54 const int a = (1 <<
shift) - x;
70 int Rf,
int Gf,
int Bf)
116 const int Rf =
rgb.x & ((1 <<
shift) - 1);
117 const int Gf =
rgb.y & ((1 <<
shift) - 1);
118 const int Bf =
rgb.z & ((1 <<
shift) - 1);
131 const int xi = (1 <<
shift) - x;
140 const int xi = (1 <<
shift) - x;
152 const int Ix = ipt.
x >> Ishift;
153 const int Px = ipt.
y >> Cshift;
154 const int Tx = ipt.
z >> Cshift;
155 const int If = ipt.
x & ((1 << Ishift) - 1);
156 const int Pf = ipt.
y & ((1 << Cshift) - 1);
157 const int Tf = ipt.
z & ((1 << Cshift) - 1);
184 const int Ix = ipt.
x >>
shift;
185 const int If = ipt.
x & ((1 <<
shift) - 1);
190 const int base = (1 << 15) -
w.y;
193 ipt.
y =
base + (ipt.
y *
w.y >> 15);
194 ipt.
z =
base + (ipt.
z *
w.y >> 15);
224 if (!new_src || !lut3d->
dynamic)
235 int in_stride, uint8_t *
out,
int out_stride,
239 const uint16_t *in16 = (
const uint16_t *) in;
240 uint16_t *out16 = (uint16_t *)
out;
242 for (
int x = 0; x <
w; x++) {
243 v3u16_t c = { in16[0], in16[1], in16[2] };
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define flags(name, subs,...)
#define xi(width, name, var, range_min, range_max, subs,...)
int ff_sws_color_map_generate_static(v3u16_t *lut, int size, const SwsColorMap *map)
Generates a single end-to-end color mapping 3DLUT embedding a static tone mapping curve.
void ff_sws_tone_map_generate(v2u16_t *lut, int size, const SwsColorMap *map)
Generate a 1D LUT of size size adapting intensity (I) levels from the source to the destination color...
int ff_sws_color_map_generate_dynamic(v3u16_t *input, v3u16_t *output, int size_input, int size_I, int size_PT, const SwsColorMap *map)
Generates a split pair of 3DLUTS, going to IPT and back, allowing an arbitrary dynamic EETF to be nes...
const VDPAUPixFmtMap * map
static int shift(int a, int b)
Macro definitions for various function/variable attributes.
static av_always_inline v3u16_t lookup_output(const SwsLut3D *lut3d, v3u16_t ipt)
static av_always_inline v3u16_t lerp3u16(v3u16_t a, v3u16_t b, int x, int shift)
SwsLut3D * ff_sws_lut3d_alloc(void)
Allocates a refstruct.
static av_always_inline v3u16_t lookup_input16(const SwsLut3D *lut3d, v3u16_t rgb)
static av_always_inline v3u16_t apply_tone_map(const SwsLut3D *lut3d, v3u16_t ipt)
static av_always_inline v3u16_t barycentric(int shift, int x, int y, int z, v3u16_t v0, v3u16_t v1, v3u16_t v2, v3u16_t v3)
v0 and v1 are 'black' and 'white' v2 and v3 are closest RGB/CMY vertices x >= y >= z are relative wei...
void ff_sws_lut3d_update(SwsLut3D *lut3d, const SwsColor *new_src)
Update the tone mapping state.
static av_always_inline v2u16_t lerp2u16(v2u16_t a, v2u16_t b, int x, int shift)
Note: These functions are scaled such that x == (1 << shift) corresponds to a value of 1....
void ff_sws_lut3d_apply_rgba64(const SwsLut3D *lut3d, const uint8_t *in, int in_stride, uint8_t *out, int out_stride, int w, int h)
Applies a color transformation to a plane in RGBA64 format.
int ff_sws_lut3d_generate(SwsLut3D *lut3d, const SwsColorMap *map)
Recalculate the (static) 3DLUT state with new settings.
static av_always_inline v3u16_t tetrahedral(const SwsLut3D *lut3d, int Rx, int Gx, int Bx, int Rf, int Gf, int Bf)
Memory handling functions.
static void * av_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(AVRefStructOpaque opaque, void *obj))
A wrapper around av_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
#define AV_REFSTRUCT_FLAG_NO_ZEROING
If this flag is set in av_refstruct_alloc_ext_c(), the object will not be initially zeroed.
Append a set of operations for applying a gamut/tone mapping 3D LUT to the pixels.
v3u16_t output[OUTPUT_LUT_SIZE_PT][OUTPUT_LUT_SIZE_PT][OUTPUT_LUT_SIZE_I]
v3u16_t input[INPUT_LUT_SIZE][INPUT_LUT_SIZE][INPUT_LUT_SIZE]
v2u16_t tone_map[TONE_LUT_SIZE+1]