FFmpeg
Loading...
Searching...
No Matches
intra.c File Reference
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "data.h"
#include "inter.h"
#include "intra.h"
#include "itx_1d.h"

Go to the source code of this file.

Macros

#define POS(c_idx, x, y)
 
#define MIN_ISP_PRED_WIDTH   4
 
#define DCT_A   64
 
#define IBC_POS(c_idx, x, y)
 
#define IBC_X(x)
 
#define IBC_Y(y)
 

Functions

static int is_cclm (enum IntraPredMode mode)
 
static int derive_ilfnst_pred_mode_intra (const VVCLocalContext *lc, const TransformBlock *tb)
 
static void ilfnst_transform (const VVCLocalContext *lc, TransformBlock *tb)
 
static void derive_transform_type (const VVCFrameContext *fc, const VVCLocalContext *lc, const TransformBlock *tb, enum VVCTxType *trh, enum VVCTxType *trv)
 
static int add_reconstructed_area (VVCLocalContext *lc, const int ch_type, const int x0, const int y0, const int w, const int h)
 
static void add_tu_area (const TransformUnit *tu, int *x0, int *y0, int *w, int *h)
 
static int get_luma_predict_unit (const CodingUnit *cu, const TransformUnit *tu, const int idx, int *x0, int *y0, int *w, int *h)
 
static int get_chroma_predict_unit (const CodingUnit *cu, const TransformUnit *tu, const int idx, int *x0, int *y0, int *w, int *h)
 
static int predict_intra (VVCLocalContext *lc, const TransformUnit *tu, const int idx, const int target_ch_type)
 
static void scale_clip (int *coeff, const int nzw, const int w, const int h, const int shift, const int log2_transform_range)
 
static void scale (int *out, const int *in, const int w, const int h, const int shift)
 
static void derive_qp (const VVCLocalContext *lc, const TransformUnit *tu, TransformBlock *tb)
 
static av_always_inline int derive_scale (const TransformBlock *tb, const int sh_dep_quant_used_flag)
 
static const uint8_t * derive_scale_m (const VVCLocalContext *lc, const TransformBlock *tb, uint8_t *scale_m)
 
static av_always_inline int scale_coeff (const TransformBlock *tb, int coeff, const int scale, const int scale_m, const int log2_transform_range)
 
static void dequant (const VVCLocalContext *lc, const TransformUnit *tu, TransformBlock *tb)
 
static void itx_2d (const VVCFrameContext *fc, TransformBlock *tb, const enum VVCTxType trh, const enum VVCTxType trv)
 
static void itx_1d (const VVCFrameContext *fc, TransformBlock *tb, const enum VVCTxType trh, const enum VVCTxType trv)
 
static void transform_bdpcm (TransformBlock *tb, const VVCLocalContext *lc, const CodingUnit *cu)
 
static void lmcs_scale_chroma (VVCLocalContext *lc, TransformUnit *tu, TransformBlock *tb, const int target_ch_type)
 
static void add_residual (const VVCLocalContext *lc, TransformUnit *tu, const int target_ch_type)
 
static void itransform (VVCLocalContext *lc, TransformUnit *tu, const int target_ch_type)
 
static int reconstruct (VVCLocalContext *lc)
 
static void intra_block_copy (const VVCLocalContext *lc, const int c_idx)
 
static void vvc_predict_ibc (const VVCLocalContext *lc)
 
static void ibc_fill_vir_buf (const VVCLocalContext *lc, const CodingUnit *cu)
 
int ff_vvc_palette_derive_scale (VVCLocalContext *lc, const TransformUnit *tu, TransformBlock *tb)
 
static void vvc_predict_palette (VVCLocalContext *lc)
 
int ff_vvc_reconstruct (VVCLocalContext *lc, const int rs, const int rx, const int ry)
 reconstruct a CTU
 

Variables

static const uint8_t rem6 [63+8 *6+1]
 
static const uint8_t div6 [63+8 *6+1]
 
static const int level_scale [2][6]
 

Macro Definition Documentation

◆ POS

#define POS ( c_idx,
x,
y )
Value:
&fc->frame->data[c_idx][((y) >> fc->ps.sps->vshift[c_idx]) * fc->frame->linesize[c_idx] + \
(((x) >> fc->ps.sps->hshift[c_idx]) << fc->ps.sps->pixel_shift)]
static const uint16_t fc[]
Definition dcaenc.h:43

Definition at line 30 of file intra.c.

Referenced by add_residual(), ibc_fill_vir_buf(), intra_block_copy(), and vvc_predict_palette().

◆ MIN_ISP_PRED_WIDTH

