From patchwork Thu May 16 11:12:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 13138 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 DD89E449AD0 for ; Thu, 16 May 2019 14:19:12 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB64168A96C; Thu, 16 May 2019 14:19:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-3.mx.upcmail.net (vie01a-dmta-pe06-3.mx.upcmail.net [84.116.36.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 63D1868A920 for ; Thu, 16 May 2019 14:19:06 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.91) (envelope-from ) id 1hREJw-0006WC-28 for ffmpeg-devel@ffmpeg.org; Thu, 16 May 2019 13:13:08 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id REIyh6j2A5D5NREIyh4tvz; Thu, 16 May 2019 13:12:08 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=bu8y+3Si c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=vYm6krMOzsYx3uC8wWwA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 16 May 2019 13:12:03 +0200 Message-Id: <20190516111205.12971-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfGN9rDKjiep2WBU3W/XGtopIalDT1EEfbdrsFb83zczVVMQOK3zHmVB6NvDV9xlY8xF3YuiWZQq6rJE1MlzNfAYyLVK0NS8ye5fgYePvC3ETGEN7NQkN 9c0bn5vC9cirfczicQVTAC8YAZ8wROxiQzFF35MYCjl21G60Ky3Hu2KU Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/aacdec_fixed: ssign seems always -1 in noise_scale(), simplify 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/aacdec_fixed.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index b051e75709..0808c81005 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -195,12 +195,12 @@ static void subband_scale(int *dst, int *src, int scale, int offset, int len, vo static void noise_scale(int *coefs, int scale, int band_energy, int len) { - int ssign = scale < 0 ? -1 : 1; - int s = FFABS(scale); + int s = -scale; unsigned int round; int i, out, c = exp2tab[s & 3]; int nlz = 0; + av_assert0(s >= 0); while (band_energy > 0x7fff) { band_energy >>= 1; nlz++; @@ -216,7 +216,7 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len) round = s ? 1 << (s-1) : 0; for (i=0; i> 32); - coefs[i] = ((int)(out+round) >> s) * ssign; + coefs[i] = -((int)(out+round) >> s); } } else { @@ -224,7 +224,7 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len) round = s ? 1 << (s-1) : 0; for (i=0; i> s); - coefs[i] = out * ssign; + coefs[i] = -out; } } }