FFmpeg
Loading...
Searching...
No Matches
filter_template.c File Reference

Go to the source code of this file.

Macros

#define ALF_DIR_VERT   0
 
#define ALF_DIR_HORZ   1
 
#define ALF_DIR_DIGA0   2
 
#define ALF_DIR_DIGA1   3
 
#define P7   pix[-8 * xstride]
 
#define P6   pix[-7 * xstride]
 
#define P5   pix[-6 * xstride]
 
#define P4   pix[-5 * xstride]
 
#define P3   pix[-4 * xstride]
 
#define P2   pix[-3 * xstride]
 
#define P1   pix[-2 * xstride]
 
#define P0   pix[-1 * xstride]
 
#define Q0   pix[0 * xstride]
 
#define Q1   pix[1 * xstride]
 
#define Q2   pix[2 * xstride]
 
#define Q3   pix[3 * xstride]
 
#define Q4   pix[4 * xstride]
 
#define Q5   pix[5 * xstride]
 
#define Q6   pix[6 * xstride]
 
#define Q7   pix[7 * xstride]
 
#define P(x)
 
#define Q(x)
 
#define TP7   pix[-8 * xstride + 3 * ystride]
 
#define TP6   pix[-7 * xstride + 3 * ystride]
 
#define TP5   pix[-6 * xstride + 3 * ystride]
 
#define TP4   pix[-5 * xstride + 3 * ystride]
 
#define TP3   pix[-4 * xstride + 3 * ystride]
 
#define TP2   pix[-3 * xstride + 3 * ystride]
 
#define TP1   pix[-2 * xstride + 3 * ystride]
 
#define TP0   pix[-1 * xstride + 3 * ystride]
 
#define TQ0   pix[0 * xstride + 3 * ystride]
 
#define TQ1   pix[1 * xstride + 3 * ystride]
 
#define TQ2   pix[2 * xstride + 3 * ystride]
 
#define TQ3   pix[3 * xstride + 3 * ystride]
 
#define TQ4   pix[4 * xstride + 3 * ystride]
 
#define TQ5   pix[5 * xstride + 3 * ystride]
 
#define TQ6   pix[6 * xstride + 3 * ystride]
 
#define TQ7   pix[7 * xstride + 3 * ystride]
 
#define TP(x)
 
#define TQ(x)
 
#define FP3   pix[-4 * xstride + 1 * ystride]
 
#define FP2   pix[-3 * xstride + 1 * ystride]
 
#define FP1   pix[-2 * xstride + 1 * ystride]
 
#define FP0   pix[-1 * xstride + 1 * ystride]
 
#define FQ0   pix[0 * xstride + 1 * ystride]
 
#define FQ1   pix[1 * xstride + 1 * ystride]
 
#define FQ2   pix[2 * xstride + 1 * ystride]
 
#define FQ3   pix[3 * xstride + 1 * ystride]
 

Functions

static void FUNC lmcs_filter_luma (uint8_t *_dst, ptrdiff_t dst_stride, const int width, const int height, const void *_lut)
 
static av_always_inline int16_t FUNC alf_clip (pixel curr, pixel v0, pixel v1, int16_t clip)
 
static void FUNC alf_filter_luma (uint8_t *_dst, ptrdiff_t dst_stride, const uint8_t *_src, ptrdiff_t src_stride, const int width, const int height, const int16_t *filter, const int16_t *clip, const int vb_pos)
 
static void FUNC alf_filter_chroma (uint8_t *_dst, ptrdiff_t dst_stride, const uint8_t *_src, ptrdiff_t src_stride, const int width, const int height, const int16_t *filter, const int16_t *clip, const int vb_pos)
 
static void FUNC alf_filter_cc (uint8_t *_dst, ptrdiff_t dst_stride, const uint8_t *_luma, const ptrdiff_t luma_stride, const int width, const int height, const int hs, const int vs, const int16_t *filter, const int vb_pos)
 
static void FUNC alf_get_idx (int *class_idx, int *transpose_idx, const int *sum, const int ac)
 
static void FUNC alf_classify (int *class_idx, int *transpose_idx, const uint8_t *_src, const ptrdiff_t _src_stride, const int width, const int height, const int vb_pos, int *gradient_tmp)
 
static void FUNC alf_recon_coeff_and_clip (int16_t *coeff, int16_t *clip, const int *class_idx, const int *transpose_idx, const int size, const int16_t *coeff_set, const uint8_t *clip_idx_set, const uint8_t *class_to_filt)
 
