summaryrefslogtreecommitdiffstats
path: root/libhb/enclame.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-03-14 01:15:31 +0000
committerjstebbins <[email protected]>2010-03-14 01:15:31 +0000
commit70ce62705b318f5ca12791a87e24065401f844cc (patch)
tree1d753d41b24644f31242e16ea8f2adec0300c97d /libhb/enclame.c
parent8412fb04b943ce61befffe2caad64ed786d62415 (diff)
improve lame audio quality by using ABR mode and disabling joint stereo mode
add mp3 muxing into mp4 container. cli and gtk gui now support this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3167 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/enclame.c')
-rw-r--r--libhb/enclame.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libhb/enclame.c b/libhb/enclame.c
index 027aa3add..a3f4a3882 100644
--- a/libhb/enclame.c
+++ b/libhb/enclame.c
@@ -48,10 +48,19 @@ int enclameInit( hb_work_object_t * w, hb_job_t * job )
hb_log( "enclame: opening libmp3lame" );
pv->lame = lame_init();
- lame_set_brate( pv->lame, audio->config.out.bitrate );
+ // use ABR
+ lame_set_VBR( pv->lame, vbr_abr );
+ lame_set_VBR_mean_bitrate_kbps( pv->lame, audio->config.out.bitrate );
lame_set_in_samplerate( pv->lame, audio->config.out.samplerate );
lame_set_out_samplerate( pv->lame, audio->config.out.samplerate );
lame_init_params( pv->lame );
+ // Lame's default encoding mode is JOINT_STEREO. This subtracts signal
+ // that is "common" to left and right (within some threshold) and encodes
+ // it separately. This improves quality at low bitrates, but hurts
+ // imaging (channel separation) at higher bitrates. So if the bitrate
+ // is suffeciently high, use regular STEREO mode.
+ if ( audio->config.out.bitrate >= 128 )
+ lame_set_mode( pv->lame, STEREO );
pv->input_samples = 1152 * 2;
pv->output_bytes = LAME_MAXMP3BUFFER;