#define MIN_ISP_PRED_WIDTH   4

Definition at line 199 of file intra.c.

Referenced by get_luma_predict_unit().

◆ DCT_A

#define DCT_A   64

Definition at line 431 of file intra.c.

Referenced by itx_1d(), and itx_2d().

◆ IBC_POS

#define IBC_POS ( c_idx,
x,
y )
Value:
(fc->tab.ibc_vir_buf[c_idx] + \
(x << ps) + (y + ((cu->y0 & ~(sps->ctb_size_y - 1)) >> vs)) * ibc_stride)
static int FUNC sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)

Definition at line 609 of file intra.c.

Referenced by ibc_fill_vir_buf(), and intra_block_copy().

◆ IBC_X

#define IBC_X ( x)
Value:
((x) & ((fc->tab.sz.ibc_buffer_width >> hs) - 1))

Definition at line 612 of file intra.c.

Referenced by ibc_fill_vir_buf(), and intra_block_copy().

◆ IBC_Y

#define IBC_Y ( y)
Value:
((y) & ((1 << sps->ctb_log2_size_y >> vs) - 1))

Definition at line 613 of file intra.c.

Referenced by ibc_fill_vir_buf(), and intra_block_copy().

Function Documentation

◆ is_cclm()

static int is_cclm ( enum IntraPredMode mode)
static

Definition at line 34 of file intra.c.

Referenced by derive_ilfnst_pred_mode_intra(), and predict_intra().

◆ derive_ilfnst_pred_mode_intra()

static int derive_ilfnst_pred_mode_intra ( const VVCLocalContext * lc,
const TransformBlock * tb )
static

Definition at line 39 of file intra.c.

Referenced by ilfnst_transform().

◆ ilfnst_transform()

static void ilfnst_transform ( const VVCLocalContext * lc,
TransformBlock * tb )
static

< nLfnstOutSize

< log2LfnstSize

< nLfnstSize

< nonZeroSize

Definition at line 70 of file intra.c.

Referenced by itransform().

◆ derive_transform_type()

static void derive_transform_type ( const VVCFrameContext * fc,
const VVCLocalContext * lc,
const TransformBlock * tb,
enum VVCTxType * trh,
enum VVCTxType * trv )
static

Definition at line 135 of file intra.c.

Referenced by itransform().

◆ add_reconstructed_area()

static int add_reconstructed_area ( VVCLocalContext * lc,
const int ch_type,
const int x0,
const int y0,
const int w,
const int h )
static

Definition at line 171 of file intra.c.

Referenced by ff_vvc_reconstruct(), and predict_intra().

◆ add_tu_area()

static void add_tu_area ( const TransformUnit * tu,
int * x0,
int * y0,
int * w,
int * h )
static

Definition at line 191 of file intra.c.

Referenced by get_chroma_predict_unit(), and get_luma_predict_unit().

◆ get_luma_predict_unit()

static int get_luma_predict_unit ( const CodingUnit * cu,
const TransformUnit * tu,
const int idx,
int * x0,
int * y0,
int * w,
int * h )
static

Definition at line 200 of file intra.c.

Referenced by predict_intra().

◆ get_chroma_predict_unit()

static int get_chroma_predict_unit ( const CodingUnit * cu,
const TransformUnit * tu,
const int idx,
int * x0,
int * y0,
int * w,
int * h )
static

Definition at line 211 of file intra.c.

Referenced by predict_intra().

◆ predict_intra()

static int predict_intra ( VVCLocalContext * lc,
const TransformUnit * tu,
const int idx,
const int target_ch_type )
static

Definition at line 228 of file intra.c.

Referenced by reconstruct().

◆ scale_clip()

static void scale_clip ( int * coeff,
const int nzw,
const int w,
const int h,
const int shift,
const int log2_transform_range )
static

Definition at line 264 of file intra.c.

Referenced by itx_2d().

◆ scale()

static void scale ( int * out,
const int * in,
const int w,
const int h,
const int shift )
static

Definition at line 278 of file intra.c.

Referenced by itx_1d(), and itx_2d().

◆ derive_qp()

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

Definition at line 291 of file intra.c.

Referenced by dequant(), and ff_vvc_palette_derive_scale().

◆ derive_scale()

static av_always_inline int derive_scale ( const TransformBlock * tb,
const int sh_dep_quant_used_flag )
static

Definition at line 342 of file intra.c.

Referenced by dequant().

◆ derive_scale_m()

static const uint8_t * derive_scale_m ( const VVCLocalContext * lc,
const TransformBlock * tb,
uint8_t * scale_m )
static

