avcodec/vvcdec: remove unused tb_pos_x0 and tb_pos_y0

This change will save approximately 531 MB for an 8K clip when processed with 16 threads.
The calculation is as follows:
7680 * 4320 * sizeof(int) * 2 * 2 * 16 / (4 * 4).
master
Nuo Mi 1 month ago
parent 2e936f2c11
commit a144e7b92e
  1. 10
      libavcodec/vvc/ctu.c
  2. 2
      libavcodec/vvc/dec.c
  3. 2
      libavcodec/vvc/dec.h

@ -38,7 +38,7 @@ typedef enum VVCModeType {
MODE_TYPE_INTRA,
} VVCModeType;
static void set_tb_pos(const VVCFrameContext *fc, const TransformBlock *tb)
static void set_tb_size(const VVCFrameContext *fc, const TransformBlock *tb)
{
const int x_tb = tb->x0 >> MIN_TU_LOG2;
const int y_tb = tb->y0 >> MIN_TU_LOG2;
@ -50,10 +50,6 @@ static void set_tb_pos(const VVCFrameContext *fc, const TransformBlock *tb)
for (int y = y_tb; y < end; y++) {
const int off = y * fc->ps.pps->min_tu_width + x_tb;
for (int i = 0; i < width; i++) {
fc->tab.tb_pos_x0[is_chroma][off + i] = tb->x0;
fc->tab.tb_pos_y0[is_chroma][off + i] = tb->y0;
}
memset(fc->tab.tb_width [is_chroma] + off, tb->tb_width, width);
memset(fc->tab.tb_height[is_chroma] + off, tb->tb_height, width);
}
@ -397,7 +393,7 @@ static int hls_transform_unit(VVCLocalContext *lc, int x0, int y0,int tu_width,
set_tb_tab(fc->tab.tu_coded_flag[tb->c_idx], tu->coded_flag[tb->c_idx], fc, tb);
}
if (tb->c_idx != CR)
set_tb_pos(fc, tb);
set_tb_size(fc, tb);
if (tb->c_idx == CB)
set_tb_tab(fc->tab.tu_joint_cbcr_residual_flag, tu->joint_cbcr_residual_flag, fc, tb);
}
@ -514,7 +510,7 @@ static int skipped_transform_tree(VVCLocalContext *lc, int x0, int y0,int tu_wid
for (int i = c_start; i < c_end; i++) {
TransformBlock *tb = add_tb(tu, lc, x0, y0, tu_width >> sps->hshift[i], tu_height >> sps->vshift[i], i);
if (i != CR)
set_tb_pos(fc, tb);
set_tb_size(fc, tb);
}
}

@ -207,8 +207,6 @@ static void min_tu_nz_tl_init(TabList *l, VVCFrameContext *fc)
tl_init(l, 0, changed);
for (int i = LUMA; i <= CHROMA; i++) {
TL_ADD(tb_pos_x0[i], pic_size_in_min_tu);
TL_ADD(tb_pos_y0[i], pic_size_in_min_tu);
TL_ADD(tb_width[i], pic_size_in_min_tu);
TL_ADD(tb_height[i], pic_size_in_min_tu);
}

@ -172,8 +172,6 @@ typedef struct VVCFrameContext {
uint8_t *tu_coded_flag[VVC_MAX_SAMPLE_ARRAYS]; ///< tu_y_coded_flag[][], tu_cb_coded_flag[][], tu_cr_coded_flag[][]
uint8_t *tu_joint_cbcr_residual_flag; ///< tu_joint_cbcr_residual_flag[][]
int *tb_pos_x0[2];
int *tb_pos_y0[2];
uint8_t *tb_width[2];
uint8_t *tb_height[2];
uint8_t *pcmf[2];

Loading…
Cancel
Save