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

Git pushed a commit to branch release/8.0
in repository ffmpeg.

commit a635df770f0c0bd6e0ad3d06cac8c5d7d6982525
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Sun Nov 2 16:00:06 2025 +0100
Commit:     James Almer <[email protected]>
CommitDate: Sun Jan 11 20:31:58 2026 -0300

    avcodec/decode: Put lcevc fields into structure of their own
    
    Makes it easier to see that width and height in DecodeContext is
    actually a lcevc field.
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
    (cherry picked from commit 2786e5a9ad32920fccee9352161e81c8e733563b)
---
 libavcodec/decode.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 2178931758..d88d245f3d 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -93,10 +93,12 @@ typedef struct DecodeContext {
      */
     uint64_t side_data_pref_mask;
 
-    FFLCEVCContext *lcevc;
-    int lcevc_frame;
-    int width;
-    int height;
+    struct {
+        FFLCEVCContext *ctx;
+        int frame;
+        int width;
+        int height;
+    } lcevc;
 } DecodeContext;
 
 static DecodeContext *decode_ctx(AVCodecInternal *avci)
@@ -1576,12 +1578,12 @@ static void update_frame_props(AVCodecContext *avctx, 
AVFrame *frame)
     AVCodecInternal    *avci = avctx->internal;
     DecodeContext        *dc = decode_ctx(avci);
 
-    dc->lcevc_frame = dc->lcevc && avctx->codec_type == AVMEDIA_TYPE_VIDEO &&
+    dc->lcevc.frame = dc->lcevc.ctx && avctx->codec_type == AVMEDIA_TYPE_VIDEO 
&&
                       av_frame_get_side_data(frame, AV_FRAME_DATA_LCEVC);
 
-    if (dc->lcevc_frame) {
-        dc->width     = frame->width;
-        dc->height    = frame->height;
+    if (dc->lcevc.frame) {
+        dc->lcevc.width  = frame->width;
+        dc->lcevc.height = frame->height;
         frame->width  = frame->width  * 2 / 
FFMAX(frame->sample_aspect_ratio.den, 1);
         frame->height = frame->height * 2 / 
FFMAX(frame->sample_aspect_ratio.num, 1);
     }
@@ -1592,7 +1594,7 @@ static int attach_post_process_data(AVCodecContext 
*avctx, AVFrame *frame)
     AVCodecInternal    *avci = avctx->internal;
     DecodeContext        *dc = decode_ctx(avci);
 
-    if (dc->lcevc_frame) {
+    if (dc->lcevc.frame) {
         FrameDecodeData *fdd = frame->private_ref;
         FFLCEVCFrame *frame_ctx;
         int ret;
@@ -1607,13 +1609,13 @@ static int attach_post_process_data(AVCodecContext 
*avctx, AVFrame *frame)
             return AVERROR(ENOMEM);
         }
 
-        frame_ctx->lcevc = av_refstruct_ref(dc->lcevc);
+        frame_ctx->lcevc = av_refstruct_ref(dc->lcevc.ctx);
         frame_ctx->frame->width  = frame->width;
         frame_ctx->frame->height = frame->height;
         frame_ctx->frame->format = frame->format;
 
-        frame->width  = dc->width;
-        frame->height = dc->height;
+        frame->width  = dc->lcevc.width;
+        frame->height = dc->lcevc.height;
 
         ret = avctx->get_buffer2(avctx, frame_ctx->frame, 0);
         if (ret < 0) {
@@ -1627,7 +1629,7 @@ static int attach_post_process_data(AVCodecContext 
*avctx, AVFrame *frame)
         fdd->post_process_opaque_free = ff_lcevc_unref;
         fdd->post_process = ff_lcevc_process;
     }
-    dc->lcevc_frame = 0;
+    dc->lcevc.frame = 0;
 
     return 0;
 }
@@ -1996,7 +1998,7 @@ int ff_decode_preinit(AVCodecContext *avctx)
 
     if (!(avctx->export_side_data & AV_CODEC_EXPORT_DATA_ENHANCEMENTS)) {
         if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
-            ret = ff_lcevc_alloc(&dc->lcevc);
+            ret = ff_lcevc_alloc(&dc->lcevc.ctx);
             if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
                 return ret;
         }
@@ -2239,7 +2241,7 @@ void ff_decode_internal_sync(AVCodecContext *dst, const 
AVCodecContext *src)
 
     dst_dc->initial_pict_type = src_dc->initial_pict_type;
     dst_dc->intra_only_flag   = src_dc->intra_only_flag;
-    av_refstruct_replace(&dst_dc->lcevc, src_dc->lcevc);
+    av_refstruct_replace(&dst_dc->lcevc.ctx, src_dc->lcevc.ctx);
 }
 
 void ff_decode_internal_uninit(AVCodecContext *avctx)
@@ -2247,5 +2249,5 @@ void ff_decode_internal_uninit(AVCodecContext *avctx)
     AVCodecInternal *avci = avctx->internal;
     DecodeContext *dc = decode_ctx(avci);
 
-    av_refstruct_unref(&dc->lcevc);
+    av_refstruct_unref(&dc->lcevc.ctx);
 }

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to