FFmpeg  4.0
Macros | Functions | Variables
hevc_idct_msa.c File Reference
#include "libavutil/mips/generic_macros_msa.h"
#include "libavcodec/mips/hevcdsp_mips.h"

Go to the source code of this file.

Macros

#define HEVC_IDCT4x4_COL(in_r0, in_l0, in_r1, in_l1, sum0, sum1, sum2, sum3, shift)
 
#define HEVC_IDCT8x8_COL(in0, in1, in2, in3, in4, in5, in6, in7, shift)
 
#define HEVC_IDCT16x16_COL(src0_r, src1_r, src2_r, src3_r, src4_r, src5_r, src6_r, src7_r, src0_l, src1_l, src2_l, src3_l, src4_l, src5_l, src6_l, src7_l, shift)
 
#define HEVC_EVEN16_CALC(input, sum0_r, sum0_l, load_idx, store_idx)
 
#define HEVC_IDCT_LUMA4x4_COL(in_r0, in_l0, in_r1, in_l1, res0, res1, res2, res3, shift)
 

Functions

static void hevc_idct_4x4_msa (int16_t *coeffs)
 
static void hevc_idct_8x8_msa (int16_t *coeffs)
 
static void hevc_idct_16x16_msa (int16_t *coeffs)
 
static void hevc_idct_8x32_column_msa (int16_t *coeffs, uint8_t buf_pitch, uint8_t round)
 
static void hevc_idct_transpose_32x8_to_8x32 (int16_t *coeffs, int16_t *tmp_buf)
 
static void hevc_idct_transpose_8x32_to_32x8 (int16_t *tmp_buf, int16_t *coeffs)
 
static void hevc_idct_32x32_msa (int16_t *coeffs)
 
static void hevc_idct_dc_4x4_msa (int16_t *coeffs)
 
static void hevc_idct_dc_8x8_msa (int16_t *coeffs)
 
static void hevc_idct_dc_16x16_msa (int16_t *coeffs)
 
static void hevc_idct_dc_32x32_msa (int16_t *coeffs)
 
static void hevc_addblk_4x4_msa (int16_t *coeffs, uint8_t *dst, int32_t stride)
 
static void hevc_addblk_8x8_msa (int16_t *coeffs, uint8_t *dst, int32_t stride)
 
static void hevc_addblk_16x16_msa (int16_t *coeffs, uint8_t *dst, int32_t stride)
 
static void hevc_addblk_32x32_msa (int16_t *coeffs, uint8_t *dst, int32_t stride)
 
static void hevc_idct_luma_4x4_msa (int16_t *coeffs)
 
void ff_hevc_idct_4x4_msa (int16_t *coeffs, int col_limit)
 
void ff_hevc_idct_8x8_msa (int16_t *coeffs, int col_limit)
 
void ff_hevc_idct_16x16_msa (int16_t *coeffs, int col_limit)
 
void ff_hevc_idct_32x32_msa (int16_t *coeffs, int col_limit)
 
