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 4b42530309 avcodec/hevc/hevcdec: don't re-apply a stale alternative 
transfer SEI
4b42530309 is described below

commit 4b425303099fd9a8965f1623c4d4bfd478727585
Author:     smp79 <[email protected]>
AuthorDate: Tue Oct 20 23:14:28 2026 +0300
Commit:     Peter Ross <[email protected]>
CommitDate: Tue Nov 10 19:43:55 2026 +0000

    avcodec/hevc/hevcdec: don't re-apply a stale alternative transfer SEI
    
    The alternative transfer characteristics SEI is parsed into
    sei.common.alternative_transfer, and export_stream_params_from_sei()
    applies it to avctx->color_trc at every frame start. However
    ff_h2645_sei_reset() never clears that state, so once such an SEI
    has been seen it keeps overriding color_trc for the rest of the
    decode.
    
    When the active SPS later changes to one without a colour
    description, export_stream_params() resets primaries, transfer and
    matrix to unspecified, and the stale SEI then restores the old
    transfer characteristics.
    
    Clear the pending SEI after exporting it during frame start, once the
    frame's SPS parameters have been applied. Keep the shared export
    helper non-consuming: extradata processing calls it before first-frame
    SPS activation, and AVDISCARD_ALL can export SPS parameters again for
    each packet. Clearing the flag in those paths would lose an SEI that
    still applies to the sequence.
    
    Add a FATE test with an HLG section followed by an SDR section.
    
    Signed-off-by: Sergey Philippov <[email protected]>
---
 libavcodec/hevc/hevcdec.c         |  1 +
 tests/fate/hevc.mak               |  3 +++
 tests/ref/fate/hevc-atc-sei-reset | 40 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 83fbdef9ba..0934f64096 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -4161,6 +4161,7 @@ static int hevc_frame_start(HEVCContext *s, 
HEVCLayerContext *l,
     ret = export_stream_params_from_sei(s);
     if (ret < 0)
         return ret;
+    s->sei.common.alternative_transfer.present = 0;
 
     ret = ff_hevc_set_new_ref(s, l, s->poc);
     if (ret < 0)
diff --git a/tests/fate/hevc.mak b/tests/fate/hevc.mak
index 9ae21af24a..4dac1a2b4b 100644
--- a/tests/fate/hevc.mak
+++ b/tests/fate/hevc.mak
@@ -276,6 +276,9 @@ fate-hevc-extradata-reload: CMD = framemd5 -i 
$(TARGET_SAMPLES)/hevc/extradata-r
 fate-hevc-paired-fields: CMD = probeframes -show_entries 
frame=interlaced_frame,top_field_first $(TARGET_SAMPLES)/hevc/paired_fields.hevc
 FATE_HEVC_FFPROBE-$(call DEMDEC, HEVC, HEVC) += fate-hevc-paired-fields
 
+fate-hevc-atc-sei-reset: CMD = probeframes -show_entries 
frame=color_primaries,color_transfer,color_space 
$(TARGET_SAMPLES)/hevc/atc-sei-reset.hevc
+FATE_HEVC_FFPROBE-$(call PARSERDEMDEC, HEVC, HEVC, HEVC) += 
fate-hevc-atc-sei-reset
+
 fate-hevc-monochrome-crop: CMD = probeframes -show_entries 
frame=width,height:stream=width,height 
$(TARGET_SAMPLES)/hevc/hevc-monochrome.hevc
 FATE_HEVC_FFPROBE-$(call PARSERDEMDEC, HEVC, HEVC, HEVC) += 
fate-hevc-monochrome-crop
 
diff --git a/tests/ref/fate/hevc-atc-sei-reset 
b/tests/ref/fate/hevc-atc-sei-reset
new file mode 100644
index 0000000000..7a181458b2
--- /dev/null
+++ b/tests/ref/fate/hevc-atc-sei-reset
@@ -0,0 +1,40 @@
+[FRAME]
+color_space=bt2020nc
+color_primaries=bt2020
+color_transfer=arib-std-b67
+[/FRAME]
+[FRAME]
+color_space=bt2020nc
+color_primaries=bt2020
+color_transfer=arib-std-b67
+[/FRAME]
+[FRAME]
+color_space=bt2020nc
+color_primaries=bt2020
+color_transfer=arib-std-b67
+[/FRAME]
+[FRAME]
+color_space=bt2020nc
+color_primaries=bt2020
+color_transfer=arib-std-b67
+[/FRAME]
+[FRAME]
+color_space=unknown
+color_primaries=unknown
+color_transfer=unknown
+[/FRAME]
+[FRAME]
+color_space=unknown
+color_primaries=unknown
+color_transfer=unknown
+[/FRAME]
+[FRAME]
+color_space=unknown
+color_primaries=unknown
+color_transfer=unknown
+[/FRAME]
+[FRAME]
+color_space=unknown
+color_primaries=unknown
+color_transfer=unknown
+[/FRAME]

-- 
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