FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 int16_t gt8x8_cnst [16]
 
static int16_t gt16x16_cnst [64]
 
static int16_t gt32x32_cnst0 [256]
 
static int16_t gt32x32_cnst1 [64]
 
static int16_t gt32x32_cnst2 [16]
 
static int16_t gt32x32_cnst3 [16]
 

Macro Definition Documentation

#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(...)
#define DOTP_SH2_SW(...)
#define SAT_SW4_SW(...)

Definition at line 69 of file hevc_idct_msa.c.

Referenced by hevc_idct_4x4_msa().

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

Definition at line 98 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x8_msa().

#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 192 of file hevc_idct_msa.c.

Referenced by hevc_idct_16x16_msa().

#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); \
}
#define ST_SW2(in0, in1, pdst, stride)
#define LD_SW2(psrc, stride, out0, out1)

Definition at line 268 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x32_column_msa().

#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(...)
#define SAT_SW4_SW(...)

Definition at line 281 of file hevc_idct_msa.c.

Referenced by hevc_idct_luma_4x4_msa().

Function Documentation

static void hevc_idct_4x4_msa ( int16_t *  coeffs)
static

Definition at line 312 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_4x4_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().

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().

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().

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

Definition at line 591 of file hevc_idct_msa.c.

Referenced by hevc_idct_32x32_msa().

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

Definition at line 604 of file hevc_idct_msa.c.

Referenced by hevc_idct_32x32_msa().

static void hevc_idct_32x32_msa ( int16_t *  coeffs)
static

Definition at line 617 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_32x32_msa().

static void hevc_idct_dc_4x4_msa ( int16_t *  coeffs)
static

Definition at line 647 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_dc_4x4_msa().

static void hevc_idct_dc_8x8_msa ( int16_t *  coeffs)
static

Definition at line 659 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_dc_8x8_msa().

static void hevc_idct_dc_16x16_msa ( int16_t *  coeffs)
static

Definition at line 671 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_dc_16x16_msa().

static void hevc_idct_dc_32x32_msa ( int16_t *  coeffs)
static

Definition at line 687 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_dc_32x32_msa().

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

Definition at line 703 of file hevc_idct_msa.c.

Referenced by ff_hevc_addblk_4x4_msa().

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

Definition at line 720 of file hevc_idct_msa.c.

Referenced by ff_hevc_addblk_8x8_msa().

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

Definition at line 757 of file hevc_idct_msa.c.

Referenced by ff_hevc_addblk_16x16_msa().

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

Definition at line 795 of file hevc_idct_msa.c.

Referenced by ff_hevc_addblk_32x32_msa().

static void hevc_idct_luma_4x4_msa ( int16_t *  coeffs)
static

Definition at line 858 of file hevc_idct_msa.c.

Referenced by ff_hevc_idct_luma_4x4_msa().

void ff_hevc_idct_4x4_msa ( int16_t *  coeffs,
int  col_limit 
)

Definition at line 876 of file hevc_idct_msa.c.

void ff_hevc_idct_8x8_msa ( int16_t *  coeffs,
int  col_limit 
)

Definition at line 881 of file hevc_idct_msa.c.

void ff_hevc_idct_16x16_msa ( int16_t *  coeffs,
int  col_limit 
)

Definition at line 886 of file hevc_idct_msa.c.

void ff_hevc_idct_32x32_msa ( int16_t *  coeffs,
int  col_limit 
)

Definition at line 891 of file hevc_idct_msa.c.

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

Definition at line 896 of file hevc_idct_msa.c.

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

Definition at line 901 of file hevc_idct_msa.c.

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

Definition at line 906 of file hevc_idct_msa.c.

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

Definition at line 911 of file hevc_idct_msa.c.

void ff_hevc_idct_dc_4x4_msa ( int16_t *  coeffs)

Definition at line 916 of file hevc_idct_msa.c.

void ff_hevc_idct_dc_8x8_msa ( int16_t *  coeffs)

Definition at line 921 of file hevc_idct_msa.c.

void ff_hevc_idct_dc_16x16_msa ( int16_t *  coeffs)

Definition at line 926 of file hevc_idct_msa.c.

void ff_hevc_idct_dc_32x32_msa ( int16_t *  coeffs)

Definition at line 931 of file hevc_idct_msa.c.

void ff_hevc_idct_luma_4x4_msa ( int16_t *  coeffs)

Definition at line 936 of file hevc_idct_msa.c.

Variable Documentation

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_8x8_msa().

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().

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().

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().

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().

int16_t gt32x32_cnst3[16]
static
Initial value:
= {
64, 64, 64, 64, 83, 36, -36, -83, 64, -64, -64, 64, 36, -83, 83, -36
}

Definition at line 65 of file hevc_idct_msa.c.

Referenced by hevc_idct_8x32_column_msa().