diff options
author | sr55 <[email protected]> | 2011-04-18 12:10:07 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-04-18 12:10:07 +0000 |
commit | e63f490b2e0a90bafb690e1d1f1f1e2f44729309 (patch) | |
tree | ba6efe28059341ad798d5e20d1682233e057e55c /libhb/common.c | |
parent | 4d2dce20625d08032eb25dd2d98c3d4319d8e0d9 (diff) |
HE-AAC support for the OSX port. Thanks go to amarcus, ritsuka and rodeo.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3937 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/libhb/common.c b/libhb/common.c index a3887b680..90bd23cb6 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -118,15 +118,14 @@ ffac3 24kHz 318 (320) 318 (320) 318 (320) 48kHz 636 (640) 636 (640) 636 (640) -Core Audio (core audio api provides range of allowed bitrates) -24kHz 16-64 32-128 80-320 -44.1kHz 64-320 160-768 -48kHz 32-256 64-320 160-768 - -Core Audio (minimum limits found in testing) -24kHz 16 32 96 -44.1kHz 32 64 160 -48kHz 40 80 240 +Core Audio AAC (core audio api provides range of allowed bitrates) +24kHz 16-64 32-128 80-320 +32kHz 24-96 48-192 128-448 +48kHz 32-256 64-320 160-768 + +Core Audio HE-AAC (core audio api provides range of allowed bitrates) +32kHz 12-40 24-80 64-192 +48kHz 16-40 32-80 80-192 */ void hb_get_audio_bitrate_limits(uint32_t codec, int samplerate, int mixdown, int *low, int *high) @@ -149,27 +148,27 @@ void hb_get_audio_bitrate_limits(uint32_t codec, int samplerate, int mixdown, in break; case HB_ACODEC_CA_AAC: - if (samplerate > 44100) + if (samplerate > 32000) { - *low = channels * 40; - *high = 256; + *low = channels * 32; + if (channels == 1) + *high = 256; if (channels == 2) *high = 320; if (channels == 6) { + *low = 160; *high = 768; } } else if (samplerate > 24000) { - *low = channels * 32; - *high = 256; - if (channels == 2) - *high = 320; + *low = channels * 24; + *high = channels * 96; if (channels == 6) { - *low = 160; - *high = 768; + *low = 128; + *high = 448; } } else @@ -178,11 +177,35 @@ void hb_get_audio_bitrate_limits(uint32_t codec, int samplerate, int mixdown, in *high = channels * 64; if (channels == 6) { + *low = 80; *high = 320; } } break; + case HB_ACODEC_CA_HAAC: + if (samplerate > 32000) + { + *low = channels * 16; + *high = channels * 40; + if (channels == 6) + { + *low = 80; + *high = 192; + } + } + else + { + *low = channels * 12; + *high = channels * 40; + if (channels == 6) + { + *low = 64; + *high = 192; + } + } + break; + case HB_ACODEC_FAAC: *low = 32 * channels; if (samplerate > 24000) @@ -280,6 +303,9 @@ int hb_get_default_audio_bitrate( uint32_t codec, int samplerate, int mixdown ) else bitrate = 640; break; + case HB_ACODEC_CA_HAAC: + bitrate = channels * 32; + break; default: bitrate = channels * 80; } @@ -611,6 +637,9 @@ int hb_calc_bitrate( hb_job_t * job, int size ) case HB_ACODEC_DCA: samples_per_frame = 1536; break; + case HB_ACODEC_CA_HAAC: + samples_per_frame = 2048; + break; default: return 0; } |