FFmpeg
Macros | Typedefs | Enumerations | Functions | Variables
vvc_ctu.c File Reference
#include "libavcodec/refstruct.h"
#include "vvc_cabac.h"
#include "vvc_ctu.h"
#include "vvc_inter.h"
#include "vvc_mvs.h"

Go to the source code of this file.

Macros

#define PROF_TEMP_SIZE   (PROF_BLOCK_SIZE) * sizeof(int16_t)
 
#define TAB_MSM(fc, depth, x, y)   fc->tab.msm[(depth)][((y) >> 5) * fc->ps.pps->width32 + ((x) >> 5)]
 
#define TAB_ISPMF(fc, x, y)   fc->tab.ispmf[((y) >> 6) * fc->ps.pps->width64 + ((x) >> 6)]
 
#define TRANSFORM_TREE(x, y)
 
#define TRANSFORM_UNIT(x, width, idx)
 
#define TRANSFORM_UNIT(y, height, idx)
 
#define SKIPPED_TRANSFORM_TREE(x, y)
 
#define CODING_TREE(x, idx)
 
#define CODING_TREE(y, idx)
 
#define CODING_TREE(x, w, sub_div, idx)
 
#define CODING_TREE(y, h, sub_div, idx)
 
#define CODING_TREE(x, y, idx)
 
#define DUAL_TREE(x, y)
 
#define CODING_TREE(tree_type)
 
#define SET_SAO(elem, value)
 

Typedefs

