44#define fn3(a,b) a##_##b
45#define fn2(a,b) fn3(a,b)
46#define fn(a) fn2(a, DEPTH)
49 int have_alpha,
int depth,
int pc)
55 const float pa =
s->preserve_amount;
56 const float max = (1 << depth) - 1;
69 for (
int j = 0; j <
out->width; j++) {
70 const pixel rin = srcr[j];
71 const pixel gin = srcg[j];
72 const pixel bin = srcb[j];
73 const pixel ain = have_alpha ? srca[j] : 0;
80 (have_alpha == 1 ?
s->ra * ain : 0);
84 (have_alpha == 1 ?
s->ga * ain : 0);
88 (have_alpha == 1 ?
s->ba * ain : 0);
90 rout =
s->lut[
R][
R][rin] +
93 (have_alpha == 1 ?
s->lut[
R][
A][ain] : 0);
94 gout =
s->lut[
G][
R][rin] +
97 (have_alpha == 1 ?
s->lut[
G][
A][ain] : 0);
98 bout =
s->lut[
B][
R][rin] +
101 (have_alpha == 1 ?
s->lut[
B][
A][ain] : 0);
105 float frout, fgout, fbout, lin, lout;
118 rout, gout, bout,
max, &lin, &lout);
136 if (have_alpha == 1) {
141 s->lut[
A][
A][ain], depth);
143 dsta[j] =
s->ar * rin +
155 dstg +=
out->linesize[0] /
sizeof(
pixel);
156 dstb +=
out->linesize[1] /
sizeof(
pixel);
157 dstr +=
out->linesize[2] /
sizeof(
pixel);
158 dsta +=
out->linesize[3] /
sizeof(
pixel);
167 int have_alpha,
int step,
int pc,
int depth)
173 const float pa =
s->preserve_amount;
174 const float max = (1 << depth) - 1;
177 const uint8_t roffset =
s->rgba_map[
R];
178 const uint8_t goffset =
s->rgba_map[
G];
179 const uint8_t boffset =
s->rgba_map[
B];
180 const uint8_t aoffset =
s->rgba_map[
A];
189 for (j = 0; j <
out->width * step; j += step) {
194 int rout, gout, bout;
196 rout =
s->lut[
R][
R][rin] +
199 (have_alpha == 1 ?
s->lut[
R][
A][ain] : 0);
200 gout =
s->lut[
G][
R][rin] +
203 (have_alpha == 1 ?
s->lut[
G][
A][ain] : 0);
204 bout =
s->lut[
B][
R][rin] +
207 (have_alpha == 1 ?
s->lut[
B][
A][ain] : 0);
216 rout, gout, bout,
max, &lin, &lout);
228 if (have_alpha == 1) {
232 s->lut[
A][
A][ain], depth);
237 dstrow +=
out->linesize[0];
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define i(width, name, range_min, range_max)
static av_always_inline int fn filter_slice_rgba_packed(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int have_alpha, int step, int pc, int depth)
static av_always_inline int fn filter_slice_rgba_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int have_alpha, int depth, int pc)
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
static void preserve_color(int preserve_color, float ir, float ig, float ib, float r, float g, float b, float max, float *icolor, float *ocolor)
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Used for passing data between threads.
static AVFormatContext * ctx
static float lerpf(float v0, float v1, float f)
static void preservel(float *r, float *g, float *b, float l)
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)