summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.h
diff options
context:
space:
mode:
authorClaudio Freire <klaussfreire@gmail.com>2015-07-20 22:53:24 -0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-27 19:13:48 +0200
commit59216e0525a58714be4207be6ae8744750e62867 (patch)
tree8c5b41b3471b08e17396c159001da6deff7ce347 /libavcodec/aacenc.h
parentc8c86b8f9b8c166633a7324c8646f38866801b88 (diff)
AAC Encoder: clipping avoidance
Avoid clipping due to quantization noise to produce audible artifacts, by detecting near-clipping signals and both attenuating them a little and encoding escape-encoded bands (usually the loudest) rounding towards zero instead of nearest, which tends to decrease overall energy and thus clipping. Currently fate tests measure numerical error so this change makes tests using asynth (which are near clipping) report higher error not less, because of window attenuation. Yet, they sound better, not worse (albeit subtle, other samples aren't subtle at all). Only measuring psychoacoustically weighted error would make for a representative test, so that will be left for a future patch. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/aacenc.h')
-rw-r--r--libavcodec/aacenc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h
index 42104552eb..1f05aabd76 100644
--- a/libavcodec/aacenc.h
+++ b/libavcodec/aacenc.h
@@ -54,7 +54,7 @@ typedef struct AACCoefficientsEncoder {
void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda);
void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
- int scale_idx, int cb, const float lambda);
+ int scale_idx, int cb, const float lambda, int rtz);
void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
void (*search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce, const float lambda);
void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);