]> iEval git - fdkaac.git/commitdiff
New upstream version 1.0.0 upstream upstream/1.0.0
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 21 Apr 2020 20:36:41 +0000 (23:36 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 21 Apr 2020 20:36:41 +0000 (23:36 +0300)
ChangeLog
MSVC/fdk-aac.vcxproj
MSVC/fdk-aac.vcxproj.filters
MSVC/fdkaac.vcxproj
Makefile.am
configure.ac
src/compat_posix.c
src/main.c
version.h

index 4455a7ef1f14bc53884f36142cd28ea8f85e7202..51815a94270c9172718e52712d214492cb75cbf1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,44 @@
+2016-08-26  nu774 <honeycomb77@gmail.com>
+
+  * update ChangeLog [HEAD -> master]
+
+  * bump [origin/master]
+
+  * Ticket #23: quit supporting MPEG-2 AOT
+
+2016-08-25  nu774 <honeycomb77@gmail.com>
+
+  * fix libfdkaac encoder version check for SBR_RATIO availability
+
+  * Use our SBR signaling implementation on old libfdkaac
+
+2015-10-10  nu774 <honeycomb77@gmail.com>
+
+  * improve MSVC project
+
+2015-09-21  nu774 <honeycomb77@gmail.com>
+
+  * fix indents
+
+  * update compat layer, mainly for MSVC14 issue
+
+2015-07-22  nu774 <honeycomb77@gmail.com>
+
+  * add platformtoolset in vcxproj
+
+  * fix build issue on MSVC14
+
+2015-06-12  nu774 <honeycomb77@gmail.com>
+
+  * remove an unused variable decl
+
+  * remove an unused variable decl
+
+  * m4af: move internal struct m4af_itmf_entry_t from header
+
 2015-02-14  nu774 <honeycomb77@gmail.com>
 
-  * update ChangeLog [HEAD]
+  * update ChangeLog
 
   * bump version [v0.6.2]
 
@@ -10,9 +48,9 @@
 
 2014-09-13  nu774 <honeycomb77@gmail.com>
 
-  * update ChangeLog [origin/master]
+  * update ChangeLog
 
-  * bump version
+  * bump version [v0.6.1]
 
 2014-09-12  nu774 <honeycomb77@gmail.com>
 
index 2035c149ad5af3442a776e9443ae1b509c40b085..ca801894cb262646b271c551899a9105f7bc7ee9 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <RootNamespace>fdk-aac</RootNamespace>
   </PropertyGroup>
   <PropertyGroup>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140_xp</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120_xp</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath11)' != ''">v110_xp</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == ''">v100</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '15.0'">v141_xp</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '14.0'">v140_xp</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '12.0'">v120_xp</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '11.0'">v110_xp</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup>
+    <IntDir>fdk-aac\$(Platform)\$(Configuration)</IntDir>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Label="Configuration">
@@ -50,7 +53,7 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <PreprocessorDefinitions>WIN32;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>../fdk-aac/libaacenc/include;../fdk-aac/libFDK/include;../fdk-aac/libMpegTPEnc/include;../fdk-aac/libPCMutils/include;../fdk-aac/libSBRenc/include;../fdk-aac/libSYS/include</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../fdk-aac/libaacenc/include;../fdk-aac/libFDK/include;../fdk-aac/libMpegTPEnc/include;../fdk-aac/libPCMutils/include;../fdk-aac/libSACenc/include;../fdk-aac/libSBRenc/include;../fdk-aac/libSYS/include</AdditionalIncludeDirectories>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
@@ -71,7 +74,6 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\fdk-aac\libAACenc\src\aacenc.cpp" />
-    <ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_hcr.cpp" />
     <ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_lib.cpp" />
     <ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_pns.cpp" />
     <ClCompile Include="..\fdk-aac\libAACenc\src\aacEnc_ram.cpp" />
@@ -91,6 +93,7 @@
     <ClCompile Include="..\fdk-aac\libAACenc\src\line_pe.cpp" />
     <ClCompile Include="..\fdk-aac\libAACenc\src\metadata_compressor.cpp" />
     <ClCompile Include="..\fdk-aac\libAACenc\src\metadata_main.cpp" />