typedef int(* coding_tree_fn) (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
 

Enumerations

enum  VVCModeType { MODE_TYPE_ALL, MODE_TYPE_INTER, MODE_TYPE_INTRA }
 

Functions

static void set_tb_pos (const VVCFrameContext *fc, const TransformBlock *tb)
 
static void set_tb_tab (uint8_t *tab, uint8_t v, const VVCFrameContext *fc, const TransformBlock *tb)
 
static int get_qp_y_pred (const VVCLocalContext *lc)
 
static void set_cb_tab (const VVCLocalContext *lc, uint8_t *tab, const uint8_t v)
 
static int set_qp_y (VVCLocalContext *lc, const int x0, const int y0, const int has_qp_delta)
 
static void set_qp_c_tab (const VVCLocalContext *lc, const TransformUnit *tu, const TransformBlock *tb)
 
static void set_qp_c (VVCLocalContext *lc)
 
static TransformUnitalloc_tu (VVCFrameContext *fc, CodingUnit *cu)
 
static TransformUnitadd_tu (VVCFrameContext *fc, CodingUnit *cu, const int x0, const int y0, const int tu_width, const int tu_height)
 
static TransformBlockadd_tb (TransformUnit *tu, VVCLocalContext *lc, const int x0, const int y0, const int tb_width, const int tb_height, const int c_idx)
 
static uint8_t tu_y_coded_flag_decode (VVCLocalContext *lc, const int is_sbt_not_coded, const int sub_tu_index, const int is_isp, const int is_chroma_coded)
 
static void chroma_qp_offset_decode (VVCLocalContext *lc, const int is_128, const int is_chroma_coded)
 
static int hls_transform_unit (VVCLocalContext *lc, int x0, int y0, int tu_width, int tu_height, int sub_tu_index, int ch_type)
 
static int hls_transform_tree (VVCLocalContext *lc, int x0, int y0, int tu_width, int tu_height, int ch_type)
 
static int skipped_transform_tree (VVCLocalContext *lc, int x0, int y0, int tu_width, int tu_height)
 
static void can_split (const VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int mtt_depth, int depth_offset, int part_idx, VVCSplitMode last_split_mode, VVCTreeType tree_type, VVCModeType mode_type, VVCAllowedSplit *split)
 
static int get_num_intra_subpartitions (enum IspType isp_split_type, int cb_width, int cb_height)
 
static int get_cclm_enabled (const VVCLocalContext *lc, const int x0, const int y0)
 
static int less (const void *a, const void *b)
 
static enum IntraPredMode luma_intra_pred_mode (VVCLocalContext *lc, const int intra_subpartitions_mode_flag)
 
static int lfnst_idx_decode (VVCLocalContext *lc)
 
static MtsIdx mts_idx_decode (VVCLocalContext *lc)
 
static enum IntraPredMode derive_center_luma_intra_pred_mode (const VVCFrameContext *fc, const VVCSPS *sps, const VVCPPS *pps, const CodingUnit *cu)
 
static void derive_chroma_intra_pred_mode (VVCLocalContext *lc, const int cclm_mode_flag, const int cclm_mode_idx, const int intra_chroma_pred_mode)
 
static void intra_luma_pred_modes (VVCLocalContext *lc)
 
static void intra_chroma_pred_modes (VVCLocalContext *lc)
 
static PredMode pred_mode_decode (VVCLocalContext *lc, const VVCTreeType tree_type, const VVCModeType mode_type)
 
static void sbt_info (VVCLocalContext *lc, const VVCSPS *sps)
 
static int skipped_transform_tree_unit (VVCLocalContext *lc)
 
static void set_cb_pos (const VVCFrameContext *fc, const CodingUnit *cu)
 
static CodingUnitalloc_cu (VVCLocalContext *lc, const int x0, const int y0)
 
static CodingUnitadd_cu (VVCLocalContext *lc, const int x0, const int y0, const int cb_width, const int cb_height, const int cqt_depth, const VVCTreeType tree_type)
 
static void set_cu_tabs (const VVCLocalContext *lc, const CodingUnit *cu)
 
static void derive_mmvd (const VVCLocalContext *lc, MvField *mvf, const Mv *mmvd_offset)
 
static void mvf_to_mi (const MvField *mvf, MotionInfo *mi)
 
static void mv_merge_refine_pred_flag (MvField *mvf, const int width, const int height)
 
static void merge_data_subblock (VVCLocalContext *lc)
 
static void merge_data_regular (VVCLocalContext *lc)
 
static int ciip_flag_decode (VVCLocalContext *lc, const int ciip_avaiable, const int gpm_avaiable, const int is_128)
 
static void merge_data_gpm (VVCLocalContext *lc)
 
static void merge_data_ciip (VVCLocalContext *lc)
 
static void merge_data_block (VVCLocalContext *lc)
 
static void merge_data_ibc (VVCLocalContext *lc)
 
static int hls_merge_data (VVCLocalContext *lc)
 
static void hls_mvd_coding (VVCLocalContext *lc, Mv *mvd)
 
static int bcw_idx_decode (VVCLocalContext *lc, const MotionInfo *mi, const int cb_width, const int cb_height)
 
static int8_t ref_idx_decode (VVCLocalContext *lc, const VVCSH *sh, const int sym_mvd_flag, const int lx)
 
static int mvds_decode (VVCLocalContext *lc, Mv mvds[2][MAX_CONTROL_POINTS], const int num_cp_mv, const int lx)
 
static void mvp_add_difference (MotionInfo *mi, const int num_cp_mv, const Mv mvds[2][MAX_CONTROL_POINTS], const int amvr_shift)
 
static int mvp_data_ibc (VVCLocalContext *lc)
 
static int mvp_data (VVCLocalContext *lc)
 
static void derive_dmvr_bdof_flag (const VVCLocalContext *lc, PredictionUnit *pu)
 
static void refine_regular_subblock (const VVCLocalContext *lc)
 
static void fill_dmvr_info (const VVCLocalContext *lc)
 
static int inter_data (VVCLocalContext *lc)
 
static int hls_coding_unit (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int cqt_depth, const VVCTreeType tree_type, VVCModeType mode_type)
 
static int derive_mode_type_condition (const VVCLocalContext *lc, const VVCSplitMode split, const int cb_width, const int cb_height, const VVCModeType mode_type_curr)
 
static VVCModeType mode_type_decode (VVCLocalContext *lc, const int x0, const int y0, const int cb_width, const int cb_height, const VVCSplitMode split, const int ch_type, const VVCModeType mode_type_curr)
 
static int hls_coding_tree (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, int part_idx, VVCSplitMode last_split_mode, VVCTreeType tree_type_curr, VVCModeType mode_type_curr)
 
static int coding_tree_btv (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
 
static int coding_tree_bth (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
 
static int coding_tree_ttv (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
 
static int coding_tree_tth (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
 
static int coding_tree_qt (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
 
static int dual_tree_implicit_qt_split (VVCLocalContext *lc, const int x0, const int y0, const int cb_size, const int cqt_depth)
 
static void hls_sao (VVCLocalContext *lc, const int rx, const int ry)
 
static void alf_params (VVCLocalContext *lc, const int rx, const int ry)
 
static void deblock_params (VVCLocalContext *lc, const int rx, const int ry)
 
static int hls_coding_tree_unit (VVCLocalContext *lc, const int x0, const int y0, const int ctu_idx, const int rx, const int ry)
 
static int has_inter_luma (const CodingUnit *cu)
 
static int pred_get_y (const int y0, const Mv *mv, const int height)
 
static void cu_get_max_y (const CodingUnit *cu, int max_y[2][VVC_MAX_REF_ENTRIES], const VVCFrameContext *fc)
 
static void ctu_get_pred (VVCLocalContext *lc, const int rs)
 
int ff_vvc_coding_tree_unit (VVCLocalContext *lc, const int ctu_idx, const int rs, const int rx, const int ry)
 parse a CTU More...
 
void ff_vvc_decode_neighbour (VVCLocalContext *lc, const int x_ctb, const int y_ctb, const int rx, const int ry, const int rs)
 
void ff_vvc_set_neighbour_available (VVCLocalContext *lc, const int x0, const int y0, const int w, const int h)
 
void ff_vvc_ctu_free_cus (CTU *ctu)
 
int ff_vvc_get_qPy (const VVCFrameContext *fc, const int xc, const int yc)
 
void ff_vvc_ep_init_stat_coeff (EntryPoint *ep, const int bit_depth, const int persistent_rice_adaptation_enabled_flag)
 

Variables

const static coding_tree_fn coding_tree []
 

Macro Definition Documentation

◆ PROF_TEMP_SIZE

#define PROF_TEMP_SIZE   (PROF_BLOCK_SIZE) * sizeof(int16_t)

Definition at line 30 of file vvc_ctu.c.

◆ TAB_MSM

#define TAB_MSM (   fc,
  depth,
  x,
 
)    fc->tab.msm[(depth)][((y) >> 5) * fc->ps.pps->width32 + ((x) >> 5)]

Definition at line 32 of file vvc_ctu.c.

◆ TAB_ISPMF

#define TAB_ISPMF (   fc,
  x,
 
)    fc->tab.ispmf[((y) >> 6) * fc->ps.pps->width64 + ((x) >> 6)]

Definition at line 33 of file vvc_ctu.c.

◆ TRANSFORM_TREE

#define TRANSFORM_TREE (   x,
 
)
Value:
do { \
ret = hls_transform_tree(lc, x, y, trafo_width, trafo_height, ch_type); \
if (ret < 0) \
return ret; \
} while (0)

◆ TRANSFORM_UNIT [1/2]

#define TRANSFORM_UNIT (   x,
  width,
  idx 
)
Value:
do { \
ret = hls_transform_unit(lc, x, y0, width, tu_height, idx, ch_type); \
if (ret < 0) \
return ret; \
} while (0)

◆ TRANSFORM_UNIT [2/2]

#define TRANSFORM_UNIT (   y,
  height,
  idx 
)
Value:
do { \
ret = hls_transform_unit(lc, x0, y, tu_width, height, idx, ch_type); \
if (ret < 0) \
return ret; \
} while (0)

◆ SKIPPED_TRANSFORM_TREE

#define SKIPPED_TRANSFORM_TREE (   x,
 
)
Value:
do { \
int ret = skipped_transform_tree(lc, x, y, trafo_width, trafo_height); \
if (ret < 0) \
return ret; \
} while (0)

