FFmpeg
Data Structures | Macros | Enumerations | Functions
ctu.h File Reference
#include <stdbool.h>
#include "libavcodec/cabac.h"
#include "libavutil/mem_internal.h"
#include "dec.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
 
struct  VVCRect
 

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 MAX_SCALING_RATIO   8
 
#define EDGE_EMU_BUFFER_STRIDE   ((MAX_PB_SIZE + 32) * MAX_SCALING_RATIO)
 
#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 SCALED_INT(pos)   ((pos) >> 10)
 
#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_LEFT_SUBPIC   (1 << 2)
 
#define BOUNDARY_UPPER_SLICE   (1 << 3)
 
#define BOUNDARY_UPPER_TILE   (1 << 4)
 
#define BOUNDARY_UPPER_SUBPIC   (1 << 5)
 

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 (CodingUnit **cus)
 
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 33 of file ctu.h.

◆ MAX_CU_SIZE

#define MAX_CU_SIZE   MAX_CTU_SIZE

Definition at line 35 of file ctu.h.

◆ MIN_CU_SIZE

#define MIN_CU_SIZE   4

Definition at line 36 of file ctu.h.

◆ MIN_CU_LOG2

#define MIN_CU_LOG2   2

Definition at line 37 of file ctu.h.

◆ MAX_CU_DEPTH

#define MAX_CU_DEPTH   7

Definition at line 38 of file 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 40 of file ctu.h.

◆ MIN_PU_SIZE

#define MIN_PU_SIZE   4

Definition at line 42 of file ctu.h.

◆ MAX_TB_SIZE

#define MAX_TB_SIZE   64

Definition at line 44 of file ctu.h.

◆ MIN_TU_SIZE

#define MIN_TU_SIZE   4

Definition at line 45 of file ctu.h.

◆ MAX_TUS_IN_CU

#define MAX_TUS_IN_CU   64

Definition at line 46 of file ctu.h.

◆ MAX_QP

#define MAX_QP   63

Definition at line 48 of file ctu.h.

◆ MAX_PB_SIZE

#define MAX_PB_SIZE   128

Definition at line 50 of file ctu.h.

◆ MAX_SCALING_RATIO

#define MAX_SCALING_RATIO   8

Definition at line 51 of file ctu.h.

◆ EDGE_EMU_BUFFER_STRIDE

#define EDGE_EMU_BUFFER_STRIDE   ((MAX_PB_SIZE + 32) * MAX_SCALING_RATIO)

Definition at line 52 of file ctu.h.

◆ CHROMA_EXTRA_BEFORE

#define CHROMA_EXTRA_BEFORE   1

Definition at line 54 of file ctu.h.

◆ CHROMA_EXTRA_AFTER

#define CHROMA_EXTRA_AFTER   2

Definition at line 55 of file ctu.h.

◆ CHROMA_EXTRA

#define CHROMA_EXTRA   3

Definition at line 56 of file ctu.h.

◆ LUMA_EXTRA_BEFORE

#define LUMA_EXTRA_BEFORE   3

Definition at line 57 of file ctu.h.

◆ LUMA_EXTRA_AFTER

#define LUMA_EXTRA_AFTER   4

Definition at line 58 of file ctu.h.

◆ LUMA_EXTRA

#define LUMA_EXTRA   7

Definition at line 59 of file ctu.h.

◆ BILINEAR_EXTRA_BEFORE

#define BILINEAR_EXTRA_BEFORE   0

Definition at line 60 of file ctu.h.

◆ BILINEAR_EXTRA_AFTER

#define BILINEAR_EXTRA_AFTER   1

Definition at line 61 of file ctu.h.

◆ BILINEAR_EXTRA

#define BILINEAR_EXTRA   1

Definition at line 62 of file ctu.h.

◆ SCALED_INT

#define SCALED_INT (   pos)    ((pos) >> 10)

Definition at line 64 of file ctu.h.

◆ MAX_CONTROL_POINTS

#define MAX_CONTROL_POINTS   3

Definition at line 66 of file ctu.h.

◆ AFFINE_MIN_BLOCK_SIZE

#define AFFINE_MIN_BLOCK_SIZE   4

Definition at line 68 of file ctu.h.

◆ MRG_MAX_NUM_CANDS

#define MRG_MAX_NUM_CANDS   6

Definition at line 70 of file ctu.h.