void ff_hevc_addblk_4x4_msa (uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
 
void ff_hevc_addblk_8x8_msa (uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
 
void ff_hevc_addblk_16x16_msa (uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
 
void ff_hevc_addblk_32x32_msa (uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
 
void ff_hevc_idct_dc_4x4_msa (int16_t *coeffs)
 
void ff_hevc_idct_dc_8x8_msa (int16_t *coeffs)
 
void ff_hevc_idct_dc_16x16_msa (int16_t *coeffs)
 
void ff_hevc_idct_dc_32x32_msa (int16_t *coeffs)
 
void ff_hevc_idct_luma_4x4_msa (int16_t *coeffs)
 

Variables

static const int16_t gt8x8_cnst [16]
 
static const int16_t gt16x16_cnst [64]
 
static const int16_t gt32x32_cnst0 [256]
 
static const int16_t gt32x32_cnst1 [64]
 
static const int16_t gt32x32_cnst2 [16]
 

Macro Definition Documentation

◆ HEVC_IDCT4x4_COL

#define HEVC_IDCT4x4_COL (   in_r0,
  in_l0,
  in_r1,
  in_l1,
  sum0,
  sum1,
  sum2,
  sum3,
  shift 
)
Value:
{ \
v4i32 vec0, vec1, vec2, vec3, vec4, vec5; \
v4i32 cnst64 = __msa_ldi_w(64); \
v4i32 cnst83 = __msa_ldi_w(83); \
v4i32 cnst36 = __msa_ldi_w(36); \
DOTP_SH4_SW(in_r0, in_r1, in_l0, in_l1, cnst64, cnst64, \
cnst83, cnst36, vec0, vec2, vec1, vec3); \
DOTP_SH2_SW(in_l0, in_l1, cnst36, cnst83, vec4, vec5); \
\
sum0 = vec0 + vec2; \
sum1 = vec0 - vec2; \
sum3 = sum0; \
sum2 = sum1; \
\
vec1 += vec3; \
vec4 -= vec5; \
\
sum0 += vec1; \
sum1 += vec4; \
sum2 -= vec4; \
sum3 -= vec1; \
SRARI_W4_SW(sum0, sum1, sum2, sum3, shift); \
SAT_SW4_SW(sum0, sum1, sum2, sum3, 15); \
}
static int shift(int a, int b)
Definition: sonic.c:82
#define SRARI_W4_SW(...)
#define DOTP_SH4_SW(...)

Definition at line 65 of file hevc_idct_msa.c.

Referenced by hevc_idct_4x4_msa().

◆ HEVC_IDCT8x8_COL

#define HEVC_IDCT8x8_COL (   in0,
  in1,
  in2,
  in3,
  in4,
  in5,
  in6,
  in7,
  shift 
)

Definition at line 94 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x8_msa().

◆ HEVC_IDCT16x16_COL

#define HEVC_IDCT16x16_COL (   src0_r,
  src1_r,
  src2_r,
  src3_r,
  src4_r,
  src5_r,
  src6_r,
  src7_r,
  src0_l,
  src1_l,
  src2_l,
  src3_l,
  src4_l,
  src5_l,
  src6_l,
  src7_l,
  shift 
)

Definition at line 188 of file hevc_idct_msa.c.

Referenced by hevc_idct_16x16_msa().

◆ HEVC_EVEN16_CALC

#define HEVC_EVEN16_CALC (   input,
  sum0_r,
  sum0_l,
  load_idx,
  store_idx 
)
Value:
{ \
LD_SW2(input + load_idx * 8, 4, tmp0_r, tmp0_l); \
tmp1_r = sum0_r; \
tmp1_l = sum0_l; \
sum0_r += tmp0_r; \
sum0_l += tmp0_l; \
ST_SW2(sum0_r, sum0_l, (input + load_idx * 8), 4); \
tmp1_r -= tmp0_r; \
tmp1_l -= tmp0_l; \
ST_SW2(tmp1_r, tmp1_l, (input + store_idx * 8), 4); \
}

Definition at line 264 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x32_column_msa().

◆ HEVC_IDCT_LUMA4x4_COL

#define HEVC_IDCT_LUMA4x4_COL (   in_r0,
  in_l0,
  in_r1,
  in_l1,
  res0,
  res1,
  res2,
  res3,
  shift 
)
Value:
{ \
v4i32 vec0, vec1, vec2, vec3; \
v4i32 cnst74 = __msa_ldi_w(74); \
v4i32 cnst55 = __msa_ldi_w(55); \
v4i32 cnst29 = __msa_ldi_w(29); \
\
vec0 = in_r0 + in_r1; \
vec2 = in_r0 - in_l1; \
res0 = vec0 * cnst29; \
res1 = vec2 * cnst55; \
res2 = in_r0 - in_r1; \
vec1 = in_r1 + in_l1; \
res2 += in_l1; \
vec3 = in_l0 * cnst74; \
res3 = vec0 * cnst55; \
\
res0 += vec1 * cnst55; \
res1 -= vec1 * cnst29; \
res2 *= cnst74; \
res3 += vec2 * cnst29; \
\
res0 += vec3; \
res1 += vec3; \
res3 -= vec3; \
SRARI_W4_SW(res0, res1, res2, res3, shift); \
SAT_SW4_SW(res0, res1, res2, res3, 15); \
}
static int shift(int a, int b)
Definition: sonic.c:82
#define SRARI_W4_SW(...)

Definition at line 277 of file hevc_idct_msa.c.

Referenced by hevc_idct_luma_4x4_msa().

Function Documentation

◆ hevc_idct_4x4_msa()

static void hevc_idct_4x4_msa ( int16_t *  coeffs)
static

Definition at line 308 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_4x4_msa().

◆ hevc_idct_8x8_msa()

static void hevc_idct_8x8_msa ( int16_t *  coeffs)
static

Definition at line 331 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_8x8_msa().

◆ hevc_idct_16x16_msa()

static void hevc_idct_16x16_msa ( int16_t *  coeffs)
static

Definition at line 346 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_16x16_msa().

◆ hevc_idct_8x32_column_msa()

static void hevc_idct_8x32_column_msa ( int16_t *  coeffs,
uint8_t  buf_pitch,
uint8_t  round 
)
static

Definition at line 428 of file hevc_idct_msa.c.

Referenced by hevc_idct_32x32_msa().

◆ hevc_idct_transpose_32x8_to_8x32()

static void hevc_idct_transpose_32x8_to_8x32 ( int16_t *  coeffs,
int16_t *  tmp_buf 
)
static

Definition at line 601 of file hevc_idct_msa.c.