◆ CODING_TREE [1/6]

#define CODING_TREE (   x,
  idx 
)
Value:
do { \
ret = hls_coding_tree(lc, x, y0, cb_width / 2, cb_height, \
qg_on_y, qg_on_c, cb_sub_div + 1, cqt_depth, mtt_depth + 1, \
depth_offset, idx, SPLIT_BT_VER, tree_type, mode_type); \
if (ret < 0) \
return ret; \
} while (0);

◆ CODING_TREE [2/6]

#define CODING_TREE (   y,
  idx 
)
Value:
do { \
ret = hls_coding_tree(lc, x0, y, cb_width , cb_height / 2, \
qg_on_y, qg_on_c, cb_sub_div + 1, cqt_depth, mtt_depth + 1, \
depth_offset, idx, SPLIT_BT_HOR, tree_type, mode_type); \
if (ret < 0) \
return ret; \
} while (0);

◆ CODING_TREE [3/6]

#define CODING_TREE (   x,
  w,
  sub_div,
  idx 
)
Value:
do { \
ret = hls_coding_tree(lc, x, y0, w, cb_height, \
qg_on_y, qg_on_c, sub_div, cqt_depth, mtt_depth + 1, \
depth_offset, idx, SPLIT_TT_VER, tree_type, mode_type); \
if (ret < 0) \
return ret; \
} while (0);

◆ CODING_TREE [4/6]

#define CODING_TREE (   y,
  h,
  sub_div,
  idx 
)
Value:
do { \
ret = hls_coding_tree(lc, x0, y, cb_width, h, \
qg_on_y, qg_on_c, sub_div, cqt_depth, mtt_depth + 1, \
depth_offset, idx, SPLIT_TT_HOR, tree_type, mode_type); \
if (ret < 0) \
return ret; \
} while (0);

◆ CODING_TREE [5/6]

#define CODING_TREE (   x,
  y,
  idx 
)
Value:
do { \
ret = hls_coding_tree(lc, x, y, cb_width / 2, cb_height / 2, \
qg_on_y, qg_on_c, cb_sub_div + 2, cqt_depth + 1, 0, 0, \
idx, SPLIT_QT, tree_type, mode_type); \
if (ret < 0) \
return ret; \
} while (0);

◆ DUAL_TREE

#define DUAL_TREE (   x,
 
)
Value:
do { \
ret = dual_tree_implicit_qt_split(lc, x, y, cb_size / 2, cqt_depth + 1); \
if (ret < 0) \
return ret; \
} while (0)

◆ CODING_TREE [6/6]

#define CODING_TREE (   tree_type)
Value:
do { \
const int qg_on_y = tree_type == DUAL_TREE_LUMA; \
ret = hls_coding_tree(lc, x0, y0, cb_size, cb_size, qg_on_y, !qg_on_y, \
cb_subdiv, cqt_depth, 0, 0, 0, SPLIT_NONE, tree_type, MODE_TYPE_ALL); \
if (ret < 0) \
return ret; \
} while (0)