static void FUNC loop_filter_luma_large (pixel *pix, const ptrdiff_t xstride, const ptrdiff_t ystride, const int32_t tc, const uint8_t no_p, const uint8_t no_q, const uint8_t max_len_p, const uint8_t max_len_q)
 
static void FUNC vvc_loop_filter_luma (uint8_t *_pix, ptrdiff_t _xstride, ptrdiff_t _ystride, const int32_t *_beta, const int32_t *_tc, const uint8_t *_no_p, const uint8_t *_no_q, const uint8_t *_max_len_p, const uint8_t *_max_len_q, const int hor_ctu_edge)
 
static void FUNC loop_filter_chroma_strong (pixel *pix, const ptrdiff_t xstride, const ptrdiff_t ystride, const int size, const int32_t tc, const uint8_t no_p, const uint8_t no_q)
 
static void FUNC loop_filter_chroma_strong_one_side (pixel *pix, const ptrdiff_t xstride, const ptrdiff_t ystride, const int size, const int32_t tc, const uint8_t no_p, const uint8_t no_q)
 
static void FUNC vvc_loop_filter_chroma (uint8_t *_pix, const ptrdiff_t _xstride, const ptrdiff_t _ystride, const int32_t *_beta, const int32_t *_tc, const uint8_t *_no_p, const uint8_t *_no_q, const uint8_t *_max_len_p, const uint8_t *_max_len_q, const int shift)
 
static void FUNC vvc_h_loop_filter_chroma (uint8_t *pix, ptrdiff_t stride, const int32_t *beta, const int32_t *tc, const uint8_t *no_p, const uint8_t *no_q, const uint8_t *max_len_p, const uint8_t *max_len_q, int shift)
 
static void FUNC vvc_v_loop_filter_chroma (uint8_t *pix, ptrdiff_t stride, const int32_t *beta, const int32_t *tc, const uint8_t *no_p, const uint8_t *no_q, const uint8_t *max_len_p, const uint8_t *max_len_q, int shift)
 
static void FUNC vvc_h_loop_filter_luma (uint8_t *pix, ptrdiff_t stride, const int32_t *beta, const int32_t *tc, const uint8_t *no_p, const uint8_t *no_q, const uint8_t *max_len_p, const uint8_t *max_len_q, const int hor_ctu_edge)
 
static void FUNC vvc_v_loop_filter_luma (uint8_t *pix, ptrdiff_t stride, const int32_t *beta, const int32_t *tc, const uint8_t *no_p, const uint8_t *no_q, const uint8_t *max_len_p, const uint8_t *max_len_q, const int hor_ctu_edge)
 
static int FUNC vvc_loop_ladf_level (const uint8_t *_pix, const ptrdiff_t _xstride, const ptrdiff_t _ystride)
 
static int FUNC vvc_h_loop_ladf_level (const uint8_t *pix, ptrdiff_t stride)
 
static int FUNC vvc_v_loop_ladf_level (const uint8_t *pix, ptrdiff_t stride)
 
static void FUNC ff_vvc_lmcs_dsp_init (VVCLMCSDSPContext *const lmcs)
 
static void FUNC ff_vvc_lf_dsp_init (VVCLFDSPContext *const lf)
 
static void FUNC ff_vvc_sao_dsp_init (VVCSAODSPContext *const sao)
 
static void FUNC ff_vvc_alf_dsp_init (VVCALFDSPContext *const alf)
 

Macro Definition Documentation

◆ ALF_DIR_VERT

#define ALF_DIR_VERT   0

Definition at line 255 of file filter_template.c.

◆ ALF_DIR_HORZ

#define ALF_DIR_HORZ   1

Definition at line 256 of file filter_template.c.

◆ ALF_DIR_DIGA0

#define ALF_DIR_DIGA0   2

Definition at line 257 of file filter_template.c.

◆ ALF_DIR_DIGA1

#define ALF_DIR_DIGA1   3

Definition at line 258 of file filter_template.c.

◆ P7

#define P7   pix[-8 * xstride]

Definition at line 406 of file filter_template.c.

Referenced by nvenc_map_preset(), and vvc_loop_filter_luma().

◆ P6

#define P6   pix[-7 * xstride]

◆ P5

#define P5   pix[-6 * xstride]

◆ P4

#define P4   pix[-5 * xstride]

◆ P3

#define P3   pix[-4 * xstride]

Definition at line 410 of file filter_template.c.

◆ P2

#define P2   pix[-3 * xstride]

Definition at line 411 of file filter_template.c.

◆ P1

#define P1   pix[-2 * xstride]

Definition at line 412 of file filter_template.c.

◆ P0

#define P0   pix[-1 * xstride]

