FFmpeg
Data Structures | Macros | Enumerations | Functions
vvc_ctu.h File Reference
#include "libavcodec/cabac.h"
#include "libavutil/mem_internal.h"
#include "vvcdec.h"

Go to the source code of this file.

Data Structures

struct  NeighbourAvailable
 
struct  TransformBlock
 
struct  TransformUnit
 
struct  Mv
 
struct  MvField
 
struct  DMVRInfo
 
struct  MotionInfo
 
struct  PredictionUnit
 
struct  CodingUnit
 
struct  CTU
 
struct  ReconstructedArea
 
struct  VVCCabacState
 
struct  EntryPoint
 
struct  VVCLocalContext
 
struct  VVCAllowedSplit
 
struct  SAOParams
 
struct  ALFParams
 

Macros

#define MAX_CTU_SIZE   128
 
#define MAX_CU_SIZE   MAX_CTU_SIZE
 
#define MIN_CU_SIZE   4
 
#define MIN_CU_LOG2   2
 
#define MAX_CU_DEPTH   7
 
#define MAX_PARTS_IN_CTU   ((MAX_CTU_SIZE >> MIN_CU_LOG2) * (MAX_CTU_SIZE >> MIN_CU_LOG2))
 
#define MIN_PU_SIZE   4
 
#define MAX_TB_SIZE   64
 
#define MIN_TU_SIZE   4
 
#define MAX_TUS_IN_CU   64
 
#define MAX_QP   63
 
#define MAX_PB_SIZE   128
 
#define EDGE_EMU_BUFFER_STRIDE   (MAX_PB_SIZE + 32)
 
#define CHROMA_EXTRA_BEFORE   1
 
#define CHROMA_EXTRA_AFTER   2
 
#define CHROMA_EXTRA   3
 
#define LUMA_EXTRA_BEFORE   3
 
#define LUMA_EXTRA_AFTER   4
 
#define LUMA_EXTRA   7
 
#define BILINEAR_EXTRA_BEFORE   0
 
#define BILINEAR_EXTRA_AFTER   1
 
#define BILINEAR_EXTRA   1
 
#define MAX_CONTROL_POINTS   3
 
#define AFFINE_MIN_BLOCK_SIZE   4
 
#define MRG_MAX_NUM_CANDS   6
 
#define MAX_NUM_HMVP_CANDS   5
 
#define SAO_PADDING_SIZE   1
 
#define ALF_PADDING_SIZE   8
 
#define ALF_BLOCK_SIZE   4
 
#define ALF_BORDER_LUMA   3
 
#define ALF_BORDER_CHROMA   2
 
#define ALF_VB_POS_ABOVE_LUMA   4
 
#define ALF_VB_POS_ABOVE_CHROMA   2
 
#define ALF_GRADIENT_STEP   2
 
#define ALF_GRADIENT_BORDER   2
 
#define ALF_GRADIENT_SIZE   ((MAX_CU_SIZE + ALF_GRADIENT_BORDER * 2) / ALF_GRADIENT_STEP)
 
#define ALF_NUM_DIR   4
 
#define SAMPLE(tab, x, y)   ((tab)[(y) * s->pps->width + (x)])
 Value of the luma sample at position (x, y) in the 2D array tab. More...
 
#define SAMPLE_CTB(tab, x, y)   ((tab)[(y) * min_cb_width + (x)])
 
#define CTB(tab, x, y)   ((tab)[(y) * fc->ps.pps->ctb_width + (x)])
 
#define VVC_CONTEXTS   378
 
#define BOUNDARY_LEFT_SLICE   (1 << 0)
 
#define BOUNDARY_LEFT_TILE   (1 << 1)
 
#define BOUNDARY_UPPER_SLICE   (1 << 2)
 
#define BOUNDARY_UPPER_TILE   (1 << 3)
 

Enumerations

enum  SAOType {
  SAO_NOT_APPLIED = 0, SAO_BAND, SAO_EDGE, SAO_APPLIED,
  SAO_NOT_APPLIED = 0, SAO_BAND, SAO_EDGE
}
 
