From patchwork Thu Jun 6 05:12:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 49616 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:c209:0:b0:460:55fa:d5ed with SMTP id d9csp143029vqo; Wed, 5 Jun 2024 22:13:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWbHkLbKp8iVewhit05w8UmgbyZA4SYacNcXrv758hoOTcG1Juz/jOFKKGakyzUX4N03GOltxjqYfkdaJ/+umjWVmRK82i9iPvLow== X-Google-Smtp-Source: AGHT+IEf1VL0ugOKYoPbolm6zY1kVl1usrVV5RHB4sGRcHrpb3zhKgyekr21RIwQ6b1PYDMg+4Hp X-Received: by 2002:a05:6512:4028:b0:529:ed2a:5d04 with SMTP id 2adb3069b0e04-52bab4d818dmr2759887e87.2.1717650808290; Wed, 05 Jun 2024 22:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717650808; cv=none; d=google.com; s=arc-20160816; b=HCkV2XR1d1vyL4G/8zlf5BcEdKGPY8aQrkdh+tuFS7K9/v9BQVJozvtpHxyzP61rHi iZ50o0edL+8FuFNqMq4fFgzXHTVlltcgqTSjTCXt0HWl4jixNCzkyREdiuInCkV2zPD4 cmCFVq0J4dxMcuEHJoo6k5d5ZLVKyuxz0pWzNz8F2uyrKeqPj0holb456erSLsbR7Wo1 UySWbWMWZytExhHG2zxVhzOmlNwKeGovKnPrVN3oP/9jjOTWBDBDU6QVCmRnvFo0Dg8y AJc0XCFeo+kklciKuFblmrx9PoDQnkQnVCAmFJMcbzvtNwIr2Ruy4IV/F7pBOuYXO1PF /1+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:delivered-to; bh=JqRovK7Iypeyj3idTMEhbcc807/2UXp1R3OdVs8MqwA=; fh=nenT92/WZoU6unXd3J6UhGUdod4piddKfVtctNBOh6k=; b=pXIOmDtc5mgE23/JellKqTjrVHb7Hu+dkJgT/vTQaecDvNOuqLBZUmOkEVhaCQtxG/ Vye0Ch0Spf1tVhlkOOmuHJRVsc0K3Cro8TzuOmf0Yw8E/pseTPtrT1FKgXtfxxx5ghyW xWH/wVgAyFbdg/C/q6bRzUNP6MQc+25yinu4lIUP6WYdn8Cb7p0Sffk8wLBWYWoNmK4A 8AOYaemKXOVoBEHXnd2yWOk1EgLUaStxZ8Y/VulT1+T7+iaBliCuGX+yxJic2EQYWLjI U3AATGUQmh1geIfpIujphO1uZCFGMGpmqHSPXS+LrDt0c3oYQwj1zfGyGUrW3b9cByJh G84A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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 2adb3069b0e04-52bb4129d3esi178594e87.82.2024.06.05.22.13.27; Wed, 05 Jun 2024 22:13:28 -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; 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 B3C5068D6E4; Thu, 6 Jun 2024 08:12:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vidala.lynne.ee (vidala.pars.ee [116.203.72.101]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D10F68D516 for ; Thu, 6 Jun 2024 08:12:48 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Jun 2024 07:12:35 +0200 Message-ID: <20240606051243.3177266-4-dev@lynne.ee> X-Mailer: git-send-email 2.43.0.381.gb435a96ce8 In-Reply-To: <20240606051243.3177266-1-dev@lynne.ee> References: <20240606051243.3177266-1-dev@lynne.ee> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] aacdec_usac: skip coeff decoding if the number to be decoded is 0 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lynne via ffmpeg-devel From: Lynne Reply-To: FFmpeg development discussions and patches Cc: Lynne Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: bozI7gvJL8LL Yet another thing not mentioned in the spec. --- libavcodec/aac/aacdec_usac.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c index 97655787ee..5dd489a43b 100644 --- a/libavcodec/aac/aacdec_usac.c +++ b/libavcodec/aac/aacdec_usac.c @@ -572,9 +572,15 @@ static int decode_spectrum_and_dequant_ac(AACDecContext *s, float coef[1024], int gb_count; GetBitContext gb2; - ff_aac_ac_init(&ac, gb); c = ff_aac_ac_map_process(state, reset, N); + if (!len) { + ff_aac_ac_finish(state, 0, N); + return 0; + } + + ff_aac_ac_init(&ac, gb); + /* Backup reader for rolling back by 14 bits at the end */ gb2 = *gb; gb_count = get_bits_count(&gb2);