From patchwork Fri Nov 20 07:19:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23761 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 5B1AA44A644 for ; Fri, 20 Nov 2020 09:24:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3E94B68BA6B; Fri, 20 Nov 2020 09:24:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C8C3E68BA30 for ; Fri, 20 Nov 2020 09:24:40 +0200 (EET) Received: by mail-ed1-f67.google.com with SMTP id k4so8505268edl.0 for ; Thu, 19 Nov 2020 23:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=o0HqSF1w3Faqea4lvh0Wq8DIQluc0FvT+3j5jehxnsw=; b=KkoQNOYNHD7NkP6eM+WoK9ffPy10oTj9Zix/pwErFQ+U0fV/qNgkzYBrUYG72UpiPT SfST62RyawVPn21gwHQOQi+BF8IStT58KtPJYm0juIKBdsl0FztkwDbKW4m+zwOxO/np GVY7tN2azW7kkMqRoZjzXmnTr4e1wSd6RK60BB7H6GfNYMM89ks8PHItT5BrJtYpCQpe u7uYHkkyeZg1P9AkCgTtgK9lud0XTLxFh7SLAlUrmO7jLn+pV4ZNLLq7HlwTIWbLE5zn Q8kT9EytRPO0QZ08Ws6X/5ndX65OxfrUW/TtdaRvM/5STEhL3YlP9loJQzZnEXYq2nax TdlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=o0HqSF1w3Faqea4lvh0Wq8DIQluc0FvT+3j5jehxnsw=; b=M8S+tVzydtQ4zg8jswDs9v0H9bppACtDD9B2v1W4FUo5OZY2o3vtXfZ1HVjfuRoyzW Xx+S46/60uiQhq5tCY88HULaU6RyDPrbteDPpPr4gE3MbXil2PU33aeXklaIGaJuP/tn 8Es0i5Q2B203svOXJw+1dPAKyyd0S2o2QHmGKS12zDJFN/+1RISvUpfAT0z2xIFDOixD P+ZoV69lIS2jNwJRzjgWW+/rk9mYju5HpbByvsE0NzAOdDadzZL1Rp2ad9USKYDwYY8d gG1IsQkO3e5S2eiPKUM3XrZZD9kts0GSF2iK+lGpO+4CCEw2yMaEUoHlRRS8zgz3cJeR rjcA== X-Gm-Message-State: AOAM531Mg99vw+AFwDHuzn9wZ+fRG0R6ZvlTAh0ycZiIY4X3t3rXNnih 74w60xOESmFdbIQ1IvWM0KLwdnE/9SS5Bw== X-Google-Smtp-Source: ABdhPJwjK5SnI2o5NeuSWrvTQo3EtGthwmCTe5b6UulE6aVeq7JOCL2x1vKyTklhJaRa5EbYrFpUCw== X-Received: by 2002:aa7:c2d7:: with SMTP id m23mr33984042edp.230.1605857080098; Thu, 19 Nov 2020 23:24:40 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id lz27sm779419ejb.39.2020.11.19.23.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:24:39 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:19:02 +0100 Message-Id: <20201120072116.818090-30-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201120072116.818090-1-andreas.rheinhardt@gmail.com> References: <20201120072116.818090-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 029/162] avcodec/cook: Inline constants 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- libavcodec/cook.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 4d06488c10..1968f2f896 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -65,6 +65,9 @@ #define SUBBAND_SIZE 20 #define MAX_SUBPACKETS 5 +#define QUANT_VLC_BITS 9 +#define COUPLING_VLC_BITS 6 + typedef struct cook_gains { int *now; int *previous; @@ -212,7 +215,7 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) result = 0; for (i = 0; i < 13; i++) { - result |= build_vlc(&q->envelope_quant_index[i], 9, + result |= build_vlc(&q->envelope_quant_index[i], QUANT_VLC_BITS, envelope_quant_index_huffcounts[i], envelope_quant_index_huffsyms[i], 1, -12, q->avctx); } @@ -226,7 +229,7 @@ static av_cold int init_cook_vlc_tables(COOKContext *q) for (i = 0; i < q->num_subpackets; i++) { if (q->subpacket[i].joint_stereo == 1) { - result |= build_vlc(&q->subpacket[i].channel_coupling, 6, + result |= build_vlc(&q->subpacket[i].channel_coupling, COUPLING_VLC_BITS, ccpl_huffcounts[q->subpacket[i].js_vlc_bits - 2], ccpl_huffsyms[q->subpacket[i].js_vlc_bits - 2], 1, 0, q->avctx); @@ -396,7 +399,7 @@ static int decode_envelope(COOKContext *q, COOKSubpacket *p, vlc_index = 13; // the VLC tables >13 are identical to No. 13 j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index - 1].table, - q->envelope_quant_index[vlc_index - 1].bits, 2); + QUANT_VLC_BITS, 2); quant_index_table[i] = quant_index_table[i - 1] + j; // differential encoding if (quant_index_table[i] > 63 || quant_index_table[i] < -63) { av_log(q->avctx, AV_LOG_ERROR, @@ -775,7 +778,7 @@ static int decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab) for (i = 0; i < length; i++) decouple_tab[start + i] = get_vlc2(&q->gb, p->channel_coupling.table, - p->channel_coupling.bits, 3); + COUPLING_VLC_BITS, 3); else for (i = 0; i < length; i++) { int v = get_bits(&q->gb, p->js_vlc_bits);