Compare commits
94 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 |
45
.gitignore
vendored
45
.gitignore
vendored
@@ -1,45 +0,0 @@
|
||||
.config
|
||||
.version
|
||||
*.o
|
||||
*.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
|
||||
|
247
Changelog
247
Changelog
@@ -1,201 +1,38 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 0.6.5:
|
||||
- vorbis: An additional defense in the Vorbis codec. (CVE-2011-3895)
|
||||
- vorbisdec: Fix decoding bug with channel handling.
|
||||
- matroskadec: Fix a bug where a pointer was cached to an array that might
|
||||
later move due to a realloc(). (CVE-2011-3893)
|
||||
- vorbis: Avoid some out-of-bounds reads. (CVE-2011-3893)
|
||||
- vp3: fix oob read for negative tokens and memleaks on error, (CVE-2011-3892)
|
||||
- vp3: fix streams with non-zero last coefficient.
|
||||
|
||||
version 0.5.2:
|
||||
|
||||
- Hurd support
|
||||
- PowerPC without Altivec compilation issues
|
||||
- validate channels and samplerate in the Vorbis decoder
|
||||
|
||||
|
||||
version 0.6.4:
|
||||
- 4xm: Add a check in decode_i_frame to prevent buffer overreads
|
||||
- wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
|
||||
- swscale: #include "libavutil/mathematics.h"
|
||||
- vp3dec: Check coefficient index in vp3_dequant() (CVE-2011-4352)
|
||||
- svq1dec: call avcodec_set_dimensions() after dimensions changed. (CVE-2011-4579)
|
||||
- commits related to CVE-2011-4353:
|
||||
- vp6: Fix illegal read.
|
||||
- vp6: Reset the internal state when aborting key frames header parsing
|
||||
- vp6: Check for huffman tree build errors
|
||||
- vp6: partially propagate huffman tree building errors during coeff model parsing and fix misspelling
|
||||
- commits related to CVE-2011-4351:
|
||||
- qdm2: check output buffer size before decoding
|
||||
- Fix qdm2 decoder packet handling to match the api
|
||||
- Fix out of bound reads in the QDM2 decoder.
|
||||
- Check for out of bound writes in the QDM2 decoder.
|
||||
- vmd: fix segfaults on corruped streams (CVE-2011-4364)
|
||||
- rv34: Check for invalid slice offsets
|
||||
- rv34: Fix potential overreads
|
||||
- rv34: Avoid NULL dereference on corrupted bitstream
|
||||
- rv10: Reject slices that does not have the same type as the first one
|
||||
- oggdec: fix out of bound write in the ogg demuxer
|
||||
- smacker: fix a few off by 1 errors
|
||||
- Check for invalid VLC value in smacker decoder.
|
||||
- Check and propagate errors when VLC trees cannot be built in smacker decoder.
|
||||
- Fixed off by one packet size allocation in the smacker demuxer.
|
||||
- Check for invalid packet size in the smacker demuxer.
|
||||
- ape demuxer: fix segfault on memory allocation failure.
|
||||
- Fixed size given to init_get_bits() in xan decoder.
|
||||
- smacker demuxer: handle possible av_realloc() failure.
|
||||
- Fixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.
|
||||
- indeo2: fail if input buffer too small
|
||||
- indeo2: init_get_bits size in bits instead of bytes
|
||||
- wavpack: Check error codes rather than working around error conditions.
|
||||
- Fixed invalid writes and reads in wavpack decoder on corrupted bitstreams.
|
||||
- cpu detection: avoid a signed overflow
|
||||
- h264: correct implicit weight table computation for long ref pics
|
||||
- h264: correct the check for invalid long term frame index in MMCO decode
|
||||
- rv10/20: tell decoder to use edge emulation
|
||||
- flvenc: use int64_t to store offsets
|
||||
- VC-1: fix reading of custom PAR.
|
||||
- h264: notice memory allocation failure
|
||||
- libx264: do not set pic quality if no frame is output
|
||||
- mxfdec: Include FF_INPUT_BUFFER_PADDING_SIZE when allocating extradata.
|
||||
- rv30: return AVERROR(EINVAL) instead of EINVAL
|
||||
- Do not decode RV30 files if the extradata is too small
|
||||
- aacps: skip some memcpy() if src and dst would be equal
|
||||
- mpegts: fix Continuity Counter error detection
|
||||
- alsa: fallback to buffer_size/4 for period_size.
|
||||
- mxfenc: fix ignored drop flag in binary timecode representation.
|
||||
- dca: set AVCodecContext frame_size for DTS audio
|
||||
- H.264: fix overreads of qscale_table
|
||||
- postprocess.c: filter name needs to be double 0 terminated
|
||||
- Replace strncpy() with av_strlcpy() in libpostproc.
|
||||
- jpegdec: actually search for and parse RSTn
|
||||
- riff: Add mpgv MPEG-2 fourcc
|
||||
- Added M701 codec_tag for mpeg2video
|
||||
|
||||
version 0.5.1:
|
||||
|
||||
version 0.6.3:
|
||||
|
||||
- fix compilation with --enable-hardcoded-tables
|
||||
- mjpeg: Detect overreads in mjpeg_decode_scan() and error out.
|
||||
- aac: add headers needed for log2f()
|
||||
- lavf: inspect more frames for fps when container time base is coarse
|
||||
- AMV: disable DR1 and don't override EMU_EDGE
|
||||
(addresses http://seclists.org/bugtraq/2011/Apr/257)
|
||||
- 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
|
||||
- Fix a heap corruption issue in the OGG decoder
|
||||
- Backported the Android VisualOn AAC encoder wrapper from 0.7.2
|
||||
|
||||
|
||||
version 0.6.3:
|
||||
|
||||
- AMV: Fix possibly exploitable crash.
|
||||
- Fix apparently exploitable race condition.
|
||||
(addresses http://seclists.org/bugtraq/2011/Apr/257)
|
||||
|
||||
version 0.6.2:
|
||||
|
||||
- fix compilation with --enable-hardcoded-tables
|
||||
- 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.6.1:
|
||||
|
||||
- fix autodetection of E-AC-3 substream samples
|
||||
- performance fix for seekable HTTP
|
||||
- backport AAC-HE v2 from trunk
|
||||
- add missing VP80 fourcc code for the VP8 codec
|
||||
- small documentation fixes
|
||||
- fix several potentially exploitable issues in the FLIC decoder
|
||||
(addresses CVE-2010-3429)
|
||||
|
||||
|
||||
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
|
||||
- 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
|
||||
@@ -215,7 +52,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
|
||||
@@ -226,19 +63,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
|
||||
@@ -257,14 +93,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
|
||||
@@ -291,10 +125,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
|
||||
@@ -303,7 +137,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
|
||||
@@ -333,7 +166,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
|
||||
@@ -341,9 +173,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
|
||||
@@ -355,7 +186,6 @@ version 0.5:
|
||||
- generic metadata API
|
||||
|
||||
|
||||
|
||||
version 0.4.9-pre1:
|
||||
|
||||
- DV encoder, DV muxer
|
||||
@@ -439,8 +269,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)
|
||||
@@ -451,8 +279,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
|
||||
@@ -493,8 +319,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
|
||||
@@ -531,8 +355,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>)
|
||||
@@ -563,8 +385,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
|
||||
@@ -589,8 +409,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>)
|
||||
@@ -611,8 +429,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
|
||||
@@ -629,7 +445,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
|
||||
@@ -642,8 +457,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
|
||||
@@ -671,14 +484,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
|
||||
@@ -686,21 +495,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)
|
||||
|
224
RELEASE
224
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 focuses on improvements for the new multimedia elements in HTML5.
|
||||
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,172 +19,96 @@ 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)
|
||||
|
||||
|
||||
Added Codecs:
|
||||
-------------
|
||||
|
||||
- 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
|
||||
|
||||
|
||||
Notable license related changes
|
||||
-------------------------------
|
||||
|
||||
- remaining GPL parts in AC-3 decoder converted to LGPL
|
||||
- libswscale can now be compiled in LGPL mode
|
||||
If at all possible, do not use the deprecated APIs. All notes on API changes
|
||||
should appear in doc/APIchanges.
|
||||
|
||||
|
||||
|
||||
* 0.6.1
|
||||
* 0.5.1 March 2, 2010
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This point release includes some updates to make the 0.6 release series usable
|
||||
for users that need to retain the existing behavior as closely as possible.
|
||||
The changes follow below:
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- fix autodetection of E-AC-3 substream samples
|
||||
- performance fix for seekable HTTP
|
||||
- add missing VP80 fourcc code for the VP8 codec
|
||||
- small documentation fixes
|
||||
- fix several potentially exploitable issues in the FLIC decoder
|
||||
(addresses CVE-2010-3429)
|
||||
|
||||
|
||||
HE-AAC v2 backport
|
||||
------------------
|
||||
|
||||
This release includes a backport of the AAC decoder from trunk, which
|
||||
enables proper playback of HE-AAC v2 media.
|
||||
|
||||
|
||||
* 0.6.2
|
||||
|
||||
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.
|
||||
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
|
||||
--------------
|
||||
|
||||
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.
|
||||
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:
|
||||
|
||||
- VC1 decoder (Change related to CVE-2011-0723)
|
||||
- APE decoder (cf. http://packetstorm.linuxsecurity.com/1103-exploits/vlc105-dos.txt)
|
||||
- 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.
|
||||
|
||||
|
||||
* 0.6.3
|
||||
|
||||
* 0.5.2 May 25, 2010
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This is a mostly maintenance-only release that addresses a small number
|
||||
of bugs such as security and compilation issues. Moreover, this release
|
||||
has been updated to work with gcc-4.6 and the VisualOn AAC encoder has
|
||||
been backported from the Libav 0.7.2 release. Distributors and system
|
||||
integrators are encouraged to update and share their patches against
|
||||
this branch.
|
||||
For a full list of changes please see the Changelog file.
|
||||
|
||||
|
||||
* 0.6.4
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This mostly maintenance-only release that addresses a number a number of
|
||||
bugs such as security and compilation issues that have been brought to
|
||||
our attention. Among other (rather minor) fixes, this release features
|
||||
fixes for the QDM2 decoder (CVE-2011-4351), vp3 decoder (CVE-2011-4352),
|
||||
DoS in the VP5/VP6 decoders (CVE-2011-4353), a buffer overflow in the
|
||||
Sierra VMD decoder CVE-2011-4364, and a safety fix in the svq1 decoder
|
||||
(CVE-2011-4579).
|
||||
|
||||
Distributors and system integrators are encouraged
|
||||
to update and share their patches against this branch. For a full list
|
||||
of changes please see the Changelog file.
|
||||
|
||||
|
||||
* 0.6.5
|
||||
|
||||
General notes
|
||||
-------------
|
||||
|
||||
This mostly maintenance-only release that addresses a number a number of
|
||||
bugs such as security and compilation issues that have been brought to
|
||||
our attention. Among other (rather minor) fixes, this release features
|
||||
fixes for the VP3 decoder (CVE-2011-3892), vorbis decoder, and matroska
|
||||
demuxer (CVE-2011-3893 and CVE-2011-3895).
|
||||
|
||||
Distributors and system integrators are encouraged
|
||||
to update and share their patches against this branch. For a full list
|
||||
of changes please see the Changelog file.
|
||||
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.
|
||||
|
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
|
655
doc/general.texi
655
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
|
||||
@@ -511,7 +480,7 @@ following image formats are supported:
|
||||
@item Name @tab Encoding @tab Decoding @tab Comments
|
||||
@item 8SVX audio @tab @tab X
|
||||
@item AAC @tab E @tab X
|
||||
@tab encoding supported through external library libfaac and libvo-aacenc
|
||||
@tab encoding supported through external library libfaac
|
||||
@item AC-3 @tab IX @tab X
|
||||
@item ADPCM 4X Movie @tab @tab X
|
||||
@item ADPCM CDROM XA @tab @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
|
||||
@@ -137,8 +137,8 @@ typedef struct FourXContext{
|
||||
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 +237,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,10 +375,8 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int 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);
|
||||
@@ -641,18 +636,9 @@ 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);
|
||||
int token_count av_unused;
|
||||
unsigned int prestream_size;
|
||||
const uint8_t *prestream;
|
||||
|
||||
if (length < bitstream_size + 12) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
token_count = AV_RL32(buf + bitstream_size + 8);
|
||||
prestream_size = 4 * AV_RL32(buf + bitstream_size + 4);
|
||||
prestream = buf + bitstream_size + 12;
|
||||
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;
|
||||
|
||||
if(prestream_size + bitstream_size + 12 != length
|
||||
|| bitstream_size > (1<<26)
|
||||
@@ -667,10 +653,8 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
|
||||
|
||||
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;
|
||||
@@ -693,10 +677,8 @@ 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;
|
||||
@@ -824,7 +806,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;
|
||||
}
|
||||
@@ -841,24 +823,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) += aacdec.o aactab.o aacsbr.o aacps.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,64 +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_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.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
|
||||
@@ -546,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
|
||||
@@ -589,70 +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)aacdec.o: $(SUBDIR)cbrt_tables.h
|
||||
$(SUBDIR)aacps.o: $(SUBDIR)aacps_tables.h
|
||||
$(SUBDIR)aactab.o: $(SUBDIR)aac_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
|
||||
|
1738
libavcodec/aac.c
Normal file
1738
libavcodec/aac.c
Normal file
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,19 +30,54 @@
|
||||
#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], 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);
|
||||
|
||||
#define MAX_CHANNELS 64
|
||||
#define MAX_ELEM_ID 16
|
||||
|
||||
#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,
|
||||
@@ -98,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
|
||||
*/
|
||||
@@ -123,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
|
||||
*/
|
||||
@@ -139,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;
|
||||
@@ -179,7 +196,6 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
int num_pulse;
|
||||
int start;
|
||||
int pos[4];
|
||||
int amp[4];
|
||||
} Pulse;
|
||||
@@ -204,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;
|
||||
|
||||
@@ -221,21 +234,18 @@ 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;
|
||||
|
||||
/**
|
||||
* main AAC context
|
||||
*/
|
||||
typedef struct {
|
||||
AVCodecContext *avctx;
|
||||
AVCodecContext * avccontext;
|
||||
|
||||
MPEG4AudioConfig m4ac;
|
||||
|
||||
@@ -249,9 +259,8 @@ typedef struct {
|
||||
enum ChannelPosition che_pos[4][MAX_ELEM_ID]; /**< channel element channel mapping with the
|
||||
* first index as the first 4 raw data block types
|
||||
*/
|
||||
ChannelElement *che[4][MAX_ELEM_ID];
|
||||
ChannelElement *tag_che_map[4][MAX_ELEM_ID];
|
||||
uint8_t tags_seen_this_frame[4][MAX_ELEM_ID];
|
||||
ChannelElement * che[4][MAX_ELEM_ID];
|
||||
ChannelElement * tag_che_map[4][MAX_ELEM_ID];
|
||||
int tags_mapped;
|
||||
/** @} */
|
||||
|
||||
@@ -259,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;
|
||||
/** @} */
|
||||
@@ -282,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,39 +0,0 @@
|
||||
/*
|
||||
* Generate a header file for hardcoded AAC tables
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#define CONFIG_HARDCODED_TABLES 0
|
||||
#include "aac_tablegen.h"
|
||||
#include "tableprint.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ff_aac_tableinit();
|
||||
|
||||
write_fileheader();
|
||||
|
||||
printf("const float ff_aac_pow2sf_tab[428] = {\n");
|
||||
write_float_array(ff_aac_pow2sf_tab, 428);
|
||||
printf("};\n");
|
||||
|
||||
return 0;
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Header file for hardcoded AAC tables
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AAC_TABLEGEN_H
|
||||
#define AAC_TABLEGEN_H
|
||||
|
||||
#include "aac_tablegen_decl.h"
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
#include "libavcodec/aac_tables.h"
|
||||
#else
|
||||
#include "../libavutil/mathematics.h"
|
||||
float ff_aac_pow2sf_tab[428];
|
||||
|
||||
void ff_aac_tableinit(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 428; i++)
|
||||
ff_aac_pow2sf_tab[i] = pow(2, (i - 200) / 4.);
|
||||
}
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
#endif /* AAC_TABLEGEN_H */
|
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Header file for hardcoded AAC tables
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AAC_TABLEGEN_INIT_H
|
||||
#define AAC_TABLEGEN_INIT_H
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
#define ff_aac_tableinit()
|
||||
extern const float ff_aac_pow2sf_tab[428];
|
||||
#else
|
||||
void ff_aac_tableinit(void);
|
||||
extern float ff_aac_pow2sf_tab[428];
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
#endif /* AAC_TABLEGEN_INIT_H */
|
@@ -1,961 +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"
|
||||
#include "libavutil/libm.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,
|
||||
},
|
||||
};
|
2142
libavcodec/aacdec.c
2142
libavcodec/aacdec.c
File diff suppressed because it is too large
Load Diff
@@ -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,243 +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[2];
|
||||
|
||||
s->lambda = avctx->global_quality ? avctx->global_quality : 120;
|
||||
|
||||
ff_aac_tableinit();
|
||||
|
||||
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) {
|
||||
for (i = 0, j = channel; i < 1024; i++, j += avctx->channels) {
|
||||
s->output[i+1024] = audio[j] * lwindow[1024 - i - 1];
|
||||
sce->saved[i] = audio[j] * lwindow[i];
|
||||
}
|
||||
} else {
|
||||
for (i = 0, j = channel; i < 448; i++, j += avctx->channels)
|
||||
s->output[i+1024] = audio[j];
|
||||
for (; 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);
|
||||
for (i = 0, j = channel; i < 1024; i++, j += avctx->channels)
|
||||
sce->saved[i] = audio[j];
|
||||
}
|
||||
ff_mdct_calc(&s->mdct1024, sce->coeffs, s->output);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
for (i = 0, j = channel; 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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -401,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]);
|
||||
}
|
||||
@@ -417,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;
|
||||
ff_psy_set_band_info(&s->psy, s->cur_channel, cpe->ch[j].coeffs, &wi[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;
|
||||
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;
|
||||
@@ -632,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]; ///< quantized coefficients
|
||||
DECLARE_ALIGNED(16, float, scoefs)[1024]; ///< scaled coefficients
|
||||
} AACEncContext;
|
||||
|
||||
#endif /* AVCODEC_AACENC_H */
|
1040
libavcodec/aacps.c
1040
libavcodec/aacps.c
File diff suppressed because it is too large
Load Diff
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* MPEG-4 Parametric Stereo definitions and declarations
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_PS_H
|
||||
#define AVCODEC_PS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "get_bits.h"
|
||||
|
||||
#define PS_MAX_NUM_ENV 5
|
||||
#define PS_MAX_NR_IIDICC 34
|
||||
#define PS_MAX_NR_IPDOPD 17
|
||||
#define PS_MAX_SSB 91
|
||||
#define PS_MAX_AP_BANDS 50
|
||||
#define PS_QMF_TIME_SLOTS 32
|
||||
#define PS_MAX_DELAY 14
|
||||
#define PS_AP_LINKS 3
|
||||
#define PS_MAX_AP_DELAY 5
|
||||
|
||||
typedef struct {
|
||||
int start;
|
||||
int enable_iid;
|
||||
int iid_quant;
|
||||
int nr_iid_par;
|
||||
int nr_ipdopd_par;
|
||||
int enable_icc;
|
||||
int icc_mode;
|
||||
int nr_icc_par;
|
||||
int enable_ext;
|
||||
int frame_class;
|
||||
int num_env_old;
|
||||
int num_env;
|
||||
int enable_ipdopd;
|
||||
int border_position[PS_MAX_NUM_ENV+1];
|
||||
int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-channel Intensity Difference Parameters
|
||||
int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-Channel Coherence Parameters
|
||||
/* ipd/opd is iid/icc sized so that the same functions can handle both */
|
||||
int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Inter-channel Phase Difference Parameters
|
||||
int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; //<Overall Phase Difference Parameters
|
||||
int is34bands;
|
||||
int is34bands_old;
|
||||
|
||||
float in_buf[5][44][2];
|
||||
float delay[PS_MAX_SSB][PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2];
|
||||
float ap_delay[PS_MAX_AP_BANDS][PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2];
|
||||
float peak_decay_nrg[34];
|
||||
float power_smooth[34];
|
||||
float peak_decay_diff_smooth[34];
|
||||
float H11[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
|
||||
float H12[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
|
||||
float H21[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
|
||||
float H22[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
|
||||
int8_t opd_hist[PS_MAX_NR_IIDICC];
|
||||
int8_t ipd_hist[PS_MAX_NR_IIDICC];
|
||||
} PSContext;
|
||||
|
||||
void ff_ps_init(void);
|
||||
void ff_ps_ctx_init(PSContext *ps);
|
||||
int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, int bits_left);
|
||||
int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top);
|
||||
|
||||
#endif /* AVCODEC_PS_H */
|
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Generate a header file for hardcoded Parametric Stereo tables
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#define CONFIG_HARDCODED_TABLES 0
|
||||
#include "aacps_tablegen.h"
|
||||
#include "tableprint.h"
|
||||
|
||||
void write_float_3d_array (const void *p, int b, int c, int d)
|
||||
{
|
||||
int i;
|
||||
const float *f = p;
|
||||
for (i = 0; i < b; i++) {
|
||||
printf("{\n");
|
||||
write_float_2d_array(f, c, d);
|
||||
printf("},\n");
|
||||
f += c * d;
|
||||
}
|
||||
}
|
||||
|
||||
void write_float_4d_array (const void *p, int a, int b, int c, int d)
|
||||
{
|
||||
int i;
|
||||
const float *f = p;
|
||||
for (i = 0; i < a; i++) {
|
||||
printf("{\n");
|
||||
write_float_3d_array(f, b, c, d);
|
||||
printf("},\n");
|
||||
f += b * c * d;
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ps_tableinit();
|
||||
|
||||
write_fileheader();
|
||||
|
||||
printf("static const float pd_re_smooth[8*8*8] = {\n");
|
||||
write_float_array(pd_re_smooth, 8*8*8);
|
||||
printf("};\n");
|
||||
printf("static const float pd_im_smooth[8*8*8] = {\n");
|
||||
write_float_array(pd_im_smooth, 8*8*8);
|
||||
printf("};\n");
|
||||
|
||||
printf("static const float HA[46][8][4] = {\n");
|
||||
write_float_3d_array(HA, 46, 8, 4);
|
||||
printf("};\n");
|
||||
printf("static const float HB[46][8][4] = {\n");
|
||||
write_float_3d_array(HB, 46, 8, 4);
|
||||
printf("};\n");
|
||||
|
||||
printf("static const float f20_0_8[8][7][2] = {\n");
|
||||
write_float_3d_array(f20_0_8, 8, 7, 2);
|
||||
printf("};\n");
|
||||
printf("static const float f34_0_12[12][7][2] = {\n");
|
||||
write_float_3d_array(f34_0_12, 12, 7, 2);
|
||||
printf("};\n");
|
||||
printf("static const float f34_1_8[8][7][2] = {\n");
|
||||
write_float_3d_array(f34_1_8, 8, 7, 2);
|
||||
printf("};\n");
|
||||
printf("static const float f34_2_4[4][7][2] = {\n");
|
||||
write_float_3d_array(f34_2_4, 4, 7, 2);
|
||||
printf("};\n");
|
||||
|
||||
printf("static const float Q_fract_allpass[2][50][3][2] = {\n");
|
||||
write_float_4d_array(Q_fract_allpass, 2, 50, 3, 2);
|
||||
printf("};\n");
|
||||
printf("static const float phi_fract[2][50][2] = {\n");
|
||||
write_float_3d_array(phi_fract, 2, 50, 2);
|
||||
printf("};\n");
|
||||
|
||||
return 0;
|
||||
}
|
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
* Header file for hardcoded Parametric Stereo tables
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AACPS_TABLEGEN_H
|
||||
#define AACPS_TABLEGEN_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
#define ps_tableinit()
|
||||
#include "libavcodec/aacps_tables.h"
|
||||
#else
|
||||
#include "../libavutil/common.h"
|
||||
#include "../libavutil/mathematics.h"
|
||||
#define NR_ALLPASS_BANDS20 30
|
||||
#define NR_ALLPASS_BANDS34 50
|
||||
#define PS_AP_LINKS 3
|
||||
static float pd_re_smooth[8*8*8];
|
||||
static float pd_im_smooth[8*8*8];
|
||||
static float HA[46][8][4];
|
||||
static float HB[46][8][4];
|
||||
static float f20_0_8 [ 8][7][2];
|
||||
static float f34_0_12[12][7][2];
|
||||
static float f34_1_8 [ 8][7][2];
|
||||
static float f34_2_4 [ 4][7][2];
|
||||
static float Q_fract_allpass[2][50][3][2];
|
||||
static float phi_fract[2][50][2];
|
||||
|
||||
static const float g0_Q8[] = {
|
||||
0.00746082949812f, 0.02270420949825f, 0.04546865930473f, 0.07266113929591f,
|
||||
0.09885108575264f, 0.11793710567217f, 0.125f
|
||||
};
|
||||
|
||||
static const float g0_Q12[] = {
|
||||
0.04081179924692f, 0.03812810994926f, 0.05144908135699f, 0.06399831151592f,
|
||||
0.07428313801106f, 0.08100347892914f, 0.08333333333333f
|
||||
};
|
||||
|
||||
static const float g1_Q8[] = {
|
||||
0.01565675600122f, 0.03752716391991f, 0.05417891378782f, 0.08417044116767f,
|
||||
0.10307344158036f, 0.12222452249753f, 0.125f
|
||||
};
|
||||
|
||||
static const float g2_Q4[] = {
|
||||
-0.05908211155639f, -0.04871498374946f, 0.0f, 0.07778723915851f,
|
||||
0.16486303567403f, 0.23279856662996f, 0.25f
|
||||
};
|
||||
|
||||
static void make_filters_from_proto(float (*filter)[7][2], const float *proto, int bands)
|
||||
{
|
||||
int q, n;
|
||||
for (q = 0; q < bands; q++) {
|
||||
for (n = 0; n < 7; n++) {
|
||||
double theta = 2 * M_PI * (q + 0.5) * (n - 6) / bands;
|
||||
filter[q][n][0] = proto[n] * cos(theta);
|
||||
filter[q][n][1] = proto[n] * -sin(theta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ps_tableinit(void)
|
||||
{
|
||||
static const float ipdopd_sin[] = { 0, M_SQRT1_2, 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2 };
|
||||
static const float ipdopd_cos[] = { 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2, 0, M_SQRT1_2 };
|
||||
int pd0, pd1, pd2;
|
||||
|
||||
static const float iid_par_dequant[] = {
|
||||
//iid_par_dequant_default
|
||||
0.05623413251903, 0.12589254117942, 0.19952623149689, 0.31622776601684,
|
||||
0.44668359215096, 0.63095734448019, 0.79432823472428, 1,
|
||||
1.25892541179417, 1.58489319246111, 2.23872113856834, 3.16227766016838,
|
||||
5.01187233627272, 7.94328234724282, 17.7827941003892,
|
||||
//iid_par_dequant_fine
|
||||
0.00316227766017, 0.00562341325190, 0.01, 0.01778279410039,
|
||||
0.03162277660168, 0.05623413251903, 0.07943282347243, 0.11220184543020,
|
||||
0.15848931924611, 0.22387211385683, 0.31622776601684, 0.39810717055350,
|
||||
0.50118723362727, 0.63095734448019, 0.79432823472428, 1,
|
||||
1.25892541179417, 1.58489319246111, 1.99526231496888, 2.51188643150958,
|
||||
3.16227766016838, 4.46683592150963, 6.30957344480193, 8.91250938133745,
|
||||
12.5892541179417, 17.7827941003892, 31.6227766016838, 56.2341325190349,
|
||||
100, 177.827941003892, 316.227766016837,
|
||||
};
|
||||
static const float icc_invq[] = {
|
||||
1, 0.937, 0.84118, 0.60092, 0.36764, 0, -0.589, -1
|
||||
};
|
||||
static const float acos_icc_invq[] = {
|
||||
0, 0.35685527, 0.57133466, 0.92614472, 1.1943263, M_PI/2, 2.2006171, M_PI
|
||||
};
|
||||
int iid, icc;
|
||||
|
||||
int k, m;
|
||||
static const int8_t f_center_20[] = {
|
||||
-3, -1, 1, 3, 5, 7, 10, 14, 18, 22,
|
||||
};
|
||||
static const int8_t f_center_34[] = {
|
||||
2, 6, 10, 14, 18, 22, 26, 30,
|
||||
34,-10, -6, -2, 51, 57, 15, 21,
|
||||
27, 33, 39, 45, 54, 66, 78, 42,
|
||||
102, 66, 78, 90,102,114,126, 90,
|
||||
};
|
||||
static const float fractional_delay_links[] = { 0.43f, 0.75f, 0.347f };
|
||||
const float fractional_delay_gain = 0.39f;
|
||||
|
||||
for (pd0 = 0; pd0 < 8; pd0++) {
|
||||
float pd0_re = ipdopd_cos[pd0];
|
||||
float pd0_im = ipdopd_sin[pd0];
|
||||
for (pd1 = 0; pd1 < 8; pd1++) {
|
||||
float pd1_re = ipdopd_cos[pd1];
|
||||
float pd1_im = ipdopd_sin[pd1];
|
||||
for (pd2 = 0; pd2 < 8; pd2++) {
|
||||
float pd2_re = ipdopd_cos[pd2];
|
||||
float pd2_im = ipdopd_sin[pd2];
|
||||
float re_smooth = 0.25f * pd0_re + 0.5f * pd1_re + pd2_re;
|
||||
float im_smooth = 0.25f * pd0_im + 0.5f * pd1_im + pd2_im;
|
||||
float pd_mag = 1 / sqrt(im_smooth * im_smooth + re_smooth * re_smooth);
|
||||
pd_re_smooth[pd0*64+pd1*8+pd2] = re_smooth * pd_mag;
|
||||
pd_im_smooth[pd0*64+pd1*8+pd2] = im_smooth * pd_mag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (iid = 0; iid < 46; iid++) {
|
||||
float c = iid_par_dequant[iid]; //<Linear Inter-channel Intensity Difference
|
||||
float c1 = (float)M_SQRT2 / sqrtf(1.0f + c*c);
|
||||
float c2 = c * c1;
|
||||
for (icc = 0; icc < 8; icc++) {
|
||||
/*if (PS_BASELINE || ps->icc_mode < 3)*/ {
|
||||
float alpha = 0.5f * acos_icc_invq[icc];
|
||||
float beta = alpha * (c1 - c2) * (float)M_SQRT1_2;
|
||||
HA[iid][icc][0] = c2 * cosf(beta + alpha);
|
||||
HA[iid][icc][1] = c1 * cosf(beta - alpha);
|
||||
HA[iid][icc][2] = c2 * sinf(beta + alpha);
|
||||
HA[iid][icc][3] = c1 * sinf(beta - alpha);
|
||||
} /* else */ {
|
||||
float alpha, gamma, mu, rho;
|
||||
float alpha_c, alpha_s, gamma_c, gamma_s;
|
||||
rho = FFMAX(icc_invq[icc], 0.05f);
|
||||
alpha = 0.5f * atan2f(2.0f * c * rho, c*c - 1.0f);
|
||||
mu = c + 1.0f / c;
|
||||
mu = sqrtf(1 + (4 * rho * rho - 4)/(mu * mu));
|
||||
gamma = atanf(sqrtf((1.0f - mu)/(1.0f + mu)));
|
||||
if (alpha < 0) alpha += M_PI/2;
|
||||
alpha_c = cosf(alpha);
|
||||
alpha_s = sinf(alpha);
|
||||
gamma_c = cosf(gamma);
|
||||
gamma_s = sinf(gamma);
|
||||
HB[iid][icc][0] = M_SQRT2 * alpha_c * gamma_c;
|
||||
HB[iid][icc][1] = M_SQRT2 * alpha_s * gamma_c;
|
||||
HB[iid][icc][2] = -M_SQRT2 * alpha_s * gamma_s;
|
||||
HB[iid][icc][3] = M_SQRT2 * alpha_c * gamma_s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (k = 0; k < NR_ALLPASS_BANDS20; k++) {
|
||||
double f_center, theta;
|
||||
if (k < FF_ARRAY_ELEMS(f_center_20))
|
||||
f_center = f_center_20[k] * 0.125;
|
||||
else
|
||||
f_center = k - 6.5f;
|
||||
for (m = 0; m < PS_AP_LINKS; m++) {
|
||||
theta = -M_PI * fractional_delay_links[m] * f_center;
|
||||
Q_fract_allpass[0][k][m][0] = cos(theta);
|
||||
Q_fract_allpass[0][k][m][1] = sin(theta);
|
||||
}
|
||||
theta = -M_PI*fractional_delay_gain*f_center;
|
||||
phi_fract[0][k][0] = cos(theta);
|
||||
phi_fract[0][k][1] = sin(theta);
|
||||
}
|
||||
for (k = 0; k < NR_ALLPASS_BANDS34; k++) {
|
||||
double f_center, theta;
|
||||
if (k < FF_ARRAY_ELEMS(f_center_34))
|
||||
f_center = f_center_34[k] / 24.;
|
||||
else
|
||||
f_center = k - 26.5f;
|
||||
for (m = 0; m < PS_AP_LINKS; m++) {
|
||||
theta = -M_PI * fractional_delay_links[m] * f_center;
|
||||
Q_fract_allpass[1][k][m][0] = cos(theta);
|
||||
Q_fract_allpass[1][k][m][1] = sin(theta);
|
||||
}
|
||||
theta = -M_PI*fractional_delay_gain*f_center;
|
||||
phi_fract[1][k][0] = cos(theta);
|
||||
phi_fract[1][k][1] = sin(theta);
|
||||
}
|
||||
|
||||
make_filters_from_proto(f20_0_8, g0_Q8, 8);
|
||||
make_filters_from_proto(f34_0_12, g0_Q12, 12);
|
||||
make_filters_from_proto(f34_1_8, g1_Q8, 8);
|
||||
make_filters_from_proto(f34_2_4, g2_Q4, 4);
|
||||
}
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
#endif /* AACPS_TABLEGEN_H */
|
@@ -1,163 +0,0 @@
|
||||
/*
|
||||
* MPEG-4 Parametric Stereo data tables
|
||||
* 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
|
||||
*/
|
||||
|
||||
static const uint8_t huff_iid_df1_bits[] = {
|
||||
18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 18, 17, 17, 16, 16, 15, 14, 14,
|
||||
13, 12, 12, 11, 10, 10, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 6, 7,
|
||||
8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 17, 18, 18,
|
||||
18, 18, 18, 18, 18, 18, 18,
|
||||
};
|
||||
|
||||
static const uint32_t huff_iid_df1_codes[] = {
|
||||
0x01FEB4, 0x01FEB5, 0x01FD76, 0x01FD77, 0x01FD74, 0x01FD75, 0x01FE8A,
|
||||
0x01FE8B, 0x01FE88, 0x00FE80, 0x01FEB6, 0x00FE82, 0x00FEB8, 0x007F42,
|
||||
0x007FAE, 0x003FAF, 0x001FD1, 0x001FE9, 0x000FE9, 0x0007EA, 0x0007FB,
|
||||
0x0003FB, 0x0001FB, 0x0001FF, 0x00007C, 0x00003C, 0x00001C, 0x00000C,
|
||||
0x000000, 0x000001, 0x000001, 0x000002, 0x000001, 0x00000D, 0x00001D,
|
||||
0x00003D, 0x00007D, 0x0000FC, 0x0001FC, 0x0003FC, 0x0003F4, 0x0007EB,
|
||||
0x000FEA, 0x001FEA, 0x001FD6, 0x003FD0, 0x007FAF, 0x007F43, 0x00FEB9,
|
||||
0x00FE83, 0x01FEB7, 0x00FE81, 0x01FE89, 0x01FE8E, 0x01FE8F, 0x01FE8C,
|
||||
0x01FE8D, 0x01FEB2, 0x01FEB3, 0x01FEB0, 0x01FEB1,
|
||||
};
|
||||
|
||||
static const uint8_t huff_iid_dt1_bits[] = {
|
||||
16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 13,
|
||||
13, 13, 12, 12, 11, 10, 9, 9, 7, 6, 5, 3, 1, 2, 5, 6, 7, 8,
|
||||
9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16,
|
||||
};
|
||||
|
||||
static const uint16_t huff_iid_dt1_codes[] = {
|
||||
0x004ED4, 0x004ED5, 0x004ECE, 0x004ECF, 0x004ECC, 0x004ED6, 0x004ED8,
|
||||
0x004F46, 0x004F60, 0x002718, 0x002719, 0x002764, 0x002765, 0x00276D,
|
||||
0x0027B1, 0x0013B7, 0x0013D6, 0x0009C7, 0x0009E9, 0x0009ED, 0x0004EE,
|
||||
0x0004F7, 0x000278, 0x000139, 0x00009A, 0x00009F, 0x000020, 0x000011,
|
||||
0x00000A, 0x000003, 0x000001, 0x000000, 0x00000B, 0x000012, 0x000021,
|
||||
0x00004C, 0x00009B, 0x00013A, 0x000279, 0x000270, 0x0004EF, 0x0004E2,
|
||||
0x0009EA, 0x0009D8, 0x0013D7, 0x0013D0, 0x0027B2, 0x0027A2, 0x00271A,
|
||||
0x00271B, 0x004F66, 0x004F67, 0x004F61, 0x004F47, 0x004ED9, 0x004ED7,
|
||||
0x004ECD, 0x004ED2, 0x004ED3, 0x004ED0, 0x004ED1,
|
||||
};
|
||||
|
||||
static const uint8_t huff_iid_df0_bits[] = {
|
||||
17, 17, 17, 17, 16, 15, 13, 10, 9, 7, 6, 5, 4, 3, 1, 3, 4, 5,
|
||||
6, 6, 8, 11, 13, 14, 14, 15, 17, 18, 18,
|
||||
};
|
||||
|
||||
static const uint32_t huff_iid_df0_codes[] = {
|
||||
0x01FFFB, 0x01FFFC, 0x01FFFD, 0x01FFFA, 0x00FFFC, 0x007FFC, 0x001FFD,
|
||||
0x0003FE, 0x0001FE, 0x00007E, 0x00003C, 0x00001D, 0x00000D, 0x000005,
|
||||
0x000000, 0x000004, 0x00000C, 0x00001C, 0x00003D, 0x00003E, 0x0000FE,
|
||||
0x0007FE, 0x001FFC, 0x003FFC, 0x003FFD, 0x007FFD, 0x01FFFE, 0x03FFFE,
|
||||
0x03FFFF,
|
||||
};
|
||||
|
||||
static const uint8_t huff_iid_dt0_bits[] = {
|
||||
19, 19, 19, 20, 20, 20, 17, 15, 12, 10, 8, 6, 4, 2, 1, 3, 5, 7,
|
||||
9, 11, 13, 14, 17, 19, 20, 20, 20, 20, 20,
|
||||
};
|
||||
|
||||
static const uint32_t huff_iid_dt0_codes[] = {
|
||||
0x07FFF9, 0x07FFFA, 0x07FFFB, 0x0FFFF8, 0x0FFFF9, 0x0FFFFA, 0x01FFFD,
|
||||
0x007FFE, 0x000FFE, 0x0003FE, 0x0000FE, 0x00003E, 0x00000E, 0x000002,
|
||||
0x000000, 0x000006, 0x00001E, 0x00007E, 0x0001FE, 0x0007FE, 0x001FFE,
|
||||
0x003FFE, 0x01FFFC, 0x07FFF8, 0x0FFFFB, 0x0FFFFC, 0x0FFFFD, 0x0FFFFE,
|
||||
0x0FFFFF,
|
||||
};
|
||||
|
||||
static const uint8_t huff_icc_df_bits[] = {
|
||||
14, 14, 12, 10, 7, 5, 3, 1, 2, 4, 6, 8, 9, 11, 13,
|
||||
};
|
||||
|
||||
static const uint16_t huff_icc_df_codes[] = {
|
||||
0x3FFF, 0x3FFE, 0x0FFE, 0x03FE, 0x007E, 0x001E, 0x0006, 0x0000,
|
||||
0x0002, 0x000E, 0x003E, 0x00FE, 0x01FE, 0x07FE, 0x1FFE,
|
||||
};
|
||||
|
||||
static const uint8_t huff_icc_dt_bits[] = {
|
||||
14, 13, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12, 14,
|
||||
};
|
||||
|
||||
static const uint16_t huff_icc_dt_codes[] = {
|
||||
0x3FFE, 0x1FFE, 0x07FE, 0x01FE, 0x007E, 0x001E, 0x0006, 0x0000,
|
||||
0x0002, 0x000E, 0x003E, 0x00FE, 0x03FE, 0x0FFE, 0x3FFF,
|
||||
};
|
||||
|
||||
static const uint8_t huff_ipd_df_bits[] = {
|
||||
1, 3, 4, 4, 4, 4, 4, 4,
|
||||
};
|
||||
|
||||
static const uint8_t huff_ipd_df_codes[] = {
|
||||
0x01, 0x00, 0x06, 0x04, 0x02, 0x03, 0x05, 0x07,
|
||||
};
|
||||
|
||||
static const uint8_t huff_ipd_dt_bits[] = {
|
||||
1, 3, 4, 5, 5, 4, 4, 3,
|
||||
};
|
||||
|
||||
static const uint8_t huff_ipd_dt_codes[] = {
|
||||
0x01, 0x02, 0x02, 0x03, 0x02, 0x00, 0x03, 0x03,
|
||||
};
|
||||
|
||||
static const uint8_t huff_opd_df_bits[] = {
|
||||
1, 3, 4, 4, 5, 5, 4, 3,
|
||||
};
|
||||
|
||||
static const uint8_t huff_opd_df_codes[] = {
|
||||
0x01, 0x01, 0x06, 0x04, 0x0F, 0x0E, 0x05, 0x00,
|
||||
};
|
||||
|
||||
static const uint8_t huff_opd_dt_bits[] = {
|
||||
1, 3, 4, 5, 5, 4, 4, 3,
|
||||
};
|
||||
|
||||
static const uint8_t huff_opd_dt_codes[] = {
|
||||
0x01, 0x02, 0x01, 0x07, 0x06, 0x00, 0x02, 0x03,
|
||||
};
|
||||
|
||||
static const int8_t huff_offset[] = {
|
||||
30, 30,
|
||||
14, 14,
|
||||
7, 7,
|
||||
0, 0,
|
||||
0, 0,
|
||||
};
|
||||
|
||||
///Table 8.48
|
||||
static const int8_t k_to_i_20[] = {
|
||||
1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15,
|
||||
15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 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, 19
|
||||
};
|
||||
///Table 8.49
|
||||
static const int8_t k_to_i_34[] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 6, 7, 2, 1, 0, 10, 10, 4, 5, 6, 7, 8,
|
||||
9, 10, 11, 12, 9, 14, 11, 12, 13, 14, 15, 16, 13, 16, 17, 18, 19, 20, 21,
|
||||
22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29,
|
||||
30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33,
|
||||
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33
|
||||
};
|
||||
|
||||
static const float g1_Q2[] = {
|
||||
0.0f, 0.01899487526049f, 0.0f, -0.07293139167538f,
|
||||
0.0f, 0.30596630545168f, 0.5f
|
||||
};
|
@@ -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,
|
||||
};
|
||||
|
1772
libavcodec/aacsbr.c
1772
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 )
|
||||
@@ -29,12 +29,11 @@
|
||||
|
||||
#include "libavutil/mem.h"
|
||||
#include "aac.h"
|
||||
#include "aac_tablegen.h"
|
||||
|
||||
#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
|
||||
@@ -410,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,
|
||||
@@ -494,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,
|
||||
@@ -578,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,
|
||||
@@ -622,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,
|
||||
@@ -657,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,
|
||||
@@ -745,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,
|
||||
@@ -900,308 +899,127 @@ const float * const ff_aac_codebook_vectors[] = {
|
||||
codebook_vector8, codebook_vector10,
|
||||
};
|
||||
|
||||
static const float codebook_vector0_vals[] = {
|
||||
-1.0000000, 0.0000000, 1.0000000
|
||||
};
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
|
||||
/*
|
||||
* 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
|
||||
/**
|
||||
* Table of pow(2, (i - 200)/4.) used for different purposes depending on the
|
||||
* range of indices to the table:
|
||||
* [ 0, 255] scale factor decoding when using C dsp.float_to_int16
|
||||
* [60, 315] scale factor decoding when using SIMD dsp.float_to_int16
|
||||
* [45, 300] intensity stereo position decoding mapped in reverse order i.e. 0->300, 1->299, ..., 254->46, 255->45
|
||||
*/
|
||||
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,
|
||||
const float ff_aac_pow2sf_tab[428] = {
|
||||
8.88178420e-16, 1.05622810e-15, 1.25607397e-15, 1.49373210e-15,
|
||||
1.77635684e-15, 2.11245619e-15, 2.51214793e-15, 2.98746420e-15,
|
||||
3.55271368e-15, 4.22491238e-15, 5.02429587e-15, 5.97492839e-15,
|
||||
7.10542736e-15, 8.44982477e-15, 1.00485917e-14, 1.19498568e-14,
|
||||
1.42108547e-14, 1.68996495e-14, 2.00971835e-14, 2.38997136e-14,
|
||||
2.84217094e-14, 3.37992991e-14, 4.01943669e-14, 4.77994272e-14,
|
||||
5.68434189e-14, 6.75985982e-14, 8.03887339e-14, 9.55988543e-14,
|
||||
1.13686838e-13, 1.35197196e-13, 1.60777468e-13, 1.91197709e-13,
|
||||
2.27373675e-13, 2.70394393e-13, 3.21554936e-13, 3.82395417e-13,
|
||||
4.54747351e-13, 5.40788785e-13, 6.43109871e-13, 7.64790834e-13,
|
||||
9.09494702e-13, 1.08157757e-12, 1.28621974e-12, 1.52958167e-12,
|
||||
1.81898940e-12, 2.16315514e-12, 2.57243948e-12, 3.05916334e-12,
|
||||
3.63797881e-12, 4.32631028e-12, 5.14487897e-12, 6.11832668e-12,
|
||||
7.27595761e-12, 8.65262056e-12, 1.02897579e-11, 1.22366534e-11,
|
||||
1.45519152e-11, 1.73052411e-11, 2.05795159e-11, 2.44733067e-11,
|
||||
2.91038305e-11, 3.46104823e-11, 4.11590317e-11, 4.89466134e-11,
|
||||
5.82076609e-11, 6.92209645e-11, 8.23180635e-11, 9.78932268e-11,
|
||||
1.16415322e-10, 1.38441929e-10, 1.64636127e-10, 1.95786454e-10,
|
||||
2.32830644e-10, 2.76883858e-10, 3.29272254e-10, 3.91572907e-10,
|
||||
4.65661287e-10, 5.53767716e-10, 6.58544508e-10, 7.83145814e-10,
|
||||
9.31322575e-10, 1.10753543e-09, 1.31708902e-09, 1.56629163e-09,
|
||||
1.86264515e-09, 2.21507086e-09, 2.63417803e-09, 3.13258326e-09,
|
||||
3.72529030e-09, 4.43014173e-09, 5.26835606e-09, 6.26516652e-09,
|
||||
7.45058060e-09, 8.86028346e-09, 1.05367121e-08, 1.25303330e-08,
|
||||
1.49011612e-08, 1.77205669e-08, 2.10734243e-08, 2.50606661e-08,
|
||||
2.98023224e-08, 3.54411338e-08, 4.21468485e-08, 5.01213321e-08,
|
||||
5.96046448e-08, 7.08822677e-08, 8.42936970e-08, 1.00242664e-07,
|
||||
1.19209290e-07, 1.41764535e-07, 1.68587394e-07, 2.00485328e-07,
|
||||
2.38418579e-07, 2.83529071e-07, 3.37174788e-07, 4.00970657e-07,
|
||||
4.76837158e-07, 5.67058141e-07, 6.74349576e-07, 8.01941314e-07,
|
||||
9.53674316e-07, 1.13411628e-06, 1.34869915e-06, 1.60388263e-06,
|
||||
1.90734863e-06, 2.26823256e-06, 2.69739830e-06, 3.20776526e-06,
|
||||
3.81469727e-06, 4.53646513e-06, 5.39479661e-06, 6.41553051e-06,
|
||||
7.62939453e-06, 9.07293026e-06, 1.07895932e-05, 1.28310610e-05,
|
||||
1.52587891e-05, 1.81458605e-05, 2.15791864e-05, 2.56621220e-05,
|
||||
3.05175781e-05, 3.62917210e-05, 4.31583729e-05, 5.13242441e-05,
|
||||
6.10351562e-05, 7.25834421e-05, 8.63167458e-05, 1.02648488e-04,
|
||||
1.22070312e-04, 1.45166884e-04, 1.72633492e-04, 2.05296976e-04,
|
||||
2.44140625e-04, 2.90333768e-04, 3.45266983e-04, 4.10593953e-04,
|
||||
4.88281250e-04, 5.80667537e-04, 6.90533966e-04, 8.21187906e-04,
|
||||
9.76562500e-04, 1.16133507e-03, 1.38106793e-03, 1.64237581e-03,
|
||||
1.95312500e-03, 2.32267015e-03, 2.76213586e-03, 3.28475162e-03,
|
||||
3.90625000e-03, 4.64534029e-03, 5.52427173e-03, 6.56950324e-03,
|
||||
7.81250000e-03, 9.29068059e-03, 1.10485435e-02, 1.31390065e-02,
|
||||
1.56250000e-02, 1.85813612e-02, 2.20970869e-02, 2.62780130e-02,
|
||||
3.12500000e-02, 3.71627223e-02, 4.41941738e-02, 5.25560260e-02,
|
||||
6.25000000e-02, 7.43254447e-02, 8.83883476e-02, 1.05112052e-01,
|
||||
1.25000000e-01, 1.48650889e-01, 1.76776695e-01, 2.10224104e-01,
|
||||
2.50000000e-01, 2.97301779e-01, 3.53553391e-01, 4.20448208e-01,
|
||||
5.00000000e-01, 5.94603558e-01, 7.07106781e-01, 8.40896415e-01,
|
||||
1.00000000e+00, 1.18920712e+00, 1.41421356e+00, 1.68179283e+00,
|
||||
2.00000000e+00, 2.37841423e+00, 2.82842712e+00, 3.36358566e+00,
|
||||
4.00000000e+00, 4.75682846e+00, 5.65685425e+00, 6.72717132e+00,
|
||||
8.00000000e+00, 9.51365692e+00, 1.13137085e+01, 1.34543426e+01,
|
||||
1.60000000e+01, 1.90273138e+01, 2.26274170e+01, 2.69086853e+01,
|
||||
3.20000000e+01, 3.80546277e+01, 4.52548340e+01, 5.38173706e+01,
|
||||
6.40000000e+01, 7.61092554e+01, 9.05096680e+01, 1.07634741e+02,
|
||||
1.28000000e+02, 1.52218511e+02, 1.81019336e+02, 2.15269482e+02,
|
||||
2.56000000e+02, 3.04437021e+02, 3.62038672e+02, 4.30538965e+02,
|
||||
5.12000000e+02, 6.08874043e+02, 7.24077344e+02, 8.61077929e+02,
|
||||
1.02400000e+03, 1.21774809e+03, 1.44815469e+03, 1.72215586e+03,
|
||||
2.04800000e+03, 2.43549617e+03, 2.89630938e+03, 3.44431172e+03,
|
||||
4.09600000e+03, 4.87099234e+03, 5.79261875e+03, 6.88862343e+03,
|
||||
8.19200000e+03, 9.74198469e+03, 1.15852375e+04, 1.37772469e+04,
|
||||
1.63840000e+04, 1.94839694e+04, 2.31704750e+04, 2.75544937e+04,
|
||||
3.27680000e+04, 3.89679387e+04, 4.63409500e+04, 5.51089875e+04,
|
||||
6.55360000e+04, 7.79358775e+04, 9.26819000e+04, 1.10217975e+05,
|
||||
1.31072000e+05, 1.55871755e+05, 1.85363800e+05, 2.20435950e+05,
|
||||
2.62144000e+05, 3.11743510e+05, 3.70727600e+05, 4.40871900e+05,
|
||||
5.24288000e+05, 6.23487020e+05, 7.41455200e+05, 8.81743800e+05,
|
||||
1.04857600e+06, 1.24697404e+06, 1.48291040e+06, 1.76348760e+06,
|
||||
2.09715200e+06, 2.49394808e+06, 2.96582080e+06, 3.52697520e+06,
|
||||
4.19430400e+06, 4.98789616e+06, 5.93164160e+06, 7.05395040e+06,
|
||||
8.38860800e+06, 9.97579232e+06, 1.18632832e+07, 1.41079008e+07,
|
||||
1.67772160e+07, 1.99515846e+07, 2.37265664e+07, 2.82158016e+07,
|
||||
3.35544320e+07, 3.99031693e+07, 4.74531328e+07, 5.64316032e+07,
|
||||
6.71088640e+07, 7.98063385e+07, 9.49062656e+07, 1.12863206e+08,
|
||||
1.34217728e+08, 1.59612677e+08, 1.89812531e+08, 2.25726413e+08,
|
||||
2.68435456e+08, 3.19225354e+08, 3.79625062e+08, 4.51452825e+08,
|
||||
5.36870912e+08, 6.38450708e+08, 7.59250125e+08, 9.02905651e+08,
|
||||
1.07374182e+09, 1.27690142e+09, 1.51850025e+09, 1.80581130e+09,
|
||||
2.14748365e+09, 2.55380283e+09, 3.03700050e+09, 3.61162260e+09,
|
||||
4.29496730e+09, 5.10760567e+09, 6.07400100e+09, 7.22324521e+09,
|
||||
8.58993459e+09, 1.02152113e+10, 1.21480020e+10, 1.44464904e+10,
|
||||
1.71798692e+10, 2.04304227e+10, 2.42960040e+10, 2.88929808e+10,
|
||||
3.43597384e+10, 4.08608453e+10, 4.85920080e+10, 5.77859616e+10,
|
||||
6.87194767e+10, 8.17216907e+10, 9.71840160e+10, 1.15571923e+11,
|
||||
1.37438953e+11, 1.63443381e+11, 1.94368032e+11, 2.31143847e+11,
|
||||
2.74877907e+11, 3.26886763e+11, 3.88736064e+11, 4.62287693e+11,
|
||||
5.49755814e+11, 6.53773525e+11, 7.77472128e+11, 9.24575386e+11,
|
||||
1.09951163e+12, 1.30754705e+12, 1.55494426e+12, 1.84915077e+12,
|
||||
2.19902326e+12, 2.61509410e+12, 3.10988851e+12, 3.69830155e+12,
|
||||
4.39804651e+12, 5.23018820e+12, 6.21977702e+12, 7.39660309e+12,
|
||||
8.79609302e+12, 1.04603764e+13, 1.24395540e+13, 1.47932062e+13,
|
||||
1.75921860e+13, 2.09207528e+13, 2.48791081e+13, 2.95864124e+13,
|
||||
3.51843721e+13, 4.18415056e+13, 4.97582162e+13, 5.91728247e+13,
|
||||
7.03687442e+13, 8.36830112e+13, 9.95164324e+13, 1.18345649e+14,
|
||||
1.40737488e+14, 1.67366022e+14, 1.99032865e+14, 2.36691299e+14,
|
||||
2.81474977e+14, 3.34732045e+14, 3.98065730e+14, 4.73382598e+14,
|
||||
5.62949953e+14, 6.69464090e+14, 7.96131459e+14, 9.46765196e+14,
|
||||
1.12589991e+15, 1.33892818e+15, 1.59226292e+15, 1.89353039e+15,
|
||||
2.25179981e+15, 2.67785636e+15, 3.18452584e+15, 3.78706078e+15,
|
||||
4.50359963e+15, 5.35571272e+15, 6.36905167e+15, 7.57412156e+15,
|
||||
9.00719925e+15, 1.07114254e+16, 1.27381033e+16, 1.51482431e+16,
|
||||
1.80143985e+16, 2.14228509e+16, 2.54762067e+16, 3.02964863e+16,
|
||||
3.60287970e+16, 4.28457018e+16, 5.09524134e+16, 6.05929725e+16,
|
||||
7.20575940e+16, 8.56914035e+16, 1.01904827e+17, 1.21185945e+17,
|
||||
};
|
||||
|
||||
static const float codebook_vector4_vals[] = {
|
||||
-6.3496042, -4.3267487,
|
||||
-2.5198421, -1.0000000,
|
||||
0.0000000, 1.0000000,
|
||||
2.5198421, 4.3267487,
|
||||
6.3496042,
|
||||
};
|
||||
#else
|
||||
|
||||
/*
|
||||
* 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,
|
||||
};
|
||||
float ff_aac_pow2sf_tab[428];
|
||||
|
||||
/*
|
||||
* 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
|
||||
};
|
||||
// @}
|
||||
#endif /* 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 )
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "libavutil/mem.h"
|
||||
#include "aac.h"
|
||||
#include "aac_tablegen_decl.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -44,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
|
||||
@@ -65,13 +64,11 @@ 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];
|
||||
#else
|
||||
extern float ff_aac_pow2sf_tab[428];
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
#endif /* AVCODEC_AACTAB_H */
|
||||
|
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @file libavcodec/aandcttab.c
|
||||
* AAN (Arai Agui Aakajima) (I)DCT tables
|
||||
*/
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user