From 44ddee945a2e8cfc1b7074de6e35595ed41da4e4 Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Sat, 29 Aug 2015 06:34:08 +0100 Subject: aacenc_pred: rework the way prediction is done This commit completely alters the algorithm of prediction. The original commit which introduced prediction was completely incorrect to even remotely care about what the actual coefficients contain or whether any options were enabled. Not my actual fault. This commit treats prediction the way the decoder does and expects to do: like lossy encryption. Everything related to prediction now happens at the very end but just before quantization and encoding of coefficients. On the decoder side, prediction happens before anything has had a chance to even access the coefficients. Also the original implementation had problems because it actually touched the band_type of special bands which already had their scalefactor indices marked and it's a wonder the asserion wasn't triggered when transmitting those. Overall, this now drastically increases audio quality and you should think about enabling it if you don't plan on playing anything encoded on really old low power ultra-embedded devices since they might not support decoding of prediction or AAC-Main. Though the specifications were written ages ago and as times change so do the FLOPS. Signed-off-by: Rostislav Pehlivanov --- libavcodec/aac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/aac.h') diff --git a/libavcodec/aac.h b/libavcodec/aac.h index dc6b439854..aa4b53b549 100644 --- a/libavcodec/aac.h +++ b/libavcodec/aac.h @@ -247,7 +247,7 @@ typedef struct SingleChannelElement { TemporalNoiseShaping tns; Pulse pulse; enum BandType band_type[128]; ///< band types - enum BandType orig_band_type[128]; ///< band type backups for undoing prediction + enum BandType band_alt[128]; ///< alternative band type (used by encoder) int band_type_run_end[120]; ///< band type run end points INTFLOAT sf[120]; ///< scalefactors int sf_idx[128]; ///< scalefactor indices (used by encoder) -- cgit v1.2.1