avfilter/vf_chromanr: Fix shadowing

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2026-02-24 01:18:31 +01:00
parent 380e1cdb0c
commit 2d9cf94283

View File

@@ -80,6 +80,27 @@ static int distance ## _slice##name(AVFilterContext *ctx, void *arg,
ChromaNRContext *s = ctx->priv; \
AVFrame *in = arg; \
AVFrame *out = s->out; \
\
{ \
const int h = s->planeheight[0]; \
const int slice_start = (h * jobnr) / nb_jobs; \
const int slice_end = (h * (jobnr+1)) / nb_jobs; \
\
av_image_copy_plane(out->data[0] + slice_start * out->linesize[0], \
out->linesize[0], \
in->data[0] + slice_start * in->linesize[0], \
in->linesize[0], \
s->linesize[0], slice_end - slice_start); \
\
if (s->nb_planes == 4) { \
av_image_copy_plane(out->data[3] + slice_start * out->linesize[3], \
out->linesize[3], \
in->data[3] + slice_start * in->linesize[3], \
in->linesize[3], \
s->linesize[3], slice_end - slice_start); \
} \
} \
\
const int in_ylinesize = in->linesize[0]; \
const int in_ulinesize = in->linesize[1]; \
const int in_vlinesize = in->linesize[2]; \
@@ -102,26 +123,6 @@ static int distance ## _slice##name(AVFilterContext *ctx, void *arg,
type *out_uptr = (type *)(out->data[1] + slice_start * out_ulinesize); \
type *out_vptr = (type *)(out->data[2] + slice_start * out_vlinesize); \
\
{ \
const int h = s->planeheight[0]; \
const int slice_start = (h * jobnr) / nb_jobs; \
const int slice_end = (h * (jobnr+1)) / nb_jobs; \
\
av_image_copy_plane(out->data[0] + slice_start * out->linesize[0], \
out->linesize[0], \
in->data[0] + slice_start * in->linesize[0], \
in->linesize[0], \
s->linesize[0], slice_end - slice_start); \
\
if (s->nb_planes == 4) { \
av_image_copy_plane(out->data[3] + slice_start * out->linesize[3], \
out->linesize[3], \
in->data[3] + slice_start * in->linesize[3], \
in->linesize[3], \
s->linesize[3], slice_end - slice_start); \
} \
} \
\
for (int y = slice_start; y < slice_end; y++) { \
const type *in_yptr = (const type *)(in->data[0] + y * chroma_h * in_ylinesize); \
const type *in_uptr = (const type *)(in->data[1] + y * in_ulinesize); \
@@ -140,14 +141,14 @@ static int distance ## _slice##name(AVFilterContext *ctx, void *arg,
int cn = 1; \
\
for (int yy = yystart; yy <= yystop; yy += steph) { \
const type *in_yptr = (const type *)(in->data[0] + yy * chroma_h * in_ylinesize); \
const type *in_uptr = (const type *)(in->data[1] + yy * in_ulinesize); \
const type *in_vptr = (const type *)(in->data[2] + yy * in_vlinesize); \
const type *in_y = (const type *)(in->data[0] + yy * chroma_h * in_ylinesize); \
const type *in_u = (const type *)(in->data[1] + yy * in_ulinesize); \
const type *in_v = (const type *)(in->data[2] + yy * in_vlinesize); \
\
for (int xx = xxstart; xx <= xxstop; xx += stepw) { \
const ctype Y = in_yptr[xx * chroma_w]; \
const ctype U = in_uptr[xx]; \
const ctype V = in_vptr[xx]; \
const ctype Y = in_y[xx * chroma_w]; \
const ctype U = in_u[xx]; \
const ctype V = in_v[xx]; \
const ctype cyY = FFABS(cy - Y); \
const ctype cuU = FFABS(cu - U); \
const ctype cvV = FFABS(cv - V); \