mirror of https://github.com/nu774/fdkaac.git
Compare commits
44 Commits
Author | SHA1 | Date |
---|---|---|
nu774 | 98d90e76d6 | |
nu774 | 2dd2b3c61b | |
nu774 | 746e85538b | |
nu774 | 594c26b960 | |
nu774 | a71453bc9a | |
nu774 | 11f6ac1665 | |
nu774 | 7291661fdc | |
nu774 | 2dc1ef46e1 | |
nu774 | f95566ee8e | |
nu774 | d705c888cf | |
nu774 | 31e62aa51c | |
nu774 | 2ed6139278 | |
nu774 | 4037c42577 | |
nu774 | 4f35b8ad7c | |
nu774 | 3bf454a5a3 | |
nu774 | 22dbf72491 | |
nu774 | 03c3c60191 | |
nu774 | 59455af10a | |
nu774 | ae1f4c3afd | |
nu774 | 0ce71d066a | |
nu774 | ecddb7d633 | |
nu774 | 1a1ee2924f | |
nu774 | cdfb81d7c6 | |
nu774 | 4ec1422bd9 | |
nu774 | 53fe239bf6 | |
nu774 | 347e995cfc | |
nu774 | 9d65d3b3bf | |
nu774 | fdf5c2f251 | |
nu774 | ef17c9436e | |
nu774 | c0919b049a | |
Dima | 353e4fcd7a | |
nu774 | 130e249ebf | |
tico-tico | 65ee26fb61 | |
nu774 | f2f9c1b4bb | |
nu774 | 836367a7fe | |
nu774 | ca65cffdd3 | |
nu774 | 36424b121c | |
nu774 | 2329b4b1eb | |
nu774 | 4c963ef139 | |
nu774 | 3f7b6abd20 | |
nu774 | 4571d9d76a | |
nu774 | 4682fe4961 | |
nu774 | c37edc6051 | |
nu774 | 07c06b4c3e |
|
@ -0,0 +1,109 @@
|
||||||
|
name: CI
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linux:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
version: [20.04, 22.04]
|
||||||
|
runs-on: ubuntu-${{ matrix.version }}
|
||||||
|
steps:
|
||||||
|
- name: Install libfdk-aac
|
||||||
|
run: |
|
||||||
|
sudo apt install libfdk-aac-dev
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
autoreconf -fiv
|
||||||
|
./configure
|
||||||
|
make -j2
|
||||||
|
sudo make install
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
fdkaac -b 128 -R -o /dev/null /dev/null
|
||||||
|
|
||||||
|
mingw-cross:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: [i686, x86_64]
|
||||||
|
include:
|
||||||
|
- arch: i686
|
||||||
|
os: mingw32
|
||||||
|
- arch: x86_64
|
||||||
|
os: mingw64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install cross compiler
|
||||||
|
run: |
|
||||||
|
ARCH=${{ matrix.arch }}
|
||||||
|
sudo apt-get install g++-mingw-w64-${ARCH//_/-}
|
||||||
|
- name: Install libfdk-aac binary from repo.msys.org
|
||||||
|
run: |
|
||||||
|
wget https://repo.msys2.org/mingw/${{ matrix.os }}/${{ matrix.os }}.db.tar.zst
|
||||||
|
DESCFILE=$(tar xvf ${{ matrix.os }}.db.tar.zst --wildcards '*-fdk-aac*/desc')
|
||||||
|
PKGFILE=$(sed -n '/%FILENAME%/{n;p;q}' $DESCFILE)
|
||||||
|
wget https://repo.msys2.org/mingw/${{ matrix.os }}/${PKGFILE}
|
||||||
|
sudo tar xvf ${PKGFILE} -C /usr/${{ matrix.arch }}-w64-mingw32 --strip-component=1
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
autoreconf -fiv
|
||||||
|
PKG_CONFIG_LIBDIR=/usr/${{ matrix.arch }}-w64-mingw32/lib/pkgconfig ./configure --host=${{ matrix.arch }}-w64-mingw32 --prefix=/usr/${{ matrix.arch }}-w64-mingw32
|
||||||
|
make -j2
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
brew install autoconf automake libtool pkg-config
|
||||||
|
brew install fdk-aac
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
autoreconf -fiv
|
||||||
|
./configure
|
||||||
|
make -j3
|
||||||
|
sudo make install
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
fdkaac -b 128 -R -o /dev/null /dev/null
|
||||||
|
|
||||||
|
msys2:
|
||||||
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
sys: [ clang32, clang64, mingw32, mingw64, ucrt64 ]
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: msys2 {0}
|
||||||
|
steps:
|
||||||
|
- name: Setup msys2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
msystem: ${{ matrix.sys }}
|
||||||
|
update: true
|
||||||
|
install: git
|
||||||
|
pacboy: >-
|
||||||
|
autoconf:
|
||||||
|
automake:
|
||||||
|
libtool:
|
||||||
|
make:
|
||||||
|
cc:p
|
||||||
|
pkg-config:p
|
||||||
|
fdk-aac:p
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
autoreconf -fiv
|
||||||
|
./configure
|
||||||
|
make -j2
|
||||||
|
make install
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
fdkaac -b 128 -R -o /dev/null /dev/null
|
|
@ -20,3 +20,11 @@ src/.deps/
|
||||||
src/.dirstamp
|
src/.dirstamp
|
||||||
stamp-h1
|
stamp-h1
|
||||||
fdkaac
|
fdkaac
|
||||||
|
.vscode
|
||||||
|
fdk-aac
|
||||||
|
MSVC/Release
|
||||||
|
MSVC/Debug
|
||||||
|
MSVC/x64/Release
|
||||||
|
MSVC/x64/Debug
|
||||||
|
MSVC/fdk-aac
|
||||||
|
MSVC/*.vcxproj.user
|
||||||
|
|
124
ChangeLog
124
ChangeLog
|
@ -1,6 +1,124 @@
|
||||||
|
2022-08-04 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* bump [HEAD -> master]
|
||||||
|
|
||||||
|
* fdk-aac.vcxproj: support vs2022
|
||||||
|
|
||||||
|
* extrapolater: don't return more samples than required
|
||||||
|
|
||||||
|
* wav/caf parser: add format checks
|
||||||
|
|
||||||
|
2022-07-13 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* update ChangeLog [origin/master]
|
||||||
|
|
||||||
|
* bump [v1.0.3]
|
||||||
|
|
||||||
|
* wav/caf parser: ensure fmt/desc chunk
|
||||||
|
|
||||||
|
2021-11-15 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* vcxproj: support Visual Studio 2022
|
||||||
|
|
||||||
|
2021-04-23 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* bump [v1.0.2]
|
||||||
|
|
||||||
|
* m4af: fix mvhd/tkhd duration
|
||||||
|
|
||||||
|
2020-09-21 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* bump [v1.0.1]
|
||||||
|
|
||||||
|
* add Windows 10 long pathname manifest
|
||||||
|
|
||||||
|
2019-09-27 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* fix indent
|
||||||
|
|
||||||
|
2019-09-19 Dima <yudind@gmail.com>
|
||||||
|
|
||||||
|
* process 32-bit input if possible (i.e. respect aac:INT_PCM type)
|
||||||
|
|
||||||
|
2019-04-04 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* vcxproj: support visual studio 2019
|
||||||
|
|
||||||
|
2018-12-10 tico-tico <sergei.ivn@gmx.com>
|
||||||
|
|
||||||
|
* don't inject timestamp
|
||||||
|
|
||||||
|
2018-09-04 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* bump version 1.0.0 [1.0.0]
|
||||||
|
|
||||||
|
* Fix LD/ELD issue: priming samples are too short to be discarded
|
||||||
|
|
||||||
|
2018-09-03 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* FDKv2 API change: encoderDelay -> nDelay/nDelayCore
|
||||||
|
|
||||||
|
* update MSVC projects for FDKv2
|
||||||
|
|
||||||
|
* use different IntDir for fdk-aac build
|
||||||
|
|
||||||
|
* remove zombies from fdk-aac.vcxproj.filters
|
||||||
|
|
||||||
|
* fix: -L option was not working (resulted in segfault)
|
||||||
|
|
||||||
|
2017-03-16 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* MSVC projects: update for VS2017
|
||||||
|
|
||||||
|
2017-01-16 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* address issue#26
|
||||||
|
|
||||||
|
2016-08-27 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* remove aacenc_hcr.* from MSVC project
|
||||||
|
|
||||||
|
2016-08-26 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
* update ChangeLog
|
||||||
|
|
||||||
|
* bump [v0.6.3]
|
||||||
|
|
||||||
|
* 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>
|
2015-02-14 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
* update ChangeLog [HEAD]
|
* update ChangeLog
|
||||||
|
|
||||||
* bump version [v0.6.2]
|
* bump version [v0.6.2]
|
||||||
|
|
||||||
|
@ -10,9 +128,9 @@
|
||||||
|
|
||||||
2014-09-13 nu774 <honeycomb77@gmail.com>
|
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>
|
2014-09-12 nu774 <honeycomb77@gmail.com>
|
||||||
|
|
||||||
|
|
|
@ -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">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
@ -24,10 +24,15 @@
|
||||||
<RootNamespace>fdk-aac</RootNamespace>
|
<RootNamespace>fdk-aac</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '17.0'">v143</PlatformToolset>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '16.0'">v142</PlatformToolset>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath11)' != ''">v110_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '15.0'">v141_xp</PlatformToolset>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v100</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>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Label="Configuration">
|
<PropertyGroup Label="Configuration">
|
||||||
|
@ -50,7 +55,7 @@
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PreprocessorDefinitions>WIN32;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<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>
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
|
@ -71,7 +76,6 @@
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\aacenc.cpp" />
|
<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_lib.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_pns.cpp" />
|
<ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_pns.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\aacEnc_ram.cpp" />
|
<ClCompile Include="..\fdk-aac\libAACenc\src\aacEnc_ram.cpp" />
|
||||||
|
@ -91,6 +95,7 @@
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\line_pe.cpp" />
|
<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_compressor.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\metadata_main.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\ms_stereo.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\noisedet.cpp" />
|
<ClCompile Include="..\fdk-aac\libAACenc\src\noisedet.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\pnsparam.cpp" />
|
<ClCompile Include="..\fdk-aac\libAACenc\src\pnsparam.cpp" />
|
||||||
|
@ -109,6 +114,8 @@
|
||||||
<ClCompile Include="..\fdk-aac\libFDK\src\FDK_core.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_crc.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libFDK\src\FDK_hybrid.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_tools_rom.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libFDK\src\FDK_trigFcts.cpp" />
|
<ClCompile Include="..\fdk-aac\libFDK\src\FDK_trigFcts.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libFDK\src\fft.cpp" />
|
<ClCompile Include="..\fdk-aac\libFDK\src\fft.cpp" />
|
||||||
|
@ -122,7 +129,20 @@
|
||||||
<ClCompile Include="..\fdk-aac\libMpegTPEnc\src\tpenc_asc.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_latm.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libMpegTPEnc\src\tpenc_lib.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\bit_sbr.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libSBRenc\src\code_env.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\env_bit.cpp" />
|
||||||
|
@ -136,19 +156,18 @@
|
||||||
<ClCompile Include="..\fdk-aac\libSBRenc\src\ps_main.cpp" />
|
<ClCompile Include="..\fdk-aac\libSBRenc\src\ps_main.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libSBRenc\src\resampler.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_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_encoder.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_misc.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\ton_corr.cpp" />
|
||||||
<ClCompile Include="..\fdk-aac\libSBRenc\src\tran_det.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\genericStds.cpp" />
|
||||||
|
<ClCompile Include="..\fdk-aac\libSYS\src\syslib_channelMapDescr.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\fdk-aac\libAACenc\include\aacenc_lib.h" />
|
<ClInclude Include="..\fdk-aac\libAACenc\include\aacenc_lib.h" />
|
||||||
<ClInclude Include="..\fdk-aac\libAACenc\src\aacenc.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_pns.h" />
|
||||||
<ClInclude Include="..\fdk-aac\libAACenc\src\aacEnc_ram.h" />
|
<ClInclude Include="..\fdk-aac\libAACenc\src\aacEnc_ram.h" />
|
||||||
<ClInclude Include="..\fdk-aac\libAACenc\src\aacEnc_rom.h" />
|
<ClInclude Include="..\fdk-aac\libAACenc\src\aacEnc_rom.h" />
|
||||||
|
|
|
@ -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">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="Source Files">
|
<Filter Include="Source Files">
|
||||||
|
@ -18,9 +18,6 @@
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\aacenc.cpp">
|
<ClCompile Include="..\fdk-aac\libAACenc\src\aacenc.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_hcr.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_lib.cpp">
|
<ClCompile Include="..\fdk-aac\libAACenc\src\aacenc_lib.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -171,9 +168,6 @@
|
||||||
<ClCompile Include="..\fdk-aac\libMpegTPEnc\src\tpenc_lib.cpp">
|
<ClCompile Include="..\fdk-aac\libMpegTPEnc\src\tpenc_lib.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\fdk-aac\libPCMutils\src\pcmutils_lib.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\fdk-aac\libSBRenc\src\bit_sbr.cpp">
|
<ClCompile Include="..\fdk-aac\libSBRenc\src\bit_sbr.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -219,22 +213,73 @@
|
||||||
<ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_misc.cpp">
|
<ClCompile Include="..\fdk-aac\libSBRenc\src\sbr_misc.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</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">
|
<ClCompile Include="..\fdk-aac\libSBRenc\src\ton_corr.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\fdk-aac\libSBRenc\src\tran_det.cpp">
|
<ClCompile Include="..\fdk-aac\libSBRenc\src\tran_det.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\fdk-aac\libSYS\src\conv_string.cpp">
|
<ClCompile Include="..\fdk-aac\libSYS\src\genericStds.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</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>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -245,9 +290,6 @@
|
||||||
<ClInclude Include="..\fdk-aac\libAACenc\src\aacenc.h">
|
<ClInclude Include="..\fdk-aac\libAACenc\src\aacenc.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\fdk-aac\libAACenc\src\aacenc_hcr.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\fdk-aac\libAACenc\src\aacenc_pns.h">
|
<ClInclude Include="..\fdk-aac\libAACenc\src\aacenc_pns.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
@ -24,10 +24,12 @@
|
||||||
<RootNamespace>fdkaac</RootNamespace>
|
<RootNamespace>fdkaac</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '17.0'">v143</PlatformToolset>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '16.0'">v142</PlatformToolset>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath11)' != ''">v110_xp</PlatformToolset>
|
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '15.0'">v141_xp</PlatformToolset>
|
||||||
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v100</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>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Label="Configuration">
|
<PropertyGroup Label="Configuration">
|
||||||
|
@ -54,12 +56,17 @@
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>..\fdkaac.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>copy ..\fdk-aac\libAACdec\include\aacdecoder_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\libAACenc\include\aacenc_lib.h include\fdk-aac\
|
||||||
copy ..\fdk-aac\libSYS\include\FDK_Audio.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\genericStds.h include\fdk-aac\
|
||||||
copy ..\fdk-aac\libSYS\include\machine_type.h include\fdk-aac\ </Command>
|
copy ..\fdk-aac\libSYS\include\machine_type.h include\fdk-aac\
|
||||||
|
copy ..\fdk-aac\libSYS\include\syslib_channelMapDescr.h include\fdk-aac\
|
||||||
|
</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
|
|
|
@ -22,8 +22,13 @@ fdkaac_SOURCES = \
|
||||||
|
|
||||||
dist_man_MANS = man/fdkaac.1
|
dist_man_MANS = man/fdkaac.1
|
||||||
|
|
||||||
|
fdkaac_CFLAGS = @CFLAGS@ @FDK_AAC_CFLAGS@
|
||||||
|
|
||||||
fdkaac_LDADD = \
|
fdkaac_LDADD = \
|
||||||
@LIBICONV@ -lfdk-aac -lm
|
@LIBICONV@ @CHARSET_LIB@ @FDK_AAC_LIBS@ -lm
|
||||||
|
|
||||||
|
.rc.o:
|
||||||
|
$(RC) $< -o $@
|
||||||
|
|
||||||
if FDK_PLATFORM_POSIX
|
if FDK_PLATFORM_POSIX
|
||||||
fdkaac_SOURCES += \
|
fdkaac_SOURCES += \
|
||||||
|
@ -33,6 +38,7 @@ endif
|
||||||
if FDK_PLATFORM_WIN32
|
if FDK_PLATFORM_WIN32
|
||||||
fdkaac_SOURCES += \
|
fdkaac_SOURCES += \
|
||||||
src/compat_win32.c
|
src/compat_win32.c
|
||||||
|
fdkaac_SOURCES += fdkaac.rc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if FDK_NO_GETOPT_LONG
|
if FDK_NO_GETOPT_LONG
|
||||||
|
|
13
configure.ac
13
configure.ac
|
@ -6,16 +6,17 @@ changequote([,])dnl
|
||||||
AC_INIT([fdkaac], [XX_VERSION], [honeycomb77@gmail.com])
|
AC_INIT([fdkaac], [XX_VERSION], [honeycomb77@gmail.com])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
AC_CONFIG_AUX_DIR([.])
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
|
AC_CHECK_TOOL(RC, windres,)
|
||||||
|
|
||||||
AC_CHECK_HEADERS([sys/time.h])
|
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], ,
|
PKG_CHECK_MODULES([FDK_AAC],[fdk-aac])
|
||||||
AC_MSG_ERROR([libfdk-aac is required]))
|
|
||||||
|
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
AC_C_BIGENDIAN
|
AC_C_BIGENDIAN
|
||||||
|
@ -38,6 +39,12 @@ AC_CHECK_FUNC(getopt_long)
|
||||||
AM_CONDITIONAL([FDK_NO_GETOPT_LONG],[test "$ac_cv_func_getopt_long" != "yes"])
|
AM_CONDITIONAL([FDK_NO_GETOPT_LONG],[test "$ac_cv_func_getopt_long" != "yes"])
|
||||||
AC_SEARCH_LIBS([aacEncOpen],[fdk-aac],[],[],[])
|
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
|
AC_CANONICAL_HOST
|
||||||
|
|
||||||
X_PLATFORM=posix
|
X_PLATFORM=posix
|
||||||
|
|
|
@ -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>
|
|
@ -0,0 +1,3 @@
|
||||||
|
#include <winresrc.h>
|
||||||
|
|
||||||
|
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "fdkaac.manifest"
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Copyright (C) 2013 nu774
|
# Copyright (C) 2013 nu774
|
||||||
# For conditions of distribution and use, see copyright notice in COPYING
|
# For conditions of distribution and use, see copyright notice in COPYING
|
||||||
|
@ -39,6 +39,6 @@ with Popen(GITLOG_CMD, shell=False, stdout=PIPE).stdout as pipe:
|
||||||
commits = parse_gitlog(pipe)
|
commits = parse_gitlog(pipe)
|
||||||
commits_by_date_author = groupby(commits, key=lambda x: (x.date, x.author))
|
commits_by_date_author = groupby(commits, key=lambda x: (x.date, x.author))
|
||||||
for (date, author), commits in commits_by_date_author:
|
for (date, author), commits in commits_by_date_author:
|
||||||
output(u'{0} {1}\n\n'.format(date, author).encode('utf-8'))
|
output(f'{date} {author}\n\n')
|
||||||
for c in commits:
|
for c in commits:
|
||||||
output(u' * {0}{1}\n\n'.format(c.subject, c.ref).encode('utf-8'))
|
output(f' * {c.subject}{c.ref}\n\n')
|
||||||
|
|
|
@ -247,7 +247,7 @@ FAIL:
|
||||||
|
|
||||||
int aac_encode_frame(HANDLE_AACENCODER encoder,
|
int aac_encode_frame(HANDLE_AACENCODER encoder,
|
||||||
const pcm_sample_description_t *format,
|
const pcm_sample_description_t *format,
|
||||||
const int16_t *input, unsigned iframes,
|
const INT_PCM *input, unsigned iframes,
|
||||||
aacenc_frame_t *output)
|
aacenc_frame_t *output)
|
||||||
{
|
{
|
||||||
uint32_t ilen = iframes * format->channels_per_frame;
|
uint32_t ilen = iframes * format->channels_per_frame;
|
||||||
|
@ -258,9 +258,9 @@ int aac_encode_frame(HANDLE_AACENCODER encoder,
|
||||||
void *obufs[1];
|
void *obufs[1];
|
||||||
INT ibuf_ids[] = { IN_AUDIO_DATA };
|
INT ibuf_ids[] = { IN_AUDIO_DATA };
|
||||||
INT obuf_ids[] = { OUT_BITSTREAM_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 obuf_sizes[1];
|
||||||
INT ibuf_el_sizes[] = { sizeof(int16_t) };
|
INT ibuf_el_sizes[] = { sizeof(INT_PCM) };
|
||||||
INT obuf_el_sizes[] = { 1 };
|
INT obuf_el_sizes[] = { 1 };
|
||||||
AACENC_ERROR err;
|
AACENC_ERROR err;
|
||||||
unsigned channel_mode, obytes;
|
unsigned channel_mode, obytes;
|
||||||
|
|
|
@ -50,7 +50,7 @@ int aacenc_init(HANDLE_AACENCODER *encoder, const aacenc_param_t *params,
|
||||||
|
|
||||||
int aac_encode_frame(HANDLE_AACENCODER encoder,
|
int aac_encode_frame(HANDLE_AACENCODER encoder,
|
||||||
const pcm_sample_description_t *format,
|
const pcm_sample_description_t *format,
|
||||||
const int16_t *input, unsigned iframes,
|
const INT_PCM *input, unsigned iframes,
|
||||||
aacenc_frame_t *output);
|
aacenc_frame_t *output);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -75,8 +75,10 @@ int caf_desc(caf_reader_t *reader, int64_t chunk_size)
|
||||||
ENSURE(mFormatID == M4AF_FOURCC('l','p','c','m'));
|
ENSURE(mFormatID == M4AF_FOURCC('l','p','c','m'));
|
||||||
ENSURE(mSampleRate && mBytesPerPacket &&
|
ENSURE(mSampleRate && mBytesPerPacket &&
|
||||||
mChannelsPerFrame >= 1 && mChannelsPerFrame <= 8 &&
|
mChannelsPerFrame >= 1 && mChannelsPerFrame <= 8 &&
|
||||||
mBitsPerChannel && mFramesPerPacket == 1 &&
|
mBitsPerChannel > 0 && mBitsPerChannel < 256 &&
|
||||||
|
mFramesPerPacket == 1 &&
|
||||||
mBytesPerPacket % mChannelsPerFrame == 0 &&
|
mBytesPerPacket % mChannelsPerFrame == 0 &&
|
||||||
|
mBytesPerPacket < 256 &&
|
||||||
mBytesPerPacket >= mChannelsPerFrame * ((mBitsPerChannel + 7) / 8));
|
mBytesPerPacket >= mChannelsPerFrame * ((mBitsPerChannel + 7) / 8));
|
||||||
|
|
||||||
desc->sample_rate = mSampleRate;
|
desc->sample_rate = mSampleRate;
|
||||||
|
@ -103,10 +105,14 @@ int caf_info(caf_reader_t *reader, int64_t chunk_size)
|
||||||
{
|
{
|
||||||
char *buf, *key, *val, *end;
|
char *buf, *key, *val, *end;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
int n;
|
||||||
|
|
||||||
if (chunk_size < 4 || (buf = malloc(chunk_size)) == 0)
|
if (chunk_size < 4 || (buf = malloc(chunk_size+1)) == 0)
|
||||||
return -1;
|
return -1;
|
||||||
pcm_read(&reader->io, buf, chunk_size);
|
n = pcm_read(&reader->io, buf, chunk_size);
|
||||||
|
if (n != chunk_size)
|
||||||
|
return -1;
|
||||||
|
buf[n] = 0;
|
||||||
key = buf + 4;
|
key = buf + 4;
|
||||||
end = buf + chunk_size;
|
end = buf + chunk_size;
|
||||||
do {
|
do {
|
||||||
|
@ -172,6 +178,7 @@ int caf_parse(caf_reader_t *reader, int64_t *data_length)
|
||||||
{
|
{
|
||||||
uint32_t fcc;
|
uint32_t fcc;
|
||||||
int64_t chunk_size;
|
int64_t chunk_size;
|
||||||
|
int desc_seen = 0;
|
||||||
|
|
||||||
*data_length = 0;
|
*data_length = 0;
|
||||||
|
|
||||||
|
@ -181,9 +188,10 @@ int caf_parse(caf_reader_t *reader, int64_t *data_length)
|
||||||
TRY_IO(pcm_skip(&reader->io, 4)); /* mFileVersion, mFileFlags */
|
TRY_IO(pcm_skip(&reader->io, 4)); /* mFileVersion, mFileFlags */
|
||||||
|
|
||||||
while ((fcc = caf_next_chunk(reader, &chunk_size)) != 0) {
|
while ((fcc = caf_next_chunk(reader, &chunk_size)) != 0) {
|
||||||
if (fcc == M4AF_FOURCC('d','e','s','c'))
|
if (fcc == M4AF_FOURCC('d','e','s','c')) {
|
||||||
|
desc_seen = 1;
|
||||||
TRY_IO(caf_desc(reader, chunk_size));
|
TRY_IO(caf_desc(reader, chunk_size));
|
||||||
else if (fcc == M4AF_FOURCC('i','n','f','o'))
|
} else if (fcc == M4AF_FOURCC('i','n','f','o'))
|
||||||
TRY_IO(caf_info(reader, chunk_size));
|
TRY_IO(caf_info(reader, chunk_size));
|
||||||
else if (fcc == M4AF_FOURCC('c','h','a','n')) {
|
else if (fcc == M4AF_FOURCC('c','h','a','n')) {
|
||||||
ENSURE(reader->sample_format.channels_per_frame);
|
ENSURE(reader->sample_format.channels_per_frame);
|
||||||
|
@ -199,7 +207,7 @@ int caf_parse(caf_reader_t *reader, int64_t *data_length)
|
||||||
TRY_IO(pcm_skip(&reader->io, chunk_size));
|
TRY_IO(pcm_skip(&reader->io, chunk_size));
|
||||||
}
|
}
|
||||||
ENSURE(reader->sample_format.channels_per_frame);
|
ENSURE(reader->sample_format.channels_per_frame);
|
||||||
ENSURE(fcc == M4AF_FOURCC('d','a','t','a'));
|
ENSURE(desc_seen && fcc == M4AF_FOURCC('d','a','t','a'));
|
||||||
return 0;
|
return 0;
|
||||||
FAIL:
|
FAIL:
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -207,7 +207,6 @@ enum
|
||||||
kAudioChannelLayoutTag_AudioUnit_5_0 = kAudioChannelLayoutTag_MPEG_5_0_B, // L R Ls Rs C
|
kAudioChannelLayoutTag_AudioUnit_5_0 = kAudioChannelLayoutTag_MPEG_5_0_B, // L R Ls Rs C
|
||||||
kAudioChannelLayoutTag_AudioUnit_6_0 = (139L<<16) | 6, // L R Ls Rs C Cs
|
kAudioChannelLayoutTag_AudioUnit_6_0 = (139L<<16) | 6, // L R Ls Rs C Cs
|
||||||
kAudioChannelLayoutTag_AudioUnit_7_0 = (140L<<16) | 7, // L R Ls Rs C Rls Rrs
|
kAudioChannelLayoutTag_AudioUnit_7_0 = (140L<<16) | 7, // L R Ls Rs C Rls Rrs
|
||||||
kAudioChannelLayoutTag_AudioUnit_7_0_Front = (148L<<16) | 7, // L R Ls Rs C Lc Rc
|
|
||||||
kAudioChannelLayoutTag_AudioUnit_5_1 = kAudioChannelLayoutTag_MPEG_5_1_A, // L R C LFE Ls Rs
|
kAudioChannelLayoutTag_AudioUnit_5_1 = kAudioChannelLayoutTag_MPEG_5_1_A, // L R C LFE Ls Rs
|
||||||
kAudioChannelLayoutTag_AudioUnit_6_1 = kAudioChannelLayoutTag_MPEG_6_1_A, // L R C LFE Ls Rs Cs
|
kAudioChannelLayoutTag_AudioUnit_6_1 = kAudioChannelLayoutTag_MPEG_6_1_A, // L R C LFE Ls Rs Cs
|
||||||
kAudioChannelLayoutTag_AudioUnit_7_1 = kAudioChannelLayoutTag_MPEG_7_1_C, // L R C LFE Ls Rs Rls Rrs
|
kAudioChannelLayoutTag_AudioUnit_7_1 = kAudioChannelLayoutTag_MPEG_7_1_C, // L R C LFE Ls Rs Rls Rrs
|
||||||
|
@ -227,6 +226,10 @@ enum
|
||||||
kAudioChannelLayoutTag_TMH_10_2_std = (145L<<16) | 16, // L R C Vhc Lsd Rsd Ls Rs Vhl Vhr Lw Rw Csd Cs LFE1 LFE2
|
kAudioChannelLayoutTag_TMH_10_2_std = (145L<<16) | 16, // L R C Vhc Lsd Rsd Ls Rs Vhl Vhr Lw Rw Csd Cs LFE1 LFE2
|
||||||
kAudioChannelLayoutTag_TMH_10_2_full = (146L<<16) | 21, // TMH_10_2_std plus: Lc Rc HI VI Haptic
|
kAudioChannelLayoutTag_TMH_10_2_full = (146L<<16) | 21, // TMH_10_2_std plus: Lc Rc HI VI Haptic
|
||||||
|
|
||||||
|
kAudioChannelLayoutTag_DiscreteInOrder = (147L<<16) | 0, // needs to be ORed with the actual number of channels
|
||||||
|
|
||||||
|
kAudioChannelLayoutTag_AudioUnit_7_0_Front = (148L<<16) | 7, // L R Ls Rs C Lc Rc
|
||||||
|
|
||||||
kAudioChannelLayoutTag_AC3_1_0_1 = (149L<<16) | 2, // C LFE
|
kAudioChannelLayoutTag_AC3_1_0_1 = (149L<<16) | 2, // C LFE
|
||||||
kAudioChannelLayoutTag_AC3_3_0 = (150L<<16) | 3, // L C R
|
kAudioChannelLayoutTag_AC3_3_0 = (150L<<16) | 3, // L C R
|
||||||
kAudioChannelLayoutTag_AC3_3_1 = (151L<<16) | 4, // L C R Cs
|
kAudioChannelLayoutTag_AC3_3_1 = (151L<<16) | 4, // L C R Cs
|
||||||
|
@ -234,7 +237,53 @@ enum
|
||||||
kAudioChannelLayoutTag_AC3_2_1_1 = (153L<<16) | 4, // L R Cs LFE
|
kAudioChannelLayoutTag_AC3_2_1_1 = (153L<<16) | 4, // L R Cs LFE
|
||||||
kAudioChannelLayoutTag_AC3_3_1_1 = (154L<<16) | 5, // L C R Cs LFE
|
kAudioChannelLayoutTag_AC3_3_1_1 = (154L<<16) | 5, // L C R Cs LFE
|
||||||
|
|
||||||
kAudioChannelLayoutTag_DiscreteInOrder = (147L<<16) | 0, // needs to be ORed with the actual number of channels
|
kAudioChannelLayoutTag_EAC_6_0_A = (155<<16) | 6, // L C R Ls Rs Cs
|
||||||
|
kAudioChannelLayoutTag_EAC_7_0_A = (156<<16) | 7, // L C R Ls Rs Rls Rrs
|
||||||
|
|
||||||
|
kAudioChannelLayoutTag_EAC3_6_1_A = (157<<16) | 7, // L C R Ls Rs LFE Cs
|
||||||
|
kAudioChannelLayoutTag_EAC3_6_1_B = (158<<16) | 7, // L C R Ls Rs LFE Ts
|
||||||
|
kAudioChannelLayoutTag_EAC3_6_1_C = (159<<16) | 7, // L C R Ls Rs LFE Vhc
|
||||||
|
kAudioChannelLayoutTag_EAC3_7_1_A = (160<<16) | 8, // L C R Ls Rs LFE Rls Rrs
|
||||||
|
kAudioChannelLayoutTag_EAC3_7_1_B = (161<<16) | 8, // L C R Ls Rs LFE Lc Rc
|
||||||
|
kAudioChannelLayoutTag_EAC3_7_1_C = (162<<16) | 8, // L C R Ls Rs LFE Lsd Rsd
|
||||||
|
kAudioChannelLayoutTag_EAC3_7_1_D = (163<<16) | 8, // L C R Ls Rs LFE Lw Rw
|
||||||
|
kAudioChannelLayoutTag_EAC3_7_1_E = (164<<16) | 8, // L C R Ls Rs LFE Vhl Vhr
|
||||||
|
|
||||||
|
kAudioChannelLayoutTag_EAC3_7_1_F = (165<<16) | 8, // L C R Ls Rs LFE Cs Ts
|
||||||
|
kAudioChannelLayoutTag_EAC3_7_1_G = (166<<16) | 8, // L C R Ls Rs LFE Cs Vhc
|
||||||
|
kAudioChannelLayoutTag_EAC3_7_1_H = (167<<16) | 8, // L C R Ls Rs LFE Ts Vhc
|
||||||
|
|
||||||
|
kAudioChannelLayoutTag_DTS_3_1 = (168<<16) | 4, // C L R LFE
|
||||||
|
kAudioChannelLayoutTag_DTS_4_1 = (169<<16) | 5, // C L R Cs LFE
|
||||||
|
kAudioChannelLayoutTag_DTS_6_0_A = (170<<16) | 6, // Lc Rc L R Ls Rs
|
||||||
|
kAudioChannelLayoutTag_DTS_6_0_B = (171<<16) | 6, // C L R Rls Rrs Ts
|
||||||
|
kAudioChannelLayoutTag_DTS_6_0_C = (172<<16) | 6, // C Cs L R Rls Rrs
|
||||||
|
kAudioChannelLayoutTag_DTS_6_1_A = (173<<16) | 7, // Lc Rc L R Ls Rs LFE
|
||||||
|
kAudioChannelLayoutTag_DTS_6_1_B = (174<<16) | 7, // C L R Rls Rrs Ts LFE
|
||||||
|
kAudioChannelLayoutTag_DTS_6_1_C = (175<<16) | 7, // C Cs L R Rls Rrs LFE
|
||||||
|
kAudioChannelLayoutTag_DTS_7_0 = (176<<16) | 7, // Lc C Rc L R Ls Rs
|
||||||
|
kAudioChannelLayoutTag_DTS_7_1 = (177<<16) | 8, // Lc C Rc L R Ls Rs LFE
|
||||||
|
kAudioChannelLayoutTag_DTS_8_0_A = (178<<16) | 8, // Lc Rc L R Ls Rs Rls Rrs
|
||||||
|
kAudioChannelLayoutTag_DTS_8_0_B = (179<<16) | 8, // Lc C Rc L R Ls Cs Rs
|
||||||
|
kAudioChannelLayoutTag_DTS_8_1_A = (180<<16) | 9, // Lc Rc L R Ls Rs Rls Rrs LFE
|
||||||
|
kAudioChannelLayoutTag_DTS_8_1_B = (181<<16) | 9, // Lc C Rc L R Ls Cs Rs LFE
|
||||||
|
kAudioChannelLayoutTag_DTS_6_1_D = (182<<16) | 7, // C L R Ls Rs LFE Cs
|
||||||
|
|
||||||
|
kAudioChannelLayoutTag_AAC_7_1_B = (183<<16) | 8, // C L R Ls Rs Rls Rrs LFE
|
||||||
|
kAudioChannelLayoutTag_AAC_7_1_C = (184<<16) | 8, // C L R Ls Rs LFE Vhl Vhr
|
||||||
|
|
||||||
|
kAudioChannelLayoutTag_WAVE_4_0_B = (185<<16) | 4, // L R Rls Rrs
|
||||||
|
kAudioChannelLayoutTag_WAVE_5_0_B = (186<<16) | 5, // L R C Rls Rrs
|
||||||
|
kAudioChannelLayoutTag_WAVE_5_1_B = (187<<16) | 6, // L R C LFE Rls Rrs
|
||||||
|
kAudioChannelLayoutTag_WAVE_6_1 = (188<<16) | 7, // L R C LFE Cs Ls Rs
|
||||||
|
kAudioChannelLayoutTag_WAVE_7_1 = (189<<16) | 8, // L R C LFE Rls Rrs Ls Rs
|
||||||
|
|
||||||
|
kAudioChannelLayoutTag_Logic_4_0_C = (197U<<16) | 4, // L R Cs C
|
||||||
|
kAudioChannelLayoutTag_Logic_6_0_B = (198U<<16) | 6, // L R Ls Rs Cs C
|
||||||
|
kAudioChannelLayoutTag_Logic_6_1_B = (199U<<16) | 7, // L R Ls Rs Cs C LFE
|
||||||
|
kAudioChannelLayoutTag_Logic_6_1_D = (200U<<16) | 7, // L C R Ls Cs Rs LFE
|
||||||
|
kAudioChannelLayoutTag_Logic_7_1_B = (201U<<16) | 8, // L R Ls Rs Rls Rrs C LFE
|
||||||
|
|
||||||
kAudioChannelLayoutTag_Unknown = 0xFFFF0000 // needs to be ORed with the actual number of channels
|
kAudioChannelLayoutTag_Unknown = 0xFFFF0000 // needs to be ORed with the actual number of channels
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ char *aacenc_to_utf8(const char *s)
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
|
|
||||||
#if HAVE_LOCALCHARSET_H
|
#if HAVE_LIBCHARSET_H
|
||||||
#include <localcharset.h>
|
#include <libcharset.h>
|
||||||
#elif HAVE_LANGINFO_H
|
#elif HAVE_LANGINFO_H
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
static const char *locale_charset(void)
|
static const char *locale_charset(void)
|
||||||
|
|
|
@ -144,17 +144,22 @@ static int process1(extrapolater_t *self, void *buffer, unsigned nframes)
|
||||||
assert(bp->count <= nframes);
|
assert(bp->count <= nframes);
|
||||||
memcpy(buffer, bp->data, bp->count * sfmt->bytes_per_frame);
|
memcpy(buffer, bp->data, bp->count * sfmt->bytes_per_frame);
|
||||||
if (!fetch(self, nframes)) {
|
if (!fetch(self, nframes)) {
|
||||||
|
// got EOF
|
||||||
buffer_t *bbp = &self->buffer[self->nbuffer];
|
buffer_t *bbp = &self->buffer[self->nbuffer];
|
||||||
if (bp->count < 2 * LPC_ORDER) {
|
if (bp->count < 2 * LPC_ORDER) {
|
||||||
|
// final frame is too short, so we join with the pre-final frame
|
||||||
size_t total = bp->count + bbp->count;
|
size_t total = bp->count + bbp->count;
|
||||||
if (bbp->count &&
|
if (bbp->count &&
|
||||||
realloc_buffer(bbp, total * sfmt->bytes_per_frame) == 0 &&
|
realloc_buffer(bbp, total * sfmt->bytes_per_frame) == 0 &&
|
||||||
realloc_buffer(bp, total * sfmt->bytes_per_frame) == 0)
|
realloc_buffer(bp, total * sfmt->bytes_per_frame) == 0)
|
||||||
{
|
{
|
||||||
memcpy(bbp->data + bbp->count * sfmt->channels_per_frame,
|
memcpy(bbp->data + bbp->count * sfmt->channels_per_frame,
|
||||||
bp->data, bp->count * sfmt->bytes_per_frame);
|
bp->data,
|
||||||
memcpy(bp->data, bbp->data, total * sfmt->bytes_per_frame);
|
bp->count * sfmt->bytes_per_frame);
|
||||||
bp->count = total;
|
memcpy(bp->data,
|
||||||
|
bbp->data + bp->count * sfmt->channels_per_frame,
|
||||||
|
bbp->count * sfmt->bytes_per_frame);
|
||||||
|
bp->count = bbp->count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bp->count >= 2 * LPC_ORDER)
|
if (bp->count >= 2 * LPC_ORDER)
|
||||||
|
|
12
src/m4af.c
12
src/m4af.c
|
@ -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_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;
|
m4af_ctx_t *ctx;
|
||||||
int64_t timestamp;
|
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));
|
memcpy(&ctx->io, io, sizeof(m4af_io_callbacks_t));
|
||||||
ctx->io_cookie = io_cookie;
|
ctx->io_cookie = io_cookie;
|
||||||
ctx->timescale = timescale;
|
ctx->timescale = timescale;
|
||||||
timestamp = m4af_timestamp();
|
timestamp = no_timestamp ? 0 : m4af_timestamp();
|
||||||
ctx->creation_time = timestamp;
|
ctx->creation_time = timestamp;
|
||||||
ctx->modification_time = timestamp;
|
ctx->modification_time = timestamp;
|
||||||
ctx->num_tracks = 1;
|
ctx->num_tracks = 1;
|
||||||
|
@ -1103,8 +1103,10 @@ void m4af_write_tkhd_box(m4af_ctx_t *ctx, uint32_t track_idx)
|
||||||
{
|
{
|
||||||
m4af_track_t *track = &ctx->track[track_idx];
|
m4af_track_t *track = &ctx->track[track_idx];
|
||||||
int64_t pos = m4af_tell(ctx);
|
int64_t pos = m4af_tell(ctx);
|
||||||
int64_t duration =
|
int64_t duration = track->duration;
|
||||||
(double)track->duration / track->timescale * ctx->timescale + .5;
|
if (ctx->priming_mode & M4AF_PRIMING_MODE_EDTS)
|
||||||
|
duration -= (track->encoder_delay + track->padding);
|
||||||
|
duration = (double)duration / track->timescale * ctx->timescale + .5;
|
||||||
uint8_t version = (track->creation_time > UINT32_MAX ||
|
uint8_t version = (track->creation_time > UINT32_MAX ||
|
||||||
track->modification_time > UINT32_MAX ||
|
track->modification_time > UINT32_MAX ||
|
||||||
duration > UINT32_MAX);
|
duration > UINT32_MAX);
|
||||||
|
@ -1169,6 +1171,8 @@ int64_t m4af_movie_duration(m4af_ctx_t *ctx)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < ctx->num_tracks; ++i) {
|
for (i = 0; i < ctx->num_tracks; ++i) {
|
||||||
double x = ctx->track[i].duration;
|
double x = ctx->track[i].duration;
|
||||||
|
if (ctx->priming_mode & M4AF_PRIMING_MODE_EDTS)
|
||||||
|
x -= (ctx->track[i].encoder_delay + ctx->track[i].padding);
|
||||||
int64_t duration = x / ctx->track[i].timescale * ctx->timescale + .5;
|
int64_t duration = x / ctx->track[i].timescale * ctx->timescale + .5;
|
||||||
if (duration > movie_duration)
|
if (duration > movie_duration)
|
||||||
movie_duration = duration;
|
movie_duration = duration;
|
||||||
|
|
|
@ -75,7 +75,7 @@ typedef struct m4af_ctx_t m4af_ctx_t;
|
||||||
|
|
||||||
|
|
||||||
m4af_ctx_t *m4af_create(uint32_t codec, uint32_t timescale,
|
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);
|
int m4af_begin_write(m4af_ctx_t *ctx);
|
||||||
|
|
||||||
|
|
71
src/main.c
71
src/main.c
|
@ -121,10 +121,9 @@ PROGNAME " %s\n"
|
||||||
" -m, --bitrate-mode <n> Bitrate configuration\n"
|
" -m, --bitrate-mode <n> Bitrate configuration\n"
|
||||||
" 0: CBR (default)\n"
|
" 0: CBR (default)\n"
|
||||||
" 1-5: VBR\n"
|
" 1-5: VBR\n"
|
||||||
" (VBR mode is not officially supported, and\n"
|
" (VBR mode 1 is tuned for HE-AAC v2\n"
|
||||||
" works only on a certain combination of\n"
|
" VBR mode 2 is tuned for HE-AAC\n"
|
||||||
" parameter settings, sample rate, and\n"
|
" VBR mode 3 or greater is for AAC LC)\n"
|
||||||
" channel configuration)\n"
|
|
||||||
" -w, --bandwidth <n> Frequency bandwidth in Hz (AAC LC only)\n"
|
" -w, --bandwidth <n> Frequency bandwidth in Hz (AAC LC only)\n"
|
||||||
" -a, --afterburner <n> Afterburner\n"
|
" -a, --afterburner <n> Afterburner\n"
|
||||||
" 0: Off\n"
|
" 0: Off\n"
|
||||||
|
@ -159,6 +158,7 @@ PROGNAME " %s\n"
|
||||||
" -I, --ignorelength Ignore length of WAV header\n"
|
" -I, --ignorelength Ignore length of WAV header\n"
|
||||||
" -S, --silent Don't print progress messages\n"
|
" -S, --silent Don't print progress messages\n"
|
||||||
" --moov-before-mdat Place moov box before mdat box on m4a output\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"
|
"\n"
|
||||||
"Options for raw (headerless) input:\n"
|
"Options for raw (headerless) input:\n"
|
||||||
" -R, --raw Treat input as raw (by default WAV is\n"
|
" -R, --raw Treat input as raw (by default WAV is\n"
|
||||||
|
@ -221,6 +221,8 @@ typedef struct aacenc_param_ex_t {
|
||||||
unsigned raw_rate;
|
unsigned raw_rate;
|
||||||
const char *raw_format;
|
const char *raw_format;
|
||||||
|
|
||||||
|
int no_timestamp;
|
||||||
|
|
||||||
aacenc_tag_store_t tags;
|
aacenc_tag_store_t tags;
|
||||||
aacenc_tag_store_t source_tags;
|
aacenc_tag_store_t source_tags;
|
||||||
aacenc_translate_generic_text_tag_ctx_t source_tag_ctx;
|
aacenc_translate_generic_text_tag_ctx_t source_tag_ctx;
|
||||||
|
@ -244,7 +246,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_LONG_TAG M4AF_FOURCC('l','t','a','g')
|
||||||
#define OPT_TAG_FROM_JSON M4AF_FOURCC('t','f','j','s')
|
#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' },
|
{ "help", no_argument, 0, 'h' },
|
||||||
{ "profile", required_argument, 0, 'p' },
|
{ "profile", required_argument, 0, 'p' },
|
||||||
{ "bitrate", required_argument, 0, 'b' },
|
{ "bitrate", required_argument, 0, 'b' },
|
||||||
|
@ -284,12 +286,14 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
|
||||||
{ "tag-from-file", required_argument, 0, OPT_SHORT_TAG_FILE },
|
{ "tag-from-file", required_argument, 0, OPT_SHORT_TAG_FILE },
|
||||||
{ "long-tag", required_argument, 0, OPT_LONG_TAG },
|
{ "long-tag", required_argument, 0, OPT_LONG_TAG },
|
||||||
{ "tag-from-json", required_argument, 0, OPT_TAG_FROM_JSON },
|
{ "tag-from-json", required_argument, 0, OPT_TAG_FROM_JSON },
|
||||||
|
|
||||||
|
{ "no-timestamp", no_argument, 0, '#' },
|
||||||
{ 0, 0, 0, 0 },
|
{ 0, 0, 0, 0 },
|
||||||
};
|
};
|
||||||
params->afterburner = 1;
|
params->afterburner = 1;
|
||||||
|
|
||||||
aacenc_getmainargs(&argc, &argv);
|
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) {
|
long_options, 0)) != EOF) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'h':
|
case 'h':
|
||||||
|
@ -456,6 +460,9 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
|
||||||
case OPT_TAG_FROM_JSON:
|
case OPT_TAG_FROM_JSON:
|
||||||
params->json_filename = optarg;
|
params->json_filename = optarg;
|
||||||
break;
|
break;
|
||||||
|
case '#':
|
||||||
|
params->no_timestamp = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return usage(), -1;
|
return usage(), -1;
|
||||||
}
|
}
|
||||||
|
@ -503,12 +510,17 @@ int write_sample(FILE *ofp, m4af_ctx_t *m4af, aacenc_frame_t *frame)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int do_smart_padding(int profile)
|
||||||
|
{
|
||||||
|
return profile == 2 || profile == 5 || profile == 29;
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
|
int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
|
||||||
HANDLE_AACENCODER encoder, uint32_t frame_length,
|
HANDLE_AACENCODER encoder, uint32_t frame_length,
|
||||||
m4af_ctx_t *m4af)
|
m4af_ctx_t *m4af)
|
||||||
{
|
{
|
||||||
int16_t *ibuf = 0, *ip;
|
INT_PCM *ibuf = 0, *ip;
|
||||||
aacenc_frame_t obuf[2] = {{ 0 }}, *obp;
|
aacenc_frame_t obuf[2] = {{ 0 }}, *obp;
|
||||||
unsigned flip = 0;
|
unsigned flip = 0;
|
||||||
int nread = 1;
|
int nread = 1;
|
||||||
|
@ -517,15 +529,12 @@ int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
|
||||||
int frames_written = 0, encoded = 0;
|
int frames_written = 0, encoded = 0;
|
||||||
aacenc_progress_t progress = { 0 };
|
aacenc_progress_t progress = { 0 };
|
||||||
const pcm_sample_description_t *fmt = pcm_get_format(reader);
|
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);
|
ibuf = malloc(frame_length * fmt->bytes_per_frame);
|
||||||
aacenc_progress_init(&progress, pcm_get_length(reader), fmt->sample_rate);
|
aacenc_progress_init(&progress, pcm_get_length(reader), fmt->sample_rate);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/*
|
|
||||||
* Since we delay the write, we cannot just exit loop when interrupted.
|
|
||||||
* Instead, we regard it as EOF.
|
|
||||||
*/
|
|
||||||
if (g_interrupted)
|
if (g_interrupted)
|
||||||
nread = 0;
|
nread = 0;
|
||||||
if (nread > 0) {
|
if (nread > 0) {
|
||||||
|
@ -548,7 +557,7 @@ int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
|
||||||
|
|
||||||
remaining -= consumed;
|
remaining -= consumed;
|
||||||
ip += consumed * fmt->channels_per_frame;
|
ip += consumed * fmt->channels_per_frame;
|
||||||
flip ^= 1;
|
if (is_padding) {
|
||||||
/*
|
/*
|
||||||
* As we pad 1 frame at beginning and ending by our extrapolator,
|
* As we pad 1 frame at beginning and ending by our extrapolator,
|
||||||
* we want to drop them.
|
* we want to drop them.
|
||||||
|
@ -557,14 +566,17 @@ int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
|
||||||
* Since sbr_header is included in the first frame (in case of
|
* Since sbr_header is included in the first frame (in case of
|
||||||
* SBR), we cannot discard first frame. So we pick second instead.
|
* SBR), we cannot discard first frame. So we pick second instead.
|
||||||
*/
|
*/
|
||||||
|
flip ^= 1;
|
||||||
++encoded;
|
++encoded;
|
||||||
if (encoded == 1 || encoded == 3)
|
if (encoded == 1 || encoded == 3)
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (write_sample(params->output_fp, m4af, &obuf[flip]) < 0)
|
if (write_sample(params->output_fp, m4af, &obuf[flip]) < 0)
|
||||||
goto END;
|
goto END;
|
||||||
++frames_written;
|
++frames_written;
|
||||||
} while (remaining > 0);
|
} while (remaining > 0);
|
||||||
|
}
|
||||||
|
DONE:
|
||||||
/*
|
/*
|
||||||
* When interrupted, we haven't pulled out last extrapolated frames
|
* When interrupted, we haven't pulled out last extrapolated frames
|
||||||
* from the reader. Therefore, we have to write the final outcome.
|
* from the reader. Therefore, we have to write the final outcome.
|
||||||
|
@ -574,8 +586,6 @@ int encode(aacenc_param_ex_t *params, pcm_reader_t *reader,
|
||||||
goto END;
|
goto END;
|
||||||
++frames_written;
|
++frames_written;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
DONE:
|
|
||||||
if (!params->silent)
|
if (!params->silent)
|
||||||
aacenc_progress_finish(&progress, pcm_get_position(reader));
|
aacenc_progress_finish(&progress, pcm_get_position(reader));
|
||||||
rc = frames_written;
|
rc = frames_written;
|
||||||
|
@ -755,8 +765,10 @@ pcm_reader_t *open_input(aacenc_param_ex_t *params)
|
||||||
reader = pcm_open_native_converter(reader);
|
reader = pcm_open_native_converter(reader);
|
||||||
if (reader && PCM_IS_FLOAT(pcm_get_format(reader)))
|
if (reader && PCM_IS_FLOAT(pcm_get_format(reader)))
|
||||||
reader = limiter_open(reader);
|
reader = limiter_open(reader);
|
||||||
if (reader && (reader = pcm_open_sint16_converter(reader)) != 0)
|
if (reader && (reader = pcm_open_sint16_converter(reader)) != 0) {
|
||||||
|
if (do_smart_padding(params->profile))
|
||||||
reader = extrapolater_open(reader);
|
reader = extrapolater_open(reader);
|
||||||
|
}
|
||||||
return reader;
|
return reader;
|
||||||
FAIL:
|
FAIL:
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -828,7 +840,7 @@ int main(int argc, char **argv)
|
||||||
unsigned framelen = aacinfo.frameLength;
|
unsigned framelen = aacinfo.frameLength;
|
||||||
scale = sample_format->sample_rate >> scale_shift;
|
scale = sample_format->sample_rate >> scale_shift;
|
||||||
if ((m4af = m4af_create(M4AF_CODEC_MP4A, scale, &m4af_io,
|
if ((m4af = m4af_create(M4AF_CODEC_MP4A, scale, &m4af_io,
|
||||||
params.output_fp)) < 0)
|
params.output_fp, params.no_timestamp)) < 0)
|
||||||
goto END;
|
goto END;
|
||||||
m4af_set_num_channels(m4af, 0, sample_format->channels_per_frame);
|
m4af_set_num_channels(m4af, 0, sample_format->channels_per_frame);
|
||||||
m4af_set_fixed_frame_duration(m4af, 0, framelen >> scale_shift);
|
m4af_set_fixed_frame_duration(m4af, 0, framelen >> scale_shift);
|
||||||
|
@ -846,29 +858,22 @@ int main(int argc, char **argv)
|
||||||
m4af_set_priming_mode(m4af, params.gapless_mode + 1);
|
m4af_set_priming_mode(m4af, params.gapless_mode + 1);
|
||||||
m4af_begin_write(m4af);
|
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(¶ms, reader, encoder, aacinfo.frameLength, m4af);
|
frame_count = encode(¶ms, reader, encoder, aacinfo.frameLength, m4af);
|
||||||
if (frame_count < 0)
|
if (frame_count < 0)
|
||||||
goto END;
|
goto END;
|
||||||
if (m4af) {
|
if (m4af) {
|
||||||
uint32_t delay = aacinfo.encoderDelay;
|
|
||||||
uint32_t padding;
|
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);
|
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;
|
padding = frame_count * aacinfo.frameLength - frames_read - delay;
|
||||||
m4af_set_priming(m4af, 0, delay >> scale_shift, padding >> scale_shift);
|
m4af_set_priming(m4af, 0, delay >> scale_shift, padding >> scale_shift);
|
||||||
if (finalize_m4a(m4af, ¶ms, encoder) < 0)
|
if (finalize_m4a(m4af, ¶ms, encoder) < 0)
|
||||||
|
|
|
@ -60,6 +60,8 @@ int pcm_skip(pcm_io_context_t *io, int64_t count)
|
||||||
|
|
||||||
if (count == 0 || pcm_seek(io, count, SEEK_CUR) >= 0)
|
if (count == 0 || pcm_seek(io, count, SEEK_CUR) >= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
if (count < 0)
|
||||||
|
return -1;
|
||||||
do {
|
do {
|
||||||
if ((rc = vp->read(io->cookie, buff, count > 8192 ? 8192 : count)) > 0)
|
if ((rc = vp->read(io->cookie, buff, count > 8192 ? 8192 : count)) > 0)
|
||||||
count -= rc;
|
count -= rc;
|
||||||
|
@ -293,6 +295,10 @@ int apple_chan_chunk(pcm_io_context_t *io, uint32_t chunk_size,
|
||||||
layout = "\x03\x01\x02\x09"; break;
|
layout = "\x03\x01\x02\x09"; break;
|
||||||
case kAudioChannelLayoutTag_AC3_3_1:
|
case kAudioChannelLayoutTag_AC3_3_1:
|
||||||
layout = "\x01\x03\x02\x09"; break;
|
layout = "\x01\x03\x02\x09"; break;
|
||||||
|
case kAudioChannelLayoutTag_WAVE_4_0_B:
|
||||||
|
layout = "\x01\x02\x05\x06"; break;
|
||||||
|
case kAudioChannelLayoutTag_Logic_4_0_C:
|
||||||
|
layout = "\x01\x02\x09\x03"; break;
|
||||||
/* 4.1ch */
|
/* 4.1ch */
|
||||||
case kAudioChannelLayoutTag_DVD_6:
|
case kAudioChannelLayoutTag_DVD_6:
|
||||||
layout = "\x01\x02\x04\x0A\x0B"; break;
|
layout = "\x01\x02\x04\x0A\x0B"; break;
|
||||||
|
@ -302,6 +308,8 @@ int apple_chan_chunk(pcm_io_context_t *io, uint32_t chunk_size,
|
||||||
layout = "\x01\x02\x03\x04\x09"; break;
|
layout = "\x01\x02\x03\x04\x09"; break;
|
||||||
case kAudioChannelLayoutTag_AC3_3_1_1:
|
case kAudioChannelLayoutTag_AC3_3_1_1:
|
||||||
layout = "\x01\x03\x02\x09\x04"; break;
|
layout = "\x01\x03\x02\x09\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_4_1:
|
||||||
|
layout = "\x03\x01\x02\x09\x04"; break;
|
||||||
/* 5ch */
|
/* 5ch */
|
||||||
case kAudioChannelLayoutTag_MPEG_5_0_A:
|
case kAudioChannelLayoutTag_MPEG_5_0_A:
|
||||||
layout = "\x01\x02\x03\x0A\x0B"; break;
|
layout = "\x01\x02\x03\x0A\x0B"; break;
|
||||||
|
@ -312,6 +320,8 @@ int apple_chan_chunk(pcm_io_context_t *io, uint32_t chunk_size,
|
||||||
layout = "\x01\x03\x02\x0A\x0B"; break;
|
layout = "\x01\x03\x02\x0A\x0B"; break;
|
||||||
case kAudioChannelLayoutTag_MPEG_5_0_D:
|
case kAudioChannelLayoutTag_MPEG_5_0_D:
|
||||||
layout = "\x03\x01\x02\x0A\x0B"; break;
|
layout = "\x03\x01\x02\x0A\x0B"; break;
|
||||||
|
case kAudioChannelLayoutTag_WAVE_5_0_B:
|
||||||
|
layout = "\x01\x02\x03\x05\x06"; break;
|
||||||
/* 5.1ch */
|
/* 5.1ch */
|
||||||
case kAudioChannelLayoutTag_MPEG_5_1_A:
|
case kAudioChannelLayoutTag_MPEG_5_1_A:
|
||||||
layout = "\x01\x02\x03\x04\x0A\x0B"; break;
|
layout = "\x01\x02\x03\x04\x0A\x0B"; break;
|
||||||
|
@ -321,17 +331,49 @@ int apple_chan_chunk(pcm_io_context_t *io, uint32_t chunk_size,
|
||||||
layout = "\x01\x03\x02\x0A\x0B\x04"; break;
|
layout = "\x01\x03\x02\x0A\x0B\x04"; break;
|
||||||
case kAudioChannelLayoutTag_MPEG_5_1_D:
|
case kAudioChannelLayoutTag_MPEG_5_1_D:
|
||||||
layout = "\x03\x01\x02\x0A\x0B\x04"; break;
|
layout = "\x03\x01\x02\x0A\x0B\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_WAVE_5_1_B:
|
||||||
|
layout = "\x01\x02\x03\x04\x05\x06"; break;
|
||||||
/* 6ch */
|
/* 6ch */
|
||||||
case kAudioChannelLayoutTag_Hexagonal:
|
case kAudioChannelLayoutTag_Hexagonal:
|
||||||
case kAudioChannelLayoutTag_AudioUnit_6_0:
|
case kAudioChannelLayoutTag_AudioUnit_6_0:
|
||||||
layout = "\x01\x02\x0A\x0B\x03\x09"; break;
|
layout = "\x01\x02\x0A\x0B\x03\x09"; break;
|
||||||
case kAudioChannelLayoutTag_AAC_6_0:
|
case kAudioChannelLayoutTag_AAC_6_0:
|
||||||
layout = "\x03\x01\x02\x0A\x0B\x09"; break;
|
layout = "\x03\x01\x02\x0A\x0B\x09"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC_6_0_A:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x09"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_6_0_A:
|
||||||
|
layout = "\x07\x08\x01\x02\x0A\x0B"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_6_0_B:
|
||||||
|
layout = "\x03\x01\x02\x05\x06\x0C"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_6_0_C:
|
||||||
|
layout = "\x03\x09\x01\x02\x05\x06"; break;
|
||||||
|
case kAudioChannelLayoutTag_Logic_6_0_B:
|
||||||
|
layout = "\x01\x02\x0A\x0B\x09\x03"; break;
|
||||||
/* 6.1ch */
|
/* 6.1ch */
|
||||||
case kAudioChannelLayoutTag_MPEG_6_1_A:
|
case kAudioChannelLayoutTag_MPEG_6_1_A:
|
||||||
layout = "\x01\x02\x03\x04\x0A\x0B\x09"; break;
|
layout = "\x01\x02\x03\x04\x0A\x0B\x09"; break;
|
||||||
case kAudioChannelLayoutTag_AAC_6_1:
|
case kAudioChannelLayoutTag_AAC_6_1:
|
||||||
layout = "\x03\x01\x02\x0A\x0B\x09\x04"; break;
|
layout = "\x03\x01\x02\x0A\x0B\x09\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_6_1_A:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x09"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_6_1_B:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x0C"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_6_1_C:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x0E"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_6_1_A:
|
||||||
|
layout = "\x07\x08\x01\x02\x0A\x0B\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_6_1_B:
|
||||||
|
layout = "\x03\x01\x02\x05\x06\x0C\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_6_1_C:
|
||||||
|
layout = "\x03\x09\x01\x02\x05\x06\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_6_1_D:
|
||||||
|
layout = "\x03\x01\x02\x0A\x0B\x04\x09"; break;
|
||||||
|
case kAudioChannelLayoutTag_WAVE_6_1:
|
||||||
|
layout = "\x01\x02\x03\x04\x09\x0A\x0B"; break;
|
||||||
|
case kAudioChannelLayoutTag_Logic_6_1_B:
|
||||||
|
layout = "\x01\x02\x0A\x0B\x09\x03\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_Logic_6_1_D:
|
||||||
|
layout = "\x01\x03\x02\x0A\x09\x0B\x04"; break;
|
||||||
/* 7ch */
|
/* 7ch */
|
||||||
case kAudioChannelLayoutTag_AudioUnit_7_0:
|
case kAudioChannelLayoutTag_AudioUnit_7_0:
|
||||||
layout = "\x01\x02\x0A\x0B\x03\x05\x06"; break;
|
layout = "\x01\x02\x0A\x0B\x03\x05\x06"; break;
|
||||||
|
@ -339,6 +381,10 @@ int apple_chan_chunk(pcm_io_context_t *io, uint32_t chunk_size,
|
||||||
layout = "\x01\x02\x0A\x0B\x03\x07\x08"; break;
|
layout = "\x01\x02\x0A\x0B\x03\x07\x08"; break;
|
||||||
case kAudioChannelLayoutTag_AAC_7_0:
|
case kAudioChannelLayoutTag_AAC_7_0:
|
||||||
layout = "\x03\x01\x02\x0A\x0B\x05\x06"; break;
|
layout = "\x03\x01\x02\x0A\x0B\x05\x06"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC_7_0_A:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x05\x06"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_7_0:
|
||||||
|
layout = "\x07\x03\x08\x01\x02\x0A\x0B"; break;
|
||||||
/* 7.1ch */
|
/* 7.1ch */
|
||||||
case kAudioChannelLayoutTag_MPEG_7_1_A:
|
case kAudioChannelLayoutTag_MPEG_7_1_A:
|
||||||
layout = "\x01\x02\x03\x04\x0A\x0B\x07\x08"; break;
|
layout = "\x01\x02\x03\x04\x0A\x0B\x07\x08"; break;
|
||||||
|
@ -348,11 +394,37 @@ int apple_chan_chunk(pcm_io_context_t *io, uint32_t chunk_size,
|
||||||
layout = "\x01\x02\x03\x04\x0A\x0B\x05\x06"; break;
|
layout = "\x01\x02\x03\x04\x0A\x0B\x05\x06"; break;
|
||||||
case kAudioChannelLayoutTag_Emagic_Default_7_1:
|
case kAudioChannelLayoutTag_Emagic_Default_7_1:
|
||||||
layout = "\x01\x02\x0A\x0B\x03\x04\x07\x08"; break;
|
layout = "\x01\x02\x0A\x0B\x03\x04\x07\x08"; break;
|
||||||
|
case kAudioChannelLayoutTag_AAC_7_1_B:
|
||||||
|
layout = "\x03\x01\x02\x0A\x0B\x05\x06\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_AAC_7_1_C:
|
||||||
|
layout = "\x03\x01\x02\x0A\x0B\x04\x0D\x0F"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_7_1_A:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x05\x06"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_7_1_B:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x07\x08"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_7_1_E:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x0D\x0F"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_7_1_F:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x09\x0C"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_7_1_G:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x09\x0E"; break;
|
||||||
|
case kAudioChannelLayoutTag_EAC3_7_1_H:
|
||||||
|
layout = "\x01\x03\x02\x0A\x0B\x04\x0C\x0E"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_7_1:
|
||||||
|
layout = "\x07\x03\x08\x01\x02\x0A\x0B\x04"; break;
|
||||||
|
case kAudioChannelLayoutTag_WAVE_7_1:
|
||||||
|
layout = "\x01\x02\x03\x04\x05\x06\x0A\x0B"; break;
|
||||||
|
case kAudioChannelLayoutTag_Logic_7_1_B:
|
||||||
|
layout = "\x01\x02\x0A\x0B\x05\x06\x03\x04"; break;
|
||||||
/* 8ch */
|
/* 8ch */
|
||||||
case kAudioChannelLayoutTag_Octagonal:
|
case kAudioChannelLayoutTag_Octagonal:
|
||||||
layout = "\x01\x02\x05\x06\x03\x09\x0A\x0B"; break;
|
layout = "\x01\x02\x05\x06\x03\x09\x0A\x0B"; break;
|
||||||
case kAudioChannelLayoutTag_AAC_Octagonal:
|
case kAudioChannelLayoutTag_AAC_Octagonal:
|
||||||
layout = "\x03\x01\x02\x0A\x0B\x05\x06\x09"; break;
|
layout = "\x03\x01\x02\x0A\x0B\x05\x06\x09"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_8_0_A:
|
||||||
|
layout = "\x07\x08\x01\x02\x0A\x0B\x05\x06"; break;
|
||||||
|
case kAudioChannelLayoutTag_DTS_8_0_B:
|
||||||
|
layout = "\x07\x03\x08\x01\x02\x0A\x09\x0B"; break;
|
||||||
default:
|
default:
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#if HAVE_STDINT_H
|
#if HAVE_STDINT_H
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <assert.h>
|
||||||
|
#include <fdk-aac/aacenc_lib.h>
|
||||||
#include "pcm_reader.h"
|
#include "pcm_reader.h"
|
||||||
|
|
||||||
typedef struct pcm_sint16_converter_t {
|
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;
|
count = nframes * sfmt->channels_per_frame;
|
||||||
if (PCM_IS_FLOAT(sfmt)) {
|
if (PCM_IS_FLOAT(sfmt)) {
|
||||||
float *ip = self->pivot;
|
float *ip = self->pivot;
|
||||||
int16_t *op = buffer;
|
INT_PCM *op = buffer;
|
||||||
|
#if SAMPLE_BITS == 16
|
||||||
for (i = 0; i < count; ++i)
|
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 {
|
} else {
|
||||||
int32_t *ip = self->pivot;
|
int32_t *ip = self->pivot;
|
||||||
int16_t *op = buffer;
|
INT_PCM *op = buffer;
|
||||||
|
#if SAMPLE_BITS == 16
|
||||||
if (sfmt->bits_per_channel <= 16) {
|
if (sfmt->bits_per_channel <= 16) {
|
||||||
for (i = 0; i < count; ++i)
|
for (i = 0; i < count; ++i)
|
||||||
op[i] = ip[i] >> 16;
|
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;
|
op[i] = (n == 0x8000) ? 0x7fff : n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
for (i = 0; i < count; ++i)
|
||||||
|
op[i] = ip[i];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return nframes;
|
return nframes;
|
||||||
}
|
}
|
||||||
|
@ -94,14 +106,16 @@ pcm_reader_t *pcm_open_sint16_converter(pcm_reader_t *reader)
|
||||||
pcm_sint16_converter_t *self = 0;
|
pcm_sint16_converter_t *self = 0;
|
||||||
pcm_sample_description_t *fmt;
|
pcm_sample_description_t *fmt;
|
||||||
|
|
||||||
|
assert((SAMPLE_BITS>>3) == sizeof(INT_PCM));
|
||||||
|
|
||||||
if ((self = calloc(1, sizeof(pcm_sint16_converter_t))) == 0)
|
if ((self = calloc(1, sizeof(pcm_sint16_converter_t))) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
self->src = reader;
|
self->src = reader;
|
||||||
self->vtbl = &my_vtable;
|
self->vtbl = &my_vtable;
|
||||||
memcpy(&self->format, pcm_get_format(reader), sizeof(self->format));
|
memcpy(&self->format, pcm_get_format(reader), sizeof(self->format));
|
||||||
fmt = &self->format;
|
fmt = &self->format;
|
||||||
fmt->bits_per_channel = 16;
|
fmt->bits_per_channel = SAMPLE_BITS;
|
||||||
fmt->sample_type = PCM_TYPE_SINT;
|
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;
|
return (pcm_reader_t *)self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,8 +113,10 @@ int wav_fmt(wav_reader_t *reader, uint32_t size)
|
||||||
wValidBitsPerSample = wBitsPerSample;
|
wValidBitsPerSample = wBitsPerSample;
|
||||||
|
|
||||||
ENSURE(wFormatTag == 1 || wFormatTag == 3 || wFormatTag == 0xfffe);
|
ENSURE(wFormatTag == 1 || wFormatTag == 3 || wFormatTag == 0xfffe);
|
||||||
ENSURE(nChannels && nSamplesPerSec && nAvgBytesPerSec &&
|
ENSURE(nChannels > 0 && nChannels <= 8 &&
|
||||||
nBlockAlign && wBitsPerSample && !(wBitsPerSample & 7) &&
|
nSamplesPerSec && nAvgBytesPerSec &&
|
||||||
|
nBlockAlign && nBlockAlign < 256 &&
|
||||||
|
wBitsPerSample && wBitsPerSample < 256 && !(wBitsPerSample & 7) &&
|
||||||
nBlockAlign == nChannels * wBitsPerSample / 8);
|
nBlockAlign == nChannels * wBitsPerSample / 8);
|
||||||
|
|
||||||
if (wFormatTag == 3)
|
if (wFormatTag == 3)
|
||||||
|
@ -155,6 +157,7 @@ static
|
||||||
int wav_parse(wav_reader_t *reader, int64_t *data_length)
|
int wav_parse(wav_reader_t *reader, int64_t *data_length)
|
||||||
{
|
{
|
||||||
uint32_t container, fcc, chunk_size;
|
uint32_t container, fcc, chunk_size;
|
||||||
|
int fmt_seen = 0;
|
||||||
|
|
||||||
*data_length = 0;
|
*data_length = 0;
|
||||||
container = riff_next_chunk(reader, &chunk_size);
|
container = riff_next_chunk(reader, &chunk_size);
|
||||||
|
@ -167,6 +170,7 @@ int wav_parse(wav_reader_t *reader, int64_t *data_length)
|
||||||
riff_ds64(reader, data_length);
|
riff_ds64(reader, data_length);
|
||||||
while ((fcc = riff_next_chunk(reader, &chunk_size)) != 0) {
|
while ((fcc = riff_next_chunk(reader, &chunk_size)) != 0) {
|
||||||
if (fcc == RIFF_FOURCC('f','m','t',' ')) {
|
if (fcc == RIFF_FOURCC('f','m','t',' ')) {
|
||||||
|
fmt_seen = 1;
|
||||||
if (wav_fmt(reader, chunk_size) < 0)
|
if (wav_fmt(reader, chunk_size) < 0)
|
||||||
goto FAIL;
|
goto FAIL;
|
||||||
} else if (fcc == RIFF_FOURCC('d','a','t','a')) {
|
} else if (fcc == RIFF_FOURCC('d','a','t','a')) {
|
||||||
|
@ -178,7 +182,7 @@ int wav_parse(wav_reader_t *reader, int64_t *data_length)
|
||||||
TRY_IO(pcm_skip(&reader->io, (chunk_size + 1) & ~1));
|
TRY_IO(pcm_skip(&reader->io, (chunk_size + 1) & ~1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fcc == RIFF_FOURCC('d','a','t','a'))
|
ENSURE(fmt_seen && fcc == RIFF_FOURCC('d', 'a', 't', 'a'));
|
||||||
return 0;
|
return 0;
|
||||||
FAIL:
|
FAIL:
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue