Compare commits
183 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
16ea6af381 | ||
![]() |
8bd374858f | ||
![]() |
d39cc3c092 | ||
![]() |
e124c3c298 | ||
![]() |
8acc0546bb | ||
![]() |
36e4be0a0a | ||
![]() |
c603cf5170 | ||
![]() |
e1a46eff7a | ||
![]() |
23aaa82b1d | ||
![]() |
58087a4e64 | ||
![]() |
8d1fa1c97e | ||
![]() |
2eb5f77bc8 | ||
![]() |
ddbbe500b0 | ||
![]() |
d1a5b53ede | ||
![]() |
8e6173c76a | ||
![]() |
1a6f024520 | ||
![]() |
3699a46ed7 | ||
![]() |
62da9203fd | ||
![]() |
2e1e3c1e41 | ||
![]() |
635256a324 | ||
![]() |
240546a185 | ||
![]() |
07df40db6e | ||
![]() |
b24c2e59fe | ||
![]() |
25bc1108c2 | ||
![]() |
8ef917c033 | ||
![]() |
1883249be3 | ||
![]() |
648dc68098 | ||
![]() |
10da0edddc | ||
![]() |
d6bf79993f | ||
![]() |
0f2735e839 | ||
![]() |
9463a28792 | ||
![]() |
1330a8a1cb | ||
![]() |
8135c35528 | ||
![]() |
38423fe0b7 | ||
![]() |
71132596ae | ||
![]() |
d6f8b65417 | ||
![]() |
d8439f0452 | ||
![]() |
eb6b0ed8be | ||
![]() |
6108f04d4f | ||
![]() |
b261ebfd22 | ||
![]() |
03db051b43 | ||
![]() |
cc885682e3 | ||
![]() |
1415ebf031 | ||
![]() |
4e0315b30e | ||
![]() |
a9ded3d272 | ||
![]() |
ef93642aac | ||
![]() |
9cda3d7915 | ||
![]() |
52b8edc94c | ||
![]() |
f936799f0b | ||
![]() |
f6d3dfe78b | ||
![]() |
2e17744a90 | ||
![]() |
19431d4d4e | ||
![]() |
ecd6fa11c2 | ||
![]() |
7cb35d4954 | ||
![]() |
457f869b73 | ||
![]() |
70f01f1262 | ||
![]() |
80fb9f2c57 | ||
![]() |
46f9a6203a | ||
![]() |
e9210b4e17 | ||
![]() |
4f07a3aa2c | ||
![]() |
04888edef3 | ||
![]() |
24cd7c5df7 | ||
![]() |
8210ee22e2 | ||
![]() |
eed5697f99 | ||
![]() |
52ee20f2aa | ||
![]() |
f17b892787 | ||
![]() |
18c5fe919f | ||
![]() |
c5898d7c1d | ||
![]() |
2c4d6aeabc | ||
![]() |
31c8dcedb2 | ||
![]() |
2adad90ae7 | ||
![]() |
808f9ce727 | ||
![]() |
8069e2f6fb | ||
![]() |
f7494394ee | ||
![]() |
04847a06c2 | ||
![]() |
329e816ed7 | ||
![]() |
d6860fb653 | ||
![]() |
e332c41670 | ||
![]() |
11f6eebdd3 | ||
![]() |
9109a58867 | ||
![]() |
44511b17cb | ||
![]() |
48b086b0ef | ||
![]() |
c9864adf34 | ||
![]() |
7d10059aeb | ||
![]() |
69e8b43812 | ||
![]() |
2f504d7a90 | ||
![]() |
2dea9a1266 | ||
![]() |
84e6629de3 | ||
![]() |
fc038df32e | ||
![]() |
021054a196 | ||
![]() |
ee20f19b20 | ||
![]() |
2fcb56dab9 | ||
![]() |
96ca078b22 | ||
![]() |
7fd4cbb519 | ||
![]() |
557e065d5f | ||
![]() |
461243731d | ||
![]() |
fe95afe1e2 | ||
![]() |
775aa5f38c | ||
![]() |
578c32814c | ||
![]() |
c46038f6b7 | ||
![]() |
306eefc49f | ||
![]() |
eade5150e4 | ||
![]() |
6d767afb7c | ||
![]() |
015a7d7362 | ||
![]() |
922c55a09b | ||
![]() |
4c83c13bc8 | ||
![]() |
bd7e30ea00 | ||
![]() |
4fb58ecea8 | ||
![]() |
a317cd5722 | ||
![]() |
8e2149d7df | ||
![]() |
9d9f1ecfaa | ||
![]() |
53b90bb25e | ||
![]() |
a0244ae347 | ||
![]() |
26f74e832b | ||
![]() |
9593c80062 | ||
![]() |
48b98cdc67 | ||
![]() |
9d442d2d7d | ||
![]() |
afc97d4735 | ||
![]() |
e5bea45df7 | ||
9e3935dfd8 | |||
4f5ee3f87b | |||
736d36b792 | |||
dc5cc27d5a | |||
eb70d77e1e | |||
b8ec4c49bd | |||
49487dfd78 | |||
0d3f25eb48 | |||
9ef13f70f4 | |||
![]() |
beb0dc5f36 | ||
![]() |
f3fd428697 | ||
8811fe6987 | |||
![]() |
3835603e7e | ||
![]() |
4b360ee2ca | ||
![]() |
ab546a7463 | ||
![]() |
acac7858bd | ||
![]() |
c42640b200 | ||
![]() |
ef84190a1a | ||
![]() |
7db16a8173 | ||
![]() |
e91ba7dc9d | ||
![]() |
95f90d27d2 | ||
![]() |
1e9ac36f66 | ||
![]() |
7d061cfe17 | ||
![]() |
e21e76a914 | ||
![]() |
b18806f811 | ||
![]() |
478394bab7 | ||
![]() |
de3196da60 | ||
![]() |
49549033fd | ||
![]() |
15dfbc503d | ||
![]() |
f5c694972e | ||
![]() |
a9785f58c6 | ||
![]() |
7a5e131735 | ||
![]() |
93229681b5 | ||
![]() |
8819b9c600 | ||
![]() |
5d62141092 | ||
![]() |
44b20d1d74 | ||
![]() |
9ad437eafb | ||
![]() |
4fcef88c4d | ||
![]() |
dd2089dfd8 | ||
![]() |
df0ff1a029 | ||
![]() |
41a4fd7a61 | ||
![]() |
a4d8ebfaa1 | ||
![]() |
0ae7dcae2c | ||
![]() |
d6c23ec06a | ||
![]() |
3499f0f3e3 | ||
![]() |
7056dd763f | ||
![]() |
eade41f3ec | ||
![]() |
2f14399e40 | ||
![]() |
4f3ce00704 | ||
![]() |
d8ef221893 | ||
![]() |
8d003e22ca | ||
![]() |
b0b57fa13b | ||
![]() |
266f6af570 | ||
![]() |
241c55aabe | ||
![]() |
030896c76a | ||
![]() |
beb93f987c | ||
![]() |
8e8813a0a1 | ||
![]() |
c3c2325adc | ||
![]() |
f8429ed58c | ||
![]() |
df4763a782 | ||
![]() |
58af0caf04 | ||
![]() |
3aafe82485 | ||
![]() |
07679e680c | ||
![]() |
da835cc8a3 |
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
.config
|
||||
.version
|
||||
*.o
|
||||
*.so
|
||||
*.d
|
||||
*.exe
|
||||
*.ho
|
||||
*-example
|
||||
*-test
|
||||
*_g
|
||||
config.*
|
||||
doc/*.1
|
||||
doc/*.html
|
||||
doc/*.pod
|
||||
doxy
|
||||
ffmpeg
|
||||
ffplay
|
||||
ffprobe
|
||||
ffserver
|
||||
libavcodec/libavcodec*
|
||||
libavcore/libavcore*
|
||||
libavdevice/libavdevice*
|
||||
libavfilter/libavfilter*
|
||||
libavformat/libavformat*
|
||||
libavutil/avconfig.h
|
||||
libavutil/libavutil*
|
||||
libpostproc/libpostproc*
|
||||
libswscale/libswscale*
|
||||
tests/audiogen
|
||||
tests/base64
|
||||
tests/data
|
||||
tests/rotozoom
|
||||
tests/seek_test
|
||||
tests/tiny_psnr
|
||||
tests/videogen
|
||||
tests/vsynth1
|
||||
tests/vsynth2
|
||||
tools/cws2fws
|
||||
tools/graph2dot
|
||||
tools/lavfi-showfiltfmts
|
||||
tools/pktdumper
|
||||
tools/probetest
|
||||
tools/qt-faststart
|
||||
tools/trasher
|
||||
tools/trasher*.d
|
||||
version.h
|
3
CREDITS
3
CREDITS
@@ -7,10 +7,8 @@ Fabrice Bellard
|
||||
Patrice Bensoussan
|
||||
Alex Beregszaszi
|
||||
BERO
|
||||
Thilo Borgmann
|
||||
Mario Brito
|
||||
Ronald Bultje
|
||||
Alex Converse
|
||||
Maarten Daniels
|
||||
Reimar Doeffinger
|
||||
Tim Ferguson
|
||||
@@ -39,7 +37,6 @@ Michael Niedermayer
|
||||
François Revol
|
||||
Peter Ross
|
||||
Måns Rullgård
|
||||
Stefano Sabatini
|
||||
Roman Shaposhnik
|
||||
Oded Shimon
|
||||
Dieter Shirley
|
||||
|
175
Changelog
175
Changelog
@@ -1,91 +1,70 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 0.6:
|
||||
|
||||
- PB-frame decoding for H.263
|
||||
- deprecated vhook subsystem removed
|
||||
- deprecated old scaler removed
|
||||
- VQF demuxer
|
||||
- Alpha channel scaler
|
||||
- PCX encoder
|
||||
- RTP packetization of H.263
|
||||
- RTP packetization of AMR
|
||||
- RTP depacketization of Vorbis
|
||||
- CorePNG decoding support
|
||||
- Cook multichannel decoding support
|
||||
- introduced avlanguage helpers in libavformat
|
||||
- 8088flex TMV demuxer and decoder
|
||||
- per-stream language-tags extraction in asfdec
|
||||
- V210 decoder and encoder
|
||||
version 0.5.5:
|
||||
|
||||
- Fix memory (re)allocation in matroskadec.c (MSVR11-011/CVE-2011-3504)
|
||||
- Fix some crashes with invalid bitstreams in the CAVS decoder
|
||||
(CVE-2011-3362, CVE-2011-3973, CVE-2011-3974)
|
||||
- Compilation fixes for gcc-4.6, testsuite now passes again
|
||||
- Detect and handle overreads in the MJPEG decoder.
|
||||
- multiple other security fixes.
|
||||
|
||||
|
||||
|
||||
version 0.5.4:
|
||||
|
||||
- Fix memory corruption in WMV parsing (addresses CVE-2010-3908)
|
||||
- Fix heap corruption crashes (addresses CVE-2011-0722)
|
||||
- Fix crashes in Vorbis decoding found by zzuf (addresses CVE-2010-4704)
|
||||
- Fix another crash in Vorbis decoding (addresses CVE-2011-0480, Chrome issue 68115)
|
||||
- Fix invalid reads in VC-1 decoding (related to CVE-2011-0723)
|
||||
- Do not attempt to decode APE file with no frames
|
||||
(adresses http://packetstorm.linuxsecurity.com/1103-exploits/vlc105-dos.txt)
|
||||
|
||||
|
||||
|
||||
version 0.5.3:
|
||||
|
||||
- build system improvements
|
||||
- performance fix for seekable HTTP
|
||||
- fix several potentially exploitable issues in the FLIC decoder
|
||||
(addresses CVE-2010-3429)
|
||||
|
||||
|
||||
|
||||
version 0.5.2:
|
||||
|
||||
- Hurd support
|
||||
- PowerPC without AltiVec compilation issues
|
||||
- validate channels and samplerate in the Vorbis decoder
|
||||
|
||||
|
||||
|
||||
version 0.5.1:
|
||||
|
||||
- build system updates
|
||||
- documentation updates
|
||||
- libswscale now is LGPL except for x86 optimizations
|
||||
- fix for GPL code in libswscale that was erroneously activated
|
||||
- AltiVec code in libswscale is now LGPL
|
||||
- remaining GPL parts in AC-3 decoder converted to LGPL
|
||||
- QCP demuxer
|
||||
- SoX native format muxer and demuxer
|
||||
- (L)GPL license upgrade support
|
||||
- AMR-NB decoding/encoding, AMR-WB decoding via OpenCORE libraries
|
||||
- DPX image decoder
|
||||
- Electronic Arts Madcow decoder
|
||||
- DivX (XSUB) subtitle encoder
|
||||
- nonfree libamr support for AMR-NB/WB decoding/encoding removed
|
||||
- experimental AAC encoder
|
||||
- RTP depacketization of ASF and RTSP from WMS servers
|
||||
- RTMP support in libavformat
|
||||
- noX handling for OPT_BOOL X options
|
||||
- Wave64 demuxer
|
||||
- IEC-61937 compatible Muxer
|
||||
- TwinVQ decoder
|
||||
- Bluray (PGS) subtitle decoder
|
||||
- LPCM support in MPEG-TS (HDMV RID as found on Blu-ray disks)
|
||||
- WMA Pro decoder
|
||||
- Core Audio Format demuxer
|
||||
- Atrac1 decoder
|
||||
- MD STUDIO audio demuxer
|
||||
- RF64 support in WAV demuxer
|
||||
- MPEG-4 Audio Lossless Coding (ALS) decoder
|
||||
- -formats option split into -formats, -codecs, -bsfs, and -protocols
|
||||
- IV8 demuxer
|
||||
- CDG demuxer and decoder
|
||||
- R210 decoder
|
||||
- Auravision Aura 1 and 2 decoders
|
||||
- Deluxe Paint Animation playback system
|
||||
- SIPR decoder
|
||||
- Adobe Filmstrip muxer and demuxer
|
||||
- RTP depacketization of H.263
|
||||
- Bink demuxer and audio/video decoders
|
||||
- enable symbol versioning by default for linkers that support it
|
||||
- IFF PBM/ILBM bitmap decoder
|
||||
- concat protocol
|
||||
- Indeo 5 decoder
|
||||
- RTP depacketization of AMR
|
||||
- WMA Voice decoder
|
||||
- ffprobe tool
|
||||
- AMR-NB decoder
|
||||
- RTSP muxer
|
||||
- HE-AAC v1 decoder
|
||||
- Kega Game Video (KGV1) decoder
|
||||
- VorbisComment writing for FLAC, Ogg FLAC and Ogg Speex files
|
||||
- RTP depacketization of Theora
|
||||
- HTTP Digest authentication
|
||||
- RTMP/RTMPT/RTMPS/RTMPE/RTMPTE protocol support via librtmp
|
||||
- Psygnosis YOP demuxer and video decoder
|
||||
- spectral extension support in the E-AC-3 decoder
|
||||
- unsharp video filter
|
||||
- RTP hinting in the mov/3gp/mp4 muxer
|
||||
- Dirac in Ogg demuxing
|
||||
- seek to keyframes in Ogg
|
||||
- 4:2:2 and 4:4:4 Theora decoding
|
||||
- 35% faster VP3/Theora decoding
|
||||
- faster AAC decoding
|
||||
- faster H.264 decoding
|
||||
- WebM support in Matroska de/muxer
|
||||
- low overhead Ogg muxing
|
||||
- VP8 de/encoding via libvpx
|
||||
- CODEC_CAP_EXPERIMENTAL added
|
||||
- backport av_lockmgr_register(), see doc/APIchanges for details
|
||||
- security fixes for:
|
||||
- ASF, Ogg and MOV demuxers
|
||||
- FFv1, H.264, HuffYUV, MLP, MPEG audio and Snow decoders
|
||||
|
||||
|
||||
|
||||
version 0.5:
|
||||
|
||||
- The "device" muxers and demuxers are now in a new libavdevice library
|
||||
- DV50 AKA DVCPRO50 encoder, decoder, muxer and demuxer
|
||||
- DV100 AKA DVCPRO HD decoder and demuxer
|
||||
- TechSmith Camtasia (TSCC) video decoder
|
||||
- IBM Ultimotion (ULTI) video decoder
|
||||
- Sierra Online audio file demuxer and decoder
|
||||
@@ -105,7 +84,7 @@ version 0.5:
|
||||
- Fraps FPS1 video decoder
|
||||
- Snow video encoder/decoder
|
||||
- Sonic audio encoder/decoder
|
||||
- Vorbis audio decoder
|
||||
- Vorbis audio encoder/decoder
|
||||
- Macromedia ADPCM decoder
|
||||
- Duck TrueMotion 2 video decoder
|
||||
- support for decoding FLX and DTA extensions in FLIC files
|
||||
@@ -116,19 +95,18 @@ version 0.5:
|
||||
- TrueSpeech audio decoder
|
||||
- WMA2 audio decoder fixed, now all files should play correctly
|
||||
- RealAudio 14.4 and 28.8 decoders fixed
|
||||
- JPEG-LS decoder
|
||||
- JPEG-LS encoder and decoder
|
||||
- CamStudio video decoder
|
||||
- build system improvements
|
||||
- tabs and trailing whitespace removed from the codebase
|
||||
- CamStudio video decoder
|
||||
- AIFF/AIFF-C audio format, encoding and decoding
|
||||
- ADTS AAC file reading and writing
|
||||
- Creative VOC file reading and writing
|
||||
- American Laser Games multimedia (*.mm) playback system
|
||||
- Zip Motion Blocks Video decoder
|
||||
- Zip Blocks Motion Video decoder and encoder
|
||||
- improved Theora/VP3 decoder
|
||||
- True Audio (TTA) decoder
|
||||
- AVS demuxer and video decoder
|
||||
- JPEG-LS encoder
|
||||
- Smacker demuxer and decoder
|
||||
- NuppelVideo/MythTV demuxer and RTjpeg decoder
|
||||
- KMVC decoder
|
||||
@@ -147,14 +125,12 @@ version 0.5:
|
||||
- VP6 video decoder
|
||||
- WavPack lossless audio decoder
|
||||
- Targa (.TGA) picture decoder
|
||||
- Vorbis audio encoder
|
||||
- Delphine Software .cin demuxer/audio and video decoder
|
||||
- Tiertex .seq demuxer/video decoder
|
||||
- MTV demuxer
|
||||
- TIFF picture encoder and decoder
|
||||
- GIF picture decoder
|
||||
- Intel Music Coder decoder
|
||||
- Zip Motion Blocks Video encoder
|
||||
- Musepack decoder
|
||||
- Flash Screen Video encoder
|
||||
- Theora encoding via libtheora
|
||||
@@ -181,10 +157,10 @@ version 0.5:
|
||||
- OS/2 support removed and restored again
|
||||
- AC-3 decoder
|
||||
- NUT muxer
|
||||
- additional SPARC (VIS) optimizations
|
||||
- Matroska muxer
|
||||
- slice-based parallel H.264 decoding
|
||||
- Monkey's Audio demuxer and decoder
|
||||
- additional SPARC (VIS) optimizations
|
||||
- AMV audio and video decoder
|
||||
- DNxHD encoder
|
||||
- H.264 PAFF decoding
|
||||
@@ -193,7 +169,6 @@ version 0.5:
|
||||
- libvorbis Vorbis decoding removed in favor of native decoder
|
||||
- IntraX8 (J-Frame) subdecoder for WMV2 and VC-1
|
||||
- Ogg (Theora, Vorbis and FLAC) muxer
|
||||
- The "device" muxers and demuxers are now in a new libavdevice library
|
||||
- PC Paintbrush PCX decoder
|
||||
- Sun Rasterfile decoder
|
||||
- TechnoTrend PVA demuxer
|
||||
@@ -223,7 +198,6 @@ version 0.5:
|
||||
- AAC decoder
|
||||
- floating point PCM encoder/decoder
|
||||
- MXF muxer
|
||||
- DV100 AKA DVCPRO HD decoder and demuxer
|
||||
- E-AC-3 support added to AC-3 decoder
|
||||
- Nellymoser ASAO encoder
|
||||
- ASS and SSA demuxer and muxer
|
||||
@@ -231,9 +205,8 @@ version 0.5:
|
||||
- SVQ3 watermark decoding support
|
||||
- Speex decoding via libspeex
|
||||
- Electronic Arts TGQ decoder
|
||||
- RV40 decoder
|
||||
- RV30 and RV40 decoder
|
||||
- QCELP / PureVoice decoder
|
||||
- RV30 decoder
|
||||
- hybrid WavPack support
|
||||
- R3D REDCODE demuxer
|
||||
- ALSA support for playback and record
|
||||
@@ -245,7 +218,6 @@ version 0.5:
|
||||
- generic metadata API
|
||||
|
||||
|
||||
|
||||
version 0.4.9-pre1:
|
||||
|
||||
- DV encoder, DV muxer
|
||||
@@ -329,8 +301,6 @@ version 0.4.9-pre1:
|
||||
- many optimizations and bugfixes
|
||||
- FunCom ISS audio file demuxer and according ADPCM decoding
|
||||
|
||||
|
||||
|
||||
version 0.4.8:
|
||||
|
||||
- MPEG-2 video encoding (Michael)
|
||||
@@ -341,8 +311,6 @@ version 0.4.8:
|
||||
- Interplay MVE playback subsystem (Mike Melanson)
|
||||
- Duck DK3 and DK4 ADPCM audio decoders (Mike Melanson)
|
||||
|
||||
|
||||
|
||||
version 0.4.7:
|
||||
|
||||
- RealAudio 1.0 (14_4) and 2.0 (28_8) native decoders. Author unknown, code from mplayerhq
|
||||
@@ -383,8 +351,6 @@ version 0.4.7:
|
||||
|
||||
.. And lots more new enhancements and fixes.
|
||||
|
||||
|
||||
|
||||
version 0.4.6:
|
||||
|
||||
- completely new integer only MPEG audio layer 1/2/3 decoder rewritten
|
||||
@@ -421,8 +387,6 @@ version 0.4.6:
|
||||
- simple stats output (Juanjo)
|
||||
- 16-bit and 15-bit RGB/BGR/GBR support (Bisqwit)
|
||||
|
||||
|
||||
|
||||
version 0.4.5:
|
||||
|
||||
- some header fixes (Zdenek Kabelac <kabi at informatics.muni.cz>)
|
||||
@@ -453,8 +417,6 @@ version 0.4.5:
|
||||
- added MJPEG raw format (input/ouput)
|
||||
- added JPEG image format support (input/output)
|
||||
|
||||
|
||||
|
||||
version 0.4.4:
|
||||
|
||||
- fixed some std header definitions (Bjorn Lindgren
|
||||
@@ -479,8 +441,6 @@ version 0.4.4:
|
||||
- codecs are no longer searched by read_header() (should fix ffserver
|
||||
segfault)
|
||||
|
||||
|
||||
|
||||
version 0.4.3:
|
||||
|
||||
- BGR24 patch (initial patch by Jeroen Vreeken <pe1rxq at amsat.org>)
|
||||
@@ -501,8 +461,6 @@ version 0.4.3:
|
||||
<lists at reserv.at>, but changed completely since we use a format
|
||||
instead of a protocol)
|
||||
|
||||
|
||||
|
||||
version 0.4.2:
|
||||
|
||||
- added H.263/MPEG-4/MSMPEG4 decoding support. MPEG-4 decoding support
|
||||
@@ -519,7 +477,6 @@ version 0.4.2:
|
||||
- added file overwrite confirmation (can be disabled with -y)
|
||||
- added custom size picture to H.263 using H.263+ (Juanjo)
|
||||
|
||||
|
||||
version 0.4.1:
|
||||
|
||||
- added MSMPEG4 (aka DivX) compatible encoder. Changed default codec
|
||||
@@ -532,8 +489,6 @@ version 0.4.1:
|
||||
- improved dct_quantize speed
|
||||
- factorized some motion estimation code
|
||||
|
||||
|
||||
|
||||
version 0.4.0:
|
||||
|
||||
- removing grab code from ffserver and moved it to ffmpeg. Added
|
||||
@@ -561,14 +516,10 @@ version 0.4.0:
|
||||
- changed directories: libav for format handling, libavcodec for
|
||||
codecs
|
||||
|
||||
|
||||
|
||||
version 0.3.4:
|
||||
|
||||
- added stereo in MPEG audio encoder
|
||||
|
||||
|
||||
|
||||
version 0.3.3:
|
||||
|
||||
- added 'high quality' mode which use motion vectors. It can be used in
|
||||
@@ -576,21 +527,15 @@ version 0.3.3:
|
||||
- fixed rounding problems which caused quality problems at high
|
||||
bitrates and large GOP size
|
||||
|
||||
|
||||
|
||||
version 0.3.2: small fixes
|
||||
|
||||
- ASF fixes
|
||||
- put_seek bug fix
|
||||
|
||||
|
||||
|
||||
version 0.3.1: added avi/divx support
|
||||
|
||||
- added AVI support
|
||||
- added MPEG-4 codec compatible with OpenDivX. It is based on the H.263 codec
|
||||
- added sound for flash format (not tested)
|
||||
|
||||
|
||||
|
||||
version 0.3: initial public release
|
||||
|
5
Doxyfile
5
Doxyfile
@@ -17,7 +17,7 @@
|
||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
# by quotes) that should identify the project.
|
||||
|
||||
PROJECT_NAME = FFmpeg
|
||||
PROJECT_NAME = ffmpeg
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
@@ -370,7 +370,7 @@ EXCLUDE_SYMLINKS = NO
|
||||
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
||||
# certain files from those directories.
|
||||
|
||||
EXCLUDE_PATTERNS = *.svn *.git
|
||||
EXCLUDE_PATTERNS =
|
||||
|
||||
# The EXAMPLE_PATH tag can be used to specify one or more files or
|
||||
# directories that contain example code fragments that are included (see
|
||||
@@ -837,6 +837,7 @@ INCLUDE_FILE_PATTERNS =
|
||||
|
||||
PREDEFINED = __attribute__(x)="" "RENAME(x)=x ## _TMPL" "DEF(x)=x ## _TMPL" \
|
||||
HAVE_AV_CONFIG_H HAVE_MMX HAVE_MMX2 HAVE_AMD3DNOW \
|
||||
ATTR_ALIGN(x)=""
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||
# this tag can be used to specify a list of macro names that should be expanded.
|
||||
|
10
LICENSE
10
LICENSE
@@ -14,8 +14,7 @@ configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
|
||||
Specifically, the GPL parts of FFmpeg are
|
||||
|
||||
- libpostproc
|
||||
- optional MMX optimizations for YUV to RGB colorspace conversion in
|
||||
libswscale/x86/yuv2rgb_template.c
|
||||
- some x86 optimizations in libswscale
|
||||
- optional x86 optimizations in the files
|
||||
libavcodec/x86/h264_deblock_sse2.asm
|
||||
libavcodec/x86/h264_idct_sse2.asm
|
||||
@@ -45,6 +44,7 @@ is incompatible with the LGPL v2.1 and the GPL v2, but not with version 3 of
|
||||
those licenses. So to combine the OpenCORE libraries with FFmpeg, the license
|
||||
version needs to be upgraded by passing --enable-version3 to configure.
|
||||
|
||||
The nonfree external library libfaac can be hooked up in FFmpeg. You need to
|
||||
pass --enable-nonfree to configure to enable it. Employ this option with care
|
||||
as FFmpeg then becomes nonfree and unredistributable.
|
||||
The nonfree external libraries libamrnb, libamrwb and libfaac can be hooked up
|
||||
in FFmpeg. You need to pass --enable-nonfree to configure to enable them. Employ
|
||||
this option with care as FFmpeg then becomes nonfree and unredistributable.
|
||||
Note that libfaac claims to be LGPL, but is not.
|
||||
|
68
MAINTAINERS
68
MAINTAINERS
@@ -18,6 +18,15 @@ Applications
|
||||
ffmpeg:
|
||||
ffmpeg.c Michael Niedermayer
|
||||
|
||||
Video Hooks:
|
||||
vhook
|
||||
vhook/watermark.c Marcus Engene
|
||||
vhook/ppm.c
|
||||
vhook/drawtext.c
|
||||
vhook/fish.c
|
||||
vhook/null.c
|
||||
vhook/imlib2.c
|
||||
|
||||
ffplay:
|
||||
ffplay.c Michael Niedermayer
|
||||
|
||||
@@ -28,7 +37,7 @@ Commandline utility code:
|
||||
cmdutils.c, cmdutils.h Michael Niedermayer
|
||||
|
||||
QuickTime faststart:
|
||||
tools/qt-faststart.c Baptiste Coudurier
|
||||
qt-faststart.c Mike Melanson
|
||||
|
||||
|
||||
Miscellaneous Areas
|
||||
@@ -40,7 +49,6 @@ build system (configure,Makefiles) Diego Biurrun, Mans Rullgard
|
||||
project server Diego Biurrun, Mans Rullgard
|
||||
mailinglists Michael Niedermayer, Baptiste Coudurier
|
||||
presets Robert Swain
|
||||
metadata subsystem Aurelien Jacobs
|
||||
release management Diego Biurrun, Reinhard Tartler
|
||||
|
||||
|
||||
@@ -98,25 +106,22 @@ Generic Parts:
|
||||
simple_idct.c, simple_idct.h Michael Niedermayer
|
||||
postprocessing:
|
||||
libpostproc/* Michael Niedermayer
|
||||
vdpau:
|
||||
vdpau* Carl Eugen Hoyos
|
||||
|
||||
Codecs:
|
||||
4xm.c Michael Niedermayer
|
||||
8bps.c Roberto Togni
|
||||
8svx.c Jaikrishnan Menon
|
||||
aasc.c Kostya Shishkov
|
||||
aac*, sbr.h Alex Converse
|
||||
aac.[ch], aactab.[ch], aacdectab.h Robert Swain
|
||||
ac3* Justin Ruggles
|
||||
alacenc.c Jaikrishnan Menon
|
||||
alsdec.c Thilo Borgmann
|
||||
apedec.c Kostya Shishkov
|
||||
asv* Michael Niedermayer
|
||||
atrac3* Benjamin Larsson
|
||||
bgmc.c, bgmc.h Thilo Borgmann
|
||||
bink.c Kostya Shishkov
|
||||
binkaudio.c Peter Ross
|
||||
bmp.c Mans Rullgard, Kostya Shishkov
|
||||
cavs* Stefan Gehrer
|
||||
celp_filters.* Vitor Sessak
|
||||
cinepak.c Roberto Togni
|
||||
cljr Alex Beregszaszi
|
||||
cook.c, cookdata.h Benjamin Larsson
|
||||
@@ -128,7 +133,8 @@ Codecs:
|
||||
dv.c Roman Shaposhnik
|
||||
eacmv*, eaidct*, eat* Peter Ross
|
||||
ffv1.c Michael Niedermayer
|
||||
flac* Justin Ruggles
|
||||
flacdec.c Alex Beregszaszi, Justin Ruggles
|
||||
flacenc.c Justin Ruggles
|
||||
flashsv* Benjamin Larsson
|
||||
flicvideo.c Mike Melanson
|
||||
g726.c Roman Shaposhnik
|
||||
@@ -140,25 +146,18 @@ Codecs:
|
||||
idcinvideo.c Mike Melanson
|
||||
imc* Benjamin Larsson
|
||||
indeo2* Kostya Shishkov
|
||||
indeo5* Kostya Shishkov
|
||||
interplayvideo.c Mike Melanson
|
||||
ivi* Kostya Shishkov
|
||||
jpeg_ls.c Kostya Shishkov
|
||||
kmvc.c Kostya Shishkov
|
||||
lcl*.c Roberto Togni, Reimar Doeffinger
|
||||
lcl*.c Roberto Togni
|
||||
libgsm.c Michel Bardiaux
|
||||
libdirac* David Conrad
|
||||
libopenjpeg.c Jaikrishnan Menon
|
||||
libschroedinger* David Conrad
|
||||
libspeexdec.c Justin Ruggles
|
||||
libtheoraenc.c David Conrad
|
||||
libx264.c Mans Rullgard, Jason Garrett-Glaser
|
||||
loco.c Kostya Shishkov
|
||||
lzo.h, lzo.c Reimar Doeffinger
|
||||
mdec.c Michael Niedermayer
|
||||
mimic.c Ramiro Polla
|
||||
mjpeg.c Michael Niedermayer
|
||||
mlp* Ramiro Polla
|
||||
mmvideo.c Peter Ross
|
||||
mpc* Kostya Shishkov
|
||||
mpeg12.c, mpeg12data.h Michael Niedermayer
|
||||
@@ -184,7 +183,6 @@ Codecs:
|
||||
rv3* Kostya Shishkov
|
||||
rv4* Kostya Shishkov
|
||||
s3tc* Ivo van Poorten
|
||||
smacker.c Kostya Shishkov
|
||||
smc.c Mike Melanson
|
||||
snow.c Michael Niedermayer, Loren Merritt
|
||||
sonic.c Alex Beregszaszi
|
||||
@@ -196,7 +194,7 @@ Codecs:
|
||||
truemotion2* Kostya Shishkov
|
||||
truespeech.c Kostya Shishkov
|
||||
tscc.c Kostya Shishkov
|
||||
tta.c Alex Beregszaszi, Jaikrishnan Menon
|
||||
tta.c Alex Beregszaszi
|
||||
txd.c Ivo van Poorten
|
||||
ulti* Kostya Shishkov
|
||||
vb.c Kostya Shishkov
|
||||
@@ -210,8 +208,6 @@ Codecs:
|
||||
vp6 Aurelien Jacobs
|
||||
vqavideo.c Mike Melanson
|
||||
wavpack.c Kostya Shishkov
|
||||
wmaprodec.c Sascha Sommer
|
||||
wmavoice.c Ronald S. Bultje
|
||||
wmv2.c Michael Niedermayer
|
||||
wnv1.c Kostya Shishkov
|
||||
xan.c Mike Melanson
|
||||
@@ -219,11 +215,6 @@ Codecs:
|
||||
xvmc.c Ivan Kalvachev
|
||||
zmbv* Kostya Shishkov
|
||||
|
||||
Hardware acceleration:
|
||||
dxva2* Laurent Aimar
|
||||
vaapi* Gwenole Beauchesne
|
||||
vdpau* Carl Eugen Hoyos
|
||||
|
||||
|
||||
libavdevice
|
||||
===========
|
||||
@@ -252,12 +243,10 @@ Muxers/Demuxers:
|
||||
aiff.c Baptiste Coudurier
|
||||
ape.c Kostya Shishkov
|
||||
avi* Michael Niedermayer
|
||||
bink.c Peter Ross
|
||||
crc.c Michael Niedermayer
|
||||
daud.c Reimar Doeffinger
|
||||
dv.c Roman Shaposhnik
|
||||
dxa.c Kostya Shishkov
|
||||
electronicarts.c Peter Ross
|
||||
ffm* Baptiste Coudurier
|
||||
flac* Justin Ruggles
|
||||
flic.c Mike Melanson
|
||||
@@ -273,41 +262,36 @@ Muxers/Demuxers:
|
||||
libnut.c Oded Shimon
|
||||
lmlm4.c Ivo van Poorten
|
||||
matroska.c Aurelien Jacobs
|
||||
matroskadec.c Aurelien Jacobs
|
||||
matroskaenc.c David Conrad
|
||||
metadata* Aurelien Jacobs
|
||||
mm.c Peter Ross
|
||||
mov.c Michael Niedermayer, Baptiste Coudurier
|
||||
movenc.c Michael Niedermayer, Baptiste Coudurier
|
||||
mpc.c Kostya Shishkov
|
||||
mpeg.c Michael Niedermayer
|
||||
mpegenc.c Michael Niedermayer
|
||||
mpegts* Baptiste Coudurier
|
||||
mpegts* Mans Rullgard
|
||||
msnwc_tcp.c Ramiro Polla
|
||||
mtv.c Reynaldo H. Verdejo Pinochet
|
||||
mxf* Baptiste Coudurier
|
||||
nsvdec.c Francois Revol
|
||||
nut.c Michael Niedermayer
|
||||
nuv.c Reimar Doeffinger
|
||||
oggdec.c, oggdec.h David Conrad
|
||||
oggdec.c, oggdec.h Mans Rullgard
|
||||
oggenc.c Baptiste Coudurier
|
||||
oggparse*.c David Conrad
|
||||
oggparsevorbis.c Mans Rullgard
|
||||
oggparseogm.c Mans Rullgard
|
||||
psxstr.c Mike Melanson
|
||||
pva.c Ivo van Poorten
|
||||
r3d.c Baptiste Coudurier
|
||||
raw.c Michael Niedermayer
|
||||
rdt.c Ronald S. Bultje
|
||||
rl2.c Sascha Sommer
|
||||
rmdec.c, rmenc.c Ronald S. Bultje, Kostya Shishkov
|
||||
rtmp* Kostya Shishkov
|
||||
rm.c Roberto Togni
|
||||
rtp.c, rtpenc.c Luca Abeni
|
||||
rtp_asf.* Ronald S. Bultje
|
||||
rtp_mpv.*, rtp_aac.* Luca Abeni
|
||||
rtsp.c Luca Barbato
|
||||
sdp.c Luca Abeni
|
||||
segafilm.c Mike Melanson
|
||||
siff.c Kostya Shishkov
|
||||
smacker.c Kostya Shishkov
|
||||
swf.c Baptiste Coudurier
|
||||
tta.c Alex Beregszaszi
|
||||
txd.c Ivo van Poorten
|
||||
@@ -318,7 +302,6 @@ Muxers/Demuxers:
|
||||
wv.c Kostya Shishkov
|
||||
|
||||
Protocols:
|
||||
http.c Ronald S. Bultje
|
||||
udp.c Luca Abeni
|
||||
|
||||
|
||||
@@ -327,8 +310,6 @@ Operating systems / CPU architectures
|
||||
|
||||
Alpha Mans Rullgard, Falk Hueffner
|
||||
ARM Mans Rullgard
|
||||
AVR32 Mans Rullgard
|
||||
MIPS Mans Rullgard
|
||||
BeOS Francois Revol
|
||||
Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier
|
||||
Amiga / PowerPC Colin Ward
|
||||
@@ -343,15 +324,10 @@ x86 Michael Niedermayer
|
||||
GnuPG Fingerprints of maintainers and others who have svn write access
|
||||
======================================================================
|
||||
|
||||
Attila Kinali 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765
|
||||
Baptiste Coudurier 8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA
|
||||
Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
|
||||
Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
|
||||
Diego Biurrun 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5
|
||||
Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
|
||||
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
|
||||
Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
|
||||
Panagiotis Issaris 515C E262 10A8 FDCE 5481 7B9C 3AD7 D9A5 071D B3A9
|
||||
Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
|
||||
Reimar Döffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
|
||||
Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
|
||||
|
437
Makefile
437
Makefile
@@ -6,57 +6,49 @@ vpath %.texi $(SRC_PATH_BARE)
|
||||
|
||||
PROGS-$(CONFIG_FFMPEG) += ffmpeg
|
||||
PROGS-$(CONFIG_FFPLAY) += ffplay
|
||||
PROGS-$(CONFIG_FFPROBE) += ffprobe
|
||||
PROGS-$(CONFIG_FFSERVER) += ffserver
|
||||
|
||||
PROGS := $(addsuffix $(EXESUF), $(PROGS-yes))
|
||||
PROGS = $(addsuffix $(EXESUF), $(PROGS-yes))
|
||||
PROGS_G = $(addsuffix _g$(EXESUF), $(PROGS-yes))
|
||||
OBJS = $(addsuffix .o, $(PROGS-yes)) cmdutils.o
|
||||
MANPAGES = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
|
||||
TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws pktdumper probetest qt-faststart trasher))
|
||||
HOSTPROGS = $(addprefix tests/, audiogen videogen rotozoom tiny_psnr)
|
||||
|
||||
BASENAMES = ffmpeg ffplay ffprobe ffserver
|
||||
BASENAMES = ffmpeg ffplay ffserver
|
||||
ALLPROGS = $(addsuffix $(EXESUF), $(BASENAMES))
|
||||
ALLPROGS_G = $(addsuffix _g$(EXESUF), $(BASENAMES))
|
||||
ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
|
||||
|
||||
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
|
||||
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
||||
FFLIBS-$(CONFIG_AVFORMAT) += avformat
|
||||
FFLIBS-$(CONFIG_AVCODEC) += avcodec
|
||||
FFLIBS-$(CONFIG_POSTPROC) += postproc
|
||||
FFLIBS-$(CONFIG_SWSCALE) += swscale
|
||||
|
||||
FFLIBS := avutil
|
||||
FFLIBS := avdevice avformat avcodec avutil
|
||||
|
||||
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
|
||||
|
||||
SKIPHEADERS = cmdutils_common_opts.h
|
||||
|
||||
include common.mak
|
||||
|
||||
FF_LDFLAGS := $(FFLDFLAGS)
|
||||
FF_EXTRALIBS := $(FFEXTRALIBS)
|
||||
FF_DEP_LIBS := $(DEP_LIBS)
|
||||
|
||||
ALL_TARGETS-$(CONFIG_DOC) += documentation
|
||||
ALL_TARGETS-$(CONFIG_VHOOK) += videohook
|
||||
ALL_TARGETS-$(BUILD_DOC) += documentation
|
||||
|
||||
ifdef PROGS
|
||||
INSTALL_TARGETS-$(CONFIG_VHOOK) += install-vhook
|
||||
ifneq ($(PROGS),)
|
||||
INSTALL_TARGETS-yes += install-progs install-data
|
||||
INSTALL_TARGETS-$(CONFIG_DOC) += install-man
|
||||
INSTALL_TARGETS-$(BUILD_DOC) += install-man
|
||||
endif
|
||||
INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
|
||||
INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
|
||||
|
||||
all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
|
||||
|
||||
$(PROGS): %$(EXESUF): %_g$(EXESUF)
|
||||
$(CP) $< $@
|
||||
cp -p $< $@
|
||||
$(STRIP) $@
|
||||
|
||||
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
|
||||
ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
|
||||
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS
|
||||
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTS
|
||||
|
||||
define RESET
|
||||
$(1) :=
|
||||
@@ -75,279 +67,294 @@ ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
|
||||
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
|
||||
|
||||
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
|
||||
$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
|
||||
$(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
|
||||
|
||||
tools/%$(EXESUF): tools/%.o
|
||||
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||
output_example$(EXESUF): output_example.o $(FF_DEP_LIBS)
|
||||
$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||
|
||||
tools/%.o: tools/%.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
|
||||
tools/%$(EXESUF): tools/%.c
|
||||
$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||
|
||||
ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
|
||||
|
||||
VERSION_SH = $(SRC_PATH_BARE)/version.sh
|
||||
GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD
|
||||
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
|
||||
cmdutils.o cmdutils.d: version.h
|
||||
|
||||
.version: $(wildcard $(GIT_LOG) $(SVN_ENTRIES)) $(VERSION_SH) config.mak
|
||||
.version: M=@
|
||||
alltools: $(addsuffix $(EXESUF),$(addprefix tools/, cws2fws pktdumper qt-faststart trasher))
|
||||
|
||||
version.h .version:
|
||||
$(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
|
||||
$(Q)touch .version
|
||||
VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
|
||||
|
||||
# force version.sh to run whenever version might have changed
|
||||
-include .version
|
||||
BASEHOOKS = fish null watermark
|
||||
ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm
|
||||
ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS)))
|
||||
|
||||
alltools: $(TOOLS)
|
||||
HOOKS-$(HAVE_FORK) += ppm
|
||||
HOOKS-$(HAVE_IMLIB2) += imlib2
|
||||
HOOKS-$(HAVE_FREETYPE2) += drawtext
|
||||
|
||||
documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
|
||||
ffplay-doc.html ffprobe-doc.html ffserver-doc.html \
|
||||
general.html libavfilter.html $(ALLMANPAGES))
|
||||
HOOKS = $(addprefix vhook/, $(addsuffix $(SLIBSUF), $(BASEHOOKS) $(HOOKS-yes)))
|
||||
|
||||
VHOOKCFLAGS-$(HAVE_IMLIB2) += `imlib2-config --cflags`
|
||||
LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs`
|
||||
|
||||
VHOOKCFLAGS-$(HAVE_FREETYPE2) += `freetype-config --cflags`
|
||||
LIBS_drawtext$(SLIBSUF) = `freetype-config --libs`
|
||||
|
||||
VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
|
||||
|
||||
vhook/%.o vhook/%.d: CFLAGS:=$(VHOOKCFLAGS)
|
||||
|
||||
# vhooks compile fine without libav*, but need them nonetheless.
|
||||
videohook: $(FF_DEP_LIBS) $(HOOKS)
|
||||
|
||||
$(eval VHOOKSHFLAGS=$(VHOOKSHFLAGS))
|
||||
vhook/%$(SLIBSUF): vhook/%.o
|
||||
$(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
|
||||
|
||||
VHOOK_DEPS = $(HOOKS:$(SLIBSUF)=.d)
|
||||
depend dep: $(VHOOK_DEPS)
|
||||
|
||||
documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
|
||||
ffplay-doc.html general.html hooks.html \
|
||||
$(ALLMANPAGES))
|
||||
|
||||
doc/%.html: TAG = HTML
|
||||
doc/%.html: doc/%.texi
|
||||
$(M)cd doc && texi2html -monolithic -number $(<:doc/%=%)
|
||||
texi2html -monolithic -number $<
|
||||
mv $(@F) $@
|
||||
|
||||
doc/%.pod: TAG = POD
|
||||
doc/%.pod: doc/%-doc.texi
|
||||
$(M)doc/texi2pod.pl $< $@
|
||||
doc/texi2pod.pl $< $@
|
||||
|
||||
doc/%.1: TAG = MAN
|
||||
doc/%.1: doc/%.pod
|
||||
$(M)pod2man --section=1 --center=" " --release=" " $< > $@
|
||||
pod2man --section=1 --center=" " --release=" " $< > $@
|
||||
|
||||
install: $(INSTALL_TARGETS-yes)
|
||||
|
||||
install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
|
||||
$(Q)mkdir -p "$(BINDIR)"
|
||||
$(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)"
|
||||
install -d "$(BINDIR)"
|
||||
install -c -m 755 $(PROGS) "$(BINDIR)"
|
||||
|
||||
install-data: $(DATA_FILES)
|
||||
$(Q)mkdir -p "$(DATADIR)"
|
||||
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
|
||||
install -d "$(DATADIR)"
|
||||
install -m 644 $(DATA_FILES) "$(DATADIR)"
|
||||
|
||||
install-man: $(MANPAGES)
|
||||
$(Q)mkdir -p "$(MANDIR)/man1"
|
||||
$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
|
||||
install -d "$(MANDIR)/man1"
|
||||
install -m 644 $(MANPAGES) "$(MANDIR)/man1"
|
||||
|
||||
uninstall: uninstall-progs uninstall-data uninstall-man
|
||||
install-vhook: videohook
|
||||
install -d "$(SHLIBDIR)/vhook"
|
||||
install -m 755 $(HOOKS) "$(SHLIBDIR)/vhook"
|
||||
|
||||
uninstall: uninstall-progs uninstall-data uninstall-man uninstall-vhook
|
||||
|
||||
uninstall-progs:
|
||||
$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
|
||||
rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
|
||||
|
||||
uninstall-data:
|
||||
$(RM) -r "$(DATADIR)"
|
||||
rm -rf "$(DATADIR)"
|
||||
|
||||
uninstall-man:
|
||||
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
||||
rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
||||
|
||||
uninstall-vhook:
|
||||
rm -f $(addprefix "$(SHLIBDIR)/",$(ALLHOOKS_SRCS:.c=$(SLIBSUF)))
|
||||
-rmdir "$(SHLIBDIR)/vhook/"
|
||||
|
||||
testclean:
|
||||
$(RM) -r tests/vsynth1 tests/vsynth2 tests/data
|
||||
$(RM) $(addprefix tests/,$(CLEANSUFFIXES))
|
||||
$(RM) tests/seek_test$(EXESUF) tests/seek_test.o
|
||||
$(RM) $(addprefix tests/,$(addsuffix $(HOSTEXESUF),audiogen videogen rotozoom tiny_psnr))
|
||||
rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
|
||||
|
||||
clean:: testclean
|
||||
$(RM) $(ALLPROGS) $(ALLPROGS_G)
|
||||
$(RM) $(CLEANSUFFIXES)
|
||||
$(RM) doc/*.html doc/*.pod doc/*.1
|
||||
$(RM) $(TOOLS)
|
||||
rm -f $(ALLPROGS) $(ALLPROGS_G) output_example$(EXESUF)
|
||||
rm -f doc/*.html doc/*.pod doc/*.1
|
||||
rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
|
||||
rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
|
||||
rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
|
||||
|
||||
distclean::
|
||||
$(RM) $(DISTCLEANSUFFIXES)
|
||||
$(RM) version.h config.* libavutil/avconfig.h
|
||||
|
||||
config:
|
||||
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
|
||||
rm -f version.h config.* vhook/*.d
|
||||
|
||||
# regression tests
|
||||
|
||||
check: test checkheaders
|
||||
|
||||
fulltest test: codectest lavftest seektest
|
||||
fulltest test: codectest libavtest seektest
|
||||
|
||||
FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
|
||||
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
|
||||
LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
|
||||
ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
|
||||
SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
|
||||
|
||||
ENCDEC = $(and $(CONFIG_$(1)_ENCODER),$(CONFIG_$(1)_DECODER))
|
||||
MUXDEM = $(and $(CONFIG_$(1)_MUXER),$(CONFIG_$(or $(2),$(1))_DEMUXER))
|
||||
CODEC_TESTS = $(addprefix regtest-, \
|
||||
mpeg \
|
||||
mpeg2 \
|
||||
mpeg2thread \
|
||||
msmpeg4v2 \
|
||||
msmpeg4 \
|
||||
wmv1 \
|
||||
wmv2 \
|
||||
h261 \
|
||||
h263 \
|
||||
h263p \
|
||||
mpeg4 \
|
||||
huffyuv \
|
||||
rc \
|
||||
mpeg4adv \
|
||||
mpeg4thread \
|
||||
error \
|
||||
mpeg4nr \
|
||||
mpeg1b \
|
||||
mjpeg \
|
||||
ljpeg \
|
||||
jpegls \
|
||||
rv10 \
|
||||
rv20 \
|
||||
asv1 \
|
||||
asv2 \
|
||||
flv \
|
||||
ffv1 \
|
||||
snow \
|
||||
snowll \
|
||||
dv \
|
||||
dv50 \
|
||||
svq1 \
|
||||
flashsv \
|
||||
mp2 \
|
||||
ac3 \
|
||||
g726 \
|
||||
adpcm_ima_wav \
|
||||
adpcm_ima_qt \
|
||||
adpcm_ms \
|
||||
adpcm_yam \
|
||||
adpcm_swf \
|
||||
flac \
|
||||
wma \
|
||||
pcm \
|
||||
)
|
||||
|
||||
VCODEC_TESTS =
|
||||
VCODEC_TESTS-$(call ENCDEC,ASV1) += asv1
|
||||
VCODEC_TESTS-$(call ENCDEC,ASV2) += asv2
|
||||
VCODEC_TESTS-$(call ENCDEC,DNXHD) += dnxhd_1080i dnxhd_720p dnxhd_720p_rd
|
||||
VCODEC_TESTS-$(call ENCDEC,DVVIDEO) += dv dv50
|
||||
VCODEC_TESTS-$(call ENCDEC,FFV1) += ffv1
|
||||
VCODEC_TESTS-$(call ENCDEC,FLASHSV) += flashsv
|
||||
VCODEC_TESTS-$(call ENCDEC,FLV) += flv
|
||||
VCODEC_TESTS-$(call ENCDEC,H261) += h261
|
||||
VCODEC_TESTS-$(call ENCDEC,H263) += h263 h263p
|
||||
VCODEC_TESTS-$(call ENCDEC,HUFFYUV) += huffyuv
|
||||
VCODEC_TESTS-$(call ENCDEC,JPEGLS) += jpegls
|
||||
VCODEC_TESTS-$(call ENCDEC,MJPEG) += mjpeg ljpeg
|
||||
VCODEC_TESTS-$(call ENCDEC,MPEG1VIDEO) += mpeg mpeg1b
|
||||
VCODEC_TESTS-$(call ENCDEC,MPEG2VIDEO) += mpeg2 mpeg2thread
|
||||
VCODEC_TESTS-$(call ENCDEC,MPEG4) += mpeg4 mpeg4adv mpeg4nr mpeg4thread error rc
|
||||
VCODEC_TESTS-$(call ENCDEC,MSMPEG4V1) += msmpeg4
|
||||
VCODEC_TESTS-$(call ENCDEC,MSMPEG4V2) += msmpeg4v2
|
||||
VCODEC_TESTS-$(call ENCDEC,ROQ) += roq
|
||||
VCODEC_TESTS-$(call ENCDEC,RV10) += rv10
|
||||
VCODEC_TESTS-$(call ENCDEC,RV20) += rv20
|
||||
VCODEC_TESTS-$(call ENCDEC,SNOW) += snow snowll
|
||||
VCODEC_TESTS-$(call ENCDEC,SVQ1) += svq1
|
||||
VCODEC_TESTS-$(call ENCDEC,WMV1) += wmv1
|
||||
VCODEC_TESTS-$(call ENCDEC,WMV2) += wmv2
|
||||
LAVF_TESTS = $(addprefix regtest-, \
|
||||
avi \
|
||||
asf \
|
||||
rm \
|
||||
mpg \
|
||||
ts \
|
||||
swf \
|
||||
ffm \
|
||||
flv_fmt \
|
||||
mov \
|
||||
dv_fmt \
|
||||
gxf \
|
||||
nut \
|
||||
mkv \
|
||||
pbmpipe \
|
||||
pgmpipe \
|
||||
ppmpipe \
|
||||
gif \
|
||||
yuv4mpeg \
|
||||
pgm \
|
||||
ppm \
|
||||
bmp \
|
||||
tga \
|
||||
tiff \
|
||||
sgi \
|
||||
jpg \
|
||||
wav \
|
||||
alaw \
|
||||
mulaw \
|
||||
au \
|
||||
mmf \
|
||||
aiff \
|
||||
voc \
|
||||
ogg \
|
||||
pixfmt \
|
||||
)
|
||||
|
||||
ACODEC_TESTS =
|
||||
ACODEC_TESTS-$(call ENCDEC,AC3) += ac3
|
||||
ACODEC_TESTS-$(call ENCDEC,ADPCM_G726) += g726
|
||||
ACODEC_TESTS-$(call ENCDEC,ADPCM_IMA_QT) += adpcm_ima_qt
|
||||
ACODEC_TESTS-$(call ENCDEC,ADPCM_IMA_WAV) += adpcm_ima_wav
|
||||
ACODEC_TESTS-$(call ENCDEC,ADPCM_MS) += adpcm_ms
|
||||
ACODEC_TESTS-$(call ENCDEC,ADPCM_SWF) += adpcm_swf
|
||||
ACODEC_TESTS-$(call ENCDEC,ADPCM_YAMAHA) += adpcm_yam
|
||||
ACODEC_TESTS-$(call ENCDEC,ALAC) += alac
|
||||
ACODEC_TESTS-$(call ENCDEC,FLAC) += flac
|
||||
ACODEC_TESTS-$(call ENCDEC,MP2) += mp2
|
||||
ACODEC_TESTS-$(call ENCDEC,PCM_S16LE) += pcm # fixme
|
||||
ACODEC_TESTS-$(call ENCDEC,WMAV1) += wmav1
|
||||
ACODEC_TESTS-$(call ENCDEC,WMAV1) += wmav2
|
||||
REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
|
||||
|
||||
LAVF_TESTS =
|
||||
LAVF_TESTS-$(call MUXDEM,AIFF) += aiff
|
||||
LAVF_TESTS-$(call MUXDEM,PCM_ALAW) += alaw
|
||||
LAVF_TESTS-$(call MUXDEM,ASF) += asf
|
||||
LAVF_TESTS-$(call MUXDEM,AU) += au
|
||||
LAVF_TESTS-$(call MUXDEM,AVI) += avi
|
||||
LAVF_TESTS-$(call ENCDEC,BMP) += bmp
|
||||
LAVF_TESTS-$(call MUXDEM,DV) += dv_fmt
|
||||
LAVF_TESTS-$(call MUXDEM,FFM) += ffm
|
||||
LAVF_TESTS-$(call MUXDEM,FLV) += flv_fmt
|
||||
LAVF_TESTS-$(call ENCDEC,GIF) += gif
|
||||
LAVF_TESTS-$(call MUXDEM,GXF) += gxf
|
||||
LAVF_TESTS-$(call ENCDEC,MJPEG) += jpg
|
||||
LAVF_TESTS-$(call MUXDEM,MATROSKA) += mkv
|
||||
LAVF_TESTS-$(call MUXDEM,MMF) += mmf
|
||||
LAVF_TESTS-$(call MUXDEM,MOV) += mov
|
||||
LAVF_TESTS-$(call MUXDEM,MPEG1SYSTEM,MPEGPS) += mpg
|
||||
LAVF_TESTS-$(call MUXDEM,PCM_MULAW) += mulaw
|
||||
LAVF_TESTS-$(call MUXDEM,MXF) += mxf
|
||||
LAVF_TESTS-$(call MUXDEM,NUT) += nut
|
||||
LAVF_TESTS-$(call MUXDEM,OGG) += ogg
|
||||
LAVF_TESTS-$(call ENCDEC,PBM) += pbmpipe
|
||||
LAVF_TESTS-$(call ENCDEC,PCX) += pcx
|
||||
LAVF_TESTS-$(call ENCDEC,PGM) += pgm pgmpipe
|
||||
LAVF_TESTS-$(call MUXDEM,RAWVIDEO) += pixfmt
|
||||
LAVF_TESTS-$(call ENCDEC,PPM) += ppm ppmpipe
|
||||
LAVF_TESTS-$(call MUXDEM,RM) += rm
|
||||
LAVF_TESTS-$(call ENCDEC,SGI) += sgi
|
||||
LAVF_TESTS-$(call MUXDEM,SWF) += swf
|
||||
LAVF_TESTS-$(call ENCDEC,TARGA) += tga
|
||||
LAVF_TESTS-$(call ENCDEC,TIFF) += tiff
|
||||
LAVF_TESTS-$(call MUXDEM,MPEGTS) += ts
|
||||
LAVF_TESTS-$(call MUXDEM,VOC) += voc
|
||||
LAVF_TESTS-$(call MUXDEM,WAV) += wav
|
||||
LAVF_TESTS-$(call MUXDEM,YUV4MPEGPIPE) += yuv4mpeg
|
||||
CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
|
||||
CODEC_VSYNTH = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
|
||||
|
||||
LAVFI_TESTS = \
|
||||
crop \
|
||||
crop_scale \
|
||||
crop_scale_vflip \
|
||||
crop_vflip \
|
||||
null \
|
||||
scale200 \
|
||||
scale500 \
|
||||
vflip \
|
||||
vflip_crop \
|
||||
vflip_vflip \
|
||||
LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
|
||||
|
||||
ACODEC_TESTS := $(addprefix regtest-, $(ACODEC_TESTS) $(ACODEC_TESTS-yes))
|
||||
VCODEC_TESTS := $(addprefix regtest-, $(VCODEC_TESTS) $(VCODEC_TESTS-yes))
|
||||
LAVF_TESTS := $(addprefix regtest-, $(LAVF_TESTS) $(LAVF_TESTS-yes))
|
||||
LAVFI_TESTS := $(addprefix regtest-, $(LAVFI_TESTS) $(LAVFI_TESTS-yes))
|
||||
LAVF_REG = tests/data/lavf.regression
|
||||
ROTOZOOM_REG = tests/data/rotozoom.regression
|
||||
VSYNTH_REG = tests/data/vsynth.regression
|
||||
|
||||
CODEC_TESTS = $(VCODEC_TESTS) $(ACODEC_TESTS)
|
||||
ifneq ($(CONFIG_SWSCALE),yes)
|
||||
servertest codectest $(CODEC_TESTS) libavtest: swscale-error
|
||||
swscale-error:
|
||||
@echo
|
||||
@echo "This regression test requires --enable-swscale."
|
||||
@echo
|
||||
@exit 1
|
||||
endif
|
||||
|
||||
codectest: $(CODEC_TESTS)
|
||||
lavftest: $(LAVF_TESTS)
|
||||
lavfitest: $(LAVFI_TESTS)
|
||||
ifneq ($(CONFIG_ZLIB),yes)
|
||||
regtest-flashsv codectest: zlib-error
|
||||
endif
|
||||
zlib-error:
|
||||
@echo
|
||||
@echo "This regression test requires zlib."
|
||||
@echo
|
||||
@exit 1
|
||||
|
||||
$(ACODEC_TESTS): regtest-aref
|
||||
$(VCODEC_TESTS): regtest-vref
|
||||
$(LAVF_TESTS) $(LAVFI_TESTS): regtest-ref
|
||||
codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
|
||||
diff -u -w $(FFMPEG_REFFILE) $(VSYNTH_REG)
|
||||
diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
|
||||
|
||||
REFFILE = $(SRC_PATH)/tests/ref/$(1)/$(2:regtest-%=%)
|
||||
RESFILE = tests/data/$(2:regtest-%=%).$(1).regression
|
||||
libavtest: $(LAVF_REG)
|
||||
diff -u -w $(LIBAV_REFFILE) $(LAVF_REG)
|
||||
|
||||
define CODECTEST_CMD
|
||||
$(SRC_PATH)/tests/codec-regression.sh $@ vsynth1 tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
$(SRC_PATH)/tests/codec-regression.sh $@ vsynth2 tests/vsynth2 "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
endef
|
||||
$(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
|
||||
cat $^ > $@
|
||||
|
||||
regtest-ref: regtest-aref regtest-vref
|
||||
$(LAVF_REG): $(LAVF_REGFILES)
|
||||
$(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
|
||||
$(VSYNTH_REG): $(CODEC_VSYNTH)
|
||||
|
||||
regtest-vref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
|
||||
$(CODECTEST_CMD)
|
||||
$(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
|
||||
|
||||
regtest-aref: ffmpeg$(EXESUF) tests/data/asynth1.sw
|
||||
@$(SRC_PATH)/tests/codec-regression.sh $@ acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
$(LAVF_REGFILES): $(LAVF_TESTS)
|
||||
|
||||
$(VCODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
|
||||
@echo "TEST VCODEC $(@:regtest-%=%)"
|
||||
@$(CODECTEST_CMD)
|
||||
@diff -u -w $(call REFFILE,vsynth1,$@) $(call RESFILE,vsynth1,$@)
|
||||
@diff -u -w $(call REFFILE,vsynth2,$@) $(call RESFILE,vsynth2,$@)
|
||||
$(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
|
||||
|
||||
$(ACODEC_TESTS): tests/tiny_psnr$(HOSTEXESUF)
|
||||
@echo "TEST ACODEC $(@:regtest-%=%)"
|
||||
@$(SRC_PATH)/tests/codec-regression.sh $@ acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
@diff -u -w $(call REFFILE,acodec,$@) $(call RESFILE,acodec,$@)
|
||||
regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw
|
||||
|
||||
$(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(EXESUF)
|
||||
$(SRC_PATH)/tests/regression.sh $@ vsynth tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
$(SRC_PATH)/tests/regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
|
||||
$(LAVF_TESTS):
|
||||
@echo "TEST LAVF $(@:regtest-%=%)"
|
||||
@$(SRC_PATH)/tests/lavf-regression.sh $@ lavf tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
@diff -u -w $(call REFFILE,lavf,$@) $(call RESFILE,lavf,$@)
|
||||
$(SRC_PATH)/tests/regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
|
||||
$(LAVFI_TESTS):
|
||||
@echo "TEST LAVFI $(@:regtest-%=%)"
|
||||
@$(SRC_PATH)/tests/lavfi-regression.sh $@ lavfi tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
@diff -u -w $(call REFFILE,lavfi,$@) $(call RESFILE,lavfi,$@)
|
||||
seektest: codectest libavtest tests/seek_test$(EXESUF)
|
||||
$(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
|
||||
seektest: codectest lavftest tests/seek_test$(EXESUF)
|
||||
$(SRC_PATH)/tests/seek-regression.sh $(SRC_PATH) "$(TARGET_EXEC)" "$(TARGET_PATH)"
|
||||
|
||||
ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
|
||||
servertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
|
||||
@echo
|
||||
@echo "Unfortunately ffserver is broken and therefore its regression"
|
||||
@echo "test fails randomly. Treat the results accordingly."
|
||||
@echo
|
||||
$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
|
||||
$(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
|
||||
|
||||
tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
|
||||
tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
|
||||
mkdir -p tests/vsynth1
|
||||
$(BUILD_ROOT)/$< 'tests/vsynth1/'
|
||||
|
||||
tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
|
||||
tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
|
||||
mkdir -p tests/vsynth2
|
||||
$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
|
||||
|
||||
tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
|
||||
mkdir -p tests/data
|
||||
tests/asynth1.sw: tests/audiogen$(EXESUF)
|
||||
$(BUILD_ROOT)/$< $@
|
||||
|
||||
tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
|
||||
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||
tests/%$(EXESUF): tests/%.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
|
||||
|
||||
ifdef SAMPLES
|
||||
include $(SRC_PATH_BARE)/tests/fate.mak
|
||||
fate: $(FATE_TESTS)
|
||||
$(FATE_TESTS): ffmpeg$(EXESUF)
|
||||
@echo "TEST FATE $(@:fate-%=%)"
|
||||
@$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)'
|
||||
else
|
||||
fate:
|
||||
@echo "SAMPLES not specified, cannot run FATE"
|
||||
endif
|
||||
tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
|
||||
$(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||
|
||||
.PHONY: documentation *test regtest-* zlib-error alltools check config
|
||||
|
||||
.PHONY: lib videohook documentation *test regtest-* swscale-error zlib-error alltools check
|
||||
|
||||
-include $(VHOOK_DEPS)
|
||||
|
197
RELEASE
197
RELEASE
@@ -1,18 +1,14 @@
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
* 0.6 "Works with HTML5" June, 2010
|
||||
* 0.5 "Bike Shed World Domination" March 3, 2009
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This release features a lot of improvements that are relevant for HTML5 video.
|
||||
The H.264 and Theora decoders are now significantly faster, the vorbis decoder
|
||||
has seen important updates and this release supports Google's newly released
|
||||
libvpx library for the VP8 codec and WEBM container.
|
||||
|
||||
Other important changes are additions of decoders including, but not limited to,
|
||||
Intel Indeo 5, WMA Pro, WMA Voice and HE-AAC.
|
||||
It has been so long since the last release that this should be considered the
|
||||
first FFmpeg release of recent times. Because of the way things have unfolded to
|
||||
date, the notes for this version cannot be entirely conventional.
|
||||
|
||||
See the Changelog file for a list of significant changes.
|
||||
|
||||
@@ -23,74 +19,137 @@ version of the development code to check if the issue still exists. If it does,
|
||||
make your report against the development code following the usual bug reporting
|
||||
guidelines.
|
||||
|
||||
API notes
|
||||
---------
|
||||
|
||||
API and other notable Changes
|
||||
-----------------------------
|
||||
In the next release, it is intended to remove a number of deprecated APIs. We
|
||||
decided to put out a release that includes said APIs for the benefit of third
|
||||
party software.
|
||||
|
||||
Please see the file doc/APIchanges for programmer-centric information.
|
||||
As such, this release:
|
||||
- provides a sync point for said APIs
|
||||
- increases awareness of API changes
|
||||
- allows the next release to detail how to transition from the old to the new
|
||||
|
||||
Notable changes:
|
||||
- deprecated vhook subsystem removed
|
||||
- deprecated old scaler removed
|
||||
- nonfree libamr support for AMR-NB/WB decoding/encoding removed
|
||||
- RTMP support in libavformat
|
||||
- -formats option split into -formats, -codecs, -bsfs, and -protocols
|
||||
- ffprobe tool
|
||||
- RTMP/RTMPT/RTMPS/RTMPE/RTMPTE protocol support via librtmp
|
||||
- CODEC_CAP_EXPERIMENTAL added
|
||||
The deprecated APIs to be removed are:
|
||||
- imgconvert (to be replaced by libswscale)
|
||||
- vhook (to be replaced by libavfilter)
|
||||
|
||||
If at all possible, do not use the deprecated APIs. All notes on API changes
|
||||
should appear in doc/APIchanges.
|
||||
|
||||
|
||||
Added Codecs:
|
||||
|
||||
* 0.5.1 March 2, 2010
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
- VQF demuxer
|
||||
- PCX encoder
|
||||
- CorePNG decoding support
|
||||
- 8088flex TMV demuxer and decoder
|
||||
- enable symbol versioning by default for linkers that support it
|
||||
- V210 decoder and encoder
|
||||
- QCP demuxer
|
||||
- SoX native format muxer and demuxer
|
||||
- AMR-NB decoding/encoding, AMR-WB decoding via OpenCORE libraries
|
||||
- DPX image decoder
|
||||
- Electronic Arts Madcow decoder
|
||||
- DivX (XSUB) subtitle encoder
|
||||
- experimental AAC encoder
|
||||
- Wave64 demuxer
|
||||
- IEC-61937 compatible Muxer
|
||||
- TwinVQ decoder
|
||||
- Bluray (PGS) subtitle decoder
|
||||
- LPCM support in MPEG-TS (HDMV RID as found on Blu-ray disks)
|
||||
- WMA Pro decoder
|
||||
- Core Audio Format demuxer
|
||||
- Atrac1 decoder
|
||||
- MD STUDIO audio demuxer
|
||||
- RF64 support in WAV demuxer
|
||||
- MPEG-4 Audio Lossless Coding (ALS) decoder
|
||||
- IV8 demuxer
|
||||
- CDG demuxer and decoder
|
||||
- R210 decoder
|
||||
- Auravision Aura 1 and 2 decoders
|
||||
- Deluxe Paint Animation playback system
|
||||
- SIPR decoder
|
||||
- Adobe Filmstrip muxer and demuxer
|
||||
- RTP packetization and depacketization of H.263 and AMR
|
||||
- Bink demuxer and audio/video decoders
|
||||
- IFF PBM/ILBM bitmap decoder
|
||||
- Indeo 5 decoder
|
||||
- WMA Voice decoder
|
||||
- AMR-NB decoder
|
||||
- RTSP muxer
|
||||
- HE-AAC v1 decoder
|
||||
- Kega Game Video (KGV1) decoder
|
||||
- Psygnosis YOP demuxer and video decoder
|
||||
- RTP hinting in the mov/3gp/mp4 muxer
|
||||
- VP8 decoding via libvpx
|
||||
This point release includes some minor updates to make the 0.5 release series
|
||||
usable for users that need to retain the existing behavior as closely as
|
||||
possible. The changes follow below:
|
||||
|
||||
Security fixes
|
||||
--------------
|
||||
|
||||
Various programming errors in container and codec implementations
|
||||
may lead to denial of service or the execution of arbitrary code
|
||||
if the user is tricked into opening a malformed media file or stream.
|
||||
|
||||
Affected and updated have been the implementations of the following
|
||||
codecs and container formats:
|
||||
|
||||
- the Vorbis audio codec
|
||||
- the FF Video 1 codec
|
||||
- the MPEG audio codec
|
||||
- the H264 video codec
|
||||
- the MLP codec
|
||||
- the HuffYUV codec
|
||||
- the ASF demuxer
|
||||
- the Ogg container implementation
|
||||
- the MOV container implementation
|
||||
|
||||
Symbol Versioning enabled
|
||||
-------------------------
|
||||
|
||||
The backported symbol versioning change is enabled on platforms that support
|
||||
it. This allows users to upgrade from 0.5.1 to the upcoming 0.6 release
|
||||
without having to recompile their applications. Please note that distributors
|
||||
have to recompile applications against 0.5.1 before upgrading to 0.6.
|
||||
|
||||
libx264.c backport
|
||||
------------------
|
||||
|
||||
This release includes a backport to the libx264 wrapper that allows FFmpeg to
|
||||
be compiled against newer versions of libx264 up to API version 85.
|
||||
|
||||
licensing changes
|
||||
-----------------
|
||||
|
||||
Previously both libswscale and our AC-3 decoder had GPLed parts. These have
|
||||
been replaced by fresh LGPL code. x86 optimizations for libswscale remain GPL,
|
||||
but the C code is fully functional. Optimizations for other architectures have
|
||||
been relicensed to LGPL.
|
||||
|
||||
AMR-NB decoding/encoding and AMR-WB decoding is now possible through the free
|
||||
software OpenCORE libraries as an alternative to the non-free libamr libraries.
|
||||
|
||||
We found out that libfaac contains non-free parts and is not LGPL as previously
|
||||
claimed. We have changed configure to reflect this. You now have to pass the
|
||||
--enable-nonfree option if you wish to compile with libfaac support enabled.
|
||||
|
||||
Furthermore the non-free bits in libavcodec/fdctref.c have been rewritten. Note
|
||||
well that they were only used in a test program and never compiled into any
|
||||
FFmpeg library.
|
||||
|
||||
|
||||
Notable license related changes
|
||||
-------------------------------
|
||||
|
||||
- remaining GPL parts in AC-3 decoder converted to LGPL
|
||||
- libswscale can now be compiled in LGPL mode
|
||||
- libvpx is considered (L)GPL incompatible
|
||||
* 0.5.2 May 25, 2010
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This is a maintenance-only release that addresses a small number of security
|
||||
and portability issues. Distributors and system integrators are encouraged
|
||||
to update and share their patches against this branch.
|
||||
|
||||
|
||||
|
||||
* 0.5.3 Oct 18, 2010
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This is (again) another maintenance-only release that addresses a fix
|
||||
for seekable HTTP and an exploitable bug in the FLIC decoder
|
||||
(cf. CVE-2010-3429 for details). Distributors and system integrators are
|
||||
encouraged to update and share their patches against this branch.
|
||||
|
||||
|
||||
|
||||
* 0.5.4 Mar 17, 2011
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This is the first release that we cut after git migration. It is another
|
||||
maintenance-only release that addresses several security issues that were
|
||||
brought to our attention. In detail, fixes for RV30/40, WMV, Vorbis and
|
||||
VC-1 have been backported from trunk. Distributors and system integrators
|
||||
are encouraged to update and share their patches against this branch.
|
||||
|
||||
|
||||
|
||||
* 0.5.5 Nov 6, 2011
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This maintenance-only release addresses several security issues that
|
||||
were brought to our attention. In detail, fixes for the MJPEG decoder,
|
||||
the CAVS decoder (CVE-2011-3362, CVE-2011-3973, CVE-2011-3974), and the
|
||||
Matroska decoder (MSVR11-011/CVE-2011-3504) and many others have been
|
||||
corrected. Additional, this release contains fixes for compilation with
|
||||
gcc-4.6. Distributors and system integrators are encouraged to update
|
||||
and share their patches against this branch.
|
||||
|
||||
|
360
cmdutils.c
360
cmdutils.c
@@ -35,24 +35,22 @@
|
||||
#include "libswscale/swscale.h"
|
||||
#include "libpostproc/postprocess.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavcodec/opt.h"
|
||||
#include "cmdutils.h"
|
||||
#include "version.h"
|
||||
#if CONFIG_NETWORK
|
||||
#include "libavformat/network.h"
|
||||
#endif
|
||||
#if HAVE_SYS_RESOURCE_H
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#undef exit
|
||||
|
||||
const char **opt_names;
|
||||
static int opt_name_count;
|
||||
AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
||||
AVCodecContext *avctx_opts[CODEC_TYPE_NB];
|
||||
AVFormatContext *avformat_opts;
|
||||
struct SwsContext *sws_opts;
|
||||
|
||||
const int this_year = 2010;
|
||||
const int this_year = 2009;
|
||||
|
||||
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
|
||||
{
|
||||
@@ -127,20 +125,11 @@ void parse_options(int argc, char **argv, const OptionDef *options,
|
||||
opt = argv[optindex++];
|
||||
|
||||
if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
|
||||
int bool_val = 1;
|
||||
if (opt[1] == '-' && opt[2] == '\0') {
|
||||
handleoptions = 0;
|
||||
continue;
|
||||
}
|
||||
opt++;
|
||||
po= find_option(options, opt);
|
||||
if (!po->name && opt[0] == 'n' && opt[1] == 'o') {
|
||||
/* handle 'no' bool option */
|
||||
po = find_option(options, opt + 2);
|
||||
if (!(po->name && (po->flags & OPT_BOOL)))
|
||||
goto unknown_opt;
|
||||
bool_val = 0;
|
||||
}
|
||||
po= find_option(options, opt + 1);
|
||||
if (!po->name)
|
||||
po= find_option(options, "default");
|
||||
if (!po->name) {
|
||||
@@ -161,18 +150,16 @@ unknown_opt:
|
||||
str = av_strdup(arg);
|
||||
*po->u.str_arg = str;
|
||||
} else if (po->flags & OPT_BOOL) {
|
||||
*po->u.int_arg = bool_val;
|
||||
*po->u.int_arg = 1;
|
||||
} else if (po->flags & OPT_INT) {
|
||||
*po->u.int_arg = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
|
||||
*po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX);
|
||||
} else if (po->flags & OPT_INT64) {
|
||||
*po->u.int64_arg = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX);
|
||||
*po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX);
|
||||
} else if (po->flags & OPT_FLOAT) {
|
||||
*po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
|
||||
*po->u.float_arg = parse_number_or_die(opt+1, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
|
||||
} else if (po->flags & OPT_FUNC2) {
|
||||
if (po->u.func2_arg(opt, arg) < 0) {
|
||||
fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
|
||||
exit(1);
|
||||
}
|
||||
if(po->u.func2_arg(opt+1, arg)<0)
|
||||
goto unknown_opt;
|
||||
} else {
|
||||
po->u.func_arg(arg);
|
||||
}
|
||||
@@ -191,91 +178,41 @@ int opt_default(const char *opt, const char *arg){
|
||||
const AVOption *o= NULL;
|
||||
int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
|
||||
|
||||
for(type=0; type<AVMEDIA_TYPE_NB && ret>= 0; type++){
|
||||
const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]);
|
||||
for(type=0; type<CODEC_TYPE_NB && ret>= 0; type++){
|
||||
const AVOption *o2 = av_find_opt(avctx_opts[0], opt, NULL, opt_types[type], opt_types[type]);
|
||||
if(o2)
|
||||
ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o);
|
||||
ret = av_set_string3(avctx_opts[type], opt, arg, 1, &o);
|
||||
}
|
||||
if(!o)
|
||||
ret = av_set_string3(avformat_opts, opt, arg, 1, &o);
|
||||
if(!o && sws_opts)
|
||||
if(!o)
|
||||
ret = av_set_string3(sws_opts, opt, arg, 1, &o);
|
||||
if(!o){
|
||||
if(opt[0] == 'a')
|
||||
ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o);
|
||||
ret = av_set_string3(avctx_opts[CODEC_TYPE_AUDIO], opt+1, arg, 1, &o);
|
||||
else if(opt[0] == 'v')
|
||||
ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o);
|
||||
ret = av_set_string3(avctx_opts[CODEC_TYPE_VIDEO], opt+1, arg, 1, &o);
|
||||
else if(opt[0] == 's')
|
||||
ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o);
|
||||
ret = av_set_string3(avctx_opts[CODEC_TYPE_SUBTITLE], opt+1, arg, 1, &o);
|
||||
}
|
||||
if (o && ret < 0) {
|
||||
fprintf(stderr, "Invalid value '%s' for option '%s'\n", arg, opt);
|
||||
exit(1);
|
||||
}
|
||||
if (!o) {
|
||||
fprintf(stderr, "Unrecognized option '%s'\n", opt);
|
||||
exit(1);
|
||||
}
|
||||
if(!o)
|
||||
return -1;
|
||||
|
||||
// av_log(NULL, AV_LOG_ERROR, "%s:%s: %f 0x%0X\n", opt, arg, av_get_double(avcodec_opts, opt, NULL), (int)av_get_int(avcodec_opts, opt, NULL));
|
||||
// av_log(NULL, AV_LOG_ERROR, "%s:%s: %f 0x%0X\n", opt, arg, av_get_double(avctx_opts, opt, NULL), (int)av_get_int(avctx_opts, opt, NULL));
|
||||
|
||||
//FIXME we should always use avcodec_opts, ... for storing options so there will not be any need to keep track of what i set over this
|
||||
//FIXME we should always use avctx_opts, ... for storing options so there will not be any need to keep track of what i set over this
|
||||
opt_names= av_realloc(opt_names, sizeof(void*)*(opt_name_count+1));
|
||||
opt_names[opt_name_count++]= o->name;
|
||||
|
||||
if(avcodec_opts[0]->debug || avformat_opts->debug)
|
||||
if(avctx_opts[0]->debug || avformat_opts->debug)
|
||||
av_log_set_level(AV_LOG_DEBUG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_loglevel(const char *opt, const char *arg)
|
||||
{
|
||||
const struct { const char *name; int level; } log_levels[] = {
|
||||
{ "quiet" , AV_LOG_QUIET },
|
||||
{ "panic" , AV_LOG_PANIC },
|
||||
{ "fatal" , AV_LOG_FATAL },
|
||||
{ "error" , AV_LOG_ERROR },
|
||||
{ "warning", AV_LOG_WARNING },
|
||||
{ "info" , AV_LOG_INFO },
|
||||
{ "verbose", AV_LOG_VERBOSE },
|
||||
{ "debug" , AV_LOG_DEBUG },
|
||||
};
|
||||
char *tail;
|
||||
int level;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) {
|
||||
if (!strcmp(log_levels[i].name, arg)) {
|
||||
av_log_set_level(log_levels[i].level);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
level = strtol(arg, &tail, 10);
|
||||
if (*tail) {
|
||||
fprintf(stderr, "Invalid loglevel \"%s\". "
|
||||
"Possible levels are numbers or:\n", arg);
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++)
|
||||
fprintf(stderr, "\"%s\"\n", log_levels[i].name);
|
||||
exit(1);
|
||||
}
|
||||
av_log_set_level(level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_timelimit(const char *opt, const char *arg)
|
||||
{
|
||||
#if HAVE_SETRLIMIT
|
||||
int lim = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
|
||||
struct rlimit rl = { lim, lim + 1 };
|
||||
if (setrlimit(RLIMIT_CPU, &rl))
|
||||
perror("setrlimit");
|
||||
#else
|
||||
fprintf(stderr, "Warning: -%s not implemented on this OS\n", opt);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void set_context_opts(void *ctx, void *opts_ctx, int flags)
|
||||
{
|
||||
int i;
|
||||
@@ -291,69 +228,78 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags)
|
||||
|
||||
void print_error(const char *filename, int err)
|
||||
{
|
||||
char errbuf[128];
|
||||
const char *errbuf_ptr = errbuf;
|
||||
|
||||
if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
|
||||
errbuf_ptr = strerror(AVUNERROR(err));
|
||||
fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
|
||||
switch(err) {
|
||||
case AVERROR_NUMEXPECTED:
|
||||
fprintf(stderr, "%s: Incorrect image filename syntax.\n"
|
||||
"Use '%%d' to specify the image number:\n"
|
||||
" for img1.jpg, img2.jpg, ..., use 'img%%d.jpg';\n"
|
||||
" for img001.jpg, img002.jpg, ..., use 'img%%03d.jpg'.\n",
|
||||
filename);
|
||||
break;
|
||||
case AVERROR_INVALIDDATA:
|
||||
fprintf(stderr, "%s: Error while parsing header\n", filename);
|
||||
break;
|
||||
case AVERROR_NOFMT:
|
||||
fprintf(stderr, "%s: Unknown format\n", filename);
|
||||
break;
|
||||
case AVERROR(EIO):
|
||||
fprintf(stderr, "%s: I/O error occurred\n"
|
||||
"Usually that means that input file is truncated and/or corrupted.\n",
|
||||
filename);
|
||||
break;
|
||||
case AVERROR(ENOMEM):
|
||||
fprintf(stderr, "%s: memory allocation error occurred\n", filename);
|
||||
break;
|
||||
case AVERROR(ENOENT):
|
||||
fprintf(stderr, "%s: no such file or directory\n", filename);
|
||||
break;
|
||||
#if CONFIG_NETWORK
|
||||
case AVERROR(FF_NETERROR(EPROTONOSUPPORT)):
|
||||
fprintf(stderr, "%s: Unsupported network protocol\n", filename);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
fprintf(stderr, "%s: Error while opening file\n", filename);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent) \
|
||||
if (CONFIG_##LIBNAME) { \
|
||||
unsigned int version = libname##_version(); \
|
||||
fprintf(outstream, "%slib%-10s %2d.%2d.%2d / %2d.%2d.%2d\n", \
|
||||
indent? " " : "", #libname, \
|
||||
LIB##LIBNAME##_VERSION_MAJOR, \
|
||||
LIB##LIBNAME##_VERSION_MINOR, \
|
||||
LIB##LIBNAME##_VERSION_MICRO, \
|
||||
version >> 16, version >> 8 & 0xff, version & 0xff); \
|
||||
}
|
||||
#define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent) \
|
||||
version= libname##_version(); \
|
||||
fprintf(outstream, "%slib%-10s %2d.%2d.%2d / %2d.%2d.%2d\n", indent? " " : "", #libname, \
|
||||
LIB##LIBNAME##_VERSION_MAJOR, LIB##LIBNAME##_VERSION_MINOR, LIB##LIBNAME##_VERSION_MICRO, \
|
||||
version >> 16, version >> 8 & 0xff, version & 0xff);
|
||||
|
||||
static void print_all_lib_versions(FILE* outstream, int indent)
|
||||
{
|
||||
unsigned int version;
|
||||
PRINT_LIB_VERSION(outstream, avutil, AVUTIL, indent);
|
||||
PRINT_LIB_VERSION(outstream, avcodec, AVCODEC, indent);
|
||||
PRINT_LIB_VERSION(outstream, avformat, AVFORMAT, indent);
|
||||
PRINT_LIB_VERSION(outstream, avdevice, AVDEVICE, indent);
|
||||
#if CONFIG_AVFILTER
|
||||
PRINT_LIB_VERSION(outstream, avfilter, AVFILTER, indent);
|
||||
#endif
|
||||
#if CONFIG_SWSCALE
|
||||
PRINT_LIB_VERSION(outstream, swscale, SWSCALE, indent);
|
||||
#endif
|
||||
#if CONFIG_POSTPROC
|
||||
PRINT_LIB_VERSION(outstream, postproc, POSTPROC, indent);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void maybe_print_config(const char *lib, const char *cfg)
|
||||
{
|
||||
static int warned_cfg;
|
||||
|
||||
if (strcmp(FFMPEG_CONFIGURATION, cfg)) {
|
||||
if (!warned_cfg) {
|
||||
fprintf(stderr, " WARNING: library configuration mismatch\n");
|
||||
warned_cfg = 1;
|
||||
}
|
||||
fprintf(stderr, " %-11s configuration: %s\n", lib, cfg);
|
||||
}
|
||||
}
|
||||
|
||||
#define PRINT_LIB_CONFIG(lib, tag, cfg) do { \
|
||||
if (CONFIG_##lib) \
|
||||
maybe_print_config(tag, cfg); \
|
||||
} while (0)
|
||||
|
||||
void show_banner(void)
|
||||
{
|
||||
fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d the FFmpeg developers\n",
|
||||
fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d Fabrice Bellard, et al.\n",
|
||||
program_name, program_birth_year, this_year);
|
||||
fprintf(stderr, " built on %s %s with %s %s\n",
|
||||
__DATE__, __TIME__, CC_TYPE, CC_VERSION);
|
||||
fprintf(stderr, " configuration: " FFMPEG_CONFIGURATION "\n");
|
||||
PRINT_LIB_CONFIG(AVUTIL, "libavutil", avutil_configuration());
|
||||
PRINT_LIB_CONFIG(AVCODEC, "libavcodec", avcodec_configuration());
|
||||
PRINT_LIB_CONFIG(AVFORMAT, "libavformat", avformat_configuration());
|
||||
PRINT_LIB_CONFIG(AVDEVICE, "libavdevice", avdevice_configuration());
|
||||
PRINT_LIB_CONFIG(AVFILTER, "libavfilter", avfilter_configuration());
|
||||
PRINT_LIB_CONFIG(SWSCALE, "libswscale", swscale_configuration());
|
||||
PRINT_LIB_CONFIG(POSTPROC, "libpostproc", postproc_configuration());
|
||||
print_all_lib_versions(stderr, 1);
|
||||
fprintf(stderr, " built on " __DATE__ " " __TIME__);
|
||||
#ifdef __GNUC__
|
||||
fprintf(stderr, ", gcc: " __VERSION__ "\n");
|
||||
#else
|
||||
fprintf(stderr, ", using a non-gcc compiler\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_version(void) {
|
||||
@@ -430,27 +376,16 @@ void show_license(void)
|
||||
);
|
||||
}
|
||||
|
||||
void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts)
|
||||
{
|
||||
int i;
|
||||
char fmt_str[128];
|
||||
for (i=-1; i < nb_fmts; i++) {
|
||||
get_fmt_string (fmt_str, sizeof(fmt_str), i);
|
||||
fprintf(stdout, "%s\n", fmt_str);
|
||||
}
|
||||
}
|
||||
|
||||
void show_formats(void)
|
||||
{
|
||||
AVInputFormat *ifmt=NULL;
|
||||
AVOutputFormat *ofmt=NULL;
|
||||
URLProtocol *up=NULL;
|
||||
AVCodec *p=NULL, *p2;
|
||||
AVBitStreamFilter *bsf=NULL;
|
||||
const char *last_name;
|
||||
|
||||
printf(
|
||||
"File formats:\n"
|
||||
" D. = Demuxing supported\n"
|
||||
" .E = Muxing supported\n"
|
||||
" --\n");
|
||||
printf("File formats:\n");
|
||||
last_name= "000";
|
||||
for(;;){
|
||||
int decode=0;
|
||||
@@ -487,23 +422,9 @@ void show_formats(void)
|
||||
name,
|
||||
long_name ? long_name:" ");
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
void show_codecs(void)
|
||||
{
|
||||
AVCodec *p=NULL, *p2;
|
||||
const char *last_name;
|
||||
printf(
|
||||
"Codecs:\n"
|
||||
" D..... = Decoding supported\n"
|
||||
" .E.... = Encoding supported\n"
|
||||
" ..V... = Video codec\n"
|
||||
" ..A... = Audio codec\n"
|
||||
" ..S... = Subtitle codec\n"
|
||||
" ...S.. = Supports draw_horiz_band\n"
|
||||
" ....D. = Supports direct rendering method 1\n"
|
||||
" .....T = Supports weird frame truncation\n"
|
||||
" ------\n");
|
||||
printf("Codecs:\n");
|
||||
last_name= "000";
|
||||
for(;;){
|
||||
int decode=0;
|
||||
@@ -529,13 +450,13 @@ void show_codecs(void)
|
||||
last_name= p2->name;
|
||||
|
||||
switch(p2->type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
case CODEC_TYPE_VIDEO:
|
||||
type_str = "V";
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
case CODEC_TYPE_AUDIO:
|
||||
type_str = "A";
|
||||
break;
|
||||
case AVMEDIA_TYPE_SUBTITLE:
|
||||
case CODEC_TYPE_SUBTITLE:
|
||||
type_str = "S";
|
||||
break;
|
||||
default:
|
||||
@@ -557,6 +478,19 @@ void show_codecs(void)
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
printf("Bitstream filters:\n");
|
||||
while((bsf = av_bitstream_filter_next(bsf)))
|
||||
printf(" %s", bsf->name);
|
||||
printf("\n");
|
||||
|
||||
printf("Supported file protocols:\n");
|
||||
while((up = av_protocol_next(up)))
|
||||
printf(" %s:", up->name);
|
||||
printf("\n");
|
||||
|
||||
printf("Frame size, frame rate abbreviations:\n ntsc pal qntsc qpal sntsc spal film ntsc-film sqcif qcif cif 4cif\n");
|
||||
printf("\n");
|
||||
printf(
|
||||
"Note, the names of encoders and decoders do not always match, so there are\n"
|
||||
"several cases where the above table shows encoder only or decoder only entries\n"
|
||||
@@ -564,101 +498,3 @@ void show_codecs(void)
|
||||
"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
|
||||
"worse.\n");
|
||||
}
|
||||
|
||||
void show_bsfs(void)
|
||||
{
|
||||
AVBitStreamFilter *bsf=NULL;
|
||||
|
||||
printf("Bitstream filters:\n");
|
||||
while((bsf = av_bitstream_filter_next(bsf)))
|
||||
printf("%s\n", bsf->name);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void show_protocols(void)
|
||||
{
|
||||
URLProtocol *up=NULL;
|
||||
|
||||
printf("Supported file protocols:\n");
|
||||
while((up = av_protocol_next(up)))
|
||||
printf("%s\n", up->name);
|
||||
}
|
||||
|
||||
void show_filters(void)
|
||||
{
|
||||
AVFilter av_unused(**filter) = NULL;
|
||||
|
||||
printf("Filters:\n");
|
||||
#if CONFIG_AVFILTER
|
||||
while ((filter = av_filter_next(filter)) && *filter)
|
||||
printf("%-16s %s\n", (*filter)->name, (*filter)->description);
|
||||
#endif
|
||||
}
|
||||
|
||||
void show_pix_fmts(void)
|
||||
{
|
||||
enum PixelFormat pix_fmt;
|
||||
|
||||
printf(
|
||||
"Pixel formats:\n"
|
||||
"I.... = Supported Input format for conversion\n"
|
||||
".O... = Supported Output format for conversion\n"
|
||||
"..H.. = Hardware accelerated format\n"
|
||||
"...P. = Paletted format\n"
|
||||
"....B = Bitstream format\n"
|
||||
"FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL\n"
|
||||
"-----\n");
|
||||
|
||||
#if !CONFIG_SWSCALE
|
||||
# define sws_isSupportedInput(x) 0
|
||||
# define sws_isSupportedOutput(x) 0
|
||||
#endif
|
||||
|
||||
for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) {
|
||||
const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
|
||||
printf("%c%c%c%c%c %-16s %d %2d\n",
|
||||
sws_isSupportedInput (pix_fmt) ? 'I' : '.',
|
||||
sws_isSupportedOutput(pix_fmt) ? 'O' : '.',
|
||||
pix_desc->flags & PIX_FMT_HWACCEL ? 'H' : '.',
|
||||
pix_desc->flags & PIX_FMT_PAL ? 'P' : '.',
|
||||
pix_desc->flags & PIX_FMT_BITSTREAM ? 'B' : '.',
|
||||
pix_desc->name,
|
||||
pix_desc->nb_components,
|
||||
av_get_bits_per_pixel(pix_desc));
|
||||
}
|
||||
}
|
||||
|
||||
int read_yesno(void)
|
||||
{
|
||||
int c = getchar();
|
||||
int yesno = (toupper(c) == 'Y');
|
||||
|
||||
while (c != '\n' && c != EOF)
|
||||
c = getchar();
|
||||
|
||||
return yesno;
|
||||
}
|
||||
|
||||
int read_file(const char *filename, char **bufptr, size_t *size)
|
||||
{
|
||||
FILE *f = fopen(filename, "rb");
|
||||
|
||||
if (!f) {
|
||||
fprintf(stderr, "Cannot read file '%s': %s\n", filename, strerror(errno));
|
||||
return AVERROR(errno);
|
||||
}
|
||||
fseek(f, 0, SEEK_END);
|
||||
*size = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
*bufptr = av_malloc(*size + 1);
|
||||
if (!*bufptr) {
|
||||
fprintf(stderr, "Could not allocate file buffer\n");
|
||||
fclose(f);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
fread(*bufptr, 1, *size, f);
|
||||
(*bufptr)[*size++] = '\0';
|
||||
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
74
cmdutils.h
74
cmdutils.h
@@ -40,7 +40,7 @@ extern const int program_birth_year;
|
||||
extern const int this_year;
|
||||
|
||||
extern const char **opt_names;
|
||||
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
||||
extern AVCodecContext *avctx_opts[CODEC_TYPE_NB];
|
||||
extern AVFormatContext *avformat_opts;
|
||||
extern struct SwsContext *sws_opts;
|
||||
|
||||
@@ -50,16 +50,6 @@ extern struct SwsContext *sws_opts;
|
||||
*/
|
||||
int opt_default(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Sets the libav* libraries log level.
|
||||
*/
|
||||
int opt_loglevel(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Limit the execution time.
|
||||
*/
|
||||
int opt_timelimit(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Parses a string and returns its corresponding value as a double.
|
||||
* Exits from the application if the string cannot be correctly
|
||||
@@ -83,8 +73,8 @@ double parse_number_or_die(const char *context, const char *numstr, int type, do
|
||||
* @param context the context of the value to be set (e.g. the
|
||||
* corresponding commandline option name)
|
||||
* @param timestr the string to be parsed
|
||||
* @param is_duration a flag which tells how to interpret timestr, if
|
||||
* not zero timestr is interpreted as a duration, otherwise as a
|
||||
* @param is_duration a flag which tells how to interpret \p timestr, if
|
||||
* not zero \p timestr is interpreted as a duration, otherwise as a
|
||||
* date
|
||||
*
|
||||
* @see parse_date()
|
||||
@@ -134,19 +124,8 @@ void parse_options(int argc, char **argv, const OptionDef *options,
|
||||
|
||||
void set_context_opts(void *ctx, void *opts_ctx, int flags);
|
||||
|
||||
/**
|
||||
* Prints an error message to stderr, indicating filename and a human
|
||||
* readable description of the error code err.
|
||||
*
|
||||
* If strerror_r() is not available the use of this function in a
|
||||
* multithreaded application may be unsafe.
|
||||
*
|
||||
* @see av_strerror()
|
||||
*/
|
||||
void print_error(const char *filename, int err);
|
||||
|
||||
void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts);
|
||||
|
||||
/**
|
||||
* Prints the program banner to stderr. The banner contents depend on the
|
||||
* current version of the repository and of the libav* libraries used by
|
||||
@@ -173,51 +152,4 @@ void show_license(void);
|
||||
*/
|
||||
void show_formats(void);
|
||||
|
||||
/**
|
||||
* Prints a listing containing all the codecs supported by the
|
||||
* program.
|
||||
*/
|
||||
void show_codecs(void);
|
||||
|
||||
/**
|
||||
* Prints a listing containing all the filters supported by the
|
||||
* program.
|
||||
*/
|
||||
void show_filters(void);
|
||||
|
||||
/**
|
||||
* Prints a listing containing all the bit stream filters supported by the
|
||||
* program.
|
||||
*/
|
||||
void show_bsfs(void);
|
||||
|
||||
/**
|
||||
* Prints a listing containing all the protocols supported by the
|
||||
* program.
|
||||
*/
|
||||
void show_protocols(void);
|
||||
|
||||
/**
|
||||
* Prints a listing containing all the pixel formats supported by the
|
||||
* program.
|
||||
*/
|
||||
void show_pix_fmts(void);
|
||||
|
||||
/**
|
||||
* Returns a positive value if reads from standard input a line
|
||||
* starting with [yY], otherwise returns 0.
|
||||
*/
|
||||
int read_yesno(void);
|
||||
|
||||
/**
|
||||
* Reads the file with name filename, and puts its content in a newly
|
||||
* allocated 0-terminated buffer.
|
||||
*
|
||||
* @param bufptr puts here the pointer to the newly allocated buffer
|
||||
* @param size puts here the size of the newly allocated buffer
|
||||
* @return 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR error code in case of failure.
|
||||
*/
|
||||
int read_file(const char *filename, char **bufptr, size_t *size);
|
||||
|
||||
#endif /* FFMPEG_CMDUTILS_H */
|
||||
|
@@ -1,13 +0,0 @@
|
||||
{ "L", OPT_EXIT, {(void*)show_license}, "show license" },
|
||||
{ "h", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "?", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "help", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "-help", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "version", OPT_EXIT, {(void*)show_version}, "show version" },
|
||||
{ "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" },
|
||||
{ "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" },
|
||||
{ "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" },
|
||||
{ "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" },
|
||||
{ "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" },
|
||||
{ "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" },
|
||||
{ "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
134
common.mak
134
common.mak
@@ -2,13 +2,12 @@
|
||||
# common bits used by all libraries
|
||||
#
|
||||
|
||||
# first so "all" becomes default target
|
||||
all: all-yes
|
||||
all: # make "all" default target
|
||||
|
||||
ifndef SUBDIR
|
||||
vpath %.c $(SRC_DIR)
|
||||
vpath %.h $(SRC_DIR)
|
||||
vpath %.S $(SRC_DIR)
|
||||
vpath %.c $(SRC_DIR)
|
||||
vpath %.h $(SRC_DIR)
|
||||
vpath %.S $(SRC_DIR)
|
||||
vpath %.asm $(SRC_DIR)
|
||||
vpath %.v $(SRC_DIR)
|
||||
|
||||
@@ -18,92 +17,101 @@ else
|
||||
BUILD_ROOT_REL = ..
|
||||
endif
|
||||
|
||||
ifndef V
|
||||
Q = @
|
||||
ECHO = printf "$(1)\t%s\n" $(2)
|
||||
BRIEF = CC AS YASM AR LD HOSTCC STRIP CP
|
||||
SILENT = DEPCC YASMDEP RM RANLIB
|
||||
MSG = $@
|
||||
M = @$(call ECHO,$(TAG),$@);
|
||||
$(foreach VAR,$(BRIEF), \
|
||||
$(eval $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
|
||||
$(foreach VAR,$(SILENT),$(eval $(VAR) = @$($(VAR))))
|
||||
$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
|
||||
endif
|
||||
|
||||
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
|
||||
|
||||
CPPFLAGS := -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
|
||||
CFLAGS += $(ECFLAGS)
|
||||
CFLAGS := -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
|
||||
-I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
$(CCDEP)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
|
||||
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
|
||||
|
||||
%.o: %.S
|
||||
$(ASDEP)
|
||||
$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
|
||||
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
|
||||
|
||||
%.ho: %.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
|
||||
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
|
||||
|
||||
%.d: %.c
|
||||
$(DEPEND_CMD) > $@
|
||||
|
||||
%.d: %.S
|
||||
$(DEPEND_CMD) > $@
|
||||
|
||||
%.d: %.cpp
|
||||
$(DEPEND_CMD) > $@
|
||||
|
||||
%.o: %.d
|
||||
|
||||
%$(EXESUF): %.c
|
||||
|
||||
%.ver: %.v
|
||||
$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
|
||||
sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
|
||||
|
||||
%.c %.h: TAG = GEN
|
||||
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
|
||||
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
|
||||
$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
|
||||
endif
|
||||
|
||||
$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh
|
||||
$< $(SRC_PATH) $@ $(EXTRA_VERSION)
|
||||
|
||||
install: install-libs install-headers
|
||||
install-libs: install-libs-yes
|
||||
|
||||
uninstall: uninstall-libs uninstall-headers
|
||||
|
||||
.PHONY: all depend dep *clean install* uninstall* examples testprogs
|
||||
|
||||
# Disable suffix rules. Most of the builtin rules are suffix rules,
|
||||
# so this saves some time on slow systems.
|
||||
.SUFFIXES:
|
||||
|
||||
# Do not delete intermediate files from chains of implicit rules
|
||||
$(OBJS):
|
||||
.PHONY: all depend dep clean distclean install* uninstall* tests
|
||||
endif
|
||||
|
||||
OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
|
||||
|
||||
CFLAGS += $(CFLAGS-yes)
|
||||
OBJS += $(OBJS-yes)
|
||||
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
|
||||
TESTPROGS += $(TESTPROGS-yes)
|
||||
CFLAGS += $(CFLAGS-yes)
|
||||
OBJS += $(OBJS-yes)
|
||||
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
|
||||
TESTS += $(TESTS-yes)
|
||||
|
||||
FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
|
||||
FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
|
||||
FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS)
|
||||
|
||||
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
|
||||
OBJS := $(addprefix $(SUBDIR),$(sort $(OBJS)))
|
||||
TESTOBJS := $(addprefix $(SUBDIR),$(TESTOBJS))
|
||||
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
|
||||
HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
|
||||
HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
|
||||
OBJS := $(addprefix $(SUBDIR),$(OBJS))
|
||||
TESTS := $(addprefix $(SUBDIR),$(TESTS))
|
||||
|
||||
DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
|
||||
DEP_LIBS:=$(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME))
|
||||
|
||||
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
||||
SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS))
|
||||
SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS))
|
||||
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
|
||||
|
||||
$(HOSTOBJS): %.o: %.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
|
||||
|
||||
$(HOSTPROGS): %$(HOSTEXESUF): %.o
|
||||
$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
|
||||
checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
|
||||
|
||||
DEPS := $(OBJS:.o=.d)
|
||||
depend dep: $(DEPS)
|
||||
|
||||
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
|
||||
DISTCLEANSUFFIXES = *.pc
|
||||
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
|
||||
CLEANSUFFIXES = *.o *~ *.ho *.ver
|
||||
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map
|
||||
DISTCLEANSUFFIXES = *.d *.pc
|
||||
|
||||
-include $(wildcard $(DEPS))
|
||||
define RULES
|
||||
$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
|
||||
$(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS)
|
||||
|
||||
$(SUBDIR)%-test.o: $(SUBDIR)%.c
|
||||
$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
|
||||
|
||||
$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
|
||||
$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
|
||||
|
||||
$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
|
||||
$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
|
||||
|
||||
$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
|
||||
$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
|
||||
|
||||
clean::
|
||||
rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
|
||||
$(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
|
||||
|
||||
distclean:: clean
|
||||
rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
|
||||
$(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
|
||||
endef
|
||||
|
||||
$(eval $(RULES))
|
||||
|
||||
tests: $(TESTS)
|
||||
|
||||
-include $(DEPS)
|
||||
|
230
doc/APIchanges
230
doc/APIchanges
@@ -1,229 +1,15 @@
|
||||
Never assume the API of libav* to be stable unless at least 1 week has passed since
|
||||
the last major version increase.
|
||||
The last version increases were:
|
||||
libavcodec: ?
|
||||
libavdevice: ?
|
||||
libavfilter: 2009-10-18
|
||||
libavformat: ?
|
||||
libpostproc: ?
|
||||
libswscale: ?
|
||||
libavutil: 2009-03-08
|
||||
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2010-06-01 - r31301 - lsws 0.11.0 - convertPalette API
|
||||
Add sws_convertPalette8ToPacked32 and sws_convertPalette8ToPacked24
|
||||
|
||||
2010-05-26 - r23334 - lavc 52.72.0 - CODEC_CAP_EXPERIMENTAL
|
||||
Add CODEC_CAP_EXPERIMENTAL flag.
|
||||
|
||||
2010-05-18 - r23161 - lavf 52.63.0 - AVFMT_FLAG_RTP_HINT
|
||||
Add AVFMT_FLAG_RTP_HINT as possible value for AVFormatContext.flags
|
||||
|
||||
2010-05-01 - r23002 - lavf 52.62.0 - probe function
|
||||
Add av_probe_input_format2 to API, it allows ignoring probe
|
||||
results below given score and returns the actual probe score.
|
||||
|
||||
2010-04-01 - r22806 - lavf 52.61.0 - metadata API
|
||||
Add a flag for av_metadata_set2() to disable overwriting of
|
||||
existing tags.
|
||||
|
||||
2010-04-01 - r22753 - lavc 52.66.0
|
||||
Add avcodec_get_edge_width()
|
||||
|
||||
2010-03-31 - r22750 - lavc 52.65.0
|
||||
Add avcodec_copy_context().
|
||||
|
||||
2010-03-31 - r22748 - lavf 52.60.0 - av_match_ext()
|
||||
Make av_match_ext() public.
|
||||
|
||||
2010-03-31 - r22736 - lavu 50.14.0 - AVMediaType
|
||||
Move AVMediaType enum from libavcodec to libavutil.
|
||||
|
||||
2010-03-31 - r22735 - lavc 52.64.0 - AVMediaType
|
||||
Define AVMediaType enum, and use it instead of enum CodecType, which
|
||||
is deprecated and will be dropped at the next major bump.
|
||||
|
||||
2010-03-25 - r22684 - lavu 50.13.0 - av_strerror()
|
||||
Implement av_strerror().
|
||||
|
||||
2010-03-23 - r22649 - lavc 52.60.0 - av_dct_init()
|
||||
Support DCT-I and DST-I
|
||||
|
||||
2010-03-15 - r22540 - lavf 52.56.0 - AVFormatContext.start_time_realtime
|
||||
Add AVFormatContext.start_time_realtime field.
|
||||
|
||||
2010-03-13 - r22506 - lavfi 1.18.0 - AVFilterPicRef.pos
|
||||
Add AVFilterPicRef.pos field.
|
||||
|
||||
2010-03-13 - r22501 - lavu 50.12.0 - error.h
|
||||
Move error code definitions from libavcodec/avcodec.h to
|
||||
the new public header libavutil/error.h.
|
||||
|
||||
2010-03-07 - r22291 - lavc 52.56.0 - avfft.h
|
||||
Add public FFT interface.
|
||||
|
||||
2010-03-06 - r22251 - lavu 50.11.0 - av_stristr()
|
||||
Add av_stristr().
|
||||
|
||||
2010-03-03 - r22174 - lavu 50.10.0 - av_tree_enumerate()
|
||||
Add av_tree_enumerate().
|
||||
|
||||
2010-02-07 - r21673 - lavu 50.9.0 - av_compare_ts()
|
||||
Add av_compare_ts().
|
||||
|
||||
2010-02-05 - r30513 - lsws 0.10.0 - sws_getCoefficients()
|
||||
Add sws_getCoefficients().
|
||||
|
||||
2010-02-01 - r21587 - lavf 52.50.0 - metadata API
|
||||
Add a list of generic tag names, change 'author' -> 'artist',
|
||||
'year' -> 'date'.
|
||||
|
||||
2010-01-30 - r21545 - lavu 50.8.0 - av_get_pix_fmt()
|
||||
Add av_get_pix_fmt().
|
||||
|
||||
2010-01-21 - r30381 - lsws 0.9.0 - sws_scale
|
||||
Change constness attributes of sws_scale() parameters.
|
||||
|
||||
2010-01-10 - r21121 - lavfi 1.15.0 - avfilter_graph_config_links()
|
||||
Add a log_ctx parameter to avfilter_graph_config_links().
|
||||
|
||||
2010-01-07 - r30236 - lsws 0.8.0 - sws_isSupported{In,Out}put
|
||||
Add sws_isSupportedInput() and sws_isSupportedOutput() functions.
|
||||
|
||||
2010-01-06 - r21035 - lavfi 1.14.0 - avfilter_add_colorspace()
|
||||
Change the avfilter_add_colorspace() signature, make it accept an
|
||||
(AVFilterFormats **) rather than an (AVFilterFormats *) as before.
|
||||
|
||||
2010-01-03 - r21007 - lavfi 1.13.0 - avfilter_add_colorspace()
|
||||
Add avfilter_add_colorspace().
|
||||
|
||||
2010-01-02 - r20998 - lavf 52.46.0 - av_match_ext()
|
||||
Add av_match_ext(), it should be used in place of match_ext().
|
||||
|
||||
2010-01-01 - r20991 - lavf 52.45.0 - av_guess_format()
|
||||
Add av_guess_format(), it should be used in place of guess_format().
|
||||
|
||||
2009-12-13 - r20834 - lavf 52.43.0 - metadata API
|
||||
Add av_metadata_set2(), AV_METADATA_DONT_STRDUP_KEY and AV_METADATA_DONT_STRDUP_VAL.
|
||||
|
||||
2009-12-13 - r20829 - lavu 50.7.0 - avstring.h API
|
||||
Add av_d2str().
|
||||
|
||||
2009-12-13 - r20826 - lavc 52.42.0 - AVStream
|
||||
Add avg_frame_rate.
|
||||
|
||||
2009-12-12 - r20808 - lavu 50.6.0 - av_bmg_next()
|
||||
Introduce the av_bmg_next() function.
|
||||
|
||||
2009-12-05 - r20734 - lavfi 1.12.0 - avfilter_draw_slice()
|
||||
Add a slice_dir parameter to avfilter_draw_slice().
|
||||
|
||||
2009-11-26 - r20611 - lavfi 1.11.0 - AVFilter
|
||||
Remove the next field from AVFilter, this is not anymore required.
|
||||
|
||||
2009-11-25 - r20607 - lavfi 1.10.0 - avfilter_next()
|
||||
Introduce the avfilter_next() function.
|
||||
|
||||
2009-11-25 - r20605 - lavfi 1.9.0 - avfilter_register()
|
||||
Change the signature of avfilter_register() to make it return an
|
||||
int. This is required since now the registration operation may fail.
|
||||
|
||||
2009-11-25 - r20603 - lavu 50.5.0 - pixdesc.h API
|
||||
Make the pixdesc.h API public.
|
||||
|
||||
2009-10-27 - r20385 - lavfi 1.5.0 - AVFilter.next
|
||||
Add a next field to AVFilter, this is used for simplifying the
|
||||
registration and management of the registered filters.
|
||||
|
||||
2009-10-23 - r20356 - lavfi 1.4.1 - AVFilter.description
|
||||
Add a description field to AVFilter.
|
||||
|
||||
2009-10-19 - r20302 - lavfi 1.3.0 - avfilter_make_format_list()
|
||||
Change the interface of avfilter_make_format_list() from
|
||||
avfilter_make_format_list(int n, ...) to
|
||||
avfilter_make_format_list(enum PixelFormat *pix_fmts).
|
||||
|
||||
2009-10-18 - r20272 - lavfi 1.0.0 - avfilter_get_video_buffer()
|
||||
Make avfilter_get_video_buffer() recursive and add the w and h
|
||||
parameters to it.
|
||||
|
||||
2009-10-07 - r20189 - lavfi 0.5.1 - AVFilterPic
|
||||
Add w and h fields to AVFilterPic.
|
||||
|
||||
2009-06-22 - r19250 - lavf 52.34.1 - AVFormatContext.packet_size
|
||||
This is now an unsigned int instead of a signed int.
|
||||
|
||||
2009-06-19 - r19222 - lavc 52.32.0 - AVSubtitle.pts
|
||||
Add a pts field to AVSubtitle which gives the subtitle packet pts
|
||||
in AV_TIME_BASE. Some subtitle de-/encoders (e.g. XSUB) will
|
||||
not work right without this.
|
||||
|
||||
2009-06-03 - r19078 - lavc 52.30.2 - AV_PKT_FLAG_KEY
|
||||
PKT_FLAG_KEY has been deprecated and will be dropped at the next
|
||||
major version. Use AV_PKT_FLAG_KEY instead.
|
||||
|
||||
2009-06-01 - r19025 - lavc 52.30.0 - av_lockmgr_register()
|
||||
20090601 - r19025 - lavc 52.30.0 - av_lockmgr_register()
|
||||
av_lockmgr_register() can be used to register a callback function
|
||||
that lavc (and in the future, libraries that depend on lavc) can use
|
||||
to implement mutexes. The application should provide a callback function
|
||||
that implements the AV_LOCK_* operations described in avcodec.h.
|
||||
When the lock manager is registered, FFmpeg is guaranteed to behave
|
||||
correctly in a multi-threaded application.
|
||||
the implements the AV_LOCK_* operations described in avcodec.h.
|
||||
When the lock manager is registered FFmpeg is guaranteed to behave
|
||||
correct also in a multi-threaded application.
|
||||
|
||||
2009-04-30 - r18719 - lavc 52.28.0 - av_free_packet
|
||||
av_free_packet() is no longer an inline function. It is now exported.
|
||||
|
||||
2009-04-11 - r18431 - lavc 52.25.0 - deprecate av_destruct_packet_nofree
|
||||
Please use NULL instead. This has been supported since r16506
|
||||
(lavf > 52.23.1, lavc > 52.10.0).
|
||||
|
||||
2009-04-07 - r18351 - lavc 52.23.0 - avcodec_decode_video/audio/subtitle
|
||||
The old decoding functions are deprecated, all new code should use the
|
||||
new functions avcodec_decode_video2(), avcodec_decode_audio3() and
|
||||
avcodec_decode_subtitle2(). These new functions take an AVPacket *pkt
|
||||
argument instead of a const uint8_t *buf / int buf_size pair.
|
||||
|
||||
2009-04-03 - r18321 - lavu 50.3.0 - av_fifo_space
|
||||
Introduce the av_fifo_space() function.
|
||||
|
||||
2009-04-02 - r18317 - lavc 52.23.0 - AVPacket
|
||||
Move AVPacket declaration from libavformat/avformat.h to
|
||||
libavcodec/avcodec.h.
|
||||
|
||||
2009-03-22 - r18163 - lavu 50.2.0 - RGB32 pixel formats
|
||||
Convert the pixel formats PIX_FMT_ARGB, PIX_FMT_RGBA, PIX_FMT_ABGR,
|
||||
PIX_FMT_BGRA, which were defined as macros, into enum PixelFormat values.
|
||||
Conversely PIX_FMT_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32 and
|
||||
PIX_FMT_BGR32_1 are now macros.
|
||||
avcodec_get_pix_fmt() now recognizes the "rgb32" and "bgr32" aliases.
|
||||
Re-sort the enum PixelFormat list accordingly.
|
||||
This change breaks API/ABI backward compatibility.
|
||||
|
||||
2009-03-22 - r18133 - lavu 50.1.0 - PIX_FMT_RGB5X5 endian variants
|
||||
Add the enum PixelFormat values:
|
||||
PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,
|
||||
PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, PIX_FMT_BGR555BE, PIX_FMT_BGR555LE.
|
||||
|
||||
2009-03-21 - r18116 - lavu 50.0.0 - av_random*
|
||||
The Mersenne Twister PRNG implemented through the av_random* functions
|
||||
was removed. Use the lagged Fibonacci PRNG through the av_lfg* functions
|
||||
instead.
|
||||
|
||||
2009-03-08 - r17869 - lavu 50.0.0 - AVFifoBuffer
|
||||
av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped
|
||||
and replaced by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write
|
||||
and av_fifo_realloc2.
|
||||
In addition, the order of the function arguments of av_fifo_generic_read
|
||||
was changed to match av_fifo_generic_write.
|
||||
The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by
|
||||
applications, they may not use sizeof() or directly access members.
|
||||
|
||||
2009-03-01 - r17682 - lavf 52.31.0 - Generic metadata API
|
||||
Introduce a new metadata API (see av_metadata_get() and friends).
|
||||
The old API is now deprecated and should not be used anymore. This especially
|
||||
includes the following structure fields:
|
||||
20090301 - r17682 - lavf 52.31.0 - Generic metadata API
|
||||
This version introduce a new metadata API (see av_metadata_get() and friends).
|
||||
The old API is now deprecated and shouldn't be used anymore. This especially
|
||||
include the following structure fields:
|
||||
- AVFormatContext.title
|
||||
- AVFormatContext.author
|
||||
- AVFormatContext.copyright
|
||||
|
@@ -1,436 +0,0 @@
|
||||
\input texinfo @c -*- texinfo -*-
|
||||
|
||||
@settitle Developer Documentation
|
||||
@titlepage
|
||||
@sp 7
|
||||
@center @titlefont{Developer Documentation}
|
||||
@sp 3
|
||||
@end titlepage
|
||||
|
||||
|
||||
@chapter Developers Guide
|
||||
|
||||
@section API
|
||||
@itemize @bullet
|
||||
@item libavcodec is the library containing the codecs (both encoding and
|
||||
decoding). Look at @file{libavcodec/apiexample.c} to see how to use it.
|
||||
|
||||
@item libavformat is the library containing the file format handling (mux and
|
||||
demux code for several formats). Look at @file{ffplay.c} to use it in a
|
||||
player. See @file{libavformat/output-example.c} to use it to generate
|
||||
audio or video streams.
|
||||
|
||||
@end itemize
|
||||
|
||||
@section Integrating libavcodec or libavformat in your program
|
||||
|
||||
You can integrate all the source code of the libraries to link them
|
||||
statically to avoid any version problem. All you need is to provide a
|
||||
'config.mak' and a 'config.h' in the parent directory. See the defines
|
||||
generated by ./configure to understand what is needed.
|
||||
|
||||
You can use libavcodec or libavformat in your commercial program, but
|
||||
@emph{any patch you make must be published}. The best way to proceed is
|
||||
to send your patches to the FFmpeg mailing list.
|
||||
|
||||
@anchor{Coding Rules}
|
||||
@section Coding Rules
|
||||
|
||||
FFmpeg is programmed in the ISO C90 language with a few additional
|
||||
features from ISO C99, namely:
|
||||
@itemize @bullet
|
||||
@item
|
||||
the @samp{inline} keyword;
|
||||
@item
|
||||
@samp{//} comments;
|
||||
@item
|
||||
designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
|
||||
@item
|
||||
compound literals (@samp{x = (struct s) @{ 17, 23 @};})
|
||||
@end itemize
|
||||
|
||||
These features are supported by all compilers we care about, so we will not
|
||||
accept patches to remove their use unless they absolutely do not impair
|
||||
clarity and performance.
|
||||
|
||||
All code must compile with GCC 2.95 and GCC 3.3. Currently, FFmpeg also
|
||||
compiles with several other compilers, such as the Compaq ccc compiler
|
||||
or Sun Studio 9, and we would like to keep it that way unless it would
|
||||
be exceedingly involved. To ensure compatibility, please do not use any
|
||||
additional C99 features or GCC extensions. Especially watch out for:
|
||||
@itemize @bullet
|
||||
@item
|
||||
mixing statements and declarations;
|
||||
@item
|
||||
@samp{long long} (use @samp{int64_t} instead);
|
||||
@item
|
||||
@samp{__attribute__} not protected by @samp{#ifdef __GNUC__} or similar;
|
||||
@item
|
||||
GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
|
||||
@end itemize
|
||||
|
||||
Indent size is 4.
|
||||
The presentation is one inspired by 'indent -i4 -kr -nut'.
|
||||
The TAB character is forbidden outside of Makefiles as is any
|
||||
form of trailing whitespace. Commits containing either will be
|
||||
rejected by the Subversion repository.
|
||||
|
||||
The main priority in FFmpeg is simplicity and small code size in order to
|
||||
minimize the bug count.
|
||||
|
||||
Comments: Use the JavaDoc/Doxygen
|
||||
format (see examples below) so that code documentation
|
||||
can be generated automatically. All nontrivial functions should have a comment
|
||||
above them explaining what the function does, even if it is just one sentence.
|
||||
All structures and their member variables should be documented, too.
|
||||
@example
|
||||
/**
|
||||
* @@file mpeg.c
|
||||
* MPEG codec.
|
||||
* @@author ...
|
||||
*/
|
||||
|
||||
/**
|
||||
* Summary sentence.
|
||||
* more text ...
|
||||
* ...
|
||||
*/
|
||||
typedef struct Foobar@{
|
||||
int var1; /**< var1 description */
|
||||
int var2; ///< var2 description
|
||||
/** var3 description */
|
||||
int var3;
|
||||
@} Foobar;
|
||||
|
||||
/**
|
||||
* Summary sentence.
|
||||
* more text ...
|
||||
* ...
|
||||
* @@param my_parameter description of my_parameter
|
||||
* @@return return value description
|
||||
*/
|
||||
int myfunc(int my_parameter)
|
||||
...
|
||||
@end example
|
||||
|
||||
fprintf and printf are forbidden in libavformat and libavcodec,
|
||||
please use av_log() instead.
|
||||
|
||||
Casts should be used only when necessary. Unneeded parentheses
|
||||
should also be avoided if they don't make the code easier to understand.
|
||||
|
||||
@section Development Policy
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Contributions should be licensed under the LGPL 2.1, including an
|
||||
"or any later version" clause, or the MIT license. GPL 2 including
|
||||
an "or any later version" clause is also acceptable, but LGPL is
|
||||
preferred.
|
||||
@item
|
||||
You must not commit code which breaks FFmpeg! (Meaning unfinished but
|
||||
enabled code which breaks compilation or compiles but does not work or
|
||||
breaks the regression tests)
|
||||
You can commit unfinished stuff (for testing etc), but it must be disabled
|
||||
(#ifdef etc) by default so it does not interfere with other developers'
|
||||
work.
|
||||
@item
|
||||
You do not have to over-test things. If it works for you, and you think it
|
||||
should work for others, then commit. If your code has problems
|
||||
(portability, triggers compiler bugs, unusual environment etc) they will be
|
||||
reported and eventually fixed.
|
||||
@item
|
||||
Do not commit unrelated changes together, split them into self-contained
|
||||
pieces. Also do not forget that if part B depends on part A, but A does not
|
||||
depend on B, then A can and should be committed first and separate from B.
|
||||
Keeping changes well split into self-contained parts makes reviewing and
|
||||
understanding them on the commit log mailing list easier. This also helps
|
||||
in case of debugging later on.
|
||||
Also if you have doubts about splitting or not splitting, do not hesitate to
|
||||
ask/discuss it on the developer mailing list.
|
||||
@item
|
||||
Do not change behavior of the program (renaming options etc) without
|
||||
first discussing it on the ffmpeg-devel mailing list. Do not remove
|
||||
functionality from the code. Just improve!
|
||||
|
||||
Note: Redundant code can be removed.
|
||||
@item
|
||||
Do not commit changes to the build system (Makefiles, configure script)
|
||||
which change behavior, defaults etc, without asking first. The same
|
||||
applies to compiler warning fixes, trivial looking fixes and to code
|
||||
maintained by other developers. We usually have a reason for doing things
|
||||
the way we do. Send your changes as patches to the ffmpeg-devel mailing
|
||||
list, and if the code maintainers say OK, you may commit. This does not
|
||||
apply to files you wrote and/or maintain.
|
||||
@item
|
||||
We refuse source indentation and other cosmetic changes if they are mixed
|
||||
with functional changes, such commits will be rejected and removed. Every
|
||||
developer has his own indentation style, you should not change it. Of course
|
||||
if you (re)write something, you can use your own style, even though we would
|
||||
prefer if the indentation throughout FFmpeg was consistent (Many projects
|
||||
force a given indentation style - we do not.). If you really need to make
|
||||
indentation changes (try to avoid this), separate them strictly from real
|
||||
changes.
|
||||
|
||||
NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
|
||||
then either do NOT change the indentation of the inner part within (do not
|
||||
move it to the right)! or do so in a separate commit
|
||||
@item
|
||||
Always fill out the commit log message. Describe in a few lines what you
|
||||
changed and why. You can refer to mailing list postings if you fix a
|
||||
particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
|
||||
@item
|
||||
If you apply a patch by someone else, include the name and email address in
|
||||
the log message. Since the ffmpeg-cvslog mailing list is publicly
|
||||
archived you should add some SPAM protection to the email address. Send an
|
||||
answer to ffmpeg-devel (or wherever you got the patch from) saying that
|
||||
you applied the patch.
|
||||
@item
|
||||
When applying patches that have been discussed (at length) on the mailing
|
||||
list, reference the thread in the log message.
|
||||
@item
|
||||
Do NOT commit to code actively maintained by others without permission.
|
||||
Send a patch to ffmpeg-devel instead. If no one answers within a reasonable
|
||||
timeframe (12h for build failures and security fixes, 3 days small changes,
|
||||
1 week for big patches) then commit your patch if you think it is OK.
|
||||
Also note, the maintainer can simply ask for more time to review!
|
||||
@item
|
||||
Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits
|
||||
are sent there and reviewed by all the other developers. Bugs and possible
|
||||
improvements or general questions regarding commits are discussed there. We
|
||||
expect you to react if problems with your code are uncovered.
|
||||
@item
|
||||
Update the documentation if you change behavior or add features. If you are
|
||||
unsure how best to do this, send a patch to ffmpeg-devel, the documentation
|
||||
maintainer(s) will review and commit your stuff.
|
||||
@item
|
||||
Try to keep important discussions and requests (also) on the public
|
||||
developer mailing list, so that all developers can benefit from them.
|
||||
@item
|
||||
Never write to unallocated memory, never write over the end of arrays,
|
||||
always check values read from some untrusted source before using them
|
||||
as array index or other risky things.
|
||||
@item
|
||||
Remember to check if you need to bump versions for the specific libav
|
||||
parts (libavutil, libavcodec, libavformat) you are changing. You need
|
||||
to change the version integer.
|
||||
Incrementing the first component means no backward compatibility to
|
||||
previous versions (e.g. removal of a function from the public API).
|
||||
Incrementing the second component means backward compatible change
|
||||
(e.g. addition of a function to the public API or extension of an
|
||||
existing data structure).
|
||||
Incrementing the third component means a noteworthy binary compatible
|
||||
change (e.g. encoder bug fix that matters for the decoder).
|
||||
@item
|
||||
Compiler warnings indicate potential bugs or code with bad style. If a type of
|
||||
warning always points to correct and clean code, that warning should
|
||||
be disabled, not the code changed.
|
||||
Thus the remaining warnings can either be bugs or correct code.
|
||||
If it is a bug, the bug has to be fixed. If it is not, the code should
|
||||
be changed to not generate a warning unless that causes a slowdown
|
||||
or obfuscates the code.
|
||||
@item
|
||||
If you add a new file, give it a proper license header. Do not copy and
|
||||
paste it from a random place, use an existing file as template.
|
||||
@end enumerate
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
Note, these rules are mostly borrowed from the MPlayer project.
|
||||
|
||||
@section Submitting patches
|
||||
|
||||
First, (@pxref{Coding Rules}) above if you did not yet.
|
||||
|
||||
When you submit your patch, try to send a unified diff (diff '-up'
|
||||
option). We cannot read other diffs :-)
|
||||
|
||||
Also please do not submit a patch which contains several unrelated changes.
|
||||
Split it into separate, self-contained pieces. This does not mean splitting
|
||||
file by file. Instead, make the patch as small as possible while still
|
||||
keeping it as a logical unit that contains an individual change, even
|
||||
if it spans multiple files. This makes reviewing your patches much easier
|
||||
for us and greatly increases your chances of getting your patch applied.
|
||||
|
||||
Use the patcheck tool of FFmpeg to check your patch.
|
||||
The tool is located in the tools directory.
|
||||
|
||||
Run the regression tests before submitting a patch so that you can
|
||||
verify that there are no big problems.
|
||||
|
||||
Patches should be posted as base64 encoded attachments (or any other
|
||||
encoding which ensures that the patch will not be trashed during
|
||||
transmission) to the ffmpeg-devel mailing list, see
|
||||
@url{http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel}
|
||||
|
||||
It also helps quite a bit if you tell us what the patch does (for example
|
||||
'replaces lrint by lrintf'), and why (for example '*BSD isn't C99 compliant
|
||||
and has no lrint()')
|
||||
|
||||
Also please if you send several patches, send each patch as a separate mail,
|
||||
do not attach several unrelated patches to the same mail.
|
||||
|
||||
Your patch will be reviewed on the mailing list. You will likely be asked
|
||||
to make some changes and are expected to send in an improved version that
|
||||
incorporates the requests from the review. This process may go through
|
||||
several iterations. Once your patch is deemed good enough, some developer
|
||||
will pick it up and commit it to the official FFmpeg tree.
|
||||
|
||||
Give us a few days to react. But if some time passes without reaction,
|
||||
send a reminder by email. Your patch should eventually be dealt with.
|
||||
|
||||
|
||||
@section New codecs or formats checklist
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Did you use av_cold for codec initialization and close functions?
|
||||
@item
|
||||
Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
|
||||
AVInputFormat/AVOutputFormat struct?
|
||||
@item
|
||||
Did you bump the minor version number in @file{avcodec.h} or
|
||||
@file{avformat.h}?
|
||||
@item
|
||||
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
|
||||
@item
|
||||
Did you add the CodecID to @file{avcodec.h}?
|
||||
@item
|
||||
If it has a fourcc, did you add it to @file{libavformat/riff.c},
|
||||
even if it is only a decoder?
|
||||
@item
|
||||
Did you add a rule to compile the appropriate files in the Makefile?
|
||||
Remember to do this even if you're just adding a format to a file that is
|
||||
already being compiled by some other rule, like a raw demuxer.
|
||||
@item
|
||||
Did you add an entry to the table of supported formats or codecs in
|
||||
@file{doc/general.texi}?
|
||||
@item
|
||||
Did you add an entry in the Changelog?
|
||||
@item
|
||||
If it depends on a parser or a library, did you add that dependency in
|
||||
configure?
|
||||
@item
|
||||
Did you "svn add" the appropriate files before commiting?
|
||||
@end enumerate
|
||||
|
||||
@section patch submission checklist
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Do the regression tests pass with the patch applied?
|
||||
@item
|
||||
Does @code{make checkheaders} pass with the patch applied?
|
||||
@item
|
||||
Is the patch a unified diff?
|
||||
@item
|
||||
Is the patch against latest FFmpeg SVN?
|
||||
@item
|
||||
Are you subscribed to ffmpeg-dev?
|
||||
(the list is subscribers only due to spam)
|
||||
@item
|
||||
Have you checked that the changes are minimal, so that the same cannot be
|
||||
achieved with a smaller patch and/or simpler final code?
|
||||
@item
|
||||
If the change is to speed critical code, did you benchmark it?
|
||||
@item
|
||||
If you did any benchmarks, did you provide them in the mail?
|
||||
@item
|
||||
Have you checked that the patch does not introduce buffer overflows or
|
||||
other security issues?
|
||||
@item
|
||||
Did you test your decoder or demuxer against damaged data? If no, see
|
||||
tools/trasher and the noise bitstream filter. Your decoder or demuxer
|
||||
should not crash or end in a (near) infinite loop when fed damaged data.
|
||||
@item
|
||||
Is the patch created from the root of the source tree, so it can be
|
||||
applied with @code{patch -p0}?
|
||||
@item
|
||||
Does the patch not mix functional and cosmetic changes?
|
||||
@item
|
||||
Did you add tabs or trailing whitespace to the code? Both are forbidden.
|
||||
@item
|
||||
Is the patch attached to the email you send?
|
||||
@item
|
||||
Is the mime type of the patch correct? It should be text/x-diff or
|
||||
text/x-patch or at least text/plain and not application/octet-stream.
|
||||
@item
|
||||
If the patch fixes a bug, did you provide a verbose analysis of the bug?
|
||||
@item
|
||||
If the patch fixes a bug, did you provide enough information, including
|
||||
a sample, so the bug can be reproduced and the fix can be verified?
|
||||
Note please do not attach samples >100k to mails but rather provide a
|
||||
URL, you can upload to ftp://upload.ffmpeg.org
|
||||
@item
|
||||
Did you provide a verbose summary about what the patch does change?
|
||||
@item
|
||||
Did you provide a verbose explanation why it changes things like it does?
|
||||
@item
|
||||
Did you provide a verbose summary of the user visible advantages and
|
||||
disadvantages if the patch is applied?
|
||||
@item
|
||||
Did you provide an example so we can verify the new feature added by the
|
||||
patch easily?
|
||||
@item
|
||||
If you added a new file, did you insert a license header? It should be
|
||||
taken from FFmpeg, not randomly copied and pasted from somewhere else.
|
||||
@item
|
||||
You should maintain alphabetical order in alphabetically ordered lists as
|
||||
long as doing so does not break API/ABI compatibility.
|
||||
@item
|
||||
Lines with similar content should be aligned vertically when doing so
|
||||
improves readability.
|
||||
@item
|
||||
Did you provide a suggestion for a clear commit log message?
|
||||
@end enumerate
|
||||
|
||||
@section Patch review process
|
||||
|
||||
All patches posted to ffmpeg-devel will be reviewed, unless they contain a
|
||||
clear note that the patch is not for SVN.
|
||||
Reviews and comments will be posted as replies to the patch on the
|
||||
mailing list. The patch submitter then has to take care of every comment,
|
||||
that can be by resubmitting a changed patch or by discussion. Resubmitted
|
||||
patches will themselves be reviewed like any other patch. If at some point
|
||||
a patch passes review with no comments then it is approved, that can for
|
||||
simple and small patches happen immediately while large patches will generally
|
||||
have to be changed and reviewed many times before they are approved.
|
||||
After a patch is approved it will be committed to the repository.
|
||||
|
||||
We will review all submitted patches, but sometimes we are quite busy so
|
||||
especially for large patches this can take several weeks.
|
||||
|
||||
When resubmitting patches, please do not make any significant changes
|
||||
not related to the comments received during review. Such patches will
|
||||
be rejected. Instead, submit significant changes or new features as
|
||||
separate patches.
|
||||
|
||||
@section Regression tests
|
||||
|
||||
Before submitting a patch (or committing to the repository), you should at least
|
||||
test that you did not break anything.
|
||||
|
||||
The regression tests build a synthetic video stream and a synthetic
|
||||
audio stream. These are then encoded and decoded with all codecs or
|
||||
formats. The CRC (or MD5) of each generated file is recorded in a
|
||||
result file. A 'diff' is launched to compare the reference results and
|
||||
the result file. The output is checked immediately after each test
|
||||
has run.
|
||||
|
||||
The regression tests then go on to test the FFserver code with a
|
||||
limited set of streams. It is important that this step runs correctly
|
||||
as well.
|
||||
|
||||
Run 'make test' to test all the codecs and formats. Commands like
|
||||
'make regtest-mpeg2' can be used to run a single test. By default,
|
||||
make will abort if any test fails. To run all tests regardless,
|
||||
use make -k. To get a more verbose output, use 'make V=1 test' or
|
||||
'make V=2 test'.
|
||||
|
||||
Run 'make fulltest' to test all the codecs, formats and FFserver.
|
||||
|
||||
[Of course, some patches may change the results of the regression tests. In
|
||||
this case, the reference results of the regression tests shall be modified
|
||||
accordingly].
|
||||
|
||||
@bye
|
39
doc/faq.texi
39
doc/faq.texi
@@ -138,25 +138,6 @@ Notice that @samp{%d} is replaced by the image number.
|
||||
|
||||
@file{img%03d.jpg} means the sequence @file{img001.jpg}, @file{img002.jpg}, etc...
|
||||
|
||||
If you have large number of pictures to rename, you can use the
|
||||
following command to ease the burden. The command, using the bourne
|
||||
shell syntax, symbolically links all files in the current directory
|
||||
that match @code{*jpg} to the @file{/tmp} directory in the sequence of
|
||||
@file{img001.jpg}, @file{img002.jpg} and so on.
|
||||
|
||||
@example
|
||||
x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
|
||||
@end example
|
||||
|
||||
If you want to sequence them by oldest modified first, substitute
|
||||
@code{$(ls -r -t *jpg)} in place of @code{*jpg}.
|
||||
|
||||
Then run:
|
||||
|
||||
@example
|
||||
ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
|
||||
@end example
|
||||
|
||||
The same logic is used for any image format that ffmpeg reads.
|
||||
|
||||
@section How do I encode movie to single pictures?
|
||||
@@ -195,6 +176,14 @@ quite logical that there is a small reduction of quality. This is not a bug.
|
||||
|
||||
Use @file{-} as file name.
|
||||
|
||||
@section Why does FFmpeg not decode audio in VOB files?
|
||||
|
||||
The audio is AC-3 (a.k.a. A/52). AC-3 decoding is an optional component in FFmpeg
|
||||
as the component that handles AC-3 decoding is currently released under the GPL.
|
||||
Enable AC-3 decoding with @code{./configure --enable-gpl}. Take care: By
|
||||
enabling AC-3, you automatically change the license of libavcodec from
|
||||
LGPL to GPL.
|
||||
|
||||
@section Why does the chrominance data seem to be sampled at a different time from the luminance data on bt8x8 captures on Linux?
|
||||
|
||||
This is a well-known bug in the bt8x8 driver. For 2.4.26 there is a patch at
|
||||
@@ -237,7 +226,7 @@ default.
|
||||
@item non-working stuff
|
||||
B-frames
|
||||
@item example command line
|
||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4
|
||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X output.mp4
|
||||
@end table
|
||||
|
||||
@section How do I encode videos which play on the PSP?
|
||||
@@ -250,7 +239,7 @@ ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags
|
||||
@item non-working stuff
|
||||
B-frames
|
||||
@item example command line
|
||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -ar 24000 -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4
|
||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -ar 24000 -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -title X -f psp output.mp4
|
||||
@item needed stuff for H.264
|
||||
-acodec libfaac -vcodec libx264 width*height<=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp
|
||||
@item working stuff for H.264
|
||||
@@ -258,7 +247,7 @@ title, loop filter
|
||||
@item non-working stuff for H.264
|
||||
CAVLC
|
||||
@item example command line
|
||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec libx264 -b 1200kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
|
||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec libx264 -b 1200kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -title X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
|
||||
@item higher resolution for newer PSP firmwares, width<=480, height<=272
|
||||
-vcodec libx264 -level 21 -coder 1 -f psp
|
||||
@item example command line
|
||||
@@ -335,10 +324,6 @@ ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
|
||||
|
||||
Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
|
||||
allow concatenation, and the transcoding step is almost lossless.
|
||||
When using multiple yuv4mpegpipe(s), the first line needs to be discarded
|
||||
from all but the first stream. This can be accomplished by piping through
|
||||
@code{tail} as seen below. Note that when piping through @code{tail} you
|
||||
must use command grouping, @code{@{ ;@}}, to background properly.
|
||||
|
||||
For example, let's say we want to join two FLV files into an output.flv file:
|
||||
|
||||
@@ -352,7 +337,7 @@ mkfifo all.v
|
||||
ffmpeg -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
|
||||
ffmpeg -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
|
||||
ffmpeg -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
|
||||
@{ ffmpeg -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp2.v ; @} &
|
||||
ffmpeg -i input2.flv -an -f yuv4mpegpipe - > temp2.v < /dev/null &
|
||||
cat temp1.a temp2.a > all.a &
|
||||
cat temp1.v temp2.v > all.v &
|
||||
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
|
||||
|
@@ -222,12 +222,36 @@ specified for the inputs.
|
||||
@c man end
|
||||
|
||||
@c man begin OPTIONS
|
||||
|
||||
@include fftools-common-opts.texi
|
||||
|
||||
@section Main options
|
||||
|
||||
@table @option
|
||||
@item -L
|
||||
Show license.
|
||||
|
||||
@item -h
|
||||
Show help.
|
||||
|
||||
@item -version
|
||||
Show version.
|
||||
|
||||
@item -formats
|
||||
Show available formats, codecs, bitstream filters, protocols, and frame size and frame rate abbreviations.
|
||||
|
||||
The fields preceding the format and codec names have the following meanings:
|
||||
@table @samp
|
||||
@item D
|
||||
Decoding available
|
||||
@item E
|
||||
Encoding available
|
||||
@item V/A/S
|
||||
Video/audio/subtitle codec
|
||||
@item S
|
||||
Codec supports slices
|
||||
@item D
|
||||
Codec supports direct rendering
|
||||
@item T
|
||||
Codec can handle input truncated at random locations instead of only at frame boundaries
|
||||
@end table
|
||||
|
||||
@item -f @var{fmt}
|
||||
Force format.
|
||||
@@ -323,8 +347,6 @@ The following abbreviations are recognized:
|
||||
352x288
|
||||
@item 4cif
|
||||
704x576
|
||||
@item 16cif
|
||||
1408x1152
|
||||
@item qqvga
|
||||
160x120
|
||||
@item qvga
|
||||
@@ -447,9 +469,6 @@ stream.
|
||||
@item -newvideo
|
||||
Add a new video stream to the current output stream.
|
||||
|
||||
@item -vlang @var{code}
|
||||
Set the ISO 639 language code (3 letters) of the current video stream.
|
||||
|
||||
@end table
|
||||
|
||||
@section Advanced Video Options
|
||||
@@ -459,7 +478,7 @@ Set the ISO 639 language code (3 letters) of the current video stream.
|
||||
Set pixel format. Use 'list' as parameter to show all the supported
|
||||
pixel formats.
|
||||
@item -sws_flags @var{flags}
|
||||
Set SwScaler flags.
|
||||
Set SwScaler flags (only available when compiled with swscale support).
|
||||
@item -g @var{gop_size}
|
||||
Set the group of pictures size.
|
||||
@item -intra
|
||||
@@ -634,6 +653,9 @@ Calculate PSNR of compressed frames.
|
||||
Dump video coding statistics to @file{vstats_HHMMSS.log}.
|
||||
@item -vstats_file @var{file}
|
||||
Dump video coding statistics to @var{file}.
|
||||
@item -vhook @var{module}
|
||||
Insert video processing @var{module}. @var{module} contains the module
|
||||
name and its parameters separated by spaces.
|
||||
@item -top @var{n}
|
||||
top=1/bottom=0/auto=-1 field first
|
||||
@item -dc @var{precision}
|
||||
@@ -734,10 +756,7 @@ Set meta data information of @var{outfile} from @var{infile}.
|
||||
@item -debug
|
||||
Print specific debug info.
|
||||
@item -benchmark
|
||||
Show benchmarking information at the end of an encode.
|
||||
Shows CPU time used and maximum memory consumption.
|
||||
Maximum memory consumption is not supported on all systems,
|
||||
it will usually display as 0 if not supported.
|
||||
Add timings for benchmarking.
|
||||
@item -dump
|
||||
Dump each input packet.
|
||||
@item -hex
|
||||
@@ -745,7 +764,7 @@ When dumping packets, also dump the payload.
|
||||
@item -bitexact
|
||||
Only use bit exact algorithms (for codec testing).
|
||||
@item -ps @var{size}
|
||||
Set RTP payload size in bytes.
|
||||
Set packet size in bits.
|
||||
@item -re
|
||||
Read input at native frame rate. Mainly used to simulate a grab device.
|
||||
@item -loop_input
|
||||
@@ -757,15 +776,8 @@ Repeatedly loop output for formats that support looping such as animated GIF
|
||||
@item -threads @var{count}
|
||||
Thread count.
|
||||
@item -vsync @var{parameter}
|
||||
Video sync method.
|
||||
0 Each frame is passed with its timestamp from the demuxer to the muxer
|
||||
1 Frames will be duplicated and dropped to achieve exactly the requested
|
||||
constant framerate.
|
||||
2 Frames are passed through with their timestamp or dropped so as to prevent
|
||||
2 frames from having the same timestamp
|
||||
-1 Chooses between 1 and 2 depending on muxer capabilities. This is the default method.
|
||||
|
||||
With -map you can select from
|
||||
Video sync method. Video will be stretched/squeezed to match the timestamps,
|
||||
it is done by duplicating and dropping frames. With -map you can select from
|
||||
which stream the timestamps should be taken. You can leave either video or
|
||||
audio unchanged and sync the remaining stream(s) to the unchanged one.
|
||||
@item -async @var{samples_per_second}
|
||||
@@ -793,22 +805,18 @@ awkward to specify on the command line. Lines starting with the hash
|
||||
('#') character are ignored and are used to provide comments. Check
|
||||
the @file{ffpresets} directory in the FFmpeg source tree for examples.
|
||||
|
||||
Preset files are specified with the @code{vpre}, @code{apre},
|
||||
@code{spre}, and @code{fpre} options. The @code{fpre} option takes the
|
||||
filename of the preset instead of a preset name as input and can be
|
||||
used for any kind of codec. For the @code{vpre}, @code{apre}, and
|
||||
@code{spre} options, the options specified in a preset file are
|
||||
Preset files are specified with the @code{vpre}, @code{apre} and
|
||||
@code{spre} options. The options specified in a preset file are
|
||||
applied to the currently selected codec of the same type as the preset
|
||||
option.
|
||||
|
||||
The argument passed to the @code{vpre}, @code{apre}, and @code{spre}
|
||||
preset options identifies the preset file to use according to the
|
||||
following rules:
|
||||
The argument passed to the preset options identifies the preset file
|
||||
to use according to the following rules.
|
||||
|
||||
First ffmpeg searches for a file named @var{arg}.ffpreset in the
|
||||
directories @file{$FFMPEG_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
|
||||
the datadir defined at configuration time (usually @file{PREFIX/share/ffmpeg})
|
||||
in that order. For example, if the argument is @code{libx264-max}, it will
|
||||
directories @file{$HOME/.ffmpeg}, and in the datadir defined at
|
||||
configuration time (usually @file{PREFIX/share/ffmpeg}) in that
|
||||
order. For example, if the argument is @code{libx264-max}, it will
|
||||
search for the file @file{libx264-max.ffpreset}.
|
||||
|
||||
If no such file is found, then ffmpeg will search for a file named
|
||||
@@ -818,7 +826,12 @@ the preset file options will be applied. For example, if you select
|
||||
the video codec with @code{-vcodec libx264} and use @code{-vpre max},
|
||||
then it will search for the file @file{libx264-max.ffpreset}.
|
||||
|
||||
@anchor{FFmpeg formula evaluator}
|
||||
Finally, if the above rules failed and the argument specifies an
|
||||
absolute pathname, ffmpeg will search for that filename. This way you
|
||||
can specify the absolute and complete filename of the preset file, for
|
||||
example @file{./ffpresets/libx264-max.ffpreset}.
|
||||
|
||||
@node FFmpeg formula evaluator
|
||||
@section FFmpeg formula evaluator
|
||||
|
||||
When evaluating a rate control string, FFmpeg uses an internal formula
|
||||
@@ -909,7 +922,7 @@ to standard output.
|
||||
|
||||
FFmpeg also handles many protocols specified with an URL syntax.
|
||||
|
||||
Use 'ffmpeg -protocols' to see a list of the supported protocols.
|
||||
Use 'ffmpeg -formats' to see a list of the supported protocols.
|
||||
|
||||
The protocol @code{http:} is currently used only to communicate with
|
||||
FFserver (see the FFserver documentation). When FFmpeg will be a
|
||||
|
@@ -26,12 +26,17 @@ ffplay [options] @file{input_file}
|
||||
@end example
|
||||
|
||||
@c man begin OPTIONS
|
||||
|
||||
@include fftools-common-opts.texi
|
||||
|
||||
@section Main options
|
||||
|
||||
@table @option
|
||||
@item -h
|
||||
Show help.
|
||||
@item -version
|
||||
Show version.
|
||||
@item -L
|
||||
Show license.
|
||||
@item -formats
|
||||
Show available formats, codecs, protocols, ...
|
||||
@item -x @var{width}
|
||||
Force displayed width.
|
||||
@item -y @var{height}
|
||||
@@ -45,18 +50,12 @@ Disable audio.
|
||||
Disable video.
|
||||
@item -ss @var{pos}
|
||||
Seek to a given position in seconds.
|
||||
@item -t @var{duration}
|
||||
play <duration> seconds of audio/video
|
||||
@item -bytes
|
||||
Seek by bytes.
|
||||
@item -nodisp
|
||||
Disable graphical display.
|
||||
@item -f @var{fmt}
|
||||
Force format.
|
||||
@item -window_title @var{title}
|
||||
Set window title (default is the input filename).
|
||||
@item -loop @var{number}
|
||||
Loops movie playback <number> times. 0 means forever.
|
||||
@end table
|
||||
|
||||
@section Advanced options
|
||||
|
@@ -1,121 +0,0 @@
|
||||
\input texinfo @c -*- texinfo -*-
|
||||
|
||||
@settitle FFprobe Documentation
|
||||
@titlepage
|
||||
@sp 7
|
||||
@center @titlefont{FFprobe Documentation}
|
||||
@sp 3
|
||||
@end titlepage
|
||||
|
||||
@chapter Introduction
|
||||
|
||||
@c man begin DESCRIPTION
|
||||
|
||||
FFprobe gathers information from multimedia streams and prints it in
|
||||
human- and machine-readable fashion.
|
||||
|
||||
For example it can be used to check the format of the container used
|
||||
by a multimedia stream and the format and type of each media stream
|
||||
contained in it.
|
||||
|
||||
If a filename is specified in input, ffprobe will try to open and
|
||||
probe the file content. If the file cannot be opened or recognized as
|
||||
a multimedia file, a positive exit code is returned.
|
||||
|
||||
FFprobe may be employed both as a standalone application or in
|
||||
combination with a textual filter, which may perform more
|
||||
sophisticated processing, e.g. statistical processing or plotting.
|
||||
|
||||
Options are used to list some of the formats supported by ffprobe or
|
||||
for specifying which information to display, and for setting how
|
||||
ffprobe will show it.
|
||||
|
||||
FFprobe output is designed to be easily parsable by a textual filter,
|
||||
and consists of one or more sections of the form:
|
||||
@example
|
||||
[SECTION]
|
||||
key1=val1
|
||||
...
|
||||
keyN=valN
|
||||
[/SECTION]
|
||||
@end example
|
||||
|
||||
Metadata tags stored in the container or in the streams are recognized
|
||||
and printed in the corresponding ``FORMAT'' or ``STREAM'' section, and
|
||||
are prefixed by the string ``TAG:''.
|
||||
|
||||
@c man end
|
||||
|
||||
@chapter Invocation
|
||||
|
||||
@section Syntax
|
||||
|
||||
The generic syntax is:
|
||||
|
||||
@example
|
||||
@c man begin SYNOPSIS
|
||||
ffprobe [options] [@file{input_file}]
|
||||
@c man end
|
||||
@end example
|
||||
|
||||
@c man begin OPTIONS
|
||||
|
||||
@include fftools-common-opts.texi
|
||||
|
||||
@section Main options
|
||||
|
||||
@table @option
|
||||
|
||||
@item -convert_tags
|
||||
Convert the tag names in the format container to the generic FFmpeg tag names.
|
||||
|
||||
@item -f @var{format}
|
||||
Force format to use.
|
||||
|
||||
@item -unit
|
||||
Show the unit of the displayed values.
|
||||
|
||||
@item -prefix
|
||||
Show a SI prefixes of the displayed values.
|
||||
Unless ``-byte_binary_prefix'' option is used all the prefix
|
||||
are decimal.
|
||||
|
||||
@item -byte_binary_prefix
|
||||
Force the use of binary prefixes for byte values.
|
||||
|
||||
@item -sexagesimal
|
||||
Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
|
||||
|
||||
@item -pretty
|
||||
Prettify the format of the displayed values, it corresponds to the
|
||||
options ``-unit -prefix -byte_binary_prefix -sexagesimal''.
|
||||
|
||||
@item -show_format
|
||||
Show information about the container format of the input multimedia
|
||||
stream.
|
||||
|
||||
All the container format information is printed within a section with
|
||||
name ``FORMAT''.
|
||||
|
||||
@item -show_streams
|
||||
Show information about each media stream contained in the input
|
||||
multimedia stream.
|
||||
|
||||
Each media stream information is printed within a dedicated section
|
||||
with name ``STREAM''.
|
||||
|
||||
@end table
|
||||
@c man end
|
||||
|
||||
@ignore
|
||||
|
||||
@setfilename ffprobe
|
||||
@settitle FFprobe media prober
|
||||
|
||||
@c man begin SEEALSO
|
||||
ffmpeg(1), ffplay(1), ffserver(1)
|
||||
@c man end
|
||||
|
||||
@end ignore
|
||||
|
||||
@bye
|
@@ -236,12 +236,15 @@ ffserver [options]
|
||||
|
||||
@section Options
|
||||
@c man begin OPTIONS
|
||||
|
||||
@include fftools-common-opts.texi
|
||||
|
||||
@section Main options
|
||||
|
||||
@table @option
|
||||
@item -version
|
||||
Show version.
|
||||
@item -L
|
||||
Show license.
|
||||
@item -formats
|
||||
Show available formats, codecs, protocols, ...
|
||||
@item -h
|
||||
Show help.
|
||||
@item -f @var{configfile}
|
||||
Use @file{configfile} instead of @file{/etc/ffserver.conf}.
|
||||
@item -n
|
||||
|
@@ -1,72 +0,0 @@
|
||||
@section Generic options
|
||||
|
||||
These options are shared amongst the ff* tools.
|
||||
|
||||
@table @option
|
||||
|
||||
@item -L
|
||||
Show license.
|
||||
|
||||
@item -h, -?, -help, --help
|
||||
Show help.
|
||||
|
||||
@item -version
|
||||
Show version.
|
||||
|
||||
@item -formats
|
||||
Show available formats.
|
||||
|
||||
The fields preceding the format names have the following meanings:
|
||||
@table @samp
|
||||
@item D
|
||||
Decoding available
|
||||
@item E
|
||||
Encoding available
|
||||
@end table
|
||||
|
||||
@item -codecs
|
||||
Show available codecs.
|
||||
|
||||
The fields preceding the codec names have the following meanings:
|
||||
@table @samp
|
||||
@item D
|
||||
Decoding available
|
||||
@item E
|
||||
Encoding available
|
||||
@item V/A/S
|
||||
Video/audio/subtitle codec
|
||||
@item S
|
||||
Codec supports slices
|
||||
@item D
|
||||
Codec supports direct rendering
|
||||
@item T
|
||||
Codec can handle input truncated at random locations instead of only at frame boundaries
|
||||
@end table
|
||||
|
||||
@item -bsfs
|
||||
Show available bitstream filters.
|
||||
|
||||
@item -protocols
|
||||
Show available protocols.
|
||||
|
||||
@item -filters
|
||||
Show available libavfilter filters.
|
||||
|
||||
@item -pix_fmts
|
||||
Show available pixel formats.
|
||||
|
||||
@item -loglevel @var{loglevel}
|
||||
Set the logging level used by the library.
|
||||
@var{loglevel} is a number or a string containing one of the following values:
|
||||
@table @samp
|
||||
@item quiet
|
||||
@item panic
|
||||
@item fatal
|
||||
@item error
|
||||
@item warning
|
||||
@item info
|
||||
@item verbose
|
||||
@item debug
|
||||
@end table
|
||||
|
||||
@end table
|
653
doc/general.texi
653
doc/general.texi
@@ -14,12 +14,16 @@ FFmpeg can be hooked up with a number of external libraries to add support
|
||||
for more formats. None of them are used by default, their use has to be
|
||||
explicitly requested by passing the appropriate flags to @file{./configure}.
|
||||
|
||||
@section OpenCORE AMR
|
||||
@section AMR
|
||||
|
||||
FFmpeg can make use of the OpenCORE libraries for AMR-NB
|
||||
decoding/encoding and AMR-WB decoding.
|
||||
AMR comes in two different flavors, wideband and narrowband. FFmpeg can make
|
||||
use of the AMR wideband (floating-point mode) and the AMR narrowband
|
||||
(floating-point mode) reference decoders and encoders (libamr) as well as
|
||||
the OpenCORE libraries for AMR-NB decoding/encoding and AMR-WB decoding.
|
||||
|
||||
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the instructions for
|
||||
@subsection OpenCORE
|
||||
|
||||
Go to @url{http://gitorious.org/opencore-amr/} and follow the instructions for
|
||||
installing the libraries. Then pass @code{--enable-libopencore-amrnb} and/or
|
||||
@code{--enable-libopencore-amrwb} to configure to enable the libraries.
|
||||
|
||||
@@ -29,10 +33,21 @@ incompatible with the LGPL version 2.1 and GPL version 2. You have to
|
||||
upgrade FFmpeg's license to LGPL version 3 (or if you have enabled
|
||||
GPL components, GPL version 3) to use it.
|
||||
|
||||
@subsection libamr
|
||||
|
||||
Go to @url{http://www.penguin.cz/~utx/amr} and follow the instructions for
|
||||
installing the libraries. Then pass @code{--enable-libamr-nb} and/or
|
||||
@code{--enable-libamr-wb} to configure to enable the libraries.
|
||||
|
||||
Note that libamr is copyrighted without any sort of license grant. This means
|
||||
that you can use it if you legally obtained it but you are not allowed to
|
||||
redistribute it in any way. @strong{Any FFmpeg binaries with libamr support
|
||||
you create are non-free and unredistributable!}
|
||||
|
||||
|
||||
@chapter Supported File Formats and Codecs
|
||||
|
||||
You can use the @code{-formats} and @code{-codecs} options to have an exhaustive list.
|
||||
You can use the @code{-formats} option to have an exhaustive list.
|
||||
|
||||
@section File Formats
|
||||
|
||||
@@ -43,8 +58,6 @@ library:
|
||||
@item Name @tab Encoding @tab Decoding @tab Comments
|
||||
@item 4xm @tab @tab X
|
||||
@tab 4X Technologies format, used in some games.
|
||||
@item 8088flex TMV @tab @tab X
|
||||
@item Adobe Filmstrip @tab X @tab X
|
||||
@item Audio IFF (AIFF) @tab X @tab X
|
||||
@item American Laser Games MM @tab @tab X
|
||||
@tab Multimedia format used in games like Mad Dog McCree.
|
||||
@@ -58,25 +71,18 @@ library:
|
||||
@tab Audio and video format used in some games by Beam Software.
|
||||
@item Bethesda Softworks VID @tab @tab X
|
||||
@tab Used in some games from Bethesda Softworks.
|
||||
@item Bink @tab @tab X
|
||||
@tab Multimedia format used by many games.
|
||||
@item Brute Force & Ignorance @tab @tab X
|
||||
@tab Used in the game Flash Traffic: City of Angels.
|
||||
@item Interplay C93 @tab @tab X
|
||||
@tab Used in the game Cyberia from Interplay.
|
||||
@item Delphine Software International CIN @tab @tab X
|
||||
@tab Multimedia format used by Delphine Software games.
|
||||
@item CD+G @tab @tab X
|
||||
@tab Video format used by CD+G karaoke disks
|
||||
@item Core Audio Format @tab @tab X
|
||||
@tab Apple Core Audio Format
|
||||
@item CRC testing format @tab X @tab
|
||||
@item Creative Voice @tab X @tab X
|
||||
@tab Created for the Sound Blaster Pro.
|
||||
@item CRYO APC @tab @tab X
|
||||
@tab Audio format used in some games by CRYO Interactive Entertainment.
|
||||
@item D-Cinema audio @tab X @tab X
|
||||
@item Deluxe Paint Animation @tab @tab X
|
||||
@item DV video @tab X @tab X
|
||||
@item DXA @tab @tab X
|
||||
@tab This format is used in the non-Windows version of the Feeble Files
|
||||
@@ -102,20 +108,16 @@ library:
|
||||
@item id Quake II CIN video @tab @tab X
|
||||
@item id RoQ @tab X @tab X
|
||||
@tab Used in Quake III, Jedi Knight 2, other computer games.
|
||||
@item IEC61937 encapsulation @tab X @tab
|
||||
@item IFF @tab @tab X
|
||||
@tab Interchange File Format
|
||||
@item Interplay MVE @tab @tab X
|
||||
@tab Format used in various Interplay computer games.
|
||||
@item IV8 @tab @tab X
|
||||
@tab A format generated by IndigoVision 8000 video server.
|
||||
@item LMLM4 @tab @tab X
|
||||
@tab Used by Linux Media Labs MPEG-4 PCI boards
|
||||
@item Matroska @tab X @tab X
|
||||
@item Matroska audio @tab X @tab
|
||||
@item MAXIS XA @tab @tab X
|
||||
@tab Used in Sim City 3000; file extension .xa.
|
||||
@item MD Studio @tab @tab X
|
||||
@item Monkey's Audio @tab @tab X
|
||||
@item Motion Pixels MVI @tab @tab X
|
||||
@item MOV/QuickTime/MP4 @tab X @tab X
|
||||
@@ -142,8 +144,6 @@ library:
|
||||
@tab SMPTE 386M, D-10/IMX Mapping.
|
||||
@item NC camera feed @tab @tab X
|
||||
@tab NC (AVIP NC4600) camera streams
|
||||
@item NTT TwinVQ (VQF) @tab @tab X
|
||||
@tab Nippon Telegraph and Telephone Corporation TwinVQ.
|
||||
@item Nullsoft Streaming Video @tab @tab X
|
||||
@item NuppelVideo @tab @tab X
|
||||
@item NUT @tab X @tab X
|
||||
@@ -151,7 +151,6 @@ library:
|
||||
@item Ogg @tab X @tab X
|
||||
@item TechnoTrend PVA @tab @tab X
|
||||
@tab Used by TechnoTrend DVB PCI boards.
|
||||
@item QCP @tab @tab X
|
||||
@item raw ADTS (AAC) @tab X @tab X
|
||||
@item raw AC-3 @tab X @tab X
|
||||
@item raw Chinese AVS video @tab @tab X
|
||||
@@ -176,7 +175,6 @@ library:
|
||||
@item raw video @tab X @tab X
|
||||
@item raw id RoQ @tab X @tab
|
||||
@item raw Shorten @tab @tab X
|
||||
@item raw TrueHD @tab X @tab X
|
||||
@item raw VC-1 @tab @tab X
|
||||
@item raw PCM A-law @tab X @tab X
|
||||
@item raw PCM mu-law @tab X @tab X
|
||||
@@ -207,10 +205,8 @@ library:
|
||||
@item RL2 @tab @tab X
|
||||
@tab Audio and video format used in some games by Entertainment Software Partners.
|
||||
@item RPL/ARMovie @tab @tab X
|
||||
@item RTMP @tab X @tab X
|
||||
@tab Output is performed by publishing stream to RTMP server
|
||||
@item RTP @tab @tab X
|
||||
@item RTSP @tab X @tab X
|
||||
@item RTSP @tab @tab X
|
||||
@item SDP @tab @tab X
|
||||
@item Sega FILM/CPK @tab @tab X
|
||||
@tab Used in many Sega Saturn console games.
|
||||
@@ -223,8 +219,6 @@ library:
|
||||
@item Sony OpenMG (OMA) @tab @tab X
|
||||
@tab Audio format used in Sony Sonic Stage and Sony Vegas.
|
||||
@item Sony PlayStation STR @tab @tab X
|
||||
@item Sony Wave64 (W64) @tab @tab X
|
||||
@item SoX native format @tab X @tab X
|
||||
@item SUN AU format @tab X @tab X
|
||||
@item THP @tab @tab X
|
||||
@tab Used on the Nintendo GameCube.
|
||||
@@ -234,7 +228,6 @@ library:
|
||||
@item VC-1 test bitstream @tab X @tab X
|
||||
@item WAV @tab X @tab X
|
||||
@item WavPack @tab @tab X
|
||||
@item WebM @tab X @tab X
|
||||
@item Wing Commander III movie @tab @tab X
|
||||
@tab Multimedia format used in Origin's Wing Commander III computer game.
|
||||
@item Westwood Studios audio @tab @tab X
|
||||
@@ -242,7 +235,6 @@ library:
|
||||
@item Westwood Studios VQA @tab @tab X
|
||||
@tab Multimedia format used in Westwood Studios games.
|
||||
@item YUV4MPEG pipe @tab X @tab X
|
||||
@item Psygnosis YOP @tab @tab X
|
||||
@end multitable
|
||||
|
||||
@code{X} means that encoding (resp. decoding) is supported.
|
||||
@@ -260,8 +252,6 @@ following image formats are supported:
|
||||
@tab Only uncompressed GIFs are generated.
|
||||
@item BMP @tab X @tab X
|
||||
@tab Microsoft BMP image
|
||||
@item DPX @tab @tab X
|
||||
@tab Digital Picture Exchange
|
||||
@item JPEG @tab X @tab X
|
||||
@tab Progressive JPEG is not supported.
|
||||
@item JPEG 2000 @tab @tab E
|
||||
@@ -273,7 +263,7 @@ following image formats are supported:
|
||||
@tab PAM is a PNM extension with alpha support.
|
||||
@item PBM @tab X @tab X
|
||||
@tab Portable BitMap image
|
||||
@item PCX @tab X @tab X
|
||||
@item PCX @tab @tab X
|
||||
@tab PC Paintbrush
|
||||
@item PGM @tab X @tab X
|
||||
@tab Portable GrayMap image
|
||||
@@ -305,7 +295,6 @@ following image formats are supported:
|
||||
@item Name @tab Encoding @tab Decoding @tab Comments
|
||||
@item 4X Movie @tab @tab X
|
||||
@tab Used in certain computer games.
|
||||
@item 8088flex TMV @tab @tab X
|
||||
@item 8SVX exponential @tab @tab X
|
||||
@item 8SVX fibonacci @tab @tab X
|
||||
@item American Laser Games MM @tab @tab X
|
||||
@@ -323,8 +312,6 @@ following image formats are supported:
|
||||
@tab fourcc: VCR1
|
||||
@item ATI VCR2 @tab @tab X
|
||||
@tab fourcc: VCR2
|
||||
@item Auravision Aura @tab @tab X
|
||||
@item Auravision Aura 2 @tab @tab X
|
||||
@item Autodesk Animator Flic video @tab @tab X
|
||||
@item Autodesk RLE @tab @tab X
|
||||
@tab fourcc: AASC
|
||||
@@ -333,16 +320,12 @@ following image formats are supported:
|
||||
@item Beam Software VB @tab @tab X
|
||||
@item Bethesda VID video @tab @tab X
|
||||
@tab Used in some games from Bethesda Softworks.
|
||||
@item Bink Video @tab @tab X
|
||||
@tab Support for version 'b' is missing.
|
||||
@item Brute Force & Ignorance @tab @tab X
|
||||
@tab Used in the game Flash Traffic: City of Angels.
|
||||
@item C93 video @tab @tab X
|
||||
@tab Codec used in Cyberia game.
|
||||
@item CamStudio @tab @tab X
|
||||
@tab fourcc: CSCD
|
||||
@item CD+G @tab @tab X
|
||||
@tab Video codec for CD+G karaoke disks
|
||||
@item Chinese AVS video @tab @tab X
|
||||
@tab AVS1-P2, JiZhun profile
|
||||
@item Delphine Software International CIN video @tab @tab X
|
||||
@@ -353,7 +336,6 @@ following image formats are supported:
|
||||
@item Creative YUV (CYUV) @tab @tab X
|
||||
@item Dirac @tab E @tab E
|
||||
@tab supported through external libdirac/libschroedinger libraries
|
||||
@item Deluxe Paint Animation @tab @tab X
|
||||
@item DNxHD @tab X @tab X
|
||||
@tab aka SMPTE VC3
|
||||
@item Duck TrueMotion 1.0 @tab @tab X
|
||||
@@ -365,12 +347,11 @@ following image formats are supported:
|
||||
@tab Codec originally used in Feeble Files game.
|
||||
@item Electronic Arts CMV video @tab @tab X
|
||||
@tab Used in NHL 95 game.
|
||||
@item Electronic Arts Madcow video @tab @tab X
|
||||
@item Electronic Arts TGV video @tab @tab X
|
||||
@item Electronic Arts TGQ video @tab @tab X
|
||||
@item Electronic Arts TQI video @tab @tab X
|
||||
@item Escape 124 @tab @tab X
|
||||
@item FFmpeg video codec #1 @tab X @tab X
|
||||
@item FFmpeg codec #1 @tab X @tab X
|
||||
@tab experimental lossless codec (fourcc: FFV1)
|
||||
@item Flash Screen Video v1 @tab X @tab X
|
||||
@tab fourcc: FSV1
|
||||
@@ -391,22 +372,15 @@ following image formats are supported:
|
||||
@tab Used in Quake II.
|
||||
@item id RoQ video @tab X @tab X
|
||||
@tab Used in Quake III, Jedi Knight 2, other computer games.
|
||||
@item IFF ILBM @tab @tab X
|
||||
@tab IFF interlaved bitmap
|
||||
@item IFF ByteRun1 @tab @tab X
|
||||
@tab IFF run length encoded bitmap
|
||||
@item Intel H.263 @tab @tab X
|
||||
@item Intel Indeo 2 @tab @tab X
|
||||
@item Intel Indeo 3 @tab @tab X
|
||||
@item Intel Indeo 5 @tab @tab X
|
||||
@item Interplay C93 @tab @tab X
|
||||
@tab Used in the game Cyberia from Interplay.
|
||||
@item Interplay MVE video @tab @tab X
|
||||
@tab Used in Interplay .MVE files.
|
||||
@item Karl Morton's video codec @tab @tab X
|
||||
@tab Codec used in Worms games.
|
||||
@item Kega Game Video (KGV1) @tab @tab X
|
||||
@tab Kega emulator screen capture codec.
|
||||
@item LCL (LossLess Codec Library) MSZH @tab @tab X
|
||||
@item LCL (LossLess Codec Library) ZLIB @tab E @tab E
|
||||
@item LOCO @tab @tab X
|
||||
@@ -437,8 +411,6 @@ following image formats are supported:
|
||||
@tab fourcc: VP50
|
||||
@item On2 VP6 @tab @tab X
|
||||
@tab fourcc: VP60,VP61,VP62
|
||||
@item VP8 @tab X @tab X
|
||||
@tab fourcc: VP80, de/encoding supported through external library libvpx
|
||||
@item planar RGB @tab @tab X
|
||||
@tab fourcc: 8BPS
|
||||
@item Q-team QPEG @tab @tab X
|
||||
@@ -450,7 +422,6 @@ following image formats are supported:
|
||||
@tab fourcc: 'smc '
|
||||
@item QuickTime video (RPZA) @tab @tab X
|
||||
@tab fourcc: rpza
|
||||
@item R210 Quicktime Uncompressed RGB 10-bit @tab @tab X
|
||||
@item Raw Video @tab X @tab X
|
||||
@item RealVideo 1.0 @tab X @tab X
|
||||
@item RealVideo 2.0 @tab X @tab X
|
||||
@@ -481,7 +452,6 @@ following image formats are supported:
|
||||
@tab encoding supported through external library libtheora
|
||||
@item Tiertex Limited SEQ video @tab @tab X
|
||||
@tab Codec used in DOS CD-ROM FlashBack game.
|
||||
@item V210 Quicktime Uncompressed 4:2:2 10-bit @tab X @tab X
|
||||
@item VMware Screen Codec / VMware Video @tab @tab X
|
||||
@tab Codec used in videos captured by VMware.
|
||||
@item Westwood Studios VQA (Vector Quantized Animation) video @tab @tab X
|
||||
@@ -494,7 +464,6 @@ following image formats are supported:
|
||||
@item Winnov WNV1 @tab @tab X
|
||||
@item WMV7 @tab X @tab X
|
||||
@item YAMAHA SMAF @tab X @tab X
|
||||
@item Psygnosis YOP Video @tab @tab X
|
||||
@item ZLIB @tab X @tab X
|
||||
@tab part of LCL, encoder experimental
|
||||
@item Zip Motion Blocks Video @tab X @tab X
|
||||
@@ -556,16 +525,14 @@ following image formats are supported:
|
||||
@item ADPCM Westwood Studios IMA @tab @tab X
|
||||
@tab Used in Westwood Studios games like Command and Conquer.
|
||||
@item ADPCM Yamaha @tab X @tab X
|
||||
@item AMR-NB @tab E @tab X
|
||||
@tab encoding supported through external library libopencore-amrnb
|
||||
@item AMR-WB @tab @tab E
|
||||
@tab decoding supported through external library libopencore-amrwb
|
||||
@item AMR-NB @tab E @tab E
|
||||
@tab supported through external libraries libamrnb and libopencore-amrnb
|
||||
@item AMR-WB @tab E @tab E
|
||||
@tab decoding supported through external libraries libamrwb and libopencore-amrwb,
|
||||
encoding supported through external library libamrwb
|
||||
@item Apple lossless audio @tab X @tab X
|
||||
@tab QuickTime fourcc 'alac'
|
||||
@item Atrac 1 @tab @tab X
|
||||
@item Atrac 3 @tab @tab X
|
||||
@item Bink Audio @tab @tab X
|
||||
@tab Used in Bink and Smacker files in many games.
|
||||
@item Delphine Software International CIN audio @tab @tab X
|
||||
@tab Codec used in Delphine Software International games.
|
||||
@item COOK @tab @tab X
|
||||
@@ -579,7 +546,6 @@ following image formats are supported:
|
||||
@tab Used in Sierra Online game audio files.
|
||||
@item DPCM Sol @tab @tab X
|
||||
@item DPCM Xan @tab @tab X
|
||||
@tab Used in Origin's Wing Commander IV AVI files.
|
||||
@item DSP Group TrueSpeech @tab @tab X
|
||||
@item DV audio @tab @tab X
|
||||
@item Enhanced AC-3 @tab @tab X
|
||||
@@ -592,15 +558,14 @@ following image formats are supported:
|
||||
@item IMC (Intel Music Coder) @tab @tab X
|
||||
@item MACE (Macintosh Audio Compression/Expansion) 3:1 @tab @tab X
|
||||
@item MACE (Macintosh Audio Compression/Expansion) 6:1 @tab @tab X
|
||||
@item MLP (Meridian Lossless Packing) @tab @tab X
|
||||
@tab Used in DVD-Audio discs.
|
||||
@item MLP(Meridian Lossless Packing)/TrueHD @tab @tab X
|
||||
@tab Used in DVD-Audio and Blu-Ray discs.
|
||||
@item Monkey's Audio @tab @tab X
|
||||
@tab Only versions 3.97-3.99 are supported.
|
||||
@item MP1 (MPEG audio layer 1) @tab @tab IX
|
||||
@item MP2 (MPEG audio layer 2) @tab IX @tab IX
|
||||
@item MP3 (MPEG audio layer 3) @tab E @tab IX
|
||||
@tab encoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
|
||||
@item MPEG-4 Audio Lossless Coding (ALS) @tab @tab X
|
||||
@item Musepack SV7 @tab @tab X
|
||||
@item Musepack SV8 @tab @tab X
|
||||
@item Nellymoser Asao @tab X @tab X
|
||||
@@ -619,7 +584,6 @@ following image formats are supported:
|
||||
@item PCM signed 24-bit little-endian @tab X @tab X
|
||||
@item PCM signed 32-bit big-endian @tab X @tab X
|
||||
@item PCM signed 32-bit little-endian @tab X @tab X
|
||||
@item PCM signed 16/20/24-bit big-endian in MPEG-TS @tab @tab X
|
||||
@item PCM unsigned 8-bit @tab X @tab X
|
||||
@item PCM unsigned 16-bit big-endian @tab X @tab X
|
||||
@item PCM unsigned 16-bit little-endian @tab X @tab X
|
||||
@@ -637,7 +601,6 @@ following image formats are supported:
|
||||
@tab Real 28800 bit/s codec
|
||||
@item RealAudio 3.0 (dnet) @tab IX @tab X
|
||||
@tab Real low bitrate AC-3 codec
|
||||
@item RealAudio SIPR / ACELP.NET @tab @tab X
|
||||
@item Shorten @tab @tab X
|
||||
@item Sierra VMD audio @tab @tab X
|
||||
@tab Used in Sierra VMD files.
|
||||
@@ -649,17 +612,13 @@ following image formats are supported:
|
||||
@item Speex @tab @tab E
|
||||
@tab supported through external library libspeex
|
||||
@item True Audio (TTA) @tab @tab X
|
||||
@item TrueHD @tab @tab X
|
||||
@tab Used in HD-DVD and Blu-Ray discs.
|
||||
@item TwinVQ (VQF flavor) @tab @tab X
|
||||
@item Vorbis @tab E @tab X
|
||||
@tab A native but very primitive encoder exists.
|
||||
@ A native but very primitive encoder exists.
|
||||
@item WavPack @tab @tab X
|
||||
@item Westwood Audio (SND1) @tab @tab X
|
||||
@item Windows Media Audio 1 @tab X @tab X
|
||||
@item Windows Media Audio 2 @tab X @tab X
|
||||
@item Windows Media Audio Pro @tab @tab X
|
||||
@item Windows Media Audio Voice @tab @tab X
|
||||
@tab Used in Origin's Wing Commander IV AVI files.
|
||||
@end multitable
|
||||
|
||||
@code{X} means that encoding (resp. decoding) is supported.
|
||||
@@ -671,20 +630,19 @@ performance on systems without hardware floating point support).
|
||||
|
||||
@section Subtitle Formats
|
||||
|
||||
@multitable @columnfractions .4 .1 .1 .1 .1
|
||||
@multitable @columnfractions .4 .1 .1 .1 .1 .1
|
||||
@item Name @tab Muxing @tab Demuxing @tab Encoding @tab Decoding
|
||||
@item SSA/ASS @tab X @tab X
|
||||
@item DVB @tab X @tab X @tab X @tab X
|
||||
@item DVD @tab X @tab X @tab X @tab X
|
||||
@item PGS @tab @tab @tab @tab X
|
||||
@item XSUB @tab @tab @tab X @tab X
|
||||
@item XSUB @tab @tab @tab @tab X
|
||||
@end multitable
|
||||
|
||||
@code{X} means that the feature is supported.
|
||||
|
||||
@section Network Protocols
|
||||
|
||||
@multitable @columnfractions .4 .1
|
||||
@multitable @columnfractions .4 .1 .1 .1 .1 .1
|
||||
@item Name @tab Support
|
||||
@item file @tab X
|
||||
@item Gopher @tab X
|
||||
@@ -698,90 +656,13 @@ performance on systems without hardware floating point support).
|
||||
@code{X} means that the protocol is supported.
|
||||
|
||||
|
||||
@section Input/Output Devices
|
||||
|
||||
@multitable @columnfractions .4 .1 .1
|
||||
@item Name @tab Input @tab Output
|
||||
@item ALSA @tab X @tab X
|
||||
@item BEOS audio @tab X @tab X
|
||||
@item BKTR @tab X @tab
|
||||
@item DV1394 @tab X @tab
|
||||
@item JACK @tab X @tab
|
||||
@item LIBDC1394 @tab X @tab
|
||||
@item OSS @tab X @tab X
|
||||
@item Video4Linux @tab X @tab
|
||||
@item Video4Linux2 @tab X @tab
|
||||
@item VfW capture @tab X @tab
|
||||
@item X11 grabbing @tab X @tab
|
||||
@end multitable
|
||||
|
||||
@code{X} means that input/output is supported.
|
||||
|
||||
|
||||
@chapter Platform Specific information
|
||||
|
||||
@section BeOS
|
||||
|
||||
BeOS support is broken in mysterious ways.
|
||||
|
||||
@section DOS
|
||||
|
||||
Using a cross-compiler is preferred for various reasons.
|
||||
|
||||
@subsection DJGPP
|
||||
|
||||
FFmpeg cannot be compiled because of broken system headers, add
|
||||
@code{--extra-cflags=-U__STRICT_ANSI__} to the configure options as a
|
||||
workaround.
|
||||
|
||||
@section OS/2
|
||||
|
||||
For information about compiling FFmpeg on OS/2 see
|
||||
@url{http://www.edm2.com/index.php/FFmpeg}.
|
||||
|
||||
@section Unix-like
|
||||
|
||||
Some parts of FFmpeg cannot be built with version 2.15 of the GNU
|
||||
assembler which is still provided by a few AMD64 distributions. To
|
||||
make sure your compiler really uses the required version of gas
|
||||
after a binutils upgrade, run:
|
||||
|
||||
@example
|
||||
$(gcc -print-prog-name=as) --version
|
||||
@end example
|
||||
|
||||
If not, then you should install a different compiler that has no
|
||||
hard-coded path to gas. In the worst case pass @code{--disable-asm}
|
||||
to configure.
|
||||
|
||||
@subsection BSD
|
||||
@section BSD
|
||||
|
||||
BSD make will not build FFmpeg, you need to install and use GNU Make
|
||||
(@file{gmake}).
|
||||
|
||||
@subsubsection FreeBSD
|
||||
|
||||
FreeBSD will not compile out-of-the-box due to broken system headers.
|
||||
Passing @code{--extra-cflags=-D__BSD_VISIBLE} to configure will work
|
||||
around the problem. This may have unexpected sideeffects, so use it at
|
||||
your own risk. If you care about FreeBSD, please make an attempt at
|
||||
getting the system headers fixed.
|
||||
|
||||
@subsection (Open)Solaris
|
||||
|
||||
GNU Make is required to build FFmpeg, so you have to invoke (@file{gmake}),
|
||||
standard Solaris Make will not work. When building with a non-c99 front-end
|
||||
(gcc, generic suncc) add either @code{--extra-libs=/usr/lib/values-xpg6.o}
|
||||
or @code{--extra-libs=/usr/lib/64/values-xpg6.o} to the configure options
|
||||
since the libc is not c99-compliant by default. The probes performed by
|
||||
configure may raise an exception leading to the death of configure itself
|
||||
due to a bug in the system shell. Simply invoke a different shell such as
|
||||
bash directly to work around this:
|
||||
|
||||
@example
|
||||
bash ./configure
|
||||
@end example
|
||||
|
||||
@section Windows
|
||||
|
||||
To get help and instructions for building FFmpeg under Windows, check out
|
||||
@@ -807,13 +688,13 @@ are listed below:
|
||||
@item mingw-runtime 3.15
|
||||
@end itemize
|
||||
|
||||
FFmpeg automatically passes @code{-fno-common} to the compiler to work around
|
||||
You will also need to pass @code{-fno-common} to the compiler to work around
|
||||
a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
|
||||
|
||||
Within the MSYS shell, configure and make with:
|
||||
|
||||
@example
|
||||
./configure --enable-memalign-hack
|
||||
./configure --enable-memalign-hack --extra-cflags=-fno-common
|
||||
make
|
||||
make install
|
||||
@end example
|
||||
@@ -826,11 +707,9 @@ Notes:
|
||||
|
||||
@itemize
|
||||
|
||||
@item Building natively using MSYS can be sped up by disabling implicit rules
|
||||
in the Makefile by calling @code{make -r} instead of plain @code{make}. This
|
||||
speed up is close to non-existent for normal one-off builds and is only
|
||||
noticeable when running make for a second time (for example in
|
||||
@code{make install}).
|
||||
@item In order to compile vhooks, you must have a POSIX-compliant libdl in
|
||||
your MinGW system. Get dlfcn-win32 from
|
||||
@url{http://code.google.com/p/dlfcn-win32}.
|
||||
|
||||
@item In order to compile FFplay, you must have the MinGW development library
|
||||
of SDL. Get it from @url{http://www.libsdl.org}.
|
||||
@@ -870,7 +749,7 @@ Application Wizard, uncheck the "Precompiled headers" option.
|
||||
@item Write the source code for your application, or, for testing, just
|
||||
copy the code from an existing sample application into the source file
|
||||
that MSVC++ has already created for you. For example, you can copy
|
||||
@file{libavformat/output-example.c} from the FFmpeg distribution.
|
||||
@file{output_example.c} from the FFmpeg distribution.
|
||||
|
||||
@item Open the "Project / Properties" dialog box. In the "Configuration"
|
||||
combo box, select "All Configurations" so that the changes you make will
|
||||
@@ -986,35 +865,43 @@ Then you can easily test FFmpeg with Wine
|
||||
|
||||
@subsection Compilation under Cygwin
|
||||
|
||||
Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
|
||||
llrint() in its C library.
|
||||
The main issue with the 1.5.x Cygwin versions is that newlib, its C library,
|
||||
does not contain llrint(). You need to upgrade to the unstable 1.7.x versions,
|
||||
or leverage the implementation in MinGW (as explained below).
|
||||
|
||||
Install your Cygwin with all the "Base" packages, plus the
|
||||
Just install your Cygwin with all the "Base" packages, plus the
|
||||
following "Devel" ones:
|
||||
@example
|
||||
binutils, gcc4-core, make, subversion, mingw-runtime, texi2html
|
||||
binutils, gcc-core, make, subversion, mingw-runtime, diffutils
|
||||
@end example
|
||||
|
||||
And the following "Utils" one:
|
||||
The experimental gcc4 package is still buggy, hence please
|
||||
use the official gcc 3.4.4 or a 4.2.x compiled from source by yourself.
|
||||
|
||||
Install the current binutils-20080624-2 as they work fine (the old
|
||||
binutils-20060709-1 proved buggy on shared builds).
|
||||
|
||||
Then create a small library that just contains llrint():
|
||||
|
||||
@example
|
||||
diffutils
|
||||
ar x /usr/lib/mingw/libmingwex.a llrint.o
|
||||
ar cq /usr/local/lib/libllrint.a llrint.o
|
||||
@end example
|
||||
|
||||
Then run
|
||||
|
||||
@example
|
||||
./configure --enable-static --disable-shared
|
||||
./configure --enable-static --disable-shared --extra-ldflags='-L /usr/local/lib' --extra-libs='-l llrint'
|
||||
@end example
|
||||
|
||||
to make a static build.
|
||||
|
||||
The current @code{gcc4-core} package is buggy and needs this flag to build
|
||||
shared libraries:
|
||||
to make a static build or
|
||||
|
||||
@example
|
||||
./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
|
||||
./configure --enable-shared --disable-static --extra-ldflags='-L /usr/local/lib' --extra-libs='-l llrint'
|
||||
@end example
|
||||
|
||||
to build shared libraries.
|
||||
|
||||
If you want to build FFmpeg with additional libraries, download Cygwin
|
||||
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
|
||||
@example
|
||||
@@ -1058,4 +945,420 @@ and for a build with shared libraries
|
||||
./configure --target-os=mingw32 --enable-memalign-hack --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||
@end example
|
||||
|
||||
@section BeOS
|
||||
|
||||
BeOS support is broken in mysterious ways.
|
||||
|
||||
@section OS/2
|
||||
|
||||
For information about compiling FFmpeg on OS/2 see
|
||||
@url{http://www.edm2.com/index.php/FFmpeg}.
|
||||
|
||||
@chapter Developers Guide
|
||||
|
||||
@section API
|
||||
@itemize @bullet
|
||||
@item libavcodec is the library containing the codecs (both encoding and
|
||||
decoding). Look at @file{libavcodec/apiexample.c} to see how to use it.
|
||||
|
||||
@item libavformat is the library containing the file format handling (mux and
|
||||
demux code for several formats). Look at @file{ffplay.c} to use it in a
|
||||
player. See @file{output_example.c} to use it to generate audio or video
|
||||
streams.
|
||||
|
||||
@end itemize
|
||||
|
||||
@section Integrating libavcodec or libavformat in your program
|
||||
|
||||
You can integrate all the source code of the libraries to link them
|
||||
statically to avoid any version problem. All you need is to provide a
|
||||
'config.mak' and a 'config.h' in the parent directory. See the defines
|
||||
generated by ./configure to understand what is needed.
|
||||
|
||||
You can use libavcodec or libavformat in your commercial program, but
|
||||
@emph{any patch you make must be published}. The best way to proceed is
|
||||
to send your patches to the FFmpeg mailing list.
|
||||
|
||||
@node Coding Rules
|
||||
@section Coding Rules
|
||||
|
||||
FFmpeg is programmed in the ISO C90 language with a few additional
|
||||
features from ISO C99, namely:
|
||||
@itemize @bullet
|
||||
@item
|
||||
the @samp{inline} keyword;
|
||||
@item
|
||||
@samp{//} comments;
|
||||
@item
|
||||
designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
|
||||
@item
|
||||
compound literals (@samp{x = (struct s) @{ 17, 23 @};})
|
||||
@end itemize
|
||||
|
||||
These features are supported by all compilers we care about, so we will not
|
||||
accept patches to remove their use unless they absolutely do not impair
|
||||
clarity and performance.
|
||||
|
||||
All code must compile with GCC 2.95 and GCC 3.3. Currently, FFmpeg also
|
||||
compiles with several other compilers, such as the Compaq ccc compiler
|
||||
or Sun Studio 9, and we would like to keep it that way unless it would
|
||||
be exceedingly involved. To ensure compatibility, please do not use any
|
||||
additional C99 features or GCC extensions. Especially watch out for:
|
||||
@itemize @bullet
|
||||
@item
|
||||
mixing statements and declarations;
|
||||
@item
|
||||
@samp{long long} (use @samp{int64_t} instead);
|
||||
@item
|
||||
@samp{__attribute__} not protected by @samp{#ifdef __GNUC__} or similar;
|
||||
@item
|
||||
GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
|
||||
@end itemize
|
||||
|
||||
Indent size is 4.
|
||||
The presentation is the one specified by 'indent -i4 -kr -nut'.
|
||||
The TAB character is forbidden outside of Makefiles as is any
|
||||
form of trailing whitespace. Commits containing either will be
|
||||
rejected by the Subversion repository.
|
||||
|
||||
The main priority in FFmpeg is simplicity and small code size in order to
|
||||
minimize the bug count.
|
||||
|
||||
Comments: Use the JavaDoc/Doxygen
|
||||
format (see examples below) so that code documentation
|
||||
can be generated automatically. All nontrivial functions should have a comment
|
||||
above them explaining what the function does, even if it is just one sentence.
|
||||
All structures and their member variables should be documented, too.
|
||||
@example
|
||||
/**
|
||||
* @@file mpeg.c
|
||||
* MPEG codec.
|
||||
* @@author ...
|
||||
*/
|
||||
|
||||
/**
|
||||
* Summary sentence.
|
||||
* more text ...
|
||||
* ...
|
||||
*/
|
||||
typedef struct Foobar@{
|
||||
int var1; /**< var1 description */
|
||||
int var2; ///< var2 description
|
||||
/** var3 description */
|
||||
int var3;
|
||||
@} Foobar;
|
||||
|
||||
/**
|
||||
* Summary sentence.
|
||||
* more text ...
|
||||
* ...
|
||||
* @@param my_parameter description of my_parameter
|
||||
* @@return return value description
|
||||
*/
|
||||
int myfunc(int my_parameter)
|
||||
...
|
||||
@end example
|
||||
|
||||
fprintf and printf are forbidden in libavformat and libavcodec,
|
||||
please use av_log() instead.
|
||||
|
||||
Casts should be used only when necessary. Unneeded parentheses
|
||||
should also be avoided if they don't make the code easier to understand.
|
||||
|
||||
@section Development Policy
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Contributions should be licensed under the LGPL 2.1, including an
|
||||
"or any later version" clause, or the MIT license. GPL 2 including
|
||||
an "or any later version" clause is also acceptable, but LGPL is
|
||||
preferred.
|
||||
@item
|
||||
You must not commit code which breaks FFmpeg! (Meaning unfinished but
|
||||
enabled code which breaks compilation or compiles but does not work or
|
||||
breaks the regression tests)
|
||||
You can commit unfinished stuff (for testing etc), but it must be disabled
|
||||
(#ifdef etc) by default so it does not interfere with other developers'
|
||||
work.
|
||||
@item
|
||||
You do not have to over-test things. If it works for you, and you think it
|
||||
should work for others, then commit. If your code has problems
|
||||
(portability, triggers compiler bugs, unusual environment etc) they will be
|
||||
reported and eventually fixed.
|
||||
@item
|
||||
Do not commit unrelated changes together, split them into self-contained
|
||||
pieces. Also do not forget that if part B depends on part A, but A does not
|
||||
depend on B, then A can and should be committed first and separate from B.
|
||||
Keeping changes well split into self-contained parts makes reviewing and
|
||||
understanding them on the commit log mailing list easier. This also helps
|
||||
in case of debugging later on.
|
||||
Also if you have doubts about splitting or not splitting, do not hesitate to
|
||||
ask/discuss it on the developer mailing list.
|
||||
@item
|
||||
Do not change behavior of the program (renaming options etc) without
|
||||
first discussing it on the ffmpeg-devel mailing list. Do not remove
|
||||
functionality from the code. Just improve!
|
||||
|
||||
Note: Redundant code can be removed.
|
||||
@item
|
||||
Do not commit changes to the build system (Makefiles, configure script)
|
||||
which change behavior, defaults etc, without asking first. The same
|
||||
applies to compiler warning fixes, trivial looking fixes and to code
|
||||
maintained by other developers. We usually have a reason for doing things
|
||||
the way we do. Send your changes as patches to the ffmpeg-devel mailing
|
||||
list, and if the code maintainers say OK, you may commit. This does not
|
||||
apply to files you wrote and/or maintain.
|
||||
@item
|
||||
We refuse source indentation and other cosmetic changes if they are mixed
|
||||
with functional changes, such commits will be rejected and removed. Every
|
||||
developer has his own indentation style, you should not change it. Of course
|
||||
if you (re)write something, you can use your own style, even though we would
|
||||
prefer if the indentation throughout FFmpeg was consistent (Many projects
|
||||
force a given indentation style - we do not.). If you really need to make
|
||||
indentation changes (try to avoid this), separate them strictly from real
|
||||
changes.
|
||||
|
||||
NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
|
||||
then either do NOT change the indentation of the inner part within (do not
|
||||
move it to the right)! or do so in a separate commit
|
||||
@item
|
||||
Always fill out the commit log message. Describe in a few lines what you
|
||||
changed and why. You can refer to mailing list postings if you fix a
|
||||
particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
|
||||
@item
|
||||
If you apply a patch by someone else, include the name and email address in
|
||||
the log message. Since the ffmpeg-cvslog mailing list is publicly
|
||||
archived you should add some SPAM protection to the email address. Send an
|
||||
answer to ffmpeg-devel (or wherever you got the patch from) saying that
|
||||
you applied the patch.
|
||||
@item
|
||||
When applying patches that have been discussed (at length) on the mailing
|
||||
list, reference the thread in the log message.
|
||||
@item
|
||||
Do NOT commit to code actively maintained by others without permission.
|
||||
Send a patch to ffmpeg-devel instead. If no one answers within a reasonable
|
||||
timeframe (12h for build failures and security fixes, 3 days small changes,
|
||||
1 week for big patches) then commit your patch if you think it is OK.
|
||||
Also note, the maintainer can simply ask for more time to review!
|
||||
@item
|
||||
Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits
|
||||
are sent there and reviewed by all the other developers. Bugs and possible
|
||||
improvements or general questions regarding commits are discussed there. We
|
||||
expect you to react if problems with your code are uncovered.
|
||||
@item
|
||||
Update the documentation if you change behavior or add features. If you are
|
||||
unsure how best to do this, send a patch to ffmpeg-devel, the documentation
|
||||
maintainer(s) will review and commit your stuff.
|
||||
@item
|
||||
Try to keep important discussions and requests (also) on the public
|
||||
developer mailing list, so that all developers can benefit from them.
|
||||
@item
|
||||
Never write to unallocated memory, never write over the end of arrays,
|
||||
always check values read from some untrusted source before using them
|
||||
as array index or other risky things.
|
||||
@item
|
||||
Remember to check if you need to bump versions for the specific libav
|
||||
parts (libavutil, libavcodec, libavformat) you are changing. You need
|
||||
to change the version integer.
|
||||
Incrementing the first component means no backward compatibility to
|
||||
previous versions (e.g. removal of a function from the public API).
|
||||
Incrementing the second component means backward compatible change
|
||||
(e.g. addition of a function to the public API or extension of an
|
||||
existing data structure).
|
||||
Incrementing the third component means a noteworthy binary compatible
|
||||
change (e.g. encoder bug fix that matters for the decoder).
|
||||
@item
|
||||
Compiler warnings indicate potential bugs or code with bad style. If a type of
|
||||
warning always points to correct and clean code, that warning should
|
||||
be disabled, not the code changed.
|
||||
Thus the remaining warnings can either be bugs or correct code.
|
||||
If it is a bug, the bug has to be fixed. If it is not, the code should
|
||||
be changed to not generate a warning unless that causes a slowdown
|
||||
or obfuscates the code.
|
||||
@item
|
||||
If you add a new file, give it a proper license header. Do not copy and
|
||||
paste it from a random place, use an existing file as template.
|
||||
@end enumerate
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
Note, these rules are mostly borrowed from the MPlayer project.
|
||||
|
||||
@section Submitting patches
|
||||
|
||||
First, (@pxref{Coding Rules}) above if you did not yet.
|
||||
|
||||
When you submit your patch, try to send a unified diff (diff '-up'
|
||||
option). We cannot read other diffs :-)
|
||||
|
||||
Also please do not submit a patch which contains several unrelated changes.
|
||||
Split it into separate, self-contained pieces. This does not mean splitting
|
||||
file by file. Instead, make the patch as small as possible while still
|
||||
keeping it as a logical unit that contains an individual change, even
|
||||
if it spans multiple files. This makes reviewing your patches much easier
|
||||
for us and greatly increases your chances of getting your patch applied.
|
||||
|
||||
Run the regression tests before submitting a patch so that you can
|
||||
verify that there are no big problems.
|
||||
|
||||
Patches should be posted as base64 encoded attachments (or any other
|
||||
encoding which ensures that the patch will not be trashed during
|
||||
transmission) to the ffmpeg-devel mailing list, see
|
||||
@url{http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel}
|
||||
|
||||
It also helps quite a bit if you tell us what the patch does (for example
|
||||
'replaces lrint by lrintf'), and why (for example '*BSD isn't C99 compliant
|
||||
and has no lrint()')
|
||||
|
||||
Also please if you send several patches, send each patch as a separate mail,
|
||||
do not attach several unrelated patches to the same mail.
|
||||
|
||||
@section New codecs or formats checklist
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Did you use av_cold for codec initialization and close functions?
|
||||
@item
|
||||
Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
|
||||
AVInputFormat/AVOutputFormat struct?
|
||||
@item
|
||||
Did you bump the minor version number in @file{avcodec.h} or
|
||||
@file{avformat.h}?
|
||||
@item
|
||||
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
|
||||
@item
|
||||
Did you add the CodecID to @file{avcodec.h}?
|
||||
@item
|
||||
If it has a fourcc, did you add it to @file{libavformat/riff.c},
|
||||
even if it is only a decoder?
|
||||
@item
|
||||
Did you add a rule to compile the appropriate files in the Makefile?
|
||||
Remember to do this even if you're just adding a format to a file that is
|
||||
already being compiled by some other rule, like a raw demuxer.
|
||||
@item
|
||||
Did you add an entry to the table of supported formats or codecs in the
|
||||
documentation?
|
||||
@item
|
||||
Did you add an entry in the Changelog?
|
||||
@item
|
||||
If it depends on a parser or a library, did you add that dependency in
|
||||
configure?
|
||||
@item
|
||||
Did you "svn add" the appropriate files before commiting?
|
||||
@end enumerate
|
||||
|
||||
@section patch submission checklist
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Do the regression tests pass with the patch applied?
|
||||
@item
|
||||
Does @code{make checkheaders} pass with the patch applied?
|
||||
@item
|
||||
Is the patch a unified diff?
|
||||
@item
|
||||
Is the patch against latest FFmpeg SVN?
|
||||
@item
|
||||
Are you subscribed to ffmpeg-dev?
|
||||
(the list is subscribers only due to spam)
|
||||
@item
|
||||
Have you checked that the changes are minimal, so that the same cannot be
|
||||
achieved with a smaller patch and/or simpler final code?
|
||||
@item
|
||||
If the change is to speed critical code, did you benchmark it?
|
||||
@item
|
||||
If you did any benchmarks, did you provide them in the mail?
|
||||
@item
|
||||
Have you checked that the patch does not introduce buffer overflows or
|
||||
other security issues?
|
||||
@item
|
||||
Did you test your decoder or demuxer against damaged data? If no, see
|
||||
tools/trasher and the noise bitstream filter. Your decoder or demuxer
|
||||
should not crash or end in a (near) infinite loop when fed damaged data.
|
||||
@item
|
||||
Is the patch created from the root of the source tree, so it can be
|
||||
applied with @code{patch -p0}?
|
||||
@item
|
||||
Does the patch not mix functional and cosmetic changes?
|
||||
@item
|
||||
Did you add tabs or trailing whitespace to the code? Both are forbidden.
|
||||
@item
|
||||
Is the patch attached to the email you send?
|
||||
@item
|
||||
Is the mime type of the patch correct? It should be text/x-diff or
|
||||
text/x-patch or at least text/plain and not application/octet-stream.
|
||||
@item
|
||||
If the patch fixes a bug, did you provide a verbose analysis of the bug?
|
||||
@item
|
||||
If the patch fixes a bug, did you provide enough information, including
|
||||
a sample, so the bug can be reproduced and the fix can be verified?
|
||||
Note please do not attach samples >100k to mails but rather provide a
|
||||
URL, you can upload to ftp://upload.ffmpeg.org
|
||||
@item
|
||||
Did you provide a verbose summary about what the patch does change?
|
||||
@item
|
||||
Did you provide a verbose explanation why it changes things like it does?
|
||||
@item
|
||||
Did you provide a verbose summary of the user visible advantages and
|
||||
disadvantages if the patch is applied?
|
||||
@item
|
||||
Did you provide an example so we can verify the new feature added by the
|
||||
patch easily?
|
||||
@item
|
||||
If you added a new file, did you insert a license header? It should be
|
||||
taken from FFmpeg, not randomly copied and pasted from somewhere else.
|
||||
@item
|
||||
You should maintain alphabetical order in alphabetically ordered lists as
|
||||
long as doing so does not break API/ABI compatibility.
|
||||
@item
|
||||
Lines with similar content should be aligned vertically when doing so
|
||||
improves readability.
|
||||
@item
|
||||
Did you provide a suggestion for a clear commit log message?
|
||||
@end enumerate
|
||||
|
||||
@section Patch review process
|
||||
|
||||
All patches posted to ffmpeg-devel will be reviewed, unless they contain a
|
||||
clear note that the patch is not for SVN.
|
||||
Reviews and comments will be posted as replies to the patch on the
|
||||
mailing list. The patch submitter then has to take care of every comment,
|
||||
that can be by resubmitting a changed patch or by discussion. Resubmitted
|
||||
patches will themselves be reviewed like any other patch. If at some point
|
||||
a patch passes review with no comments then it is approved, that can for
|
||||
simple and small patches happen immediately while large patches will generally
|
||||
have to be changed and reviewed many times before they are approved.
|
||||
After a patch is approved it will be committed to the repository.
|
||||
|
||||
We will review all submitted patches, but sometimes we are quite busy so
|
||||
especially for large patches this can take several weeks.
|
||||
|
||||
When resubmitting patches, please do not make any significant changes
|
||||
not related to the comments received during review. Such patches will
|
||||
be rejected. Instead, submit significant changes or new features as
|
||||
separate patches.
|
||||
|
||||
@section Regression tests
|
||||
|
||||
Before submitting a patch (or committing to the repository), you should at least
|
||||
test that you did not break anything.
|
||||
|
||||
The regression tests build a synthetic video stream and a synthetic
|
||||
audio stream. These are then encoded and decoded with all codecs or
|
||||
formats. The CRC (or MD5) of each generated file is recorded in a
|
||||
result file. A 'diff' is launched to compare the reference results and
|
||||
the result file.
|
||||
|
||||
The regression tests then go on to test the FFserver code with a
|
||||
limited set of streams. It is important that this step runs correctly
|
||||
as well.
|
||||
|
||||
Run 'make test' to test all the codecs and formats.
|
||||
|
||||
Run 'make fulltest' to test all the codecs, formats and FFserver.
|
||||
|
||||
[Of course, some patches may change the results of the regression tests. In
|
||||
this case, the reference results of the regression tests shall be modified
|
||||
accordingly].
|
||||
|
||||
@bye
|
||||
|
299
doc/hooks.texi
Normal file
299
doc/hooks.texi
Normal file
@@ -0,0 +1,299 @@
|
||||
\input texinfo @c -*- texinfo -*-
|
||||
|
||||
@settitle Video Hook Documentation
|
||||
@titlepage
|
||||
@sp 7
|
||||
@center @titlefont{Video Hook Documentation}
|
||||
@sp 3
|
||||
@end titlepage
|
||||
|
||||
|
||||
@chapter Introduction
|
||||
|
||||
@var{Please be aware that vhook is deprecated, and hence its development is
|
||||
frozen (bug fixes are still accepted).
|
||||
The substitute will be 'libavfilter', the result of our 'Video Filter API'
|
||||
Google Summer of Code project. You may monitor its progress by subscribing to
|
||||
the ffmpeg-soc mailing list at
|
||||
@url{http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc}.}
|
||||
|
||||
The video hook functionality is designed (mostly) for live video. It allows
|
||||
the video to be modified or examined between the decoder and the encoder.
|
||||
|
||||
Any number of hook modules can be placed inline, and they are run in the
|
||||
order that they were specified on the ffmpeg command line.
|
||||
|
||||
The video hook modules are provided for use as a base for your own modules,
|
||||
and are described below.
|
||||
|
||||
Modules are loaded using the -vhook option to ffmpeg. The value of this parameter
|
||||
is a space separated list of arguments. The first is the module name, and the rest
|
||||
are passed as arguments to the Configure function of the module.
|
||||
|
||||
The modules are dynamic libraries: They have different suffixes (.so, .dll, .dylib)
|
||||
depending on your platform. And your platform dictates if they need to be
|
||||
somewhere in your PATH, or in your LD_LIBRARY_PATH. Otherwise you will need to
|
||||
specify the full path of the vhook file that you are using.
|
||||
|
||||
@section null.c
|
||||
|
||||
This does nothing. Actually it converts the input image to RGB24 and then converts
|
||||
it back again. This is meant as a sample that you can use to test your setup.
|
||||
|
||||
@section fish.c
|
||||
|
||||
This implements a 'fish detector'. Essentially it converts the image into HSV
|
||||
space and tests whether more than a certain percentage of the pixels fall into
|
||||
a specific HSV cuboid. If so, then the image is saved into a file for processing
|
||||
by other bits of code.
|
||||
|
||||
Why use HSV? It turns out that HSV cuboids represent a more compact range of
|
||||
colors than would an RGB cuboid.
|
||||
|
||||
@section imlib2.c
|
||||
|
||||
This module implements a text overlay for a video image. Currently it
|
||||
supports a fixed overlay or reading the text from a file. The string
|
||||
is passed through strftime() so that it is easy to imprint the date and
|
||||
time onto the image.
|
||||
|
||||
This module depends on the external library imlib2, available on
|
||||
Sourceforge, among other places, if it is not already installed on
|
||||
your system.
|
||||
|
||||
You may also overlay an image (even semi-transparent) like TV stations do.
|
||||
You may move either the text or the image around your video to create
|
||||
scrolling credits, for example.
|
||||
|
||||
The font file used is looked for in a FONTPATH environment variable, and
|
||||
prepended to the point size as a command line option and can be specified
|
||||
with the full path to the font file, as in:
|
||||
@example
|
||||
-F /usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf/20
|
||||
@end example
|
||||
where 20 is the point size.
|
||||
|
||||
You can specify the filename to read RGB color names from. If it is not
|
||||
specified, these defaults are used: @file{/usr/share/X11/rgb.txt} and
|
||||
@file{/usr/lib/X11/rgb.txt}
|
||||
|
||||
Options:
|
||||
@multitable @columnfractions .2 .8
|
||||
@item @option{-C <rgb.txt>} @tab The filename to read RGB color names from
|
||||
@item @option{-c <color>} @tab The color of the text
|
||||
@item @option{-F <fontname>} @tab The font face and size
|
||||
@item @option{-t <text>} @tab The text
|
||||
@item @option{-f <filename>} @tab The filename to read text from
|
||||
@item @option{-x <expression>}@tab x coordinate of text or image
|
||||
@item @option{-y <expression>}@tab y coordinate of text or image
|
||||
@item @option{-i <filename>} @tab The filename to read a image from
|
||||
@item @option{-R <expression>}@tab Value for R color
|
||||
@item @option{-G <expression>}@tab Value for G color
|
||||
@item @option{-B <expression>}@tab Value for B color
|
||||
@item @option{-A <expression>}@tab Value for Alpha channel
|
||||
@end multitable
|
||||
|
||||
Expressions are functions of these variables:
|
||||
@multitable @columnfractions .2 .8
|
||||
@item @var{N} @tab frame number (starting at zero)
|
||||
@item @var{H} @tab frame height
|
||||
@item @var{W} @tab frame width
|
||||
@item @var{h} @tab image height
|
||||
@item @var{w} @tab image width
|
||||
@item @var{X} @tab previous x coordinate of text or image
|
||||
@item @var{Y} @tab previous y coordinate of text or image
|
||||
@end multitable
|
||||
|
||||
You may also use the constants @var{PI}, @var{E}, and the math functions available at the
|
||||
FFmpeg formula evaluator at (@url{ffmpeg-doc.html#SEC13}), except @var{bits2qp(bits)}
|
||||
and @var{qp2bits(qp)}.
|
||||
|
||||
Usage examples:
|
||||
|
||||
@example
|
||||
# Remember to set the path to your fonts
|
||||
FONTPATH="/cygdrive/c/WINDOWS/Fonts/"
|
||||
FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/"
|
||||
FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/"
|
||||
export FONTPATH
|
||||
|
||||
# Bulb dancing in a Lissajous pattern
|
||||
ffmpeg -i input.avi -vhook \
|
||||
'vhook/imlib2.dll -x W*(0.5+0.25*sin(N/47*PI))-w/2 -y H*(0.5+0.50*cos(N/97*PI))-h/2 -i /usr/share/imlib2/data/images/bulb.png' \
|
||||
-acodec copy -sameq output.avi
|
||||
|
||||
# Text scrolling
|
||||
ffmpeg -i input.avi -vhook \
|
||||
'vhook/imlib2.dll -c red -F Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello' \
|
||||
-acodec copy -sameq output.avi
|
||||
|
||||
# Date and time stamp, security-camera style:
|
||||
ffmpeg -r 29.97 -s 320x256 -f video4linux -i /dev/video0 \
|
||||
-vhook 'vhook/imlib2.so -x 0 -y 0 -i black-260x20.png' \
|
||||
-vhook 'vhook/imlib2.so -c white -F VeraBd.ttf/12 -x 0 -y 0 -t %A-%D-%T' \
|
||||
output.avi
|
||||
|
||||
In this example the video is captured from the first video capture card as a
|
||||
320x256 AVI, and a black 260 by 20 pixel PNG image is placed in the upper
|
||||
left corner, with the day, date and time overlaid on it in Vera Bold 12
|
||||
point font. A simple black PNG file 260 pixels wide and 20 pixels tall
|
||||
was created in the GIMP for this purpose.
|
||||
|
||||
# Scrolling credits from a text file
|
||||
ffmpeg -i input.avi -vhook \
|
||||
'vhook/imlib2.so -c white -F VeraBd.ttf/16 -x 100 -y -1.0*N -f credits.txt' \
|
||||
-sameq output.avi
|
||||
|
||||
In this example, the text is stored in a file, and is positioned 100
|
||||
pixels from the left hand edge of the video. The text is scrolled from the
|
||||
bottom up. Making the y factor positive will scroll from the top down.
|
||||
Increasing the magnitude of the y factor makes the text scroll faster,
|
||||
decreasing it makes it scroll slower. Hint: Blank lines containing only
|
||||
a newline are treated as end-of-file. To create blank lines, use lines
|
||||
that consist of space characters only.
|
||||
|
||||
# Scrolling credits with custom color from a text file
|
||||
ffmpeg -i input.avi -vhook \
|
||||
'vhook/imlib2.so -C rgb.txt -c CustomColor1 -F VeraBd.ttf/16 -x 100 -y -1.0*N -f credits.txt' \
|
||||
-sameq output.avi
|
||||
|
||||
This example does the same as the one above, but specifies an rgb.txt file
|
||||
to be used, which has a custom-made color in it.
|
||||
|
||||
# Variable colors
|
||||
ffmpeg -i input.avi -vhook \
|
||||
'vhook/imlib2.so -t Hello -R abs(255*sin(N/47*PI)) -G abs(255*sin(N/47*PI)) -B abs(255*sin(N/47*PI))' \
|
||||
-sameq output.avi
|
||||
|
||||
In this example, the color for the text goes up and down from black to
|
||||
white.
|
||||
|
||||
# Text fade-out
|
||||
ffmpeg -i input.avi -vhook \
|
||||
'vhook/imlib2.so -t Hello -A max(0,255-exp(N/47))' \
|
||||
-sameq output.avi
|
||||
|
||||
In this example, the text fades out in about 10 seconds for a 25 fps input
|
||||
video file.
|
||||
|
||||
# scrolling credits from a graphics file
|
||||
ffmpeg -sameq -i input.avi \
|
||||
-vhook 'vhook/imlib2.so -x 0 -y -1.0*N -i credits.png' output.avi
|
||||
|
||||
In this example, a transparent PNG file the same width as the video
|
||||
(e.g. 320 pixels), but very long, (e.g. 3000 pixels), was created, and
|
||||
text, graphics, brushstrokes, etc, were added to the image. The image
|
||||
is then scrolled up, from the bottom of the frame.
|
||||
|
||||
@end example
|
||||
|
||||
@section ppm.c
|
||||
|
||||
It's basically a launch point for a PPM pipe, so you can use any
|
||||
executable (or script) which consumes a PPM on stdin and produces a PPM
|
||||
on stdout (and flushes each frame). The Netpbm utilities are a series of
|
||||
such programs.
|
||||
|
||||
A list of them is here:
|
||||
|
||||
@url{http://netpbm.sourceforge.net/doc/directory.html}
|
||||
|
||||
Usage example:
|
||||
|
||||
@example
|
||||
ffmpeg -i input -vhook "/path/to/ppm.so some-ppm-filter args" output
|
||||
@end example
|
||||
|
||||
@section drawtext.c
|
||||
|
||||
This module implements a text overlay for a video image. Currently it
|
||||
supports a fixed overlay or reading the text from a file. The string
|
||||
is passed through strftime() so that it is easy to imprint the date and
|
||||
time onto the image.
|
||||
|
||||
Features:
|
||||
@itemize @minus
|
||||
@item TrueType, Type1 and others via the FreeType2 library
|
||||
@item Font kerning (better output)
|
||||
@item Line Wrap (put the text that doesn't fit one line on the next line)
|
||||
@item Background box (currently in development)
|
||||
@item Outline
|
||||
@end itemize
|
||||
|
||||
Options:
|
||||
@multitable @columnfractions .2 .8
|
||||
@item @option{-c <color>} @tab Foreground color of the text ('internet' way) <#RRGGBB> [default #FFFFFF]
|
||||
@item @option{-C <color>} @tab Background color of the text ('internet' way) <#RRGGBB> [default #000000]
|
||||
@item @option{-f <font-filename>} @tab font file to use
|
||||
@item @option{-t <text>} @tab text to display
|
||||
@item @option{-T <filename>} @tab file to read text from
|
||||
@item @option{-x <pos>} @tab x coordinate of the start of the text
|
||||
@item @option{-y <pos>} @tab y coordinate of the start of the text
|
||||
@end multitable
|
||||
|
||||
Text fonts are being looked for in a FONTPATH environment variable.
|
||||
If the FONTPATH environment variable is not available, or is not checked by
|
||||
your target (i.e. Cygwin), then specify the full path to the font file as in:
|
||||
@example
|
||||
-f /usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf
|
||||
@end example
|
||||
|
||||
Usage Example:
|
||||
@example
|
||||
# Remember to set the path to your fonts
|
||||
FONTPATH="/cygdrive/c/WINDOWS/Fonts/"
|
||||
FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/"
|
||||
FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/"
|
||||
export FONTPATH
|
||||
|
||||
# Time and date display
|
||||
ffmpeg -f video4linux2 -i /dev/video0 \
|
||||
-vhook 'vhook/drawtext.so -f VeraBd.ttf -t %A-%D-%T' movie.mpg
|
||||
|
||||
This example grabs video from the first capture card and outputs it to an
|
||||
MPEG video, and places "Weekday-dd/mm/yy-hh:mm:ss" at the top left of the
|
||||
frame, updated every second, using the Vera Bold TrueType Font, which
|
||||
should exist in: /usr/X11R6/lib/X11/fonts/TTF/
|
||||
@end example
|
||||
|
||||
Check the man page for strftime() for all the various ways you can format
|
||||
the date and time.
|
||||
|
||||
@section watermark.c
|
||||
|
||||
Command Line options:
|
||||
@multitable @columnfractions .2 .8
|
||||
@item @option{-m [0|1]} @tab Mode (default: 0, see below)
|
||||
@item @option{-t 000000 - FFFFFF} @tab Threshold, six digit hex number
|
||||
@item @option{-f <filename>} @tab Watermark image filename, must be specified!
|
||||
@end multitable
|
||||
|
||||
MODE 0:
|
||||
The watermark picture works like this (assuming color intensities 0..0xFF):
|
||||
Per color do this:
|
||||
If mask color is 0x80, no change to the original frame.
|
||||
If mask color is < 0x80 the absolute difference is subtracted from the
|
||||
frame. If result < 0, result = 0.
|
||||
If mask color is > 0x80 the absolute difference is added to the
|
||||
frame. If result > 0xFF, result = 0xFF.
|
||||
|
||||
You can override the 0x80 level with the -t flag. E.g. if threshold is
|
||||
000000 the color value of watermark is added to the destination.
|
||||
|
||||
This way a mask that is visible both in light and dark pictures can be made
|
||||
(e.g. by using a picture generated by the Gimp and the bump map tool).
|
||||
|
||||
An example watermark file is at:
|
||||
@url{http://engene.se/ffmpeg_watermark.gif}
|
||||
|
||||
MODE 1:
|
||||
Per color do this:
|
||||
If mask color > threshold color then the watermark pixel is used.
|
||||
|
||||
Example usage:
|
||||
@example
|
||||
ffmpeg -i infile -vhook '/path/watermark.so -f wm.gif' -an out.mov
|
||||
ffmpeg -i infile -vhook '/path/watermark.so -f wm.gif -m 1 -t 222222' -an out.mov
|
||||
@end example
|
||||
|
||||
@bye
|
@@ -1,307 +0,0 @@
|
||||
\input texinfo @c -*- texinfo -*-
|
||||
|
||||
@settitle Libavfilter Documentation
|
||||
@titlepage
|
||||
@sp 7
|
||||
@center @titlefont{Libavfilter Documentation}
|
||||
@sp 3
|
||||
@end titlepage
|
||||
|
||||
|
||||
@chapter Introduction
|
||||
|
||||
Libavfilter is the filtering API of FFmpeg. It is the substitute of the
|
||||
now deprecated 'vhooks' and started as a Google Summer of Code project.
|
||||
|
||||
Integrating libavfilter into the main FFmpeg repository is a work in
|
||||
progress. If you wish to try the unfinished development code of
|
||||
libavfilter then check it out from the libavfilter repository into
|
||||
some directory of your choice by:
|
||||
|
||||
@example
|
||||
svn checkout svn://svn.ffmpeg.org/soc/libavfilter
|
||||
@end example
|
||||
|
||||
And then read the README file in the top directory to learn how to
|
||||
integrate it into ffmpeg and ffplay.
|
||||
|
||||
But note that there may still be serious bugs in the code and its API
|
||||
and ABI should not be considered stable yet!
|
||||
|
||||
@chapter Tutorial
|
||||
|
||||
In libavfilter, it is possible for filters to have multiple inputs and
|
||||
multiple outputs.
|
||||
To illustrate the sorts of things that are possible, we can
|
||||
use a complex filter graph. For example, the following one:
|
||||
|
||||
@example
|
||||
input --> split --> fifo -----------------------> overlay --> output
|
||||
| ^
|
||||
| |
|
||||
+------> fifo --> crop --> vflip --------+
|
||||
@end example
|
||||
|
||||
splits the stream in two streams, sends one stream through the crop filter
|
||||
and the vflip filter before merging it back with the other stream by
|
||||
overlaying it on top. You can use the following command to achieve this:
|
||||
|
||||
@example
|
||||
./ffmpeg -i in.avi -s 240x320 -vfilters "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
|
||||
@end example
|
||||
|
||||
where input_video.avi has a vertical resolution of 480 pixels. The
|
||||
result will be that in output the top half of the video is mirrored
|
||||
onto the bottom half.
|
||||
|
||||
Video filters are loaded using the @var{-vfilters} option passed to
|
||||
ffmpeg or to ffplay. Filters in the same linear chain are separated by
|
||||
commas. In our example, @var{split, fifo, overlay} are in one linear
|
||||
chain, and @var{fifo, crop, vflip} are in another. The points where
|
||||
the linear chains join are labeled by names enclosed in square
|
||||
brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic
|
||||
labels @var{[in]} and @var{[out]} are the points where video is input
|
||||
and output.
|
||||
|
||||
Some filters take in input a list of parameters: they are specified
|
||||
after the filter name and an equal sign, and are separated each other
|
||||
by a semicolon.
|
||||
|
||||
There exist so-called @var{source filters} that do not have a video
|
||||
input, and we expect in the future some @var{sink filters} that will
|
||||
not have video output.
|
||||
|
||||
@chapter graph2dot
|
||||
|
||||
The @file{graph2dot} program included in the FFmpeg @file{tools}
|
||||
directory can be used to parse a filter graph description and issue a
|
||||
corresponding textual representation in the dot language.
|
||||
|
||||
Invoke the command:
|
||||
@example
|
||||
graph2dot -h
|
||||
@end example
|
||||
|
||||
to see how to use @file{graph2dot}.
|
||||
|
||||
You can then pass the dot description to the @file{dot} program (from
|
||||
the graphviz suite of programs) and obtain a graphical representation
|
||||
of the filter graph.
|
||||
|
||||
For example the sequence of commands:
|
||||
@example
|
||||
echo @var{GRAPH_DESCRIPTION} | \
|
||||
tools/graph2dot -o graph.tmp && \
|
||||
dot -Tpng graph.tmp -o graph.png && \
|
||||
display graph.png
|
||||
@end example
|
||||
|
||||
can be used to create and display an image representing the graph
|
||||
described by the @var{GRAPH_DESCRIPTION} string.
|
||||
|
||||
@chapter Available video filters
|
||||
|
||||
When you configure your FFmpeg build, you can disable any of the
|
||||
existing video filters.
|
||||
The configure output will show the video filters included in your
|
||||
build.
|
||||
|
||||
Below is a description of the currently available video filters.
|
||||
|
||||
@section crop
|
||||
|
||||
Crop the input video to @var{x}:@var{y}:@var{width}:@var{height}.
|
||||
|
||||
@example
|
||||
./ffmpeg -i in.avi -vfilters "crop=0:0:0:240" out.avi
|
||||
@end example
|
||||
|
||||
@var{x} and @var{y} specify the position of the top-left corner of the
|
||||
output (non-cropped) area.
|
||||
|
||||
The default value of @var{x} and @var{y} is 0.
|
||||
|
||||
The @var{width} and @var{height} parameters specify the width and height
|
||||
of the output (non-cropped) area.
|
||||
|
||||
A value of 0 is interpreted as the maximum possible size contained in
|
||||
the area delimited by the top-left corner at position x:y.
|
||||
|
||||
For example the parameters:
|
||||
|
||||
@example
|
||||
"crop=100:100:0:0"
|
||||
@end example
|
||||
|
||||
will delimit the rectangle with the top-left corner placed at position
|
||||
100:100 and the right-bottom corner corresponding to the right-bottom
|
||||
corner of the input image.
|
||||
|
||||
The default value of @var{width} and @var{height} is 0.
|
||||
|
||||
@section format
|
||||
|
||||
Convert the input video to one of the specified pixel formats.
|
||||
Libavfilter will try to pick one that is supported for the input to
|
||||
the next filter.
|
||||
|
||||
The filter accepts a list of pixel format names, separated by ``:'',
|
||||
for example ``yuv420p:monow:rgb24''.
|
||||
|
||||
The following command:
|
||||
|
||||
@example
|
||||
./ffmpeg -i in.avi -vfilters "format=yuv420p" out.avi
|
||||
@end example
|
||||
|
||||
will convert the input video to the format ``yuv420p''.
|
||||
|
||||
@section noformat
|
||||
|
||||
Force libavfilter not to use any of the specified pixel formats for the
|
||||
input to the next filter.
|
||||
|
||||
The filter accepts a list of pixel format names, separated by ``:'',
|
||||
for example ``yuv420p:monow:rgb24''.
|
||||
|
||||
The following command:
|
||||
|
||||
@example
|
||||
./ffmpeg -i in.avi -vfilters "noformat=yuv420p, vflip" out.avi
|
||||
@end example
|
||||
|
||||
will make libavfilter use a format different from ``yuv420p'' for the
|
||||
input to the vflip filter.
|
||||
|
||||
@section null
|
||||
|
||||
Pass the source unchanged to the output.
|
||||
|
||||
@section scale
|
||||
|
||||
Scale the input video to @var{width}:@var{height} and/or convert the image format.
|
||||
|
||||
For example the command:
|
||||
|
||||
@example
|
||||
./ffmpeg -i in.avi -vfilters "scale=200:100" out.avi
|
||||
@end example
|
||||
|
||||
will scale the input video to a size of 200x100.
|
||||
|
||||
If the input image format is different from the format requested by
|
||||
the next filter, the scale filter will convert the input to the
|
||||
requested format.
|
||||
|
||||
If the value for @var{width} or @var{height} is 0, the respective input
|
||||
size is used for the output.
|
||||
|
||||
If the value for @var{width} or @var{height} is -1, the scale filter will
|
||||
use, for the respective output size, a value that maintains the aspect
|
||||
ratio of the input image.
|
||||
|
||||
The default value of @var{width} and @var{height} is 0.
|
||||
|
||||
@section slicify
|
||||
|
||||
Pass the images of input video on to next video filter as multiple
|
||||
slices.
|
||||
|
||||
@example
|
||||
./ffmpeg -i in.avi -vfilters "slicify=32" out.avi
|
||||
@end example
|
||||
|
||||
The filter accepts the slice height as parameter. If the parameter is
|
||||
not specified it will use the default value of 16.
|
||||
|
||||
Adding this in the beginning of filter chains should make filtering
|
||||
faster due to better use of the memory cache.
|
||||
|
||||
@section unsharp
|
||||
|
||||
Sharpen or blur the input video. It accepts the following parameters:
|
||||
|
||||
@multitable @columnfractions .2 .5 .1 .1 .1
|
||||
@headitem Name @tab Description @tab Min @tab Max @tab Default
|
||||
@item @var{luma_msize_x}
|
||||
@tab Luma matrix horizontal size
|
||||
@tab 3
|
||||
@tab 13
|
||||
@tab 5
|
||||
@item @var{luma_msize_y}
|
||||
@tab Luma matrix vertical size
|
||||
@tab 3
|
||||
@tab 13
|
||||
@tab 5
|
||||
@item @var{luma_amount}
|
||||
@tab Luma effect strength
|
||||
@tab -2.0
|
||||
@tab 5.0
|
||||
@tab 1.0
|
||||
@item @var{chroma_msize_x}
|
||||
@tab Chroma matrix horizontal size
|
||||
@tab 3
|
||||
@tab 13
|
||||
@tab 0
|
||||
@item @var{chroma_msize_y}
|
||||
@tab Chroma matrix vertical size
|
||||
@tab 3
|
||||
@tab 13
|
||||
@tab 0
|
||||
@item @var{chroma_amount}
|
||||
@tab Chroma effect strength
|
||||
@tab -2.0
|
||||
@tab 5.0
|
||||
@tab 0.0
|
||||
@end multitable
|
||||
|
||||
Negative values for the amount will blur the input video, while positive
|
||||
values will sharpen. All parameters are optional and default to the
|
||||
equivalent of the string '5:5:1.0:0:0:0.0'.
|
||||
|
||||
@example
|
||||
# Strong luma sharpen effect parameters
|
||||
unsharp=7:7:2.5
|
||||
|
||||
# Strong blur of both luma and chroma parameters
|
||||
unsharp=7:7:-2:7:7:-2
|
||||
|
||||
# Use the default values with @command{ffmpeg}
|
||||
./ffmpeg -i in.avi -vfilters "unsharp" out.mp4
|
||||
@end example
|
||||
|
||||
@section vflip
|
||||
|
||||
Flip the input video vertically.
|
||||
|
||||
@example
|
||||
./ffmpeg -i in.avi -vfilters "vflip" out.avi
|
||||
@end example
|
||||
|
||||
@chapter Available video sources
|
||||
|
||||
Below is a description of the currently available video sources.
|
||||
|
||||
@section nullsrc
|
||||
|
||||
Null video source, never return images. It is mainly useful as a
|
||||
template and to be employed in analysis / debugging tools.
|
||||
|
||||
It accepts as optional parameter a string of the form
|
||||
@var{width}:@var{height}, where @var{width} and @var{height} specify the size of
|
||||
the configured source.
|
||||
|
||||
The default values of @var{width} and @var{height} are respectively 352
|
||||
and 288 (corresponding to the CIF size format).
|
||||
|
||||
@chapter Available video sinks
|
||||
|
||||
Below is a description of the currently available video sinks.
|
||||
|
||||
@section nullsink
|
||||
|
||||
Null video sink, do absolutely nothing with the input video. It is
|
||||
mainly useful as a template and to be employed in analysis / debugging
|
||||
tools.
|
||||
|
||||
@bye
|
@@ -1,61 +0,0 @@
|
||||
A Quick Description Of Rate Distortion Theory.
|
||||
|
||||
We want to encode a video, picture or piece of music optimally. What does
|
||||
"optimally" really mean? It means that we want to get the best quality at a
|
||||
given filesize OR we want to get the smallest filesize at a given quality
|
||||
(in practice, these 2 goals are usually the same).
|
||||
|
||||
Solving this directly is not practical; trying all byte sequences 1
|
||||
megabyte in length and selecting the "best looking" sequence will yield
|
||||
256^1000000 cases to try.
|
||||
|
||||
But first, a word about quality, which is also called distortion.
|
||||
Distortion can be quantified by almost any quality measurement one chooses.
|
||||
Commonly, the sum of squared differences is used but more complex methods
|
||||
that consider psychovisual effects can be used as well. It makes no
|
||||
difference in this discussion.
|
||||
|
||||
|
||||
First step: that rate distortion factor called lambda...
|
||||
Let's consider the problem of minimizing:
|
||||
|
||||
distortion + lambda*rate
|
||||
|
||||
rate is the filesize
|
||||
distortion is the quality
|
||||
lambda is a fixed value choosen as a tradeoff between quality and filesize
|
||||
Is this equivalent to finding the best quality for a given max
|
||||
filesize? The answer is yes. For each filesize limit there is some lambda
|
||||
factor for which minimizing above will get you the best quality (using your
|
||||
chosen quality measurement) at the desired (or lower) filesize.
|
||||
|
||||
|
||||
Second step: splitting the problem.
|
||||
Directly splitting the problem of finding the best quality at a given
|
||||
filesize is hard because we do not know how many bits from the total
|
||||
filesize should be allocated to each of the subproblems. But the formula
|
||||
from above:
|
||||
|
||||
distortion + lambda*rate
|
||||
|
||||
can be trivially split. Consider:
|
||||
|
||||
(distortion0 + distortion1) + lambda*(rate0 + rate1)
|
||||
|
||||
This creates a problem made of 2 independent subproblems. The subproblems
|
||||
might be 2 16x16 macroblocks in a frame of 32x16 size. To minimize:
|
||||
|
||||
(distortion0 + distortion1) + lambda*(rate0 + rate1)
|
||||
|
||||
we just have to minimize:
|
||||
|
||||
distortion0 + lambda*rate0
|
||||
|
||||
and
|
||||
|
||||
distortion1 + lambda*rate1
|
||||
|
||||
I.e, the 2 problems can be solved independently.
|
||||
|
||||
Author: Michael Niedermayer
|
||||
Copyright: LGPL
|
@@ -30,7 +30,7 @@ slices, that is, consecutive non-overlapping rectangles of dimension
|
||||
|
||||
special converter
|
||||
These generally are unscaled converters of common
|
||||
formats, like YUV 4:2:0/4:2:2 -> RGB12/15/16/24/32. Though it could also
|
||||
formats, like YUV 4:2:0/4:2:2 -> RGB15/16/24/32. Though it could also
|
||||
in principle contain scalers optimized for specific common cases.
|
||||
|
||||
Main path
|
||||
|
@@ -1,64 +0,0 @@
|
||||
Writing a table generator
|
||||
|
||||
This documentation is preliminary.
|
||||
Parts of the API are not good and should be changed.
|
||||
|
||||
Basic concepts
|
||||
|
||||
A table generator consists of two files, *_tablegen.c and *_tablegen.h.
|
||||
The .h file will provide the variable declarations and initialization
|
||||
code for the tables, the .c calls the initialization code and then prints
|
||||
the tables as a header file using the tableprint.h helpers.
|
||||
Both of these files will be compiled for the host system, so to avoid
|
||||
breakage with cross-compilation neither of them may include, directly
|
||||
or indirectly, config.h or avconfig.h.
|
||||
Due to this, the .c file or Makefile may have to provide additional defines
|
||||
or stubs, though if possible this should be avoided.
|
||||
In particular, CONFIG_HARDCODED_TABLES should always be defined to 0.
|
||||
|
||||
The .c file
|
||||
|
||||
This file should include the *_tablegen.h and tableprint.h files and
|
||||
anything else it needs as long as it does not depend on config.h or
|
||||
avconfig.h.
|
||||
In addition to that it must contain a main() function which initializes
|
||||
all tables by calling the init functions from the .h file and then prints
|
||||
them.
|
||||
The printing code typically looks like this:
|
||||
write_fileheader();
|
||||
printf("static const uint8_t my_array[100] = {\n");
|
||||
write_uint8_array(my_array, 100);
|
||||
printf("};\n");
|
||||
|
||||
write_fileheader() adds some minor things like a "this is a generated file"
|
||||
comment and some standard includes.
|
||||
tablegen.h defines some write functions for one- and two-dimensional arrays
|
||||
for standard types - they print only the "core" parts so they are easier
|
||||
to reuse for multi-dimensional arrays so the outermost {} must be printed
|
||||
separately.
|
||||
If there's no standard function for printing the type you need, the
|
||||
WRITE_1D_FUNC_ARGV macro is a very quick way to create one.
|
||||
See libavcodec/dv_tablegen.c for an example.
|
||||
|
||||
|
||||
The .h file
|
||||
|
||||
This file should contain:
|
||||
- one or more initialization functions
|
||||
- the table variable declarations
|
||||
If CONFIG_HARDCODED_TABLES is set, the initialization functions should
|
||||
not do anything, and instead of the variable declarations the
|
||||
generated *_tables.h file should be included.
|
||||
Since that will be generated in the build directory, the path must be
|
||||
included, i.e.
|
||||
#include "libavcodec/example_tables.h"
|
||||
not
|
||||
#include "example_tables.h"
|
||||
|
||||
Makefile changes
|
||||
|
||||
To make the automatic table creation work, you must manually declare the
|
||||
new dependency.
|
||||
For this add a line similar to this:
|
||||
$(SUBDIR)example.o: $(SUBDIR)example_tables.h
|
||||
under the "ifdef CONFIG_HARDCODED_TABLES" section in the Makefile.
|
110
doc/viterbi.txt
110
doc/viterbi.txt
@@ -1,110 +0,0 @@
|
||||
This is a quick description of the viterbi aka dynamic programing
|
||||
algorthm.
|
||||
|
||||
Its reason for existence is that wikipedia has become very poor on
|
||||
describing algorithms in a way that makes it useable for understanding
|
||||
them or anything else actually. It tends now to describe the very same
|
||||
algorithm under 50 different names and pages with few understandable
|
||||
by even people who fully understand the algorithm and the theory behind.
|
||||
|
||||
Problem description: (that is what it can solve)
|
||||
assume we have a 2d table, or you could call it a graph or matrix if you
|
||||
prefer
|
||||
|
||||
O O O O O O O
|
||||
|
||||
O O O O O O O
|
||||
|
||||
O O O O O O O
|
||||
|
||||
O O O O O O O
|
||||
|
||||
|
||||
That table has edges connecting points from each column to the next column
|
||||
and each edge has a score like: (only some edge and scores shown to keep it
|
||||
readable)
|
||||
|
||||
|
||||
O--5--O-----O-----O-----O-----O
|
||||
2 / 7 / \ / \ / \ /
|
||||
\ / \ / \ / \ / \ /
|
||||
O7-/--O--/--O--/--O--/--O--/--O
|
||||
\/ \/ 1/ \/ \/ \/ \/ \/ \/ \/
|
||||
/\ /\ 2\ /\ /\ /\ /\ /\ /\ /\
|
||||
O3-/--O--/--O--/--O--/--O--/--O
|
||||
/ \ / \ / \ / \ / \
|
||||
1 \ 9 \ / \ / \ / \
|
||||
O--2--O--1--O--5--O--3--O--8--O
|
||||
|
||||
|
||||
|
||||
Our goal is to find a path from left to right through it which
|
||||
minimizes the sum of the score of all edges.
|
||||
(and of course left/right is just a convention here it could be top down too)
|
||||
Similarly the minimum could be the maximum by just fliping the sign,
|
||||
Example of a path with scores:
|
||||
|
||||
O O O O O O O
|
||||
|
||||
>---O. O O .O-2-O O O
|
||||
5. .7 .
|
||||
O O-1-O O O 8 O O
|
||||
.
|
||||
O O O O O O-1-O---> (sum here is 24)
|
||||
|
||||
|
||||
The viterbi algorthm now solves this simply column by column
|
||||
For the previous column each point has a best path and a associated
|
||||
score:
|
||||
|
||||
O-----5 O
|
||||
\
|
||||
\
|
||||
O \ 1 O
|
||||
\/
|
||||
/\
|
||||
O / 2 O
|
||||
/
|
||||
/
|
||||
O-----2 O
|
||||
|
||||
|
||||
To move one column forward we just need to find the best path and associated
|
||||
scores for the next column
|
||||
here are some edges we could choose from:
|
||||
|
||||
|
||||
O-----5--3--O
|
||||
\ \8
|
||||
\ \
|
||||
O \ 1--9--O
|
||||
\/ \3
|
||||
/\ \
|
||||
O / 2--1--O
|
||||
/ \2
|
||||
/ \
|
||||
O-----2--4--O
|
||||
|
||||
Finding the new best pathes and scores for each point of our new column is
|
||||
trivial given we know the previous column best pathes and scores:
|
||||
|
||||
O-----0-----8
|
||||
\
|
||||
\
|
||||
O \ 0----10
|
||||
\/
|
||||
/\
|
||||
O / 0-----3
|
||||
/ \
|
||||
/ \
|
||||
O 0 4
|
||||
|
||||
|
||||
the viterbi algorthm continues exactly like this column for column until the
|
||||
end and then just picks the path with the best score (above that would be the
|
||||
one with score 3)
|
||||
|
||||
|
||||
Author: Michael niedermayer
|
||||
Copyright LGPL
|
||||
|
@@ -1,4 +1,4 @@
|
||||
coder=0
|
||||
bf=0
|
||||
flags2=-wpred-dct8x8
|
||||
flags2=-wpred-dct8x8+mbtree
|
||||
wpredp=0
|
||||
|
@@ -18,5 +18,5 @@ bf=3
|
||||
refs=3
|
||||
directpred=1
|
||||
trellis=1
|
||||
flags2=+mixed_refs+wpred+dct8x8+fastpskip
|
||||
flags2=+mixed_refs+wpred+dct8x8+fastpskip+mbtree
|
||||
wpredp=2
|
||||
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
|
||||
me_method=hex
|
||||
subq=6
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=2
|
||||
directpred=1
|
||||
trellis=1
|
||||
flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=30
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=2
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=30
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
|
||||
me_method=hex
|
||||
subq=4
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=2
|
||||
directpred=1
|
||||
trellis=1
|
||||
flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip
|
||||
wpredp=1
|
||||
rc_lookahead=20
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=2
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
|
||||
wpredp=1
|
||||
rc_lookahead=20
|
@@ -18,5 +18,5 @@ bf=3
|
||||
refs=1
|
||||
directpred=3
|
||||
trellis=0
|
||||
flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip
|
||||
flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip+mbtree
|
||||
wpredp=2
|
||||
|
@@ -18,5 +18,5 @@ bf=3
|
||||
refs=4
|
||||
directpred=3
|
||||
trellis=1
|
||||
flags2=+wpred+mixed_refs+dct8x8+fastpskip
|
||||
flags2=+wpred+mixed_refs+dct8x8+fastpskip+mbtree
|
||||
wpredp=2
|
||||
|
@@ -1,6 +1,6 @@
|
||||
coder=0
|
||||
bf=0
|
||||
flags2=-wpred-dct8x8
|
||||
flags2=-wpred-dct8x8+mbtree
|
||||
level=13
|
||||
maxrate=768000
|
||||
bufsize=3000000
|
||||
|
@@ -1,7 +1,7 @@
|
||||
coder=0
|
||||
bf=0
|
||||
refs=1
|
||||
flags2=-wpred-dct8x8
|
||||
flags2=-wpred-dct8x8+mbtree
|
||||
level=30
|
||||
maxrate=10000000
|
||||
bufsize=10000000
|
||||
|
@@ -15,6 +15,6 @@ qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
directpred=1
|
||||
flags2=+fastpskip
|
||||
flags2=+fastpskip+mbtree
|
||||
cqp=0
|
||||
wpredp=0
|
||||
|
@@ -16,6 +16,6 @@ qmax=51
|
||||
qdiff=4
|
||||
refs=16
|
||||
directpred=1
|
||||
flags2=+mixed_refs+dct8x8+fastpskip
|
||||
flags2=+mixed_refs+dct8x8+fastpskip+mbtree
|
||||
cqp=0
|
||||
wpredp=2
|
||||
|
@@ -15,6 +15,6 @@ qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
directpred=1
|
||||
flags2=+fastpskip
|
||||
flags2=+fastpskip+mbtree
|
||||
cqp=0
|
||||
wpredp=2
|
||||
|
@@ -16,6 +16,6 @@ qmax=51
|
||||
qdiff=4
|
||||
refs=2
|
||||
directpred=1
|
||||
flags2=+dct8x8+fastpskip
|
||||
flags2=+dct8x8+fastpskip+mbtree
|
||||
cqp=0
|
||||
wpredp=2
|
||||
|
@@ -16,6 +16,6 @@ qmax=51
|
||||
qdiff=4
|
||||
refs=4
|
||||
directpred=1
|
||||
flags2=+mixed_refs+dct8x8+fastpskip
|
||||
flags2=+mixed_refs+dct8x8+fastpskip+mbtree
|
||||
cqp=0
|
||||
wpredp=2
|
||||
|
@@ -15,5 +15,5 @@ qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
directpred=1
|
||||
flags2=+fastpskip
|
||||
flags2=+fastpskip+mbtree
|
||||
cqp=0
|
||||
|
@@ -1 +1 @@
|
||||
flags2=-dct8x8
|
||||
flags2=-dct8x8+mbtree
|
||||
|
@@ -18,5 +18,5 @@ bf=3
|
||||
refs=16
|
||||
directpred=3
|
||||
trellis=2
|
||||
flags2=+wpred+mixed_refs+dct8x8-fastpskip
|
||||
flags2=+wpred+mixed_refs+dct8x8-fastpskip+mbtree
|
||||
wpredp=2
|
||||
|
@@ -1,22 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
|
||||
me_method=hex
|
||||
subq=7
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=3
|
||||
directpred=1
|
||||
trellis=1
|
||||
flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
|
||||
wpredp=2
|
@@ -1,22 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=2
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
|
||||
wpredp=2
|
@@ -18,5 +18,5 @@ bf=3
|
||||
refs=2
|
||||
directpred=3
|
||||
trellis=0
|
||||
flags2=+wpred+dct8x8+fastpskip
|
||||
flags2=+wpred+dct8x8+fastpskip+mbtree
|
||||
wpredp=2
|
||||
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
|
||||
me_method=tesa
|
||||
subq=10
|
||||
me_range=24
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=2
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=16
|
||||
refs=16
|
||||
directpred=3
|
||||
trellis=2
|
||||
flags2=+bpyramid+mixed_refs+wpred+dct8x8-fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=60
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
|
||||
me_method=tesa
|
||||
subq=10
|
||||
me_range=24
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=2
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=16
|
||||
refs=16
|
||||
directpred=3
|
||||
trellis=2
|
||||
flags2=+bpyramid+mixed_refs+wpred+dct8x8-fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=60
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
|
||||
me_method=umh
|
||||
subq=8
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=2
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=5
|
||||
directpred=3
|
||||
trellis=1
|
||||
flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=50
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=2
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=2
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=3
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=50
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
|
||||
me_method=umh
|
||||
subq=9
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=2
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=8
|
||||
directpred=3
|
||||
trellis=2
|
||||
flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=60
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=2
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=2
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=3
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=60
|
@@ -18,5 +18,5 @@ bf=3
|
||||
refs=1
|
||||
directpred=3
|
||||
trellis=0
|
||||
flags2=+wpred+dct8x8+fastpskip
|
||||
flags2=+wpred+dct8x8+fastpskip+mbtree
|
||||
wpredp=2
|
||||
|
@@ -1,22 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=1
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip-mbtree
|
||||
wpredp=0
|
@@ -1,22 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=1
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip-mbtree
|
||||
wpredp=0
|
@@ -1,23 +0,0 @@
|
||||
coder=0
|
||||
flags=-loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=0
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=0
|
||||
i_qfactor=0.71
|
||||
b_strategy=0
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=0
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=-bpyramid-mixed_refs-wpred-dct8x8+fastpskip-mbtree
|
||||
wpredp=0
|
||||
aq_mode=0
|
@@ -1,23 +0,0 @@
|
||||
coder=0
|
||||
flags=-loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=0
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=0
|
||||
i_qfactor=0.71
|
||||
b_strategy=0
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=0
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=-bpyramid-mixed_refs-wpred-dct8x8+fastpskip-mbtree
|
||||
wpredp=0
|
||||
aq_mode=0
|
@@ -1,22 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
|
||||
me_method=hex
|
||||
subq=2
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip-mbtree
|
||||
wpredp=0
|
@@ -1,22 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=2
|
||||
me_range=16
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=1
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=3
|
||||
refs=1
|
||||
directpred=1
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip-mbtree
|
||||
wpredp=0
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8
|
||||
me_method=umh
|
||||
subq=10
|
||||
me_range=24
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=2
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=8
|
||||
refs=16
|
||||
directpred=3
|
||||
trellis=2
|
||||
flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=60
|
@@ -1,23 +0,0 @@
|
||||
coder=1
|
||||
flags=+loop
|
||||
cmp=+chroma
|
||||
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
|
||||
me_method=dia
|
||||
subq=2
|
||||
me_range=24
|
||||
g=250
|
||||
keyint_min=25
|
||||
sc_threshold=40
|
||||
i_qfactor=0.71
|
||||
b_strategy=2
|
||||
qcomp=0.6
|
||||
qmin=10
|
||||
qmax=51
|
||||
qdiff=4
|
||||
bf=8
|
||||
refs=1
|
||||
directpred=3
|
||||
trellis=0
|
||||
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
|
||||
wpredp=2
|
||||
rc_lookahead=60
|
367
ffprobe.c
367
ffprobe.c
@@ -1,367 +0,0 @@
|
||||
/*
|
||||
* FFprobe : Simple Media Prober based on the FFmpeg libraries
|
||||
* Copyright (c) 2007-2010 Stefano Sabatini
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/opt.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavdevice/avdevice.h"
|
||||
#include "cmdutils.h"
|
||||
|
||||
const char program_name[] = "FFprobe";
|
||||
const int program_birth_year = 2007;
|
||||
|
||||
static int do_show_format = 0;
|
||||
static int do_show_streams = 0;
|
||||
|
||||
static int convert_tags = 0;
|
||||
static int show_value_unit = 0;
|
||||
static int use_value_prefix = 0;
|
||||
static int use_byte_value_binary_prefix = 0;
|
||||
static int use_value_sexagesimal_format = 0;
|
||||
|
||||
/* globals */
|
||||
static const OptionDef options[];
|
||||
|
||||
/* FFprobe context */
|
||||
static const char *input_filename;
|
||||
static AVInputFormat *iformat = NULL;
|
||||
|
||||
static const char *binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
|
||||
static const char *decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P" };
|
||||
|
||||
static const char *unit_second_str = "s" ;
|
||||
static const char *unit_hertz_str = "Hz" ;
|
||||
static const char *unit_byte_str = "byte" ;
|
||||
static const char *unit_bit_per_second_str = "bit/s";
|
||||
|
||||
static char *value_string(char *buf, int buf_size, double val, const char *unit)
|
||||
{
|
||||
if (unit == unit_second_str && use_value_sexagesimal_format) {
|
||||
double secs;
|
||||
int hours, mins;
|
||||
secs = val;
|
||||
mins = (int)secs / 60;
|
||||
secs = secs - mins * 60;
|
||||
hours = mins / 60;
|
||||
mins %= 60;
|
||||
snprintf(buf, buf_size, "%d:%02d:%09.6f", hours, mins, secs);
|
||||
} else if (use_value_prefix) {
|
||||
const char *prefix_string;
|
||||
int index;
|
||||
|
||||
if (unit == unit_byte_str && use_byte_value_binary_prefix) {
|
||||
index = (int) (log(val)/log(2)) / 10;
|
||||
index = av_clip(index, 0, FF_ARRAY_ELEMS(binary_unit_prefixes) -1);
|
||||
val /= pow(2, index*10);
|
||||
prefix_string = binary_unit_prefixes[index];
|
||||
} else {
|
||||
index = (int) (log10(val)) / 3;
|
||||
index = av_clip(index, 0, FF_ARRAY_ELEMS(decimal_unit_prefixes) -1);
|
||||
val /= pow(10, index*3);
|
||||
prefix_string = decimal_unit_prefixes[index];
|
||||
}
|
||||
|
||||
snprintf(buf, buf_size, "%.3f %s%s", val, prefix_string, show_value_unit ? unit : "");
|
||||
} else {
|
||||
snprintf(buf, buf_size, "%f %s", val, show_value_unit ? unit : "");
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static char *time_value_string(char *buf, int buf_size, int64_t val, const AVRational *time_base)
|
||||
{
|
||||
if (val == AV_NOPTS_VALUE) {
|
||||
snprintf(buf, buf_size, "N/A");
|
||||
} else {
|
||||
value_string(buf, buf_size, val * av_q2d(*time_base), unit_second_str);
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static const char *media_type_string(enum AVMediaType media_type)
|
||||
{
|
||||
switch (media_type) {
|
||||
case AVMEDIA_TYPE_VIDEO: return "video";
|
||||
case AVMEDIA_TYPE_AUDIO: return "audio";
|
||||
case AVMEDIA_TYPE_DATA: return "data";
|
||||
case AVMEDIA_TYPE_SUBTITLE: return "subtitle";
|
||||
case AVMEDIA_TYPE_ATTACHMENT: return "attachment";
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
|
||||
{
|
||||
AVStream *stream = fmt_ctx->streams[stream_idx];
|
||||
AVCodecContext *dec_ctx;
|
||||
AVCodec *dec;
|
||||
char val_str[128];
|
||||
AVMetadataTag *tag = NULL;
|
||||
char a, b, c, d;
|
||||
AVRational display_aspect_ratio;
|
||||
|
||||
printf("[STREAM]\n");
|
||||
|
||||
printf("index=%d\n", stream->index);
|
||||
|
||||
if ((dec_ctx = stream->codec)) {
|
||||
if ((dec = dec_ctx->codec)) {
|
||||
printf("codec_name=%s\n", dec->name);
|
||||
printf("codec_long_name=%s\n", dec->long_name);
|
||||
} else {
|
||||
printf("codec_name=unknown\n");
|
||||
}
|
||||
|
||||
printf("codec_type=%s\n", media_type_string(dec_ctx->codec_type));
|
||||
printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den);
|
||||
|
||||
/* print AVI/FourCC tag */
|
||||
a = dec_ctx->codec_tag & 0xff;
|
||||
b = dec_ctx->codec_tag>>8 & 0xff;
|
||||
c = dec_ctx->codec_tag>>16 & 0xff;
|
||||
d = dec_ctx->codec_tag>>24 & 0xff;
|
||||
printf("codec_tag_string=");
|
||||
if (isprint(a)) printf("%c", a); else printf("[%d]", a);
|
||||
if (isprint(b)) printf("%c", b); else printf("[%d]", b);
|
||||
if (isprint(c)) printf("%c", c); else printf("[%d]", c);
|
||||
if (isprint(d)) printf("%c", d); else printf("[%d]", d);
|
||||
printf("\ncodec_tag=0x%04x\n", dec_ctx->codec_tag);
|
||||
|
||||
switch (dec_ctx->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
printf("width=%d\n", dec_ctx->width);
|
||||
printf("height=%d\n", dec_ctx->height);
|
||||
printf("has_b_frames=%d\n", dec_ctx->has_b_frames);
|
||||
if (dec_ctx->sample_aspect_ratio.num) {
|
||||
printf("sample_aspect_ratio=%d:%d\n", dec_ctx->sample_aspect_ratio.num,
|
||||
dec_ctx->sample_aspect_ratio.den);
|
||||
av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
|
||||
dec_ctx->width * dec_ctx->sample_aspect_ratio.num,
|
||||
dec_ctx->height * dec_ctx->sample_aspect_ratio.den,
|
||||
1024*1024);
|
||||
printf("display_aspect_ratio=%d:%d\n", display_aspect_ratio.num,
|
||||
display_aspect_ratio.den);
|
||||
}
|
||||
printf("pix_fmt=%s\n", dec_ctx->pix_fmt != PIX_FMT_NONE ?
|
||||
av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
printf("sample_rate=%s\n", value_string(val_str, sizeof(val_str),
|
||||
dec_ctx->sample_rate,
|
||||
unit_hertz_str));
|
||||
printf("channels=%d\n", dec_ctx->channels);
|
||||
printf("bits_per_sample=%d\n", av_get_bits_per_sample(dec_ctx->codec_id));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
printf("codec_type=unknown\n");
|
||||
}
|
||||
|
||||
if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS)
|
||||
printf("id=0x%x\n", stream->id);
|
||||
printf("r_frame_rate=%d/%d\n", stream->r_frame_rate.num, stream->r_frame_rate.den);
|
||||
printf("avg_frame_rate=%d/%d\n", stream->avg_frame_rate.num, stream->avg_frame_rate.den);
|
||||
printf("time_base=%d/%d\n", stream->time_base.num, stream->time_base.den);
|
||||
if (stream->language[0])
|
||||
printf("language=%s\n", stream->language);
|
||||
printf("start_time=%s\n", time_value_string(val_str, sizeof(val_str), stream->start_time,
|
||||
&stream->time_base));
|
||||
printf("duration=%s\n", time_value_string(val_str, sizeof(val_str), stream->duration,
|
||||
&stream->time_base));
|
||||
if (stream->nb_frames)
|
||||
printf("nb_frames=%"PRId64"\n", stream->nb_frames);
|
||||
|
||||
while ((tag = av_metadata_get(stream->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX)))
|
||||
printf("TAG:%s=%s\n", tag->key, tag->value);
|
||||
|
||||
printf("[/STREAM]\n");
|
||||
}
|
||||
|
||||
static void show_format(AVFormatContext *fmt_ctx)
|
||||
{
|
||||
AVMetadataTag *tag = NULL;
|
||||
char val_str[128];
|
||||
|
||||
printf("[FORMAT]\n");
|
||||
|
||||
printf("filename=%s\n", fmt_ctx->filename);
|
||||
printf("nb_streams=%d\n", fmt_ctx->nb_streams);
|
||||
printf("format_name=%s\n", fmt_ctx->iformat->name);
|
||||
printf("format_long_name=%s\n", fmt_ctx->iformat->long_name);
|
||||
printf("start_time=%s\n", time_value_string(val_str, sizeof(val_str), fmt_ctx->start_time,
|
||||
&AV_TIME_BASE_Q));
|
||||
printf("duration=%s\n", time_value_string(val_str, sizeof(val_str), fmt_ctx->duration,
|
||||
&AV_TIME_BASE_Q));
|
||||
printf("size=%s\n", value_string(val_str, sizeof(val_str), fmt_ctx->file_size,
|
||||
unit_byte_str));
|
||||
printf("bit_rate=%s\n", value_string(val_str, sizeof(val_str), fmt_ctx->bit_rate,
|
||||
unit_bit_per_second_str));
|
||||
|
||||
if (convert_tags)
|
||||
av_metadata_conv(fmt_ctx, NULL, fmt_ctx->iformat->metadata_conv);
|
||||
while ((tag = av_metadata_get(fmt_ctx->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX)))
|
||||
printf("TAG:%s=%s\n", tag->key, tag->value);
|
||||
|
||||
printf("[/FORMAT]\n");
|
||||
}
|
||||
|
||||
static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
|
||||
{
|
||||
int err, i;
|
||||
AVFormatContext *fmt_ctx;
|
||||
|
||||
fmt_ctx = avformat_alloc_context();
|
||||
|
||||
if ((err = av_open_input_file(&fmt_ctx, filename, iformat, 0, NULL)) < 0) {
|
||||
print_error(filename, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* fill the streams in the format context */
|
||||
if ((err = av_find_stream_info(fmt_ctx)) < 0) {
|
||||
print_error(filename, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
dump_format(fmt_ctx, 0, filename, 0);
|
||||
|
||||
/* bind a decoder to each input stream */
|
||||
for (i = 0; i < fmt_ctx->nb_streams; i++) {
|
||||
AVStream *stream = fmt_ctx->streams[i];
|
||||
AVCodec *codec;
|
||||
|
||||
if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
|
||||
fprintf(stderr, "Unsupported codec (id=%d) for input stream %d\n",
|
||||
stream->codec->codec_id, stream->index);
|
||||
} else if (avcodec_open(stream->codec, codec) < 0) {
|
||||
fprintf(stderr, "Error while opening codec for input stream %d\n",
|
||||
stream->index);
|
||||
}
|
||||
}
|
||||
|
||||
*fmt_ctx_ptr = fmt_ctx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int probe_file(const char *filename)
|
||||
{
|
||||
AVFormatContext *fmt_ctx;
|
||||
int ret, i;
|
||||
|
||||
if ((ret = open_input_file(&fmt_ctx, filename)))
|
||||
return ret;
|
||||
|
||||
if (do_show_streams)
|
||||
for (i = 0; i < fmt_ctx->nb_streams; i++)
|
||||
show_stream(fmt_ctx, i);
|
||||
|
||||
if (do_show_format)
|
||||
show_format(fmt_ctx);
|
||||
|
||||
av_close_input_file(fmt_ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void show_usage(void)
|
||||
{
|
||||
printf("Simple multimedia streams analyzer\n");
|
||||
printf("usage: ffprobe [OPTIONS] [INPUT_FILE]\n");
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void opt_format(const char *arg)
|
||||
{
|
||||
iformat = av_find_input_format(arg);
|
||||
if (!iformat) {
|
||||
fprintf(stderr, "Unknown input format: %s\n", arg);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
static void opt_input_file(const char *arg)
|
||||
{
|
||||
if (input_filename) {
|
||||
fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n",
|
||||
arg, input_filename);
|
||||
exit(1);
|
||||
}
|
||||
if (!strcmp(arg, "-"))
|
||||
arg = "pipe:";
|
||||
input_filename = arg;
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
{
|
||||
show_usage();
|
||||
show_help_options(options, "Main options:\n", 0, 0);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void opt_pretty(void)
|
||||
{
|
||||
show_value_unit = 1;
|
||||
use_value_prefix = 1;
|
||||
use_byte_value_binary_prefix = 1;
|
||||
use_value_sexagesimal_format = 1;
|
||||
}
|
||||
|
||||
static const OptionDef options[] = {
|
||||
#include "cmdutils_common_opts.h"
|
||||
{ "convert_tags", OPT_BOOL, {(void*)&convert_tags}, "convert tag names to the FFmpeg generic tag names" },
|
||||
{ "f", HAS_ARG, {(void*)opt_format}, "force format", "format" },
|
||||
{ "unit", OPT_BOOL, {(void*)&show_value_unit}, "show unit of the displayed values" },
|
||||
{ "prefix", OPT_BOOL, {(void*)&use_value_prefix}, "use SI prefixes for the displayed values" },
|
||||
{ "byte_binary_prefix", OPT_BOOL, {(void*)&use_byte_value_binary_prefix},
|
||||
"use binary prefixes for byte units" },
|
||||
{ "sexagesimal", OPT_BOOL, {(void*)&use_value_sexagesimal_format},
|
||||
"use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
|
||||
{ "pretty", 0, {(void*)&opt_pretty},
|
||||
"prettify the format of displayed values, make it more human readable" },
|
||||
{ "show_format", OPT_BOOL, {(void*)&do_show_format} , "show format/container info" },
|
||||
{ "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" },
|
||||
{ NULL, },
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
av_register_all();
|
||||
#if CONFIG_AVDEVICE
|
||||
avdevice_register_all();
|
||||
#endif
|
||||
|
||||
show_banner();
|
||||
parse_options(argc, argv, options, opt_input_file);
|
||||
|
||||
if (!input_filename) {
|
||||
show_usage();
|
||||
fprintf(stderr, "You have to specify one input file.\n");
|
||||
fprintf(stderr, "Use -h to get full help or, even better, run 'man ffprobe'.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return probe_file(input_filename);
|
||||
}
|
870
ffserver.c
870
ffserver.c
File diff suppressed because it is too large
Load Diff
@@ -20,14 +20,14 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/4xm.c
|
||||
* 4XM codec.
|
||||
*/
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "get_bits.h"
|
||||
#include "bitstream.h"
|
||||
#include "bytestream.h"
|
||||
|
||||
//#undef NDEBUG
|
||||
@@ -133,12 +133,14 @@ typedef struct FourXContext{
|
||||
GetBitContext pre_gb; ///< ac/dc prefix
|
||||
GetBitContext gb;
|
||||
const uint8_t *bytestream;
|
||||
const uint8_t *bytestream_end;
|
||||
const uint16_t *wordstream;
|
||||
const uint16_t *wordstream_end;
|
||||
int mv[256];
|
||||
VLC pre_vlc;
|
||||
int last_dc;
|
||||
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
|
||||
void *bitstream_buffer;
|
||||
DECLARE_ALIGNED_8(DCTELEM, block[6][64]);
|
||||
uint8_t *bitstream_buffer;
|
||||
unsigned int bitstream_buffer_size;
|
||||
int version;
|
||||
CFrameBuffer cfrm[CFRAME_BUFFER_COUNT];
|
||||
@@ -237,15 +239,12 @@ static void idct(DCTELEM block[64]){
|
||||
}
|
||||
|
||||
static av_cold void init_vlcs(FourXContext *f){
|
||||
static VLC_TYPE table[8][32][2];
|
||||
int i;
|
||||
|
||||
for(i=0; i<8; i++){
|
||||
block_type_vlc[0][i].table= table[i];
|
||||
block_type_vlc[0][i].table_allocated= 32;
|
||||
init_vlc(&block_type_vlc[0][i], BLOCK_TYPE_VLC_BITS, 7,
|
||||
&block_type_tab[0][i][0][1], 2, 1,
|
||||
&block_type_tab[0][i][0][0], 2, 1, INIT_VLC_USE_NEW_STATIC);
|
||||
&block_type_tab[0][i][0][0], 2, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,6 +310,8 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
|
||||
assert(code>=0 && code<=6);
|
||||
|
||||
if(code == 0){
|
||||
if (f->bytestream_end - f->bytestream < 1)
|
||||
return;
|
||||
src += f->mv[ *f->bytestream++ ];
|
||||
if(start > src || src > end){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||
@@ -328,15 +329,23 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
|
||||
}else if(code == 3 && f->version<2){
|
||||
mcdc(dst, src, log2w, h, stride, 1, 0);
|
||||
}else if(code == 4){
|
||||
if (f->bytestream_end - f->bytestream < 1)
|
||||
return;
|
||||
src += f->mv[ *f->bytestream++ ];
|
||||
if(start > src || src > end){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
|
||||
return;
|
||||
}
|
||||
if (f->wordstream_end - f->wordstream < 1)
|
||||
return;
|
||||
mcdc(dst, src, log2w, h, stride, 1, le2me_16(*f->wordstream++));
|
||||
}else if(code == 5){
|
||||
if (f->wordstream_end - f->wordstream < 1)
|
||||
return;
|
||||
mcdc(dst, src, log2w, h, stride, 0, le2me_16(*f->wordstream++));
|
||||
}else if(code == 6){
|
||||
if (f->wordstream_end - f->wordstream < 2)
|
||||
return;
|
||||
if(log2w){
|
||||
dst[0] = le2me_16(*f->wordstream++);
|
||||
dst[1] = le2me_16(*f->wordstream++);
|
||||
@@ -358,6 +367,8 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
|
||||
|
||||
if(f->version>1){
|
||||
extra=20;
|
||||
if (length < extra)
|
||||
return -1;
|
||||
bitstream_size= AV_RL32(buf+8);
|
||||
wordstream_size= AV_RL32(buf+12);
|
||||
bytestream_size= AV_RL32(buf+16);
|
||||
@@ -368,24 +379,23 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
|
||||
bytestream_size= FFMAX(length - bitstream_size - wordstream_size, 0);
|
||||
}
|
||||
|
||||
if(bitstream_size+ bytestream_size+ wordstream_size + extra != length
|
||||
|| bitstream_size > (1<<26)
|
||||
|| bytestream_size > (1<<26)
|
||||
|| wordstream_size > (1<<26)
|
||||
){
|
||||
if (bitstream_size > length ||
|
||||
bytestream_size > length - bitstream_size ||
|
||||
wordstream_size > length - bytestream_size - bitstream_size ||
|
||||
extra > length - bytestream_size - bitstream_size - wordstream_size){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
|
||||
bitstream_size+ bytestream_size+ wordstream_size - length);
|
||||
return -1;
|
||||
}
|
||||
|
||||
av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size, bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!f->bitstream_buffer)
|
||||
return AVERROR(ENOMEM);
|
||||
f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra), bitstream_size/4);
|
||||
f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
f->dsp.bswap_buf((uint32_t*)f->bitstream_buffer, (const uint32_t*)(buf + extra), bitstream_size/4);
|
||||
init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
|
||||
|
||||
f->wordstream= (const uint16_t*)(buf + extra + bitstream_size);
|
||||
f->wordstream_end= f->wordstream + wordstream_size/2;
|
||||
f->bytestream= buf + extra + bitstream_size + wordstream_size;
|
||||
f->bytestream_end = f->bytestream + bytestream_size;
|
||||
|
||||
init_mv(f);
|
||||
|
||||
@@ -514,7 +524,7 @@ static int decode_i_mb(FourXContext *f){
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf){
|
||||
static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf, int buf_size){
|
||||
int frequency[512];
|
||||
uint8_t flag[512];
|
||||
int up[512];
|
||||
@@ -522,6 +532,7 @@ static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const
|
||||
int bits_tab[257];
|
||||
int start, end;
|
||||
const uint8_t *ptr= buf;
|
||||
const uint8_t *ptr_end = buf + buf_size;
|
||||
int j;
|
||||
|
||||
memset(frequency, 0, sizeof(frequency));
|
||||
@@ -532,6 +543,8 @@ static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const
|
||||
for(;;){
|
||||
int i;
|
||||
|
||||
if (start <= end && ptr_end - ptr < end - start + 1 + 1)
|
||||
return NULL;
|
||||
for(i=start; i<=end; i++){
|
||||
frequency[i]= *ptr++;
|
||||
}
|
||||
@@ -604,10 +617,13 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length){
|
||||
const int height= f->avctx->height;
|
||||
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
|
||||
const int stride= f->current_picture.linesize[0]>>1;
|
||||
const uint8_t *buf_end = buf + length;
|
||||
|
||||
for(y=0; y<height; y+=16){
|
||||
for(x=0; x<width; x+=16){
|
||||
unsigned int color[4], bits;
|
||||
if (buf_end - buf < 8)
|
||||
return -1;
|
||||
memset(color, 0, sizeof(color));
|
||||
//warning following is purely guessed ...
|
||||
color[0]= bytestream_get_le16(&buf);
|
||||
@@ -641,27 +657,30 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
|
||||
uint16_t *dst= (uint16_t*)f->current_picture.data[0];
|
||||
const int stride= f->current_picture.linesize[0]>>1;
|
||||
const unsigned int bitstream_size= AV_RL32(buf);
|
||||
const int token_count av_unused = AV_RL32(buf + bitstream_size + 8);
|
||||
unsigned int prestream_size= 4*AV_RL32(buf + bitstream_size + 4);
|
||||
const uint8_t *prestream= buf + bitstream_size + 12;
|
||||
unsigned int prestream_size;
|
||||
const uint8_t *prestream;
|
||||
|
||||
if(prestream_size + bitstream_size + 12 != length
|
||||
|| bitstream_size > (1<<26)
|
||||
|| prestream_size > (1<<26)){
|
||||
if (bitstream_size > (1<<26) || length < bitstream_size + 12)
|
||||
return -1;
|
||||
prestream_size = 4*AV_RL32(buf + bitstream_size + 4);
|
||||
prestream = buf + bitstream_size + 12;
|
||||
|
||||
if (prestream_size > (1<<26) ||
|
||||
prestream_size != length - (bitstream_size + 12)){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n", prestream_size, bitstream_size, length);
|
||||
return -1;
|
||||
}
|
||||
|
||||
prestream= read_huffman_tables(f, prestream);
|
||||
prestream= read_huffman_tables(f, prestream, buf + length - prestream);
|
||||
if (!prestream)
|
||||
return -1;
|
||||
|
||||
init_get_bits(&f->gb, buf + 4, 8*bitstream_size);
|
||||
|
||||
prestream_size= length + buf - prestream;
|
||||
|
||||
av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size, prestream_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!f->bitstream_buffer)
|
||||
return AVERROR(ENOMEM);
|
||||
f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream, prestream_size/4);
|
||||
f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, prestream_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
f->dsp.bswap_buf((uint32_t*)f->bitstream_buffer, (const uint32_t*)prestream, prestream_size/4);
|
||||
init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
|
||||
|
||||
f->last_dc= 0*128*8*8;
|
||||
@@ -684,15 +703,15 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
|
||||
|
||||
static int decode_frame(AVCodecContext *avctx,
|
||||
void *data, int *data_size,
|
||||
AVPacket *avpkt)
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
FourXContext * const f = avctx->priv_data;
|
||||
AVFrame *picture = data;
|
||||
AVFrame *p, temp;
|
||||
int i, frame_4cc, frame_size;
|
||||
|
||||
if (buf_size < 12)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame_4cc= AV_RL32(buf);
|
||||
if(buf_size != AV_RL32(buf+4)+8 || buf_size < 20){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n", buf_size, AV_RL32(buf+4));
|
||||
@@ -705,6 +724,9 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
const int whole_size= AV_RL32(buf+16);
|
||||
CFrameBuffer *cfrm;
|
||||
|
||||
if (data_size < 0 || whole_size < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
for(i=0; i<CFRAME_BUFFER_COUNT; i++){
|
||||
if(f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
|
||||
av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id);
|
||||
@@ -721,6 +743,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
cfrm= &f->cfrm[i];
|
||||
|
||||
if (data_size > UINT_MAX - cfrm->size - FF_INPUT_BUFFER_PADDING_SIZE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
cfrm->data= av_fast_realloc(cfrm->data, &cfrm->allocated_size, cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if(!cfrm->data){ //explicit check needed as memcpy below might not catch a NULL
|
||||
av_log(f->avctx, AV_LOG_ERROR, "realloc falure");
|
||||
@@ -815,7 +839,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
|
||||
init_vlcs(f);
|
||||
|
||||
if(f->version>2) avctx->pix_fmt= PIX_FMT_RGB565;
|
||||
else avctx->pix_fmt= PIX_FMT_BGR555;
|
||||
else avctx->pix_fmt= PIX_FMT_RGB555;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -832,24 +856,20 @@ static av_cold int decode_end(AVCodecContext *avctx){
|
||||
f->cfrm[i].allocated_size= 0;
|
||||
}
|
||||
free_vlc(&f->pre_vlc);
|
||||
if(f->current_picture.data[0])
|
||||
avctx->release_buffer(avctx, &f->current_picture);
|
||||
if(f->last_picture.data[0])
|
||||
avctx->release_buffer(avctx, &f->last_picture);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVCodec fourxm_decoder = {
|
||||
"4xm",
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
CODEC_TYPE_VIDEO,
|
||||
CODEC_ID_4XM,
|
||||
sizeof(FourXContext),
|
||||
decode_init,
|
||||
NULL,
|
||||
decode_end,
|
||||
decode_frame,
|
||||
CODEC_CAP_DR1,
|
||||
/*CODEC_CAP_DR1,*/
|
||||
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
|
||||
};
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/8bps.c
|
||||
* QT 8BPS Video Decoder by Roberto Togni
|
||||
* For more information about the 8BPS format, visit:
|
||||
* http://www.pcisys.net/~melanson/codecs/
|
||||
@@ -58,10 +58,8 @@ typedef struct EightBpsContext {
|
||||
* Decode a frame
|
||||
*
|
||||
*/
|
||||
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
|
||||
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
|
||||
{
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
EightBpsContext * const c = avctx->priv_data;
|
||||
const unsigned char *encoded = buf;
|
||||
unsigned char *pixptr, *pixptr_end;
|
||||
@@ -159,6 +157,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
|
||||
c->pic.data[0] = NULL;
|
||||
|
||||
if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (avctx->bits_per_coded_sample) {
|
||||
case 8:
|
||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||
@@ -179,7 +181,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
case 32:
|
||||
avctx->pix_fmt = PIX_FMT_RGB32;
|
||||
c->planes = 4;
|
||||
#if HAVE_BIGENDIAN
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
c->planemap[0] = 1; // 1st plane is red
|
||||
c->planemap[1] = 2; // 2nd plane is green
|
||||
c->planemap[2] = 3; // 3rd plane is blue
|
||||
@@ -221,7 +223,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
|
||||
|
||||
AVCodec eightbps_decoder = {
|
||||
"8bps",
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
CODEC_TYPE_VIDEO,
|
||||
CODEC_ID_8BPS,
|
||||
sizeof(EightBpsContext),
|
||||
decode_init,
|
||||
|
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/8svx.c
|
||||
* 8svx audio decoder
|
||||
* @author Jaikrishnan Menon
|
||||
* supports: fibonacci delta encoding
|
||||
@@ -42,10 +42,8 @@ static const int16_t exponential[16] = { -128<<8, -64<<8, -32<<8, -16<<8, -8<<8,
|
||||
|
||||
/** decode a frame */
|
||||
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||
AVPacket *avpkt)
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
EightSvxContext *esc = avctx->priv_data;
|
||||
int16_t *out_data = data;
|
||||
int consumed = buf_size;
|
||||
@@ -94,7 +92,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
|
||||
|
||||
AVCodec eightsvx_fib_decoder = {
|
||||
.name = "8svx_fib",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.type = CODEC_TYPE_AUDIO,
|
||||
.id = CODEC_ID_8SVX_FIB,
|
||||
.priv_data_size = sizeof (EightSvxContext),
|
||||
.init = eightsvx_decode_init,
|
||||
@@ -104,7 +102,7 @@ AVCodec eightsvx_fib_decoder = {
|
||||
|
||||
AVCodec eightsvx_exp_decoder = {
|
||||
.name = "8svx_exp",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.type = CODEC_TYPE_AUDIO,
|
||||
.id = CODEC_ID_8SVX_EXP,
|
||||
.priv_data_size = sizeof (EightSvxContext),
|
||||
.init = eightsvx_decode_init,
|
||||
|
@@ -3,11 +3,10 @@ include $(SUBDIR)../config.mak
|
||||
NAME = avcodec
|
||||
FFLIBS = avutil
|
||||
|
||||
HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vdpau.h xvmc.h
|
||||
HEADERS = avcodec.h opt.h vdpau.h xvmc.h
|
||||
|
||||
OBJS = allcodecs.o \
|
||||
audioconvert.o \
|
||||
avpacket.o \
|
||||
bitstream.o \
|
||||
bitstream_filter.o \
|
||||
dsputil.o \
|
||||
@@ -27,92 +26,56 @@ OBJS = allcodecs.o \
|
||||
# parts needed for many different codecs
|
||||
OBJS-$(CONFIG_AANDCT) += aandcttab.o
|
||||
OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
|
||||
OBJS-$(CONFIG_DCT) += dct.o
|
||||
OBJS-$(CONFIG_DWT) += dwt.o
|
||||
OBJS-$(CONFIG_DXVA2) += dxva2.o
|
||||
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft.o $(FFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_FFT) += fft.o
|
||||
OBJS-$(CONFIG_GOLOMB) += golomb.o
|
||||
OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o h264pred.o
|
||||
OBJS-$(CONFIG_LPC) += lpc.o
|
||||
OBJS-$(CONFIG_LSP) += lsp.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct.o
|
||||
RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
|
||||
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_VAAPI) += vaapi.o
|
||||
OBJS-$(CONFIG_VDPAU) += vdpau.o
|
||||
OBJS-$(CONFIG_OLDSCALER) += imgresample.o
|
||||
OBJS-$(CONFIG_RDFT) += rdft.o
|
||||
|
||||
# decoders/encoders/hardware accelerators
|
||||
OBJS-$(CONFIG_AAC_DECODER) += aac.o aactab.o aacsbr.o
|
||||
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
|
||||
aacpsy.o aactab.o \
|
||||
psymodel.o iirfilter.o \
|
||||
mpeg4audio.o
|
||||
# decoders/encoders
|
||||
OBJS-$(CONFIG_AAC_DECODER) += aac.o aactab.o mpeg4audio.o aac_parser.o aac_ac3_parser.o
|
||||
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
|
||||
OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o
|
||||
OBJS-$(CONFIG_AC3_DECODER) += eac3dec.o ac3dec.o ac3tab.o ac3dec_data.o ac3.o
|
||||
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc.o ac3tab.o ac3.o
|
||||
OBJS-$(CONFIG_ALAC_DECODER) += alac.o
|
||||
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o
|
||||
OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_AMRNB_DECODER) += amrnbdec.o celp_filters.o \
|
||||
celp_math.o acelp_filters.o \
|
||||
acelp_vectors.o \
|
||||
acelp_pitch_delay.o
|
||||
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o lpc.o
|
||||
OBJS-$(CONFIG_AMV_DECODER) += sp5xdec.o mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_ANM_DECODER) += anm.o
|
||||
OBJS-$(CONFIG_APE_DECODER) += apedec.o
|
||||
OBJS-$(CONFIG_ASV1_DECODER) += asv1.o mpeg12data.o
|
||||
OBJS-$(CONFIG_ASV1_ENCODER) += asv1.o mpeg12data.o
|
||||
OBJS-$(CONFIG_ASV2_DECODER) += asv1.o mpeg12data.o
|
||||
OBJS-$(CONFIG_ASV2_ENCODER) += asv1.o mpeg12data.o
|
||||
OBJS-$(CONFIG_ATRAC1_DECODER) += atrac1.o atrac.o
|
||||
OBJS-$(CONFIG_ATRAC3_DECODER) += atrac3.o atrac.o
|
||||
OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
|
||||
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
|
||||
OBJS-$(CONFIG_ATRAC3_DECODER) += atrac3.o
|
||||
OBJS-$(CONFIG_AVS_DECODER) += avs.o
|
||||
OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o
|
||||
OBJS-$(CONFIG_BFI_DECODER) += bfi.o
|
||||
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkidct.o
|
||||
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER) += binkaudio.o wma.o
|
||||
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER) += binkaudio.o wma.o
|
||||
OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
|
||||
OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o
|
||||
OBJS-$(CONFIG_C93_DECODER) += c93.o
|
||||
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
|
||||
mpeg12data.o mpegvideo.o
|
||||
OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o
|
||||
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o mpeg12data.o mpegvideo.o
|
||||
OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
|
||||
OBJS-$(CONFIG_CLJR_DECODER) += cljr.o
|
||||
OBJS-$(CONFIG_CLJR_ENCODER) += cljr.o
|
||||
OBJS-$(CONFIG_COOK_DECODER) += cook.o
|
||||
OBJS-$(CONFIG_CSCD_DECODER) += cscd.o
|
||||
OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
|
||||
OBJS-$(CONFIG_DCA_DECODER) += dca.o synth_filter.o dcadsp.o
|
||||
OBJS-$(CONFIG_DCA_DECODER) += dca.o
|
||||
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
|
||||
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o \
|
||||
mpegvideo_enc.o motion_est.o \
|
||||
ratecontrol.o mpeg12data.o \
|
||||
mpegvideo.o
|
||||
OBJS-$(CONFIG_DPX_DECODER) += dpx.o
|
||||
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12data.o mpegvideo.o
|
||||
OBJS-$(CONFIG_DSICINAUDIO_DECODER) += dsicinav.o
|
||||
OBJS-$(CONFIG_DSICINVIDEO_DECODER) += dsicinav.o
|
||||
OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o
|
||||
OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o
|
||||
OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o
|
||||
OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
|
||||
OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o
|
||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o
|
||||
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3dec_data.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o ac3dec.o ac3tab.o ac3dec_data.o ac3.o
|
||||
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
|
||||
OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
|
||||
mpeg12data.o mpegvideo.o \
|
||||
error_resilience.o
|
||||
OBJS-$(CONFIG_EATGQ_DECODER) += eatgq.o eaidct.o
|
||||
OBJS-$(CONFIG_EATGV_DECODER) += eatgv.o
|
||||
OBJS-$(CONFIG_EATQI_DECODER) += eatqi.o eaidct.o mpeg12.o \
|
||||
mpeg12data.o mpegvideo.o \
|
||||
error_resilience.o
|
||||
OBJS-$(CONFIG_EATQI_DECODER) += eatqi.o eaidct.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_EIGHTBPS_DECODER) += 8bps.o
|
||||
OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER) += 8svx.o
|
||||
OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o
|
||||
@@ -121,155 +84,94 @@ OBJS-$(CONFIG_FFV1_DECODER) += ffv1.o rangecoder.o
|
||||
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1.o rangecoder.o
|
||||
OBJS-$(CONFIG_FFVHUFF_DECODER) += huffyuv.o
|
||||
OBJS-$(CONFIG_FFVHUFF_ENCODER) += huffyuv.o
|
||||
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o
|
||||
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o lpc.o
|
||||
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
|
||||
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
|
||||
OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
|
||||
OBJS-$(CONFIG_FLV_DECODER) += h263dec.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_FLV_ENCODER) += mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
|
||||
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o huffman.o
|
||||
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
|
||||
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
|
||||
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
|
||||
OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261.o \
|
||||
mpegvideo_enc.o motion_est.o \
|
||||
ratecontrol.o mpeg12data.o \
|
||||
mpegvideo.o
|
||||
OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
|
||||
mpeg4video.o mpeg4videodec.o flvdec.o\
|
||||
intelh263dec.o mpegvideo.o \
|
||||
error_resilience.o
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_H263_ENCODER) += mpegvideo_enc.o mpeg4video.o \
|
||||
mpeg4videoenc.o motion_est.o \
|
||||
ratecontrol.o h263.o ituh263enc.o \
|
||||
flvenc.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H264_DECODER) += h264.o \
|
||||
h264_loopfilter.o h264_direct.o \
|
||||
cabac.o h264_sei.o h264_ps.o \
|
||||
h264_refs.o h264_cavlc.o h264_cabac.o\
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
|
||||
OBJS-$(CONFIG_GIF_ENCODER) += gif.o
|
||||
OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12data.o mpegvideo.o
|
||||
OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o h263_parser.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H263I_DECODER) += h263dec.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H263_ENCODER) += mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H263P_ENCODER) += mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H264_DECODER) += h264.o h264idct.o h264pred.o h264_parser.o cabac.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H264_ENCODER) += h264enc.o h264dspenc.o
|
||||
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
|
||||
OBJS-$(CONFIG_H264_VDPAU_DECODER) += vdpau.o h264.o h264idct.o h264pred.o h264_parser.o cabac.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o
|
||||
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o
|
||||
OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
|
||||
OBJS-$(CONFIG_IFF_BYTERUN1_DECODER) += iff.o
|
||||
OBJS-$(CONFIG_IFF_ILBM_DECODER) += iff.o
|
||||
OBJS-$(CONFIG_IMC_DECODER) += imc.o
|
||||
OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
|
||||
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
|
||||
OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi_common.o ivi_dsp.o
|
||||
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
|
||||
OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o \
|
||||
mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o
|
||||
OBJS-$(CONFIG_KGV1_DECODER) += kgv1dec.o
|
||||
OBJS-$(CONFIG_KMVC_DECODER) += kmvc.o
|
||||
OBJS-$(CONFIG_LJPEG_ENCODER) += ljpegenc.o mjpegenc.o mjpeg.o \
|
||||
mpegvideo_enc.o motion_est.o \
|
||||
ratecontrol.o mpeg12data.o \
|
||||
mpegvideo.o
|
||||
OBJS-$(CONFIG_LJPEG_ENCODER) += ljpegenc.o mjpegenc.o mjpeg.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12data.o mpegvideo.o
|
||||
OBJS-$(CONFIG_LOCO_DECODER) += loco.o
|
||||
OBJS-$(CONFIG_MACE3_DECODER) += mace.o
|
||||
OBJS-$(CONFIG_MACE6_DECODER) += mace.o
|
||||
OBJS-$(CONFIG_MDEC_DECODER) += mdec.o mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MDEC_DECODER) += mdec.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MIMIC_DECODER) += mimic.o
|
||||
OBJS-$(CONFIG_MJPEG_DECODER) += mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpeg.o \
|
||||
mpegvideo_enc.o motion_est.o \
|
||||
ratecontrol.o mpeg12data.o \
|
||||
mpegvideo.o
|
||||
OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpeg.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12data.o mpegvideo.o
|
||||
OBJS-$(CONFIG_MJPEGB_DECODER) += mjpegbdec.o mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlpdsp.o
|
||||
OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlp_parser.o mlp.o
|
||||
OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o
|
||||
OBJS-$(CONFIG_MOTIONPIXELS_DECODER) += motionpixels.o
|
||||
OBJS-$(CONFIG_MP1_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
|
||||
mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP2_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
|
||||
mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP2_ENCODER) += mpegaudioenc.o mpegaudio.o \
|
||||
mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP3ADU_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
|
||||
mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP3ON4_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
|
||||
mpegaudio.o mpegaudiodata.o \
|
||||
mpeg4audio.o
|
||||
OBJS-$(CONFIG_MP3_DECODER) += mpegaudiodec.o mpegaudiodecheader.o \
|
||||
mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPC7_DECODER) += mpc7.o mpc.o mpegaudiodec.o \
|
||||
mpegaudiodecheader.o mpegaudio.o \
|
||||
mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o mpegaudiodec.o \
|
||||
mpegaudiodecheader.o mpegaudio.o \
|
||||
mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG_XVMC_DECODER) += mpegvideo_xvmc.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
|
||||
motion_est.o ratecontrol.o \
|
||||
mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpegvideo_enc.o \
|
||||
motion_est.o ratecontrol.o \
|
||||
mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_ENCODER) += msmpeg4.o msmpeg4data.o h263dec.o \
|
||||
h263.o ituh263dec.o mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
|
||||
h263.o ituh263dec.o mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4.o msmpeg4data.o h263dec.o \
|
||||
h263.o ituh263dec.o mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
|
||||
h263.o ituh263dec.o mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4.o msmpeg4data.o h263dec.o \
|
||||
h263.o ituh263dec.o mpeg4videodec.o
|
||||
OBJS-$(CONFIG_MP1_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP2_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP2_ENCODER) += mpegaudioenc.o mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP3ADU_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP3ON4_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_MP3_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPC7_DECODER) += mpc7.o mpc.o mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPEG_VDPAU_DECODER) += vdpau.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG1_VDPAU_DECODER) += vdpau.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG_XVMC_DECODER) += mpegvideo_xvmc.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12data.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12data.o mpegvideo_enc.o motion_est.o ratecontrol.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG4_DECODER) += h263dec.o h263.o mpeg4video_parser.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG4_ENCODER) += mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_ENCODER) += msmpeg4.o msmpeg4data.o mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4.o msmpeg4data.o mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4.o msmpeg4data.o mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
|
||||
OBJS-$(CONFIG_MSVIDEO1_DECODER) += msvideo1.o
|
||||
OBJS-$(CONFIG_MSZH_DECODER) += lcldec.o
|
||||
OBJS-$(CONFIG_NELLYMOSER_DECODER) += nellymoserdec.o nellymoser.o
|
||||
OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o
|
||||
OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
|
||||
OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PAM_ENCODER) += pamenc.o pnm.o
|
||||
OBJS-$(CONFIG_PBM_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PAM_ENCODER) += pnmenc.o pnm.o
|
||||
OBJS-$(CONFIG_PBM_ENCODER) += pnmenc.o pnm.o
|
||||
OBJS-$(CONFIG_PCX_DECODER) += pcx.o
|
||||
OBJS-$(CONFIG_PCX_ENCODER) += pcxenc.o
|
||||
OBJS-$(CONFIG_PGM_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o pnm.o
|
||||
OBJS-$(CONFIG_PGMYUV_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PGMYUV_ENCODER) += pnmenc.o pnm.o
|
||||
OBJS-$(CONFIG_PGSSUB_DECODER) += pgssubdec.o
|
||||
OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o
|
||||
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
|
||||
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
|
||||
OBJS-$(CONFIG_PTX_DECODER) += ptx.o
|
||||
OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o celp_math.o \
|
||||
celp_filters.o acelp_vectors.o \
|
||||
acelp_filters.o
|
||||
OBJS-$(CONFIG_QDM2_DECODER) += qdm2.o mpegaudiodec.o \
|
||||
mpegaudiodecheader.o mpegaudio.o \
|
||||
mpegaudiodata.o
|
||||
OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o qcelp_lsp.o celp_math.o celp_filters.o
|
||||
OBJS-$(CONFIG_QDM2_DECODER) += qdm2.o mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_QDRAW_DECODER) += qdrw.o
|
||||
OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o
|
||||
OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o
|
||||
OBJS-$(CONFIG_QTRLE_ENCODER) += qtrleenc.o
|
||||
OBJS-$(CONFIG_R210_DECODER) += r210dec.o
|
||||
OBJS-$(CONFIG_RA_144_DECODER) += ra144.o celp_filters.o
|
||||
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_math.o celp_filters.o
|
||||
OBJS-$(CONFIG_RAWVIDEO_DECODER) += rawdec.o
|
||||
@@ -280,105 +182,70 @@ OBJS-$(CONFIG_ROQ_ENCODER) += roqvideoenc.o roqvideo.o elbg.o
|
||||
OBJS-$(CONFIG_ROQ_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_ROQ_DPCM_ENCODER) += roqaudioenc.o
|
||||
OBJS-$(CONFIG_RPZA_DECODER) += rpza.o
|
||||
OBJS-$(CONFIG_RV10_DECODER) += rv10.o
|
||||
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
|
||||
OBJS-$(CONFIG_RV20_DECODER) += rv10.o
|
||||
OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o
|
||||
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv40dsp.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_RV10_DECODER) += rv10.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_RV10_ENCODER) += rv10.o mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_RV20_DECODER) += rv10.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_RV20_ENCODER) += rv10.o mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o h264pred.o rv30dsp.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o h264pred.o rv40dsp.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
|
||||
OBJS-$(CONFIG_SGI_ENCODER) += sgienc.o rle.o
|
||||
OBJS-$(CONFIG_SHORTEN_DECODER) += shorten.o
|
||||
OBJS-$(CONFIG_SIPR_DECODER) += sipr.o acelp_pitch_delay.o \
|
||||
celp_math.o acelp_vectors.o \
|
||||
acelp_filters.o celp_filters.o \
|
||||
sipr16k.o
|
||||
OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
|
||||
OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
|
||||
OBJS-$(CONFIG_SMC_DECODER) += smc.o
|
||||
OBJS-$(CONFIG_SNOW_DECODER) += snow.o rangecoder.o
|
||||
OBJS-$(CONFIG_SNOW_ENCODER) += snow.o rangecoder.o motion_est.o \
|
||||
ratecontrol.o h263.o \
|
||||
mpegvideo.o error_resilience.o \
|
||||
ituh263enc.o mpegvideo_enc.o \
|
||||
mpeg12data.o
|
||||
OBJS-$(CONFIG_SNOW_ENCODER) += snow.o rangecoder.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
|
||||
OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o
|
||||
OBJS-$(CONFIG_SONIC_LS_ENCODER) += sonic.o
|
||||
OBJS-$(CONFIG_SP5X_DECODER) += sp5xdec.o mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_SUNRAST_DECODER) += sunrast.o
|
||||
OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o \
|
||||
motion_est.o h263.o \
|
||||
mpegvideo.o error_resilience.o \
|
||||
ituh263enc.o mpegvideo_enc.o \
|
||||
ratecontrol.o mpeg12data.o
|
||||
OBJS-$(CONFIG_SVQ3_DECODER) += h264.o svq3.o \
|
||||
h264_loopfilter.o h264_direct.o \
|
||||
h264_sei.o h264_ps.o h264_refs.o \
|
||||
h264_cavlc.o h264_cabac.o cabac.o \
|
||||
mpegvideo.o error_resilience.o \
|
||||
svq1dec.o svq1.o h263.o
|
||||
OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o motion_est.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_SVQ3_DECODER) += h264.o h264idct.o h264pred.o h264_parser.o cabac.o mpegvideo.o error_resilience.o svq1dec.o svq1.o h263.o
|
||||
OBJS-$(CONFIG_TARGA_DECODER) += targa.o
|
||||
OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o
|
||||
OBJS-$(CONFIG_THEORA_DECODER) += xiph.o
|
||||
OBJS-$(CONFIG_THEORA_DECODER) += vp3.o xiph.o vp3dsp.o
|
||||
OBJS-$(CONFIG_THP_DECODER) += mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
|
||||
OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o faxcompr.o
|
||||
OBJS-$(CONFIG_TIFF_ENCODER) += tiffenc.o rle.o lzwenc.o
|
||||
OBJS-$(CONFIG_TMV_DECODER) += tmv.o cga_data.o
|
||||
OBJS-$(CONFIG_TRUEMOTION1_DECODER) += truemotion1.o
|
||||
OBJS-$(CONFIG_TRUEMOTION2_DECODER) += truemotion2.o
|
||||
OBJS-$(CONFIG_TRUESPEECH_DECODER) += truespeech.o
|
||||
OBJS-$(CONFIG_TSCC_DECODER) += tscc.o msrledec.o
|
||||
OBJS-$(CONFIG_TTA_DECODER) += tta.o
|
||||
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvq.o celp_math.o
|
||||
OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
|
||||
OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
|
||||
OBJS-$(CONFIG_V210_DECODER) += v210dec.o
|
||||
OBJS-$(CONFIG_V210_ENCODER) += v210enc.o
|
||||
OBJS-$(CONFIG_V210X_DECODER) += v210x.o
|
||||
OBJS-$(CONFIG_VB_DECODER) += vb.o
|
||||
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
|
||||
msmpeg4.o msmpeg4data.o \
|
||||
intrax8.o intrax8dsp.o
|
||||
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o
|
||||
OBJS-$(CONFIG_VC1_DECODER) += vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o msmpeg4.o
|
||||
OBJS-$(CONFIG_VC1_VDPAU_DECODER) += vdpau.o vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o msmpeg4.o
|
||||
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
|
||||
OBJS-$(CONFIG_VCR1_ENCODER) += vcr1.o
|
||||
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdav.o
|
||||
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdav.o
|
||||
OBJS-$(CONFIG_VMNC_DECODER) += vmnc.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += vorbis_dec.o vorbis.o \
|
||||
vorbis_data.o xiph.o
|
||||
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbis_enc.o vorbis.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += vorbis_dec.o vorbis.o vorbis_data.o xiph.o
|
||||
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbis_enc.o vorbis.o vorbis_data.o
|
||||
OBJS-$(CONFIG_VP3_DECODER) += vp3.o vp3dsp.o
|
||||
OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp56dsp.o \
|
||||
vp3dsp.o
|
||||
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
|
||||
vp3dsp.o vp6dsp.o huffman.o
|
||||
OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp3dsp.o
|
||||
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp3dsp.o vp6dsp.o huffman.o
|
||||
OBJS-$(CONFIG_VP6A_DECODER) += vp6.o vp56.o vp56data.o vp3dsp.o vp6dsp.o huffman.o
|
||||
OBJS-$(CONFIG_VP6F_DECODER) += vp6.o vp56.o vp56data.o vp3dsp.o vp6dsp.o huffman.o
|
||||
OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
|
||||
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
|
||||
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o
|
||||
OBJS-$(CONFIG_WMAV1_DECODER) += wmadec.o wma.o aactab.o
|
||||
OBJS-$(CONFIG_WMAV1_ENCODER) += wmaenc.o wma.o aactab.o
|
||||
OBJS-$(CONFIG_WMAV2_DECODER) += wmadec.o wma.o aactab.o
|
||||
OBJS-$(CONFIG_WMAV2_ENCODER) += wmaenc.o wma.o aactab.o
|
||||
OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
|
||||
celp_math.o celp_filters.o \
|
||||
acelp_vectors.o acelp_filters.o
|
||||
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o \
|
||||
msmpeg4.o msmpeg4data.o \
|
||||
intrax8.o intrax8dsp.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o \
|
||||
msmpeg4.o msmpeg4data.o \
|
||||
mpeg4videodec.o ituh263dec.o h263dec.o
|
||||
OBJS-$(CONFIG_WMAV1_DECODER) += wmadec.o wma.o
|
||||
OBJS-$(CONFIG_WMAV1_ENCODER) += wmaenc.o wma.o
|
||||
OBJS-$(CONFIG_WMAV2_DECODER) += wmadec.o wma.o
|
||||
OBJS-$(CONFIG_WMAV2_ENCODER) += wmaenc.o wma.o
|
||||
OBJS-$(CONFIG_WMV1_DECODER) += h263dec.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_WMV1_ENCODER) += mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o msmpeg4.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o msmpeg4.o msmpeg4data.o mpegvideo_enc.o motion_est.o ratecontrol.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_WMV3_DECODER) += vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o msmpeg4.o
|
||||
OBJS-$(CONFIG_WMV3_VDPAU_DECODER) += vdpau.o vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o msmpeg4.o
|
||||
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
|
||||
OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
|
||||
OBJS-$(CONFIG_XAN_DPCM_DECODER) += dpcm.o
|
||||
@@ -386,8 +253,6 @@ OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o
|
||||
OBJS-$(CONFIG_XAN_WC4_DECODER) += xan.o
|
||||
OBJS-$(CONFIG_XL_DECODER) += xl.o
|
||||
OBJS-$(CONFIG_XSUB_DECODER) += xsubdec.o
|
||||
OBJS-$(CONFIG_XSUB_ENCODER) += xsubenc.o
|
||||
OBJS-$(CONFIG_YOP_DECODER) += yop.o
|
||||
OBJS-$(CONFIG_ZLIB_DECODER) += lcldec.o
|
||||
OBJS-$(CONFIG_ZLIB_ENCODER) += lclenc.o
|
||||
OBJS-$(CONFIG_ZMBV_DECODER) += zmbv.o
|
||||
@@ -396,7 +261,6 @@ OBJS-$(CONFIG_ZMBV_ENCODER) += zmbvenc.o
|
||||
# (AD)PCM decoders/encoders
|
||||
OBJS-$(CONFIG_PCM_ALAW_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_ALAW_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_BLURAY_DECODER) += pcm-mpeg.o
|
||||
OBJS-$(CONFIG_PCM_DVD_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_DVD_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_F32BE_DECODER) += pcm.o
|
||||
@@ -480,63 +344,42 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o
|
||||
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcm.o
|
||||
|
||||
# libavformat dependencies
|
||||
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_DV_DEMUXER) += dvdata.o
|
||||
OBJS-$(CONFIG_DV_MUXER) += dvdata.o
|
||||
OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_FLAC_MUXER) += flacdec.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_EAC3_DEMUXER) += ac3_parser.o ac3tab.o aac_ac3_parser.o
|
||||
OBJS-$(CONFIG_FLAC_MUXER) += flacdec.o
|
||||
OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o
|
||||
OBJS-$(CONFIG_IFF_DEMUXER) += iff.o
|
||||
OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o \
|
||||
flacdec.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o flacdec.o
|
||||
OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
|
||||
flacdec.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o flacdec.o
|
||||
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o
|
||||
OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
|
||||
OBJS-$(CONFIG_OGG_DEMUXER) += flacdec.o flacdata.o flac.o \
|
||||
dirac.o mpeg12data.o
|
||||
OBJS-$(CONFIG_OGG_MUXER) += xiph.o flacdec.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_OGG_DEMUXER) += flacdec.o
|
||||
OBJS-$(CONFIG_OGG_MUXER) += xiph.o flacdec.o
|
||||
OBJS-$(CONFIG_RTP_MUXER) += mpegvideo.o
|
||||
OBJS-$(CONFIG_WEBM_MUXER) += xiph.o mpeg4audio.o \
|
||||
flacdec.o flacdata.o flac.o
|
||||
|
||||
# external codec libraries
|
||||
OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o
|
||||
OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o
|
||||
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
|
||||
OBJS-$(CONFIG_LIBFAAD_DECODER) += libfaad.o
|
||||
OBJS-$(CONFIG_LIBGSM_DECODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_ENCODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpeg.o
|
||||
OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
|
||||
libschroedinger.o \
|
||||
libdirac_libschro.o
|
||||
OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
|
||||
libschroedinger.o \
|
||||
libdirac_libschro.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbis.o
|
||||
OBJS-$(CONFIG_LIBVPX_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
|
||||
OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvidff.o libxvid_rc.o
|
||||
OBJS-$(CONFIG_LIBAMR_NB) += libamr.o
|
||||
OBJS-$(CONFIG_LIBAMR_WB) += libamr.o
|
||||
OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o
|
||||
OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o
|
||||
OBJS-$(CONFIG_LIBFAAC) += libfaac.o
|
||||
OBJS-$(CONFIG_LIBFAAD) += libfaad.o
|
||||
OBJS-$(CONFIG_LIBGSM) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBMP3LAME) += libmp3lame.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRWB) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENJPEG) += libopenjpeg.o
|
||||
OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o libschroedinger.o libdirac_libschro.o
|
||||
OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o libschroedinger.o libdirac_libschro.o
|
||||
OBJS-$(CONFIG_LIBSPEEX) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBTHEORA) += libtheoraenc.o
|
||||
OBJS-$(CONFIG_LIBVORBIS) += libvorbis.o
|
||||
OBJS-$(CONFIG_LIBX264) += libx264.o
|
||||
OBJS-$(CONFIG_LIBXVID) += libxvidff.o libxvid_rc.o
|
||||
|
||||
# parsers
|
||||
OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o \
|
||||
mpeg4audio.o
|
||||
OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \
|
||||
aac_ac3_parser.o
|
||||
OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o aac_ac3_parser.o
|
||||
OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
|
||||
OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o
|
||||
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
|
||||
@@ -545,39 +388,24 @@ OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o
|
||||
OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
|
||||
OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
|
||||
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
|
||||
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o \
|
||||
cabac.o \
|
||||
h264_refs.o h264_sei.o h264_direct.o \
|
||||
h264_loopfilter.o h264_cabac.o \
|
||||
h264_cavlc.o h264_ps.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o
|
||||
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
|
||||
OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
|
||||
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
|
||||
mpegvideo.o error_resilience.o \
|
||||
mpeg4videodec.o mpeg4video.o \
|
||||
ituh263dec.o h263dec.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \
|
||||
mpegaudiodecheader.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
|
||||
mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o mpegaudiodecheader.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
|
||||
OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
|
||||
msmpeg4.o msmpeg4data.o mpeg4video.o \
|
||||
h263.o mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o
|
||||
OBJS-$(CONFIG_VP3_PARSER) += vp3_parser.o
|
||||
|
||||
# bitstream filters
|
||||
OBJS-$(CONFIG_AAC_ADTSTOASC_BSF) += aac_adtstoasc_bsf.o
|
||||
OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += dump_extradata_bsf.o
|
||||
OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o
|
||||
OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += imx_dump_header_bsf.o
|
||||
OBJS-$(CONFIG_MJPEGA_DUMP_HEADER_BSF) += mjpega_dump_header_bsf.o
|
||||
OBJS-$(CONFIG_MOV2TEXTSUB_BSF) += movsub_bsf.o
|
||||
OBJS-$(CONFIG_MP3_HEADER_COMPRESS_BSF) += mp3_header_compress_bsf.o
|
||||
OBJS-$(CONFIG_MP3_HEADER_DECOMPRESS_BSF) += mp3_header_decompress_bsf.o \
|
||||
mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MP3_HEADER_DECOMPRESS_BSF) += mp3_header_decompress_bsf.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_NOISE_BSF) += noise_bsf.o
|
||||
OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF) += remove_extradata_bsf.o
|
||||
OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
|
||||
@@ -588,68 +416,123 @@ OBJS-$(HAVE_OS2THREADS) += os2thread.o
|
||||
OBJS-$(HAVE_PTHREADS) += pthread.o
|
||||
OBJS-$(HAVE_W32THREADS) += w32thread.o
|
||||
|
||||
# processor-specific code
|
||||
YASM-OBJS-FFT-$(HAVE_AMD3DNOW) += x86/fft_3dn.o
|
||||
YASM-OBJS-FFT-$(HAVE_AMD3DNOWEXT) += x86/fft_3dn2.o
|
||||
YASM-OBJS-FFT-$(HAVE_SSE) += x86/fft_sse.o
|
||||
YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o $(YASM-OBJS-FFT-yes)
|
||||
YASM-OBJS-$(CONFIG_GPL) += x86/h264_deblock_sse2.o \
|
||||
x86/h264_idct_sse2.o \
|
||||
|
||||
MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o
|
||||
MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o
|
||||
MMX-OBJS-$(CONFIG_FLAC_ENCODER) += x86/flacdsp_mmx.o
|
||||
MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o
|
||||
MMX-OBJS-$(CONFIG_SNOW_DECODER) += x86/snowdsp_mmx.o
|
||||
MMX-OBJS-$(CONFIG_THEORA_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
|
||||
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
|
||||
MMX-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
|
||||
MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o
|
||||
MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o \
|
||||
x86/vp6dsp_mmx.o x86/vp6dsp_sse2.o
|
||||
MMX-OBJS-$(CONFIG_VP6A_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o \
|
||||
x86/vp6dsp_mmx.o x86/vp6dsp_sse2.o
|
||||
MMX-OBJS-$(CONFIG_VP6F_DECODER) += x86/vp3dsp_mmx.o x86/vp3dsp_sse2.o \
|
||||
x86/vp6dsp_mmx.o x86/vp6dsp_sse2.o
|
||||
MMX-OBJS-$(CONFIG_WMV3_DECODER) += x86/vc1dsp_mmx.o
|
||||
MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \
|
||||
$(YASM-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_MMX) += x86/cpuid.o \
|
||||
x86/dnxhd_mmx.o \
|
||||
x86/dsputil_mmx.o \
|
||||
x86/fdct_mmx.o \
|
||||
x86/idct_mmx_xvid.o \
|
||||
x86/idct_sse2_xvid.o \
|
||||
x86/motion_est_mmx.o \
|
||||
x86/mpegvideo_mmx.o \
|
||||
x86/simple_idct_mmx.o \
|
||||
$(MMX-OBJS-yes)
|
||||
|
||||
OBJS-$(ARCH_ALPHA) += alpha/dsputil_alpha.o \
|
||||
alpha/dsputil_alpha_asm.o \
|
||||
alpha/motion_est_alpha.o \
|
||||
alpha/motion_est_mvi_asm.o \
|
||||
alpha/mpegvideo_alpha.o \
|
||||
alpha/simple_idct_alpha.o \
|
||||
|
||||
OBJS-$(ARCH_ARM) += arm/dsputil_arm.o \
|
||||
arm/dsputil_arm_s.o \
|
||||
arm/jrevdct_arm.o \
|
||||
arm/mpegvideo_arm.o \
|
||||
arm/simple_idct_arm.o \
|
||||
|
||||
OBJS-$(HAVE_ARMV5TE) += arm/mpegvideo_armv5te.o \
|
||||
arm/mpegvideo_armv5te_s.o \
|
||||
arm/simple_idct_armv5te.o \
|
||||
|
||||
OBJS-$(HAVE_ARMV6) += arm/simple_idct_armv6.o \
|
||||
|
||||
OBJS-$(HAVE_ARMVFP) += arm/dsputil_vfp.o \
|
||||
arm/float_arm_vfp.o \
|
||||
|
||||
OBJS-$(HAVE_IWMMXT) += arm/dsputil_iwmmxt.o \
|
||||
arm/mpegvideo_iwmmxt.o \
|
||||
|
||||
OBJS-$(HAVE_NEON) += arm/dsputil_neon.o \
|
||||
arm/dsputil_neon_s.o \
|
||||
arm/h264dsp_neon.o \
|
||||
arm/h264idct_neon.o \
|
||||
arm/simple_idct_neon.o \
|
||||
|
||||
OBJS-$(ARCH_BFIN) += bfin/dsputil_bfin.o \
|
||||
bfin/fdct_bfin.o \
|
||||
bfin/idct_bfin.o \
|
||||
bfin/mpegvideo_bfin.o \
|
||||
bfin/pixels_bfin.o \
|
||||
bfin/vp3_bfin.o \
|
||||
bfin/vp3_idct_bfin.o \
|
||||
|
||||
OBJS-$(ARCH_PPC) += ppc/dsputil_ppc.o \
|
||||
|
||||
ALTIVEC-OBJS-$(CONFIG_H264_DECODER) += ppc/h264_altivec.o
|
||||
ALTIVEC-OBJS-$(CONFIG_OLDSCALER) += ppc/imgresample_altivec.o
|
||||
ALTIVEC-OBJS-$(CONFIG_SNOW_DECODER) += ppc/snow_altivec.o
|
||||
ALTIVEC-OBJS-$(CONFIG_VC1_DECODER) += ppc/vc1dsp_altivec.o
|
||||
ALTIVEC-OBJS-$(CONFIG_WMV3_DECODER) += ppc/vc1dsp_altivec.o
|
||||
|
||||
OBJS-$(HAVE_ALTIVEC) += ppc/check_altivec.o \
|
||||
ppc/dsputil_altivec.o \
|
||||
ppc/fdct_altivec.o \
|
||||
ppc/fft_altivec.o \
|
||||
ppc/float_altivec.o \
|
||||
ppc/gmc_altivec.o \
|
||||
ppc/idct_altivec.o \
|
||||
ppc/int_altivec.o \
|
||||
ppc/mpegvideo_altivec.o \
|
||||
$(ALTIVEC-OBJS-yes)
|
||||
|
||||
OBJS-$(ARCH_SH4) += sh4/dsputil_align.o \
|
||||
sh4/dsputil_sh4.o \
|
||||
sh4/idct_sh4.o \
|
||||
|
||||
OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
|
||||
|
||||
-include $(SUBDIR)$(ARCH)/Makefile
|
||||
OBJS-$(HAVE_MMI) += ps2/dsputil_mmi.o \
|
||||
ps2/idct_mmi.o \
|
||||
ps2/mpegvideo_mmi.o \
|
||||
|
||||
SKIPHEADERS = %_tablegen.h
|
||||
SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h
|
||||
SKIPHEADERS-$(CONFIG_LIBDIRAC) += libdirac.h
|
||||
SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h
|
||||
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h
|
||||
SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
|
||||
SKIPHEADERS += mpegaudio3.h
|
||||
OBJS-$(HAVE_VIS) += sparc/dsputil_vis.o \
|
||||
sparc/simple_idct_vis.o \
|
||||
|
||||
EXAMPLES = api
|
||||
|
||||
TESTPROGS = cabac dct eval fft h264 iirfilter rangecoder snow
|
||||
TESTPROGS-$(ARCH_X86) += x86/cpuid
|
||||
TESTPROGS-$(HAVE_MMX) += motion
|
||||
TESTOBJS = dctref.o
|
||||
|
||||
HOSTPROGS = costablegen
|
||||
TESTS = $(addsuffix -test$(EXESUF), cabac dct eval fft h264 rangecoder snow)
|
||||
TESTS-$(CONFIG_OLDSCALER) += imgresample-test$(EXESUF)
|
||||
TESTS-$(ARCH_X86) += x86/cpuid-test$(EXESUF) motion-test$(EXESUF)
|
||||
|
||||
CLEANFILES = apiexample$(EXESUF)
|
||||
DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
|
||||
|
||||
CLEANFILES = sin_tables.c cos_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
|
||||
|
||||
include $(SUBDIR)../subdir.mak
|
||||
|
||||
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
|
||||
|
||||
$(SUBDIR)cos_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
|
||||
$(M)./$< > $@
|
||||
|
||||
$(SUBDIR)sin_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
|
||||
$(M)./$< sin > $@
|
||||
|
||||
ifdef CONFIG_MPEGAUDIO_HP
|
||||
$(SUBDIR)mpegaudio_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DFRAC_BITS=23
|
||||
$(SUBDIR)mpegaudio_tablegen.ho: CPPFLAGS += -DFRAC_BITS=23
|
||||
else
|
||||
$(SUBDIR)mpegaudio_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DFRAC_BITS=15
|
||||
$(SUBDIR)mpegaudio_tablegen.ho: CPPFLAGS += -DFRAC_BITS=15
|
||||
endif
|
||||
|
||||
ifdef CONFIG_SMALL
|
||||
$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=1
|
||||
else
|
||||
$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
|
||||
endif
|
||||
|
||||
$(SUBDIR)%_tablegen$(HOSTEXESUF): $(SUBDIR)%_tablegen.c $(SUBDIR)tableprint.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTLIBS)
|
||||
|
||||
$(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF)
|
||||
$(M)./$< > $@
|
||||
|
||||
ifdef CONFIG_HARDCODED_TABLES
|
||||
$(SUBDIR)aac.o: $(SUBDIR)cbrt_tables.h
|
||||
$(SUBDIR)dv.o: $(SUBDIR)dv_tables.h
|
||||
$(SUBDIR)mdct.o: $(SUBDIR)mdct_tables.h
|
||||
$(SUBDIR)mpegaudiodec.o: $(SUBDIR)mpegaudio_tables.h
|
||||
$(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
|
||||
$(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h
|
||||
$(SUBDIR)qdm2.o: $(SUBDIR)qdm2_tables.h
|
||||
endif
|
||||
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o $(SUBDIR)aandcttab.o
|
||||
|
1368
libavcodec/aac.c
1368
libavcodec/aac.c
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aac.h
|
||||
* AAC definitions and structures
|
||||
* @author Oded Shimon ( ods15 ods15 dyndns org )
|
||||
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
|
||||
@@ -30,16 +30,15 @@
|
||||
#ifndef AVCODEC_AAC_H
|
||||
#define AVCODEC_AAC_H
|
||||
|
||||
#include "libavutil/internal.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "fft.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "sbr.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define AAC_INIT_VLC_STATIC(num, size) \
|
||||
INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \
|
||||
INIT_VLC_STATIC(&vlc_spectral[num], 6, ff_aac_spectral_sizes[num], \
|
||||
ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeof( ff_aac_spectral_bits[num][0]), \
|
||||
ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeof(ff_aac_spectral_codes[num][0]), \
|
||||
size);
|
||||
@@ -49,6 +48,36 @@
|
||||
|
||||
#define TNS_MAX_ORDER 20
|
||||
|
||||
enum AudioObjectType {
|
||||
AOT_NULL,
|
||||
// Support? Name
|
||||
AOT_AAC_MAIN, ///< Y Main
|
||||
AOT_AAC_LC, ///< Y Low Complexity
|
||||
AOT_AAC_SSR, ///< N (code in SoC repo) Scalable Sample Rate
|
||||
AOT_AAC_LTP, ///< N (code in SoC repo) Long Term Prediction
|
||||
AOT_SBR, ///< N (in progress) Spectral Band Replication
|
||||
AOT_AAC_SCALABLE, ///< N Scalable
|
||||
AOT_TWINVQ, ///< N Twin Vector Quantizer
|
||||
AOT_CELP, ///< N Code Excited Linear Prediction
|
||||
AOT_HVXC, ///< N Harmonic Vector eXcitation Coding
|
||||
AOT_TTSI = 12, ///< N Text-To-Speech Interface
|
||||
AOT_MAINSYNTH, ///< N Main Synthesis
|
||||
AOT_WAVESYNTH, ///< N Wavetable Synthesis
|
||||
AOT_MIDI, ///< N General MIDI
|
||||
AOT_SAFX, ///< N Algorithmic Synthesis and Audio Effects
|
||||
AOT_ER_AAC_LC, ///< N Error Resilient Low Complexity
|
||||
AOT_ER_AAC_LTP = 19, ///< N Error Resilient Long Term Prediction
|
||||
AOT_ER_AAC_SCALABLE, ///< N Error Resilient Scalable
|
||||
AOT_ER_TWINVQ, ///< N Error Resilient Twin Vector Quantizer
|
||||
AOT_ER_BSAC, ///< N Error Resilient Bit-Sliced Arithmetic Coding
|
||||
AOT_ER_AAC_LD, ///< N Error Resilient Low Delay
|
||||
AOT_ER_CELP, ///< N Error Resilient Code Excited Linear Prediction
|
||||
AOT_ER_HVXC, ///< N Error Resilient Harmonic Vector eXcitation Coding
|
||||
AOT_ER_HILN, ///< N Error Resilient Harmonic and Individual Lines plus Noise
|
||||
AOT_ER_PARAM, ///< N Error Resilient Parametric
|
||||
AOT_SSC, ///< N SinuSoidal Coding
|
||||
};
|
||||
|
||||
enum RawDataBlockType {
|
||||
TYPE_SCE,
|
||||
TYPE_CPE,
|
||||
@@ -104,17 +133,6 @@ enum CouplingPoint {
|
||||
AFTER_IMDCT = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* Output configuration status
|
||||
*/
|
||||
enum OCStatus {
|
||||
OC_NONE, //< Output unconfigured
|
||||
OC_TRIAL_PCE, //< Output configuration under trial specified by an inband PCE
|
||||
OC_TRIAL_FRAME, //< Output configuration under trial specified by a frame header
|
||||
OC_GLOBAL_HDR, //< Output configuration set in a global header but not yet locked
|
||||
OC_LOCKED, //< Output configuration locked in place
|
||||
};
|
||||
|
||||
/**
|
||||
* Predictor State
|
||||
*/
|
||||
@@ -129,12 +147,6 @@ typedef struct {
|
||||
|
||||
#define MAX_PREDICTORS 672
|
||||
|
||||
#define SCALE_DIV_512 36 ///< scalefactor difference that corresponds to scale difference in 512 times
|
||||
#define SCALE_ONE_POS 140 ///< scalefactor index that corresponds to scale=1.0
|
||||
#define SCALE_MAX_POS 255 ///< scalefactor index maximum value
|
||||
#define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard
|
||||
#define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference
|
||||
|
||||
/**
|
||||
* Individual Channel Stream
|
||||
*/
|
||||
@@ -145,7 +157,6 @@ typedef struct {
|
||||
int num_window_groups;
|
||||
uint8_t group_len[8];
|
||||
const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window
|
||||
const uint8_t *swb_sizes; ///< table of scalefactor band sizes for a particular window
|
||||
int num_swb; ///< number of scalefactor window bands
|
||||
int num_windows;
|
||||
int tns_max_bands;
|
||||
@@ -185,7 +196,6 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
int num_pulse;
|
||||
int start;
|
||||
int pos[4];
|
||||
int amp[4];
|
||||
} Pulse;
|
||||
@@ -210,15 +220,12 @@ typedef struct {
|
||||
typedef struct {
|
||||
IndividualChannelStream ics;
|
||||
TemporalNoiseShaping tns;
|
||||
Pulse pulse;
|
||||
enum BandType band_type[128]; ///< band types
|
||||
enum BandType band_type[120]; ///< band types
|
||||
int band_type_run_end[120]; ///< band type run end points
|
||||
float sf[120]; ///< scalefactors
|
||||
int sf_idx[128]; ///< scalefactor indices (used by encoder)
|
||||
uint8_t zeroes[128]; ///< band is not coded (used by encoder)
|
||||
DECLARE_ALIGNED(16, float, coeffs)[1024]; ///< coefficients for IMDCT
|
||||
DECLARE_ALIGNED(16, float, saved)[1024]; ///< overlap
|
||||
DECLARE_ALIGNED(16, float, ret)[2048]; ///< PCM output
|
||||
DECLARE_ALIGNED_16(float, coeffs[1024]); ///< coefficients for IMDCT
|
||||
DECLARE_ALIGNED_16(float, saved[512]); ///< overlap
|
||||
DECLARE_ALIGNED_16(float, ret[1024]); ///< PCM output
|
||||
PredictorState predictor_state[MAX_PREDICTORS];
|
||||
} SingleChannelElement;
|
||||
|
||||
@@ -227,14 +234,11 @@ typedef struct {
|
||||
*/
|
||||
typedef struct {
|
||||
// CPE specific
|
||||
int common_window; ///< Set if channels share a common 'IndividualChannelStream' in bitstream.
|
||||
int ms_mode; ///< Signals mid/side stereo flags coding mode (used by encoder)
|
||||
uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band
|
||||
uint8_t ms_mask[120]; ///< Set if mid/side stereo is used for each scalefactor window band
|
||||
// shared
|
||||
SingleChannelElement ch[2];
|
||||
// CCE specific
|
||||
ChannelCoupling coup;
|
||||
SpectralBandReplication sbr;
|
||||
} ChannelElement;
|
||||
|
||||
/**
|
||||
@@ -264,15 +268,15 @@ typedef struct {
|
||||
* @defgroup temporary aligned temporary buffers (We do not want to have these on the stack.)
|
||||
* @{
|
||||
*/
|
||||
DECLARE_ALIGNED(16, float, buf_mdct)[1024];
|
||||
DECLARE_ALIGNED_16(float, buf_mdct[1024]);
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup tables Computed / set up during initialization.
|
||||
* @{
|
||||
*/
|
||||
FFTContext mdct;
|
||||
FFTContext mdct_small;
|
||||
MDCTContext mdct;
|
||||
MDCTContext mdct_small;
|
||||
DSPContext dsp;
|
||||
int random_state;
|
||||
/** @} */
|
||||
@@ -287,9 +291,7 @@ typedef struct {
|
||||
int sf_offset; ///< offset into pow2sf_tab as appropriate for dsp.float_to_int16
|
||||
/** @} */
|
||||
|
||||
DECLARE_ALIGNED(16, float, temp)[128];
|
||||
|
||||
enum OCStatus output_configured;
|
||||
DECLARE_ALIGNED(16, float, temp[128]);
|
||||
} AACContext;
|
||||
|
||||
#endif /* AVCODEC_AAC_H */
|
||||
|
@@ -71,32 +71,23 @@ get_next:
|
||||
*poutbuf_size = buf_size;
|
||||
|
||||
/* update codec info */
|
||||
avctx->sample_rate = s->sample_rate;
|
||||
if(s->codec_id)
|
||||
avctx->codec_id = s->codec_id;
|
||||
|
||||
/* Due to backwards compatible HE-AAC the sample rate, channel count,
|
||||
and total number of samples found in an AAC ADTS header are not
|
||||
reliable. Bit rate is still accurate because the total frame duration in
|
||||
seconds is still correct (as is the number of bits in the frame). */
|
||||
if (avctx->codec_id != CODEC_ID_AAC) {
|
||||
avctx->sample_rate = s->sample_rate;
|
||||
|
||||
/* allow downmixing to stereo (or mono for AC-3) */
|
||||
if(avctx->request_channels > 0 &&
|
||||
avctx->request_channels < s->channels &&
|
||||
(avctx->request_channels <= 2 ||
|
||||
(avctx->request_channels == 1 &&
|
||||
(avctx->codec_id == CODEC_ID_AC3 ||
|
||||
avctx->codec_id == CODEC_ID_EAC3)))) {
|
||||
avctx->channels = avctx->request_channels;
|
||||
} else {
|
||||
avctx->channels = s->channels;
|
||||
avctx->channel_layout = s->channel_layout;
|
||||
}
|
||||
avctx->frame_size = s->samples;
|
||||
/* allow downmixing to stereo (or mono for AC-3) */
|
||||
if(avctx->request_channels > 0 &&
|
||||
avctx->request_channels < s->channels &&
|
||||
(avctx->request_channels <= 2 ||
|
||||
(avctx->request_channels == 1 &&
|
||||
(avctx->codec_id == CODEC_ID_AC3 ||
|
||||
avctx->codec_id == CODEC_ID_EAC3)))) {
|
||||
avctx->channels = avctx->request_channels;
|
||||
} else {
|
||||
avctx->channels = s->channels;
|
||||
}
|
||||
|
||||
avctx->bit_rate = s->bit_rate;
|
||||
avctx->frame_size = s->samples;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
@@ -48,7 +48,6 @@ typedef struct AACAC3ParseContext {
|
||||
int sample_rate;
|
||||
int bit_rate;
|
||||
int samples;
|
||||
int64_t channel_layout;
|
||||
|
||||
int remaining_size;
|
||||
uint64_t state;
|
||||
|
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration bitstream filter
|
||||
* Copyright (c) 2009 Alex Converse <alex.converse@gmail.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "aac_parser.h"
|
||||
#include "put_bits.h"
|
||||
#include "get_bits.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "internal.h"
|
||||
|
||||
typedef struct AACBSFContext {
|
||||
int first_frame_done;
|
||||
} AACBSFContext;
|
||||
|
||||
/**
|
||||
* This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
|
||||
* ADTS header and removes the ADTS header.
|
||||
*/
|
||||
static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
||||
AVCodecContext *avctx, const char *args,
|
||||
uint8_t **poutbuf, int *poutbuf_size,
|
||||
const uint8_t *buf, int buf_size,
|
||||
int keyframe)
|
||||
{
|
||||
GetBitContext gb;
|
||||
PutBitContext pb;
|
||||
AACADTSHeaderInfo hdr;
|
||||
|
||||
AACBSFContext *ctx = bsfc->priv_data;
|
||||
|
||||
init_get_bits(&gb, buf, AAC_ADTS_HEADER_SIZE*8);
|
||||
|
||||
*poutbuf = (uint8_t*) buf;
|
||||
*poutbuf_size = buf_size;
|
||||
|
||||
if (avctx->extradata)
|
||||
if (show_bits(&gb, 12) != 0xfff)
|
||||
return 0;
|
||||
|
||||
if (ff_aac_parse_header(&gb, &hdr) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!hdr.crc_absent && hdr.num_aac_frames > 1) {
|
||||
av_log_missing_feature(avctx, "Multiple RDBs per frame with CRC is", 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
buf += AAC_ADTS_HEADER_SIZE + 2*!hdr.crc_absent;
|
||||
buf_size -= AAC_ADTS_HEADER_SIZE + 2*!hdr.crc_absent;
|
||||
|
||||
if (!ctx->first_frame_done) {
|
||||
int pce_size = 0;
|
||||
uint8_t pce_data[MAX_PCE_SIZE];
|
||||
if (!hdr.chan_config) {
|
||||
init_get_bits(&gb, buf, buf_size);
|
||||
if (get_bits(&gb, 3) != 5) {
|
||||
av_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element is", 0);
|
||||
return -1;
|
||||
}
|
||||
init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
|
||||
pce_size = ff_copy_pce_data(&pb, &gb)/8;
|
||||
flush_put_bits(&pb);
|
||||
buf_size -= get_bits_count(&gb)/8;
|
||||
buf += get_bits_count(&gb)/8;
|
||||
}
|
||||
avctx->extradata_size = 2 + pce_size;
|
||||
avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
|
||||
put_bits(&pb, 5, hdr.object_type);
|
||||
put_bits(&pb, 4, hdr.sampling_index);
|
||||
put_bits(&pb, 4, hdr.chan_config);
|
||||
put_bits(&pb, 1, 0); //frame length - 1024 samples
|
||||
put_bits(&pb, 1, 0); //does not depend on core coder
|
||||
put_bits(&pb, 1, 0); //is not extension
|
||||
flush_put_bits(&pb);
|
||||
if (pce_size) {
|
||||
memcpy(avctx->extradata + 2, pce_data, pce_size);
|
||||
}
|
||||
|
||||
ctx->first_frame_done = 1;
|
||||
}
|
||||
|
||||
*poutbuf = (uint8_t*) buf;
|
||||
*poutbuf_size = buf_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVBitStreamFilter aac_adtstoasc_bsf = {
|
||||
"aac_adtstoasc",
|
||||
sizeof(AACBSFContext),
|
||||
aac_adtstoasc_filter,
|
||||
};
|
@@ -23,9 +23,11 @@
|
||||
#include "parser.h"
|
||||
#include "aac_ac3_parser.h"
|
||||
#include "aac_parser.h"
|
||||
#include "get_bits.h"
|
||||
#include "bitstream.h"
|
||||
#include "mpeg4audio.h"
|
||||
|
||||
#define AAC_HEADER_SIZE 7
|
||||
|
||||
int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
|
||||
{
|
||||
int size, rdb, ch, sr;
|
||||
@@ -44,6 +46,9 @@ int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
|
||||
skip_bits1(gbc); /* private_bit */
|
||||
ch = get_bits(gbc, 3); /* channel_configuration */
|
||||
|
||||
if(!ff_mpeg4audio_channels[ch])
|
||||
return AAC_AC3_PARSE_ERROR_CHANNEL_CFG;
|
||||
|
||||
skip_bits1(gbc); /* original/copy */
|
||||
skip_bits1(gbc); /* home */
|
||||
|
||||
@@ -51,7 +56,7 @@ int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
|
||||
skip_bits1(gbc); /* copyright_identification_bit */
|
||||
skip_bits1(gbc); /* copyright_identification_start */
|
||||
size = get_bits(gbc, 13); /* aac_frame_length */
|
||||
if(size < AAC_ADTS_HEADER_SIZE)
|
||||
if(size < AAC_HEADER_SIZE)
|
||||
return AAC_AC3_PARSE_ERROR_FRAME_SIZE;
|
||||
|
||||
skip_bits(gbc, 11); /* adts_buffer_fullness */
|
||||
@@ -81,7 +86,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
||||
} tmp;
|
||||
|
||||
tmp.u64 = be2me_64(state);
|
||||
init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
|
||||
init_get_bits(&bits, tmp.u8+8-AAC_HEADER_SIZE, AAC_HEADER_SIZE * 8);
|
||||
|
||||
if ((size = ff_aac_parse_header(&bits, &hdr)) < 0)
|
||||
return 0;
|
||||
@@ -97,7 +102,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
||||
static av_cold int aac_parse_init(AVCodecParserContext *s1)
|
||||
{
|
||||
AACAC3ParseContext *s = s1->priv_data;
|
||||
s->header_size = AAC_ADTS_HEADER_SIZE;
|
||||
s->header_size = AAC_HEADER_SIZE;
|
||||
s->sync = aac_sync;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -25,9 +25,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "aac_ac3_parser.h"
|
||||
#include "get_bits.h"
|
||||
|
||||
#define AAC_ADTS_HEADER_SIZE 7
|
||||
#include "bitstream.h"
|
||||
|
||||
typedef struct {
|
||||
uint32_t sample_rate;
|
||||
|
@@ -1,960 +0,0 @@
|
||||
/*
|
||||
* AAC coefficients encoder
|
||||
* Copyright (C) 2008-2009 Konstantin Shishkov
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* AAC coefficients encoder
|
||||
*/
|
||||
|
||||
/***********************************
|
||||
* TODOs:
|
||||
* speedup quantizer selection
|
||||
* add sane pulse detection
|
||||
***********************************/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "aac.h"
|
||||
#include "aacenc.h"
|
||||
#include "aactab.h"
|
||||
|
||||
/** bits needed to code codebook run value for long windows */
|
||||
static const uint8_t run_value_bits_long[64] = {
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
|
||||
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
|
||||
};
|
||||
|
||||
/** bits needed to code codebook run value for short windows */
|
||||
static const uint8_t run_value_bits_short[16] = {
|
||||
3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
|
||||
};
|
||||
|
||||
static const uint8_t *run_value_bits[2] = {
|
||||
run_value_bits_long, run_value_bits_short
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Quantize one coefficient.
|
||||
* @return absolute value of the quantized coefficient
|
||||
* @see 3GPP TS26.403 5.6.2 "Scalefactor determination"
|
||||
*/
|
||||
static av_always_inline int quant(float coef, const float Q)
|
||||
{
|
||||
float a = coef * Q;
|
||||
return sqrtf(a * sqrtf(a)) + 0.4054;
|
||||
}
|
||||
|
||||
static void quantize_bands(int (*out)[2], const float *in, const float *scaled,
|
||||
int size, float Q34, int is_signed, int maxval)
|
||||
{
|
||||
int i;
|
||||
double qc;
|
||||
for (i = 0; i < size; i++) {
|
||||
qc = scaled[i] * Q34;
|
||||
out[i][0] = (int)FFMIN(qc, (double)maxval);
|
||||
out[i][1] = (int)FFMIN(qc + 0.4054, (double)maxval);
|
||||
if (is_signed && in[i] < 0.0f) {
|
||||
out[i][0] = -out[i][0];
|
||||
out[i][1] = -out[i][1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void abs_pow34_v(float *out, const float *in, const int size)
|
||||
{
|
||||
#ifndef USE_REALLY_FULL_SEARCH
|
||||
int i;
|
||||
for (i = 0; i < size; i++) {
|
||||
float a = fabsf(in[i]);
|
||||
out[i] = sqrtf(a * sqrtf(a));
|
||||
}
|
||||
#endif /* USE_REALLY_FULL_SEARCH */
|
||||
}
|
||||
|
||||
static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17};
|
||||
static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16};
|
||||
|
||||
/**
|
||||
* Calculate rate distortion cost for quantizing with given codebook
|
||||
*
|
||||
* @return quantization distortion
|
||||
*/
|
||||
static float quantize_and_encode_band_cost(struct AACEncContext *s,
|
||||
PutBitContext *pb, const float *in,
|
||||
const float *scaled, int size, int scale_idx,
|
||||
int cb, const float lambda, const float uplim,
|
||||
int *bits)
|
||||
{
|
||||
const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
|
||||
const float Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
|
||||
const float CLIPPED_ESCAPE = 165140.0f*IQ;
|
||||
int i, j, k;
|
||||
float cost = 0;
|
||||
const int dim = cb < FIRST_PAIR_BT ? 4 : 2;
|
||||
int resbits = 0;
|
||||
#ifndef USE_REALLY_FULL_SEARCH
|
||||
const float Q34 = sqrtf(Q * sqrtf(Q));
|
||||
const int range = aac_cb_range[cb];
|
||||
const int maxval = aac_cb_maxval[cb];
|
||||
int offs[4];
|
||||
#endif /* USE_REALLY_FULL_SEARCH */
|
||||
|
||||
if (!cb) {
|
||||
for (i = 0; i < size; i++)
|
||||
cost += in[i]*in[i];
|
||||
if (bits)
|
||||
*bits = 0;
|
||||
return cost * lambda;
|
||||
}
|
||||
#ifndef USE_REALLY_FULL_SEARCH
|
||||
offs[0] = 1;
|
||||
for (i = 1; i < dim; i++)
|
||||
offs[i] = offs[i-1]*range;
|
||||
if (!scaled) {
|
||||
abs_pow34_v(s->scoefs, in, size);
|
||||
scaled = s->scoefs;
|
||||
}
|
||||
quantize_bands(s->qcoefs, in, scaled, size, Q34, !IS_CODEBOOK_UNSIGNED(cb), maxval);
|
||||
#endif /* USE_REALLY_FULL_SEARCH */
|
||||
for (i = 0; i < size; i += dim) {
|
||||
float mincost;
|
||||
int minidx = 0;
|
||||
int minbits = 0;
|
||||
const float *vec;
|
||||
#ifndef USE_REALLY_FULL_SEARCH
|
||||
int (*quants)[2] = &s->qcoefs[i];
|
||||
mincost = 0.0f;
|
||||
for (j = 0; j < dim; j++)
|
||||
mincost += in[i+j]*in[i+j];
|
||||
minidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;
|
||||
minbits = ff_aac_spectral_bits[cb-1][minidx];
|
||||
mincost = mincost * lambda + minbits;
|
||||
for (j = 0; j < (1<<dim); j++) {
|
||||
float rd = 0.0f;
|
||||
int curbits;
|
||||
int curidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40;
|
||||
int same = 0;
|
||||
for (k = 0; k < dim; k++) {
|
||||
if ((j & (1 << k)) && quants[k][0] == quants[k][1]) {
|
||||
same = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (same)
|
||||
continue;
|
||||
for (k = 0; k < dim; k++)
|
||||
curidx += quants[k][!!(j & (1 << k))] * offs[dim - 1 - k];
|
||||
curbits = ff_aac_spectral_bits[cb-1][curidx];
|
||||
vec = &ff_aac_codebook_vectors[cb-1][curidx*dim];
|
||||
#else
|
||||
mincost = INFINITY;
|
||||
vec = ff_aac_codebook_vectors[cb-1];
|
||||
for (j = 0; j < ff_aac_spectral_sizes[cb-1]; j++, vec += dim) {
|
||||
float rd = 0.0f;
|
||||
int curbits = ff_aac_spectral_bits[cb-1][j];
|
||||
int curidx = j;
|
||||
#endif /* USE_REALLY_FULL_SEARCH */
|
||||
if (IS_CODEBOOK_UNSIGNED(cb)) {
|
||||
for (k = 0; k < dim; k++) {
|
||||
float t = fabsf(in[i+k]);
|
||||
float di;
|
||||
if (vec[k] == 64.0f) { //FIXME: slow
|
||||
//do not code with escape sequence small values
|
||||
if (t < 39.0f*IQ) {
|
||||
rd = INFINITY;
|
||||
break;
|
||||
}
|
||||
if (t >= CLIPPED_ESCAPE) {
|
||||
di = t - CLIPPED_ESCAPE;
|
||||
curbits += 21;
|
||||
} else {
|
||||
int c = av_clip(quant(t, Q), 0, 8191);
|
||||
di = t - c*cbrtf(c)*IQ;
|
||||
curbits += av_log2(c)*2 - 4 + 1;
|
||||
}
|
||||
} else {
|
||||
di = t - vec[k]*IQ;
|
||||
}
|
||||
if (vec[k] != 0.0f)
|
||||
curbits++;
|
||||
rd += di*di;
|
||||
}
|
||||
} else {
|
||||
for (k = 0; k < dim; k++) {
|
||||
float di = in[i+k] - vec[k]*IQ;
|
||||
rd += di*di;
|
||||
}
|
||||
}
|
||||
rd = rd * lambda + curbits;
|
||||
if (rd < mincost) {
|
||||
mincost = rd;
|
||||
minidx = curidx;
|
||||
minbits = curbits;
|
||||
}
|
||||
}
|
||||
cost += mincost;
|
||||
resbits += minbits;
|
||||
if (cost >= uplim)
|
||||
return uplim;
|
||||
if (pb) {
|
||||
put_bits(pb, ff_aac_spectral_bits[cb-1][minidx], ff_aac_spectral_codes[cb-1][minidx]);
|
||||
if (IS_CODEBOOK_UNSIGNED(cb))
|
||||
for (j = 0; j < dim; j++)
|
||||
if (ff_aac_codebook_vectors[cb-1][minidx*dim+j] != 0.0f)
|
||||
put_bits(pb, 1, in[i+j] < 0.0f);
|
||||
if (cb == ESC_BT) {
|
||||
for (j = 0; j < 2; j++) {
|
||||
if (ff_aac_codebook_vectors[cb-1][minidx*2+j] == 64.0f) {
|
||||
int coef = av_clip(quant(fabsf(in[i+j]), Q), 0, 8191);
|
||||
int len = av_log2(coef);
|
||||
|
||||
put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
|
||||
put_bits(pb, len, coef & ((1 << len) - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bits)
|
||||
*bits = resbits;
|
||||
return cost;
|
||||
}
|
||||
static float quantize_band_cost(struct AACEncContext *s, const float *in,
|
||||
const float *scaled, int size, int scale_idx,
|
||||
int cb, const float lambda, const float uplim,
|
||||
int *bits)
|
||||
{
|
||||
return quantize_and_encode_band_cost(s, NULL, in, scaled, size, scale_idx,
|
||||
cb, lambda, uplim, bits);
|
||||
}
|
||||
|
||||
static void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb,
|
||||
const float *in, int size, int scale_idx,
|
||||
int cb, const float lambda)
|
||||
{
|
||||
quantize_and_encode_band_cost(s, pb, in, NULL, size, scale_idx, cb, lambda,
|
||||
INFINITY, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* structure used in optimal codebook search
|
||||
*/
|
||||
typedef struct BandCodingPath {
|
||||
int prev_idx; ///< pointer to the previous path point
|
||||
float cost; ///< path cost
|
||||
int run;
|
||||
} BandCodingPath;
|
||||
|
||||
/**
|
||||
* Encode band info for single window group bands.
|
||||
*/
|
||||
static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce,
|
||||
int win, int group_len, const float lambda)
|
||||
{
|
||||
BandCodingPath path[120][12];
|
||||
int w, swb, cb, start, start2, size;
|
||||
int i, j;
|
||||
const int max_sfb = sce->ics.max_sfb;
|
||||
const int run_bits = sce->ics.num_windows == 1 ? 5 : 3;
|
||||
const int run_esc = (1 << run_bits) - 1;
|
||||
int idx, ppos, count;
|
||||
int stackrun[120], stackcb[120], stack_len;
|
||||
float next_minrd = INFINITY;
|
||||
int next_mincb = 0;
|
||||
|
||||
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
|
||||
start = win*128;
|
||||
for (cb = 0; cb < 12; cb++) {
|
||||
path[0][cb].cost = 0.0f;
|
||||
path[0][cb].prev_idx = -1;
|
||||
path[0][cb].run = 0;
|
||||
}
|
||||
for (swb = 0; swb < max_sfb; swb++) {
|
||||
start2 = start;
|
||||
size = sce->ics.swb_sizes[swb];
|
||||
if (sce->zeroes[win*16 + swb]) {
|
||||
for (cb = 0; cb < 12; cb++) {
|
||||
path[swb+1][cb].prev_idx = cb;
|
||||
path[swb+1][cb].cost = path[swb][cb].cost;
|
||||
path[swb+1][cb].run = path[swb][cb].run + 1;
|
||||
}
|
||||
} else {
|
||||
float minrd = next_minrd;
|
||||
int mincb = next_mincb;
|
||||
next_minrd = INFINITY;
|
||||
next_mincb = 0;
|
||||
for (cb = 0; cb < 12; cb++) {
|
||||
float cost_stay_here, cost_get_here;
|
||||
float rd = 0.0f;
|
||||
for (w = 0; w < group_len; w++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(win+w)*16+swb];
|
||||
rd += quantize_band_cost(s, sce->coeffs + start + w*128,
|
||||
s->scoefs + start + w*128, size,
|
||||
sce->sf_idx[(win+w)*16+swb], cb,
|
||||
lambda / band->threshold, INFINITY, NULL);
|
||||
}
|
||||
cost_stay_here = path[swb][cb].cost + rd;
|
||||
cost_get_here = minrd + rd + run_bits + 4;
|
||||
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
|
||||
!= run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
|
||||
cost_stay_here += run_bits;
|
||||
if (cost_get_here < cost_stay_here) {
|
||||
path[swb+1][cb].prev_idx = mincb;
|
||||
path[swb+1][cb].cost = cost_get_here;
|
||||
path[swb+1][cb].run = 1;
|
||||
} else {
|
||||
path[swb+1][cb].prev_idx = cb;
|
||||
path[swb+1][cb].cost = cost_stay_here;
|
||||
path[swb+1][cb].run = path[swb][cb].run + 1;
|
||||
}
|
||||
if (path[swb+1][cb].cost < next_minrd) {
|
||||
next_minrd = path[swb+1][cb].cost;
|
||||
next_mincb = cb;
|
||||
}
|
||||
}
|
||||
}
|
||||
start += sce->ics.swb_sizes[swb];
|
||||
}
|
||||
|
||||
//convert resulting path from backward-linked list
|
||||
stack_len = 0;
|
||||
idx = 0;
|
||||
for (cb = 1; cb < 12; cb++)
|
||||
if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
|
||||
idx = cb;
|
||||
ppos = max_sfb;
|
||||
while (ppos > 0) {
|
||||
cb = idx;
|
||||
stackrun[stack_len] = path[ppos][cb].run;
|
||||
stackcb [stack_len] = cb;
|
||||
idx = path[ppos-path[ppos][cb].run+1][cb].prev_idx;
|
||||
ppos -= path[ppos][cb].run;
|
||||
stack_len++;
|
||||
}
|
||||
//perform actual band info encoding
|
||||
start = 0;
|
||||
for (i = stack_len - 1; i >= 0; i--) {
|
||||
put_bits(&s->pb, 4, stackcb[i]);
|
||||
count = stackrun[i];
|
||||
memset(sce->zeroes + win*16 + start, !stackcb[i], count);
|
||||
//XXX: memset when band_type is also uint8_t
|
||||
for (j = 0; j < count; j++) {
|
||||
sce->band_type[win*16 + start] = stackcb[i];
|
||||
start++;
|
||||
}
|
||||
while (count >= run_esc) {
|
||||
put_bits(&s->pb, run_bits, run_esc);
|
||||
count -= run_esc;
|
||||
}
|
||||
put_bits(&s->pb, run_bits, count);
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct TrellisPath {
|
||||
float cost;
|
||||
int prev;
|
||||
int min_val;
|
||||
int max_val;
|
||||
} TrellisPath;
|
||||
|
||||
#define TRELLIS_STAGES 121
|
||||
#define TRELLIS_STATES 256
|
||||
|
||||
static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
|
||||
SingleChannelElement *sce,
|
||||
const float lambda)
|
||||
{
|
||||
int q, w, w2, g, start = 0;
|
||||
int i, j;
|
||||
int idx;
|
||||
TrellisPath paths[TRELLIS_STAGES][TRELLIS_STATES];
|
||||
int bandaddr[TRELLIS_STAGES];
|
||||
int minq;
|
||||
float mincost;
|
||||
|
||||
for (i = 0; i < TRELLIS_STATES; i++) {
|
||||
paths[0][i].cost = 0.0f;
|
||||
paths[0][i].prev = -1;
|
||||
paths[0][i].min_val = i;
|
||||
paths[0][i].max_val = i;
|
||||
}
|
||||
for (j = 1; j < TRELLIS_STAGES; j++) {
|
||||
for (i = 0; i < TRELLIS_STATES; i++) {
|
||||
paths[j][i].cost = INFINITY;
|
||||
paths[j][i].prev = -2;
|
||||
paths[j][i].min_val = INT_MAX;
|
||||
paths[j][i].max_val = 0;
|
||||
}
|
||||
}
|
||||
idx = 1;
|
||||
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
const float *coefs = sce->coeffs + start;
|
||||
float qmin, qmax;
|
||||
int nz = 0;
|
||||
|
||||
bandaddr[idx] = w * 16 + g;
|
||||
qmin = INT_MAX;
|
||||
qmax = 0.0f;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
if (band->energy <= band->threshold || band->threshold == 0.0f) {
|
||||
sce->zeroes[(w+w2)*16+g] = 1;
|
||||
continue;
|
||||
}
|
||||
sce->zeroes[(w+w2)*16+g] = 0;
|
||||
nz = 1;
|
||||
for (i = 0; i < sce->ics.swb_sizes[g]; i++) {
|
||||
float t = fabsf(coefs[w2*128+i]);
|
||||
if (t > 0.0f)
|
||||
qmin = FFMIN(qmin, t);
|
||||
qmax = FFMAX(qmax, t);
|
||||
}
|
||||
}
|
||||
if (nz) {
|
||||
int minscale, maxscale;
|
||||
float minrd = INFINITY;
|
||||
//minimum scalefactor index is when minimum nonzero coefficient after quantizing is not clipped
|
||||
minscale = av_clip_uint8(log2(qmin)*4 - 69 + SCALE_ONE_POS - SCALE_DIV_512);
|
||||
//maximum scalefactor index is when maximum coefficient after quantizing is still not zero
|
||||
maxscale = av_clip_uint8(log2(qmax)*4 + 6 + SCALE_ONE_POS - SCALE_DIV_512);
|
||||
for (q = minscale; q < maxscale; q++) {
|
||||
float dists[12], dist;
|
||||
memset(dists, 0, sizeof(dists));
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
int cb;
|
||||
for (cb = 0; cb <= ESC_BT; cb++)
|
||||
dists[cb] += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
|
||||
q, cb, lambda / band->threshold, INFINITY, NULL);
|
||||
}
|
||||
dist = dists[0];
|
||||
for (i = 1; i <= ESC_BT; i++)
|
||||
dist = FFMIN(dist, dists[i]);
|
||||
minrd = FFMIN(minrd, dist);
|
||||
|
||||
for (i = FFMAX(q - SCALE_MAX_DIFF, 0); i < FFMIN(q + SCALE_MAX_DIFF, TRELLIS_STATES); i++) {
|
||||
float cost;
|
||||
int minv, maxv;
|
||||
if (isinf(paths[idx - 1][i].cost))
|
||||
continue;
|
||||
cost = paths[idx - 1][i].cost + dist
|
||||
+ ff_aac_scalefactor_bits[q - i + SCALE_DIFF_ZERO];
|
||||
minv = FFMIN(paths[idx - 1][i].min_val, q);
|
||||
maxv = FFMAX(paths[idx - 1][i].max_val, q);
|
||||
if (cost < paths[idx][q].cost && maxv-minv < SCALE_MAX_DIFF) {
|
||||
paths[idx][q].cost = cost;
|
||||
paths[idx][q].prev = i;
|
||||
paths[idx][q].min_val = minv;
|
||||
paths[idx][q].max_val = maxv;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (q = 0; q < TRELLIS_STATES; q++) {
|
||||
if (!isinf(paths[idx - 1][q].cost)) {
|
||||
paths[idx][q].cost = paths[idx - 1][q].cost + 1;
|
||||
paths[idx][q].prev = q;
|
||||
paths[idx][q].min_val = FFMIN(paths[idx - 1][q].min_val, q);
|
||||
paths[idx][q].max_val = FFMAX(paths[idx - 1][q].max_val, q);
|
||||
continue;
|
||||
}
|
||||
for (i = FFMAX(q - SCALE_MAX_DIFF, 0); i < FFMIN(q + SCALE_MAX_DIFF, TRELLIS_STATES); i++) {
|
||||
float cost;
|
||||
int minv, maxv;
|
||||
if (isinf(paths[idx - 1][i].cost))
|
||||
continue;
|
||||
cost = paths[idx - 1][i].cost + ff_aac_scalefactor_bits[q - i + SCALE_DIFF_ZERO];
|
||||
minv = FFMIN(paths[idx - 1][i].min_val, q);
|
||||
maxv = FFMAX(paths[idx - 1][i].max_val, q);
|
||||
if (cost < paths[idx][q].cost && maxv-minv < SCALE_MAX_DIFF) {
|
||||
paths[idx][q].cost = cost;
|
||||
paths[idx][q].prev = i;
|
||||
paths[idx][q].min_val = minv;
|
||||
paths[idx][q].max_val = maxv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sce->zeroes[w*16+g] = !nz;
|
||||
start += sce->ics.swb_sizes[g];
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
idx--;
|
||||
mincost = paths[idx][0].cost;
|
||||
minq = 0;
|
||||
for (i = 1; i < TRELLIS_STATES; i++) {
|
||||
if (paths[idx][i].cost < mincost) {
|
||||
mincost = paths[idx][i].cost;
|
||||
minq = i;
|
||||
}
|
||||
}
|
||||
while (idx) {
|
||||
sce->sf_idx[bandaddr[idx]] = minq;
|
||||
minq = paths[idx][minq].prev;
|
||||
idx--;
|
||||
}
|
||||
//set the same quantizers inside window groups
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
|
||||
for (g = 0; g < sce->ics.num_swb; g++)
|
||||
for (w2 = 1; w2 < sce->ics.group_len[w]; w2++)
|
||||
sce->sf_idx[(w+w2)*16+g] = sce->sf_idx[w*16+g];
|
||||
}
|
||||
|
||||
/**
|
||||
* two-loop quantizers search taken from ISO 13818-7 Appendix C
|
||||
*/
|
||||
static void search_for_quantizers_twoloop(AVCodecContext *avctx,
|
||||
AACEncContext *s,
|
||||
SingleChannelElement *sce,
|
||||
const float lambda)
|
||||
{
|
||||
int start = 0, i, w, w2, g;
|
||||
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
|
||||
float dists[128], uplims[128];
|
||||
int fflag, minscaler;
|
||||
int its = 0;
|
||||
int allz = 0;
|
||||
float minthr = INFINITY;
|
||||
|
||||
//XXX: some heuristic to determine initial quantizers will reduce search time
|
||||
memset(dists, 0, sizeof(dists));
|
||||
//determine zero bands and upper limits
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
int nz = 0;
|
||||
float uplim = 0.0f;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
uplim += band->threshold;
|
||||
if (band->energy <= band->threshold || band->threshold == 0.0f) {
|
||||
sce->zeroes[(w+w2)*16+g] = 1;
|
||||
continue;
|
||||
}
|
||||
nz = 1;
|
||||
}
|
||||
uplims[w*16+g] = uplim *512;
|
||||
sce->zeroes[w*16+g] = !nz;
|
||||
if (nz)
|
||||
minthr = FFMIN(minthr, uplim);
|
||||
allz = FFMAX(allz, nz);
|
||||
}
|
||||
}
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
if (sce->zeroes[w*16+g]) {
|
||||
sce->sf_idx[w*16+g] = SCALE_ONE_POS;
|
||||
continue;
|
||||
}
|
||||
sce->sf_idx[w*16+g] = SCALE_ONE_POS + FFMIN(log2(uplims[w*16+g]/minthr)*4,59);
|
||||
}
|
||||
}
|
||||
|
||||
if (!allz)
|
||||
return;
|
||||
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
|
||||
//perform two-loop search
|
||||
//outer loop - improve quality
|
||||
do {
|
||||
int tbits, qstep;
|
||||
minscaler = sce->sf_idx[0];
|
||||
//inner loop - quantize spectrum to fit into given number of bits
|
||||
qstep = its ? 1 : 32;
|
||||
do {
|
||||
int prev = -1;
|
||||
tbits = 0;
|
||||
fflag = 0;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
const float *coefs = sce->coeffs + start;
|
||||
const float *scaled = s->scoefs + start;
|
||||
int bits = 0;
|
||||
int cb;
|
||||
float mindist = INFINITY;
|
||||
int minbits = 0;
|
||||
|
||||
if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
|
||||
start += sce->ics.swb_sizes[g];
|
||||
continue;
|
||||
}
|
||||
minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
|
||||
for (cb = 0; cb <= ESC_BT; cb++) {
|
||||
float dist = 0.0f;
|
||||
int bb = 0;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
int b;
|
||||
dist += quantize_band_cost(s, coefs + w2*128,
|
||||
scaled + w2*128,
|
||||
sce->ics.swb_sizes[g],
|
||||
sce->sf_idx[w*16+g],
|
||||
cb,
|
||||
lambda,
|
||||
INFINITY,
|
||||
&b);
|
||||
bb += b;
|
||||
}
|
||||
if (dist < mindist) {
|
||||
mindist = dist;
|
||||
minbits = bb;
|
||||
}
|
||||
}
|
||||
dists[w*16+g] = (mindist - minbits) / lambda;
|
||||
bits = minbits;
|
||||
if (prev != -1) {
|
||||
bits += ff_aac_scalefactor_bits[sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO];
|
||||
}
|
||||
tbits += bits;
|
||||
start += sce->ics.swb_sizes[g];
|
||||
prev = sce->sf_idx[w*16+g];
|
||||
}
|
||||
}
|
||||
if (tbits > destbits) {
|
||||
for (i = 0; i < 128; i++)
|
||||
if (sce->sf_idx[i] < 218 - qstep)
|
||||
sce->sf_idx[i] += qstep;
|
||||
} else {
|
||||
for (i = 0; i < 128; i++)
|
||||
if (sce->sf_idx[i] > 60 - qstep)
|
||||
sce->sf_idx[i] -= qstep;
|
||||
}
|
||||
qstep >>= 1;
|
||||
if (!qstep && tbits > destbits*1.02)
|
||||
qstep = 1;
|
||||
if (sce->sf_idx[0] >= 217)
|
||||
break;
|
||||
} while (qstep);
|
||||
|
||||
fflag = 0;
|
||||
minscaler = av_clip(minscaler, 60, 255 - SCALE_MAX_DIFF);
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
int prevsc = sce->sf_idx[w*16+g];
|
||||
if (dists[w*16+g] > uplims[w*16+g] && sce->sf_idx[w*16+g] > 60)
|
||||
sce->sf_idx[w*16+g]--;
|
||||
sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF);
|
||||
sce->sf_idx[w*16+g] = FFMIN(sce->sf_idx[w*16+g], 219);
|
||||
if (sce->sf_idx[w*16+g] != prevsc)
|
||||
fflag = 1;
|
||||
}
|
||||
}
|
||||
its++;
|
||||
} while (fflag && its < 10);
|
||||
}
|
||||
|
||||
static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
|
||||
SingleChannelElement *sce,
|
||||
const float lambda)
|
||||
{
|
||||
int start = 0, i, w, w2, g;
|
||||
float uplim[128], maxq[128];
|
||||
int minq, maxsf;
|
||||
float distfact = ((sce->ics.num_windows > 1) ? 85.80 : 147.84) / lambda;
|
||||
int last = 0, lastband = 0, curband = 0;
|
||||
float avg_energy = 0.0;
|
||||
if (sce->ics.num_windows == 1) {
|
||||
start = 0;
|
||||
for (i = 0; i < 1024; i++) {
|
||||
if (i - start >= sce->ics.swb_sizes[curband]) {
|
||||
start += sce->ics.swb_sizes[curband];
|
||||
curband++;
|
||||
}
|
||||
if (sce->coeffs[i]) {
|
||||
avg_energy += sce->coeffs[i] * sce->coeffs[i];
|
||||
last = i;
|
||||
lastband = curband;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (w = 0; w < 8; w++) {
|
||||
const float *coeffs = sce->coeffs + w*128;
|
||||
start = 0;
|
||||
for (i = 0; i < 128; i++) {
|
||||
if (i - start >= sce->ics.swb_sizes[curband]) {
|
||||
start += sce->ics.swb_sizes[curband];
|
||||
curband++;
|
||||
}
|
||||
if (coeffs[i]) {
|
||||
avg_energy += coeffs[i] * coeffs[i];
|
||||
last = FFMAX(last, i);
|
||||
lastband = FFMAX(lastband, curband);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
last++;
|
||||
avg_energy /= last;
|
||||
if (avg_energy == 0.0f) {
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(sce->sf_idx); i++)
|
||||
sce->sf_idx[i] = SCALE_ONE_POS;
|
||||
return;
|
||||
}
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
float *coefs = sce->coeffs + start;
|
||||
const int size = sce->ics.swb_sizes[g];
|
||||
int start2 = start, end2 = start + size, peakpos = start;
|
||||
float maxval = -1, thr = 0.0f, t;
|
||||
maxq[w*16+g] = 0.0f;
|
||||
if (g > lastband) {
|
||||
maxq[w*16+g] = 0.0f;
|
||||
start += size;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++)
|
||||
memset(coefs + w2*128, 0, sizeof(coefs[0])*size);
|
||||
continue;
|
||||
}
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
for (i = 0; i < size; i++) {
|
||||
float t = coefs[w2*128+i]*coefs[w2*128+i];
|
||||
maxq[w*16+g] = FFMAX(maxq[w*16+g], fabsf(coefs[w2*128 + i]));
|
||||
thr += t;
|
||||
if (sce->ics.num_windows == 1 && maxval < t) {
|
||||
maxval = t;
|
||||
peakpos = start+i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sce->ics.num_windows == 1) {
|
||||
start2 = FFMAX(peakpos - 2, start2);
|
||||
end2 = FFMIN(peakpos + 3, end2);
|
||||
} else {
|
||||
start2 -= start;
|
||||
end2 -= start;
|
||||
}
|
||||
start += size;
|
||||
thr = pow(thr / (avg_energy * (end2 - start2)), 0.3 + 0.1*(lastband - g) / lastband);
|
||||
t = 1.0 - (1.0 * start2 / last);
|
||||
uplim[w*16+g] = distfact / (1.4 * thr + t*t*t + 0.075);
|
||||
}
|
||||
}
|
||||
memset(sce->sf_idx, 0, sizeof(sce->sf_idx));
|
||||
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
const float *coefs = sce->coeffs + start;
|
||||
const float *scaled = s->scoefs + start;
|
||||
const int size = sce->ics.swb_sizes[g];
|
||||
int scf, prev_scf, step;
|
||||
int min_scf = -1, max_scf = 256;
|
||||
float curdiff;
|
||||
if (maxq[w*16+g] < 21.544) {
|
||||
sce->zeroes[w*16+g] = 1;
|
||||
start += size;
|
||||
continue;
|
||||
}
|
||||
sce->zeroes[w*16+g] = 0;
|
||||
scf = prev_scf = av_clip(SCALE_ONE_POS - SCALE_DIV_512 - log2(1/maxq[w*16+g])*16/3, 60, 218);
|
||||
step = 16;
|
||||
for (;;) {
|
||||
float dist = 0.0f;
|
||||
int quant_max;
|
||||
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
int b;
|
||||
dist += quantize_band_cost(s, coefs + w2*128,
|
||||
scaled + w2*128,
|
||||
sce->ics.swb_sizes[g],
|
||||
scf,
|
||||
ESC_BT,
|
||||
lambda,
|
||||
INFINITY,
|
||||
&b);
|
||||
dist -= b;
|
||||
}
|
||||
dist *= 1.0f / 512.0f / lambda;
|
||||
quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[200 - scf + SCALE_ONE_POS - SCALE_DIV_512]);
|
||||
if (quant_max >= 8191) { // too much, return to the previous quantizer
|
||||
sce->sf_idx[w*16+g] = prev_scf;
|
||||
break;
|
||||
}
|
||||
prev_scf = scf;
|
||||
curdiff = fabsf(dist - uplim[w*16+g]);
|
||||
if (curdiff <= 1.0f)
|
||||
step = 0;
|
||||
else
|
||||
step = log2(curdiff);
|
||||
if (dist > uplim[w*16+g])
|
||||
step = -step;
|
||||
scf += step;
|
||||
scf = av_clip_uint8(scf);
|
||||
step = scf - prev_scf;
|
||||
if (FFABS(step) <= 1 || (step > 0 && scf >= max_scf) || (step < 0 && scf <= min_scf)) {
|
||||
sce->sf_idx[w*16+g] = av_clip(scf, min_scf, max_scf);
|
||||
break;
|
||||
}
|
||||
if (step > 0)
|
||||
min_scf = prev_scf;
|
||||
else
|
||||
max_scf = prev_scf;
|
||||
}
|
||||
start += size;
|
||||
}
|
||||
}
|
||||
minq = sce->sf_idx[0] ? sce->sf_idx[0] : INT_MAX;
|
||||
for (i = 1; i < 128; i++) {
|
||||
if (!sce->sf_idx[i])
|
||||
sce->sf_idx[i] = sce->sf_idx[i-1];
|
||||
else
|
||||
minq = FFMIN(minq, sce->sf_idx[i]);
|
||||
}
|
||||
if (minq == INT_MAX)
|
||||
minq = 0;
|
||||
minq = FFMIN(minq, SCALE_MAX_POS);
|
||||
maxsf = FFMIN(minq + SCALE_MAX_DIFF, SCALE_MAX_POS);
|
||||
for (i = 126; i >= 0; i--) {
|
||||
if (!sce->sf_idx[i])
|
||||
sce->sf_idx[i] = sce->sf_idx[i+1];
|
||||
sce->sf_idx[i] = av_clip(sce->sf_idx[i], minq, maxsf);
|
||||
}
|
||||
}
|
||||
|
||||
static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s,
|
||||
SingleChannelElement *sce,
|
||||
const float lambda)
|
||||
{
|
||||
int start = 0, i, w, w2, g;
|
||||
int minq = 255;
|
||||
|
||||
memset(sce->sf_idx, 0, sizeof(sce->sf_idx));
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
if (band->energy <= band->threshold) {
|
||||
sce->sf_idx[(w+w2)*16+g] = 218;
|
||||
sce->zeroes[(w+w2)*16+g] = 1;
|
||||
} else {
|
||||
sce->sf_idx[(w+w2)*16+g] = av_clip(SCALE_ONE_POS - SCALE_DIV_512 + log2(band->threshold), 80, 218);
|
||||
sce->zeroes[(w+w2)*16+g] = 0;
|
||||
}
|
||||
minq = FFMIN(minq, sce->sf_idx[(w+w2)*16+g]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 128; i++) {
|
||||
sce->sf_idx[i] = 140;
|
||||
//av_clip(sce->sf_idx[i], minq, minq + SCALE_MAX_DIFF - 1);
|
||||
}
|
||||
//set the same quantizers inside window groups
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
|
||||
for (g = 0; g < sce->ics.num_swb; g++)
|
||||
for (w2 = 1; w2 < sce->ics.group_len[w]; w2++)
|
||||
sce->sf_idx[(w+w2)*16+g] = sce->sf_idx[w*16+g];
|
||||
}
|
||||
|
||||
static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
|
||||
const float lambda)
|
||||
{
|
||||
int start = 0, i, w, w2, g;
|
||||
float M[128], S[128];
|
||||
float *L34 = s->scoefs, *R34 = s->scoefs + 128, *M34 = s->scoefs + 128*2, *S34 = s->scoefs + 128*3;
|
||||
SingleChannelElement *sce0 = &cpe->ch[0];
|
||||
SingleChannelElement *sce1 = &cpe->ch[1];
|
||||
if (!cpe->common_window)
|
||||
return;
|
||||
for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
|
||||
for (g = 0; g < sce0->ics.num_swb; g++) {
|
||||
if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {
|
||||
float dist1 = 0.0f, dist2 = 0.0f;
|
||||
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band0 = &s->psy.psy_bands[(s->cur_channel+0)*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
FFPsyBand *band1 = &s->psy.psy_bands[(s->cur_channel+1)*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
float minthr = FFMIN(band0->threshold, band1->threshold);
|
||||
float maxthr = FFMAX(band0->threshold, band1->threshold);
|
||||
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
|
||||
M[i] = (sce0->coeffs[start+w2*128+i]
|
||||
+ sce1->coeffs[start+w2*128+i]) * 0.5;
|
||||
S[i] = sce0->coeffs[start+w2*128+i]
|
||||
- sce1->coeffs[start+w2*128+i];
|
||||
}
|
||||
abs_pow34_v(L34, sce0->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
|
||||
abs_pow34_v(R34, sce1->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
|
||||
abs_pow34_v(M34, M, sce0->ics.swb_sizes[g]);
|
||||
abs_pow34_v(S34, S, sce0->ics.swb_sizes[g]);
|
||||
dist1 += quantize_band_cost(s, sce0->coeffs + start + w2*128,
|
||||
L34,
|
||||
sce0->ics.swb_sizes[g],
|
||||
sce0->sf_idx[(w+w2)*16+g],
|
||||
sce0->band_type[(w+w2)*16+g],
|
||||
lambda / band0->threshold, INFINITY, NULL);
|
||||
dist1 += quantize_band_cost(s, sce1->coeffs + start + w2*128,
|
||||
R34,
|
||||
sce1->ics.swb_sizes[g],
|
||||
sce1->sf_idx[(w+w2)*16+g],
|
||||
sce1->band_type[(w+w2)*16+g],
|
||||
lambda / band1->threshold, INFINITY, NULL);
|
||||
dist2 += quantize_band_cost(s, M,
|
||||
M34,
|
||||
sce0->ics.swb_sizes[g],
|
||||
sce0->sf_idx[(w+w2)*16+g],
|
||||
sce0->band_type[(w+w2)*16+g],
|
||||
lambda / maxthr, INFINITY, NULL);
|
||||
dist2 += quantize_band_cost(s, S,
|
||||
S34,
|
||||
sce1->ics.swb_sizes[g],
|
||||
sce1->sf_idx[(w+w2)*16+g],
|
||||
sce1->band_type[(w+w2)*16+g],
|
||||
lambda / minthr, INFINITY, NULL);
|
||||
}
|
||||
cpe->ms_mask[w*16+g] = dist2 < dist1;
|
||||
}
|
||||
start += sce0->ics.swb_sizes[g];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AACCoefficientsEncoder ff_aac_coders[] = {
|
||||
{
|
||||
search_for_quantizers_faac,
|
||||
encode_window_bands_info,
|
||||
quantize_and_encode_band,
|
||||
search_for_ms,
|
||||
},
|
||||
{
|
||||
search_for_quantizers_anmr,
|
||||
encode_window_bands_info,
|
||||
quantize_and_encode_band,
|
||||
search_for_ms,
|
||||
},
|
||||
{
|
||||
search_for_quantizers_twoloop,
|
||||
encode_window_bands_info,
|
||||
quantize_and_encode_band,
|
||||
search_for_ms,
|
||||
},
|
||||
{
|
||||
search_for_quantizers_fast,
|
||||
encode_window_bands_info,
|
||||
quantize_and_encode_band,
|
||||
search_for_ms,
|
||||
},
|
||||
};
|
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aacdectab.h
|
||||
* AAC decoder data
|
||||
* @author Oded Shimon ( ods15 ods15 dyndns org )
|
||||
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
|
||||
@@ -34,6 +34,145 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* @name swb_offsets
|
||||
* Sample offset into the window indicating the beginning of a scalefactor
|
||||
* window band
|
||||
*
|
||||
* scalefactor window band - term for scalefactor bands within a window,
|
||||
* given in Table 4.110 to Table 4.128.
|
||||
*
|
||||
* scalefactor band - a set of spectral coefficients which are scaled by one
|
||||
* scalefactor. In case of EIGHT_SHORT_SEQUENCE and grouping a scalefactor band
|
||||
* may contain several scalefactor window bands of corresponding frequency. For
|
||||
* all other window_sequences scalefactor bands and scalefactor window bands are
|
||||
* identical.
|
||||
* @{
|
||||
*/
|
||||
|
||||
static const uint16_t swb_offset_1024_96[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 44, 48, 52, 56, 64,
|
||||
72, 80, 88, 96, 108, 120, 132, 144,
|
||||
156, 172, 188, 212, 240, 276, 320, 384,
|
||||
448, 512, 576, 640, 704, 768, 832, 896,
|
||||
960, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_96[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_64[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 44, 48, 52, 56, 64,
|
||||
72, 80, 88, 100, 112, 124, 140, 156,
|
||||
172, 192, 216, 240, 268, 304, 344, 384,
|
||||
424, 464, 504, 544, 584, 624, 664, 704,
|
||||
744, 784, 824, 864, 904, 944, 984, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_48[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 48, 56, 64, 72, 80,
|
||||
88, 96, 108, 120, 132, 144, 160, 176,
|
||||
196, 216, 240, 264, 292, 320, 352, 384,
|
||||
416, 448, 480, 512, 544, 576, 608, 640,
|
||||
672, 704, 736, 768, 800, 832, 864, 896,
|
||||
928, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_48[] = {
|
||||
0, 4, 8, 12, 16, 20, 28, 36,
|
||||
44, 56, 68, 80, 96, 112, 128
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_32[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 48, 56, 64, 72, 80,
|
||||
88, 96, 108, 120, 132, 144, 160, 176,
|
||||
196, 216, 240, 264, 292, 320, 352, 384,
|
||||
416, 448, 480, 512, 544, 576, 608, 640,
|
||||
672, 704, 736, 768, 800, 832, 864, 896,
|
||||
928, 960, 992, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_24[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 44, 52, 60, 68, 76,
|
||||
84, 92, 100, 108, 116, 124, 136, 148,
|
||||
160, 172, 188, 204, 220, 240, 260, 284,
|
||||
308, 336, 364, 396, 432, 468, 508, 552,
|
||||
600, 652, 704, 768, 832, 896, 960, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_24[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
36, 44, 52, 64, 76, 92, 108, 128
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_16[] = {
|
||||
0, 8, 16, 24, 32, 40, 48, 56,
|
||||
64, 72, 80, 88, 100, 112, 124, 136,
|
||||
148, 160, 172, 184, 196, 212, 228, 244,
|
||||
260, 280, 300, 320, 344, 368, 396, 424,
|
||||
456, 492, 532, 572, 616, 664, 716, 772,
|
||||
832, 896, 960, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_16[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 40, 48, 60, 72, 88, 108, 128
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_8[] = {
|
||||
0, 12, 24, 36, 48, 60, 72, 84,
|
||||
96, 108, 120, 132, 144, 156, 172, 188,
|
||||
204, 220, 236, 252, 268, 288, 308, 328,
|
||||
348, 372, 396, 420, 448, 476, 508, 544,
|
||||
580, 620, 664, 712, 764, 820, 880, 944,
|
||||
1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_8[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
36, 44, 52, 60, 72, 88, 108, 128
|
||||
};
|
||||
|
||||
static const uint16_t *swb_offset_1024[] = {
|
||||
swb_offset_1024_96, swb_offset_1024_96, swb_offset_1024_64,
|
||||
swb_offset_1024_48, swb_offset_1024_48, swb_offset_1024_32,
|
||||
swb_offset_1024_24, swb_offset_1024_24, swb_offset_1024_16,
|
||||
swb_offset_1024_16, swb_offset_1024_16, swb_offset_1024_8,
|
||||
swb_offset_1024_8
|
||||
};
|
||||
|
||||
static const uint16_t *swb_offset_128[] = {
|
||||
/* The last entry on the following row is swb_offset_128_64 but is a
|
||||
duplicate of swb_offset_128_96. */
|
||||
swb_offset_128_96, swb_offset_128_96, swb_offset_128_96,
|
||||
swb_offset_128_48, swb_offset_128_48, swb_offset_128_48,
|
||||
swb_offset_128_24, swb_offset_128_24, swb_offset_128_16,
|
||||
swb_offset_128_16, swb_offset_128_16, swb_offset_128_8,
|
||||
swb_offset_128_8
|
||||
};
|
||||
|
||||
// @}
|
||||
|
||||
/* @name tns_max_bands
|
||||
* The maximum number of scalefactor bands on which TNS can operate for the long
|
||||
* and short transforms respectively. The index to these tables is related to
|
||||
* the sample rate of the audio.
|
||||
* @{
|
||||
*/
|
||||
static const uint8_t tns_max_bands_1024[] = {
|
||||
31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, 39
|
||||
};
|
||||
|
||||
static const uint8_t tns_max_bands_128[] = {
|
||||
9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14
|
||||
};
|
||||
// @}
|
||||
|
||||
/* @name tns_tmp2_map
|
||||
* Tables of the tmp2[] arrays of LPC coefficients used for TNS.
|
||||
* The suffix _M_N[] indicate the values of coef_compress and coef_res
|
||||
@@ -69,27 +208,4 @@ static const float * const tns_tmp2_map[4] = {
|
||||
};
|
||||
// @}
|
||||
|
||||
static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
static const uint8_t aac_channel_layout_map[7][5][2] = {
|
||||
{ { TYPE_SCE, 0 }, },
|
||||
{ { TYPE_CPE, 0 }, },
|
||||
{ { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, },
|
||||
{ { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_SCE, 1 }, },
|
||||
{ { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_CPE, 1 }, },
|
||||
{ { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_LFE, 0 }, { TYPE_CPE, 1 }, },
|
||||
{ { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_LFE, 0 }, { TYPE_CPE, 2 }, { TYPE_CPE, 1 }, },
|
||||
};
|
||||
|
||||
static const int64_t aac_channel_layout[8] = {
|
||||
CH_LAYOUT_MONO,
|
||||
CH_LAYOUT_STEREO,
|
||||
CH_LAYOUT_SURROUND,
|
||||
CH_LAYOUT_4POINT0,
|
||||
CH_LAYOUT_5POINT0_BACK,
|
||||
CH_LAYOUT_5POINT1_BACK,
|
||||
CH_LAYOUT_7POINT1_WIDE,
|
||||
0,
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_AACDECTAB_H */
|
||||
|
@@ -20,26 +20,25 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aacenc.c
|
||||
* AAC encoder
|
||||
*/
|
||||
|
||||
/***********************************
|
||||
* TODOs:
|
||||
* psy model selection with some option
|
||||
* add sane pulse detection
|
||||
* add temporal noise shaping
|
||||
***********************************/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "bitstream.h"
|
||||
#include "dsputil.h"
|
||||
#include "mpeg4audio.h"
|
||||
|
||||
#include "aacpsy.h"
|
||||
#include "aac.h"
|
||||
#include "aactab.h"
|
||||
#include "aacenc.h"
|
||||
|
||||
#include "psymodel.h"
|
||||
|
||||
static const uint8_t swb_size_1024_96[] = {
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
|
||||
@@ -84,7 +83,7 @@ static const uint8_t swb_size_1024_8[] = {
|
||||
32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80
|
||||
};
|
||||
|
||||
static const uint8_t *swb_size_1024[] = {
|
||||
static const uint8_t * const swb_size_1024[] = {
|
||||
swb_size_1024_96, swb_size_1024_96, swb_size_1024_64,
|
||||
swb_size_1024_48, swb_size_1024_48, swb_size_1024_32,
|
||||
swb_size_1024_24, swb_size_1024_24, swb_size_1024_16,
|
||||
@@ -111,7 +110,7 @@ static const uint8_t swb_size_128_8[] = {
|
||||
4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 16, 20, 20
|
||||
};
|
||||
|
||||
static const uint8_t *swb_size_128[] = {
|
||||
static const uint8_t * const swb_size_128[] = {
|
||||
/* the last entry on the following row is swb_size_128_64 but is a
|
||||
duplicate of swb_size_128_96 */
|
||||
swb_size_128_96, swb_size_128_96, swb_size_128_96,
|
||||
@@ -120,6 +119,23 @@ static const uint8_t *swb_size_128[] = {
|
||||
swb_size_128_16, swb_size_128_16, swb_size_128_8
|
||||
};
|
||||
|
||||
/** bits needed to code codebook run value for long windows */
|
||||
static const uint8_t run_value_bits_long[64] = {
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
|
||||
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
|
||||
};
|
||||
|
||||
/** bits needed to code codebook run value for short windows */
|
||||
static const uint8_t run_value_bits_short[16] = {
|
||||
3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
|
||||
};
|
||||
|
||||
static const uint8_t* const run_value_bits[2] = {
|
||||
run_value_bits_long, run_value_bits_short
|
||||
};
|
||||
|
||||
/** default channel configurations */
|
||||
static const uint8_t aac_chan_configs[6][5] = {
|
||||
{1, TYPE_SCE}, // 1 channel - single channel element
|
||||
@@ -130,6 +146,33 @@ static const uint8_t aac_chan_configs[6][5] = {
|
||||
{4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
|
||||
};
|
||||
|
||||
/**
|
||||
* structure used in optimal codebook search
|
||||
*/
|
||||
typedef struct BandCodingPath {
|
||||
int prev_idx; ///< pointer to the previous path point
|
||||
int codebook; ///< codebook for coding band run
|
||||
int bits; ///< number of bit needed to code given number of bands
|
||||
} BandCodingPath;
|
||||
|
||||
/**
|
||||
* AAC encoder context
|
||||
*/
|
||||
typedef struct {
|
||||
PutBitContext pb;
|
||||
MDCTContext mdct1024; ///< long (1024 samples) frame transform context
|
||||
MDCTContext mdct128; ///< short (128 samples) frame transform context
|
||||
DSPContext dsp;
|
||||
DECLARE_ALIGNED_16(FFTSample, output[2048]); ///< temporary buffer for MDCT input coefficients
|
||||
int16_t* samples; ///< saved preprocessed input
|
||||
|
||||
int samplerate_index; ///< MPEG-4 samplerate index
|
||||
|
||||
ChannelElement *cpe; ///< channel elements
|
||||
AACPsyContext psy; ///< psychoacoustic model context
|
||||
int last_frame;
|
||||
} AACEncContext;
|
||||
|
||||
/**
|
||||
* Make AAC audio config object.
|
||||
* @see 1.6.2.1 "Syntax - AudioSpecificConfig"
|
||||
@@ -154,250 +197,82 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
AACEncContext *s = avctx->priv_data;
|
||||
int i;
|
||||
const uint8_t *sizes[2];
|
||||
int lengths[2];
|
||||
|
||||
avctx->frame_size = 1024;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
if (avctx->sample_rate == ff_mpeg4audio_sample_rates[i])
|
||||
for(i = 0; i < 16; i++)
|
||||
if(avctx->sample_rate == ff_mpeg4audio_sample_rates[i])
|
||||
break;
|
||||
if (i == 16) {
|
||||
if(i == 16){
|
||||
av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n", avctx->sample_rate);
|
||||
return -1;
|
||||
}
|
||||
if (avctx->channels > 6) {
|
||||
if(avctx->channels > 6){
|
||||
av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n", avctx->channels);
|
||||
return -1;
|
||||
}
|
||||
if (avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unsupported profile %d\n", avctx->profile);
|
||||
return -1;
|
||||
}
|
||||
if (1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * avctx->channels) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Too many bits per frame requested\n");
|
||||
return -1;
|
||||
}
|
||||
s->samplerate_index = i;
|
||||
|
||||
dsputil_init(&s->dsp, avctx);
|
||||
ff_mdct_init(&s->mdct1024, 11, 0, 1.0);
|
||||
ff_mdct_init(&s->mdct128, 8, 0, 1.0);
|
||||
ff_mdct_init(&s->mdct1024, 11, 0);
|
||||
ff_mdct_init(&s->mdct128, 8, 0);
|
||||
// window init
|
||||
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
|
||||
ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
|
||||
ff_init_ff_sine_windows(10);
|
||||
ff_init_ff_sine_windows(7);
|
||||
ff_sine_window_init(ff_sine_1024, 1024);
|
||||
ff_sine_window_init(ff_sine_128, 128);
|
||||
|
||||
s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));
|
||||
s->cpe = av_mallocz(sizeof(ChannelElement) * aac_chan_configs[avctx->channels-1][0]);
|
||||
avctx->extradata = av_malloc(2);
|
||||
s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));
|
||||
s->cpe = av_mallocz(sizeof(ChannelElement) * aac_chan_configs[avctx->channels-1][0]);
|
||||
if(ff_aac_psy_init(&s->psy, avctx, AAC_PSY_3GPP,
|
||||
aac_chan_configs[avctx->channels-1][0], 0,
|
||||
swb_size_1024[i], ff_aac_num_swb_1024[i], swb_size_128[i], ff_aac_num_swb_128[i]) < 0){
|
||||
av_log(avctx, AV_LOG_ERROR, "Cannot initialize selected model.\n");
|
||||
return -1;
|
||||
}
|
||||
avctx->extradata = av_malloc(2);
|
||||
avctx->extradata_size = 2;
|
||||
put_audio_specific_config(avctx);
|
||||
|
||||
sizes[0] = swb_size_1024[i];
|
||||
sizes[1] = swb_size_128[i];
|
||||
lengths[0] = ff_aac_num_swb_1024[i];
|
||||
lengths[1] = ff_aac_num_swb_128[i];
|
||||
ff_psy_init(&s->psy, avctx, 2, sizes, lengths);
|
||||
s->psypp = ff_psy_preprocess_init(avctx);
|
||||
s->coder = &ff_aac_coders[0];
|
||||
|
||||
s->lambda = avctx->global_quality ? avctx->global_quality : 120;
|
||||
#if !CONFIG_HARDCODED_TABLES
|
||||
for (i = 0; i < 428; i++)
|
||||
ff_aac_pow2sf_tab[i] = pow(2, (i - 200)/4.);
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
if (avctx->channels > 5)
|
||||
av_log(avctx, AV_LOG_ERROR, "This encoder does not yet enforce the restrictions on LFEs. "
|
||||
"The output will most likely be an illegal bitstream.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void apply_window_and_mdct(AVCodecContext *avctx, AACEncContext *s,
|
||||
SingleChannelElement *sce, short *audio, int channel)
|
||||
{
|
||||
int i, j, k;
|
||||
const float * lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
|
||||
const float * swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
|
||||
const float * pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
|
||||
|
||||
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
|
||||
memcpy(s->output, sce->saved, sizeof(float)*1024);
|
||||
if (sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE) {
|
||||
memset(s->output, 0, sizeof(s->output[0]) * 448);
|
||||
for (i = 448; i < 576; i++)
|
||||
s->output[i] = sce->saved[i] * pwindow[i - 448];
|
||||
for (i = 576; i < 704; i++)
|
||||
s->output[i] = sce->saved[i];
|
||||
}
|
||||
if (sce->ics.window_sequence[0] != LONG_START_SEQUENCE) {
|
||||
j = channel;
|
||||
for (i = 0; i < 1024; i++, j += avctx->channels) {
|
||||
s->output[i+1024] = audio[j] * lwindow[1024 - i - 1];
|
||||
sce->saved[i] = audio[j] * lwindow[i];
|
||||
}
|
||||
} else {
|
||||
j = channel;
|
||||
for (i = 0; i < 448; i++, j += avctx->channels)
|
||||
s->output[i+1024] = audio[j];
|
||||
for (i = 448; i < 576; i++, j += avctx->channels)
|
||||
s->output[i+1024] = audio[j] * swindow[576 - i - 1];
|
||||
memset(s->output+1024+576, 0, sizeof(s->output[0]) * 448);
|
||||
j = channel;
|
||||
for (i = 0; i < 1024; i++, j += avctx->channels)
|
||||
sce->saved[i] = audio[j];
|
||||
}
|
||||
ff_mdct_calc(&s->mdct1024, sce->coeffs, s->output);
|
||||
} else {
|
||||
j = channel;
|
||||
for (k = 0; k < 1024; k += 128) {
|
||||
for (i = 448 + k; i < 448 + k + 256; i++)
|
||||
s->output[i - 448 - k] = (i < 1024)
|
||||
? sce->saved[i]
|
||||
: audio[channel + (i-1024)*avctx->channels];
|
||||
s->dsp.vector_fmul (s->output, k ? swindow : pwindow, 128);
|
||||
s->dsp.vector_fmul_reverse(s->output+128, s->output+128, swindow, 128);
|
||||
ff_mdct_calc(&s->mdct128, sce->coeffs + k, s->output);
|
||||
}
|
||||
j = channel;
|
||||
for (i = 0; i < 1024; i++, j += avctx->channels)
|
||||
sce->saved[i] = audio[j];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode ics_info element.
|
||||
* @see Table 4.6 (syntax of ics_info)
|
||||
*/
|
||||
static void put_ics_info(AACEncContext *s, IndividualChannelStream *info)
|
||||
{
|
||||
int w;
|
||||
int i;
|
||||
|
||||
put_bits(&s->pb, 1, 0); // ics_reserved bit
|
||||
put_bits(&s->pb, 2, info->window_sequence[0]);
|
||||
put_bits(&s->pb, 1, info->use_kb_window[0]);
|
||||
if (info->window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
|
||||
if(info->window_sequence[0] != EIGHT_SHORT_SEQUENCE){
|
||||
put_bits(&s->pb, 6, info->max_sfb);
|
||||
put_bits(&s->pb, 1, 0); // no prediction
|
||||
} else {
|
||||
}else{
|
||||
put_bits(&s->pb, 4, info->max_sfb);
|
||||
for (w = 1; w < 8; w++)
|
||||
put_bits(&s->pb, 1, !info->group_len[w]);
|
||||
for(i = 1; i < info->num_windows; i++)
|
||||
put_bits(&s->pb, 1, info->group_len[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode MS data.
|
||||
* @see 4.6.8.1 "Joint Coding - M/S Stereo"
|
||||
* Calculate the number of bits needed to code all coefficient signs in current band.
|
||||
*/
|
||||
static void encode_ms_info(PutBitContext *pb, ChannelElement *cpe)
|
||||
static int calculate_band_sign_bits(AACEncContext *s, SingleChannelElement *sce,
|
||||
int group_len, int start, int size)
|
||||
{
|
||||
int bits = 0;
|
||||
int i, w;
|
||||
|
||||
put_bits(pb, 2, cpe->ms_mode);
|
||||
if (cpe->ms_mode == 1)
|
||||
for (w = 0; w < cpe->ch[0].ics.num_windows; w += cpe->ch[0].ics.group_len[w])
|
||||
for (i = 0; i < cpe->ch[0].ics.max_sfb; i++)
|
||||
put_bits(pb, 1, cpe->ms_mask[w*16 + i]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce integer coefficients from scalefactors provided by the model.
|
||||
*/
|
||||
static void adjust_frame_information(AACEncContext *apc, ChannelElement *cpe, int chans)
|
||||
{
|
||||
int i, w, w2, g, ch;
|
||||
int start, sum, maxsfb, cmaxsfb;
|
||||
|
||||
for (ch = 0; ch < chans; ch++) {
|
||||
IndividualChannelStream *ics = &cpe->ch[ch].ics;
|
||||
start = 0;
|
||||
maxsfb = 0;
|
||||
cpe->ch[ch].pulse.num_pulse = 0;
|
||||
for (w = 0; w < ics->num_windows*16; w += 16) {
|
||||
for (g = 0; g < ics->num_swb; g++) {
|
||||
sum = 0;
|
||||
//apply M/S
|
||||
if (!ch && cpe->ms_mask[w + g]) {
|
||||
for (i = 0; i < ics->swb_sizes[g]; i++) {
|
||||
cpe->ch[0].coeffs[start+i] = (cpe->ch[0].coeffs[start+i] + cpe->ch[1].coeffs[start+i]) / 2.0;
|
||||
cpe->ch[1].coeffs[start+i] = cpe->ch[0].coeffs[start+i] - cpe->ch[1].coeffs[start+i];
|
||||
}
|
||||
}
|
||||
start += ics->swb_sizes[g];
|
||||
}
|
||||
for (cmaxsfb = ics->num_swb; cmaxsfb > 0 && cpe->ch[ch].zeroes[w+cmaxsfb-1]; cmaxsfb--)
|
||||
;
|
||||
maxsfb = FFMAX(maxsfb, cmaxsfb);
|
||||
}
|
||||
ics->max_sfb = maxsfb;
|
||||
|
||||
//adjust zero bands for window groups
|
||||
for (w = 0; w < ics->num_windows; w += ics->group_len[w]) {
|
||||
for (g = 0; g < ics->max_sfb; g++) {
|
||||
i = 1;
|
||||
for (w2 = w; w2 < w + ics->group_len[w]; w2++) {
|
||||
if (!cpe->ch[ch].zeroes[w2*16 + g]) {
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
cpe->ch[ch].zeroes[w*16 + g] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (chans > 1 && cpe->common_window) {
|
||||
IndividualChannelStream *ics0 = &cpe->ch[0].ics;
|
||||
IndividualChannelStream *ics1 = &cpe->ch[1].ics;
|
||||
int msc = 0;
|
||||
ics0->max_sfb = FFMAX(ics0->max_sfb, ics1->max_sfb);
|
||||
ics1->max_sfb = ics0->max_sfb;
|
||||
for (w = 0; w < ics0->num_windows*16; w += 16)
|
||||
for (i = 0; i < ics0->max_sfb; i++)
|
||||
if (cpe->ms_mask[w+i])
|
||||
msc++;
|
||||
if (msc == 0 || ics0->max_sfb == 0)
|
||||
cpe->ms_mode = 0;
|
||||
else
|
||||
cpe->ms_mode = msc < ics0->max_sfb ? 1 : 2;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode scalefactor band coding type.
|
||||
*/
|
||||
static void encode_band_info(AACEncContext *s, SingleChannelElement *sce)
|
||||
{
|
||||
int w;
|
||||
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
|
||||
s->coder->encode_window_bands_info(s, sce, w, sce->ics.group_len[w], s->lambda);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode scalefactors.
|
||||
*/
|
||||
static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
|
||||
SingleChannelElement *sce)
|
||||
{
|
||||
int off = sce->sf_idx[0], diff;
|
||||
int i, w;
|
||||
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (i = 0; i < sce->ics.max_sfb; i++) {
|
||||
if (!sce->zeroes[w*16 + i]) {
|
||||
diff = sce->sf_idx[w*16 + i] - off + SCALE_DIFF_ZERO;
|
||||
if (diff < 0 || diff > 120)
|
||||
av_log(avctx, AV_LOG_ERROR, "Scalefactor difference is too big to be coded\n");
|
||||
off = sce->sf_idx[w*16 + i];
|
||||
put_bits(&s->pb, ff_aac_scalefactor_bits[diff], ff_aac_scalefactor_code[diff]);
|
||||
}
|
||||
for(w = 0; w < group_len; w++){
|
||||
for(i = 0; i < size; i++){
|
||||
if(sce->icoefs[start + i])
|
||||
bits++;
|
||||
}
|
||||
start += 128;
|
||||
}
|
||||
return bits;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -408,12 +283,11 @@ static void encode_pulses(AACEncContext *s, Pulse *pulse)
|
||||
int i;
|
||||
|
||||
put_bits(&s->pb, 1, !!pulse->num_pulse);
|
||||
if (!pulse->num_pulse)
|
||||
return;
|
||||
if(!pulse->num_pulse) return;
|
||||
|
||||
put_bits(&s->pb, 2, pulse->num_pulse - 1);
|
||||
put_bits(&s->pb, 6, pulse->start);
|
||||
for (i = 0; i < pulse->num_pulse; i++) {
|
||||
for(i = 0; i < pulse->num_pulse; i++){
|
||||
put_bits(&s->pb, 5, pulse->pos[i]);
|
||||
put_bits(&s->pb, 4, pulse->amp[i]);
|
||||
}
|
||||
@@ -424,214 +298,54 @@ static void encode_pulses(AACEncContext *s, Pulse *pulse)
|
||||
*/
|
||||
static void encode_spectral_coeffs(AACEncContext *s, SingleChannelElement *sce)
|
||||
{
|
||||
int start, i, w, w2;
|
||||
int start, i, w, w2, wg;
|
||||
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
w = 0;
|
||||
for(wg = 0; wg < sce->ics.num_window_groups; wg++){
|
||||
start = 0;
|
||||
for (i = 0; i < sce->ics.max_sfb; i++) {
|
||||
if (sce->zeroes[w*16 + i]) {
|
||||
for(i = 0; i < sce->ics.max_sfb; i++){
|
||||
if(sce->zeroes[w*16 + i]){
|
||||
start += sce->ics.swb_sizes[i];
|
||||
continue;
|
||||
}
|
||||
for (w2 = w; w2 < w + sce->ics.group_len[w]; w2++)
|
||||
s->coder->quantize_and_encode_band(s, &s->pb, sce->coeffs + start + w2*128,
|
||||
sce->ics.swb_sizes[i],
|
||||
sce->sf_idx[w*16 + i],
|
||||
sce->band_type[w*16 + i],
|
||||
s->lambda);
|
||||
for(w2 = w; w2 < w + sce->ics.group_len[wg]; w2++){
|
||||
encode_band_coeffs(s, sce, start + w2*128,
|
||||
sce->ics.swb_sizes[i],
|
||||
sce->band_type[w*16 + i]);
|
||||
}
|
||||
start += sce->ics.swb_sizes[i];
|
||||
}
|
||||
w += sce->ics.group_len[wg];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode one channel of audio data.
|
||||
*/
|
||||
static int encode_individual_channel(AVCodecContext *avctx, AACEncContext *s,
|
||||
SingleChannelElement *sce,
|
||||
int common_window)
|
||||
{
|
||||
put_bits(&s->pb, 8, sce->sf_idx[0]);
|
||||
if (!common_window)
|
||||
put_ics_info(s, &sce->ics);
|
||||
encode_band_info(s, sce);
|
||||
encode_scale_factors(avctx, s, sce);
|
||||
encode_pulses(s, &sce->pulse);
|
||||
put_bits(&s->pb, 1, 0); //tns
|
||||
put_bits(&s->pb, 1, 0); //ssr
|
||||
encode_spectral_coeffs(s, sce);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write some auxiliary information about the created AAC file.
|
||||
*/
|
||||
static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s,
|
||||
const char *name)
|
||||
static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s, const char *name)
|
||||
{
|
||||
int i, namelen, padbits;
|
||||
|
||||
namelen = strlen(name) + 2;
|
||||
put_bits(&s->pb, 3, TYPE_FIL);
|
||||
put_bits(&s->pb, 4, FFMIN(namelen, 15));
|
||||
if (namelen >= 15)
|
||||
if(namelen >= 15)
|
||||
put_bits(&s->pb, 8, namelen - 16);
|
||||
put_bits(&s->pb, 4, 0); //extension type - filler
|
||||
padbits = 8 - (put_bits_count(&s->pb) & 7);
|
||||
align_put_bits(&s->pb);
|
||||
for (i = 0; i < namelen - 2; i++)
|
||||
for(i = 0; i < namelen - 2; i++)
|
||||
put_bits(&s->pb, 8, name[i]);
|
||||
put_bits(&s->pb, 12 - padbits, 0);
|
||||
}
|
||||
|
||||
static int aac_encode_frame(AVCodecContext *avctx,
|
||||
uint8_t *frame, int buf_size, void *data)
|
||||
{
|
||||
AACEncContext *s = avctx->priv_data;
|
||||
int16_t *samples = s->samples, *samples2, *la;
|
||||
ChannelElement *cpe;
|
||||
int i, j, chans, tag, start_ch;
|
||||
const uint8_t *chan_map = aac_chan_configs[avctx->channels-1];
|
||||
int chan_el_counter[4];
|
||||
FFPsyWindowInfo windows[avctx->channels];
|
||||
|
||||
if (s->last_frame)
|
||||
return 0;
|
||||
if (data) {
|
||||
if (!s->psypp) {
|
||||
memcpy(s->samples + 1024 * avctx->channels, data,
|
||||
1024 * avctx->channels * sizeof(s->samples[0]));
|
||||
} else {
|
||||
start_ch = 0;
|
||||
samples2 = s->samples + 1024 * avctx->channels;
|
||||
for (i = 0; i < chan_map[0]; i++) {
|
||||
tag = chan_map[i+1];
|
||||
chans = tag == TYPE_CPE ? 2 : 1;
|
||||
ff_psy_preprocess(s->psypp, (uint16_t*)data + start_ch,
|
||||
samples2 + start_ch, start_ch, chans);
|
||||
start_ch += chans;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!avctx->frame_number) {
|
||||
memcpy(s->samples, s->samples + 1024 * avctx->channels,
|
||||
1024 * avctx->channels * sizeof(s->samples[0]));
|
||||
return 0;
|
||||
}
|
||||
|
||||
start_ch = 0;
|
||||
for (i = 0; i < chan_map[0]; i++) {
|
||||
FFPsyWindowInfo* wi = windows + start_ch;
|
||||
tag = chan_map[i+1];
|
||||
chans = tag == TYPE_CPE ? 2 : 1;
|
||||
cpe = &s->cpe[i];
|
||||
samples2 = samples + start_ch;
|
||||
la = samples2 + 1024 * avctx->channels + start_ch;
|
||||
if (!data)
|
||||
la = NULL;
|
||||
for (j = 0; j < chans; j++) {
|
||||
IndividualChannelStream *ics = &cpe->ch[j].ics;
|
||||
int k;
|
||||
wi[j] = ff_psy_suggest_window(&s->psy, samples2, la, start_ch + j, ics->window_sequence[0]);
|
||||
ics->window_sequence[1] = ics->window_sequence[0];
|
||||
ics->window_sequence[0] = wi[j].window_type[0];
|
||||
ics->use_kb_window[1] = ics->use_kb_window[0];
|
||||
ics->use_kb_window[0] = wi[j].window_shape;
|
||||
ics->num_windows = wi[j].num_windows;
|
||||
ics->swb_sizes = s->psy.bands [ics->num_windows == 8];
|
||||
ics->num_swb = s->psy.num_bands[ics->num_windows == 8];
|
||||
for (k = 0; k < ics->num_windows; k++)
|
||||
ics->group_len[k] = wi[j].grouping[k];
|
||||
|
||||
s->cur_channel = start_ch + j;
|
||||
apply_window_and_mdct(avctx, s, &cpe->ch[j], samples2, j);
|
||||
}
|
||||
start_ch += chans;
|
||||
}
|
||||
do {
|
||||
int frame_bits;
|
||||
init_put_bits(&s->pb, frame, buf_size*8);
|
||||
if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & CODEC_FLAG_BITEXACT))
|
||||
put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
|
||||
start_ch = 0;
|
||||
memset(chan_el_counter, 0, sizeof(chan_el_counter));
|
||||
for (i = 0; i < chan_map[0]; i++) {
|
||||
FFPsyWindowInfo* wi = windows + start_ch;
|
||||
tag = chan_map[i+1];
|
||||
chans = tag == TYPE_CPE ? 2 : 1;
|
||||
cpe = &s->cpe[i];
|
||||
for (j = 0; j < chans; j++) {
|
||||
s->cur_channel = start_ch + j;
|
||||
s->coder->search_for_quantizers(avctx, s, &cpe->ch[j], s->lambda);
|
||||
}
|
||||
cpe->common_window = 0;
|
||||
if (chans > 1
|
||||
&& wi[0].window_type[0] == wi[1].window_type[0]
|
||||
&& wi[0].window_shape == wi[1].window_shape) {
|
||||
|
||||
cpe->common_window = 1;
|
||||
for (j = 0; j < wi[0].num_windows; j++) {
|
||||
if (wi[0].grouping[j] != wi[1].grouping[j]) {
|
||||
cpe->common_window = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
s->cur_channel = start_ch;
|
||||
if (cpe->common_window && s->coder->search_for_ms)
|
||||
s->coder->search_for_ms(s, cpe, s->lambda);
|
||||
adjust_frame_information(s, cpe, chans);
|
||||
put_bits(&s->pb, 3, tag);
|
||||
put_bits(&s->pb, 4, chan_el_counter[tag]++);
|
||||
if (chans == 2) {
|
||||
put_bits(&s->pb, 1, cpe->common_window);
|
||||
if (cpe->common_window) {
|
||||
put_ics_info(s, &cpe->ch[0].ics);
|
||||
encode_ms_info(&s->pb, cpe);
|
||||
}
|
||||
}
|
||||
for (j = 0; j < chans; j++) {
|
||||
s->cur_channel = start_ch + j;
|
||||
ff_psy_set_band_info(&s->psy, s->cur_channel, cpe->ch[j].coeffs, &wi[j]);
|
||||
encode_individual_channel(avctx, s, &cpe->ch[j], cpe->common_window);
|
||||
}
|
||||
start_ch += chans;
|
||||
}
|
||||
|
||||
frame_bits = put_bits_count(&s->pb);
|
||||
if (frame_bits <= 6144 * avctx->channels - 3)
|
||||
break;
|
||||
|
||||
s->lambda *= avctx->bit_rate * 1024.0f / avctx->sample_rate / frame_bits;
|
||||
|
||||
} while (1);
|
||||
|
||||
put_bits(&s->pb, 3, TYPE_END);
|
||||
flush_put_bits(&s->pb);
|
||||
avctx->frame_bits = put_bits_count(&s->pb);
|
||||
|
||||
// rate control stuff
|
||||
if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
|
||||
float ratio = avctx->bit_rate * 1024.0f / avctx->sample_rate / avctx->frame_bits;
|
||||
s->lambda *= ratio;
|
||||
s->lambda = FFMIN(s->lambda, 65536.f);
|
||||
}
|
||||
|
||||
if (!data)
|
||||
s->last_frame = 1;
|
||||
memcpy(s->samples, s->samples + 1024 * avctx->channels,
|
||||
1024 * avctx->channels * sizeof(s->samples[0]));
|
||||
return put_bits_count(&s->pb)>>3;
|
||||
}
|
||||
|
||||
static av_cold int aac_encode_end(AVCodecContext *avctx)
|
||||
{
|
||||
AACEncContext *s = avctx->priv_data;
|
||||
|
||||
ff_mdct_end(&s->mdct1024);
|
||||
ff_mdct_end(&s->mdct128);
|
||||
ff_psy_end(&s->psy);
|
||||
ff_psy_preprocess_end(s->psypp);
|
||||
ff_aac_psy_end(&s->psy);
|
||||
av_freep(&s->samples);
|
||||
av_freep(&s->cpe);
|
||||
return 0;
|
||||
@@ -639,13 +353,13 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
|
||||
|
||||
AVCodec aac_encoder = {
|
||||
"aac",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_TYPE_AUDIO,
|
||||
CODEC_ID_AAC,
|
||||
sizeof(AACEncContext),
|
||||
aac_encode_init,
|
||||
aac_encode_frame,
|
||||
aac_encode_end,
|
||||
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
|
||||
.sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
|
||||
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
|
||||
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
|
||||
};
|
||||
|
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* AAC encoder
|
||||
* Copyright (C) 2008 Konstantin Shishkov
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AACENC_H
|
||||
#define AVCODEC_AACENC_H
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "dsputil.h"
|
||||
|
||||
#include "aac.h"
|
||||
|
||||
#include "psymodel.h"
|
||||
|
||||
struct AACEncContext;
|
||||
|
||||
typedef struct AACCoefficientsEncoder {
|
||||
void (*search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s,
|
||||
SingleChannelElement *sce, const float lambda);
|
||||
void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
|
||||
int win, int group_len, const float lambda);
|
||||
void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
|
||||
int scale_idx, int cb, const float lambda);
|
||||
void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
|
||||
} AACCoefficientsEncoder;
|
||||
|
||||
extern AACCoefficientsEncoder ff_aac_coders[];
|
||||
|
||||
/**
|
||||
* AAC encoder context
|
||||
*/
|
||||
typedef struct AACEncContext {
|
||||
PutBitContext pb;
|
||||
FFTContext mdct1024; ///< long (1024 samples) frame transform context
|
||||
FFTContext mdct128; ///< short (128 samples) frame transform context
|
||||
DSPContext dsp;
|
||||
DECLARE_ALIGNED(16, FFTSample, output)[2048]; ///< temporary buffer for MDCT input coefficients
|
||||
int16_t* samples; ///< saved preprocessed input
|
||||
|
||||
int samplerate_index; ///< MPEG-4 samplerate index
|
||||
|
||||
ChannelElement *cpe; ///< channel elements
|
||||
FFPsyContext psy;
|
||||
struct FFPsyPreprocessContext* psypp;
|
||||
AACCoefficientsEncoder *coder;
|
||||
int cur_channel;
|
||||
int last_frame;
|
||||
float lambda;
|
||||
DECLARE_ALIGNED(16, int, qcoefs)[96][2]; ///< quantized coefficients
|
||||
DECLARE_ALIGNED(16, float, scoefs)[1024]; ///< scaled coefficients
|
||||
} AACEncContext;
|
||||
|
||||
#endif /* AVCODEC_AACENC_H */
|
@@ -20,30 +20,59 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aacpsy.c
|
||||
* AAC encoder psychoacoustic model
|
||||
*/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "aacpsy.h"
|
||||
#include "aactab.h"
|
||||
#include "psymodel.h"
|
||||
|
||||
/***********************************
|
||||
* TODOs:
|
||||
* General:
|
||||
* better audio preprocessing (add DC highpass filter?)
|
||||
* more psy models
|
||||
* maybe improve coefficient quantization function in some way
|
||||
*
|
||||
* 3GPP-based psy model:
|
||||
* thresholds linearization after their modifications for attaining given bitrate
|
||||
* try other bitrate controlling mechanism (maybe use ratecontrol.c?)
|
||||
* control quality for quality-based output
|
||||
**********************************/
|
||||
|
||||
/**
|
||||
* Quantize one coefficient.
|
||||
* @return absolute value of the quantized coefficient
|
||||
* @see 3GPP TS26.403 5.6.2 "Scalefactor determination"
|
||||
*/
|
||||
static av_always_inline int quant(float coef, const float Q)
|
||||
{
|
||||
return av_clip((int)(pow(fabsf(coef) * Q, 0.75) + 0.4054), 0, 8191);
|
||||
}
|
||||
|
||||
static inline float get_approximate_quant_error(float *c, int size, int scale_idx)
|
||||
{
|
||||
int i;
|
||||
int q;
|
||||
float coef, unquant, sum = 0.0f;
|
||||
const float Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
|
||||
const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
|
||||
for(i = 0; i < size; i++){
|
||||
coef = fabs(c[i]);
|
||||
q = quant(c[i], Q);
|
||||
unquant = (q * cbrt(q)) * IQ;
|
||||
sum += (coef - unquant) * (coef - unquant);
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/**
|
||||
* constants for 3GPP AAC psychoacoustic model
|
||||
* @{
|
||||
*/
|
||||
#define PSY_3GPP_SPREAD_LOW 1.5f // spreading factor for ascending threshold spreading (15 dB/Bark)
|
||||
#define PSY_3GPP_SPREAD_HI 3.0f // spreading factor for descending threshold spreading (30 dB/Bark)
|
||||
|
||||
#define PSY_3GPP_RPEMIN 0.01f
|
||||
#define PSY_3GPP_RPELEV 2.0f
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -54,24 +83,8 @@
|
||||
typedef struct Psy3gppBand{
|
||||
float energy; ///< band energy
|
||||
float ffac; ///< form factor
|
||||
float thr; ///< energy threshold
|
||||
float min_snr; ///< minimal SNR
|
||||
float thr_quiet; ///< threshold in quiet
|
||||
}Psy3gppBand;
|
||||
|
||||
/**
|
||||
* single/pair channel context for psychoacoustic model
|
||||
*/
|
||||
typedef struct Psy3gppChannel{
|
||||
Psy3gppBand band[128]; ///< bands information
|
||||
Psy3gppBand prev_band[128]; ///< bands information from the previous frame
|
||||
|
||||
float win_energy; ///< sliding average of channel energy
|
||||
float iir_state[2]; ///< hi-pass IIR filter state
|
||||
uint8_t next_grouping; ///< stored grouping scheme for the next frame (in case of 8 short window sequence)
|
||||
enum WindowSequence next_window_seq; ///< window sequence to be used in the next frame
|
||||
}Psy3gppChannel;
|
||||
|
||||
/**
|
||||
* psychoacoustic model frame type-dependent coefficients
|
||||
*/
|
||||
@@ -82,237 +95,10 @@ typedef struct Psy3gppCoeffs{
|
||||
float spread_hi [64]; ///< spreading factor for high-to-low threshold spreading in long frame
|
||||
}Psy3gppCoeffs;
|
||||
|
||||
/**
|
||||
* 3GPP TS26.403-inspired psychoacoustic model specific data
|
||||
*/
|
||||
typedef struct Psy3gppContext{
|
||||
Psy3gppCoeffs psy_coef[2];
|
||||
Psy3gppChannel *ch;
|
||||
}Psy3gppContext;
|
||||
|
||||
/**
|
||||
* Calculate Bark value for given line.
|
||||
*/
|
||||
static av_cold float calc_bark(float f)
|
||||
static inline float calc_bark(float f)
|
||||
{
|
||||
return 13.3f * atanf(0.00076f * f) + 3.5f * atanf((f / 7500.0f) * (f / 7500.0f));
|
||||
}
|
||||
|
||||
#define ATH_ADD 4
|
||||
/**
|
||||
* Calculate ATH value for given frequency.
|
||||
* Borrowed from Lame.
|
||||
*/
|
||||
static av_cold float ath(float f, float add)
|
||||
{
|
||||
f /= 1000.0f;
|
||||
return 3.64 * pow(f, -0.8)
|
||||
- 6.8 * exp(-0.6 * (f - 3.4) * (f - 3.4))
|
||||
+ 6.0 * exp(-0.15 * (f - 8.7) * (f - 8.7))
|
||||
+ (0.6 + 0.04 * add) * 0.001 * f * f * f * f;
|
||||
}
|
||||
|
||||
static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
|
||||
Psy3gppContext *pctx;
|
||||
float barks[1024];
|
||||
int i, j, g, start;
|
||||
float prev, minscale, minath;
|
||||
|
||||
ctx->model_priv_data = av_mallocz(sizeof(Psy3gppContext));
|
||||
pctx = (Psy3gppContext*) ctx->model_priv_data;
|
||||
|
||||
for (i = 0; i < 1024; i++)
|
||||
barks[i] = calc_bark(i * ctx->avctx->sample_rate / 2048.0);
|
||||
minath = ath(3410, ATH_ADD);
|
||||
for (j = 0; j < 2; j++) {
|
||||
Psy3gppCoeffs *coeffs = &pctx->psy_coef[j];
|
||||
i = 0;
|
||||
prev = 0.0;
|
||||
for (g = 0; g < ctx->num_bands[j]; g++) {
|
||||
i += ctx->bands[j][g];
|
||||
coeffs->barks[g] = (barks[i - 1] + prev) / 2.0;
|
||||
prev = barks[i - 1];
|
||||
}
|
||||
for (g = 0; g < ctx->num_bands[j] - 1; g++) {
|
||||
coeffs->spread_low[g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_LOW);
|
||||
coeffs->spread_hi [g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_HI);
|
||||
}
|
||||
start = 0;
|
||||
for (g = 0; g < ctx->num_bands[j]; g++) {
|
||||
minscale = ath(ctx->avctx->sample_rate * start / 1024.0, ATH_ADD);
|
||||
for (i = 1; i < ctx->bands[j][g]; i++)
|
||||
minscale = FFMIN(minscale, ath(ctx->avctx->sample_rate * (start + i) / 1024.0 / 2.0, ATH_ADD));
|
||||
coeffs->ath[g] = minscale - minath;
|
||||
start += ctx->bands[j][g];
|
||||
}
|
||||
}
|
||||
|
||||
pctx->ch = av_mallocz(sizeof(Psy3gppChannel) * ctx->avctx->channels);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* IIR filter used in block switching decision
|
||||
*/
|
||||
static float iir_filter(int in, float state[2])
|
||||
{
|
||||
float ret;
|
||||
|
||||
ret = 0.7548f * (in - state[0]) + 0.5095f * state[1];
|
||||
state[0] = in;
|
||||
state[1] = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* window grouping information stored as bits (0 - new group, 1 - group continues)
|
||||
*/
|
||||
static const uint8_t window_grouping[9] = {
|
||||
0xB6, 0x6C, 0xD8, 0xB2, 0x66, 0xC6, 0x96, 0x36, 0x36
|
||||
};
|
||||
|
||||
/**
|
||||
* Tell encoder which window types to use.
|
||||
* @see 3GPP TS26.403 5.4.1 "Blockswitching"
|
||||
*/
|
||||
static FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
|
||||
const int16_t *audio, const int16_t *la,
|
||||
int channel, int prev_type)
|
||||
{
|
||||
int i, j;
|
||||
int br = ctx->avctx->bit_rate / ctx->avctx->channels;
|
||||
int attack_ratio = br <= 16000 ? 18 : 10;
|
||||
Psy3gppContext *pctx = (Psy3gppContext*) ctx->model_priv_data;
|
||||
Psy3gppChannel *pch = &pctx->ch[channel];
|
||||
uint8_t grouping = 0;
|
||||
FFPsyWindowInfo wi;
|
||||
|
||||
memset(&wi, 0, sizeof(wi));
|
||||
if (la) {
|
||||
float s[8], v;
|
||||
int switch_to_eight = 0;
|
||||
float sum = 0.0, sum2 = 0.0;
|
||||
int attack_n = 0;
|
||||
for (i = 0; i < 8; i++) {
|
||||
for (j = 0; j < 128; j++) {
|
||||
v = iir_filter(audio[(i*128+j)*ctx->avctx->channels], pch->iir_state);
|
||||
sum += v*v;
|
||||
}
|
||||
s[i] = sum;
|
||||
sum2 += sum;
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (s[i] > pch->win_energy * attack_ratio) {
|
||||
attack_n = i + 1;
|
||||
switch_to_eight = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pch->win_energy = pch->win_energy*7/8 + sum2/64;
|
||||
|
||||
wi.window_type[1] = prev_type;
|
||||
switch (prev_type) {
|
||||
case ONLY_LONG_SEQUENCE:
|
||||
wi.window_type[0] = switch_to_eight ? LONG_START_SEQUENCE : ONLY_LONG_SEQUENCE;
|
||||
break;
|
||||
case LONG_START_SEQUENCE:
|
||||
wi.window_type[0] = EIGHT_SHORT_SEQUENCE;
|
||||
grouping = pch->next_grouping;
|
||||
break;
|
||||
case LONG_STOP_SEQUENCE:
|
||||
wi.window_type[0] = ONLY_LONG_SEQUENCE;
|
||||
break;
|
||||
case EIGHT_SHORT_SEQUENCE:
|
||||
wi.window_type[0] = switch_to_eight ? EIGHT_SHORT_SEQUENCE : LONG_STOP_SEQUENCE;
|
||||
grouping = switch_to_eight ? pch->next_grouping : 0;
|
||||
break;
|
||||
}
|
||||
pch->next_grouping = window_grouping[attack_n];
|
||||
} else {
|
||||
for (i = 0; i < 3; i++)
|
||||
wi.window_type[i] = prev_type;
|
||||
grouping = (prev_type == EIGHT_SHORT_SEQUENCE) ? window_grouping[0] : 0;
|
||||
}
|
||||
|
||||
wi.window_shape = 1;
|
||||
if (wi.window_type[0] != EIGHT_SHORT_SEQUENCE) {
|
||||
wi.num_windows = 1;
|
||||
wi.grouping[0] = 1;
|
||||
} else {
|
||||
int lastgrp = 0;
|
||||
wi.num_windows = 8;
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (!((grouping >> i) & 1))
|
||||
lastgrp = i;
|
||||
wi.grouping[lastgrp]++;
|
||||
}
|
||||
}
|
||||
|
||||
return wi;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate band thresholds as suggested in 3GPP TS26.403
|
||||
*/
|
||||
static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
|
||||
const float *coefs, FFPsyWindowInfo *wi)
|
||||
{
|
||||
Psy3gppContext *pctx = (Psy3gppContext*) ctx->model_priv_data;
|
||||
Psy3gppChannel *pch = &pctx->ch[channel];
|
||||
int start = 0;
|
||||
int i, w, g;
|
||||
const int num_bands = ctx->num_bands[wi->num_windows == 8];
|
||||
const uint8_t* band_sizes = ctx->bands[wi->num_windows == 8];
|
||||
Psy3gppCoeffs *coeffs = &pctx->psy_coef[wi->num_windows == 8];
|
||||
|
||||
//calculate energies, initial thresholds and related values - 5.4.2 "Threshold Calculation"
|
||||
for (w = 0; w < wi->num_windows*16; w += 16) {
|
||||
for (g = 0; g < num_bands; g++) {
|
||||
Psy3gppBand *band = &pch->band[w+g];
|
||||
band->energy = 0.0f;
|
||||
for (i = 0; i < band_sizes[g]; i++)
|
||||
band->energy += coefs[start+i] * coefs[start+i];
|
||||
band->energy *= 1.0f / (512*512);
|
||||
band->thr = band->energy * 0.001258925f;
|
||||
start += band_sizes[g];
|
||||
|
||||
ctx->psy_bands[channel*PSY_MAX_BANDS+w+g].energy = band->energy;
|
||||
}
|
||||
}
|
||||
//modify thresholds - spread, threshold in quiet - 5.4.3 "Spreaded Energy Calculation"
|
||||
for (w = 0; w < wi->num_windows*16; w += 16) {
|
||||
Psy3gppBand *band = &pch->band[w];
|
||||
for (g = 1; g < num_bands; g++)
|
||||
band[g].thr = FFMAX(band[g].thr, band[g-1].thr * coeffs->spread_low[g-1]);
|
||||
for (g = num_bands - 2; g >= 0; g--)
|
||||
band[g].thr = FFMAX(band[g].thr, band[g+1].thr * coeffs->spread_hi [g]);
|
||||
for (g = 0; g < num_bands; g++) {
|
||||
band[g].thr_quiet = FFMAX(band[g].thr, coeffs->ath[g]);
|
||||
if (wi->num_windows != 8 && wi->window_type[1] != EIGHT_SHORT_SEQUENCE)
|
||||
band[g].thr_quiet = FFMAX(PSY_3GPP_RPEMIN*band[g].thr_quiet,
|
||||
FFMIN(band[g].thr_quiet,
|
||||
PSY_3GPP_RPELEV*pch->prev_band[w+g].thr_quiet));
|
||||
band[g].thr = FFMAX(band[g].thr, band[g].thr_quiet * 0.25);
|
||||
|
||||
ctx->psy_bands[channel*PSY_MAX_BANDS+w+g].threshold = band[g].thr;
|
||||
}
|
||||
}
|
||||
memcpy(pch->prev_band, pch->band, sizeof(pch->band));
|
||||
}
|
||||
|
||||
static av_cold void psy_3gpp_end(FFPsyContext *apc)
|
||||
{
|
||||
Psy3gppContext *pctx = (Psy3gppContext*) apc->model_priv_data;
|
||||
av_freep(&pctx->ch);
|
||||
av_freep(&apc->model_priv_data);
|
||||
}
|
||||
|
||||
|
||||
const FFPsyModel ff_aac_psy_model =
|
||||
{
|
||||
.name = "3GPP TS 26.403-inspired model",
|
||||
.init = psy_3gpp_init,
|
||||
.window = psy_3gpp_window,
|
||||
.analyze = psy_3gpp_analyze,
|
||||
.end = psy_3gpp_end,
|
||||
};
|
||||
|
1766
libavcodec/aacsbr.c
1766
libavcodec/aacsbr.c
File diff suppressed because it is too large
Load Diff
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* AAC Spectral Band Replication function declarations
|
||||
* Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
|
||||
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* AAC Spectral Band Replication function declarations
|
||||
* @author Robert Swain ( rob opendot cl )
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AACSBR_H
|
||||
#define AVCODEC_AACSBR_H
|
||||
|
||||
#include "get_bits.h"
|
||||
#include "aac.h"
|
||||
#include "sbr.h"
|
||||
|
||||
/** Initialize SBR. */
|
||||
av_cold void ff_aac_sbr_init(void);
|
||||
/** Initialize one SBR context. */
|
||||
av_cold void ff_aac_sbr_ctx_init(SpectralBandReplication *sbr);
|
||||
/** Close one SBR context. */
|
||||
av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr);
|
||||
/** Decode one SBR element. */
|
||||
int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
|
||||
GetBitContext *gb, int crc, int cnt, int id_aac);
|
||||
/** Apply one SBR element to one AAC element. */
|
||||
void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
float* L, float *R);
|
||||
|
||||
#endif /* AVCODEC_AACSBR_H */
|
@@ -1,614 +0,0 @@
|
||||
/*
|
||||
* AAC Spectral Band Replication decoding data
|
||||
* Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* AAC Spectral Band Replication decoding data
|
||||
* @author Robert Swain ( rob opendot cl )
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AACSBRDATA_H
|
||||
#define AVCODEC_AACSBRDATA_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "libavutil/mem.h"
|
||||
|
||||
///< Huffman tables for SBR
|
||||
|
||||
static const uint8_t t_huffman_env_1_5dB_bits[121] = {
|
||||
18, 18, 18, 18, 18, 18, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 17, 18, 16, 17, 18, 17,
|
||||
16, 16, 16, 16, 15, 14, 14, 13,
|
||||
13, 12, 11, 10, 9, 8, 7, 6,
|
||||
5, 4, 3, 2, 2, 3, 4, 5,
|
||||
6, 7, 8, 9, 10, 12, 13, 14,
|
||||
14, 15, 16, 17, 16, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19,
|
||||
};
|
||||
|
||||
static const uint32_t t_huffman_env_1_5dB_codes[121] = {
|
||||
0x3ffd6, 0x3ffd7, 0x3ffd8, 0x3ffd9, 0x3ffda, 0x3ffdb, 0x7ffb8, 0x7ffb9,
|
||||
0x7ffba, 0x7ffbb, 0x7ffbc, 0x7ffbd, 0x7ffbe, 0x7ffbf, 0x7ffc0, 0x7ffc1,
|
||||
0x7ffc2, 0x7ffc3, 0x7ffc4, 0x7ffc5, 0x7ffc6, 0x7ffc7, 0x7ffc8, 0x7ffc9,
|
||||
0x7ffca, 0x7ffcb, 0x7ffcc, 0x7ffcd, 0x7ffce, 0x7ffcf, 0x7ffd0, 0x7ffd1,
|
||||
0x7ffd2, 0x7ffd3, 0x1ffe6, 0x3ffd4, 0x0fff0, 0x1ffe9, 0x3ffd5, 0x1ffe7,
|
||||
0x0fff1, 0x0ffec, 0x0ffed, 0x0ffee, 0x07ff4, 0x03ff9, 0x03ff7, 0x01ffa,
|
||||
0x01ff9, 0x00ffb, 0x007fc, 0x003fc, 0x001fd, 0x000fd, 0x0007d, 0x0003d,
|
||||
0x0001d, 0x0000d, 0x00005, 0x00001, 0x00000, 0x00004, 0x0000c, 0x0001c,
|
||||
0x0003c, 0x0007c, 0x000fc, 0x001fc, 0x003fd, 0x00ffa, 0x01ff8, 0x03ff6,
|
||||
0x03ff8, 0x07ff5, 0x0ffef, 0x1ffe8, 0x0fff2, 0x7ffd4, 0x7ffd5, 0x7ffd6,
|
||||
0x7ffd7, 0x7ffd8, 0x7ffd9, 0x7ffda, 0x7ffdb, 0x7ffdc, 0x7ffdd, 0x7ffde,
|
||||
0x7ffdf, 0x7ffe0, 0x7ffe1, 0x7ffe2, 0x7ffe3, 0x7ffe4, 0x7ffe5, 0x7ffe6,
|
||||
0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb, 0x7ffec, 0x7ffed, 0x7ffee,
|
||||
0x7ffef, 0x7fff0, 0x7fff1, 0x7fff2, 0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6,
|
||||
0x7fff7, 0x7fff8, 0x7fff9, 0x7fffa, 0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe,
|
||||
0x7ffff,
|
||||
};
|
||||
|
||||
static const uint8_t f_huffman_env_1_5dB_bits[121] = {
|
||||
19, 19, 20, 20, 20, 20, 20, 20,
|
||||
20, 19, 20, 20, 20, 20, 19, 20,
|
||||
19, 19, 20, 18, 20, 20, 20, 19,
|
||||
20, 20, 20, 19, 20, 19, 18, 19,
|
||||
18, 18, 17, 18, 17, 17, 17, 16,
|
||||
16, 16, 15, 15, 14, 13, 13, 12,
|
||||
12, 11, 10, 9, 9, 8, 7, 6,
|
||||
5, 4, 3, 2, 2, 3, 4, 5,
|
||||
6, 8, 8, 9, 10, 11, 11, 11,
|
||||
12, 12, 13, 13, 14, 14, 16, 16,
|
||||
17, 17, 18, 18, 18, 18, 18, 18,
|
||||
18, 20, 19, 20, 20, 20, 20, 20,
|
||||
20, 19, 20, 20, 20, 20, 19, 20,
|
||||
18, 20, 20, 19, 19, 20, 20, 20,
|
||||
20, 20, 20, 20, 20, 20, 20, 20,
|
||||
20,
|
||||
};
|
||||
|
||||
static const uint32_t f_huffman_env_1_5dB_codes[121] = {
|
||||
0x7ffe7, 0x7ffe8, 0xfffd2, 0xfffd3, 0xfffd4, 0xfffd5, 0xfffd6, 0xfffd7,
|
||||
0xfffd8, 0x7ffda, 0xfffd9, 0xfffda, 0xfffdb, 0xfffdc, 0x7ffdb, 0xfffdd,
|
||||
0x7ffdc, 0x7ffdd, 0xfffde, 0x3ffe4, 0xfffdf, 0xfffe0, 0xfffe1, 0x7ffde,
|
||||
0xfffe2, 0xfffe3, 0xfffe4, 0x7ffdf, 0xfffe5, 0x7ffe0, 0x3ffe8, 0x7ffe1,
|
||||
0x3ffe0, 0x3ffe9, 0x1ffef, 0x3ffe5, 0x1ffec, 0x1ffed, 0x1ffee, 0x0fff4,
|
||||
0x0fff3, 0x0fff0, 0x07ff7, 0x07ff6, 0x03ffa, 0x01ffa, 0x01ff9, 0x00ffa,
|
||||
0x00ff8, 0x007f9, 0x003fb, 0x001fc, 0x001fa, 0x000fb, 0x0007c, 0x0003c,
|
||||
0x0001c, 0x0000c, 0x00005, 0x00001, 0x00000, 0x00004, 0x0000d, 0x0001d,
|
||||
0x0003d, 0x000fa, 0x000fc, 0x001fb, 0x003fa, 0x007f8, 0x007fa, 0x007fb,
|
||||
0x00ff9, 0x00ffb, 0x01ff8, 0x01ffb, 0x03ff8, 0x03ff9, 0x0fff1, 0x0fff2,
|
||||
0x1ffea, 0x1ffeb, 0x3ffe1, 0x3ffe2, 0x3ffea, 0x3ffe3, 0x3ffe6, 0x3ffe7,
|
||||
0x3ffeb, 0xfffe6, 0x7ffe2, 0xfffe7, 0xfffe8, 0xfffe9, 0xfffea, 0xfffeb,
|
||||
0xfffec, 0x7ffe3, 0xfffed, 0xfffee, 0xfffef, 0xffff0, 0x7ffe4, 0xffff1,
|
||||
0x3ffec, 0xffff2, 0xffff3, 0x7ffe5, 0x7ffe6, 0xffff4, 0xffff5, 0xffff6,
|
||||
0xffff7, 0xffff8, 0xffff9, 0xffffa, 0xffffb, 0xffffc, 0xffffd, 0xffffe,
|
||||
0xfffff,
|
||||
};
|
||||
|
||||
static const uint8_t t_huffman_env_bal_1_5dB_bits[49] = {
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 12, 11, 9, 7, 5, 3,
|
||||
1, 2, 4, 6, 8, 11, 12, 15,
|
||||
16, 16, 16, 16, 16, 16, 16, 17,
|
||||
17, 17, 17, 17, 17, 17, 17, 17,
|
||||
17,
|
||||
};
|
||||
|
||||
static const uint32_t t_huffman_env_bal_1_5dB_codes[49] = {
|
||||
0x0ffe4, 0x0ffe5, 0x0ffe6, 0x0ffe7, 0x0ffe8, 0x0ffe9, 0x0ffea, 0x0ffeb,
|
||||
0x0ffec, 0x0ffed, 0x0ffee, 0x0ffef, 0x0fff0, 0x0fff1, 0x0fff2, 0x0fff3,
|
||||
0x0fff4, 0x0ffe2, 0x00ffc, 0x007fc, 0x001fe, 0x0007e, 0x0001e, 0x00006,
|
||||
0x00000, 0x00002, 0x0000e, 0x0003e, 0x000fe, 0x007fd, 0x00ffd, 0x07ff0,
|
||||
0x0ffe3, 0x0fff5, 0x0fff6, 0x0fff7, 0x0fff8, 0x0fff9, 0x0fffa, 0x1fff6,
|
||||
0x1fff7, 0x1fff8, 0x1fff9, 0x1fffa, 0x1fffb, 0x1fffc, 0x1fffd, 0x1fffe,
|
||||
0x1ffff,
|
||||
};
|
||||
|
||||
static const uint8_t f_huffman_env_bal_1_5dB_bits[49] = {
|
||||
18, 18, 18, 18, 18, 18, 18, 18,
|
||||
18, 18, 18, 18, 18, 18, 18, 16,
|
||||
17, 14, 11, 11, 8, 7, 4, 2,
|
||||
1, 3, 5, 6, 9, 11, 12, 15,
|
||||
16, 18, 18, 18, 18, 18, 18, 18,
|
||||
18, 18, 18, 18, 18, 18, 18, 19,
|
||||
19,
|
||||
};
|
||||
|
||||
static const uint32_t f_huffman_env_bal_1_5dB_codes[49] = {
|
||||
0x3ffe2, 0x3ffe3, 0x3ffe4, 0x3ffe5, 0x3ffe6, 0x3ffe7, 0x3ffe8, 0x3ffe9,
|
||||
0x3ffea, 0x3ffeb, 0x3ffec, 0x3ffed, 0x3ffee, 0x3ffef, 0x3fff0, 0x0fff7,
|
||||
0x1fff0, 0x03ffc, 0x007fe, 0x007fc, 0x000fe, 0x0007e, 0x0000e, 0x00002,
|
||||
0x00000, 0x00006, 0x0001e, 0x0003e, 0x001fe, 0x007fd, 0x00ffe, 0x07ffa,
|
||||
0x0fff6, 0x3fff1, 0x3fff2, 0x3fff3, 0x3fff4, 0x3fff5, 0x3fff6, 0x3fff7,
|
||||
0x3fff8, 0x3fff9, 0x3fffa, 0x3fffb, 0x3fffc, 0x3fffd, 0x3fffe, 0x7fffe,
|
||||
0x7ffff,
|
||||
};
|
||||
|
||||
static const uint8_t t_huffman_env_3_0dB_bits[63] = {
|
||||
18, 18, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 17, 16, 16, 16, 14, 14, 14,
|
||||
13, 12, 11, 8, 6, 4, 2, 1,
|
||||
3, 5, 7, 9, 11, 13, 14, 14,
|
||||
15, 16, 17, 18, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19,
|
||||
};
|
||||
|
||||
static const uint32_t t_huffman_env_3_0dB_codes[63] = {
|
||||
0x3ffed, 0x3ffee, 0x7ffde, 0x7ffdf, 0x7ffe0, 0x7ffe1, 0x7ffe2, 0x7ffe3,
|
||||
0x7ffe4, 0x7ffe5, 0x7ffe6, 0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb,
|
||||
0x7ffec, 0x1fff4, 0x0fff7, 0x0fff9, 0x0fff8, 0x03ffb, 0x03ffa, 0x03ff8,
|
||||
0x01ffa, 0x00ffc, 0x007fc, 0x000fe, 0x0003e, 0x0000e, 0x00002, 0x00000,
|
||||
0x00006, 0x0001e, 0x0007e, 0x001fe, 0x007fd, 0x01ffb, 0x03ff9, 0x03ffc,
|
||||
0x07ffa, 0x0fff6, 0x1fff5, 0x3ffec, 0x7ffed, 0x7ffee, 0x7ffef, 0x7fff0,
|
||||
0x7fff1, 0x7fff2, 0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6, 0x7fff7, 0x7fff8,
|
||||
0x7fff9, 0x7fffa, 0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe, 0x7ffff,
|
||||
};
|
||||
|
||||
static const uint8_t f_huffman_env_3_0dB_bits[63] = {
|
||||
20, 20, 20, 20, 20, 20, 20, 18,
|
||||
19, 19, 19, 19, 18, 18, 20, 19,
|
||||
17, 18, 17, 16, 16, 15, 14, 12,
|
||||
11, 10, 9, 8, 6, 4, 2, 1,
|
||||
3, 5, 8, 9, 10, 11, 12, 13,
|
||||
14, 15, 15, 16, 16, 17, 17, 18,
|
||||
18, 18, 20, 19, 19, 19, 20, 19,
|
||||
19, 20, 20, 20, 20, 20, 20,
|
||||
};
|
||||
|
||||
static const uint32_t f_huffman_env_3_0dB_codes[63] = {
|
||||
0xffff0, 0xffff1, 0xffff2, 0xffff3, 0xffff4, 0xffff5, 0xffff6, 0x3fff3,
|
||||
0x7fff5, 0x7ffee, 0x7ffef, 0x7fff6, 0x3fff4, 0x3fff2, 0xffff7, 0x7fff0,
|
||||
0x1fff5, 0x3fff0, 0x1fff4, 0x0fff7, 0x0fff6, 0x07ff8, 0x03ffb, 0x00ffd,
|
||||
0x007fd, 0x003fd, 0x001fd, 0x000fd, 0x0003e, 0x0000e, 0x00002, 0x00000,
|
||||
0x00006, 0x0001e, 0x000fc, 0x001fc, 0x003fc, 0x007fc, 0x00ffc, 0x01ffc,
|
||||
0x03ffa, 0x07ff9, 0x07ffa, 0x0fff8, 0x0fff9, 0x1fff6, 0x1fff7, 0x3fff5,
|
||||
0x3fff6, 0x3fff1, 0xffff8, 0x7fff1, 0x7fff2, 0x7fff3, 0xffff9, 0x7fff7,
|
||||
0x7fff4, 0xffffa, 0xffffb, 0xffffc, 0xffffd, 0xffffe, 0xfffff,
|
||||
};
|
||||
|
||||
static const uint8_t t_huffman_env_bal_3_0dB_bits[25] = {
|
||||
13, 13, 13, 13, 13, 13, 13, 12,
|
||||
8, 7, 4, 3, 1, 2, 5, 6,
|
||||
9, 13, 13, 13, 13, 13, 13, 14,
|
||||
14,
|
||||
};
|
||||
|
||||
static const uint16_t t_huffman_env_bal_3_0dB_codes[25] = {
|
||||
0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1ff8, 0x0ff8,
|
||||
0x00fe, 0x007e, 0x000e, 0x0006, 0x0000, 0x0002, 0x001e, 0x003e,
|
||||
0x01fe, 0x1ff9, 0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x3ffe,
|
||||
0x3fff,
|
||||
};
|
||||
|
||||
static const uint8_t f_huffman_env_bal_3_0dB_bits[25] = {
|
||||
13, 13, 13, 13, 13, 14, 14, 11,
|
||||
8, 7, 4, 2, 1, 3, 5, 6,
|
||||
9, 12, 13, 14, 14, 14, 14, 14,
|
||||
14,
|
||||
};
|
||||
|
||||
static const uint16_t f_huffman_env_bal_3_0dB_codes[25] = {
|
||||
0x1ff7, 0x1ff8, 0x1ff9, 0x1ffa, 0x1ffb, 0x3ff8, 0x3ff9, 0x07fc,
|
||||
0x00fe, 0x007e, 0x000e, 0x0002, 0x0000, 0x0006, 0x001e, 0x003e,
|
||||
0x01fe, 0x0ffa, 0x1ff6, 0x3ffa, 0x3ffb, 0x3ffc, 0x3ffd, 0x3ffe,
|
||||
0x3fff,
|
||||
};
|
||||
|
||||
static const uint8_t t_huffman_noise_3_0dB_bits[63] = {
|
||||
13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 11, 8, 6, 4, 3, 1,
|
||||
2, 5, 8, 10, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 14, 14,
|
||||
};
|
||||
|
||||
static const uint16_t t_huffman_noise_3_0dB_codes[63] = {
|
||||
0x1fce, 0x1fcf, 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x1fd4, 0x1fd5,
|
||||
0x1fd6, 0x1fd7, 0x1fd8, 0x1fd9, 0x1fda, 0x1fdb, 0x1fdc, 0x1fdd,
|
||||
0x1fde, 0x1fdf, 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5,
|
||||
0x1fe6, 0x1fe7, 0x07f2, 0x00fd, 0x003e, 0x000e, 0x0006, 0x0000,
|
||||
0x0002, 0x001e, 0x00fc, 0x03f8, 0x1fcc, 0x1fe8, 0x1fe9, 0x1fea,
|
||||
0x1feb, 0x1fec, 0x1fcd, 0x1fed, 0x1fee, 0x1fef, 0x1ff0, 0x1ff1,
|
||||
0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1ff8, 0x1ff9,
|
||||
0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x3ffe, 0x3fff,
|
||||
};
|
||||
|
||||
static const uint8_t t_huffman_noise_bal_3_0dB_bits[25] = {
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 5, 2, 1, 3, 6, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8,
|
||||
};
|
||||
|
||||
static const uint8_t t_huffman_noise_bal_3_0dB_codes[25] = {
|
||||
0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3,
|
||||
0xf4, 0xf5, 0x1c, 0x02, 0x00, 0x06, 0x3a, 0xf6,
|
||||
0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe,
|
||||
0xff,
|
||||
};
|
||||
|
||||
static const int8_t sbr_offset[6][16] = {
|
||||
{-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}, // fs_sbr = 16000 Hz
|
||||
{-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13}, // fs_sbr = 22050 Hz
|
||||
{-5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, // fs_sbr = 24000 Hz
|
||||
{-6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, // fs_sbr = 32000 Hz
|
||||
{-4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20}, // 44100 Hz <= fs_sbr <= 64000 Hz
|
||||
{-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, // 64000 Hz < fs_sbr
|
||||
};
|
||||
|
||||
///< window coefficients for analysis/synthesis QMF banks
|
||||
static DECLARE_ALIGNED(16, float, sbr_qmf_window_ds)[320];
|
||||
static DECLARE_ALIGNED(16, float, sbr_qmf_window_us)[640] = {
|
||||
0.0000000000, -0.0005525286, -0.0005617692, -0.0004947518,
|
||||
-0.0004875227, -0.0004893791, -0.0005040714, -0.0005226564,
|
||||
-0.0005466565, -0.0005677802, -0.0005870930, -0.0006132747,
|
||||
-0.0006312493, -0.0006540333, -0.0006777690, -0.0006941614,
|
||||
-0.0007157736, -0.0007255043, -0.0007440941, -0.0007490598,
|
||||
-0.0007681371, -0.0007724848, -0.0007834332, -0.0007779869,
|
||||
-0.0007803664, -0.0007801449, -0.0007757977, -0.0007630793,
|
||||
-0.0007530001, -0.0007319357, -0.0007215391, -0.0006917937,
|
||||
-0.0006650415, -0.0006341594, -0.0005946118, -0.0005564576,
|
||||
-0.0005145572, -0.0004606325, -0.0004095121, -0.0003501175,
|
||||
-0.0002896981, -0.0002098337, -0.0001446380, -0.0000617334,
|
||||
0.0000134949, 0.0001094383, 0.0002043017, 0.0002949531,
|
||||
0.0004026540, 0.0005107388, 0.0006239376, 0.0007458025,
|
||||
0.0008608443, 0.0009885988, 0.0011250155, 0.0012577884,
|
||||
0.0013902494, 0.0015443219, 0.0016868083, 0.0018348265,
|
||||
0.0019841140, 0.0021461583, 0.0023017254, 0.0024625616,
|
||||
0.0026201758, 0.0027870464, 0.0029469447, 0.0031125420,
|
||||
0.0032739613, 0.0034418874, 0.0036008268, 0.0037603922,
|
||||
0.0039207432, 0.0040819753, 0.0042264269, 0.0043730719,
|
||||
0.0045209852, 0.0046606460, 0.0047932560, 0.0049137603,
|
||||
0.0050393022, 0.0051407353, 0.0052461166, 0.0053471681,
|
||||
0.0054196775, 0.0054876040, 0.0055475714, 0.0055938023,
|
||||
0.0056220643, 0.0056455196, 0.0056389199, 0.0056266114,
|
||||
0.0055917128, 0.0055404363, 0.0054753783, 0.0053838975,
|
||||
0.0052715758, 0.0051382275, 0.0049839687, 0.0048109469,
|
||||
0.0046039530, 0.0043801861, 0.0041251642, 0.0038456408,
|
||||
0.0035401246, 0.0032091885, 0.0028446757, 0.0024508540,
|
||||
0.0020274176, 0.0015784682, 0.0010902329, 0.0005832264,
|
||||
0.0000276045, -0.0005464280, -0.0011568135, -0.0018039472,
|
||||
-0.0024826723, -0.0031933778, -0.0039401124, -0.0047222596,
|
||||
-0.0055337211, -0.0063792293, -0.0072615816, -0.0081798233,
|
||||
-0.0091325329, -0.0101150215, -0.0111315548, -0.0121849995,
|
||||
0.0132718220, 0.0143904666, 0.0155405553, 0.0167324712,
|
||||
0.0179433381, 0.0191872431, 0.0204531793, 0.0217467550,
|
||||
0.0230680169, 0.0244160992, 0.0257875847, 0.0271859429,
|
||||
0.0286072173, 0.0300502657, 0.0315017608, 0.0329754081,
|
||||
0.0344620948, 0.0359697560, 0.0374812850, 0.0390053679,
|
||||
0.0405349170, 0.0420649094, 0.0436097542, 0.0451488405,
|
||||
0.0466843027, 0.0482165720, 0.0497385755, 0.0512556155,
|
||||
0.0527630746, 0.0542452768, 0.0557173648, 0.0571616450,
|
||||
0.0585915683, 0.0599837480, 0.0613455171, 0.0626857808,
|
||||
0.0639715898, 0.0652247106, 0.0664367512, 0.0676075985,
|
||||
0.0687043828, 0.0697630244, 0.0707628710, 0.0717002673,
|
||||
0.0725682583, 0.0733620255, 0.0741003642, 0.0747452558,
|
||||
0.0753137336, 0.0758008358, 0.0761992479, 0.0764992170,
|
||||
0.0767093490, 0.0768173975, 0.0768230011, 0.0767204924,
|
||||
0.0765050718, 0.0761748321, 0.0757305756, 0.0751576255,
|
||||
0.0744664394, 0.0736406005, 0.0726774642, 0.0715826364,
|
||||
0.0703533073, 0.0689664013, 0.0674525021, 0.0657690668,
|
||||
0.0639444805, 0.0619602779, 0.0598166570, 0.0575152691,
|
||||
0.0550460034, 0.0524093821, 0.0495978676, 0.0466303305,
|
||||
0.0434768782, 0.0401458278, 0.0366418116, 0.0329583930,
|
||||
0.0290824006, 0.0250307561, 0.0207997072, 0.0163701258,
|
||||
0.0117623832, 0.0069636862, 0.0019765601, -0.0032086896,
|
||||
-0.0085711749, -0.0141288827, -0.0198834129, -0.0258227288,
|
||||
-0.0319531274, -0.0382776572, -0.0447806821, -0.0514804176,
|
||||
-0.0583705326, -0.0654409853, -0.0726943300, -0.0801372934,
|
||||
-0.0877547536, -0.0955533352, -0.1035329531, -0.1116826931,
|
||||
-0.1200077984, -0.1285002850, -0.1371551761, -0.1459766491,
|
||||
-0.1549607071, -0.1640958855, -0.1733808172, -0.1828172548,
|
||||
-0.1923966745, -0.2021250176, -0.2119735853, -0.2219652696,
|
||||
-0.2320690870, -0.2423016884, -0.2526480309, -0.2631053299,
|
||||
-0.2736634040, -0.2843214189, -0.2950716717, -0.3059098575,
|
||||
-0.3168278913, -0.3278113727, -0.3388722693, -0.3499914122,
|
||||
0.3611589903, 0.3723795546, 0.3836350013, 0.3949211761,
|
||||
0.4062317676, 0.4175696896, 0.4289119920, 0.4402553754,
|
||||
0.4515996535, 0.4629308085, 0.4742453214, 0.4855253091,
|
||||
0.4967708254, 0.5079817500, 0.5191234970, 0.5302240895,
|
||||
0.5412553448, 0.5522051258, 0.5630789140, 0.5738524131,
|
||||
0.5845403235, 0.5951123086, 0.6055783538, 0.6159109932,
|
||||
0.6261242695, 0.6361980107, 0.6461269695, 0.6559016302,
|
||||
0.6655139880, 0.6749663190, 0.6842353293, 0.6933282376,
|
||||
0.7022388719, 0.7109410426, 0.7194462634, 0.7277448900,
|
||||
0.7358211758, 0.7436827863, 0.7513137456, 0.7587080760,
|
||||
0.7658674865, 0.7727780881, 0.7794287519, 0.7858353120,
|
||||
0.7919735841, 0.7978466413, 0.8034485751, 0.8087695004,
|
||||
0.8138191270, 0.8185776004, 0.8230419890, 0.8272275347,
|
||||
0.8311038457, 0.8346937361, 0.8379717337, 0.8409541392,
|
||||
0.8436238281, 0.8459818469, 0.8480315777, 0.8497805198,
|
||||
0.8511971524, 0.8523047035, 0.8531020949, 0.8535720573,
|
||||
0.8537385600,
|
||||
};
|
||||
|
||||
static const float sbr_noise_table[512][2] = {
|
||||
{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
|
||||
{ 0.14130051758487, -0.95090983575689}, {-0.47005496701697, -0.37340549728647},
|
||||
{ 0.80705063769351, 0.29653668284408}, {-0.38981478896926, 0.89572605717087},
|
||||
{-0.01053049862020, -0.66959058036166}, {-0.91266367957293, -0.11522938140034},
|
||||
{ 0.54840422910309, 0.75221367176302}, { 0.40009252867955, -0.98929400334421},
|
||||
{-0.99867974711855, -0.88147068645358}, {-0.95531076805040, 0.90908757154593},
|
||||
{-0.45725933317144, -0.56716323646760}, {-0.72929675029275, -0.98008272727324},
|
||||
{ 0.75622801399036, 0.20950329995549}, { 0.07069442601050, -0.78247898470706},
|
||||
{ 0.74496252926055, -0.91169004445807}, {-0.96440182703856, -0.94739918296622},
|
||||
{ 0.30424629369539, -0.49438267012479}, { 0.66565033746925, 0.64652935542491},
|
||||
{ 0.91697008020594, 0.17514097332009}, {-0.70774918760427, 0.52548653416543},
|
||||
{-0.70051415345560, -0.45340028808763}, {-0.99496513054797, -0.90071908066973},
|
||||
{ 0.98164490790123, -0.77463155528697}, {-0.54671580548181, -0.02570928536004},
|
||||
{-0.01689629065389, 0.00287506445732}, {-0.86110349531986, 0.42548583726477},
|
||||
{-0.98892980586032, -0.87881132267556}, { 0.51756627678691, 0.66926784710139},
|
||||
{-0.99635026409640, -0.58107730574765}, {-0.99969370862163, 0.98369989360250},
|
||||
{ 0.55266258627194, 0.59449057465591}, { 0.34581177741673, 0.94879421061866},
|
||||
{ 0.62664209577999, -0.74402970906471}, {-0.77149701404973, -0.33883658042801},
|
||||
{-0.91592244254432, 0.03687901376713}, {-0.76285492357887, -0.91371867919124},
|
||||
{ 0.79788337195331, -0.93180971199849}, { 0.54473080610200, -0.11919206037186},
|
||||
{-0.85639281671058, 0.42429854760451}, {-0.92882402971423, 0.27871809078609},
|
||||
{-0.11708371046774, -0.99800843444966}, { 0.21356749817493, -0.90716295627033},
|
||||
{-0.76191692573909, 0.99768118356265}, { 0.98111043100884, -0.95854459734407},
|
||||
{-0.85913269895572, 0.95766566168880}, {-0.93307242253692, 0.49431757696466},
|
||||
{ 0.30485754879632, -0.70540034357529}, { 0.85289650925190, 0.46766131791044},
|
||||
{ 0.91328082618125, -0.99839597361769}, {-0.05890199924154, 0.70741827819497},
|
||||
{ 0.28398686150148, 0.34633555702188}, { 0.95258164539612, -0.54893416026939},
|
||||
{-0.78566324168507, -0.75568541079691}, {-0.95789495447877, -0.20423194696966},
|
||||
{ 0.82411158711197, 0.96654618432562}, {-0.65185446735885, -0.88734990773289},
|
||||
{-0.93643603134666, 0.99870790442385}, { 0.91427159529618, -0.98290505544444},
|
||||
{-0.70395684036886, 0.58796798221039}, { 0.00563771969365, 0.61768196727244},
|
||||
{ 0.89065051931895, 0.52783352697585}, {-0.68683707712762, 0.80806944710339},
|
||||
{ 0.72165342518718, -0.69259857349564}, {-0.62928247730667, 0.13627037407335},
|
||||
{ 0.29938434065514, -0.46051329682246}, {-0.91781958879280, -0.74012716684186},
|
||||
{ 0.99298717043688, 0.40816610075661}, { 0.82368298622748, -0.74036047190173},
|
||||
{-0.98512833386833, -0.99972330709594}, {-0.95915368242257, -0.99237800466040},
|
||||
{-0.21411126572790, -0.93424819052545}, {-0.68821476106884, -0.26892306315457},
|
||||
{ 0.91851997982317, 0.09358228901785}, {-0.96062769559127, 0.36099095133739},
|
||||
{ 0.51646184922287, -0.71373332873917}, { 0.61130721139669, 0.46950141175917},
|
||||
{ 0.47336129371299, -0.27333178296162}, { 0.90998308703519, 0.96715662938132},
|
||||
{ 0.44844799194357, 0.99211574628306}, { 0.66614891079092, 0.96590176169121},
|
||||
{ 0.74922239129237, -0.89879858826087}, {-0.99571588506485, 0.52785521494349},
|
||||
{ 0.97401082477563, -0.16855870075190}, { 0.72683747733879, -0.48060774432251},
|
||||
{ 0.95432193457128, 0.68849603408441}, {-0.72962208425191, -0.76608443420917},
|
||||
{-0.85359479233537, 0.88738125901579}, {-0.81412430338535, -0.97480768049637},
|
||||
{-0.87930772356786, 0.74748307690436}, {-0.71573331064977, -0.98570608178923},
|
||||
{ 0.83524300028228, 0.83702537075163}, {-0.48086065601423, -0.98848504923531},
|
||||
{ 0.97139128574778, 0.80093621198236}, { 0.51992825347895, 0.80247631400510},
|
||||
{-0.00848591195325, -0.76670128000486}, {-0.70294374303036, 0.55359910445577},
|
||||
{-0.95894428168140, -0.43265504344783}, { 0.97079252950321, 0.09325857238682},
|
||||
{-0.92404293670797, 0.85507704027855}, {-0.69506469500450, 0.98633412625459},
|
||||
{ 0.26559203620024, 0.73314307966524}, { 0.28038443336943, 0.14537913654427},
|
||||
{-0.74138124825523, 0.99310339807762}, {-0.01752795995444, -0.82616635284178},
|
||||
{-0.55126773094930, -0.98898543862153}, { 0.97960898850996, -0.94021446752851},
|
||||
{-0.99196309146936, 0.67019017358456}, {-0.67684928085260, 0.12631491649378},
|
||||
{ 0.09140039465500, -0.20537731453108}, {-0.71658965751996, -0.97788200391224},
|
||||
{ 0.81014640078925, 0.53722648362443}, { 0.40616991671205, -0.26469008598449},
|
||||
{-0.67680188682972, 0.94502052337695}, { 0.86849774348749, -0.18333598647899},
|
||||
{-0.99500381284851, -0.02634122068550}, { 0.84329189340667, 0.10406957462213},
|
||||
{-0.09215968531446, 0.69540012101253}, { 0.99956173327206, -0.12358542001404},
|
||||
{-0.79732779473535, -0.91582524736159}, { 0.96349973642406, 0.96640458041000},
|
||||
{-0.79942778496547, 0.64323902822857}, {-0.11566039853896, 0.28587846253726},
|
||||
{-0.39922954514662, 0.94129601616966}, { 0.99089197565987, -0.92062625581587},
|
||||
{ 0.28631285179909, -0.91035047143603}, {-0.83302725605608, -0.67330410892084},
|
||||
{ 0.95404443402072, 0.49162765398743}, {-0.06449863579434, 0.03250560813135},
|
||||
{-0.99575054486311, 0.42389784469507}, {-0.65501142790847, 0.82546114655624},
|
||||
{-0.81254441908887, -0.51627234660629}, {-0.99646369485481, 0.84490533520752},
|
||||
{ 0.00287840603348, 0.64768261158166}, { 0.70176989408455, -0.20453028573322},
|
||||
{ 0.96361882270190, 0.40706967140989}, {-0.68883758192426, 0.91338958840772},
|
||||
{-0.34875585502238, 0.71472290693300}, { 0.91980081243087, 0.66507455644919},
|
||||
{-0.99009048343881, 0.85868021604848}, { 0.68865791458395, 0.55660316809678},
|
||||
{-0.99484402129368, -0.20052559254934}, { 0.94214511408023, -0.99696425367461},
|
||||
{-0.67414626793544, 0.49548221180078}, {-0.47339353684664, -0.85904328834047},
|
||||
{ 0.14323651387360, -0.94145598222488}, {-0.29268293575672, 0.05759224927952},
|
||||
{ 0.43793861458754, -0.78904969892724}, {-0.36345126374441, 0.64874435357162},
|
||||
{-0.08750604656825, 0.97686944362527}, {-0.96495267812511, -0.53960305946511},
|
||||
{ 0.55526940659947, 0.78891523734774}, { 0.73538215752630, 0.96452072373404},
|
||||
{-0.30889773919437, -0.80664389776860}, { 0.03574995626194, -0.97325616900959},
|
||||
{ 0.98720684660488, 0.48409133691962}, {-0.81689296271203, -0.90827703628298},
|
||||
{ 0.67866860118215, 0.81284503870856}, {-0.15808569732583, 0.85279555024382},
|
||||
{ 0.80723395114371, -0.24717418514605}, { 0.47788757329038, -0.46333147839295},
|
||||
{ 0.96367554763201, 0.38486749303242}, {-0.99143875716818, -0.24945277239809},
|
||||
{ 0.83081876925833, -0.94780851414763}, {-0.58753191905341, 0.01290772389163},
|
||||
{ 0.95538108220960, -0.85557052096538}, {-0.96490920476211, -0.64020970923102},
|
||||
{-0.97327101028521, 0.12378128133110}, { 0.91400366022124, 0.57972471346930},
|
||||
{-0.99925837363824, 0.71084847864067}, {-0.86875903507313, -0.20291699203564},
|
||||
{-0.26240034795124, -0.68264554369108}, {-0.24664412953388, -0.87642273115183},
|
||||
{ 0.02416275806869, 0.27192914288905}, { 0.82068619590515, -0.85087787994476},
|
||||
{ 0.88547373760759, -0.89636802901469}, {-0.18173078152226, -0.26152145156800},
|
||||
{ 0.09355476558534, 0.54845123045604}, {-0.54668414224090, 0.95980774020221},
|
||||
{ 0.37050990604091, -0.59910140383171}, {-0.70373594262891, 0.91227665827081},
|
||||
{-0.34600785879594, -0.99441426144200}, {-0.68774481731008, -0.30238837956299},
|
||||
{-0.26843291251234, 0.83115668004362}, { 0.49072334613242, -0.45359708737775},
|
||||
{ 0.38975993093975, 0.95515358099121}, {-0.97757125224150, 0.05305894580606},
|
||||
{-0.17325552859616, -0.92770672250494}, { 0.99948035025744, 0.58285545563426},
|
||||
{-0.64946246527458, 0.68645507104960}, {-0.12016920576437, -0.57147322153312},
|
||||
{-0.58947456517751, -0.34847132454388}, {-0.41815140454465, 0.16276422358861},
|
||||
{ 0.99885650204884, 0.11136095490444}, {-0.56649614128386, -0.90494866361587},
|
||||
{ 0.94138021032330, 0.35281916733018}, {-0.75725076534641, 0.53650549640587},
|
||||
{ 0.20541973692630, -0.94435144369918}, { 0.99980371023351, 0.79835913565599},
|
||||
{ 0.29078277605775, 0.35393777921520}, {-0.62858772103030, 0.38765693387102},
|
||||
{ 0.43440904467688, -0.98546330463232}, {-0.98298583762390, 0.21021524625209},
|
||||
{ 0.19513029146934, -0.94239832251867}, {-0.95476662400101, 0.98364554179143},
|
||||
{ 0.93379635304810, -0.70881994583682}, {-0.85235410573336, -0.08342347966410},
|
||||
{-0.86425093011245, -0.45795025029466}, { 0.38879779059045, 0.97274429344593},
|
||||
{ 0.92045124735495, -0.62433652524220}, { 0.89162532251878, 0.54950955570563},
|
||||
{-0.36834336949252, 0.96458298020975}, { 0.93891760988045, -0.89968353740388},
|
||||
{ 0.99267657565094, -0.03757034316958}, {-0.94063471614176, 0.41332338538963},
|
||||
{ 0.99740224117019, -0.16830494996370}, {-0.35899413170555, -0.46633226649613},
|
||||
{ 0.05237237274947, -0.25640361602661}, { 0.36703583957424, -0.38653265641875},
|
||||
{ 0.91653180367913, -0.30587628726597}, { 0.69000803499316, 0.90952171386132},
|
||||
{-0.38658751133527, 0.99501571208985}, {-0.29250814029851, 0.37444994344615},
|
||||
{-0.60182204677608, 0.86779651036123}, {-0.97418588163217, 0.96468523666475},
|
||||
{ 0.88461574003963, 0.57508405276414}, { 0.05198933055162, 0.21269661669964},
|
||||
{-0.53499621979720, 0.97241553731237}, {-0.49429560226497, 0.98183865291903},
|
||||
{-0.98935142339139, -0.40249159006933}, {-0.98081380091130, -0.72856895534041},
|
||||
{-0.27338148835532, 0.99950922447209}, { 0.06310802338302, -0.54539587529618},
|
||||
{-0.20461677199539, -0.14209977628489}, { 0.66223843141647, 0.72528579940326},
|
||||
{-0.84764345483665, 0.02372316801261}, {-0.89039863483811, 0.88866581484602},
|
||||
{ 0.95903308477986, 0.76744927173873}, { 0.73504123909879, -0.03747203173192},
|
||||
{-0.31744434966056, -0.36834111883652}, {-0.34110827591623, 0.40211222807691},
|
||||
{ 0.47803883714199, -0.39423219786288}, { 0.98299195879514, 0.01989791390047},
|
||||
{-0.30963073129751, -0.18076720599336}, { 0.99992588229018, -0.26281872094289},
|
||||
{-0.93149731080767, -0.98313162570490}, { 0.99923472302773, -0.80142993767554},
|
||||
{-0.26024169633417, -0.75999759855752}, {-0.35712514743563, 0.19298963768574},
|
||||
{-0.99899084509530, 0.74645156992493}, { 0.86557171579452, 0.55593866696299},
|
||||
{ 0.33408042438752, 0.86185953874709}, { 0.99010736374716, 0.04602397576623},
|
||||
{-0.66694269691195, -0.91643611810148}, { 0.64016792079480, 0.15649530836856},
|
||||
{ 0.99570534804836, 0.45844586038111}, {-0.63431466947340, 0.21079116459234},
|
||||
{-0.07706847005931, -0.89581437101329}, { 0.98590090577724, 0.88241721133981},
|
||||
{ 0.80099335254678, -0.36851896710853}, { 0.78368131392666, 0.45506999802597},
|
||||
{ 0.08707806671691, 0.80938994918745}, {-0.86811883080712, 0.39347308654705},
|
||||
{-0.39466529740375, -0.66809432114456}, { 0.97875325649683, -0.72467840967746},
|
||||
{-0.95038560288864, 0.89563219587625}, { 0.17005239424212, 0.54683053962658},
|
||||
{-0.76910792026848, -0.96226617549298}, { 0.99743281016846, 0.42697157037567},
|
||||
{ 0.95437383549973, 0.97002324109952}, { 0.99578905365569, -0.54106826257356},
|
||||
{ 0.28058259829990, -0.85361420634036}, { 0.85256524470573, -0.64567607735589},
|
||||
{-0.50608540105128, -0.65846015480300}, {-0.97210735183243, -0.23095213067791},
|
||||
{ 0.95424048234441, -0.99240147091219}, {-0.96926570524023, 0.73775654896574},
|
||||
{ 0.30872163214726, 0.41514960556126}, {-0.24523839572639, 0.63206633394807},
|
||||
{-0.33813265086024, -0.38661779441897}, {-0.05826828420146, -0.06940774188029},
|
||||
{-0.22898461455054, 0.97054853316316}, {-0.18509915019881, 0.47565762892084},
|
||||
{-0.10488238045009, -0.87769947402394}, {-0.71886586182037, 0.78030982480538},
|
||||
{ 0.99793873738654, 0.90041310491497}, { 0.57563307626120, -0.91034337352097},
|
||||
{ 0.28909646383717, 0.96307783970534}, { 0.42188998312520, 0.48148651230437},
|
||||
{ 0.93335049681047, -0.43537023883588}, {-0.97087374418267, 0.86636445711364},
|
||||
{ 0.36722871286923, 0.65291654172961}, {-0.81093025665696, 0.08778370229363},
|
||||
{-0.26240603062237, -0.92774095379098}, { 0.83996497984604, 0.55839849139647},
|
||||
{-0.99909615720225, -0.96024605713970}, { 0.74649464155061, 0.12144893606462},
|
||||
{-0.74774595569805, -0.26898062008959}, { 0.95781667469567, -0.79047927052628},
|
||||
{ 0.95472308713099, -0.08588776019550}, { 0.48708332746299, 0.99999041579432},
|
||||
{ 0.46332038247497, 0.10964126185063}, {-0.76497004940162, 0.89210929242238},
|
||||
{ 0.57397389364339, 0.35289703373760}, { 0.75374316974495, 0.96705214651335},
|
||||
{-0.59174397685714, -0.89405370422752}, { 0.75087906691890, -0.29612672982396},
|
||||
{-0.98607857336230, 0.25034911730023}, {-0.40761056640505, -0.90045573444695},
|
||||
{ 0.66929266740477, 0.98629493401748}, {-0.97463695257310, -0.00190223301301},
|
||||
{ 0.90145509409859, 0.99781390365446}, {-0.87259289048043, 0.99233587353666},
|
||||
{-0.91529461447692, -0.15698707534206}, {-0.03305738840705, -0.37205262859764},
|
||||
{ 0.07223051368337, -0.88805001733626}, { 0.99498012188353, 0.97094358113387},
|
||||
{-0.74904939500519, 0.99985483641521}, { 0.04585228574211, 0.99812337444082},
|
||||
{-0.89054954257993, -0.31791913188064}, {-0.83782144651251, 0.97637632547466},
|
||||
{ 0.33454804933804, -0.86231516800408}, {-0.99707579362824, 0.93237990079441},
|
||||
{-0.22827527843994, 0.18874759397997}, { 0.67248046289143, -0.03646211390569},
|
||||
{-0.05146538187944, -0.92599700120679}, { 0.99947295749905, 0.93625229707912},
|
||||
{ 0.66951124390363, 0.98905825623893}, {-0.99602956559179, -0.44654715757688},
|
||||
{ 0.82104905483590, 0.99540741724928}, { 0.99186510988782, 0.72023001312947},
|
||||
{-0.65284592392918, 0.52186723253637}, { 0.93885443798188, -0.74895312615259},
|
||||
{ 0.96735248738388, 0.90891816978629}, {-0.22225968841114, 0.57124029781228},
|
||||
{-0.44132783753414, -0.92688840659280}, {-0.85694974219574, 0.88844532719844},
|
||||
{ 0.91783042091762, -0.46356892383970}, { 0.72556974415690, -0.99899555770747},
|
||||
{-0.99711581834508, 0.58211560180426}, { 0.77638976371966, 0.94321834873819},
|
||||
{ 0.07717324253925, 0.58638399856595}, {-0.56049829194163, 0.82522301569036},
|
||||
{ 0.98398893639988, 0.39467440420569}, { 0.47546946844938, 0.68613044836811},
|
||||
{ 0.65675089314631, 0.18331637134880}, { 0.03273375457980, -0.74933109564108},
|
||||
{-0.38684144784738, 0.51337349030406}, {-0.97346267944545, -0.96549364384098},
|
||||
{-0.53282156061942, -0.91423265091354}, { 0.99817310731176, 0.61133572482148},
|
||||
{-0.50254500772635, -0.88829338134294}, { 0.01995873238855, 0.85223515096765},
|
||||
{ 0.99930381973804, 0.94578896296649}, { 0.82907767600783, -0.06323442598128},
|
||||
{-0.58660709669728, 0.96840773806582}, {-0.17573736667267, -0.48166920859485},
|
||||
{ 0.83434292401346, -0.13023450646997}, { 0.05946491307025, 0.20511047074866},
|
||||
{ 0.81505484574602, -0.94685947861369}, {-0.44976380954860, 0.40894572671545},
|
||||
{-0.89746474625671, 0.99846578838537}, { 0.39677256130792, -0.74854668609359},
|
||||
{-0.07588948563079, 0.74096214084170}, { 0.76343198951445, 0.41746629422634},
|
||||
{-0.74490104699626, 0.94725911744610}, { 0.64880119792759, 0.41336660830571},
|
||||
{ 0.62319537462542, -0.93098313552599}, { 0.42215817594807, -0.07712787385208},
|
||||
{ 0.02704554141885, -0.05417518053666}, { 0.80001773566818, 0.91542195141039},
|
||||
{-0.79351832348816, -0.36208897989136}, { 0.63872359151636, 0.08128252493444},
|
||||
{ 0.52890520960295, 0.60048872455592}, { 0.74238552914587, 0.04491915291044},
|
||||
{ 0.99096131449250, -0.19451182854402}, {-0.80412329643109, -0.88513818199457},
|
||||
{-0.64612616129736, 0.72198674804544}, { 0.11657770663191, -0.83662833815041},
|
||||
{-0.95053182488101, -0.96939905138082}, {-0.62228872928622, 0.82767262846661},
|
||||
{ 0.03004475787316, -0.99738896333384}, {-0.97987214341034, 0.36526129686425},
|
||||
{-0.99986980746200, -0.36021610299715}, { 0.89110648599879, -0.97894250343044},
|
||||
{ 0.10407960510582, 0.77357793811619}, { 0.95964737821728, -0.35435818285502},
|
||||
{ 0.50843233159162, 0.96107691266205}, { 0.17006334670615, -0.76854025314829},
|
||||
{ 0.25872675063360, 0.99893303933816}, {-0.01115998681937, 0.98496019742444},
|
||||
{-0.79598702973261, 0.97138411318894}, {-0.99264708948101, -0.99542822402536},
|
||||
{-0.99829663752818, 0.01877138824311}, {-0.70801016548184, 0.33680685948117},
|
||||
{-0.70467057786826, 0.93272777501857}, { 0.99846021905254, -0.98725746254433},
|
||||
{-0.63364968534650, -0.16473594423746}, {-0.16258217500792, -0.95939125400802},
|
||||
{-0.43645594360633, -0.94805030113284}, {-0.99848471702976, 0.96245166923809},
|
||||
{-0.16796458968998, -0.98987511890470}, {-0.87979225745213, -0.71725725041680},
|
||||
{ 0.44183099021786, -0.93568974498761}, { 0.93310180125532, -0.99913308068246},
|
||||
{-0.93941931782002, -0.56409379640356}, {-0.88590003188677, 0.47624600491382},
|
||||
{ 0.99971463703691, -0.83889954253462}, {-0.75376385639978, 0.00814643438625},
|
||||
{ 0.93887685615875, -0.11284528204636}, { 0.85126435782309, 0.52349251543547},
|
||||
{ 0.39701421446381, 0.81779634174316}, {-0.37024464187437, -0.87071656222959},
|
||||
{-0.36024828242896, 0.34655735648287}, {-0.93388812549209, -0.84476541096429},
|
||||
{-0.65298804552119, -0.18439575450921}, { 0.11960319006843, 0.99899346780168},
|
||||
{ 0.94292565553160, 0.83163906518293}, { 0.75081145286948, -0.35533223142265},
|
||||
{ 0.56721979748394, -0.24076836414499}, { 0.46857766746029, -0.30140233457198},
|
||||
{ 0.97312313923635, -0.99548191630031}, {-0.38299976567017, 0.98516909715427},
|
||||
{ 0.41025800019463, 0.02116736935734}, { 0.09638062008048, 0.04411984381457},
|
||||
{-0.85283249275397, 0.91475563922421}, { 0.88866808958124, -0.99735267083226},
|
||||
{-0.48202429536989, -0.96805608884164}, { 0.27572582416567, 0.58634753335832},
|
||||
{-0.65889129659168, 0.58835634138583}, { 0.98838086953732, 0.99994349600236},
|
||||
{-0.20651349620689, 0.54593044066355}, {-0.62126416356920, -0.59893681700392},
|
||||
{ 0.20320105410437, -0.86879180355289}, {-0.97790548600584, 0.96290806999242},
|
||||
{ 0.11112534735126, 0.21484763313301}, {-0.41368337314182, 0.28216837680365},
|
||||
{ 0.24133038992960, 0.51294362630238}, {-0.66393410674885, -0.08249679629081},
|
||||
{-0.53697829178752, -0.97649903936228}, {-0.97224737889348, 0.22081333579837},
|
||||
{ 0.87392477144549, -0.12796173740361}, { 0.19050361015753, 0.01602615387195},
|
||||
{-0.46353441212724, -0.95249041539006}, {-0.07064096339021, -0.94479803205886},
|
||||
{-0.92444085484466, -0.10457590187436}, {-0.83822593578728, -0.01695043208885},
|
||||
{ 0.75214681811150, -0.99955681042665}, {-0.42102998829339, 0.99720941999394},
|
||||
{-0.72094786237696, -0.35008961934255}, { 0.78843311019251, 0.52851398958271},
|
||||
{ 0.97394027897442, -0.26695944086561}, { 0.99206463477946, -0.57010120849429},
|
||||
{ 0.76789609461795, -0.76519356730966}, {-0.82002421836409, -0.73530179553767},
|
||||
{ 0.81924990025724, 0.99698425250579}, {-0.26719850873357, 0.68903369776193},
|
||||
{-0.43311260380975, 0.85321815947490}, { 0.99194979673836, 0.91876249766422},
|
||||
{-0.80692001248487, -0.32627540663214}, { 0.43080003649976, -0.21919095636638},
|
||||
{ 0.67709491937357, -0.95478075822906}, { 0.56151770568316, -0.70693811747778},
|
||||
{ 0.10831862810749, -0.08628837174592}, { 0.91229417540436, -0.65987351408410},
|
||||
{-0.48972893932274, 0.56289246362686}, {-0.89033658689697, -0.71656563987082},
|
||||
{ 0.65269447475094, 0.65916004833932}, { 0.67439478141121, -0.81684380846796},
|
||||
{-0.47770832416973, -0.16789556203025}, {-0.99715979260878, -0.93565784007648},
|
||||
{-0.90889593602546, 0.62034397054380}, {-0.06618622548177, -0.23812217221359},
|
||||
{ 0.99430266919728, 0.18812555317553}, { 0.97686402381843, -0.28664534366620},
|
||||
{ 0.94813650221268, -0.97506640027128}, {-0.95434497492853, -0.79607978501983},
|
||||
{-0.49104783137150, 0.32895214359663}, { 0.99881175120751, 0.88993983831354},
|
||||
{ 0.50449166760303, -0.85995072408434}, { 0.47162891065108, -0.18680204049569},
|
||||
{-0.62081581361840, 0.75000676218956}, {-0.43867015250812, 0.99998069244322},
|
||||
{ 0.98630563232075, -0.53578899600662}, {-0.61510362277374, -0.89515019899997},
|
||||
{-0.03841517601843, -0.69888815681179}, {-0.30102157304644, -0.07667808922205},
|
||||
{ 0.41881284182683, 0.02188098922282}, {-0.86135454941237, 0.98947480909359},
|
||||
{ 0.67226861393788, -0.13494389011014}, {-0.70737398842068, -0.76547349325992},
|
||||
{ 0.94044946687963, 0.09026201157416}, {-0.82386352534327, 0.08924768823676},
|
||||
{-0.32070666698656, 0.50143421908753}, { 0.57593163224487, -0.98966422921509},
|
||||
{-0.36326018419965, 0.07440243123228}, { 0.99979044674350, -0.14130287347405},
|
||||
{-0.92366023326932, -0.97979298068180}, {-0.44607178518598, -0.54233252016394},
|
||||
{ 0.44226800932956, 0.71326756742752}, { 0.03671907158312, 0.63606389366675},
|
||||
{ 0.52175424682195, -0.85396826735705}, {-0.94701139690956, -0.01826348194255},
|
||||
{-0.98759606946049, 0.82288714303073}, { 0.87434794743625, 0.89399495655433},
|
||||
{-0.93412041758744, 0.41374052024363}, { 0.96063943315511, 0.93116709541280},
|
||||
{ 0.97534253457837, 0.86150930812689}, { 0.99642466504163, 0.70190043427512},
|
||||
{-0.94705089665984, -0.29580042814306}, { 0.91599807087376, -0.98147830385781},
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_AACSBRDATA_H */
|
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aactab.c
|
||||
* AAC data
|
||||
* @author Oded Shimon ( ods15 ods15 dyndns org )
|
||||
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
DECLARE_ALIGNED(16, float, ff_aac_kbd_long_1024)[1024];
|
||||
DECLARE_ALIGNED(16, float, ff_aac_kbd_short_128)[128];
|
||||
DECLARE_ALIGNED(16, float, ff_aac_kbd_long_1024[1024]);
|
||||
DECLARE_ALIGNED(16, float, ff_aac_kbd_short_128[128]);
|
||||
|
||||
const uint8_t ff_aac_num_swb_1024[] = {
|
||||
41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40, 40
|
||||
@@ -409,7 +409,7 @@ const uint16_t ff_aac_spectral_sizes[11] = {
|
||||
* 64.0f is a special value indicating the existence of an escape code in the
|
||||
* bitstream.
|
||||
*/
|
||||
static const DECLARE_ALIGNED(16, float, codebook_vector0)[324] = {
|
||||
static const float codebook_vector0[324] = {
|
||||
-1.0000000, -1.0000000, -1.0000000, -1.0000000,
|
||||
-1.0000000, -1.0000000, -1.0000000, 0.0000000,
|
||||
-1.0000000, -1.0000000, -1.0000000, 1.0000000,
|
||||
@@ -493,7 +493,7 @@ static const DECLARE_ALIGNED(16, float, codebook_vector0)[324] = {
|
||||
1.0000000, 1.0000000, 1.0000000, 1.0000000,
|
||||
};
|
||||
|
||||
static const DECLARE_ALIGNED(16, float, codebook_vector2)[324] = {
|
||||
static const float codebook_vector2[324] = {
|
||||
0.0000000, 0.0000000, 0.0000000, 0.0000000,
|
||||
0.0000000, 0.0000000, 0.0000000, 1.0000000,
|
||||
0.0000000, 0.0000000, 0.0000000, 2.5198421,
|
||||
@@ -577,7 +577,7 @@ static const DECLARE_ALIGNED(16, float, codebook_vector2)[324] = {
|
||||
2.5198421, 2.5198421, 2.5198421, 2.5198421,
|
||||
};
|
||||
|
||||
static const DECLARE_ALIGNED(16, float, codebook_vector4)[162] = {
|
||||
static const float codebook_vector4[162] = {
|
||||
-6.3496042, -6.3496042, -6.3496042, -4.3267487,
|
||||
-6.3496042, -2.5198421, -6.3496042, -1.0000000,
|
||||
-6.3496042, 0.0000000, -6.3496042, 1.0000000,
|
||||
@@ -621,7 +621,7 @@ static const DECLARE_ALIGNED(16, float, codebook_vector4)[162] = {
|
||||
6.3496042, 6.3496042,
|
||||
};
|
||||
|
||||
static const DECLARE_ALIGNED(16, float, codebook_vector6)[128] = {
|
||||
static const float codebook_vector6[128] = {
|
||||
0.0000000, 0.0000000, 0.0000000, 1.0000000,
|
||||
0.0000000, 2.5198421, 0.0000000, 4.3267487,
|
||||
0.0000000, 6.3496042, 0.0000000, 8.5498797,
|
||||
@@ -656,7 +656,7 @@ static const DECLARE_ALIGNED(16, float, codebook_vector6)[128] = {
|
||||
13.3905183, 10.9027236, 13.3905183, 13.3905183,
|
||||
};
|
||||
|
||||
static const DECLARE_ALIGNED(16, float, codebook_vector8)[338] = {
|
||||
static const float codebook_vector8[338] = {
|
||||
0.0000000, 0.0000000, 0.0000000, 1.0000000,
|
||||
0.0000000, 2.5198421, 0.0000000, 4.3267487,
|
||||
0.0000000, 6.3496042, 0.0000000, 8.5498797,
|
||||
@@ -744,7 +744,7 @@ static const DECLARE_ALIGNED(16, float, codebook_vector8)[338] = {
|
||||
27.4731418, 27.4731418,
|
||||
};
|
||||
|
||||
static const DECLARE_ALIGNED(16, float, codebook_vector10)[578] = {
|
||||
static const float codebook_vector10[578] = {
|
||||
0.0000000, 0.0000000, 0.0000000, 1.0000000,
|
||||
0.0000000, 2.5198421, 0.0000000, 4.3267487,
|
||||
0.0000000, 6.3496042, 0.0000000, 8.5498797,
|
||||
@@ -899,313 +899,6 @@ const float * const ff_aac_codebook_vectors[] = {
|
||||
codebook_vector8, codebook_vector10,
|
||||
};
|
||||
|
||||
static const float codebook_vector0_vals[] = {
|
||||
-1.0000000, 0.0000000, 1.0000000
|
||||
};
|
||||
|
||||
/*
|
||||
* bits 0:1, 2:3, 4:5, 6:7 index into _vals array
|
||||
* 8:11 number of non-zero values
|
||||
* 12:15 bit mask of non-zero values
|
||||
*/
|
||||
static const uint16_t codebook_vector02_idx[] = {
|
||||
0x0000, 0x8140, 0x8180, 0x4110, 0xc250, 0xc290, 0x4120, 0xc260, 0xc2a0,
|
||||
0x2104, 0xa244, 0xa284, 0x6214, 0xe354, 0xe394, 0x6224, 0xe364, 0xe3a4,
|
||||
0x2108, 0xa248, 0xa288, 0x6218, 0xe358, 0xe398, 0x6228, 0xe368, 0xe3a8,
|
||||
0x1101, 0x9241, 0x9281, 0x5211, 0xd351, 0xd391, 0x5221, 0xd361, 0xd3a1,
|
||||
0x3205, 0xb345, 0xb385, 0x7315, 0xf455, 0xf495, 0x7325, 0xf465, 0xf4a5,
|
||||
0x3209, 0xb349, 0xb389, 0x7319, 0xf459, 0xf499, 0x7329, 0xf469, 0xf4a9,
|
||||
0x1102, 0x9242, 0x9282, 0x5212, 0xd352, 0xd392, 0x5222, 0xd362, 0xd3a2,
|
||||
0x3206, 0xb346, 0xb386, 0x7316, 0xf456, 0xf496, 0x7326, 0xf466, 0xf4a6,
|
||||
0x320a, 0xb34a, 0xb38a, 0x731a, 0xf45a, 0xf49a, 0x732a, 0xf46a, 0xf4aa,
|
||||
};
|
||||
|
||||
static const float codebook_vector4_vals[] = {
|
||||
-6.3496042, -4.3267487,
|
||||
-2.5198421, -1.0000000,
|
||||
0.0000000, 1.0000000,
|
||||
2.5198421, 4.3267487,
|
||||
6.3496042,
|
||||
};
|
||||
|
||||
/*
|
||||
* bits 0:3, 4:7 index into _vals array
|
||||
*/
|
||||
static const uint16_t codebook_vector4_idx[] = {
|
||||
0x0000, 0x0010, 0x0020, 0x0030, 0x0040, 0x0050, 0x0060, 0x0070, 0x0080,
|
||||
0x0001, 0x0011, 0x0021, 0x0031, 0x0041, 0x0051, 0x0061, 0x0071, 0x0081,
|
||||
0x0002, 0x0012, 0x0022, 0x0032, 0x0042, 0x0052, 0x0062, 0x0072, 0x0082,
|
||||
0x0003, 0x0013, 0x0023, 0x0033, 0x0043, 0x0053, 0x0063, 0x0073, 0x0083,
|
||||
0x0004, 0x0014, 0x0024, 0x0034, 0x0044, 0x0054, 0x0064, 0x0074, 0x0084,
|
||||
0x0005, 0x0015, 0x0025, 0x0035, 0x0045, 0x0055, 0x0065, 0x0075, 0x0085,
|
||||
0x0006, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0076, 0x0086,
|
||||
0x0007, 0x0017, 0x0027, 0x0037, 0x0047, 0x0057, 0x0067, 0x0077, 0x0087,
|
||||
0x0008, 0x0018, 0x0028, 0x0038, 0x0048, 0x0058, 0x0068, 0x0078, 0x0088,
|
||||
};
|
||||
|
||||
/*
|
||||
* bits 0:3, 4:7 index into _vals array
|
||||
* 8:11 number of non-zero values
|
||||
* 12:15 1: only second value non-zero
|
||||
* 0: other cases
|
||||
*/
|
||||
static const uint16_t codebook_vector6_idx[] = {
|
||||
0x0000, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170,
|
||||
0x1101, 0x0211, 0x0221, 0x0231, 0x0241, 0x0251, 0x0261, 0x0271,
|
||||
0x1102, 0x0212, 0x0222, 0x0232, 0x0242, 0x0252, 0x0262, 0x0272,
|
||||
0x1103, 0x0213, 0x0223, 0x0233, 0x0243, 0x0253, 0x0263, 0x0273,
|
||||
0x1104, 0x0214, 0x0224, 0x0234, 0x0244, 0x0254, 0x0264, 0x0274,
|
||||
0x1105, 0x0215, 0x0225, 0x0235, 0x0245, 0x0255, 0x0265, 0x0275,
|
||||
0x1106, 0x0216, 0x0226, 0x0236, 0x0246, 0x0256, 0x0266, 0x0276,
|
||||
0x1107, 0x0217, 0x0227, 0x0237, 0x0247, 0x0257, 0x0267, 0x0277,
|
||||
};
|
||||
|
||||
/*
|
||||
* bits 0:3, 4:7 index into _vals array
|
||||
* 8:11 number of non-zero values
|
||||
* 12:15 1: only second value non-zero
|
||||
* 0: other cases
|
||||
*/
|
||||
static const uint16_t codebook_vector8_idx[] = {
|
||||
0x0000, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160,
|
||||
0x0170, 0x0180, 0x0190, 0x01a0, 0x01b0, 0x01c0,
|
||||
0x1101, 0x0211, 0x0221, 0x0231, 0x0241, 0x0251, 0x0261,
|
||||
0x0271, 0x0281, 0x0291, 0x02a1, 0x02b1, 0x02c1,
|
||||
0x1102, 0x0212, 0x0222, 0x0232, 0x0242, 0x0252, 0x0262,
|
||||
0x0272, 0x0282, 0x0292, 0x02a2, 0x02b2, 0x02c2,
|
||||
0x1103, 0x0213, 0x0223, 0x0233, 0x0243, 0x0253, 0x0263,
|
||||
0x0273, 0x0283, 0x0293, 0x02a3, 0x02b3, 0x02c3,
|
||||
0x1104, 0x0214, 0x0224, 0x0234, 0x0244, 0x0254, 0x0264,
|
||||
0x0274, 0x0284, 0x0294, 0x02a4, 0x02b4, 0x02c4,
|
||||
0x1105, 0x0215, 0x0225, 0x0235, 0x0245, 0x0255, 0x0265,
|
||||
0x0275, 0x0285, 0x0295, 0x02a5, 0x02b5, 0x02c5,
|
||||
0x1106, 0x0216, 0x0226, 0x0236, 0x0246, 0x0256, 0x0266,
|
||||
0x0276, 0x0286, 0x0296, 0x02a6, 0x02b6, 0x02c6,
|
||||
0x1107, 0x0217, 0x0227, 0x0237, 0x0247, 0x0257, 0x0267,
|
||||
0x0277, 0x0287, 0x0297, 0x02a7, 0x02b7, 0x02c7,
|
||||
0x1108, 0x0218, 0x0228, 0x0238, 0x0248, 0x0258, 0x0268,
|
||||
0x0278, 0x0288, 0x0298, 0x02a8, 0x02b8, 0x02c8,
|
||||
0x1109, 0x0219, 0x0229, 0x0239, 0x0249, 0x0259, 0x0269,
|
||||
0x0279, 0x0289, 0x0299, 0x02a9, 0x02b9, 0x02c9,
|
||||
0x110a, 0x021a, 0x022a, 0x023a, 0x024a, 0x025a, 0x026a,
|
||||
0x027a, 0x028a, 0x029a, 0x02aa, 0x02ba, 0x02ca,
|
||||
0x110b, 0x021b, 0x022b, 0x023b, 0x024b, 0x025b, 0x026b,
|
||||
0x027b, 0x028b, 0x029b, 0x02ab, 0x02bb, 0x02cb,
|
||||
0x110c, 0x021c, 0x022c, 0x023c, 0x024c, 0x025c, 0x026c,
|
||||
0x027c, 0x028c, 0x029c, 0x02ac, 0x02bc, 0x02cc,
|
||||
};
|
||||
|
||||
static const float codebook_vector10_vals[] = {
|
||||
0.0000000, 1.0000000,
|
||||
2.5198421, 4.3267487,
|
||||
6.3496042, 8.5498797,
|
||||
10.9027236, 13.3905183,
|
||||
16.0000000, 18.7207544,
|
||||
21.5443469, 24.4637810,
|
||||
27.4731418, 30.5673509,
|
||||
33.7419917, 36.9931811,
|
||||
};
|
||||
|
||||
/*
|
||||
* bits 0:3, 4:7 index into _vals array
|
||||
* 8:9 bit mask of escape-coded entries
|
||||
* 12:15 number of non-zero values
|
||||
*/
|
||||
static const uint16_t codebook_vector10_idx[] = {
|
||||
0x0000, 0x1010, 0x1020, 0x1030, 0x1040, 0x1050, 0x1060, 0x1070,
|
||||
0x1080, 0x1090, 0x10a0, 0x10b0, 0x10c0, 0x10d0, 0x10e0, 0x10f0, 0x1200,
|
||||
0x1001, 0x2011, 0x2021, 0x2031, 0x2041, 0x2051, 0x2061, 0x2071,
|
||||
0x2081, 0x2091, 0x20a1, 0x20b1, 0x20c1, 0x20d1, 0x20e1, 0x20f1, 0x2201,
|
||||
0x1002, 0x2012, 0x2022, 0x2032, 0x2042, 0x2052, 0x2062, 0x2072,
|
||||
0x2082, 0x2092, 0x20a2, 0x20b2, 0x20c2, 0x20d2, 0x20e2, 0x20f2, 0x2202,
|
||||
0x1003, 0x2013, 0x2023, 0x2033, 0x2043, 0x2053, 0x2063, 0x2073,
|
||||
0x2083, 0x2093, 0x20a3, 0x20b3, 0x20c3, 0x20d3, 0x20e3, 0x20f3, 0x2203,
|
||||
0x1004, 0x2014, 0x2024, 0x2034, 0x2044, 0x2054, 0x2064, 0x2074,
|
||||
0x2084, 0x2094, 0x20a4, 0x20b4, 0x20c4, 0x20d4, 0x20e4, 0x20f4, 0x2204,
|
||||
0x1005, 0x2015, 0x2025, 0x2035, 0x2045, 0x2055, 0x2065, 0x2075,
|
||||
0x2085, 0x2095, 0x20a5, 0x20b5, 0x20c5, 0x20d5, 0x20e5, 0x20f5, 0x2205,
|
||||
0x1006, 0x2016, 0x2026, 0x2036, 0x2046, 0x2056, 0x2066, 0x2076,
|
||||
0x2086, 0x2096, 0x20a6, 0x20b6, 0x20c6, 0x20d6, 0x20e6, 0x20f6, 0x2206,
|
||||
0x1007, 0x2017, 0x2027, 0x2037, 0x2047, 0x2057, 0x2067, 0x2077,
|
||||
0x2087, 0x2097, 0x20a7, 0x20b7, 0x20c7, 0x20d7, 0x20e7, 0x20f7, 0x2207,
|
||||
0x1008, 0x2018, 0x2028, 0x2038, 0x2048, 0x2058, 0x2068, 0x2078,
|
||||
0x2088, 0x2098, 0x20a8, 0x20b8, 0x20c8, 0x20d8, 0x20e8, 0x20f8, 0x2208,
|
||||
0x1009, 0x2019, 0x2029, 0x2039, 0x2049, 0x2059, 0x2069, 0x2079,
|
||||
0x2089, 0x2099, 0x20a9, 0x20b9, 0x20c9, 0x20d9, 0x20e9, 0x20f9, 0x2209,
|
||||
0x100a, 0x201a, 0x202a, 0x203a, 0x204a, 0x205a, 0x206a, 0x207a,
|
||||
0x208a, 0x209a, 0x20aa, 0x20ba, 0x20ca, 0x20da, 0x20ea, 0x20fa, 0x220a,
|
||||
0x100b, 0x201b, 0x202b, 0x203b, 0x204b, 0x205b, 0x206b, 0x207b,
|
||||
0x208b, 0x209b, 0x20ab, 0x20bb, 0x20cb, 0x20db, 0x20eb, 0x20fb, 0x220b,
|
||||
0x100c, 0x201c, 0x202c, 0x203c, 0x204c, 0x205c, 0x206c, 0x207c,
|
||||
0x208c, 0x209c, 0x20ac, 0x20bc, 0x20cc, 0x20dc, 0x20ec, 0x20fc, 0x220c,
|
||||
0x100d, 0x201d, 0x202d, 0x203d, 0x204d, 0x205d, 0x206d, 0x207d,
|
||||
0x208d, 0x209d, 0x20ad, 0x20bd, 0x20cd, 0x20dd, 0x20ed, 0x20fd, 0x220d,
|
||||
0x100e, 0x201e, 0x202e, 0x203e, 0x204e, 0x205e, 0x206e, 0x207e,
|
||||
0x208e, 0x209e, 0x20ae, 0x20be, 0x20ce, 0x20de, 0x20ee, 0x20fe, 0x220e,
|
||||
0x100f, 0x201f, 0x202f, 0x203f, 0x204f, 0x205f, 0x206f, 0x207f,
|
||||
0x208f, 0x209f, 0x20af, 0x20bf, 0x20cf, 0x20df, 0x20ef, 0x20ff, 0x220f,
|
||||
0x1100, 0x2110, 0x2120, 0x2130, 0x2140, 0x2150, 0x2160, 0x2170,
|
||||
0x2180, 0x2190, 0x21a0, 0x21b0, 0x21c0, 0x21d0, 0x21e0, 0x21f0, 0x2300,
|
||||
};
|
||||
|
||||
const float *const ff_aac_codebook_vector_vals[] = {
|
||||
codebook_vector0_vals, codebook_vector0_vals,
|
||||
codebook_vector10_vals, codebook_vector10_vals,
|
||||
codebook_vector4_vals, codebook_vector4_vals,
|
||||
codebook_vector10_vals, codebook_vector10_vals,
|
||||
codebook_vector10_vals, codebook_vector10_vals,
|
||||
codebook_vector10_vals,
|
||||
};
|
||||
|
||||
const uint16_t *const ff_aac_codebook_vector_idx[] = {
|
||||
codebook_vector02_idx, codebook_vector02_idx,
|
||||
codebook_vector02_idx, codebook_vector02_idx,
|
||||
codebook_vector4_idx, codebook_vector4_idx,
|
||||
codebook_vector6_idx, codebook_vector6_idx,
|
||||
codebook_vector8_idx, codebook_vector8_idx,
|
||||
codebook_vector10_idx,
|
||||
};
|
||||
|
||||
/* @name swb_offsets
|
||||
* Sample offset into the window indicating the beginning of a scalefactor
|
||||
* window band
|
||||
*
|
||||
* scalefactor window band - term for scalefactor bands within a window,
|
||||
* given in Table 4.110 to Table 4.128.
|
||||
*
|
||||
* scalefactor band - a set of spectral coefficients which are scaled by one
|
||||
* scalefactor. In case of EIGHT_SHORT_SEQUENCE and grouping a scalefactor band
|
||||
* may contain several scalefactor window bands of corresponding frequency. For
|
||||
* all other window_sequences scalefactor bands and scalefactor window bands are
|
||||
* identical.
|
||||
* @{
|
||||
*/
|
||||
|
||||
static const uint16_t swb_offset_1024_96[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 44, 48, 52, 56, 64,
|
||||
72, 80, 88, 96, 108, 120, 132, 144,
|
||||
156, 172, 188, 212, 240, 276, 320, 384,
|
||||
448, 512, 576, 640, 704, 768, 832, 896,
|
||||
960, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_96[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_64[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 44, 48, 52, 56, 64,
|
||||
72, 80, 88, 100, 112, 124, 140, 156,
|
||||
172, 192, 216, 240, 268, 304, 344, 384,
|
||||
424, 464, 504, 544, 584, 624, 664, 704,
|
||||
744, 784, 824, 864, 904, 944, 984, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_48[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 48, 56, 64, 72, 80,
|
||||
88, 96, 108, 120, 132, 144, 160, 176,
|
||||
196, 216, 240, 264, 292, 320, 352, 384,
|
||||
416, 448, 480, 512, 544, 576, 608, 640,
|
||||
672, 704, 736, 768, 800, 832, 864, 896,
|
||||
928, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_48[] = {
|
||||
0, 4, 8, 12, 16, 20, 28, 36,
|
||||
44, 56, 68, 80, 96, 112, 128
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_32[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 48, 56, 64, 72, 80,
|
||||
88, 96, 108, 120, 132, 144, 160, 176,
|
||||
196, 216, 240, 264, 292, 320, 352, 384,
|
||||
416, 448, 480, 512, 544, 576, 608, 640,
|
||||
672, 704, 736, 768, 800, 832, 864, 896,
|
||||
928, 960, 992, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_24[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 36, 40, 44, 52, 60, 68, 76,
|
||||
84, 92, 100, 108, 116, 124, 136, 148,
|
||||
160, 172, 188, 204, 220, 240, 260, 284,
|
||||
308, 336, 364, 396, 432, 468, 508, 552,
|
||||
600, 652, 704, 768, 832, 896, 960, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_24[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
36, 44, 52, 64, 76, 92, 108, 128
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_16[] = {
|
||||
0, 8, 16, 24, 32, 40, 48, 56,
|
||||
64, 72, 80, 88, 100, 112, 124, 136,
|
||||
148, 160, 172, 184, 196, 212, 228, 244,
|
||||
260, 280, 300, 320, 344, 368, 396, 424,
|
||||
456, 492, 532, 572, 616, 664, 716, 772,
|
||||
832, 896, 960, 1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_16[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
32, 40, 48, 60, 72, 88, 108, 128
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_1024_8[] = {
|
||||
0, 12, 24, 36, 48, 60, 72, 84,
|
||||
96, 108, 120, 132, 144, 156, 172, 188,
|
||||
204, 220, 236, 252, 268, 288, 308, 328,
|
||||
348, 372, 396, 420, 448, 476, 508, 544,
|
||||
580, 620, 664, 712, 764, 820, 880, 944,
|
||||
1024
|
||||
};
|
||||
|
||||
static const uint16_t swb_offset_128_8[] = {
|
||||
0, 4, 8, 12, 16, 20, 24, 28,
|
||||
36, 44, 52, 60, 72, 88, 108, 128
|
||||
};
|
||||
|
||||
const uint16_t * const ff_swb_offset_1024[] = {
|
||||
swb_offset_1024_96, swb_offset_1024_96, swb_offset_1024_64,
|
||||
swb_offset_1024_48, swb_offset_1024_48, swb_offset_1024_32,
|
||||
swb_offset_1024_24, swb_offset_1024_24, swb_offset_1024_16,
|
||||
swb_offset_1024_16, swb_offset_1024_16, swb_offset_1024_8,
|
||||
swb_offset_1024_8
|
||||
};
|
||||
|
||||
const uint16_t * const ff_swb_offset_128[] = {
|
||||
/* The last entry on the following row is swb_offset_128_64 but is a
|
||||
duplicate of swb_offset_128_96. */
|
||||
swb_offset_128_96, swb_offset_128_96, swb_offset_128_96,
|
||||
swb_offset_128_48, swb_offset_128_48, swb_offset_128_48,
|
||||
swb_offset_128_24, swb_offset_128_24, swb_offset_128_16,
|
||||
swb_offset_128_16, swb_offset_128_16, swb_offset_128_8,
|
||||
swb_offset_128_8
|
||||
};
|
||||
|
||||
// @}
|
||||
|
||||
/* @name ff_tns_max_bands
|
||||
* The maximum number of scalefactor bands on which TNS can operate for the long
|
||||
* and short transforms respectively. The index to these tables is related to
|
||||
* the sample rate of the audio.
|
||||
* @{
|
||||
*/
|
||||
const uint8_t ff_tns_max_bands_1024[] = {
|
||||
31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, 39
|
||||
};
|
||||
|
||||
const uint8_t ff_tns_max_bands_128[] = {
|
||||
9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14
|
||||
};
|
||||
// @}
|
||||
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
|
||||
/**
|
||||
|
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aactab.h
|
||||
* AAC data declarations
|
||||
* @author Oded Shimon ( ods15 ods15 dyndns org )
|
||||
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
|
||||
@@ -43,8 +43,8 @@
|
||||
/* @name window coefficients
|
||||
* @{
|
||||
*/
|
||||
DECLARE_ALIGNED(16, extern float, ff_aac_kbd_long_1024)[1024];
|
||||
DECLARE_ALIGNED(16, extern float, ff_aac_kbd_short_128)[128];
|
||||
DECLARE_ALIGNED(16, extern float, ff_aac_kbd_long_1024[1024]);
|
||||
DECLARE_ALIGNED(16, extern float, ff_aac_kbd_short_128[128]);
|
||||
// @}
|
||||
|
||||
/* @name number of scalefactor window bands for long and short transform windows respectively
|
||||
@@ -64,14 +64,6 @@ extern const uint8_t * const ff_aac_spectral_bits [11];
|
||||
extern const uint16_t ff_aac_spectral_sizes[11];
|
||||
|
||||
extern const float *ff_aac_codebook_vectors[];
|
||||
extern const float *ff_aac_codebook_vector_vals[];
|
||||
extern const uint16_t *ff_aac_codebook_vector_idx[];
|
||||
|
||||
extern const uint16_t * const ff_swb_offset_1024[13];
|
||||
extern const uint16_t * const ff_swb_offset_128 [13];
|
||||
|
||||
extern const uint8_t ff_tns_max_bands_1024[13];
|
||||
extern const uint8_t ff_tns_max_bands_128 [13];
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
extern const float ff_aac_pow2sf_tab[428];
|
||||
|
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aandcttab.c
|
||||
* AAN (Arai Agui Aakajima) (I)DCT tables
|
||||
*/
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aandcttab.h
|
||||
* AAN (Arai Agui Nakajima) (I)DCT tables
|
||||
*/
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aasc.c
|
||||
* Autodesk RLE Video Decoder by Konstantin Shishkov
|
||||
*/
|
||||
|
||||
@@ -52,16 +52,15 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx)
|
||||
s->avctx = avctx;
|
||||
|
||||
avctx->pix_fmt = PIX_FMT_BGR24;
|
||||
s->frame.data[0] = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aasc_decode_frame(AVCodecContext *avctx,
|
||||
void *data, int *data_size,
|
||||
AVPacket *avpkt)
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
AascContext *s = avctx->priv_data;
|
||||
int compr, i, stride;
|
||||
|
||||
@@ -111,7 +110,7 @@ static av_cold int aasc_decode_end(AVCodecContext *avctx)
|
||||
|
||||
AVCodec aasc_decoder = {
|
||||
"aasc",
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
CODEC_TYPE_VIDEO,
|
||||
CODEC_ID_AASC,
|
||||
sizeof(AascContext),
|
||||
aasc_decode_init,
|
||||
|
187
libavcodec/ac3.c
187
libavcodec/ac3.c
@@ -20,59 +20,16 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/ac3.c
|
||||
* Common code between the AC-3 encoder and decoder.
|
||||
*/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "ac3.h"
|
||||
#include "get_bits.h"
|
||||
#include "bitstream.h"
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
|
||||
/**
|
||||
* Starting frequency coefficient bin for each critical band.
|
||||
*/
|
||||
static const uint8_t band_start_tab[51] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 31,
|
||||
34, 37, 40, 43, 46, 49, 55, 61, 67, 73,
|
||||
79, 85, 97, 109, 121, 133, 157, 181, 205, 229, 253
|
||||
};
|
||||
|
||||
/**
|
||||
* Maps each frequency coefficient bin to the critical band that contains it.
|
||||
*/
|
||||
static const uint8_t bin_to_band_tab[253] = {
|
||||
0,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
||||
25, 26, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30,
|
||||
31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34,
|
||||
35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36,
|
||||
37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38,
|
||||
39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40,
|
||||
41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
|
||||
42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
|
||||
43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
|
||||
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
||||
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
|
||||
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
|
||||
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
|
||||
49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
|
||||
49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49
|
||||
};
|
||||
|
||||
#else /* CONFIG_HARDCODED_TABLES */
|
||||
static uint8_t band_start_tab[51];
|
||||
static uint8_t bin_to_band_tab[253];
|
||||
#endif
|
||||
|
||||
static inline int calc_lowcomp1(int a, int b0, int b1, int c)
|
||||
{
|
||||
@@ -98,27 +55,29 @@ static inline int calc_lowcomp(int a, int b0, int b1, int bin)
|
||||
void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd,
|
||||
int16_t *band_psd)
|
||||
{
|
||||
int bin, band;
|
||||
int bin, i, j, k, end1, v;
|
||||
|
||||
/* exponent mapping to PSD */
|
||||
for (bin = start; bin < end; bin++) {
|
||||
for(bin=start;bin<end;bin++) {
|
||||
psd[bin]=(3072 - (exp[bin] << 7));
|
||||
}
|
||||
|
||||
/* PSD integration */
|
||||
bin = start;
|
||||
band = bin_to_band_tab[start];
|
||||
j=start;
|
||||
k=bin_to_band_tab[start];
|
||||
do {
|
||||
int v = psd[bin++];
|
||||
int band_end = FFMIN(band_start_tab[band+1], end);
|
||||
for (; bin < band_end; bin++) {
|
||||
int max = FFMAX(v, psd[bin]);
|
||||
v=psd[j];
|
||||
j++;
|
||||
end1 = FFMIN(band_start_tab[k+1], end);
|
||||
for(i=j;i<end1;i++) {
|
||||
/* logadd */
|
||||
int adr = FFMIN(max - ((v + psd[bin] + 1) >> 1), 255);
|
||||
v = max + ff_ac3_log_add_tab[adr];
|
||||
int adr = FFMIN(FFABS(v - psd[j]) >> 1, 255);
|
||||
v = FFMAX(v, psd[j]) + ff_ac3_log_add_tab[adr];
|
||||
j++;
|
||||
}
|
||||
band_psd[band++] = v;
|
||||
} while (end > band_start_tab[band]);
|
||||
band_psd[k]=v;
|
||||
k++;
|
||||
} while (end > band_start_tab[k]);
|
||||
}
|
||||
|
||||
int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
|
||||
@@ -128,71 +87,75 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
|
||||
int16_t *mask)
|
||||
{
|
||||
int16_t excite[50]; /* excitation */
|
||||
int band;
|
||||
int band_start, band_end, begin, end1;
|
||||
int bin, k;
|
||||
int bndstrt, bndend, begin, end1, tmp;
|
||||
int lowcomp, fastleak, slowleak;
|
||||
|
||||
/* excitation function */
|
||||
band_start = bin_to_band_tab[start];
|
||||
band_end = bin_to_band_tab[end-1] + 1;
|
||||
bndstrt = bin_to_band_tab[start];
|
||||
bndend = bin_to_band_tab[end-1] + 1;
|
||||
|
||||
if (band_start == 0) {
|
||||
if (bndstrt == 0) {
|
||||
lowcomp = 0;
|
||||
lowcomp = calc_lowcomp1(lowcomp, band_psd[0], band_psd[1], 384);
|
||||
excite[0] = band_psd[0] - fast_gain - lowcomp;
|
||||
lowcomp = calc_lowcomp1(lowcomp, band_psd[1], band_psd[2], 384);
|
||||
excite[1] = band_psd[1] - fast_gain - lowcomp;
|
||||
begin = 7;
|
||||
for (band = 2; band < 7; band++) {
|
||||
if (!(is_lfe && band == 6))
|
||||
lowcomp = calc_lowcomp1(lowcomp, band_psd[band], band_psd[band+1], 384);
|
||||
fastleak = band_psd[band] - fast_gain;
|
||||
slowleak = band_psd[band] - s->slow_gain;
|
||||
excite[band] = fastleak - lowcomp;
|
||||
if (!(is_lfe && band == 6)) {
|
||||
if (band_psd[band] <= band_psd[band+1]) {
|
||||
begin = band + 1;
|
||||
for (bin = 2; bin < 7; bin++) {
|
||||
if (!(is_lfe && bin == 6))
|
||||
lowcomp = calc_lowcomp1(lowcomp, band_psd[bin], band_psd[bin+1], 384);
|
||||
fastleak = band_psd[bin] - fast_gain;
|
||||
slowleak = band_psd[bin] - s->slow_gain;
|
||||
excite[bin] = fastleak - lowcomp;
|
||||
if (!(is_lfe && bin == 6)) {
|
||||
if (band_psd[bin] <= band_psd[bin+1]) {
|
||||
begin = bin + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end1 = FFMIN(band_end, 22);
|
||||
for (band = begin; band < end1; band++) {
|
||||
if (!(is_lfe && band == 6))
|
||||
lowcomp = calc_lowcomp(lowcomp, band_psd[band], band_psd[band+1], band);
|
||||
fastleak = FFMAX(fastleak - s->fast_decay, band_psd[band] - fast_gain);
|
||||
slowleak = FFMAX(slowleak - s->slow_decay, band_psd[band] - s->slow_gain);
|
||||
excite[band] = FFMAX(fastleak - lowcomp, slowleak);
|
||||
end1=bndend;
|
||||
if (end1 > 22) end1=22;
|
||||
|
||||
for (bin = begin; bin < end1; bin++) {
|
||||
if (!(is_lfe && bin == 6))
|
||||
lowcomp = calc_lowcomp(lowcomp, band_psd[bin], band_psd[bin+1], bin);
|
||||
|
||||
fastleak = FFMAX(fastleak - s->fast_decay, band_psd[bin] - fast_gain);
|
||||
slowleak = FFMAX(slowleak - s->slow_decay, band_psd[bin] - s->slow_gain);
|
||||
excite[bin] = FFMAX(fastleak - lowcomp, slowleak);
|
||||
}
|
||||
begin = 22;
|
||||
} else {
|
||||
/* coupling channel */
|
||||
begin = band_start;
|
||||
begin = bndstrt;
|
||||
|
||||
fastleak = (s->cpl_fast_leak << 8) + 768;
|
||||
slowleak = (s->cpl_slow_leak << 8) + 768;
|
||||
}
|
||||
|
||||
for (band = begin; band < band_end; band++) {
|
||||
fastleak = FFMAX(fastleak - s->fast_decay, band_psd[band] - fast_gain);
|
||||
slowleak = FFMAX(slowleak - s->slow_decay, band_psd[band] - s->slow_gain);
|
||||
excite[band] = FFMAX(fastleak, slowleak);
|
||||
for (bin = begin; bin < bndend; bin++) {
|
||||
fastleak = FFMAX(fastleak - s->fast_decay, band_psd[bin] - fast_gain);
|
||||
slowleak = FFMAX(slowleak - s->slow_decay, band_psd[bin] - s->slow_gain);
|
||||
excite[bin] = FFMAX(fastleak, slowleak);
|
||||
}
|
||||
|
||||
/* compute masking curve */
|
||||
|
||||
for (band = band_start; band < band_end; band++) {
|
||||
int tmp = s->db_per_bit - band_psd[band];
|
||||
for (bin = bndstrt; bin < bndend; bin++) {
|
||||
tmp = s->db_per_bit - band_psd[bin];
|
||||
if (tmp > 0) {
|
||||
excite[band] += tmp >> 2;
|
||||
excite[bin] += tmp >> 2;
|
||||
}
|
||||
mask[band] = FFMAX(ff_ac3_hearing_threshold_tab[band >> s->sr_shift][s->sr_code], excite[band]);
|
||||
mask[bin] = FFMAX(ff_ac3_hearing_threshold_tab[bin >> s->sr_shift][s->sr_code], excite[bin]);
|
||||
}
|
||||
|
||||
/* delta bit allocation */
|
||||
|
||||
if (dba_mode == DBA_REUSE || dba_mode == DBA_NEW) {
|
||||
int i, seg, delta;
|
||||
int band, seg, delta;
|
||||
if (dba_nsegs >= 8)
|
||||
return -1;
|
||||
band = 0;
|
||||
@@ -205,8 +168,9 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
|
||||
} else {
|
||||
delta = (dba_values[seg] - 4) << 7;
|
||||
}
|
||||
for (i = 0; i < dba_lengths[seg]; i++) {
|
||||
mask[band++] += delta;
|
||||
for (k = 0; k < dba_lengths[seg]; k++) {
|
||||
mask[band] += delta;
|
||||
band++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,24 +181,25 @@ void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
|
||||
int snr_offset, int floor,
|
||||
const uint8_t *bap_tab, uint8_t *bap)
|
||||
{
|
||||
int bin, band;
|
||||
int i, j, k, end1, v, address;
|
||||
|
||||
/* special case, if snr offset is -960, set all bap's to zero */
|
||||
if (snr_offset == -960) {
|
||||
if(snr_offset == -960) {
|
||||
memset(bap, 0, 256);
|
||||
return;
|
||||
}
|
||||
|
||||
bin = start;
|
||||
band = bin_to_band_tab[start];
|
||||
i = start;
|
||||
j = bin_to_band_tab[start];
|
||||
do {
|
||||
int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
|
||||
int band_end = FFMIN(band_start_tab[band+1], end);
|
||||
for (; bin < band_end; bin++) {
|
||||
int address = av_clip((psd[bin] - m) >> 5, 0, 63);
|
||||
bap[bin] = bap_tab[address];
|
||||
v = (FFMAX(mask[j] - snr_offset - floor, 0) & 0x1FE0) + floor;
|
||||
end1 = FFMIN(band_start_tab[j] + ff_ac3_critical_band_size_tab[j], end);
|
||||
for (k = i; k < end1; k++) {
|
||||
address = av_clip((psd[i] - v) >> 5, 0, 63);
|
||||
bap[i] = bap_tab[address];
|
||||
i++;
|
||||
}
|
||||
} while (end > band_start_tab[band++]);
|
||||
} while (end > band_start_tab[j++]);
|
||||
}
|
||||
|
||||
/* AC-3 bit allocation. The algorithm is the one described in the AC-3
|
||||
@@ -253,8 +218,8 @@ void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
|
||||
ff_ac3_bit_alloc_calc_psd(exp, start, end, psd, band_psd);
|
||||
|
||||
ff_ac3_bit_alloc_calc_mask(s, band_psd, start, end, fast_gain, is_lfe,
|
||||
dba_mode, dba_nsegs, dba_offsets, dba_lengths,
|
||||
dba_values, mask);
|
||||
dba_mode, dba_nsegs, dba_offsets, dba_lengths, dba_values,
|
||||
mask);
|
||||
|
||||
ff_ac3_bit_alloc_calc_bap(mask, psd, start, end, snr_offset, s->floor,
|
||||
ff_ac3_bap_tab, bap);
|
||||
@@ -267,15 +232,15 @@ void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
|
||||
*/
|
||||
av_cold void ac3_common_init(void)
|
||||
{
|
||||
#if !CONFIG_HARDCODED_TABLES
|
||||
int i, j, k, l, v;
|
||||
/* compute bndtab and masktab from bandsz */
|
||||
int bin = 0, band;
|
||||
for (band = 0; band < 50; band++) {
|
||||
int band_end = bin + ff_ac3_critical_band_size_tab[band];
|
||||
band_start_tab[band] = bin;
|
||||
while (bin < band_end)
|
||||
bin_to_band_tab[bin++] = band;
|
||||
k = 0;
|
||||
l = 0;
|
||||
for(i=0;i<50;i++) {
|
||||
band_start_tab[i] = l;
|
||||
v = ff_ac3_critical_band_size_tab[i];
|
||||
for(j=0;j<v;j++) bin_to_band_tab[k++]=i;
|
||||
l += v;
|
||||
}
|
||||
band_start_tab[50] = bin;
|
||||
#endif /* !CONFIG_HARDCODED_TABLES */
|
||||
band_start_tab[50] = l;
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/ac3.h
|
||||
* Common code between the AC-3 encoder and decoder.
|
||||
*/
|
||||
|
||||
@@ -100,7 +100,6 @@ typedef struct {
|
||||
uint32_t bit_rate;
|
||||
uint8_t channels;
|
||||
uint16_t frame_size;
|
||||
int64_t channel_layout;
|
||||
/** @} */
|
||||
} AC3HeaderInfo;
|
||||
|
||||
@@ -132,7 +131,7 @@ void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd,
|
||||
|
||||
/**
|
||||
* Calculates the masking curve.
|
||||
* First, the excitation is calculated using parameters in s and the signal
|
||||
* First, the excitation is calculated using parameters in \p s and the signal
|
||||
* power in each critical band. The excitation is compared with a predefined
|
||||
* hearing threshold table to produce the masking curve. If delta bit
|
||||
* allocation information is provided, it is used for adjusting the masking
|
||||
@@ -161,7 +160,7 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
|
||||
/**
|
||||
* Calculates bit allocation pointers.
|
||||
* The SNR is the difference between the masking curve and the signal. AC-3
|
||||
* uses this value for each frequency bin to allocate bits. The snroffset
|
||||
* uses this value for each frequency bin to allocate bits. The \p snroffset
|
||||
* parameter is a global adjustment to the SNR for all bins.
|
||||
*
|
||||
* @param[in] mask masking curve
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "parser.h"
|
||||
#include "ac3_parser.h"
|
||||
#include "aac_ac3_parser.h"
|
||||
#include "get_bits.h"
|
||||
#include "bitstream.h"
|
||||
|
||||
|
||||
#define AC3_HEADER_SIZE 7
|
||||
@@ -121,9 +121,6 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
|
||||
(hdr->num_blocks * 256.0));
|
||||
hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
|
||||
}
|
||||
hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode];
|
||||
if (hdr->lfe_on)
|
||||
hdr->channel_layout |= CH_LOW_FREQUENCY;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -177,7 +174,6 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
||||
hdr_info->sample_rate = hdr.sample_rate;
|
||||
hdr_info->bit_rate = hdr.bit_rate;
|
||||
hdr_info->channels = hdr.channels;
|
||||
hdr_info->channel_layout = hdr.channel_layout;
|
||||
hdr_info->samples = hdr.num_blocks * 256;
|
||||
if(hdr.bitstream_id>10)
|
||||
hdr_info->codec_id = CODEC_ID_EAC3;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#define AVCODEC_AC3_PARSER_H
|
||||
|
||||
#include "ac3.h"
|
||||
#include "get_bits.h"
|
||||
#include "bitstream.h"
|
||||
|
||||
/**
|
||||
* Parses AC-3 frame header.
|
||||
|
@@ -189,8 +189,8 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
|
||||
|
||||
ac3_common_init();
|
||||
ac3_tables_init();
|
||||
ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
|
||||
ff_mdct_init(&s->imdct_512, 9, 1, 1.0);
|
||||
ff_mdct_init(&s->imdct_256, 8, 1);
|
||||
ff_mdct_init(&s->imdct_512, 9, 1);
|
||||
ff_kbd_window_init(s->window, 5.0, 256);
|
||||
dsputil_init(&s->dsp, avctx);
|
||||
av_lfg_init(&s->dith_state, 0);
|
||||
@@ -216,7 +216,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
|
||||
if (avctx->error_recognition >= FF_ER_CAREFUL) {
|
||||
s->input_buffer = av_mallocz(AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!s->input_buffer)
|
||||
return AVERROR(ENOMEM);
|
||||
return AVERROR_NOMEM;
|
||||
}
|
||||
|
||||
avctx->sample_fmt = SAMPLE_FMT_S16;
|
||||
@@ -280,7 +280,6 @@ static int parse_frame_header(AC3DecodeContext *s)
|
||||
/* get decoding parameters from header info */
|
||||
s->bit_alloc_params.sr_code = hdr.sr_code;
|
||||
s->channel_mode = hdr.channel_mode;
|
||||
s->channel_layout = hdr.channel_layout;
|
||||
s->lfe_on = hdr.lfe_on;
|
||||
s->bit_alloc_params.sr_shift = hdr.sr_shift;
|
||||
s->sample_rate = hdr.sample_rate;
|
||||
@@ -314,12 +313,9 @@ static int parse_frame_header(AC3DecodeContext *s)
|
||||
s->skip_syntax = 1;
|
||||
memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));
|
||||
return ac3_parse_header(s);
|
||||
} else if (CONFIG_EAC3_DECODER) {
|
||||
} else {
|
||||
s->eac3 = 1;
|
||||
return ff_eac3_parse_header(s);
|
||||
} else {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,25 +408,24 @@ static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,
|
||||
*/
|
||||
static void calc_transform_coeffs_cpl(AC3DecodeContext *s)
|
||||
{
|
||||
int bin, band, ch;
|
||||
int i, j, ch, bnd, subbnd;
|
||||
|
||||
bin = s->start_freq[CPL_CH];
|
||||
for (band = 0; band < s->num_cpl_bands; band++) {
|
||||
int band_start = bin;
|
||||
int band_end = bin + s->cpl_band_sizes[band];
|
||||
for (ch = 1; ch <= s->fbw_channels; ch++) {
|
||||
if (s->channel_in_cpl[ch]) {
|
||||
int cpl_coord = s->cpl_coords[ch][band] << 5;
|
||||
for (bin = band_start; bin < band_end; bin++) {
|
||||
s->fixed_coeffs[ch][bin] = MULH(s->fixed_coeffs[CPL_CH][bin] << 4, cpl_coord);
|
||||
}
|
||||
if (ch == 2 && s->phase_flags[band]) {
|
||||
for (bin = band_start; bin < band_end; bin++)
|
||||
s->fixed_coeffs[2][bin] = -s->fixed_coeffs[2][bin];
|
||||
subbnd = -1;
|
||||
i = s->start_freq[CPL_CH];
|
||||
for(bnd=0; bnd<s->num_cpl_bands; bnd++) {
|
||||
do {
|
||||
subbnd++;
|
||||
for(j=0; j<12; j++) {
|
||||
for(ch=1; ch<=s->fbw_channels; ch++) {
|
||||
if(s->channel_in_cpl[ch]) {
|
||||
s->fixed_coeffs[ch][i] = ((int64_t)s->fixed_coeffs[CPL_CH][i] * (int64_t)s->cpl_coords[ch][bnd]) >> 23;
|
||||
if (ch == 2 && s->phase_flags[bnd])
|
||||
s->fixed_coeffs[ch][i] = -s->fixed_coeffs[ch][i];
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
bin = band_end;
|
||||
} while(s->cpl_band_struct[subbnd]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,7 +452,6 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
|
||||
uint8_t *baps = s->bap[ch_index];
|
||||
int8_t *exps = s->dexps[ch_index];
|
||||
int *coeffs = s->fixed_coeffs[ch_index];
|
||||
int dither = (ch_index == CPL_CH) || s->dither_flag[ch_index];
|
||||
GetBitContext *gbc = &s->gbc;
|
||||
int freq;
|
||||
|
||||
@@ -466,10 +460,7 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
|
||||
int mantissa;
|
||||
switch(bap){
|
||||
case 0:
|
||||
if (dither)
|
||||
mantissa = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
|
||||
else
|
||||
mantissa = 0;
|
||||
mantissa = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
|
||||
break;
|
||||
case 1:
|
||||
if(m->b1){
|
||||
@@ -526,18 +517,33 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove random dithering from coupling range coefficients with zero-bit
|
||||
* mantissas for coupled channels which do not use dithering.
|
||||
* Remove random dithering from coefficients with zero-bit mantissas
|
||||
* reference: Section 7.3.4 Dither for Zero Bit Mantissas (bap=0)
|
||||
*/
|
||||
static void remove_dithering(AC3DecodeContext *s) {
|
||||
int ch, i;
|
||||
int end=0;
|
||||
int *coeffs;
|
||||
uint8_t *bap;
|
||||
|
||||
for(ch=1; ch<=s->fbw_channels; ch++) {
|
||||
if(!s->dither_flag[ch] && s->channel_in_cpl[ch]) {
|
||||
for(i = s->start_freq[CPL_CH]; i<s->end_freq[CPL_CH]; i++) {
|
||||
if(!s->bap[CPL_CH][i])
|
||||
s->fixed_coeffs[ch][i] = 0;
|
||||
if(!s->dither_flag[ch]) {
|
||||
coeffs = s->fixed_coeffs[ch];
|
||||
bap = s->bap[ch];
|
||||
if(s->channel_in_cpl[ch])
|
||||
end = s->start_freq[CPL_CH];
|
||||
else
|
||||
end = s->end_freq[ch];
|
||||
for(i=0; i<end; i++) {
|
||||
if(!bap[i])
|
||||
coeffs[i] = 0;
|
||||
}
|
||||
if(s->channel_in_cpl[ch]) {
|
||||
bap = s->bap[CPL_CH];
|
||||
for(; i<s->end_freq[CPL_CH]; i++) {
|
||||
if(!bap[i])
|
||||
coeffs[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -552,7 +558,7 @@ static void decode_transform_coeffs_ch(AC3DecodeContext *s, int blk, int ch,
|
||||
/* if AHT is used, mantissas for all blocks are encoded in the first
|
||||
block of the frame. */
|
||||
int bin;
|
||||
if (!blk && CONFIG_EAC3_DECODER)
|
||||
if (!blk)
|
||||
ff_eac3_decode_transform_coeffs_aht_ch(s, ch);
|
||||
for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
|
||||
s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin];
|
||||
@@ -603,6 +609,7 @@ static void do_rematrixing(AC3DecodeContext *s)
|
||||
{
|
||||
int bnd, i;
|
||||
int end, bndend;
|
||||
int tmp0, tmp1;
|
||||
|
||||
end = FFMIN(s->end_freq[1], s->end_freq[2]);
|
||||
|
||||
@@ -610,9 +617,10 @@ static void do_rematrixing(AC3DecodeContext *s)
|
||||
if(s->rematrixing_flags[bnd]) {
|
||||
bndend = FFMIN(end, ff_ac3_rematrix_band_tab[bnd+1]);
|
||||
for(i=ff_ac3_rematrix_band_tab[bnd]; i<bndend; i++) {
|
||||
int tmp0 = s->fixed_coeffs[1][i];
|
||||
s->fixed_coeffs[1][i] += s->fixed_coeffs[2][i];
|
||||
s->fixed_coeffs[2][i] = tmp0 - s->fixed_coeffs[2][i];
|
||||
tmp0 = s->fixed_coeffs[1][i];
|
||||
tmp1 = s->fixed_coeffs[2][i];
|
||||
s->fixed_coeffs[1][i] = tmp0 + tmp1;
|
||||
s->fixed_coeffs[2][i] = tmp0 - tmp1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -706,10 +714,6 @@ static void ac3_upmix_delay(AC3DecodeContext *s)
|
||||
|
||||
/**
|
||||
* Decode band structure for coupling, spectral extension, or enhanced coupling.
|
||||
* The band structure defines how many subbands are in each band. For each
|
||||
* subband in the range, 1 means it is combined with the previous band, and 0
|
||||
* means that it starts a new band.
|
||||
*
|
||||
* @param[in] gbc bit reader context
|
||||
* @param[in] blk block number
|
||||
* @param[in] eac3 flag to indicate E-AC-3
|
||||
@@ -717,33 +721,33 @@ static void ac3_upmix_delay(AC3DecodeContext *s)
|
||||
* @param[in] start_subband subband number for start of range
|
||||
* @param[in] end_subband subband number for end of range
|
||||
* @param[in] default_band_struct default band structure table
|
||||
* @param[out] band_struct decoded band structure
|
||||
* @param[out] num_subbands number of subbands (optionally NULL)
|
||||
* @param[out] num_bands number of bands (optionally NULL)
|
||||
* @param[out] band_sizes array containing the number of bins in each band (optionally NULL)
|
||||
*/
|
||||
static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
|
||||
int ecpl, int start_subband, int end_subband,
|
||||
const uint8_t *default_band_struct,
|
||||
uint8_t *band_struct, int *num_subbands,
|
||||
int *num_bands, uint8_t *band_sizes)
|
||||
{
|
||||
int subbnd, bnd, n_subbands, n_bands=0;
|
||||
uint8_t bnd_sz[22];
|
||||
uint8_t coded_band_struct[22];
|
||||
const uint8_t *band_struct;
|
||||
|
||||
n_subbands = end_subband - start_subband;
|
||||
|
||||
/* decode band structure from bitstream or use default */
|
||||
if (!eac3 || get_bits1(gbc)) {
|
||||
for (subbnd = 0; subbnd < n_subbands - 1; subbnd++) {
|
||||
coded_band_struct[subbnd] = get_bits1(gbc);
|
||||
band_struct[subbnd] = get_bits1(gbc);
|
||||
}
|
||||
band_struct = coded_band_struct;
|
||||
} else if (!blk) {
|
||||
band_struct = &default_band_struct[start_subband+1];
|
||||
} else {
|
||||
/* no change in band structure */
|
||||
return;
|
||||
memcpy(band_struct,
|
||||
&default_band_struct[start_subband+1],
|
||||
n_subbands-1);
|
||||
}
|
||||
band_struct[n_subbands-1] = 0;
|
||||
|
||||
/* calculate number of bands and band sizes based on band structure.
|
||||
note that the first 4 subbands in enhanced coupling span only 6 bins
|
||||
@@ -763,6 +767,8 @@ static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
|
||||
}
|
||||
|
||||
/* set optional output params */
|
||||
if (num_subbands)
|
||||
*num_subbands = n_subbands;
|
||||
if (num_bands)
|
||||
*num_bands = n_bands;
|
||||
if (band_sizes)
|
||||
@@ -815,105 +821,14 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
|
||||
/* spectral extension strategy */
|
||||
if (s->eac3 && (!blk || get_bits1(gbc))) {
|
||||
s->spx_in_use = get_bits1(gbc);
|
||||
if (s->spx_in_use) {
|
||||
int dst_start_freq, dst_end_freq, src_start_freq,
|
||||
start_subband, end_subband;
|
||||
|
||||
/* determine which channels use spx */
|
||||
if (s->channel_mode == AC3_CHMODE_MONO) {
|
||||
s->channel_uses_spx[1] = 1;
|
||||
} else {
|
||||
for (ch = 1; ch <= fbw_channels; ch++)
|
||||
s->channel_uses_spx[ch] = get_bits1(gbc);
|
||||
}
|
||||
|
||||
/* get the frequency bins of the spx copy region and the spx start
|
||||
and end subbands */
|
||||
dst_start_freq = get_bits(gbc, 2);
|
||||
start_subband = get_bits(gbc, 3) + 2;
|
||||
if (start_subband > 7)
|
||||
start_subband += start_subband - 7;
|
||||
end_subband = get_bits(gbc, 3) + 5;
|
||||
if (end_subband > 7)
|
||||
end_subband += end_subband - 7;
|
||||
dst_start_freq = dst_start_freq * 12 + 25;
|
||||
src_start_freq = start_subband * 12 + 25;
|
||||
dst_end_freq = end_subband * 12 + 25;
|
||||
|
||||
/* check validity of spx ranges */
|
||||
if (start_subband >= end_subband) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "
|
||||
"range (%d >= %d)\n", start_subband, end_subband);
|
||||
return -1;
|
||||
}
|
||||
if (dst_start_freq >= src_start_freq) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "
|
||||
"copy start bin (%d >= %d)\n", dst_start_freq, src_start_freq);
|
||||
return -1;
|
||||
}
|
||||
|
||||
s->spx_dst_start_freq = dst_start_freq;
|
||||
s->spx_src_start_freq = src_start_freq;
|
||||
s->spx_dst_end_freq = dst_end_freq;
|
||||
|
||||
decode_band_structure(gbc, blk, s->eac3, 0,
|
||||
start_subband, end_subband,
|
||||
ff_eac3_default_spx_band_struct,
|
||||
&s->num_spx_bands,
|
||||
s->spx_band_sizes);
|
||||
} else {
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
if (get_bits1(gbc)) {
|
||||
ff_log_missing_feature(s->avctx, "Spectral extension", 1);
|
||||
return -1;
|
||||
}
|
||||
/* TODO: parse spectral extension strategy info */
|
||||
}
|
||||
|
||||
/* spectral extension coordinates */
|
||||
if (s->spx_in_use) {
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
if (s->channel_uses_spx[ch]) {
|
||||
if (s->first_spx_coords[ch] || get_bits1(gbc)) {
|
||||
float spx_blend;
|
||||
int bin, master_spx_coord;
|
||||
|
||||
s->first_spx_coords[ch] = 0;
|
||||
spx_blend = get_bits(gbc, 5) * (1.0f/32);
|
||||
master_spx_coord = get_bits(gbc, 2) * 3;
|
||||
|
||||
bin = s->spx_src_start_freq;
|
||||
for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
|
||||
int bandsize;
|
||||
int spx_coord_exp, spx_coord_mant;
|
||||
float nratio, sblend, nblend, spx_coord;
|
||||
|
||||
/* calculate blending factors */
|
||||
bandsize = s->spx_band_sizes[bnd];
|
||||
nratio = ((float)((bin + (bandsize >> 1))) / s->spx_dst_end_freq) - spx_blend;
|
||||
nratio = av_clipf(nratio, 0.0f, 1.0f);
|
||||
nblend = sqrtf(3.0f * nratio); // noise is scaled by sqrt(3) to give unity variance
|
||||
sblend = sqrtf(1.0f - nratio);
|
||||
bin += bandsize;
|
||||
|
||||
/* decode spx coordinates */
|
||||
spx_coord_exp = get_bits(gbc, 4);
|
||||
spx_coord_mant = get_bits(gbc, 2);
|
||||
if (spx_coord_exp == 15) spx_coord_mant <<= 1;
|
||||
else spx_coord_mant += 4;
|
||||
spx_coord_mant <<= (25 - spx_coord_exp - master_spx_coord);
|
||||
spx_coord = spx_coord_mant * (1.0f/(1<<23));
|
||||
|
||||
/* multiply noise and signal blending factors by spx coordinate */
|
||||
s->spx_noise_blend [ch][bnd] = nblend * spx_coord;
|
||||
s->spx_signal_blend[ch][bnd] = sblend * spx_coord;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* TODO: spectral extension coordinates */
|
||||
|
||||
/* coupling strategy */
|
||||
if (s->eac3 ? s->cpl_strategy_exists[blk] : get_bits1(gbc)) {
|
||||
@@ -932,7 +847,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
/* check for enhanced coupling */
|
||||
if (s->eac3 && get_bits1(gbc)) {
|
||||
/* TODO: parse enhanced coupling strategy info */
|
||||
av_log_missing_feature(s->avctx, "Enhanced coupling", 1);
|
||||
ff_log_missing_feature(s->avctx, "Enhanced coupling", 1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -950,21 +865,23 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
s->phase_flags_in_use = get_bits1(gbc);
|
||||
|
||||
/* coupling frequency range */
|
||||
/* TODO: modify coupling end freq if spectral extension is used */
|
||||
cpl_start_subband = get_bits(gbc, 4);
|
||||
cpl_end_subband = s->spx_in_use ? (s->spx_src_start_freq - 37) / 12 :
|
||||
get_bits(gbc, 4) + 3;
|
||||
if (cpl_start_subband >= cpl_end_subband) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d >= %d)\n",
|
||||
cpl_end_subband = get_bits(gbc, 4) + 3;
|
||||
s->num_cpl_subbands = cpl_end_subband - cpl_start_subband;
|
||||
if (s->num_cpl_subbands < 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d > %d)\n",
|
||||
cpl_start_subband, cpl_end_subband);
|
||||
return -1;
|
||||
}
|
||||
s->start_freq[CPL_CH] = cpl_start_subband * 12 + 37;
|
||||
s->end_freq[CPL_CH] = cpl_end_subband * 12 + 37;
|
||||
|
||||
decode_band_structure(gbc, blk, s->eac3, 0, cpl_start_subband,
|
||||
cpl_end_subband,
|
||||
ff_eac3_default_cpl_band_struct,
|
||||
&s->num_cpl_bands, s->cpl_band_sizes);
|
||||
decode_band_structure(gbc, blk, s->eac3, 0,
|
||||
cpl_start_subband, cpl_end_subband,
|
||||
ff_eac3_default_cpl_band_struct,
|
||||
s->cpl_band_struct, &s->num_cpl_subbands,
|
||||
&s->num_cpl_bands, NULL);
|
||||
} else {
|
||||
/* coupling not in use */
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
@@ -1025,16 +942,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
if (channel_mode == AC3_CHMODE_STEREO) {
|
||||
if ((s->eac3 && !blk) || get_bits1(gbc)) {
|
||||
s->num_rematrixing_bands = 4;
|
||||
if (cpl_in_use && s->start_freq[CPL_CH] <= 61) {
|
||||
if(cpl_in_use && s->start_freq[CPL_CH] <= 61)
|
||||
s->num_rematrixing_bands -= 1 + (s->start_freq[CPL_CH] == 37);
|
||||
} else if (s->spx_in_use && s->spx_src_start_freq <= 61) {
|
||||
s->num_rematrixing_bands--;
|
||||
}
|
||||
for(bnd=0; bnd<s->num_rematrixing_bands; bnd++)
|
||||
s->rematrixing_flags[bnd] = get_bits1(gbc);
|
||||
} else if (!blk) {
|
||||
av_log(s->avctx, AV_LOG_WARNING, "Warning: new rematrixing strategy not present in block 0\n");
|
||||
s->num_rematrixing_bands = 0;
|
||||
av_log(s->avctx, AV_LOG_ERROR, "new rematrixing strategy must be present in block 0\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1054,8 +968,6 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
int prev = s->end_freq[ch];
|
||||
if (s->channel_in_cpl[ch])
|
||||
s->end_freq[ch] = s->start_freq[CPL_CH];
|
||||
else if (s->channel_uses_spx[ch])
|
||||
s->end_freq[ch] = s->spx_src_start_freq;
|
||||
else {
|
||||
int bandwidth_code = get_bits(gbc, 6);
|
||||
if (bandwidth_code > 60) {
|
||||
@@ -1252,6 +1164,8 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
|
||||
/* TODO: generate enhanced coupling coordinates and uncouple */
|
||||
|
||||
/* TODO: apply spectral extension */
|
||||
|
||||
/* recover coefficients if rematrixing is in use */
|
||||
if(s->channel_mode == AC3_CHMODE_STEREO)
|
||||
do_rematrixing(s);
|
||||
@@ -1260,18 +1174,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
for(ch=1; ch<=s->channels; ch++) {
|
||||
float gain = s->mul_bias / 4194304.0f;
|
||||
if(s->channel_mode == AC3_CHMODE_DUALMONO) {
|
||||
gain *= s->dynamic_range[2-ch];
|
||||
gain *= s->dynamic_range[ch-1];
|
||||
} else {
|
||||
gain *= s->dynamic_range[0];
|
||||
}
|
||||
s->dsp.int32_to_float_fmul_scalar(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain, 256);
|
||||
}
|
||||
|
||||
/* apply spectral extension to high frequency bins */
|
||||
if (s->spx_in_use && CONFIG_EAC3_DECODER) {
|
||||
ff_eac3_apply_spectral_extension(s);
|
||||
}
|
||||
|
||||
/* downmix and MDCT. order depends on whether block switching is used for
|
||||
any channel in this block. this is because coefficients for the long
|
||||
and short transforms cannot be mixed. */
|
||||
@@ -1311,15 +1220,11 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
* Decode a single AC-3 frame.
|
||||
*/
|
||||
static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
|
||||
AVPacket *avpkt)
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
AC3DecodeContext *s = avctx->priv_data;
|
||||
int16_t *out_samples = (int16_t *)data;
|
||||
int blk, ch, err;
|
||||
const uint8_t *channel_map;
|
||||
const float *output[AC3_MAX_CHANNELS];
|
||||
|
||||
/* initialize the GetBitContext with the start of valid AC-3 Frame */
|
||||
if (s->input_buffer) {
|
||||
@@ -1335,7 +1240,21 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
|
||||
*data_size = 0;
|
||||
err = parse_frame_header(s);
|
||||
|
||||
if (err) {
|
||||
/* check that reported frame size fits in input buffer */
|
||||
if(s->frame_size > buf_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
|
||||
err = AAC_AC3_PARSE_ERROR_FRAME_SIZE;
|
||||
}
|
||||
|
||||
/* check for crc mismatch */
|
||||
if(err != AAC_AC3_PARSE_ERROR_FRAME_SIZE && avctx->error_recognition >= FF_ER_CAREFUL) {
|
||||
if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
|
||||
err = AAC_AC3_PARSE_ERROR_CRC;
|
||||
}
|
||||
}
|
||||
|
||||
if(err && err != AAC_AC3_PARSE_ERROR_CRC) {
|
||||
switch(err) {
|
||||
case AAC_AC3_PARSE_ERROR_SYNC:
|
||||
av_log(avctx, AV_LOG_ERROR, "frame sync error\n");
|
||||
@@ -1363,18 +1282,6 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
|
||||
av_log(avctx, AV_LOG_ERROR, "invalid header\n");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* check that reported frame size fits in input buffer */
|
||||
if (s->frame_size > buf_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
|
||||
err = AAC_AC3_PARSE_ERROR_FRAME_SIZE;
|
||||
} else if (avctx->error_recognition >= FF_ER_CAREFUL) {
|
||||
/* check for crc mismatch */
|
||||
if (av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
|
||||
err = AAC_AC3_PARSE_ERROR_CRC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* if frame is ok, set audio parameters */
|
||||
@@ -1391,10 +1298,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
|
||||
avctx->request_channels < s->channels) {
|
||||
s->out_channels = avctx->request_channels;
|
||||
s->output_mode = avctx->request_channels == 1 ? AC3_CHMODE_MONO : AC3_CHMODE_STEREO;
|
||||
s->channel_layout = ff_ac3_channel_layout_tab[s->output_mode];
|
||||
}
|
||||
avctx->channels = s->out_channels;
|
||||
avctx->channel_layout = s->channel_layout;
|
||||
|
||||
/* set downmixing coefficients if needed */
|
||||
if(s->channels != s->out_channels && !((s->output_mode & AC3_OUTPUT_LFEON) &&
|
||||
@@ -1408,19 +1313,19 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
|
||||
}
|
||||
|
||||
/* decode the audio blocks */
|
||||
channel_map = ff_ac3_dec_channel_map[s->output_mode & ~AC3_OUTPUT_LFEON][s->lfe_on];
|
||||
for (ch = 0; ch < s->out_channels; ch++)
|
||||
output[ch] = s->output[channel_map[ch]];
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
const float *output[s->out_channels];
|
||||
if (!err && decode_audio_block(s, blk)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "error decoding the audio block\n");
|
||||
err = 1;
|
||||
}
|
||||
for (ch = 0; ch < s->out_channels; ch++)
|
||||
output[ch] = s->output[ch];
|
||||
s->dsp.float_to_int16_interleave(out_samples, output, 256, s->out_channels);
|
||||
out_samples += 256 * s->out_channels;
|
||||
}
|
||||
*data_size = s->num_blocks * 256 * avctx->channels * sizeof (int16_t);
|
||||
return FFMIN(buf_size, s->frame_size);
|
||||
return s->frame_size;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1439,7 +1344,7 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx)
|
||||
|
||||
AVCodec ac3_decoder = {
|
||||
.name = "ac3",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.type = CODEC_TYPE_AUDIO,
|
||||
.id = CODEC_ID_AC3,
|
||||
.priv_data_size = sizeof (AC3DecodeContext),
|
||||
.init = ac3_decode_init,
|
||||
@@ -1448,10 +1353,9 @@ AVCodec ac3_decoder = {
|
||||
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
|
||||
};
|
||||
|
||||
#if CONFIG_EAC3_DECODER
|
||||
AVCodec eac3_decoder = {
|
||||
.name = "eac3",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.type = CODEC_TYPE_AUDIO,
|
||||
.id = CODEC_ID_EAC3,
|
||||
.priv_data_size = sizeof (AC3DecodeContext),
|
||||
.init = ac3_decode_init,
|
||||
@@ -1459,4 +1363,3 @@ AVCodec eac3_decoder = {
|
||||
.decode = ac3_decode_frame,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
|
||||
};
|
||||
#endif
|
||||
|
@@ -20,41 +20,18 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/ac3.h
|
||||
* Common code between the AC-3 and E-AC-3 decoders.
|
||||
*
|
||||
* Summary of MDCT Coefficient Grouping:
|
||||
* The individual MDCT coefficient indices are often referred to in the
|
||||
* (E-)AC-3 specification as frequency bins. These bins are grouped together
|
||||
* into subbands of 12 coefficients each. The subbands are grouped together
|
||||
* into bands as defined in the bitstream by the band structures, which
|
||||
* determine the number of bands and the size of each band. The full spectrum
|
||||
* of 256 frequency bins is divided into 1 DC bin + 21 subbands = 253 bins.
|
||||
* This system of grouping coefficients is used for channel bandwidth, stereo
|
||||
* rematrixing, channel coupling, enhanced coupling, and spectral extension.
|
||||
*
|
||||
* +-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-+
|
||||
* |1| |12| | [12|12|12|12] | | | | | | | | | | | | |3|
|
||||
* +-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-+
|
||||
* ~~~ ~~~~ ~~~~~~~~~~~~~ ~~~
|
||||
* | | | |
|
||||
* | | | 3 unused frequency bins--+
|
||||
* | | |
|
||||
* | | +--1 band containing 4 subbands
|
||||
* | |
|
||||
* | +--1 subband of 12 frequency bins
|
||||
* |
|
||||
* +--DC frequency bin
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AC3DEC_H
|
||||
#define AVCODEC_AC3DEC_H
|
||||
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/lfg.h"
|
||||
#include "ac3.h"
|
||||
#include "get_bits.h"
|
||||
#include "bitstream.h"
|
||||
#include "dsputil.h"
|
||||
#include "fft.h"
|
||||
|
||||
/* override ac3.h to include coupling channel */
|
||||
#undef AC3_MAX_CHANNELS
|
||||
@@ -66,7 +43,6 @@
|
||||
#define AC3_MAX_COEFS 256
|
||||
#define AC3_BLOCK_SIZE 256
|
||||
#define MAX_BLOCKS 6
|
||||
#define SPX_MAX_BANDS 17
|
||||
|
||||
typedef struct {
|
||||
AVCodecContext *avctx; ///< parent context
|
||||
@@ -82,7 +58,6 @@ typedef struct {
|
||||
int sample_rate; ///< sample frequency, in Hz
|
||||
int num_blocks; ///< number of audio blocks
|
||||
int channel_mode; ///< channel mode (acmod)
|
||||
int channel_layout; ///< channel layout
|
||||
int lfe_on; ///< lfe channel in use
|
||||
int channel_map; ///< custom channel map
|
||||
int center_mix_level; ///< Center mix level index
|
||||
@@ -106,29 +81,14 @@ typedef struct {
|
||||
int channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl)
|
||||
int phase_flags_in_use; ///< phase flags in use (phsflginu)
|
||||
int phase_flags[18]; ///< phase flags (phsflg)
|
||||
int num_cpl_subbands; ///< number of coupling sub bands (ncplsubnd)
|
||||
int num_cpl_bands; ///< number of coupling bands (ncplbnd)
|
||||
uint8_t cpl_band_sizes[18]; ///< number of coeffs in each coupling band
|
||||
uint8_t cpl_band_struct[18]; ///< coupling band structure (cplbndstrc)
|
||||
int firstchincpl; ///< first channel in coupling
|
||||
int first_cpl_coords[AC3_MAX_CHANNELS]; ///< first coupling coordinates states (firstcplcos)
|
||||
int cpl_coords[AC3_MAX_CHANNELS][18]; ///< coupling coordinates (cplco)
|
||||
///@}
|
||||
|
||||
///@defgroup spx spectral extension
|
||||
///@{
|
||||
int spx_in_use; ///< spectral extension in use (spxinu)
|
||||
uint8_t channel_uses_spx[AC3_MAX_CHANNELS]; ///< channel uses spectral extension (chinspx)
|
||||
int8_t spx_atten_code[AC3_MAX_CHANNELS]; ///< spx attenuation code (spxattencod)
|
||||
int spx_src_start_freq; ///< spx start frequency bin
|
||||
int spx_dst_end_freq; ///< spx end frequency bin
|
||||
int spx_dst_start_freq; ///< spx starting frequency bin for copying (copystartmant)
|
||||
///< the copy region ends at the start of the spx region.
|
||||
int num_spx_bands; ///< number of spx bands (nspxbnds)
|
||||
uint8_t spx_band_sizes[SPX_MAX_BANDS]; ///< number of bins in each spx band
|
||||
uint8_t first_spx_coords[AC3_MAX_CHANNELS]; ///< first spx coordinates states (firstspxcos)
|
||||
float spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor (nblendfact)
|
||||
float spx_signal_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS];///< spx signal blending factor (sblendfact)
|
||||
///@}
|
||||
|
||||
///@defgroup aht adaptive hybrid transform
|
||||
int channel_uses_aht[AC3_MAX_CHANNELS]; ///< channel AHT in use (chahtinu)
|
||||
int pre_mantissa[AC3_MAX_CHANNELS][AC3_MAX_COEFS][MAX_BLOCKS]; ///< pre-IDCT mantissas
|
||||
@@ -187,8 +147,8 @@ typedef struct {
|
||||
|
||||
///@defgroup imdct IMDCT
|
||||
int block_switch[AC3_MAX_CHANNELS]; ///< block switch flags (blksw)
|
||||
FFTContext imdct_512; ///< for 512 sample IMDCT
|
||||
FFTContext imdct_256; ///< for 256 sample IMDCT
|
||||
MDCTContext imdct_512; ///< for 512 sample IMDCT
|
||||
MDCTContext imdct_256; ///< for 256 sample IMDCT
|
||||
///@}
|
||||
|
||||
///@defgroup opt optimization
|
||||
@@ -197,13 +157,14 @@ typedef struct {
|
||||
float mul_bias; ///< scaling for float_to_int16 conversion
|
||||
///@}
|
||||
|
||||
DECLARE_ALIGNED_16(int, fixed_coeffs[AC3_MAX_CHANNELS][AC3_MAX_COEFS]); ///> fixed-point transform coefficients
|
||||
|
||||
///@defgroup arrays aligned arrays
|
||||
DECLARE_ALIGNED(16, int, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///> fixed-point transform coefficients
|
||||
DECLARE_ALIGNED(16, float, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< transform coefficients
|
||||
DECLARE_ALIGNED(16, float, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next block
|
||||
DECLARE_ALIGNED(16, float, window)[AC3_BLOCK_SIZE]; ///< window coefficients
|
||||
DECLARE_ALIGNED(16, float, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing
|
||||
DECLARE_ALIGNED(16, float, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing
|
||||
DECLARE_ALIGNED_16(float, transform_coeffs[AC3_MAX_CHANNELS][AC3_MAX_COEFS]); ///< transform coefficients
|
||||
DECLARE_ALIGNED_16(float, delay[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]); ///< delay - added to the next block
|
||||
DECLARE_ALIGNED_16(float, window[AC3_BLOCK_SIZE]); ///< window coefficients
|
||||
DECLARE_ALIGNED_16(float, tmp_output[AC3_BLOCK_SIZE]); ///< temporary storage for output before windowing
|
||||
DECLARE_ALIGNED_16(float, output[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]); ///< output after imdct transform and windowing
|
||||
///@}
|
||||
} AC3DecodeContext;
|
||||
|
||||
@@ -219,14 +180,4 @@ int ff_eac3_parse_header(AC3DecodeContext *s);
|
||||
*/
|
||||
void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
|
||||
|
||||
void ff_ac3_downmix_c(float (*samples)[256], float (*matrix)[2],
|
||||
int out_ch, int in_ch, int len);
|
||||
|
||||
/**
|
||||
* Apply spectral extension to each channel by copying lower frequency
|
||||
* coefficients to higher frequency bins and applying side information to
|
||||
* approximate the original high frequency signal.
|
||||
*/
|
||||
void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
|
||||
|
||||
#endif /* AVCODEC_AC3DEC_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user