+    <ClCompile Include="..\fdk-aac\libAACenc\src\mps_main.cpp" />
     <ClCompile Include="..\fdk-aac\libAACenc\src\ms_stereo.cpp" />
     <ClCompile Include="..\fdk-aac\libAACenc\src\noisedet.cpp" />
     <ClCompile Include="..\fdk-aac\libAACenc\src\pnsparam.cpp" />
     <ClCompile Include="..\fdk-aac\libFDK\src\FDK_core.cpp" />
     <ClCompile Include="..\fdk-aac\libFDK\src\FDK_crc.cpp" />
     <ClCompile Include="..\fdk-aac\libFDK\src\FDK_hybrid.cpp" />
+    <ClCompile Include="..\fdk-aac\libFDK\src\FDK_lpc.cpp" />
+    <ClCompile Include="..\fdk-aac\libFDK\src\FDK_matrixCalloc.cpp" />
     <ClCompile Include="..\fdk-aac\libFDK\src\FDK_tools_rom.cpp" />
     <ClCompile Include="..\fdk-aac\libFDK\src\FDK_trigFcts.cpp" />
     <ClCompile Include="..\fdk-aac\libFDK\src\fft.cpp" />
     <ClCompile Include="..\fdk-aac\libMpegTPEnc\src\tpenc_asc.cpp" />
     <ClCompile Include="..\fdk-aac\libMpegTPEnc\src\tpenc_latm.cpp" />
     <ClCompile Include="..\fdk-aac\libMpegTPEnc\src\tpenc_lib.cpp" />
-    <ClCompile Include="..\fdk-aac\libPCMutils\src\pcmutils_lib.cpp" />
+    <ClCompile Include="..\fdk-aac\libPCMutils\src\pcm_utils.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_bitstream.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_delay.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_dmx_tdom_enh.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_filter.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_framewindowing.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_huff_tab.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_lib.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_nlc_enc.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_onsetdetect.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_paramextract.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_staticgain.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_tree.cpp" />
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_vectorfunctions.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\bit_sbr.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\code_env.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\env_bit.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\ps_main.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\resampler.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\sbrenc_freq_sca.cpp" />
+    <ClCompile Include="..\fdk-aac\libSBRenc\src\sbrenc_ram.cpp" />
+    <ClCompile Include="..\fdk-aac\libSBRenc\src\sbrenc_rom.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_encoder.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_misc.cpp" />
-    <ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_ram.cpp" />
-    <ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_rom.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\ton_corr.cpp" />
     <ClCompile Include="..\fdk-aac\libSBRenc\src\tran_det.cpp" />
-    <ClCompile Include="..\fdk-aac\libSYS\src\conv_string.cpp" />
     <ClCompile Include="..\fdk-aac\libSYS\src\genericStds.cpp" />
+    <ClCompile Include="..\fdk-aac\libSYS\src\syslib_channelMapDescr.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\fdk-aac\libAACenc\include\aacenc_lib.h" />
     <ClInclude Include="..\fdk-aac\libAACenc\src\aacenc.h" />
-    <ClInclude Include="..\fdk-aac\libAACenc\src\aacenc_hcr.h" />
     <ClInclude Include="..\fdk-aac\libAACenc\src\aacenc_pns.h" />
     <ClInclude Include="..\fdk-aac\libAACenc\src\aacEnc_ram.h" />
     <ClInclude Include="..\fdk-aac\libAACenc\src\aacEnc_rom.h" />
index 194d0b01fbc84eb9125e0477a471116420eadff2..0ebb5475b67ac671d549e6ee00a411da4d5cd25f 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
@@ -18,9 +18,6 @@
     <ClCompile Include="..\fdk-aac\libAACenc\src\aacenc.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_hcr.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_lib.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\fdk-aac\libMpegTPEnc\src\tpenc_lib.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\fdk-aac\libPCMutils\src\pcmutils_lib.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\fdk-aac\libSBRenc\src\bit_sbr.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_misc.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_ram.cpp">
