[FFmpeg-devel] [PATCH 08/11] avcodec/vvcdec: do not zero frame cpm table

Nuo Mi nuomi2021 at gmail.com
Sun Jul 28 06:18:04 EEST 2024


---
 libavcodec/vvc/ctu.c | 15 ++++++++-------
 libavcodec/vvc/dec.c |  5 ++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
index d39dd579ae..579337759f 100644
--- a/libavcodec/vvc/ctu.c
+++ b/libavcodec/vvc/ctu.c
@@ -1080,10 +1080,15 @@ static PredMode pred_mode_decode(VVCLocalContext *lc,
         }
         if (pred_mode_ibc_flag)
             pred_mode = MODE_IBC;
-        return pred_mode;
     } else {
-        return MODE_INTRA;
+        pred_mode = MODE_INTRA;
     }
+
+    set_cb_tab(lc, fc->tab.cpm[cu->ch_type], pred_mode);
+    if (tree_type == SINGLE_TREE)
+        set_cb_tab(lc, fc->tab.cpm[CHROMA], pred_mode);
+
+    return pred_mode;
 }
 
 static void sbt_info(VVCLocalContext *lc, const VVCSPS *sps)
@@ -1232,12 +1237,8 @@ static void set_cu_tabs(const VVCLocalContext *lc, const CodingUnit *cu)
     const VVCFrameContext *fc   = lc->fc;
     const TransformUnit *tu     = cu->tus.head;
 
-    if (cu->tree_type != DUAL_TREE_CHROMA) {
-        set_cb_tab(lc, fc->tab.cpm[LUMA], cu->pred_mode);
+    if (cu->tree_type != DUAL_TREE_CHROMA)
         set_cb_tab(lc, fc->tab.skip, cu->skip_flag);
-    }
-    if (fc->ps.sps->r->sps_chroma_format_idc && cu->tree_type != DUAL_TREE_LUMA)
-        set_cb_tab(lc, fc->tab.cpm[CHROMA], cu->pred_mode);
 
     while (tu) {
           for (int j = 0; j < tu->nb_tbs; j++) {
diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
index be23f2bd54..e078f9387b 100644
--- a/libavcodec/vvc/dec.c
+++ b/libavcodec/vvc/dec.c
@@ -121,10 +121,8 @@ static void min_cb_tl_init(TabList *l, VVCFrameContext *fc)
     TL_ADD(imf,  pic_size_in_min_cb);
     TL_ADD(imm,  pic_size_in_min_cb);
 
-    for (int i = LUMA; i <= CHROMA; i++) {
+    for (int i = LUMA; i <= CHROMA; i++)
         TL_ADD(cb_width[i],  pic_size_in_min_cb);   //is_a0_available requires this
-        TL_ADD(cpm[i],       pic_size_in_min_cb);
-    };
 }
 
 static void min_cb_nz_tl_init(TabList *l, VVCFrameContext *fc)
@@ -145,6 +143,7 @@ static void min_cb_nz_tl_init(TabList *l, VVCFrameContext *fc)
         TL_ADD(cb_pos_y[i],  pic_size_in_min_cb);
         TL_ADD(cb_height[i], pic_size_in_min_cb);
         TL_ADD(cp_mv[i],     pic_size_in_min_cb * MAX_CONTROL_POINTS);
+        TL_ADD(cpm[i],       pic_size_in_min_cb);
     }
 }
 
-- 
2.34.1



More information about the ffmpeg-devel mailing list