FFmpeg
Loading...
Searching...
No Matches
dsp_init.c File Reference
#include "config.h"
#include "libavutil/cpu.h"
#include "libavutil/mem_internal.h"
#include "libavutil/x86/cpu.h"
#include "libavcodec/hevc/dsp.h"
#include "libavcodec/x86/hevc/dsp.h"
#include "libavcodec/x86/h26x/h2656dsp.h"

Go to the source code of this file.

Macros

#define LFC_FUNC(DIR, DEPTH, OPT)
 
#define LFL_FUNC(DIR, DEPTH, OPT)
 
#define LFC_FUNCS(type, depth, opt)
 
#define LFL_FUNCS(type, depth, opt)
 
#define IDCT_DC_FUNCS(W, opt)
 
#define IDCT_FUNCS(opt)
 
#define TRANSFORM_LUMA_FUNCS(opt)
 
#define ff_hevc_pel_filters   ff_hevc_qpel_filters
 
#define DECL_HV_FILTER(f)
 
#define FW_PUT(p, a, b, depth, opt)
 
#define FW_PUT_UNI(p, a, b, depth, opt)
 
#define mc_rep_func(name, bitd, step, W, opt)
 
#define mc_rep_uni_func(name, bitd, step, W, opt)
 
#define mc_rep_bi_func(name, bitd, step, W, opt)
 
#define mc_rep_funcs(name, bitd, step, W, opt)
 
#define mc_rep_func2(name, bitd, step1, step2, W, opt)
 
#define mc_rep_uni_func2(name, bitd, step1, step2, W, opt)
 
#define mc_rep_bi_func2(name, bitd, step1, step2, W, opt)
 
#define mc_rep_funcs2(name, bitd, step1, step2, W, opt)
 
#define SAO_BAND_FILTER_FUNCS(bitd, opt)
 
#define SAO_BAND_INIT(bitd, opt)
 
#define SAO_EDGE_FILTER_FUNCS(bitd, opt)
 
#define SAO_EDGE_INIT(bitd, opt)
 
#define PEL_LINK(dst, idx1, idx2, idx3, name, D, opt)
 
#define EPEL_LINKS(pointer, my, mx, fname, bitd, opt)
 
#define QPEL_LINKS(pointer, my, mx, fname, bitd, opt)
 

Functions

void ff_hevc_dequant_8_ssse3 (int16_t *coeffs, int16_t log2_size)
 
 IDCT_DC_FUNCS (4x4, sse2)
 
 IDCT_DC_FUNCS (8x8, sse2)
 
 IDCT_DC_FUNCS (16x16, sse2)
 
 IDCT_DC_FUNCS (32x32, sse2)
 
 IDCT_DC_FUNCS (16x16, avx2)
 
 IDCT_DC_FUNCS (32x32, avx2)
 
 TRANSFORM_LUMA_FUNCS (sse2)
 
 TRANSFORM_LUMA_FUNCS (avx)
 
void ff_hevc_dsp_init_x86 (HEVCDSPContext *c, const int bit_depth)
 

Macro Definition Documentation

◆ LFC_FUNC

#define LFC_FUNC ( DIR,
DEPTH,
OPT )
Value:
void ff_hevc_ ## DIR ## _loop_filter_chroma_ ## DEPTH ## _ ## OPT(uint8_t *pix, ptrdiff_t stride, const int *tc, const uint8_t *no_p, const uint8_t *no_q);
#define _
#define DEPTH
Definition v210enc.c:33
enum AVPixelFormat pix
Definition ohcodec.c:55
#define stride
#define OPT(name, field, help)
Definition vf_drawvg.c:2651

Definition at line 34 of file dsp_init.c.

◆ LFL_FUNC

#define LFL_FUNC ( DIR,
DEPTH,
OPT )
Value:
void ff_hevc_ ## DIR ## _loop_filter_luma_ ## DEPTH ## _ ## OPT(uint8_t *pix, ptrdiff_t stride, int beta, const int *tc, const uint8_t *no_p, const uint8_t *no_q);

Definition at line 37 of file dsp_init.c.

◆ LFC_FUNCS

#define LFC_FUNCS ( type,
depth,
opt )
Value:
LFC_FUNC(h, depth, opt) \
LFC_FUNC(v, depth, opt)
#define LFC_FUNC(DIR, DEPTH, OPT)
Definition dsp_init.c:34