Referenced by hevc_idct_32x32_msa().

◆ hevc_idct_transpose_8x32_to_32x8()

static void hevc_idct_transpose_8x32_to_32x8 ( int16_t *  tmp_buf,
int16_t *  coeffs 
)
static

Definition at line 614 of file hevc_idct_msa.c.

Referenced by hevc_idct_32x32_msa().

◆ hevc_idct_32x32_msa()

static void hevc_idct_32x32_msa ( int16_t *  coeffs)
static

Definition at line 627 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_32x32_msa().

◆ hevc_idct_dc_4x4_msa()

static void hevc_idct_dc_4x4_msa ( int16_t *  coeffs)
static

Definition at line 660 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_dc_4x4_msa().

◆ hevc_idct_dc_8x8_msa()

static void hevc_idct_dc_8x8_msa ( int16_t *  coeffs)
static

Definition at line 672 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_dc_8x8_msa().

◆ hevc_idct_dc_16x16_msa()

static void hevc_idct_dc_16x16_msa ( int16_t *  coeffs)
static

Definition at line 684 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_dc_16x16_msa().

◆ hevc_idct_dc_32x32_msa()

static void hevc_idct_dc_32x32_msa ( int16_t *  coeffs)
static

Definition at line 700 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_dc_32x32_msa().

◆ hevc_addblk_4x4_msa()

static void hevc_addblk_4x4_msa ( int16_t *  coeffs,
uint8_t dst,
int32_t  stride 
)
static

Definition at line 716 of file hevc_idct_msa.c.

Referenced by ff_hevc_addblk_4x4_msa().

◆ hevc_addblk_8x8_msa()

static void hevc_addblk_8x8_msa ( int16_t *  coeffs,
uint8_t dst,
int32_t  stride 
)
static

Definition at line 733 of file hevc_idct_msa.c.

Referenced by ff_hevc_addblk_8x8_msa().

◆ hevc_addblk_16x16_msa()

static void hevc_addblk_16x16_msa ( int16_t *  coeffs,
uint8_t dst,
int32_t  stride 
)
static

Definition at line 770 of file hevc_idct_msa.c.

Referenced by ff_hevc_addblk_16x16_msa().

◆ hevc_addblk_32x32_msa()

static void hevc_addblk_32x32_msa ( int16_t *  coeffs,
uint8_t dst,
int32_t  stride 
)
static

Definition at line 836 of file hevc_idct_msa.c.

Referenced by ff_hevc_addblk_32x32_msa().

◆ hevc_idct_luma_4x4_msa()

static void hevc_idct_luma_4x4_msa ( int16_t *  coeffs)
static

Definition at line 941 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_luma_4x4_msa().

◆ ff_hevc_idct_4x4_msa()

void ff_hevc_idct_4x4_msa ( int16_t *  coeffs,
int  col_limit 
)

Definition at line 963 of file hevc_idct_msa.c.

◆ ff_hevc_idct_8x8_msa()

void ff_hevc_idct_8x8_msa ( int16_t *  coeffs,
int  col_limit 
)

Definition at line 968 of file hevc_idct_msa.c.

◆ ff_hevc_idct_16x16_msa()

void ff_hevc_idct_16x16_msa ( int16_t *  coeffs,
int  col_limit 
)

Definition at line 973 of file hevc_idct_msa.c.

◆ ff_hevc_idct_32x32_msa()

void ff_hevc_idct_32x32_msa ( int16_t *  coeffs,
int  col_limit 
)

Definition at line 978 of file hevc_idct_msa.c.

◆ ff_hevc_addblk_4x4_msa()

void ff_hevc_addblk_4x4_msa ( uint8_t dst,
int16_t *  coeffs,
ptrdiff_t  stride 
)

Definition at line 983 of file hevc_idct_msa.c.

◆ ff_hevc_addblk_8x8_msa()

void ff_hevc_addblk_8x8_msa ( uint8_t dst,
int16_t *  coeffs,
ptrdiff_t  stride 
)

Definition at line 988 of file hevc_idct_msa.c.

◆ ff_hevc_addblk_16x16_msa()

void ff_hevc_addblk_16x16_msa ( uint8_t dst,
int16_t *  coeffs,
ptrdiff_t  stride 
)

Definition at line 993 of file hevc_idct_msa.c.

◆ ff_hevc_addblk_32x32_msa()

void ff_hevc_addblk_32x32_msa ( uint8_t dst,
int16_t *  coeffs,
ptrdiff_t  stride 
)

Definition at line 998 of file hevc_idct_msa.c.

◆ ff_hevc_idct_dc_4x4_msa()

void ff_hevc_idct_dc_4x4_msa ( int16_t *  coeffs)

Definition at line 1003 of file hevc_idct_msa.c.

◆ ff_hevc_idct_dc_8x8_msa()

