[FFmpeg-devel,1/3] avcodec/h2645_sei: move some common SEI syncing code to ff_h2645_sei_ctx_replace()

Message ID 20241112172244.1528-1-jamrial@gmail.com
State New
Headers
Series [FFmpeg-devel,1/3] avcodec/h2645_sei: move some common SEI syncing code to ff_h2645_sei_ctx_replace() |

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

James Almer Nov. 12, 2024, 5:22 p.m. UTC
Instead of duplicating it across all supported decoders.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/h2645_sei.c    | 3 +++
 libavcodec/h264_slice.c   | 2 --
 libavcodec/hevc/hevcdec.c | 2 --
 3 files changed, 3 insertions(+), 4 deletions(-)
  

Patch

diff --git a/libavcodec/h2645_sei.c b/libavcodec/h2645_sei.c
index 62369dd37f..986d1d250a 100644
--- a/libavcodec/h2645_sei.c
+++ b/libavcodec/h2645_sei.c
@@ -556,6 +556,9 @@  int ff_h2645_sei_ctx_replace(H2645SEI *dst, const H2645SEI *src)
     }
     dst->aom_film_grain.enable = src->aom_film_grain.enable;
 
+    dst->mastering_display     = src->mastering_display;
+    dst->content_light         = src->content_light;
+
     ff_refstruct_replace(&dst->film_grain_characteristics,
                           src->film_grain_characteristics);
 
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 84595b1a8b..08376ffa6d 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -442,8 +442,6 @@  int ff_h264_update_thread_context(AVCodecContext *dst,
         return ret;
 
     h->sei.common.unregistered.x264_build = h1->sei.common.unregistered.x264_build;
-    h->sei.common.mastering_display = h1->sei.common.mastering_display;
-    h->sei.common.content_light = h1->sei.common.content_light;
 
     if (!h->cur_pic_ptr)
         return 0;
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 19080255cb..fe8897fb6e 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -4003,8 +4003,6 @@  static int hevc_update_thread_context(AVCodecContext *dst,
     s->sei.common.frame_packing        = s0->sei.common.frame_packing;
     s->sei.common.display_orientation  = s0->sei.common.display_orientation;
     s->sei.common.alternative_transfer = s0->sei.common.alternative_transfer;
-    s->sei.common.mastering_display    = s0->sei.common.mastering_display;
-    s->sei.common.content_light        = s0->sei.common.content_light;
     s->sei.tdrdi                       = s0->sei.tdrdi;
 
     return 0;