Definition at line 413 of file filter_template.c.

◆ Q0

#define Q0   pix[0 * xstride]

Definition at line 414 of file filter_template.c.

◆ Q1

#define Q1   pix[1 * xstride]

Definition at line 415 of file filter_template.c.

◆ Q2

#define Q2   pix[2 * xstride]

Definition at line 416 of file filter_template.c.

◆ Q3

#define Q3   pix[3 * xstride]

Definition at line 417 of file filter_template.c.

◆ Q4

#define Q4   pix[4 * xstride]

Definition at line 418 of file filter_template.c.

Referenced by loop_filter_luma_large(), and vvc_loop_filter_luma().

◆ Q5

#define Q5   pix[5 * xstride]

Definition at line 419 of file filter_template.c.

Referenced by loop_filter_luma_large(), and vvc_loop_filter_luma().

◆ Q6

#define Q6   pix[6 * xstride]

Definition at line 420 of file filter_template.c.

Referenced by loop_filter_luma_large(), and vvc_loop_filter_luma().

◆ Q7

#define Q7   pix[7 * xstride]

Definition at line 421 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ P

#define P ( x)
Value:
pix[(-(x)-1) * xstride]
enum AVPixelFormat pix
Definition ohcodec.c:55

Definition at line 422 of file filter_template.c.

Referenced by loop_filter_luma_large(), and vvc_loop_filter_luma().

◆ Q

#define Q ( x)
Value:
pix[(x) * xstride]

Definition at line 423 of file filter_template.c.

Referenced by loop_filter_luma_large(), and vvc_loop_filter_luma().

◆ TP7

#define TP7   pix[-8 * xstride + 3 * ystride]

Definition at line 426 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TP6

#define TP6   pix[-7 * xstride + 3 * ystride]

Definition at line 427 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TP5

#define TP5   pix[-6 * xstride + 3 * ystride]

Definition at line 428 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TP4

#define TP4   pix[-5 * xstride + 3 * ystride]

Definition at line 429 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TP3

#define TP3   pix[-4 * xstride + 3 * ystride]

Definition at line 430 of file filter_template.c.

◆ TP2

#define TP2   pix[-3 * xstride + 3 * ystride]

Definition at line 431 of file filter_template.c.

◆ TP1

#define TP1   pix[-2 * xstride + 3 * ystride]

Definition at line 432 of file filter_template.c.

◆ TP0

#define TP0   pix[-1 * xstride + 3 * ystride]

Definition at line 433 of file filter_template.c.

◆ TQ0

#define TQ0   pix[0 * xstride + 3 * ystride]

Definition at line 434 of file filter_template.c.

◆ TQ1

#define TQ1   pix[1 * xstride + 3 * ystride]

Definition at line 435 of file filter_template.c.

◆ TQ2

#define TQ2   pix[2 * xstride + 3 * ystride]

Definition at line 436 of file filter_template.c.

◆ TQ3

#define TQ3   pix[3 * xstride + 3 * ystride]

Definition at line 437 of file filter_template.c.

◆ TQ4

#define TQ4   pix[4 * xstride + 3 * ystride]

Definition at line 438 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TQ5

#define TQ5   pix[5 * xstride + 3 * ystride]

Definition at line 439 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TQ6

#define TQ6   pix[6 * xstride + 3 * ystride]

Definition at line 440 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TQ7

#define TQ7   pix[7 * xstride + 3 * ystride]

Definition at line 441 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TP

#define TP ( x)
Value:
pix[(-(x)-1) * xstride + 3 * ystride]

Definition at line 442 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ TQ

#define TQ ( x)
Value:
pix[(x) * xstride + 3 * ystride]

Definition at line 443 of file filter_template.c.

Referenced by vvc_loop_filter_luma().

◆ FP3

#define FP3   pix[-4 * xstride + 1 * ystride]

Definition at line 445 of file filter_template.c.

Referenced by vvc_loop_filter_chroma().

◆ FP2

#define FP2   pix[-3 * xstride + 1 * ystride]

Definition at line 446 of file filter_template.c.

Referenced by vvc_loop_filter_chroma().

◆ FP1

#define FP1   pix[-2 * xstride + 1 * ystride]

Definition at line 447 of file filter_template.c.

Referenced by vvc_loop_filter_chroma().

◆ FP0

#define FP0   pix[-1 * xstride + 1 * ystride]

Definition at line 448 of file filter_template.c.

Referenced by vvc_loop_filter_chroma().

◆ FQ0

#define FQ0   pix[0 * xstride + 1 * ystride]

Definition at line 449 of file filter_template.c.

