aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK/include/mdct.h
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2020-08-27 10:16:06 -0700
committerXin Li <delphij@google.com>2020-08-27 10:16:06 -0700
commit7a0dde5d5dc4d24095c0391e7fa8297de3c7cd45 (patch)
tree0e353968c34e8c9699663a9b252836b70847c30b /libFDK/include/mdct.h
parent946a672b0f5b8481eb3a429f854fcb34d847d692 (diff)
parente0624f4c05df8b171555bc8c8748ee93655f5b3e (diff)
downloadfdk-aac-7a0dde5d5dc4d24095c0391e7fa8297de3c7cd45.tar.gz
fdk-aac-7a0dde5d5dc4d24095c0391e7fa8297de3c7cd45.tar.bz2
fdk-aac-7a0dde5d5dc4d24095c0391e7fa8297de3c7cd45.zip
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507 Merged-In: I9bd31724ae68b9a0b3eb4bb5be3782359824aa1f Change-Id: Idcdb13a8c37b0b4b5446169c3e80dfe55586bc77
Diffstat (limited to 'libFDK/include/mdct.h')
-rw-r--r--libFDK/include/mdct.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/libFDK/include/mdct.h b/libFDK/include/mdct.h
index 1382374..e7cf3ad 100644
--- a/libFDK/include/mdct.h
+++ b/libFDK/include/mdct.h
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -106,18 +106,16 @@ amm-info@iis.fraunhofer.de
#include "common_fix.h"
#define MDCT_OUT_HEADROOM 2 /* Output additional headroom */
-#define PCM_OUT_BITS SAMPLE_BITS
+
+#define PCM_OUT_BITS DFRACT_BITS
#define PCM_OUT_HEADROOM 8 /* Must have the same values as DMXH_HEADROOM */
-#define MDCT_OUTPUT_SCALE (-MDCT_OUT_HEADROOM + (DFRACT_BITS - SAMPLE_BITS))
+#define MDCT_OUTPUT_SCALE (-MDCT_OUT_HEADROOM + (DFRACT_BITS - PCM_OUT_BITS))
/* Refer to "Output word length" in ISO/IEC 14496-3:2008(E) 23.2.3.6 */
#define MDCT_OUTPUT_GAIN 16
-#if (MDCT_OUTPUT_SCALE >= 0)
-#define IMDCT_SCALE(x) SATURATE_RIGHT_SHIFT(x, MDCT_OUTPUT_SCALE, PCM_OUT_BITS)
-#else
-#define IMDCT_SCALE(x) SATURATE_LEFT_SHIFT(x, -MDCT_OUTPUT_SCALE, PCM_OUT_BITS)
-#endif
+#define IMDCT_SCALE(x, s) \
+ SATURATE_RIGHT_SHIFT((x), ((s) + MDCT_OUTPUT_SCALE), PCM_OUT_BITS)
#define IMDCT_SCALE_DBL(x) (FIXP_DBL)(x)
#define IMDCT_SCALE_DBL_LSH1(x) SATURATE_LEFT_SHIFT_ALT((x), 1, DFRACT_BITS)