1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avfilter/vf_feedback: fix artifacts with subsampled chroma

This commit is contained in:
Paul B Mahol 2023-05-09 00:40:32 +02:00
parent 21a0b6bca8
commit 90096dd042

View File

@ -163,11 +163,11 @@ static int activate(AVFilterContext *ctx)
src->data[0] + y * src->linesize[0], src->width * s->max_step[0]);
}
for (int i = 1; i < 3; i ++) {
for (int i = 1; i < 3; i++) {
if (dst->data[i]) {
for (int y = 0; y < src->height; y++) {
memmove(dst->data[i] + ((s->y + y) >> s->vsub) * dst->linesize[i] + ((s->x * s->max_step[i]) >> s->hsub),
src->data[i] + (y >> s->vsub) * src->linesize[i], (src->width * s->max_step[i]) >> s->hsub);
memmove(dst->data[i] + ((s->y + y) >> s->vsub) * dst->linesize[i] + (s->x >> s->hsub) * s->max_step[i],
src->data[i] + (y >> s->vsub) * src->linesize[i], (src->width >> s->hsub) * s->max_step[i]);
}
}
}
@ -213,7 +213,7 @@ static int activate(AVFilterContext *ctx)
for (int i = 1; i < 3; i ++) {
if (frame->data[i]) {
frame->data[i] += (s->y >> s->vsub) * frame->linesize[i];
frame->data[i] += (s->x * s->max_step[i]) >> s->hsub;
frame->data[i] += (s->x >> s->hsub) * s->max_step[i];
}
}