Definition at line 351 of file intra.c.

Referenced by dequant().

◆ scale_coeff()

static av_always_inline int scale_coeff ( const TransformBlock * tb,
int coeff,
const int scale,
const int scale_m,
const int log2_transform_range )
static

Definition at line 400 of file intra.c.

Referenced by dequant(), lmcs_derive_lut(), and lmcs_derive_lut_sample().

◆ dequant()

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

Definition at line 408 of file intra.c.

Referenced by itransform().

◆ itx_2d()

static void itx_2d ( const VVCFrameContext * fc,
TransformBlock * tb,
const enum VVCTxType trh,
const enum VVCTxType trv )
static

Definition at line 432 of file intra.c.

Referenced by itransform().

◆ itx_1d()

static void itx_1d ( const VVCFrameContext * fc,
TransformBlock * tb,
const enum VVCTxType trh,
const enum VVCTxType trv )
static

Definition at line 461 of file intra.c.

Referenced by itransform().

◆ transform_bdpcm()

static void transform_bdpcm ( TransformBlock * tb,
const VVCLocalContext * lc,
const CodingUnit * cu )
static

Definition at line 487 of file intra.c.

Referenced by itransform().

◆ lmcs_scale_chroma()

static void lmcs_scale_chroma ( VVCLocalContext * lc,
TransformUnit * tu,
TransformBlock * tb,
const int target_ch_type )
static

Definition at line 500 of file intra.c.

Referenced by ff_vvc_intra_dsp_init(), itransform(), and lmcs_scale_chroma().

◆ add_residual()

static void add_residual ( const VVCLocalContext * lc,
TransformUnit * tu,
const int target_ch_type )
static

Definition at line 528 of file intra.c.

Referenced by itransform().

◆ itransform()

static void itransform ( VVCLocalContext * lc,
TransformUnit * tu,
const int target_ch_type )
static

Definition at line 547 of file intra.c.

Referenced by reconstruct().

◆ reconstruct()

static int reconstruct ( VVCLocalContext * lc)
static

Definition at line 588 of file intra.c.

Referenced by ff_vvc_reconstruct().

◆ intra_block_copy()

static void intra_block_copy ( const VVCLocalContext * lc,
const int c_idx )
static

< IbcBufWidthY and IbcBufWidthC

Definition at line 615 of file intra.c.

Referenced by vvc_predict_ibc().

◆ vvc_predict_ibc()

static void vvc_predict_ibc ( const VVCLocalContext * lc)
static

Definition at line 646 of file intra.c.

Referenced by ff_vvc_reconstruct().

◆ ibc_fill_vir_buf()

static void ibc_fill_vir_buf ( const VVCLocalContext * lc,
const CodingUnit * cu )
static

Definition at line 657 of file intra.c.

Referenced by ff_vvc_reconstruct().

◆ ff_vvc_palette_derive_scale()

int ff_vvc_palette_derive_scale ( VVCLocalContext * lc,
const TransformUnit * tu,
TransformBlock * tb )

Definition at line 680 of file intra.c.

Referenced by palette_subblock_data().

◆ vvc_predict_palette()

static void vvc_predict_palette ( VVCLocalContext * lc)
static

Definition at line 692 of file intra.c.

Referenced by ff_vvc_reconstruct().

◆ ff_vvc_reconstruct()

int ff_vvc_reconstruct ( VVCLocalContext * lc,
const int rs,
const int rx,
const int ry )

reconstruct a CTU

Parameters
lclocal context for CTU
rsraster order for the CTU.
rxraster order x for the CTU.
ryraster order y for the CTU.
Returns
AVERROR

Definition at line 712 of file intra.c.

Referenced by run_recon().

Variable Documentation

◆ rem6

const uint8_t rem6[63+8 *6+1]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
}

Definition at line 320 of file intra.c.

Referenced by derive_scale(), ff_hevc_hls_residual_coding(), and ff_vvc_palette_derive_scale().

◆ div6

const uint8_t div6[63+8 *6+1]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15,
16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18,
}

Definition at line 328 of file intra.c.

Referenced by derive_scale(), ff_hevc_hls_residual_coding(), and ff_vvc_palette_derive_scale().

◆ level_scale

const int level_scale[2][6]
static
Initial value:
= {
{ 40, 45, 51, 57, 64, 72 },
{ 57, 64, 72, 80, 90, 102 }
}

Definition at line 336 of file intra.c.

Referenced by apv_decode_tile_component(), build_dct_push_const(), check_decode_transquant(), derive_scale(), ff_hevc_hls_residual_coding(), and ff_vvc_palette_derive_scale().