This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 0b19c65afe avcodec/lcevcdec: propagate color related frame fields
0b19c65afe is described below

commit 0b19c65afeed73ce7498ae7faa8fe95530b8a6ab
Author:     James Almer <[email protected]>
AuthorDate: Fri Oct 16 14:26:22 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Fri Oct 16 14:27:26 2026 -0300

    avcodec/lcevcdec: propagate color related frame fields
    
    Signed-off-by: James Almer <[email protected]>
---
 libavcodec/lcevcdec.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/libavcodec/lcevcdec.c b/libavcodec/lcevcdec.c
index a2bda77b4a..b79401f98d 100644
--- a/libavcodec/lcevcdec.c
+++ b/libavcodec/lcevcdec.c
@@ -95,6 +95,14 @@ static int alloc_base_frame(FFLCEVCContext *lcevc,
     desc.cropRight  = frame->crop_right;
     desc.sampleAspectRatioNum  = frame->sample_aspect_ratio.num;
     desc.sampleAspectRatioDen  = frame->sample_aspect_ratio.den;
+    desc.colorRange = LCEVC_ColorRange_Unknown;
+    if (frame->color_range == AVCOL_RANGE_JPEG)
+        desc.colorRange = LCEVC_ColorRange_Full;
+    else if (frame->color_range == AVCOL_RANGE_MPEG)
+        desc.colorRange = LCEVC_ColorRange_Limited;
+    desc.colorPrimaries = (LCEVC_ColorPrimaries)frame->color_primaries;
+    desc.matrixCoefficients = (LCEVC_MatrixCoefficients)frame->colorspace;
+    desc.transferCharacteristics = 
(LCEVC_TransferCharacteristics)frame->color_trc;
 
     for (int i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
         planes[i].firstSample = frame->data[i];
@@ -235,14 +243,24 @@ static int generate_output(FFLCEVCFrame *frame_ctx, 
AVFrame *out)
     out->sample_aspect_ratio.den = desc.sampleAspectRatioDen;
     out->width = desc.width + out->crop_left + out->crop_right;
     out->height = desc.height + out->crop_top + out->crop_bottom;
+    out->color_range = AVCOL_RANGE_UNSPECIFIED;
+    if (desc.colorRange == LCEVC_ColorRange_Full)
+        out->color_range = AVCOL_RANGE_JPEG;
+    else if (desc.colorRange == LCEVC_ColorRange_Limited)
+        out->color_range = AVCOL_RANGE_MPEG;
+    out->color_primaries = (enum AVColorPrimaries)desc.colorPrimaries;
+    out->colorspace = (enum AVColorSpace)desc.matrixCoefficients;
+    out->color_trc = (enum 
AVColorTransferCharacteristic)desc.transferCharacteristics;
 
     av_log(lcevc, AV_LOG_DEBUG,  "out PTS %"PRId64", %dx%d, "
                                  "%zu/%zu/%zu/%zu, "
                                  "SAR %d:%d, "
+                                 "color_range %d, color_primaries %d, 
colorspace %d, color_trc %d, "
                                  "hasEnhancement %d, enhanced %d\n",
            out->pts, out->width, out->height,
            out->crop_top, out->crop_bottom, out->crop_left, out->crop_right,
            out->sample_aspect_ratio.num, out->sample_aspect_ratio.den,
+           out->color_range, out->color_primaries, out->colorspace, 
out->color_trc,
            info.hasEnhancement, info.enhanced);
 
     res = LCEVC_FreePicture(lcevc->decoder, picture);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to