+    <ClCompile Include="..\fdk-aac\libSBRenc\src\ton_corr.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSBRenc\src\tran_det.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_rom.cpp">
+    <ClCompile Include="..\fdk-aac\libSYS\src\genericStds.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\fdk-aac\libSBRenc\src\ton_corr.cpp">
+    <ClCompile Include="..\fdk-aac\libPCMutils\src\pcm_utils.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\fdk-aac\libSBRenc\src\tran_det.cpp">
+    <ClCompile Include="..\fdk-aac\libSBRenc\src\sbrenc_ram.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\fdk-aac\libSYS\src\conv_string.cpp">
+    <ClCompile Include="..\fdk-aac\libSBRenc\src\sbrenc_rom.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\fdk-aac\libSYS\src\genericStds.cpp">
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_bitstream.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_delay.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_dmx_tdom_enh.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_filter.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_framewindowing.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_huff_tab.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_lib.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_nlc_enc.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_onsetdetect.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_paramextract.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_staticgain.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_tree.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSACenc\src\sacenc_vectorfunctions.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libAACenc\src\mps_main.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libSYS\src\syslib_channelMapDescr.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libFDK\src\FDK_matrixCalloc.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\fdk-aac\libFDK\src\FDK_lpc.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
     <ClInclude Include="..\fdk-aac\libAACenc\src\aacenc.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\fdk-aac\libAACenc\src\aacenc_hcr.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\fdk-aac\libAACenc\src\aacenc_pns.h">
       <Filter>Header Files</Filter>
     </ClInclude>
index 0a59d914d92bd70f6309f3907e668602a57eb874..11b1cd65a539f005670c8f9c0e8d2fe29020298e 100644 (file)
     <RootNamespace>fdkaac</RootNamespace>
   </PropertyGroup>
   <PropertyGroup>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140_xp</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120_xp</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath11)' != ''">v110_xp</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == ''">v100</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '15.0'">v141_xp</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '14.0'">v140_xp</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '12.0'">v120_xp</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '11.0'">v110_xp</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Label="Configuration">
       <GenerateDebugInformation>true</GenerateDebugInformation>
     </Link>
     <PreBuildEvent>
-      <Command>copy ..\fdk-aac\libAACdec\include\aacdecoder_lib.h include\fdk-aac\ 
-copy ..\fdk-aac\libAACenc\include\aacenc_lib.h include\fdk-aac\ 
+      <Command>copy ..\fdk-aac\libAACdec\include\aacdecoder_lib.h include\fdk-aac\
+copy ..\fdk-aac\libAACenc\include\aacenc_lib.h include\fdk-aac\
 copy ..\fdk-aac\libSYS\include\FDK_Audio.h include\fdk-aac\
-copy ..\fdk-aac\libSYS\include\genericStds.h include\fdk-aac\ 
-copy ..\fdk-aac\libSYS\include\machine_type.h include\fdk-aac\ </Command>
+copy ..\fdk-aac\libSYS\include\genericStds.h include\fdk-aac\
+copy ..\fdk-aac\libSYS\include\machine_type.h include\fdk-aac\
+copy ..\fdk-aac\libSYS\include\syslib_channelMapDescr.h include\fdk-aac\
+      </Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
index 17b74ce3ca148d6100446226ba5a29020abeff18..73291aaf7f2df589ab3eeb32409472dca187bc87 100644 (file)
@@ -23,7 +23,7 @@ fdkaac_SOURCES = \
 dist_man_MANS = man/fdkaac.1
 
 fdkaac_LDADD = \
-    @LIBICONV@ -lfdk-aac -lm
+    @LIBICONV@ @CHARSET_LIB@ -lfdk-aac -lm
 
 if FDK_PLATFORM_POSIX
     fdkaac_SOURCES += \