◆ SET_SAO

#define SET_SAO (   elem,
  value 
)
Value:
do { \
if (!sao_merge_up_flag && !sao_merge_left_flag) \
sao->elem = value; \
else if (sao_merge_left_flag) \
sao->elem = CTB(fc->tab.sao, rx-1, ry).elem; \
else if (sao_merge_up_flag) \
sao->elem = CTB(fc->tab.sao, rx, ry-1).elem; \
else \
sao->elem = 0; \
} while (0)

Definition at line 2189 of file vvc_ctu.c.

Typedef Documentation

◆ coding_tree_fn

typedef int(* coding_tree_fn) (VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)

Definition at line 2071 of file vvc_ctu.c.

Enumeration Type Documentation

◆ VVCModeType

Enumerator
MODE_TYPE_ALL 
MODE_TYPE_INTER 
MODE_TYPE_INTRA 

Definition at line 35 of file vvc_ctu.c.

Function Documentation

◆ set_tb_pos()

static void set_tb_pos ( const VVCFrameContext fc,
const TransformBlock tb 
)
static

Definition at line 41 of file vvc_ctu.c.

Referenced by hls_transform_unit(), and skipped_transform_tree().

◆ set_tb_tab()

static void set_tb_tab ( uint8_t *  tab,
uint8_t  v,
const VVCFrameContext fc,
const TransformBlock tb 
)
static

Definition at line 62 of file vvc_ctu.c.

Referenced by hls_transform_unit(), set_cu_tabs(), and set_qp_c_tab().

◆ get_qp_y_pred()

static int get_qp_y_pred ( const VVCLocalContext lc)
static

Definition at line 77 of file vvc_ctu.c.

Referenced by set_qp_y().

◆ set_cb_tab()

static void set_cb_tab ( const VVCLocalContext lc,
uint8_t *  tab,
const uint8_t  v 
)
static

◆ set_qp_y()

static int set_qp_y ( VVCLocalContext lc,
const int  x0,
const int  y0,
const int  has_qp_delta 
)
static

Definition at line 144 of file vvc_ctu.c.

Referenced by hls_transform_unit(), and skipped_transform_tree_unit().

◆ set_qp_c_tab()

static void set_qp_c_tab ( const VVCLocalContext lc,
const TransformUnit tu,
const TransformBlock tb 
)
static

Definition at line 179 of file vvc_ctu.c.

Referenced by set_cu_tabs().

◆ set_qp_c()

static void set_qp_c ( VVCLocalContext lc)
static

Definition at line 187 of file vvc_ctu.c.

Referenced by hls_coding_unit(), and skipped_transform_tree_unit().

◆ alloc_tu()

static TransformUnit* alloc_tu ( VVCFrameContext fc,
CodingUnit cu 
)
static

Definition at line 214 of file vvc_ctu.c.

Referenced by add_tu().

◆ add_tu()

static TransformUnit* add_tu ( VVCFrameContext fc,
CodingUnit cu,
const int  x0,
const int  y0,
const int  tu_width,
const int  tu_height 
)
static

Definition at line 231 of file vvc_ctu.c.

Referenced by hls_transform_unit(), and skipped_transform_tree().

◆ add_tb()

static TransformBlock* add_tb ( TransformUnit tu,
VVCLocalContext lc,
const int  x0,
const int  y0,
const int  tb_width,
const int  tb_height,
const int  c_idx 
)
static

Definition at line 249 of file vvc_ctu.c.

Referenced by hls_transform_unit(), and skipped_transform_tree().

◆ tu_y_coded_flag_decode()

static uint8_t tu_y_coded_flag_decode ( VVCLocalContext lc,
const int  is_sbt_not_coded,
const int  sub_tu_index,
const int  is_isp,
const int  is_chroma_coded 
)
static

Definition at line 273 of file vvc_ctu.c.

Referenced by hls_transform_unit().

◆ chroma_qp_offset_decode()

static void chroma_qp_offset_decode ( VVCLocalContext lc,
const int  is_128,
const int  is_chroma_coded 
)
static

Definition at line 293 of file vvc_ctu.c.

Referenced by hls_transform_unit().

◆ hls_transform_unit()

static int hls_transform_unit ( VVCLocalContext lc,
int  x0,
int  y0,
int  tu_width,
int  tu_height,
int  sub_tu_index,
int  ch_type 
)
static

Definition at line 314 of file vvc_ctu.c.

Referenced by hls_transform_tree().

◆ hls_transform_tree()

static int hls_transform_tree ( VVCLocalContext lc,
int  x0,
int  y0,
int  tu_width,
int  tu_height,
int  ch_type 
)
static

Definition at line 406 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ skipped_transform_tree()

static int skipped_transform_tree ( VVCLocalContext lc,
int  x0,
int  y0,
int  tu_width,
int  tu_height 
)
static

Definition at line 482 of file vvc_ctu.c.

Referenced by skipped_transform_tree_unit().

