From patchwork Fri Oct 23 20:54:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23185 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 3960344B5CA for ; Fri, 23 Oct 2020 23:55:14 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1E3A36899EB; Fri, 23 Oct 2020 23:55:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B4ED7689257 for ; Fri, 23 Oct 2020 23:55:07 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id v5so3197541wmh.1 for ; Fri, 23 Oct 2020 13:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xssfbe5HkdReWpDJ4NVcjAl+aG7VQTb9AreLb75/11g=; b=WcL/XFURdVSc4BXqke6trPx4RoEit+hAUHEBxbPYDvnDRxzf5M+eiFpUDzp0URWt6t 35Oio9KIQ69+OyazgCNMDAafLtzpQaqC/cRrSVX22X59nI5fX1DNyLHyAx7hlywFemmx InIvNe2tOIJ2lO4Z6gkjUxnjShZeIiugOrEqX0p4AS9RzT0qpvgTL9/rpYOQ9mi1bRFQ A8nv7aVUDXnHVRQzg53IDycie4yi3S4HNP7lY6W8MpFS/SAGl5ect9C7s11us2L2VWy5 f3PWY7zFXQsjAjjL98eTwn9sdTspAxIfgEAVC0V0ERbDLWyR8IVwaxRsGlEC9OyimY8m yfnw== 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:mime-version :content-transfer-encoding; bh=xssfbe5HkdReWpDJ4NVcjAl+aG7VQTb9AreLb75/11g=; b=i6246AlCRi7cTTJQ/Ktm2Lzx2TNR68MIRq7kNrjQJLVvA41DNkdaoI2ZH5S8FES6AH TprYFPfIhvQM7XjxeWXXc7RLn++7KA00akd0d7f/ViFaQWu4D7kdDgbpgtRYhrR1gp/a UCBIFxiFByFNk+iEWHZcwxHGFikqUYfsp66T8db/WAFdvAJgKcTdTuXFeiN3pJpeOT8K PUUroI241MLmbJhV1hLX4X1dNdgB4jIRptRu4eiucUKsVKtbNPbmWz02c3CWLxm8E5iq 0gupDwIQ9CV1IrG5VsrhRh+w91HkZjPiLaY/lzgxSob7XzRxQdafkR863MgxCiyFWuWf JOGg== X-Gm-Message-State: AOAM530+OJrSo8TIpX8qGqeFYlZgegvQZN6xSiSVXt1DfMZHU76Wkkgj xQ4ldjurwALuzfJLLrU6M3afBr8eJqw= X-Google-Smtp-Source: ABdhPJwjx+fzvIHZVcL2GokLxtyHMBg36yzhTNN/vmKWUftxXgfND+f4w305r7Kbn0eu7q8XTp/nMQ== X-Received: by 2002:a7b:c858:: with SMTP id c24mr4065608wml.176.1603486506781; Fri, 23 Oct 2020 13:55:06 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id z6sm5153350wmi.28.2020.10.23.13.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 13:55:05 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 23 Oct 2020 22:54:51 +0200 Message-Id: <20201023205454.851696-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avcodec/atrac3plus: Perform reusing of VLCs during init 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/atrac3plus.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index 8d17889582..6b046a887e 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -192,12 +192,12 @@ av_cold void ff_atrac3p_init_vlcs(void) /* build huffman tables for spectrum decoding */ for (i = 0; i < 112; i++) { - if (atrac3p_spectra_tabs[i].cb) + if (atrac3p_spectra_tabs[i].redirect < 0) build_canonical_huff(atrac3p_spectra_tabs[i].cb, atrac3p_spectra_tabs[i].xlat, &tab_offset, &spec_vlc_tabs[i]); - else - spec_vlc_tabs[i].table = 0; + else /* Reuse already initialized VLC table */ + spec_vlc_tabs[i] = spec_vlc_tabs[atrac3p_spectra_tabs[i].redirect]; } /* build huffman tables for gain data decoding */ @@ -880,10 +880,6 @@ static void decode_spectrum(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, tab_index = (chan->table_type * 8 + codetab) * 7 + wordlen - 1; tab = &atrac3p_spectra_tabs[tab_index]; - /* this allows reusing VLC tables */ - if (tab->redirect >= 0) - tab_index = tab->redirect; - decode_qu_spectra(gb, tab, &spec_vlc_tabs[tab_index], &chan->spectrum[ff_atrac3p_qu_to_spec_pos[qu]], num_specs);