enum  SAOEOClass {
  SAO_EO_HORIZ = 0, SAO_EO_VERT, SAO_EO_135D, SAO_EO_45D,
  SAO_EO_HORIZ = 0, SAO_EO_VERT, SAO_EO_135D, SAO_EO_45D
}
 
enum  IspType { ISP_NO_SPLIT, ISP_HOR_SPLIT, ISP_VER_SPLIT }
 
enum  VVCSplitMode {
  SPLIT_NONE, SPLIT_TT_HOR, SPLIT_BT_HOR, SPLIT_TT_VER,
  SPLIT_BT_VER, SPLIT_QT
}
 
enum  MtsIdx {
  MTS_DCT2_DCT2, MTS_DST7_DST7, MTS_DST7_DCT8, MTS_DCT8_DST7,
  MTS_DCT8_DCT8
}
 
enum  VVCTreeType { SINGLE_TREE, DUAL_TREE_LUMA, DUAL_TREE_CHROMA }
 
enum  PredMode {
  MODE_INTER = 0, MODE_INTRA, MODE_SKIP, MODE_INTER,
  MODE_INTRA, MODE_SKIP, MODE_PLT, MODE_IBC
}
 
enum  MotionModelIdc { MOTION_TRANSLATION, MOTION_4_PARAMS_AFFINE, MOTION_6_PARAMS_AFFINE }
 
enum  PredFlag {
  PF_INTRA = 0, PF_L0, PF_L1, PF_BI,
  PF_INTRA = 0x0, PF_L0 = 0x1, PF_L1 = 0x2, PF_BI = 0x3,
  PF_IBC = PF_L0 | 0x4
}
 
enum  IntraPredMode {
  INTRA_PLANAR = 0, INTRA_DC, INTRA_ANGULAR_2, INTRA_ANGULAR_3,
  INTRA_ANGULAR_4, INTRA_ANGULAR_5, INTRA_ANGULAR_6, INTRA_ANGULAR_7,
  INTRA_ANGULAR_8, INTRA_ANGULAR_9, INTRA_ANGULAR_10, INTRA_ANGULAR_11,
  INTRA_ANGULAR_12, INTRA_ANGULAR_13, INTRA_ANGULAR_14, INTRA_ANGULAR_15,
  INTRA_ANGULAR_16, INTRA_ANGULAR_17, INTRA_ANGULAR_18, INTRA_ANGULAR_19,
  INTRA_ANGULAR_20, INTRA_ANGULAR_21, INTRA_ANGULAR_22, INTRA_ANGULAR_23,
  INTRA_ANGULAR_24, INTRA_ANGULAR_25, INTRA_ANGULAR_26, INTRA_ANGULAR_27,
  INTRA_ANGULAR_28, INTRA_ANGULAR_29, INTRA_ANGULAR_30, INTRA_ANGULAR_31,
  INTRA_ANGULAR_32, INTRA_ANGULAR_33, INTRA_ANGULAR_34, VERT_PRED,
  HOR_PRED, DC_PRED, DIAG_DOWN_LEFT_PRED, DIAG_DOWN_RIGHT_PRED,
  VERT_RIGHT_PRED, HOR_DOWN_PRED, VERT_LEFT_PRED, HOR_UP_PRED,
  TM_VP8_PRED, LEFT_DC_PRED, TOP_DC_PRED, DC_128_PRED,
  DC_127_PRED, DC_129_PRED, N_INTRA_PRED_MODES, INTRA_INVALID = -1,
  INTRA_PLANAR = 0, INTRA_DC, INTRA_HORZ = 18, INTRA_DIAG = 34,
  INTRA_VERT = 50, INTRA_VDIAG = 66, INTRA_LT_CCLM = 81, INTRA_L_CCLM,
  INTRA_T_CCLM
}
 

Functions

int ff_vvc_coding_tree_unit (VVCLocalContext *lc, int ctu_idx, int rs, int rx, int ry)
 parse a CTU More...
 
void ff_vvc_set_neighbour_available (VVCLocalContext *lc, int x0, int y0, int w, int h)
 
void ff_vvc_decode_neighbour (VVCLocalContext *lc, int x_ctb, int y_ctb, int rx, int ry, int rs)
 
void ff_vvc_ctu_free_cus (CTU *ctu)
 
