Go to the documentation of this file.
31 #define pixel uint16_t
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;
57 const int slice_start = (
out->height * jobnr) / nb_jobs;
58 const int slice_end = (
out->height * (jobnr+1)) / nb_jobs;
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;
175 const int slice_start = (
out->height * jobnr) / nb_jobs;
176 const int slice_end = (
out->height * (jobnr+1)) / nb_jobs;
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];
181 const uint8_t *srcrow = in->
data[0] + slice_start * in->
linesize[0];
182 uint8_t *dstrow =
out->data[0] + slice_start *
out->linesize[0];
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];
This structure describes decoded (raw) audio or video data.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
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)
static void preservel(float *r, float *g, float *b, float l)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
static float lerpf(float v0, float v1, float f)
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 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)
#define i(width, name, range_min, range_max)
Used for passing data between threads.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...