|
FFmpeg
|
#include <ops.h>
Data Fields | |
| const SwsLut3D * | lut |
| Reference to the external LUT3D to apply. | |
| bool | dynamic |
| const SwsLut3D* SwsLut3dOp::lut |
Reference to the external LUT3D to apply.
This is managed by the caller, and must remain valid for the lifetime of the SwsOp and any compiled functions derived from it.
*lut is never dereferenced by the SwsOp code itself, only at runtime by the actual dispatched implementation, and may be freely modified even after op compilation to place new values for dynamic tone-mapping.
The reference algorithm for this operation lives in lut3d.c, and includes a tetrahedral interpolation component for the input LUT, and then an optional linear tone mapping LUT plus trilinear output LUT (when lut->dynamic is true).
All linear interpolations are performed in the pixel value's native representation, even though the LUTs themselves are stored as unsigned packed 16-bit integers. The input value range is assumed to be scaled and clamped to the LUT's domain (i.e. [0, INPUT_LUT_SIZE - 1]), and the output value range will be [0, 2^16-1], except for the alpha channel, which is passed through untouched.