◆ can_split()

static void can_split ( const VVCLocalContext lc,
int  x0,
int  y0,
int  cb_width,
int  cb_height,
int  mtt_depth,
int  depth_offset,
int  part_idx,
VVCSplitMode  last_split_mode,
VVCTreeType  tree_type,
VVCModeType  mode_type,
VVCAllowedSplit split 
)
static

Definition at line 525 of file vvc_ctu.c.

Referenced by hls_coding_tree(), and hls_write_packet().

◆ get_num_intra_subpartitions()

static int get_num_intra_subpartitions ( enum IspType  isp_split_type,
int  cb_width,
int  cb_height 
)
static

Definition at line 624 of file vvc_ctu.c.

Referenced by intra_luma_pred_modes().

◆ get_cclm_enabled()

static int get_cclm_enabled ( const VVCLocalContext lc,
const int  x0,
const int  y0 
)
static

Definition at line 633 of file vvc_ctu.c.

Referenced by intra_chroma_pred_modes().

◆ less()

static int less ( const void *  a,
const void *  b 
)
static

Definition at line 678 of file vvc_ctu.c.

Referenced by luma_intra_pred_mode().

◆ luma_intra_pred_mode()

static enum IntraPredMode luma_intra_pred_mode ( VVCLocalContext lc,
const int  intra_subpartitions_mode_flag 
)
static

Definition at line 684 of file vvc_ctu.c.

Referenced by derive_chroma_intra_pred_mode(), and intra_luma_pred_modes().

◆ lfnst_idx_decode()

static int lfnst_idx_decode ( VVCLocalContext lc)
static

Definition at line 795 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ mts_idx_decode()

static MtsIdx mts_idx_decode ( VVCLocalContext lc)
static

Definition at line 846 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ derive_center_luma_intra_pred_mode()

static enum IntraPredMode derive_center_luma_intra_pred_mode ( const VVCFrameContext fc,
const VVCSPS sps,
const VVCPPS pps,
const CodingUnit cu 
)
static

Definition at line 867 of file vvc_ctu.c.

Referenced by derive_chroma_intra_pred_mode().

◆ derive_chroma_intra_pred_mode()

static void derive_chroma_intra_pred_mode ( VVCLocalContext lc,
const int  cclm_mode_flag,
const int  cclm_mode_idx,
const int  intra_chroma_pred_mode 
)
static

Definition at line 886 of file vvc_ctu.c.

Referenced by intra_chroma_pred_modes().

◆ intra_luma_pred_modes()

static void intra_luma_pred_modes ( VVCLocalContext lc)
static

Definition at line 951 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ intra_chroma_pred_modes()

static void intra_chroma_pred_modes ( VVCLocalContext lc)
static

Definition at line 1004 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ pred_mode_decode()

static PredMode pred_mode_decode ( VVCLocalContext lc,
const VVCTreeType  tree_type,
const VVCModeType  mode_type 
)
static

Definition at line 1036 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ sbt_info()

static void sbt_info ( VVCLocalContext lc,
const VVCSPS sps 
)
static

Definition at line 1091 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ skipped_transform_tree_unit()

static int skipped_transform_tree_unit ( VVCLocalContext lc)
static

Definition at line 1130 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ set_cb_pos()

static void set_cb_pos ( const VVCFrameContext fc,
const CodingUnit cu 
)
static

Definition at line 1146 of file vvc_ctu.c.

Referenced by add_cu().

◆ alloc_cu()

static CodingUnit* alloc_cu ( VVCLocalContext lc,
const int  x0,
const int  y0 
)
static

Definition at line 1172 of file vvc_ctu.c.

Referenced by add_cu().

◆ add_cu()

static CodingUnit* add_cu ( VVCLocalContext lc,
const int  x0,
const int  y0,
const int  cb_width,
const int  cb_height,
const int  cqt_depth,
const VVCTreeType  tree_type 
)
static

Definition at line 1195 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ set_cu_tabs()

static void set_cu_tabs ( const VVCLocalContext lc,
const CodingUnit cu 
)
static

Definition at line 1232 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ derive_mmvd()

static void derive_mmvd ( const VVCLocalContext lc,
MvField mvf,
const Mv mmvd_offset 
)
static

Definition at line 1257 of file vvc_ctu.c.

Referenced by merge_data_regular().

◆ mvf_to_mi()

static void mvf_to_mi ( const MvField mvf,
MotionInfo mi 
)
static

Definition at line 1298 of file vvc_ctu.c.

Referenced by merge_data_ciip(), and merge_data_regular().

◆ mv_merge_refine_pred_flag()

static void mv_merge_refine_pred_flag ( MvField mvf,
const int  width,
const int  height 
)
static

Definition at line 1312 of file vvc_ctu.c.

Referenced by merge_data_ciip(), and merge_data_regular().

◆ merge_data_subblock()

static void merge_data_subblock ( VVCLocalContext lc)
static

Definition at line 1321 of file vvc_ctu.c.

Referenced by hls_merge_data().

