From patchwork Fri Sep 22 11:37:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manojkumar Bhosale X-Patchwork-Id: 5237 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp3082135jaa; Fri, 22 Sep 2017 04:38:06 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDa71Al/uFnJa+A1jzNnnCHviihjHu2Yq7CcIP/JVBSc5wsiG1H3GGHhogPy+4urBC5XdGZ X-Received: by 10.28.184.141 with SMTP id i135mr3854351wmf.143.1506080286698; Fri, 22 Sep 2017 04:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506080286; cv=none; d=google.com; s=arc-20160816; b=NvgzwlIhgYXUqCGKBdS49GZsIDv9xk39iOuoy3g0Hx7jJT7YdxEKEiawynILmafTEA xQAUqNkLP3VoLoXa+zyi7ckLjrkCif73H7EziSVXCRME/MAcWppA4oiW7R46rpBI9OZ/ rYViL9igMzyoF39DHshtK1gL5UTks12Xh7iSEKt+fMTvfigGBt1SmLgcgEgBWh85EMti lvoseA/dIRfyaYcTJ/9h6U3KxGACI4XnThpC8qYu1GVi2ZSuwsglPTFHUlW/8BsF6v+r 3eCLurDFOabL9yfFrsePKM0x6qC9S3mZvEt5iv0ZLoUvmsXIoH7+8ktgFZXD/g+VqCGt AwIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:to:from:delivered-to:arc-authentication-results; bh=JUiCM0NA6zO/ML6DySD5KnNINZlp2Mrs/I1nircgd8E=; b=RF3v6YKFpemKeb3rODC+uIGjyjeoOe7oUnB74dl+9sroRy0/92nQfU92wIqnXXVVto zVVeF9odNE/g3KYP62GBVXJgLPg7N/wxcV0oRgOYg6PI4ZGPbjnFhtm+H6/FOofi+sTP fZqJFJVjWscw0Hk7gJ2Rg55T7YsLXqaTRFTBdtv7Ye5P4iikleAPHWbvlO6dIUJ408Aa 6kYdbbqww2xYPvlFKTDksu/++ae3OKTPvldyXGmju7m3e4+AiWyzavHJzOZ4u44Bo/nF l69d8f7Kv9ATX6au7GGAq7vbboQxcV+DLhjtTPWrxtXkSHmLpTnA4fmn8bwmAWwQGSM8 Boaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y27si3061684wmh.158.2017.09.22.04.38.06; Fri, 22 Sep 2017 04:38:06 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4EDC86882A3; Fri, 22 Sep 2017 14:37:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BDB1E680656 for ; Fri, 22 Sep 2017 14:37:48 +0300 (EEST) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 7DD1933CD37A0 for ; Fri, 22 Sep 2017 12:37:54 +0100 (IST) Received: from PUMAIL01.pu.imgtec.org (192.168.91.250) by HHMAIL01.hh.imgtec.org (10.100.10.19) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 22 Sep 2017 12:37:57 +0100 Received: from PUMAIL01.pu.imgtec.org ([::1]) by PUMAIL01.pu.imgtec.org ([::1]) with mapi id 14.03.0266.001; Fri, 22 Sep 2017 17:07:54 +0530 From: Manojkumar Bhosale To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH] avcodec/mips: Unrolled loops avc intra msa functions Thread-Index: AQHTMt33j9LC15Sg5E6v5vgbgqUhm6LAyLLg Date: Fri, 22 Sep 2017 11:37:54 +0000 Message-ID: <70293ACCC3BA6A4E81FFCA024C7A86E1E0592470@PUMAIL01.pu.imgtec.org> References: <1506000750-18418-1-git-send-email-kaustubh.raste@imgtec.com> In-Reply-To: <1506000750-18418-1-git-send-email-kaustubh.raste@imgtec.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.91.86] MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avcodec/mips: Unrolled loops avc intra msa functions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Kaustubh Raste Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" LGTM -----Original Message----- From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of kaustubh.raste@imgtec.com Sent: Thursday, September 21, 2017 7:03 PM To: ffmpeg-devel@ffmpeg.org Cc: Kaustubh Raste Subject: [FFmpeg-devel] [PATCH] avcodec/mips: Unrolled loops avc intra msa functions From: Kaustubh Raste Signed-off-by: Kaustubh Raste --- libavcodec/mips/h264pred_msa.c | 318 ++++++++++++++++++++-------------------- 1 file changed, 158 insertions(+), 160 deletions(-) - v16u8 src0, src1, src2, src3; - - for (row = 4; row--;) { - inp0 = src[0]; - src += src_stride; - inp1 = src[0]; - src += src_stride; - inp2 = src[0]; - src += src_stride; - inp3 = src[0]; - src += src_stride; - - src0 = (v16u8) __msa_fill_b(inp0); - src1 = (v16u8) __msa_fill_b(inp1); - src2 = (v16u8) __msa_fill_b(inp2); - src3 = (v16u8) __msa_fill_b(inp3); - - ST_UB4(src0, src1, src2, src3, dst, dst_stride); - dst += (4 * dst_stride); - } + v16u8 src0, src1, src2, src3, src4, src5, src6, src7; + v16u8 src8, src9, src10, src11, src12, src13, src14, src15; + + inp0 = src[0 * src_stride]; + inp1 = src[1 * src_stride]; + inp2 = src[2 * src_stride]; + inp3 = src[3 * src_stride]; + src0 = (v16u8) __msa_fill_b(inp0); + src1 = (v16u8) __msa_fill_b(inp1); + src2 = (v16u8) __msa_fill_b(inp2); + src3 = (v16u8) __msa_fill_b(inp3); + inp0 = src[4 * src_stride]; + inp1 = src[5 * src_stride]; + inp2 = src[6 * src_stride]; + inp3 = src[7 * src_stride]; + src4 = (v16u8) __msa_fill_b(inp0); + src5 = (v16u8) __msa_fill_b(inp1); + src6 = (v16u8) __msa_fill_b(inp2); + src7 = (v16u8) __msa_fill_b(inp3); + inp0 = src[ 8 * src_stride]; + inp1 = src[ 9 * src_stride]; + inp2 = src[10 * src_stride]; + inp3 = src[11 * src_stride]; + src8 = (v16u8) __msa_fill_b(inp0); + src9 = (v16u8) __msa_fill_b(inp1); + src10 = (v16u8) __msa_fill_b(inp2); + src11 = (v16u8) __msa_fill_b(inp3); + inp0 = src[12 * src_stride]; + inp1 = src[13 * src_stride]; + inp2 = src[14 * src_stride]; + inp3 = src[15 * src_stride]; + src12 = (v16u8) __msa_fill_b(inp0); + src13 = (v16u8) __msa_fill_b(inp1); + src14 = (v16u8) __msa_fill_b(inp2); + src15 = (v16u8) __msa_fill_b(inp3); + + ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7, dst, dst_stride); + dst += (8 * dst_stride); + ST_UB8(src8, src9, src10, src11, src12, src13, src14, src15, + dst, dst_stride); } static void intra_predict_dc_8x8_msa(uint8_t *src_top, uint8_t *src_left, @@ -206,39 +215,29 @@ static void intra_predict_dc_16x16_msa(uint8_t *src_top, uint8_t *src_left, } } -#define INTRA_PREDICT_VALDC_8X8_MSA(val) \ -static void intra_predict_##val##dc_8x8_msa(uint8_t *dst, \ - int32_t dst_stride) \ -{ \ - uint32_t row, out; \ - v16i8 store; \ - \ - store = __msa_ldi_b(val); \ - out = __msa_copy_u_w((v4i32) store, 0); \ - \ - for (row = 8; row--;) { \ - SW(out, dst); \ - SW(out, (dst + 4)); \ - dst += dst_stride; \ - } \ +#define INTRA_PREDICT_VALDC_8X8_MSA(val) \ +static void intra_predict_##val##dc_8x8_msa(uint8_t *dst, int32_t dst_stride) \ +{ \ + v16i8 store = __msa_fill_b(val); \ + uint64_t out = __msa_copy_u_d((v2i64) store, 0); \ + \ + SD4(out, out, out, out, dst, dst_stride); \ + dst += (4 * dst_stride); \ + SD4(out, out, out, out, dst, dst_stride); \ } INTRA_PREDICT_VALDC_8X8_MSA(127); INTRA_PREDICT_VALDC_8X8_MSA(129); -#define INTRA_PREDICT_VALDC_16X16_MSA(val) \ -static void intra_predict_##val##dc_16x16_msa(uint8_t *dst, \ - int32_t dst_stride) \ -{ \ - uint32_t row; \ - v16u8 store; \ - \ - store = (v16u8) __msa_ldi_b(val); \ - \ - for (row = 16; row--;) { \ - ST_UB(store, dst); \ - dst += dst_stride; \ - } \ +#define INTRA_PREDICT_VALDC_16X16_MSA(val) \ +static void intra_predict_##val##dc_16x16_msa(uint8_t *dst, \ + int32_t dst_stride) \ +{ \ + v16u8 out = (v16u8) __msa_fill_b(val); \ + \ + ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); \ + dst += (8 * dst_stride); \ + ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); \ } INTRA_PREDICT_VALDC_16X16_MSA(127); @@ -321,8 +320,10 @@ static void intra_predict_plane_16x16_msa(uint8_t *src, int32_t stride) v8i16 short_multiplier = { 1, 2, 3, 4, 5, 6, 7, 8 }; v4i32 int_multiplier = { 0, 1, 2, 3 }; v16u8 src_top = { 0 }; - v8i16 vec9, vec10; + v16u8 store0, store1; + v8i16 vec9, vec10, vec11, vec12; v4i32 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, res_add; + v4i32 reg0, reg1, reg2, reg3; load0 = LD(src - (stride + 1)); load1 = LD(src - (stride + 1) + 9); @@ -362,18 +363,28 @@ static void intra_predict_plane_16x16_msa(uint8_t *src, int32_t stride) vec6 = vec8 * 4; vec7 = vec8 * int_multiplier; - for (lpcnt = 16; lpcnt--;) { + for (lpcnt = 8; lpcnt--;) { vec0 = vec7; + reg0 = vec7; vec0 += vec4; + vec4 += vec5; + reg0 += vec4; vec1 = vec0 + vec6; + reg1 = reg0 + vec6; vec2 = vec1 + vec6; + reg2 = reg1 + vec6; vec3 = vec2 + vec6; + reg3 = reg2 + vec6; SRA_4V(vec0, vec1, vec2, vec3, 5); + SRA_4V(reg0, reg1, reg2, reg3, 5); PCKEV_H2_SH(vec1, vec0, vec3, vec2, vec9, vec10); + PCKEV_H2_SH(reg1, reg0, reg3, reg2, vec11, vec12); CLIP_SH2_0_255(vec9, vec10); - PCKEV_ST_SB(vec9, vec10, src); - src += stride; + CLIP_SH2_0_255(vec11, vec12); + PCKEV_B2_UB(vec10, vec9, vec12, vec11, store0, store1); + ST_UB2(store0, store1, src, stride); + src += 2 * stride; vec4 += vec5; } @@ -381,9 +392,9 @@ static void intra_predict_plane_16x16_msa(uint8_t *src, int32_t stride) static void intra_predict_dc_4blk_8x8_msa(uint8_t *src, int32_t stride) { - uint8_t lp_cnt; - uint32_t src0, src1, src3, src2 = 0; + uint32_t src0, src1, src3, src2; uint32_t out0, out1, out2, out3; + uint64_t store0, store1; v16u8 src_top; v8u16 add; v4u32 sum; @@ -393,12 +404,14 @@ static void intra_predict_dc_4blk_8x8_msa(uint8_t *src, int32_t stride) sum = __msa_hadd_u_w(add, add); src0 = __msa_copy_u_w((v4i32) sum, 0); src1 = __msa_copy_u_w((v4i32) sum, 1); - - for (lp_cnt = 0; lp_cnt < 4; lp_cnt++) { - src0 += src[lp_cnt * stride - 1]; - src2 += src[(4 + lp_cnt) * stride - 1]; - } - + src0 += src[0 * stride - 1]; + src0 += src[1 * stride - 1]; + src0 += src[2 * stride - 1]; + src0 += src[3 * stride - 1]; + src2 = src[4 * stride - 1]; + src2 += src[5 * stride - 1]; + src2 += src[6 * stride - 1]; + src2 += src[7 * stride - 1]; src0 = (src0 + 4) >> 3; src3 = (src1 + src2 + 4) >> 3; src1 = (src1 + 2) >> 2; @@ -407,69 +420,62 @@ static void intra_predict_dc_4blk_8x8_msa(uint8_t *src, int32_t stride) out1 = src1 * 0x01010101; out2 = src2 * 0x01010101; out3 = src3 * 0x01010101; + store0 = ((uint64_t) out1 << 32) | out0; + store1 = ((uint64_t) out3 << 32) | out2; - for (lp_cnt = 4; lp_cnt--;) { - SW(out0, src); - SW(out1, (src + 4)); - SW(out2, (src + 4 * stride)); - SW(out3, (src + 4 * stride + 4)); - src += stride; - } + SD4(store0, store0, store0, store0, src, stride); + src += (4 * stride); + SD4(store1, store1, store1, store1, src, stride); } static void intra_predict_hor_dc_8x8_msa(uint8_t *src, int32_t stride) { - uint8_t lp_cnt; - uint32_t src0 = 0, src1 = 0; + uint32_t src0, src1; uint64_t out0, out1; - for (lp_cnt = 0; lp_cnt < 4; lp_cnt++) { - src0 += src[lp_cnt * stride - 1]; - src1 += src[(4 + lp_cnt) * stride - 1]; - } - + src0 = src[0 * stride - 1]; + src0 += src[1 * stride - 1]; + src0 += src[2 * stride - 1]; + src0 += src[3 * stride - 1]; + src1 = src[4 * stride - 1]; + src1 += src[5 * stride - 1]; + src1 += src[6 * stride - 1]; + src1 += src[7 * stride - 1]; src0 = (src0 + 2) >> 2; src1 = (src1 + 2) >> 2; out0 = src0 * 0x0101010101010101; out1 = src1 * 0x0101010101010101; - for (lp_cnt = 4; lp_cnt--;) { - SD(out0, src); - SD(out1, (src + 4 * stride)); - src += stride; - } + SD4(out0, out0, out0, out0, src, stride); + src += (4 * stride); + SD4(out1, out1, out1, out1, src, stride); } static void intra_predict_vert_dc_8x8_msa(uint8_t *src, int32_t stride) { - uint8_t lp_cnt; - uint32_t out0 = 0, out1 = 0; - v16u8 src_top; + uint64_t out0; + v16i8 mask = { 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0 }; + v16u8 src_top, res0; v8u16 add; v4u32 sum; - v4i32 res0, res1; src_top = LD_UB(src - stride); add = __msa_hadd_u_h(src_top, src_top); sum = __msa_hadd_u_w(add, add); sum = (v4u32) __msa_srari_w((v4i32) sum, 2); - res0 = (v4i32) __msa_splati_b((v16i8) sum, 0); - res1 = (v4i32) __msa_splati_b((v16i8) sum, 4); - out0 = __msa_copy_u_w(res0, 0); - out1 = __msa_copy_u_w(res1, 0); - - for (lp_cnt = 8; lp_cnt--;) { - SW(out0, src); - SW(out1, src + 4); - src += stride; - } + res0 = (v16u8) __msa_vshf_b(mask, (v16i8) sum, (v16i8) sum); + out0 = __msa_copy_u_d((v2i64) res0, 0); + + SD4(out0, out0, out0, out0, src, stride); + src += (4 * stride); + SD4(out0, out0, out0, out0, src, stride); } static void intra_predict_mad_cow_dc_l0t_8x8_msa(uint8_t *src, int32_t stride) { - uint8_t lp_cnt; - uint32_t src0, src1, src2 = 0; + uint32_t src0, src1, src2; uint32_t out0, out1, out2; + uint64_t store0, store1; v16u8 src_top; v8u16 add; v4u32 sum; @@ -480,30 +486,30 @@ static void intra_predict_mad_cow_dc_l0t_8x8_msa(uint8_t *src, int32_t stride) src0 = __msa_copy_u_w((v4i32) sum, 0); src1 = __msa_copy_u_w((v4i32) sum, 1); - for (lp_cnt = 0; lp_cnt < 4; lp_cnt++) { - src2 += src[lp_cnt * stride - 1]; - } + src2 = src[0 * stride - 1]; + src2 += src[1 * stride - 1]; + src2 += src[2 * stride - 1]; + src2 += src[3 * stride - 1]; src2 = (src0 + src2 + 4) >> 3; src0 = (src0 + 2) >> 2; src1 = (src1 + 2) >> 2; out0 = src0 * 0x01010101; out1 = src1 * 0x01010101; out2 = src2 * 0x01010101; + store1 = ((uint64_t) out1 << 32); + store0 = store1 | ((uint64_t) out2); + store1 = store1 | ((uint64_t) out0); - for (lp_cnt = 4; lp_cnt--;) { - SW(out2, src); - SW(out1, src + 4); - SW(out0, src + stride * 4); - SW(out1, src + stride * 4 + 4); - src += stride; - } + SD4(store0, store0, store0, store0, src, stride); + src += (4 * stride); + SD4(store1, store1, store1, store1, src, stride); } static void intra_predict_mad_cow_dc_0lt_8x8_msa(uint8_t *src, int32_t stride) { - uint8_t lp_cnt; - uint32_t src0, src1, src2 = 0, src3; + uint32_t src0, src1, src2, src3; uint32_t out0, out1, out2, out3; + uint64_t store0, store1; v16u8 src_top; v8u16 add; v4u32 sum; @@ -514,10 +520,10 @@ static void intra_predict_mad_cow_dc_0lt_8x8_msa(uint8_t *src, int32_t stride) src0 = __msa_copy_u_w((v4i32) sum, 0); src1 = __msa_copy_u_w((v4i32) sum, 1); - for (lp_cnt = 0; lp_cnt < 4; lp_cnt++) { - src2 += src[(4 + lp_cnt) * stride - 1]; - } - + src2 = src[4 * stride - 1]; + src2 += src[5 * stride - 1]; + src2 += src[6 * stride - 1]; + src2 += src[7 * stride - 1]; src0 = (src0 + 2) >> 2; src3 = (src1 + src2 + 4) >> 3; src1 = (src1 + 2) >> 2; @@ -527,57 +533,49 @@ static void intra_predict_mad_cow_dc_0lt_8x8_msa(uint8_t *src, int32_t stride) out1 = src1 * 0x01010101; out2 = src2 * 0x01010101; out3 = src3 * 0x01010101; + store0 = ((uint64_t) out1 << 32) | out0; + store1 = ((uint64_t) out3 << 32) | out2; - for (lp_cnt = 4; lp_cnt--;) { - SW(out0, src); - SW(out1, src + 4); - SW(out2, src + stride * 4); - SW(out3, src + stride * 4 + 4); - src += stride; - } + SD4(store0, store0, store0, store0, src, stride); + src += (4 * stride); + SD4(store1, store1, store1, store1, src, stride); } static void intra_predict_mad_cow_dc_l00_8x8_msa(uint8_t *src, int32_t stride) { - uint8_t lp_cnt; - uint32_t src0 = 0; + uint32_t src0; uint64_t out0, out1; - for (lp_cnt = 0; lp_cnt < 4; lp_cnt++) { - src0 += src[lp_cnt * stride - 1]; - } - + src0 = src[0 * stride - 1]; + src0 += src[1 * stride - 1]; + src0 += src[2 * stride - 1]; + src0 += src[3 * stride - 1]; src0 = (src0 + 2) >> 2; out0 = src0 * 0x0101010101010101; out1 = 0x8080808080808080; - for (lp_cnt = 4; lp_cnt--;) { - SD(out0, src); - SD(out1, src + stride * 4); - src += stride; - } + SD4(out0, out0, out0, out0, src, stride); + src += (4 * stride); + SD4(out1, out1, out1, out1, src, stride); } static void intra_predict_mad_cow_dc_0l0_8x8_msa(uint8_t *src, int32_t stride) { - uint8_t lp_cnt; - uint32_t src0 = 0; + uint32_t src0; uint64_t out0, out1; - for (lp_cnt = 0; lp_cnt < 4; lp_cnt++) { - src0 += src[(4 + lp_cnt) * stride - 1]; - } - + src0 = src[4 * stride - 1]; + src0 += src[5 * stride - 1]; + src0 += src[6 * stride - 1]; + src0 += src[7 * stride - 1]; src0 = (src0 + 2) >> 2; out0 = 0x8080808080808080; out1 = src0 * 0x0101010101010101; - for (lp_cnt = 4; lp_cnt--;) { - SD(out0, src); - SD(out1, src + stride * 4); - src += stride; - } + SD4(out0, out0, out0, out0, src, stride); + src += (4 * stride); + SD4(out1, out1, out1, out1, src, stride); } void ff_h264_intra_predict_plane_8x8_msa(uint8_t *src, ptrdiff_t stride) -- 1.7.9.5 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel diff --git a/libavcodec/mips/h264pred_msa.c b/libavcodec/mips/h264pred_msa.c index cddcd2e..6c7e756 100644 --- a/libavcodec/mips/h264pred_msa.c +++ b/libavcodec/mips/h264pred_msa.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com) + * Copyright (c) 2015 - 2017 Shivraj Patil (Shivraj.Patil@imgtec.com) * * This file is part of FFmpeg. * @@ -24,31 +24,21 @@ static void intra_predict_vert_8x8_msa(uint8_t *src, uint8_t *dst, int32_t dst_stride) { - uint32_t row; - uint32_t src_data1, src_data2; - - src_data1 = LW(src); - src_data2 = LW(src + 4); + uint64_t out = LD(src); - for (row = 8; row--;) { - SW(src_data1, dst); - SW(src_data2, (dst + 4)); - dst += dst_stride; - } + SD4(out, out, out, out, dst, dst_stride); + dst += (4 * dst_stride); + SD4(out, out, out, out, dst, dst_stride); } static void intra_predict_vert_16x16_msa(uint8_t *src, uint8_t *dst, int32_t dst_stride) { - uint32_t row; - v16u8 src0; - - src0 = LD_UB(src); + v16u8 out = LD_UB(src); - for (row = 16; row--;) { - ST_UB(src0, dst); - dst += dst_stride; - } + ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); + dst += (8 * dst_stride); + ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); } static void intra_predict_horiz_8x8_msa(uint8_t *src, int32_t src_stride, @@ -73,28 +63,47 @@ static void intra_predict_horiz_8x8_msa(uint8_t *src, int32_t src_stride, static void intra_predict_horiz_16x16_msa(uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride) { - uint32_t row; uint8_t inp0, inp1, inp2, inp3;