index 6fbe8c0cfc837d697d9c6c636ffbaa7f0de50917..40673d0c26c7e3dc5321849ecdbd6d3f9679646e 100644 (file)
@@ -13,7 +13,7 @@ AC_PROG_CC
 AM_PROG_CC_C_O
 
 AC_CHECK_HEADERS([sys/time.h])
-AC_CHECK_HEADERS([localcharset.h langinfo.h endian.h byteswap.h])
+AC_CHECK_HEADERS([libcharset.h langinfo.h endian.h byteswap.h])
 AC_CHECK_HEADERS([fdk-aac/aacenc_lib.h], ,
                  AC_MSG_ERROR([libfdk-aac is required]))
 
@@ -38,6 +38,12 @@ AC_CHECK_FUNC(getopt_long)
 AM_CONDITIONAL([FDK_NO_GETOPT_LONG],[test "$ac_cv_func_getopt_long" != "yes"])
 AC_SEARCH_LIBS([aacEncOpen],[fdk-aac],[],[],[])
 
+CHARSET_LIB=
+AC_CHECK_LIB([iconv], [locale_charset],
+       [CHARSET_LIB=-liconv],
+       [AC_CHECK_LIB([charset], [locale_charset], [CHARSET_LIB=-lcharset])])
+AC_SUBST([CHARSET_LIB])
+
 AC_CANONICAL_HOST
 
 X_PLATFORM=posix
index f895637c939a55068c4d27aca85569d7f5fd6102..741c87fa8091266c6b4cf122d52354dd0d87ac2f 100644 (file)
@@ -59,8 +59,8 @@ char *aacenc_to_utf8(const char *s)
 #include <errno.h>
 #include <iconv.h>
 
-#if HAVE_LOCALCHARSET_H
-#include <localcharset.h>
+#if HAVE_LIBCHARSET_H
+#include <libcharset.h>
 #elif HAVE_LANGINFO_H
 #include <langinfo.h>
 static const char *locale_charset(void)
index 1eb9a0e827c6338c9dc1095ca8e988d2e0b0eaec..49051307ebaf7631db909ebab4f3d504aa6403dc 100644 (file)
@@ -289,7 +289,7 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
     params->afterburner = 1;
 
     aacenc_getmainargs(&argc, &argv);
