From patchwork Fri Nov 20 07:33:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23905 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 EE03A44AB03 for ; Fri, 20 Nov 2020 09:54:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3436068BD83; Fri, 20 Nov 2020 09:35:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8CC9368BD8E for ; Fri, 20 Nov 2020 09:34:58 +0200 (EET) Received: by mail-ed1-f44.google.com with SMTP id v22so8487720edt.9 for ; Thu, 19 Nov 2020 23:34:58 -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=bH6FbEc2PyAxCsLHrGMvwVqN+xAejxdWdLfBUdMHe6c=; b=qk2EbE1Mykz6n7OLP9eqH81v8p48Es3QJKg6darZPQrkPHIfJ4eelYxa0Bh5CvohPY oq3rtGHsvU4zxa9rm9WALLSZShIwzL/h/0Znfytta+S9h1Kpqh29W56t24saAnVB4/t8 gWjJK/ETZuzkP087fqE6chhulNcIISlPgdHltCQSQeNf0sBpKQ8nWPWMdFeRGAPB+M4t TVNtGf0uTSc6/FlQOuJDSZH5ut/F41PYwUO4+ob4OTHNXogYgSO7JHQTLHi+Aa8WrIif 6Zhrnuy+1fJRzzObGC16FMZ2LoKaa1J+hmsfGkM/ugGMB/iZp6oxfmQ9RutaRRxzxCxi 2+ug== 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=bH6FbEc2PyAxCsLHrGMvwVqN+xAejxdWdLfBUdMHe6c=; b=D4N33ZbduX10+vamZjzHyCfEtae/GDHsUHAJfX1y+OB3y37+P7yFiqbFvpeWoK7von 3xnVqeCTeEWUoJABj9Xl1fL7ah2+xEeFz4dQrzxS2kIvgvWLK+97tymm7oN82Q1Tz5jr ZfVJHibXly93DBjKj+n4HWtzzQaixOq2WTtHTZQtG1DLI36QrxTi4q4ME7IxpgUAnnGL irIv/X7cwFtBU3tXOUia2tAjAAQboqrWB9NKGrrj0+cxP3ftJhayVYDqSL8SlwI72cs/ JbLLo+7U2uNe+RY/ggMDtUbhO2vECZ+/N2K+XfSJaE7g16uDaP5/YpslpoOj1CLak/Tq Z2xg== X-Gm-Message-State: AOAM530IBcGW4O9FGRqJOuudM0oEA6b11jYVDT8JvzEp3q028FcBKSwh l5WfatyCQasDEsK5lqMGyqNrg/r3/Jq8Xw== X-Google-Smtp-Source: ABdhPJw2TL05uCht7rU2wB5biHdOKemjvjYiLzLk3bgA51RILcETqkqo0Ddb8BZlAeP1Cidz7UGpcA== X-Received: by 2002:a50:9e8a:: with SMTP id a10mr35499646edf.150.1605857697873; Thu, 19 Nov 2020 23:34:57 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id i13sm769110ejv.84.2020.11.19.23.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 23:34:57 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Nov 2020 08:33:18 +0100 Message-Id: <20201120073327.820745-54-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 153/162] avcodec/mpegaudiotab: Avoid unused entry in table 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/mpegaudiodec_template.c | 6 +++--- libavcodec/mpegaudiodectab.h | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 53db13d0d4..88679723fc 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -100,7 +100,7 @@ typedef struct MPADecodeContext { /* vlc structure for decoding layer 3 huffman tables */ static VLC huff_vlc[16]; static VLC_TYPE huff_vlc_tables[ - 0 + 128 + 128 + 128 + 130 + 128 + 154 + 166 + + 128 + 128 + 128 + 130 + 128 + 154 + 166 + 142 + 204 + 190 + 170 + 542 + 460 + 662 + 414 ][2]; static VLC huff_quad_vlc[2]; @@ -286,7 +286,7 @@ static av_cold void decode_init_static(void) /* huffman decode tables */ offset = 0; - for (i = 1; i < 16; i++) { + for (int i = 0; i < 15;) { const HuffTable *h = &mpa_huff_tables[i]; int xsize, x, y; uint8_t tmp_bits [512] = { 0 }; @@ -303,7 +303,7 @@ static av_cold void decode_init_static(void) } /* XXX: fail test */ - huff_vlc[i].table = huff_vlc_tables+offset; + huff_vlc[++i].table = huff_vlc_tables + offset; huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; init_vlc(&huff_vlc[i], 7, 512, tmp_bits, 1, 1, tmp_codes, 2, 2, diff --git a/libavcodec/mpegaudiodectab.h b/libavcodec/mpegaudiodectab.h index accd12b8e2..e1468c5e89 100644 --- a/libavcodec/mpegaudiodectab.h +++ b/libavcodec/mpegaudiodectab.h @@ -502,8 +502,7 @@ static const uint8_t mpa_huffbits_24[256] = { 7, 7, 7, 8, 8, 8, 8, 4, }; -static const HuffTable mpa_huff_tables[16] = { -{ 1, NULL, NULL }, +static const HuffTable mpa_huff_tables[] = { { 2, mpa_huffbits_1, mpa_huffcodes_1 }, { 3, mpa_huffbits_2, mpa_huffcodes_2 }, { 3, mpa_huffbits_3, mpa_huffcodes_3 },