You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avfilter/vf_neighbor: simplify code little
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
@@ -165,8 +165,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
for (plane = 0; plane < s->nb_planes; plane++) {
|
||||
const int threshold = s->threshold[plane];
|
||||
|
||||
if (threshold) {
|
||||
const int stride = in->linesize[plane];
|
||||
const int dstride = out->linesize[plane];
|
||||
const uint8_t *src = in->data[plane];
|
||||
@@ -174,6 +172,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
const int height = s->planeheight[plane];
|
||||
const int width = s->planewidth[plane];
|
||||
|
||||
if (!threshold) {
|
||||
av_image_copy_plane(dst, dstride, src, stride, width, height);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
const int nh = y > 0;
|
||||
const int ph = y < height - 1;
|
||||
@@ -196,11 +199,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
src += stride;
|
||||
dst += dstride;
|
||||
}
|
||||
} else {
|
||||
av_image_copy_plane(out->data[plane], out->linesize[plane],
|
||||
in->data[plane], in->linesize[plane],
|
||||
s->planewidth[plane], s->planeheight[plane]);
|
||||
}
|
||||
}
|
||||
|
||||
av_frame_free(&in);
|
||||
|
Reference in New Issue
Block a user