From patchwork Tue Sep 26 05:26:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kaustubh.raste@imgtec.com X-Patchwork-Id: 5284 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp3423087jaa; Mon, 25 Sep 2017 22:25:26 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCZFevYnebl1AAloyKZkQP6TPN2j7VGdfw8c2mYCAW14uC1Ca1kdP/Qoym6ISPG/aTr/qcJ X-Received: by 10.223.163.83 with SMTP id d19mr7906822wrb.84.1506403526088; Mon, 25 Sep 2017 22:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506403526; cv=none; d=google.com; s=arc-20160816; b=Lj7COkDKfdeG3fRT1r6bp4wJDP3J2Wjz71Q+a8TCrFnfdWtl5yWc5aoWFaa7ZjX9Aw 0u5+O1k/4F2d+mGlZZYvB1YFivhnNxTEcAQkWazfizngE3ERhc/YuB3n31D92C9ApsfJ BXjMeSq2mFpMzSzOCMRWi8hNmRges9cdAzXn8afITkesuW2dvfjux5GJrNade8AEVBQa L03wNX4lpvpWe50/8kYkblULeGIHlktvV7YuWRaFmuK1laqtGHm6fsKd/0TYwYGJBt+k FAQb2drxj2p6BN7xLAezEjDZqJItk96bXc9JrABk2zB5A1OfpwMlSWYwqKpSFruRWMKE lgHA== 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:message-id:date:to:from :delivered-to:arc-authentication-results; bh=utP4FVBAkE0teAzlwl9vmjQnq/WfWsjCigYAwvb9QBI=; b=adt9X+/BvNCDEQH0bWF/bLqTEmZQgDxDFW4oDWs6ULxAzivOikUhsO4qntDOE2qqK1 35rs0O29EtjXU360ouW4nLdeSZFxpC+mJfJsok6s/gDaKZysZ4+2CAV6ATehtq6mhzKH M+n5zBRKcqVSJYS5m0c3Vc/yUJpIj84HYScPuAU3P5+AtWRP9uGsSlcY5EBy0xGDYgiA EEZcQPIEIfuipc6ySzEY+wBhJvWdzvG9IhTroUQqqPIaM/yzy4FPmcMeAPrneSMsG/rn 8oQEN6SafeeeDQluHCUr4zH+bE2zAyAGmmzgduB95KW+nLTJRDEWWJOs0P38+tZBQHfQ KqIA== 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 15si887029wmg.52.2017.09.25.22.25.25; Mon, 25 Sep 2017 22:25:26 -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 44FC8680B0F; Tue, 26 Sep 2017 08:25:11 +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 57885680411 for ; Tue, 26 Sep 2017 08:25:05 +0300 (EEST) Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 7B137F57EBE41 for ; Tue, 26 Sep 2017 06:25:13 +0100 (IST) Received: from pudesk204.pu.imgtec.org (192.168.91.13) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Sep 2017 06:25:14 +0100 From: To: Date: Tue, 26 Sep 2017 10:56:27 +0530 Message-ID: <1506403587-777-1-git-send-email-kaustubh.raste@imgtec.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Originating-IP: [192.168.91.13] Subject: [FFmpeg-devel] [PATCH] avcodec/mips: Improve avc chroma vert 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" From: Kaustubh Raste Replace generic with block size specific function. Signed-off-by: Kaustubh Raste --- libavcodec/mips/h264chroma_msa.c | 237 ++++++++++++++++++-------------------- 1 file changed, 112 insertions(+), 125 deletions(-) diff --git a/libavcodec/mips/h264chroma_msa.c b/libavcodec/mips/h264chroma_msa.c index c27830d..16e2fe4 100644 --- a/libavcodec/mips/h264chroma_msa.c +++ b/libavcodec/mips/h264chroma_msa.c @@ -302,8 +302,7 @@ static void avc_chroma_hz_8w_msa(uint8_t *src, uint8_t *dst, int32_t stride, } } -static void avc_chroma_vt_2x2_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, +static void avc_chroma_vt_2x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { uint16_t out0, out1; @@ -315,7 +314,7 @@ static void avc_chroma_vt_2x2_msa(uint8_t *src, int32_t src_stride, v16i8 coeff_vec1 = __msa_fill_b(coeff1); v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - LD_SB3(src, src_stride, src0, src1, src2); + LD_SB3(src, stride, src0, src1, src2); ILVR_B2_UB(src1, src0, src2, src1, tmp0, tmp1); @@ -331,12 +330,11 @@ static void avc_chroma_vt_2x2_msa(uint8_t *src, int32_t src_stride, out1 = __msa_copy_u_h(res, 2); SH(out0, dst); - dst += dst_stride; + dst += stride; SH(out1, dst); } -static void avc_chroma_vt_2x4_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, +static void avc_chroma_vt_2x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4; @@ -347,39 +345,7 @@ static void avc_chroma_vt_2x4_msa(uint8_t *src, int32_t src_stride, v16i8 coeff_vec1 = __msa_fill_b(coeff1); v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - LD_UB5(src, src_stride, src0, src1, src2, src3, src4); - ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, - tmp0, tmp1, tmp2, tmp3); - ILVR_W2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); - - tmp0 = (v16u8) __msa_ilvr_d((v2i64) tmp2, (v2i64) tmp0); - - res_r = __msa_dotp_u_h(tmp0, coeff_vec); - res_r <<= 3; - res_r = (v8u16) __msa_srari_h((v8i16) res_r, 6); - res_r = __msa_sat_u_h(res_r, 7); - - res = (v8i16) __msa_pckev_b((v16i8) res_r, (v16i8) res_r); - - ST2x4_UB(res, 0, dst, dst_stride); -} - -static void avc_chroma_vt_2x8_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, - uint32_t coeff0, uint32_t coeff1) -{ - v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8; - v16u8 tmp0, tmp1, tmp2, tmp3; - v8i16 res; - v8u16 res_r; - v16i8 coeff_vec0 = __msa_fill_b(coeff0); - v16i8 coeff_vec1 = __msa_fill_b(coeff1); - v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - - LD_UB5(src, src_stride, src0, src1, src2, src3, src4); - src += (5 * src_stride); - LD_UB4(src, src_stride, src5, src6, src7, src8); - + LD_UB5(src, stride, src0, src1, src2, src3, src4); ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, tmp0, tmp1, tmp2, tmp3); ILVR_W2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); @@ -393,42 +359,21 @@ static void avc_chroma_vt_2x8_msa(uint8_t *src, int32_t src_stride, res = (v8i16) __msa_pckev_b((v16i8) res_r, (v16i8) res_r); - ST2x4_UB(res, 0, dst, dst_stride); - dst += (4 * dst_stride); - - ILVR_B4_UB(src5, src4, src6, src5, src7, src6, src8, src7, - tmp0, tmp1, tmp2, tmp3); - ILVR_W2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); - - tmp0 = (v16u8) __msa_ilvr_d((v2i64) tmp2, (v2i64) tmp0); - - res_r = __msa_dotp_u_h(tmp0, coeff_vec); - res_r <<= 3; - res_r = (v8u16) __msa_srari_h((v8i16) res_r, 6); - res_r = __msa_sat_u_h(res_r, 7); - - res = (v8i16) __msa_pckev_b((v16i8) res_r, (v16i8) res_r); - - ST2x4_UB(res, 0, dst, dst_stride); - dst += (4 * dst_stride); + ST2x4_UB(res, 0, dst, stride); } -static void avc_chroma_vt_2w_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, +static void avc_chroma_vt_2w_msa(uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { if (2 == height) { - avc_chroma_vt_2x2_msa(src, src_stride, dst, dst_stride, coeff0, coeff1); + avc_chroma_vt_2x2_msa(src, dst, stride, coeff0, coeff1); } else if (4 == height) { - avc_chroma_vt_2x4_msa(src, src_stride, dst, dst_stride, coeff0, coeff1); - } else if (8 == height) { - avc_chroma_vt_2x8_msa(src, src_stride, dst, dst_stride, coeff0, coeff1); + avc_chroma_vt_2x4_msa(src, dst, stride, coeff0, coeff1); } } -static void avc_chroma_vt_4x2_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, +static void avc_chroma_vt_4x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2; @@ -439,7 +384,7 @@ static void avc_chroma_vt_4x2_msa(uint8_t *src, int32_t src_stride, v16i8 coeff_vec1 = __msa_fill_b(coeff1); v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - LD_UB3(src, src_stride, src0, src1, src2); + LD_UB3(src, stride, src0, src1, src2); ILVR_B2_UB(src1, src0, src2, src1, tmp0, tmp1); tmp0 = (v16u8) __msa_ilvr_d((v2i64) tmp1, (v2i64) tmp0); @@ -449,93 +394,135 @@ static void avc_chroma_vt_4x2_msa(uint8_t *src, int32_t src_stride, res_r = __msa_sat_u_h(res_r, 7); res = (v4i32) __msa_pckev_b((v16i8) res_r, (v16i8) res_r); - ST4x2_UB(res, dst, dst_stride); + ST4x2_UB(res, dst, stride); } -static void avc_chroma_vt_4x4multiple_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, - uint32_t coeff0, uint32_t coeff1, - int32_t height) +static void avc_chroma_vt_4x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, + uint32_t coeff0, uint32_t coeff1) { - uint32_t row; v16u8 src0, src1, src2, src3, src4; v16u8 tmp0, tmp1, tmp2, tmp3; + v16u8 out; v8u16 res0_r, res1_r; - v4i32 res0, res1; v16i8 coeff_vec0 = __msa_fill_b(coeff0); v16i8 coeff_vec1 = __msa_fill_b(coeff1); v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - src0 = LD_UB(src); - src += src_stride; - - for (row = (height >> 2); row--;) { - LD_UB4(src, src_stride, src1, src2, src3, src4); - src += (4 * src_stride); - - ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, - tmp0, tmp1, tmp2, tmp3); - ILVR_D2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); - DOTP_UB2_UH(tmp0, tmp2, coeff_vec, coeff_vec, res0_r, res1_r); - - res0_r <<= 3; - res1_r <<= 3; + LD_UB5(src, stride, src0, src1, src2, src3, src4); + ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, tmp0, tmp1, tmp2, + tmp3); + ILVR_D2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); + DOTP_UB2_UH(tmp0, tmp2, coeff_vec, coeff_vec, res0_r, res1_r); + res0_r <<= 3; + res1_r <<= 3; + SRARI_H2_UH(res0_r, res1_r, 6); + SAT_UH2_UH(res0_r, res1_r, 7); + out = (v16u8) __msa_pckev_b((v16i8) res1_r, (v16i8) res0_r); + ST4x4_UB(out, out, 0, 1, 2, 3, dst, stride); +} - SRARI_H2_UH(res0_r, res1_r, 6); - SAT_UH2_UH(res0_r, res1_r, 7); - PCKEV_B2_SW(res0_r, res0_r, res1_r, res1_r, res0, res1); +static void avc_chroma_vt_4x8_msa(uint8_t *src, uint8_t *dst, int32_t stride, + uint32_t coeff0, uint32_t coeff1) +{ + v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8; + v16u8 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, out0, out1; + v8u16 res0, res1, res2, res3; + v16i8 coeff_vec0 = __msa_fill_b(coeff0); + v16i8 coeff_vec1 = __msa_fill_b(coeff1); + v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride); - dst += (4 * dst_stride); - src0 = src4; - } + LD_UB5(src, stride, src0, src1, src2, src3, src4); + src += (5 * stride); + LD_UB4(src, stride, src5, src6, src7, src8); + ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, tmp0, tmp1, tmp2, + tmp3); + ILVR_B4_UB(src5, src4, src6, src5, src7, src6, src8, src7, tmp4, tmp5, tmp6, + tmp7); + ILVR_D2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); + ILVR_D2_UB(tmp5, tmp4, tmp7, tmp6, tmp4, tmp6); + DOTP_UB2_UH(tmp0, tmp2, coeff_vec, coeff_vec, res0, res1); + DOTP_UB2_UH(tmp4, tmp6, coeff_vec, coeff_vec, res2, res3); + SLLI_4V(res0, res1, res2, res3, 3); + SRARI_H4_UH(res0, res1, res2, res3, 6); + SAT_UH4_UH(res0, res1, res2, res3, 7); + PCKEV_B2_UB(res1, res0, res3, res2, out0, out1); + ST4x8_UB(out0, out1, dst, stride); } -static void avc_chroma_vt_4w_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, +static void avc_chroma_vt_4w_msa(uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { if (2 == height) { - avc_chroma_vt_4x2_msa(src, src_stride, dst, dst_stride, coeff0, coeff1); - } else { - avc_chroma_vt_4x4multiple_msa(src, src_stride, dst, dst_stride, coeff0, - coeff1, height); + avc_chroma_vt_4x2_msa(src, dst, stride, coeff0, coeff1); + } else if (4 == height) { + avc_chroma_vt_4x4_msa(src, dst, stride, coeff0, coeff1); + } else if (8 == height) { + avc_chroma_vt_4x8_msa(src, dst, stride, coeff0, coeff1); } } -static void avc_chroma_vt_8w_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, - uint32_t coeff0, uint32_t coeff1, - int32_t height) +static void avc_chroma_vt_8x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, + uint32_t coeff0, uint32_t coeff1) { - uint32_t row; v16u8 src0, src1, src2, src3, src4, out0, out1; v8u16 res0, res1, res2, res3; v16i8 coeff_vec0 = __msa_fill_b(coeff0); v16i8 coeff_vec1 = __msa_fill_b(coeff1); v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - src0 = LD_UB(src); - src += src_stride; - - for (row = height >> 2; row--;) { - LD_UB4(src, src_stride, src1, src2, src3, src4); - src += (4 * src_stride); + LD_UB5(src, stride, src0, src1, src2, src3, src4); + ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, src0, src1, src2, + src3); + DOTP_UB4_UH(src0, src1, src2, src3, coeff_vec, coeff_vec, coeff_vec, + coeff_vec, res0, res1, res2, res3); + SLLI_4V(res0, res1, res2, res3, 3); + SRARI_H4_UH(res0, res1, res2, res3, 6); + SAT_UH4_UH(res0, res1, res2, res3, 7); + PCKEV_B2_UB(res1, res0, res3, res2, out0, out1); + ST8x4_UB(out0, out1, dst, stride); +} - ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, - src0, src1, src2, src3); - DOTP_UB4_UH(src0, src1, src2, src3, coeff_vec, coeff_vec, coeff_vec, - coeff_vec, res0, res1, res2, res3); - SLLI_4V(res0, res1, res2, res3, 3); - SRARI_H4_UH(res0, res1, res2, res3, 6); - SAT_UH4_UH(res0, res1, res2, res3, 7); - PCKEV_B2_UB(res1, res0, res3, res2, out0, out1); +static void avc_chroma_vt_8x8_msa(uint8_t *src, uint8_t *dst, int32_t stride, + uint32_t coeff0, uint32_t coeff1) +{ + v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8; + v16u8 out0, out1, out2, out3; + v8u16 res0, res1, res2, res3, res4, res5, res6, res7; + v16i8 coeff_vec0 = __msa_fill_b(coeff0); + v16i8 coeff_vec1 = __msa_fill_b(coeff1); + v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - ST8x4_UB(out0, out1, dst, dst_stride); + LD_UB5(src, stride, src0, src1, src2, src3, src4); + src += (5 * stride); + LD_UB4(src, stride, src5, src6, src7, src8); + ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, src0, src1, src2, + src3); + ILVR_B4_UB(src5, src4, src6, src5, src7, src6, src8, src7, src4, src5, src6, + src7); + DOTP_UB4_UH(src0, src1, src2, src3, coeff_vec, coeff_vec, coeff_vec, + coeff_vec, res0, res1, res2, res3); + DOTP_UB4_UH(src4, src5, src6, src7, coeff_vec, coeff_vec, coeff_vec, + coeff_vec, res4, res5, res6, res7); + SLLI_4V(res0, res1, res2, res3, 3); + SLLI_4V(res4, res5, res6, res7, 3); + SRARI_H4_UH(res0, res1, res2, res3, 6); + SRARI_H4_UH(res4, res5, res6, res7, 6); + SAT_UH4_UH(res0, res1, res2, res3, 7); + SAT_UH4_UH(res0, res1, res2, res3, 7); + PCKEV_B2_UB(res1, res0, res3, res2, out0, out1); + PCKEV_B2_UB(res5, res4, res7, res6, out2, out3); + ST8x8_UB(out0, out1, out2, out3, dst, stride); +} - dst += (4 * dst_stride); - src0 = src4; +static void avc_chroma_vt_8w_msa(uint8_t *src, uint8_t *dst, int32_t stride, + uint32_t coeff0, uint32_t coeff1, + int32_t height) +{ + if (4 == height) { + avc_chroma_vt_8x4_msa(src, dst, stride, coeff0, coeff1); + } else if (8 == height) { + avc_chroma_vt_8x8_msa(src, dst, stride, coeff0, coeff1); } } @@ -1914,7 +1901,7 @@ void ff_put_h264_chroma_mc8_msa(uint8_t *dst, uint8_t *src, } else if (x) { avc_chroma_hz_8w_msa(src, dst, stride, x, (8 - x), height); } else if (y) { - avc_chroma_vt_8w_msa(src, stride, dst, stride, y, (8 - y), height); + avc_chroma_vt_8w_msa(src, dst, stride, y, (8 - y), height); } else { copy_width8_msa(src, stride, dst, stride, height); } @@ -1933,7 +1920,7 @@ void ff_put_h264_chroma_mc4_msa(uint8_t *dst, uint8_t *src, } else if (x) { avc_chroma_hz_4w_msa(src, dst, stride, x, (8 - x), height); } else if (y) { - avc_chroma_vt_4w_msa(src, stride, dst, stride, y, (8 - y), height); + avc_chroma_vt_4w_msa(src, dst, stride, y, (8 - y), height); } else { for (cnt = height; cnt--;) { *((uint32_t *) dst) = *((uint32_t *) src); @@ -1957,7 +1944,7 @@ void ff_put_h264_chroma_mc2_msa(uint8_t *dst, uint8_t *src, } else if (x) { avc_chroma_hz_2w_msa(src, dst, stride, x, (8 - x), height); } else if (y) { - avc_chroma_vt_2w_msa(src, stride, dst, stride, y, (8 - y), height); + avc_chroma_vt_2w_msa(src, dst, stride, y, (8 - y), height); } else { for (cnt = height; cnt--;) { *((uint16_t *) dst) = *((uint16_t *) src);