[FFmpeg-devel,v2,3/3] lavf/f_select: make the more pixel format usable to avoid autoscale to rgb

Submitted by lance.lmwang@gmail.com on July 16, 2019, 10:58 a.m.

Details

Message ID 1563274731-21877-1-git-send-email-lance.lmwang@gmail.com
State New
Headers show

Commit Message

lance.lmwang@gmail.com July 16, 2019, 10:58 a.m.
From: Limin Wang <lance.lmwang@gmail.com>

Have tested all available pixel format in the code:
1. AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8
are tested by autoscale with the fate sample: Vertical400kbit.sorenson3.mov

pkt_pts=20040 scenecut haven't been detected for serveral format

2. AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUYV422, AV_PIX_FMT_YUV422P
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUYV42, AV_PIX_FMT_YUVJ422P
are tested with my local samples

3. AV_PIX_FMT_YUVJ420P
is tested with fate sample: Vertical400kbit.sorenson3.mov

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavfilter/f_select.c                     |  6 +++++-
 tests/ref/fate/filter-metadata-scenedetect | 16 ++++++++--------
 2 files changed, 13 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index eed8df34cb..3ec26c68c3 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -498,7 +498,11 @@  static int query_formats(AVFilterContext *ctx)
     } else {
         int ret;
         static const enum AVPixelFormat pix_fmts[] = {
-            AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
+            AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA,
+            AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8,
+            AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUYV422,
+            AV_PIX_FMT_YUV422P, AV_PIX_FMT_NV12, AV_PIX_FMT_P010,
+            AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
             AV_PIX_FMT_NONE
         };
         AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
diff --git a/tests/ref/fate/filter-metadata-scenedetect b/tests/ref/fate/filter-metadata-scenedetect
index 67c23b3c32..7ce2d6794e 100644
--- a/tests/ref/fate/filter-metadata-scenedetect
+++ b/tests/ref/fate/filter-metadata-scenedetect
@@ -1,11 +1,11 @@ 
 pkt_pts=1620|tag:lavfi.scene_score=1.000000
-pkt_pts=4140|tag:lavfi.scene_score=0.875036
-pkt_pts=5800|tag:lavfi.scene_score=1.000000
-pkt_pts=6720|tag:lavfi.scene_score=0.461625
-pkt_pts=8160|tag:lavfi.scene_score=1.000000
-pkt_pts=9760|tag:lavfi.scene_score=1.000000
-pkt_pts=14080|tag:lavfi.scene_score=0.838916
+pkt_pts=4140|tag:lavfi.scene_score=0.668643
+pkt_pts=5800|tag:lavfi.scene_score=0.996721
+pkt_pts=6720|tag:lavfi.scene_score=0.357390
+pkt_pts=8160|tag:lavfi.scene_score=0.886268
+pkt_pts=9760|tag:lavfi.scene_score=0.926219
+pkt_pts=14080|tag:lavfi.scene_score=0.650033
 pkt_pts=15700|tag:lavfi.scene_score=1.000000
-pkt_pts=18500|tag:lavfi.scene_score=0.474948
-pkt_pts=20040|tag:lavfi.scene_score=0.379700
+pkt_pts=18500|tag:lavfi.scene_score=0.316402
+pkt_pts=20040|tag:lavfi.scene_score=0.269509
 pkt_pts=21760|tag:lavfi.scene_score=1.000000