diff options
-rw-r--r-- | contrib/faac/A00-bitrates.patch | 60 | ||||
-rw-r--r-- | contrib/faac/A01-multichannel-improvements.patch | 752 | ||||
-rw-r--r-- | contrib/faac/P00-cygwin.patch | 12 | ||||
-rw-r--r-- | contrib/faac/module.defs | 13 | ||||
-rw-r--r-- | contrib/faac/module.rules | 2 | ||||
-rw-r--r-- | gtk/configure.ac | 8 | ||||
-rw-r--r-- | gtk/module.defs | 4 | ||||
-rw-r--r-- | gtk/src/audiohandler.c | 4 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 6 | ||||
-rw-r--r-- | gtk/src/standard_presets.xml | 24 | ||||
-rw-r--r-- | libhb/common.c | 31 | ||||
-rw-r--r-- | libhb/common.h | 2 | ||||
-rw-r--r-- | libhb/encfaac.c | 293 | ||||
-rw-r--r-- | libhb/hb.c | 3 | ||||
-rw-r--r-- | libhb/internal.h | 1 | ||||
-rw-r--r-- | libhb/module.defs | 9 | ||||
-rw-r--r-- | libhb/muxavformat.c | 1 | ||||
-rw-r--r-- | libhb/muxmkv.c | 1 | ||||
-rw-r--r-- | libhb/muxmp4.c | 2 | ||||
-rw-r--r-- | libhb/work.c | 1 | ||||
-rw-r--r-- | macosx/HBAudioController.m | 2 | ||||
-rw-r--r-- | macosx/HBPresets.m | 24 | ||||
-rw-r--r-- | macosx/HandBrake.xcodeproj/project.pbxproj | 2 | ||||
-rw-r--r-- | make/configure.py | 5 | ||||
-rw-r--r-- | make/include/main.defs | 4 | ||||
-rwxr-xr-x | scripts/manicure.rb | 32 | ||||
-rw-r--r-- | test/test.c | 49 |
27 files changed, 65 insertions, 1282 deletions
diff --git a/contrib/faac/A00-bitrates.patch b/contrib/faac/A00-bitrates.patch deleted file mode 100644 index 49460768e..000000000 --- a/contrib/faac/A00-bitrates.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff -Naur faac-1.28.old/libfaac/frame.c faac-1.28.new/libfaac/frame.c ---- faac-1.28.old/libfaac/frame.c 2004-11-17 06:26:06.000000000 -0800 -+++ faac-1.28.new/libfaac/frame.c 2010-04-10 12:26:28.200614437 -0700 -@@ -196,6 +196,8 @@ - {47000, 10000}, - {64000, 16000}, - {76000, 20000}, -+ {128000, 22000}, -+ {160000, 22000}, - #endif - {0, 0} - }; -@@ -242,8 +244,6 @@ - config->bitRate = tmpbitRate * hEncoder->sampleRate / 44100; - #endif - -- if (config->bandWidth > bwbase) -- config->bandWidth = bwbase; - } - - hEncoder->config.bitRate = config->bitRate; -@@ -251,6 +251,7 @@ - if (!config->bandWidth) - { - config->bandWidth = (config->quantqual - 100) * bwmult + bwbase; -+ config->bandWidth *= (double)hEncoder->sampleRate / 44100; - } - - hEncoder->config.bandWidth = config->bandWidth; -@@ -261,8 +262,8 @@ - if (hEncoder->config.bandWidth > (hEncoder->sampleRate / 2)) - hEncoder->config.bandWidth = hEncoder->sampleRate / 2; - -- if (config->quantqual > 500) -- config->quantqual = 500; -+ if (config->quantqual > 700) -+ config->quantqual = 700; - if (config->quantqual < 10) - config->quantqual = 10; - -@@ -328,8 +329,6 @@ - hEncoder->config.useTns = 0; - hEncoder->config.bitRate = 0; /* default bitrate / channel */ - hEncoder->config.bandWidth = bwfac * hEncoder->sampleRate; -- if (hEncoder->config.bandWidth > bwbase) -- hEncoder->config.bandWidth = bwbase; - hEncoder->config.quantqual = 100; - hEncoder->config.psymodellist = (psymodellist_t *)psymodellist; - hEncoder->config.psymodelidx = 0; -@@ -888,8 +887,8 @@ - if (((diff > 0) && (fix > 0.0)) || ((diff < 0) && (fix < 0.0))) - { - hEncoder->aacquantCfg.quality *= (1.0 - fix); -- if (hEncoder->aacquantCfg.quality > 300) -- hEncoder->aacquantCfg.quality = 300; -+ if (hEncoder->aacquantCfg.quality > 700) -+ hEncoder->aacquantCfg.quality = 700; - if (hEncoder->aacquantCfg.quality < 50) - hEncoder->aacquantCfg.quality = 50; - } diff --git a/contrib/faac/A01-multichannel-improvements.patch b/contrib/faac/A01-multichannel-improvements.patch deleted file mode 100644 index d0ec5ce3c..000000000 --- a/contrib/faac/A01-multichannel-improvements.patch +++ /dev/null @@ -1,752 +0,0 @@ -diff -Naur faac-1.28.old/frontend/main.c faac-1.28.new/frontend/main.c ---- faac-1.28.old/frontend/main.c 2009-01-24 02:10:20.000000000 +0100 -+++ faac-1.28.new/frontend/main.c 2012-08-06 21:15:34.000000000 +0200 -@@ -858,7 +858,7 @@ - break; - } - if (infile->channels >= 6) -- myFormat->useLfe = 1; -+ myFormat->numLFEChannels = 1; - myFormat->allowMidside = useMidSide; - if (bitRate) - myFormat->bitRate = bitRate / infile->channels; -diff -Naur faac-1.28.old/include/faaccfg.h faac-1.28.new/include/faaccfg.h ---- faac-1.28.old/include/faaccfg.h 2004-07-04 14:12:05.000000000 +0200 -+++ faac-1.28.new/include/faaccfg.h 2012-08-06 21:15:34.000000000 +0200 -@@ -66,8 +66,14 @@ - /* Allow mid/side coding */ - unsigned int allowMidside; - -- /* Use one of the channels as LFE channel */ -- unsigned int useLfe; -+ /* Channel configuration */ -+ unsigned int channelConfiguration; -+ -+ /* Number of front, side, back & LFE channels */ -+ unsigned int numFrontChannels; -+ unsigned int numSideChannels; -+ unsigned int numBackChannels; -+ unsigned int numLFEChannels; - - /* Use Temporal Noise Shaping */ - unsigned int useTns; -diff -Naur faac-1.28.old/libfaac/bitstream.c faac-1.28.new/libfaac/bitstream.c ---- faac-1.28.old/libfaac/bitstream.c 2007-06-05 20:59:47.000000000 +0200 -+++ faac-1.28.new/libfaac/bitstream.c 2012-08-06 21:15:34.000000000 +0200 -@@ -1032,6 +1032,219 @@ - return j; - } - -+/* write a program_config_element() */ -+int WritePCE(faacEncHandle hEncoder, -+ BitStream *bitStream, -+ int byte_alignment, -+ int instance_tag, -+ int writeFlag) -+{ -+ int i; -+ int bits = 0; -+ -+ /* we can have up to 29 full-bandwidth channels of each type: -+ * 4 bits -> 0 - 15 elements, 14 CPEs (28 channels) and 1 SCE (1 channel) -+ * we can have up to 3 LFE channels: -+ * 2 bits -> 0 - 3 elements, 3 LFEs (1 channel) */ -+ if (hEncoder->config.numFrontChannels > 29) { -+ fprintf(stderr, "WritePCE: too many front channels (%u)\n", -+ hEncoder->config.numFrontChannels); -+ return 0; -+ } -+ if (hEncoder->config.numSideChannels > 29) { -+ fprintf(stderr, "WritePCE: too many side channels (%u)\n", -+ hEncoder->config.numSideChannels); -+ return 0; -+ } -+ if (hEncoder->config.numBackChannels > 29) { -+ fprintf(stderr, "WritePCE: too many back channels (%u)\n", -+ hEncoder->config.numBackChannels); -+ return 0; -+ } -+ if (hEncoder->config.numLFEChannels > 3) { -+ fprintf(stderr, "WritePCE: too many LFE channels (%u)\n", -+ hEncoder->config.numLFEChannels); -+ return 0; -+ } -+ /* program_config_element() shall be used only for the audio object types: -+ * AAC main, AAC SSR, AAC LC and AAC LTP */ -+ if (hEncoder->config.aacObjectType > 4) { -+ fprintf(stderr, "WritePCE: unsupported AudioObjectType %u", -+ hEncoder->config.aacObjectType); -+ return 0; -+ } -+ -+ /* Determine the channel configuration (see GetChannelInfo) */ -+ int sceTag = 0; -+ int cpeTag = 0; -+ int lfeTag = 0; -+ int num_front_channel_elements = 0; -+ int front_element_is_cpe[15] = { 0 }; -+ int front_element_tag_select[15] = { 0 }; -+ int num_side_channel_elements = 0; -+ int side_element_is_cpe[15] = { 0 }; -+ int side_element_tag_select[15] = { 0 }; -+ int num_back_channel_elements = 0; -+ int back_element_is_cpe[15] = { 0 }; -+ int back_element_tag_select[15] = { 0 }; -+ int num_lfe_channel_elements = 0; -+ int lfe_element_tag_select[3] = { 0 }; -+ // Front channels -+ i = hEncoder->config.numFrontChannels; -+ if (i % 2) { -+ front_element_is_cpe[num_front_channel_elements] = 0; -+ front_element_tag_select[num_front_channel_elements] = sceTag; -+ num_front_channel_elements++; -+ sceTag++; -+ i--; -+ } -+ while (i) { -+ front_element_is_cpe[num_front_channel_elements] = 1; -+ front_element_tag_select[num_front_channel_elements] = cpeTag; -+ num_front_channel_elements++; -+ cpeTag++; -+ i -= 2; -+ } -+ // Side channels -+ i = hEncoder->config.numSideChannels; -+ while (i > 1) { -+ side_element_is_cpe[num_side_channel_elements] = 1; -+ side_element_tag_select[num_side_channel_elements] = cpeTag; -+ num_side_channel_elements++; -+ cpeTag++; -+ i -= 2; -+ } -+ if (i) { -+ side_element_is_cpe[num_side_channel_elements] = 0; -+ side_element_tag_select[num_side_channel_elements] = sceTag; -+ num_side_channel_elements++; -+ sceTag++; -+ i--; -+ } -+ // Back channels -+ i = hEncoder->config.numBackChannels; -+ while (i > 1) { -+ back_element_is_cpe[num_back_channel_elements] = 1; -+ back_element_tag_select[num_back_channel_elements] = cpeTag; -+ num_back_channel_elements++; -+ cpeTag++; -+ i -= 2; -+ } -+ if (i) { -+ back_element_is_cpe[num_back_channel_elements] = 0; -+ back_element_tag_select[num_back_channel_elements] = sceTag; -+ num_back_channel_elements++; -+ sceTag++; -+ i--; -+ } -+ // LFE channels -+ i = hEncoder->config.numLFEChannels; -+ while (i) { -+ lfe_element_tag_select[num_lfe_channel_elements] = lfeTag; -+ num_lfe_channel_elements++; -+ lfeTag++; -+ i--; -+ } -+ -+ /* element_instance_tag */ -+ if (writeFlag) -+ PutBit(bitStream, instance_tag, 4); -+ bits =+ 4; -+ -+ /* object_type */ -+ if (writeFlag) -+ PutBit(bitStream, hEncoder->config.aacObjectType - 1, 2); -+ bits += 2; -+ -+ /* sampling_frequency_index */ -+ if (writeFlag) -+ PutBit(bitStream, hEncoder->sampleRateIdx, 4); -+ bits += 4; -+ -+ /* num_front_channel_elements */ -+ if (writeFlag) -+ PutBit(bitStream, num_front_channel_elements, 4); -+ bits += 4; -+ -+ /* num_side_channel_elements */ -+ if (writeFlag) -+ PutBit(bitStream, num_side_channel_elements, 4); -+ bits += 4; -+ -+ /* num_back_channel_elements */ -+ if (writeFlag) -+ PutBit(bitStream, num_back_channel_elements, 4); -+ bits += 4; -+ -+ /* num_lfe_channel_elements */ -+ if (writeFlag) -+ PutBit(bitStream, num_lfe_channel_elements, 2); -+ bits += 2; -+ -+ /* num_assoc_data_elements */ -+ if (writeFlag) -+ PutBit(bitStream, 0, 3); -+ bits += 3; -+ -+ /* num_valid_cc_elements */ -+ if (writeFlag) -+ PutBit(bitStream, 0, 4); -+ bits += 4; -+ -+ /* mono_mixdown_present */ -+ if (writeFlag) -+ PutBit(bitStream, 0, 1); -+ bits++; -+ -+ /* stereo_mixdown_present */ -+ if (writeFlag) -+ PutBit(bitStream, 0, 1); -+ bits++; -+ -+ /* matrix_mixdown_idx_present */ -+ if (writeFlag) -+ PutBit(bitStream, 0, 1); -+ bits++; -+ -+ /* describe the channel configuration */ -+ for (i = 0; i < num_front_channel_elements; i++) { -+ if (writeFlag) { -+ PutBit(bitStream, front_element_is_cpe[i], 1); -+ PutBit(bitStream, front_element_tag_select[i], 4); -+ } -+ bits += 5; -+ } -+ for (i = 0; i < num_side_channel_elements; i++) { -+ if (writeFlag) { -+ PutBit(bitStream, side_element_is_cpe[i], 1); -+ PutBit(bitStream, side_element_tag_select[i], 4); -+ } -+ bits += 5; -+ } -+ for (i = 0; i < num_back_channel_elements; i++) { -+ if (writeFlag) { -+ PutBit(bitStream, back_element_is_cpe[i], 1); -+ PutBit(bitStream, back_element_tag_select[i], 4); -+ } -+ bits += 5; -+ } -+ for (i = 0; i < num_lfe_channel_elements; i++) { -+ if (writeFlag) -+ PutBit(bitStream, lfe_element_tag_select[i], 4); -+ bits += 4; -+ } -+ -+ /* byte_alignment() */ -+ bits += ByteAlign(bitStream, writeFlag, bits + byte_alignment); -+ -+ /* comment_field_bytes */ -+ if (writeFlag) -+ PutBit(bitStream, 0, 8); -+ bits += 8; -+ -+ return bits; -+} -+ - #ifdef DRM - /* - **************************************************************************** -diff -Naur faac-1.28.old/libfaac/bitstream.h faac-1.28.new/libfaac/bitstream.h ---- faac-1.28.old/libfaac/bitstream.h 2004-07-04 14:10:52.000000000 +0200 -+++ faac-1.28.new/libfaac/bitstream.h 2012-08-06 21:15:34.000000000 +0200 -@@ -164,6 +164,13 @@ - unsigned long data, - int numBit); - -+/* write a program_config_element() */ -+int WritePCE(faacEncHandle hEncoder, -+ BitStream *bitStream, -+ int byte_alignment, -+ int instance_tag, -+ int writeFlag); -+ - #ifdef __cplusplus - } - #endif /* __cplusplus */ -diff -Naur faac-1.28.old/libfaac/channels.c faac-1.28.new/libfaac/channels.c ---- faac-1.28.old/libfaac/channels.c 2001-09-04 20:39:35.000000000 +0200 -+++ faac-1.28.new/libfaac/channels.c 2012-08-06 21:15:34.000000000 +0200 -@@ -28,83 +28,112 @@ - #include "coder.h" - #include "util.h" - --/* If LFE present */ --/* Num channels # of SCE's # of CPE's #of LFE's */ --/* ============ ========== ========== ========= */ --/* 1 1 0 0 */ --/* 2 0 1 0 */ --/* 3 1 1 0 */ --/* 4 1 1 1 */ --/* 5 1 2 0 */ --/* For more than 5 channels, use the following elements: */ --/* 2*N 1 2*(N-1) 1 */ --/* 2*N+1 1 2*N 0 */ --/* */ --/* Else: */ --/* */ --/* Num channels # of SCE's # of CPE's #of LFE's */ --/* ============ ========== ========== ========= */ --/* 1 1 0 0 */ --/* 2 0 1 0 */ --/* 3 1 1 0 */ --/* 4 2 1 0 */ --/* 5 1 2 0 */ --/* For more than 5 channels, use the following elements: */ --/* 2*N 2 2*(N-1) 0 */ --/* 2*N+1 1 2*N 0 */ -- --void GetChannelInfo(ChannelInfo *channelInfo, int numChannels, int useLfe) --{ -- int sceTag = 0; -- int lfeTag = 0; -- int cpeTag = 0; -- int numChannelsLeft = numChannels; -+static void addSCE(ChannelInfo *channelInfo, int numChannels, int numChannelsLeft, int tag); -+static void addCPE(ChannelInfo *channelInfo, int numChannels, int numChannelsLeft, int tag); -+static void addLFE(ChannelInfo *channelInfo, int numChannels, int numChannelsLeft, int tag); - - -- /* First element is sce, except for 2 channel case */ -- if (numChannelsLeft != 2) { -- channelInfo[numChannels-numChannelsLeft].present = 1; -- channelInfo[numChannels-numChannelsLeft].tag = sceTag++; -- channelInfo[numChannels-numChannelsLeft].cpe = 0; -- channelInfo[numChannels-numChannelsLeft].lfe = 0; -+void GetChannelInfo(ChannelInfo *channelInfo, int numFrontChannels, int numSideChannels, int numBackChannels, int numLFEChannels) -+{ -+ int i; -+ int sceTag = 0; -+ int cpeTag = 0; -+ int lfeTag = 0; -+ int numChannels = (numFrontChannels + -+ numSideChannels + -+ numBackChannels + -+ numLFEChannels); -+ int numChannelsLeft = numChannels; -+ -+ /* Front channels */ -+ i = numFrontChannels; -+ if (i % 2) { -+ // Front Center -+ addSCE(channelInfo, numChannels, numChannelsLeft, sceTag); - numChannelsLeft--; -+ sceTag++; -+ i--; -+ } -+ while (i) { -+ // Front Left/Right, Front Left/Right of Center, ??? -+ addCPE(channelInfo, numChannels, numChannelsLeft, cpeTag); -+ numChannelsLeft -= 2; -+ cpeTag++; -+ i -= 2; - } - -- /* Next elements are cpe's */ -- while (numChannelsLeft > 1) { -- /* Left channel info */ -- channelInfo[numChannels-numChannelsLeft].present = 1; -- channelInfo[numChannels-numChannelsLeft].tag = cpeTag++; -- channelInfo[numChannels-numChannelsLeft].cpe = 1; -- channelInfo[numChannels-numChannelsLeft].common_window = 0; -- channelInfo[numChannels-numChannelsLeft].ch_is_left = 1; -- channelInfo[numChannels-numChannelsLeft].paired_ch = numChannels-numChannelsLeft+1; -- channelInfo[numChannels-numChannelsLeft].lfe = 0; -+ /* Side channels */ -+ i = numSideChannels; -+ while (i > 1) { -+ // Surround Left/Right (if rear surrounds present), ??? -+ addCPE(channelInfo, numChannels, numChannelsLeft, cpeTag); -+ numChannelsLeft -= 2; -+ cpeTag++; -+ i -= 2; -+ } -+ if (i) { -+ // ??? -+ addSCE(channelInfo, numChannels, numChannelsLeft, sceTag); - numChannelsLeft--; -+ sceTag++; -+ i--; -+ } - -- /* Right channel info */ -- channelInfo[numChannels-numChannelsLeft].present = 1; -- channelInfo[numChannels-numChannelsLeft].cpe = 1; -- channelInfo[numChannels-numChannelsLeft].common_window = 0; -- channelInfo[numChannels-numChannelsLeft].ch_is_left = 0; -- channelInfo[numChannels-numChannelsLeft].paired_ch = numChannels-numChannelsLeft-1; -- channelInfo[numChannels-numChannelsLeft].lfe = 0; -+ /* Back channels */ -+ i = numBackChannels; -+ while (i > 1) { -+ // Surround Left/Right (if rear surrounds absent), Rear Surround Left/Right, ??? -+ addCPE(channelInfo, numChannels, numChannelsLeft, cpeTag); -+ numChannelsLeft -= 2; -+ cpeTag++; -+ i -= 2; -+ } -+ if (i) { -+ // Surround Center -+ addSCE(channelInfo, numChannels, numChannelsLeft, sceTag); - numChannelsLeft--; -+ sceTag++; -+ i--; - } - -- /* Is there another channel left ? */ -- if (numChannelsLeft) { -- if (useLfe) { -- channelInfo[numChannels-numChannelsLeft].present = 1; -- channelInfo[numChannels-numChannelsLeft].tag = lfeTag++; -- channelInfo[numChannels-numChannelsLeft].cpe = 0; -- channelInfo[numChannels-numChannelsLeft].lfe = 1; -- } else { -- channelInfo[numChannels-numChannelsLeft].present = 1; -- channelInfo[numChannels-numChannelsLeft].tag = sceTag++; -- channelInfo[numChannels-numChannelsLeft].cpe = 0; -- channelInfo[numChannels-numChannelsLeft].lfe = 0; -- } -+ /* LFE channel */ -+ i = numLFEChannels; -+ while (i) { -+ addLFE(channelInfo, numChannels, numChannelsLeft, lfeTag); - numChannelsLeft--; -+ lfeTag++; -+ i--; - } - } -+ -+static void addSCE(ChannelInfo *channelInfo, int numChannels, int numChannelsLeft, int tag) { -+ channelInfo[numChannels-numChannelsLeft].present = 1; -+ channelInfo[numChannels-numChannelsLeft].cpe = 0; -+ channelInfo[numChannels-numChannelsLeft].lfe = 0; -+ channelInfo[numChannels-numChannelsLeft].tag = tag; -+} -+ -+static void addCPE(ChannelInfo *channelInfo, int numChannels, int numChannelsLeft, int tag) { -+ /* Left channel info */ -+ channelInfo[numChannels-numChannelsLeft].present = 1; -+ channelInfo[numChannels-numChannelsLeft].cpe = 1; -+ channelInfo[numChannels-numChannelsLeft].lfe = 0; -+ channelInfo[numChannels-numChannelsLeft].tag = tag; -+ channelInfo[numChannels-numChannelsLeft].ch_is_left = 1; -+ channelInfo[numChannels-numChannelsLeft].common_window = 0; -+ channelInfo[numChannels-numChannelsLeft].paired_ch = numChannels-numChannelsLeft+1; -+ /* Right channel info */ -+ channelInfo[numChannels-numChannelsLeft+1].present = 1; -+ channelInfo[numChannels-numChannelsLeft+1].cpe = 1; -+ channelInfo[numChannels-numChannelsLeft+1].lfe = 0; -+ channelInfo[numChannels-numChannelsLeft+1].ch_is_left = 0; -+ channelInfo[numChannels-numChannelsLeft+1].common_window = 0; -+ channelInfo[numChannels-numChannelsLeft+1].paired_ch = numChannels-numChannelsLeft; -+} -+ -+static void addLFE(ChannelInfo *channelInfo, int numChannels, int numChannelsLeft, int tag) { -+ channelInfo[numChannels-numChannelsLeft].present = 1; -+ channelInfo[numChannels-numChannelsLeft].cpe = 0; -+ channelInfo[numChannels-numChannelsLeft].lfe = 1; -+ channelInfo[numChannels-numChannelsLeft].tag = tag; -+} -diff -Naur faac-1.28.old/libfaac/channels.h faac-1.28.new/libfaac/channels.h ---- faac-1.28.old/libfaac/channels.h 2003-06-26 21:19:41.000000000 +0200 -+++ faac-1.28.new/libfaac/channels.h 2012-08-06 21:15:34.000000000 +0200 -@@ -45,7 +45,7 @@ - MSInfo msInfo; - } ChannelInfo; - --void GetChannelInfo(ChannelInfo *channelInfo, int numChannels, int useLfe); -+void GetChannelInfo(ChannelInfo *channelInfo, int numFrontChannels, int numSideChannels, int numBackChannels, int numLFEChannels); - - #ifdef __cplusplus - } -diff -Naur faac-1.28.old/libfaac/frame.c faac-1.28.new/libfaac/frame.c ---- faac-1.28.old/libfaac/frame.c 2004-11-17 15:26:06.000000000 +0100 -+++ faac-1.28.new/libfaac/frame.c 2012-08-06 21:15:34.000000000 +0200 -@@ -99,21 +99,47 @@ - return -2; /* not supported */ - } - -- *pSizeOfDecoderSpecificInfo = 2; -- *ppBuffer = malloc(2); -+ if (hEncoder->config.channelConfiguration > 7) { -+ fprintf(stderr, "faacEncGetDecoderSpecificInfo: " -+ "invalid channel configuration %u\n", -+ hEncoder->config.channelConfiguration); -+ return -2; -+ } else if (hEncoder->config.channelConfiguration) { -+ // 16 bits -+ *pSizeOfDecoderSpecificInfo = 2; -+ } else { -+ // 16 bits + size of the program_config_element() -+ *pSizeOfDecoderSpecificInfo = 2 + (WritePCE(hEncoder, NULL, 0, 0, 0) / 8); -+ } - -- if(*ppBuffer != NULL){ -+ *ppBuffer = malloc(*pSizeOfDecoderSpecificInfo); - -+ if (*ppBuffer != NULL) { - memset(*ppBuffer,0,*pSizeOfDecoderSpecificInfo); - pBitStream = OpenBitStream(*pSizeOfDecoderSpecificInfo, *ppBuffer); - PutBit(pBitStream, hEncoder->config.aacObjectType, 5); - PutBit(pBitStream, hEncoder->sampleRateIdx, 4); -- PutBit(pBitStream, hEncoder->numChannels, 4); -+ PutBit(pBitStream, hEncoder->config.channelConfiguration, 4); -+ PutBit(pBitStream, 0, 1); // frameLengthFlag -+ PutBit(pBitStream, 0, 1); // dependsOnCoreCoder -+ PutBit(pBitStream, 0, 1); // extensionFlag -+ if (!hEncoder->config.channelConfiguration) { -+ /* a program_config_element() must be written */ -+ if (WritePCE(hEncoder, pBitStream, 0, 0, 1) <= 0) { -+ fprintf(stderr, -+ "faacEncGetDecoderSpecificInfo: WritePCE() failed!\n"); -+ *pSizeOfDecoderSpecificInfo = 0; -+ CloseBitStream(pBitStream); -+ free(*ppBuffer); -+ *ppBuffer = NULL; -+ return -3; -+ } -+ } - CloseBitStream(pBitStream); -- - return 0; - } else { -- return -3; -+ *pSizeOfDecoderSpecificInfo = 0; -+ return -4; - } - } - -@@ -131,7 +157,6 @@ - int i; - - hEncoder->config.allowMidside = config->allowMidside; -- hEncoder->config.useLfe = config->useLfe; - hEncoder->config.useTns = config->useTns; - hEncoder->config.aacObjectType = config->aacObjectType; - hEncoder->config.mpegVersion = config->mpegVersion; -@@ -139,6 +164,77 @@ - hEncoder->config.inputFormat = config->inputFormat; - hEncoder->config.shortctl = config->shortctl; - -+ if (!config->channelConfiguration) { -+ if (hEncoder->numChannels != (config->numFrontChannels + -+ config->numSideChannels + -+ config->numBackChannels + -+ config->numLFEChannels)) { -+ fprintf(stderr, "faacEncSetConfiguration: " -+ "numChannels doesn't match the custom channel configuration\n"); -+ return 0; -+ } -+ hEncoder->config.numFrontChannels = config->numFrontChannels; -+ hEncoder->config.numSideChannels = config->numSideChannels; -+ hEncoder->config.numBackChannels = config->numBackChannels; -+ hEncoder->config.numLFEChannels = config->numLFEChannels; -+ } else if (config->channelConfiguration > 7) { -+ fprintf(stderr, "faacEncSetConfiguration: " -+ "invalid channel configuration %u\n", -+ config->channelConfiguration); -+ return 0; -+ } else { -+ if ((config->channelConfiguration == 7 && hEncoder->numChannels != 8) || -+ (config->channelConfiguration != 7 && hEncoder->numChannels != config->channelConfiguration)) { -+ fprintf(stderr, "faacEncSetConfiguration: " -+ "numChannels doesn't match the channel configuration\n"); -+ return 0; -+ } -+ switch (config->channelConfiguration) { -+ case 7: -+ hEncoder->config.numFrontChannels = 5; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 2; -+ hEncoder->config.numLFEChannels = 1; -+ break; -+ case 6: -+ hEncoder->config.numFrontChannels = 3; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 2; -+ hEncoder->config.numLFEChannels = 1; -+ break; -+ case 5: -+ hEncoder->config.numFrontChannels = 3; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 2; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ case 4: -+ hEncoder->config.numFrontChannels = 3; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 1; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ case 3: -+ hEncoder->config.numFrontChannels = 3; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 0; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ case 2: -+ hEncoder->config.numFrontChannels = 2; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 0; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ case 1: -+ hEncoder->config.numFrontChannels = 1; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 0; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ } -+ } -+ - assert((hEncoder->config.outputFormat == 0) || (hEncoder->config.outputFormat == 1)); - - switch( hEncoder->config.inputFormat ) -@@ -306,6 +402,12 @@ - *maxOutputBytes += 1; /* for CRC */ - #endif - -+ if (!numChannels || numChannels > 64) { -+ fprintf(stderr, "faacEncOpen: invalid number of channels %u\n", -+ numChannels); -+ return NULL; -+ } -+ - hEncoder = (faacEncStruct*)AllocMemory(sizeof(faacEncStruct)); - SetMemory(hEncoder, 0, sizeof(faacEncStruct)); - -@@ -324,7 +426,6 @@ - hEncoder->config.mpegVersion = MPEG4; - hEncoder->config.aacObjectType = LTP; - hEncoder->config.allowMidside = 1; -- hEncoder->config.useLfe = 1; - hEncoder->config.useTns = 0; - hEncoder->config.bitRate = 0; /* default bitrate / channel */ - hEncoder->config.bandWidth = bwfac * hEncoder->sampleRate; -@@ -340,6 +441,91 @@ - /* default channel map is straight-through */ - for( channel = 0; channel < 64; channel++ ) - hEncoder->config.channel_map[channel] = channel; -+ -+ /* Define a sensible default channel configuration */ -+ if (numChannels <= 6 || numChannels == 8) { -+ switch (numChannels) { -+ case 8: -+ hEncoder->config.channelConfiguration = 7; -+ hEncoder->config.numFrontChannels = 5; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 2; -+ hEncoder->config.numLFEChannels = 1; -+ break; -+ case 6: -+ hEncoder->config.channelConfiguration = 6; -+ hEncoder->config.numFrontChannels = 3; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 2; -+ hEncoder->config.numLFEChannels = 1; -+ break; -+ case 5: -+ hEncoder->config.channelConfiguration = 5; -+ hEncoder->config.numFrontChannels = 3; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 2; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ case 4: -+ hEncoder->config.channelConfiguration = 4; -+ hEncoder->config.numFrontChannels = 3; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 1; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ case 3: -+ hEncoder->config.channelConfiguration = 3; -+ hEncoder->config.numFrontChannels = 3; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 0; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ case 2: -+ hEncoder->config.channelConfiguration = 2; -+ hEncoder->config.numFrontChannels = 2; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 0; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ case 1: -+ hEncoder->config.channelConfiguration = 1; -+ hEncoder->config.numFrontChannels = 1; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 0; -+ hEncoder->config.numLFEChannels = 0; -+ break; -+ } -+ } else { -+ hEncoder->config.channelConfiguration = 0; -+ hEncoder->config.numFrontChannels = 0; -+ hEncoder->config.numSideChannels = 0; -+ hEncoder->config.numBackChannels = 0; -+ hEncoder->config.numLFEChannels = 0; -+ for (channel = numChannels; channel > 0; channel--) { -+ // 7 channels: 7.0 (C L R Ls Rs Rls Rrs) -+ // 9 channels: 9.0 (Lc Rc L R Ls Rs Rls Rrs Cs) -+ // 10 channels: 10.0 (C Lc Rc L R Ls Rs Rls Rrs Cs) -+ // for more than 10 channels, use faacEncSetConfiguration() -+ if (hEncoder->config.numFrontChannels < 3) { -+ // C, L, R -+ hEncoder->config.numFrontChannels++; -+ } else if (hEncoder->config.numBackChannels < 2) { -+ // Ls or Rls, Rs or Rrs -+ hEncoder->config.numBackChannels++; -+ } else if (hEncoder->config.numSideChannels < 2) { -+ // Ls, Rs -+ hEncoder->config.numSideChannels++; -+ } else if (hEncoder->config.numBackChannels < 3) { -+ // Cs -+ hEncoder->config.numBackChannels++; -+ } else if (hEncoder->config.numFrontChannels < 5) { -+ // Lc, Rc -+ hEncoder->config.numFrontChannels++; -+ } else { -+ break; -+ } -+ } -+ } - - /* - by default we have to be compatible with all previous software -@@ -459,14 +645,13 @@ - double fix; - #endif - -- /* local copy's of parameters */ -+ /* local copies of parameters */ - ChannelInfo *channelInfo = hEncoder->channelInfo; - CoderInfo *coderInfo = hEncoder->coderInfo; - unsigned int numChannels = hEncoder->numChannels; - unsigned int sampleRate = hEncoder->sampleRate; - unsigned int aacObjectType = hEncoder->config.aacObjectType; - unsigned int mpegVersion = hEncoder->config.mpegVersion; -- unsigned int useLfe = hEncoder->config.useLfe; - unsigned int useTns = hEncoder->config.useTns; - unsigned int allowMidside = hEncoder->config.allowMidside; - unsigned int bandWidth = hEncoder->config.bandWidth; -@@ -484,7 +669,11 @@ - return 0; - - /* Determine the channel configuration */ -- GetChannelInfo(channelInfo, numChannels, useLfe); -+ GetChannelInfo(channelInfo, -+ hEncoder->config.numFrontChannels, -+ hEncoder->config.numSideChannels, -+ hEncoder->config.numBackChannels, -+ hEncoder->config.numLFEChannels); - - /* Update current sample buffers */ - for (channel = 0; channel < numChannels; channel++) diff --git a/contrib/faac/P00-cygwin.patch b/contrib/faac/P00-cygwin.patch deleted file mode 100644 index bef152139..000000000 --- a/contrib/faac/P00-cygwin.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur faac-1.28.old/include/faac.h faac-1.28.new/include/faac.h ---- faac-1.28.old/include/faac.h 2009-01-25 13:50:32.000000000 -0500 -+++ faac-1.28.new/include/faac.h 2009-03-20 03:31:46.000000000 -0400 -@@ -50,7 +50,7 @@ - typedef void *faacEncHandle; - - #ifndef HAVE_INT32_T --typedef signed int int32_t; -+//typedef signed int int32_t; - #endif - - /* diff --git a/contrib/faac/module.defs b/contrib/faac/module.defs deleted file mode 100644 index d1ae1be13..000000000 --- a/contrib/faac/module.defs +++ /dev/null @@ -1,13 +0,0 @@ -$(eval $(call import.MODULE.defs,FAAC,faac)) -$(eval $(call import.CONTRIB.defs,FAAC)) - -FAAC.FETCH.url = http://download.handbrake.fr/handbrake/contrib/faac-1.28.tar.gz -FAAC.EXTRACT.tarbase = faac-1.28 - -# If faac not already bootstrapped then add the following -#FAAC.CONFIGURE.bootstrap = ./bootstrap; -FAAC.CONFIGURE.extra = --without-mp4v2 - -## optional static libs need to be marked -FAAC.OSL.libs = faac -FAAC.OSL.files = $(foreach i,$(FAAC.OSL.libs),$(call fn.ABSOLUTE,$(CONTRIB.build/)lib/lib$(i).a)) diff --git a/contrib/faac/module.rules b/contrib/faac/module.rules deleted file mode 100644 index 5c311304a..000000000 --- a/contrib/faac/module.rules +++ /dev/null @@ -1,2 +0,0 @@ -$(eval $(call import.MODULE.rules,FAAC)) -$(eval $(call import.CONTRIB.rules,FAAC)) diff --git a/gtk/configure.ac b/gtk/configure.ac index 6c57e9851..6d0ecfce8 100644 --- a/gtk/configure.ac +++ b/gtk/configure.ac @@ -60,10 +60,6 @@ AC_ARG_ENABLE(fdk-aac, AS_HELP_STRING([--enable-fdk-aac], [enable fdk aac encoder]), use_fdk_aac=yes, use_fdk_aac=no) -AC_ARG_ENABLE(faac, - AS_HELP_STRING([--enable-faac], [enable faac encoder]), - use_faac=yes, use_faac=no) - AC_ARG_ENABLE(mp4v2, AS_HELP_STRING([--enable-mp4v2], [enable mp4v2 muxer]), use_mp4v2=yes, use_mp4v2=no) @@ -192,10 +188,6 @@ if test "x$use_fdk_aac" = "xyes" ; then HB_LIBS+=" -lfdk-aac" fi -if test "x$use_faac" = "xyes" ; then - HB_LIBS+=" -lfaac" -fi - if test "x$use_mp4v2" = "xyes" ; then HB_LIBS+=" -lmp4v2" fi diff --git a/gtk/module.defs b/gtk/module.defs index 33a5fd115..c23d74fc9 100644 --- a/gtk/module.defs +++ b/gtk/module.defs @@ -33,10 +33,6 @@ ifeq (1,$(FEATURE.fdk_aac)) GTK.CONFIGURE.extra += --enable-fdk-aac endif -ifeq (1,$(FEATURE.faac)) - GTK.CONFIGURE.extra += --enable-faac -endif - ifeq (1,$(FEATURE.mp4v2)) GTK.CONFIGURE.extra += --enable-mp4v2 endif diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index 24742f51d..1ab4987be 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -125,7 +125,7 @@ ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec, gint f if ( mux & HB_MUX_MASK_MKV ) fallback = HB_ACODEC_LAME; else - fallback = HB_ACODEC_FAAC; + fallback = HB_ACODEC_FFAAC; break; } } @@ -183,7 +183,7 @@ int ghb_select_fallback(GValue *settings, int acodec) return HB_ACODEC_LAME; case HB_ACODEC_AAC_PASS: - return HB_ACODEC_FAAC; + return HB_ACODEC_FFAAC; case HB_ACODEC_AC3_PASS: return HB_ACODEC_AC3; diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index c7b07481d..057625375 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3369,7 +3369,7 @@ ghb_audio_can_passthru(gint acodec) gint ghb_get_default_acodec() { - return HB_ACODEC_FAAC; + return HB_ACODEC_FFAAC; } void @@ -4128,7 +4128,7 @@ ghb_validate_audio(GValue *settings) } else { - codec = HB_ACODEC_FAAC; + codec = HB_ACODEC_FFAAC; } const char *name = hb_audio_encoder_get_short_name(codec); ghb_settings_set_string(asettings, "AudioEncoder", name); @@ -4142,7 +4142,7 @@ ghb_validate_audio(GValue *settings) if (codec == HB_ACODEC_VORBIS) { a_unsup = "Vorbis"; - codec = HB_ACODEC_FAAC; + codec = HB_ACODEC_FFAAC; } } if (a_unsup) diff --git a/gtk/src/standard_presets.xml b/gtk/src/standard_presets.xml index 6fe8cb396..0d15877e3 100644 --- a/gtk/src/standard_presets.xml +++ b/gtk/src/standard_presets.xml @@ -24,7 +24,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -173,7 +173,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -306,7 +306,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -439,7 +439,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -572,7 +572,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -721,7 +721,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -870,7 +870,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -1019,7 +1019,7 @@ <key>AudioBitrate</key> <string>128</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -1152,7 +1152,7 @@ <key>AudioBitrate</key> <string>128</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -1285,7 +1285,7 @@ <key>AudioBitrate</key> <string>128</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -1433,7 +1433,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> @@ -1566,7 +1566,7 @@ <key>AudioBitrate</key> <string>160</string> <key>AudioEncoder</key> - <string>AAC (faac)</string> + <string>AAC (avcodec)</string> <key>AudioMixdown</key> <string>Dolby Pro Logic II</string> <key>AudioSamplerate</key> diff --git a/libhb/common.c b/libhb/common.c index b3291c2b2..34bc5a047 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -244,6 +244,7 @@ hb_encoder_internal_t hb_audio_encoders[] = { // legacy encoders, back to HB 0.9.4 whenever possible (disabled) { { "", "dts", NULL, HB_ACODEC_DCA_PASS, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_DTS_PASS, }, + { { "AAC (faac)", "faac", NULL, 0, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_AAC, }, { { "AAC (ffmpeg)", "ffaac", NULL, HB_ACODEC_FFAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_AAC, }, { { "AC3 (ffmpeg)", "ffac3", NULL, HB_ACODEC_AC3, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_AC3, }, { { "MP3 (lame)", "lame", NULL, HB_ACODEC_LAME, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_ACODEC_MP3, }, @@ -253,7 +254,6 @@ hb_encoder_internal_t hb_audio_encoders[] = // actual encoders { { "AAC (CoreAudio)", "ca_aac", "AAC (Apple AudioToolbox)", HB_ACODEC_CA_AAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_ACODEC_AAC, }, { { "HE-AAC (CoreAudio)", "ca_haac", "HE-AAC (Apple AudioToolbox)", HB_ACODEC_CA_HAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_ACODEC_AAC_HE, }, - { { "AAC (faac)", "faac", "AAC (libfaac)", HB_ACODEC_FAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_ACODEC_AAC, }, { { "AAC (avcodec)", "av_aac", "AAC (libavcodec)", HB_ACODEC_FFAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_ACODEC_AAC, }, { { "AAC (FDK)", "fdk_aac", "AAC (libfdk_aac)", HB_ACODEC_FDK_AAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_ACODEC_AAC, }, { { "HE-AAC (FDK)", "fdk_haac", "HE-AAC (libfdk_aac)", HB_ACODEC_FDK_HAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_ACODEC_AAC_HE, }, @@ -285,11 +285,6 @@ static int hb_audio_encoder_is_enabled(int encoder) return 1; #endif -#ifdef USE_FAAC - case HB_ACODEC_FAAC: - return 1; -#endif - #ifdef USE_LIBAV_AAC case HB_ACODEC_FFAAC: return avcodec_find_encoder_by_name("aac") != NULL; @@ -862,21 +857,6 @@ fail: * Encoder 1.0 channel 2.0 channels 5.1 channels 6.1 channels 7.1 channels * -------------------------------------------------------------------------------------- * - * faac - * ---- - * supported samplerates: 8 - 48 kHz - * libfaac/util.c defines the bitrate limits: - * MinBitrate() -> 8000 bps (per channel, incl. LFE). - * MaxBitrate() -> (6144 * samplerate / 1024) bps (per channel, incl. LFE). - * But output bitrates don't go as high as the theoretical maximums: - * 12 kHz 43 (72) 87 (144) 260 (432) 303 (504) 342 (576) - * 24 kHz 87 (144) 174 (288) 514 (864) 595 (1008) 669 (1152) - * 48 kHz 174 (288) 347 (576) 970 (1728) 1138 (2016) 1287 (2304) - * Also, faac isn't a great encoder, so you don't want to allow too low a bitrate. - * Limits: minimum of 32 Kbps per channel - * maximum of 192 Kbps per channel at 32-48 kHz, adjusted for sr_shift - * - * * ffaac * ----- * supported samplerates: 8 - 48 kHz @@ -1061,11 +1041,6 @@ void hb_audio_bitrate_get_limits(uint32_t codec, int samplerate, int mixdown, (samplerate >= 22050))); break; - case HB_ACODEC_FAAC: - *low = (nchannels + lfe_count) * 32; - *high = (nchannels + lfe_count) * (192 >> sr_shift); - break; - case HB_ACODEC_FFAAC: *low = ((nchannels + lfe_count) * 32); *high = ((nchannels + lfe_count) * @@ -1500,7 +1475,6 @@ int hb_mixdown_has_codec_support(int mixdown, uint32_t codec) case HB_ACODEC_LAME: return (mixdown <= HB_AMIXDOWN_DOLBYPLII); - case HB_ACODEC_FAAC: case HB_ACODEC_CA_AAC: case HB_ACODEC_CA_HAAC: return ((mixdown <= HB_AMIXDOWN_5POINT1) || @@ -1894,8 +1868,7 @@ int hb_audio_encoder_get_default(int muxer) // Lame is better than our low-end AAC encoders // if the container is MKV, use the former // AAC is still used when the container is MP4 (for better compatibility) - if ((codec == HB_ACODEC_FAAC || - codec == HB_ACODEC_FFAAC) && (muxer & HB_MUX_MASK_MKV) == muxer) + if (codec == HB_ACODEC_FFAAC && (muxer & HB_MUX_MASK_MKV) == muxer) { return HB_ACODEC_LAME; } diff --git a/libhb/common.h b/libhb/common.h index f709f7570..bc790e2d9 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -597,7 +597,6 @@ struct hb_job_s /* Audio starts here */ /* Audio Codecs: Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs when changing these consts */ #define HB_ACODEC_MASK 0x00FFFF00 -#define HB_ACODEC_FAAC 0x00000100 #define HB_ACODEC_LAME 0x00000200 #define HB_ACODEC_VORBIS 0x00000400 #define HB_ACODEC_AC3 0x00000800 @@ -1088,7 +1087,6 @@ extern hb_work_object_t hb_encx265; extern hb_work_object_t hb_decavcodeca; extern hb_work_object_t hb_decavcodecv; extern hb_work_object_t hb_declpcm; -extern hb_work_object_t hb_encfaac; extern hb_work_object_t hb_enclame; extern hb_work_object_t hb_encvorbis; extern hb_work_object_t hb_muxer; diff --git a/libhb/encfaac.c b/libhb/encfaac.c deleted file mode 100644 index 4060c778a..000000000 --- a/libhb/encfaac.c +++ /dev/null @@ -1,293 +0,0 @@ -/* encfaac.c - - Copyright (c) 2003-2014 HandBrake Team - This file is part of the HandBrake source code - Homepage: <http://handbrake.fr/>. - It may be used under the terms of the GNU General Public License v2. - For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html - */ - -#ifdef USE_FAAC -#include "hb.h" -#include "audio_remap.h" - -#include "faac.h" - -struct hb_work_private_s -{ - hb_job_t * job; - - faacEncHandle * faac; - unsigned long input_samples; - unsigned long output_bytes; - uint8_t * buf; - uint8_t * obuf; - hb_list_t * list; - double pts; - double framedur; - int out_discrete_channels; -}; - -int encfaacInit( hb_work_object_t *, hb_job_t * ); -int encfaacWork( hb_work_object_t *, hb_buffer_t **, hb_buffer_t ** ); -void encfaacClose( hb_work_object_t * ); - -hb_work_object_t hb_encfaac = -{ - WORK_ENCFAAC, - "AAC encoder (libfaac)", - encfaacInit, - encfaacWork, - encfaacClose -}; - -/*********************************************************************** - * hb_work_encfaac_init - *********************************************************************** - * - **********************************************************************/ -int encfaacInit( hb_work_object_t * w, hb_job_t * job ) -{ - hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) ); - hb_audio_t * audio = w->audio; - faacEncConfigurationPtr cfg; - uint8_t * bytes; - unsigned long length; - - w->private_data = pv; - - pv->job = job; - - /* pass the number of channels used into the private work data */ - pv->out_discrete_channels = hb_mixdown_get_discrete_channel_count(audio->config.out.mixdown); - - pv->faac = faacEncOpen( audio->config.out.samplerate, pv->out_discrete_channels, - &pv->input_samples, &pv->output_bytes ); - pv->buf = malloc( pv->input_samples * sizeof( float ) ); - pv->obuf = malloc( pv->output_bytes ); - pv->framedur = 90000.0 * pv->input_samples / - ( audio->config.out.samplerate * pv->out_discrete_channels ); - audio->config.out.samples_per_frame = pv->input_samples / pv->out_discrete_channels; - - cfg = faacEncGetCurrentConfiguration( pv->faac ); - cfg->mpegVersion = MPEG4; - cfg->aacObjectType = LOW; - cfg->allowMidside = 1; - - /* channel configuration & remapping */ - uint64_t layout = hb_ff_mixdown_xlat(audio->config.out.mixdown, NULL); - hb_audio_remap_build_table(&hb_aac_chan_map, audio->config.in.channel_map, - layout, cfg->channel_map); - - switch (audio->config.out.mixdown) - { - case HB_AMIXDOWN_7POINT1: - cfg->channelConfiguration = 0; - cfg->numFrontChannels = 3; - cfg->numSideChannels = 2; - cfg->numBackChannels = 2; - cfg->numLFEChannels = 1; - break; - - case HB_AMIXDOWN_6POINT1: - cfg->channelConfiguration = 0; - cfg->numFrontChannels = 3; - cfg->numSideChannels = 0; - cfg->numBackChannels = 3; - cfg->numLFEChannels = 1; - break; - - case HB_AMIXDOWN_5_2_LFE: - cfg->channelConfiguration = 7; - break; - - default: - cfg->channelConfiguration = - hb_mixdown_get_discrete_channel_count(audio->config.out.mixdown); - break; - } - - cfg->useTns = 0; - cfg->bitRate = audio->config.out.bitrate * 1000 / pv->out_discrete_channels; /* Per channel */ - cfg->bandWidth = 0; - cfg->outputFormat = 0; - cfg->inputFormat = FAAC_INPUT_FLOAT; - - if( !faacEncSetConfiguration( pv->faac, cfg ) ) - { - hb_log( "faacEncSetConfiguration failed" ); - *job->done_error = HB_ERROR_INIT; - *job->die = 1; - return 0; - } - - if( faacEncGetDecoderSpecificInfo( pv->faac, &bytes, &length ) < 0 ) - { - hb_log( "faacEncGetDecoderSpecificInfo failed" ); - *job->done_error = HB_ERROR_INIT; - *job->die = 1; - return 0; - } - memcpy( w->config->extradata.bytes, bytes, length ); - w->config->extradata.length = length; - free( bytes ); - - pv->list = hb_list_init(); - - return 0; -} - -/*********************************************************************** - * Close - *********************************************************************** - * - **********************************************************************/ -void encfaacClose( hb_work_object_t * w ) -{ - hb_work_private_t * pv = w->private_data; - if ( pv ) - { - if ( pv->faac ) - { - faacEncClose( pv->faac ); - pv->faac = NULL; - } - if ( pv->buf ) - { - free( pv->buf ); - pv->buf = NULL; - } - if ( pv->obuf ) - { - free( pv->obuf ); - pv->obuf = NULL; - } - if ( pv->list ) - hb_list_empty( &pv->list ); - - free( pv ); - w->private_data = NULL; - } -} - -/*********************************************************************** - * Encode - *********************************************************************** - * - **********************************************************************/ -static hb_buffer_t * Encode( hb_work_object_t * w ) -{ - hb_work_private_t * pv = w->private_data; - - if( hb_list_bytes( pv->list ) < pv->input_samples * sizeof( float ) ) - { - /* Need more data */ - return NULL; - } - - uint64_t pts, pos; - hb_list_getbytes( pv->list, pv->buf, pv->input_samples * sizeof( float ), - &pts, &pos ); - - int i; - float *fltBuf = (float*)pv->buf; - for ( i = 0; i < pv->input_samples; i++ ) - fltBuf[i] *= 32768.0; - - int size = faacEncEncode( pv->faac, (int32_t *)pv->buf, pv->input_samples, - pv->obuf, pv->output_bytes ); - - // AAC needs four frames before it can start encoding so we'll get nothing - // on the first three calls to the encoder. - if ( size > 0 ) - { - hb_buffer_t * buf = hb_buffer_init( size ); - memcpy( buf->data, pv->obuf, size ); - buf->size = size; - buf->s.start = pv->pts; - buf->s.duration = pv->framedur; - buf->s.stop = buf->s.start + buf->s.duration; - buf->s.type = AUDIO_BUF; - buf->s.frametype = HB_FRAME_AUDIO; - pv->pts += pv->framedur; - return buf; - } - return NULL; -} - -static hb_buffer_t *Flush( hb_work_object_t *w, hb_buffer_t *bufin ) -{ - hb_work_private_t *pv = w->private_data; - - // pad whatever data we have out to four input frames. - int nbytes = hb_list_bytes( pv->list ); - int pad = pv->input_samples * sizeof(float) * 4 - nbytes; - if ( pad > 0 ) - { - hb_buffer_t *tmp = hb_buffer_init( pad ); - memset( tmp->data, 0, pad ); - hb_list_add( pv->list, tmp ); - } - - // There are up to three frames buffered in the encoder plus one - // in our list buffer so four calls to Encode should get them all. - hb_buffer_t *bufout = NULL, *buf = NULL; - while ( hb_list_bytes( pv->list ) >= pv->input_samples * sizeof(float) ) - { - hb_buffer_t *b = Encode( w ); - if ( b ) - { - if ( bufout == NULL ) - { - bufout = b; - } - else - { - buf->next = b; - } - buf = b; - } - } - // add the eof marker to the end of our buf chain - if ( buf ) - buf->next = bufin; - else - bufout = bufin; - return bufout; -} - -/*********************************************************************** - * Work - *********************************************************************** - * - **********************************************************************/ -int encfaacWork( hb_work_object_t * w, hb_buffer_t ** buf_in, - hb_buffer_t ** buf_out ) -{ - hb_work_private_t * pv = w->private_data; - hb_buffer_t * buf; - - if ( (*buf_in)->size <= 0 ) - { - // EOF on input. Finish encoding what we have buffered then send - // it & the eof downstream. - - *buf_out = Flush( w, *buf_in ); - *buf_in = NULL; - return HB_WORK_DONE; - } - - hb_list_add( pv->list, *buf_in ); - *buf_in = NULL; - - *buf_out = buf = Encode( w ); - - while( buf ) - { - buf->next = Encode( w ); - buf = buf->next; - } - - return HB_WORK_OK; -} -#endif // USE_FAAC diff --git a/libhb/hb.c b/libhb/hb.c index b6a939e3a..303781cc5 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -1651,9 +1651,6 @@ int hb_global_init() hb_register(&hb_encca_aac); hb_register(&hb_encca_haac); #endif -#ifdef USE_FAAC - hb_register(&hb_encfaac); -#endif hb_register(&hb_enclame); hb_register(&hb_enctheora); hb_register(&hb_encvorbis); diff --git a/libhb/internal.h b/libhb/internal.h index fa3b36f5f..5255c6fac 100644 --- a/libhb/internal.h +++ b/libhb/internal.h @@ -415,7 +415,6 @@ enum WORK_DECAVCODEC, WORK_DECAVCODECV, WORK_DECLPCM, - WORK_ENCFAAC, WORK_ENCLAME, WORK_ENCVORBIS, WORK_ENC_CA_AAC, diff --git a/libhb/module.defs b/libhb/module.defs index 02279befd..73a3b6999 100644 --- a/libhb/module.defs +++ b/libhb/module.defs @@ -1,4 +1,4 @@ -__deps__ := A52DEC BZIP2 FAAC FFMPEG FONTCONFIG FREETYPE LAME LIBASS LIBDCA \ +__deps__ := A52DEC BZIP2 FFMPEG FONTCONFIG FREETYPE LAME LIBASS LIBDCA \ LIBDVDREAD LIBDVDNAV LIBICONV LIBMKV LIBOGG LIBSAMPLERATE LIBTHEORA LIBVORBIS LIBXML2 \ MP4V2 PTHREADW32 X264 X265 ZLIB LIBBLURAY FDKAAC LIBMFX @@ -42,9 +42,6 @@ endif ifeq (1,$(FEATURE.libav_aac)) LIBHB.GCC.D += USE_LIBAV_AAC endif -ifeq (1,$(FEATURE.faac)) -LIBHB.GCC.D += USE_FAAC -endif ifeq (1,$(FEATURE.mp4v2)) LIBHB.GCC.D += USE_MP4V2 endif @@ -126,10 +123,6 @@ ifeq (1,$(FEATURE.fdk_aac)) LIBHB.dll.libs += $(CONTRIB.build/)lib/libfdk-aac.a endif -ifeq (1,$(FEATURE.faac)) -LIBHB.dll.libs += $(CONTRIB.build/)lib/libfaac.a -endif - ifeq (1,$(FEATURE.qsv)) LIBHB.dll.libs += $(CONTRIB.build/)lib/libmfx.a endif diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c index 3e9d9b9e9..a5ca6b5fa 100644 --- a/libhb/muxavformat.c +++ b/libhb/muxavformat.c @@ -490,7 +490,6 @@ static int avformatInit( hb_mux_object_t * m ) audio->priv.config.extradata.length); } break; - case HB_ACODEC_FAAC: case HB_ACODEC_FFAAC: case HB_ACODEC_CA_AAC: case HB_ACODEC_CA_HAAC: diff --git a/libhb/muxmkv.c b/libhb/muxmkv.c index 6c531a755..0c2a28490 100644 --- a/libhb/muxmkv.c +++ b/libhb/muxmkv.c @@ -302,7 +302,6 @@ static int MKVInit( hb_mux_object_t * m ) } track->codecID = MK_ACODEC_FLAC; break; - case HB_ACODEC_FAAC: case HB_ACODEC_FFAAC: case HB_ACODEC_CA_AAC: case HB_ACODEC_CA_HAAC: diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c index dfb4ed58a..946277574 100644 --- a/libhb/muxmp4.c +++ b/libhb/muxmp4.c @@ -439,7 +439,6 @@ static int MP4Init( hb_mux_object_t * m ) } } break; - case HB_ACODEC_FAAC: case HB_ACODEC_FFAAC: case HB_ACODEC_CA_AAC: case HB_ACODEC_CA_HAAC: @@ -456,7 +455,6 @@ static int MP4Init( hb_mux_object_t * m ) switch ( audio->config.out.codec & HB_ACODEC_MASK ) { - case HB_ACODEC_FAAC: case HB_ACODEC_FFAAC: case HB_ACODEC_CA_AAC: case HB_ACODEC_CA_HAAC: diff --git a/libhb/work.c b/libhb/work.c index 2192f593b..c8dcb0c0b 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -139,7 +139,6 @@ hb_work_object_t* hb_codec_encoder(int codec) switch (codec) { case HB_ACODEC_AC3: return hb_get_work(WORK_ENCAVCODEC_AUDIO); - case HB_ACODEC_FAAC: return hb_get_work(WORK_ENCFAAC); case HB_ACODEC_LAME: return hb_get_work(WORK_ENCLAME); case HB_ACODEC_VORBIS: return hb_get_work(WORK_ENCVORBIS); case HB_ACODEC_CA_AAC: return hb_get_work(WORK_ENC_CA_AAC); diff --git a/macosx/HBAudioController.m b/macosx/HBAudioController.m index 80ad96c31..d65c01a65 100644 --- a/macosx/HBAudioController.m +++ b/macosx/HBAudioController.m @@ -396,7 +396,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification"; [NSArray arrayWithObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: 1], @"AudioTrack", - @"AAC (faac)", @"AudioEncoder", + @"AAC (CoreAudio)", @"AudioEncoder", @"Dolby Pro Logic II", @"AudioMixdown", @"Auto", @"AudioSamplerate", @"160", @"AudioBitrate", diff --git a/macosx/HBPresets.m b/macosx/HBPresets.m index 3121c29c5..e47b7fd77 100644 --- a/macosx/HBPresets.m +++ b/macosx/HBPresets.m @@ -186,7 +186,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; @@ -302,7 +302,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; @@ -407,7 +407,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; @@ -512,7 +512,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; @@ -618,7 +618,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; @@ -734,7 +734,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; @@ -850,7 +850,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; @@ -966,7 +966,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"128" forKey:@"AudioBitrate"]; @@ -1071,7 +1071,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"128" forKey:@"AudioBitrate"]; @@ -1176,7 +1176,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"128" forKey:@"AudioBitrate"]; @@ -1281,7 +1281,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; @@ -1386,7 +1386,7 @@ /* Track 1 */ NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; - [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"AAC (avcodec)" forKey:@"AudioEncoder"]; [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; [audioTrack1Array setObject:@"160" forKey:@"AudioBitrate"]; diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index 7c80f16bd..621a2559e 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -283,7 +283,6 @@ 277EFE8D17ED5628001D4A6A /* supplemental.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = supplemental.xcconfig; sourceTree = "<group>"; }; 277EFE8F17ED7296001D4A6A /* libmp4v2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmp4v2.a; path = external/contrib/lib/libmp4v2.a; sourceTree = BUILT_PRODUCTS_DIR; }; 277EFE9017ED72A1001D4A6A /* libmkv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmkv.a; path = external/contrib/lib/libmkv.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 277EFE9117ED7749001D4A6A /* libfaac.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfaac.a; path = external/contrib/lib/libfaac.a; sourceTree = BUILT_PRODUCTS_DIR; }; 277EFE9217ED799E001D4A6A /* libfdk-aac.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfdk-aac.a"; path = "../../../../Users/mike/Library/Developer/Xcode/DerivedData/HandBrake-anpxrfhxsejsxehiwuiaexjoygra/Build/Products/debug/external/contrib/lib/libfdk-aac.a"; sourceTree = "<group>"; }; 27D6C72414B1019100B785E4 /* libhandbrake.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libhandbrake.a; path = external/libhb/libhandbrake.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27D6C72814B102DA00B785E4 /* libass.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libass.a; path = external/contrib/lib/libass.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -688,7 +687,6 @@ 277EFE8E17ED71A2001D4A6A /* Static Libraries (optional) */ = { isa = PBXGroup; children = ( - 277EFE9117ED7749001D4A6A /* libfaac.a */, 277EFE9217ED799E001D4A6A /* libfdk-aac.a */, 277EFE9017ED72A1001D4A6A /* libmkv.a */, 277EFE8F17ED7296001D4A6A /* libmp4v2.a */, diff --git a/make/configure.py b/make/configure.py index c3d4ea0ba..36c7cb31d 100644 --- a/make/configure.py +++ b/make/configure.py @@ -1218,10 +1218,6 @@ def createCLI(): grp.add_option( '--enable-libav-aac', dest="enable_libav_aac", default=not host.match( '*-*-darwin*' ), action='store_true', help=h ) grp.add_option( '--disable-libav-aac', dest="enable_libav_aac", action='store_false' ) - h = IfHost( 'enable use of faac encoder', '*-*-*', none=optparse.SUPPRESS_HELP ).value - grp.add_option( '--enable-faac', dest="enable_faac", default=False, action='store_true', help=h ) - grp.add_option( '--disable-faac', dest="enable_faac", action='store_false' ) - h = IfHost( 'enable use of mp4v2 muxer', '*-*-*', none=optparse.SUPPRESS_HELP ).value grp.add_option( '--enable-mp4v2', dest="enable_mp4v2", default=True, action='store_true', help=h ) grp.add_option( '--disable-mp4v2', dest="enable_mp4v2", action='store_false' ) @@ -1683,7 +1679,6 @@ int main () doc.add( 'FEATURE.gst', int( not options.disable_gst )) doc.add( 'FEATURE.fdk_aac', int( options.enable_fdk_aac )) doc.add( 'FEATURE.libav_aac', int( options.enable_libav_aac )) - doc.add( 'FEATURE.faac', int( options.enable_faac )) doc.add( 'FEATURE.mp4v2', int( options.enable_mp4v2 )) doc.add( 'FEATURE.libmkv', int( options.enable_libmkv )) doc.add( 'FEATURE.avformat', int( options.enable_avformat )) diff --git a/make/include/main.defs b/make/include/main.defs index c3dcfd8f6..d3276067c 100644 --- a/make/include/main.defs +++ b/make/include/main.defs @@ -45,10 +45,6 @@ ifeq (1,$(FEATURE.fdk_aac)) MODULES += contrib/fdk-aac endif -ifeq (1,$(FEATURE.faac)) - MODULES += contrib/faac -endif - ifeq (1,$(FEATURE.mp4v2)) MODULES += contrib/mp4v2 endif diff --git a/scripts/manicure.rb b/scripts/manicure.rb index 5cbc9d906..a6fbaf571 100755 --- a/scripts/manicure.rb +++ b/scripts/manicure.rb @@ -349,9 +349,7 @@ class Display audioEncoders << "copy:dtshd" when /AAC Pass/ audioEncoders << "copy:aac" - when "AAC (faac)" - audioEncoders << "faac" - when "AAC (ffmpeg)", "AAC (avcodec)" + when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)" audioEncoders << "av_aac" when "AAC (FDK)" audioEncoders << "fdk_aac" @@ -468,9 +466,7 @@ class Display case hash["AudioEncoderFallback"] when /AC3/ audioEncoderFallback << "ac3" - when "AAC (faac)" - audioEncoderFallback << "faac" - when "AAC (ffmpeg)", "AAC (avcodec)" + when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)" audioEncoderFallback << "av_aac" when "AAC (FDK)" audioEncoderFallback << "fdk_aac" @@ -757,9 +753,7 @@ class Display audioEncoders << "copy:dtshd" when /AAC Pass/ audioEncoders << "copy:aac" - when "AAC (faac)" - audioEncoders << "faac" - when "AAC (ffmpeg)", "AAC (avcodec)" + when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)" audioEncoders << "av_aac" when "AAC (FDK)" audioEncoders << "fdk_aac" @@ -876,9 +870,7 @@ class Display case hash["AudioEncoderFallback"] when /AC3/ audioEncoderFallback << "ac3" - when "AAC (faac)" - audioEncoderFallback << "faac" - when "AAC (ffmpeg)", "AAC (avcodec)" + when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)" audioEncoderFallback << "av_aac" when "AAC (FDK)" audioEncoderFallback << "fdk_aac" @@ -1171,9 +1163,7 @@ class Display audioEncoders << "copy:dtshd" when /AAC Pass/ audioEncoders << "copy:aac" - when "AAC (faac)" - audioEncoders << "faac" - when "AAC (ffmpeg)", "AAC (avcodec)" + when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)" audioEncoders << "av_aac" when "AAC (FDK)" audioEncoders << "fdk_aac" @@ -1308,9 +1298,7 @@ class Display case hash["AudioEncoderFallback"] when /AC3/ audioEncoderFallback << "ac3" - when "AAC (faac)" - audioEncoderFallback << "faac" - when "AAC (ffmpeg)", "AAC (avcodec)" + when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)" audioEncoderFallback << "av_aac" when "AAC (FDK)" audioEncoderFallback << "fdk_aac" @@ -1627,9 +1615,7 @@ class Display audioEncoders << "copy:dtshd" when /AAC Pass/ audioEncoders << "copy:aac" - when "AAC (faac)" - audioEncoders << "faac" - when "AAC (ffmpeg)", "AAC (avcodec)" + when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)" audioEncoders << "av_aac" when "AAC (FDK)" audioEncoders << "fdk_aac" @@ -1746,9 +1732,7 @@ class Display case hash["AudioEncoderFallback"] when /AC3/ audioEncoderFallback << "ac3" - when "AAC (faac)" - audioEncoderFallback << "faac" - when "AAC (ffmpeg)", "AAC (avcodec)" + when "AAC (ffmpeg)", "AAC (avcodec)", "AAC (faac)" audioEncoderFallback << "av_aac" when "AAC (FDK)" audioEncoderFallback << "fdk_aac" diff --git a/test/test.c b/test/test.c index 0de6108c1..3a36f1f21 100644 --- a/test/test.c +++ b/test/test.c @@ -794,7 +794,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac,copy:ac3"); + acodecs = strdup("ffaac,copy:ac3"); } if( !abitrates ) { @@ -864,7 +864,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac"); + acodecs = strdup("ffaac"); } if( !abitrates ) { @@ -930,7 +930,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac"); + acodecs = strdup("ffaac"); } if( !abitrates ) { @@ -1000,7 +1000,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac"); + acodecs = strdup("ffaac"); } if( !abitrates ) { @@ -1070,7 +1070,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac,copy:ac3"); + acodecs = strdup("ffaac,copy:ac3"); } if( !abitrates ) { @@ -1144,7 +1144,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac,copy:ac3"); + acodecs = strdup("ffaac,copy:ac3"); } if( !abitrates ) { @@ -1214,7 +1214,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac,copy:ac3"); + acodecs = strdup("ffaac,copy:ac3"); } if( !abitrates ) { @@ -1285,7 +1285,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac"); + acodecs = strdup("ffaac"); } if( !abitrates ) { @@ -1353,7 +1353,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac"); + acodecs = strdup("ffaac"); } if( !abitrates ) { @@ -1421,7 +1421,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac"); + acodecs = strdup("ffaac"); } if( !abitrates ) { @@ -1487,7 +1487,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac"); + acodecs = strdup("ffaac"); } if( !abitrates ) { @@ -1553,7 +1553,7 @@ static int HandleEvents( hb_handle_t * h ) } if( !acodecs ) { - acodecs = strdup("faac,copy:ac3"); + acodecs = strdup("ffaac,copy:ac3"); } if( !abitrates ) { @@ -3552,23 +3552,22 @@ static void ShowPresets() fprintf( stderr, "%s - %s - %s\n", HB_PROJECT_TITLE, HB_PROJECT_BUILD_TITLE, HB_PROJECT_URL_WEBSITE ); printf("\n< Devices\n"); - printf("\n + Universal: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 -m --x264-preset fast --h264-profile baseline --h264-level 3.0\n"); - printf("\n + iPod: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -I -X 320 -Y 240 --modulus 2 -m --x264-preset medium --h264-profile baseline --h264-level 1.3\n"); - printf("\n + iPhone & iPod touch: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 960 -Y 640 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n"); - printf("\n + iPad: -e x264 -q 20.0 -r 30 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n"); - printf("\n + AppleTV: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 960 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1 -x qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500\n"); - printf("\n + AppleTV 2: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n"); - printf("\n + AppleTV 3: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1920 -Y 1080 --decomb=fast --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.0\n"); - printf("\n + Android: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.0\n"); - printf("\n + Android Tablet: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.1\n"); - printf("\n + Windows Phone 8: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 1280 -Y 720 --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.1\n"); + printf("\n + Universal: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 -m --x264-preset fast --h264-profile baseline --h264-level 3.0\n"); + printf("\n + iPod: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -I -X 320 -Y 240 --modulus 2 -m --x264-preset medium --h264-profile baseline --h264-level 1.3\n"); + printf("\n + iPhone & iPod touch: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 960 -Y 640 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n"); + printf("\n + iPad: -e x264 -q 20.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n"); + printf("\n + AppleTV: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 960 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1 -x qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500\n"); + printf("\n + AppleTV 2: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n"); + printf("\n + AppleTV 3: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1920 -Y 1080 --decomb=fast --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.0\n"); + printf("\n + Android: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.0\n"); + printf("\n + Android Tablet: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.1\n"); + printf("\n + Windows Phone 8: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 1280 -Y 720 --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.1\n"); printf("\n>\n"); printf("\n< Regular\n"); - printf("\n + Normal: -e x264 -q 20.0 -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 --loose-anamorphic --modulus 2 -m --x264-preset veryfast --h264-profile main --h264-level 4.0\n"); - printf("\n + High Profile: -e x264 -q 20.0 -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 --decomb --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.1\n"); + printf("\n + Normal: -e x264 -q 20.0 -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 --loose-anamorphic --modulus 2 -m --x264-preset veryfast --h264-profile main --h264-level 4.0\n"); + printf("\n + High Profile: -e x264 -q 20.0 -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 --decomb --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.1\n"); printf("\n>\n"); } - static char * hb_strndup( char * str, int len ) { char * res; |