From aede1a1a60cc89bb663753fee1aad9feaca8a14a Mon Sep 17 00:00:00 2001 From: Shivraj Patil Date: Fri, 29 May 2015 12:20:26 +0530 Subject: avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for HEVC bi mc functions This patch adds MSA (MIPS-SIMD-Arch) optimizations for HEVC bi mc functions (qpel as well as epel) in new file hevc_mc_bi_msa.c Adds new generic macros (needed for this patch) in libavutil/mips/generic_macros_msa.h Adds HEVC specific macros (needed for this patch) in libavcodec/mips/hevc_macros_msa.h Signed-off-by: Shivraj Patil Signed-off-by: Michael Niedermayer --- libavcodec/mips/hevc_macros_msa.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'libavcodec/mips/hevc_macros_msa.h') diff --git a/libavcodec/mips/hevc_macros_msa.h b/libavcodec/mips/hevc_macros_msa.h index 7a89f93a9c..b06c5ad9b9 100644 --- a/libavcodec/mips/hevc_macros_msa.h +++ b/libavcodec/mips/hevc_macros_msa.h @@ -37,6 +37,27 @@ out = (v4i32) __msa_pckev_b((v16i8) tmp1_m, (v16i8) tmp0_m); \ } +#define HEVC_PCK_SW_SB8(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1) \ +{ \ + v8i16 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \ + \ + PCKEV_H4_SH(in0, in1, in2, in3, in4, in5, in6, in7, \ + tmp0_m, tmp1_m, tmp2_m, tmp3_m); \ + PCKEV_B2_SW(tmp1_m, tmp0_m, tmp3_m, tmp2_m, out0, out1); \ +} + +#define HEVC_PCK_SW_SB12(in0, in1, in2, in3, in4, in5, in6, in7, \ + in8, in9, in10, in11, out0, out1, out2) \ +{ \ + v8i16 tmp0_m, tmp1_m, tmp2_m, tmp3_m, tmp4_m, tmp5_m; \ + \ + PCKEV_H4_SH(in0, in1, in2, in3, in4, in5, in6, in7, \ + tmp0_m, tmp1_m, tmp2_m, tmp3_m); \ + PCKEV_H2_SH(in8, in9, in10, in11, tmp4_m, tmp5_m); \ + PCKEV_B2_SW(tmp1_m, tmp0_m, tmp3_m, tmp2_m, out0, out1); \ + out2 = (v4i32) __msa_pckev_b((v16i8) tmp5_m, (v16i8) tmp4_m); \ +} + #define HEVC_FILT_8TAP(in0, in1, in2, in3, \ filt0, filt1, filt2, filt3) \ ( { \ @@ -48,4 +69,13 @@ out_m; \ } ) +#define HEVC_FILT_4TAP(in0, in1, filt0, filt1) \ +( { \ + v4i32 out_m; \ + \ + out_m = __msa_dotp_s_w(in0, (v8i16) filt0); \ + out_m = __msa_dpadd_s_w(out_m, in1, (v8i16) filt1); \ + out_m; \ +} ) + #endif /* AVCODEC_MIPS_HEVC_MACROS_MSA_H */ -- cgit v1.2.3