From patchwork Thu Sep 21 11:57:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manojkumar Bhosale X-Patchwork-Id: 5217 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp1855291jaa; Thu, 21 Sep 2017 04:57:33 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBRNQ63qkxYKUaEeqQY6ss2p+9q0SrWJWehcvMFUAUpGSbwBpAHbD131GT0xVPhOG5qSlVu X-Received: by 10.223.184.181 with SMTP id i50mr1627433wrf.136.1505995053848; Thu, 21 Sep 2017 04:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505995053; cv=none; d=google.com; s=arc-20160816; b=pBAyO1tRc4xSO4ESJHKTwBb63ILTvMftMAFe/TVV42QB9BJC2UMMihc4VM2beaFzmc b3bU97sUvdeBU8l9x80mnnff3X740svbVhHhs2n+Bn5mJJP5AkESYHtsxoQl4MQRgv9+ WEblqLfG7cACAkNtcRyqmQcT1W/605t0c/ekaLb6stAAKsbqp2aqt2NeX4kczwAEYzJS 6NJXZCin7UtkJXXAa3WNQcWTD08GYLQB2gCkGWeovCHDVyLMdow5DQrNxHYRzv518kDp f31y8Dx6vEiK2hE2GhGGe7tob4YQhArrrmJHZuJNTSJsh9XkJ6fJPrlC+pxw2918pqw1 Rivg== 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=aTI2jS5QJqj/+3fl107bpEKq0voRQb5xheZC1Ioj0WU=; b=PU4KT8OXXAO4TSepH3ZacHMztJM/weOriozdSEtsD6kPM6JG5zcBc//IcNJ6o2kJM0 JRBi6c8Mc1sdao/lUU+APg2mXVyObqKmTAs4jK6/wFXOfhXCzS1jQg6inmw9Kbl0ljT4 X/rzdH1IYbAeewh8J8iPv3DM84UKT7xJrGZdvQgZjKhjPPz84uEednytE1Plf99dmQZl bfrQtZAVeJfaCaWa8XToShJdsM3/1br/zgCtFoxxM2iVOcWgj8j0HzFDjUU1dQoMkQvz cv9j/s2VNg1zEXt7vUHspUpRefLJIq93awETTC9JN6NiRtYVX69eGGnxNhPd9uksayMf FeTg== 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 y82si1189654wmb.36.2017.09.21.04.57.32; Thu, 21 Sep 2017 04:57:33 -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 075F56882CA; Thu, 21 Sep 2017 14:57:20 +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 1229D680350 for ; Thu, 21 Sep 2017 14:57:13 +0300 (EEST) Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 1FF36323EDB86 for ; Thu, 21 Sep 2017 12:57:17 +0100 (IST) Received: from PUMAIL01.pu.imgtec.org (192.168.91.250) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 21 Sep 2017 12:57:20 +0100 Received: from PUMAIL01.pu.imgtec.org ([::1]) by PUMAIL01.pu.imgtec.org ([::1]) with mapi id 14.03.0266.001; Thu, 21 Sep 2017 17:27:17 +0530 From: Manojkumar Bhosale To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH] avcodec/mips: Remove generic func use in hevc non-uni copy mc msa functions Thread-Index: AQHTMqlJdAGE2VjBeUWCT9re5JzNpqK/PC0Q Date: Thu, 21 Sep 2017 11:57:16 +0000 Message-ID: <70293ACCC3BA6A4E81FFCA024C7A86E1E05922FE@PUMAIL01.pu.imgtec.org> References: <1505978128-31209-1-git-send-email-kaustubh.raste@imgtec.com> In-Reply-To: <1505978128-31209-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: Remove generic func use in hevc non-uni copy mc 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 12:45 PM To: ffmpeg-devel@ffmpeg.org Cc: Kaustubh Raste Subject: [FFmpeg-devel] [PATCH] avcodec/mips: Remove generic func use in hevc non-uni copy mc msa functions From: Kaustubh Raste Signed-off-by: Kaustubh Raste --- libavcodec/mips/hevcdsp_msa.c | 168 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 160 insertions(+), 8 deletions(-) ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel diff --git a/libavcodec/mips/hevcdsp_msa.c b/libavcodec/mips/hevcdsp_msa.c index f2bc748..1a854b2 100644 --- a/libavcodec/mips/hevcdsp_msa.c +++ b/libavcodec/mips/hevcdsp_msa.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com) + * Copyright (c) 2015 - 2017 Manojkumar Bhosale + (Manojkumar.Bhosale@imgtec.com) * * This file is part of FFmpeg. * @@ -302,8 +302,34 @@ static void hevc_copy_16w_msa(uint8_t *src, int32_t src_stride, ST_SH4(in0_r, in1_r, in2_r, in3_r, dst, dst_stride); ST_SH4(in0_l, in1_l, in2_l, in3_l, (dst + 8), dst_stride); } else if (0 == (height % 8)) { - hevc_copy_16multx8mult_msa(src, src_stride, dst, dst_stride, - height, 16); + uint32_t loop_cnt; + v16i8 src0, src1, src2, src3, src4, src5, src6, src7; + v8i16 in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l; + + for (loop_cnt = (height >> 3); loop_cnt--;) { + LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, + src7); + src += (8 * src_stride); + ILVR_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, in0_r, + in1_r, in2_r, in3_r); + ILVL_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, in0_l, + in1_l, in2_l, in3_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + ST_SH4(in0_r, in1_r, in2_r, in3_r, dst, dst_stride); + ST_SH4(in0_l, in1_l, in2_l, in3_l, (dst + 8), dst_stride); + dst += (4 * dst_stride); + + ILVR_B4_SH(zero, src4, zero, src5, zero, src6, zero, src7, in0_r, + in1_r, in2_r, in3_r); + ILVL_B4_SH(zero, src4, zero, src5, zero, src6, zero, src7, in0_l, + in1_l, in2_l, in3_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + ST_SH4(in0_r, in1_r, in2_r, in3_r, dst, dst_stride); + ST_SH4(in0_l, in1_l, in2_l, in3_l, (dst + 8), dst_stride); + dst += (4 * dst_stride); + } } } @@ -311,29 +337,155 @@ static void hevc_copy_24w_msa(uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { - hevc_copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 16); - hevc_copy_8w_msa(src + 16, src_stride, dst + 16, dst_stride, height); + uint32_t loop_cnt; + v16i8 zero = { 0 }; + v16i8 src0, src1, src2, src3, src4, src5, src6, src7; + v8i16 in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l; + + for (loop_cnt = (height >> 2); loop_cnt--;) { + LD_SB4(src, src_stride, src0, src1, src2, src3); + LD_SB4((src + 16), src_stride, src4, src5, src6, src7); + src += (4 * src_stride); + ILVR_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, in0_r, in1_r, + in2_r, in3_r); + ILVL_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, in0_l, in1_l, + in2_l, in3_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + ST_SH4(in0_r, in1_r, in2_r, in3_r, dst, dst_stride); + ST_SH4(in0_l, in1_l, in2_l, in3_l, (dst + 8), dst_stride); + ILVR_B4_SH(zero, src4, zero, src5, zero, src6, zero, src7, in0_r, in1_r, + in2_r, in3_r); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + ST_SH4(in0_r, in1_r, in2_r, in3_r, (dst + 16), dst_stride); + dst += (4 * dst_stride); + } } static void hevc_copy_32w_msa(uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { - hevc_copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 32); + uint32_t loop_cnt; + v16i8 zero = { 0 }; + v16i8 src0, src1, src2, src3, src4, src5, src6, src7; + v8i16 in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l; + + for (loop_cnt = (height >> 2); loop_cnt--;) { + LD_SB4(src, src_stride, src0, src2, src4, src6); + LD_SB4((src + 16), src_stride, src1, src3, src5, src7); + src += (4 * src_stride); + + ILVR_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, in0_r, in1_r, + in2_r, in3_r); + ILVL_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, in0_l, in1_l, + in2_l, in3_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + ST_SH4(in0_r, in0_l, in1_r, in1_l, dst, 8); + dst += dst_stride; + ST_SH4(in2_r, in2_l, in3_r, in3_l, dst, 8); + dst += dst_stride; + + ILVR_B4_SH(zero, src4, zero, src5, zero, src6, zero, src7, in0_r, in1_r, + in2_r, in3_r); + ILVL_B4_SH(zero, src4, zero, src5, zero, src6, zero, src7, in0_l, in1_l, + in2_l, in3_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + ST_SH4(in0_r, in0_l, in1_r, in1_l, dst, 8); + dst += dst_stride; + ST_SH4(in2_r, in2_l, in3_r, in3_l, dst, 8); + dst += dst_stride; + } } static void hevc_copy_48w_msa(uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { - hevc_copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 48); + uint32_t loop_cnt; + v16i8 zero = { 0 }; + v16i8 src0, src1, src2, src3, src4, src5, src6, src7; + v16i8 src8, src9, src10, src11; + v8i16 in0_r, in1_r, in2_r, in3_r, in4_r, in5_r; + v8i16 in0_l, in1_l, in2_l, in3_l, in4_l, in5_l; + + for (loop_cnt = (height >> 2); loop_cnt--;) { + LD_SB3(src, 16, src0, src1, src2); + src += src_stride; + LD_SB3(src, 16, src3, src4, src5); + src += src_stride; + LD_SB3(src, 16, src6, src7, src8); + src += src_stride; + LD_SB3(src, 16, src9, src10, src11); + src += src_stride; + + ILVR_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, + in0_r, in1_r, in2_r, in3_r); + ILVL_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, + in0_l, in1_l, in2_l, in3_l); + ILVR_B2_SH(zero, src4, zero, src5, in4_r, in5_r); + ILVL_B2_SH(zero, src4, zero, src5, in4_l, in5_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + SLLI_4V(in4_r, in5_r, in4_l, in5_l, 6); + ST_SH6(in0_r, in0_l, in1_r, in1_l, in2_r, in2_l, dst, 8); + dst += dst_stride; + ST_SH6(in3_r, in3_l, in4_r, in4_l, in5_r, in5_l, dst, 8); + dst += dst_stride; + + ILVR_B4_SH(zero, src6, zero, src7, zero, src8, zero, src9, + in0_r, in1_r, in2_r, in3_r); + ILVL_B4_SH(zero, src6, zero, src7, zero, src8, zero, src9, + in0_l, in1_l, in2_l, in3_l); + ILVR_B2_SH(zero, src10, zero, src11, in4_r, in5_r); + ILVL_B2_SH(zero, src10, zero, src11, in4_l, in5_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + SLLI_4V(in4_r, in5_r, in4_l, in5_l, 6); + ST_SH6(in0_r, in0_l, in1_r, in1_l, in2_r, in2_l, dst, 8); + dst += dst_stride; + ST_SH6(in3_r, in3_l, in4_r, in4_l, in5_r, in5_l, dst, 8); + dst += dst_stride; + } } static void hevc_copy_64w_msa(uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { - hevc_copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 64); + uint32_t loop_cnt; + v16i8 zero = { 0 }; + v16i8 src0, src1, src2, src3, src4, src5, src6, src7; + v8i16 in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l; + + for (loop_cnt = (height >> 1); loop_cnt--;) { + LD_SB4(src, 16, src0, src1, src2, src3); + src += src_stride; + LD_SB4(src, 16, src4, src5, src6, src7); + src += src_stride; + + ILVR_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, + in0_r, in1_r, in2_r, in3_r); + ILVL_B4_SH(zero, src0, zero, src1, zero, src2, zero, src3, + in0_l, in1_l, in2_l, in3_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + ST_SH4(in0_r, in0_l, in1_r, in1_l, dst, 8); + ST_SH4(in2_r, in2_l, in3_r, in3_l, (dst + 32), 8); + dst += dst_stride; + + ILVR_B4_SH(zero, src4, zero, src5, zero, src6, zero, src7, + in0_r, in1_r, in2_r, in3_r); + ILVL_B4_SH(zero, src4, zero, src5, zero, src6, zero, src7, + in0_l, in1_l, in2_l, in3_l); + SLLI_4V(in0_r, in1_r, in2_r, in3_r, 6); + SLLI_4V(in0_l, in1_l, in2_l, in3_l, 6); + ST_SH4(in0_r, in0_l, in1_r, in1_l, dst, 8); + ST_SH4(in2_r, in2_l, in3_r, in3_l, (dst + 32), 8); + dst += dst_stride; + } } static void hevc_hz_8t_4w_msa(uint8_t *src, int32_t src_stride, -- 1.7.9.5 _______________________________________________ ffmpeg-devel mailing list