mirror of https://github.com/nu774/fdkaac.git
Compare commits
27 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 |
|
@ -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
|
||||
stamp-h1
|
||||
fdkaac
|
||||
.vscode
|
||||
fdk-aac
|
||||
MSVC/Release
|
||||
MSVC/Debug
|
||||
MSVC/x64/Release
|
||||
MSVC/x64/Debug
|
||||
MSVC/fdk-aac
|
||||
MSVC/*.vcxproj.user
|
||||
|
|
84
ChangeLog
84
ChangeLog
|
@ -1,8 +1,88 @@
|
|||
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 [HEAD -> master]
|
||||
* update ChangeLog
|
||||
|
||||
* bump [origin/master]
|
||||
* bump [v0.6.3]
|
||||
|
||||
* Ticket #23: quit supporting MPEG-2 AOT
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<RootNamespace>fdk-aac</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '17.0'">v143</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>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<RootNamespace>fdkaac</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(MSBuildToolsVersion)' == '17.0'">v143</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>
|
||||
|
|
|
@ -22,8 +22,10 @@ fdkaac_SOURCES = \
|
|||
|
||||
dist_man_MANS = man/fdkaac.1
|
||||
|
||||
fdkaac_CFLAGS = @CFLAGS@ @FDK_AAC_CFLAGS@
|
||||
|
||||
fdkaac_LDADD = \
|
||||
@LIBICONV@ @CHARSET_LIB@ -lfdk-aac -lm
|
||||
@LIBICONV@ @CHARSET_LIB@ @FDK_AAC_LIBS@ -lm
|
||||
|
||||
.rc.o:
|
||||
$(RC) $< -o $@
|
||||
|
|
|
@ -6,6 +6,7 @@ changequote([,])dnl
|
|||
AC_INIT([fdkaac], [XX_VERSION], [honeycomb77@gmail.com])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_AUX_DIR([.])
|
||||
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
|
@ -15,8 +16,7 @@ AC_CHECK_TOOL(RC, windres,)
|
|||
|
||||
AC_CHECK_HEADERS([sys/time.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]))
|
||||
PKG_CHECK_MODULES([FDK_AAC],[fdk-aac])
|
||||
|
||||
AC_C_INLINE
|
||||
AC_C_BIGENDIAN
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright (C) 2013 nu774
|
||||
# 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_by_date_author = groupby(commits, key=lambda x: (x.date, x.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:
|
||||
output(u' * {0}{1}\n\n'.format(c.subject, c.ref).encode('utf-8'))
|
||||
output(f' * {c.subject}{c.ref}\n\n')
|
||||
|
|
|
@ -75,8 +75,10 @@ int caf_desc(caf_reader_t *reader, int64_t chunk_size)
|
|||
ENSURE(mFormatID == M4AF_FOURCC('l','p','c','m'));
|
||||
ENSURE(mSampleRate && mBytesPerPacket &&
|
||||
mChannelsPerFrame >= 1 && mChannelsPerFrame <= 8 &&
|
||||
mBitsPerChannel && mFramesPerPacket == 1 &&
|
||||
mBitsPerChannel > 0 && mBitsPerChannel < 256 &&
|
||||
mFramesPerPacket == 1 &&
|
||||
mBytesPerPacket % mChannelsPerFrame == 0 &&
|
||||
mBytesPerPacket < 256 &&
|
||||
mBytesPerPacket >= mChannelsPerFrame * ((mBitsPerChannel + 7) / 8));
|
||||
|
||||
desc->sample_rate = mSampleRate;
|
||||
|
@ -103,10 +105,14 @@ int caf_info(caf_reader_t *reader, int64_t chunk_size)
|
|||
{
|
||||
char *buf, *key, *val, *end;
|
||||
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;
|
||||
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;
|
||||
end = buf + chunk_size;
|
||||
do {
|
||||
|
@ -172,6 +178,7 @@ int caf_parse(caf_reader_t *reader, int64_t *data_length)
|
|||
{
|
||||
uint32_t fcc;
|
||||
int64_t chunk_size;
|
||||
int desc_seen = 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 */
|
||||
|
||||
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));
|
||||
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));
|
||||
else if (fcc == M4AF_FOURCC('c','h','a','n')) {
|
||||
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));
|
||||
}
|
||||
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;
|
||||
FAIL:
|
||||
return -1;
|
||||
|
|
|
@ -207,7 +207,6 @@ enum
|
|||
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_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_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
|
||||
|
@ -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_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_3_0 = (150L<<16) | 3, // L C R
|
||||
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_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
|
||||
};
|
||||
|
||||
|
|
|
@ -144,17 +144,22 @@ static int process1(extrapolater_t *self, void *buffer, unsigned nframes)
|
|||
assert(bp->count <= nframes);
|
||||
memcpy(buffer, bp->data, bp->count * sfmt->bytes_per_frame);
|
||||
if (!fetch(self, nframes)) {
|
||||
// got EOF
|
||||
buffer_t *bbp = &self->buffer[self->nbuffer];
|
||||
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;
|
||||
if (bbp->count &&
|
||||
realloc_buffer(bbp, total * sfmt->bytes_per_frame) == 0 &&
|
||||
realloc_buffer(bp, total * sfmt->bytes_per_frame) == 0)
|
||||
{
|
||||
memcpy(bbp->data + bbp->count * sfmt->channels_per_frame,
|
||||
bp->data, bp->count * sfmt->bytes_per_frame);
|
||||
memcpy(bp->data, bbp->data, total * sfmt->bytes_per_frame);
|
||||
bp->count = total;
|
||||
bp->data,
|
||||
bp->count * sfmt->bytes_per_frame);
|
||||
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)
|
||||
|
|
|
@ -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];
|
||||
int64_t pos = m4af_tell(ctx);
|
||||
int64_t duration =
|
||||
(double)track->duration / track->timescale * ctx->timescale + .5;
|
||||
int64_t duration = track->duration;
|
||||
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 ||
|
||||
track->modification_time > UINT32_MAX ||
|
||||
duration > UINT32_MAX);
|
||||
|
@ -1169,6 +1171,8 @@ int64_t m4af_movie_duration(m4af_ctx_t *ctx)
|
|||
unsigned i;
|
||||
for (i = 0; i < ctx->num_tracks; ++i) {
|
||||
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;
|
||||
if (duration > movie_duration)
|
||||
movie_duration = duration;
|
||||
|
|
|
@ -121,10 +121,9 @@ PROGNAME " %s\n"
|
|||
" -m, --bitrate-mode <n> Bitrate configuration\n"
|
||||
" 0: CBR (default)\n"
|
||||
" 1-5: VBR\n"
|
||||
" (VBR mode is not officially supported, and\n"
|
||||
" works only on a certain combination of\n"
|
||||
" parameter settings, sample rate, and\n"
|
||||
" channel configuration)\n"
|
||||
" (VBR mode 1 is tuned for HE-AAC v2\n"
|
||||
" VBR mode 2 is tuned for HE-AAC\n"
|
||||
" VBR mode 3 or greater is for AAC LC)\n"
|
||||
" -w, --bandwidth <n> Frequency bandwidth in Hz (AAC LC only)\n"
|
||||
" -a, --afterburner <n> Afterburner\n"
|
||||
" 0: Off\n"
|
||||
|
|
|
@ -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)
|
||||
return 0;
|
||||
if (count < 0)
|
||||
return -1;
|
||||
do {
|
||||
if ((rc = vp->read(io->cookie, buff, count > 8192 ? 8192 : count)) > 0)
|
||||
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;
|
||||
case kAudioChannelLayoutTag_AC3_3_1:
|
||||
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 */
|
||||
case kAudioChannelLayoutTag_DVD_6:
|
||||
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;
|
||||
case kAudioChannelLayoutTag_AC3_3_1_1:
|
||||
layout = "\x01\x03\x02\x09\x04"; break;
|
||||
case kAudioChannelLayoutTag_DTS_4_1:
|
||||
layout = "\x03\x01\x02\x09\x04"; break;
|
||||
/* 5ch */
|
||||
case kAudioChannelLayoutTag_MPEG_5_0_A:
|
||||
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;
|
||||
case kAudioChannelLayoutTag_MPEG_5_0_D:
|
||||
layout = "\x03\x01\x02\x0A\x0B"; break;
|
||||
case kAudioChannelLayoutTag_WAVE_5_0_B:
|
||||
layout = "\x01\x02\x03\x05\x06"; break;
|
||||
/* 5.1ch */
|
||||
case kAudioChannelLayoutTag_MPEG_5_1_A:
|
||||
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;
|
||||
case kAudioChannelLayoutTag_MPEG_5_1_D:
|
||||
layout = "\x03\x01\x02\x0A\x0B\x04"; break;
|
||||
case kAudioChannelLayoutTag_WAVE_5_1_B:
|
||||
layout = "\x01\x02\x03\x04\x05\x06"; break;
|
||||
/* 6ch */
|
||||
case kAudioChannelLayoutTag_Hexagonal:
|
||||
case kAudioChannelLayoutTag_AudioUnit_6_0:
|
||||
layout = "\x01\x02\x0A\x0B\x03\x09"; break;
|
||||
case kAudioChannelLayoutTag_AAC_6_0:
|
||||
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 */
|
||||
case kAudioChannelLayoutTag_MPEG_6_1_A:
|
||||
layout = "\x01\x02\x03\x04\x0A\x0B\x09"; break;
|
||||
case kAudioChannelLayoutTag_AAC_6_1:
|
||||
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 */
|
||||
case kAudioChannelLayoutTag_AudioUnit_7_0:
|
||||
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;
|
||||
case kAudioChannelLayoutTag_AAC_7_0:
|
||||
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 */
|
||||
case kAudioChannelLayoutTag_MPEG_7_1_A:
|
||||
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;
|
||||
case kAudioChannelLayoutTag_Emagic_Default_7_1:
|
||||
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 */
|
||||
case kAudioChannelLayoutTag_Octagonal:
|
||||
layout = "\x01\x02\x05\x06\x03\x09\x0A\x0B"; break;
|
||||
case kAudioChannelLayoutTag_AAC_Octagonal:
|
||||
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:
|
||||
goto FAIL;
|
||||
}
|
||||
|
|
|
@ -113,8 +113,10 @@ int wav_fmt(wav_reader_t *reader, uint32_t size)
|
|||
wValidBitsPerSample = wBitsPerSample;
|
||||
|
||||
ENSURE(wFormatTag == 1 || wFormatTag == 3 || wFormatTag == 0xfffe);
|
||||
ENSURE(nChannels && nSamplesPerSec && nAvgBytesPerSec &&
|
||||
nBlockAlign && wBitsPerSample && !(wBitsPerSample & 7) &&
|
||||
ENSURE(nChannels > 0 && nChannels <= 8 &&
|
||||
nSamplesPerSec && nAvgBytesPerSec &&
|
||||
nBlockAlign && nBlockAlign < 256 &&
|
||||
wBitsPerSample && wBitsPerSample < 256 && !(wBitsPerSample & 7) &&
|
||||
nBlockAlign == nChannels * wBitsPerSample / 8);
|
||||
|
||||
if (wFormatTag == 3)
|
||||
|
@ -155,6 +157,7 @@ static
|
|||
int wav_parse(wav_reader_t *reader, int64_t *data_length)
|
||||
{
|
||||
uint32_t container, fcc, chunk_size;
|
||||
int fmt_seen = 0;
|
||||
|
||||
*data_length = 0;
|
||||
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);
|
||||
while ((fcc = riff_next_chunk(reader, &chunk_size)) != 0) {
|
||||
if (fcc == RIFF_FOURCC('f','m','t',' ')) {
|
||||
fmt_seen = 1;
|
||||
if (wav_fmt(reader, chunk_size) < 0)
|
||||
goto FAIL;
|
||||
} else if (fcc == RIFF_FOURCC('d','a','t','a')) {
|
||||
|
@ -178,8 +182,8 @@ int wav_parse(wav_reader_t *reader, int64_t *data_length)
|
|||
TRY_IO(pcm_skip(&reader->io, (chunk_size + 1) & ~1));
|
||||
}
|
||||
}
|
||||
if (fcc == RIFF_FOURCC('d','a','t','a'))
|
||||
return 0;
|
||||
ENSURE(fmt_seen && fcc == RIFF_FOURCC('d', 'a', 't', 'a'));
|
||||
return 0;
|
||||
FAIL:
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue