mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-04 01:36:07 +00:00
lavc/mips: Fix hevc decoding bugs on MIPS paltform.
The patch fixes the bugs that occurred when running fate-checkasm-hevc_pel on MIPS paltform. Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
d5679d6899
commit
fb233771ce
@ -52,6 +52,15 @@
|
||||
out_m; \
|
||||
} )
|
||||
|
||||
#define HEVC_FILT_4TAP_SW(in0, in1, filt0, filt1) \
|
||||
( { \
|
||||
v4i32 out_m; \
|
||||
\
|
||||
out_m = __msa_dotp_s_w((v8i16) in0, (v8i16) filt0); \
|
||||
out_m = __msa_dpadd_s_w(out_m, (v8i16) in1, (v8i16) filt1); \
|
||||
out_m; \
|
||||
} )
|
||||
|
||||
#define HEVC_FILT_4TAP(in0, in1, filt0, filt1) \
|
||||
( { \
|
||||
v4i32 out_m; \
|
||||
|
@ -136,6 +136,7 @@ static void hevc_bi_copy_6w_msa(const uint8_t *src0_ptr,
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint64_t tp0, tp1, tp2, tp3;
|
||||
int32_t res = height & 0x07;
|
||||
v16u8 out0, out1, out2, out3;
|
||||
v16i8 zero = { 0 };
|
||||
v16i8 src0 = { 0 }, src1 = { 0 }, src2 = { 0 }, src3 = { 0 };
|
||||
@ -176,6 +177,45 @@ static void hevc_bi_copy_6w_msa(const uint8_t *src0_ptr,
|
||||
ST_H2(out3, 2, 6, dst + 2 * dst_stride + 4, dst_stride);
|
||||
dst += (4 * dst_stride);
|
||||
}
|
||||
if (res) {
|
||||
LD4(src0_ptr, src_stride, tp0, tp1, tp2, tp3);
|
||||
src0_ptr += (4 * src_stride);
|
||||
INSERT_D2_SB(tp0, tp1, src0);
|
||||
INSERT_D2_SB(tp2, tp3, src1);
|
||||
LD4(src0_ptr, src_stride, tp0, tp1, tp2, tp3);
|
||||
INSERT_D2_SB(tp0, tp1, src2);
|
||||
INSERT_D2_SB(tp2, tp3, src3);
|
||||
LD_SH8(src1_ptr, src2_stride, in0, in1, in2, in3, in4, in5, in6, in7);
|
||||
ILVRL_B2_SH(zero, src0, dst0, dst1);
|
||||
ILVRL_B2_SH(zero, src1, dst2, dst3);
|
||||
ILVRL_B2_SH(zero, src2, dst4, dst5);
|
||||
ILVRL_B2_SH(zero, src3, dst6, dst7);
|
||||
SLLI_4V(dst0, dst1, dst2, dst3, 6);
|
||||
SLLI_4V(dst4, dst5, dst6, dst7, 6);
|
||||
HEVC_BI_RND_CLIP4_MAX_SATU(in0, in1, in2, in3, dst0, dst1, dst2, dst3,
|
||||
7, dst0, dst1, dst2, dst3);
|
||||
HEVC_BI_RND_CLIP4_MAX_SATU(in4, in5, in6, in7, dst4, dst5, dst6, dst7,
|
||||
7, dst4, dst5, dst6, dst7);
|
||||
PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1);
|
||||
PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3);
|
||||
if (res == 2) {
|
||||
ST_W2(out0, 0, 2, dst, dst_stride);
|
||||
ST_H2(out0, 2, 6, dst + 4, dst_stride);
|
||||
} else if (res == 4) {
|
||||
ST_W2(out0, 0, 2, dst, dst_stride);
|
||||
ST_H2(out0, 2, 6, dst + 4, dst_stride);
|
||||
ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride);
|
||||
ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride);
|
||||
} else {
|
||||
ST_W2(out0, 0, 2, dst, dst_stride);
|
||||
ST_H2(out0, 2, 6, dst + 4, dst_stride);
|
||||
ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride);
|
||||
ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride);
|
||||
dst += (4 * dst_stride);
|
||||
ST_W2(out2, 0, 2, dst, dst_stride);
|
||||
ST_H2(out2, 2, 6, dst + 4, dst_stride);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_bi_copy_8w_msa(const uint8_t *src0_ptr,
|
||||
@ -536,6 +576,7 @@ static void hevc_hz_bi_8t_4w_msa(const uint8_t *src0_ptr,
|
||||
int32_t height)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
int32_t res = height & 0x07;
|
||||
v8i16 filt0, filt1, filt2, filt3;
|
||||
v16i8 src0, src1, src2, src3, src4, src5, src6, src7;
|
||||
v16i8 mask1, mask2, mask3;
|
||||
@ -597,6 +638,50 @@ static void hevc_hz_bi_8t_4w_msa(const uint8_t *src0_ptr,
|
||||
ST_W8(dst0, dst1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride);
|
||||
dst += (8 * dst_stride);
|
||||
}
|
||||
if (res) {
|
||||
LD_SB8(src0_ptr, src_stride, src0, src1, src2, src3,
|
||||
src4, src5, src6, src7);
|
||||
LD_SH8(src1_ptr, src2_stride, in0, in1, in2, in3, in4, in5, in6, in7);
|
||||
|
||||
ILVR_D2_SH(in1, in0, in3, in2, in0, in1);
|
||||
ILVR_D2_SH(in5, in4, in7, in6, in2, in3);
|
||||
XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7);
|
||||
|
||||
dst0 = const_vec;
|
||||
dst1 = const_vec;
|
||||
dst2 = const_vec;
|
||||
dst3 = const_vec;
|
||||
VSHF_B2_SB(src0, src1, src2, src3, mask0, mask0, vec0, vec1);
|
||||
VSHF_B2_SB(src4, src5, src6, src7, mask0, mask0, vec2, vec3);
|
||||
DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, dst0,
|
||||
dst1, dst2, dst3);
|
||||
VSHF_B2_SB(src0, src1, src2, src3, mask1, mask1, vec0, vec1);
|
||||
VSHF_B2_SB(src4, src5, src6, src7, mask1, mask1, vec2, vec3);
|
||||
DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt1, filt1, filt1, filt1, dst0,
|
||||
dst1, dst2, dst3);
|
||||
VSHF_B2_SB(src0, src1, src2, src3, mask2, mask2, vec0, vec1);
|
||||
VSHF_B2_SB(src4, src5, src6, src7, mask2, mask2, vec2, vec3);
|
||||
DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt2, filt2, filt2, filt2, dst0,
|
||||
dst1, dst2, dst3);
|
||||
VSHF_B2_SB(src0, src1, src2, src3, mask3, mask3, vec0, vec1);
|
||||
VSHF_B2_SB(src4, src5, src6, src7, mask3, mask3, vec2, vec3);
|
||||
DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt3, filt3, filt3, filt3, dst0,
|
||||
dst1, dst2, dst3);
|
||||
|
||||
HEVC_BI_RND_CLIP4(in0, in1, in2, in3,
|
||||
dst0, dst1, dst2, dst3, 7, dst0, dst1, dst2, dst3);
|
||||
|
||||
PCKEV_B2_SH(dst1, dst0, dst3, dst2, dst0, dst1);
|
||||
if (res == 2) {
|
||||
ST_W2(dst0, 0, 1, dst, dst_stride);
|
||||
} else if (res == 4) {
|
||||
ST_W4(dst0, 0, 1, 2, 3, dst, dst_stride);
|
||||
} else {
|
||||
ST_W4(dst0, 0, 1, 2, 3, dst, dst_stride);
|
||||
dst += (4 * dst_stride);
|
||||
ST_W2(dst1, 0, 1, dst, dst_stride);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_hz_bi_8t_8w_msa(const uint8_t *src0_ptr,
|
||||
@ -1182,6 +1267,7 @@ static void hevc_vt_bi_8t_4w_msa(const uint8_t *src0_ptr,
|
||||
int32_t height)
|
||||
{
|
||||
int32_t loop_cnt;
|
||||
int32_t res = height & 0x07;
|
||||
v16i8 src0, src1, src2, src3, src4, src5;
|
||||
v16i8 src6, src7, src8, src9, src10;
|
||||
v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
|
||||
@ -1256,6 +1342,50 @@ static void hevc_vt_bi_8t_4w_msa(const uint8_t *src0_ptr,
|
||||
src6554 = src14131312;
|
||||
src6 = src14;
|
||||
}
|
||||
if (res) {
|
||||
LD_SB8(src0_ptr, src_stride,
|
||||
src7, src8, src9, src10, src11, src12, src13, src14);
|
||||
LD_SH8(src1_ptr, src2_stride, in0, in1, in2, in3, in4, in5, in6, in7);
|
||||
|
||||
ILVR_D2_SH(in1, in0, in3, in2, in0, in1);
|
||||
ILVR_D2_SH(in5, in4, in7, in6, in2, in3);
|
||||
ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9,
|
||||
src76_r, src87_r, src98_r, src109_r);
|
||||
ILVR_B4_SB(src11, src10, src12, src11, src13, src12, src14, src13,
|
||||
src1110_r, src1211_r, src1312_r, src1413_r);
|
||||
ILVR_D4_SB(src87_r, src76_r, src109_r, src98_r, src1211_r, src1110_r,
|
||||
src1413_r, src1312_r,
|
||||
src8776, src10998, src12111110, src14131312);
|
||||
XORI_B4_128_SB(src8776, src10998, src12111110, src14131312);
|
||||
|
||||
dst10 = const_vec;
|
||||
DPADD_SB4_SH(src2110, src4332, src6554, src8776,
|
||||
filt0, filt1, filt2, filt3, dst10, dst10, dst10, dst10);
|
||||
dst32 = const_vec;
|
||||
DPADD_SB4_SH(src4332, src6554, src8776, src10998,
|
||||
filt0, filt1, filt2, filt3, dst32, dst32, dst32, dst32);
|
||||
dst54 = const_vec;
|
||||
DPADD_SB4_SH(src6554, src8776, src10998, src12111110,
|
||||
filt0, filt1, filt2, filt3, dst54, dst54, dst54, dst54);
|
||||
dst76 = const_vec;
|
||||
DPADD_SB4_SH(src8776, src10998, src12111110, src14131312,
|
||||
filt0, filt1, filt2, filt3, dst76, dst76, dst76, dst76);
|
||||
|
||||
HEVC_BI_RND_CLIP4(in0, in1, in2, in3,
|
||||
dst10, dst32, dst54, dst76, 7,
|
||||
dst10, dst32, dst54, dst76);
|
||||
|
||||
PCKEV_B2_SH(dst32, dst10, dst76, dst54, dst10, dst54);
|
||||
if (res == 2) {
|
||||
ST_W2(dst10, 0, 1, dst, dst_stride);
|
||||
} else if (res == 4) {
|
||||
ST_W4(dst10, 0, 1, 2, 3, dst, dst_stride);
|
||||
} else {
|
||||
ST_W4(dst10, 0, 1, 2, 3, dst, dst_stride);
|
||||
dst += 4 * dst_stride;
|
||||
ST_W2(dst54, 0, 1, dst, dst_stride);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_vt_bi_8t_8w_msa(const uint8_t *src0_ptr,
|
||||
@ -2363,6 +2493,7 @@ static void hevc_hz_bi_4t_6w_msa(const uint8_t *src0_ptr,
|
||||
int32_t height)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
int32_t res = height & 0x03;
|
||||
v8i16 filt0, filt1;
|
||||
v16i8 src0, src1, src2, src3;
|
||||
v8i16 in0, in1, in2, in3;
|
||||
@ -2412,6 +2543,24 @@ static void hevc_hz_bi_4t_6w_msa(const uint8_t *src0_ptr,
|
||||
ST_H2(dst1, 2, 6, dst + 2 * dst_stride + 4, dst_stride);
|
||||
dst += (4 * dst_stride);
|
||||
}
|
||||
if (res) {
|
||||
LD_SB2(src0_ptr, src_stride, src0, src1);
|
||||
LD_SH2(src1_ptr, src2_stride, in0, in1);
|
||||
XORI_B2_128_SB(src0, src1);
|
||||
|
||||
dst0 = const_vec;
|
||||
dst1 = const_vec;
|
||||
VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0, vec1);
|
||||
DPADD_SB2_SH(vec0, vec1, filt0, filt0, dst0, dst1);
|
||||
VSHF_B2_SB(src0, src0, src1, src1, mask1, mask1, vec0, vec1);
|
||||
DPADD_SB2_SH(vec0, vec1, filt1, filt1, dst0, dst1);
|
||||
|
||||
HEVC_BI_RND_CLIP2(in0, in1, dst0, dst1, 7, dst0, dst1);
|
||||
|
||||
dst0 = (v8i16) __msa_pckev_b((v16i8) dst1, (v16i8) dst0);
|
||||
ST_W2(dst0, 0, 2, dst, dst_stride);
|
||||
ST_H2(dst0, 2, 6, dst + 4, dst_stride);
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_hz_bi_4t_8x2_msa(const uint8_t *src0_ptr,
|
||||
|
@ -42,8 +42,8 @@ static const uint8_t ff_hevc_mask_arr[16 * 2] __attribute__((aligned(0x40))) = {
|
||||
out1_l = __msa_dpadd_s_w(offset, (v8i16) out1_l, (v8i16) wgt); \
|
||||
\
|
||||
SRAR_W4_SW(out0_r, out1_r, out0_l, out1_l, rnd); \
|
||||
CLIP_SW4_0_255(out0_l, out0_r, out1_l, out1_r); \
|
||||
PCKEV_H2_SH(out0_l, out0_r, out1_l, out1_r, out0, out1); \
|
||||
CLIP_SH2_0_255(out0, out1); \
|
||||
}
|
||||
|
||||
#define HEVC_BIW_RND_CLIP4(in0, in1, in2, in3, vec0, vec1, vec2, vec3, \
|
||||
@ -65,8 +65,8 @@ static const uint8_t ff_hevc_mask_arr[16 * 2] __attribute__((aligned(0x40))) = {
|
||||
out0_l = __msa_dpadd_s_w(offset, (v8i16) out0_l, (v8i16) wgt); \
|
||||
out1_l = __msa_dpadd_s_w(offset, (v8i16) out1_l, (v8i16) wgt); \
|
||||
SRAR_W4_SW(out0_r, out1_r, out0_l, out1_l, rnd); \
|
||||
CLIP_SW4_0_255(out0_r, out1_r, out0_l, out1_l); \
|
||||
PCKEV_H2_SH(out0_l, out0_r, out1_l, out1_r, out0, out1); \
|
||||
CLIP_SH2_0_255(out0, out1); \
|
||||
}
|
||||
|
||||
#define HEVC_BIW_RND_CLIP4_MAX_SATU(in0, in1, in2, in3, vec0, vec1, vec2, \
|
||||
@ -123,8 +123,8 @@ static void hevc_biwgt_copy_4w_msa(const uint8_t *src0_ptr,
|
||||
dst0_r = __msa_dpadd_s_w(offset_vec, (v8i16) dst0_r, weight_vec);
|
||||
dst0_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst0_l, weight_vec);
|
||||
SRAR_W2_SW(dst0_r, dst0_l, rnd_vec);
|
||||
CLIP_SW2_0_255(dst0_r, dst0_l);
|
||||
dst0 = (v8i16) __msa_pckev_h((v8i16) dst0_l, (v8i16) dst0_r);
|
||||
CLIP_SH_0_255(dst0);
|
||||
out0 = (v16u8) __msa_pckev_b((v16i8) dst0, (v16i8) dst0);
|
||||
ST_W2(out0, 0, 1, dst, dst_stride);
|
||||
} else if (4 == height) {
|
||||
@ -182,6 +182,7 @@ static void hevc_biwgt_copy_6w_msa(const uint8_t *src0_ptr,
|
||||
int32_t rnd_val)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
int32_t res = height & 0x03;
|
||||
int32_t offset, weight;
|
||||
uint64_t tp0, tp1, tp2, tp3;
|
||||
v16u8 out0, out1;
|
||||
@ -220,6 +221,27 @@ static void hevc_biwgt_copy_6w_msa(const uint8_t *src0_ptr,
|
||||
ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride);
|
||||
dst += (4 * dst_stride);
|
||||
}
|
||||
if (res) {
|
||||
LD4(src0_ptr, src_stride, tp0, tp1, tp2, tp3);
|
||||
src0_ptr += (4 * src_stride);
|
||||
INSERT_D2_SB(tp0, tp1, src0);
|
||||
INSERT_D2_SB(tp2, tp3, src1);
|
||||
LD_SH4(src1_ptr, src2_stride, in0, in1, in2, in3);
|
||||
src1_ptr += (4 * src2_stride);
|
||||
ILVRL_B2_SH(zero, src0, dst0, dst1);
|
||||
ILVRL_B2_SH(zero, src1, dst2, dst3);
|
||||
SLLI_4V(dst0, dst1, dst2, dst3, 6);
|
||||
HEVC_BIW_RND_CLIP4_MAX_SATU(dst0, dst1, dst2, dst3,
|
||||
in0, in1, in2, in3,
|
||||
weight_vec, rnd_vec, offset_vec,
|
||||
dst0, dst1, dst2, dst3);
|
||||
|
||||
PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1);
|
||||
ST_W2(out0, 0, 2, dst, dst_stride);
|
||||
ST_H2(out0, 2, 6, dst + 4, dst_stride);
|
||||
ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride);
|
||||
ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride);
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_biwgt_copy_8w_msa(const uint8_t *src0_ptr,
|
||||
@ -340,7 +362,7 @@ static void hevc_biwgt_copy_12w_msa(const uint8_t *src0_ptr,
|
||||
weight_vec = __msa_fill_w(weight);
|
||||
rnd_vec = __msa_fill_w(rnd_val + 1);
|
||||
|
||||
for (loop_cnt = (16 >> 2); loop_cnt--;) {
|
||||
for (loop_cnt = (height >> 2); loop_cnt--;) {
|
||||
LD_SB4(src0_ptr, src_stride, src0, src1, src2, src3);
|
||||
src0_ptr += (4 * src_stride);
|
||||
LD_SH4(src1_ptr, src2_stride, in0, in1, in2, in3);
|
||||
@ -1069,8 +1091,8 @@ static void hevc_hz_biwgt_8t_24w_msa(const uint8_t *src0_ptr,
|
||||
dst2_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst2_l,
|
||||
(v8i16) weight_vec);
|
||||
SRAR_W2_SW(dst2_r, dst2_l, rnd_vec);
|
||||
CLIP_SW2_0_255(dst2_r, dst2_l);
|
||||
out2 = __msa_pckev_h((v8i16) dst2_l, (v8i16) dst2_r);
|
||||
CLIP_SH_0_255(out2);
|
||||
|
||||
LD_SB2(src0_ptr, 16, src0, src1);
|
||||
src0_ptr += src_stride;
|
||||
@ -1100,8 +1122,8 @@ static void hevc_hz_biwgt_8t_24w_msa(const uint8_t *src0_ptr,
|
||||
dst2_r = __msa_dpadd_s_w(offset_vec, (v8i16) dst2_r, (v8i16) weight_vec);
|
||||
dst2_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst2_l, (v8i16) weight_vec);
|
||||
SRAR_W2_SW(dst2_r, dst2_l, rnd_vec);
|
||||
CLIP_SW2_0_255(dst2_r, dst2_l);
|
||||
out2 = __msa_pckev_h((v8i16) dst2_l, (v8i16) dst2_r);
|
||||
CLIP_SH_0_255(out2);
|
||||
PCKEV_B2_SH(out1, out0, out2, out2, out0, out2);
|
||||
dst_val0 = __msa_copy_u_d((v2i64) out2, 0);
|
||||
ST_SH(out0, dst);
|
||||
@ -1413,6 +1435,7 @@ static void hevc_vt_biwgt_8t_4w_msa(const uint8_t *src0_ptr,
|
||||
int32_t rnd_val)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
int32_t res = height & 0x07;
|
||||
int32_t offset, weight;
|
||||
v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
|
||||
v16i8 src11, src12, src13, src14;
|
||||
@ -1489,6 +1512,46 @@ static void hevc_vt_biwgt_8t_4w_msa(const uint8_t *src0_ptr,
|
||||
ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride);
|
||||
dst += (8 * dst_stride);
|
||||
|
||||
src2110 = src10998;
|
||||
src4332 = src12111110;
|
||||
src6554 = src14131312;
|
||||
src6 = src14;
|
||||
}
|
||||
if (res) {
|
||||
LD_SB8(src0_ptr, src_stride,
|
||||
src7, src8, src9, src10, src11, src12, src13, src14);
|
||||
src0_ptr += (8 * src_stride);
|
||||
LD_SH8(src1_ptr, src2_stride, in0, in1, in2, in3, in4, in5, in6, in7);
|
||||
src1_ptr += (8 * src2_stride);
|
||||
|
||||
ILVR_D2_SH(in1, in0, in3, in2, in0, in1);
|
||||
ILVR_D2_SH(in5, in4, in7, in6, in2, in3);
|
||||
ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9,
|
||||
src76_r, src87_r, src98_r, src109_r);
|
||||
ILVR_B4_SB(src11, src10, src12, src11, src13, src12, src14, src13,
|
||||
src1110_r, src1211_r, src1312_r, src1413_r);
|
||||
ILVR_D4_SB(src87_r, src76_r, src109_r, src98_r, src1211_r, src1110_r,
|
||||
src1413_r, src1312_r,
|
||||
src8776, src10998, src12111110, src14131312);
|
||||
XORI_B4_128_SB(src8776, src10998, src12111110, src14131312);
|
||||
|
||||
DOTP_SB4_SH(src2110, src4332, src6554, src8776, filt0, filt0, filt0,
|
||||
filt0, dst10, dst32, dst54, dst76);
|
||||
DPADD_SB4_SH(src4332, src6554, src8776, src10998, filt1, filt1, filt1,
|
||||
filt1, dst10, dst32, dst54, dst76);
|
||||
DPADD_SB4_SH(src6554, src8776, src10998, src12111110, filt2, filt2,
|
||||
filt2, filt2, dst10, dst32, dst54, dst76);
|
||||
DPADD_SB4_SH(src8776, src10998, src12111110, src14131312, filt3, filt3,
|
||||
filt3, filt3, dst10, dst32, dst54, dst76);
|
||||
|
||||
HEVC_BIW_RND_CLIP4(dst10, dst32, dst54, dst76,
|
||||
in0, in1, in2, in3,
|
||||
weight_vec, rnd_vec, offset_vec,
|
||||
out0, out1, out2, out3);
|
||||
|
||||
PCKEV_B2_SH(out1, out0, out3, out2, out0, out1);
|
||||
ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride);
|
||||
|
||||
src2110 = src10998;
|
||||
src4332 = src12111110;
|
||||
src6554 = src14131312;
|
||||
@ -1674,8 +1737,8 @@ static void hevc_vt_biwgt_8t_12w_msa(const uint8_t *src0_ptr,
|
||||
dst2_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst2_l,
|
||||
(v8i16) weight_vec);
|
||||
SRAR_W2_SW(dst2_r, dst2_l, rnd_vec);
|
||||
CLIP_SW2_0_255(dst2_r, dst2_l);
|
||||
out2 = __msa_pckev_h((v8i16) dst2_l, (v8i16) dst2_r);
|
||||
CLIP_SH_0_255(out2);
|
||||
PCKEV_B2_SH(out1, out0, out2, out2, out0, out2);
|
||||
ST_D2(out0, 0, 1, dst, dst_stride);
|
||||
ST_W2(out2, 0, 1, dst + 8, dst_stride);
|
||||
@ -3555,8 +3618,8 @@ static void hevc_vt_biwgt_4t_4x2_msa(const uint8_t *src0_ptr,
|
||||
dst10_r = __msa_dpadd_s_w(offset_vec, (v8i16) dst10_r, (v8i16) weight_vec);
|
||||
dst10_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst10_l, (v8i16) weight_vec);
|
||||
SRAR_W2_SW(dst10_r, dst10_l, rnd_vec);
|
||||
CLIP_SW2_0_255(dst10_r, dst10_l);
|
||||
out = __msa_pckev_h((v8i16) dst10_l, (v8i16) dst10_r);
|
||||
CLIP_SH_0_255(out);
|
||||
out = (v8i16) __msa_pckev_b((v16i8) out, (v16i8) out);
|
||||
ST_W2(out, 0, 1, dst, dst_stride);
|
||||
}
|
||||
@ -3760,6 +3823,7 @@ static void hevc_vt_biwgt_4t_6w_msa(const uint8_t *src0_ptr,
|
||||
int32_t rnd_val)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
int32_t res = height & 0x03;
|
||||
int32_t offset, weight, constant;
|
||||
v16i8 src0, src1, src2, src3, src4;
|
||||
v8i16 in0, in1, in2, in3;
|
||||
@ -3820,6 +3884,35 @@ static void hevc_vt_biwgt_4t_6w_msa(const uint8_t *src0_ptr,
|
||||
ST_H2(tmp1, 2, 6, dst + 2 * dst_stride + 4, dst_stride);
|
||||
dst += (4 * dst_stride);
|
||||
}
|
||||
if (res) {
|
||||
LD_SB2(src0_ptr, src_stride, src3, src4);
|
||||
src0_ptr += (2 * src_stride);
|
||||
LD_SH4(src1_ptr, src2_stride, in0, in1, in2, in3);
|
||||
src1_ptr += (4 * src2_stride);
|
||||
XORI_B2_128_SB(src3, src4);
|
||||
ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r);
|
||||
|
||||
tmp0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1);
|
||||
tmp1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1);
|
||||
|
||||
LD_SB2(src0_ptr, src_stride, src1, src2);
|
||||
src0_ptr += (2 * src_stride);
|
||||
XORI_B2_128_SB(src1, src2);
|
||||
ILVR_B2_SB(src1, src4, src2, src1, src10_r, src21_r);
|
||||
|
||||
tmp2 = HEVC_FILT_4TAP_SH(src32_r, src10_r, filt0, filt1);
|
||||
tmp3 = HEVC_FILT_4TAP_SH(src43_r, src21_r, filt0, filt1);
|
||||
HEVC_BIW_RND_CLIP4(tmp0, tmp1, tmp2, tmp3,
|
||||
in0, in1, in2, in3,
|
||||
weight_vec, rnd_vec, offset_vec,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
|
||||
PCKEV_B2_SH(tmp1, tmp0, tmp3, tmp2, tmp0, tmp1);
|
||||
ST_W2(tmp0, 0, 2, dst, dst_stride);
|
||||
ST_H2(tmp0, 2, 6, dst + 4, dst_stride);
|
||||
ST_W2(tmp1, 0, 2, dst + 2 * dst_stride, dst_stride);
|
||||
ST_H2(tmp1, 2, 6, dst + 2 * dst_stride + 4, dst_stride);
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_vt_biwgt_4t_8x2_msa(const uint8_t *src0_ptr,
|
||||
@ -4575,8 +4668,8 @@ static void hevc_hv_biwgt_4t_4x2_msa(const uint8_t *src0_ptr,
|
||||
dst0 = __msa_dpadd_s_w(offset_vec, tmp0, weight_vec);
|
||||
dst1 = __msa_dpadd_s_w(offset_vec, tmp1, weight_vec);
|
||||
SRAR_W2_SW(dst0, dst1, rnd_vec);
|
||||
CLIP_SW2_0_255(dst0, dst1);
|
||||
tmp = __msa_pckev_h((v8i16) dst1, (v8i16) dst0);
|
||||
CLIP_SH_0_255(tmp);
|
||||
out = (v16u8) __msa_pckev_b((v16i8) tmp, (v16i8) tmp);
|
||||
ST_W2(out, 0, 1, dst, dst_stride);
|
||||
}
|
||||
@ -4672,8 +4765,8 @@ static void hevc_hv_biwgt_4t_4x4_msa(const uint8_t *src0_ptr,
|
||||
dst2 = __msa_dpadd_s_w(offset_vec, tmp2, weight_vec);
|
||||
dst3 = __msa_dpadd_s_w(offset_vec, tmp3, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1);
|
||||
CLIP_SH2_0_255(tmp0, tmp1);
|
||||
out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0);
|
||||
ST_W4(out, 0, 1, 2, 3, dst, dst_stride);
|
||||
}
|
||||
@ -4809,9 +4902,10 @@ static void hevc_hv_biwgt_4t_4multx8mult_msa(const uint8_t *src0_ptr,
|
||||
dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
CLIP_SW4_0_255(dst4, dst5, dst6, dst7);
|
||||
PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1,
|
||||
tmp2, tmp3);
|
||||
CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3);
|
||||
PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1);
|
||||
ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride);
|
||||
dst += (8 * dst_stride);
|
||||
@ -5007,9 +5101,10 @@ static void hevc_hv_biwgt_4t_6w_msa(const uint8_t *src0_ptr,
|
||||
dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
CLIP_SW4_0_255(dst4, dst5, dst6, dst7);
|
||||
PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1,
|
||||
tmp2, tmp3);
|
||||
CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3);
|
||||
PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1);
|
||||
ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride);
|
||||
|
||||
@ -5029,9 +5124,9 @@ static void hevc_hv_biwgt_4t_6w_msa(const uint8_t *src0_ptr,
|
||||
dst2 = __msa_dpadd_s_w(offset_vec, tmp2, weight_vec);
|
||||
dst3 = __msa_dpadd_s_w(offset_vec, tmp3, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp4, tmp5);
|
||||
|
||||
CLIP_SH2_0_255(tmp4, tmp5);
|
||||
out2 = (v16u8) __msa_pckev_b((v16i8) tmp5, (v16i8) tmp4);
|
||||
ST_H8(out2, 0, 1, 2, 3, 4, 5, 6, 7, dst + 4, dst_stride);
|
||||
}
|
||||
@ -5126,8 +5221,8 @@ static void hevc_hv_biwgt_4t_8x2_msa(const uint8_t *src0_ptr,
|
||||
dst1_r = __msa_dpadd_s_w(offset_vec, tmp2, weight_vec);
|
||||
dst1_l = __msa_dpadd_s_w(offset_vec, tmp3, weight_vec);
|
||||
SRAR_W4_SW(dst0_r, dst0_l, dst1_r, dst1_l, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0_r, dst0_l, dst1_r, dst1_l);
|
||||
PCKEV_H2_SH(dst0_l, dst0_r, dst1_l, dst1_r, tmp0, tmp1);
|
||||
CLIP_SH2_0_255(tmp0, tmp1);
|
||||
out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0);
|
||||
ST_D2(out, 0, 1, dst, dst_stride);
|
||||
}
|
||||
@ -5247,9 +5342,10 @@ static void hevc_hv_biwgt_4t_8multx4_msa(const uint8_t *src0_ptr,
|
||||
dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
CLIP_SW4_0_255(dst4, dst5, dst6, dst7);
|
||||
PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3);
|
||||
PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1);
|
||||
ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride);
|
||||
dst += 8;
|
||||
@ -5386,9 +5482,10 @@ static void hevc_hv_biwgt_4t_8x6_msa(const uint8_t *src0_ptr,
|
||||
dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
CLIP_SW4_0_255(dst4, dst5, dst6, dst7);
|
||||
PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3);
|
||||
PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1);
|
||||
|
||||
PCKEV_H2_SW(dst4_l, dst4_r, dst5_l, dst5_r, dst0, dst1);
|
||||
@ -5399,8 +5496,8 @@ static void hevc_hv_biwgt_4t_8x6_msa(const uint8_t *src0_ptr,
|
||||
dst2 = __msa_dpadd_s_w(offset_vec, tmp2, weight_vec);
|
||||
dst3 = __msa_dpadd_s_w(offset_vec, tmp3, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp4, tmp5);
|
||||
CLIP_SH2_0_255(tmp4, tmp5);
|
||||
out2 = (v16u8) __msa_pckev_b((v16i8) tmp5, (v16i8) tmp4);
|
||||
ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride);
|
||||
ST_D2(out2, 0, 1, dst + 4 * dst_stride, dst_stride);
|
||||
@ -5536,9 +5633,10 @@ static void hevc_hv_biwgt_4t_8multx4mult_msa(const uint8_t *src0_ptr,
|
||||
dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
CLIP_SW4_0_255(dst4, dst5, dst6, dst7);
|
||||
PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3);
|
||||
PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1);
|
||||
ST_D4(out0, out1, 0, 1, 0, 1, dst_tmp, dst_stride);
|
||||
dst_tmp += (4 * dst_stride);
|
||||
@ -5724,9 +5822,10 @@ static void hevc_hv_biwgt_4t_12w_msa(const uint8_t *src0_ptr,
|
||||
dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
CLIP_SW4_0_255(dst4, dst5, dst6, dst7);
|
||||
PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3);
|
||||
PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1);
|
||||
ST_D4(out0, out1, 0, 1, 0, 1, dst_tmp, dst_stride);
|
||||
dst_tmp += (4 * dst_stride);
|
||||
@ -5820,9 +5919,10 @@ static void hevc_hv_biwgt_4t_12w_msa(const uint8_t *src0_ptr,
|
||||
dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec);
|
||||
SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec);
|
||||
SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec);
|
||||
CLIP_SW4_0_255(dst0, dst1, dst2, dst3);
|
||||
CLIP_SW4_0_255(dst4, dst5, dst6, dst7);
|
||||
PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3);
|
||||
PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1);
|
||||
ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride);
|
||||
dst += (8 * dst_stride);
|
||||
|
@ -908,6 +908,7 @@ static void common_vt_8t_4w_msa(const uint8_t *src, int32_t src_stride,
|
||||
const int8_t *filter, int32_t height)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint32_t res = (height & 0x07) >> 1;
|
||||
v16u8 out0, out1;
|
||||
v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
|
||||
v16i8 src11, src12, src13, src14;
|
||||
@ -970,6 +971,27 @@ static void common_vt_8t_4w_msa(const uint8_t *src, int32_t src_stride,
|
||||
src6554 = src14131312;
|
||||
src6 = src14;
|
||||
}
|
||||
for (; res--; ) {
|
||||
LD_SB2(src, src_stride, src7, src8);
|
||||
src += 2 * src_stride;
|
||||
ILVR_B2_SB(src7, src6, src8, src7, src76_r, src87_r);
|
||||
src8776 = (v16i8)__msa_ilvr_d((v2i64) src87_r, (v2i64) src76_r);
|
||||
src8776 = (v16i8)__msa_xori_b(src8776, 128);
|
||||
out10 = (v8i16)__msa_dotp_s_h((v16i8) src2110, (v16i8) filt0);
|
||||
out10 = (v8i16)__msa_dpadd_s_h((v8i16) out10, src4332, filt1);
|
||||
out10 = (v8i16)__msa_dpadd_s_h((v8i16) out10, src6554, filt2);
|
||||
out10 = (v8i16)__msa_dpadd_s_h((v8i16) out10, src8776, filt3);
|
||||
out10 = (v8i16)__msa_srari_h((v8i16) out10, 6);
|
||||
out10 = (v8i16)__msa_sat_s_h((v8i16) out10, 7);
|
||||
out0 = (v16u8)__msa_pckev_b((v16i8) out10, (v16i8) out10);
|
||||
out0 = (v16u8)__msa_xori_b((v16u8) out0, 128);
|
||||
ST_W2(out0, 0, 1, dst, dst_stride);
|
||||
dst += 2 * dst_stride;
|
||||
src2110 = src4332;
|
||||
src4332 = src6554;
|
||||
src6554 = src8776;
|
||||
src6 = src8;
|
||||
}
|
||||
}
|
||||
|
||||
static void common_vt_8t_8w_msa(const uint8_t *src, int32_t src_stride,
|
||||
@ -1341,6 +1363,7 @@ static void hevc_hv_uni_8t_4w_msa(const uint8_t *src,
|
||||
int32_t height)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint32_t res = height & 0x07;
|
||||
v16u8 out0, out1;
|
||||
v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
|
||||
v16i8 src9, src10, src11, src12, src13, src14;
|
||||
@ -1464,6 +1487,72 @@ static void hevc_hv_uni_8t_4w_msa(const uint8_t *src,
|
||||
dst65_r = dst1413_r;
|
||||
dst66 = (v8i16) __msa_splati_d((v2i64) dst1410, 1);
|
||||
}
|
||||
if (res) {
|
||||
LD_SB8(src, src_stride, src7, src8, src9, src10, src11, src12, src13,
|
||||
src14);
|
||||
XORI_B8_128_SB(src7, src8, src9, src10, src11, src12, src13, src14);
|
||||
|
||||
VSHF_B4_SB(src7, src11, mask0, mask1, mask2, mask3,
|
||||
vec0, vec1, vec2, vec3);
|
||||
VSHF_B4_SB(src8, src12, mask0, mask1, mask2, mask3,
|
||||
vec4, vec5, vec6, vec7);
|
||||
VSHF_B4_SB(src9, src13, mask0, mask1, mask2, mask3,
|
||||
vec8, vec9, vec10, vec11);
|
||||
VSHF_B4_SB(src10, src14, mask0, mask1, mask2, mask3,
|
||||
vec12, vec13, vec14, vec15);
|
||||
|
||||
dst117 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2,
|
||||
filt3);
|
||||
dst128 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2,
|
||||
filt3);
|
||||
dst139 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1,
|
||||
filt2, filt3);
|
||||
dst1410 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1,
|
||||
filt2, filt3);
|
||||
|
||||
dst76_r = __msa_ilvr_h(dst117, dst66);
|
||||
ILVRL_H2_SH(dst128, dst117, dst87_r, dst1211_r);
|
||||
ILVRL_H2_SH(dst139, dst128, dst98_r, dst1312_r);
|
||||
ILVRL_H2_SH(dst1410, dst139, dst109_r, dst1413_r);
|
||||
dst117 = (v8i16) __msa_splati_d((v2i64) dst117, 1);
|
||||
dst1110_r = __msa_ilvr_h(dst117, dst1410);
|
||||
|
||||
dst0_r = HEVC_FILT_8TAP(dst10_r, dst32_r, dst54_r, dst76_r, filt_h0,
|
||||
filt_h1, filt_h2, filt_h3);
|
||||
dst1_r = HEVC_FILT_8TAP(dst21_r, dst43_r, dst65_r, dst87_r, filt_h0,
|
||||
filt_h1, filt_h2, filt_h3);
|
||||
dst2_r = HEVC_FILT_8TAP(dst32_r, dst54_r, dst76_r, dst98_r, filt_h0,
|
||||
filt_h1, filt_h2, filt_h3);
|
||||
dst3_r = HEVC_FILT_8TAP(dst43_r, dst65_r, dst87_r, dst109_r, filt_h0,
|
||||
filt_h1, filt_h2, filt_h3);
|
||||
dst4_r = HEVC_FILT_8TAP(dst54_r, dst76_r, dst98_r, dst1110_r, filt_h0,
|
||||
filt_h1, filt_h2, filt_h3);
|
||||
dst5_r = HEVC_FILT_8TAP(dst65_r, dst87_r, dst109_r, dst1211_r, filt_h0,
|
||||
filt_h1, filt_h2, filt_h3);
|
||||
dst6_r = HEVC_FILT_8TAP(dst76_r, dst98_r, dst1110_r, dst1312_r, filt_h0,
|
||||
filt_h1, filt_h2, filt_h3);
|
||||
dst7_r = HEVC_FILT_8TAP(dst87_r, dst109_r, dst1211_r, dst1413_r,
|
||||
filt_h0, filt_h1, filt_h2, filt_h3);
|
||||
|
||||
SRA_4V(dst0_r, dst1_r, dst2_r, dst3_r, 6);
|
||||
SRA_4V(dst4_r, dst5_r, dst6_r, dst7_r, 6);
|
||||
SRARI_W4_SW(dst0_r, dst1_r, dst2_r, dst3_r, 6);
|
||||
SRARI_W4_SW(dst4_r, dst5_r, dst6_r, dst7_r, 6);
|
||||
SAT_SW4_SW(dst0_r, dst1_r, dst2_r, dst3_r, 7);
|
||||
SAT_SW4_SW(dst4_r, dst5_r, dst6_r, dst7_r, 7);
|
||||
PCKEV_H2_SW(dst1_r, dst0_r, dst3_r, dst2_r, dst0_r, dst1_r);
|
||||
PCKEV_H2_SW(dst5_r, dst4_r, dst7_r, dst6_r, dst4_r, dst5_r);
|
||||
out0 = PCKEV_XORI128_UB(dst0_r, dst1_r);
|
||||
out1 = PCKEV_XORI128_UB(dst4_r, dst5_r);
|
||||
if (res == 2) {
|
||||
ST_W2(out0, 0, 1, dst, dst_stride);
|
||||
} else if(res == 4) {
|
||||
ST_W4(out0, 0, 1, 2, 3, dst, dst_stride);
|
||||
} else {
|
||||
ST_W4(out0, 0, 1, 2, 3, dst, dst_stride);
|
||||
ST_W2(out1, 0, 1, dst + 4 * dst_stride, dst_stride);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_hv_uni_8t_8multx2mult_msa(const uint8_t *src,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -81,12 +81,13 @@ static void hevc_copy_6w_msa(const uint8_t *src, int32_t src_stride,
|
||||
int16_t *dst, int32_t dst_stride,
|
||||
int32_t height)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint32_t loop_cnt = (height >> 3);
|
||||
uint32_t res = height & 0x07;
|
||||
v16i8 zero = { 0 };
|
||||
v16i8 src0, src1, src2, src3, src4, src5, src6, src7;
|
||||
v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
|
||||
|
||||
for (loop_cnt = (height >> 3); loop_cnt--;) {
|
||||
for (; loop_cnt--; ) {
|
||||
LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
|
||||
src += (8 * src_stride);
|
||||
|
||||
@ -99,6 +100,19 @@ static void hevc_copy_6w_msa(const uint8_t *src, int32_t src_stride,
|
||||
ST12x8_UB(in0, in1, in2, in3, in4, in5, in6, in7, dst, 2 * dst_stride);
|
||||
dst += (8 * dst_stride);
|
||||
}
|
||||
for (; res--; ) {
|
||||
uint64_t out0;
|
||||
uint32_t out1;
|
||||
src0 = LD_SB(src);
|
||||
src += src_stride;
|
||||
in0 = (v8i16)__msa_ilvr_b((v16i8) zero, (v16i8) src0);
|
||||
in0 = in0 << 6;
|
||||
out0 = __msa_copy_u_d((v2i64) in0, 0);
|
||||
out1 = __msa_copy_u_w((v4i32) in0, 2);
|
||||
SD(out0, dst);
|
||||
SW(out1, dst + 4);
|
||||
dst += dst_stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_copy_8w_msa(const uint8_t *src, int32_t src_stride,
|
||||
@ -167,6 +181,7 @@ static void hevc_copy_12w_msa(const uint8_t *src, int32_t src_stride,
|
||||
int32_t height)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint32_t res = height & 0x07;
|
||||
v16i8 zero = { 0 };
|
||||
v16i8 src0, src1, src2, src3, src4, src5, src6, src7;
|
||||
v8i16 in0, in1, in0_r, in1_r, in2_r, in3_r;
|
||||
@ -197,6 +212,19 @@ static void hevc_copy_12w_msa(const uint8_t *src, int32_t src_stride,
|
||||
ST_D4(in0, in1, 0, 1, 0, 1, dst + 8, dst_stride);
|
||||
dst += (4 * dst_stride);
|
||||
}
|
||||
for (; res--; ) {
|
||||
uint64_t out0;
|
||||
src0 = LD_SB(src);
|
||||
src += src_stride;
|
||||
in0_r = (v8i16)__msa_ilvr_b((v16i8) zero, (v16i8) src0);
|
||||
in0 = (v8i16)__msa_ilvl_b((v16i8) zero, (v16i8) src0);
|
||||
in0_r = in0_r << 6;
|
||||
in0 = in0 << 6;
|
||||
ST_UH(in0_r, dst);
|
||||
out0 = __msa_copy_u_d((v2i64) in0, 0);
|
||||
SD(out0, dst + 8);
|
||||
dst += dst_stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_copy_16w_msa(const uint8_t *src, int32_t src_stride,
|
||||
@ -450,6 +478,7 @@ static void hevc_hz_8t_4w_msa(const uint8_t *src, int32_t src_stride,
|
||||
const int8_t *filter, int32_t height)
|
||||
{
|
||||
uint32_t loop_cnt;
|
||||
uint32_t res = (height & 0x07) >> 1;
|
||||
v16i8 src0, src1, src2, src3, src4, src5, src6, src7;
|
||||
v8i16 filt0, filt1, filt2, filt3;
|
||||
v16i8 mask1, mask2, mask3;
|
||||
@ -498,6 +527,18 @@ static void hevc_hz_8t_4w_msa(const uint8_t *src, int32_t src_stride,
|
||||
ST_D8(dst0, dst1, dst2, dst3, 0, 1, 0, 1, 0, 1, 0, 1, dst, dst_stride);
|
||||
dst += (8 * dst_stride);
|
||||
}
|
||||
for (; res--; ) {
|
||||
LD_SB2(src, src_stride, src0, src1);
|
||||
src += 2 * src_stride;
|
||||
XORI_B2_128_SB(src0, src1);
|
||||
VSHF_B4_SB(src0, src1, mask0, mask1, mask2, mask3,
|
||||
vec0, vec1, vec2, vec3);
|
||||
dst0 = const_vec;
|
||||
DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, filt3,
|
||||
dst0, dst0, dst0, dst0);
|
||||
ST_D2(dst0, 0, 1, dst, dst_stride);
|
||||
dst += 2 * dst_stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_hz_8t_8w_msa(const uint8_t *src, int32_t src_stride,
|
||||
@ -992,6 +1033,7 @@ static void hevc_vt_8t_4w_msa(const uint8_t *src, int32_t src_stride,
|
||||
const int8_t *filter, int32_t height)
|
||||
{
|
||||
int32_t loop_cnt;
|
||||
int32_t res = (height & 0x07) >> 1;
|
||||
v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
|
||||
v16i8 src9, src10, src11, src12, src13, src14;
|
||||
v16i8 src10_r, src32_r, src54_r, src76_r, src98_r;
|
||||
@ -1055,6 +1097,22 @@ static void hevc_vt_8t_4w_msa(const uint8_t *src, int32_t src_stride,
|
||||
src6554 = src14131312;
|
||||
src6 = src14;
|
||||
}
|
||||
for (; res--; ) {
|
||||
LD_SB2(src, src_stride, src7, src8);
|
||||
src += 2 * src_stride;
|
||||
ILVR_B2_SB(src7, src6, src8, src7, src76_r, src87_r);
|
||||
src8776 = (v16i8)__msa_ilvr_d((v2i64) src87_r, src76_r);
|
||||
src8776 = (v16i8)__msa_xori_b((v16i8) src8776, 128);
|
||||
dst10 = const_vec;
|
||||
DPADD_SB4_SH(src2110, src4332, src6554, src8776,
|
||||
filt0, filt1, filt2, filt3, dst10, dst10, dst10, dst10);
|
||||
ST_D2(dst10, 0, 1, dst, dst_stride);
|
||||
dst += 2 * dst_stride;
|
||||
src2110 = src4332;
|
||||
src4332 = src6554;
|
||||
src6554 = src8776;
|
||||
src6 = src8;
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_vt_8t_8w_msa(const uint8_t *src, int32_t src_stride,
|
||||
@ -2661,6 +2719,7 @@ static void hevc_vt_4t_6w_msa(const uint8_t *src,
|
||||
int32_t height)
|
||||
{
|
||||
int32_t loop_cnt;
|
||||
int32_t res = height & 0x03;
|
||||
uint32_t dst_val_int0, dst_val_int1, dst_val_int2, dst_val_int3;
|
||||
uint64_t dst_val0, dst_val1, dst_val2, dst_val3;
|
||||
v16i8 src0, src1, src2, src3, src4;
|
||||
@ -2725,6 +2784,29 @@ static void hevc_vt_4t_6w_msa(const uint8_t *src,
|
||||
SW(dst_val_int3, dst + 4);
|
||||
dst += dst_stride;
|
||||
}
|
||||
if (res) {
|
||||
LD_SB2(src, src_stride, src3, src4);
|
||||
XORI_B2_128_SB(src3, src4);
|
||||
ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r);
|
||||
|
||||
dst0_r = const_vec;
|
||||
DPADD_SB2_SH(src10_r, src32_r, filt0, filt1, dst0_r, dst0_r);
|
||||
dst1_r = const_vec;
|
||||
DPADD_SB2_SH(src21_r, src43_r, filt0, filt1, dst1_r, dst1_r);
|
||||
|
||||
dst_val0 = __msa_copy_u_d((v2i64) dst0_r, 0);
|
||||
dst_val1 = __msa_copy_u_d((v2i64) dst1_r, 0);
|
||||
|
||||
dst_val_int0 = __msa_copy_u_w((v4i32) dst0_r, 2);
|
||||
dst_val_int1 = __msa_copy_u_w((v4i32) dst1_r, 2);
|
||||
|
||||
SD(dst_val0, dst);
|
||||
SW(dst_val_int0, dst + 4);
|
||||
dst += dst_stride;
|
||||
SD(dst_val1, dst);
|
||||
SW(dst_val_int1, dst + 4);
|
||||
dst += dst_stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void hevc_vt_4t_8x2_msa(const uint8_t *src,
|
||||
|
Loading…
Reference in New Issue
Block a user