From patchwork Thu Jun 15 13:34:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Darnley X-Patchwork-Id: 3984 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.22.4 with SMTP id 4csp806879vsw; Thu, 15 Jun 2017 06:48:04 -0700 (PDT) X-Received: by 10.28.12.1 with SMTP id 1mr3757145wmm.109.1497534484011; Thu, 15 Jun 2017 06:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497534483; cv=none; d=google.com; s=arc-20160816; b=osRz5HOxRy/ZWNbdsVilEOvtqkfBVDrz8ue3XmC3fPEGJGJZwwOuMMhJoMFfcuseiI Sn1YmK6KUNGJgThVEiEQ4hwr0B899HH4G4BOm3lBGmu6motwc5St+cnFk3pDyHWaZbTB 1sdSYV2CeIYWZrqDA5FZvQCI9n1TlwpDkmJgAXV981S9HlQ0cBus+/DTg4igoyfvDufO nmz5mnd7DVZKzi4McFii/BZr52LE78HdT1gifunwZdu8etJ3jZfR/Mg8V3k1BEyb6RPJ yPiHJMXQqzjSid4ke91t+oruvXzcWwsfphOXZ1O291dtOpKBMpcvY2TtOA7uTzkuHVH3 01xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=sf9qKbPkQ902NgAuGxx9Q79r77L6Zdyq5D0F/uj8Mko=; b=upwGcHR4vJ6A2AMYwhz7VbZhKx6IJa8ytL9sTr4s1UwtnjTizz7mgu625O2RGdVa08 SJ5+7gkrEVVjc1NisQ2yxS2BcnVMWaM4Gfs3XezohPVSt2BWILqYt2BVpow9Y+rd0fiz 6vU/4WxsgTRWPehchrLuU64p1KNvBpC3xrlnJPzadmSuROUlj5dnCMM+xbb4rzksZAqq Z4G4v3H9tq/kczPDgFfwXAwGcyUHf2mQCBUgCZZh2w17OY07noz0gYcOyk+qqfLDLiBo 7bZkdGVFGG2ILlA/tTJ+X/SR7iGRYw3OyOFovPp5ZXM0cv1gcUTJZ9B8ikxjQAQLXIcj O+Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ob-encoder-com.20150623.gappssmtp.com header.b=uAHNEeX7; 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 188si154006wmf.101.2017.06.15.06.48.03; Thu, 15 Jun 2017 06:48:03 -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; dkim=neutral (body hash did not verify) header.i=@ob-encoder-com.20150623.gappssmtp.com header.b=uAHNEeX7; 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 7893568A320; Thu, 15 Jun 2017 16:47:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C700268A288 for ; Thu, 15 Jun 2017 16:47:51 +0300 (EEST) Received: by mail-wr0-f194.google.com with SMTP id z45so3856910wrb.2 for ; Thu, 15 Jun 2017 06:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ob-encoder-com.20150623.gappssmtp.com; s=20150623; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=kBr0hsfhvuOeB/xMRfnIzPkRMh4JxL5/mc6IJMYoJTA=; b=uAHNEeX7EHi8djfzcNfZoX9O5VO93KEnXmAPUsiNHUITsJKdVmU7GQU8Xs7pTkyOQN BuIXcQgrf15Lk9n6120zVgSLa7/mlsjvuCO29nAph7nkNkD9+hx/165YLCkgVzW919hw w1t9vPHA61U691y22Ag1nLm33RY5U/X0PL7crK14ltmyChrWQ07bRv9UkhX79/JF/Asg yycKSYzHidaSnLB8p+tdofvBYNDI3lOR7H5Lf4emcbp37FxJRFN55ciZckTjBx0+kaDh fyWaihtb6DwJY4g59yzL03MPhIRIiuYI1+V32EO0sUQfLINVFthEji61LKT8x/MvdNmb W3Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=kBr0hsfhvuOeB/xMRfnIzPkRMh4JxL5/mc6IJMYoJTA=; b=pnoj3q9qmf1ZD2BQb4NgTC4XNB0bB+fSy+fisn+uL1UXf6IXGOVwmNPipzlAKgep9i t022Wsst8PZxtScIsvmB2gSN8qeuW/H61C4NoprxCpLI7kGY8GgRj2gbS+TlEeYeheBN HqwyhIzbqU1+zoih3YH2Em0UZZmtMkiAj3BwyT5RX4hbGB4J6Vsco8gH2UdMCfhRJm+L AwUg2bJ5mYLbUjstY5UJ/NzYfI7LqMNggQWjFG1kr+dn9izdxlpP6fFBoeOlokQIFhob mgaOEyfZpx7pq6OOn17z7YUxorMVO6uF7PjF0hWkmH6zK81JVl7mqbqJaJY5z994MczJ dOcw== X-Gm-Message-State: AKS2vOzydrPs+Xx1iziiPVsmI7am/e1f2FBGUJ0FoFEqkNPHSHkZqrm3 ZdO0JuwP98h1nzDh5S4= X-Received: by 10.223.162.151 with SMTP id s23mr3564662wra.68.1497534054078; Thu, 15 Jun 2017 06:40:54 -0700 (PDT) Received: from Ifrit.systemlords.lan (d51a44418.access.telenet.be. [81.164.68.24]) by smtp.gmail.com with ESMTPSA id c55sm211027wrc.7.2017.06.15.06.40.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 06:40:53 -0700 (PDT) From: James Darnley To: FFmpeg development discussions and patches Date: Thu, 15 Jun 2017 15:34:24 +0200 Message-Id: <20170615133426.4484-5-jdarnley@obe.tv> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170615133426.4484-1-jdarnley@obe.tv> References: <20170615133426.4484-1-jdarnley@obe.tv> Subject: [FFmpeg-devel] [PATCH 4/6] avcodec/x86: allow future 8-bit simple idct to use slightly different coefficients 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/x86/proresdsp.asm | 18 ++++++++++-------- libavcodec/x86/simple_idct10.asm | 29 +++++++++++++++++++++-------- libavcodec/x86/simple_idct10_template.asm | 19 +++++++++++++++++++ 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm index 3be0ff7757..65c9fad51c 100644 --- a/libavcodec/x86/proresdsp.asm +++ b/libavcodec/x86/proresdsp.asm @@ -33,14 +33,14 @@ cextern pw_1 cextern pw_4 cextern pw_1019 ; Below are defined in simple_idct10.asm built from selecting idctdsp -cextern w4_plus_w2 -cextern w4_min_w2 -cextern w4_plus_w6 -cextern w4_min_w6 -cextern w1_plus_w3 -cextern w3_min_w1 -cextern w7_plus_w3 -cextern w3_min_w7 +cextern w4_plus_w2_hi +cextern w4_min_w2_hi +cextern w4_plus_w6_hi +cextern w4_min_w6_hi +cextern w1_plus_w3_hi +cextern w3_min_w1_hi +cextern w7_plus_w3_hi +cextern w3_min_w7_hi cextern w1_plus_w5 cextern w5_min_w1 cextern w5_plus_w7 @@ -50,6 +50,8 @@ cextern w7_min_w5 SECTION .text +define_constants _hi + %macro idct_fn 0 cglobal prores_idct_put_10, 4, 4, 15, pixels, lsize, block, qmat IDCT_FN pw_1, 15, pw_88, 18, "put", pw_4, pw_1019, r3 diff --git a/libavcodec/x86/simple_idct10.asm b/libavcodec/x86/simple_idct10.asm index 1a5a2eae9b..b492303a57 100644 --- a/libavcodec/x86/simple_idct10.asm +++ b/libavcodec/x86/simple_idct10.asm @@ -46,28 +46,41 @@ times 4 dw %2, %3 %define W2sh2 21407 ; W2 = 85627 = 21407<<2 - 1 %define W3sh2 19265 ; W3 = 77062 = 19265<<2 + 2 %define W4sh2 16384 ; W4 = 65535 = 16384<<2 - 1 +%define W3sh2_lo 19266 +%define W4sh2_lo 16383 %define W5sh2 12873 ; W5 = 51491 = 12873<<2 - 1 %define W6sh2 8867 ; W6 = 35468 = 8867<<2 %define W7sh2 4520 ; W7 = 18081 = 4520<<2 + 1 -CONST_DEC w4_plus_w2, W4sh2, +W2sh2 -CONST_DEC w4_min_w2, W4sh2, -W2sh2 -CONST_DEC w4_plus_w6, W4sh2, +W6sh2 -CONST_DEC w4_min_w6, W4sh2, -W6sh2 -CONST_DEC w1_plus_w3, W1sh2, +W3sh2 -CONST_DEC w3_min_w1, W3sh2, -W1sh2 -CONST_DEC w7_plus_w3, W7sh2, +W3sh2 -CONST_DEC w3_min_w7, W3sh2, -W7sh2 +CONST_DEC w4_plus_w2_hi, W4sh2, +W2sh2 +CONST_DEC w4_min_w2_hi, W4sh2, -W2sh2 +CONST_DEC w4_plus_w6_hi, W4sh2, +W6sh2 +CONST_DEC w4_min_w6_hi, W4sh2, -W6sh2 +CONST_DEC w1_plus_w3_hi, W1sh2, +W3sh2 +CONST_DEC w3_min_w1_hi, W3sh2, -W1sh2 +CONST_DEC w7_plus_w3_hi, W7sh2, +W3sh2 +CONST_DEC w3_min_w7_hi, W3sh2, -W7sh2 CONST_DEC w1_plus_w5, W1sh2, +W5sh2 CONST_DEC w5_min_w1, W5sh2, -W1sh2 CONST_DEC w5_plus_w7, W5sh2, +W7sh2 CONST_DEC w7_min_w5, W7sh2, -W5sh2 +CONST_DEC w4_plus_w2_lo, W4sh2_lo, +W2sh2 +CONST_DEC w4_min_w2_lo, W4sh2_lo, -W2sh2 +CONST_DEC w4_plus_w6_lo, W4sh2_lo, +W6sh2 +CONST_DEC w4_min_w6_lo, W4sh2_lo, -W6sh2 +CONST_DEC w1_plus_w3_lo, W1sh2, +W3sh2_lo +CONST_DEC w3_min_w1_lo, W3sh2_lo, -W1sh2 +CONST_DEC w7_plus_w3_lo, W7sh2, +W3sh2_lo +CONST_DEC w3_min_w7_lo, W3sh2_lo, -W7sh2 %include "libavcodec/x86/simple_idct10_template.asm" SECTION .text %macro idct_fn 0 + +define_constants _hi + cglobal simple_idct10, 1, 1, 16, block IDCT_FN "", 12, "", 19, "store" RET diff --git a/libavcodec/x86/simple_idct10_template.asm b/libavcodec/x86/simple_idct10_template.asm index 8367011dfd..d8ea0bcc6b 100644 --- a/libavcodec/x86/simple_idct10_template.asm +++ b/libavcodec/x86/simple_idct10_template.asm @@ -26,6 +26,25 @@ %if ARCH_X86_64 +%macro define_constants 1 + %undef w4_plus_w2 + %undef w4_min_w2 + %undef w4_plus_w6 + %undef w4_min_w6 + %undef w1_plus_w3 + %undef w3_min_w1 + %undef w7_plus_w3 + %undef w3_min_w7 + %define w4_plus_w2 w4_plus_w2%1 + %define w4_min_w2 w4_min_w2%1 + %define w4_plus_w6 w4_plus_w6%1 + %define w4_min_w6 w4_min_w6%1 + %define w1_plus_w3 w1_plus_w3%1 + %define w3_min_w1 w3_min_w1%1 + %define w7_plus_w3 w7_plus_w3%1 + %define w3_min_w7 w3_min_w7%1 +%endmacro + ; interleave data while maintaining source ; %1=type, %2=dstlo, %3=dsthi, %4=src, %5=interleave %macro SBUTTERFLY3 5