[FFmpeg-devel] [PATCH 20/23] avfilter/vf_blackdetect: use color_range from inlink

Paul B Mahol onemda at gmail.com
Tue Dec 12 15:56:18 EET 2017


Remove YUVJ pixel format usage.

Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavfilter/vf_blackdetect.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c
index 06ef9988d1..ff4b9eebb9 100644
--- a/libavfilter/vf_blackdetect.c
+++ b/libavfilter/vf_blackdetect.c
@@ -61,13 +61,6 @@ static const AVOption blackdetect_options[] = {
 
 AVFILTER_DEFINE_CLASS(blackdetect);
 
-#define YUVJ_FORMATS \
-    AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P
-
-static const enum AVPixelFormat yuvj_formats[] = {
-    YUVJ_FORMATS, AV_PIX_FMT_NONE
-};
-
 static int query_formats(AVFilterContext *ctx)
 {
     static const enum AVPixelFormat pix_fmts[] = {
@@ -76,7 +69,6 @@ static int query_formats(AVFilterContext *ctx)
         AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
         AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
         AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
-        YUVJ_FORMATS,
         AV_PIX_FMT_NONE
     };
 
@@ -94,7 +86,7 @@ static int config_input(AVFilterLink *inlink)
     blackdetect->black_min_duration =
         blackdetect->black_min_duration_time / av_q2d(inlink->time_base);
 
-    blackdetect->pixel_black_th_i = ff_fmt_is_in(inlink->format, yuvj_formats) ?
+    blackdetect->pixel_black_th_i = inlink->color_range == AVCOL_RANGE_JPEG ?
         // luminance_minimum_value + pixel_black_th * luminance_range_size
              blackdetect->pixel_black_th *  255 :
         16 + blackdetect->pixel_black_th * (235 - 16);
-- 
2.11.0



More information about the ffmpeg-devel mailing list