[FFmpeg-devel] [PATCH v2 09/13] lavc: set color_ranges for YUVJ-only codecs

Niklas Haas ffmpeg at haasn.xyz
Fri Oct 13 17:24:47 EEST 2023


From: Niklas Haas <git at haasn.dev>

Only affects amv and roqvideo. (mjpeg is handled separately by fftools)
---
 libavcodec/mjpegenc.c    | 3 +++
 libavcodec/roqvideoenc.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 508772987f..c827a47e59 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -685,6 +685,9 @@ const FFCodec ff_amv_encoder = {
     .p.pix_fmts     = (const enum AVPixelFormat[]) {
         AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE
     },
+    .p.color_ranges = (const enum AVColorRange[]) {
+        AVCOL_RANGE_JPEG, AVCOL_RANGE_UNSPECIFIED
+    },
     .p.priv_class   = &amv_class,
     .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
 };
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 0933abf4f9..b584ee1142 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -1127,6 +1127,8 @@ const FFCodec ff_roq_encoder = {
     .close                = roq_encode_end,
     .p.pix_fmts           = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ444P,
                                                         AV_PIX_FMT_NONE },
+    .p.color_ranges       = (const enum AVColorRange[]){ AVCOL_RANGE_JPEG,
+                                                        AVCOL_RANGE_UNSPECIFIED },
     .p.priv_class   = &roq_class,
     .caps_internal        = FF_CODEC_CAP_INIT_CLEANUP,
 };
-- 
2.42.0



More information about the ffmpeg-devel mailing list