]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_hflip.c
fate: split off Ut Video codec FATE tests into their own file
[ffmpeg] / libavfilter / vf_hflip.c
index 3c1c3e347e3aa05d05eb2a0b5f5787947a19daeb..fb8911f85133e0aa8f1df9b20af13ec492052c50 100644 (file)
@@ -2,31 +2,32 @@
  * Copyright (c) 2007 Benoit Fouet
  * Copyright (c) 2010 Stefano Sabatini
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /**
- * @flip
+ * @file
  * horizontal flip filter
  */
 
 #include "avfilter.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/imgutils.h"
 
 typedef struct {
     int max_step[4];    ///< max pixel step for each plane, expressed as a number of bytes
@@ -37,6 +38,7 @@ static int query_formats(AVFilterContext *ctx)
 {
     static const enum PixelFormat pix_fmts[] = {
         PIX_FMT_RGB48BE,      PIX_FMT_RGB48LE,
+        PIX_FMT_BGR48BE,      PIX_FMT_BGR48LE,
         PIX_FMT_ARGB,         PIX_FMT_RGBA,
         PIX_FMT_ABGR,         PIX_FMT_BGRA,
         PIX_FMT_RGB24,        PIX_FMT_BGR24,
@@ -68,15 +70,8 @@ static int config_props(AVFilterLink *inlink)
 {
     FlipContext *flip = inlink->dst->priv;
     const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format];
-    int i;
-
-    memset(flip->max_step, 0, sizeof(flip->max_step));
-    for (i = 0; i < 4; i++) {
-        const AVComponentDescriptor *comp = &(pix_desc->comp[i]);
-        if ((comp->step_minus1+1) > flip->max_step[comp->plane])
-            flip->max_step[comp->plane] = comp->step_minus1+1;
-    }
 
+    av_image_fill_max_pixsteps(flip->max_step, NULL, pix_desc);
     flip->hsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_w;
     flip->vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h;