◆ merge_data_regular()

static void merge_data_regular ( VVCLocalContext lc)
static

Definition at line 1336 of file vvc_ctu.c.

Referenced by merge_data_block().

◆ ciip_flag_decode()

static int ciip_flag_decode ( VVCLocalContext lc,
const int  ciip_avaiable,
const int  gpm_avaiable,
const int  is_128 
)
static

Definition at line 1366 of file vvc_ctu.c.

Referenced by merge_data_block().

◆ merge_data_gpm()

static void merge_data_gpm ( VVCLocalContext lc)
static

Definition at line 1378 of file vvc_ctu.c.

Referenced by merge_data_block().

◆ merge_data_ciip()

static void merge_data_ciip ( VVCLocalContext lc)
static

Definition at line 1396 of file vvc_ctu.c.

Referenced by merge_data_block().

◆ merge_data_block()

static void merge_data_block ( VVCLocalContext lc)
static

Definition at line 1417 of file vvc_ctu.c.

Referenced by hls_merge_data().

◆ merge_data_ibc()

static void merge_data_ibc ( VVCLocalContext lc)
static

Definition at line 1447 of file vvc_ctu.c.

Referenced by hls_merge_data().

◆ hls_merge_data()

static int hls_merge_data ( VVCLocalContext lc)
static

Definition at line 1463 of file vvc_ctu.c.

Referenced by inter_data().

◆ hls_mvd_coding()

static void hls_mvd_coding ( VVCLocalContext lc,
Mv mvd 
)
static

Definition at line 1485 of file vvc_ctu.c.

Referenced by mvds_decode(), and mvp_data_ibc().

◆ bcw_idx_decode()

static int bcw_idx_decode ( VVCLocalContext lc,
const MotionInfo mi,
const int  cb_width,
const int  cb_height 
)
static

Definition at line 1509 of file vvc_ctu.c.

Referenced by mvp_data().

◆ ref_idx_decode()

static int8_t ref_idx_decode ( VVCLocalContext lc,
const VVCSH sh,
const int  sym_mvd_flag,
const int  lx 
)
static

Definition at line 1530 of file vvc_ctu.c.

Referenced by mvp_data().

◆ mvds_decode()

static int mvds_decode ( VVCLocalContext lc,
Mv  mvds[2][MAX_CONTROL_POINTS],
const int  num_cp_mv,
const int  lx 
)
static

Definition at line 1542 of file vvc_ctu.c.

Referenced by mvp_data().

◆ mvp_add_difference()

static void mvp_add_difference ( MotionInfo mi,
const int  num_cp_mv,
const Mv  mvds[2][MAX_CONTROL_POINTS],
const int  amvr_shift 
)
static

Definition at line 1574 of file vvc_ctu.c.

Referenced by mvp_data().

◆ mvp_data_ibc()

static int mvp_data_ibc ( VVCLocalContext lc)
static

Definition at line 1589 of file vvc_ctu.c.

Referenced by inter_data().

◆ mvp_data()

static int mvp_data ( VVCLocalContext lc)
static

Definition at line 1616 of file vvc_ctu.c.

Referenced by inter_data().

◆ derive_dmvr_bdof_flag()

static void derive_dmvr_bdof_flag ( const VVCLocalContext lc,
PredictionUnit pu 
)
static

Definition at line 1685 of file vvc_ctu.c.

Referenced by refine_regular_subblock().

◆ refine_regular_subblock()

static void refine_regular_subblock ( const VVCLocalContext lc)
static

Definition at line 1724 of file vvc_ctu.c.

Referenced by inter_data().

◆ fill_dmvr_info()

static void fill_dmvr_info ( const VVCLocalContext lc)
static

Definition at line 1736 of file vvc_ctu.c.

Referenced by inter_data().

◆ inter_data()

static int inter_data ( VVCLocalContext lc)
static

Definition at line 1757 of file vvc_ctu.c.

Referenced by hls_coding_unit().

◆ hls_coding_unit()

static int hls_coding_unit ( VVCLocalContext lc,
int  x0,
int  y0,
int  cb_width,
int  cb_height,
int  cqt_depth,
const VVCTreeType  tree_type,
VVCModeType  mode_type 
)
static

Definition at line 1789 of file vvc_ctu.c.

Referenced by hls_coding_tree().

◆ derive_mode_type_condition()

static int derive_mode_type_condition ( const VVCLocalContext lc,
const VVCSplitMode  split,
const int  cb_width,
const int  cb_height,
const VVCModeType  mode_type_curr 
)
static

Definition at line 1880 of file vvc_ctu.c.

Referenced by mode_type_decode().

◆ mode_type_decode()

static VVCModeType mode_type_decode ( VVCLocalContext lc,
const int  x0,
const int  y0,
const int  cb_width,
const int  cb_height,
const VVCSplitMode  split,
const int  ch_type,
const VVCModeType  mode_type_curr 
)
static

Definition at line 1902 of file vvc_ctu.c.

Referenced by hls_coding_tree().

