summaryrefslogtreecommitdiff
path: root/libavfilter/vf_hflip.c
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2017-12-11 11:22:56 +0100
committerMartin Vignali <martin.vignali@gmail.com>2017-12-13 11:34:24 +0100
commit46f534bdee3439a1a803392b83fb867fcbc0adce (patch)
tree2c1f5953409a62091838c29df4804e3cb6f5e7b3 /libavfilter/vf_hflip.c
parent88e2dc7d0448d1d4656c78454bc5f17063b867e7 (diff)
avfilter/vf_hflip : move context func init in ff_hflip_init
Diffstat (limited to 'libavfilter/vf_hflip.c')
-rw-r--r--libavfilter/vf_hflip.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c
index 957ddd9900..b77afc77fc 100644
--- a/libavfilter/vf_hflip.c
+++ b/libavfilter/vf_hflip.c
@@ -131,7 +131,7 @@ static int config_props(AVFilterLink *inlink)
const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
const int hsub = pix_desc->log2_chroma_w;
const int vsub = pix_desc->log2_chroma_h;
- int nb_planes, i;
+ int nb_planes;
av_image_fill_max_pixsteps(s->max_step, NULL, pix_desc);
s->planewidth[0] = s->planewidth[3] = inlink->w;
@@ -141,8 +141,15 @@ static int config_props(AVFilterLink *inlink)
nb_planes = av_pix_fmt_count_planes(inlink->format);
+ return ff_hflip_init(s, s->max_step, nb_planes);
+}
+
+int ff_hflip_init(FlipContext *s, int step[4], int nb_planes)
+{
+ int i;
+
for (i = 0; i < nb_planes; i++) {
- switch (s->max_step[i]) {
+ switch (step[i]) {
case 1: s->flip_line[i] = hflip_byte_c; break;
case 2: s->flip_line[i] = hflip_short_c; break;
case 3: s->flip_line[i] = hflip_b24_c; break;
@@ -153,9 +160,8 @@ static int config_props(AVFilterLink *inlink)
return AVERROR_BUG;
}
}
-
if (ARCH_X86)
- ff_hflip_init_x86(s, s->max_step, nb_planes);
+ ff_hflip_init_x86(s, step, nb_planes);
return 0;
}