[FFmpeg-cvslog] lavc/hevcdec: move HEVCContext.deblock to HEVCLayerContext

Anton Khirnov git at videolan.org
Fri Sep 6 15:25:44 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Jun  5 09:01:16 2024 +0200| [ed2d25e7f058b2c61a98c0bdd027d05ffca6869a] | committer: Anton Khirnov

lavc/hevcdec: move HEVCContext.deblock to HEVCLayerContext

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed2d25e7f058b2c61a98c0bdd027d05ffca6869a
---

 libavcodec/hevc/filter.c  |  8 ++++----
 libavcodec/hevc/hevcdec.c | 10 +++++-----
 libavcodec/hevc/hevcdec.h |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavcodec/hevc/filter.c b/libavcodec/hevc/filter.c
index 78f408f170..4d5ef631d7 100644
--- a/libavcodec/hevc/filter.c
+++ b/libavcodec/hevc/filter.c
@@ -515,8 +515,8 @@ static void deblocking_filter_CTB(const HEVCContext *s, const HEVCLayerContext *
     int ctb_size        = 1 << log2_ctb_size;
     int ctb             = (x0 >> log2_ctb_size) +
                           (y0 >> log2_ctb_size) * sps->ctb_width;
-    int cur_tc_offset   = s->deblock[ctb].tc_offset;
-    int cur_beta_offset = s->deblock[ctb].beta_offset;
+    int cur_tc_offset   = l->deblock[ctb].tc_offset;
+    int cur_beta_offset = l->deblock[ctb].beta_offset;
     int left_tc_offset, left_beta_offset;
     int tc_offset, beta_offset;
     int pcmf = (sps->pcm_enabled &&
@@ -524,8 +524,8 @@ static void deblocking_filter_CTB(const HEVCContext *s, const HEVCLayerContext *
                pps->transquant_bypass_enable_flag;
 
     if (x0) {
-        left_tc_offset   = s->deblock[ctb - 1].tc_offset;
-        left_beta_offset = s->deblock[ctb - 1].beta_offset;
+        left_tc_offset   = l->deblock[ctb - 1].tc_offset;
+        left_beta_offset = l->deblock[ctb - 1].beta_offset;
     } else {
         left_tc_offset   = 0;
         left_beta_offset = 0;
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 0bb4d43ed4..a20e559353 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -69,7 +69,7 @@ static const uint8_t hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3,
 static void pic_arrays_free(HEVCContext *s, HEVCLayerContext *l)
 {
     av_freep(&l->sao);
-    av_freep(&s->deblock);
+    av_freep(&l->deblock);
 
     av_freep(&s->skip_flag);
     av_freep(&s->tab_ct_depth);
@@ -104,8 +104,8 @@ static int pic_arrays_init(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *s
     l->bs_height = (height >> 2) + 1;
 
     l->sao           = av_calloc(ctb_count, sizeof(*l->sao));
-    s->deblock       = av_calloc(ctb_count, sizeof(*s->deblock));
-    if (!l->sao || !s->deblock)
+    l->deblock       = av_calloc(ctb_count, sizeof(*l->deblock));
+    if (!l->sao || !l->deblock)
         goto fail;
 
     s->skip_flag    = av_malloc_array(sps->min_cb_height, sps->min_cb_width);
@@ -2559,8 +2559,8 @@ static int hls_decode_entry(HEVCContext *s, GetBitContext *gb)
         hls_sao_param(lc, l, pps, sps,
                       x_ctb >> sps->log2_ctb_size, y_ctb >> sps->log2_ctb_size);
 
-        s->deblock[ctb_addr_rs].beta_offset = s->sh.beta_offset;
-        s->deblock[ctb_addr_rs].tc_offset   = s->sh.tc_offset;
+        l->deblock[ctb_addr_rs].beta_offset = s->sh.beta_offset;
+        l->deblock[ctb_addr_rs].tc_offset   = s->sh.tc_offset;
         s->filter_slice_edges[ctb_addr_rs]  = s->sh.slice_loop_filter_across_slices_enabled_flag;
 
         more_data = hls_coding_quadtree(lc, l, pps, sps, x_ctb, y_ctb, sps->log2_ctb_size, 0);
diff --git a/libavcodec/hevc/hevcdec.h b/libavcodec/hevc/hevcdec.h
index e0b026eef6..22b34924d5 100644
--- a/libavcodec/hevc/hevcdec.h
+++ b/libavcodec/hevc/hevcdec.h
@@ -445,6 +445,7 @@ typedef struct HEVCLayerContext {
     int                     bs_height;
 
     SAOParams              *sao;
+    DBParams               *deblock;
 } HEVCLayerContext;
 
 typedef struct HEVCContext {
@@ -478,7 +479,6 @@ typedef struct HEVCContext {
     const HEVCVPS *vps; ///< RefStruct reference
     const HEVCPPS *pps; ///< RefStruct reference
     SliceHeader sh;
-    DBParams *deblock;
     enum HEVCNALUnitType nal_unit_type;
     int temporal_id;  ///< temporal_id_plus1 - 1
     HEVCFrame *cur_frame;



More information about the ffmpeg-cvslog mailing list