From patchwork Sun Apr 12 02:31:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ross X-Patchwork-Id: 18886 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E8A9744B6AD for ; Sun, 12 Apr 2020 05:31:52 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA22C68B544; Sun, 12 Apr 2020 05:31:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx.sdf.org (mx.sdf.org [205.166.94.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E99D768B53A for ; Sun, 12 Apr 2020 05:31:45 +0300 (EEST) Received: from 0778c5dd73bd0558c189edf4906cd250 ([1.136.244.58]) (authenticated (128 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id 03C2VTXB004458 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Sun, 12 Apr 2020 02:31:35 GMT Date: Sun, 12 Apr 2020 12:31:23 +1000 From: Peter Ross To: ffmpeg-devel@ffmpeg.org Message-ID: <93f19639ad194dec916a1c488a569f6d38cc719b.1586658617.git.pross@xvid.org> MIME-Version: 1.0 User-Agent: Mutt/1.10.1 (2018-07-13) Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/mv30: remove unused table elements 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/mv30.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c index ffa04ac493..6e25ed647b 100644 --- a/libavcodec/mv30.c +++ b/libavcodec/mv30.c @@ -86,14 +86,6 @@ static const uint8_t luma_tab[] = { 25, 31, 42, 48, 58, 72, 81, 75, 38, 46, 54, 61, 71, 84, 88, 85, 50, 61, 65, 68, 79, 78, 86, 91, - 12, 12, 16, 18, 20, 30, 40, 45, - 12, 12, 16, 18, 30, 40, 45, 50, - 16, 16, 20, 30, 40, 45, 50, 55, - 18, 18, 35, 40, 45, 50, 55, 60, - 20, 30, 40, 45, 50, 55, 60, 65, - 30, 40, 45, 50, 55, 60, 65, 70, - 40, 45, 50, 55, 60, 65, 70, 75, - 45, 50, 55, 60, 65, 70, 75, 80, }; static const uint8_t chroma_tab[] = { @@ -105,14 +97,6 @@ static const uint8_t chroma_tab[] = { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 12, 16, 20, 24, 28, 36, 40, 44, - 16, 20, 24, 28, 36, 40, 44, 50, - 20, 24, 28, 36, 40, 44, 50, 60, - 24, 28, 36, 40, 44, 50, 60, 80, - 28, 36, 40, 44, 50, 60, 80, 99, - 36, 40, 44, 50, 60, 80, 99, 99, - 40, 44, 50, 60, 80, 99, 99, 99, - 44, 50, 60, 80, 99, 99, 99, 99, }; static const uint8_t zigzag[] = { From patchwork Sun Apr 12 02:33:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ross X-Patchwork-Id: 18887 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 39E38449B5C for ; Sun, 12 Apr 2020 05:34:09 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0E9D468B584; Sun, 12 Apr 2020 05:34:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx.sdf.org (mx.sdf.org [205.166.94.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4E01D68B0BE for ; Sun, 12 Apr 2020 05:34:02 +0300 (EEST) Received: from 89344a7aec9c0f7af06250b9d70d8357 ([1.136.244.146]) (authenticated (128 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id 03C2XsR0021231 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Sun, 12 Apr 2020 02:33:59 GMT Date: Sun, 12 Apr 2020 12:33:50 +1000 From: Peter Ross To: ffmpeg-devel@ffmpeg.org Message-ID: <187345a2516961e4968e88d9d803f772f24a5620.1586658617.git.pross@xvid.org> References: <93f19639ad194dec916a1c488a569f6d38cc719b.1586658617.git.pross@xvid.org> MIME-Version: 1.0 In-Reply-To: <93f19639ad194dec916a1c488a569f6d38cc719b.1586658617.git.pross@xvid.org> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/mv30: use aandcttables for quantizer scaling 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- configure | 2 +- libavcodec/mv30.c | 22 ++-------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/configure b/configure index 4d4c429be9..f008559fd8 100755 --- a/configure +++ b/configure @@ -2790,7 +2790,7 @@ msmpeg4v3_decoder_select="h263_decoder" msmpeg4v3_encoder_select="h263_encoder" mss2_decoder_select="mpegvideo qpeldsp vc1_decoder" mts2_decoder_select="mss34dsp" -mv30_decoder_select="blockdsp" +mv30_decoder_select="aandcttables blockdsp" mvha_decoder_deps="zlib" mvha_decoder_select="llviddsp" mwsc_decoder_deps="zlib" diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c index 6e25ed647b..fed9bcd1e8 100644 --- a/libavcodec/mv30.c +++ b/libavcodec/mv30.c @@ -33,6 +33,7 @@ #include "blockdsp.h" #include "get_bits.h" #include "internal.h" +#include "aandcttab.h" typedef struct MV30Context { GetBitContext gb; @@ -58,25 +59,6 @@ typedef struct MV30Context { static VLC cbp_tab; -static const int16_t scale_tab[] = { - 16384, 22725, 21407, 19266, - 16384, 12873, 8867, 4520, - 22725, 31521, 29692, 26722, - 22725, 17855, 12299, 6270, - 21407, 29692, 27969, 25172, - 21407, 16819, 11585, 5906, - 19266, 26722, 25172, 22654, - 19266, 15137, 10426, 5315, - 16384, 22725, 21407, 19266, - 16384, 12873, 8867, 4520, - 12873, 17855, 16819, 15137, - 12873, 10114, 6967, 3552, - 8867, 12299, 11585, 10426, - 8867, 6967, 4799, 2446, - 4520, 6270, 5906, 5315, - 4520, 3552, 2446, 1247, -}; - static const uint8_t luma_tab[] = { 12, 12, 15, 19, 25, 34, 40, 48, 12, 12, 18, 22, 27, 44, 47, 46, @@ -116,7 +98,7 @@ static void get_qtable(int16_t *table, int quant, const uint8_t *quant_tab) for (int i = 0; i < 64; i++) { table[i] = av_clip((quant_tab[i] * factor + 0x32) / 100, 1, 0x7fff); - table[i] = ((int)scale_tab[i] * (int)table[i] + 0x800) >> 12; + table[i] = ((int)ff_aanscales[i] * (int)table[i] + 0x800) >> 12; } }