Definition at line 40 of file dsp_init.c.

◆ LFL_FUNCS

#define LFL_FUNCS ( type,
depth,
opt )
Value:
LFL_FUNC(h, depth, opt) \
LFL_FUNC(v, depth, opt)
#define LFL_FUNC(DIR, DEPTH, OPT)
Definition dsp_init.c:37

Definition at line 44 of file dsp_init.c.

◆ IDCT_DC_FUNCS

#define IDCT_DC_FUNCS ( W,
opt )
Value:
void ff_hevc_idct_ ## W ## _dc_8_ ## opt(int16_t *coeffs); \
void ff_hevc_idct_ ## W ## _dc_10_ ## opt(int16_t *coeffs); \
void ff_hevc_idct_ ## W ## _dc_12_ ## opt(int16_t *coeffs)
#define W(a, i, v)
Definition jpegls.h:119

Definition at line 64 of file dsp_init.c.

◆ IDCT_FUNCS

#define IDCT_FUNCS ( opt)
Value:
void ff_hevc_idct_4x4_8_ ## opt(int16_t *coeffs, int col_limit); \
void ff_hevc_idct_4x4_10_ ## opt(int16_t *coeffs, int col_limit); \
void ff_hevc_idct_8x8_8_ ## opt(int16_t *coeffs, int col_limit); \
void ff_hevc_idct_8x8_10_ ## opt(int16_t *coeffs, int col_limit); \
void ff_hevc_idct_16x16_8_ ## opt(int16_t *coeffs, int col_limit); \
void ff_hevc_idct_16x16_10_ ## opt(int16_t *coeffs, int col_limit); \
void ff_hevc_idct_32x32_8_ ## opt(int16_t *coeffs, int col_limit); \
void ff_hevc_idct_32x32_10_ ## opt(int16_t *coeffs, int col_limit);

Definition at line 76 of file dsp_init.c.

◆ TRANSFORM_LUMA_FUNCS

#define TRANSFORM_LUMA_FUNCS ( opt)
Value:
void ff_hevc_transform_4x4_luma_8_ ## opt(int16_t *coeffs); \
void ff_hevc_transform_4x4_luma_10_ ## opt(int16_t *coeffs)

Definition at line 89 of file dsp_init.c.

◆ ff_hevc_pel_filters

#define ff_hevc_pel_filters   ff_hevc_qpel_filters

Definition at line 96 of file dsp_init.c.

◆ DECL_HV_FILTER

#define DECL_HV_FILTER ( f)
Value:
const uint8_t *hf = ff_hevc_ ## f ## _filters[mx]; \
const uint8_t *vf = ff_hevc_ ## f ## _filters[my];
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
Definition dsp.h:57
uint8_t ptrdiff_t const uint8_t ptrdiff_t int const int8_t const int8_t * vf
Definition dsp.h:262
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
Definition dsp.h:57
uint8_t ptrdiff_t const uint8_t ptrdiff_t int const int8_t * hf
Definition dsp.h:262
#define f(width, name)
Definition cbs_vp8.c:236

Definition at line 97 of file dsp_init.c.

◆ FW_PUT

#define FW_PUT ( p,
a,
b,
depth,
opt )
Value:
static void hevc_put_ ## a ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \
int height, intptr_t mx, intptr_t my,int width) \
{ \
DECL_HV_FILTER(p) \
ff_h2656_put_ ## b ## _ ## depth ## _##opt(dst, 2 * MAX_PB_SIZE, src, srcstride, height, hf, vf, width); \
}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t const uint8_t ptrdiff_t srcstride
Definition dsp.h:88
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
int a
#define MAX_PB_SIZE
Definition dsp.h:32
#define b
Definition input.c:43
#define src
Definition vp8dsp.c:248
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89

Definition at line 101 of file dsp_init.c.

◆ FW_PUT_UNI

#define FW_PUT_UNI ( p,
a,
b,
depth,
opt )
Value:
static void hevc_put_uni_ ## a ## _ ## depth ## _##opt(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, ptrdiff_t srcstride, \
int height, intptr_t mx, intptr_t my, int width) \
{ \
DECL_HV_FILTER(p) \
ff_h2656_put_uni_ ## b ## _ ## depth ## _##opt(dst, dststride, src, srcstride, height, hf, vf, width); \
}

