From 8df9bf8e39b5f38c75d63c0ef17965382e634b1c Mon Sep 17 00:00:00 2001 From: Claudio Freire Date: Tue, 15 Sep 2015 03:59:45 -0300 Subject: AAC encoder: refactor to resynchronize MIPS port This patch refactors the AAC coders to reuse code between the MIPS port and the regular, portable C code. There were two main functions that had to use hand-optimized versions of quantization code: - search_for_quantizers_twoloop - codebook_trellis_rate Those two were split into their own template header files so they can be inlined inside both the MIPS port and the generic code. In each context, they'll link to their specialized implementations, and thus be optimized by the compiler. This approach I believe is better than maintaining several copies of each function. As past experience has proven, having to keep those in sync was error prone. In this way, they will remain in sync by default. Also, an implementation of the dequantized output argument for the optimized quantize_and_encode functions is included in the patch. While the current implementation of search_for_pred still isn't using it, future iterations of main prediction probably will. It should not imply any measurable performance hit while not being used. --- tests/fate/aac.mak | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak index cbefc38a75..72fc59df5a 100644 --- a/tests/fate/aac.mak +++ b/tests/fate/aac.mak @@ -158,6 +158,15 @@ fate-aac-ln-encode: CMP_SHIFT = -4096 fate-aac-ln-encode: CMP_TARGET = 68 fate-aac-ln-encode: SIZE_TOLERANCE = 3560 +FATE_AAC_ENCODE += fate-aac-ln-encode-128k +fate-aac-ln-encode-128k: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -strict -2 -c:a aac -aac_is 0 -aac_pns 0 -b:a 128k +fate-aac-ln-encode-128k: CMP = stddev +fate-aac-ln-encode-128k: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav +fate-aac-ln-encode-128k: CMP_SHIFT = -4096 +fate-aac-ln-encode-128k: CMP_TARGET = 638 +fate-aac-ln-encode-128k: SIZE_TOLERANCE = 3560 +fate-aac-ln-encode-128k: FUZZ = 5 + FATE_AAC_ENCODE += fate-aac-pns-encode fate-aac-pns-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -strict -2 -c:a aac -aac_pns 1 -aac_is 0 -b:a 128k fate-aac-pns-encode: CMP = stddev @@ -165,7 +174,7 @@ fate-aac-pns-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.w fate-aac-pns-encode: CMP_SHIFT = -4096 fate-aac-pns-encode: CMP_TARGET = 633.77 fate-aac-pns-encode: SIZE_TOLERANCE = 3560 -fate-aac-pns-encode: FUZZ = 5 +fate-aac-pns-encode: FUZZ = 1 FATE_AAC_ENCODE += fate-aac-tns-encode fate-aac-tns-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -strict -2 -c:a aac -aac_tns 1 -aac_is 0 -aac_pns 0 -b:a 128k @@ -183,7 +192,7 @@ fate-aac-is-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wa fate-aac-is-encode: CMP_SHIFT = -4096 fate-aac-is-encode: CMP_TARGET = 616.75 fate-aac-is-encode: SIZE_TOLERANCE = 3560 -fate-aac-is-encode: FUZZ = 35 +fate-aac-is-encode: FUZZ = 1 FATE_AAC_ENCODE += fate-aac-pred-encode fate-aac-pred-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -strict -2 -profile:a aac_main -c:a aac -aac_is 0 -aac_pns 0 -b:a 128k @@ -191,7 +200,7 @@ fate-aac-pred-encode: CMP = stddev fate-aac-pred-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav fate-aac-pred-encode: CMP_SHIFT = -4096 fate-aac-pred-encode: CMP_TARGET = 652.60 -fate-aac-pred-encode: FUZZ = 10 +fate-aac-pred-encode: FUZZ = 5 fate-aac-pred-encode: SIZE_TOLERANCE = 3560 FATE_AAC_LATM += fate-aac-latm_000000001180bc60 -- cgit v1.2.3