1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/vf_gblur: properly round output

This commit is contained in:
Paul B Mahol 2022-06-23 14:47:29 +02:00
parent fed07efcde
commit 5a4ffb4f5e

View File

@ -280,17 +280,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
width * sizeof(float), height);
} else if (s->depth == 8) {
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
dst[x] = bptr[x];
}
for (x = 0; x < width; x++)
dst[x] = lrintf(bptr[x]);
bptr += width;
dst += out->linesize[plane];
}
} else {
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
dst16[x] = bptr[x];
}
for (x = 0; x < width; x++)
dst16[x] = lrintf(bptr[x]);
bptr += width;
dst16 += out->linesize[plane] / 2;
}