From 46ba3676b854acbc69a4c7845f578d4c2886377b Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Fri, 8 Apr 2016 10:52:42 -0700 Subject: AAC/SBR encoder improvements * AAC-Encoder - AAC-ELD core encoder audio quality tuning. Update tuning tables, configure bitreservoir size and adapt afterburner iteration value. Modified file(s): libAACenc/src/aacenc.h libAACenc/src/aacenc_lib.cpp libAACenc/src/adj_thr.cpp libAACenc/src/adj_thr.h libAACenc/src/adj_thr_data.h libAACenc/src/bandwidth.cpp libAACenc/src/pnsparam.cpp libAACenc/src/qc_main.cpp - Introduze dead zone quantizer for ELD to improve audio quality at certain configurations. Modified file(s): libAACenc/src/aacenc_lib.cpp libAACenc/src/adj_thr.cpp libAACenc/src/adj_thr.h libAACenc/src/qc_data.h libAACenc/src/qc_main.cpp libAACenc/src/quantize.cpp libAACenc/src/quantize.h libAACenc/src/sf_estim.cpp libAACenc/src/sf_estim.h - Revise TNS module to improve ELD audio quality. - Use new window function and separate prediction gain according TNS filters. - Add missing memory initilization to TNS configuration. Modified file(s): libAACenc/src/aacenc_lib.cpp libAACenc/src/aacenc_tns.cpp libAACenc/src/aacenc_tns.h libAACenc/src/psy_main.cpp libAACenc/src/tns_func.h * SBR-Encoder - Revise frequency resolution calculation and handle differently depending on number of envelopes and split frames decision. - Add and adjust ELD SBR tuning tables. Modified file(s): libSBRenc/include/sbr_encoder.h libSBRenc/src/bit_sbr.h libSBRenc/src/env_est.cpp libSBRenc/src/fram_gen.cpp libSBRenc/src/fram_gen.h libSBRenc/src/mh_det.cpp libSBRenc/src/sbr_def.h libSBRenc/src/sbr_encoder.cpp libSBRenc/src/sbr_rom.cpp libSBRenc/src/tran_det.cpp - Replace ELD transient detector with fast implementation. Modified file(s): libSBRenc/src/env_est.cpp libSBRenc/src/env_est.h libSBRenc/src/fram_gen.cpp libSBRenc/src/sbr_def.h libSBRenc/src/sbr_encoder.cpp libSBRenc/src/tran_det.cpp libSBRenc/src/tran_det.h * FDK-Library - Introduce generic compare function in tools library. Modified file(s): libFDK/include/fixpoint_math.h libFDK/src/FDK_core.cpp * SBR-Encoder - Revise ELD frame splitter to improve bit distribution. Modified file(s): libSBRenc/include/sbr_encoder.h libSBRenc/src/bit_sbr.h libSBRenc/src/env_est.cpp libSBRenc/src/fram_gen.cpp libSBRenc/src/fram_gen.h libSBRenc/src/sbr_encoder.cpp libSBRenc/src/tran_det.cpp libSBRenc/src/tran_det.h - Configure amplitude resolution according the tonality of the audio signal. Modified file(s): libSBRenc/include/sbr_encoder.h libSBRenc/src/bit_sbr.h libSBRenc/src/env_est.cpp libSBRenc/src/nf_est.cpp libSBRenc/src/nf_est.h libSBRenc/src/sbr_def.h libSBRenc/src/sbr_encoder.cpp libSBRenc/src/ton_corr.cpp libSBRenc/src/ton_corr.h libSBRenc/src/tran_det.cpp libSBRenc/src/tran_det.h Change-Id: Ie0672b989a06ee63b50240616b8d1d4b790b6cb2 --- libAACenc/src/pnsparam.cpp | 47 ++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'libAACenc/src/pnsparam.cpp') diff --git a/libAACenc/src/pnsparam.cpp b/libAACenc/src/pnsparam.cpp index afc5bdd..9d59ddc 100644 --- a/libAACenc/src/pnsparam.cpp +++ b/libAACenc/src/pnsparam.cpp @@ -2,7 +2,7 @@ /* ----------------------------------------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. +© Copyright 1995 - 2015 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -107,6 +107,7 @@ typedef struct { typedef struct { ULONG brFrom; ULONG brTo; + UCHAR S16000; UCHAR S22050; UCHAR S24000; UCHAR S32000; @@ -115,25 +116,26 @@ typedef struct { } AUTO_PNS_TAB; static const AUTO_PNS_TAB levelTable_mono[]= { - {0, 11999, 1, 1, 1, 1, 1,}, - {12000, 19999, 1, 1, 1, 1, 1,}, - {20000, 28999, 2, 1, 1, 1, 1,}, - {29000, 40999, 4, 4, 4, 2, 2,}, - {41000, 55999, 9, 9, 7, 7, 7,}, - {56000, 79999, 0, 0, 0, 9, 9,}, - {80000, 99999, 0, 0, 0, 0, 0,}, - {100000,999999, 0, 0, 0, 0, 0,}, + {0, 11999, 0, 1, 1, 1, 1, 1,}, + {12000, 19999, 0, 1, 1, 1, 1, 1,}, + {20000, 28999, 0, 2, 1, 1, 1, 1,}, + {29000, 40999, 0, 4, 4, 4, 2, 2,}, + {41000, 55999, 0, 9, 9, 7, 7, 7,}, + {56000, 61999, 0, 0, 0, 0, 9, 9,}, + {62000, 75999, 0, 0, 0, 0, 0, 0,}, + {76000, 92999, 0, 0, 0, 0, 0, 0,}, + {93000, 999999, 0, 0, 0, 0, 0, 0,}, }; static const AUTO_PNS_TAB levelTable_stereo[]= { - {0, 11999, 1, 1, 1, 1, 1,}, - {12000, 19999, 3, 1, 1, 1, 1,}, - {20000, 28999, 3, 3, 3, 2, 2,}, - {29000, 40999, 7, 6, 6, 5, 5,}, - {41000, 55999, 9, 9, 7, 7, 7,}, - {56000, 79999, 0, 0, 0, 0, 0,}, - {80000, 99999, 0, 0, 0, 0, 0,}, - {100000,999999, 0, 0, 0, 0, 0,}, + {0, 11999, 0, 1, 1, 1, 1, 1,}, + {12000, 19999, 0, 3, 1, 1, 1, 1,}, + {20000, 28999, 0, 3, 3, 3, 2, 2,}, + {29000, 40999, 0, 7, 6, 6, 5, 5,}, + {41000, 55999, 0, 9, 9, 7, 7, 7,}, + {56000, 79999, 0, 0, 0, 0, 0, 0,}, + {80000, 99999, 0, 0, 0, 0, 0, 0,}, + {100000,999999, 0, 0, 0, 0, 0, 0,}, }; @@ -160,11 +162,11 @@ static const PNS_INFO_TAB pnsInfoTab[] = { }; static const AUTO_PNS_TAB levelTable_lowComplexity[]= { - {0, 27999, 0, 0, 0, 0, 0,}, - {28000, 31999, 2, 2, 2, 2, 2,}, - {32000, 47999, 3, 3, 3, 3, 3,}, - {48000, 48000, 4, 4, 4, 4, 4,}, - {48001, 999999, 0, 0, 0, 0, 0,}, + {0, 27999, 0, 0, 0, 0, 0, 0,}, + {28000, 31999, 0, 2, 2, 2, 2, 2,}, + {32000, 47999, 0, 3, 3, 3, 3, 3,}, + {48000, 48000, 0, 4, 4, 4, 4, 4,}, + {48001, 999999, 0, 0, 0, 0, 0, 0,}, }; /* conversion of old LC tuning tables to new (LD enc) structure (only entries which are actually used were converted) */ @@ -211,6 +213,7 @@ int FDKaacEnc_lookUpPnsUse (int bitRate, int sampleRate, int numChan, const int } switch (sampleRate) { + case 16000: hUsePns = levelTable[i].S16000; break; case 22050: hUsePns = levelTable[i].S22050; break; case 24000: hUsePns = levelTable[i].S24000; break; case 32000: hUsePns = levelTable[i].S32000; break; -- cgit v1.2.3