aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vvc/ctu.c
diff options
context:
space:
mode:
authorNuo Mi <nuomi2021@gmail.com>2024-07-28 11:18:00 +0800
committerNuo Mi <nuomi2021@gmail.com>2024-08-15 20:19:45 +0800
commite8ac76129365302de7e2885b76459ad890b7ecc7 (patch)
treeeb04007293325a533647701a87920ceb07f2be07 /libavcodec/vvc/ctu.c
parent4f609614983bcabc277d354ef8bc4e65e52faaf6 (diff)
downloadffmpeg-e8ac76129365302de7e2885b76459ad890b7ecc7.tar.gz
avcodec/vvcdec: split ctu table to zero init and no zero init parts
cus need to init to zero, other parts are not
Diffstat (limited to 'libavcodec/vvc/ctu.c')
-rw-r--r--libavcodec/vvc/ctu.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
index 3f9a75190b..d39dd579ae 100644
--- a/libavcodec/vvc/ctu.c
+++ b/libavcodec/vvc/ctu.c
@@ -1174,7 +1174,7 @@ static CodingUnit* alloc_cu(VVCLocalContext *lc, const int x0, const int y0)
const VVCPPS *pps = fc->ps.pps;
const int rx = x0 >> sps->ctb_log2_size_y;
const int ry = y0 >> sps->ctb_log2_size_y;
- CTU *ctu = fc->tab.ctus + ry * pps->ctb_width + rx;
+ CodingUnit **cus = fc->tab.cus + ry * pps->ctb_width + rx;
CodingUnit *cu = ff_refstruct_pool_get(fc->cu_pool);
if (!cu)
@@ -1184,7 +1184,7 @@ static CodingUnit* alloc_cu(VVCLocalContext *lc, const int x0, const int y0)
if (lc->cu)
lc->cu->next = cu;
else
- ctu->cus = cu;
+ *cus = cu;
lc->cu = cu;
return cu;
@@ -2429,7 +2429,9 @@ static void ctu_get_pred(VVCLocalContext *lc, const int rs)
const VVCFrameContext *fc = lc->fc;
const H266RawSliceHeader *rsh = lc->sc->sh.r;
CTU *ctu = fc->tab.ctus + rs;
- const CodingUnit *cu = ctu->cus;
+ const CodingUnit *cu = fc->tab.cus[rs];
+
+ ctu->has_dmvr = 0;
if (IS_I(rsh))
return;
@@ -2526,9 +2528,8 @@ void ff_vvc_set_neighbour_available(VVCLocalContext *lc,
lc->na.cand_up_right = lc->na.cand_up_right_sap && (x0 + w) < lc->end_of_tiles_x;
}
-void ff_vvc_ctu_free_cus(CTU *ctu)
+void ff_vvc_ctu_free_cus(CodingUnit **cus)
{
- CodingUnit **cus = &ctu->cus;
while (*cus) {
CodingUnit *cu = *cus;
TransformUnit **head = &cu->tus.head;