1
0
mirror of https://github.com/nu774/fdkaac.git synced 2025-06-05 23:29:14 +02:00

17 Commits

Author SHA1 Message Date
fdf5c2f251 bump 2020-09-21 22:41:03 +09:00
ef17c9436e add Windows 10 long pathname manifest 2020-09-21 22:41:03 +09:00
c0919b049a fix indent 2019-09-27 21:05:12 +09:00
353e4fcd7a process 32-bit input if possible (i.e. respect aac:INT_PCM type)
switch AAC-FDK from pcm16 to pcm32:
    typedef LONG INT_PCM;
    #define SAMPLE_BITS 32
2019-09-27 12:10:30 +03:00
130e249ebf vcxproj: support visual studio 2019 2019-04-04 19:55:18 +09:00
65ee26fb61 don't inject timestamp 2018-12-10 14:59:48 +03:00
f2f9c1b4bb bump version 1.0.0 2018-09-04 02:04:36 +09:00
836367a7fe Fix LD/ELD issue: priming samples are too short to be discarded
When discarded, cannot reconstruct the beginning.
Now we changed to activate smartpadding only for LC/HE/HEv2.
(padding is not nice for low delay codec anyway)

LD and ELD are two short
2018-09-04 01:30:08 +09:00
ca65cffdd3 FDKv2 API change: encoderDelay -> nDelay/nDelayCore 2018-09-03 22:59:24 +09:00
36424b121c update MSVC projects for FDKv2 2018-09-03 20:58:17 +09:00
2329b4b1eb use different IntDir for fdk-aac build 2018-09-03 20:27:42 +09:00
4c963ef139 remove zombies from fdk-aac.vcxproj.filters 2018-09-03 20:26:32 +09:00
3f7b6abd20 fix: -L option was not working (resulted in segfault) 2018-09-03 20:25:28 +09:00
4571d9d76a MSVC projects: update for VS2017 2017-03-16 20:51:30 +09:00
4682fe4961 address issue#26
try to link with libcharset when locale_charset() is not present in
libiconv
2017-01-16 15:20:09 +09:00
c37edc6051 remove aacenc_hcr.* from MSVC project 2016-08-27 23:51:48 +09:00
07c06b4c3e update ChangeLog 2016-08-26 21:47:20 +09:00
16 changed files with 244 additions and 98 deletions

View File

@ -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>

View 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">
@ -24,10 +24,14 @@
<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)' == '16.0'">v142</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 +54,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 +75,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 +94,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" />
@ -109,6 +113,8 @@
<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" />
@ -122,7 +128,20 @@
<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" />
@ -136,19 +155,18 @@
<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" />

View 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>
@ -171,9 +168,6 @@
<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>
@ -219,22 +213,73 @@
<ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_misc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_ram.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_rom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<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\libSYS\src\conv_string.cpp">
<ClCompile Include="..\fdk-aac\libSYS\src\genericStds.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\fdk-aac\libSYS\src\genericStds.cpp">
<ClCompile Include="..\fdk-aac\libPCMutils\src\pcm_utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\fdk-aac\libSBRenc\src\sbrenc_ram.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\fdk-aac\libSBRenc\src\sbrenc_rom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<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>
@ -245,9 +290,6 @@
<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>

View File

@ -24,10 +24,11 @@
<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)' == '16.0'">v142</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">
@ -54,12 +55,17 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Manifest>
<AdditionalManifestFiles>..\fdkaac.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
<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'">

View File

@ -23,7 +23,10 @@ fdkaac_SOURCES = \
dist_man_MANS = man/fdkaac.1
fdkaac_LDADD = \
@LIBICONV@ -lfdk-aac -lm
@LIBICONV@ @CHARSET_LIB@ -lfdk-aac -lm
.rc.o:
$(RC) $< -o $@
if FDK_PLATFORM_POSIX
fdkaac_SOURCES += \
@ -33,6 +36,7 @@ endif
if FDK_PLATFORM_WIN32
fdkaac_SOURCES += \
src/compat_win32.c
fdkaac_SOURCES += fdkaac.rc
endif
if FDK_NO_GETOPT_LONG

View File

@ -11,9 +11,10 @@ AM_INIT_AUTOMAKE
AC_PROG_CC
AM_PROG_CC_C_O
AC_CHECK_TOOL(RC, windres,)
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 +39,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