void ff_hevc_idct_dc_8x8_msa ( int16_t *  coeffs)

Definition at line 1008 of file hevc_idct_msa.c.

◆ ff_hevc_idct_dc_16x16_msa()

void ff_hevc_idct_dc_16x16_msa ( int16_t *  coeffs)

Definition at line 1013 of file hevc_idct_msa.c.

◆ ff_hevc_idct_dc_32x32_msa()

void ff_hevc_idct_dc_32x32_msa ( int16_t *  coeffs)

Definition at line 1018 of file hevc_idct_msa.c.

◆ ff_hevc_idct_luma_4x4_msa()

void ff_hevc_idct_luma_4x4_msa ( int16_t *  coeffs)

Definition at line 1023 of file hevc_idct_msa.c.

Variable Documentation

◆ gt8x8_cnst

const int16_t gt8x8_cnst[16]
static
Initial value:
= {
64, 64, 83, 36, 89, 50, 18, 75, 64, -64, 36, -83, 75, -89, -50, -18
}

Definition at line 24 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x32_column_msa(), and hevc_idct_8x8_msa().

◆ gt16x16_cnst

const int16_t gt16x16_cnst[64]
static
Initial value:
= {
64, 83, 64, 36, 89, 75, 50, 18, 90, 80, 57, 25, 70, 87, 9, 43,
64, 36, -64, -83, 75, -18, -89, -50, 87, 9, -80, -70, -43, 57, -25, -90,
64, -36, -64, 83, 50, -89, 18, 75, 80, -70, -25, 90, -87, 9, 43, 57,
64, -83, 64, -36, 18, -50, 75, -89, 70, -87, 90, -80, 9, -43, -57, 25
}

Definition at line 28 of file hevc_idct_msa.c.

Referenced by hevc_idct_16x16_msa().

◆ gt32x32_cnst0

const int16_t gt32x32_cnst0[256]
static
Initial value:
= {
90, 90, 88, 85, 82, 78, 73, 67, 61, 54, 46, 38, 31, 22, 13, 4,
90, 82, 67, 46, 22, -4, -31, -54, -73, -85, -90, -88, -78, -61, -38, -13,
88, 67, 31, -13, -54, -82, -90, -78, -46, -4, 38, 73, 90, 85, 61, 22,
85, 46, -13, -67, -90, -73, -22, 38, 82, 88, 54, -4, -61, -90, -78, -31,
82, 22, -54, -90, -61, 13, 78, 85, 31, -46, -90, -67, 4, 73, 88, 38,
78, -4, -82, -73, 13, 85, 67, -22, -88, -61, 31, 90, 54, -38, -90, -46,
73, -31, -90, -22, 78, 67, -38, -90, -13, 82, 61, -46, -88, -4, 85, 54,
67, -54, -78, 38, 85, -22, -90, 4, 90, 13, -88, -31, 82, 46, -73, -61,
61, -73, -46, 82, 31, -88, -13, 90, -4, -90, 22, 85, -38, -78, 54, 67,
54, -85, -4, 88, -46, -61, 82, 13, -90, 38, 67, -78, -22, 90, -31, -73,
46, -90, 38, 54, -90, 31, 61, -88, 22, 67, -85, 13, 73, -82, 4, 78,
38, -88, 73, -4, -67, 90, -46, -31, 85, -78, 13, 61, -90, 54, 22, -82,
31, -78, 90, -61, 4, 54, -88, 82, -38, -22, 73, -90, 67, -13, -46, 85,
22, -61, 85, -90, 73, -38, -4, 46, -78, 90, -82, 54, -13, -31, 67, -88,
13, -38, 61, -78, 88, -90, 85, -73, 54, -31, 4, 22, -46, 67, -82, 90,
4, -13, 22, -31, 38, -46, 54, -61, 67, -73, 78, -82, 85, -88, 90, -90
}

Definition at line 35 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x32_column_msa().

◆ gt32x32_cnst1

const int16_t gt32x32_cnst1[64]
static
Initial value:
= {
90, 87, 80, 70, 57, 43, 25, 9, 87, 57, 9, -43, -80, -90, -70, -25,
80, 9, -70, -87, -25, 57, 90, 43, 70, -43, -87, 9, 90, 25, -80, -57,
57, -80, -25, 90, -9, -87, 43, 70, 43, -90, 57, 25, -87, 70, 9, -80,
25, -70, 90, -80, 43, 9, -57, 87, 9, -25, 43, -57, 70, -80, 87, -90
}

Definition at line 54 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x32_column_msa().

◆ gt32x32_cnst2

const int16_t gt32x32_cnst2[16]
static
Initial value:
= {
89, 75, 50, 18, 75, -18, -89, -50, 50, -89, 18, 75, 18, -50, 75, -89
}

Definition at line 61 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x32_column_msa().