◆ hls_coding_tree()

static int hls_coding_tree ( VVCLocalContext lc,
int  x0,
int  y0,
int  cb_width,
int  cb_height,
int  qg_on_y,
int  qg_on_c,
int  cb_sub_div,
int  cqt_depth,
int  mtt_depth,
int  depth_offset,
int  part_idx,
VVCSplitMode  last_split_mode,
VVCTreeType  tree_type_curr,
VVCModeType  mode_type_curr 
)
static

Definition at line 2084 of file vvc_ctu.c.

Referenced by hls_coding_tree_unit().

◆ coding_tree_btv()

static int coding_tree_btv ( VVCLocalContext lc,
int  x0,
int  y0,
int  cb_width,
int  cb_height,
int  qg_on_y,
int  qg_on_c,
int  cb_sub_div,
int  cqt_depth,
int  mtt_depth,
int  depth_offset,
VVCTreeType  tree_type,
VVCModeType  mode_type 
)
static

Definition at line 1925 of file vvc_ctu.c.

◆ coding_tree_bth()

static int coding_tree_bth ( VVCLocalContext lc,
int  x0,
int  y0,
int  cb_width,
int  cb_height,
int  qg_on_y,
int  qg_on_c,
int  cb_sub_div,
int  cqt_depth,
int  mtt_depth,
int  depth_offset,
VVCTreeType  tree_type,
VVCModeType  mode_type 
)
static

Definition at line 1952 of file vvc_ctu.c.

◆ coding_tree_ttv()

static int coding_tree_ttv ( VVCLocalContext lc,
int  x0,
int  y0,
int  cb_width,
int  cb_height,
int  qg_on_y,
int  qg_on_c,
int  cb_sub_div,
int  cqt_depth,
int  mtt_depth,
int  depth_offset,
VVCTreeType  tree_type,
VVCModeType  mode_type 
)
static

Definition at line 1979 of file vvc_ctu.c.

◆ coding_tree_tth()

static int coding_tree_tth ( VVCLocalContext lc,
int  x0,
int  y0,
int  cb_width,
int  cb_height,
int  qg_on_y,
int  qg_on_c,
int  cb_sub_div,
int  cqt_depth,
int  mtt_depth,
int  depth_offset,
VVCTreeType  tree_type,
VVCModeType  mode_type 
)
static

Definition at line 2009 of file vvc_ctu.c.

◆ coding_tree_qt()

static int coding_tree_qt ( VVCLocalContext lc,
int  x0,
int  y0,
int  cb_width,
int  cb_height,
int  qg_on_y,
int  qg_on_c,
int  cb_sub_div,
int  cqt_depth,
int  mtt_depth,
int  depth_offset,
VVCTreeType  tree_type,
VVCModeType  mode_type 
)
static

Definition at line 2039 of file vvc_ctu.c.

◆ dual_tree_implicit_qt_split()

static int dual_tree_implicit_qt_split ( VVCLocalContext lc,
const int  x0,
const int  y0,
const int  cb_size,
const int  cqt_depth 
)
static

Definition at line 2139 of file vvc_ctu.c.

Referenced by hls_coding_tree_unit().

◆ hls_sao()

static void hls_sao ( VVCLocalContext lc,
const int  rx,
const int  ry 
)
static

Definition at line 2201 of file vvc_ctu.c.

Referenced by hls_coding_tree_unit().

◆ alf_params()

static void alf_params ( VVCLocalContext lc,
const int  rx,
const int  ry 
)
static

Definition at line 2270 of file vvc_ctu.c.

Referenced by hls_coding_tree_unit().

◆ deblock_params()

static void deblock_params ( VVCLocalContext lc,
const int  rx,
const int  ry 
)
static

Definition at line 2316 of file vvc_ctu.c.

Referenced by hls_coding_tree_unit().

◆ hls_coding_tree_unit()

static int hls_coding_tree_unit ( VVCLocalContext lc,
const int  x0,
const int  y0,
const int  ctu_idx,
const int  rx,
const int  ry 
)
static

Definition at line 2323 of file vvc_ctu.c.

Referenced by ff_vvc_coding_tree_unit().

◆ has_inter_luma()

static int has_inter_luma ( const CodingUnit cu)
static

Definition at line 2371 of file vvc_ctu.c.

Referenced by ctu_get_pred().

◆ pred_get_y()

static int pred_get_y ( const int  y0,
const Mv mv,
const int  height 
)
static

Definition at line 2376 of file vvc_ctu.c.

Referenced by cu_get_max_y().

◆ cu_get_max_y()

static void cu_get_max_y ( const CodingUnit cu,
int  max_y[2][VVC_MAX_REF_ENTRIES],
const VVCFrameContext fc 
)
static

Definition at line 2381 of file vvc_ctu.c.

Referenced by ctu_get_pred().

◆ ctu_get_pred()

static void ctu_get_pred ( VVCLocalContext lc,
const int  rs 
)
static

Definition at line 2418 of file vvc_ctu.c.

