summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/faac/A00-bitrates.patch60
-rw-r--r--gtk/src/audiohandler.c4
-rw-r--r--gtk/src/hb-backend.c11
3 files changed, 70 insertions, 5 deletions
diff --git a/contrib/faac/A00-bitrates.patch b/contrib/faac/A00-bitrates.patch
new file mode 100644
index 000000000..50b11ec78
--- /dev/null
+++ b/contrib/faac/A00-bitrates.patch
@@ -0,0 +1,60 @@
+diff -Naur faac-1.28/libfaac/frame.c ../build.debug/contrib/faac/faac-1.28/libfaac/frame.c
+--- faac-1.28.orig/libfaac/frame.c 2004-11-17 06:26:06.000000000 -0800
++++ faac-1.28/libfaac/frame.c 2010-04-10 12:26:28.200614437 -0700
+@@ -196,6 +196,8 @@
+ {47000, 10000},
+ {64000, 16000},
+ {76000, 20000},
++ {128000, 22000},
++ {160000, 22000},
+ #endif
+ {0, 0}
+ };
+@@ -242,8 +244,6 @@
+ config->bitRate = tmpbitRate * hEncoder->sampleRate / 44100;
+ #endif
+
+- if (config->bandWidth > bwbase)
+- config->bandWidth = bwbase;
+ }
+
+ hEncoder->config.bitRate = config->bitRate;
+@@ -251,6 +251,7 @@
+ if (!config->bandWidth)
+ {
+ config->bandWidth = (config->quantqual - 100) * bwmult + bwbase;
++ config->bandWidth *= (double)hEncoder->sampleRate / 44100;
+ }
+
+ hEncoder->config.bandWidth = config->bandWidth;
+@@ -261,8 +262,8 @@
+ if (hEncoder->config.bandWidth > (hEncoder->sampleRate / 2))
+ hEncoder->config.bandWidth = hEncoder->sampleRate / 2;
+
+- if (config->quantqual > 500)
+- config->quantqual = 500;
++ if (config->quantqual > 700)
++ config->quantqual = 700;
+ if (config->quantqual < 10)
+ config->quantqual = 10;
+
+@@ -328,8 +329,6 @@
+ hEncoder->config.useTns = 0;
+ hEncoder->config.bitRate = 0; /* default bitrate / channel */
+ hEncoder->config.bandWidth = bwfac * hEncoder->sampleRate;
+- if (hEncoder->config.bandWidth > bwbase)
+- hEncoder->config.bandWidth = bwbase;
+ hEncoder->config.quantqual = 100;
+ hEncoder->config.psymodellist = (psymodellist_t *)psymodellist;
+ hEncoder->config.psymodelidx = 0;
+@@ -888,8 +887,8 @@
+ if (((diff > 0) && (fix > 0.0)) || ((diff < 0) && (fix < 0.0)))
+ {
+ hEncoder->aacquantCfg.quality *= (1.0 - fix);
+- if (hEncoder->aacquantCfg.quality > 300)
+- hEncoder->aacquantCfg.quality = 300;
++ if (hEncoder->aacquantCfg.quality > 700)
++ hEncoder->aacquantCfg.quality = 700;
+ if (hEncoder->aacquantCfg.quality < 50)
+ hEncoder->aacquantCfg.quality = 50;
+ }
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index f8804e561..5895a83c0 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -79,12 +79,12 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud)
}
else if (acodec == HB_ACODEC_FAAC)
{
- gint br, last = 160, first = 0;
+ gint br, last = 320, first = 0;
if (mix == HB_AMIXDOWN_6CH)
{
first = 192;
- last = 448;
+ last = 768;
}
widget = GHB_WIDGET(ud->builder, "AudioBitrate");
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 78fab8cbd..abe02b8e7 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -948,7 +948,7 @@ ghb_find_closest_audio_bitrate(gint codec, gint rate)
gint result;
if (codec == HB_ACODEC_FAAC)
- high = 160;
+ high = 320;
result = high;
for (ii = 0; ii < hb_audio_bitrates_count; ii++)
@@ -1421,7 +1421,12 @@ ghb_get_best_audio_bitrate(gint acodec, gint br, gint channels)
{
if (acodec & HB_ACODEC_FAAC)
{
- int maxbr = channels * 80;
+ int maxbr;
+
+ if (channels == 2)
+ maxbr = 320;
+ else
+ maxbr = 768;
if (br > maxbr)
br = maxbr;
}
@@ -2091,7 +2096,7 @@ ghb_find_audio_track(
gint count = 0;
gint track = -1;
gint max_chan = 0;
- gboolean *used;
+ gboolean *used = NULL;
gboolean *passthru_used;
gint try_acodec;
gint passthru_acodec;