diff options
author | Shiyou Yin <yinshiyou-hf@loongson.cn> | 2018-09-06 11:10:53 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-09 13:01:07 +0300 |
commit | 5161f7bcfd3c2d2e6cb92e782855b7fc00bdf877 (patch) | |
tree | 13a91834e04c47ccccd3ecc58012703b127cee59 /libavcodec/mips | |
parent | 090647da84f975c7ffb163436040cc8aecf46a9c (diff) |
avutil/mips: [loongson] simplify macro TRANSPOSE_4H and TRANSPOSE_8B
Simplify macro TRANSPOSE_4H in mmiutils.h and add TRANSPOSE_8B as a common macro.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mips')
-rw-r--r-- | libavcodec/mips/vc1dsp_mmi.c | 12 | ||||
-rw-r--r-- | libavcodec/mips/vp8dsp_mmi.c | 72 |
2 files changed, 12 insertions, 72 deletions
diff --git a/libavcodec/mips/vc1dsp_mmi.c b/libavcodec/mips/vc1dsp_mmi.c index a439b40890..80778a50d9 100644 --- a/libavcodec/mips/vc1dsp_mmi.c +++ b/libavcodec/mips/vc1dsp_mmi.c @@ -248,8 +248,7 @@ void ff_vc1_inv_trans_8x8_mmi(int16_t block[64]) 0xfff70004, 0xfff0000f, %[ff_pw_4]) TRANSPOSE_4H(%[ftmp15], %[ftmp16], %[ftmp17], %[ftmp18], - %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4], - %[ftmp5], %[tmp0], %[ftmp6], %[ftmp7]) + %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4]) MMI_SDC1(%[ftmp15], %[dst], 0x00) MMI_SDC1(%[ftmp16], %[dst], 0x10) @@ -257,8 +256,7 @@ void ff_vc1_inv_trans_8x8_mmi(int16_t block[64]) MMI_SDC1(%[ftmp18], %[dst], 0x30) TRANSPOSE_4H(%[ftmp19], %[ftmp20], %[ftmp21], %[ftmp22], - %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4], - %[ftmp5], %[tmp0], %[ftmp6], %[ftmp7]) + %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4]) MMI_SDC1(%[ftmp19], %[dst], 0x08) MMI_SDC1(%[ftmp20], %[dst], 0x18) @@ -301,8 +299,7 @@ void ff_vc1_inv_trans_8x8_mmi(int16_t block[64]) 0xfff70004, 0xfff0000f, %[ff_pw_4]) TRANSPOSE_4H(%[ftmp15], %[ftmp16], %[ftmp17], %[ftmp18], - %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4], - %[ftmp5], %[tmp0], %[ftmp6], %[ftmp7]) + %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4]) MMI_SDC1(%[ftmp15], %[dst], 0x40) MMI_SDC1(%[ftmp16], %[dst], 0x50) @@ -310,8 +307,7 @@ void ff_vc1_inv_trans_8x8_mmi(int16_t block[64]) MMI_SDC1(%[ftmp18], %[dst], 0x70) TRANSPOSE_4H(%[ftmp19], %[ftmp20], %[ftmp21], %[ftmp22], - %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4], - %[ftmp5], %[tmp0], %[ftmp6], %[ftmp7]) + %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4]) MMI_SDC1(%[ftmp19], %[dst], 0x48) MMI_SDC1(%[ftmp20], %[dst], 0x58) diff --git a/libavcodec/mips/vp8dsp_mmi.c b/libavcodec/mips/vp8dsp_mmi.c index b24a87adae..bd80aa1445 100644 --- a/libavcodec/mips/vp8dsp_mmi.c +++ b/libavcodec/mips/vp8dsp_mmi.c @@ -44,58 +44,6 @@ "punpcklbh "#dst_r", "#src", %[db_2] \n\t" \ "punpckhbh "#dst_l", "#src", %[db_2] \n\t" -#define MMI_TRANSPOSE8x8_UB_UB(src_0, src_1, src_2, src_3, \ - src_4, src_5, src_6, src_7, \ - dst_0, dst_1, dst_2, dst_3, \ - dst_4, dst_5, dst_6, dst_7) \ - "li %[it_1], 0xe4 \n\t" \ - "dmtc1 %[it_1], %[db_1] \n\t" \ - "pshufh %[db_2], "#src_0", %[db_1] \n\t" \ - "punpcklbh "#dst_0", "#src_0", "#src_1" \n\t" \ - "punpckhbh "#dst_1", %[db_2], "#src_1" \n\t" \ - "pshufh %[db_2], "#src_2", %[db_1] \n\t" \ - "punpcklbh "#dst_2", "#src_2", "#src_3" \n\t" \ - "punpckhbh "#dst_3", %[db_2], "#src_3" \n\t" \ - "pshufh %[db_2], "#src_4", %[db_1] \n\t" \ - "punpcklbh "#dst_4", "#src_4", "#src_5" \n\t" \ - "punpckhbh "#dst_5", %[db_2], "#src_5" \n\t" \ - "pshufh %[db_2], "#src_6", %[db_1] \n\t" \ - "punpcklbh "#dst_6", "#src_6", "#src_7" \n\t" \ - "punpckhbh "#dst_7", %[db_2], "#src_7" \n\t" \ - \ - "pshufh %[db_2], "#dst_0", %[db_1] \n\t" \ - "punpcklhw "#dst_0", "#dst_0", "#dst_2" \n\t" \ - "punpckhhw "#dst_2", %[db_2], "#dst_2" \n\t" \ - "pshufh %[db_2], "#dst_1", %[db_1] \n\t" \ - "punpcklhw "#dst_1", "#dst_1", "#dst_3" \n\t" \ - "punpckhhw "#dst_3", %[db_2], "#dst_3" \n\t" \ - "pshufh %[db_2], "#dst_4", %[db_1] \n\t" \ - "punpcklhw "#dst_4", "#dst_4", "#dst_6" \n\t" \ - "punpckhhw "#dst_6", %[db_2], "#dst_6" \n\t" \ - "pshufh %[db_2], "#dst_5", %[db_1] \n\t" \ - "punpcklhw "#dst_5", "#dst_5", "#dst_7" \n\t" \ - "punpckhhw "#dst_7", %[db_2], "#dst_7" \n\t" \ - \ - "pshufh %[db_2], "#dst_0", %[db_1] \n\t" \ - "punpcklwd "#dst_0", "#dst_0", "#dst_4" \n\t" \ - "punpckhwd "#dst_4", %[db_2], "#dst_4" \n\t" \ - "pshufh %[db_2], "#dst_1", %[db_1] \n\t" \ - "punpcklwd "#dst_1", "#dst_1", "#dst_5" \n\t" \ - "punpckhwd "#dst_5", %[db_2], "#dst_5" \n\t" \ - "pshufh %[db_2], "#dst_2", %[db_1] \n\t" \ - "punpcklwd "#dst_2", "#dst_2", "#dst_6" \n\t" \ - "punpckhwd "#dst_6", %[db_2], "#dst_6" \n\t" \ - "pshufh %[db_2], "#dst_3", %[db_1] \n\t" \ - "punpcklwd "#dst_3", "#dst_3", "#dst_7" \n\t" \ - "punpckhwd "#dst_7", %[db_2], "#dst_7" \n\t" \ - \ - "pshufh %[db_2], "#dst_1", %[db_1] \n\t" \ - "pshufh "#dst_1", "#dst_4", %[db_1] \n\t" \ - "pshufh "#dst_4", %[db_2], %[db_1] \n\t" \ - "pshufh %[db_2], "#dst_3", %[db_1] \n\t" \ - "pshufh "#dst_3", "#dst_6", %[db_1] \n\t" \ - "pshufh "#dst_6", %[db_2], %[db_1] \n\t" - #define MMI_VP8_LOOP_FILTER \ /* Calculation of hev */ \ "dmtc1 %[thresh], %[ftmp3] \n\t" \ @@ -952,16 +900,14 @@ static av_always_inline void vp8_h_loop_filter8_mmi(uint8_t *dst, "gsldlc1 %[q3], 0x03(%[tmp0]) \n\t" "gsldrc1 %[q3], -0x04(%[tmp0]) \n\t" /* Matrix transpose */ - MMI_TRANSPOSE8x8_UB_UB(%[p3], %[p2], %[p1], %[p0], - %[q0], %[q1], %[q2], %[q3], - %[p3], %[p2], %[p1], %[p0], - %[q0], %[q1], %[q2], %[q3]) + TRANSPOSE_8B(%[p3], %[p2], %[p1], %[p0], + %[q0], %[q1], %[q2], %[q3], + %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4]) MMI_VP8_LOOP_FILTER /* Matrix transpose */ - MMI_TRANSPOSE8x8_UB_UB(%[p3], %[p2], %[p1], %[p0], - %[q0], %[q1], %[q2], %[q3], - %[p3], %[p2], %[p1], %[p0], - %[q0], %[q1], %[q2], %[q3]) + TRANSPOSE_8B(%[p3], %[p2], %[p1], %[p0], + %[q0], %[q1], %[q2], %[q3], + %[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4]) /* Move to dst */ "gssdlc1 %[p3], 0x03(%[dst]) \n\t" "gssdrc1 %[p3], -0x04(%[dst]) \n\t" @@ -1233,8 +1179,7 @@ void ff_vp8_idct_add_mmi(uint8_t *dst, int16_t block[16], ptrdiff_t stride) MMI_SDC1(%[ftmp0], %[block], 0x18) TRANSPOSE_4H(%[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4], - %[ftmp5], %[ftmp6], %[ftmp7], %[ftmp8], - %[ftmp9], %[tmp0], %[ftmp0], %[ftmp10]) + %[ftmp5], %[ftmp6], %[ftmp7], %[ftmp8]) // t[0 4 8 12] "paddh %[ftmp5], %[ftmp1], %[ftmp3] \n\t" @@ -1269,8 +1214,7 @@ void ff_vp8_idct_add_mmi(uint8_t *dst, int16_t block[16], ptrdiff_t stride) "psrah %[ftmp4], %[ftmp4], %[ftmp11] \n\t" TRANSPOSE_4H(%[ftmp1], %[ftmp2], %[ftmp3], %[ftmp4], - %[ftmp5], %[ftmp6], %[ftmp7], %[ftmp8], - %[ftmp9], %[tmp0], %[ftmp0], %[ftmp10]) + %[ftmp5], %[ftmp6], %[ftmp7], %[ftmp8]) MMI_LWC1(%[ftmp5], %[dst0], 0x00) MMI_LWC1(%[ftmp6], %[dst1], 0x00) |