summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-05-04 17:49:02 +0000
committerjstebbins <[email protected]>2015-05-04 17:49:02 +0000
commit81bcee10d2ad88f44c0f7791f2dd8da4ee2c1b76 (patch)
treef6acdd9c2a29d14817ff2a2a3c1b920f024bb8ea /libhb
parent6e0247780f466b512c23a425922c05596df43dbe (diff)
libhb: enable vbr encoding with fdk-aac and libav-aac
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7157 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/common.c22
-rw-r--r--libhb/encavcodecaudio.c7
2 files changed, 29 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c
index bca6e6956..7bb3f2a56 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -1288,6 +1288,21 @@ void hb_audio_quality_get_limits(uint32_t codec, float *low, float *high,
{
switch (codec)
{
+ case HB_ACODEC_FFAAC:
+ *direction = 0;
+ *granularity = 1.;
+ *low = 1.;
+ *high = 10.;
+ break;
+
+ case HB_ACODEC_FDK_HAAC:
+ case HB_ACODEC_FDK_AAC:
+ *direction = 0;
+ *granularity = 1.;
+ *low = 1.;
+ *high = 5.;
+ break;
+
case HB_ACODEC_LAME:
*direction = 1;
*granularity = 0.5;
@@ -1333,6 +1348,13 @@ float hb_audio_quality_get_default(uint32_t codec)
{
switch (codec)
{
+ case HB_ACODEC_FFAAC:
+ return 5.;
+
+ case HB_ACODEC_FDK_HAAC:
+ case HB_ACODEC_FDK_AAC:
+ return 3.;
+
case HB_ACODEC_LAME:
return 2.;
diff --git a/libhb/encavcodecaudio.c b/libhb/encavcodecaudio.c
index 78c993286..2f302b348 100644
--- a/libhb/encavcodecaudio.c
+++ b/libhb/encavcodecaudio.c
@@ -163,6 +163,13 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job)
{
context->global_quality = audio->config.out.quality * FF_QP2LAMBDA;
context->flags |= CODEC_FLAG_QSCALE;
+ if (audio->config.out.codec == HB_ACODEC_FDK_AAC ||
+ audio->config.out.codec == HB_ACODEC_FDK_HAAC)
+ {
+ char vbr[2];
+ snprintf(vbr, 2, "%.1g", audio->config.out.quality);
+ av_dict_set(&av_opts, "vbr", vbr, 0);
+ }
}
if (audio->config.out.compression_level >= 0)