From patchwork Mon Jun 19 15:10:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Darnley X-Patchwork-Id: 4044 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.22.4 with SMTP id 4csp962396vsw; Mon, 19 Jun 2017 08:25:29 -0700 (PDT) X-Received: by 10.28.63.144 with SMTP id m138mr16809963wma.10.1497885929493; Mon, 19 Jun 2017 08:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497885929; cv=none; d=google.com; s=arc-20160816; b=TD/E9+rIX/30rvLV0iyr8rGH2PaXsigJuam4bOl4fM08R2BUaagPnU9iiyAMN2ndRk +tv0+8HHdLWNd1wb4JfT0Bi1Bttaf+hjkQKmx+W6tjN0lIGHPz8iNSX4qWHACVZHUBer 8S518/fDRaoG55FZODkte4i0BGVg4zKqC2hW0/2VBI0o0NjQAZ//xjORn/1CdHNihX10 4zojohj4URMkOu54BtnRW4oECyR3vx73zul0plaLLVFMqULFAfBlT8tu2nE7P77q5aWW LTbkyvhtGqrs5gtwwINt7Ou7UEMbnXsKjQxyAHj3ByejY1MPRB+z9Y7OuWyuSe7gaYTw Nxbg== 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:cc: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=OSffQIpHJoFRmF7e03U2av/N2QktgOi9sW9jTTNFFIg=; b=ePLy3P+f+MeUPr7v8a7ublSY0FFQUa1TpMYO6/zK+TKmfTerYrvq9IPXjdu8pYtsVG PnRrWLRUJcc226StZnNFY/im+NnGFRc5TNqSuOvck77zm7vApGyPBxtE1W/OCmZKkgvC fJlgZKuqTSmMLmH0OHKK77WJ6iS024Cg6o0NF9202jEEXHHCXVBSxTPkfULN/M7clkKv kKzDfp8VRWCfvL4cSkTL+xTiaTp4qF1vn+Q0ej8OaEecN4SGKquJ0J++Xr5uD6Fz/GEw yDvKW4NZZp5so2tRuSPSvxDINhjJVu7yIcVOKAZSUsC5B7GR+B03FUPOthM7mz05kG29 tO9g== 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=TyGs1ISC; 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 m142si3778543wmb.57.2017.06.19.08.25.28; Mon, 19 Jun 2017 08:25:29 -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=TyGs1ISC; 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 6509368A51B; Mon, 19 Jun 2017 18:25:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6A9C668A4CB for ; Mon, 19 Jun 2017 18:25:16 +0300 (EEST) Received: by mail-wr0-f195.google.com with SMTP id y25so11909801wrd.1 for ; Mon, 19 Jun 2017 08:25:21 -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:cc:subject:date:message-id:in-reply-to:references; bh=4fapCXdd0BneDXhiljRZjEiobhgg/8DWBZDn9E0IgGY=; b=TyGs1ISCjHac/ZNbjfIXit8tABHzGpMnHY4lY02/z48Fa41t/kkHFSfRbeBZ4rlHH0 89UCqdVmFOoFojzLRFOWRXlXvhHLlAZ0ECpEEZsytkD3a/uvZgMgLxfnTqAqGyDSv2iR J1euZjrDvJuXX3C6ANsIgacX0czf/0xpoOtFJi5dnF8m23s8W9gjXVawme3KWilMMkqo QpDugq5h+IIQTtdwWAHQznnFTvKFVMdpjg71ZPRCSUAXt+IE9suFAUTkejJ0LLJ0pNsv 7FBQOOUlW80A1hQaN6Z2Qhtip9x1lUQEi2kAKibmUzOglCjklOvnY4ZDRTTId8GFIRYl V45Q== 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:cc:subject:date:message-id :in-reply-to:references; bh=4fapCXdd0BneDXhiljRZjEiobhgg/8DWBZDn9E0IgGY=; b=orLqwnbFcPXICI9qlM8PTgJfffvIChOs/yBJm6GNIRBzpCuryB9DoVIsqG9IzAB7dP zT4WmlD5Urrokg0mkY8CgfNh2IZ7nfY96rZuvzwp/l+WYaJazUpS5zzmVJzO+Scyja+F GqRKOpJQqenKjsw0Sie0i8fiZrAlH4ABSdhgQcaWUl79ChkpLBLXyMv3IeguxA5x4zsh exIKXGQy51eNsHVB7D3WTW3UjSIACBph8rM/YTAcQrKB+5D9kcOuD8wcMYaos4nuN4O0 I/S/r3AKic1ycD1+LREp4UGvaB7JDKhl8AzgqNhG4xBkqHbCWgC52YtiHdhF578XK1tZ qlzg== X-Gm-Message-State: AKS2vOwrIWqgO2SDUxb5oMRQjRVImiE8uAyxQqcNkKmRxjMRKU/BUsTM ycARSvHnLzEfvtfwuFY= X-Received: by 10.223.176.218 with SMTP id j26mr16808032wra.192.1497885460747; Mon, 19 Jun 2017 08:17:40 -0700 (PDT) Received: from Ifrit.systemlords.lan (d51a44418.access.telenet.be. [81.164.68.24]) by smtp.gmail.com with ESMTPSA id 6sm8059540wrg.61.2017.06.19.08.17.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 08:17:40 -0700 (PDT) From: James Darnley To: FFmpeg development discussions and patches Date: Mon, 19 Jun 2017 17:10:57 +0200 Message-Id: <20170619151104.31273-5-jdarnley@obe.tv> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170619151104.31273-1-jdarnley@obe.tv> References: <20170619151104.31273-1-jdarnley@obe.tv> Subject: [FFmpeg-devel] [PATCH 04/11] avcodec/mdec: allow/use permuted IDCTs 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: "Ronald S. Bultje" MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: "Ronald S. Bultje" --- libavcodec/mdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 97bfebbeb7..1e1c8f4c55 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -94,7 +94,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) return AVERROR_INVALIDDATA; } j = scantable[i]; - level = (level * qscale * quant_matrix[j]) >> 3; + level = (level * qscale * quant_matrix[ff_zigzag_direct[i]]) >> 3; level = (level ^ SHOW_SBITS(re, &a->gb, 1)) - SHOW_SBITS(re, &a->gb, 1); LAST_SKIP_BITS(re, &a->gb, 1); } else { @@ -111,11 +111,11 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) j = scantable[i]; if (level < 0) { level = -level; - level = (level * (unsigned)qscale * quant_matrix[j]) >> 3; + level = (level * (unsigned)qscale * quant_matrix[ff_zigzag_direct[i]]) >> 3; level = (level - 1) | 1; level = -level; } else { - level = (level * (unsigned)qscale * quant_matrix[j]) >> 3; + level = (level * (unsigned)qscale * quant_matrix[ff_zigzag_direct[i]]) >> 3; level = (level - 1) | 1; } }