OSDN Git Service

tweak ca_aac bitrate limits some more
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 9 Oct 2010 23:24:32 +0000 (23:24 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 9 Oct 2010 23:24:32 +0000 (23:24 +0000)
add comment table of bitrate limits found through empirical testing.

git-svn-id: svn://localhost/HandBrake/trunk@3594 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/common.c

index 0921ecb..3788d31 100644 (file)
@@ -98,6 +98,38 @@ int hb_find_closest_audio_bitrate(int bitrate)
 }
 
 // Get the bitrate low and high limits for a codec/samplerate/mixdown triplet
+// The limits have been empirically determined through testing.  Max bitrates
+// in table below. Numbers in parenthesis are the target bitrate chosen.
+/*
+Encoder     1 channel           2 channels          6 channels
+
+faac
+24kHz       86 (128)            173 (256)           460 (768)
+48kHz       152 (160)           304 (320)           759 (768)
+
+Vorbis
+24kHz       97 (80)             177 (160)           527 (512)
+48kHz       241 (224)           465 (448)           783 (768)
+
+Lame
+24kHz       146 (768)           138 (768)
+48kHz       318 (768)           318 (768)
+
+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
+*/
+
 void hb_get_audio_bitrate_limits(uint32_t codec, int samplerate, int mixdown, int *low, int *high)
 {
     int channels;
@@ -118,7 +150,18 @@ void hb_get_audio_bitrate_limits(uint32_t codec, int samplerate, int mixdown, in
             break;
 
         case HB_ACODEC_CA_AAC:
-            if (samplerate > 24000)
+            if (samplerate > 44100)
+            {
+                *low = channels * 40;
+                *high = 256;
+                if (channels == 2)
+                    *high = 320;
+                if (channels == 6)
+                {
+                    *high = 768;
+                }
+            }
+            else if (samplerate > 24000)
             {
                 *low = channels * 32;
                 *high = 256;
@@ -136,7 +179,6 @@ void hb_get_audio_bitrate_limits(uint32_t codec, int samplerate, int mixdown, in
                 *high = channels * 64;
                 if (channels == 6)
                 {
-                    *low = 80;
                     *high = 320;
                 }
             }