Referenced by ff_vvc_coding_tree_unit().

◆ ff_vvc_coding_tree_unit()

int ff_vvc_coding_tree_unit ( VVCLocalContext lc,
int  ctu_idx,
int  rs,
int  rx,
int  ry 
)

parse a CTU

Parameters
lclocal context for CTU
ctb_idxCTB(CTU) address in the current slice
rsraster order for the CTU.
rxraster order x for the CTU.
ryraster order y for the CTU.
Returns
AVERROR

Definition at line 2441 of file vvc_ctu.c.

Referenced by run_parse().

◆ ff_vvc_decode_neighbour()

void ff_vvc_decode_neighbour ( VVCLocalContext lc,
const int  x_ctb,
const int  y_ctb,
const int  rx,
const int  ry,
const int  rs 
)

◆ ff_vvc_set_neighbour_available()

void ff_vvc_set_neighbour_available ( VVCLocalContext lc,
const int  x0,
const int  y0,
const int  w,
const int  h 
)

◆ ff_vvc_ctu_free_cus()

void ff_vvc_ctu_free_cus ( CTU ctu)

Definition at line 2516 of file vvc_ctu.c.

Referenced by ff_vvc_reconstruct(), and free_cus().

◆ ff_vvc_get_qPy()

int ff_vvc_get_qPy ( const VVCFrameContext fc,
const int  xc,
const int  yc 
)

Definition at line 2536 of file vvc_ctu.c.

Referenced by get_qp_y(), and set_qp_c().

◆ ff_vvc_ep_init_stat_coeff()

void ff_vvc_ep_init_stat_coeff ( EntryPoint ep,
const int  bit_depth,
const int  persistent_rice_adaptation_enabled_flag 
)

Definition at line 2544 of file vvc_ctu.c.

Referenced by cabac_init_state(), and schedule_next_parse().

Variable Documentation

◆ coding_tree

const static coding_tree_fn coding_tree[]
static
Initial value:

Definition at line 2076 of file vvc_ctu.c.

Referenced by hls_coding_tree().

coding_tree_ttv
static int coding_tree_ttv(VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
Definition: vvc_ctu.c:1979
SPLIT_TT_VER
@ SPLIT_TT_VER
Definition: vvc_ctu.h:123
w
uint8_t w
Definition: llviddspenc.c:38
fc
#define fc(width, name, range_min, range_max)
Definition: cbs_av1.c:472
coding_tree_tth
static int coding_tree_tth(VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
Definition: vvc_ctu.c:2009
dual_tree_implicit_qt_split
static int dual_tree_implicit_qt_split(VVCLocalContext *lc, const int x0, const int y0, const int cb_size, const int cqt_depth)
Definition: vvc_ctu.c:2139
width
#define width
SPLIT_TT_HOR
@ SPLIT_TT_HOR
Definition: vvc_ctu.h:121
coding_tree_bth
static int coding_tree_bth(VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
Definition: vvc_ctu.c:1952
SPLIT_QT
@ SPLIT_QT
Definition: vvc_ctu.h:125
MODE_TYPE_ALL
@ MODE_TYPE_ALL
Definition: vvc_ctu.c:36
SPLIT_NONE
@ SPLIT_NONE
Definition: mss12.c:36
CTB
#define CTB(tab, x, y)
Definition: hevc_filter.c:254
SPLIT_BT_VER
@ SPLIT_BT_VER
Definition: vvc_ctu.h:124
skipped_transform_tree
static int skipped_transform_tree(VVCLocalContext *lc, int x0, int y0, int tu_width, int tu_height)
Definition: vvc_ctu.c:482
height
#define height
hls_transform_unit
static int hls_transform_unit(VVCLocalContext *lc, int x0, int y0, int tu_width, int tu_height, int sub_tu_index, int ch_type)
Definition: vvc_ctu.c:314
DUAL_TREE_LUMA
@ DUAL_TREE_LUMA
Definition: vvc_ctu.h:163
hls_transform_tree
static int hls_transform_tree(VVCLocalContext *lc, int x0, int y0, int tu_width, int tu_height, int ch_type)
Definition: vvc_ctu.c:406
value
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
Definition: writing_filters.txt:86
ret
ret
Definition: filter_design.txt:187
coding_tree_qt
static int coding_tree_qt(VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
Definition: vvc_ctu.c:2039
hls_coding_tree
static int hls_coding_tree(VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, int part_idx, VVCSplitMode last_split_mode, VVCTreeType tree_type_curr, VVCModeType mode_type_curr)
Definition: vvc_ctu.c:2084
SPLIT_BT_HOR
@ SPLIT_BT_HOR
Definition: vvc_ctu.h:122
h
h
Definition: vp9dsp_template.c:2038
coding_tree_btv
static int coding_tree_btv(VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, int qg_on_y, int qg_on_c, int cb_sub_div, int cqt_depth, int mtt_depth, int depth_offset, VVCTreeType tree_type, VVCModeType mode_type)
Definition: vvc_ctu.c:1925