X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_hflip.c;h=2a0defda6c4c08b1318fddeb84025ce5e7567a4d;hb=a04ad248a05e7b613abe09b3bb067f555108d794;hp=b77afc77fc9ec343ad76348cbc3ed95aa24cfa85;hpb=ebdc5c419aef0d9eed8c1ec57b30238194c1db0a;p=ffmpeg diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c index b77afc77fc9..2a0defda6c4 100644 --- a/libavfilter/vf_hflip.c +++ b/libavfilter/vf_hflip.c @@ -138,6 +138,7 @@ static int config_props(AVFilterLink *inlink) s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, hsub); s->planeheight[0] = s->planeheight[3] = inlink->h; s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, vsub); + s->bayer_plus1 = !!(pix_desc->flags & AV_PIX_FMT_FLAG_BAYER) + 1; nb_planes = av_pix_fmt_count_planes(inlink->format); @@ -149,6 +150,7 @@ int ff_hflip_init(FlipContext *s, int step[4], int nb_planes) int i; for (i = 0; i < nb_planes; i++) { + step[i] *= s->bayer_plus1; switch (step[i]) { case 1: s->flip_line[i] = hflip_byte_c; break; case 2: s->flip_line[i] = hflip_short_c; break; @@ -180,7 +182,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs) int i, plane, step; for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) { - const int width = s->planewidth[plane]; + const int width = s->planewidth[plane] / s->bayer_plus1; const int height = s->planeheight[plane]; const int start = (height * job ) / nb_jobs; const int end = (height * (job+1)) / nb_jobs; @@ -243,7 +245,7 @@ static const AVFilterPad avfilter_vf_hflip_outputs[] = { { NULL } }; -AVFilter ff_vf_hflip = { +const AVFilter ff_vf_hflip = { .name = "hflip", .description = NULL_IF_CONFIG_SMALL("Horizontally flip the input video."), .priv_size = sizeof(FlipContext),