8
fdkaac.manifest Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</windowsSettings>
</application>
</assembly>

3
fdkaac.rc Normal file
View File

@ -0,0 +1,3 @@
#include <winresrc.h>
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "fdkaac.manifest"

View File

@ -247,7 +247,7 @@ FAIL:
int aac_encode_frame(HANDLE_AACENCODER encoder,
const pcm_sample_description_t *format,
const int16_t *input, unsigned iframes,
const INT_PCM *input, unsigned iframes,
aacenc_frame_t *output)
{
uint32_t ilen = iframes * format->channels_per_frame;
@ -258,9 +258,9 @@ int aac_encode_frame(HANDLE_AACENCODER encoder,
void *obufs[1];
INT ibuf_ids[] = { IN_AUDIO_DATA };
INT obuf_ids[] = { OUT_BITSTREAM_DATA };
INT ibuf_sizes[] = { ilen * sizeof(int16_t) };
INT ibuf_sizes[] = { ilen * sizeof(INT_PCM) };
INT obuf_sizes[1];
INT ibuf_el_sizes[] = { sizeof(int16_t) };
INT ibuf_el_sizes[] = { sizeof(INT_PCM) };
INT obuf_el_sizes[] = { 1 };
AACENC_ERROR err;
unsigned channel_mode, obytes;

View File

@ -50,7 +50,7 @@ int aacenc_init(HANDLE_AACENCODER *encoder, const aacenc_param_t *params,
int aac_encode_frame(HANDLE_AACENCODER encoder,
const pcm_sample_description_t *format,
const int16_t *input, unsigned iframes,
const INT_PCM *input, unsigned iframes,
aacenc_frame_t *output);
#endif

View 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)

View File

@ -223,7 +223,7 @@ void m4af_write32_at(m4af_ctx_t *ctx, int64_t pos, uint32_t value)
}
m4af_ctx_t *m4af_create(uint32_t codec, uint32_t timescale,
m4af_io_callbacks_t *io, void *io_cookie)
m4af_io_callbacks_t *io, void *io_cookie, int no_timestamp)
{
m4af_ctx_t *ctx;
int64_t timestamp;
@ -237,7 +237,7 @@ m4af_ctx_t *m4af_create(uint32_t codec, uint32_t timescale,
memcpy(&ctx->io, io, sizeof(m4af_io_callbacks_t));
ctx->io_cookie = io_cookie;
ctx->timescale = timescale;
timestamp = m4af_timestamp();
timestamp = no_timestamp ? 0 : m4af_timestamp();
ctx->creation_time = timestamp;
ctx->modification_time = timestamp;
ctx->num_tracks = 1;

View File

@ -75,7 +75,7 @@ typedef struct m4af_ctx_t m4af_ctx_t;
m4af_ctx_t *m4af_create(uint32_t codec, uint32_t timescale,
m4af_io_callbacks_t *io, void *io_cookie);
m4af_io_callbacks_t *io, void *io_cookie, int no_timestamp);
int m4af_begin_write(m4af_ctx_t *ctx);

View File

@ -159,6 +159,7 @@ PROGNAME " %s\n"
" -I, --ignorelength Ignore length of WAV header\n"
" -S, --silent Don't print progress messages\n"
" --moov-before-mdat Place moov box before mdat box on m4a output\n"
" --no-timestamp Don't inject timestamp in the file\n"
"\n"
"Options for raw (headerless) input:\n"
" -R, --raw Treat input as raw (by default WAV is\n"
@ -221,6 +222,8 @@ typedef struct aacenc_param_ex_t {
unsigned raw_rate;
const char *raw_format;
int no_timestamp;
aacenc_tag_store_t tags;
aacenc_tag_store_t source_tags;
aacenc_translate_generic_text_tag_ctx_t source_tag_ctx;
@ -244,7 +247,7 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
#define OPT_LONG_TAG M4AF_FOURCC('l','t','a','g')
#define OPT_TAG_FROM_JSON M4AF_FOURCC('t','f','j','s')
static struct option long_options[] = {
static const struct option long_options[] = {
{ "help", no_argument, 0, 'h' },
{ "profile", required_argument, 0, 'p' },
{ "bitrate", required_argument, 0, 'b' },
@ -284,12 +287,14 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
{ "tag-from-file", required_argument, 0, OPT_SHORT_TAG_FILE },
{ "long-tag", required_argument, 0, OPT_LONG_TAG },
{ "tag-from-json", required_argument, 0, OPT_TAG_FROM_JSON },
{ "no-timestamp", no_argument, 0, '#' },
{ 0, 0, 0, 0 },
};
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':
@ -456,6 +461,9 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
case OPT_TAG_FROM_JSON:
params->json_filename = optarg;
break;
case '#':
params->no_timestamp = 1;
break;
default:
return usage(), -1;
}
@ -503,12 +511,17 @@ 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,
m4af_ctx_t *m4af)
{
int16_t *ibuf = 0, *ip;
INT_PCM *ibuf = 0, *ip;
aacenc_frame_t obuf[2] = {{ 0 }}, *obp;
unsigned flip = 0;
int nread = 1;
@ -517,15 +530,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 +558,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 +567,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 +766,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;
@ -828,7 +841,7 @@ int main(int argc, char **argv)
unsigned framelen = aacinfo.frameLength;
scale = sample_format->sample_rate >> scale_shift;
if ((m4af = m4af_create(M4AF_CODEC_MP4A, scale, &m4af_io,
params.output_fp)) < 0)
params.output_fp, params.no_timestamp)) < 0)
goto END;
m4af_set_num_channels(m4af, 0, sample_format->channels_per_frame);
m4af_set_fixed_frame_duration(m4af, 0, framelen >> scale_shift);
@ -846,29 +859,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)