Referenced by vvc_loop_filter_chroma().

◆ FQ1

#define FQ1   pix[1 * xstride + 1 * ystride]

Definition at line 450 of file filter_template.c.

Referenced by vvc_loop_filter_chroma().

◆ FQ2

#define FQ2   pix[2 * xstride + 1 * ystride]

Definition at line 451 of file filter_template.c.

Referenced by vvc_loop_filter_chroma().

◆ FQ3

#define FQ3   pix[3 * xstride + 1 * ystride]

Definition at line 452 of file filter_template.c.

Referenced by vvc_loop_filter_chroma().

Function Documentation

◆ lmcs_filter_luma()

static void FUNC lmcs_filter_luma ( uint8_t * _dst,
ptrdiff_t dst_stride,
const int width,
const int height,
const void * _lut )
static

Definition at line 25 of file filter_template.c.

Referenced by ff_vvc_lmcs_dsp_init(), and lmcs_filter_luma().

◆ alf_clip()

static av_always_inline int16_t FUNC alf_clip ( pixel curr,
pixel v0,
pixel v1,
int16_t clip )
static

Definition at line 38 of file filter_template.c.

Referenced by alf_clip(), alf_filter_chroma(), and alf_filter_luma().

◆ alf_filter_luma()

static void FUNC alf_filter_luma ( uint8_t * _dst,
ptrdiff_t dst_stride,
const uint8_t * _src,
ptrdiff_t src_stride,
const int width,
const int height,
const int16_t * filter,
const int16_t * clip,
const int vb_pos )
static

Definition at line 43 of file filter_template.c.

◆ alf_filter_chroma()

static void FUNC alf_filter_chroma ( uint8_t * _dst,
ptrdiff_t dst_stride,
const uint8_t * _src,
ptrdiff_t src_stride,
const int width,
const int height,
const int16_t * filter,
const int16_t * clip,
const int vb_pos )
static

Definition at line 137 of file filter_template.c.

◆ alf_filter_cc()

static void FUNC alf_filter_cc ( uint8_t * _dst,
ptrdiff_t dst_stride,
const uint8_t * _luma,
const ptrdiff_t luma_stride,
const int width,
const int height,
const int hs,
const int vs,
const int16_t * filter,
const int vb_pos )
static

Definition at line 213 of file filter_template.c.

◆ alf_get_idx()

static void FUNC alf_get_idx ( int * class_idx,
int * transpose_idx,
const int * sum,
const int ac )
static

Definition at line 260 of file filter_template.c.

◆ alf_classify()

static void FUNC alf_classify ( int * class_idx,
int * transpose_idx,
const uint8_t * _src,
const ptrdiff_t _src_stride,
const int width,
const int height,
const int vb_pos,
int * gradient_tmp )
static

Definition at line 289 of file filter_template.c.

◆ alf_recon_coeff_and_clip()

static void FUNC alf_recon_coeff_and_clip ( int16_t * coeff,
int16_t * clip,
const int * class_idx,
const int * transpose_idx,
const int size,
const int16_t * coeff_set,
const uint8_t * clip_idx_set,
const uint8_t * class_to_filt )
static

Definition at line 373 of file filter_template.c.

Referenced by alf_recon_coeff_and_clip(), and ff_vvc_alf_dsp_init().

◆ loop_filter_luma_large()

static void FUNC loop_filter_luma_large ( pixel * pix,
const ptrdiff_t xstride,
const ptrdiff_t ystride,
const int32_t tc,
const uint8_t no_p,
const uint8_t no_q,
const uint8_t max_len_p,
const uint8_t max_len_q )
static

Definition at line 456 of file filter_template.c.

Referenced by loop_filter_luma_large(), and vvc_loop_filter_luma().

◆ vvc_loop_filter_luma()

static void FUNC vvc_loop_filter_luma ( uint8_t * _pix,
ptrdiff_t _xstride,
ptrdiff_t _ystride,
const int32_t * _beta,
const int32_t * _tc,
const uint8_t * _no_p,
const uint8_t * _no_q,
const uint8_t * _max_len_p,
const uint8_t * _max_len_q,
const int hor_ctu_edge )
static

◆ loop_filter_chroma_strong()

static void FUNC loop_filter_chroma_strong ( pixel * pix,
const ptrdiff_t xstride,
const ptrdiff_t ystride,
const int size,
const int32_t tc,
const uint8_t no_p,
const uint8_t no_q )
static

Definition at line 623 of file filter_template.c.

Referenced by loop_filter_chroma_strong(), and vvc_loop_filter_chroma().

◆ loop_filter_chroma_strong_one_side()