int ff_vvc_get_qPy (const VVCFrameContext *fc, int xc, int yc)
 
void ff_vvc_ep_init_stat_coeff (EntryPoint *ep, int bit_depth, int persistent_rice_adaptation_enabled_flag)
 

Macro Definition Documentation

◆ MAX_CTU_SIZE

#define MAX_CTU_SIZE   128

Definition at line 31 of file vvc_ctu.h.

◆ MAX_CU_SIZE

#define MAX_CU_SIZE   MAX_CTU_SIZE

Definition at line 33 of file vvc_ctu.h.

◆ MIN_CU_SIZE

#define MIN_CU_SIZE   4

Definition at line 34 of file vvc_ctu.h.

◆ MIN_CU_LOG2

#define MIN_CU_LOG2   2

Definition at line 35 of file vvc_ctu.h.

◆ MAX_CU_DEPTH

#define MAX_CU_DEPTH   7

Definition at line 36 of file vvc_ctu.h.

◆ MAX_PARTS_IN_CTU

#define MAX_PARTS_IN_CTU   ((MAX_CTU_SIZE >> MIN_CU_LOG2) * (MAX_CTU_SIZE >> MIN_CU_LOG2))

Definition at line 38 of file vvc_ctu.h.

◆ MIN_PU_SIZE

#define MIN_PU_SIZE   4

Definition at line 40 of file vvc_ctu.h.

◆ MAX_TB_SIZE

#define MAX_TB_SIZE   64

Definition at line 42 of file vvc_ctu.h.

◆ MIN_TU_SIZE

#define MIN_TU_SIZE   4

Definition at line 43 of file vvc_ctu.h.

◆ MAX_TUS_IN_CU

#define MAX_TUS_IN_CU   64

Definition at line 44 of file vvc_ctu.h.

◆ MAX_QP

#define MAX_QP   63

Definition at line 46 of file vvc_ctu.h.

◆ MAX_PB_SIZE

#define MAX_PB_SIZE   128

Definition at line 48 of file vvc_ctu.h.

◆ EDGE_EMU_BUFFER_STRIDE

#define EDGE_EMU_BUFFER_STRIDE   (MAX_PB_SIZE + 32)

Definition at line 49 of file vvc_ctu.h.

◆ CHROMA_EXTRA_BEFORE

#define CHROMA_EXTRA_BEFORE   1

Definition at line 51 of file vvc_ctu.h.

◆ CHROMA_EXTRA_AFTER

#define CHROMA_EXTRA_AFTER   2

Definition at line 52 of file vvc_ctu.h.

◆ CHROMA_EXTRA

#define CHROMA_EXTRA   3

Definition at line 53 of file vvc_ctu.h.

◆ LUMA_EXTRA_BEFORE

#define LUMA_EXTRA_BEFORE   3

Definition at line 54 of file vvc_ctu.h.

◆ LUMA_EXTRA_AFTER

#define LUMA_EXTRA_AFTER   4

Definition at line 55 of file vvc_ctu.h.

◆ LUMA_EXTRA

#define LUMA_EXTRA   7

Definition at line 56 of file vvc_ctu.h.

◆ BILINEAR_EXTRA_BEFORE

#define BILINEAR_EXTRA_BEFORE   0

Definition at line 57 of file vvc_ctu.h.

◆ BILINEAR_EXTRA_AFTER

#define BILINEAR_EXTRA_AFTER   1

Definition at line 58 of file vvc_ctu.h.

◆ BILINEAR_EXTRA

#define BILINEAR_EXTRA   1

Definition at line 59 of file vvc_ctu.h.

◆ MAX_CONTROL_POINTS

#define MAX_CONTROL_POINTS   3

Definition at line 61 of file vvc_ctu.h.

◆ AFFINE_MIN_BLOCK_SIZE

#define AFFINE_MIN_BLOCK_SIZE   4

Definition at line 63 of file vvc_ctu.h.

◆ MRG_MAX_NUM_CANDS

#define MRG_MAX_NUM_CANDS   6

Definition at line 65 of file vvc_ctu.h.

◆ MAX_NUM_HMVP_CANDS

#define MAX_NUM_HMVP_CANDS   5

