From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id F07C3494A4 for ; Sun, 12 May 2024 11:19:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F0C3D68D61C; Sun, 12 May 2024 14:19:20 +0300 (EEST) Received: from btbn.de (btbn.de [144.76.60.213]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AAB5468807C for ; Sun, 12 May 2024 14:19:14 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id 7437A27FFD853 for ; Sun, 12 May 2024 13:19:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1715512753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e6A7B06RYyUoprooZXYcmb/WLdnm41XN7Xlm1Hs8dJs=; b=ezYguOiiLpNwQrgI9tngwzfIMSVOBhRjLhzIUMpnyP0bYxq/SHwh2oDs7oxqsphZ1ZU/QQ aN3zCqgRB9rmGoPf8fJY2vGuIrHeUcwhh1OV7kJLU+ynHQF2QbzFYUFoCr9bmNTdJ2jbt1 QxpRfJgXlWA4J/uD+EZYxNaqsozr5xas/uCCCqH3tznFS8PqGV4rUCqqA2dZGykJue9dh1 uIf+77rHcRGMdZfuxPvHxaZSohRNVaEe/JG/XQX88G2NrC2w7Sgd1GtCInBOPAvPruXFak heguxRN8wghLVDdPh2/dLLc2F7oGcsIyqp2gDKGmfCR0YddKeHPCE9WNrc9jSg== Message-ID: <15fc1743-b193-4475-a204-8b6ec8effc78@rothenpieler.org> Date: Sun, 12 May 2024 13:19:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240512085340.1473198-1-yotam.ofek@gmail.com> Content-Language: en-US From: Timo Rothenpieler In-Reply-To: <20240512085340.1473198-1-yotam.ofek@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/aacenc_tns: remove unreachable code branch 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: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 12.05.2024 10:53, Yotam Ofek wrote: > the condition being tested was the same as the stop condition for the containing loop, > so inside the loop it would always test positive > --- > libavcodec/aacenc_tns.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c > index 60888fece7..fa3cd2af39 100644 > --- a/libavcodec/aacenc_tns.c > +++ b/libavcodec/aacenc_tns.c > @@ -181,7 +181,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) > > for (w = 0; w < sce->ics.num_windows; w++) { > float en[2] = {0.0f, 0.0f}; > - int oc_start = 0, os_start = 0; > + int oc_start = 0; > int coef_start = sce->ics.swb_offset[sfb_start]; > > for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) { > @@ -202,12 +202,11 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) > tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3; > for (g = 0; g < tns->n_filt[w]; g++) { > tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g]; > - tns->order[w][g] = g < tns->n_filt[w] ? order/tns->n_filt[w] : order - oc_start; > - tns->length[w][g] = g < tns->n_filt[w] ? sfb_len/tns->n_filt[w] : sfb_len - os_start; > + tns->order[w][g] = order/tns->n_filt[w]; > + tns->length[w][g] = sfb_len/tns->n_filt[w]; Are you sure this isn't an indication that this code was meant to do something else, and there is actually a different issue than just dead code here? > quantize_coefs(&coefs[oc_start], tns->coef_idx[w][g], tns->coef[w][g], > tns->order[w][g], c_bits); > oc_start += tns->order[w][g]; > - os_start += tns->length[w][g]; > } > count++; > } _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".