static void FUNC loop_filter_chroma_strong_one_side ( pixel * pix,
const ptrdiff_t xstride,
const ptrdiff_t ystride,
const int size,
const int32_t tc,
const uint8_t no_p,
const uint8_t no_q )
static

◆ vvc_loop_filter_chroma()

static void FUNC vvc_loop_filter_chroma ( uint8_t * _pix,
const ptrdiff_t _xstride,
const ptrdiff_t _ystride,
const int32_t * _beta,
const int32_t * _tc,
const uint8_t * _no_p,
const uint8_t * _no_q,
const uint8_t * _max_len_p,
const uint8_t * _max_len_q,
const int shift )
static

◆ vvc_h_loop_filter_chroma()

static void FUNC vvc_h_loop_filter_chroma ( uint8_t * pix,
ptrdiff_t stride,
const int32_t * beta,
const int32_t * tc,
const uint8_t * no_p,
const uint8_t * no_q,
const uint8_t * max_len_p,
const uint8_t * max_len_q,
int shift )
static

Definition at line 746 of file filter_template.c.

Referenced by ff_vvc_lf_dsp_init(), and vvc_h_loop_filter_chroma().

◆ vvc_v_loop_filter_chroma()

static void FUNC vvc_v_loop_filter_chroma ( uint8_t * pix,
ptrdiff_t stride,
const int32_t * beta,
const int32_t * tc,
const uint8_t * no_p,
const uint8_t * no_q,
const uint8_t * max_len_p,
const uint8_t * max_len_q,
int shift )
static

Definition at line 754 of file filter_template.c.

Referenced by ff_vvc_lf_dsp_init(), and vvc_v_loop_filter_chroma().

◆ vvc_h_loop_filter_luma()

static void FUNC vvc_h_loop_filter_luma ( uint8_t * pix,
ptrdiff_t stride,
const int32_t * beta,
const int32_t * tc,
const uint8_t * no_p,
const uint8_t * no_q,
const uint8_t * max_len_p,
const uint8_t * max_len_q,
const int hor_ctu_edge )
static

Definition at line 762 of file filter_template.c.

Referenced by ff_vvc_lf_dsp_init(), and vvc_h_loop_filter_luma().

◆ vvc_v_loop_filter_luma()

static void FUNC vvc_v_loop_filter_luma ( uint8_t * pix,
ptrdiff_t stride,
const int32_t * beta,
const int32_t * tc,
const uint8_t * no_p,
const uint8_t * no_q,
const uint8_t * max_len_p,
const uint8_t * max_len_q,
const int hor_ctu_edge )
static

Definition at line 770 of file filter_template.c.

Referenced by ff_vvc_lf_dsp_init(), and vvc_v_loop_filter_luma().

◆ vvc_loop_ladf_level()

static int FUNC vvc_loop_ladf_level ( const uint8_t * _pix,
const ptrdiff_t _xstride,
const ptrdiff_t _ystride )
static

◆ vvc_h_loop_ladf_level()

static int FUNC vvc_h_loop_ladf_level ( const uint8_t * pix,
ptrdiff_t stride )
static

Definition at line 786 of file filter_template.c.

Referenced by ff_vvc_lf_dsp_init(), and vvc_h_loop_ladf_level().

◆ vvc_v_loop_ladf_level()

static int FUNC vvc_v_loop_ladf_level ( const uint8_t * pix,
ptrdiff_t stride )
static

Definition at line 791 of file filter_template.c.

Referenced by ff_vvc_lf_dsp_init(), and vvc_v_loop_ladf_level().

◆ ff_vvc_lmcs_dsp_init()

static void FUNC ff_vvc_lmcs_dsp_init ( VVCLMCSDSPContext *const lmcs)
static

Definition at line 830 of file filter_template.c.

Referenced by ff_vvc_lmcs_dsp_init().

◆ ff_vvc_lf_dsp_init()

static void FUNC ff_vvc_lf_dsp_init ( VVCLFDSPContext *const lf)
static

Definition at line 835 of file filter_template.c.

Referenced by ff_vvc_lf_dsp_init().

◆ ff_vvc_sao_dsp_init()

static void FUNC ff_vvc_sao_dsp_init ( VVCSAODSPContext *const sao)
static

Definition at line 845 of file filter_template.c.

Referenced by ff_vvc_sao_dsp_init().

◆ ff_vvc_alf_dsp_init()

static void FUNC ff_vvc_alf_dsp_init ( VVCALFDSPContext *const alf)
static

Definition at line 855 of file filter_template.c.

Referenced by ff_vvc_alf_dsp_init().