Definition at line 109 of file dsp_init.c.

◆ mc_rep_func

#define mc_rep_func ( name,
bitd,
step,
W,
opt )
Value:
static void hevc_put_##name##W##_##bitd##_##opt(int16_t *_dst, \
const uint8_t *_src, ptrdiff_t _srcstride, int height, \
intptr_t mx, intptr_t my, int width) \
{ \
int i; \
int16_t *dst; \
for (i = 0; i < W; i += step) { \
const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \
dst = _dst + i; \
hevc_put_##name##step##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width); \
} \
}
uint8_t * _dst
Definition dsp.h:56
uint8_t ptrdiff_t const uint8_t ptrdiff_t _srcstride
Definition dsp.h:57
uint8_t ptrdiff_t const uint8_t * _src
Definition dsp.h:56
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
const char * name
Definition qsvenc.c:142

Definition at line 199 of file dsp_init.c.

◆ mc_rep_uni_func

#define mc_rep_uni_func ( name,
bitd,
step,
W,
opt )
Value:
static void hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, \
const uint8_t *_src, ptrdiff_t _srcstride, int height, \
intptr_t mx, intptr_t my, int width) \
{ \
int i; \
uint8_t *dst; \
for (i = 0; i < W; i += step) { \
const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \
dst = _dst + (i * ((bitd + 7) / 8)); \
hevc_put_uni_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, \
height, mx, my, width); \
} \
}

Definition at line 212 of file dsp_init.c.

◆ mc_rep_bi_func

#define mc_rep_bi_func ( name,
bitd,
step,
W,
opt )
Value:
static void ff_hevc_put_bi_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, const uint8_t *_src, \
ptrdiff_t _srcstride, const int16_t *_src2, \
int height, intptr_t mx, intptr_t my, int width) \
{ \
int i; \
uint8_t *dst; \
for (i = 0; i < W ; i += step) { \
const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \
const int16_t *src2 = _src2 + i; \
dst = _dst + (i * ((bitd + 7) / 8)); \
ff_hevc_put_bi_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, src2, \
height, mx, my, width); \
} \
}
const pixel * src2

Definition at line 226 of file dsp_init.c.

◆ mc_rep_funcs

#define mc_rep_funcs ( name,
bitd,
step,
W,
opt )
Value:
mc_rep_func(name, bitd, step, W, opt) \
mc_rep_uni_func(name, bitd, step, W, opt) \
mc_rep_bi_func(name, bitd, step, W, opt)
#define mc_rep_func(name, bitd, step, W, opt)
Definition h2656dsp.c:28

Definition at line 242 of file dsp_init.c.

◆ mc_rep_func2

#define mc_rep_func2 ( name,
bitd,
step1,
step2,
W,
opt )
Value:
static void hevc_put_##name##W##_##bitd##_##opt(int16_t *dst, \
const uint8_t *src, ptrdiff_t _srcstride, int height, \
intptr_t mx, intptr_t my, int width) \
{ \
hevc_put_##name##step1##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width); \
hevc_put_##name##step2##_##bitd##_##opt(dst + step1, src + (step1 * ((bitd + 7) / 8)), \
}

Definition at line 247 of file dsp_init.c.

◆ mc_rep_uni_func2

#define mc_rep_uni_func2 ( name,
bitd,
step1,
step2,
W,
opt )
Value:
static void hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, ptrdiff_t _srcstride, int height, \
intptr_t mx, intptr_t my, int width) \
{ \
hevc_put_uni_##name##step1##_##bitd##_##opt(dst, dststride, src, _srcstride, height, mx, my, width); \
hevc_put_uni_##name##step2##_##bitd##_##opt(dst + (step1 * ((bitd + 7) / 8)), dststride, \
src + (step1 * ((bitd + 7) / 8)), _srcstride, \
height, mx, my, width); \
}

Definition at line 256 of file dsp_init.c.

◆ mc_rep_bi_func2

