summaryrefslogtreecommitdiffstats
path: root/libhb/work.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-02-05 17:53:03 +0000
committerRodeo <[email protected]>2013-02-05 17:53:03 +0000
commit5ca5ec3e6f4ebb47e92984a4ef859510df56b537 (patch)
tree22dbb88491ce5e6d7b8c844ebdb79581993f2e52 /libhb/work.c
parent4017dfc2050336c4476f89fd4c4e358449b9376e (diff)
Audio dithering.
Works with encoders that accept 16-bit signed integers as input (currently, only ffflac). When supported, the default method is standard triangular. CLI users can request a specific dither algorithm via the --adither option. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5241 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/work.c')
-rw-r--r--libhb/work.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libhb/work.c b/libhb/work.c
index 9ee2b0593..575bebdbd 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -486,6 +486,11 @@ void hb_display_job_info( hb_job_t * job )
{
hb_log( " + dynamic range compression: %f", audio->config.out.dynamic_range_compression );
}
+ if (hb_audio_dither_is_supported(audio->config.out.codec))
+ {
+ hb_log(" + dither: %s",
+ hb_audio_dither_get_description(audio->config.out.dither_method));
+ }
for( j = 0; j < hb_audio_encoders_count; j++ )
{
if( hb_audio_encoders[j].encoder == audio->config.out.codec )
@@ -992,6 +997,25 @@ static void do_job( hb_job_t * job )
audio->config.out.bitrate = best_bitrate;
}
}
+
+ /* sense-check the requested dither */
+ if (hb_audio_dither_is_supported(audio->config.out.codec))
+ {
+ if (audio->config.out.dither_method ==
+ hb_audio_dither_get_default())
+ {
+ /* "auto", enable with default settings */
+ audio->config.out.dither_method =
+ hb_audio_dither_get_default_method();
+ }
+ }
+ else if (audio->config.out.dither_method !=
+ hb_audio_dither_get_default())
+ {
+ /* specific dither requested but dithering not supported */
+ hb_log("work: track %d, dithering not supported by codec",
+ audio->config.out.track);
+ }
}
}