summaryrefslogtreecommitdiff
path: root/libavcodec/mips/hevcpred_msa.c
diff options
context:
space:
mode:
authorgxw <guxiwei-hf@loongson.cn>2019-08-07 17:52:00 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2019-08-13 16:48:38 +0200
commita3e572d96fd1dd6291f6b28e173db858c08ff8d8 (patch)
tree85807f6ec1442cc362cf8946e67f564c92267e07 /libavcodec/mips/hevcpred_msa.c
parent8f92eb05e063e6c4d6e36521020620d4e6e1c21d (diff)
avutil/mips: refine msa macros CLIP_*.
Changing details as following: 1. Remove the local variable 'out_m' in 'CLIP_SH' and store the result in source vector. 2. Refine the implementation of macro 'CLIP_SH_0_255' and 'CLIP_SW_0_255'. Performance of VP8 decoding has speed up about 1.1%(from 7.03x to 7.11x). Performance of H264 decoding has speed up about 0.5%(from 4.35x to 4.37x). Performance of Theora decoding has speed up about 0.7%(from 5.79x to 5.83x). 3. Remove redundant macro 'CLIP_SH/Wn_0_255_MAX_SATU' and use 'CLIP_SH/Wn_0_255' instead, because there are no difference in the effect of this two macros. Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mips/hevcpred_msa.c')
-rw-r--r--libavcodec/mips/hevcpred_msa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/mips/hevcpred_msa.c b/libavcodec/mips/hevcpred_msa.c
index b8df089e0c..930a89cb48 100644
--- a/libavcodec/mips/hevcpred_msa.c
+++ b/libavcodec/mips/hevcpred_msa.c
@@ -83,7 +83,7 @@ static void hevc_intra_pred_vert_4x4_msa(const uint8_t *src_top,
vec2 -= vec0;
vec2 >>= 1;
vec2 += vec1;
- vec2 = CLIP_SH_0_255(vec2);
+ CLIP_SH_0_255(vec2);
for (col = 0; col < 4; col++) {
dst[stride * col] = (uint8_t) vec2[col];
@@ -122,7 +122,7 @@ static void hevc_intra_pred_vert_8x8_msa(const uint8_t *src_top,
vec2 -= vec0;
vec2 >>= 1;
vec2 += vec1;
- vec2 = CLIP_SH_0_255(vec2);
+ CLIP_SH_0_255(vec2);
val0 = vec2[0];
val1 = vec2[1];
@@ -214,7 +214,7 @@ static void hevc_intra_pred_horiz_4x4_msa(const uint8_t *src_top,
src0_r -= src_top_val;
src0_r >>= 1;
src0_r += src_left_val;
- src0_r = CLIP_SH_0_255(src0_r);
+ CLIP_SH_0_255(src0_r);
src0 = __msa_pckev_b((v16i8) src0_r, (v16i8) src0_r);
val0 = __msa_copy_s_w((v4i32) src0, 0);
SW(val0, dst);
@@ -254,7 +254,7 @@ static void hevc_intra_pred_horiz_8x8_msa(const uint8_t *src_top,
src0_r -= src_top_val;
src0_r >>= 1;
src0_r += src_left_val;
- src0_r = CLIP_SH_0_255(src0_r);
+ CLIP_SH_0_255(src0_r);
src0 = __msa_pckev_b((v16i8) src0_r, (v16i8) src0_r);
val0 = __msa_copy_s_d((v2i64) src0, 0);
SD(val0, dst);