Definition at line 66 of file vvc_ctu.h.

◆ SAO_PADDING_SIZE

#define SAO_PADDING_SIZE   1

Definition at line 68 of file vvc_ctu.h.

◆ ALF_PADDING_SIZE

#define ALF_PADDING_SIZE   8

Definition at line 70 of file vvc_ctu.h.

◆ ALF_BLOCK_SIZE

#define ALF_BLOCK_SIZE   4

Definition at line 71 of file vvc_ctu.h.

◆ ALF_BORDER_LUMA

#define ALF_BORDER_LUMA   3

Definition at line 73 of file vvc_ctu.h.

◆ ALF_BORDER_CHROMA

#define ALF_BORDER_CHROMA   2

Definition at line 74 of file vvc_ctu.h.

◆ ALF_VB_POS_ABOVE_LUMA

#define ALF_VB_POS_ABOVE_LUMA   4

Definition at line 76 of file vvc_ctu.h.

◆ ALF_VB_POS_ABOVE_CHROMA

#define ALF_VB_POS_ABOVE_CHROMA   2

Definition at line 77 of file vvc_ctu.h.

◆ ALF_GRADIENT_STEP

#define ALF_GRADIENT_STEP   2

Definition at line 79 of file vvc_ctu.h.

◆ ALF_GRADIENT_BORDER

#define ALF_GRADIENT_BORDER   2

Definition at line 80 of file vvc_ctu.h.

◆ ALF_GRADIENT_SIZE

#define ALF_GRADIENT_SIZE   ((MAX_CU_SIZE + ALF_GRADIENT_BORDER * 2) / ALF_GRADIENT_STEP)

Definition at line 81 of file vvc_ctu.h.

◆ ALF_NUM_DIR

#define ALF_NUM_DIR   4

Definition at line 82 of file vvc_ctu.h.

◆ SAMPLE

#define SAMPLE (   tab,
  x,
 
)    ((tab)[(y) * s->pps->width + (x)])

Value of the luma sample at position (x, y) in the 2D array tab.

Definition at line 88 of file vvc_ctu.h.

◆ SAMPLE_CTB

#define SAMPLE_CTB (   tab,
  x,
 
)    ((tab)[(y) * min_cb_width + (x)])

Definition at line 89 of file vvc_ctu.h.

◆ CTB

#define CTB (   tab,
  x,
 
)    ((tab)[(y) * fc->ps.pps->ctb_width + (x)])

Definition at line 90 of file vvc_ctu.h.

◆ VVC_CONTEXTS

#define VVC_CONTEXTS   378

Definition at line 348 of file vvc_ctu.h.

◆ BOUNDARY_LEFT_SLICE

#define BOUNDARY_LEFT_SLICE   (1 << 0)

Definition at line 422 of file vvc_ctu.h.

◆ BOUNDARY_LEFT_TILE

#define BOUNDARY_LEFT_TILE   (1 << 1)

Definition at line 423 of file vvc_ctu.h.

◆ BOUNDARY_UPPER_SLICE

#define BOUNDARY_UPPER_SLICE   (1 << 2)

Definition at line 424 of file vvc_ctu.h.

◆ BOUNDARY_UPPER_TILE

#define BOUNDARY_UPPER_TILE   (1 << 3)

Definition at line 425 of file vvc_ctu.h.

Enumeration Type Documentation

◆ SAOType

enum SAOType
Enumerator
SAO_NOT_APPLIED 
SAO_BAND 
SAO_EDGE 
SAO_APPLIED 
SAO_NOT_APPLIED 
SAO_BAND 
SAO_EDGE 

Definition at line 92 of file vvc_ctu.h.

◆ SAOEOClass

enum SAOEOClass
Enumerator
SAO_EO_HORIZ 
SAO_EO_VERT 
SAO_EO_135D 
SAO_EO_45D 
SAO_EO_HORIZ 
SAO_EO_VERT 
SAO_EO_135D 
SAO_EO_45D 

Definition at line 98 of file vvc_ctu.h.

◆ IspType

enum IspType
Enumerator
ISP_NO_SPLIT 
ISP_HOR_SPLIT 
ISP_VER_SPLIT 

Definition at line 113 of file vvc_ctu.h.