◆ MAX_NUM_HMVP_CANDS

#define MAX_NUM_HMVP_CANDS   5

Definition at line 71 of file ctu.h.

◆ SAO_PADDING_SIZE

#define SAO_PADDING_SIZE   1

Definition at line 73 of file ctu.h.

◆ ALF_PADDING_SIZE

#define ALF_PADDING_SIZE   8

Definition at line 75 of file ctu.h.

◆ ALF_BLOCK_SIZE

#define ALF_BLOCK_SIZE   4

Definition at line 76 of file ctu.h.

◆ ALF_BORDER_LUMA

#define ALF_BORDER_LUMA   3

Definition at line 78 of file ctu.h.

◆ ALF_BORDER_CHROMA

#define ALF_BORDER_CHROMA   2

Definition at line 79 of file ctu.h.

◆ ALF_VB_POS_ABOVE_LUMA

#define ALF_VB_POS_ABOVE_LUMA   4

Definition at line 81 of file ctu.h.

◆ ALF_VB_POS_ABOVE_CHROMA

#define ALF_VB_POS_ABOVE_CHROMA   2

Definition at line 82 of file ctu.h.

◆ ALF_GRADIENT_STEP

#define ALF_GRADIENT_STEP   2

Definition at line 84 of file ctu.h.

◆ ALF_GRADIENT_BORDER

#define ALF_GRADIENT_BORDER   2

Definition at line 85 of file ctu.h.

◆ ALF_GRADIENT_SIZE

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

Definition at line 86 of file ctu.h.

◆ ALF_NUM_DIR

#define ALF_NUM_DIR   4

Definition at line 87 of file 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 93 of file ctu.h.

◆ SAMPLE_CTB

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

Definition at line 94 of file ctu.h.

◆ CTB

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

Definition at line 95 of file ctu.h.

◆ VVC_CONTEXTS

#define VVC_CONTEXTS   378

Definition at line 353 of file ctu.h.

◆ BOUNDARY_LEFT_SLICE

#define BOUNDARY_LEFT_SLICE   (1 << 0)

Definition at line 424 of file ctu.h.

◆ BOUNDARY_LEFT_TILE

#define BOUNDARY_LEFT_TILE   (1 << 1)

Definition at line 425 of file ctu.h.

◆ BOUNDARY_LEFT_SUBPIC

#define BOUNDARY_LEFT_SUBPIC   (1 << 2)

Definition at line 426 of file ctu.h.

◆ BOUNDARY_UPPER_SLICE

#define BOUNDARY_UPPER_SLICE   (1 << 3)

Definition at line 427 of file ctu.h.

◆ BOUNDARY_UPPER_TILE

#define BOUNDARY_UPPER_TILE   (1 << 4)

Definition at line 428 of file ctu.h.

◆ BOUNDARY_UPPER_SUBPIC

#define BOUNDARY_UPPER_SUBPIC   (1 << 5)

Definition at line 429 of file 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 97 of file 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 103 of file ctu.h.

◆ IspType

enum IspType
Enumerator
ISP_NO_SPLIT 
ISP_HOR_SPLIT 
ISP_VER_SPLIT 

Definition at line 118 of file ctu.h.

◆ VVCSplitMode

Enumerator
SPLIT_NONE 
SPLIT_TT_HOR 
SPLIT_BT_HOR 
SPLIT_TT_VER 
SPLIT_BT_VER 
SPLIT_QT 

Definition at line 124 of file ctu.h.

◆ MtsIdx

enum MtsIdx
Enumerator
MTS_DCT2_DCT2 
MTS_DST7_DST7 
MTS_DST7_DCT8 
MTS_DCT8_DST7 
MTS_DCT8_DCT8 

Definition at line 133 of file ctu.h.

◆ VVCTreeType

Enumerator
SINGLE_TREE 
DUAL_TREE_LUMA 
DUAL_TREE_CHROMA 

Definition at line 166 of file 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 188 of file ctu.h.

◆ MotionModelIdc

Enumerator
MOTION_TRANSLATION 
MOTION_4_PARAMS_AFFINE 
MOTION_6_PARAMS_AFFINE 

Definition at line 215 of file 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 221 of file 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 229 of file 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 2455 of file 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 ( CodingUnit **  cus)

Definition at line 2534 of file 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 2553 of file 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 2561 of file ctu.c.

Referenced by cabac_init_state(), and schedule_next_parse().