#define mc_rep_bi_func2 ( name,
bitd,
step1,
step2,
W,
opt )
Value:
static void ff_hevc_put_bi_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \
ptrdiff_t _srcstride, const int16_t *src2, \
int height, intptr_t mx, intptr_t my, int width) \
{ \
ff_hevc_put_bi_##name##step1##_##bitd##_##opt(dst, dststride, src, _srcstride, src2, height, mx, my, width);\
ff_hevc_put_bi_##name##step2##_##bitd##_##opt(dst + (step1 * ((bitd + 7) / 8)), dststride, \
src + (step1 * ((bitd + 7) / 8)), _srcstride, \
src2 + step1, height, mx, my, width); \
}

Definition at line 266 of file dsp_init.c.

◆ mc_rep_funcs2

#define mc_rep_funcs2 ( name,
bitd,
step1,
step2,
W,
opt )
Value:
mc_rep_func2(name, bitd, step1, step2, W, opt) \
mc_rep_uni_func2(name, bitd, step1, step2, W, opt) \
mc_rep_bi_func2(name, bitd, step1, step2, W, opt)
#define mc_rep_func2(name, bitd, step1, step2, W, opt)
Definition dsp_init.c:247

Definition at line 277 of file dsp_init.c.

◆ SAO_BAND_FILTER_FUNCS

#define SAO_BAND_FILTER_FUNCS ( bitd,
opt )
Value:
void ff_hevc_sao_band_filter_8_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
const int16_t *sao_offset_val, int sao_left_class, int width, int height); \
void ff_hevc_sao_band_filter_16_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
const int16_t *sao_offset_val, int sao_left_class, int width, int height); \
void ff_hevc_sao_band_filter_32_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
const int16_t *sao_offset_val, int sao_left_class, int width, int height); \
void ff_hevc_sao_band_filter_48_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
const int16_t *sao_offset_val, int sao_left_class, int width, int height); \
void ff_hevc_sao_band_filter_64_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
const int16_t *sao_offset_val, int sao_left_class, int width, int height);

Definition at line 736 of file dsp_init.c.

◆ SAO_BAND_INIT

#define SAO_BAND_INIT ( bitd,
opt )
Value:
do { \
c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_##bitd##_##opt; \
c->sao_band_filter[1] = ff_hevc_sao_band_filter_16_##bitd##_##opt; \
c->sao_band_filter[2] = ff_hevc_sao_band_filter_32_##bitd##_##opt; \
c->sao_band_filter[3] = ff_hevc_sao_band_filter_48_##bitd##_##opt; \
c->sao_band_filter[4] = ff_hevc_sao_band_filter_64_##bitd##_##opt; \
} while (0)
static double c[64]

Definition at line 758 of file dsp_init.c.

Referenced by ff_hevc_dsp_init_x86().

◆ SAO_EDGE_FILTER_FUNCS

#define SAO_EDGE_FILTER_FUNCS ( bitd,
opt )
Value:
void ff_hevc_sao_edge_filter_8_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \
const int16_t *sao_offset_val, int eo, int width, int height); \
void ff_hevc_sao_edge_filter_16_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \
const int16_t *sao_offset_val, int eo, int width, int height); \
void ff_hevc_sao_edge_filter_32_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \
const int16_t *sao_offset_val, int eo, int width, int height); \
void ff_hevc_sao_edge_filter_48_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \
const int16_t *sao_offset_val, int eo, int width, int height); \
void ff_hevc_sao_edge_filter_64_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \
const int16_t *sao_offset_val, int eo, int width, int height); \

Definition at line 766 of file dsp_init.c.

◆ SAO_EDGE_INIT

#define SAO_EDGE_INIT ( bitd,
opt )
Value:
do { \
c->sao_edge_filter[0] = ff_hevc_sao_edge_filter_8_##bitd##_##opt; \
c->sao_edge_filter[1] = ff_hevc_sao_edge_filter_16_##bitd##_##opt; \
c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_##bitd##_##opt; \
c->sao_edge_filter[3] = ff_hevc_sao_edge_filter_48_##bitd##_##opt; \
c->sao_edge_filter[4] = ff_hevc_sao_edge_filter_64_##bitd##_##opt; \
} while (0)

Definition at line 785 of file dsp_init.c.

Referenced by ff_hevc_dsp_init_x86().

◆ PEL_LINK