-    while ((ch = getopt_long(argc, argv, "hp:b:m:w:a:Ls:f:CP:G:Io:SR",
+    while ((ch = getopt_long(argc, argv, "hp:b:m:w:a:L:s:f:CP:G:Io:SR",
                              long_options, 0)) != EOF) {
         switch (ch) {
         case 'h':
@@ -503,6 +503,11 @@ int write_sample(FILE *ofp, m4af_ctx_t *m4af, aacenc_frame_t *frame)
     return 0;
 }
 
+static int do_smart_padding(int profile)
+{
+    return profile == 2 || profile == 5 || profile == 29;
+}
+
 static
 int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
            HANDLE_AACENCODER encoder, uint32_t frame_length, 
@@ -517,15 +522,12 @@ int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
     int frames_written = 0, encoded = 0;
     aacenc_progress_t progress = { 0 };
     const pcm_sample_description_t *fmt = pcm_get_format(reader);
+    const int is_padding = do_smart_padding(params->profile);
 
     ibuf = malloc(frame_length * fmt->bytes_per_frame);
     aacenc_progress_init(&progress, pcm_get_length(reader), fmt->sample_rate);
 
     for (;;) {
-        /*
-         * Since we delay the write, we cannot just exit loop when interrupted.
-         * Instead, we regard it as EOF.
-         */
         if (g_interrupted)
             nread = 0;
         if (nread > 0) {
@@ -548,7 +550,7 @@ int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
 
             remaining -= consumed;
             ip += consumed * fmt->channels_per_frame;
-            flip ^= 1;
+            if (is_padding) {
             /*
              * As we pad 1 frame at beginning and ending by our extrapolator,
              * we want to drop them.
@@ -557,25 +559,26 @@ int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
              * Since sbr_header is included in the first frame (in case of
              * SBR), we cannot discard first frame. So we pick second instead.
              */
-            ++encoded;
-            if (encoded == 1 || encoded == 3)
-                continue;
-
+                flip ^= 1;
+                ++encoded;
+                if (encoded == 1 || encoded == 3)
+                    continue;
+            }
             if (write_sample(params->output_fp, m4af, &obuf[flip]) < 0)
                 goto END;
             ++frames_written;
         } while (remaining > 0);
-        /*
-         * When interrupted, we haven't pulled out last extrapolated frames
-         * from the reader. Therefore, we have to write the final outcome.
-         */
-        if (g_interrupted) {
-            if (write_sample(params->output_fp, m4af, &obp[flip^1]) < 0)
-                goto END;
-            ++frames_written;
-        }
     }
 DONE:
+    /*
+     * When interrupted, we haven't pulled out last extrapolated frames
+     * from the reader. Therefore, we have to write the final outcome.
+     */
+    if (g_interrupted) {
+        if (write_sample(params->output_fp, m4af, &obp[flip^1]) < 0)
+            goto END;
+        ++frames_written;
+    }
     if (!params->silent)
         aacenc_progress_finish(&progress, pcm_get_position(reader));
     rc = frames_written;
@@ -755,8 +758,10 @@ pcm_reader_t *open_input(aacenc_param_ex_t *params)
     reader = pcm_open_native_converter(reader);
     if (reader && PCM_IS_FLOAT(pcm_get_format(reader)))
         reader = limiter_open(reader);
-    if (reader && (reader = pcm_open_sint16_converter(reader)) != 0)
-        reader = extrapolater_open(reader);
+    if (reader && (reader = pcm_open_sint16_converter(reader)) != 0) {
+        if (do_smart_padding(params->profile))
+            reader = extrapolater_open(reader);
+    }
     return reader;
 FAIL:
     return 0;
@@ -846,29 +851,22 @@ int main(int argc, char **argv)
         m4af_set_priming_mode(m4af, params.gapless_mode + 1);
         m4af_begin_write(m4af);
     }
-    if (scale_shift && (aacinfo.encoderDelay & 1)) {
-        /*
-         * Since odd delay cannot be exactly expressed in downsampled scale,
-         * we push one zero frame to the encoder here, to make delay even
-         */
-        int16_t zero[8] = { 0 };
-        aacenc_frame_t frame = { 0 };
-        aac_encode_frame(encoder, sample_format, zero, 1, &frame);
-        free(frame.data);
-    }
     frame_count = encode(&params, reader, encoder, aacinfo.frameLength, m4af);
     if (frame_count < 0)
         goto END;
     if (m4af) {
-        uint32_t delay = aacinfo.encoderDelay;
         uint32_t padding;
+#if AACENCODER_LIB_VL0 < 4
+        uint32_t delay = aacinfo.encoderDelay;
+        if (sbr_mode && params.profile != AOT_ER_AAC_ELD
+            && !params.include_sbr_delay)
+            delay -= 481 << scale_shift;
+#else
+        uint32_t delay = params.include_sbr_delay ? aacinfo.nDelay
+                                                  : aacinfo.nDelayCore;
+#endif
         int64_t frames_read = pcm_get_position(reader);
 
-        if (sbr_mode && params.profile != AOT_ER_AAC_ELD &&
-            !params.include_sbr_delay)
-            delay -= 481 << scale_shift;
-        if (scale_shift && (delay & 1))
-            ++delay;
         padding = frame_count * aacinfo.frameLength - frames_read - delay;
         m4af_set_priming(m4af, 0, delay >> scale_shift, padding >> scale_shift);
         if (finalize_m4a(m4af, &params, encoder) < 0)
index 10bb7c43ddd3513de9a4b39d7a09b580ff062cb6..52527c6d1264ec3824ce9d3abd1ee65cb5253456 100644 (file)
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
 #ifndef VERSION_H
 #define VERSION_H
-const char *fdkaac_version = "0.6.3";
+const char *fdkaac_version = "1.0.0";
 #endif
This page took 0.049519 seconds and 4 git commands to generate.