From patchwork Thu Aug 18 11:01:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5oia6ZOB6ZOu?= X-Patchwork-Id: 37347 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp239027pzh; Thu, 18 Aug 2022 04:01:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR48+qdVtO5zgPpKcPMjQOi9NWnmJXd/4c2jjoNXoSLqxjBRbsC0TTkZaQd+vVShZ3WTJ7LB X-Received: by 2002:a05:6402:4382:b0:43d:6fce:3f1b with SMTP id o2-20020a056402438200b0043d6fce3f1bmr1822741edc.361.1660820481239; Thu, 18 Aug 2022 04:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660820481; cv=none; d=google.com; s=arc-20160816; b=o4R6ecKNqzEkNnDG6YhBbTwpVL1XO6Tu0pW8RIUrytLXWxS4JGj/vxo9ESimg2NQcv IZZb/2q+KQOqP8ipY534xq4CAiielD9ZTU9J33TBLCQsWKQykm5Mab71NHWFxi/PbeZg es7NDpQ9J+75k1lKAHa12k4wBn2WZM/gRQ/mdfWPAxK4WnzP1I6S/rn8wSduITyhd5Yy d66n/cmo9PoOUCupA9t/U2EWIEA6Pp7ce3vtpFH59H8O9n52/DMTV1yAhym9BK6eiQZ5 d1EYENdi4htHX6iYwpmCyCat0oGSCuWJFzdwm/Pp0CkwAqrfJCIHYjU6Z+tzSfZCSHAr zojQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=resent-date:resent-message-id: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:resent-from:content-language:accept-language :message-id:date:thread-index:thread-topic:to:from:delivered-to; bh=92ljlEgjaVp1ijPzANz5kN2AC06W5KW/PezC9384A/0=; b=JibqYxGwBxgvdxb+yKRrk3aTS/nfZuFGJXz7F8tqyo3FHCp2f6fWQJBpbYFLYYCgjj aH/kx921gm9rrgw1vHxk2F2AIDZglnbBxGtMCdo4flqp1qgXGLcDjdACnaBDHbIMzMcc u/SqMuntllUvyunj38mPHoPDRPwXvWUXKvmNdNO02MCsosEh2ld/+WC2hntr/UCFnEwm NGeLHZBiwCVhjUmC0Zy8zgrsOb6YgaG7jArtPtb67F7fPS7+Mkz9mnd6phD0QsDca4m4 EtAtUa4Iu5/5AMYe73WkBsQbnULYaXggz2KNDPOl+0sSo694hExU/LGlVUPNpHXAu3K3 6zHA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=360.cn Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hd11-20020a170907968b00b0073069573e2esi879977ejc.667.2022.08.18.04.01.20; Thu, 18 Aug 2022 04:01:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=360.cn Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EF92D68B9A3; Thu, 18 Aug 2022 14:01:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.corp.qihoo.net (bjyt-esg-p01.qihoo.net [36.110.232.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B3EF468B320 for ; Thu, 18 Aug 2022 14:01:10 +0300 (EEST) Received: from bjyt-exmbx04.corp.qihoo.net (unknown [36.110.235.125]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by Forcepoint Email with ESMTPS id E0B52B8B5E3825408C06; Thu, 18 Aug 2022 19:01:07 +0800 (CST) Received: from bjyt-exmbx03.corp.qihoo.net (36.110.235.93) by bjyt-exmbx04.corp.qihoo.net (36.110.235.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 18 Aug 2022 19:01:07 +0800 Received: from bjyt-exmbx03.corp.qihoo.net ([fe80::f11f:7339:143c:b42b]) by bjyt-exmbx03.corp.qihoo.net ([fe80::f11f:7339:143c:b42b%4]) with mapi id 15.01.2308.027; Thu, 18 Aug 2022 19:01:07 +0800 From: =?eucgb2312_cn?b?xt3M+u+j?= To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH v2] avcodec/mips: Fix MMI macro replaces in HEVC Decoder Thread-Index: AQHYsvHRsKpS/6RGdkWDoKrYfsQbKQ== Date: Thu, 18 Aug 2022 11:01:07 +0000 Message-ID: <3491d48ab91042e0a6cfeda1020b630f@360.cn> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: Resent-From: x-originating-ip: [10.254.174.183] MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] avcodec/mips: Fix MMI macro replaces in HEVC Decoder X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: "yinshiyou-hf@loongson.cn" , =?eucgb2312_cn?b?zO8=?= =?eucgb2312_cn?b?0MKzrA==?= , =?eucgb2312_cn?b?1cXWvsDa?= , "chenhao@loongson.cn" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Resent-Message-Id: <20220818110117.EF92D68B9A3@ffbox0-bg.mplayerhq.hu> Resent-Date: Thu, 18 Aug 2022 14:01:17 +0300 (EEST) X-TUID: 3FiLIeUrlGV4 The latest commit of Loongson MMI macro replaces were incorrect. It makes a mass of green tints on HEVC videos when playing. I've compared it with the older MMI implementation, and found out that several lines have been replaced by wrong macros. Signed-off-by: Qi Tiezheng --- libavcodec/mips/hevcdsp_mmi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/mips/hevcdsp_mmi.c b/libavcodec/mips/hevcdsp_mmi.c index 0ea88a7c08..1da56d3d87 100644 --- a/libavcodec/mips/hevcdsp_mmi.c +++ b/libavcodec/mips/hevcdsp_mmi.c @@ -80,7 +80,7 @@ void ff_hevc_put_hevc_qpel_h##w##_8_mmi(int16_t *dst, const uint8_t *_src, \ "paddh %[ftmp3], %[ftmp3], %[ftmp4] \n\t" \ "paddh %[ftmp5], %[ftmp5], %[ftmp6] \n\t" \ "paddh %[ftmp3], %[ftmp3], %[ftmp5] \n\t" \ - MMI_ULDC1(%[ftmp3], %[dst], 0x00) \ + MMI_USDC1(%[ftmp3], %[dst], 0x00) \ \ "daddi %[x], %[x], -0x01 \n\t" \ PTR_ADDIU "%[src], %[src], 0x04 \n\t" \ @@ -178,7 +178,7 @@ void ff_hevc_put_hevc_qpel_hv##w##_8_mmi(int16_t *dst, const uint8_t *_src,\ "paddh %[ftmp3], %[ftmp3], %[ftmp4] \n\t" \ "paddh %[ftmp5], %[ftmp5], %[ftmp6] \n\t" \ "paddh %[ftmp3], %[ftmp3], %[ftmp5] \n\t" \ - MMI_ULDC1(%[ftmp3], %[tmp], 0x00) \ + MMI_USDC1(%[ftmp3], %[tmp], 0x00) \ \ "daddi %[x], %[x], -0x01 \n\t" \ PTR_ADDIU "%[src], %[src], 0x04 \n\t" \ @@ -690,10 +690,10 @@ void ff_hevc_put_hevc_epel_bi_hv##w##_8_mmi(uint8_t *_dst, \ \ "1: \n\t" \ "2: \n\t" \ - MMI_ULDC1(%[ftmp3], %[src], 0x00) \ - MMI_ULDC1(%[ftmp4], %[src], 0x01) \ - MMI_ULDC1(%[ftmp5], %[src], 0x02) \ - MMI_ULDC1(%[ftmp6], %[src], 0x03) \ + MMI_ULWC1(%[ftmp2], %[src], 0x00) \ + MMI_ULWC1(%[ftmp3], %[src], 0x01) \ + MMI_ULWC1(%[ftmp4], %[src], 0x02) \ + MMI_ULWC1(%[ftmp5], %[src], 0x03) \ "punpcklbh %[ftmp2], %[ftmp2], %[ftmp0] \n\t" \ "pmullh %[ftmp2], %[ftmp2], %[ftmp1] \n\t" \ "punpcklbh %[ftmp3], %[ftmp3], %[ftmp0] \n\t" \ @@ -707,7 +707,7 @@ void ff_hevc_put_hevc_epel_bi_hv##w##_8_mmi(uint8_t *_dst, \ "paddh %[ftmp2], %[ftmp2], %[ftmp3] \n\t" \ "paddh %[ftmp4], %[ftmp4], %[ftmp5] \n\t" \ "paddh %[ftmp2], %[ftmp2], %[ftmp4] \n\t" \ - MMI_ULDC1(%[ftmp2], %[tmp], 0x00) \ + MMI_USDC1(%[ftmp2], %[tmp], 0x00) \ \ "daddi %[x], %[x], -0x01 \n\t" \ PTR_ADDIU "%[src], %[src], 0x04 \n\t" \ @@ -773,7 +773,7 @@ void ff_hevc_put_hevc_epel_bi_hv##w##_8_mmi(uint8_t *_dst, \ "paddw %[ftmp5], %[ftmp5], %[ftmp6] \n\t" \ "psraw %[ftmp5], %[ftmp5], %[ftmp0] \n\t" \ "packsswh %[ftmp3], %[ftmp3], %[ftmp5] \n\t" \ - MMI_ULDC1(%[ftmp4], %[tmp], 0x02) \ + MMI_ULDC1(%[ftmp4], %[src2], 0x00) \ "li %[rtmp0], 0x10 \n\t" \ "dmtc1 %[rtmp0], %[ftmp8] \n\t" \ "punpcklhw %[ftmp5], %[ftmp2], %[ftmp3] \n\t" \