[FFmpeg-cvslog] lavfi/vmafmotion: Allow more pix_fmts.

Carl Eugen Hoyos git at videolan.org
Sun Oct 1 21:54:28 EEST 2017


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Sat Sep 30 21:39:08 2017 +0200| [59924d5eb11646f82f70c206be8a867468f102b9] | committer: Carl Eugen Hoyos

lavfi/vmafmotion: Allow more pix_fmts.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=59924d5eb11646f82f70c206be8a867468f102b9
---

 libavfilter/vf_vmafmotion.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c
index 6b6150a931..9bcc4ff16f 100644
--- a/libavfilter/vf_vmafmotion.c
+++ b/libavfilter/vf_vmafmotion.c
@@ -261,15 +261,19 @@ int ff_vmafmotion_init(VMAFMotionData *s,
 
 static int query_formats(AVFilterContext *ctx)
 {
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
-        AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10,
-        AV_PIX_FMT_NONE
-    };
-
-    AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
-    if (!fmts_list)
-        return AVERROR(ENOMEM);
+    AVFilterFormats *fmts_list = NULL;
+    int format, ret;
+
+    for (format = 0; av_pix_fmt_desc_get(format); format++) {
+        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
+        if (!(desc->flags & (AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_PAL)) &&
+            (desc->flags & AV_PIX_FMT_FLAG_PLANAR || desc->nb_components == 1) &&
+            (!(desc->flags & AV_PIX_FMT_FLAG_BE) == !HAVE_BIGENDIAN || desc->comp[0].depth == 8) &&
+            (desc->comp[0].depth == 8 || desc->comp[0].depth == 10) &&
+            (ret = ff_add_format(&fmts_list, format)) < 0)
+            return ret;
+    }
+
     return ff_set_common_formats(ctx, fmts_list);
 }
 



More information about the ffmpeg-cvslog mailing list