@@ -1568,23 +1568,25 @@ static void hevc_sao_edge_filter_90degree_4width_msa(uint8_t *dst,
int16_t *sao_offset_val,
int32_t height) {
- int32_t h_cnt;
uint32_t dst_val0, dst_val1;
- v8i16 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0 };
+ v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
v16u8 const1 = (v16u8) __msa_ldi_b(1);
v16i8 dst0;
- v16i8 zero = { 0 };
+ v16i8 sao_offset = LD_SB(sao_offset_val);
v16u8 cmp_minus10, diff_minus10, cmp_minus11, diff_minus11;
v16u8 src_minus10, src_minus11, src10, src11;
v16i8 src_zero0, src_zero1;
- v8i16 sao_offset, src00, src01, offset_mask0, offset_mask1;
+ v16i8 offset;
+ v8i16 offset_mask0, offset_mask1;
- sao_offset = LD_SH(sao_offset_val);
+ sao_offset = __msa_pckev_b(sao_offset, sao_offset);
+ /* load in advance */
LD_UB2(src - src_stride, src_stride, src_minus10, src_minus11);
+ LD_UB2(src + src_stride, src_stride, src10, src11);
- for (h_cnt = (height >> 1); h_cnt--;) {
- LD_UB2(src + src_stride, src_stride, src10, src11);
+ for (height -= 2; height; height -= 2) {
+ src += (src_stride << 1);
src_minus10 = (v16u8) __msa_ilvr_b((v16i8) src10, (v16i8) src_minus10);
src_zero0 = __msa_ilvr_b((v16i8) src_minus11, (v16i8) src_minus11); @@ -1604,19 +1606,22 @@ static void hevc_sao_edge_filter_90degree_4width_msa(uint8_t *dst,
offset_mask0 = (v8i16) (__msa_hadd_u_h(diff_minus10, diff_minus10) + 2);