View File

@ -10,6 +10,8 @@
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#include <assert.h>
#include <fdk-aac/aacenc_lib.h>
#include "pcm_reader.h"
typedef struct pcm_sint16_converter_t {
@ -57,12 +59,18 @@ static int read_frames(pcm_reader_t *reader, void *buffer, unsigned nframes)
count = nframes * sfmt->channels_per_frame;
if (PCM_IS_FLOAT(sfmt)) {
float *ip = self->pivot;
int16_t *op = buffer;
INT_PCM *op = buffer;
#if SAMPLE_BITS == 16
for (i = 0; i < count; ++i)
op[i] = pcm_clip(ip[i] * 32768.0, -32768.0, 32767.0);
op[i] = (int16_t)pcm_clip(ip[i] * 32768.0, -32768.0, 32767.0);
#else
for (i = 0; i < count; ++i)
op[i] = (int32_t)pcm_clip(ip[i] * 2147483648.0, -2147483648.0, 2147483647.0);
#endif
} else {
int32_t *ip = self->pivot;
int16_t *op = buffer;
INT_PCM *op = buffer;
#if SAMPLE_BITS == 16
if (sfmt->bits_per_channel <= 16) {
for (i = 0; i < count; ++i)
op[i] = ip[i] >> 16;
@ -72,6 +80,10 @@ static int read_frames(pcm_reader_t *reader, void *buffer, unsigned nframes)
op[i] = (n == 0x8000) ? 0x7fff : n;
}
}
#else
for (i = 0; i < count; ++i)
op[i] = ip[i];
#endif
}
return nframes;
}
@ -94,14 +106,16 @@ pcm_reader_t *pcm_open_sint16_converter(pcm_reader_t *reader)
pcm_sint16_converter_t *self = 0;
pcm_sample_description_t *fmt;
assert((SAMPLE_BITS>>3) == sizeof(INT_PCM));
if ((self = calloc(1, sizeof(pcm_sint16_converter_t))) == 0)
return 0;
self->src = reader;
self->vtbl = &my_vtable;
memcpy(&self->format, pcm_get_format(reader), sizeof(self->format));
fmt = &self->format;
fmt->bits_per_channel = 16;
fmt->bits_per_channel = SAMPLE_BITS;
fmt->sample_type = PCM_TYPE_SINT;
fmt->bytes_per_frame = 2 * fmt->channels_per_frame;
fmt->bytes_per_frame = sizeof(INT_PCM) * fmt->channels_per_frame;
return (pcm_reader_t *)self;
}

View File

@ -1,4 +1,4 @@
#ifndef VERSION_H
#define VERSION_H
const char *fdkaac_version = "0.6.3";
const char *fdkaac_version = "1.0.1";
#endif