#define PEL_LINK ( dst,
idx1,
idx2,
idx3,
name,
D,
opt )
Value:
dst [idx1][idx2][idx3] = hevc_put_ ## name ## _ ## D ## _##opt; \
dst ## _bi [idx1][idx2][idx3] = ff_hevc_put_bi_ ## name ## _ ## D ## _##opt; \
dst ## _uni [idx1][idx2][idx3] = hevc_put_uni_ ## name ## _ ## D ## _##opt; \
dst ## _uni_w[idx1][idx2][idx3] = hevc_put_uni_w_ ## name ## _ ## D ## _##opt; \
dst ## _bi_w [idx1][idx2][idx3] = hevc_put_bi_w_ ## name ## _ ## D ## _##opt
#define D
Definition avdct.c:35

Definition at line 793 of file dsp_init.c.

◆ EPEL_LINKS

#define EPEL_LINKS ( pointer,
my,
mx,
fname,
bitd,
opt )
Value:
PEL_LINK(pointer, 1, my , mx , fname##4 , bitd, opt ); \
PEL_LINK(pointer, 2, my , mx , fname##6 , bitd, opt ); \
PEL_LINK(pointer, 3, my , mx , fname##8 , bitd, opt ); \
PEL_LINK(pointer, 4, my , mx , fname##12, bitd, opt ); \
PEL_LINK(pointer, 5, my , mx , fname##16, bitd, opt ); \
PEL_LINK(pointer, 6, my , mx , fname##24, bitd, opt ); \
PEL_LINK(pointer, 7, my , mx , fname##32, bitd, opt ); \
PEL_LINK(pointer, 8, my , mx , fname##48, bitd, opt ); \
PEL_LINK(pointer, 9, my , mx , fname##64, bitd, opt )
#define PEL_LINK(dst, idx1, idx2, idx3, name, D, opt)
Definition dsp_init.c:793

Definition at line 800 of file dsp_init.c.

Referenced by ff_hevc_dsp_init_x86().

◆ QPEL_LINKS

#define QPEL_LINKS ( pointer,
my,
mx,
fname,
bitd,
opt )
Value:
PEL_LINK(pointer, 1, my , mx , fname##4 , bitd, opt ); \
PEL_LINK(pointer, 3, my , mx , fname##8 , bitd, opt ); \
PEL_LINK(pointer, 4, my , mx , fname##12, bitd, opt ); \
PEL_LINK(pointer, 5, my , mx , fname##16, bitd, opt ); \
PEL_LINK(pointer, 6, my , mx , fname##24, bitd, opt ); \
PEL_LINK(pointer, 7, my , mx , fname##32, bitd, opt ); \
PEL_LINK(pointer, 8, my , mx , fname##48, bitd, opt ); \
PEL_LINK(pointer, 9, my , mx , fname##64, bitd, opt )

Definition at line 810 of file dsp_init.c.

Referenced by ff_hevc_dsp_init_x86().

Function Documentation

◆ ff_hevc_dequant_8_ssse3()

void ff_hevc_dequant_8_ssse3 ( int16_t * coeffs,
int16_t log2_size )

Referenced by ff_hevc_dsp_init_x86().

◆ IDCT_DC_FUNCS() [1/6]

IDCT_DC_FUNCS ( 4x4 ,
sse2  )

◆ IDCT_DC_FUNCS() [2/6]

IDCT_DC_FUNCS ( 8x8 ,
sse2  )

◆ IDCT_DC_FUNCS() [3/6]

IDCT_DC_FUNCS ( 16x16 ,
sse2  )

◆ IDCT_DC_FUNCS() [4/6]

IDCT_DC_FUNCS ( 32x32 ,
sse2  )

◆ IDCT_DC_FUNCS() [5/6]

IDCT_DC_FUNCS ( 16x16 ,
avx2  )

◆ IDCT_DC_FUNCS() [6/6]

IDCT_DC_FUNCS ( 32x32 ,
avx2  )

◆ TRANSFORM_LUMA_FUNCS() [1/2]

TRANSFORM_LUMA_FUNCS ( sse2 )

◆ TRANSFORM_LUMA_FUNCS() [2/2]

TRANSFORM_LUMA_FUNCS ( avx )

◆ ff_hevc_dsp_init_x86()

void ff_hevc_dsp_init_x86 ( HEVCDSPContext * c,
const int bit_depth )

Definition at line 820 of file dsp_init.c.

Referenced by ff_hevc_dsp_init().