◆ VVCSplitMode

Enumerator
SPLIT_NONE 
SPLIT_TT_HOR 
SPLIT_BT_HOR 
SPLIT_TT_VER 
SPLIT_BT_VER 
SPLIT_QT 

Definition at line 119 of file vvc_ctu.h.

◆ MtsIdx

enum MtsIdx
Enumerator
MTS_DCT2_DCT2 
MTS_DST7_DST7 
MTS_DST7_DCT8 
MTS_DCT8_DST7 
MTS_DCT8_DCT8 

Definition at line 128 of file vvc_ctu.h.

◆ VVCTreeType

Enumerator
SINGLE_TREE 
DUAL_TREE_LUMA 
DUAL_TREE_CHROMA 

Definition at line 161 of file vvc_ctu.h.

◆ PredMode

enum PredMode
Enumerator
MODE_INTER 
MODE_INTRA 
MODE_SKIP 
MODE_INTER 
MODE_INTRA 
MODE_SKIP 
MODE_PLT 
MODE_IBC 

Definition at line 182 of file vvc_ctu.h.

◆ MotionModelIdc

Enumerator
MOTION_TRANSLATION 
MOTION_4_PARAMS_AFFINE 
MOTION_6_PARAMS_AFFINE 

Definition at line 209 of file vvc_ctu.h.

◆ PredFlag

enum PredFlag
Enumerator
PF_INTRA 
PF_L0 
PF_L1 
PF_BI 
PF_INTRA 
PF_L0 
PF_L1 
PF_BI 
PF_IBC 

Definition at line 215 of file vvc_ctu.h.

◆ IntraPredMode

Enumerator
INTRA_PLANAR 
INTRA_DC 
INTRA_ANGULAR_2 
INTRA_ANGULAR_3 
INTRA_ANGULAR_4 
INTRA_ANGULAR_5 
INTRA_ANGULAR_6 
INTRA_ANGULAR_7 
INTRA_ANGULAR_8 
INTRA_ANGULAR_9 
INTRA_ANGULAR_10 
INTRA_ANGULAR_11 
INTRA_ANGULAR_12 
INTRA_ANGULAR_13 
INTRA_ANGULAR_14 
INTRA_ANGULAR_15 
INTRA_ANGULAR_16 
INTRA_ANGULAR_17 
INTRA_ANGULAR_18 
INTRA_ANGULAR_19 
INTRA_ANGULAR_20 
INTRA_ANGULAR_21 
INTRA_ANGULAR_22 
INTRA_ANGULAR_23 
INTRA_ANGULAR_24 
INTRA_ANGULAR_25 
INTRA_ANGULAR_26 
INTRA_ANGULAR_27 
INTRA_ANGULAR_28 
INTRA_ANGULAR_29 
INTRA_ANGULAR_30 
INTRA_ANGULAR_31 
INTRA_ANGULAR_32 
INTRA_ANGULAR_33 
INTRA_ANGULAR_34 
VERT_PRED 
HOR_PRED 
DC_PRED 
DIAG_DOWN_LEFT_PRED 
DIAG_DOWN_RIGHT_PRED 
VERT_RIGHT_PRED 
HOR_DOWN_PRED 
VERT_LEFT_PRED 
HOR_UP_PRED 
TM_VP8_PRED 
LEFT_DC_PRED 
TOP_DC_PRED 
DC_128_PRED 
DC_127_PRED 
DC_129_PRED 
N_INTRA_PRED_MODES 
INTRA_INVALID 
INTRA_PLANAR 
INTRA_DC 
INTRA_HORZ 
INTRA_DIAG 
INTRA_VERT 
INTRA_VDIAG 
INTRA_LT_CCLM 
INTRA_L_CCLM 
INTRA_T_CCLM 

Definition at line 223 of file vvc_ctu.h.

Function Documentation

◆ 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_set_neighbour_available()

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

◆ ff_vvc_decode_neighbour()

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

◆ 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,
int  xc,
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,
int  bit_depth,
int  persistent_rice_adaptation_enabled_flag 
)

Definition at line 2544 of file vvc_ctu.c.

Referenced by cabac_init_state(), and schedule_next_parse().