summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2013-06-15 17:24:35 +0000
committerjstebbins <[email protected]>2013-06-15 17:24:35 +0000
commit768561ada96cd0149ed115748c95a32357676b38 (patch)
treef3133420c26ba3955476aaab30e829555745e57b /contrib
parentc0a3e42fcb044932defaa420ce9ecaeed54db9a3 (diff)
improve aac encoder build options and change some aac encoder defaults
By default, faac is no longer built. Libav aac is now the default aac encoder on all platforms except osx where ca_aac is the default. fdk-aac is now built by default (except on osx). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5581 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ffmpeg/A04-aacenc.patch82
1 files changed, 82 insertions, 0 deletions
diff --git a/contrib/ffmpeg/A04-aacenc.patch b/contrib/ffmpeg/A04-aacenc.patch
new file mode 100644
index 000000000..b58441a17
--- /dev/null
+++ b/contrib/ffmpeg/A04-aacenc.patch
@@ -0,0 +1,82 @@
+commit 8bbdd20a293eab2cfac9f332613ead02a4e3c0c2
+Author: Claudio Freire <[email protected]>
+Date: Sun May 12 09:38:40 2013 +0200
+
+ aacenc: Fix erasure of surround channels
+
+ This was due to a miscomputation of s->cur_channel, which led to
+ psy-based encoders using the psy coefficients for the wrong channel.
+
+ Signed-off-by: Martin Storsjö <[email protected]>
+
+diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
+index 60eca59..b2ad47b 100644
+--- a/libavcodec/aacenc.c
++++ b/libavcodec/aacenc.c
+@@ -597,7 +597,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+ coeffs[ch] = cpe->ch[ch].coeffs;
+ s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
+ for (ch = 0; ch < chans; ch++) {
+- s->cur_channel = start_ch * 2 + ch;
++ s->cur_channel = start_ch + ch;
+ s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
+ }
+ cpe->common_window = 0;
+@@ -613,7 +613,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+ }
+ }
+ }
+- s->cur_channel = start_ch * 2;
++ s->cur_channel = start_ch;
+ if (s->options.stereo_mode && cpe->common_window) {
+ if (s->options.stereo_mode > 0) {
+ IndividualChannelStream *ics = &cpe->ch[0].ics;
+
+commit f4d0a63b5b5c682c18df3bba730f97a9067408ba
+Author: Claudio Freire <[email protected]>
+Date: Sat May 4 18:36:37 2013 -0300
+
+ aacenc: Fix target bitrate for twoloop quantiser search
+
+ This fixes a case where multichannel bitrate isn't accurately
+ targetted by psy model alone, never achieving the target bitrate.
+
+ Signed-off-by: Martin Storsjö <[email protected]>
+
+diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
+index d65d8d9..35b98a9 100644
+--- a/libavcodec/aaccoder.c
++++ b/libavcodec/aaccoder.c
+@@ -710,7 +710,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
+ const float lambda)
+ {
+ int start = 0, i, w, w2, g;
+- int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
++ int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
+ float dists[128] = { 0 }, uplims[128];
+ float maxvals[128];
+ int fflag, minscaler;
+
+commit 7c71ada4cad3c6aab5fa24155c379465c41cfd76
+Author: Claudio Freire <[email protected]>
+Date: Sat May 4 18:35:49 2013 -0300
+
+ aacenc: Fix a rounding bug in aacpsy channel bitrate computation
+
+ Signed-off-by: Martin Storsjö <[email protected]>
+
+diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
+index 6f1ac05..66cf6d5 100644
+--- a/libavcodec/aacpsy.c
++++ b/libavcodec/aacpsy.c
+@@ -312,7 +312,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
+ AacPsyCoeffs *coeffs = pctx->psy_coef[j];
+ const uint8_t *band_sizes = ctx->bands[j];
+ float line_to_frequency = ctx->avctx->sample_rate / (j ? 256.f : 2048.0f);
+- float avg_chan_bits = chan_bitrate / ctx->avctx->sample_rate * (j ? 128.0f : 1024.0f);
++ float avg_chan_bits = chan_bitrate * (j ? 128.0f : 1024.0f) / ctx->avctx->sample_rate;
+ /* reference encoder uses 2.4% here instead of 60% like the spec says */
+ float bark_pe = 0.024f * PSY_3GPP_BITS_TO_PE(avg_chan_bits) / num_bark;
+ float en_spread_low = j ? PSY_3GPP_EN_SPREAD_LOW_S : PSY_3GPP_EN_SPREAD_LOW_L;
+
+