Compare commits
354 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
192d1d34eb | ||
|
|
14644e3322 | ||
|
|
c1fb94fcac | ||
|
|
2852aa5084 | ||
|
|
9db961861a | ||
|
|
fd53f6745e | ||
|
|
4bc84f4f7d | ||
|
|
662accb728 | ||
|
|
4667920455 | ||
|
|
1cf238d3bf | ||
|
|
cb3a59ca82 | ||
|
|
25b5331a1d | ||
|
|
525a8ee3d8 | ||
|
|
9bea771035 | ||
|
|
4abd0e1282 | ||
|
|
fd674648a2 | ||
|
|
31e169948d | ||
|
|
cb1111b04a | ||
|
|
067b2c0c28 | ||
|
|
8681622d7b | ||
|
|
3679bda78b | ||
|
|
affedbd027 | ||
|
|
d7fbabaeb5 | ||
|
|
9511cfe07f | ||
|
|
5f14ba4776 | ||
|
|
bc17113954 | ||
|
|
ddb35d510e | ||
|
|
846c61789c | ||
|
|
01f5442b82 | ||
|
|
090d10ce60 | ||
|
|
7a1b6aa6ac | ||
|
|
19691eb4d5 | ||
|
|
ef722f7692 | ||
|
|
3c0fcc7779 | ||
|
|
60605ffa5c | ||
|
|
075b337798 | ||
|
|
747245ce0e | ||
|
|
1f88bbc9f2 | ||
|
|
d6cc432751 | ||
|
|
d39a058707 | ||
|
|
96e1ca6e05 | ||
|
|
50ed50a03b | ||
|
|
6bb2004c82 | ||
|
|
7bf4d235c0 | ||
|
|
3bd30882b1 | ||
|
|
573cfcc52b | ||
|
|
fe04b47cea | ||
|
|
3292f6c6be | ||
|
|
c98cecea59 | ||
|
|
d808a43e29 | ||
|
|
079db0014b | ||
|
|
7ee5d5bf66 | ||
|
|
e0f9f52938 | ||
|
|
3266d05538 | ||
|
|
b02b306f73 | ||
|
|
5f8e1a014f | ||
|
|
f21ef41c14 | ||
|
|
31240bb703 | ||
|
|
8c1c43c6c1 | ||
|
|
10fb811c0d | ||
|
|
1aeef9979d | ||
|
|
4cd8ae5b9c | ||
|
|
0ae9a8cdbb | ||
|
|
b56388541b | ||
|
|
f0bd54aaa7 | ||
|
|
3a6ef19263 | ||
|
|
afd3574959 | ||
|
|
f75b377857 | ||
|
|
96ccd5665c | ||
|
|
9eecca08e7 | ||
|
|
074d7c2f8d | ||
|
|
3c53cdb1ad | ||
|
|
1c531e7d76 | ||
|
|
d79972badd | ||
|
|
b0c18a836a | ||
|
|
e57cb9429a | ||
|
|
3a91eb37c4 | ||
|
|
1c24ab39b6 | ||
|
|
922837561b | ||
|
|
f3c4718f1b | ||
|
|
88d97044cb | ||
|
|
9cf2764389 | ||
|
|
62dae886b6 | ||
|
|
651e9773ed | ||
|
|
61fd1484c4 | ||
|
|
0c6d17ae87 | ||
|
|
c599f7ed76 | ||
|
|
556bb822a0 | ||
|
|
d32058276c | ||
|
|
571c66659d | ||
|
|
3613a0df40 | ||
|
|
58226980a6 | ||
|
|
b8425d0e26 | ||
|
|
72c9dab15d | ||
|
|
f9738b2af3 | ||
|
|
a06c0fadc8 | ||
|
|
c609312a47 | ||
|
|
1c1b94aaae | ||
|
|
f348a0bc3c | ||
|
|
e634dc98b2 | ||
|
|
59a2b67c79 | ||
|
|
5cf9d6c586 | ||
|
|
63162b9f97 | ||
|
|
267ee47529 | ||
|
|
f3a90da0b5 | ||
|
|
b55ec3f327 | ||
|
|
6be30c4f8e | ||
|
|
8f71cd980c | ||
|
|
99243eea7b | ||
|
|
87e8bfeb90 | ||
|
|
28ddc0b9b8 | ||
|
|
f66e52fd96 | ||
|
|
3a9432ec64 | ||
|
|
4006aecd19 | ||
|
|
2eddfd7cfd | ||
|
|
59479f474f | ||
|
|
f2457bd115 | ||
|
|
a93c1d1e83 | ||
|
|
d3d4ba2dbe | ||
|
|
f75c931238 | ||
|
|
a3e5542744 | ||
|
|
7755265387 | ||
|
|
6496bfcc65 | ||
|
|
36ba4471d4 | ||
|
|
64c2abf53f | ||
|
|
81672bf00f | ||
|
|
b97aaf791f | ||
|
|
b786eed33a | ||
|
|
21d514a67a | ||
|
|
f20ca5d729 | ||
|
|
e34028dd81 | ||
|
|
3a46c84945 | ||
|
|
f725378bff | ||
|
|
70ef5ce67e | ||
|
|
0259532a6e | ||
|
|
3f919ef19c | ||
|
|
90e449a690 | ||
|
|
030884f6a6 | ||
|
|
d9259e05c2 | ||
|
|
3410c67da1 | ||
|
|
b07290fa84 | ||
|
|
ee7d2ea4f6 | ||
|
|
a4c6ba7ea7 | ||
|
|
f6c9c455b6 | ||
|
|
50a81bd978 | ||
|
|
22a784c6db | ||
|
|
ae1b3038d0 | ||
|
|
7bd58702f9 | ||
|
|
71f3bb58df | ||
|
|
fb8e3a5b44 | ||
|
|
da773624b6 | ||
|
|
292c492271 | ||
|
|
44b48d6acb | ||
|
|
9cb50bb3cc | ||
|
|
3a82e564cc | ||
|
|
ed47b3d429 | ||
|
|
9c3ae17cc1 | ||
|
|
3a40d5ab2f | ||
|
|
6f2723e54b | ||
|
|
37e1cc6186 | ||
|
|
101244dad9 | ||
|
|
4d0bd531f4 | ||
|
|
8323e0dc73 | ||
|
|
321d838098 | ||
|
|
f5f0e11378 | ||
|
|
838b359225 | ||
|
|
2e527ed7b1 | ||
|
|
e59b387e0a | ||
|
|
32a9a34f86 | ||
|
|
d4602f21da | ||
|
|
519532549f | ||
|
|
c9754099e5 | ||
|
|
3d60a87a5b | ||
|
|
53f38b7b82 | ||
|
|
447a67589b | ||
|
|
9e58eb10ba | ||
|
|
962b0345a5 | ||
|
|
6e6f0027fd | ||
|
|
1493a952ed | ||
|
|
c0f315b835 | ||
|
|
026f243d71 | ||
|
|
331b5ac3c9 | ||
|
|
c3fb2bd9aa | ||
|
|
6271b13be6 | ||
|
|
0373a4ce53 | ||
|
|
e08778c3ea | ||
|
|
8eb6296172 | ||
|
|
c7d53daf9a | ||
|
|
1beae222db | ||
|
|
0147b74205 | ||
|
|
daa398e80e | ||
|
|
dc2bae1b3b | ||
|
|
0bf92a41c3 | ||
|
|
28aafef295 | ||
|
|
75cd59ec21 | ||
|
|
f72580eb0f | ||
|
|
69e32fd0b1 | ||
|
|
372f9254c3 | ||
|
|
8ae4a2915a | ||
|
|
9b81e32f01 | ||
|
|
315362028e | ||
|
|
da988851dc | ||
|
|
4f9200a963 | ||
|
|
bc09450e29 | ||
|
|
38fde9e95f | ||
|
|
6789b3c2c3 | ||
|
|
2e260c2271 | ||
|
|
58e6635324 | ||
|
|
83e85e9798 | ||
|
|
48659851e2 | ||
|
|
69be8cc6e0 | ||
|
|
48ae235848 | ||
|
|
2f89f24eb9 | ||
|
|
d3fef1a3bd | ||
|
|
69abae318a | ||
|
|
0493699813 | ||
|
|
2722fc2bcf | ||
|
|
40123639fe | ||
|
|
289838b7bd | ||
|
|
82a3a623f0 | ||
|
|
252ef2329a | ||
|
|
8da31e9eef | ||
|
|
57365f67a0 | ||
|
|
44fe41a1ca | ||
|
|
61853f7503 | ||
|
|
2ec1b096b1 | ||
|
|
0eb1088960 | ||
|
|
25273ef23a | ||
|
|
1529dfb73a | ||
|
|
e66d4725c7 | ||
|
|
5a1e0cae2f | ||
|
|
d3b45f1378 | ||
|
|
5b44aec196 | ||
|
|
6c583ec9bd | ||
|
|
ee89d9e3d6 | ||
|
|
1dec90d456 | ||
|
|
3de33c6e76 | ||
|
|
6a19167a6f | ||
|
|
457ed86478 | ||
|
|
a7f6b27e3c | ||
|
|
517fd68acd | ||
|
|
69db79074f | ||
|
|
372c91b199 | ||
|
|
ba7ba6db74 | ||
|
|
fd235d7428 | ||
|
|
7edcd88a3f | ||
|
|
948e655d13 | ||
|
|
92e021ff95 | ||
|
|
b34033dec2 | ||
|
|
7a9b43671a | ||
|
|
ada9293402 | ||
|
|
7823b70004 | ||
|
|
fc2bb55605 | ||
|
|
cf65da16f8 | ||
|
|
209a28bb74 | ||
|
|
53ed19f374 | ||
|
|
818a3fd27c | ||
|
|
b881ea0f9e | ||
|
|
da3e2efad6 | ||
|
|
61268f2454 | ||
|
|
d34b5c938b | ||
|
|
9f61f2f1ea | ||
|
|
36019fc088 | ||
|
|
3349be5745 | ||
|
|
80ecb421fe | ||
|
|
bcc1fe5165 | ||
|
|
634f590061 | ||
|
|
eba31bf944 | ||
|
|
fc902dd374 | ||
|
|
6d5377c622 | ||
|
|
2547f92410 | ||
|
|
2a59101eb1 | ||
|
|
be36e13e66 | ||
|
|
3bff0de66b | ||
|
|
3223f4229a | ||
|
|
3520590810 | ||
|
|
4d7bbeb164 | ||
|
|
f5c6f81576 | ||
|
|
4eef201e15 | ||
|
|
ebc43bef1f | ||
|
|
7e9bb72dd6 | ||
|
|
eda64cda63 | ||
|
|
ee20e3ff2d | ||
|
|
b205d5a6d2 | ||
|
|
6449c086f1 | ||
|
|
c99cb72d27 | ||
|
|
611eb95943 | ||
|
|
0f8e2a0b86 | ||
|
|
b4e9103709 | ||
|
|
3a17fe2bdd | ||
|
|
c1dc4d2d50 | ||
|
|
3dd3e8e24a | ||
|
|
e008f89cfa | ||
|
|
370c346d5d | ||
|
|
299e0dff1f | ||
|
|
c8dcda22f1 | ||
|
|
75384bc464 | ||
|
|
35e9d9cbf7 | ||
|
|
d1c81070bc | ||
|
|
5152602ba8 | ||
|
|
6e53b43d48 | ||
|
|
a2df7e44b3 | ||
|
|
f4b254e299 | ||
|
|
34a40aeb73 | ||
|
|
d5cd7fe5af | ||
|
|
06688a8cc5 | ||
|
|
6443b95de6 | ||
|
|
772d91d6b0 | ||
|
|
11f01ad26c | ||
|
|
3a3c02be9a | ||
|
|
5764b92f82 | ||
|
|
414144a371 | ||
|
|
8b95d93e07 | ||
|
|
4c16a8fe67 | ||
|
|
f9597a5a11 | ||
|
|
8d17180884 | ||
|
|
f06fced6df | ||
|
|
739f93ebe1 | ||
|
|
8b8f5fd05e | ||
|
|
889fdc690a | ||
|
|
25aa7ddd31 | ||
|
|
99ecd0cfc9 | ||
|
|
fc6f02b297 | ||
|
|
d09370b060 | ||
|
|
c74712dae3 | ||
|
|
7ce1e57c01 | ||
|
|
c8dea60fca | ||
|
|
c9322598f4 | ||
|
|
4f57240859 | ||
|
|
44119e5ad6 | ||
|
|
7821480db5 | ||
|
|
7f71ebded4 | ||
|
|
4739a62451 | ||
|
|
a2c8df28c9 | ||
|
|
f30d67341e | ||
|
|
a33fd08266 | ||
|
|
5fa0b18c95 | ||
|
|
8a03611020 | ||
|
|
6b04a5dd2d | ||
|
|
8d2e23508f | ||
|
|
598496e50c | ||
|
|
907027a4f2 | ||
|
|
9cb0da0bfe | ||
|
|
86de65fbf0 | ||
|
|
e33ea0f503 | ||
|
|
af3541fc7e | ||
|
|
6a5ed71d36 | ||
|
|
1df4a99e89 | ||
|
|
3abec7f397 | ||
|
|
a3d986ff47 | ||
|
|
65434823a1 | ||
|
|
c60e1d6be5 | ||
|
|
7c4064d9df | ||
|
|
984950cc99 |
25
.mailmap
25
.mailmap
@@ -1,25 +0,0 @@
|
||||
<james.darnley@gmail.com> <jdarnley@obe.tv>
|
||||
<jeebjp@gmail.com> <jan.ekstrom@aminocom.com>
|
||||
<sw@jkqxz.net> <mrt@jkqxz.net>
|
||||
<u@pkh.me> <cboesch@gopro.com>
|
||||
<zhilizhao@tencent.com> <quinkblack@foxmail.com>
|
||||
<zhilizhao@tencent.com> <wantlamy@gmail.com>
|
||||
<modmaker@google.com> <modmaker-at-google.com@ffmpeg.org>
|
||||
<stebbins@jetheaddev.com> <jstebbins@jetheaddev.com>
|
||||
<barryjzhao@tencent.com> <mypopydev@gmail.com>
|
||||
<barryjzhao@tencent.com> <jun.zhao@intel.com>
|
||||
<josh@itanimul.li> <joshdk@obe.tv>
|
||||
<michael@niedermayer.cc> <michaelni@gmx.at>
|
||||
<linjie.justin.fu@gmail.com> <linjie.fu@intel.com>
|
||||
<linjie.justin.fu@gmail.com> <fulinjie@zju.edu.cn>
|
||||
<ceffmpeg@gmail.com> <cehoyos@ag.or.at>
|
||||
<ceffmpeg@gmail.com> <cehoyos@rainbow.studorg.tuwien.ac.at>
|
||||
<ffmpeg@gyani.pro> <gyandoshi@gmail.com>
|
||||
<atomnuker@gmail.com> <rpehlivanov@obe.tv>
|
||||
<lizhong1008@gmail.com> <zhong.li@intel.com>
|
||||
<lizhong1008@gmail.com> <zhongli_dev@126.com>
|
||||
<andreas.rheinhardt@gmail.com> <andreas.rheinhardt@googlemail.com>
|
||||
rcombs <rcombs@rcombs.me> <rodger.combs@gmail.com>
|
||||
<thilo.borgmann@mail.de> <thilo.borgmann@googlemail.com>
|
||||
<liuqi05@kuaishou.com> <lq@chinaffmpeg.org>
|
||||
<ruiling.song83@gmail.com> <ruiling.song@intel.com>
|
||||
454
Changelog
454
Changelog
@@ -1,165 +1,303 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
- AudioToolbox output device
|
||||
- MacCaption demuxer
|
||||
- PGX decoder
|
||||
- chromanr video filter
|
||||
- VDPAU accelerated HEVC 10/12bit decoding
|
||||
- ADPCM IMA Ubisoft APM encoder
|
||||
- Rayman 2 APM muxer
|
||||
- AV1 encoding support SVT-AV1
|
||||
- Cineform HD encoder
|
||||
- ADPCM Argonaut Games encoder
|
||||
- Argonaut Games ASF muxer
|
||||
- AV1 Low overhead bitstream format demuxer
|
||||
- RPZA video encoder
|
||||
- ADPCM IMA MOFLEX decoder
|
||||
- MobiClip FastAudio decoder
|
||||
- MobiClip video decoder
|
||||
- MOFLEX demuxer
|
||||
- MODS demuxer
|
||||
- PhotoCD decoder
|
||||
- MCA demuxer
|
||||
- AV1 decoder (Hardware acceleration used only)
|
||||
- SVS demuxer
|
||||
- Argonaut Games BRP demuxer
|
||||
- DAT demuxer
|
||||
- aax demuxer
|
||||
- IPU decoder, parser and demuxer
|
||||
- Intel QSV-accelerated AV1 decoding
|
||||
- Argonaut Games Video decoder
|
||||
- libwavpack encoder removed
|
||||
- ACE demuxer
|
||||
- AVS3 demuxer
|
||||
- AVS3 video decoder via libuavs3d
|
||||
- Cintel RAW decoder
|
||||
- VDPAU accelerated VP9 10/12bit decoding
|
||||
- afreqshift and aphaseshift filters
|
||||
- High Voltage Software ADPCM encoder
|
||||
- LEGO Racers ALP (.tun & .pcm) muxer
|
||||
- AV1 VAAPI decoder
|
||||
- adenorm filter
|
||||
- ADPCM IMA AMV encoder
|
||||
- AMV muxer
|
||||
- NVDEC AV1 hwaccel
|
||||
- DXVA2/D3D11VA hardware accelerated AV1 decoding
|
||||
- speechnorm filter
|
||||
- SpeedHQ encoder
|
||||
- asupercut filter
|
||||
- asubcut filter
|
||||
- Microsoft Paint (MSP) version 2 decoder
|
||||
- Microsoft Paint (MSP) demuxer
|
||||
- AV1 monochrome encoding support via libaom >= 2.0.1
|
||||
- asuperpass and asuperstop filter
|
||||
- shufflepixels filter
|
||||
- tmidequalizer filter
|
||||
- estdif filter
|
||||
- epx filter
|
||||
- Dolby E parser
|
||||
- shear filter
|
||||
- kirsch filter
|
||||
- colortemperature filter
|
||||
- colorcontrast filter
|
||||
- PFM encoder
|
||||
- colorcorrect filter
|
||||
- binka demuxer
|
||||
- XBM parser
|
||||
- xbm_pipe demuxer
|
||||
- colorize filter
|
||||
- CRI parser
|
||||
- aexciter audio filter
|
||||
- exposure video filter
|
||||
- monochrome video filter
|
||||
- setts bitstream filter
|
||||
- vif video filter
|
||||
- OpenEXR image encoder
|
||||
- Simbiosis IMX decoder
|
||||
- Simbiosis IMX demuxer
|
||||
- Digital Pictures SGA demuxer and decoders
|
||||
- TTML subtitle encoder and muxer
|
||||
- identity video filter
|
||||
- msad video filter
|
||||
- gophers protocol
|
||||
- RIST protocol via librist
|
||||
|
||||
|
||||
version 4.3:
|
||||
- v360 filter
|
||||
- Intel QSV-accelerated MJPEG decoding
|
||||
- Intel QSV-accelerated VP9 decoding
|
||||
- Support for TrueHD in mp4
|
||||
- Support AMD AMF encoder on Linux (via Vulkan)
|
||||
- IMM5 video decoder
|
||||
- ZeroMQ protocol
|
||||
- support Sipro ACELP.KELVIN decoding
|
||||
- streamhash muxer
|
||||
- sierpinski video source
|
||||
- scroll video filter
|
||||
- photosensitivity filter
|
||||
- anlms filter
|
||||
- arnndn filter
|
||||
- bilateral filter
|
||||
- maskedmin and maskedmax filters
|
||||
- VDPAU VP9 hwaccel
|
||||
- median filter
|
||||
- QSV-accelerated VP9 encoding
|
||||
- AV1 encoding support via librav1e
|
||||
- AV1 frame merge bitstream filter
|
||||
- AV1 Annex B demuxer
|
||||
- axcorrelate filter
|
||||
- mvdv decoder
|
||||
- mvha decoder
|
||||
- MPEG-H 3D Audio support in mp4
|
||||
- thistogram filter
|
||||
- freezeframes filter
|
||||
- Argonaut Games ADPCM decoder
|
||||
- Argonaut Games ASF demuxer
|
||||
- xfade video filter
|
||||
- xfade_opencl filter
|
||||
- afirsrc audio filter source
|
||||
- pad_opencl filter
|
||||
- Simon & Schuster Interactive ADPCM decoder
|
||||
- Real War KVAG demuxer
|
||||
- CDToons video decoder
|
||||
- siren audio decoder
|
||||
- Rayman 2 ADPCM decoder
|
||||
- Rayman 2 APM demuxer
|
||||
- cas video filter
|
||||
- High Voltage Software ADPCM decoder
|
||||
- LEGO Racers ALP (.tun & .pcm) demuxer
|
||||
- AMQP 0-9-1 protocol (RabbitMQ)
|
||||
- Vulkan support
|
||||
- avgblur_vulkan, overlay_vulkan, scale_vulkan and chromaber_vulkan filters
|
||||
- ADPCM IMA MTF decoder
|
||||
- FWSE demuxer
|
||||
- DERF DPCM decoder
|
||||
- DERF demuxer
|
||||
- CRI HCA decoder
|
||||
- CRI HCA demuxer
|
||||
- overlay_cuda filter
|
||||
- switch from AvxSynth to AviSynth+ on Linux
|
||||
- mv30 decoder
|
||||
- Expanded styling support for 3GPP Timed Text Subtitles (movtext)
|
||||
- WebP parser
|
||||
- tmedian filter
|
||||
- maskedthreshold filter
|
||||
- Support for muxing pcm and pgs in m2ts
|
||||
- Cunning Developments ADPCM decoder
|
||||
- asubboost filter
|
||||
- Pro Pinball Series Soundbank demuxer
|
||||
- pcm_rechunk bitstream filter
|
||||
- scdet filter
|
||||
- NotchLC decoder
|
||||
- gradients source video filter
|
||||
- MediaFoundation encoder wrapper
|
||||
- untile filter
|
||||
- Simon & Schuster Interactive ADPCM encoder
|
||||
- PFM decoder
|
||||
- dblur video filter
|
||||
- Real War KVAG muxer
|
||||
version 4.2.2
|
||||
- cbs_mpeg2: Fix parsing the last unit
|
||||
- cbs_mpeg2: Rearrange start code search
|
||||
- cbs_mpeg2: Decompose Sequence End
|
||||
- cbs_mpeg2: Fix parsing of picture and slice headers
|
||||
- cbs: Remove useless initializations
|
||||
- mpeg2_metadata, cbs_mpeg2: Fix handling of colour_description
|
||||
- lavc/cbs_h2645_syntax_template: Fix memleak
|
||||
- avcodec/cbs: Fix potential overflow
|
||||
- avcodec/cbs: Factor out common code for writing units
|
||||
- avcodec/ffwavesynth: Fix undefined overflow in wavesynth_synth_sample()
|
||||
- avcodec/ffwavesynth: Fix undefined overflow in wavesynth_synth_sample()
|
||||
- avcodec/cook: Use 3 stage VLC decoding for channel_coupling
|
||||
- avcodec/wmalosslessdec: Fixes undefined overflow in dequantization in decode_subframe()
|
||||
- avcodec/sonic: Check e in get_symbol()
|
||||
- avcodec/twinvqdec: Correct overflow in block align check
|
||||
- avcodec/vc1dec: Fix "return -1" cases
|
||||
- avcodec/vc1dec: Free sprite_output_frame on error
|
||||
- avcodec/atrac9dec: Clamp band_ext_data to max that can be read if skipped.
|
||||
- avcodec/agm: Include block size in the MV check for flags == 3
|
||||
- avcodec/wmadec: Keep track of exponent initialization per channel
|
||||
- avcodec/iff: Check that video_size is large enough for the read parameters
|
||||
- avcodec/cbs_vp9: Check data_size
|
||||
- avcodec/cbs_vp9: Check index_size
|
||||
- avcodec/adpcm: Clip predictor for APC
|
||||
- avcodec/targa: Check colors vs. available space
|
||||
- avcodec/dstdec: Use get_ur_golomb_jpegls()
|
||||
- avcodec/wmavoice: Check remaining input in parse_packet_header()
|
||||
- avcodec/wmalosslessdec: Fix 2 overflows in mclms
|
||||
- avcodec/wmaprodec: Fixes integer overflow with 32bit samples
|
||||
- avcodec/adpcm: Fix invalid shift in xa_decode()
|
||||
- avcodec/wmalosslessdec: Fix several integer issues
|
||||
- avcodec/wmalosslessdec: Check that padding bits is not more than sample bits
|
||||
- avcodec/iff: Skip overflowing runs in decode_delta_d()
|
||||
- avcodec/pnm: Check that the header is not truncated
|
||||
- avcodec/mp3_header_decompress_bsf: Check sample_rate_index
|
||||
- avcodec/cbs_av1_syntax_template: Check num_y_points
|
||||
- avformat/rmdec: Initialize and sanity check offset in ivr_read_header()
|
||||
- avcodec/agm: Do not allow MVs out of the picture area as no edge is allocated
|
||||
- avcodec/apedec: Fix 2 integer overflows
|
||||
- avformat/id3v2: Fix double-free on error
|
||||
- avcodec/wmaprodec: Set packet_loss when we error out on a sanity check
|
||||
- avcodec/wmaprodec: Check offset
|
||||
- avcodec/truemotion2: Fix 2 integer overflows in tm2_low_res_block()
|
||||
- avcodec/wmaprodec: Check if the channel sum of all internal contexts match the external
|
||||
- avcodec/atrac9dec: Check q_unit_cnt more completely before using it to access at9_tab_band_ext_group
|
||||
- avcodec/fitsdec: Use lrint()
|
||||
- avcodec/g729dec: Avoid using buf_size
|
||||
- avcodec/g729dec: Factor block_size out
|
||||
- avcodec/g729dec: require buf_size to be non 0
|
||||
- avcodec/alac: Fix integer overflow in lpc_prediction() with sign
|
||||
- avcodec/wmaprodec: Fix buflen computation in save_bits()
|
||||
- avcodec/vc1_block: Fix integer overflow in AC rescaling in vc1_decode_i_block_adv()
|
||||
- avcodec/vmdaudio: Check chunk counts to avoid integer overflow
|
||||
- avformat/mxfdec: Clear metadata_sets_count in mxf_read_close()
|
||||
- avcodec/nuv: Use ff_set_dimensions()
|
||||
- avformat/vividas: Error out on audio packets in the absence of audio streams
|
||||
- avformat/vividas: Check and require 1 video stream
|
||||
- avcodec/ffwavesynth: Fix integer overflow with pink_ts_cur/next
|
||||
- avcodec/ralf: Fix integer overflows with the filter coefficient in decode_channel()
|
||||
- avcodec/g729dec: Use 64bit and clip in scalar product
|
||||
- avcodec/mxpegdec: Check for multiple SOF
|
||||
- avcodec/nuv: Move comptype check up
|
||||
- avcodec/wmavoice: Fix integer overflow in synth_frame()
|
||||
- avcodec/rawdec: Check bits_per_coded_sample more pedantically for 16bit cases
|
||||
- avutil/lfg: Correct index increment type to avoid undefined behavior
|
||||
- avcodec/cngdec: Remove AV_CODEC_CAP_DELAY
|
||||
- avcodec/iff: Move index use after check in decodeplane8()
|
||||
- avcodec/atrac3: Check for huge block aligns
|
||||
- avcodec/ralf: use multiply instead of shift to avoid undefined behavior in decode_block()
|
||||
- avcodec/wmadec: Require previous exponents for reuse
|
||||
- avcodec/vc1_block: Fix undefined behavior in ac prediction rescaling
|
||||
- avcodec/qdm2: The smallest header seems to have 2 bytes so treat 1 as invalid
|
||||
- avcodec/apedec: Fixes integer overflow of res+*data in do_apply_filter()
|
||||
- avcodec/sonic: Fix integer overflow in predictor_calc_error()
|
||||
- avformat/vividas: Add EOF check in val_1 loop in track_header()
|
||||
- avcodec/atrac9dec: Check precision_fine/coarse
|
||||
- avformat/mp3dec: Check that the frame fits within the probe buffer
|
||||
- vcodec/agm: Alloc based on coded dimensions
|
||||
- avcodec/wmaprodec: get frame during frame decode
|
||||
- avcodec/interplayacm: Fix overflow of last unused value
|
||||
- avcodec/adpcm: Fix undefined behavior with negative predictions in IMA OKI
|
||||
- avcodec/cook: Move up and extend block_align check
|
||||
- avcodec/sbcdec: Fix integer overflows in sbc_synthesize_four()
|
||||
- avcodec/twinvq: Check block_align
|
||||
- avcodec/cook: Enlarge gain table
|
||||
- avcodec/cook: Check samples_per_channel earlier
|
||||
- avcodec/atrac3plus: Check split point in fill mode 3
|
||||
- avcodec/wmavoice: Check sample_rate
|
||||
- avcodec/xsubdec: fix overflow in alpha handling
|
||||
- avcodec/iff: Check available space before entering loop in decode_long_vertical_delta2() / decode_long_vertical_delta()
|
||||
- avcodec/apedec: Fix integer overflow in filter_3800()
|
||||
- avutil/lfg: Document the AVLFG struct
|
||||
- avcodec/ffv1dec: Use a different error message for the slice level CRC
|
||||
- avcodec/apedec: Fix undefined integer overflow in long_filter_ehigh_3830()
|
||||
- avcodec/dstdec: Check that AC probabilities are within range
|
||||
- avcodec/dstdec: Check read_table() for failure
|
||||
- avformat/vividas: Fix n_sb_blocks Check
|
||||
- avcodec/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0
|
||||
- avcodec/snowenc: Fix 2 undefined shifts
|
||||
- avformat/nutenc: Do not pass NULL to memcmp() in get_needed_flags()
|
||||
- avcodec/aptx: Check the number of channels
|
||||
- avcodec/aacdec_template: Check samplerate
|
||||
- avcodec/truemotion2: Fix several integer overflows in tm2_low_res_block()
|
||||
- avcodec/utils: Check block_align
|
||||
- avcodec/wmalosslessdec: Fix some integer anomalies
|
||||
- avcodec/adpcm: Fix invalid shifts in ADPCM DTK
|
||||
- avcodec/apedec: Only clear the needed buffer space, instead of all
|
||||
- avcodec/libvorbisdec: Fix insufficient input checks leading to out of array reads
|
||||
- avcodec/g723_1dec: fix invalid shift with negative sid_gain
|
||||
- avcodec/vp5: Check render_x/y
|
||||
- avcodec/hcom: Check the root entry and the right entries
|
||||
- avcodec/qdrw: Check input for header/skiped space before get_buffer()
|
||||
- avcodec/ralf: Skip initializing unused filter variables
|
||||
- avcodec/takdec: Fix overflow with large sample rates
|
||||
- avcodec/atrac9dec: Set channels
|
||||
- avcodec/alsdec: Check that input space for header exists in read_diff_float_data()
|
||||
- avformat/pjsdec: Check duration for overflow
|
||||
- avcodec/agm: Check for reference frame earlier
|
||||
- avcodec/ptx: Check that the input contains at least one line
|
||||
- avcodec/alac: Fix integer overflow in LPC
|
||||
- avcodec/smacker: Fix integer overflows in pred[] in smka_decode_frame()
|
||||
- avcodec/aliaspixdec: Check input size against minimal picture size
|
||||
- avcodec/ffwavesynth: Fix integer overflows in pink noise addition
|
||||
- avcodec/vc1_block: Fixes integer overflow in vc1_decode_i_block_adv()
|
||||
- avcodec/wmalosslessdec: Check block_align
|
||||
- avcodec/g729dec: Avoid computing invalid temporary pointers for ff_acelp_weighted_vector_sum()
|
||||
- avcodec/g729postfilter: Fix left shift of negative value
|
||||
- avcodec/binkaudio: Check sample rate
|
||||
- avcodec/sbcdec: Fix integer overflows in sbc_synthesize_eight()
|
||||
- avcodec/adpcm: Check initial predictor for ADPCM_IMA_EA_EACS
|
||||
- avcodec/g723_1dec: Fix overflow in shift
|
||||
- avcodec/apedec: Fix integer overflow in predictor_update_3930()
|
||||
- avcodec/g729postfilter: Fix undefined intermediate pointers
|
||||
- avcodec/g729postfilter: Fix undefined shifts
|
||||
- avcodec/lsp: Fix undefined shifts in lsp2poly()
|
||||
- avcodec/adpcm: Fix left shifts in AV_CODEC_ID_ADPCM_EA
|
||||
- avformat/shortendec: Check k in probe
|
||||
- avfilter/vf_geq: Use av_clipd() instead of av_clipf()
|
||||
- avcodec/wmaprodec: Check that the streams channels do not exceed the overall channels
|
||||
- avcodec/qdmc: Check input space in qdmc_get_vlc()
|
||||
- avcodec/wmaprodec: Fix cleanup on error
|
||||
- avcodec/pcm: Check bits_per_coded_sample
|
||||
- avcodec/exr: Allow duplicate use of channel indexes
|
||||
- avcodec/fitsdec: Fail on 0 naxisn
|
||||
- avcodec/dxv: Subtract 12 earlier in dxv_decompress_cocg()
|
||||
- libavcodec/dxv: Remove redundant seek
|
||||
- avcodec/ituh263dec: Check input for minimal frame size
|
||||
- avcodec/truemotion1: Check that the input has enough space for a minimal index_stream
|
||||
- avformat/mpsubdec: Clear queue on error
|
||||
- avcodec/sunrast: Check that the input is large enough for the maximally compressed image
|
||||
- avcodec/sunrast: Check for availability of maplength before allocating image
|
||||
- avformat/subtitles: Check nb_subs in ff_subtitles_queue_finalize()
|
||||
- avcodec/vc1_block: Fix invalid left shift in vc1_decode_p_mb()
|
||||
- avcodec/wmaprodec: Check if there is a stream
|
||||
- avcodec/g2meet: Check for end of input in jpg_decode_block()
|
||||
- avcodec/g2meet: Check if adjusted pixel was on the stack
|
||||
- avformat/electronicarts: If no packet has been read at the end do not treat it as if theres a packet
|
||||
- avcodec/dxv: Check op_offset in dxv_decompress_yo()
|
||||
- avcodec/utils: Check sample_rate before opening the decoder
|
||||
- avcodec/aptx: Fix multiple shift anomalies
|
||||
- avcodec/fitsdec: fix use of uninitialised values
|
||||
- avcodec/motionpixels: Mark 2 functions as always_inline
|
||||
- avcodec/ituh263dec: Make the condition for the studio slice start code match between ff_h263_resync() and ff_mpeg4_decode_studio_slice_header()
|
||||
- avcodec/ralf: Fix integer overflow in decode_channel()
|
||||
- vcodec/vc1: compute rangex/y only for P/B frames
|
||||
- avcodec/vc1_pred: Fix invalid shifts in scaleforopp()
|
||||
- avcodec/vc1_block: Fix invalid shift with rangeredfrm
|
||||
- avcodec/vc1: Check for excessive resolution
|
||||
- avcodec/vc1: check REFDIST
|
||||
- avcodec/apedec: Fix several integer overflows in predictor_update_filter() and do_apply_filter()
|
||||
- avcodec/hevc_cabac: Tighten the limit on k in ff_hevc_cu_qp_delta_abs()
|
||||
- avcodec/4xm: Check index in decode_i_block() also in the path where its not used.
|
||||
- avcodec/loco: Check for end of input in the first line
|
||||
- avcodec/atrac3: Check block_align
|
||||
- avcodec/alsdec: Avoid dereferencing context pointer in inner interleave loop
|
||||
- avcodec/hcom: Check that there are dictionary entries
|
||||
- avcodec/fitsdec: Prevent division by 0 with huge data_max
|
||||
- avcodec/dstdec: Fix integer overflow in samples_per_frame computation
|
||||
- avcodec/g729_parser: Check block_size
|
||||
- avcodec/sbcdec: Initialize number of channels
|
||||
- avcodec/utils: Optimize ff_color_frame() using memcpy()
|
||||
- avcodec/aacdec: Check if we run out of input in read_stream_mux_config()
|
||||
- avcodec/utils: Use av_memcpy_backptr() in ff_color_frame()
|
||||
- avcodec/smacker: Fix integer overflow in signed int multiply in SMK_BLK_FILL
|
||||
- avcodec/alac: Fix invalid shifts in 20/24 bps
|
||||
- avcodec/alac: fix undefined behavior with INT_MIN in lpc_prediction()
|
||||
- avcodec/ffwavesynth: Fix integer overflow in timestamps
|
||||
- avformat/vividas: Test size and packet numbers a bit more
|
||||
- avformat/vividas: Check n_sb_blocks against input space
|
||||
- avcodec/dxv: Check op_offset in both directions
|
||||
- avcodec/adpcm: Check number of channels for MTAF
|
||||
- avcodec/sunrast: Fix indention
|
||||
- avcodec/sunrast: Fix return type for "unsupported (compression) type"
|
||||
- avcodec/utils: Check channels fully earlier
|
||||
- avformat/mov: Check for EOF in mov_read_meta()
|
||||
- avcodec/hevcdec: Fix memleak of a53_caption
|
||||
- avformat/vividas: Remove align offset which is always masked off
|
||||
- avformat/vividas: remove dead assignment
|
||||
- avformat/cdxl: Fix integer overflow in intermediate
|
||||
- avcodec/hevcdec: repeat character in skiped
|
||||
- repeat an even number of characters in occured
|
||||
- avcodec/gdv: Replace assert() checking bitstream by if()
|
||||
- libavcodec/utils: Free threads on init failure
|
||||
- avcodec/htmlsubtitles: Avoid locale dependant isdigit()
|
||||
- avcodec/alsdec: Check k from being outside what our implementation can handle
|
||||
- avcodec/takdec: Fix integer overflow in decorrelate()
|
||||
- avcodec/aacps: Fix integer overflows in hybrid_synthesis()
|
||||
- avcodec/mpeg4videodec: Fix integer overflow in mpeg4_decode_studio_block()
|
||||
- avcodec/vp56rac: delay signaling an error on truncated input
|
||||
- avcodec/pnm_parser: Use memchr() in pnm_parse()
|
||||
- tests: Fix bash errors in lavf_container tests.
|
||||
- avformat/matroskadec: Fix use-after-free when demuxing ProRes
|
||||
- avformat/matroskadec: Fix demuxing ProRes
|
||||
- avcodec/cbs_av1: fix array size for ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128
|
||||
- avcodec/cbs_av1: avoid reading trailing bits when obu type is OBU_TILE_LIST
|
||||
- lavc/cbs_h2645: Fix incorrect max size of nalu unit
|
||||
- avcodec/extract_extradata_bsf: Don't unref uninitialized buffers
|
||||
- avformat/av1: Fix leak of dynamic buffer in case of parsing failure
|
||||
- libavformat/rtsp: return error if rtsp_hd_out is null instead of crash
|
||||
- cbs_h264: Fix missing inferred colour description fields
|
||||
- avcodec/cbs_av1: keep separate reference frame state for reading and writing
|
||||
- avcodec/cbs_av1: fix reading reference order hint in skip_mode_params()
|
||||
- avcodec/amfnec: allocate packets using av_new_packet()
|
||||
- avcodec/nvenc: make sure newly allocated packets are refcounted
|
||||
- lavc/mpeg4audio: add chan_config check to avoid indeterminate channels
|
||||
- aformat/movenc: add missing padding to output track extradata
|
||||
- avcodec/nvenc: add driver version info for SDK 9.1
|
||||
- avcodec/bsf: check that AVBSFInternal was allocated before dereferencing it
|
||||
|
||||
version 4.2.1:
|
||||
- avformat/vividas: check for tiny blocks using alignment
|
||||
- avcodec/vc1_pred: Fix refdist in scaleforopp()
|
||||
- avcodec/vorbisdec: fix FASTDIV usage for vr_type == 2
|
||||
- avcodec/iff: Check for overlap in cmap_read_palette()
|
||||
- avcodec/apedec: Fix 32bit int overflow in do_apply_filter()
|
||||
- lavf/rawenc: Only accept the appropriate stream type for raw muxers.
|
||||
- avformat/matroskadec: use av_fast_realloc to reallocate ebml list arrays
|
||||
- avformat/matroskadec: use proper types for some EbmlSyntax fields
|
||||
- avcodec/ralf: fix undefined shift in extend_code()
|
||||
- avcodec/ralf: fix undefined shift
|
||||
- avcodec/bgmc: Check input space in ff_bgmc_decode_init()
|
||||
- avcodec/vp3: Check for end of input in 2 places of vp4_unpack_macroblocks()
|
||||
- avcodec/truemotion2: Fix multiple integer overflows in tm2_null_res_block()
|
||||
- avcodec/vc1_block: Check the return code from vc1_decode_p_block()
|
||||
- avcodec/vc1dec: Require res_sprite for wmv3images
|
||||
- avcodec/vc1_block: Check for double escapes
|
||||
- avcodec/vorbisdec: Check get_vlc2() failure
|
||||
- avcodec/tta: Fix integer overflow in prediction
|
||||
- avcodec/vb: Check input packet size to be large enough to contain flags
|
||||
- avcodec/cavsdec: Limit the number of access units per packet to 2
|
||||
- avcodec/atrac9dec: Check block_align
|
||||
- avcodec/alac: Check for bps of 0
|
||||
- avcodec/alac: Fix multiple integer overflows in lpc_prediction()
|
||||
- avcodec/rl2: set dimensions
|
||||
- avcodec/aacdec: Add FF_CODEC_CAP_INIT_CLEANUP
|
||||
- avcodec/idcinvideo: Add 320x240 default maximum resolution
|
||||
- avformat/realtextdec: free queue on error
|
||||
- avcodec/vp5/6/8: use vpX_rac_is_end()
|
||||
- avformat/vividas: Check av_xiphlacing() return value before use
|
||||
- avcodec/alsdec: Fix integer overflow in decode_var_block_data()
|
||||
- avcodec/alsdec: Limit maximum channels to 512
|
||||
- avcodec/anm: Check input size for a frame with just a stop code
|
||||
- avcodec/flicvideo: Optimize and Simplify FLI_COPY in flic_decode_frame_24BPP() by using bytestream2_get_buffer()
|
||||
- avcodec/loco: Check left column value
|
||||
- avcodec/ffwavesynth: Fixes invalid shift with pink noise seeking
|
||||
- avcodec/ffwavesynth: Fix integer overflow for some corner case values
|
||||
- avcodec/indeo2: Check remaining input more often
|
||||
- avcodec/diracdec: Check that slices are fewer than pixels
|
||||
- avcodec/vp56: Consider the alpha start as end of the prior header
|
||||
- avcodec/4xm: Check for end of input in decode_p_block()
|
||||
- avcodec/hevcdec: Check delta_luma_weight_l0/1
|
||||
- avcodec/hnm4video: Optimize postprocess_current_frame()
|
||||
- avcodec/hevc_refs: Optimize 16bit generate_missing_ref()
|
||||
- avcodec/scpr: Use av_memcpy_backptr() in type 17 and 33
|
||||
- avcodec/tiff: Enforce increasing offsets
|
||||
- avcodec/dds: Use ff_set_dimensions()
|
||||
- avformat/vividas: Fix another infinite loop
|
||||
- avformat/vividas: Fix infinite loop in header parser
|
||||
- avcodec/mpc8: Fix 32bit mask/enum
|
||||
- avcodec/alsdec: Fix integer overflows of raw_samples in decode_var_block_data()
|
||||
- avcodec/alsdec: Fix integer overflow of raw_samples in decode_blocks()
|
||||
- avcodec/alsdec: fix mantisse shift
|
||||
- avcodec/pngdec: consider chunk size in minimal size check
|
||||
- avcodec/vc1_block: Fix invalid shifts in vc1_decode_i_blocks()
|
||||
- avcodec/vc1_block: fix invalid shift in vc1_decode_p_mb()
|
||||
- avcodec/aacdec_template: fix integer overflow in imdct_and_windowing()
|
||||
- avformat/mpegts: Check if ready on SCTE reception
|
||||
- avcodec/omx: fix xFramerate calculation
|
||||
- avformat/avidec: add support for recognizing HEVC fourcc when demuxing
|
||||
- avformat/mpegts: fix teletext PTS when selecting teletext streams only
|
||||
- avcodec/h2645_parse: zero initialize the rbsp buffer
|
||||
- avcodec/omx: Fix handling of fragmented buffers
|
||||
- avcodec/omx: ensure zerocopy mode can be disabled on rpi builds
|
||||
- avformat/mxfdec: do not ignore bad size errors
|
||||
- avformat/matroskadec: Fix seeking
|
||||
- ffplay: properly detect all window size changes
|
||||
|
||||
version 4.2:
|
||||
- tpad filter
|
||||
|
||||
30
LICENSE.md
30
LICENSE.md
@@ -21,11 +21,10 @@ Specifically, the GPL parts of FFmpeg are:
|
||||
- `compat/solaris/make_sunver.pl`
|
||||
- `doc/t2h.pm`
|
||||
- `doc/texi2pod.pl`
|
||||
- `libswresample/tests/swresample.c`
|
||||
- `libswresample/swresample-test.c`
|
||||
- `tests/checkasm/*`
|
||||
- `tests/tiny_ssim.c`
|
||||
- the following filters in libavfilter:
|
||||
- `signature_lookup.c`
|
||||
- `vf_blackframe.c`
|
||||
- `vf_boxblur.c`
|
||||
- `vf_colormatrix.c`
|
||||
@@ -35,13 +34,13 @@ Specifically, the GPL parts of FFmpeg are:
|
||||
- `vf_eq.c`
|
||||
- `vf_find_rect.c`
|
||||
- `vf_fspp.c`
|
||||
- `vf_geq.c`
|
||||
- `vf_histeq.c`
|
||||
- `vf_hqdn3d.c`
|
||||
- `vf_interlace.c`
|
||||
- `vf_kerndeint.c`
|
||||
- `vf_lensfun.c` (GPL version 3 or later)
|
||||
- `vf_mcdeint.c`
|
||||
- `vf_mpdecimate.c`
|
||||
- `vf_nnedi.c`
|
||||
- `vf_owdenoise.c`
|
||||
- `vf_perspective.c`
|
||||
- `vf_phase.c`
|
||||
@@ -50,14 +49,12 @@ Specifically, the GPL parts of FFmpeg are:
|
||||
- `vf_pullup.c`
|
||||
- `vf_repeatfields.c`
|
||||
- `vf_sab.c`
|
||||
- `vf_signature.c`
|
||||
- `vf_smartblur.c`
|
||||
- `vf_spp.c`
|
||||
- `vf_stereo3d.c`
|
||||
- `vf_super2xsai.c`
|
||||
- `vf_tinterlace.c`
|
||||
- `vf_uspp.c`
|
||||
- `vf_vaguedenoiser.c`
|
||||
- `vsrc_mptestsrc.c`
|
||||
|
||||
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
|
||||
@@ -83,39 +80,24 @@ affect the licensing of binaries resulting from the combination.
|
||||
|
||||
### Compatible libraries
|
||||
|
||||
The following libraries are under GPL version 2:
|
||||
- avisynth
|
||||
The following libraries are under GPL:
|
||||
- frei0r
|
||||
- libcdio
|
||||
- libdavs2
|
||||
- librubberband
|
||||
- libvidstab
|
||||
- libx264
|
||||
- libx265
|
||||
- libxavs
|
||||
- libxavs2
|
||||
- libxvid
|
||||
|
||||
When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
|
||||
passing `--enable-gpl` to configure.
|
||||
|
||||
The following libraries are under LGPL version 3:
|
||||
- gmp
|
||||
- libaribb24
|
||||
- liblensfun
|
||||
|
||||
When combining them with FFmpeg, use the configure option `--enable-version3` to
|
||||
upgrade FFmpeg to the LGPL v3.
|
||||
|
||||
The VMAF, mbedTLS, RK MPI, OpenCORE and VisualOn libraries are under the Apache License
|
||||
2.0. That license is incompatible with the LGPL v2.1 and the GPL v2, but not with
|
||||
The OpenCORE and VisualOn libraries are under the Apache License 2.0. That
|
||||
license is incompatible with the LGPL v2.1 and the GPL v2, but not with
|
||||
version 3 of those licenses. So to combine these libraries with FFmpeg, the
|
||||
license version needs to be upgraded by passing `--enable-version3` to configure.
|
||||
|
||||
The smbclient library is under the GPL v3, to combine it with FFmpeg,
|
||||
the options `--enable-gpl` and `--enable-version3` have to be passed to
|
||||
configure to upgrade FFmpeg to the GPL v3.
|
||||
|
||||
### Incompatible libraries
|
||||
|
||||
There are certain libraries you can combine with FFmpeg whose licenses are not
|
||||
|
||||
39
MAINTAINERS
39
MAINTAINERS
@@ -53,11 +53,11 @@ Communication
|
||||
website Deby Barbara Lepage
|
||||
fate.ffmpeg.org Timothy Gu
|
||||
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos
|
||||
Patchwork Andriy Gelman
|
||||
mailing lists Baptiste Coudurier
|
||||
Twitter Reynaldo H. Verdejo Pinochet
|
||||
Google+ Paul B Mahol, Michael Niedermayer, Alexander Strasser
|
||||
Twitter Lou Logan, Reynaldo H. Verdejo Pinochet
|
||||
Launchpad Timothy Gu
|
||||
ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, rcombs, wm4
|
||||
ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, Rodger Combs, wm4
|
||||
|
||||
|
||||
libavutil
|
||||
@@ -78,7 +78,6 @@ Other:
|
||||
float_dsp Loren Merritt
|
||||
hash Reimar Doeffinger
|
||||
hwcontext_cuda* Timo Rothenpieler
|
||||
hwcontext_vulkan* Lynne
|
||||
intfloat* Michael Niedermayer
|
||||
integer.c, integer.h Michael Niedermayer
|
||||
lzo Reimar Doeffinger
|
||||
@@ -89,7 +88,6 @@ Other:
|
||||
rational.c, rational.h Michael Niedermayer
|
||||
rc4 Reimar Doeffinger
|
||||
ripemd.c, ripemd.h James Almer
|
||||
tx* Lynne
|
||||
|
||||
|
||||
libavcodec
|
||||
@@ -144,7 +142,7 @@ Codecs:
|
||||
ass* Aurelien Jacobs
|
||||
asv* Michael Niedermayer
|
||||
atrac3plus* Maxim Poliakovski
|
||||
audiotoolbox* rcombs
|
||||
audiotoolbox* Rodger Combs
|
||||
avs2* Huiwen Ren
|
||||
bgmc.c, bgmc.h Thilo Borgmann
|
||||
binkaudio.c Peter Ross
|
||||
@@ -194,14 +192,12 @@ Codecs:
|
||||
libdavs2.c Huiwen Ren
|
||||
libgsm.c Michel Bardiaux
|
||||
libkvazaar.c Arttu Ylä-Outinen
|
||||
libopenh264enc.c Martin Storsjo, Linjie Fu
|
||||
libopenjpeg.c Jaikrishnan Menon
|
||||
libopenjpegenc.c Michael Bradshaw
|
||||
libtheoraenc.c David Conrad
|
||||
libvorbis.c David Conrad
|
||||
libvpx* James Zern
|
||||
libxavs.c Stefan Gehrer
|
||||
libxavs2.c Huiwen Ren
|
||||
libzvbi-teletextdec.c Marton Balint
|
||||
lzo.h, lzo.c Reimar Doeffinger
|
||||
mdec.c Michael Niedermayer
|
||||
@@ -217,7 +213,6 @@ Codecs:
|
||||
msvideo1.c Mike Melanson
|
||||
nuv.c Reimar Doeffinger
|
||||
nvdec*, nvenc* Timo Rothenpieler
|
||||
omx.c Martin Storsjo, Aman Gupta
|
||||
opus* Rostislav Pehlivanov
|
||||
paf.* Paul B Mahol
|
||||
pcx.c Ivo van Poorten
|
||||
@@ -235,6 +230,7 @@ Codecs:
|
||||
rv10.c Michael Niedermayer
|
||||
s3tc* Ivo van Poorten
|
||||
smc.c Mike Melanson
|
||||
smvjpegdec.c Ash Hughes
|
||||
snow* Michael Niedermayer, Loren Merritt
|
||||
sonic.c Alex Beregszaszi
|
||||
speedhq.c Steinar H. Gunderson
|
||||
@@ -372,8 +368,6 @@ Filters:
|
||||
Sources:
|
||||
vsrc_mandelbrot.c Michael Niedermayer
|
||||
|
||||
dnn Yejun Guo
|
||||
|
||||
libavformat
|
||||
===========
|
||||
|
||||
@@ -392,12 +386,7 @@ Muxers/Demuxers:
|
||||
afc.c Paul B Mahol
|
||||
aiffdec.c Baptiste Coudurier, Matthieu Bouron
|
||||
aiffenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
alp.c Zane van Iperen
|
||||
amvenc.c Zane van Iperen
|
||||
apm.c Zane van Iperen
|
||||
apngdec.c Benoit Fouet
|
||||
argo_asf.c Zane van Iperen
|
||||
argo_brp.c Zane van Iperen
|
||||
ass* Aurelien Jacobs
|
||||
astdec.c Paul B Mahol
|
||||
astenc.c James Almer
|
||||
@@ -435,15 +424,14 @@ Muxers/Demuxers:
|
||||
ircam* Paul B Mahol
|
||||
iss.c Stefan Gehrer
|
||||
jvdec.c Peter Ross
|
||||
kvag.c Zane van Iperen
|
||||
libmodplug.c Clément Bœsch
|
||||
libopenmpt.c Josh de Kock
|
||||
lmlm4.c Ivo van Poorten
|
||||
lvfdec.c Paul B Mahol
|
||||
lxfdec.c Tomas Härdin
|
||||
matroska.c Aurelien Jacobs, Andreas Rheinhardt
|
||||
matroskadec.c Aurelien Jacobs, Andreas Rheinhardt
|
||||
matroskaenc.c David Conrad, Andreas Rheinhardt
|
||||
matroska.c Aurelien Jacobs
|
||||
matroskadec.c Aurelien Jacobs
|
||||
matroskaenc.c David Conrad
|
||||
matroska subtitles (matroskaenc.c) John Peebles
|
||||
metadata* Aurelien Jacobs
|
||||
mgsts.c Paul B Mahol
|
||||
@@ -458,7 +446,7 @@ Muxers/Demuxers:
|
||||
mpegtsenc.c Baptiste Coudurier
|
||||
msnwc_tcp.c Ramiro Polla
|
||||
mtv.c Reynaldo H. Verdejo Pinochet
|
||||
mxf* Baptiste Coudurier, Tomas Härdin
|
||||
mxf* Baptiste Coudurier
|
||||
nistspheredec.c Paul B Mahol
|
||||
nsvdec.c Francois Revol
|
||||
nut* Michael Niedermayer
|
||||
@@ -466,9 +454,9 @@ Muxers/Demuxers:
|
||||
oggdec.c, oggdec.h David Conrad
|
||||
oggenc.c Baptiste Coudurier
|
||||
oggparse*.c David Conrad
|
||||
oggparsedaala* Rostislav Pehlivanov
|
||||
oma.c Maxim Poliakovski
|
||||
paf.c Paul B Mahol
|
||||
pp_bnk.c Zane van Iperen
|
||||
psxstr.c Mike Melanson
|
||||
pva.c Ivo van Poorten
|
||||
pvfdec.c Paul B Mahol
|
||||
@@ -514,7 +502,6 @@ Protocols:
|
||||
ftp.c Lukasz Marek
|
||||
http.c Ronald S. Bultje
|
||||
libssh.c Lukasz Marek
|
||||
libzmq.c Andriy Gelman
|
||||
mms*.c Ronald S. Bultje
|
||||
udp.c Luca Abeni
|
||||
icecast.c Marvin Scholz
|
||||
@@ -570,7 +557,6 @@ Joakim Plate
|
||||
Jun Zhao
|
||||
Kieran Kunhya
|
||||
Kirill Gavrilov
|
||||
Limin Wang
|
||||
Martin Storsjö
|
||||
Panagiotis Issaris
|
||||
Pedro Arthur
|
||||
@@ -613,14 +599,13 @@ Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
|
||||
James Almer 7751 2E8C FD94 A169 57E6 9A7A 1463 01AD 7376 59E0
|
||||
Jean Delvare 7CA6 9F44 60F1 BDC4 1FD2 C858 A552 6B9B B3CD 4E6A
|
||||
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
|
||||
Lynne FE50 139C 6805 72CA FD52 1F8D A2FE A5F0 3F03 4464
|
||||
Lou Logan (llogan) 7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A
|
||||
Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
|
||||
Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93
|
||||
Nikolay Aleksandrov 8978 1D8C FB71 588E 4B27 EAA8 C4F0 B5FC E011 13B1
|
||||
Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029
|
||||
Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
|
||||
Philip Langdale 5DC5 8D66 5FBA 3A43 18EC 045E F8D6 B194 6A75 682E
|
||||
Ramiro Polla 7859 C65B 751B 1179 792E DAE8 8E95 8B2F 9B6C 5700
|
||||
Reimar Doeffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
|
||||
Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
|
||||
Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A
|
||||
@@ -629,9 +614,7 @@ Sascha Sommer 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C
|
||||
Stefano Sabatini 0D0B AD6B 5330 BBAD D3D6 6A0C 719C 2839 FC43 2D5F
|
||||
Steinar H. Gunderson C2E9 004F F028 C18E 4EAD DB83 7F61 7561 7797 8F76
|
||||
Stephan Hilb 4F38 0B3A 5F39 B99B F505 E562 8D5C 5554 4E17 8863
|
||||
Thilo Borgmann (thilo) CE1D B7F4 4D20 FC3A DD9F FE5A 257C 5B8F 1D20 B92F
|
||||
Tiancheng "Timothy" Gu 9456 AFC0 814A 8139 E994 8351 7FE6 B095 B582 B0D4
|
||||
Tim Nicholson 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
|
||||
Tomas Härdin (thardin) A79D 4E3D F38F 763F 91F5 8B33 A01E 8AE0 41BB 2551
|
||||
Wei Gao 4269 7741 857A 0E60 9EC5 08D2 4744 4EFA 62C1 87B9
|
||||
Zane van Iperen (zane) 61AE D40F 368B 6F26 9DAE 3892 6861 6B2D 8AC4 DCC5
|
||||
|
||||
16
Makefile
16
Makefile
@@ -50,26 +50,13 @@ $(TOOLS): %$(EXESUF): %.o
|
||||
target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_bsf_%_fuzzer$(EXESUF): tools/target_bsf_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
target_dem_%_fuzzer$(EXESUF): target_dem_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_dem_fuzzer$(EXESUF): tools/target_dem_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
|
||||
tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS)
|
||||
tools/enum_options$(EXESUF): $(FF_DEP_LIBS)
|
||||
tools/sofa2wavs$(EXESUF): ELIBS = $(FF_EXTRALIBS)
|
||||
tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
|
||||
tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
|
||||
tools/target_dec_%_fuzzer$(EXESUF): $(FF_DEP_LIBS)
|
||||
tools/target_dem_%_fuzzer$(EXESUF): $(FF_DEP_LIBS)
|
||||
|
||||
CONFIGURABLE_COMPONENTS = \
|
||||
$(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \
|
||||
@@ -110,7 +97,7 @@ include $(SRC_PATH)/fftools/Makefile
|
||||
include $(SRC_PATH)/doc/Makefile
|
||||
include $(SRC_PATH)/doc/examples/Makefile
|
||||
|
||||
libavcodec/avcodec.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
|
||||
libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
|
||||
|
||||
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
||||
ifeq ($(STRIPTYPE),direct)
|
||||
@@ -161,7 +148,6 @@ distclean:: clean
|
||||
version.h libavutil/ffversion.h libavcodec/codec_names.h \
|
||||
libavcodec/bsf_list.c libavformat/protocol_list.c \
|
||||
libavcodec/codec_list.c libavcodec/parser_list.c \
|
||||
libavfilter/filter_list.c libavdevice/indev_list.c libavdevice/outdev_list.c \
|
||||
libavformat/muxer_list.c libavformat/demuxer_list.c
|
||||
ifeq ($(SRC_LINK),src)
|
||||
$(RM) src
|
||||
|
||||
15
RELEASE_NOTES
Normal file
15
RELEASE_NOTES
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
┌────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 4.2 "Ada" │
|
||||
└────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 4.2 "Ada", about 8
|
||||
months after the release of FFmpeg 4.1.
|
||||
|
||||
A complete Changelog is available at the root of the project, and the
|
||||
complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git
|
||||
|
||||
We hope you will like this release as much as we enjoyed working on it, and
|
||||
as usual, if you have any questions about it, or any FFmpeg related topic,
|
||||
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
|
||||
on the mailing-lists.
|
||||
1264
compat/avisynth/avisynth_c.h
Normal file
1264
compat/avisynth/avisynth_c.h
Normal file
File diff suppressed because it is too large
Load Diff
94
compat/avisynth/avs/capi.h
Normal file
94
compat/avisynth/avs/capi.h
Normal file
@@ -0,0 +1,94 @@
|
||||
// Avisynth C Interface Version 0.20
|
||||
// Copyright 2003 Kevin Atkinson
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program 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 General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
|
||||
// http://www.gnu.org/copyleft/gpl.html .
|
||||
//
|
||||
// As a special exception, I give you permission to link to the
|
||||
// Avisynth C interface with independent modules that communicate with
|
||||
// the Avisynth C interface solely through the interfaces defined in
|
||||
// avisynth_c.h, regardless of the license terms of these independent
|
||||
// modules, and to copy and distribute the resulting combined work
|
||||
// under terms of your choice, provided that every copy of the
|
||||
// combined work is accompanied by a complete copy of the source code
|
||||
// of the Avisynth C interface and Avisynth itself (with the version
|
||||
// used to produce the combined work), being distributed under the
|
||||
// terms of the GNU General Public License plus this exception. An
|
||||
// independent module is a module which is not derived from or based
|
||||
// on Avisynth C Interface, such as 3rd-party filters, import and
|
||||
// export plugins, or graphical user interfaces.
|
||||
|
||||
#ifndef AVS_CAPI_H
|
||||
#define AVS_CAPI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define EXTERN_C extern "C"
|
||||
#else
|
||||
# define EXTERN_C
|
||||
#endif
|
||||
|
||||
#ifdef BUILDING_AVSCORE
|
||||
# if defined(GCC) && defined(X86_32)
|
||||
# define AVSC_CC
|
||||
# else // MSVC builds and 64-bit GCC
|
||||
# ifndef AVSC_USE_STDCALL
|
||||
# define AVSC_CC __cdecl
|
||||
# else
|
||||
# define AVSC_CC __stdcall
|
||||
# endif
|
||||
# endif
|
||||
#else // needed for programs that talk to AviSynth+
|
||||
# ifndef AVSC_WIN32_GCC32 // see comment below
|
||||
# ifndef AVSC_USE_STDCALL
|
||||
# define AVSC_CC __cdecl
|
||||
# else
|
||||
# define AVSC_CC __stdcall
|
||||
# endif
|
||||
# else
|
||||
# define AVSC_CC
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// On 64-bit Windows, there's only one calling convention,
|
||||
// so there is no difference between MSVC and GCC. On 32-bit,
|
||||
// this isn't true. The convention that GCC needs to use to
|
||||
// even build AviSynth+ as 32-bit makes anything that uses
|
||||
// it incompatible with 32-bit MSVC builds of AviSynth+.
|
||||
// The AVSC_WIN32_GCC32 define is meant to provide a user
|
||||
// switchable way to make builds of FFmpeg to test 32-bit
|
||||
// GCC builds of AviSynth+ without having to screw around
|
||||
// with alternate headers, while still default to the usual
|
||||
// situation of using 32-bit MSVC builds of AviSynth+.
|
||||
|
||||
// Hopefully, this situation will eventually be resolved
|
||||
// and a broadly compatible solution will arise so the
|
||||
// same 32-bit FFmpeg build can handle either MSVC or GCC
|
||||
// builds of AviSynth+.
|
||||
|
||||
#define AVSC_INLINE static __inline
|
||||
|
||||
#ifdef BUILDING_AVSCORE
|
||||
# define AVSC_EXPORT __declspec(dllexport)
|
||||
# define AVSC_API(ret, name) EXTERN_C AVSC_EXPORT ret AVSC_CC name
|
||||
#else
|
||||
# define AVSC_EXPORT EXTERN_C __declspec(dllexport)
|
||||
# ifndef AVSC_NO_DECLSPEC
|
||||
# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
|
||||
# else
|
||||
# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif //AVS_CAPI_H
|
||||
70
compat/avisynth/avs/config.h
Normal file
70
compat/avisynth/avs/config.h
Normal file
@@ -0,0 +1,70 @@
|
||||
// Avisynth C Interface Version 0.20
|
||||
// Copyright 2003 Kevin Atkinson
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program 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 General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
|
||||
// http://www.gnu.org/copyleft/gpl.html .
|
||||
//
|
||||
// As a special exception, I give you permission to link to the
|
||||
// Avisynth C interface with independent modules that communicate with
|
||||
// the Avisynth C interface solely through the interfaces defined in
|
||||
// avisynth_c.h, regardless of the license terms of these independent
|
||||
// modules, and to copy and distribute the resulting combined work
|
||||
// under terms of your choice, provided that every copy of the
|
||||
// combined work is accompanied by a complete copy of the source code
|
||||
// of the Avisynth C interface and Avisynth itself (with the version
|
||||
// used to produce the combined work), being distributed under the
|
||||
// terms of the GNU General Public License plus this exception. An
|
||||
// independent module is a module which is not derived from or based
|
||||
// on Avisynth C Interface, such as 3rd-party filters, import and
|
||||
// export plugins, or graphical user interfaces.
|
||||
|
||||
#ifndef AVS_CONFIG_H
|
||||
#define AVS_CONFIG_H
|
||||
|
||||
// Undefine this to get cdecl calling convention
|
||||
#define AVSC_USE_STDCALL 1
|
||||
|
||||
// NOTE TO PLUGIN AUTHORS:
|
||||
// Because FRAME_ALIGN can be substantially higher than the alignment
|
||||
// a plugin actually needs, plugins should not use FRAME_ALIGN to check for
|
||||
// alignment. They should always request the exact alignment value they need.
|
||||
// This is to make sure that plugins work over the widest range of AviSynth
|
||||
// builds possible.
|
||||
#define FRAME_ALIGN 64
|
||||
|
||||
#if defined(_M_AMD64) || defined(__x86_64)
|
||||
# define X86_64
|
||||
#elif defined(_M_IX86) || defined(__i386__)
|
||||
# define X86_32
|
||||
#else
|
||||
# error Unsupported CPU architecture.
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define MSVC
|
||||
#elif defined(__GNUC__)
|
||||
# define GCC
|
||||
#elif defined(__clang__)
|
||||
# define CLANG
|
||||
#else
|
||||
# error Unsupported compiler.
|
||||
#endif
|
||||
|
||||
#if defined(GCC)
|
||||
# undef __forceinline
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#endif //AVS_CONFIG_H
|
||||
57
compat/avisynth/avs/types.h
Normal file
57
compat/avisynth/avs/types.h
Normal file
@@ -0,0 +1,57 @@
|
||||
// Avisynth C Interface Version 0.20
|
||||
// Copyright 2003 Kevin Atkinson
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program 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 General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
|
||||
// http://www.gnu.org/copyleft/gpl.html .
|
||||
//
|
||||
// As a special exception, I give you permission to link to the
|
||||
// Avisynth C interface with independent modules that communicate with
|
||||
// the Avisynth C interface solely through the interfaces defined in
|
||||
// avisynth_c.h, regardless of the license terms of these independent
|
||||
// modules, and to copy and distribute the resulting combined work
|
||||
// under terms of your choice, provided that every copy of the
|
||||
// combined work is accompanied by a complete copy of the source code
|
||||
// of the Avisynth C interface and Avisynth itself (with the version
|
||||
// used to produce the combined work), being distributed under the
|
||||
// terms of the GNU General Public License plus this exception. An
|
||||
// independent module is a module which is not derived from or based
|
||||
// on Avisynth C Interface, such as 3rd-party filters, import and
|
||||
// export plugins, or graphical user interfaces.
|
||||
|
||||
#ifndef AVS_TYPES_H
|
||||
#define AVS_TYPES_H
|
||||
|
||||
// Define all types necessary for interfacing with avisynth.dll
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cstddef>
|
||||
#else
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
// Raster types used by VirtualDub & Avisynth
|
||||
typedef unsigned int Pixel32;
|
||||
typedef unsigned char BYTE;
|
||||
|
||||
// Audio Sample information
|
||||
typedef float SFLOAT;
|
||||
|
||||
#ifdef __GNUC__
|
||||
typedef long long int INT64;
|
||||
#else
|
||||
typedef __int64 INT64;
|
||||
#endif
|
||||
|
||||
#endif //AVS_TYPES_H
|
||||
728
compat/avisynth/avxsynth_c.h
Normal file
728
compat/avisynth/avxsynth_c.h
Normal file
@@ -0,0 +1,728 @@
|
||||
// Avisynth C Interface Version 0.20
|
||||
// Copyright 2003 Kevin Atkinson
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program 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 General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
// MA 02110-1301 USA, or visit
|
||||
// http://www.gnu.org/copyleft/gpl.html .
|
||||
//
|
||||
// As a special exception, I give you permission to link to the
|
||||
// Avisynth C interface with independent modules that communicate with
|
||||
// the Avisynth C interface solely through the interfaces defined in
|
||||
// avisynth_c.h, regardless of the license terms of these independent
|
||||
// modules, and to copy and distribute the resulting combined work
|
||||
// under terms of your choice, provided that every copy of the
|
||||
// combined work is accompanied by a complete copy of the source code
|
||||
// of the Avisynth C interface and Avisynth itself (with the version
|
||||
// used to produce the combined work), being distributed under the
|
||||
// terms of the GNU General Public License plus this exception. An
|
||||
// independent module is a module which is not derived from or based
|
||||
// on Avisynth C Interface, such as 3rd-party filters, import and
|
||||
// export plugins, or graphical user interfaces.
|
||||
|
||||
#ifndef __AVXSYNTH_C__
|
||||
#define __AVXSYNTH_C__
|
||||
|
||||
#include "windowsPorts/windows2linux.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define EXTERN_C extern "C"
|
||||
#else
|
||||
# define EXTERN_C
|
||||
#endif
|
||||
|
||||
#define AVSC_USE_STDCALL 1
|
||||
|
||||
#ifndef AVSC_USE_STDCALL
|
||||
# define AVSC_CC __cdecl
|
||||
#else
|
||||
# define AVSC_CC __stdcall
|
||||
#endif
|
||||
|
||||
#define AVSC_INLINE static __inline
|
||||
|
||||
#ifdef AVISYNTH_C_EXPORTS
|
||||
# define AVSC_EXPORT EXTERN_C
|
||||
# define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
|
||||
#else
|
||||
# define AVSC_EXPORT EXTERN_C __declspec(dllexport)
|
||||
# ifndef AVSC_NO_DECLSPEC
|
||||
# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
|
||||
# else
|
||||
# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
typedef long long int INT64;
|
||||
#else
|
||||
typedef __int64 INT64;
|
||||
#endif
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
|
||||
#ifndef __AVXSYNTH_H__
|
||||
enum { AVISYNTH_INTERFACE_VERSION = 3 };
|
||||
#endif
|
||||
|
||||
enum {AVS_SAMPLE_INT8 = 1<<0,
|
||||
AVS_SAMPLE_INT16 = 1<<1,
|
||||
AVS_SAMPLE_INT24 = 1<<2,
|
||||
AVS_SAMPLE_INT32 = 1<<3,
|
||||
AVS_SAMPLE_FLOAT = 1<<4};
|
||||
|
||||
enum {AVS_PLANAR_Y=1<<0,
|
||||
AVS_PLANAR_U=1<<1,
|
||||
AVS_PLANAR_V=1<<2,
|
||||
AVS_PLANAR_ALIGNED=1<<3,
|
||||
AVS_PLANAR_Y_ALIGNED=AVS_PLANAR_Y|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_U_ALIGNED=AVS_PLANAR_U|AVS_PLANAR_ALIGNED,
|
||||
AVS_PLANAR_V_ALIGNED=AVS_PLANAR_V|AVS_PLANAR_ALIGNED};
|
||||
|
||||
// Colorspace properties.
|
||||
enum {AVS_CS_BGR = 1<<28,
|
||||
AVS_CS_YUV = 1<<29,
|
||||
AVS_CS_INTERLEAVED = 1<<30,
|
||||
AVS_CS_PLANAR = 1<<31};
|
||||
|
||||
// Specific colorformats
|
||||
enum {
|
||||
AVS_CS_UNKNOWN = 0,
|
||||
AVS_CS_BGR24 = 1<<0 | AVS_CS_BGR | AVS_CS_INTERLEAVED,
|
||||
AVS_CS_BGR32 = 1<<1 | AVS_CS_BGR | AVS_CS_INTERLEAVED,
|
||||
AVS_CS_YUY2 = 1<<2 | AVS_CS_YUV | AVS_CS_INTERLEAVED,
|
||||
AVS_CS_YV12 = 1<<3 | AVS_CS_YUV | AVS_CS_PLANAR, // y-v-u, planar
|
||||
AVS_CS_I420 = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR, // y-u-v, planar
|
||||
AVS_CS_IYUV = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR // same as above
|
||||
};
|
||||
|
||||
enum {
|
||||
AVS_IT_BFF = 1<<0,
|
||||
AVS_IT_TFF = 1<<1,
|
||||
AVS_IT_FIELDBASED = 1<<2};
|
||||
|
||||
enum {
|
||||
AVS_FILTER_TYPE=1,
|
||||
AVS_FILTER_INPUT_COLORSPACE=2,
|
||||
AVS_FILTER_OUTPUT_TYPE=9,
|
||||
AVS_FILTER_NAME=4,
|
||||
AVS_FILTER_AUTHOR=5,
|
||||
AVS_FILTER_VERSION=6,
|
||||
AVS_FILTER_ARGS=7,
|
||||
AVS_FILTER_ARGS_INFO=8,
|
||||
AVS_FILTER_ARGS_DESCRIPTION=10,
|
||||
AVS_FILTER_DESCRIPTION=11};
|
||||
|
||||
enum { //SUBTYPES
|
||||
AVS_FILTER_TYPE_AUDIO=1,
|
||||
AVS_FILTER_TYPE_VIDEO=2,
|
||||
AVS_FILTER_OUTPUT_TYPE_SAME=3,
|
||||
AVS_FILTER_OUTPUT_TYPE_DIFFERENT=4};
|
||||
|
||||
enum {
|
||||
AVS_CACHE_NOTHING=0,
|
||||
AVS_CACHE_RANGE=1,
|
||||
AVS_CACHE_ALL=2,
|
||||
AVS_CACHE_AUDIO=3,
|
||||
AVS_CACHE_AUDIO_NONE=4,
|
||||
AVS_CACHE_AUDIO_AUTO=5
|
||||
};
|
||||
|
||||
#define AVS_FRAME_ALIGN 16
|
||||
|
||||
typedef struct AVS_Clip AVS_Clip;
|
||||
typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_VideoInfo
|
||||
//
|
||||
|
||||
// AVS_VideoInfo is layed out identicly to VideoInfo
|
||||
typedef struct AVS_VideoInfo {
|
||||
int width, height; // width=0 means no video
|
||||
unsigned fps_numerator, fps_denominator;
|
||||
int num_frames;
|
||||
|
||||
int pixel_type;
|
||||
|
||||
int audio_samples_per_second; // 0 means no audio
|
||||
int sample_type;
|
||||
INT64 num_audio_samples;
|
||||
int nchannels;
|
||||
|
||||
// Imagetype properties
|
||||
|
||||
int image_type;
|
||||
} AVS_VideoInfo;
|
||||
|
||||
// useful functions of the above
|
||||
AVSC_INLINE int avs_has_video(const AVS_VideoInfo * p)
|
||||
{ return (p->width!=0); }
|
||||
|
||||
AVSC_INLINE int avs_has_audio(const AVS_VideoInfo * p)
|
||||
{ return (p->audio_samples_per_second!=0); }
|
||||
|
||||
AVSC_INLINE int avs_is_rgb(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type&AVS_CS_BGR); }
|
||||
|
||||
AVSC_INLINE int avs_is_rgb24(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type&AVS_CS_BGR24)==AVS_CS_BGR24; } // Clear out additional properties
|
||||
|
||||
AVSC_INLINE int avs_is_rgb32(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_BGR32) == AVS_CS_BGR32 ; }
|
||||
|
||||
AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type&AVS_CS_YUV ); }
|
||||
|
||||
AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p)
|
||||
{ return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; }
|
||||
|
||||
AVSC_INLINE int avs_is_yv12(const AVS_VideoInfo * p)
|
||||
{ return ((p->pixel_type & AVS_CS_YV12) == AVS_CS_YV12)||((p->pixel_type & AVS_CS_I420) == AVS_CS_I420); }
|
||||
|
||||
AVSC_INLINE int avs_is_color_space(const AVS_VideoInfo * p, int c_space)
|
||||
{ return ((p->pixel_type & c_space) == c_space); }
|
||||
|
||||
AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property)
|
||||
{ return ((p->pixel_type & property)==property ); }
|
||||
|
||||
AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p)
|
||||
{ return !!(p->pixel_type & AVS_CS_PLANAR); }
|
||||
|
||||
AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_FIELDBASED); }
|
||||
|
||||
AVSC_INLINE int avs_is_parity_known(const AVS_VideoInfo * p)
|
||||
{ return ((p->image_type & AVS_IT_FIELDBASED)&&(p->image_type & (AVS_IT_BFF | AVS_IT_TFF))); }
|
||||
|
||||
AVSC_INLINE int avs_is_bff(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_BFF); }
|
||||
|
||||
AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p)
|
||||
{ return !!(p->image_type & AVS_IT_TFF); }
|
||||
|
||||
AVSC_INLINE int avs_bits_per_pixel(const AVS_VideoInfo * p)
|
||||
{
|
||||
switch (p->pixel_type) {
|
||||
case AVS_CS_BGR24: return 24;
|
||||
case AVS_CS_BGR32: return 32;
|
||||
case AVS_CS_YUY2: return 16;
|
||||
case AVS_CS_YV12:
|
||||
case AVS_CS_I420: return 12;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
AVSC_INLINE int avs_bytes_from_pixels(const AVS_VideoInfo * p, int pixels)
|
||||
{ return pixels * (avs_bits_per_pixel(p)>>3); } // Will work on planar images, but will return only luma planes
|
||||
|
||||
AVSC_INLINE int avs_row_size(const AVS_VideoInfo * p)
|
||||
{ return avs_bytes_from_pixels(p,p->width); } // Also only returns first plane on planar images
|
||||
|
||||
AVSC_INLINE int avs_bmp_size(const AVS_VideoInfo * vi)
|
||||
{ if (avs_is_planar(vi)) {int p = vi->height * ((avs_row_size(vi)+3) & ~3); p+=p>>1; return p; } return vi->height * ((avs_row_size(vi)+3) & ~3); }
|
||||
|
||||
AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p)
|
||||
{ return p->audio_samples_per_second; }
|
||||
|
||||
|
||||
AVSC_INLINE int avs_bytes_per_channel_sample(const AVS_VideoInfo * p)
|
||||
{
|
||||
switch (p->sample_type) {
|
||||
case AVS_SAMPLE_INT8: return sizeof(signed char);
|
||||
case AVS_SAMPLE_INT16: return sizeof(signed short);
|
||||
case AVS_SAMPLE_INT24: return 3;
|
||||
case AVS_SAMPLE_INT32: return sizeof(signed int);
|
||||
case AVS_SAMPLE_FLOAT: return sizeof(float);
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
AVSC_INLINE int avs_bytes_per_audio_sample(const AVS_VideoInfo * p)
|
||||
{ return p->nchannels*avs_bytes_per_channel_sample(p);}
|
||||
|
||||
AVSC_INLINE INT64 avs_audio_samples_from_frames(const AVS_VideoInfo * p, INT64 frames)
|
||||
{ return ((INT64)(frames) * p->audio_samples_per_second * p->fps_denominator / p->fps_numerator); }
|
||||
|
||||
AVSC_INLINE int avs_frames_from_audio_samples(const AVS_VideoInfo * p, INT64 samples)
|
||||
{ return (int)(samples * (INT64)p->fps_numerator / (INT64)p->fps_denominator / (INT64)p->audio_samples_per_second); }
|
||||
|
||||
AVSC_INLINE INT64 avs_audio_samples_from_bytes(const AVS_VideoInfo * p, INT64 bytes)
|
||||
{ return bytes / avs_bytes_per_audio_sample(p); }
|
||||
|
||||
AVSC_INLINE INT64 avs_bytes_from_audio_samples(const AVS_VideoInfo * p, INT64 samples)
|
||||
{ return samples * avs_bytes_per_audio_sample(p); }
|
||||
|
||||
AVSC_INLINE int avs_audio_channels(const AVS_VideoInfo * p)
|
||||
{ return p->nchannels; }
|
||||
|
||||
AVSC_INLINE int avs_sample_type(const AVS_VideoInfo * p)
|
||||
{ return p->sample_type;}
|
||||
|
||||
// useful mutator
|
||||
AVSC_INLINE void avs_set_property(AVS_VideoInfo * p, int property)
|
||||
{ p->image_type|=property; }
|
||||
|
||||
AVSC_INLINE void avs_clear_property(AVS_VideoInfo * p, int property)
|
||||
{ p->image_type&=~property; }
|
||||
|
||||
AVSC_INLINE void avs_set_field_based(AVS_VideoInfo * p, int isfieldbased)
|
||||
{ if (isfieldbased) p->image_type|=AVS_IT_FIELDBASED; else p->image_type&=~AVS_IT_FIELDBASED; }
|
||||
|
||||
AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned denominator)
|
||||
{
|
||||
unsigned x=numerator, y=denominator;
|
||||
while (y) { // find gcd
|
||||
unsigned t = x%y; x = y; y = t;
|
||||
}
|
||||
p->fps_numerator = numerator/x;
|
||||
p->fps_denominator = denominator/x;
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo * x, AVS_VideoInfo * y)
|
||||
{
|
||||
return (x->pixel_type == y->pixel_type)
|
||||
|| (avs_is_yv12(x) && avs_is_yv12(y));
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_VideoFrame
|
||||
//
|
||||
|
||||
// VideoFrameBuffer holds information about a memory block which is used
|
||||
// for video data. For efficiency, instances of this class are not deleted
|
||||
// when the refcount reaches zero; instead they're stored in a linked list
|
||||
// to be reused. The instances are deleted when the corresponding AVS
|
||||
// file is closed.
|
||||
|
||||
// AVS_VideoFrameBuffer is layed out identicly to VideoFrameBuffer
|
||||
// DO NOT USE THIS STRUCTURE DIRECTLY
|
||||
typedef struct AVS_VideoFrameBuffer {
|
||||
unsigned char * data;
|
||||
int data_size;
|
||||
// sequence_number is incremented every time the buffer is changed, so
|
||||
// that stale views can tell they're no longer valid.
|
||||
long sequence_number;
|
||||
|
||||
long refcount;
|
||||
} AVS_VideoFrameBuffer;
|
||||
|
||||
// VideoFrame holds a "window" into a VideoFrameBuffer.
|
||||
|
||||
// AVS_VideoFrame is layed out identicly to IVideoFrame
|
||||
// DO NOT USE THIS STRUCTURE DIRECTLY
|
||||
typedef struct AVS_VideoFrame {
|
||||
int refcount;
|
||||
AVS_VideoFrameBuffer * vfb;
|
||||
int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture.
|
||||
} AVS_VideoFrame;
|
||||
|
||||
// Access functions for AVS_VideoFrame
|
||||
AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) {
|
||||
return p->pitch;}
|
||||
|
||||
AVSC_INLINE int avs_get_pitch_p(const AVS_VideoFrame * p, int plane) {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V: return p->pitchUV;}
|
||||
return p->pitch;}
|
||||
|
||||
AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) {
|
||||
return p->row_size; }
|
||||
|
||||
AVSC_INLINE int avs_get_row_size_p(const AVS_VideoFrame * p, int plane) {
|
||||
int r;
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V:
|
||||
if (p->pitchUV) return p->row_size>>1;
|
||||
else return 0;
|
||||
case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED:
|
||||
if (p->pitchUV) {
|
||||
r = ((p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)) )>>1; // Aligned rowsize
|
||||
if (r < p->pitchUV)
|
||||
return r;
|
||||
return p->row_size>>1;
|
||||
} else return 0;
|
||||
case AVS_PLANAR_Y_ALIGNED:
|
||||
r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
|
||||
if (r <= p->pitch)
|
||||
return r;
|
||||
return p->row_size;
|
||||
}
|
||||
return p->row_size;
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) {
|
||||
return p->height;}
|
||||
|
||||
AVSC_INLINE int avs_get_height_p(const AVS_VideoFrame * p, int plane) {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: case AVS_PLANAR_V:
|
||||
if (p->pitchUV) return p->height>>1;
|
||||
return 0;
|
||||
}
|
||||
return p->height;}
|
||||
|
||||
AVSC_INLINE const unsigned char* avs_get_read_ptr(const AVS_VideoFrame * p) {
|
||||
return p->vfb->data + p->offset;}
|
||||
|
||||
AVSC_INLINE const unsigned char* avs_get_read_ptr_p(const AVS_VideoFrame * p, int plane)
|
||||
{
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
|
||||
case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
|
||||
default: return p->vfb->data + p->offset;}
|
||||
}
|
||||
|
||||
AVSC_INLINE int avs_is_writable(const AVS_VideoFrame * p) {
|
||||
return (p->refcount == 1 && p->vfb->refcount == 1);}
|
||||
|
||||
AVSC_INLINE unsigned char* avs_get_write_ptr(const AVS_VideoFrame * p)
|
||||
{
|
||||
if (avs_is_writable(p)) {
|
||||
++p->vfb->sequence_number;
|
||||
return p->vfb->data + p->offset;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVSC_INLINE unsigned char* avs_get_write_ptr_p(const AVS_VideoFrame * p, int plane)
|
||||
{
|
||||
if (plane==AVS_PLANAR_Y && avs_is_writable(p)) {
|
||||
++p->vfb->sequence_number;
|
||||
return p->vfb->data + p->offset;
|
||||
} else if (plane==AVS_PLANAR_Y) {
|
||||
return 0;
|
||||
} else {
|
||||
switch (plane) {
|
||||
case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
|
||||
case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
|
||||
default: return p->vfb->data + p->offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *);
|
||||
// makes a shallow copy of a video frame
|
||||
AVSC_API(AVS_VideoFrame *, avs_copy_video_frame)(AVS_VideoFrame *);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE void avs_release_frame(AVS_VideoFrame * f)
|
||||
{avs_release_video_frame(f);}
|
||||
AVSC_INLINE AVS_VideoFrame * avs_copy_frame(AVS_VideoFrame * f)
|
||||
{return avs_copy_video_frame(f);}
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_Value
|
||||
//
|
||||
|
||||
// Treat AVS_Value as a fat pointer. That is use avs_copy_value
|
||||
// and avs_release_value appropiaty as you would if AVS_Value was
|
||||
// a pointer.
|
||||
|
||||
// To maintain source code compatibility with future versions of the
|
||||
// avisynth_c API don't use the AVS_Value directly. Use the helper
|
||||
// functions below.
|
||||
|
||||
// AVS_Value is layed out identicly to AVSValue
|
||||
typedef struct AVS_Value AVS_Value;
|
||||
struct AVS_Value {
|
||||
short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
|
||||
// for some function e'rror
|
||||
short array_size;
|
||||
union {
|
||||
void * clip; // do not use directly, use avs_take_clip
|
||||
char boolean;
|
||||
int integer;
|
||||
INT64 integer64; // match addition of __int64 to avxplugin.h
|
||||
float floating_pt;
|
||||
const char * string;
|
||||
const AVS_Value * array;
|
||||
} d;
|
||||
};
|
||||
|
||||
// AVS_Value should be initilized with avs_void.
|
||||
// Should also set to avs_void after the value is released
|
||||
// with avs_copy_value. Consider it the equalvent of setting
|
||||
// a pointer to NULL
|
||||
static const AVS_Value avs_void = {'v'};
|
||||
|
||||
AVSC_API(void, avs_copy_value)(AVS_Value * dest, AVS_Value src);
|
||||
AVSC_API(void, avs_release_value)(AVS_Value);
|
||||
|
||||
AVSC_INLINE int avs_defined(AVS_Value v) { return v.type != 'v'; }
|
||||
AVSC_INLINE int avs_is_clip(AVS_Value v) { return v.type == 'c'; }
|
||||
AVSC_INLINE int avs_is_bool(AVS_Value v) { return v.type == 'b'; }
|
||||
AVSC_INLINE int avs_is_int(AVS_Value v) { return v.type == 'i'; }
|
||||
AVSC_INLINE int avs_is_float(AVS_Value v) { return v.type == 'f' || v.type == 'i'; }
|
||||
AVSC_INLINE int avs_is_string(AVS_Value v) { return v.type == 's'; }
|
||||
AVSC_INLINE int avs_is_array(AVS_Value v) { return v.type == 'a'; }
|
||||
AVSC_INLINE int avs_is_error(AVS_Value v) { return v.type == 'e'; }
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(AVS_Clip *, avs_take_clip)(AVS_Value, AVS_ScriptEnvironment *);
|
||||
AVSC_API(void, avs_set_to_clip)(AVS_Value *, AVS_Clip *);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
AVSC_INLINE int avs_as_bool(AVS_Value v)
|
||||
{ return v.d.boolean; }
|
||||
AVSC_INLINE int avs_as_int(AVS_Value v)
|
||||
{ return v.d.integer; }
|
||||
AVSC_INLINE const char * avs_as_string(AVS_Value v)
|
||||
{ return avs_is_error(v) || avs_is_string(v) ? v.d.string : 0; }
|
||||
AVSC_INLINE double avs_as_float(AVS_Value v)
|
||||
{ return avs_is_int(v) ? v.d.integer : v.d.floating_pt; }
|
||||
AVSC_INLINE const char * avs_as_error(AVS_Value v)
|
||||
{ return avs_is_error(v) ? v.d.string : 0; }
|
||||
AVSC_INLINE const AVS_Value * avs_as_array(AVS_Value v)
|
||||
{ return v.d.array; }
|
||||
AVSC_INLINE int avs_array_size(AVS_Value v)
|
||||
{ return avs_is_array(v) ? v.array_size : 1; }
|
||||
AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index)
|
||||
{ return avs_is_array(v) ? v.d.array[index] : v; }
|
||||
|
||||
// only use these functions on am AVS_Value that does not already have
|
||||
// an active value. Remember, treat AVS_Value as a fat pointer.
|
||||
AVSC_INLINE AVS_Value avs_new_value_bool(int v0)
|
||||
{ AVS_Value v = {0}; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_int(int v0)
|
||||
{ AVS_Value v = {0}; v.type = 'i'; v.d.integer = v0; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_string(const char * v0)
|
||||
{ AVS_Value v = {0}; v.type = 's'; v.d.string = v0; return v; }
|
||||
AVSC_INLINE AVS_Value avs_new_value_float(float v0)
|
||||
{ AVS_Value v = {0}; v.type = 'f'; v.d.floating_pt = v0; return v;}
|
||||
AVSC_INLINE AVS_Value avs_new_value_error(const char * v0)
|
||||
{ AVS_Value v = {0}; v.type = 'e'; v.d.string = v0; return v; }
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0)
|
||||
{ AVS_Value v = {0}; avs_set_to_clip(&v, v0); return v; }
|
||||
#endif
|
||||
AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size)
|
||||
{ AVS_Value v = {0}; v.type = 'a'; v.d.array = v0; v.array_size = size; return v; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_Clip
|
||||
//
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(void, avs_release_clip)(AVS_Clip *);
|
||||
AVSC_API(AVS_Clip *, avs_copy_clip)(AVS_Clip *);
|
||||
|
||||
AVSC_API(const char *, avs_clip_get_error)(AVS_Clip *); // return 0 if no error
|
||||
|
||||
AVSC_API(const AVS_VideoInfo *, avs_get_video_info)(AVS_Clip *);
|
||||
|
||||
AVSC_API(int, avs_get_version)(AVS_Clip *);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_get_frame)(AVS_Clip *, int n);
|
||||
// The returned video frame must be released with avs_release_video_frame
|
||||
|
||||
AVSC_API(int, avs_get_parity)(AVS_Clip *, int n);
|
||||
// return field parity if field_based, else parity of first field in frame
|
||||
|
||||
AVSC_API(int, avs_get_audio)(AVS_Clip *, void * buf,
|
||||
INT64 start, INT64 count);
|
||||
// start and count are in samples
|
||||
|
||||
AVSC_API(int, avs_set_cache_hints)(AVS_Clip *,
|
||||
int cachehints, size_t frame_range);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
// This is the callback type used by avs_add_function
|
||||
typedef AVS_Value (AVSC_CC * AVS_ApplyFunc)
|
||||
(AVS_ScriptEnvironment *, AVS_Value args, void * user_data);
|
||||
|
||||
typedef struct AVS_FilterInfo AVS_FilterInfo;
|
||||
struct AVS_FilterInfo
|
||||
{
|
||||
// these members should not be modified outside of the AVS_ApplyFunc callback
|
||||
AVS_Clip * child;
|
||||
AVS_VideoInfo vi;
|
||||
AVS_ScriptEnvironment * env;
|
||||
AVS_VideoFrame * (AVSC_CC * get_frame)(AVS_FilterInfo *, int n);
|
||||
int (AVSC_CC * get_parity)(AVS_FilterInfo *, int n);
|
||||
int (AVSC_CC * get_audio)(AVS_FilterInfo *, void * buf,
|
||||
INT64 start, INT64 count);
|
||||
int (AVSC_CC * set_cache_hints)(AVS_FilterInfo *, int cachehints,
|
||||
int frame_range);
|
||||
void (AVSC_CC * free_filter)(AVS_FilterInfo *);
|
||||
|
||||
// Should be set when ever there is an error to report.
|
||||
// It is cleared before any of the above methods are called
|
||||
const char * error;
|
||||
// this is to store whatever and may be modified at will
|
||||
void * user_data;
|
||||
};
|
||||
|
||||
// Create a new filter
|
||||
// fi is set to point to the AVS_FilterInfo so that you can
|
||||
// modify it once it is initilized.
|
||||
// store_child should generally be set to true. If it is not
|
||||
// set than ALL methods (the function pointers) must be defined
|
||||
// If it is set than you do not need to worry about freeing the child
|
||||
// clip.
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(AVS_Clip *, avs_new_c_filter)(AVS_ScriptEnvironment * e,
|
||||
AVS_FilterInfo * * fi,
|
||||
AVS_Value child, int store_child);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AVS_ScriptEnvironment
|
||||
//
|
||||
|
||||
// For GetCPUFlags. These are backwards-compatible with those in VirtualDub.
|
||||
enum {
|
||||
/* slowest CPU to support extension */
|
||||
AVS_CPU_FORCE = 0x01, // N/A
|
||||
AVS_CPU_FPU = 0x02, // 386/486DX
|
||||
AVS_CPU_MMX = 0x04, // P55C, K6, PII
|
||||
AVS_CPU_INTEGER_SSE = 0x08, // PIII, Athlon
|
||||
AVS_CPU_SSE = 0x10, // PIII, Athlon XP/MP
|
||||
AVS_CPU_SSE2 = 0x20, // PIV, Hammer
|
||||
AVS_CPU_3DNOW = 0x40, // K6-2
|
||||
AVS_CPU_3DNOW_EXT = 0x80, // Athlon
|
||||
AVS_CPU_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2,
|
||||
// which only Hammer will have anyway)
|
||||
};
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error
|
||||
|
||||
AVSC_API(long, avs_get_cpu_flags)(AVS_ScriptEnvironment *);
|
||||
AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version);
|
||||
|
||||
AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length);
|
||||
AVSC_API(char *, avs_sprintf)(AVS_ScriptEnvironment *, const char * fmt, ...);
|
||||
|
||||
AVSC_API(char *, avs_vsprintf)(AVS_ScriptEnvironment *, const char * fmt, va_list val);
|
||||
// note: val is really a va_list; I hope everyone typedefs va_list to a pointer
|
||||
|
||||
AVSC_API(int, avs_add_function)(AVS_ScriptEnvironment *,
|
||||
const char * name, const char * params,
|
||||
AVS_ApplyFunc apply, void * user_data);
|
||||
|
||||
AVSC_API(int, avs_function_exists)(AVS_ScriptEnvironment *, const char * name);
|
||||
|
||||
AVSC_API(AVS_Value, avs_invoke)(AVS_ScriptEnvironment *, const char * name,
|
||||
AVS_Value args, const char** arg_names);
|
||||
// The returned value must be be released with avs_release_value
|
||||
|
||||
AVSC_API(AVS_Value, avs_get_var)(AVS_ScriptEnvironment *, const char* name);
|
||||
// The returned value must be be released with avs_release_value
|
||||
|
||||
AVSC_API(int, avs_set_var)(AVS_ScriptEnvironment *, const char* name, AVS_Value val);
|
||||
|
||||
AVSC_API(int, avs_set_global_var)(AVS_ScriptEnvironment *, const char* name, const AVS_Value val);
|
||||
|
||||
//void avs_push_context(AVS_ScriptEnvironment *, int level=0);
|
||||
//void avs_pop_context(AVS_ScriptEnvironment *);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *,
|
||||
const AVS_VideoInfo * vi, int align);
|
||||
// align should be at least 16
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef AVSC_NO_DECLSPEC
|
||||
AVSC_INLINE
|
||||
AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env,
|
||||
const AVS_VideoInfo * vi)
|
||||
{return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
|
||||
|
||||
AVSC_INLINE
|
||||
AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env,
|
||||
const AVS_VideoInfo * vi)
|
||||
{return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
|
||||
#endif
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(int, avs_make_writable)(AVS_ScriptEnvironment *, AVS_VideoFrame * * pvf);
|
||||
|
||||
AVSC_API(void, avs_bit_blt)(AVS_ScriptEnvironment *, unsigned char* dstp, int dst_pitch, const unsigned char* srcp, int src_pitch, int row_size, int height);
|
||||
|
||||
typedef void (AVSC_CC *AVS_ShutdownFunc)(void* user_data, AVS_ScriptEnvironment * env);
|
||||
AVSC_API(void, avs_at_exit)(AVS_ScriptEnvironment *, AVS_ShutdownFunc function, void * user_data);
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_subframe)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height);
|
||||
// The returned video frame must be be released
|
||||
|
||||
AVSC_API(int, avs_set_memory_max)(AVS_ScriptEnvironment *, int mem);
|
||||
|
||||
AVSC_API(int, avs_set_working_dir)(AVS_ScriptEnvironment *, const char * newdir);
|
||||
|
||||
// avisynth.dll exports this; it's a way to use it as a library, without
|
||||
// writing an AVS script or without going through AVIFile.
|
||||
AVSC_API(AVS_ScriptEnvironment *, avs_create_script_environment)(int version);
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
// this symbol is the entry point for the plugin and must
|
||||
// be defined
|
||||
AVSC_EXPORT
|
||||
const char * AVSC_CC avisynth_c_plugin_init(AVS_ScriptEnvironment* env);
|
||||
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
AVSC_API(void, avs_delete_script_environment)(AVS_ScriptEnvironment *);
|
||||
|
||||
|
||||
AVSC_API(AVS_VideoFrame *, avs_subframe_planar)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV);
|
||||
// The returned video frame must be be released
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif //__AVXSYNTH_C__
|
||||
85
compat/avisynth/windowsPorts/basicDataTypeConversions.h
Normal file
85
compat/avisynth/windowsPorts/basicDataTypeConversions.h
Normal file
@@ -0,0 +1,85 @@
|
||||
#ifndef __DATA_TYPE_CONVERSIONS_H__
|
||||
#define __DATA_TYPE_CONVERSIONS_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace avxsynth {
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef int64_t __int64;
|
||||
typedef int32_t __int32;
|
||||
#ifdef __cplusplus
|
||||
typedef bool BOOL;
|
||||
#else
|
||||
typedef uint32_t BOOL;
|
||||
#endif // __cplusplus
|
||||
typedef void* HMODULE;
|
||||
typedef void* LPVOID;
|
||||
typedef void* PVOID;
|
||||
typedef PVOID HANDLE;
|
||||
typedef HANDLE HWND;
|
||||
typedef HANDLE HINSTANCE;
|
||||
typedef void* HDC;
|
||||
typedef void* HBITMAP;
|
||||
typedef void* HICON;
|
||||
typedef void* HFONT;
|
||||
typedef void* HGDIOBJ;
|
||||
typedef void* HBRUSH;
|
||||
typedef void* HMMIO;
|
||||
typedef void* HACMSTREAM;
|
||||
typedef void* HACMDRIVER;
|
||||
typedef void* HIC;
|
||||
typedef void* HACMOBJ;
|
||||
typedef HACMSTREAM* LPHACMSTREAM;
|
||||
typedef void* HACMDRIVERID;
|
||||
typedef void* LPHACMDRIVER;
|
||||
typedef unsigned char BYTE;
|
||||
typedef BYTE* LPBYTE;
|
||||
typedef char TCHAR;
|
||||
typedef TCHAR* LPTSTR;
|
||||
typedef const TCHAR* LPCTSTR;
|
||||
typedef char* LPSTR;
|
||||
typedef LPSTR LPOLESTR;
|
||||
typedef const char* LPCSTR;
|
||||
typedef LPCSTR LPCOLESTR;
|
||||
typedef wchar_t WCHAR;
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned int UINT;
|
||||
typedef UINT MMRESULT;
|
||||
typedef uint32_t DWORD;
|
||||
typedef DWORD COLORREF;
|
||||
typedef DWORD FOURCC;
|
||||
typedef DWORD HRESULT;
|
||||
typedef DWORD* LPDWORD;
|
||||
typedef DWORD* DWORD_PTR;
|
||||
typedef int32_t LONG;
|
||||
typedef int32_t* LONG_PTR;
|
||||
typedef LONG_PTR LRESULT;
|
||||
typedef uint32_t ULONG;
|
||||
typedef uint32_t* ULONG_PTR;
|
||||
//typedef __int64_t intptr_t;
|
||||
typedef uint64_t _fsize_t;
|
||||
|
||||
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
|
||||
typedef struct _GUID {
|
||||
DWORD Data1;
|
||||
WORD Data2;
|
||||
WORD Data3;
|
||||
BYTE Data4[8];
|
||||
} GUID;
|
||||
|
||||
typedef GUID REFIID;
|
||||
typedef GUID CLSID;
|
||||
typedef CLSID* LPCLSID;
|
||||
typedef GUID IID;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}; // namespace avxsynth
|
||||
#endif // __cplusplus
|
||||
#endif // __DATA_TYPE_CONVERSIONS_H__
|
||||
77
compat/avisynth/windowsPorts/windows2linux.h
Normal file
77
compat/avisynth/windowsPorts/windows2linux.h
Normal file
@@ -0,0 +1,77 @@
|
||||
#ifndef __WINDOWS2LINUX_H__
|
||||
#define __WINDOWS2LINUX_H__
|
||||
|
||||
/*
|
||||
* LINUX SPECIFIC DEFINITIONS
|
||||
*/
|
||||
//
|
||||
// Data types conversions
|
||||
//
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "basicDataTypeConversions.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace avxsynth {
|
||||
#endif // __cplusplus
|
||||
//
|
||||
// purposefully define the following MSFT definitions
|
||||
// to mean nothing (as they do not mean anything on Linux)
|
||||
//
|
||||
#define __stdcall
|
||||
#define __cdecl
|
||||
#define noreturn
|
||||
#define __declspec(x)
|
||||
#define STDAPI extern "C" HRESULT
|
||||
#define STDMETHODIMP HRESULT __stdcall
|
||||
#define STDMETHODIMP_(x) x __stdcall
|
||||
|
||||
#define STDMETHOD(x) virtual HRESULT x
|
||||
#define STDMETHOD_(a, x) virtual a x
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE true
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE false
|
||||
#endif
|
||||
|
||||
#define S_OK (0x00000000)
|
||||
#define S_FALSE (0x00000001)
|
||||
#define E_NOINTERFACE (0X80004002)
|
||||
#define E_POINTER (0x80004003)
|
||||
#define E_FAIL (0x80004005)
|
||||
#define E_OUTOFMEMORY (0x8007000E)
|
||||
|
||||
#define INVALID_HANDLE_VALUE ((HANDLE)((LONG_PTR)-1))
|
||||
#define FAILED(hr) ((hr) & 0x80000000)
|
||||
#define SUCCEEDED(hr) (!FAILED(hr))
|
||||
|
||||
|
||||
//
|
||||
// Functions
|
||||
//
|
||||
#define MAKEDWORD(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
|
||||
#define MAKEWORD(a,b) (((a) << 8) | (b))
|
||||
|
||||
#define lstrlen strlen
|
||||
#define lstrcpy strcpy
|
||||
#define lstrcmpi strcasecmp
|
||||
#define _stricmp strcasecmp
|
||||
#define InterlockedIncrement(x) __sync_fetch_and_add((x), 1)
|
||||
#define InterlockedDecrement(x) __sync_fetch_and_sub((x), 1)
|
||||
// Windows uses (new, old) ordering but GCC has (old, new)
|
||||
#define InterlockedCompareExchange(x,y,z) __sync_val_compare_and_swap(x,z,y)
|
||||
|
||||
#define UInt32x32To64(a, b) ( (uint64_t) ( ((uint64_t)((uint32_t)(a))) * ((uint32_t)(b)) ) )
|
||||
#define Int64ShrlMod32(a, b) ( (uint64_t) ( (uint64_t)(a) >> (b) ) )
|
||||
#define Int32x32To64(a, b) ((__int64)(((__int64)((long)(a))) * ((long)(b))))
|
||||
|
||||
#define MulDiv(nNumber, nNumerator, nDenominator) (int32_t) (((int64_t) (nNumber) * (int64_t) (nNumerator) + (int64_t) ((nDenominator)/2)) / (int64_t) (nDenominator))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}; // namespace avxsynth
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __WINDOWS2LINUX_H__
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Minimum CUDA compatibility definitions header
|
||||
*
|
||||
* Copyright (c) 2019 rcombs
|
||||
* Copyright (c) 2019 Rodger Combs
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
@@ -49,16 +49,6 @@ typedef struct __device_builtin__ __align__(4) ushort2
|
||||
unsigned short x, y;
|
||||
} ushort2;
|
||||
|
||||
typedef struct __device_builtin__ __align__(8) float2
|
||||
{
|
||||
float x, y;
|
||||
} float2;
|
||||
|
||||
typedef struct __device_builtin__ __align__(8) int2
|
||||
{
|
||||
int x, y;
|
||||
} int2;
|
||||
|
||||
typedef struct __device_builtin__ uint3
|
||||
{
|
||||
unsigned int x, y, z;
|
||||
@@ -66,6 +56,11 @@ typedef struct __device_builtin__ uint3
|
||||
|
||||
typedef struct uint3 dim3;
|
||||
|
||||
typedef struct __device_builtin__ __align__(8) int2
|
||||
{
|
||||
int x, y;
|
||||
} int2;
|
||||
|
||||
typedef struct __device_builtin__ __align__(4) uchar4
|
||||
{
|
||||
unsigned char x, y, z, w;
|
||||
@@ -73,7 +68,7 @@ typedef struct __device_builtin__ __align__(4) uchar4
|
||||
|
||||
typedef struct __device_builtin__ __align__(8) ushort4
|
||||
{
|
||||
unsigned short x, y, z, w;
|
||||
unsigned char x, y, z, w;
|
||||
} ushort4;
|
||||
|
||||
typedef struct __device_builtin__ __align__(16) int4
|
||||
@@ -81,11 +76,6 @@ typedef struct __device_builtin__ __align__(16) int4
|
||||
int x, y, z, w;
|
||||
} int4;
|
||||
|
||||
typedef struct __device_builtin__ __align__(16) float4
|
||||
{
|
||||
float x, y, z, w;
|
||||
} float4;
|
||||
|
||||
// Accessors for special registers
|
||||
#define GETCOMP(reg, comp) \
|
||||
asm("mov.u32 %0, %%" #reg "." #comp ";" : "=r"(tmp)); \
|
||||
@@ -110,31 +100,24 @@ GET(getThreadIdx, tid)
|
||||
#define threadIdx (getThreadIdx())
|
||||
|
||||
// Basic initializers (simple macros rather than inline functions)
|
||||
#define make_int2(a, b) ((int2){.x = a, .y = b})
|
||||
#define make_uchar2(a, b) ((uchar2){.x = a, .y = b})
|
||||
#define make_ushort2(a, b) ((ushort2){.x = a, .y = b})
|
||||
#define make_float2(a, b) ((float2){.x = a, .y = b})
|
||||
#define make_int4(a, b, c, d) ((int4){.x = a, .y = b, .z = c, .w = d})
|
||||
#define make_uchar4(a, b, c, d) ((uchar4){.x = a, .y = b, .z = c, .w = d})
|
||||
#define make_ushort4(a, b, c, d) ((ushort4){.x = a, .y = b, .z = c, .w = d})
|
||||
#define make_float4(a, b, c, d) ((float4){.x = a, .y = b, .z = c, .w = d})
|
||||
|
||||
// Conversions from the tex instruction's 4-register output to various types
|
||||
#define TEX2D(type, ret) static inline __device__ void conv(type* out, unsigned a, unsigned b, unsigned c, unsigned d) {*out = (ret);}
|
||||
|
||||
TEX2D(unsigned char, a & 0xFF)
|
||||
TEX2D(unsigned short, a & 0xFFFF)
|
||||
TEX2D(float, a)
|
||||
TEX2D(uchar2, make_uchar2(a & 0xFF, b & 0xFF))
|
||||
TEX2D(ushort2, make_ushort2(a & 0xFFFF, b & 0xFFFF))
|
||||
TEX2D(float2, make_float2(a, b))
|
||||
TEX2D(uchar4, make_uchar4(a & 0xFF, b & 0xFF, c & 0xFF, d & 0xFF))
|
||||
TEX2D(ushort4, make_ushort4(a & 0xFFFF, b & 0xFFFF, c & 0xFFFF, d & 0xFFFF))
|
||||
TEX2D(float4, make_float4(a, b, c, d))
|
||||
|
||||
// Template calling tex instruction and converting the output to the selected type
|
||||
template<typename T>
|
||||
inline __device__ T tex2D(cudaTextureObject_t texObject, float x, float y)
|
||||
template <class T>
|
||||
static inline __device__ T tex2D(cudaTextureObject_t texObject, float x, float y)
|
||||
{
|
||||
T ret;
|
||||
unsigned ret1, ret2, ret3, ret4;
|
||||
@@ -145,44 +128,4 @@ inline __device__ T tex2D(cudaTextureObject_t texObject, float x, float y)
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
inline __device__ float4 tex2D<float4>(cudaTextureObject_t texObject, float x, float y)
|
||||
{
|
||||
float4 ret;
|
||||
asm("tex.2d.v4.f32.f32 {%0, %1, %2, %3}, [%4, {%5, %6}];" :
|
||||
"=r"(ret.x), "=r"(ret.y), "=r"(ret.z), "=r"(ret.w) :
|
||||
"l"(texObject), "f"(x), "f"(y));
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
inline __device__ float tex2D<float>(cudaTextureObject_t texObject, float x, float y)
|
||||
{
|
||||
return tex2D<float4>(texObject, x, y).x;
|
||||
}
|
||||
|
||||
template<>
|
||||
inline __device__ float2 tex2D<float2>(cudaTextureObject_t texObject, float x, float y)
|
||||
{
|
||||
float4 ret = tex2D<float4>(texObject, x, y);
|
||||
return make_float2(ret.x, ret.y);
|
||||
}
|
||||
|
||||
// Math helper functions
|
||||
static inline __device__ float floorf(float a) { return __builtin_floorf(a); }
|
||||
static inline __device__ float floor(float a) { return __builtin_floorf(a); }
|
||||
static inline __device__ double floor(double a) { return __builtin_floor(a); }
|
||||
static inline __device__ float ceilf(float a) { return __builtin_ceilf(a); }
|
||||
static inline __device__ float ceil(float a) { return __builtin_ceilf(a); }
|
||||
static inline __device__ double ceil(double a) { return __builtin_ceil(a); }
|
||||
static inline __device__ float truncf(float a) { return __builtin_truncf(a); }
|
||||
static inline __device__ float trunc(float a) { return __builtin_truncf(a); }
|
||||
static inline __device__ double trunc(double a) { return __builtin_trunc(a); }
|
||||
static inline __device__ float fabsf(float a) { return __builtin_fabsf(a); }
|
||||
static inline __device__ float fabs(float a) { return __builtin_fabsf(a); }
|
||||
static inline __device__ double fabs(double a) { return __builtin_fabs(a); }
|
||||
|
||||
static inline __device__ float __sinf(float a) { return __nvvm_sin_approx_f(a); }
|
||||
static inline __device__ float __cosf(float a) { return __nvvm_cos_approx_f(a); }
|
||||
|
||||
#endif /* COMPAT_CUDA_CUDA_RUNTIME_H */
|
||||
|
||||
@@ -27,8 +27,10 @@ IN="$2"
|
||||
NAME="$(basename "$IN" | sed 's/\..*//')"
|
||||
|
||||
printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
|
||||
echo >> "$OUT"
|
||||
sed -e "$(printf 's/\r//g')" -e 's/["\\]/\\&/g' -e "$(printf 's/^/\t"/')" -e 's/$/\\n"/' < "$IN" >> "$OUT"
|
||||
echo ";" >> "$OUT"
|
||||
while IFS= read -r LINE
|
||||
do
|
||||
printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed -e 's/\r//g' -e 's/["\\]/\\&/g')" >> "$OUT"
|
||||
done < "$IN"
|
||||
printf ";\n" >> "$OUT"
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -27,19 +27,15 @@
|
||||
#define COMPAT_OS2THREADS_H
|
||||
|
||||
#define INCL_DOS
|
||||
#define INCL_DOSERRORS
|
||||
#include <os2.h>
|
||||
|
||||
#undef __STRICT_ANSI__ /* for _beginthread() */
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <sys/builtin.h>
|
||||
#include <sys/fmutex.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/time.h"
|
||||
|
||||
typedef struct {
|
||||
TID tid;
|
||||
@@ -167,28 +163,6 @@ static av_always_inline int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_cond_timedwait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex,
|
||||
const struct timespec *abstime)
|
||||
{
|
||||
int64_t abs_milli = abstime->tv_sec * 1000LL + abstime->tv_nsec / 1000000;
|
||||
ULONG t = av_clip64(abs_milli - av_gettime() / 1000, 0, ULONG_MAX);
|
||||
|
||||
__atomic_increment(&cond->wait_count);
|
||||
|
||||
pthread_mutex_unlock(mutex);
|
||||
|
||||
APIRET ret = DosWaitEventSem(cond->event_sem, t);
|
||||
|
||||
__atomic_decrement(&cond->wait_count);
|
||||
|
||||
DosPostEventSem(cond->ack_sem);
|
||||
|
||||
pthread_mutex_lock(mutex);
|
||||
|
||||
return (ret == ERROR_TIMEOUT) ? ETIMEDOUT : 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_cond_wait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex)
|
||||
{
|
||||
|
||||
@@ -38,13 +38,11 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/time.h"
|
||||
|
||||
typedef struct pthread_t {
|
||||
void *handle;
|
||||
@@ -63,9 +61,6 @@ typedef CONDITION_VARIABLE pthread_cond_t;
|
||||
#define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
|
||||
#define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
|
||||
|
||||
#define PTHREAD_CANCEL_ENABLE 1
|
||||
#define PTHREAD_CANCEL_DISABLE 0
|
||||
|
||||
static av_unused unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
|
||||
{
|
||||
pthread_t *h = (pthread_t*)arg;
|
||||
@@ -161,31 +156,10 @@ static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
const struct timespec *abstime)
|
||||
{
|
||||
int64_t abs_milli = abstime->tv_sec * 1000LL + abstime->tv_nsec / 1000000;
|
||||
DWORD t = av_clip64(abs_milli - av_gettime() / 1000, 0, UINT32_MAX);
|
||||
|
||||
if (!SleepConditionVariableSRW(cond, mutex, t, 0)) {
|
||||
DWORD err = GetLastError();
|
||||
if (err == ERROR_TIMEOUT)
|
||||
return ETIMEDOUT;
|
||||
else
|
||||
return EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
WakeConditionVariable(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_setcancelstate(int state, int *oldstate)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* COMPAT_W32PTHREADS_H */
|
||||
|
||||
245
doc/APIchanges
245
doc/APIchanges
@@ -15,251 +15,6 @@ libavutil: 2017-10-21
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
-------- 8< --------- FFmpeg 4.4 was cut here -------- 8< ---------
|
||||
|
||||
2021-03-19 - e8c0bca6bd - lavu 56.69.100 - adler32.h
|
||||
Added a typedef for the type of the Adler-32 checksums
|
||||
used by av_adler32_update(). It will be changed to uint32_t
|
||||
at the next major bump.
|
||||
The type of the parameter for the length of the input buffer
|
||||
will also be changed to size_t at the next major bump.
|
||||
|
||||
2021-03-19 - e318438f2f - lavf 58.75.100 - avformat.h
|
||||
AVChapter.id will be changed from int to int64_t
|
||||
on the next major version bump.
|
||||
|
||||
2021-03-17 - f7db77bd87 - lavc 58.133.100 - codec.h
|
||||
Deprecated av_init_packet(). Once removed, sizeof(AVPacket) will
|
||||
no longer be a part of the public ABI.
|
||||
Deprecated AVPacketList.
|
||||
|
||||
2021-03-16 - 7d09579190 - lavc 58.132.100 - codec.h
|
||||
Add AV_CODEC_CAP_OTHER_THREADS as a new name for
|
||||
AV_CODEC_CAP_AUTO_THREADS. AV_CODEC_CAP_AUTO_THREADS
|
||||
is now deprecated.
|
||||
|
||||
2021-03-12 - 6e7e3a3820 - lavc 58.131.100 - avcodec.h codec.h
|
||||
Add a get_encode_buffer callback to AVCodecContext, similar to
|
||||
get_buffer2 but for encoders.
|
||||
Add avcodec_default_get_encode_buffer().
|
||||
Add AV_GET_ENCODE_BUFFER_FLAG_REF.
|
||||
Encoders may now be flagged as AV_CODEC_CAP_DR1 capable.
|
||||
|
||||
2021-03-10 - 42e68fe015 - lavf 58.72.100 - avformat.h
|
||||
Change AVBufferRef related AVStream function and struct size
|
||||
parameter and fields type to size_t at next major bump.
|
||||
|
||||
2021-03-10 - d79e0fe65c - lavc 58.130.100 - packet.h
|
||||
Change AVBufferRef related AVPacket function and struct size
|
||||
parameter and fields type to size_t at next major bump.
|
||||
|
||||
2021-03-10 - 14040a1d91 - lavu 56.68.100 - buffer.h frame.h
|
||||
Change AVBufferRef and relevant AVFrame function and struct size
|
||||
parameter and fields type to size_t at next major bump.
|
||||
|
||||
2021-03-04 - a0eec776b6 - lavc 58.128.101 - avcodec.h
|
||||
Enable err_recognition to be set for encoders.
|
||||
|
||||
2021-03-03 - 2ff40b98ec - lavf 58.70.100 - avformat.h
|
||||
Deprecate AVFMT_FLAG_PRIV_OPT. It will do nothing
|
||||
as soon as av_demuxer_open() is removed.
|
||||
|
||||
2021-02-27 - dd9227e48f - lavc 58.126.100 - avcodec.h
|
||||
Deprecated avcodec_get_frame_class().
|
||||
|
||||
2021-02-21 - 5ca40d6d94 - lavu 56.66.100 - tx.h
|
||||
Add enum AVTXFlags and AVTXFlags.AV_TX_INPLACE
|
||||
|
||||
2021-02-14 - 4f49ca7bbc - lavd 58.12.100 - avdevice.h
|
||||
Deprecated avdevice_capabilities_create() and
|
||||
avdevice_capabilities_free().
|
||||
|
||||
2021-02-10 - 1bda9bb68a - lavu 56.65.100 - common.h
|
||||
Add FFABS64U()
|
||||
|
||||
2021-01-26 - 5dd9567080 - lavu 56.64.100 - common.h
|
||||
Add FFABSU()
|
||||
|
||||
2021-01-25 - 56709ca8aa - lavc 58.119.100 - avcodec.h
|
||||
Deprecate AVCodecContext.debug_mv, FF_DEBUG_VIS_MV_P_FOR, FF_DEBUG_VIS_MV_B_FOR,
|
||||
FF_DEBUG_VIS_MV_B_BACK
|
||||
|
||||
2021-01-11 - ebdd33086a - lavc 58.116.100 - avcodec.h
|
||||
Add FF_PROFILE_VVC_MAIN_10 and FF_PROFILE_VVC_MAIN_10_444.
|
||||
|
||||
2020-01-01 - baecaa16c1 - lavu 56.63.100 - video_enc_params.h
|
||||
Add AV_VIDEO_ENC_PARAMS_MPEG2
|
||||
|
||||
2020-12-03 - eca12f4d5a - lavu 56.62.100 - timecode.h
|
||||
Add av_timecode_init_from_components.
|
||||
|
||||
2020-11-27 - a83098ab03 - lavc 58.114.100 - avcodec.h
|
||||
Deprecate AVCodecContext.thread_safe_callbacks. Starting with
|
||||
LIBAVCODEC_VERSION_MAJOR=60, user callbacks must always be
|
||||
thread-safe when frame threading is used.
|
||||
|
||||
2020-11-25 - d243dd540a - lavc 58.113.100 - avcodec.h
|
||||
Adds a new flag AV_CODEC_EXPORT_DATA_FILM_GRAIN for export_side_data.
|
||||
|
||||
2020-11-25 - 4f9ee87253 - lavu 56.61.100 - film_grain_params.h
|
||||
Adds a new API for extracting codec film grain parameters as side data.
|
||||
Adds a new AVFrameSideDataType entry AV_FRAME_DATA_FILM_GRAIN_PARAMS for it.
|
||||
|
||||
2020-10-28 - f95d9510ff - lavf 58.64.100 - avformat.h
|
||||
Add AVSTREAM_EVENT_FLAG_NEW_PACKETS.
|
||||
|
||||
2020-09-28 - 68918d3b7f - lavu 56.60.100 - buffer.h
|
||||
Add a av_buffer_replace() convenience function.
|
||||
|
||||
2020-09-13 - 837b6eb90e - lavu 56.59.100 - timecode.h
|
||||
Add av_timecode_make_smpte_tc_string2.
|
||||
|
||||
2020-08-21 - 06f2651204 - lavu 56.58.100 - avstring.h
|
||||
Deprecate av_d2str(). Use av_asprintf() instead.
|
||||
|
||||
2020-08-04 - 34de0abbe7 - lavu 56.58.100 - channel_layout.h
|
||||
Add AV_CH_LAYOUT_22POINT2 together with its newly required pieces:
|
||||
AV_CH_TOP_SIDE_LEFT, AV_CH_TOP_SIDE_RIGHT, AV_CH_BOTTOM_FRONT_CENTER,
|
||||
AV_CH_BOTTOM_FRONT_LEFT, AV_CH_BOTTOM_FRONT_RIGHT.
|
||||
|
||||
2020-07-23 - 84655b7101 - lavu 56.57.100 - cpu.h
|
||||
Add AV_CPU_FLAG_MMI and AV_CPU_FLAG_MSA.
|
||||
|
||||
2020-07-22 - 3a8e927176 - lavu 56.56.100 - imgutils.h
|
||||
Add av_image_fill_plane_sizes().
|
||||
|
||||
2020-07-15 - 448a9aaa78 - lavc 58.96.100 - packet.h
|
||||
Add AV_PKT_DATA_S12M_TIMECODE.
|
||||
|
||||
2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
|
||||
Add AV_PIX_FMT_X2RGB10.
|
||||
|
||||
2020-06-11 - bc8ab084fb - lavu 56.54.100 - frame.h
|
||||
Add AV_FRAME_DATA_SEI_UNREGISTERED.
|
||||
|
||||
2020-06-10 - 1b4a98b029 - lavu 56.53.100 - log.h opt.h
|
||||
Add av_opt_child_class_iterate() and AVClass.child_class_iterate().
|
||||
Deprecate av_opt_child_class_next() and AVClass.child_class_next().
|
||||
|
||||
-------- 8< --------- FFmpeg 4.3 was cut here -------- 8< ---------
|
||||
|
||||
2020-06-05 - ec39c2276a - lavu 56.50.100 - buffer.h
|
||||
Passing NULL as alloc argument to av_buffer_pool_init2() is now allowed.
|
||||
|
||||
2020-05-27 - ba6cada92e - lavc 58.88.100 - avcodec.h codec.h
|
||||
Move AVCodec-related public API to new header codec.h.
|
||||
|
||||
2020-05-23 - 064b875e89 - lavu 56.49.100 - video_enc_params.h
|
||||
Add AV_VIDEO_ENC_PARAMS_H264.
|
||||
|
||||
2020-05-23 - 2e08b39444 - lavu 56.48.100 - hwcontext.h
|
||||
Add av_hwdevice_ctx_create_derived_opts.
|
||||
|
||||
2020-05-23 - 6b65c4ec54 - lavu 56.47.100 - rational.h
|
||||
Add av_gcd_q().
|
||||
|
||||
2020-05-22 - af9e622776 - lavu 56.46.101 - opt.h
|
||||
Add AV_OPT_FLAG_CHILD_CONSTS.
|
||||
|
||||
2020-05-22 - 9d443c3e68 - lavc 58.87.100 - avcodec.h codec_par.h
|
||||
Move AVBitstreamFilter-related public API to new header bsf.h.
|
||||
Move AVCodecParameters-related public API to new header codec_par.h.
|
||||
|
||||
2020-05-21 - 13b1bbff0b - lavc 58.86.101 - avcodec.h
|
||||
Deprecated AV_CODEC_CAP_INTRA_ONLY and AV_CODEC_CAP_LOSSLESS.
|
||||
|
||||
2020-05-17 - 84af196c65 - lavu 56.46.100 - common.h
|
||||
Add av_sat_add64() and av_sat_sub64()
|
||||
|
||||
2020-05-12 - 991d417692 - lavu 56.45.100 - video_enc_params.h
|
||||
lavc 58.84.100 - avcodec.h
|
||||
Add a new API for exporting video encoding information.
|
||||
Replaces the deprecated API for exporting QP tables from decoders.
|
||||
Add AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS to request this information from
|
||||
decoders.
|
||||
|
||||
2020-05-10 - dccd07f66d - lavu 56.44.100 - hwcontext_vulkan.h
|
||||
Add enabled_inst_extensions, num_enabled_inst_extensions, enabled_dev_extensions
|
||||
and num_enabled_dev_extensions fields to AVVulkanDeviceContext
|
||||
|
||||
2020-04-22 - 0e1db79e37 - lavc 58.81.100 - packet.h
|
||||
- lavu 56.43.100 - dovi_meta.h
|
||||
Add AV_PKT_DATA_DOVI_CONF and AVDOVIDecoderConfigurationRecord.
|
||||
|
||||
2020-04-15 - 22b25b3ea5 - lavc 58.79.100 - avcodec.h
|
||||
Add formal support for calling avcodec_flush_buffers() on encoders.
|
||||
Encoders that set the cap AV_CODEC_CAP_ENCODER_FLUSH will be flushed.
|
||||
For all other encoders, the call is now a no-op rather than undefined
|
||||
behaviour.
|
||||
|
||||
2020-04-10 - 672946c7fe - lavc 58.78.100 - avcodec.h codec_desc.h codec_id.h packet.h
|
||||
Move AVCodecDesc-related public API to new header codec_desc.h.
|
||||
Move AVCodecID enum to new header codec_id.h.
|
||||
Move AVPacket-related public API to new header packet.h.
|
||||
|
||||
2020-03-29 - 4cb0dda555 - lavf 58.42.100 - avformat.h
|
||||
av_read_frame() now guarantees to handle uninitialized input packets
|
||||
and to return refcounted packets on success.
|
||||
|
||||
2020-03-27 - c52ec0367d - lavc 58.77.100 - avcodec.h
|
||||
av_packet_ref() now guarantees to return the destination packet
|
||||
in a blank state on error.
|
||||
|
||||
2020-03-10 - 05d27f342b - lavc 58.75.100 - avcodec.h
|
||||
Add AV_PKT_DATA_ICC_PROFILE.
|
||||
|
||||
2020-02-21 - d005a7cdfd - lavc 58.73.101 - avcodec.h
|
||||
Add AV_CODEC_EXPORT_DATA_PRFT.
|
||||
|
||||
2020-02-21 - c666689491 - lavc 58.73.100 - avcodec.h
|
||||
Add AVCodecContext.export_side_data and AV_CODEC_EXPORT_DATA_MVS.
|
||||
|
||||
2020-02-13 - e8f054b095 - lavu 56.41.100 - tx.h
|
||||
Add AV_TX_INT32_FFT and AV_TX_INT32_MDCT
|
||||
|
||||
2020-02-12 - 3182114f88 - lavu 56.40.100 - log.h
|
||||
Add av_log_once().
|
||||
|
||||
2020-02-04 - a88449ffb2 - lavu 56.39.100 - hwcontext.h
|
||||
Add AV_PIX_FMT_VULKAN
|
||||
Add AV_HWDEVICE_TYPE_VULKAN and implementation.
|
||||
|
||||
2020-01-30 - 27529eeb27 - lavf 58.37.100 - avio.h
|
||||
Add avio_protocol_get_class().
|
||||
|
||||
2020-01-15 - 717b2074ec - lavc 58.66.100 - avcodec.h
|
||||
Add AV_PKT_DATA_PRFT and AVProducerReferenceTime.
|
||||
|
||||
2019-12-27 - 45259a0ee4 - lavu 56.38.100 - eval.h
|
||||
Add av_expr_count_func().
|
||||
|
||||
2019-12-26 - 16685114d5 - lavu 56.37.100 - buffer.h
|
||||
Add av_buffer_pool_buffer_get_opaque().
|
||||
|
||||
2019-11-17 - 1c23abc88f - lavu 56.36.100 - eval API
|
||||
Add av_expr_count_vars().
|
||||
|
||||
2019-10-14 - f3746d31f9 - lavu 56.35.101 - opt.h
|
||||
Add AV_OPT_FLAG_RUNTIME_PARAM.
|
||||
|
||||
2019-09-25 - f8406ab4b9 - lavc 58.59.100 - avcodec.h
|
||||
Add max_samples
|
||||
|
||||
2019-09-04 - 2a9d461abc - lavu 56.35.100 - hwcontext_videotoolbox.h
|
||||
Add av_map_videotoolbox_format_from_pixfmt2() for full range pixfmt
|
||||
|
||||
2019-09-01 - 8821d1f56e - lavu 56.34.100 - pixfmt.h
|
||||
Add EBU Tech. 3213-E AVColorPrimaries value
|
||||
|
||||
2019-08-17 - 95fa73a2b4 - lavf 58.31.101 - avio.h
|
||||
4K limit removed from avio_printf.
|
||||
|
||||
2019-08-17 - a82f8f2f10 - lavf 58.31.100 - avio.h
|
||||
Add avio_print_string_array and avio_print.
|
||||
|
||||
2019-07-27 - 42e2319ba9 - lavu 56.33.100 - tx.h
|
||||
Add AV_TX_DOUBLE_FFT and AV_TX_DOUBLE_MDCT
|
||||
|
||||
-------- 8< --------- FFmpeg 4.2 was cut here -------- 8< ---------
|
||||
|
||||
2019-06-21 - a30e44098a - lavu 56.30.100 - frame.h
|
||||
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = 4.2.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -224,10 +224,6 @@ Insert or remove AUD NAL units in all access units of the stream.
|
||||
@item sample_aspect_ratio
|
||||
Set the sample aspect ratio of the stream in the VUI parameters.
|
||||
|
||||
@item overscan_appropriate_flag
|
||||
Set whether the stream is suitable for display using overscan
|
||||
or not (see H.264 section E.2.1).
|
||||
|
||||
@item video_format
|
||||
@item video_full_range_flag
|
||||
Set the video format in the stream (see H.264 section E.2.1 and
|
||||
@@ -548,36 +544,6 @@ ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
|
||||
@section null
|
||||
This bitstream filter passes the packets through unchanged.
|
||||
|
||||
@section pcm_rechunk
|
||||
|
||||
Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
|
||||
rate per second. This is similar to the @ref{asetnsamples,,asetnsamples audio
|
||||
filter,ffmpeg-filters} but works on audio packets instead of audio frames.
|
||||
|
||||
@table @option
|
||||
@item nb_out_samples, n
|
||||
Set the number of samples per each output audio packet. The number is intended
|
||||
as the number of samples @emph{per each channel}. Default value is 1024.
|
||||
|
||||
@item pad, p
|
||||
If set to 1, the filter will pad the last audio packet with silence, so that it
|
||||
will contain the same number of samples (or roughly the same number of samples,
|
||||
see @option{frame_rate}) as the previous ones. Default value is 1.
|
||||
|
||||
@item frame_rate, r
|
||||
This option makes the filter output a fixed number of packets per second instead
|
||||
of a fixed number of samples per packet. If the audio sample rate is not
|
||||
divisible by the frame rate then the number of samples will not be constant but
|
||||
will vary slightly so that each packet will start as close to the frame
|
||||
boundary as possible. Using this option has precedence over @option{nb_out_samples}.
|
||||
@end table
|
||||
|
||||
You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
|
||||
for NTSC frame rate using the @option{frame_rate} option.
|
||||
@example
|
||||
ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
|
||||
@end example
|
||||
|
||||
@section prores_metadata
|
||||
|
||||
Modify color property metadata embedded in prores stream.
|
||||
@@ -619,10 +585,6 @@ Keep the same transfer characteristics property (default).
|
||||
@item unknown
|
||||
@item bt709
|
||||
BT 601, BT 709, BT 2020
|
||||
@item smpte2084
|
||||
SMPTE ST 2084
|
||||
@item arib-std-b67
|
||||
ARIB STD-B67
|
||||
@end table
|
||||
|
||||
|
||||
@@ -632,7 +594,7 @@ Available values are:
|
||||
|
||||
@table @samp
|
||||
@item auto
|
||||
Keep the same colorspace property (default).
|
||||
Keep the same transfer characteristics property (default).
|
||||
|
||||
@item unknown
|
||||
@item bt709
|
||||
@@ -648,11 +610,6 @@ Set Rec709 colorspace for each frame of the file
|
||||
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
|
||||
@end example
|
||||
|
||||
Set Hybrid Log-Gamma parameters for each frame of the file
|
||||
@example
|
||||
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
|
||||
@end example
|
||||
|
||||
@section remove_extra
|
||||
|
||||
Remove extradata from packets.
|
||||
@@ -675,63 +632,6 @@ Remove extradata from all frames.
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@section setts
|
||||
Set PTS and DTS in packets.
|
||||
|
||||
It accepts the following parameters:
|
||||
@table @option
|
||||
@item ts
|
||||
@item pts
|
||||
@item dts
|
||||
Set expressions for PTS, DTS or both.
|
||||
@end table
|
||||
|
||||
The expressions are evaluated through the eval API and can contain the following
|
||||
constants:
|
||||
|
||||
@table @option
|
||||
@item N
|
||||
The count of the input packet. Starting from 0.
|
||||
|
||||
@item TS
|
||||
The demux timestamp in input in case of @code{ts} or @code{dts} option or presentation
|
||||
timestamp in case of @code{pts} option.
|
||||
|
||||
@item POS
|
||||
The original position in the file of the packet, or undefined if undefined
|
||||
for the current packet
|
||||
|
||||
@item DTS
|
||||
The demux timestamp in input.
|
||||
|
||||
@item PTS
|
||||
The presentation timestamp in input.
|
||||
|
||||
@item STARTDTS
|
||||
The DTS of the first packet.
|
||||
|
||||
@item STARTPTS
|
||||
The PTS of the first packet.
|
||||
|
||||
@item PREV_INDTS
|
||||
The previous input DTS.
|
||||
|
||||
@item PREV_INPTS
|
||||
The previous input PTS.
|
||||
|
||||
@item PREV_OUTDTS
|
||||
The previous output DTS.
|
||||
|
||||
@item PREV_OUTPTS
|
||||
The previous output PTS.
|
||||
|
||||
@item TB
|
||||
The timebase of stream packet belongs.
|
||||
|
||||
@item SR
|
||||
The sample rate of stream packet belongs.
|
||||
@end table
|
||||
|
||||
@anchor{text2movsub}
|
||||
@section text2movsub
|
||||
|
||||
@@ -759,9 +659,7 @@ Modify metadata embedded in a VP9 stream.
|
||||
|
||||
@table @option
|
||||
@item color_space
|
||||
Set the color space value in the frame header. Note that any frame
|
||||
set to RGB will be implicitly set to PC range and that RGB is
|
||||
incompatible with profiles 0 and 2.
|
||||
Set the color space value in the frame header.
|
||||
@table @samp
|
||||
@item unknown
|
||||
@item bt601
|
||||
@@ -773,8 +671,8 @@ incompatible with profiles 0 and 2.
|
||||
@end table
|
||||
|
||||
@item color_range
|
||||
Set the color range value in the frame header. Note that any value
|
||||
imposed by the color space will take precedence over this value.
|
||||
Set the color range value in the frame header. Note that this cannot
|
||||
be set in RGB streams.
|
||||
@table @samp
|
||||
@item tv
|
||||
@item pc
|
||||
|
||||
@@ -48,8 +48,6 @@ config
|
||||
tools/target_dec_<decoder>_fuzzer
|
||||
Build fuzzer to fuzz the specified decoder.
|
||||
|
||||
tools/target_bsf_<filter>_fuzzer
|
||||
Build fuzzer to fuzz the specified bitstream filter.
|
||||
|
||||
Useful standard make commands:
|
||||
make -t <target>
|
||||
|
||||
216
doc/codecs.texi
216
doc/codecs.texi
@@ -50,10 +50,11 @@ Use internal 2pass ratecontrol in first pass mode.
|
||||
Use internal 2pass ratecontrol in second pass mode.
|
||||
@item gray
|
||||
Only decode/encode grayscale.
|
||||
@item emu_edge
|
||||
Do not draw edges.
|
||||
@item psnr
|
||||
Set error[?] variables during encoding.
|
||||
@item truncated
|
||||
Input bitstream might be randomly truncated.
|
||||
@item drop_changed
|
||||
Don't output frames whose parameters differ from first decoded frame in stream.
|
||||
Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
|
||||
@@ -70,14 +71,50 @@ This ensures that file and data checksums are reproducible and match between
|
||||
platforms. Its primary use is for regression testing.
|
||||
@item aic
|
||||
Apply H263 advanced intra coding / mpeg4 ac prediction.
|
||||
@item cbp
|
||||
Deprecated, use mpegvideo private options instead.
|
||||
@item qprd
|
||||
Deprecated, use mpegvideo private options instead.
|
||||
@item ilme
|
||||
Apply interlaced motion estimation.
|
||||
@item cgop
|
||||
Use closed gop.
|
||||
@item output_corrupt
|
||||
Output even potentially corrupted frames.
|
||||
@end table
|
||||
|
||||
@item me_method @var{integer} (@emph{encoding,video})
|
||||
Set motion estimation method.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item zero
|
||||
zero motion estimation (fastest)
|
||||
@item full
|
||||
full motion estimation (slowest)
|
||||
@item epzs
|
||||
EPZS motion estimation (default)
|
||||
@item esa
|
||||
esa motion estimation (alias for full)
|
||||
@item tesa
|
||||
tesa motion estimation
|
||||
@item dia
|
||||
dia motion estimation (alias for epzs)
|
||||
@item log
|
||||
log motion estimation
|
||||
@item phods
|
||||
phods motion estimation
|
||||
@item x1
|
||||
X1 motion estimation
|
||||
@item hex
|
||||
hex motion estimation
|
||||
@item umh
|
||||
umh motion estimation
|
||||
@item iter
|
||||
iter motion estimation
|
||||
@end table
|
||||
|
||||
@item extradata_size @var{integer}
|
||||
Set extradata size.
|
||||
|
||||
@item time_base @var{rational number}
|
||||
Set codec time base.
|
||||
|
||||
@@ -144,6 +181,9 @@ Default value is 0.
|
||||
@item b_qfactor @var{float} (@emph{encoding,video})
|
||||
Set qp factor between P and B frames.
|
||||
|
||||
@item rc_strategy @var{integer} (@emph{encoding,video})
|
||||
Set ratecontrol method.
|
||||
|
||||
@item b_strategy @var{integer} (@emph{encoding,video})
|
||||
Set strategy to choose between I/P/B-frames.
|
||||
|
||||
@@ -167,6 +207,8 @@ Possible values:
|
||||
@table @samp
|
||||
@item autodetect
|
||||
|
||||
@item old_msmpeg4
|
||||
some old lavc generated msmpeg4v3 files (no autodetection)
|
||||
@item xvid_ilace
|
||||
Xvid interlacing bug (autodetected if fourcc==XVIX)
|
||||
@item ump4
|
||||
@@ -175,6 +217,8 @@ Xvid interlacing bug (autodetected if fourcc==XVIX)
|
||||
padding bug (autodetected)
|
||||
@item amv
|
||||
|
||||
@item ac_vlc
|
||||
illegal vlc bug (autodetected per fourcc)
|
||||
@item qpel_chroma
|
||||
|
||||
@item std_qpel
|
||||
@@ -195,6 +239,14 @@ Workaround various bugs in microsoft broken decoders.
|
||||
trancated frames
|
||||
@end table
|
||||
|
||||
@item lelim @var{integer} (@emph{encoding,video})
|
||||
Set single coefficient elimination threshold for luminance (negative
|
||||
values also consider DC coefficient).
|
||||
|
||||
@item celim @var{integer} (@emph{encoding,video})
|
||||
Set single coefficient elimination threshold for chrominance (negative
|
||||
values also consider dc coefficient)
|
||||
|
||||
@item strict @var{integer} (@emph{decoding/encoding,audio,video})
|
||||
Specify how strictly to follow the standards.
|
||||
|
||||
@@ -251,8 +303,26 @@ consider things that a sane encoder should not do as an error
|
||||
@item mpeg_quant @var{integer} (@emph{encoding,video})
|
||||
Use MPEG quantizers instead of H.263.
|
||||
|
||||
@item qsquish @var{float} (@emph{encoding,video})
|
||||
How to keep quantizer between qmin and qmax (0 = clip, 1 = use
|
||||
differentiable function).
|
||||
|
||||
@item rc_qmod_amp @var{float} (@emph{encoding,video})
|
||||
Set experimental quantizer modulation.
|
||||
|
||||
@item rc_qmod_freq @var{integer} (@emph{encoding,video})
|
||||
Set experimental quantizer modulation.
|
||||
|
||||
@item rc_override_count @var{integer}
|
||||
|
||||
@item rc_eq @var{string} (@emph{encoding,video})
|
||||
Set rate control equation. When computing the expression, besides the
|
||||
standard functions defined in the section 'Expression Evaluation', the
|
||||
following functions are available: bits2qp(bits), qp2bits(qp). Also
|
||||
the following constants are available: iTex pTex tex mv fCode iCount
|
||||
mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
|
||||
avgTex.
|
||||
|
||||
@item maxrate @var{integer} (@emph{encoding,audio,video})
|
||||
Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
|
||||
|
||||
@@ -263,12 +333,18 @@ encode. It is of little use elsewise.
|
||||
@item bufsize @var{integer} (@emph{encoding,audio,video})
|
||||
Set ratecontrol buffer size (in bits).
|
||||
|
||||
@item rc_buf_aggressivity @var{float} (@emph{encoding,video})
|
||||
Currently useless.
|
||||
|
||||
@item i_qfactor @var{float} (@emph{encoding,video})
|
||||
Set QP factor between P and I frames.
|
||||
|
||||
@item i_qoffset @var{float} (@emph{encoding,video})
|
||||
Set QP offset between P and I frames.
|
||||
|
||||
@item rc_init_cplx @var{float} (@emph{encoding,video})
|
||||
Set initial complexity for 1-pass encoding.
|
||||
|
||||
@item dct @var{integer} (@emph{encoding,video})
|
||||
Set DCT algorithm.
|
||||
|
||||
@@ -333,7 +409,11 @@ Automatically pick a IDCT compatible with the simple one
|
||||
|
||||
@item simpleneon
|
||||
|
||||
@item xvid
|
||||
@item simplealpha
|
||||
|
||||
@item ipp
|
||||
|
||||
@item xvidmmx
|
||||
|
||||
@item faani
|
||||
floating point AAN IDCT
|
||||
@@ -563,24 +643,6 @@ noise preserving sum of squared differences
|
||||
|
||||
@item dia_size @var{integer} (@emph{encoding,video})
|
||||
Set diamond type & size for motion estimation.
|
||||
@table @samp
|
||||
@item (1024, INT_MAX)
|
||||
full motion estimation(slowest)
|
||||
@item (768, 1024]
|
||||
umh motion estimation
|
||||
@item (512, 768]
|
||||
hex motion estimation
|
||||
@item (256, 512]
|
||||
l2s diamond motion estimation
|
||||
@item [2,256]
|
||||
var diamond motion estimation
|
||||
@item (-1, 2)
|
||||
small diamond motion estimation
|
||||
@item -1
|
||||
funny diamond motion estimation
|
||||
@item (INT_MIN, -1)
|
||||
sab diamond motion estimation
|
||||
@end table
|
||||
|
||||
@item last_pred @var{integer} (@emph{encoding,video})
|
||||
Set amount of motion predictors from the previous frame.
|
||||
@@ -631,9 +693,19 @@ Set diamond type & size for motion estimation pre-pass.
|
||||
@item subq @var{integer} (@emph{encoding,video})
|
||||
Set sub pel motion estimation quality.
|
||||
|
||||
@item dtg_active_format @var{integer}
|
||||
|
||||
@item me_range @var{integer} (@emph{encoding,video})
|
||||
Set limit motion vectors range (1023 for DivX player).
|
||||
|
||||
@item ibias @var{integer} (@emph{encoding,video})
|
||||
Set intra quant bias.
|
||||
|
||||
@item pbias @var{integer} (@emph{encoding,video})
|
||||
Set inter quant bias.
|
||||
|
||||
@item color_table_id @var{integer}
|
||||
|
||||
@item global_quality @var{integer} (@emph{encoding,audio,video})
|
||||
|
||||
@item coder @var{integer} (@emph{encoding,video})
|
||||
@@ -648,6 +720,8 @@ arithmetic coder
|
||||
raw (no encoding)
|
||||
@item rle
|
||||
run-length coder
|
||||
@item deflate
|
||||
deflate-based coder
|
||||
@end table
|
||||
|
||||
@item context @var{integer} (@emph{encoding,video})
|
||||
@@ -668,9 +742,17 @@ use fewest bits
|
||||
use best rate distortion
|
||||
@end table
|
||||
|
||||
@item stream_codec_tag @var{integer}
|
||||
|
||||
@item sc_threshold @var{integer} (@emph{encoding,video})
|
||||
Set scene change threshold.
|
||||
|
||||
@item lmin @var{integer} (@emph{encoding,video})
|
||||
Set min lagrange factor (VBR).
|
||||
|
||||
@item lmax @var{integer} (@emph{encoding,video})
|
||||
Set max lagrange factor (VBR).
|
||||
|
||||
@item nr @var{integer} (@emph{encoding,video})
|
||||
Set noise reduction.
|
||||
|
||||
@@ -678,12 +760,14 @@ Set noise reduction.
|
||||
Set number of bits which should be loaded into the rc buffer before
|
||||
decoding starts.
|
||||
|
||||
@item flags2 @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
|
||||
@item flags2 @var{flags} (@emph{decoding/encoding,audio,video})
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item fast
|
||||
Allow non spec compliant speedup tricks.
|
||||
@item sgop
|
||||
Deprecated, use mpegvideo private options instead.
|
||||
@item noout
|
||||
Skip bitstream encoding.
|
||||
@item ignorecrop
|
||||
@@ -697,29 +781,12 @@ Show all frames before the first keyframe.
|
||||
@item export_mvs
|
||||
Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS})
|
||||
for codecs that support it. See also @file{doc/examples/export_mvs.c}.
|
||||
@item skip_manual
|
||||
Do not skip samples and export skip information as frame side data.
|
||||
@item ass_ro_flush_noop
|
||||
Do not reset ASS ReadOrder field on flush.
|
||||
@end table
|
||||
|
||||
@item export_side_data @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
|
||||
@item error @var{integer} (@emph{encoding,video})
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item mvs
|
||||
Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS})
|
||||
for codecs that support it. See also @file{doc/examples/export_mvs.c}.
|
||||
@item prft
|
||||
Export encoder Producer Reference Time into packet side-data (see @code{AV_PKT_DATA_PRFT})
|
||||
for codecs that support it.
|
||||
@item venc_params
|
||||
Export video encoding parameters through frame side data (see @code{AV_FRAME_DATA_VIDEO_ENC_PARAMS})
|
||||
for codecs that support it. At present, those are H.264 and VP9.
|
||||
@item film_grain
|
||||
Export film grain parameters through frame side data (see @code{AV_FRAME_DATA_FILM_GRAIN_PARAMS}).
|
||||
Supported at present by AV1 decoders.
|
||||
@end table
|
||||
@item qns @var{integer} (@emph{encoding,video})
|
||||
Deprecated, use mpegvideo private options instead.
|
||||
|
||||
@item threads @var{integer} (@emph{decoding/encoding,video})
|
||||
Set the number of threads to be used, in case the selected codec
|
||||
@@ -733,6 +800,12 @@ automatically select the number of threads to set
|
||||
|
||||
Default value is @samp{auto}.
|
||||
|
||||
@item me_threshold @var{integer} (@emph{encoding,video})
|
||||
Set motion estimation threshold.
|
||||
|
||||
@item mb_threshold @var{integer} (@emph{encoding,video})
|
||||
Set macroblock threshold.
|
||||
|
||||
@item dc @var{integer} (@emph{encoding,video})
|
||||
Set intra_dc_precision.
|
||||
|
||||
@@ -747,8 +820,49 @@ Set number of macroblock rows at the bottom which are skipped.
|
||||
|
||||
@item profile @var{integer} (@emph{encoding,audio,video})
|
||||
|
||||
Set encoder codec profile. Default value is @samp{unknown}. Encoder specific
|
||||
profiles are documented in the relevant encoder documentation.
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item unknown
|
||||
|
||||
@item aac_main
|
||||
|
||||
@item aac_low
|
||||
|
||||
@item aac_ssr
|
||||
|
||||
@item aac_ltp
|
||||
|
||||
@item aac_he
|
||||
|
||||
@item aac_he_v2
|
||||
|
||||
@item aac_ld
|
||||
|
||||
@item aac_eld
|
||||
|
||||
@item mpeg2_aac_low
|
||||
|
||||
@item mpeg2_aac_he
|
||||
|
||||
@item mpeg4_sp
|
||||
|
||||
@item mpeg4_core
|
||||
|
||||
@item mpeg4_main
|
||||
|
||||
@item mpeg4_asp
|
||||
|
||||
@item dts
|
||||
|
||||
@item dts_es
|
||||
|
||||
@item dts_96_24
|
||||
|
||||
@item dts_hd_hra
|
||||
|
||||
@item dts_hd_ma
|
||||
|
||||
@end table
|
||||
|
||||
@item level @var{integer} (@emph{encoding,audio,video})
|
||||
|
||||
@@ -810,6 +924,9 @@ noise preserving sum of squared differences
|
||||
|
||||
@end table
|
||||
|
||||
@item border_mask @var{float} (@emph{encoding,video})
|
||||
Increase the quantizer for macroblocks close to borders.
|
||||
|
||||
@item mblmin @var{integer} (@emph{encoding,video})
|
||||
Set min macroblock lagrange factor (VBR).
|
||||
|
||||
@@ -883,6 +1000,9 @@ Adjust sensitivity of b_frame_strategy 1.
|
||||
@item timecode_frame_start @var{integer} (@emph{encoding,video})
|
||||
Set GOP timecode frame start number, in non drop frame format.
|
||||
|
||||
@item request_channels @var{integer} (@emph{decoding,audio})
|
||||
Set desired number of audio channels.
|
||||
|
||||
@item bits_per_raw_sample @var{integer}
|
||||
@item channel_layout @var{integer} (@emph{decoding/encoding,audio})
|
||||
|
||||
@@ -996,12 +1116,6 @@ BT.2020 NCL
|
||||
BT.2020 CL
|
||||
@item smpte2085
|
||||
SMPTE 2085
|
||||
@item chroma-derived-nc
|
||||
Chroma-derived NCL
|
||||
@item chroma-derived-c
|
||||
Chroma-derived CL
|
||||
@item ictcp
|
||||
ICtCp
|
||||
@end table
|
||||
|
||||
@item color_range @var{integer} (@emph{decoding/encoding,video})
|
||||
|
||||
@@ -25,19 +25,6 @@ enabled decoders.
|
||||
A description of some of the currently available video decoders
|
||||
follows.
|
||||
|
||||
@section av1
|
||||
|
||||
AOMedia Video 1 (AV1) decoder.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item operating_point
|
||||
Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
|
||||
|
||||
@end table
|
||||
|
||||
@section rawvideo
|
||||
|
||||
Raw video decoder.
|
||||
@@ -70,7 +57,7 @@ You need to explicitly configure the build with @code{--enable-libdav1d}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are supported by the libdav1d wrapper.
|
||||
The following option is supported by the libdav1d wrapper.
|
||||
|
||||
@table @option
|
||||
|
||||
@@ -81,15 +68,8 @@ Set amount of frame threads to use during decoding. The default value is 0 (auto
|
||||
Set amount of tile threads to use during decoding. The default value is 0 (autodetect).
|
||||
|
||||
@item filmgrain
|
||||
Apply film grain to the decoded video if present in the bitstream. Defaults to the
|
||||
internal default of the library.
|
||||
|
||||
@item oppoint
|
||||
Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
|
||||
internal default of the library.
|
||||
|
||||
@item alllayers
|
||||
Output all spatial layers of a scalable AV1 bitstream. The default value is false.
|
||||
Apply film grain to the decoded video if present in the bitstream. The default value
|
||||
is true.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -101,27 +81,6 @@ This decoder allows libavcodec to decode AVS2 streams with davs2 library.
|
||||
|
||||
@c man end VIDEO DECODERS
|
||||
|
||||
@section libuavs3d
|
||||
|
||||
AVS3-P2/IEEE1857.10 video decoder.
|
||||
|
||||
libuavs3d allows libavcodec to decode AVS3 streams.
|
||||
Requires the presence of the libuavs3d headers and library during configuration.
|
||||
You need to explicitly configure the build with @code{--enable-libuavs3d}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following option is supported by the libuavs3d wrapper.
|
||||
|
||||
@table @option
|
||||
|
||||
@item frame_threads
|
||||
Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
|
||||
|
||||
@end table
|
||||
|
||||
@c man end VIDEO DECODERS
|
||||
|
||||
@chapter Audio Decoders
|
||||
@c man begin AUDIO DECODERS
|
||||
|
||||
@@ -141,7 +100,7 @@ the undocumented RealAudio 3 (a.k.a. dnet).
|
||||
|
||||
@item -drc_scale @var{value}
|
||||
Dynamic Range Scale Factor. The factor to apply to dynamic range values
|
||||
from the AC-3 stream. This factor is applied exponentially. The default value is 1.
|
||||
from the AC-3 stream. This factor is applied exponentially.
|
||||
There are 3 notable scale factor ranges:
|
||||
@table @option
|
||||
@item drc_scale == 0
|
||||
@@ -321,7 +280,7 @@ palette is stored in the IFO file, and therefore not available when reading
|
||||
from dumped VOB files.
|
||||
|
||||
The format for this option is a string containing 16 24-bits hexadecimal
|
||||
numbers (without 0x prefix) separated by commas, for example @code{0d00ee,
|
||||
numbers (without 0x prefix) separated by comas, for example @code{0d00ee,
|
||||
ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
|
||||
7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
|
||||
|
||||
@@ -350,11 +309,6 @@ List of teletext page numbers to decode. Pages that do not match the specified
|
||||
list are dropped. You may use the special @code{*} string to match all pages,
|
||||
or @code{subtitle} to match all subtitle pages.
|
||||
Default value is *.
|
||||
@item txt_default_region
|
||||
Set default character set used for decoding, a value between 0 and 87 (see
|
||||
ETS 300 706, Section 15, Table 32). Default value is -1, which does not
|
||||
override the libzvbi default. This option is needed for some legacy level 1.0
|
||||
transmissions which cannot signal the proper charset.
|
||||
@item txt_chop_top
|
||||
Discards the top teletext line. Default value is 1.
|
||||
@item txt_format
|
||||
|
||||
@@ -331,10 +331,6 @@ segment index to start live streams at (negative values are from the end).
|
||||
Maximum number of times a insufficient list is attempted to be reloaded.
|
||||
Default value is 1000.
|
||||
|
||||
@item m3u8_hold_counters
|
||||
The maximum number of times to load m3u8 when it refreshes without new segments.
|
||||
Default value is 1000.
|
||||
|
||||
@item http_persistent
|
||||
Use persistent HTTP connections. Applicable only for HTTP streams.
|
||||
Enabled by default.
|
||||
@@ -342,10 +338,6 @@ Enabled by default.
|
||||
@item http_multiple
|
||||
Use multiple HTTP connections for downloading HTTP segments.
|
||||
Enabled by default for HTTP/1.1 servers.
|
||||
|
||||
@item http_seekable
|
||||
Use HTTP partial requests for downloading HTTP segments.
|
||||
0 = disable, 1 = enable, -1 = auto, Default is auto.
|
||||
@end table
|
||||
|
||||
@section image2
|
||||
@@ -456,17 +448,6 @@ nanosecond precision.
|
||||
@item video_size
|
||||
Set the video size of the images to read. If not specified the video
|
||||
size is guessed from the first image file in the sequence.
|
||||
@item export_path_metadata
|
||||
If set to 1, will add two extra fields to the metadata found in input, making them
|
||||
also available for other filters (see @var{drawtext} filter for examples). Default
|
||||
value is 0. The extra fields are described below:
|
||||
@table @option
|
||||
@item lavf.image2dec.source_path
|
||||
Corresponds to the full path to the input file being read.
|
||||
@item lavf.image2dec.source_basename
|
||||
Corresponds to the name of the file being read.
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -604,13 +585,9 @@ Set the sample rate for libopenmpt to output.
|
||||
Range is from 1000 to INT_MAX. The value default is 48000.
|
||||
@end table
|
||||
|
||||
@section mov/mp4/3gp
|
||||
@section mov/mp4/3gp/QuickTime
|
||||
|
||||
Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12).
|
||||
|
||||
Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
|
||||
|
||||
@subsection Options
|
||||
QuickTime / MP4 demuxer.
|
||||
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
@@ -621,73 +598,10 @@ Enabling this can theoretically leak information in some use cases.
|
||||
@item use_absolute_path
|
||||
Allows loading of external tracks via absolute paths, disabled by default.
|
||||
Enabling this poses a security risk. It should only be enabled if the source
|
||||
is known to be non-malicious.
|
||||
is known to be non malicious.
|
||||
|
||||
@item seek_streams_individually
|
||||
When seeking, identify the closest point in each stream individually and demux packets in
|
||||
that stream from identified point. This can lead to a different sequence of packets compared
|
||||
to demuxing linearly from the beginning. Default is true.
|
||||
|
||||
@item ignore_editlist
|
||||
Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
|
||||
timeline described by the edit list. Default is false.
|
||||
|
||||
@item advanced_editlist
|
||||
Modify the stream index to reflect the timeline described by the edit list. @code{ignore_editlist}
|
||||
must be set to false for this option to be effective.
|
||||
If both @code{ignore_editlist} and this option are set to false, then only the
|
||||
start of the stream index is modified to reflect initial dwell time or starting timestamp
|
||||
described by the edit list. Default is true.
|
||||
|
||||
@item ignore_chapters
|
||||
Don't parse chapters. This includes GoPro 'HiLight' tags/moments. Note that chapters are
|
||||
only parsed when input is seekable. Default is false.
|
||||
|
||||
@item use_mfra_for
|
||||
For seekable fragmented input, set fragment's starting timestamp from media fragment random access box, if present.
|
||||
|
||||
Following options are available:
|
||||
@table @samp
|
||||
@item auto
|
||||
Auto-detect whether to set mfra timestamps as PTS or DTS @emph{(default)}
|
||||
|
||||
@item dts
|
||||
Set mfra timestamps as DTS
|
||||
|
||||
@item pts
|
||||
Set mfra timestamps as PTS
|
||||
|
||||
@item 0
|
||||
Don't use mfra box to set timestamps
|
||||
@end table
|
||||
|
||||
@item export_all
|
||||
Export unrecognized boxes within the @var{udta} box as metadata entries. The first four
|
||||
characters of the box type are set as the key. Default is false.
|
||||
|
||||
@item export_xmp
|
||||
Export entire contents of @var{XMP_} box and @var{uuid} box as a string with key @code{xmp}. Note that
|
||||
if @code{export_all} is set and this option isn't, the contents of @var{XMP_} box are still exported
|
||||
but with key @code{XMP_}. Default is false.
|
||||
|
||||
@item activation_bytes
|
||||
4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
|
||||
|
||||
@item audible_fixed_key
|
||||
Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
|
||||
specify.
|
||||
|
||||
@item decryption_key
|
||||
16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
|
||||
@end table
|
||||
|
||||
@subsection Audible AAX
|
||||
|
||||
Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
|
||||
@example
|
||||
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
|
||||
@end example
|
||||
|
||||
@section mpegts
|
||||
|
||||
MPEG-2 transport stream demuxer.
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
# FFmpeg project
|
||||
|
||||
## Organisation
|
||||
|
||||
The FFmpeg project is organized through a community working on global consensus.
|
||||
|
||||
Decisions are taken by the ensemble of active members, through voting and
|
||||
are aided by two committees.
|
||||
|
||||
## General Assembly
|
||||
|
||||
The ensemble of active members is called the General Assembly (GA).
|
||||
|
||||
The General Assembly is sovereign and legitimate for all its decisions
|
||||
regarding the FFmpeg project.
|
||||
|
||||
The General Assembly is made up of active contributors.
|
||||
|
||||
Contributors are considered "active contributors" if they have pushed more
|
||||
than 20 patches in the last 36 months in the main FFmpeg repository, or
|
||||
if they have been voted in by the GA.
|
||||
|
||||
Additional members are added to the General Assembly through a vote after
|
||||
proposal by a member of the General Assembly.
|
||||
They are part of the GA for two years, after which they need a confirmation by
|
||||
the GA.
|
||||
|
||||
## Voting
|
||||
|
||||
Voting is done using a ranked voting system, currently running on https://vote.ffmpeg.org/ .
|
||||
|
||||
Majority vote means more than 50% of the expressed ballots.
|
||||
|
||||
## Technical Committee
|
||||
|
||||
The Technical Committee (TC) is here to arbitrate and make decisions when
|
||||
technical conflicts occur in the project.
|
||||
They will consider the merits of all the positions, judge them and make a
|
||||
decision.
|
||||
|
||||
The TC resolves technical conflicts but is not a technical steering committee.
|
||||
|
||||
Decisions by the TC are binding for all the contributors.
|
||||
|
||||
Decisions made by the TC can be re-opened after 1 year or by a majority vote
|
||||
of the General Assembly, requested by one of the member of the GA.
|
||||
|
||||
The TC is elected by the General Assembly for a duration of 1 year, and
|
||||
is composed of 5 members.
|
||||
Members can be re-elected if they wish. A majority vote in the General Assembly
|
||||
can trigger a new election of the TC.
|
||||
|
||||
The members of the TC can be elected from outside of the GA.
|
||||
Candidates for election can either be suggested or self-nominated.
|
||||
|
||||
The conflict resolution process is detailed in the [resolution process](resolution_process.md) document.
|
||||
|
||||
## Community committee
|
||||
|
||||
The Community Committee (CC) is here to arbitrage and make decisions when
|
||||
inter-personal conflicts occur in the project. It will decide quickly and
|
||||
take actions, for the sake of the project.
|
||||
|
||||
The CC can remove privileges of offending members, including removal of
|
||||
commit access and temporary ban from the community.
|
||||
|
||||
Decisions made by the CC can be re-opened after 1 year or by a majority vote
|
||||
of the General Assembly. Indefinite bans from the community must be confirmed
|
||||
by the General Assembly, in a majority vote.
|
||||
|
||||
The CC is elected by the General Assembly for a duration of 1 year, and is
|
||||
composed of 5 members.
|
||||
Members can be re-elected if they wish. A majority vote in the General Assembly
|
||||
can trigger a new election of the CC.
|
||||
|
||||
The members of the CC can be elected from outside of the GA.
|
||||
Candidates for election can either be suggested or self-nominated.
|
||||
|
||||
The CC is governed by and responsible for enforcing the Code of Conduct.
|
||||
@@ -1,91 +0,0 @@
|
||||
# Technical Committee
|
||||
|
||||
_This document only makes sense with the rules from [the community document](community)_.
|
||||
|
||||
The Technical Committee (**TC**) is here to arbitrate and make decisions when
|
||||
technical conflicts occur in the project.
|
||||
|
||||
The TC main role is to resolve technical conflicts.
|
||||
It is therefore not a technical steering committee, but it is understood that
|
||||
some decisions might impact the future of the project.
|
||||
|
||||
# Process
|
||||
|
||||
## Seizing
|
||||
|
||||
The TC can take possession of any technical matter that it sees fit.
|
||||
|
||||
To involve the TC in a matter, email tc@ or CC them on an ongoing discussion.
|
||||
|
||||
As members of TC are developers, they also can email tc@ to raise an issue.
|
||||
|
||||
## Announcement
|
||||
|
||||
The TC, once seized, must announce itself on the main mailing list, with a _[TC]_ tag.
|
||||
|
||||
The TC has 2 modes of operation: a RFC one and an internal one.
|
||||
|
||||
If the TC thinks it needs the input from the larger community, the TC can call
|
||||
for a RFC. Else, it can decide by itself.
|
||||
|
||||
If the disagreement involves a member of the TC, that member should recuse
|
||||
themselves from the decision.
|
||||
|
||||
The decision to use a RFC process or an internal discussion is a discretionary
|
||||
decision of the TC.
|
||||
|
||||
The TC can also reject a seizure for a few reasons such as:
|
||||
the matter was not discussed enough previously; it lacks expertise to reach a
|
||||
beneficial decision on the matter; or the matter is too trivial.
|
||||
|
||||
### RFC call
|
||||
|
||||
In the RFC mode, one person from the TC posts on the mailing list the
|
||||
technical question and will request input from the community.
|
||||
|
||||
The mail will have the following specification:
|
||||
* a precise title
|
||||
* a specific tag [TC RFC]
|
||||
* a top-level email
|
||||
* contain a precise question that does not exceed 100 words and that is answerable by developers
|
||||
* may have an extra description, or a link to a previous discussion, if deemed necessary,
|
||||
* contain a precise end date for the answers.
|
||||
|
||||
The answers from the community must be on the main mailing list and must have
|
||||
the following specification:
|
||||
* keep the tag and the title unchanged
|
||||
* limited to 400 words
|
||||
* a first-level, answering directly to the main email
|
||||
* answering to the question.
|
||||
|
||||
Further replies to answers are permitted, as long as they conform to the
|
||||
community standards of politeness, they are limited to 100 words, and are not
|
||||
nested more than once. (max-depth=2)
|
||||
|
||||
After the end-date, mails on the thread will be ignored.
|
||||
|
||||
Violations of those rules will be escalated through the Community Committee.
|
||||
|
||||
After all the emails are in, the TC has 96 hours to give its final decision.
|
||||
Exceptionally, the TC can request an extra delay, that will be notified on the
|
||||
mailing list.
|
||||
|
||||
### Within TC
|
||||
|
||||
In the internal case, the TC has 96 hours to give its final decision.
|
||||
Exceptionally, the TC can request an extra delay.
|
||||
|
||||
|
||||
## Decisions
|
||||
|
||||
The decisions from the TC will be sent on the mailing list, with the _[TC]_ tag.
|
||||
|
||||
Internally, the TC should take decisions with a majority, or using
|
||||
ranked-choice voting.
|
||||
|
||||
The decision from the TC should be published with a summary of the reasons that
|
||||
lead to this decision.
|
||||
|
||||
The decisions from the TC are final, until the matters are reopened after
|
||||
no less than one year.
|
||||
|
||||
@@ -131,9 +131,6 @@ compound literals (@samp{x = (struct s) @{ 17, 23 @};}).
|
||||
@item
|
||||
for loops with variable definition (@samp{for (int i = 0; i < 8; i++)});
|
||||
|
||||
@item
|
||||
Variadic macros (@samp{#define ARRAY(nb, ...) (int[nb + 1])@{ nb, __VA_ARGS__ @}});
|
||||
|
||||
@item
|
||||
Implementation defined behavior for signed integers is assumed to match the
|
||||
expected behavior for two's complement. Non representable values in integer
|
||||
@@ -625,7 +622,7 @@ If the patch fixes a bug, did you provide a verbose analysis of the bug?
|
||||
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 @url{https://streams.videolan.org/upload/}.
|
||||
URL, you can upload to ftp://upload.ffmpeg.org.
|
||||
|
||||
@item
|
||||
Did you provide a verbose summary about what the patch does change?
|
||||
|
||||
@@ -30,7 +30,11 @@ follows.
|
||||
|
||||
Advanced Audio Coding (AAC) encoder.
|
||||
|
||||
This encoder is the default AAC encoder, natively implemented into FFmpeg.
|
||||
This encoder is the default AAC encoder, natively implemented into FFmpeg. Its
|
||||
quality is on par or better than libfdk_aac at the default bitrate of 128kbps.
|
||||
This encoder also implements more options, profiles and samplerates than
|
||||
other encoders (with only the AAC-HE profile pending to be implemented) so this
|
||||
encoder has become the default and is the recommended choice.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@@ -151,9 +155,10 @@ the undocumented RealAudio 3 (a.k.a. dnet).
|
||||
The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
|
||||
encoder only uses fixed-point integer math. This does not mean that one is
|
||||
always faster, just that one or the other may be better suited to a
|
||||
particular system. The @var{ac3_fixed} encoder is not the default codec for
|
||||
any of the output formats, so it must be specified explicitly using the option
|
||||
@code{-acodec ac3_fixed} in order to use it.
|
||||
particular system. The floating-point encoder will generally produce better
|
||||
quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
|
||||
default codec for any of the output formats, so it must be specified explicitly
|
||||
using the option @code{-acodec ac3_fixed} in order to use it.
|
||||
|
||||
@subsection AC-3 Metadata
|
||||
|
||||
@@ -646,7 +651,10 @@ configuration. You need to explicitly configure the build with
|
||||
so if you allow the use of GPL, you should configure with
|
||||
@code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
|
||||
|
||||
This encoder has support for the AAC-HE profiles.
|
||||
This encoder is considered to produce output on par or worse at 128kbps to the
|
||||
@ref{aacenc,,the native FFmpeg AAC encoder} but can often produce better
|
||||
sounding audio at identical or lower bitrates and has support for the
|
||||
AAC-HE profiles.
|
||||
|
||||
VBR encoding, enabled through the @option{vbr} or @option{flags
|
||||
+qscale} options, is experimental and only works with some
|
||||
@@ -952,11 +960,6 @@ The default is 20ms.
|
||||
@item packet_loss (@emph{expect-loss})
|
||||
Set expected packet loss percentage. The default is 0.
|
||||
|
||||
@item fec (@emph{n/a})
|
||||
Enable inband forward error correction. @option{packet_loss} must be non-zero
|
||||
to take advantage - frequency of FEC 'side-data' is proportional to expected packet loss.
|
||||
Default is disabled.
|
||||
|
||||
@item application (N.A.)
|
||||
Set intended application type. Valid options are listed below:
|
||||
|
||||
@@ -1184,6 +1187,53 @@ transient response is a higher bitrate.
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{libwavpack}
|
||||
@section libwavpack
|
||||
|
||||
A wrapper providing WavPack encoding through libwavpack.
|
||||
|
||||
Only lossless mode using 32-bit integer samples is supported currently.
|
||||
|
||||
Requires the presence of the libwavpack headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libwavpack}.
|
||||
|
||||
Note that a libavcodec-native encoder for the WavPack codec exists so users can
|
||||
encode audios with this codec without using this encoder. See @ref{wavpackenc}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@command{wavpack} command line utility's corresponding options are listed in
|
||||
parentheses, if any.
|
||||
|
||||
@table @option
|
||||
@item frame_size (@emph{--blocksize})
|
||||
Default is 32768.
|
||||
|
||||
@item compression_level
|
||||
Set speed vs. compression tradeoff. Acceptable arguments are listed below:
|
||||
|
||||
@table @samp
|
||||
@item 0 (@emph{-f})
|
||||
Fast mode.
|
||||
|
||||
@item 1
|
||||
Normal (default) settings.
|
||||
|
||||
@item 2 (@emph{-h})
|
||||
High quality.
|
||||
|
||||
@item 3 (@emph{-hh})
|
||||
Very high quality.
|
||||
|
||||
@item 4-8 (@emph{-hh -x}@var{EXTRAPROC})
|
||||
Same as @samp{3}, but with extra processing enabled.
|
||||
|
||||
@samp{4} is the same as @option{-x2} and @samp{8} is the same as @option{-x6}.
|
||||
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@anchor{mjpegenc}
|
||||
@section mjpeg
|
||||
|
||||
@@ -1210,6 +1260,11 @@ Compute and use optimal huffman tables.
|
||||
|
||||
WavPack lossless audio encoder.
|
||||
|
||||
This is a libavcodec-native WavPack encoder. There is also an encoder based on
|
||||
libwavpack, but there is virtually no reason to use that encoder.
|
||||
|
||||
See also @ref{libwavpack}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The equivalent options for @command{wavpack} command line utility are listed in
|
||||
@@ -1230,6 +1285,7 @@ For the complete formula of calculating default, see
|
||||
@file{libavcodec/wavpackenc.c}.
|
||||
|
||||
@item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x})
|
||||
This option's syntax is consistent with @ref{libwavpack}'s.
|
||||
@end table
|
||||
|
||||
@subsubsection Private options
|
||||
@@ -1268,44 +1324,6 @@ disabled
|
||||
A description of some of the currently available video encoders
|
||||
follows.
|
||||
|
||||
@section GIF
|
||||
|
||||
GIF image/animation encoder.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item gifflags @var{integer}
|
||||
Sets the flags used for GIF encoding.
|
||||
|
||||
@table @option
|
||||
@item offsetting
|
||||
Enables picture offsetting.
|
||||
|
||||
Default is enabled.
|
||||
|
||||
@item transdiff
|
||||
Enables transparency detection between frames.
|
||||
|
||||
Default is enabled.
|
||||
|
||||
@end table
|
||||
|
||||
@item gifimage @var{integer}
|
||||
Enables encoding one full GIF image per frame, rather than an animated GIF.
|
||||
|
||||
Default value is @option{0}.
|
||||
|
||||
@item global_palette @var{integer}
|
||||
Writes a palette to the global GIF header where feasible.
|
||||
|
||||
If disabled, every frame will always have a palette written, even if there
|
||||
is a global palette supplied.
|
||||
|
||||
Default value is @option{1}.
|
||||
|
||||
@end table
|
||||
|
||||
@section Hap
|
||||
|
||||
Vidvox Hap video encoder.
|
||||
@@ -1354,101 +1372,10 @@ can be selected with @code{-pred 1}.
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item format @var{integer}
|
||||
@item format
|
||||
Can be set to either @code{j2k} or @code{jp2} (the default) that
|
||||
makes it possible to store non-rgb pix_fmts.
|
||||
|
||||
@item tile_width @var{integer}
|
||||
Sets tile width. Range is 1 to 1073741824. Default is 256.
|
||||
|
||||
@item tile_height @var{integer}
|
||||
Sets tile height. Range is 1 to 1073741824. Default is 256.
|
||||
|
||||
@item pred @var{integer}
|
||||
Allows setting the discrete wavelet transform (DWT) type
|
||||
@table @option
|
||||
@item dwt97int (Lossy)
|
||||
@item dwt53 (Lossless)
|
||||
@end table
|
||||
Default is @code{dwt97int}
|
||||
|
||||
@item sop @var{boolean}
|
||||
Enable this to add SOP marker at the start of each packet. Disabled by default.
|
||||
|
||||
@item eph @var{boolean}
|
||||
Enable this to add EPH marker at the end of each packet header. Disabled by default.
|
||||
|
||||
@item prog @var{integer}
|
||||
Sets the progression order to be used by the encoder.
|
||||
Possible values are:
|
||||
@table @option
|
||||
@item lrcp
|
||||
@item rlcp
|
||||
@item rpcl
|
||||
@item pcrl
|
||||
@item cprl
|
||||
@end table
|
||||
Set to @code{lrcp} by default.
|
||||
|
||||
@item layer_rates @var{string}
|
||||
By default, when this option is not used, compression is done using the quality metric.
|
||||
This option allows for compression using compression ratio. The compression ratio for each
|
||||
level could be specified. The compression ratio of a layer @code{l} species the what ratio of
|
||||
total file size is contained in the first @code{l} layers.
|
||||
|
||||
Example usage:
|
||||
|
||||
@example
|
||||
ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k
|
||||
@end example
|
||||
|
||||
This would compress the image to contain 3 layers, where the data contained in the
|
||||
first layer would be compressed by 1000 times, compressed by 100 in the first two layers,
|
||||
and shall contain all data while using all 3 layers.
|
||||
|
||||
@end table
|
||||
|
||||
@section librav1e
|
||||
|
||||
rav1e AV1 encoder wrapper.
|
||||
|
||||
Requires the presence of the rav1e headers and library during configuration.
|
||||
You need to explicitly configure the build with @code{--enable-librav1e}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item qmax
|
||||
Sets the maximum quantizer to use when using bitrate mode.
|
||||
|
||||
@item qmin
|
||||
Sets the minimum quantizer to use when using bitrate mode.
|
||||
|
||||
@item qp
|
||||
Uses quantizer mode to encode at the given quantizer (0-255).
|
||||
|
||||
@item speed
|
||||
Selects the speed preset (0-10) to encode with.
|
||||
|
||||
@item tiles
|
||||
Selects how many tiles to encode with.
|
||||
|
||||
@item tile-rows
|
||||
Selects how many rows of tiles to encode with.
|
||||
|
||||
@item tile-columns
|
||||
Selects how many columns of tiles to encode with.
|
||||
|
||||
@item rav1e-params
|
||||
Set rav1e options using a list of @var{key}=@var{value} pairs separated
|
||||
by ":". See @command{rav1e --help} for a list of options.
|
||||
|
||||
For example to specify librav1e encoding options with @option{-rav1e-params}:
|
||||
|
||||
@example
|
||||
ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
|
||||
@end example
|
||||
|
||||
@end table
|
||||
|
||||
@section libaom-av1
|
||||
@@ -1538,15 +1465,6 @@ Complexity-based.
|
||||
Cyclic refresh.
|
||||
@end table
|
||||
|
||||
@item tune (@emph{tune})
|
||||
Set the distortion metric the encoder is tuned with. Default is @code{psnr}.
|
||||
|
||||
@table @samp
|
||||
@item psnr (@emph{0})
|
||||
|
||||
@item ssim (@emph{1})
|
||||
@end table
|
||||
|
||||
@item lag-in-frames
|
||||
Set the maximum number of frames which the encoder may keep in flight
|
||||
at any one time for lookahead purposes. Defaults to the internal
|
||||
@@ -1626,9 +1544,6 @@ Enable row based multi-threading. Disabled by default.
|
||||
Enable Constrained Directional Enhancement Filter. The libaom-av1
|
||||
encoder enables CDEF by default.
|
||||
|
||||
@item enable-restoration (@emph{boolean})
|
||||
Enable Loop Restoration Filter. Default is true for libaom-av1.
|
||||
|
||||
@item enable-global-motion (@emph{boolean})
|
||||
Enable the use of global motion for block prediction. Default is true.
|
||||
|
||||
@@ -1636,165 +1551,6 @@ Enable the use of global motion for block prediction. Default is true.
|
||||
Enable block copy mode for intra block prediction. This mode is
|
||||
useful for screen content. Default is true.
|
||||
|
||||
@item enable-rect-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable rectangular partitions. Default is true.
|
||||
|
||||
@item enable-1to4-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable 1:4/4:1 partitions. Default is true.
|
||||
|
||||
@item enable-ab-partitions (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable AB shape partitions. Default is true.
|
||||
|
||||
@item enable-angle-delta (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable angle delta intra prediction. Default is true.
|
||||
|
||||
@item enable-cfl-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable chroma predicted from luma intra prediction. Default is true.
|
||||
|
||||
@item enable-filter-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable filter intra predictor. Default is true.
|
||||
|
||||
@item enable-intra-edge-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable intra edge filter. Default is true.
|
||||
|
||||
@item enable-smooth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable smooth intra prediction mode. Default is true.
|
||||
|
||||
@item enable-paeth-intra (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable paeth predictor in intra prediction. Default is true.
|
||||
|
||||
@item enable-palette (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable palette prediction mode. Default is true.
|
||||
|
||||
@item enable-flip-idtx (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST,
|
||||
FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT,
|
||||
V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true.
|
||||
|
||||
@item enable-tx64 (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable 64-pt transform. Default is true.
|
||||
|
||||
@item reduced-tx-type-set (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Use reduced set of transform types. Default is false.
|
||||
|
||||
@item use-intra-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Use DCT only for INTRA modes. Default is false.
|
||||
|
||||
@item use-inter-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Use DCT only for INTER modes. Default is false.
|
||||
|
||||
@item use-intra-default-tx-only (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Use Default-transform only for INTRA modes. Default is false.
|
||||
|
||||
@item enable-ref-frame-mvs (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable temporal mv prediction. Default is true.
|
||||
|
||||
@item enable-reduced-reference-set (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Use reduced set of single and compound references. Default is false.
|
||||
|
||||
@item enable-obmc (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable obmc. Default is true.
|
||||
|
||||
@item enable-dual-filter (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable dual filter. Default is true.
|
||||
|
||||
@item enable-diff-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable difference-weighted compound. Default is true.
|
||||
|
||||
@item enable-dist-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable distance-weighted compound. Default is true.
|
||||
|
||||
@item enable-onesided-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable one sided compound. Default is true.
|
||||
|
||||
@item enable-interinter-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable interinter wedge compound. Default is true.
|
||||
|
||||
@item enable-interintra-wedge (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable interintra wedge compound. Default is true.
|
||||
|
||||
@item enable-masked-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable masked compound. Default is true.
|
||||
|
||||
@item enable-interintra-comp (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable interintra compound. Default is true.
|
||||
|
||||
@item enable-smooth-interintra (@emph{boolean}) (Requires libaom >= v2.0.0)
|
||||
Enable smooth interintra mode. Default is true.
|
||||
|
||||
@item aom-params
|
||||
Set libaom options using a list of @var{key}=@var{value} pairs separated
|
||||
by ":". For a list of supported options, see @command{aomenc --help} under the
|
||||
section "AV1 Specific Options".
|
||||
|
||||
For example to specify libaom encoding options with @option{-aom-params}:
|
||||
|
||||
@example
|
||||
ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
|
||||
@end example
|
||||
|
||||
@end table
|
||||
|
||||
@section libsvtav1
|
||||
|
||||
SVT-AV1 encoder wrapper.
|
||||
|
||||
Requires the presence of the SVT-AV1 headers and library during configuration.
|
||||
You need to explicitly configure the build with @code{--enable-libsvtav1}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item profile
|
||||
Set the encoding profile.
|
||||
|
||||
@item level
|
||||
Set the operating point level.
|
||||
|
||||
@item tier
|
||||
Set the operating point tier.
|
||||
|
||||
@item rc
|
||||
Set the rate control mode to use.
|
||||
|
||||
Possible modes:
|
||||
@table @option
|
||||
@item cqp
|
||||
Constant quantizer: use fixed values of qindex (dependent on the frame type)
|
||||
throughout the stream. This mode is the default.
|
||||
|
||||
@item vbr
|
||||
Variable bitrate: use a target bitrate for the whole stream.
|
||||
|
||||
@item cvbr
|
||||
Constrained variable bitrate: use a target bitrate for each GOP.
|
||||
@end table
|
||||
|
||||
@item qmax
|
||||
Set the maximum quantizer to use when using a bitrate mode.
|
||||
|
||||
@item qmin
|
||||
Set the minimum quantizer to use when using a bitrate mode.
|
||||
|
||||
@item qp
|
||||
Set the quantizer used in cqp rate control mode (0-63).
|
||||
|
||||
@item sc_detection
|
||||
Enable scene change detection.
|
||||
|
||||
@item la_depth
|
||||
Set number of frames to look ahead (0-120).
|
||||
|
||||
@item preset
|
||||
Set the quality-speed tradeoff, in the range 0 to 8. Higher values are
|
||||
faster but lower quality. Defaults to 8 (highest speed).
|
||||
|
||||
@item tile_rows
|
||||
Set log2 of the number of rows of tiles to use (0-6).
|
||||
|
||||
@item tile_columns
|
||||
Set log2 of the number of columns of tiles to use (0-4).
|
||||
|
||||
@end table
|
||||
|
||||
@section libkvazaar
|
||||
@@ -2086,14 +1842,16 @@ Enable error resiliency features.
|
||||
Increase sharpness at the expense of lower PSNR.
|
||||
The valid range is [0, 7].
|
||||
|
||||
@item VP8-specific options
|
||||
@table @option
|
||||
@item ts-parameters
|
||||
Sets the temporal scalability configuration using a :-separated list of
|
||||
key=value pairs. For example, to specify temporal scalability parameters
|
||||
with @code{ffmpeg}:
|
||||
@example
|
||||
ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
|
||||
ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
|
||||
ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
|
||||
ts_target_bitrate=250000,500000,1000000:ts_rate_decimator=4,2,1:\
|
||||
ts_periodicity=4:ts_layer_id=0,2,1,2 OUTPUT
|
||||
@end example
|
||||
Below is a brief explanation of each of the parameters, please
|
||||
refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more
|
||||
@@ -2102,38 +1860,13 @@ details.
|
||||
@item ts_number_layers
|
||||
Number of temporal coding layers.
|
||||
@item ts_target_bitrate
|
||||
Target bitrate for each temporal layer (in kbps).
|
||||
(bitrate should be inclusive of the lower temporal layer).
|
||||
Target bitrate for each temporal layer.
|
||||
@item ts_rate_decimator
|
||||
Frame rate decimation factor for each temporal layer.
|
||||
@item ts_periodicity
|
||||
Length of the sequence defining frame temporal layer membership.
|
||||
@item ts_layer_id
|
||||
Template defining the membership of frames to temporal layers.
|
||||
@item ts_layering_mode
|
||||
(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
|
||||
Currently supports the following options.
|
||||
@table @option
|
||||
@item 0
|
||||
No temporal layering flags are provided internally,
|
||||
relies on flags being passed in using @code{metadata} field in @code{AVFrame}
|
||||
with following keys.
|
||||
@table @option
|
||||
@item vp8-flags
|
||||
Sets the flags passed into the encoder to indicate the referencing scheme for
|
||||
the current frame.
|
||||
Refer to function @code{vpx_codec_encode} in @code{vpx/vpx_encoder.h} for more
|
||||
details.
|
||||
@item temporal_id
|
||||
Explicitly sets the temporal id of the current frame to encode.
|
||||
@end table
|
||||
@item 2
|
||||
Two temporal layers. 0-1...
|
||||
@item 3
|
||||
Three temporal layers. 0-2-1-2...; with single reference frame.
|
||||
@item 4
|
||||
Same as option "3", except there is a dependency between
|
||||
the two temporal layer 2 frames within the temporal period.
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@@ -2177,38 +1910,6 @@ midpoint is passed in rather than calculated for a specific clip or chunk.
|
||||
The valid range is [0, 10000]. 0 (default) uses standard VBR.
|
||||
@item enable-tpl @var{boolean}
|
||||
Enable temporal dependency model.
|
||||
@item ref-frame-config
|
||||
Using per-frame metadata, set members of the structure @code{vpx_svc_ref_frame_config_t} in @code{vpx/vp8cx.h} to fine-control referencing schemes and frame buffer management.
|
||||
@*Use a :-separated list of key=value pairs.
|
||||
For example,
|
||||
@example
|
||||
av_dict_set(&av_frame->metadata, "ref-frame-config", \
|
||||
"rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0");
|
||||
@end example
|
||||
@table @option
|
||||
@item rfc_update_buffer_slot
|
||||
Indicates the buffer slot number to update
|
||||
@item rfc_update_last
|
||||
Indicates whether to update the LAST frame
|
||||
@item rfc_update_golden
|
||||
Indicates whether to update GOLDEN frame
|
||||
@item rfc_update_alt_ref
|
||||
Indicates whether to update ALT_REF frame
|
||||
@item rfc_lst_fb_idx
|
||||
LAST frame buffer index
|
||||
@item rfc_gld_fb_idx
|
||||
GOLDEN frame buffer index
|
||||
@item rfc_alt_fb_idx
|
||||
ALT_REF frame buffer index
|
||||
@item rfc_reference_last
|
||||
Indicates whether to reference LAST frame
|
||||
@item rfc_reference_golden
|
||||
Indicates whether to reference GOLDEN frame
|
||||
@item rfc_reference_alt_ref
|
||||
Indicates whether to reference ALT_REF frame
|
||||
@item rfc_reference_duration
|
||||
Indicates frame duration
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@end table
|
||||
@@ -2305,7 +2006,9 @@ pixel formats as input instead of YUV.
|
||||
@subsection Supported Pixel Formats
|
||||
|
||||
x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
|
||||
x264's configure time.
|
||||
x264's configure time. FFmpeg only supports one bit depth in one particular
|
||||
build. In other words, it is not possible to build one FFmpeg with multiple
|
||||
versions of x264 with different bit depths.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@@ -2668,20 +2371,6 @@ during configuration. You need to explicitly configure the build with
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item b
|
||||
Sets target video bitrate.
|
||||
|
||||
@item bf
|
||||
|
||||
@item g
|
||||
Set the GOP size.
|
||||
|
||||
@item keyint_min
|
||||
Minimum GOP size.
|
||||
|
||||
@item refs
|
||||
Number of reference frames each P-frame can use. The range is from @var{1-16}.
|
||||
|
||||
@item preset
|
||||
Set the x265 preset.
|
||||
|
||||
@@ -2694,28 +2383,6 @@ Set profile restrictions.
|
||||
@item crf
|
||||
Set the quality for constant quality mode.
|
||||
|
||||
@item qp
|
||||
Set constant quantization rate control method parameter.
|
||||
|
||||
@item qmin
|
||||
Minimum quantizer scale.
|
||||
|
||||
@item qmax
|
||||
Maximum quantizer scale.
|
||||
|
||||
@item qdiff
|
||||
Maximum difference between quantizer scales.
|
||||
|
||||
@item qblur
|
||||
Quantizer curve blur
|
||||
|
||||
@item qcomp
|
||||
Quantizer curve compression factor
|
||||
|
||||
@item i_qfactor
|
||||
|
||||
@item b_qfactor
|
||||
|
||||
@item forced-idr
|
||||
Normally, when forcing a I-frame type, the encoder can select any type
|
||||
of I-frame. This option forces it to choose an IDR-frame.
|
||||
@@ -2951,14 +2618,6 @@ fastest.
|
||||
|
||||
@end table
|
||||
|
||||
@section MediaFoundation
|
||||
|
||||
This provides wrappers to encoders (both audio and video) in the
|
||||
MediaFoundation framework. It can access both SW and HW encoders.
|
||||
Video encoders can take input in either of nv12 or yuv420p form
|
||||
(some encoders support both, some support only either - in practice,
|
||||
nv12 is the safer choice, especially among HW encoders).
|
||||
|
||||
@section mpeg2
|
||||
|
||||
MPEG-2 video encoder.
|
||||
@@ -2966,30 +2625,6 @@ MPEG-2 video encoder.
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item profile
|
||||
Select the mpeg2 profile to encode:
|
||||
|
||||
@table @samp
|
||||
@item 422
|
||||
@item high
|
||||
@item ss
|
||||
Spatially Scalable
|
||||
@item snr
|
||||
SNR Scalable
|
||||
@item main
|
||||
@item simple
|
||||
@end table
|
||||
|
||||
@item level
|
||||
Select the mpeg2 level to encode:
|
||||
|
||||
@table @samp
|
||||
@item high
|
||||
@item high1440
|
||||
@item main
|
||||
@item low
|
||||
@end table
|
||||
|
||||
@item seq_disp_ext @var{integer}
|
||||
Specifies if the encoder should write a sequence_display_extension to the
|
||||
output.
|
||||
@@ -3098,7 +2733,7 @@ recommended value) and do not set a size constraint.
|
||||
|
||||
@section QSV encoders
|
||||
|
||||
The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG and VP9)
|
||||
The family of Intel QuickSync Video encoders (MPEG-2, H.264 and HEVC)
|
||||
|
||||
The ratecontrol method is selected as follows:
|
||||
|
||||
@@ -3351,11 +2986,6 @@ Include HDR metadata if the input frames have it
|
||||
messages).
|
||||
@end table
|
||||
|
||||
@item tiles
|
||||
Set the number of tiles to encode the input video with, as columns x rows.
|
||||
Larger numbers allow greater parallelism in both encoding and decoding, but
|
||||
may decrease coding efficiency.
|
||||
|
||||
@end table
|
||||
|
||||
@item mjpeg_vaapi
|
||||
@@ -3486,14 +3116,6 @@ and they can also be used in Matroska files.
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item palette
|
||||
Specify the global palette used by the bitmaps.
|
||||
|
||||
The format for this option is a string containing 16 24-bits hexadecimal
|
||||
numbers (without 0x prefix) separated by commas, for example @code{0d00ee,
|
||||
ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
|
||||
7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
|
||||
|
||||
@item even_rows_fix
|
||||
When set to 1, enable a work-around that makes the number of pixel rows
|
||||
even in all subtitles. This fixes a problem with some players that
|
||||
|
||||
2
doc/examples/.gitignore
vendored
2
doc/examples/.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
/avio_list_dir
|
||||
/avio_dir_cmd
|
||||
/avio_reading
|
||||
/decode_audio
|
||||
/decode_video
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
|
||||
EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE) += avio_dir_cmd
|
||||
EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading
|
||||
EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio
|
||||
EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE) += decode_video
|
||||
|
||||
@@ -11,7 +11,7 @@ CFLAGS += -Wall -g
|
||||
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
|
||||
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
|
||||
|
||||
EXAMPLES= avio_list_dir \
|
||||
EXAMPLES= avio_dir_cmd \
|
||||
avio_reading \
|
||||
decode_audio \
|
||||
decode_video \
|
||||
|
||||
@@ -102,15 +102,38 @@ static int list_op(const char *input_dir)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int del_op(const char *url)
|
||||
{
|
||||
int ret = avpriv_io_delete(url);
|
||||
if (ret < 0)
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int move_op(const char *src, const char *dst)
|
||||
{
|
||||
int ret = avpriv_io_move(src, dst);
|
||||
if (ret < 0)
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, dst, av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static void usage(const char *program_name)
|
||||
{
|
||||
fprintf(stderr, "usage: %s input_dir\n"
|
||||
"API example program to show how to list files in directory "
|
||||
"accessed through AVIOContext.\n", program_name);
|
||||
fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
|
||||
"API example program to show how to manipulate resources "
|
||||
"accessed through AVIOContext.\n"
|
||||
"OPERATIONS:\n"
|
||||
"list list content of the directory\n"
|
||||
"move rename content in directory\n"
|
||||
"del delete content in directory\n",
|
||||
program_name);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *op = NULL;
|
||||
int ret;
|
||||
|
||||
av_log_set_level(AV_LOG_DEBUG);
|
||||
@@ -122,7 +145,32 @@ int main(int argc, char *argv[])
|
||||
|
||||
avformat_network_init();
|
||||
|
||||
ret = list_op(argv[1]);
|
||||
op = argv[1];
|
||||
if (strcmp(op, "list") == 0) {
|
||||
if (argc < 3) {
|
||||
av_log(NULL, AV_LOG_INFO, "Missing argument for list operation.\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
} else {
|
||||
ret = list_op(argv[2]);
|
||||
}
|
||||
} else if (strcmp(op, "del") == 0) {
|
||||
if (argc < 3) {
|
||||
av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
} else {
|
||||
ret = del_op(argv[2]);
|
||||
}
|
||||
} else if (strcmp(op, "move") == 0) {
|
||||
if (argc < 4) {
|
||||
av_log(NULL, AV_LOG_INFO, "Missing argument for move operation.\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
} else {
|
||||
ret = move_op(argv[2], argv[3]);
|
||||
}
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_INFO, "Invalid operation %s\n", op);
|
||||
ret = AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
avformat_network_deinit();
|
||||
|
||||
@@ -39,35 +39,6 @@
|
||||
#define AUDIO_INBUF_SIZE 20480
|
||||
#define AUDIO_REFILL_THRESH 4096
|
||||
|
||||
static int get_format_from_sample_fmt(const char **fmt,
|
||||
enum AVSampleFormat sample_fmt)
|
||||
{
|
||||
int i;
|
||||
struct sample_fmt_entry {
|
||||
enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le;
|
||||
} sample_fmt_entries[] = {
|
||||
{ AV_SAMPLE_FMT_U8, "u8", "u8" },
|
||||
{ AV_SAMPLE_FMT_S16, "s16be", "s16le" },
|
||||
{ AV_SAMPLE_FMT_S32, "s32be", "s32le" },
|
||||
{ AV_SAMPLE_FMT_FLT, "f32be", "f32le" },
|
||||
{ AV_SAMPLE_FMT_DBL, "f64be", "f64le" },
|
||||
};
|
||||
*fmt = NULL;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(sample_fmt_entries); i++) {
|
||||
struct sample_fmt_entry *entry = &sample_fmt_entries[i];
|
||||
if (sample_fmt == entry->sample_fmt) {
|
||||
*fmt = AV_NE(entry->fmt_be, entry->fmt_le);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
"sample format %s is not supported as output format\n",
|
||||
av_get_sample_fmt_name(sample_fmt));
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame,
|
||||
FILE *outfile)
|
||||
{
|
||||
@@ -115,9 +86,6 @@ int main(int argc, char **argv)
|
||||
size_t data_size;
|
||||
AVPacket *pkt;
|
||||
AVFrame *decoded_frame = NULL;
|
||||
enum AVSampleFormat sfmt;
|
||||
int n_channels = 0;
|
||||
const char *fmt;
|
||||
|
||||
if (argc <= 2) {
|
||||
fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
|
||||
@@ -204,26 +172,6 @@ int main(int argc, char **argv)
|
||||
pkt->size = 0;
|
||||
decode(c, pkt, decoded_frame, outfile);
|
||||
|
||||
/* print output pcm infomations, because there have no metadata of pcm */
|
||||
sfmt = c->sample_fmt;
|
||||
|
||||
if (av_sample_fmt_is_planar(sfmt)) {
|
||||
const char *packed = av_get_sample_fmt_name(sfmt);
|
||||
printf("Warning: the sample format the decoder produced is planar "
|
||||
"(%s). This example will output the first channel only.\n",
|
||||
packed ? packed : "?");
|
||||
sfmt = av_get_packed_sample_fmt(sfmt);
|
||||
}
|
||||
|
||||
n_channels = c->channels;
|
||||
if ((ret = get_format_from_sample_fmt(&fmt, sfmt)) < 0)
|
||||
goto end;
|
||||
|
||||
printf("Play the output audio file with the command:\n"
|
||||
"ffplay -f %s -ac %d -ar %d %s\n",
|
||||
fmt, n_channels, c->sample_rate,
|
||||
outfilename);
|
||||
end:
|
||||
fclose(outfile);
|
||||
fclose(f);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize,
|
||||
FILE *f;
|
||||
int i;
|
||||
|
||||
f = fopen(filename,"wb");
|
||||
f = fopen(filename,"w");
|
||||
fprintf(f, "P5\n%d %d\n%d\n", xsize, ysize, 255);
|
||||
for (i = 0; i < ysize; i++)
|
||||
fwrite(buf + i * wrap, 1, xsize, f);
|
||||
@@ -95,8 +95,7 @@ int main(int argc, char **argv)
|
||||
AVPacket *pkt;
|
||||
|
||||
if (argc <= 2) {
|
||||
fprintf(stderr, "Usage: %s <input file> <output file>\n"
|
||||
"And check your input file is encoded by mpeg1video please.\n", argv[0]);
|
||||
fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
|
||||
exit(0);
|
||||
}
|
||||
filename = argv[1];
|
||||
|
||||
@@ -51,97 +51,99 @@ static int video_dst_bufsize;
|
||||
|
||||
static int video_stream_idx = -1, audio_stream_idx = -1;
|
||||
static AVFrame *frame = NULL;
|
||||
static AVPacket *pkt = NULL;
|
||||
static AVPacket pkt;
|
||||
static int video_frame_count = 0;
|
||||
static int audio_frame_count = 0;
|
||||
|
||||
static int output_video_frame(AVFrame *frame)
|
||||
{
|
||||
if (frame->width != width || frame->height != height ||
|
||||
frame->format != pix_fmt) {
|
||||
/* To handle this change, one could call av_image_alloc again and
|
||||
* decode the following frames into another rawvideo file. */
|
||||
fprintf(stderr, "Error: Width, height and pixel format have to be "
|
||||
"constant in a rawvideo file, but the width, height or "
|
||||
"pixel format of the input video changed:\n"
|
||||
"old: width = %d, height = %d, format = %s\n"
|
||||
"new: width = %d, height = %d, format = %s\n",
|
||||
width, height, av_get_pix_fmt_name(pix_fmt),
|
||||
frame->width, frame->height,
|
||||
av_get_pix_fmt_name(frame->format));
|
||||
return -1;
|
||||
}
|
||||
/* Enable or disable frame reference counting. You are not supposed to support
|
||||
* both paths in your application but pick the one most appropriate to your
|
||||
* needs. Look for the use of refcount in this example to see what are the
|
||||
* differences of API usage between them. */
|
||||
static int refcount = 0;
|
||||
|
||||
printf("video_frame n:%d coded_n:%d\n",
|
||||
video_frame_count++, frame->coded_picture_number);
|
||||
|
||||
/* copy decoded frame to destination buffer:
|
||||
* this is required since rawvideo expects non aligned data */
|
||||
av_image_copy(video_dst_data, video_dst_linesize,
|
||||
(const uint8_t **)(frame->data), frame->linesize,
|
||||
pix_fmt, width, height);
|
||||
|
||||
/* write to rawvideo file */
|
||||
fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int output_audio_frame(AVFrame *frame)
|
||||
{
|
||||
size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format);
|
||||
printf("audio_frame n:%d nb_samples:%d pts:%s\n",
|
||||
audio_frame_count++, frame->nb_samples,
|
||||
av_ts2timestr(frame->pts, &audio_dec_ctx->time_base));
|
||||
|
||||
/* Write the raw audio data samples of the first plane. This works
|
||||
* fine for packed formats (e.g. AV_SAMPLE_FMT_S16). However,
|
||||
* most audio decoders output planar audio, which uses a separate
|
||||
* plane of audio samples for each channel (e.g. AV_SAMPLE_FMT_S16P).
|
||||
* In other words, this code will write only the first audio channel
|
||||
* in these cases.
|
||||
* You should use libswresample or libavfilter to convert the frame
|
||||
* to packed data. */
|
||||
fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_packet(AVCodecContext *dec, const AVPacket *pkt)
|
||||
static int decode_packet(int *got_frame, int cached)
|
||||
{
|
||||
int ret = 0;
|
||||
int decoded = pkt.size;
|
||||
|
||||
// submit the packet to the decoder
|
||||
ret = avcodec_send_packet(dec, pkt);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error submitting a packet for decoding (%s)\n", av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
*got_frame = 0;
|
||||
|
||||
// get all the available frames from the decoder
|
||||
while (ret >= 0) {
|
||||
ret = avcodec_receive_frame(dec, frame);
|
||||
if (pkt.stream_index == video_stream_idx) {
|
||||
/* decode video frame */
|
||||
ret = avcodec_decode_video2(video_dec_ctx, frame, got_frame, &pkt);
|
||||
if (ret < 0) {
|
||||
// those two return values are special and mean there is no output
|
||||
// frame available, but there were no errors during decoding
|
||||
if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN))
|
||||
return 0;
|
||||
|
||||
fprintf(stderr, "Error during decoding (%s)\n", av_err2str(ret));
|
||||
fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
// write the frame data to output file
|
||||
if (dec->codec->type == AVMEDIA_TYPE_VIDEO)
|
||||
ret = output_video_frame(frame);
|
||||
else
|
||||
ret = output_audio_frame(frame);
|
||||
if (*got_frame) {
|
||||
|
||||
av_frame_unref(frame);
|
||||
if (ret < 0)
|
||||
if (frame->width != width || frame->height != height ||
|
||||
frame->format != pix_fmt) {
|
||||
/* To handle this change, one could call av_image_alloc again and
|
||||
* decode the following frames into another rawvideo file. */
|
||||
fprintf(stderr, "Error: Width, height and pixel format have to be "
|
||||
"constant in a rawvideo file, but the width, height or "
|
||||
"pixel format of the input video changed:\n"
|
||||
"old: width = %d, height = %d, format = %s\n"
|
||||
"new: width = %d, height = %d, format = %s\n",
|
||||
width, height, av_get_pix_fmt_name(pix_fmt),
|
||||
frame->width, frame->height,
|
||||
av_get_pix_fmt_name(frame->format));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("video_frame%s n:%d coded_n:%d\n",
|
||||
cached ? "(cached)" : "",
|
||||
video_frame_count++, frame->coded_picture_number);
|
||||
|
||||
/* copy decoded frame to destination buffer:
|
||||
* this is required since rawvideo expects non aligned data */
|
||||
av_image_copy(video_dst_data, video_dst_linesize,
|
||||
(const uint8_t **)(frame->data), frame->linesize,
|
||||
pix_fmt, width, height);
|
||||
|
||||
/* write to rawvideo file */
|
||||
fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file);
|
||||
}
|
||||
} else if (pkt.stream_index == audio_stream_idx) {
|
||||
/* decode audio frame */
|
||||
ret = avcodec_decode_audio4(audio_dec_ctx, frame, got_frame, &pkt);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error decoding audio frame (%s)\n", av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
/* Some audio decoders decode only part of the packet, and have to be
|
||||
* called again with the remainder of the packet data.
|
||||
* Sample: fate-suite/lossless-audio/luckynight-partial.shn
|
||||
* Also, some decoders might over-read the packet. */
|
||||
decoded = FFMIN(ret, pkt.size);
|
||||
|
||||
if (*got_frame) {
|
||||
size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format);
|
||||
printf("audio_frame%s n:%d nb_samples:%d pts:%s\n",
|
||||
cached ? "(cached)" : "",
|
||||
audio_frame_count++, frame->nb_samples,
|
||||
av_ts2timestr(frame->pts, &audio_dec_ctx->time_base));
|
||||
|
||||
/* Write the raw audio data samples of the first plane. This works
|
||||
* fine for packed formats (e.g. AV_SAMPLE_FMT_S16). However,
|
||||
* most audio decoders output planar audio, which uses a separate
|
||||
* plane of audio samples for each channel (e.g. AV_SAMPLE_FMT_S16P).
|
||||
* In other words, this code will write only the first audio channel
|
||||
* in these cases.
|
||||
* You should use libswresample or libavfilter to convert the frame
|
||||
* to packed data. */
|
||||
fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
/* If we use frame reference counting, we own the data and need
|
||||
* to de-reference it when we don't use it anymore */
|
||||
if (*got_frame && refcount)
|
||||
av_frame_unref(frame);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
|
||||
static int open_codec_context(int *stream_idx,
|
||||
@@ -184,7 +186,8 @@ static int open_codec_context(int *stream_idx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Init the decoders */
|
||||
/* Init the decoders, with or without reference counting */
|
||||
av_dict_set(&opts, "refcounted_frames", refcount ? "1" : "0", 0);
|
||||
if ((ret = avcodec_open2(*dec_ctx, dec, &opts)) < 0) {
|
||||
fprintf(stderr, "Failed to open %s codec\n",
|
||||
av_get_media_type_string(type));
|
||||
@@ -227,17 +230,24 @@ static int get_format_from_sample_fmt(const char **fmt,
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = 0, got_frame;
|
||||
|
||||
if (argc != 4) {
|
||||
fprintf(stderr, "usage: %s input_file video_output_file audio_output_file\n"
|
||||
if (argc != 4 && argc != 5) {
|
||||
fprintf(stderr, "usage: %s [-refcount] input_file video_output_file audio_output_file\n"
|
||||
"API example program to show how to read frames from an input file.\n"
|
||||
"This program reads frames from a file, decodes them, and writes decoded\n"
|
||||
"video frames to a rawvideo file named video_output_file, and decoded\n"
|
||||
"audio frames to a rawaudio file named audio_output_file.\n",
|
||||
argv[0]);
|
||||
"audio frames to a rawaudio file named audio_output_file.\n\n"
|
||||
"If the -refcount option is specified, the program use the\n"
|
||||
"reference counting frame system which allows keeping a copy of\n"
|
||||
"the data for longer than one decode call.\n"
|
||||
"\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
if (argc == 5 && !strcmp(argv[1], "-refcount")) {
|
||||
refcount = 1;
|
||||
argv++;
|
||||
}
|
||||
src_filename = argv[1];
|
||||
video_dst_filename = argv[2];
|
||||
audio_dst_filename = argv[3];
|
||||
@@ -303,12 +313,10 @@ int main (int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
pkt = av_packet_alloc();
|
||||
if (!pkt) {
|
||||
fprintf(stderr, "Could not allocate packet\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
/* initialize packet, set data to NULL, let the demuxer fill it */
|
||||
av_init_packet(&pkt);
|
||||
pkt.data = NULL;
|
||||
pkt.size = 0;
|
||||
|
||||
if (video_stream)
|
||||
printf("Demuxing video from file '%s' into '%s'\n", src_filename, video_dst_filename);
|
||||
@@ -316,23 +324,24 @@ int main (int argc, char **argv)
|
||||
printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename);
|
||||
|
||||
/* read frames from the file */
|
||||
while (av_read_frame(fmt_ctx, pkt) >= 0) {
|
||||
// check if the packet belongs to a stream we are interested in, otherwise
|
||||
// skip it
|
||||
if (pkt->stream_index == video_stream_idx)
|
||||
ret = decode_packet(video_dec_ctx, pkt);
|
||||
else if (pkt->stream_index == audio_stream_idx)
|
||||
ret = decode_packet(audio_dec_ctx, pkt);
|
||||
av_packet_unref(pkt);
|
||||
if (ret < 0)
|
||||
break;
|
||||
while (av_read_frame(fmt_ctx, &pkt) >= 0) {
|
||||
AVPacket orig_pkt = pkt;
|
||||
do {
|
||||
ret = decode_packet(&got_frame, 0);
|
||||
if (ret < 0)
|
||||
break;
|
||||
pkt.data += ret;
|
||||
pkt.size -= ret;
|
||||
} while (pkt.size > 0);
|
||||
av_packet_unref(&orig_pkt);
|
||||
}
|
||||
|
||||
/* flush the decoders */
|
||||
if (video_dec_ctx)
|
||||
decode_packet(video_dec_ctx, NULL);
|
||||
if (audio_dec_ctx)
|
||||
decode_packet(audio_dec_ctx, NULL);
|
||||
/* flush cached frames */
|
||||
pkt.data = NULL;
|
||||
pkt.size = 0;
|
||||
do {
|
||||
decode_packet(&got_frame, 1);
|
||||
} while (got_frame);
|
||||
|
||||
printf("Demuxing succeeded.\n");
|
||||
|
||||
@@ -374,7 +383,6 @@ end:
|
||||
fclose(video_dst_file);
|
||||
if (audio_dst_file)
|
||||
fclose(audio_dst_file);
|
||||
av_packet_free(&pkt);
|
||||
av_frame_free(&frame);
|
||||
av_free(video_dst_data[0]);
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ int main(int argc, char **argv)
|
||||
frame->width = c->width;
|
||||
frame->height = c->height;
|
||||
|
||||
ret = av_frame_get_buffer(frame, 0);
|
||||
ret = av_frame_get_buffer(frame, 32);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate the video frame data\n");
|
||||
exit(1);
|
||||
@@ -186,8 +186,7 @@ int main(int argc, char **argv)
|
||||
encode(c, NULL, pkt, f);
|
||||
|
||||
/* add sequence end code to have a real MPEG file */
|
||||
if (codec->id == AV_CODEC_ID_MPEG1VIDEO || codec->id == AV_CODEC_ID_MPEG2VIDEO)
|
||||
fwrite(endcode, 1, sizeof(endcode), f);
|
||||
fwrite(endcode, 1, sizeof(endcode), f);
|
||||
fclose(f);
|
||||
|
||||
avcodec_free_context(&c);
|
||||
|
||||
@@ -223,7 +223,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* open the file to dump raw data */
|
||||
output_file = fopen(argv[3], "w+b");
|
||||
output_file = fopen(argv[3], "w+");
|
||||
|
||||
/* actual decoding and dump the raw data */
|
||||
while (ret >= 0) {
|
||||
|
||||
@@ -78,45 +78,15 @@ static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt)
|
||||
pkt->stream_index);
|
||||
}
|
||||
|
||||
static int write_frame(AVFormatContext *fmt_ctx, AVCodecContext *c,
|
||||
AVStream *st, AVFrame *frame)
|
||||
static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt)
|
||||
{
|
||||
int ret;
|
||||
/* rescale output packet timestamp values from codec to stream timebase */
|
||||
av_packet_rescale_ts(pkt, *time_base, st->time_base);
|
||||
pkt->stream_index = st->index;
|
||||
|
||||
// send the frame to the encoder
|
||||
ret = avcodec_send_frame(c, frame);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error sending a frame to the encoder: %s\n",
|
||||
av_err2str(ret));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
while (ret >= 0) {
|
||||
AVPacket pkt = { 0 };
|
||||
|
||||
ret = avcodec_receive_packet(c, &pkt);
|
||||
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
|
||||
break;
|
||||
else if (ret < 0) {
|
||||
fprintf(stderr, "Error encoding a frame: %s\n", av_err2str(ret));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* rescale output packet timestamp values from codec to stream timebase */
|
||||
av_packet_rescale_ts(&pkt, c->time_base, st->time_base);
|
||||
pkt.stream_index = st->index;
|
||||
|
||||
/* Write the compressed frame to the media file. */
|
||||
log_packet(fmt_ctx, &pkt);
|
||||
ret = av_interleaved_write_frame(fmt_ctx, &pkt);
|
||||
av_packet_unref(&pkt);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error while writing output packet: %s\n", av_err2str(ret));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
return ret == AVERROR_EOF ? 1 : 0;
|
||||
/* Write the compressed frame to the media file. */
|
||||
log_packet(fmt_ctx, pkt);
|
||||
return av_interleaved_write_frame(fmt_ctx, pkt);
|
||||
}
|
||||
|
||||
/* Add an output stream. */
|
||||
@@ -200,7 +170,7 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
|
||||
* the motion of the chroma plane does not match the luma plane. */
|
||||
c->mb_decision = 2;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
@@ -284,25 +254,25 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
|
||||
}
|
||||
|
||||
/* create resampler context */
|
||||
ost->swr_ctx = swr_alloc();
|
||||
if (!ost->swr_ctx) {
|
||||
fprintf(stderr, "Could not allocate resampler context\n");
|
||||
exit(1);
|
||||
}
|
||||
ost->swr_ctx = swr_alloc();
|
||||
if (!ost->swr_ctx) {
|
||||
fprintf(stderr, "Could not allocate resampler context\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* set options */
|
||||
av_opt_set_int (ost->swr_ctx, "in_channel_count", c->channels, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "in_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(ost->swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "out_channel_count", c->channels, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "out_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(ost->swr_ctx, "out_sample_fmt", c->sample_fmt, 0);
|
||||
/* set options */
|
||||
av_opt_set_int (ost->swr_ctx, "in_channel_count", c->channels, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "in_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(ost->swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "out_channel_count", c->channels, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "out_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(ost->swr_ctx, "out_sample_fmt", c->sample_fmt, 0);
|
||||
|
||||
/* initialize the resampling context */
|
||||
if ((ret = swr_init(ost->swr_ctx)) < 0) {
|
||||
fprintf(stderr, "Failed to initialize the resampling context\n");
|
||||
exit(1);
|
||||
}
|
||||
/* initialize the resampling context */
|
||||
if ((ret = swr_init(ost->swr_ctx)) < 0) {
|
||||
fprintf(stderr, "Failed to initialize the resampling context\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Prepare a 16 bit dummy audio frame of 'frame_size' samples and
|
||||
@@ -315,7 +285,7 @@ static AVFrame *get_audio_frame(OutputStream *ost)
|
||||
|
||||
/* check if we want to generate more frames */
|
||||
if (av_compare_ts(ost->next_pts, ost->enc->time_base,
|
||||
STREAM_DURATION, (AVRational){ 1, 1 }) > 0)
|
||||
STREAM_DURATION, (AVRational){ 1, 1 }) >= 0)
|
||||
return NULL;
|
||||
|
||||
for (j = 0; j <frame->nb_samples; j++) {
|
||||
@@ -339,20 +309,23 @@ static AVFrame *get_audio_frame(OutputStream *ost)
|
||||
static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
|
||||
{
|
||||
AVCodecContext *c;
|
||||
AVPacket pkt = { 0 }; // data and size must be 0;
|
||||
AVFrame *frame;
|
||||
int ret;
|
||||
int got_packet;
|
||||
int dst_nb_samples;
|
||||
|
||||
av_init_packet(&pkt);
|
||||
c = ost->enc;
|
||||
|
||||
frame = get_audio_frame(ost);
|
||||
|
||||
if (frame) {
|
||||
/* convert samples from native format to destination codec format, using the resampler */
|
||||
/* compute destination number of samples */
|
||||
dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples,
|
||||
c->sample_rate, c->sample_rate, AV_ROUND_UP);
|
||||
av_assert0(dst_nb_samples == frame->nb_samples);
|
||||
/* compute destination number of samples */
|
||||
dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples,
|
||||
c->sample_rate, c->sample_rate, AV_ROUND_UP);
|
||||
av_assert0(dst_nb_samples == frame->nb_samples);
|
||||
|
||||
/* when we pass a frame to the encoder, it may keep a reference to it
|
||||
* internally;
|
||||
@@ -376,7 +349,22 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
|
||||
ost->samples_count += dst_nb_samples;
|
||||
}
|
||||
|
||||
return write_frame(oc, c, ost->st, frame);
|
||||
ret = avcodec_encode_audio2(c, &pkt, frame, &got_packet);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error encoding audio frame: %s\n", av_err2str(ret));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (got_packet) {
|
||||
ret = write_frame(oc, &c->time_base, ost->st, &pkt);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error while writing audio frame: %s\n",
|
||||
av_err2str(ret));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
return (frame || got_packet) ? 0 : 1;
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
@@ -396,7 +384,7 @@ static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
|
||||
picture->height = height;
|
||||
|
||||
/* allocate the buffers for the frame data */
|
||||
ret = av_frame_get_buffer(picture, 0);
|
||||
ret = av_frame_get_buffer(picture, 32);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate frame data.\n");
|
||||
exit(1);
|
||||
@@ -476,7 +464,7 @@ static AVFrame *get_video_frame(OutputStream *ost)
|
||||
|
||||
/* check if we want to generate more frames */
|
||||
if (av_compare_ts(ost->next_pts, c->time_base,
|
||||
STREAM_DURATION, (AVRational){ 1, 1 }) > 0)
|
||||
STREAM_DURATION, (AVRational){ 1, 1 }) >= 0)
|
||||
return NULL;
|
||||
|
||||
/* when we pass a frame to the encoder, it may keep a reference to it
|
||||
@@ -518,7 +506,37 @@ static AVFrame *get_video_frame(OutputStream *ost)
|
||||
*/
|
||||
static int write_video_frame(AVFormatContext *oc, OutputStream *ost)
|
||||
{
|
||||
return write_frame(oc, ost->enc, ost->st, get_video_frame(ost));
|
||||
int ret;
|
||||
AVCodecContext *c;
|
||||
AVFrame *frame;
|
||||
int got_packet = 0;
|
||||
AVPacket pkt = { 0 };
|
||||
|
||||
c = ost->enc;
|
||||
|
||||
frame = get_video_frame(ost);
|
||||
|
||||
av_init_packet(&pkt);
|
||||
|
||||
/* encode the image */
|
||||
ret = avcodec_encode_video2(c, &pkt, frame, &got_packet);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (got_packet) {
|
||||
ret = write_frame(oc, &c->time_base, ost->st, &pkt);
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error while writing video frame: %s\n", av_err2str(ret));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return (frame || got_packet) ? 0 : 1;
|
||||
}
|
||||
|
||||
static void close_stream(AVFormatContext *oc, OutputStream *ost)
|
||||
|
||||
@@ -245,16 +245,14 @@ cleanup:
|
||||
|
||||
/**
|
||||
* Initialize one data packet for reading or writing.
|
||||
* @param[out] packet Packet to be initialized
|
||||
* @return Error code (0 if successful)
|
||||
* @param packet Packet to be initialized
|
||||
*/
|
||||
static int init_packet(AVPacket **packet)
|
||||
static void init_packet(AVPacket *packet)
|
||||
{
|
||||
if (!(*packet = av_packet_alloc())) {
|
||||
fprintf(stderr, "Could not allocate packet\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
return 0;
|
||||
av_init_packet(packet);
|
||||
/* Set the packet data and size so that it is recognized as being empty. */
|
||||
packet->data = NULL;
|
||||
packet->size = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -373,31 +371,28 @@ static int decode_audio_frame(AVFrame *frame,
|
||||
int *data_present, int *finished)
|
||||
{
|
||||
/* Packet used for temporary storage. */
|
||||
AVPacket *input_packet;
|
||||
AVPacket input_packet;
|
||||
int error;
|
||||
|
||||
error = init_packet(&input_packet);
|
||||
if (error < 0)
|
||||
return error;
|
||||
init_packet(&input_packet);
|
||||
|
||||
/* Read one audio frame from the input file into a temporary packet. */
|
||||
if ((error = av_read_frame(input_format_context, input_packet)) < 0) {
|
||||
if ((error = av_read_frame(input_format_context, &input_packet)) < 0) {
|
||||
/* If we are at the end of the file, flush the decoder below. */
|
||||
if (error == AVERROR_EOF)
|
||||
*finished = 1;
|
||||
else {
|
||||
fprintf(stderr, "Could not read frame (error '%s')\n",
|
||||
av_err2str(error));
|
||||
goto cleanup;
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
/* Send the audio frame stored in the temporary packet to the decoder.
|
||||
* The input audio stream decoder is used to do this. */
|
||||
if ((error = avcodec_send_packet(input_codec_context, input_packet)) < 0) {
|
||||
if ((error = avcodec_send_packet(input_codec_context, &input_packet)) < 0) {
|
||||
fprintf(stderr, "Could not send packet for decoding (error '%s')\n",
|
||||
av_err2str(error));
|
||||
goto cleanup;
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Receive one frame from the decoder. */
|
||||
@@ -423,7 +418,7 @@ static int decode_audio_frame(AVFrame *frame,
|
||||
}
|
||||
|
||||
cleanup:
|
||||
av_packet_free(&input_packet);
|
||||
av_packet_unref(&input_packet);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -666,12 +661,9 @@ static int encode_audio_frame(AVFrame *frame,
|
||||
int *data_present)
|
||||
{
|
||||
/* Packet used for temporary storage. */
|
||||
AVPacket *output_packet;
|
||||
AVPacket output_packet;
|
||||
int error;
|
||||
|
||||
error = init_packet(&output_packet);
|
||||
if (error < 0)
|
||||
return error;
|
||||
init_packet(&output_packet);
|
||||
|
||||
/* Set a timestamp based on the sample rate for the container. */
|
||||
if (frame) {
|
||||
@@ -689,11 +681,11 @@ static int encode_audio_frame(AVFrame *frame,
|
||||
} else if (error < 0) {
|
||||
fprintf(stderr, "Could not send packet for encoding (error '%s')\n",
|
||||
av_err2str(error));
|
||||
goto cleanup;
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Receive one encoded frame from the encoder. */
|
||||
error = avcodec_receive_packet(output_codec_context, output_packet);
|
||||
error = avcodec_receive_packet(output_codec_context, &output_packet);
|
||||
/* If the encoder asks for more data to be able to provide an
|
||||
* encoded frame, return indicating that no data is present. */
|
||||
if (error == AVERROR(EAGAIN)) {
|
||||
@@ -714,14 +706,14 @@ static int encode_audio_frame(AVFrame *frame,
|
||||
|
||||
/* Write one audio frame from the temporary packet to the output file. */
|
||||
if (*data_present &&
|
||||
(error = av_write_frame(output_format_context, output_packet)) < 0) {
|
||||
(error = av_write_frame(output_format_context, &output_packet)) < 0) {
|
||||
fprintf(stderr, "Could not write frame (error '%s')\n",
|
||||
av_err2str(error));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
av_packet_free(&output_packet);
|
||||
av_packet_unref(&output_packet);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,17 +41,12 @@ typedef struct FilteringContext {
|
||||
AVFilterContext *buffersink_ctx;
|
||||
AVFilterContext *buffersrc_ctx;
|
||||
AVFilterGraph *filter_graph;
|
||||
|
||||
AVPacket *enc_pkt;
|
||||
AVFrame *filtered_frame;
|
||||
} FilteringContext;
|
||||
static FilteringContext *filter_ctx;
|
||||
|
||||
typedef struct StreamContext {
|
||||
AVCodecContext *dec_ctx;
|
||||
AVCodecContext *enc_ctx;
|
||||
|
||||
AVFrame *dec_frame;
|
||||
} StreamContext;
|
||||
static StreamContext *stream_ctx;
|
||||
|
||||
@@ -107,10 +102,6 @@ static int open_input_file(const char *filename)
|
||||
}
|
||||
}
|
||||
stream_ctx[i].dec_ctx = codec_ctx;
|
||||
|
||||
stream_ctx[i].dec_frame = av_frame_alloc();
|
||||
if (!stream_ctx[i].dec_frame)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
av_dump_format(ifmt_ctx, 0, filename, 0);
|
||||
@@ -407,63 +398,54 @@ static int init_filters(void)
|
||||
stream_ctx[i].enc_ctx, filter_spec);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
filter_ctx[i].enc_pkt = av_packet_alloc();
|
||||
if (!filter_ctx[i].enc_pkt)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
filter_ctx[i].filtered_frame = av_frame_alloc();
|
||||
if (!filter_ctx[i].filtered_frame)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int encode_write_frame(unsigned int stream_index, int flush)
|
||||
{
|
||||
StreamContext *stream = &stream_ctx[stream_index];
|
||||
FilteringContext *filter = &filter_ctx[stream_index];
|
||||
AVFrame *filt_frame = flush ? NULL : filter->filtered_frame;
|
||||
AVPacket *enc_pkt = filter->enc_pkt;
|
||||
static int encode_write_frame(AVFrame *filt_frame, unsigned int stream_index, int *got_frame) {
|
||||
int ret;
|
||||
int got_frame_local;
|
||||
AVPacket enc_pkt;
|
||||
int (*enc_func)(AVCodecContext *, AVPacket *, const AVFrame *, int *) =
|
||||
(ifmt_ctx->streams[stream_index]->codecpar->codec_type ==
|
||||
AVMEDIA_TYPE_VIDEO) ? avcodec_encode_video2 : avcodec_encode_audio2;
|
||||
|
||||
if (!got_frame)
|
||||
got_frame = &got_frame_local;
|
||||
|
||||
av_log(NULL, AV_LOG_INFO, "Encoding frame\n");
|
||||
/* encode filtered frame */
|
||||
av_packet_unref(enc_pkt);
|
||||
|
||||
ret = avcodec_send_frame(stream->enc_ctx, filt_frame);
|
||||
|
||||
enc_pkt.data = NULL;
|
||||
enc_pkt.size = 0;
|
||||
av_init_packet(&enc_pkt);
|
||||
ret = enc_func(stream_ctx[stream_index].enc_ctx, &enc_pkt,
|
||||
filt_frame, got_frame);
|
||||
av_frame_free(&filt_frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (!(*got_frame))
|
||||
return 0;
|
||||
|
||||
while (ret >= 0) {
|
||||
ret = avcodec_receive_packet(stream->enc_ctx, enc_pkt);
|
||||
|
||||
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
|
||||
return 0;
|
||||
|
||||
/* prepare packet for muxing */
|
||||
enc_pkt->stream_index = stream_index;
|
||||
av_packet_rescale_ts(enc_pkt,
|
||||
stream->enc_ctx->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base);
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Muxing frame\n");
|
||||
/* mux encoded frame */
|
||||
ret = av_interleaved_write_frame(ofmt_ctx, enc_pkt);
|
||||
}
|
||||
/* prepare packet for muxing */
|
||||
enc_pkt.stream_index = stream_index;
|
||||
av_packet_rescale_ts(&enc_pkt,
|
||||
stream_ctx[stream_index].enc_ctx->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base);
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Muxing frame\n");
|
||||
/* mux encoded frame */
|
||||
ret = av_interleaved_write_frame(ofmt_ctx, &enc_pkt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int filter_encode_write_frame(AVFrame *frame, unsigned int stream_index)
|
||||
{
|
||||
FilteringContext *filter = &filter_ctx[stream_index];
|
||||
int ret;
|
||||
AVFrame *filt_frame;
|
||||
|
||||
av_log(NULL, AV_LOG_INFO, "Pushing decoded frame to filters\n");
|
||||
/* push the decoded frame into the filtergraph */
|
||||
ret = av_buffersrc_add_frame_flags(filter->buffersrc_ctx,
|
||||
ret = av_buffersrc_add_frame_flags(filter_ctx[stream_index].buffersrc_ctx,
|
||||
frame, 0);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
|
||||
@@ -472,9 +454,14 @@ static int filter_encode_write_frame(AVFrame *frame, unsigned int stream_index)
|
||||
|
||||
/* pull filtered frames from the filtergraph */
|
||||
while (1) {
|
||||
filt_frame = av_frame_alloc();
|
||||
if (!filt_frame) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
break;
|
||||
}
|
||||
av_log(NULL, AV_LOG_INFO, "Pulling filtered frame from filters\n");
|
||||
ret = av_buffersink_get_frame(filter->buffersink_ctx,
|
||||
filter->filtered_frame);
|
||||
ret = av_buffersink_get_frame(filter_ctx[stream_index].buffersink_ctx,
|
||||
filt_frame);
|
||||
if (ret < 0) {
|
||||
/* if no more frames for output - returns AVERROR(EAGAIN)
|
||||
* if flushed and no more frames for output - returns AVERROR_EOF
|
||||
@@ -482,12 +469,12 @@ static int filter_encode_write_frame(AVFrame *frame, unsigned int stream_index)
|
||||
*/
|
||||
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
|
||||
ret = 0;
|
||||
av_frame_free(&filt_frame);
|
||||
break;
|
||||
}
|
||||
|
||||
filter->filtered_frame->pict_type = AV_PICTURE_TYPE_NONE;
|
||||
ret = encode_write_frame(stream_index, 0);
|
||||
av_frame_unref(filter->filtered_frame);
|
||||
filt_frame->pict_type = AV_PICTURE_TYPE_NONE;
|
||||
ret = encode_write_frame(filt_frame, stream_index, NULL);
|
||||
if (ret < 0)
|
||||
break;
|
||||
}
|
||||
@@ -497,20 +484,34 @@ static int filter_encode_write_frame(AVFrame *frame, unsigned int stream_index)
|
||||
|
||||
static int flush_encoder(unsigned int stream_index)
|
||||
{
|
||||
int ret;
|
||||
int got_frame;
|
||||
|
||||
if (!(stream_ctx[stream_index].enc_ctx->codec->capabilities &
|
||||
AV_CODEC_CAP_DELAY))
|
||||
return 0;
|
||||
|
||||
av_log(NULL, AV_LOG_INFO, "Flushing stream #%u encoder\n", stream_index);
|
||||
return encode_write_frame(stream_index, 1);
|
||||
while (1) {
|
||||
av_log(NULL, AV_LOG_INFO, "Flushing stream #%u encoder\n", stream_index);
|
||||
ret = encode_write_frame(NULL, stream_index, &got_frame);
|
||||
if (ret < 0)
|
||||
break;
|
||||
if (!got_frame)
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
AVPacket *packet = NULL;
|
||||
AVPacket packet = { .data = NULL, .size = 0 };
|
||||
AVFrame *frame = NULL;
|
||||
enum AVMediaType type;
|
||||
unsigned int stream_index;
|
||||
unsigned int i;
|
||||
int got_frame;
|
||||
int (*dec_func)(AVCodecContext *, AVFrame *, int *, const AVPacket *);
|
||||
|
||||
if (argc != 3) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Usage: %s <input file> <output file>\n", argv[0]);
|
||||
@@ -523,54 +524,56 @@ int main(int argc, char **argv)
|
||||
goto end;
|
||||
if ((ret = init_filters()) < 0)
|
||||
goto end;
|
||||
if (!(packet = av_packet_alloc()))
|
||||
goto end;
|
||||
|
||||
/* read all packets */
|
||||
while (1) {
|
||||
if ((ret = av_read_frame(ifmt_ctx, packet)) < 0)
|
||||
if ((ret = av_read_frame(ifmt_ctx, &packet)) < 0)
|
||||
break;
|
||||
stream_index = packet->stream_index;
|
||||
stream_index = packet.stream_index;
|
||||
type = ifmt_ctx->streams[packet.stream_index]->codecpar->codec_type;
|
||||
av_log(NULL, AV_LOG_DEBUG, "Demuxer gave frame of stream_index %u\n",
|
||||
stream_index);
|
||||
|
||||
if (filter_ctx[stream_index].filter_graph) {
|
||||
StreamContext *stream = &stream_ctx[stream_index];
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Going to reencode&filter the frame\n");
|
||||
|
||||
av_packet_rescale_ts(packet,
|
||||
frame = av_frame_alloc();
|
||||
if (!frame) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
break;
|
||||
}
|
||||
av_packet_rescale_ts(&packet,
|
||||
ifmt_ctx->streams[stream_index]->time_base,
|
||||
stream->dec_ctx->time_base);
|
||||
ret = avcodec_send_packet(stream->dec_ctx, packet);
|
||||
stream_ctx[stream_index].dec_ctx->time_base);
|
||||
dec_func = (type == AVMEDIA_TYPE_VIDEO) ? avcodec_decode_video2 :
|
||||
avcodec_decode_audio4;
|
||||
ret = dec_func(stream_ctx[stream_index].dec_ctx, frame,
|
||||
&got_frame, &packet);
|
||||
if (ret < 0) {
|
||||
av_frame_free(&frame);
|
||||
av_log(NULL, AV_LOG_ERROR, "Decoding failed\n");
|
||||
break;
|
||||
}
|
||||
|
||||
while (ret >= 0) {
|
||||
ret = avcodec_receive_frame(stream->dec_ctx, stream->dec_frame);
|
||||
if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN))
|
||||
break;
|
||||
else if (ret < 0)
|
||||
goto end;
|
||||
|
||||
stream->dec_frame->pts = stream->dec_frame->best_effort_timestamp;
|
||||
ret = filter_encode_write_frame(stream->dec_frame, stream_index);
|
||||
if (got_frame) {
|
||||
frame->pts = frame->best_effort_timestamp;
|
||||
ret = filter_encode_write_frame(frame, stream_index);
|
||||
av_frame_free(&frame);
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
} else {
|
||||
av_frame_free(&frame);
|
||||
}
|
||||
} else {
|
||||
/* remux this frame without reencoding */
|
||||
av_packet_rescale_ts(packet,
|
||||
av_packet_rescale_ts(&packet,
|
||||
ifmt_ctx->streams[stream_index]->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base);
|
||||
|
||||
ret = av_interleaved_write_frame(ofmt_ctx, packet);
|
||||
ret = av_interleaved_write_frame(ofmt_ctx, &packet);
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
}
|
||||
av_packet_unref(packet);
|
||||
av_packet_unref(&packet);
|
||||
}
|
||||
|
||||
/* flush filters and encoders */
|
||||
@@ -594,18 +597,14 @@ int main(int argc, char **argv)
|
||||
|
||||
av_write_trailer(ofmt_ctx);
|
||||
end:
|
||||
av_packet_free(&packet);
|
||||
av_packet_unref(&packet);
|
||||
av_frame_free(&frame);
|
||||
for (i = 0; i < ifmt_ctx->nb_streams; i++) {
|
||||
avcodec_free_context(&stream_ctx[i].dec_ctx);
|
||||
if (ofmt_ctx && ofmt_ctx->nb_streams > i && ofmt_ctx->streams[i] && stream_ctx[i].enc_ctx)
|
||||
avcodec_free_context(&stream_ctx[i].enc_ctx);
|
||||
if (filter_ctx && filter_ctx[i].filter_graph) {
|
||||
if (filter_ctx && filter_ctx[i].filter_graph)
|
||||
avfilter_graph_free(&filter_ctx[i].filter_graph);
|
||||
av_packet_free(&filter_ctx[i].enc_pkt);
|
||||
av_frame_free(&filter_ctx[i].filtered_frame);
|
||||
}
|
||||
|
||||
av_frame_free(&stream_ctx[i].dec_frame);
|
||||
}
|
||||
av_free(filter_ctx);
|
||||
av_free(stream_ctx);
|
||||
|
||||
@@ -74,27 +74,27 @@ static int set_hwframe_ctx(AVCodecContext *ctx, AVBufferRef *hw_device_ctx)
|
||||
static int encode_write(AVCodecContext *avctx, AVFrame *frame, FILE *fout)
|
||||
{
|
||||
int ret = 0;
|
||||
AVPacket *enc_pkt;
|
||||
AVPacket enc_pkt;
|
||||
|
||||
if (!(enc_pkt = av_packet_alloc()))
|
||||
return AVERROR(ENOMEM);
|
||||
av_init_packet(&enc_pkt);
|
||||
enc_pkt.data = NULL;
|
||||
enc_pkt.size = 0;
|
||||
|
||||
if ((ret = avcodec_send_frame(avctx, frame)) < 0) {
|
||||
fprintf(stderr, "Error code: %s\n", av_err2str(ret));
|
||||
goto end;
|
||||
}
|
||||
while (1) {
|
||||
ret = avcodec_receive_packet(avctx, enc_pkt);
|
||||
ret = avcodec_receive_packet(avctx, &enc_pkt);
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
enc_pkt->stream_index = 0;
|
||||
ret = fwrite(enc_pkt->data, enc_pkt->size, 1, fout);
|
||||
av_packet_unref(enc_pkt);
|
||||
enc_pkt.stream_index = 0;
|
||||
ret = fwrite(enc_pkt.data, enc_pkt.size, 1, fout);
|
||||
av_packet_unref(&enc_pkt);
|
||||
}
|
||||
|
||||
end:
|
||||
av_packet_free(&enc_pkt);
|
||||
ret = ((ret == AVERROR(EAGAIN)) ? 0 : -1);
|
||||
return ret;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ int main(int argc, char *argv[])
|
||||
sw_frame->width = width;
|
||||
sw_frame->height = height;
|
||||
sw_frame->format = AV_PIX_FMT_NV12;
|
||||
if ((err = av_frame_get_buffer(sw_frame, 0)) < 0)
|
||||
if ((err = av_frame_get_buffer(sw_frame, 32)) < 0)
|
||||
goto close;
|
||||
if ((err = fread((uint8_t*)(sw_frame->data[0]), size, 1, fin)) <= 0)
|
||||
break;
|
||||
|
||||
@@ -109,25 +109,28 @@ static int open_input_file(const char *filename)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int encode_write(AVPacket *enc_pkt, AVFrame *frame)
|
||||
static int encode_write(AVFrame *frame)
|
||||
{
|
||||
int ret = 0;
|
||||
AVPacket enc_pkt;
|
||||
|
||||
av_packet_unref(enc_pkt);
|
||||
av_init_packet(&enc_pkt);
|
||||
enc_pkt.data = NULL;
|
||||
enc_pkt.size = 0;
|
||||
|
||||
if ((ret = avcodec_send_frame(encoder_ctx, frame)) < 0) {
|
||||
fprintf(stderr, "Error during encoding. Error code: %s\n", av_err2str(ret));
|
||||
goto end;
|
||||
}
|
||||
while (1) {
|
||||
ret = avcodec_receive_packet(encoder_ctx, enc_pkt);
|
||||
ret = avcodec_receive_packet(encoder_ctx, &enc_pkt);
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
enc_pkt->stream_index = 0;
|
||||
av_packet_rescale_ts(enc_pkt, ifmt_ctx->streams[video_stream]->time_base,
|
||||
enc_pkt.stream_index = 0;
|
||||
av_packet_rescale_ts(&enc_pkt, ifmt_ctx->streams[video_stream]->time_base,
|
||||
ofmt_ctx->streams[0]->time_base);
|
||||
ret = av_interleaved_write_frame(ofmt_ctx, enc_pkt);
|
||||
ret = av_interleaved_write_frame(ofmt_ctx, &enc_pkt);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error during writing data to output file. "
|
||||
"Error code: %s\n", av_err2str(ret));
|
||||
@@ -213,7 +216,7 @@ static int dec_enc(AVPacket *pkt, AVCodec *enc_codec)
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
if ((ret = encode_write(pkt, frame)) < 0)
|
||||
if ((ret = encode_write(frame)) < 0)
|
||||
fprintf(stderr, "Error during encoding and writing.\n");
|
||||
|
||||
fail:
|
||||
@@ -227,7 +230,7 @@ fail:
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret = 0;
|
||||
AVPacket *dec_pkt;
|
||||
AVPacket dec_pkt;
|
||||
AVCodec *enc_codec;
|
||||
|
||||
if (argc != 4) {
|
||||
@@ -243,12 +246,6 @@ int main(int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
dec_pkt = av_packet_alloc();
|
||||
if (!dec_pkt) {
|
||||
fprintf(stderr, "Failed to allocate decode packet\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((ret = open_input_file(argv[1])) < 0)
|
||||
goto end;
|
||||
|
||||
@@ -278,21 +275,23 @@ int main(int argc, char **argv)
|
||||
|
||||
/* read all packets and only transcoding video */
|
||||
while (ret >= 0) {
|
||||
if ((ret = av_read_frame(ifmt_ctx, dec_pkt)) < 0)
|
||||
if ((ret = av_read_frame(ifmt_ctx, &dec_pkt)) < 0)
|
||||
break;
|
||||
|
||||
if (video_stream == dec_pkt->stream_index)
|
||||
ret = dec_enc(dec_pkt, enc_codec);
|
||||
if (video_stream == dec_pkt.stream_index)
|
||||
ret = dec_enc(&dec_pkt, enc_codec);
|
||||
|
||||
av_packet_unref(dec_pkt);
|
||||
av_packet_unref(&dec_pkt);
|
||||
}
|
||||
|
||||
/* flush decoder */
|
||||
av_packet_unref(dec_pkt);
|
||||
ret = dec_enc(dec_pkt, enc_codec);
|
||||
dec_pkt.data = NULL;
|
||||
dec_pkt.size = 0;
|
||||
ret = dec_enc(&dec_pkt, enc_codec);
|
||||
av_packet_unref(&dec_pkt);
|
||||
|
||||
/* flush encoder */
|
||||
ret = encode_write(dec_pkt, NULL);
|
||||
ret = encode_write(NULL);
|
||||
|
||||
/* write the trailer for output stream */
|
||||
av_write_trailer(ofmt_ctx);
|
||||
@@ -303,6 +302,5 @@ end:
|
||||
avcodec_free_context(&decoder_ctx);
|
||||
avcodec_free_context(&encoder_ctx);
|
||||
av_buffer_unref(&hw_device_ctx);
|
||||
av_packet_free(&dec_pkt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -149,8 +149,6 @@ the synchronisation of the samples directory.
|
||||
|
||||
@chapter Uploading new samples to the fate suite
|
||||
|
||||
If you need a sample uploaded send a mail to samples-request.
|
||||
|
||||
This is for developers who have an account on the fate suite server.
|
||||
If you upload new samples, please make sure they are as small as possible,
|
||||
space on each client, network bandwidth and so on benefit from smaller test cases.
|
||||
@@ -159,8 +157,6 @@ practice generally do not replace, remove or overwrite files as it likely would
|
||||
break older checkouts or releases.
|
||||
Also all needed samples for a commit should be uploaded, ideally 24
|
||||
hours, before the push.
|
||||
If you need an account for frequently uploading samples or you wish to help
|
||||
others by doing that send a mail to ffmpeg-devel.
|
||||
|
||||
@example
|
||||
#First update your local samples copy:
|
||||
|
||||
264
doc/ffmpeg.texi
264
doc/ffmpeg.texi
@@ -617,102 +617,6 @@ they do not conflict with the standard, as in:
|
||||
ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
|
||||
@end example
|
||||
|
||||
The parameters set for each target are as follows.
|
||||
|
||||
@strong{VCD}
|
||||
@example
|
||||
@var{pal}:
|
||||
-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
|
||||
-s 352x288 -r 25
|
||||
-codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150v -minrate:v 1150k -bufsize:v 327680
|
||||
-ar 44100 -ac 2
|
||||
-codec:a mp2 -b:a 224k
|
||||
|
||||
@var{ntsc}:
|
||||
-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
|
||||
-s 352x240 -r 30000/1001
|
||||
-codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150v -minrate:v 1150k -bufsize:v 327680
|
||||
-ar 44100 -ac 2
|
||||
-codec:a mp2 -b:a 224k
|
||||
|
||||
@var{film}:
|
||||
-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
|
||||
-s 352x240 -r 24000/1001
|
||||
-codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150v -minrate:v 1150k -bufsize:v 327680
|
||||
-ar 44100 -ac 2
|
||||
-codec:a mp2 -b:a 224k
|
||||
@end example
|
||||
|
||||
@strong{SVCD}
|
||||
@example
|
||||
@var{pal}:
|
||||
-f svcd -packetsize 2324
|
||||
-s 480x576 -pix_fmt yuv420p -r 25
|
||||
-codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
|
||||
-ar 44100
|
||||
-codec:a mp2 -b:a 224k
|
||||
|
||||
@var{ntsc}:
|
||||
-f svcd -packetsize 2324
|
||||
-s 480x480 -pix_fmt yuv420p -r 30000/1001
|
||||
-codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
|
||||
-ar 44100
|
||||
-codec:a mp2 -b:a 224k
|
||||
|
||||
@var{film}:
|
||||
-f svcd -packetsize 2324
|
||||
-s 480x480 -pix_fmt yuv420p -r 24000/1001
|
||||
-codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
|
||||
-ar 44100
|
||||
-codec:a mp2 -b:a 224k
|
||||
@end example
|
||||
|
||||
@strong{DVD}
|
||||
@example
|
||||
@var{pal}:
|
||||
-f dvd -muxrate 10080k -packetsize 2048
|
||||
-s 720x576 -pix_fmt yuv420p -r 25
|
||||
-codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
|
||||
-ar 48000
|
||||
-codec:a ac3 -b:a 448k
|
||||
|
||||
@var{ntsc}:
|
||||
-f dvd -muxrate 10080k -packetsize 2048
|
||||
-s 720x480 -pix_fmt yuv420p -r 30000/1001
|
||||
-codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
|
||||
-ar 48000
|
||||
-codec:a ac3 -b:a 448k
|
||||
|
||||
@var{film}:
|
||||
-f dvd -muxrate 10080k -packetsize 2048
|
||||
-s 720x480 -pix_fmt yuv420p -r 24000/1001
|
||||
-codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
|
||||
-ar 48000
|
||||
-codec:a ac3 -b:a 448k
|
||||
@end example
|
||||
|
||||
@strong{DV}
|
||||
@example
|
||||
@var{pal}:
|
||||
-f dv
|
||||
-s 720x576 -pix_fmt yuv420p -r 25
|
||||
-ar 48000 -ac 2
|
||||
|
||||
@var{ntsc}:
|
||||
-f dv
|
||||
-s 720x480 -pix_fmt yuv411p -r 30000/1001
|
||||
-ar 48000 -ac 2
|
||||
|
||||
@var{film}:
|
||||
-f dv
|
||||
-s 720x480 -pix_fmt yuv411p -r 24000/1001
|
||||
-ar 48000 -ac 2
|
||||
@end example
|
||||
The @code{dv50} target is identical to the @code{dv} target except that the pixel format set is @code{yuv422p} for all three standards.
|
||||
|
||||
Any user-set value for a parameter above will override the target preset value. In that case, the output may
|
||||
not comply with the target standard.
|
||||
|
||||
@item -dn (@emph{input/output})
|
||||
As an input option, blocks all data streams of a file from being filtered or
|
||||
being automatically selected or mapped for any output. See @code{-discard}
|
||||
@@ -771,19 +675,14 @@ Specify the preset for matching stream(s).
|
||||
Print encoding progress/statistics. It is on by default, to explicitly
|
||||
disable it you need to specify @code{-nostats}.
|
||||
|
||||
@item -stats_period @var{time} (@emph{global})
|
||||
Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
|
||||
|
||||
@item -progress @var{url} (@emph{global})
|
||||
Send program-friendly progress information to @var{url}.
|
||||
|
||||
Progress information is written periodically and at the end of
|
||||
Progress information is written approximately every second and at the end of
|
||||
the encoding process. It is made of "@var{key}=@var{value}" lines. @var{key}
|
||||
consists of only alphanumeric characters. The last key of a sequence of
|
||||
progress information is always "progress".
|
||||
|
||||
The update period is set using @code{-stats_period}.
|
||||
|
||||
@anchor{stdin option}
|
||||
@item -stdin
|
||||
Enable interaction on standard input. On by default unless standard input is
|
||||
@@ -835,6 +734,10 @@ ffmpeg -dump_attachment:t "" -i INPUT
|
||||
Technical note -- attachments are implemented as codec extradata, so this
|
||||
option can actually be used to extract extradata from any stream, not just
|
||||
attachments.
|
||||
|
||||
@item -noautorotate
|
||||
Disable automatically rotating video based on file metadata.
|
||||
|
||||
@end table
|
||||
|
||||
@section Video Options
|
||||
@@ -855,13 +758,6 @@ If in doubt use @option{-framerate} instead of the input option @option{-r}.
|
||||
As an output option, duplicate or drop input frames to achieve constant output
|
||||
frame rate @var{fps}.
|
||||
|
||||
@item -fpsmax[:@var{stream_specifier}] @var{fps} (@emph{output,per-stream})
|
||||
Set maximum frame rate (Hz value, fraction or abbreviation).
|
||||
|
||||
Clamps output frame rate when output framerate is auto-set and is higher than this value.
|
||||
Useful in batch processing or when input framerate is wrongly detected as very high.
|
||||
It cannot be set together with @code{-r}. It is ignored during streamcopy.
|
||||
|
||||
@item -s[:@var{stream_specifier}] @var{size} (@emph{input/output,per-stream})
|
||||
Set frame size.
|
||||
|
||||
@@ -923,18 +819,6 @@ Create the filtergraph specified by @var{filtergraph} and use it to
|
||||
filter the stream.
|
||||
|
||||
This is an alias for @code{-filter:v}, see the @ref{filter_option,,-filter option}.
|
||||
|
||||
@item -autorotate
|
||||
Automatically rotate the video according to file metadata. Enabled by
|
||||
default, use @option{-noautorotate} to disable it.
|
||||
|
||||
@item -autoscale
|
||||
Automatically scale the video according to the resolution of first frame.
|
||||
Enabled by default, use @option{-noautoscale} to disable it. When autoscale is
|
||||
disabled, all output frames of filter graph might not be in the same resolution
|
||||
and may be inadequate for some encoder/muxer. Therefore, it is not recommended
|
||||
to disable it unless you really know what you are doing.
|
||||
Disable autoscale at your own risk.
|
||||
@end table
|
||||
|
||||
@section Advanced Video options
|
||||
@@ -964,8 +848,8 @@ factor if negative.
|
||||
Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
|
||||
Use this option if your input file is interlaced and you want
|
||||
to keep the interlaced format for minimum losses.
|
||||
The alternative is to deinterlace the input stream by use of a filter
|
||||
such as @code{yadif} or @code{bwdif}, but deinterlacing introduces losses.
|
||||
The alternative is to deinterlace the input stream with
|
||||
@option{-deinterlace}, but deinterlacing introduces losses.
|
||||
@item -psnr
|
||||
Calculate PSNR of compressed frames.
|
||||
@item -vstats
|
||||
@@ -995,19 +879,12 @@ Deprecated see -bsf
|
||||
|
||||
@item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
|
||||
@item -force_key_frames[:@var{stream_specifier}] expr:@var{expr} (@emph{output,per-stream})
|
||||
@item -force_key_frames[:@var{stream_specifier}] source (@emph{output,per-stream})
|
||||
Force key frames at the specified timestamps, more precisely at the first
|
||||
frames after each specified time.
|
||||
|
||||
@var{force_key_frames} can take arguments of the following form:
|
||||
|
||||
@table @option
|
||||
|
||||
@item @var{time}[,@var{time}...]
|
||||
If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
|
||||
output timestamp as per the encoder time base and force a keyframe at the first frame having
|
||||
timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
|
||||
coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
|
||||
The default encoder time base is the inverse of the output framerate but may be set otherwise
|
||||
via @code{-enc_time_base}.
|
||||
If the argument is prefixed with @code{expr:}, the string @var{expr}
|
||||
is interpreted like an expression and is evaluated for each frame. A
|
||||
key frame is forced in case the evaluation is non-zero.
|
||||
|
||||
If one of the times is "@code{chapters}[@var{delta}]", it is expanded into
|
||||
the time of the beginning of all chapters in the file, shifted by
|
||||
@@ -1021,11 +898,6 @@ before the beginning of every chapter:
|
||||
-force_key_frames 0:05:00,chapters-0.1
|
||||
@end example
|
||||
|
||||
@item expr:@var{expr}
|
||||
If the argument is prefixed with @code{expr:}, the string @var{expr}
|
||||
is interpreted like an expression and is evaluated for each frame. A
|
||||
key frame is forced in case the evaluation is non-zero.
|
||||
|
||||
The expression in @var{expr} can contain the following constants:
|
||||
@table @option
|
||||
@item n
|
||||
@@ -1053,12 +925,6 @@ starting from second 13:
|
||||
-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
|
||||
@end example
|
||||
|
||||
@item source
|
||||
If the argument is @code{source}, ffmpeg will force a key frame if
|
||||
the current frame being encoded is marked as a key frame in its source.
|
||||
|
||||
@end table
|
||||
|
||||
Note that forcing too many keyframes is very harmful for the lookahead
|
||||
algorithms of certain encoders: using fixed-GOP options or similar
|
||||
would be more efficient.
|
||||
@@ -1145,35 +1011,6 @@ Choose the GPU device on the second platform supporting the @emph{cl_khr_fp16}
|
||||
extension.
|
||||
@end table
|
||||
|
||||
@item vulkan
|
||||
If @var{device} is an integer, it selects the device by its index in a
|
||||
system-dependent list of devices. If @var{device} is any other string, it
|
||||
selects the first device with a name containing that string as a substring.
|
||||
|
||||
The following options are recognized:
|
||||
@table @option
|
||||
@item debug
|
||||
If set to 1, enables the validation layer, if installed.
|
||||
@item linear_images
|
||||
If set to 1, images allocated by the hwcontext will be linear and locally mappable.
|
||||
@item instance_extensions
|
||||
A plus separated list of additional instance extensions to enable.
|
||||
@item device_extensions
|
||||
A plus separated list of additional device extensions to enable.
|
||||
@end table
|
||||
|
||||
Examples:
|
||||
@table @emph
|
||||
@item -init_hw_device vulkan:1
|
||||
Choose the second device on the system.
|
||||
|
||||
@item -init_hw_device vulkan:RADV
|
||||
Choose the first device with a name containing the string @emph{RADV}.
|
||||
|
||||
@item -init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface
|
||||
Choose the first device and enable the Wayland and XCB instance extensions.
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@item -init_hw_device @var{type}[=@var{name}]@@@var{source}
|
||||
@@ -1546,7 +1383,7 @@ it will usually display as 0 if not supported.
|
||||
Show benchmarking information during the encode.
|
||||
Shows real, system and user time used in various steps (audio/video encode/decode).
|
||||
@item -timelimit @var{duration} (@emph{global})
|
||||
Exit after ffmpeg has been running for @var{duration} seconds in CPU user time.
|
||||
Exit after ffmpeg has been running for @var{duration} seconds.
|
||||
@item -dump (@emph{global})
|
||||
Dump each input packet to stderr.
|
||||
@item -hex (@emph{global})
|
||||
@@ -1608,17 +1445,6 @@ is enabled.
|
||||
|
||||
This option has been deprecated. Use the @code{aresample} audio filter instead.
|
||||
|
||||
@item -adrift_threshold @var{time}
|
||||
Set the minimum difference between timestamps and audio data (in seconds) to trigger
|
||||
adding/dropping samples to make it match the timestamps. This option effectively is
|
||||
a threshold to select between hard (add/drop) and soft (squeeze/stretch) compensation.
|
||||
@code{-async} must be set to a positive value.
|
||||
|
||||
@item -apad @var{parameters} (@emph{output,per-stream})
|
||||
Pad the output audio stream(s). This is the same as applying @code{-af apad}.
|
||||
Argument is a string of filter parameters composed the same as with the @code{apad} filter.
|
||||
@code{-shortest} must be set for this output for the option to take effect.
|
||||
|
||||
@item -copyts
|
||||
Do not process input timestamps, but keep their values without trying
|
||||
to sanitize them. In particular, do not remove the initial start time
|
||||
@@ -1689,10 +1515,6 @@ Enable bitexact mode for (de)muxer and (de/en)coder
|
||||
Finish encoding when the shortest input stream ends.
|
||||
@item -dts_delta_threshold
|
||||
Timestamp discontinuity delta threshold.
|
||||
@item -dts_error_threshold @var{seconds}
|
||||
Timestamp error delta threshold. This threshold use to discard crazy/damaged
|
||||
timestamps and the default is 30 hours which is arbitrarily picked and quite
|
||||
conservative.
|
||||
@item -muxdelay @var{seconds} (@emph{output})
|
||||
Set the maximum demux-decode delay.
|
||||
@item -muxpreload @var{seconds} (@emph{output})
|
||||
@@ -1773,22 +1595,6 @@ graph will be added to the output file automatically, so we can simply write
|
||||
ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
|
||||
@end example
|
||||
|
||||
As a special exception, you can use a bitmap subtitle stream as input: it
|
||||
will be converted into a video with the same size as the largest video in
|
||||
the file, or 720x576 if no video is present. Note that this is an
|
||||
experimental and temporary solution. It will be removed once libavfilter has
|
||||
proper support for subtitles.
|
||||
|
||||
For example, to hardcode subtitles on top of a DVB-T recording stored in
|
||||
MPEG-TS format, delaying the subtitles by 1 second:
|
||||
@example
|
||||
ffmpeg -i input.ts -filter_complex \
|
||||
'[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
|
||||
-sn -map '#0x2dc' output.mkv
|
||||
@end example
|
||||
(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
|
||||
audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
|
||||
|
||||
To generate 5 seconds of pure red video using lavfi @code{color} source:
|
||||
@example
|
||||
ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
|
||||
@@ -1824,9 +1630,8 @@ not start from timestamp 0, such as transport streams.
|
||||
@item -thread_queue_size @var{size} (@emph{input})
|
||||
This option sets the maximum number of queued packets when reading from the
|
||||
file or device. With low latency / high rate live streams, packets may be
|
||||
discarded if they are not read in a timely manner; setting this value can
|
||||
force ffmpeg to use a separate input thread and read packets as soon as they
|
||||
arrive. By default ffmpeg only do this if multiple inputs are specified.
|
||||
discarded if they are not read in a timely manner; raising this value can
|
||||
avoid it.
|
||||
|
||||
@item -sdp_file @var{file} (@emph{global})
|
||||
Print sdp information for an output stream to @var{file}.
|
||||
@@ -1865,15 +1670,8 @@ Stop and abort on various conditions. The following flags are available:
|
||||
@table @option
|
||||
@item empty_output
|
||||
No packets were passed to the muxer, the output is empty.
|
||||
@item empty_output_stream
|
||||
No packets were passed to the muxer in some of the output streams.
|
||||
@end table
|
||||
|
||||
@item -max_error_rate (@emph{global})
|
||||
Set fraction of decoding frame failures across all inputs which when crossed
|
||||
ffmpeg will return exit code 69. Crossing this threshold does not terminate
|
||||
processing. Range is a floating-point number between 0 to 1. Default is 2/3.
|
||||
|
||||
@item -xerror (@emph{global})
|
||||
Stop and exit on error
|
||||
|
||||
@@ -1886,23 +1684,24 @@ this buffer, in packets, for the matching output stream.
|
||||
The default value of this option should be high enough for most uses, so only
|
||||
touch this option if you are sure that you need it.
|
||||
|
||||
@item -muxing_queue_data_threshold @var{bytes} (@emph{output,per-stream})
|
||||
This is a minimum threshold until which the muxing queue size is not taken into
|
||||
account. Defaults to 50 megabytes per stream, and is based on the overall size
|
||||
of packets passed to the muxer.
|
||||
|
||||
@item -auto_conversion_filters (@emph{global})
|
||||
Enable automatically inserting format conversion filters in all filter
|
||||
graphs, including those defined by @option{-vf}, @option{-af},
|
||||
@option{-filter_complex} and @option{-lavfi}. If filter format negotiation
|
||||
requires a conversion, the initialization of the filters will fail.
|
||||
Conversions can still be performed by inserting the relevant conversion
|
||||
filter (scale, aresample) in the graph.
|
||||
On by default, to explicitly disable it you need to specify
|
||||
@code{-noauto_conversion_filters}.
|
||||
|
||||
@end table
|
||||
|
||||
As a special exception, you can use a bitmap subtitle stream as input: it
|
||||
will be converted into a video with the same size as the largest video in
|
||||
the file, or 720x576 if no video is present. Note that this is an
|
||||
experimental and temporary solution. It will be removed once libavfilter has
|
||||
proper support for subtitles.
|
||||
|
||||
For example, to hardcode subtitles on top of a DVB-T recording stored in
|
||||
MPEG-TS format, delaying the subtitles by 1 second:
|
||||
@example
|
||||
ffmpeg -i input.ts -filter_complex \
|
||||
'[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
|
||||
-sn -map '#0x2dc' output.mkv
|
||||
@end example
|
||||
(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
|
||||
audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
|
||||
|
||||
@section Preset files
|
||||
A preset file contains a sequence of @var{option}=@var{value} pairs,
|
||||
one for each line, specifying a sequence of options which would be
|
||||
@@ -2179,7 +1978,6 @@ ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
|
||||
@ifset config-avfilter
|
||||
@include filters.texi
|
||||
@end ifset
|
||||
@include general_contents.texi
|
||||
@end ifset
|
||||
|
||||
@chapter See Also
|
||||
|
||||
@@ -133,9 +133,8 @@ This option has been deprecated in favor of private options, try -pixel_format.
|
||||
@item -stats
|
||||
Print several playback statistics, in particular show the stream
|
||||
duration, the codec parameters, the current position in the stream and
|
||||
the audio/video synchronisation drift. It is shown by default, unless the
|
||||
log level is lower than @code{info}. Its display can be forced by manually
|
||||
specifying this option. To disable it, you need to specify @code{-nostats}.
|
||||
the audio/video synchronisation drift. It is on by default, to
|
||||
explicitly disable it you need to specify @code{-nostats}.
|
||||
|
||||
@item -fast
|
||||
Non-spec-compliant optimizations.
|
||||
@@ -295,7 +294,6 @@ Toggle full screen.
|
||||
@ifset config-avfilter
|
||||
@include filters.texi
|
||||
@end ifset
|
||||
@include general_contents.texi
|
||||
@end ifset
|
||||
|
||||
@chapter See Also
|
||||
|
||||
@@ -642,7 +642,6 @@ DV, GXF and AVI timecodes are available in format metadata
|
||||
@ifset config-avfilter
|
||||
@include filters.texi
|
||||
@end ifset
|
||||
@include general_contents.texi
|
||||
@end ifset
|
||||
|
||||
@chapter See Also
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
<xsd:attribute name="dts_time" type="xsd:float" />
|
||||
<xsd:attribute name="duration" type="xsd:long" />
|
||||
<xsd:attribute name="duration_time" type="xsd:float" />
|
||||
<xsd:attribute name="convergence_duration" type="xsd:long" />
|
||||
<xsd:attribute name="convergence_duration_time" type="xsd:float" />
|
||||
<xsd:attribute name="size" type="xsd:long" use="required" />
|
||||
<xsd:attribute name="pos" type="xsd:long" />
|
||||
<xsd:attribute name="flags" type="xsd:string" use="required" />
|
||||
@@ -213,6 +215,7 @@
|
||||
<xsd:attribute name="codec_long_name" type="xsd:string" />
|
||||
<xsd:attribute name="profile" type="xsd:string" />
|
||||
<xsd:attribute name="codec_type" type="xsd:string" />
|
||||
<xsd:attribute name="codec_time_base" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="codec_tag" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="codec_tag_string" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="extradata" type="xsd:string" />
|
||||
@@ -223,7 +226,6 @@
|
||||
<xsd:attribute name="height" type="xsd:int"/>
|
||||
<xsd:attribute name="coded_width" type="xsd:int"/>
|
||||
<xsd:attribute name="coded_height" type="xsd:int"/>
|
||||
<xsd:attribute name="closed_captions" type="xsd:boolean"/>
|
||||
<xsd:attribute name="has_b_frames" type="xsd:int"/>
|
||||
<xsd:attribute name="sample_aspect_ratio" type="xsd:string"/>
|
||||
<xsd:attribute name="display_aspect_ratio" type="xsd:string"/>
|
||||
@@ -235,6 +237,7 @@
|
||||
<xsd:attribute name="color_primaries" type="xsd:string"/>
|
||||
<xsd:attribute name="chroma_location" type="xsd:string"/>
|
||||
<xsd:attribute name="field_order" type="xsd:string"/>
|
||||
<xsd:attribute name="timecode" type="xsd:string"/>
|
||||
<xsd:attribute name="refs" type="xsd:int"/>
|
||||
|
||||
<!-- audio attributes -->
|
||||
@@ -354,6 +357,7 @@
|
||||
<xsd:attribute name="hwaccel" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="planar" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="rgb" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="pseudopal" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="alpha" type="xsd:int" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
@@ -107,24 +107,17 @@ Print detailed information about the muxer named @var{muxer_name}. Use the
|
||||
@option{-formats} option to get a list of all muxers and demuxers.
|
||||
|
||||
@item filter=@var{filter_name}
|
||||
Print detailed information about the filter named @var{filter_name}. Use the
|
||||
Print detailed information about the filter name @var{filter_name}. Use the
|
||||
@option{-filters} option to get a list of all filters.
|
||||
|
||||
@item bsf=@var{bitstream_filter_name}
|
||||
Print detailed information about the bitstream filter named @var{bitstream_filter_name}.
|
||||
Print detailed information about the bitstream filter name @var{bitstream_filter_name}.
|
||||
Use the @option{-bsfs} option to get a list of all bitstream filters.
|
||||
|
||||
@item protocol=@var{protocol_name}
|
||||
Print detailed information about the protocol named @var{protocol_name}.
|
||||
Use the @option{-protocols} option to get a list of all protocols.
|
||||
@end table
|
||||
|
||||
@item -version
|
||||
Show version.
|
||||
|
||||
@item -buildconf
|
||||
Show the build configuration, one option per line.
|
||||
|
||||
@item -formats
|
||||
Show available formats (including devices).
|
||||
|
||||
@@ -243,11 +236,13 @@ ffmpeg [...] -loglevel +repeat
|
||||
By default the program logs to stderr. If coloring is supported by the
|
||||
terminal, colors are used to mark errors and warnings. Log coloring
|
||||
can be disabled setting the environment variable
|
||||
@env{AV_LOG_FORCE_NOCOLOR}, or can be forced setting
|
||||
@env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
|
||||
the environment variable @env{AV_LOG_FORCE_COLOR}.
|
||||
The use of the environment variable @env{NO_COLOR} is deprecated and
|
||||
will be dropped in a future FFmpeg version.
|
||||
|
||||
@item -report
|
||||
Dump full command line and log output to a file named
|
||||
Dump full command line and console output to a file named
|
||||
@code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
|
||||
directory.
|
||||
This file can be useful for bug reports.
|
||||
@@ -352,12 +347,6 @@ Possible flags for this option are:
|
||||
@item k8
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@item -max_alloc @var{bytes}
|
||||
Set the maximum size limit for allocating a block on the heap by ffmpeg's
|
||||
family of malloc functions. Exercise @strong{extreme caution} when using
|
||||
this option. Don't use if you do not understand the full consequence of doing so.
|
||||
Default is INT_MAX.
|
||||
@end table
|
||||
|
||||
@section AVOptions
|
||||
|
||||
5434
doc/filters.texi
5434
doc/filters.texi
File diff suppressed because it is too large
Load Diff
@@ -27,10 +27,6 @@ stream information. A higher value will enable detecting more
|
||||
information in case it is dispersed into the stream, but will increase
|
||||
latency. Must be an integer not lesser than 32. It is 5000000 by default.
|
||||
|
||||
@item max_probe_packets @var{integer} (@emph{input})
|
||||
Set the maximum number of buffered packets when probing a codec.
|
||||
Default is 2500 packets.
|
||||
|
||||
@item packetsize @var{integer} (@emph{output})
|
||||
Set packet size.
|
||||
|
||||
@@ -143,7 +139,7 @@ Consider things that a sane encoder should not do as an error.
|
||||
|
||||
@item max_interleave_delta @var{integer} (@emph{output})
|
||||
Set maximum buffering duration for interleaving. The duration is
|
||||
expressed in microseconds, and defaults to 10000000 (10 seconds).
|
||||
expressed in microseconds, and defaults to 1000000 (1 second).
|
||||
|
||||
To ensure all the streams are interleaved correctly, libavformat will
|
||||
wait until it has at least one packet for each stream before actually
|
||||
|
||||
1364
doc/general.texi
1364
doc/general.texi
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -277,8 +277,8 @@ audio track.
|
||||
|
||||
@item list_devices
|
||||
If set to @option{true}, print a list of devices and exit.
|
||||
Defaults to @option{false}. This option is deprecated, please use the
|
||||
@code{-sources} option of ffmpeg to list the available input devices.
|
||||
Defaults to @option{false}. Alternatively you can use the @code{-sources}
|
||||
option of ffmpeg to list the available input devices.
|
||||
|
||||
@item list_formats
|
||||
If set to @option{true}, print a list of supported formats and exit.
|
||||
@@ -292,35 +292,25 @@ as @option{pal} (3 letters).
|
||||
Default behavior is autodetection of the input video format, if the hardware
|
||||
supports it.
|
||||
|
||||
@item bm_v210
|
||||
This is a deprecated option, you can use @option{raw_format} instead.
|
||||
If set to @samp{1}, video is captured in 10 bit v210 instead
|
||||
of uyvy422. Not all Blackmagic devices support this option.
|
||||
|
||||
@item raw_format
|
||||
Set the pixel format of the captured video.
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item auto
|
||||
|
||||
This is the default which means 8-bit YUV 422 or 8-bit ARGB if format
|
||||
autodetection is used, 8-bit YUV 422 otherwise.
|
||||
|
||||
@item uyvy422
|
||||
|
||||
8-bit YUV 422.
|
||||
|
||||
@item yuv422p10
|
||||
|
||||
10-bit YUV 422.
|
||||
|
||||
@item argb
|
||||
|
||||
8-bit RGB.
|
||||
|
||||
@item bgra
|
||||
|
||||
8-bit RGB.
|
||||
|
||||
@item rgb10
|
||||
|
||||
10-bit RGB.
|
||||
|
||||
@end table
|
||||
|
||||
@item teletext_lines
|
||||
@@ -350,13 +340,8 @@ Defaults to @samp{unset}.
|
||||
@item timecode_format
|
||||
Timecode type to include in the frame and video stream metadata. Must be
|
||||
@samp{none}, @samp{rp188vitc}, @samp{rp188vitc2}, @samp{rp188ltc},
|
||||
@samp{rp188hfr}, @samp{rp188any}, @samp{vitc}, @samp{vitc2}, or @samp{serial}.
|
||||
Defaults to @samp{none} (not included).
|
||||
|
||||
In order to properly support 50/60 fps timecodes, the ordering of the queried
|
||||
timecode types for @samp{rp188any} is HFR, VITC1, VITC2 and LTC for >30 fps
|
||||
content. Note that this is slightly different to the ordering used by the
|
||||
DeckLink API, which is HFR, VITC1, LTC, VITC2.
|
||||
@samp{rp188any}, @samp{vitc}, @samp{vitc2}, or @samp{serial}. Defaults to
|
||||
@samp{none} (not included).
|
||||
|
||||
@item video_input
|
||||
Sets the video input source. Must be @samp{unset}, @samp{sdi}, @samp{hdmi},
|
||||
@@ -410,20 +395,6 @@ Either sync could go wrong by 1 frame or in a rarer case
|
||||
@option{timestamp_align} seconds.
|
||||
Defaults to @samp{0}.
|
||||
|
||||
@item wait_for_tc (@emph{bool})
|
||||
Drop frames till a frame with timecode is received. Sometimes serial timecode
|
||||
isn't received with the first input frame. If that happens, the stored stream
|
||||
timecode will be inaccurate. If this option is set to @option{true}, input frames
|
||||
are dropped till a frame with timecode is received.
|
||||
Option @var{timecode_format} must be specified.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@item enable_klv(@emph{bool})
|
||||
If set to @option{true}, extracts KLV data from VANC and outputs KLV packets.
|
||||
KLV VANC packets are joined based on MID and PSC fields and aggregated into
|
||||
one KLV packet.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -433,7 +404,7 @@ Defaults to @option{false}.
|
||||
@item
|
||||
List input devices:
|
||||
@example
|
||||
ffmpeg -sources decklink
|
||||
ffmpeg -f decklink -list_devices 1 -i dummy
|
||||
@end example
|
||||
|
||||
@item
|
||||
@@ -451,7 +422,7 @@ ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy outp
|
||||
@item
|
||||
Capture video clip at 1080i50 10 bit:
|
||||
@example
|
||||
ffmpeg -raw_format yuv422p10 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
|
||||
ffmpeg -bm_v210 1 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
|
||||
@end example
|
||||
|
||||
@item
|
||||
@@ -909,15 +880,11 @@ If you don't understand what all of that means, you probably don't want this. L
|
||||
DRM device to capture on. Defaults to @option{/dev/dri/card0}.
|
||||
|
||||
@item format
|
||||
Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7
|
||||
or later, but needs to be provided for earlier versions. Defaults to @option{bgr0},
|
||||
which is the most common format used by the Linux console and Xorg X server.
|
||||
Pixel format of the framebuffer. Defaults to @option{bgr0}.
|
||||
|
||||
@item format_modifier
|
||||
Format modifier to signal on output frames. This is necessary to import correctly into
|
||||
some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need
|
||||
to be provided explicitly when needed in earlier versions. See the libdrm documentation
|
||||
for possible values.
|
||||
some APIs, but can't be autodetected. See the libdrm documentation for possible values.
|
||||
|
||||
@item crtc_id
|
||||
KMS CRTC ID to define the capture source. The first active plane on the given CRTC
|
||||
@@ -1508,14 +1475,6 @@ ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item select_region
|
||||
Specify whether to select the grabbing area graphically using the pointer.
|
||||
A value of @code{1} prompts the user to select the grabbing area graphically
|
||||
by clicking and dragging. A single click with no dragging will select the
|
||||
whole screen. A region with zero width or height will also select the whole
|
||||
screen. This option overwrites the @var{video_size}, @var{grab_x}, and
|
||||
@var{grab_y} options. Default value is @code{0}.
|
||||
|
||||
@item draw_mouse
|
||||
Specify whether to draw the mouse pointer. A value of @code{0} specifies
|
||||
not to draw the pointer. Default value is @code{1}.
|
||||
@@ -1564,21 +1523,8 @@ With @var{follow_mouse}:
|
||||
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
|
||||
@end example
|
||||
|
||||
@item window_id
|
||||
Grab this window, instead of the whole screen. Default value is 0, which maps to
|
||||
the whole screen (root window).
|
||||
|
||||
The id of a window can be found using the @command{xwininfo} program, possibly with options -tree and
|
||||
-root.
|
||||
|
||||
If the window is later enlarged, the new area is not recorded. Video ends when
|
||||
the window is closed, unmapped (i.e., iconified) or shrunk beyond the video
|
||||
size (which defaults to the initial window size).
|
||||
|
||||
This option disables options @option{follow_mouse} and @option{select_region}.
|
||||
|
||||
@item video_size
|
||||
Set the video frame size. Default is the full desktop or window.
|
||||
Set the video frame size. Default value is @code{vga}.
|
||||
|
||||
@item grab_x
|
||||
@item grab_y
|
||||
|
||||
@@ -20,7 +20,8 @@ Slice threading -
|
||||
|
||||
Frame threading -
|
||||
* Restrictions with slice threading also apply.
|
||||
* Custom get_buffer2() and get_format() callbacks must be thread-safe.
|
||||
* For best performance, the client should set thread_safe_callbacks if it
|
||||
provides a thread-safe get_buffer() callback.
|
||||
* There is one frame of delay added for every thread beyond the first one.
|
||||
Clients must be able to handle this; the pkt_dts and pkt_pts fields in
|
||||
AVFrame will work as usual.
|
||||
@@ -50,14 +51,16 @@ the decode process starts. Call ff_thread_finish_setup() afterwards. If
|
||||
some code can't be moved, have update_thread_context() run it in the next
|
||||
thread.
|
||||
|
||||
If the codec allocates writable tables in its init(), add an init_thread_copy()
|
||||
which re-allocates them for other threads.
|
||||
|
||||
Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
|
||||
speed gain at this point but it should work.
|
||||
|
||||
If there are inter-frame dependencies, so the codec calls
|
||||
ff_thread_report/await_progress(), set FF_CODEC_CAP_ALLOCATE_PROGRESS in
|
||||
AVCodec.caps_internal and use ff_thread_get_buffer() to allocate frames. The
|
||||
ff_thread_report/await_progress(), set AVCodecInternal.allocate_progress. The
|
||||
frames must then be freed with ff_thread_release_buffer().
|
||||
Otherwise decode directly into the user-supplied frames.
|
||||
Otherwise leave it at zero and decode directly into the user-supplied frames.
|
||||
|
||||
Call ff_thread_report_progress() after some part of the current picture has decoded.
|
||||
A good place to put this is where draw_horiz_band() is called - add this if it isn't
|
||||
|
||||
297
doc/muxers.texi
297
doc/muxers.texi
@@ -89,12 +89,6 @@ specific scenarios, e.g. when merging multiple audio streams into one for
|
||||
compatibility with software that only supports a single audio stream in AVI
|
||||
(see @ref{amerge,,the "amerge" section in the ffmpeg-filters manual,ffmpeg-filters}).
|
||||
|
||||
@item flipped_raw_rgb
|
||||
If set to true, store positive height for raw RGB bitmaps, which indicates
|
||||
bitmap is stored bottom-up. Note that this option does not flip the bitmap
|
||||
which has to be done manually beforehand, e.g. by using the vflip filter.
|
||||
Default is @var{false} and indicates bitmap is stored top down.
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{chromaprint}
|
||||
@@ -111,14 +105,12 @@ It takes a single signed native-endian 16-bit raw audio stream of at most 2 chan
|
||||
|
||||
@table @option
|
||||
@item silence_threshold
|
||||
Threshold for detecting silence. Range is from -1 to 32767, where -1 disables
|
||||
silence detection. Silence detection can only be used with version 3 of the
|
||||
algorithm.
|
||||
Silence detection must be disabled for use with the AcoustID service. Default is -1.
|
||||
Threshold for detecting silence, ranges from -1 to 32767. -1 disables silence detection and
|
||||
is required for use with the AcoustID service. Default is -1.
|
||||
|
||||
@item algorithm
|
||||
Version of algorithm to fingerprint with. Range is 0 to 4.
|
||||
Version 3 enables silence detection. Default is 1.
|
||||
Version of algorithm to fingerprint with. Range is 0 to 4. Version 2 requires that silence
|
||||
detection be enabled. Default is 1.
|
||||
|
||||
@item fp_format
|
||||
Format to output the fingerprint as. Accepts the following options:
|
||||
@@ -244,10 +236,6 @@ Set the segment length in seconds (fractional value can be set). The value is
|
||||
treated as average segment duration when @var{use_template} is enabled and
|
||||
@var{use_timeline} is disabled and as minimum segment duration for all the other
|
||||
use cases.
|
||||
@item frag_duration @var{duration}
|
||||
Set the length in seconds of fragments within segments (fractional value can be set).
|
||||
@item frag_type @var{type}
|
||||
Set the type of interval for fragmentation.
|
||||
@item window_size @var{size}
|
||||
Set the maximum number of segments kept in the manifest.
|
||||
@item extra_window_size @var{size}
|
||||
@@ -275,10 +263,8 @@ Override User-Agent field in HTTP header. Applicable only for HTTP output.
|
||||
@item http_persistent @var{http_persistent}
|
||||
Use persistent HTTP connections. Applicable only for HTTP output.
|
||||
@item hls_playlist @var{hls_playlist}
|
||||
Generate HLS playlist files as well. The master playlist is generated with the filename @var{hls_master_name}.
|
||||
Generate HLS playlist files as well. The master playlist is generated with the filename master.m3u8.
|
||||
One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc.
|
||||
@item hls_master_name @var{file_name}
|
||||
HLS master playlist name. Default is "master.m3u8".
|
||||
@item streaming @var{streaming}
|
||||
Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming
|
||||
mode, each frame will be a moof fragment which forms a chunk.
|
||||
@@ -289,15 +275,6 @@ of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
|
||||
To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can be used as stream identifier instead of IDs.
|
||||
|
||||
When no assignment is defined, this defaults to an AdaptationSet for each stream.
|
||||
|
||||
Optional syntax is "id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e" and so on,
|
||||
descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.
|
||||
For example, -adaptation_sets "id=0,descriptor=<SupplementalProperty schemeIdUri=\"urn:mpeg:dash:srd:2014\" value=\"0,0,0,1,1,2,2\"/>,streams=v".
|
||||
Please note that descriptor string should be a self-closing xml tag.
|
||||
seg_duration, frag_duration and frag_type override the global option values for each adaptation set.
|
||||
For example, -adaptation_sets "id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a"
|
||||
type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set.
|
||||
For example, -adaptation_sets "id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1"
|
||||
@item timeout @var{timeout}
|
||||
Set timeout for socket I/O operations. Applicable only for HTTP output.
|
||||
@item index_correction @var{index_correction}
|
||||
@@ -343,41 +320,9 @@ This option will also try to comply with the above open spec, till Apple's spec
|
||||
Applicable only when @var{streaming} and @var{hls_playlist} options are enabled.
|
||||
This is an experimental feature.
|
||||
|
||||
@item ldash @var{ldash}
|
||||
Enable Low-latency Dash by constraining the presence and values of some elements.
|
||||
|
||||
@item master_m3u8_publish_rate @var{master_m3u8_publish_rate}
|
||||
Publish master playlist repeatedly every after specified number of segment intervals.
|
||||
|
||||
@item write_prft @var{write_prft}
|
||||
Write Producer Reference Time elements on supported streams. This also enables writing
|
||||
prft boxes in the underlying muxer. Applicable only when the @var{utc_url} option is enabled.
|
||||
It's set to auto by default, in which case the muxer will attempt to enable it only in modes
|
||||
that require it.
|
||||
|
||||
@item mpd_profile @var{mpd_profile}
|
||||
Set one or more manifest profiles.
|
||||
|
||||
@item http_opts @var{http_opts}
|
||||
A :-separated list of key=value options to pass to the underlying HTTP
|
||||
protocol. Applicable only for HTTP output.
|
||||
|
||||
@item target_latency @var{target_latency}
|
||||
Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when @var{streaming} and @var{write_prft} options are enabled.
|
||||
This is an informative fields clients can use to measure the latency of the service.
|
||||
|
||||
@item min_playback_rate @var{min_playback_rate}
|
||||
Set the minimum playback rate indicated as appropriate for the purposes of automatically
|
||||
adjusting playback latency and buffer occupancy during normal playback by clients.
|
||||
|
||||
@item max_playback_rate @var{max_playback_rate}
|
||||
Set the maximum playback rate indicated as appropriate for the purposes of automatically
|
||||
adjusting playback latency and buffer occupancy during normal playback by clients.
|
||||
|
||||
@item update_period @var{update_period}
|
||||
Set the mpd update period ,for dynamic content.
|
||||
The unit is second.
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{framecrc}
|
||||
@@ -611,21 +556,14 @@ segmentation.
|
||||
This muxer supports the following options:
|
||||
|
||||
@table @option
|
||||
@item hls_init_time @var{duration}
|
||||
Set the initial target segment length. Default value is @var{0}.
|
||||
|
||||
@var{duration} must be a time duration specification,
|
||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
|
||||
@item hls_init_time @var{seconds}
|
||||
Set the initial target segment length in seconds. Default value is @var{0}.
|
||||
Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
|
||||
After the initial playlist is filled @command{ffmpeg} will cut segments
|
||||
at duration equal to @code{hls_time}
|
||||
|
||||
@item hls_time @var{duration}
|
||||
Set the target segment length. Default value is 2.
|
||||
|
||||
@var{duration} must be a time duration specification,
|
||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
@item hls_time @var{seconds}
|
||||
Set the target segment length in seconds. Default value is 2.
|
||||
Segment will be cut on the next key frame after this time has passed.
|
||||
|
||||
@item hls_list_size @var{size}
|
||||
@@ -669,9 +607,6 @@ Set the starting sequence numbers according to @var{start_number} option value.
|
||||
@item epoch
|
||||
The start number will be the seconds since epoch (1970-01-01 00:00:00)
|
||||
|
||||
@item epoch_us
|
||||
The start number will be the microseconds since epoch (1970-01-01 00:00:00)
|
||||
|
||||
@item datetime
|
||||
The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
|
||||
|
||||
@@ -840,7 +775,7 @@ When enabled every segment generated is encrypted and the encryption key
|
||||
is saved as @var{playlist name}.key.
|
||||
|
||||
@item -hls_enc_key @var{key}
|
||||
16-octet key to encrypt the segments, by default it
|
||||
Hex-coded 16byte key to encrypt the segments, by default it
|
||||
is randomly generated.
|
||||
|
||||
@item -hls_enc_key_url @var{keyurl}
|
||||
@@ -848,7 +783,7 @@ If set, @var{keyurl} is prepended instead of @var{baseurl} to the key filename
|
||||
in the playlist.
|
||||
|
||||
@item -hls_enc_iv @var{iv}
|
||||
16-octet initialization vector for every segment instead
|
||||
Hex-coded 16byte initialization vector for every segment instead
|
||||
of the autogenerated ones.
|
||||
|
||||
@item hls_segment_type @var{flags}
|
||||
@@ -868,16 +803,6 @@ fmp4 files may be used in HLS version 7 and above.
|
||||
@item hls_fmp4_init_filename @var{filename}
|
||||
Set filename to the fragment files header file, default filename is @file{init.mp4}.
|
||||
|
||||
Use @code{-strftime 1} on @var{filename} to expand the segment filename with localtime.
|
||||
@example
|
||||
ffmpeg -i in.nut -hls_segment_type fmp4 -strftime 1 -hls_fmp4_init_filename "%s_init.mp4" out.m3u8
|
||||
@end example
|
||||
This will produce init like this
|
||||
@file{1602678741_init.mp4}
|
||||
|
||||
@item hls_fmp4_init_resend
|
||||
Resend init file after m3u8 file refresh every time, default is @var{0}.
|
||||
|
||||
When @code{var_stream_map} is set with two or more variant streams, the
|
||||
@var{filename} pattern must contain the string "%v", this string specifies
|
||||
the position of variant stream index in the generated init file names.
|
||||
@@ -973,8 +898,8 @@ serving up segments can be configured to reject requests to *.tmp to prevent acc
|
||||
before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
|
||||
If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
|
||||
But playlists with @code{file} protocol and with type (@code{hls_playlist_type}) other than @code{vod}
|
||||
are always written into temporary file regardless of this flag. Master playlist files (@code{master_pl_name}), if any, with @code{file} protocol,
|
||||
are always written into temporary file regardless of this flag if @code{master_pl_publish_rate} value is other than zero.
|
||||
are always written into temporary file regardles of this flag. Master playlist files (@code{master_pl_name}), if any, with @code{file} protocol,
|
||||
are always written into temporary file regardles of this flag if @code{master_pl_publish_rate} value is other than zero.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -1104,21 +1029,6 @@ have and language is named ENG, the other audio language is named CHN.
|
||||
|
||||
By default, a single hls variant containing all the encoded streams is created.
|
||||
|
||||
@example
|
||||
ffmpeg -y -i input_with_subtitle.mkv \
|
||||
-b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
|
||||
-b:a:0 256k \
|
||||
-c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
|
||||
-f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \
|
||||
-master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
|
||||
10 -master_pl_publish_rate 10 -hls_flags \
|
||||
delete_segments+discont_start+split_by_time ./tmp/video.m3u8
|
||||
@end example
|
||||
|
||||
This example adds @code{#EXT-X-MEDIA} tag with @code{TYPE=SUBTITLES} in
|
||||
the master playlist with webvtt subtitle group name 'subtitle'. Please make sure
|
||||
the input file has one text subtitle stream at least.
|
||||
|
||||
@item cc_stream_map
|
||||
Map string which specifies different closed captions groups and their
|
||||
attributes. The closed captions stream groups are separated by space.
|
||||
@@ -1253,37 +1163,6 @@ The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
|
||||
form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg},
|
||||
etc.
|
||||
|
||||
The image muxer supports the .Y.U.V image file format. This format is
|
||||
special in that that each image frame consists of three files, for
|
||||
each of the YUV420P components. To read or write this image file format,
|
||||
specify the name of the '.Y' file. The muxer will automatically open the
|
||||
'.U' and '.V' files as required.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item frame_pts
|
||||
If set to 1, expand the filename with pts from pkt->pts.
|
||||
Default value is 0.
|
||||
|
||||
@item start_number
|
||||
Start the sequence from the specified number. Default value is 1.
|
||||
|
||||
@item update
|
||||
If set to 1, the filename will always be interpreted as just a
|
||||
filename, not a pattern, and the corresponding file will be continuously
|
||||
overwritten with new images. Default value is 0.
|
||||
|
||||
@item strftime
|
||||
If set to 1, expand the filename with date and time information from
|
||||
@code{strftime()}. Default value is 0.
|
||||
|
||||
@item protocol_opts @var{options_list}
|
||||
Set protocol options as a :-separated list of key=value parameters. Values
|
||||
containing the @code{:} special character must be escaped.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
The following example shows how to use @command{ffmpeg} for creating a
|
||||
@@ -1324,11 +1203,31 @@ You can set the file name with current frame's PTS:
|
||||
ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg"
|
||||
@end example
|
||||
|
||||
A more complex example is to publish contents of your desktop directly to a
|
||||
WebDAV server every second:
|
||||
@example
|
||||
ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
|
||||
@end example
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item frame_pts
|
||||
If set to 1, expand the filename with pts from pkt->pts.
|
||||
Default value is 0.
|
||||
|
||||
@item start_number
|
||||
Start the sequence from the specified number. Default value is 1.
|
||||
|
||||
@item update
|
||||
If set to 1, the filename will always be interpreted as just a
|
||||
filename, not a pattern, and the corresponding file will be continuously
|
||||
overwritten with new images. Default value is 0.
|
||||
|
||||
@item strftime
|
||||
If set to 1, expand the filename with date and time information from
|
||||
@code{strftime()}. Default value is 0.
|
||||
@end table
|
||||
|
||||
The image muxer supports the .Y.U.V image file format. This format is
|
||||
special in that that each image frame consists of three files, for
|
||||
each of the YUV420P components. To read or write this image file format,
|
||||
specify the name of the '.Y' file. The muxer will automatically open the
|
||||
'.U' and '.V' files as required.
|
||||
|
||||
@section matroska
|
||||
|
||||
@@ -1342,8 +1241,7 @@ The recognized metadata settings in this muxer are:
|
||||
|
||||
@table @option
|
||||
@item title
|
||||
Set title name provided to a single track. This gets mapped to
|
||||
the FileDescription element for a stream written as attachment.
|
||||
Set title name provided to a single track.
|
||||
|
||||
@item language
|
||||
Specify the language of the track in the Matroska languages form.
|
||||
@@ -1410,38 +1308,11 @@ index at the beginning of the file.
|
||||
|
||||
If this option is set to a non-zero value, the muxer will reserve a given amount
|
||||
of space in the file header and then try to write the cues there when the muxing
|
||||
finishes. If the reserved space does not suffice, no Cues will be written, the
|
||||
file will be finalized and writing the trailer will return an error.
|
||||
A safe size for most use cases should be about 50kB per hour of video.
|
||||
finishes. If the available space does not suffice, muxing will fail. A safe size
|
||||
for most use cases should be about 50kB per hour of video.
|
||||
|
||||
Note that cues are only written if the output is seekable and this option will
|
||||
have no effect if it is not.
|
||||
@item default_mode
|
||||
This option controls how the FlagDefault of the output tracks will be set.
|
||||
It influences which tracks players should play by default. The default mode
|
||||
is @samp{infer}.
|
||||
@table @samp
|
||||
@item infer
|
||||
In this mode, for each type of track (audio, video or subtitle), if there is
|
||||
a track with disposition default of this type, then the first such track
|
||||
(i.e. the one with the lowest index) will be marked as default; if no such
|
||||
track exists, the first track of this type will be marked as default instead
|
||||
(if existing). This ensures that the default flag is set in a sensible way even
|
||||
if the input originated from containers that lack the concept of default tracks.
|
||||
@item infer_no_subs
|
||||
This mode is the same as infer except that if no subtitle track with
|
||||
disposition default exists, no subtitle track will be marked as default.
|
||||
@item passthrough
|
||||
In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT
|
||||
flag is set in the disposition of the corresponding stream.
|
||||
@end table
|
||||
|
||||
@item flipped_raw_rgb
|
||||
If set to true, store positive height for raw RGB bitmaps, which indicates
|
||||
bitmap is stored bottom-up. Note that this option does not flip the bitmap
|
||||
which has to be done manually beforehand, e.g. by using the vflip filter.
|
||||
Default is @var{false} and indicates bitmap is stored top down.
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{md5}
|
||||
@@ -1591,6 +1462,13 @@ point on IIS with this muxer. Example:
|
||||
ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
|
||||
@end example
|
||||
|
||||
@subsection Audible AAX
|
||||
|
||||
Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
|
||||
@example
|
||||
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
|
||||
@end example
|
||||
|
||||
@section mp3
|
||||
|
||||
The MP3 muxer writes a raw MP3 stream with the following optional features:
|
||||
@@ -1698,14 +1576,11 @@ Advanced Codec Digital HDTV service.
|
||||
@end table
|
||||
|
||||
@item mpegts_pmt_start_pid @var{integer}
|
||||
Set the first PID for PMTs. Default is @code{0x1000}, minimum is @code{0x0020},
|
||||
maximum is @code{0x1ffa}. This option has no effect in m2ts mode where the PMT
|
||||
PID is fixed @code{0x0100}.
|
||||
Set the first PID for PMT. Default is @code{0x1000}. Max is @code{0x1f00}.
|
||||
|
||||
@item mpegts_start_pid @var{integer}
|
||||
Set the first PID for elementary streams. Default is @code{0x0100}, minimum is
|
||||
@code{0x0020}, maximum is @code{0x1ffa}. This option has no effect in m2ts mode
|
||||
where the elementary stream PIDs are fixed.
|
||||
Set the first PID for data packets. Default is @code{0x0100}. Max is
|
||||
@code{0x0f00}.
|
||||
|
||||
@item mpegts_m2ts_mode @var{boolean}
|
||||
Enable m2ts mode if set to @code{1}. Default value is @code{-1} which
|
||||
@@ -1732,6 +1607,10 @@ Conform to System B (DVB) instead of System A (ATSC).
|
||||
Mark the initial packet of each stream as discontinuity.
|
||||
@end table
|
||||
|
||||
@item resend_headers @var{integer}
|
||||
Reemit PAT/PMT before writing the next packet. This option is deprecated:
|
||||
use @option{mpegts_flags} instead.
|
||||
|
||||
@item mpegts_copyts @var{boolean}
|
||||
Preserve original timestamps, if value is set to @code{1}. Default value
|
||||
is @code{-1}, which results in shifting timestamps so that they start from 0.
|
||||
@@ -1740,16 +1619,14 @@ is @code{-1}, which results in shifting timestamps so that they start from 0.
|
||||
Omit the PES packet length for video packets. Default is @code{1} (true).
|
||||
|
||||
@item pcr_period @var{integer}
|
||||
Override the default PCR retransmission time in milliseconds. Default is
|
||||
@code{-1} which means that the PCR interval will be determined automatically:
|
||||
20 ms is used for CBR streams, the highest multiple of the frame duration which
|
||||
is less than 100 ms is used for VBR streams.
|
||||
Override the default PCR retransmission time in milliseconds. Ignored if
|
||||
variable muxrate is selected. Default is @code{20}.
|
||||
|
||||
@item pat_period @var{duration}
|
||||
Maximum time in seconds between PAT/PMT tables. Default is @code{0.1}.
|
||||
@item pat_period @var{double}
|
||||
Maximum time in seconds between PAT/PMT tables.
|
||||
|
||||
@item sdt_period @var{duration}
|
||||
Maximum time in seconds between SDT tables. Default is @code{0.5}.
|
||||
@item sdt_period @var{double}
|
||||
Maximum time in seconds between SDT tables.
|
||||
|
||||
@item tables_version @var{integer}
|
||||
Set PAT, PMT and SDT version (default @code{0}, valid values are from 0 to 31, inclusively).
|
||||
@@ -2185,53 +2062,6 @@ Specify whether to remove all fragments when finished. Default 0 (do not remove)
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{streamhash}
|
||||
@section streamhash
|
||||
|
||||
Per stream hash testing format.
|
||||
|
||||
This muxer computes and prints a cryptographic hash of all the input frames,
|
||||
on a per-stream basis. This can be used for equality checks without having
|
||||
to do a complete binary comparison.
|
||||
|
||||
By default audio frames are converted to signed 16-bit raw audio and
|
||||
video frames to raw video before computing the hash, but the output
|
||||
of explicit conversions to other codecs can also be used. Timestamps
|
||||
are ignored. It uses the SHA-256 cryptographic hash function by default,
|
||||
but supports several other algorithms.
|
||||
|
||||
The output of the muxer consists of one line per stream of the form:
|
||||
@var{streamindex},@var{streamtype},@var{algo}=@var{hash}, where
|
||||
@var{streamindex} is the index of the mapped stream, @var{streamtype} is a
|
||||
single character indicating the type of stream, @var{algo} is a short string
|
||||
representing the hash function used, and @var{hash} is a hexadecimal number
|
||||
representing the computed hash.
|
||||
|
||||
@table @option
|
||||
@item hash @var{algorithm}
|
||||
Use the cryptographic hash function specified by the string @var{algorithm}.
|
||||
Supported values include @code{MD5}, @code{murmur3}, @code{RIPEMD128},
|
||||
@code{RIPEMD160}, @code{RIPEMD256}, @code{RIPEMD320}, @code{SHA160},
|
||||
@code{SHA224}, @code{SHA256} (default), @code{SHA512/224}, @code{SHA512/256},
|
||||
@code{SHA384}, @code{SHA512}, @code{CRC32} and @code{adler32}.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
To compute the SHA-256 hash of the input converted to raw audio and
|
||||
video, and store it in the file @file{out.sha256}:
|
||||
@example
|
||||
ffmpeg -i INPUT -f streamhash out.sha256
|
||||
@end example
|
||||
|
||||
To print an MD5 hash to stdout use the command:
|
||||
@example
|
||||
ffmpeg -i INPUT -f streamhash -hash md5 -
|
||||
@end example
|
||||
|
||||
See also the @ref{hash} and @ref{framehash} muxers.
|
||||
|
||||
@anchor{fifo}
|
||||
@section fifo
|
||||
|
||||
@@ -2310,11 +2140,6 @@ certain (usually permanent) errors the recovery is not attempted even when
|
||||
Specify whether to wait for the keyframe after recovering from
|
||||
queue overflow or failure. This option is set to 0 (false) by default.
|
||||
|
||||
@item timeshift @var{duration}
|
||||
Buffer the specified amount of packets and delay writing the output. Note that
|
||||
@var{queue_size} must be big enough to store the packets for timeshift. At the
|
||||
end of the input the fifo buffer is flushed at realtime speed.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@@ -38,52 +38,6 @@ ffmpeg -i INPUT -f alsa hw:1,7
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section AudioToolbox
|
||||
|
||||
AudioToolbox output device.
|
||||
|
||||
Allows native output to CoreAudio devices on OSX.
|
||||
|
||||
The output filename can be empty (or @code{-}) to refer to the default system output device or a number that refers to the device index as shown using: @code{-list_devices true}.
|
||||
|
||||
Alternatively, the audio input device can be chosen by index using the
|
||||
@option{
|
||||
-audio_device_index <INDEX>
|
||||
}
|
||||
, overriding any device name or index given in the input filename.
|
||||
|
||||
All available devices can be enumerated by using @option{-list_devices true}, listing
|
||||
all device names, UIDs and corresponding indices.
|
||||
|
||||
@subsection Options
|
||||
|
||||
AudioToolbox supports the following options:
|
||||
|
||||
@table @option
|
||||
|
||||
@item -audio_device_index <INDEX>
|
||||
Specify the audio device by its index. Overrides anything given in the output filename.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
|
||||
@item
|
||||
Print the list of supported devices and output a sine wave to the default device:
|
||||
@example
|
||||
$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
|
||||
@end example
|
||||
|
||||
@item
|
||||
Output a sine wave to the device with the index 2, overriding any output filename:
|
||||
@example
|
||||
$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
@section caca
|
||||
|
||||
CACA output device.
|
||||
@@ -186,8 +140,8 @@ device with @command{-list_formats 1}. Audio sample rate is always 48 kHz.
|
||||
|
||||
@item list_devices
|
||||
If set to @option{true}, print a list of devices and exit.
|
||||
Defaults to @option{false}. This option is deprecated, please use the
|
||||
@code{-sinks} option of ffmpeg to list the available output devices.
|
||||
Defaults to @option{false}. Alternatively you can use the @code{-sinks}
|
||||
option of ffmpeg to list the available output devices.
|
||||
|
||||
@item list_formats
|
||||
If set to @option{true}, print a list of supported formats and exit.
|
||||
@@ -214,7 +168,7 @@ Defaults to @samp{unset}.
|
||||
@item
|
||||
List output devices:
|
||||
@example
|
||||
ffmpeg -sinks decklink
|
||||
ffmpeg -i test.avi -f decklink -list_devices 1 dummy
|
||||
@end example
|
||||
|
||||
@item
|
||||
@@ -375,8 +329,6 @@ ffmpeg -i INPUT -f pulse "stream name"
|
||||
|
||||
SDL (Simple DirectMedia Layer) output device.
|
||||
|
||||
"sdl2" can be used as alias for "sdl".
|
||||
|
||||
This output device allows one to show a video stream in an SDL
|
||||
window. Only one SDL window is allowed per application, so you can
|
||||
have only one instance of this output device in an application.
|
||||
|
||||
@@ -51,82 +51,6 @@ in microseconds.
|
||||
|
||||
A description of the currently available protocols follows.
|
||||
|
||||
@section amqp
|
||||
|
||||
Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based
|
||||
publish-subscribe communication protocol.
|
||||
|
||||
FFmpeg must be compiled with --enable-librabbitmq to support AMQP. A separate
|
||||
AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ.
|
||||
|
||||
After starting the broker, an FFmpeg client may stream data to the broker using
|
||||
the command:
|
||||
|
||||
@example
|
||||
ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@@]hostname[:port][/vhost]
|
||||
@end example
|
||||
|
||||
Where hostname and port (default is 5672) is the address of the broker. The
|
||||
client may also set a user/password for authentication. The default for both
|
||||
fields is "guest". Name of virtual host on broker can be set with vhost. The
|
||||
default value is "/".
|
||||
|
||||
Muliple subscribers may stream from the broker using the command:
|
||||
@example
|
||||
ffplay amqp://[[user]:[password]@@]hostname[:port][/vhost]
|
||||
@end example
|
||||
|
||||
In RabbitMQ all data published to the broker flows through a specific exchange,
|
||||
and each subscribing client has an assigned queue/buffer. When a packet arrives
|
||||
at an exchange, it may be copied to a client's queue depending on the exchange
|
||||
and routing_key fields.
|
||||
|
||||
The following options are supported:
|
||||
|
||||
@table @option
|
||||
|
||||
@item exchange
|
||||
Sets the exchange to use on the broker. RabbitMQ has several predefined
|
||||
exchanges: "amq.direct" is the default exchange, where the publisher and
|
||||
subscriber must have a matching routing_key; "amq.fanout" is the same as a
|
||||
broadcast operation (i.e. the data is forwarded to all queues on the fanout
|
||||
exchange independent of the routing_key); and "amq.topic" is similar to
|
||||
"amq.direct", but allows for more complex pattern matching (refer to the RabbitMQ
|
||||
documentation).
|
||||
|
||||
@item routing_key
|
||||
Sets the routing key. The default value is "amqp". The routing key is used on
|
||||
the "amq.direct" and "amq.topic" exchanges to decide whether packets are written
|
||||
to the queue of a subscriber.
|
||||
|
||||
@item pkt_size
|
||||
Maximum size of each packet sent/received to the broker. Default is 131072.
|
||||
Minimum is 4096 and max is any large value (representable by an int). When
|
||||
receiving packets, this sets an internal buffer size in FFmpeg. It should be
|
||||
equal to or greater than the size of the published packets to the broker. Otherwise
|
||||
the received message may be truncated causing decoding errors.
|
||||
|
||||
@item connection_timeout
|
||||
The timeout in seconds during the initial connection to the broker. The
|
||||
default value is rw_timeout, or 5 seconds if rw_timeout is not set.
|
||||
|
||||
@item delivery_mode @var{mode}
|
||||
Sets the delivery mode of each message sent to broker.
|
||||
The following values are accepted:
|
||||
@table @samp
|
||||
@item persistent
|
||||
Delivery mode set to "persistent" (2). This is the default value.
|
||||
Messages may be written to the broker's disk depending on its setup.
|
||||
|
||||
@item non-persistent
|
||||
Delivery mode set to "non-persistent" (1).
|
||||
Messages will stay in broker's memory unless the broker is under memory
|
||||
pressure.
|
||||
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@section async
|
||||
|
||||
Asynchronous data filling wrapper for input stream.
|
||||
@@ -175,16 +99,6 @@ Caching wrapper for input stream.
|
||||
|
||||
Cache the input stream to temporary file. It brings seeking capability to live streams.
|
||||
|
||||
The accepted options are:
|
||||
@table @option
|
||||
|
||||
@item read_ahead_limit
|
||||
Amount in bytes that may be read ahead when seeking isn't supported. Range is -1 to INT_MAX.
|
||||
-1 for unlimited. Default is 65536.
|
||||
|
||||
@end table
|
||||
|
||||
URL Syntax is
|
||||
@example
|
||||
cache:@var{URL}
|
||||
@end example
|
||||
@@ -314,14 +228,6 @@ Set timeout in microseconds of socket I/O operations used by the underlying low
|
||||
operation. By default it is set to -1, which means that the timeout is
|
||||
not specified.
|
||||
|
||||
@item ftp-user
|
||||
Set a user to be used for authenticating to the FTP server. This is overridden by the
|
||||
user in the FTP URL.
|
||||
|
||||
@item ftp-password
|
||||
Set a password to be used for authenticating to the FTP server. This is overridden by
|
||||
the password in the FTP URL, or by @option{ftp-anonymous-password} if no user is set.
|
||||
|
||||
@item ftp-anonymous-password
|
||||
Password used when login as anonymous user. Typically an e-mail address
|
||||
should be used.
|
||||
@@ -341,12 +247,6 @@ operation. ff* tools may produce incomplete content due to server limitations.
|
||||
|
||||
Gopher protocol.
|
||||
|
||||
@section gophers
|
||||
|
||||
Gophers protocol.
|
||||
|
||||
The Gopher protocol with TLS encapsulation.
|
||||
|
||||
@section hls
|
||||
|
||||
Read Apple HTTP Live Streaming compliant segmented stream as
|
||||
@@ -409,6 +309,11 @@ string describing the libavformat build. ("Lavf/<version>")
|
||||
@item user-agent
|
||||
This is a deprecated option, you can use user_agent instead it.
|
||||
|
||||
@item timeout
|
||||
Set timeout in microseconds of socket I/O operations used by the underlying low level
|
||||
operation. By default it is set to -1, which means that the timeout is
|
||||
not specified.
|
||||
|
||||
@item reconnect_at_eof
|
||||
If set then eof is treated like an error and causes reconnection, this is useful
|
||||
for live / endless streams.
|
||||
@@ -416,13 +321,6 @@ for live / endless streams.
|
||||
@item reconnect_streamed
|
||||
If set then even streamed/non seekable streams will be reconnected on errors.
|
||||
|
||||
@item reconnect_on_network_error
|
||||
Reconnect automatically in case of TCP/TLS errors during connect.
|
||||
|
||||
@item reconnect_on_http_error
|
||||
A comma separated list of HTTP status codes to reconnect on. The list can
|
||||
include specific status codes (e.g. '503') or the strings '4xx' / '5xx'.
|
||||
|
||||
@item reconnect_delay_max
|
||||
Sets the maximum delay in seconds after which to give up reconnecting
|
||||
|
||||
@@ -500,28 +398,6 @@ Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
|
||||
to 0 it won't, if set to -1 it will try to send if it is applicable. Default
|
||||
value is -1.
|
||||
|
||||
@item auth_type
|
||||
|
||||
Set HTTP authentication type. No option for Digest, since this method requires
|
||||
getting nonce parameters from the server first and can't be used straight away like
|
||||
Basic.
|
||||
|
||||
@table @option
|
||||
@item none
|
||||
Choose the HTTP authentication type automatically. This is the default.
|
||||
@item basic
|
||||
|
||||
Choose the HTTP basic authentication.
|
||||
|
||||
Basic authentication sends a Base64-encoded string that contains a user name and password
|
||||
for the client. Base64 is not a form of encryption and should be considered the same as
|
||||
sending the user name and password in clear text (Base64 is a reversible encoding).
|
||||
If a resource needs to be protected, strongly consider using an authentication scheme
|
||||
other than basic authentication. HTTPS/TLS should be used with basic authentication.
|
||||
Without these additional security enhancements, basic authentication should not be used
|
||||
to protect sensitive or valuable information.
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@subsection HTTP Cookies
|
||||
@@ -576,9 +452,6 @@ audio/mpeg.
|
||||
This enables support for Icecast versions < 2.4.0, that do not support the
|
||||
HTTP PUT method but the SOURCE method.
|
||||
|
||||
@item tls
|
||||
Establish a TLS (HTTPS) connection to Icecast.
|
||||
|
||||
@end table
|
||||
|
||||
@example
|
||||
@@ -696,42 +569,6 @@ Example usage:
|
||||
-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://@var{hostname}:@var{port}
|
||||
@end example
|
||||
|
||||
@section rist
|
||||
|
||||
Reliable Internet Streaming Transport protocol
|
||||
|
||||
The accepted options are:
|
||||
@table @option
|
||||
@item rist_profile
|
||||
Supported values:
|
||||
@table @samp
|
||||
@item simple
|
||||
@item main
|
||||
This one is default.
|
||||
@item advanced
|
||||
@end table
|
||||
|
||||
@item buffer_size
|
||||
Set internal RIST buffer size in milliseconds for retransmission of data.
|
||||
Default value is 0 which means the librist default (1 sec). Maximum value is 30
|
||||
seconds.
|
||||
|
||||
@item pkt_size
|
||||
Set maximum packet size for sending data. 1316 by default.
|
||||
|
||||
@item log_level
|
||||
Set loglevel for RIST logging messages. You only need to set this if you
|
||||
explicitly want to enable debug level messages or packet loss simulation,
|
||||
otherwise the regular loglevel is respected.
|
||||
|
||||
@item secret
|
||||
Set override of encryption secret, by default is unset.
|
||||
|
||||
@item encryption
|
||||
Set encryption type, by default is disabled.
|
||||
Acceptable values are 128 and 256.
|
||||
@end table
|
||||
|
||||
@section rtmp
|
||||
|
||||
Real-Time Messaging Protocol.
|
||||
@@ -1033,9 +870,6 @@ Set the local RTCP port to @var{n}.
|
||||
@item pkt_size=@var{n}
|
||||
Set max packet size (in bytes) to @var{n}.
|
||||
|
||||
@item buffer_size=@var{size}
|
||||
Set the maximum UDP socket buffer size in bytes.
|
||||
|
||||
@item connect=0|1
|
||||
Do a @code{connect()} on the UDP socket (if set to 1) or not (if set
|
||||
to 0).
|
||||
@@ -1053,9 +887,6 @@ set to 1) or to a default remote address (if set to 0).
|
||||
@item localport=@var{n}
|
||||
Set the local RTP port to @var{n}.
|
||||
|
||||
@item timeout=@var{n}
|
||||
Set timeout (in microseconds) of socket I/O operations to @var{n}.
|
||||
|
||||
This is a deprecated option. Instead, @option{localrtpport} should be
|
||||
used.
|
||||
|
||||
@@ -1356,7 +1187,7 @@ options.
|
||||
This protocol accepts the following options.
|
||||
|
||||
@table @option
|
||||
@item connect_timeout=@var{milliseconds}
|
||||
@item connect_timeout
|
||||
Connection timeout; SRT cannot connect for RTT > 1500 msec
|
||||
(2 handshake exchanges) with the default connect timeout of
|
||||
3 seconds. This option applies to the caller and rendezvous
|
||||
@@ -1387,7 +1218,7 @@ IP Type of Service. Applies to sender only. Default value is 0xB8.
|
||||
@item ipttl=@var{ttl}
|
||||
IP Time To Live. Applies to sender only. Default value is 64.
|
||||
|
||||
@item latency=@var{microseconds}
|
||||
@item latency
|
||||
Timestamp-based Packet Delivery Delay.
|
||||
Used to absorb bursts of missed packet retransmissions.
|
||||
This flag sets both @option{rcvlatency} and @option{peerlatency}
|
||||
@@ -1398,7 +1229,7 @@ when side is sender and @option{rcvlatency}
|
||||
when side is receiver, and the bidirectional stream
|
||||
sending is not supported.
|
||||
|
||||
@item listen_timeout=@var{microseconds}
|
||||
@item listen_timeout
|
||||
Set socket listen timeout.
|
||||
|
||||
@item maxbw=@var{bytes/seconds}
|
||||
@@ -1443,26 +1274,6 @@ only if @option{pbkeylen} is non-zero. It is used on
|
||||
the receiver only if the received data is encrypted.
|
||||
The configured passphrase cannot be recovered (write-only).
|
||||
|
||||
@item enforced_encryption=@var{1|0}
|
||||
If true, both connection parties must have the same password
|
||||
set (including empty, that is, with no encryption). If the
|
||||
password doesn't match or only one side is unencrypted,
|
||||
the connection is rejected. Default is true.
|
||||
|
||||
@item kmrefreshrate=@var{packets}
|
||||
The number of packets to be transmitted after which the
|
||||
encryption key is switched to a new key. Default is -1.
|
||||
-1 means auto (0x1000000 in srt library). The range for
|
||||
this option is integers in the 0 - @code{INT_MAX}.
|
||||
|
||||
@item kmpreannounce=@var{packets}
|
||||
The interval between when a new encryption key is sent and
|
||||
when switchover occurs. This value also applies to the
|
||||
subsequent interval between when switchover occurs and
|
||||
when the old encryption key is decommissioned. Default is -1.
|
||||
-1 means auto (0x1000 in srt library). The range for
|
||||
this option is integers in the 0 - @code{INT_MAX}.
|
||||
|
||||
@item payload_size=@var{bytes}
|
||||
Sets the maximum declared size of a packet transferred
|
||||
during the single call to the sending function in Live
|
||||
@@ -1478,7 +1289,7 @@ use a bigger maximum frame size, though not greater than
|
||||
@item pkt_size=@var{bytes}
|
||||
Alias for @samp{payload_size}.
|
||||
|
||||
@item peerlatency=@var{microseconds}
|
||||
@item peerlatency
|
||||
The latency value (as described in @option{rcvlatency}) that is
|
||||
set by the sender side as a minimum value for the receiver.
|
||||
|
||||
@@ -1490,7 +1301,7 @@ Not required on receiver (set to 0),
|
||||
key size obtained from sender in HaiCrypt handshake.
|
||||
Default value is 0.
|
||||
|
||||
@item rcvlatency=@var{microseconds}
|
||||
@item rcvlatency
|
||||
The time that should elapse since the moment when the
|
||||
packet was sent and the moment when it's delivered to
|
||||
the receiver application in the receiving function.
|
||||
@@ -1508,10 +1319,12 @@ Set UDP receive buffer size, expressed in bytes.
|
||||
@item send_buffer_size=@var{bytes}
|
||||
Set UDP send buffer size, expressed in bytes.
|
||||
|
||||
@item timeout=@var{microseconds}
|
||||
Set raise error timeouts for read, write and connect operations. Note that the
|
||||
SRT library has internal timeouts which can be controlled separately, the
|
||||
value set here is only a cap on those.
|
||||
@item rw_timeout
|
||||
Set raise error timeout for read/write optations.
|
||||
|
||||
This option is only relevant in read mode:
|
||||
if no data arrived in more than this time
|
||||
interval, raise error.
|
||||
|
||||
@item tlpktdrop=@var{1|0}
|
||||
Too-late Packet Drop. When enabled on receiver, it skips
|
||||
@@ -1605,12 +1418,6 @@ the overhead transmission (retransmitted and control packets).
|
||||
file: Set options as for non-live transmission. See @option{messageapi}
|
||||
for further explanations
|
||||
|
||||
@item linger=@var{seconds}
|
||||
The number of seconds that the socket waits for unsent data when closing.
|
||||
Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
|
||||
seconds in file mode). The range for this option is integers in the
|
||||
0 - @code{INT_MAX}.
|
||||
|
||||
@end table
|
||||
|
||||
For more information see: @url{https://github.com/Haivision/srt}.
|
||||
@@ -1697,9 +1504,8 @@ tcp://@var{hostname}:@var{port}[?@var{options}]
|
||||
The list of supported options follows.
|
||||
|
||||
@table @option
|
||||
@item listen=@var{2|1|0}
|
||||
Listen for an incoming connection. 0 disables listen, 1 enables listen in
|
||||
single client mode, 2 enables listen in multi-client mode. Default value is 0.
|
||||
@item listen=@var{1|0}
|
||||
Listen for an incoming connection. Default value is 0.
|
||||
|
||||
@item timeout=@var{microseconds}
|
||||
Set raise error timeout, expressed in microseconds.
|
||||
@@ -1775,10 +1581,6 @@ A file containing the private key for the certificate.
|
||||
If enabled, listen for connections on the provided port, and assume
|
||||
the server role in the handshake instead of the client role.
|
||||
|
||||
@item http_proxy
|
||||
The HTTP proxy to tunnel through, e.g. @code{http://example.com:1234}.
|
||||
The proxy must support the CONNECT method.
|
||||
|
||||
@end table
|
||||
|
||||
Example command lines:
|
||||
@@ -1817,7 +1619,7 @@ The list of supported options follows.
|
||||
@item buffer_size=@var{size}
|
||||
Set the UDP maximum socket buffer size in bytes. This is used to set either
|
||||
the receive or send buffer size, depending on what the socket is used for.
|
||||
Default is 32 KB for output, 384 KB for input. See also @var{fifo_size}.
|
||||
Default is 64KB. See also @var{fifo_size}.
|
||||
|
||||
@item bitrate=@var{bitrate}
|
||||
If set to nonzero, the output will have the specified constant bitrate if the
|
||||
@@ -1926,51 +1728,4 @@ Timeout in ms.
|
||||
Create the Unix socket in listening mode.
|
||||
@end table
|
||||
|
||||
@section zmq
|
||||
|
||||
ZeroMQ asynchronous messaging using the libzmq library.
|
||||
|
||||
This library supports unicast streaming to multiple clients without relying on
|
||||
an external server.
|
||||
|
||||
The required syntax for streaming or connecting to a stream is:
|
||||
@example
|
||||
zmq:tcp://ip-address:port
|
||||
@end example
|
||||
|
||||
Example:
|
||||
Create a localhost stream on port 5555:
|
||||
@example
|
||||
ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
|
||||
@end example
|
||||
|
||||
Multiple clients may connect to the stream using:
|
||||
@example
|
||||
ffplay zmq:tcp://127.0.0.1:5555
|
||||
@end example
|
||||
|
||||
Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
|
||||
The server side binds to a port and publishes data. Clients connect to the
|
||||
server (via IP address/port) and subscribe to the stream. The order in which
|
||||
the server and client start generally does not matter.
|
||||
|
||||
ffmpeg must be compiled with the --enable-libzmq option to support
|
||||
this protocol.
|
||||
|
||||
Options can be set on the @command{ffmpeg}/@command{ffplay} command
|
||||
line. The following options are supported:
|
||||
|
||||
@table @option
|
||||
|
||||
@item pkt_size
|
||||
Forces the maximum packet size for sending/receiving data. The default value is
|
||||
131,072 bytes. On the server side, this sets the maximum size of sent packets
|
||||
via ZeroMQ. On the clients, it sets an internal buffer size for receiving
|
||||
packets. Note that pkt_size on the clients should be equal to or greater than
|
||||
pkt_size on the server. Otherwise the received message may be truncated causing
|
||||
decoding errors.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@c man end PROTOCOLS
|
||||
|
||||
@@ -172,9 +172,6 @@ INF: while(<$inf>) {
|
||||
} elsif ($ended =~ /^(?:itemize|enumerate|(?:multi|[fv])?table)$/) {
|
||||
$_ = "\n=back\n";
|
||||
$ic = pop @icstack;
|
||||
} elsif ($ended =~ /^float$/) {
|
||||
$_ = "\n=back\n";
|
||||
$ic = pop @icstack;
|
||||
} else {
|
||||
die "unknown command \@end $ended at line $.\n";
|
||||
}
|
||||
@@ -300,12 +297,6 @@ INF: while(<$inf>) {
|
||||
$_ = ""; # need a paragraph break
|
||||
};
|
||||
|
||||
/^\@(float)\s+\w+/ and do {
|
||||
push @endwstack, $endw;
|
||||
$endw = $1;
|
||||
$_ = "\n=over 4\n";
|
||||
};
|
||||
|
||||
/^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
|
||||
my $columns = $1;
|
||||
$columns =~ s/\@tab/ : /;
|
||||
|
||||
@@ -110,13 +110,11 @@ maximum of 2 digits. The @var{m} at the end expresses decimal value for
|
||||
@emph{or}
|
||||
|
||||
@example
|
||||
[-]@var{S}+[.@var{m}...][s|ms|us]
|
||||
[-]@var{S}+[.@var{m}...]
|
||||
@end example
|
||||
|
||||
@var{S} expresses the number of seconds, with the optional decimal part
|
||||
@var{m}. The optional literal suffixes @samp{s}, @samp{ms} or @samp{us}
|
||||
indicate to interpret the value as seconds, milliseconds or microseconds,
|
||||
respectively.
|
||||
@var{m}.
|
||||
|
||||
In both expressions, the optional @samp{-} indicates negative duration.
|
||||
|
||||
@@ -128,15 +126,6 @@ The following examples are all valid time duration:
|
||||
@item 55
|
||||
55 seconds
|
||||
|
||||
@item 0.2
|
||||
0.2 seconds
|
||||
|
||||
@item 200ms
|
||||
200 milliseconds, that's 0.2s
|
||||
|
||||
@item 200000us
|
||||
200000 microseconds, that's 0.2s
|
||||
|
||||
@item 12:03:45
|
||||
12 hours, 03 minutes and 45 seconds
|
||||
|
||||
@@ -715,8 +704,6 @@ FL+FR+FC+LFE+BL+BR+FLC+FRC
|
||||
FL+FR+FC+LFE+FLC+FRC+SL+SR
|
||||
@item octagonal
|
||||
FL+FR+FC+BL+BR+BC+SL+SR
|
||||
@item hexadecagonal
|
||||
FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
|
||||
@item downmix
|
||||
DL+DR
|
||||
@end table
|
||||
@@ -933,9 +920,6 @@ corresponding input value will be returned.
|
||||
@item round(expr)
|
||||
Round the value of expression @var{expr} to the nearest integer. For example, "round(1.5)" is "2.0".
|
||||
|
||||
@item sgn(x)
|
||||
Compute sign of @var{x}.
|
||||
|
||||
@item sin(x)
|
||||
Compute sine of @var{x}.
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
|
||||
|
||||
define COMPILE
|
||||
$(call $(1)DEP,$(1))
|
||||
$($(1)) $($(1)FLAGS) $($(2)) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
|
||||
$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
|
||||
endef
|
||||
|
||||
COMPILE_C = $(call COMPILE,CC)
|
||||
@@ -54,14 +54,6 @@ COMPILE_M = $(call COMPILE,OBJCC)
|
||||
COMPILE_X86ASM = $(call COMPILE,X86ASM)
|
||||
COMPILE_HOSTC = $(call COMPILE,HOSTCC)
|
||||
COMPILE_NVCC = $(call COMPILE,NVCC)
|
||||
COMPILE_MMI = $(call COMPILE,CC,MMIFLAGS)
|
||||
COMPILE_MSA = $(call COMPILE,CC,MSAFLAGS)
|
||||
|
||||
%_mmi.o: %_mmi.c
|
||||
$(COMPILE_MMI)
|
||||
|
||||
%_msa.o: %_msa.c
|
||||
$(COMPILE_MSA)
|
||||
|
||||
%.o: %.c
|
||||
$(COMPILE_C)
|
||||
@@ -107,7 +99,7 @@ COMPILE_MSA = $(call COMPILE,CC,MSAFLAGS)
|
||||
%.c %.h %.pc %.ver %.version: TAG = GEN
|
||||
|
||||
# Dummy rule to stop make trying to rebuild removed or renamed headers
|
||||
%.h %_template.c:
|
||||
%.h:
|
||||
@:
|
||||
|
||||
# Disable suffix rules. Most of the builtin rules are suffix rules,
|
||||
@@ -170,7 +162,7 @@ $(TOOLOBJS): | tools
|
||||
|
||||
OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
|
||||
|
||||
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.pc *.ptx *.ptx.c *.ver *.version *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
|
||||
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.pc *.ptx *.ptx.c *.ver *.version *$(DEFAULT_X86ASMD).asm *~
|
||||
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
|
||||
|
||||
define RULES
|
||||
|
||||
@@ -10,6 +10,7 @@ ALLAVPROGS = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
|
||||
ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
|
||||
|
||||
OBJS-ffmpeg += fftools/ffmpeg_opt.o fftools/ffmpeg_filter.o fftools/ffmpeg_hw.o
|
||||
OBJS-ffmpeg-$(CONFIG_CUVID) += fftools/ffmpeg_cuvid.o
|
||||
OBJS-ffmpeg-$(CONFIG_LIBMFX) += fftools/ffmpeg_qsv.o
|
||||
ifndef CONFIG_VIDEOTOOLBOX
|
||||
OBJS-ffmpeg-$(CONFIG_VDA) += fftools/ffmpeg_videotoolbox.o
|
||||
|
||||
@@ -55,6 +55,9 @@
|
||||
#include "libavutil/ffversion.h"
|
||||
#include "libavutil/version.h"
|
||||
#include "cmdutils.h"
|
||||
#if CONFIG_NETWORK
|
||||
#include "libavformat/network.h"
|
||||
#endif
|
||||
#if HAVE_SYS_RESOURCE_H
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
@@ -116,7 +119,7 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
|
||||
|
||||
void init_dynload(void)
|
||||
{
|
||||
#if HAVE_SETDLLDIRECTORY && defined(_WIN32)
|
||||
#ifdef _WIN32
|
||||
/* Calling SetDllDirectory with the empty string (but not NULL) removes the
|
||||
* current working directory from the DLL search path as a security pre-caution. */
|
||||
SetDllDirectory("");
|
||||
@@ -179,7 +182,7 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
||||
|
||||
first = 1;
|
||||
for (po = options; po->name; po++) {
|
||||
char buf[128];
|
||||
char buf[64];
|
||||
|
||||
if (((po->flags & req_flags) != req_flags) ||
|
||||
(alt_flags && !(po->flags & alt_flags)) ||
|
||||
@@ -202,22 +205,23 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
||||
|
||||
void show_help_children(const AVClass *class, int flags)
|
||||
{
|
||||
void *iter = NULL;
|
||||
const AVClass *child;
|
||||
const AVClass *child = NULL;
|
||||
if (class->option) {
|
||||
av_opt_show2(&class, NULL, flags, 0);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
while (child = av_opt_child_class_iterate(class, &iter))
|
||||
while (child = av_opt_child_class_next(class, child))
|
||||
show_help_children(child, flags);
|
||||
}
|
||||
|
||||
static const OptionDef *find_option(const OptionDef *po, const char *name)
|
||||
{
|
||||
const char *p = strchr(name, ':');
|
||||
int len = p ? p - name : strlen(name);
|
||||
|
||||
while (po->name) {
|
||||
const char *end;
|
||||
if (av_strstart(name, po->name, &end) && (!*end || *end == ':'))
|
||||
if (!strncmp(name, po->name, len) && strlen(po->name) == len)
|
||||
break;
|
||||
po++;
|
||||
}
|
||||
@@ -844,8 +848,8 @@ do { \
|
||||
}
|
||||
|
||||
if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts)
|
||||
av_log(NULL, AV_LOG_WARNING, "Trailing option(s) found in the "
|
||||
"command: may be ignored.\n");
|
||||
av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the "
|
||||
"commandline.\n");
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Finished splitting the commandline.\n");
|
||||
|
||||
@@ -976,7 +980,6 @@ static int init_report(const char *env)
|
||||
char *filename_template = NULL;
|
||||
char *key, *val;
|
||||
int ret, count = 0;
|
||||
int prog_loglevel, envlevel = 0;
|
||||
time_t now;
|
||||
struct tm *tm;
|
||||
AVBPrint filename;
|
||||
@@ -1008,7 +1011,6 @@ static int init_report(const char *env)
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid report file level\n");
|
||||
exit_program(1);
|
||||
}
|
||||
envlevel = 1;
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_ERROR, "Unknown key '%s' in FFREPORT\n", key);
|
||||
}
|
||||
@@ -1025,10 +1027,6 @@ static int init_report(const char *env)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
prog_loglevel = av_log_get_level();
|
||||
if (!envlevel)
|
||||
report_file_level = FFMAX(report_file_level, prog_loglevel);
|
||||
|
||||
report_file = fopen(filename.str, "w");
|
||||
if (!report_file) {
|
||||
int ret = AVERROR(errno);
|
||||
@@ -1039,17 +1037,16 @@ static int init_report(const char *env)
|
||||
av_log_set_callback(log_callback_report);
|
||||
av_log(NULL, AV_LOG_INFO,
|
||||
"%s started on %04d-%02d-%02d at %02d:%02d:%02d\n"
|
||||
"Report written to \"%s\"\n"
|
||||
"Log level: %d\n",
|
||||
"Report written to \"%s\"\n",
|
||||
program_name,
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec,
|
||||
filename.str, report_file_level);
|
||||
filename.str);
|
||||
av_bprint_finalize(&filename, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_report(void *optctx, const char *opt, const char *arg)
|
||||
int opt_report(const char *opt)
|
||||
{
|
||||
return init_report(NULL);
|
||||
}
|
||||
@@ -1163,13 +1160,13 @@ static void print_buildconf(int flags, int level)
|
||||
// Change all the ' --' strings to '~--' so that
|
||||
// they can be identified as tokens.
|
||||
while ((conflist = strstr(str, " --")) != NULL) {
|
||||
conflist[0] = '~';
|
||||
strncpy(conflist, "~--", 3);
|
||||
}
|
||||
|
||||
// Compensate for the weirdness this would cause
|
||||
// when passing 'pkg-config --static'.
|
||||
while ((remove_tilde = strstr(str, "pkg-config~")) != NULL) {
|
||||
remove_tilde[sizeof("pkg-config~") - 2] = ' ';
|
||||
strncpy(remove_tilde, "pkg-config ", 11);
|
||||
}
|
||||
|
||||
splitconf = strtok(str, "~");
|
||||
@@ -1415,10 +1412,14 @@ static void print_codec(const AVCodec *c)
|
||||
printf("variable ");
|
||||
if (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS |
|
||||
AV_CODEC_CAP_OTHER_THREADS))
|
||||
AV_CODEC_CAP_AUTO_THREADS))
|
||||
printf("threads ");
|
||||
if (c->capabilities & AV_CODEC_CAP_AVOID_PROBING)
|
||||
printf("avoidprobe ");
|
||||
if (c->capabilities & AV_CODEC_CAP_INTRA_ONLY)
|
||||
printf("intraonly ");
|
||||
if (c->capabilities & AV_CODEC_CAP_LOSSLESS)
|
||||
printf("lossless ");
|
||||
if (c->capabilities & AV_CODEC_CAP_HARDWARE)
|
||||
printf("hardware ");
|
||||
if (c->capabilities & AV_CODEC_CAP_HYBRID)
|
||||
@@ -1432,12 +1433,12 @@ static void print_codec(const AVCodec *c)
|
||||
printf(" Threading capabilities: ");
|
||||
switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS |
|
||||
AV_CODEC_CAP_OTHER_THREADS)) {
|
||||
AV_CODEC_CAP_AUTO_THREADS)) {
|
||||
case AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
|
||||
case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break;
|
||||
case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break;
|
||||
case AV_CODEC_CAP_OTHER_THREADS: printf("other"); break;
|
||||
case AV_CODEC_CAP_AUTO_THREADS : printf("auto"); break;
|
||||
default: printf("none"); break;
|
||||
}
|
||||
printf("\n");
|
||||
@@ -1492,14 +1493,13 @@ static char get_media_type_char(enum AVMediaType type)
|
||||
}
|
||||
}
|
||||
|
||||
static const AVCodec *next_codec_for_id(enum AVCodecID id, void **iter,
|
||||
static const AVCodec *next_codec_for_id(enum AVCodecID id, const AVCodec *prev,
|
||||
int encoder)
|
||||
{
|
||||
const AVCodec *c;
|
||||
while ((c = av_codec_iterate(iter))) {
|
||||
if (c->id == id &&
|
||||
(encoder ? av_codec_is_encoder(c) : av_codec_is_decoder(c)))
|
||||
return c;
|
||||
while ((prev = av_codec_next(prev))) {
|
||||
if (prev->id == id &&
|
||||
(encoder ? av_codec_is_encoder(prev) : av_codec_is_decoder(prev)))
|
||||
return prev;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1536,12 +1536,11 @@ static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs)
|
||||
|
||||
static void print_codecs_for_id(enum AVCodecID id, int encoder)
|
||||
{
|
||||
void *iter = NULL;
|
||||
const AVCodec *codec;
|
||||
const AVCodec *codec = NULL;
|
||||
|
||||
printf(" (%s: ", encoder ? "encoders" : "decoders");
|
||||
|
||||
while ((codec = next_codec_for_id(id, &iter, encoder)))
|
||||
while ((codec = next_codec_for_id(id, codec, encoder)))
|
||||
printf("%s ", codec->name);
|
||||
|
||||
printf(")");
|
||||
@@ -1564,8 +1563,7 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
|
||||
" -------\n");
|
||||
for (i = 0; i < nb_codecs; i++) {
|
||||
const AVCodecDescriptor *desc = codecs[i];
|
||||
const AVCodec *codec;
|
||||
void *iter = NULL;
|
||||
const AVCodec *codec = NULL;
|
||||
|
||||
if (strstr(desc->name, "_deprecated"))
|
||||
continue;
|
||||
@@ -1583,14 +1581,14 @@ int show_codecs(void *optctx, const char *opt, const char *arg)
|
||||
|
||||
/* print decoders/encoders when there's more than one or their
|
||||
* names are different from codec name */
|
||||
while ((codec = next_codec_for_id(desc->id, &iter, 0))) {
|
||||
while ((codec = next_codec_for_id(desc->id, codec, 0))) {
|
||||
if (strcmp(codec->name, desc->name)) {
|
||||
print_codecs_for_id(desc->id, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
iter = NULL;
|
||||
while ((codec = next_codec_for_id(desc->id, &iter, 1))) {
|
||||
codec = NULL;
|
||||
while ((codec = next_codec_for_id(desc->id, codec, 1))) {
|
||||
if (strcmp(codec->name, desc->name)) {
|
||||
print_codecs_for_id(desc->id, 1);
|
||||
break;
|
||||
@@ -1621,10 +1619,9 @@ static void print_codecs(int encoder)
|
||||
encoder ? "Encoders" : "Decoders");
|
||||
for (i = 0; i < nb_codecs; i++) {
|
||||
const AVCodecDescriptor *desc = codecs[i];
|
||||
const AVCodec *codec;
|
||||
void *iter = NULL;
|
||||
const AVCodec *codec = NULL;
|
||||
|
||||
while ((codec = next_codec_for_id(desc->id, &iter, encoder))) {
|
||||
while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
|
||||
printf(" %c", get_media_type_char(desc->type));
|
||||
printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : ".");
|
||||
@@ -1829,10 +1826,9 @@ static void show_help_codec(const char *name, int encoder)
|
||||
if (codec)
|
||||
print_codec(codec);
|
||||
else if ((desc = avcodec_descriptor_get_by_name(name))) {
|
||||
void *iter = NULL;
|
||||
int printed = 0;
|
||||
|
||||
while ((codec = next_codec_for_id(desc->id, &iter, encoder))) {
|
||||
while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
|
||||
printed = 1;
|
||||
print_codec(codec);
|
||||
}
|
||||
@@ -1867,24 +1863,6 @@ static void show_help_demuxer(const char *name)
|
||||
show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM);
|
||||
}
|
||||
|
||||
static void show_help_protocol(const char *name)
|
||||
{
|
||||
const AVClass *proto_class;
|
||||
|
||||
if (!name) {
|
||||
av_log(NULL, AV_LOG_ERROR, "No protocol name specified.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
proto_class = avio_protocol_get_class(name);
|
||||
if (!proto_class) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name);
|
||||
return;
|
||||
}
|
||||
|
||||
show_help_children(proto_class, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
|
||||
}
|
||||
|
||||
static void show_help_muxer(const char *name)
|
||||
{
|
||||
const AVCodecDescriptor *desc;
|
||||
@@ -2015,8 +1993,6 @@ int show_help(void *optctx, const char *opt, const char *arg)
|
||||
show_help_demuxer(par);
|
||||
} else if (!strcmp(topic, "muxer")) {
|
||||
show_help_muxer(par);
|
||||
} else if (!strcmp(topic, "protocol")) {
|
||||
show_help_protocol(par);
|
||||
#if CONFIG_AVFILTER
|
||||
} else if (!strcmp(topic, "filter")) {
|
||||
show_help_filter(par);
|
||||
@@ -2056,7 +2032,7 @@ FILE *get_preset_file(char *filename, size_t filename_size,
|
||||
av_strlcpy(filename, preset_name, filename_size);
|
||||
f = fopen(filename, "r");
|
||||
} else {
|
||||
#if HAVE_GETMODULEHANDLE && defined(_WIN32)
|
||||
#ifdef _WIN32
|
||||
char datadir[MAX_PATH], *ls;
|
||||
base[2] = NULL;
|
||||
|
||||
@@ -2101,7 +2077,7 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
|
||||
}
|
||||
|
||||
AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
|
||||
AVFormatContext *s, AVStream *st, const AVCodec *codec)
|
||||
AVFormatContext *s, AVStream *st, AVCodec *codec)
|
||||
{
|
||||
AVDictionary *ret = NULL;
|
||||
AVDictionaryEntry *t = NULL;
|
||||
@@ -2130,7 +2106,6 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
|
||||
}
|
||||
|
||||
while (t = av_dict_get(opts, "", t, AV_DICT_IGNORE_SUFFIX)) {
|
||||
const AVClass *priv_class;
|
||||
char *p = strchr(t->key, ':');
|
||||
|
||||
/* check stream specification in opt name */
|
||||
@@ -2143,8 +2118,8 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
|
||||
|
||||
if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) ||
|
||||
!codec ||
|
||||
((priv_class = codec->priv_class) &&
|
||||
av_opt_find(&priv_class, t->key, NULL, flags,
|
||||
(codec->priv_class &&
|
||||
av_opt_find(&codec->priv_class, t->key, NULL, flags,
|
||||
AV_OPT_SEARCH_FAKE_OBJ)))
|
||||
av_dict_set(&ret, t->key, t->value, 0);
|
||||
else if (t->key[0] == prefix &&
|
||||
@@ -2210,7 +2185,7 @@ double get_rotation(AVStream *st)
|
||||
if (fabs(theta - 90*round(theta/90)) > 2)
|
||||
av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n"
|
||||
"If you want to help, upload a sample "
|
||||
"of this file to https://streams.videolan.org/upload/ "
|
||||
"of this file to ftp://upload.ffmpeg.org/incoming/ "
|
||||
"and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)");
|
||||
|
||||
return theta;
|
||||
@@ -2307,7 +2282,7 @@ int show_sources(void *optctx, const char *opt, const char *arg)
|
||||
int ret = 0;
|
||||
int error_level = av_log_get_level();
|
||||
|
||||
av_log_set_level(AV_LOG_WARNING);
|
||||
av_log_set_level(AV_LOG_ERROR);
|
||||
|
||||
if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0)
|
||||
goto fail;
|
||||
@@ -2345,7 +2320,7 @@ int show_sinks(void *optctx, const char *opt, const char *arg)
|
||||
int ret = 0;
|
||||
int error_level = av_log_get_level();
|
||||
|
||||
av_log_set_level(AV_LOG_WARNING);
|
||||
av_log_set_level(AV_LOG_ERROR);
|
||||
|
||||
if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0)
|
||||
goto fail;
|
||||
|
||||
@@ -99,7 +99,7 @@ int opt_default(void *optctx, const char *opt, const char *arg);
|
||||
*/
|
||||
int opt_loglevel(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
int opt_report(void *optctx, const char *opt, const char *arg);
|
||||
int opt_report(const char *opt);
|
||||
|
||||
int opt_max_alloc(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
@@ -236,7 +236,7 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
||||
{ "colors", OPT_EXIT, { .func_arg = show_colors }, "show available color names" }, \
|
||||
{ "loglevel", HAS_ARG, { .func_arg = opt_loglevel }, "set logging level", "loglevel" }, \
|
||||
{ "v", HAS_ARG, { .func_arg = opt_loglevel }, "set logging level", "loglevel" }, \
|
||||
{ "report", 0, { .func_arg = opt_report }, "generate a report" }, \
|
||||
{ "report", 0, { (void*)opt_report }, "generate a report" }, \
|
||||
{ "max_alloc", HAS_ARG, { .func_arg = opt_max_alloc }, "set maximum size of a single allocated block", "bytes" }, \
|
||||
{ "cpuflags", HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" }, \
|
||||
{ "hide_banner", OPT_BOOL | OPT_EXPERT, {&hide_banner}, "do not show program banner", "hide_banner" }, \
|
||||
@@ -414,7 +414,7 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
|
||||
* @return a pointer to the created dictionary
|
||||
*/
|
||||
AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
|
||||
AVFormatContext *s, AVStream *st, const AVCodec *codec);
|
||||
AVFormatContext *s, AVStream *st, AVCodec *codec);
|
||||
|
||||
/**
|
||||
* Setup AVCodecContext options for avformat_find_stream_info().
|
||||
|
||||
877
fftools/ffmpeg.c
877
fftools/ffmpeg.c
File diff suppressed because it is too large
Load Diff
@@ -61,6 +61,7 @@ enum HWAccelID {
|
||||
HWACCEL_GENERIC,
|
||||
HWACCEL_VIDEOTOOLBOX,
|
||||
HWACCEL_QSV,
|
||||
HWACCEL_CUVID,
|
||||
};
|
||||
|
||||
typedef struct HWAccel {
|
||||
@@ -108,8 +109,6 @@ typedef struct OptionsContext {
|
||||
int nb_audio_sample_rate;
|
||||
SpecifierOpt *frame_rates;
|
||||
int nb_frame_rates;
|
||||
SpecifierOpt *max_frame_rates;
|
||||
int nb_max_frame_rates;
|
||||
SpecifierOpt *frame_sizes;
|
||||
int nb_frame_sizes;
|
||||
SpecifierOpt *frame_pix_fmts;
|
||||
@@ -217,8 +216,6 @@ typedef struct OptionsContext {
|
||||
int nb_passlogfiles;
|
||||
SpecifierOpt *max_muxing_queue_size;
|
||||
int nb_max_muxing_queue_size;
|
||||
SpecifierOpt *muxing_queue_data_threshold;
|
||||
int nb_muxing_queue_data_threshold;
|
||||
SpecifierOpt *guess_layout_max;
|
||||
int nb_guess_layout_max;
|
||||
SpecifierOpt *apad;
|
||||
@@ -233,8 +230,6 @@ typedef struct OptionsContext {
|
||||
int nb_time_bases;
|
||||
SpecifierOpt *enc_time_bases;
|
||||
int nb_enc_time_bases;
|
||||
SpecifierOpt *autoscale;
|
||||
int nb_autoscale;
|
||||
} OptionsContext;
|
||||
|
||||
typedef struct InputFilter {
|
||||
@@ -307,10 +302,9 @@ typedef struct InputStream {
|
||||
#define DECODING_FOR_FILTER 2
|
||||
|
||||
AVCodecContext *dec_ctx;
|
||||
const AVCodec *dec;
|
||||
AVCodec *dec;
|
||||
AVFrame *decoded_frame;
|
||||
AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */
|
||||
AVPacket *pkt;
|
||||
|
||||
int64_t start; /* time when read started */
|
||||
/* predicted dts of the next packet read for this stream or (when there are
|
||||
@@ -355,7 +349,6 @@ typedef struct InputStream {
|
||||
AVFifoBuffer *sub_queue; ///< queue of AVSubtitle* before filter init
|
||||
AVFrame *frame;
|
||||
int w, h;
|
||||
unsigned int initialize; ///< marks if sub2video_update should force an initialization
|
||||
} sub2video;
|
||||
|
||||
int dr1;
|
||||
@@ -419,8 +412,6 @@ typedef struct InputFile {
|
||||
int rate_emu;
|
||||
int accurate_seek;
|
||||
|
||||
AVPacket *pkt;
|
||||
|
||||
#if HAVE_THREADS
|
||||
AVThreadMessageQueue *in_thread_queue;
|
||||
pthread_t thread; /* thread reading from this file */
|
||||
@@ -439,8 +430,7 @@ enum forced_keyframes_const {
|
||||
FKF_NB
|
||||
};
|
||||
|
||||
#define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0)
|
||||
#define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM (1 << 1)
|
||||
#define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0)
|
||||
|
||||
extern const char *const forced_keyframes_const_names[];
|
||||
|
||||
@@ -469,15 +459,15 @@ typedef struct OutputStream {
|
||||
AVRational mux_timebase;
|
||||
AVRational enc_timebase;
|
||||
|
||||
AVBSFContext *bsf_ctx;
|
||||
int nb_bitstream_filters;
|
||||
AVBSFContext **bsf_ctx;
|
||||
|
||||
AVCodecContext *enc_ctx;
|
||||
AVCodecParameters *ref_par; /* associated input codec parameters with encoders options applied */
|
||||
const AVCodec *enc;
|
||||
AVCodec *enc;
|
||||
int64_t max_frames;
|
||||
AVFrame *filtered_frame;
|
||||
AVFrame *last_frame;
|
||||
AVPacket *pkt;
|
||||
int last_dropped;
|
||||
int last_nb0_frames[3];
|
||||
|
||||
@@ -485,12 +475,10 @@ typedef struct OutputStream {
|
||||
|
||||
/* video only */
|
||||
AVRational frame_rate;
|
||||
AVRational max_frame_rate;
|
||||
int is_cfr;
|
||||
int force_fps;
|
||||
int top_field_first;
|
||||
int rotate_overridden;
|
||||
int autoscale;
|
||||
double rotate_override_value;
|
||||
|
||||
AVRational frame_aspect_ratio;
|
||||
@@ -556,15 +544,6 @@ typedef struct OutputStream {
|
||||
/* the packets are buffered here until the muxer is ready to be initialized */
|
||||
AVFifoBuffer *muxing_queue;
|
||||
|
||||
/*
|
||||
* The size of the AVPackets' buffers in queue.
|
||||
* Updated when a packet is either pushed or pulled from the queue.
|
||||
*/
|
||||
size_t muxing_queue_data_size;
|
||||
|
||||
/* Threshold after which max_muxing_queue_size will be in effect */
|
||||
size_t muxing_queue_data_threshold;
|
||||
|
||||
/* packet picture type */
|
||||
int pict_type;
|
||||
|
||||
@@ -621,7 +600,6 @@ extern int debug_ts;
|
||||
extern int exit_on_error;
|
||||
extern int abort_on_flags;
|
||||
extern int print_stats;
|
||||
extern int64_t stats_period;
|
||||
extern int qp_hist;
|
||||
extern int stdin_interaction;
|
||||
extern int frame_bits_per_raw_sample;
|
||||
@@ -632,12 +610,12 @@ extern char *videotoolbox_pixfmt;
|
||||
extern int filter_nbthreads;
|
||||
extern int filter_complex_nbthreads;
|
||||
extern int vstats_version;
|
||||
extern int auto_conversion_filters;
|
||||
|
||||
extern const AVIOInterruptCB int_cb;
|
||||
|
||||
extern const OptionDef options[];
|
||||
extern const HWAccel hwaccels[];
|
||||
extern AVBufferRef *hw_device_ctx;
|
||||
#if CONFIG_QSV
|
||||
extern char *qsv_device;
|
||||
#endif
|
||||
@@ -647,20 +625,28 @@ extern HWDevice *filter_hw_device;
|
||||
void term_init(void);
|
||||
void term_exit(void);
|
||||
|
||||
void reset_options(OptionsContext *o, int is_input);
|
||||
void show_usage(void);
|
||||
|
||||
void opt_output_file(void *optctx, const char *filename);
|
||||
|
||||
void remove_avoptions(AVDictionary **a, AVDictionary *b);
|
||||
void assert_avoptions(AVDictionary *m);
|
||||
|
||||
int guess_input_channel_layout(InputStream *ist);
|
||||
|
||||
enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, AVCodec *codec, enum AVPixelFormat target);
|
||||
void choose_sample_fmt(AVStream *st, AVCodec *codec);
|
||||
|
||||
int configure_filtergraph(FilterGraph *fg);
|
||||
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out);
|
||||
void check_filter_outputs(void);
|
||||
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
|
||||
int filtergraph_is_simple(FilterGraph *fg);
|
||||
int init_simple_filtergraph(InputStream *ist, OutputStream *ost);
|
||||
int init_complex_filtergraph(FilterGraph *fg);
|
||||
|
||||
void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub);
|
||||
void sub2video_update(InputStream *ist, AVSubtitle *sub);
|
||||
|
||||
int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame);
|
||||
|
||||
@@ -668,6 +654,7 @@ int ffmpeg_parse_options(int argc, char **argv);
|
||||
|
||||
int videotoolbox_init(AVCodecContext *s);
|
||||
int qsv_init(AVCodecContext *s);
|
||||
int cuvid_init(AVCodecContext *s);
|
||||
|
||||
HWDevice *hw_device_get_by_name(const char *name);
|
||||
int hw_device_init_from_string(const char *arg, HWDevice **dev);
|
||||
@@ -675,7 +662,6 @@ void hw_device_free_all(void);
|
||||
|
||||
int hw_device_setup_for_decode(InputStream *ist);
|
||||
int hw_device_setup_for_encode(OutputStream *ost);
|
||||
int hw_device_setup_for_filter(FilterGraph *fg);
|
||||
|
||||
int hwaccel_decode_init(AVCodecContext *avctx);
|
||||
|
||||
|
||||
73
fftools/ffmpeg_cuvid.c
Normal file
73
fftools/ffmpeg_cuvid.c
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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 "libavutil/hwcontext.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
|
||||
#include "ffmpeg.h"
|
||||
|
||||
static void cuvid_uninit(AVCodecContext *avctx)
|
||||
{
|
||||
InputStream *ist = avctx->opaque;
|
||||
av_buffer_unref(&ist->hw_frames_ctx);
|
||||
}
|
||||
|
||||
int cuvid_init(AVCodecContext *avctx)
|
||||
{
|
||||
InputStream *ist = avctx->opaque;
|
||||
AVHWFramesContext *frames_ctx;
|
||||
int ret;
|
||||
|
||||
av_log(avctx, AV_LOG_VERBOSE, "Initializing cuvid hwaccel\n");
|
||||
|
||||
if (!hw_device_ctx) {
|
||||
ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_CUDA,
|
||||
ist->hwaccel_device, NULL, 0);
|
||||
if (ret < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error creating a CUDA device\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
av_buffer_unref(&ist->hw_frames_ctx);
|
||||
ist->hw_frames_ctx = av_hwframe_ctx_alloc(hw_device_ctx);
|
||||
if (!ist->hw_frames_ctx) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error creating a CUDA frames context\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
frames_ctx = (AVHWFramesContext*)ist->hw_frames_ctx->data;
|
||||
|
||||
frames_ctx->format = AV_PIX_FMT_CUDA;
|
||||
frames_ctx->sw_format = avctx->sw_pix_fmt;
|
||||
frames_ctx->width = avctx->width;
|
||||
frames_ctx->height = avctx->height;
|
||||
|
||||
av_log(avctx, AV_LOG_DEBUG, "Initializing CUDA frames context: sw_format = %s, width = %d, height = %d\n",
|
||||
av_get_pix_fmt_name(frames_ctx->sw_format), frames_ctx->width, frames_ctx->height);
|
||||
|
||||
ret = av_hwframe_ctx_init(ist->hw_frames_ctx);
|
||||
if (ret < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error initializing a CUDA frame pool\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ist->hwaccel_uninit = cuvid_uninit;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -60,8 +60,7 @@ static const enum AVPixelFormat *get_compliance_unofficial_pix_fmts(enum AVCodec
|
||||
}
|
||||
}
|
||||
|
||||
static enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx,
|
||||
const AVCodec *codec, enum AVPixelFormat target)
|
||||
enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, AVCodec *codec, enum AVPixelFormat target)
|
||||
{
|
||||
if (codec && codec->pix_fmts) {
|
||||
const enum AVPixelFormat *p = codec->pix_fmts;
|
||||
@@ -74,7 +73,7 @@ static enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx
|
||||
p = get_compliance_unofficial_pix_fmts(enc_ctx->codec_id, p);
|
||||
}
|
||||
for (; *p != AV_PIX_FMT_NONE; p++) {
|
||||
best = av_find_best_pix_fmt_of_2(best, *p, target, has_alpha, NULL);
|
||||
best= avcodec_find_best_pix_fmt_of_2(best, *p, target, has_alpha, NULL);
|
||||
if (*p == target)
|
||||
break;
|
||||
}
|
||||
@@ -91,6 +90,28 @@ static enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx
|
||||
return target;
|
||||
}
|
||||
|
||||
void choose_sample_fmt(AVStream *st, AVCodec *codec)
|
||||
{
|
||||
if (codec && codec->sample_fmts) {
|
||||
const enum AVSampleFormat *p = codec->sample_fmts;
|
||||
for (; *p != -1; p++) {
|
||||
if (*p == st->codecpar->format)
|
||||
break;
|
||||
}
|
||||
if (*p == -1) {
|
||||
if((codec->capabilities & AV_CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codecpar->format) > av_get_sample_fmt_name(codec->sample_fmts[0]))
|
||||
av_log(NULL, AV_LOG_ERROR, "Conversion will not be lossless.\n");
|
||||
if(av_get_sample_fmt_name(st->codecpar->format))
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"Incompatible sample format '%s' for codec '%s', auto-selecting format '%s'\n",
|
||||
av_get_sample_fmt_name(st->codecpar->format),
|
||||
codec->name,
|
||||
av_get_sample_fmt_name(codec->sample_fmts[0]));
|
||||
st->codecpar->format = codec->sample_fmts[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static char *choose_pix_fmts(OutputFilter *ofilter)
|
||||
{
|
||||
OutputStream *ost = ofilter->ost;
|
||||
@@ -448,7 +469,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if ((ofilter->width || ofilter->height) && ofilter->ost->autoscale) {
|
||||
if (ofilter->width || ofilter->height) {
|
||||
char args[255];
|
||||
AVFilterContext *filter;
|
||||
AVDictionaryEntry *e = NULL;
|
||||
@@ -618,6 +639,13 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
pad_idx = 0;
|
||||
}
|
||||
|
||||
if (audio_volume != 256 && 0) {
|
||||
char args[256];
|
||||
|
||||
snprintf(args, sizeof(args), "%f", audio_volume / 256.);
|
||||
AUTO_INSERT_FILTER("-vol", "volume", args);
|
||||
}
|
||||
|
||||
if (ost->apad && of->shortest) {
|
||||
char args[256];
|
||||
int i;
|
||||
@@ -645,8 +673,7 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
AVFilterInOut *out)
|
||||
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
|
||||
{
|
||||
if (!ofilter->ost) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Filter %s has an unconnected output\n", ofilter->name);
|
||||
@@ -713,12 +740,6 @@ static int sub2video_prepare(InputStream *ist, InputFilter *ifilter)
|
||||
return AVERROR(ENOMEM);
|
||||
ist->sub2video.last_pts = INT64_MIN;
|
||||
ist->sub2video.end_pts = INT64_MIN;
|
||||
|
||||
/* sub2video structure has been (re-)initialized.
|
||||
Mark it as such so that the system will be
|
||||
initialized with the first received heartbeat. */
|
||||
ist->sub2video.initialize = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -765,9 +786,10 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
|
||||
av_bprintf(&args,
|
||||
"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:"
|
||||
"pixel_aspect=%d/%d",
|
||||
"pixel_aspect=%d/%d:sws_param=flags=%d",
|
||||
ifilter->width, ifilter->height, ifilter->format,
|
||||
tb.num, tb.den, sar.num, sar.den);
|
||||
tb.num, tb.den, sar.num, sar.den,
|
||||
SWS_BILINEAR + ((ist->dec_ctx->flags&AV_CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0));
|
||||
if (fr.num && fr.den)
|
||||
av_bprintf(&args, ":frame_rate=%d/%d", fr.num, fr.den);
|
||||
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
|
||||
@@ -1034,9 +1056,17 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)
|
||||
goto fail;
|
||||
|
||||
ret = hw_device_setup_for_filter(fg);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
if (filter_hw_device || hw_device_ctx) {
|
||||
AVBufferRef *device = filter_hw_device ? filter_hw_device->device_ref
|
||||
: hw_device_ctx;
|
||||
for (i = 0; i < fg->graph->nb_filters; i++) {
|
||||
fg->graph->filters[i]->hw_device_ctx = av_buffer_ref(device);
|
||||
if (!fg->graph->filters[i]->hw_device_ctx) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
|
||||
const char *num_inputs;
|
||||
@@ -1076,8 +1106,6 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
configure_output_filter(fg, fg->outputs[i], cur);
|
||||
avfilter_inout_free(&outputs);
|
||||
|
||||
if (!auto_conversion_filters)
|
||||
avfilter_graph_set_auto_convert(fg->graph, AVFILTER_AUTO_CONVERT_NONE);
|
||||
if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
|
||||
goto fail;
|
||||
|
||||
@@ -1141,7 +1169,7 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
while (av_fifo_size(ist->sub2video.sub_queue)) {
|
||||
AVSubtitle tmp;
|
||||
av_fifo_generic_read(ist->sub2video.sub_queue, &tmp, sizeof(tmp), NULL);
|
||||
sub2video_update(ist, INT64_MIN, &tmp);
|
||||
sub2video_update(ist, &tmp);
|
||||
avsubtitle_free(&tmp);
|
||||
}
|
||||
}
|
||||
@@ -1177,6 +1205,15 @@ int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < fg->nb_inputs; i++)
|
||||
if (fg->inputs[i]->ist == ist)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int filtergraph_is_simple(FilterGraph *fg)
|
||||
{
|
||||
return !fg->graph_desc;
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavfilter/buffersink.h"
|
||||
|
||||
#include "ffmpeg.h"
|
||||
|
||||
@@ -418,57 +416,18 @@ int hw_device_setup_for_decode(InputStream *ist)
|
||||
|
||||
int hw_device_setup_for_encode(OutputStream *ost)
|
||||
{
|
||||
const AVCodecHWConfig *config;
|
||||
HWDevice *dev = NULL;
|
||||
AVBufferRef *frames_ref = NULL;
|
||||
int i;
|
||||
|
||||
if (ost->filter) {
|
||||
frames_ref = av_buffersink_get_hw_frames_ctx(ost->filter->filter);
|
||||
if (frames_ref &&
|
||||
((AVHWFramesContext*)frames_ref->data)->format ==
|
||||
ost->enc_ctx->pix_fmt) {
|
||||
// Matching format, will try to use hw_frames_ctx.
|
||||
} else {
|
||||
frames_ref = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0;; i++) {
|
||||
config = avcodec_get_hw_config(ost->enc, i);
|
||||
if (!config)
|
||||
break;
|
||||
|
||||
if (frames_ref &&
|
||||
config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX &&
|
||||
(config->pix_fmt == AV_PIX_FMT_NONE ||
|
||||
config->pix_fmt == ost->enc_ctx->pix_fmt)) {
|
||||
av_log(ost->enc_ctx, AV_LOG_VERBOSE, "Using input "
|
||||
"frames context (format %s) with %s encoder.\n",
|
||||
av_get_pix_fmt_name(ost->enc_ctx->pix_fmt),
|
||||
ost->enc->name);
|
||||
ost->enc_ctx->hw_frames_ctx = av_buffer_ref(frames_ref);
|
||||
if (!ost->enc_ctx->hw_frames_ctx)
|
||||
return AVERROR(ENOMEM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!dev &&
|
||||
config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX)
|
||||
dev = hw_device_get_by_type(config->device_type);
|
||||
}
|
||||
HWDevice *dev;
|
||||
|
||||
dev = hw_device_match_by_codec(ost->enc);
|
||||
if (dev) {
|
||||
av_log(ost->enc_ctx, AV_LOG_VERBOSE, "Using device %s "
|
||||
"(type %s) with %s encoder.\n", dev->name,
|
||||
av_hwdevice_get_type_name(dev->type), ost->enc->name);
|
||||
ost->enc_ctx->hw_device_ctx = av_buffer_ref(dev->device_ref);
|
||||
if (!ost->enc_ctx->hw_device_ctx)
|
||||
return AVERROR(ENOMEM);
|
||||
return 0;
|
||||
} else {
|
||||
// No device required, or no device available.
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hwaccel_retrieve_data(AVCodecContext *avctx, AVFrame *input)
|
||||
@@ -521,31 +480,3 @@ int hwaccel_decode_init(AVCodecContext *avctx)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hw_device_setup_for_filter(FilterGraph *fg)
|
||||
{
|
||||
HWDevice *dev;
|
||||
int i;
|
||||
|
||||
// If the user has supplied exactly one hardware device then just
|
||||
// give it straight to every filter for convenience. If more than
|
||||
// one device is available then the user needs to pick one explcitly
|
||||
// with the filter_hw_device option.
|
||||
if (filter_hw_device)
|
||||
dev = filter_hw_device;
|
||||
else if (nb_hw_devices == 1)
|
||||
dev = hw_devices[0];
|
||||
else
|
||||
dev = NULL;
|
||||
|
||||
if (dev) {
|
||||
for (i = 0; i < fg->graph->nb_filters; i++) {
|
||||
fg->graph->filters[i]->hw_device_ctx =
|
||||
av_buffer_ref(dev->device_ref);
|
||||
if (!fg->graph->filters[i]->hw_device_ctx)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* ffmpeg option parsing
|
||||
*
|
||||
@@ -44,83 +43,16 @@
|
||||
|
||||
#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
|
||||
|
||||
#define SPECIFIER_OPT_FMT_str "%s"
|
||||
#define SPECIFIER_OPT_FMT_i "%i"
|
||||
#define SPECIFIER_OPT_FMT_i64 "%"PRId64
|
||||
#define SPECIFIER_OPT_FMT_ui64 "%"PRIu64
|
||||
#define SPECIFIER_OPT_FMT_f "%f"
|
||||
#define SPECIFIER_OPT_FMT_dbl "%lf"
|
||||
|
||||
static const char *const opt_name_codec_names[] = {"c", "codec", "acodec", "vcodec", "scodec", "dcodec", NULL};
|
||||
static const char *const opt_name_audio_channels[] = {"ac", NULL};
|
||||
static const char *const opt_name_audio_sample_rate[] = {"ar", NULL};
|
||||
static const char *const opt_name_frame_rates[] = {"r", NULL};
|
||||
static const char *const opt_name_max_frame_rates[] = {"fpsmax", NULL};
|
||||
static const char *const opt_name_frame_sizes[] = {"s", NULL};
|
||||
static const char *const opt_name_frame_pix_fmts[] = {"pix_fmt", NULL};
|
||||
static const char *const opt_name_ts_scale[] = {"itsscale", NULL};
|
||||
static const char *const opt_name_hwaccels[] = {"hwaccel", NULL};
|
||||
static const char *const opt_name_hwaccel_devices[] = {"hwaccel_device", NULL};
|
||||
static const char *const opt_name_hwaccel_output_formats[] = {"hwaccel_output_format", NULL};
|
||||
static const char *const opt_name_autorotate[] = {"autorotate", NULL};
|
||||
static const char *const opt_name_autoscale[] = {"autoscale", NULL};
|
||||
static const char *const opt_name_max_frames[] = {"frames", "aframes", "vframes", "dframes", NULL};
|
||||
static const char *const opt_name_bitstream_filters[] = {"bsf", "absf", "vbsf", NULL};
|
||||
static const char *const opt_name_codec_tags[] = {"tag", "atag", "vtag", "stag", NULL};
|
||||
static const char *const opt_name_sample_fmts[] = {"sample_fmt", NULL};
|
||||
static const char *const opt_name_qscale[] = {"q", "qscale", NULL};
|
||||
static const char *const opt_name_forced_key_frames[] = {"forced_key_frames", NULL};
|
||||
static const char *const opt_name_force_fps[] = {"force_fps", NULL};
|
||||
static const char *const opt_name_frame_aspect_ratios[] = {"aspect", NULL};
|
||||
static const char *const opt_name_rc_overrides[] = {"rc_override", NULL};
|
||||
static const char *const opt_name_intra_matrices[] = {"intra_matrix", NULL};
|
||||
static const char *const opt_name_inter_matrices[] = {"inter_matrix", NULL};
|
||||
static const char *const opt_name_chroma_intra_matrices[] = {"chroma_intra_matrix", NULL};
|
||||
static const char *const opt_name_top_field_first[] = {"top", NULL};
|
||||
static const char *const opt_name_presets[] = {"pre", "apre", "vpre", "spre", NULL};
|
||||
static const char *const opt_name_copy_initial_nonkeyframes[] = {"copyinkfr", NULL};
|
||||
static const char *const opt_name_copy_prior_start[] = {"copypriorss", NULL};
|
||||
static const char *const opt_name_filters[] = {"filter", "af", "vf", NULL};
|
||||
static const char *const opt_name_filter_scripts[] = {"filter_script", NULL};
|
||||
static const char *const opt_name_reinit_filters[] = {"reinit_filter", NULL};
|
||||
static const char *const opt_name_fix_sub_duration[] = {"fix_sub_duration", NULL};
|
||||
static const char *const opt_name_canvas_sizes[] = {"canvas_size", NULL};
|
||||
static const char *const opt_name_pass[] = {"pass", NULL};
|
||||
static const char *const opt_name_passlogfiles[] = {"passlogfile", NULL};
|
||||
static const char *const opt_name_max_muxing_queue_size[] = {"max_muxing_queue_size", NULL};
|
||||
static const char *const opt_name_muxing_queue_data_threshold[] = {"muxing_queue_data_threshold", NULL};
|
||||
static const char *const opt_name_guess_layout_max[] = {"guess_layout_max", NULL};
|
||||
static const char *const opt_name_apad[] = {"apad", NULL};
|
||||
static const char *const opt_name_discard[] = {"discard", NULL};
|
||||
static const char *const opt_name_disposition[] = {"disposition", NULL};
|
||||
static const char *const opt_name_time_bases[] = {"time_base", NULL};
|
||||
static const char *const opt_name_enc_time_bases[] = {"enc_time_base", NULL};
|
||||
|
||||
#define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\
|
||||
{\
|
||||
char namestr[128] = "";\
|
||||
const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\
|
||||
for (i = 0; opt_name_##name[i]; i++)\
|
||||
av_strlcatf(namestr, sizeof(namestr), "-%s%s", opt_name_##name[i], opt_name_##name[i+1] ? (opt_name_##name[i+2] ? ", " : " or ") : "");\
|
||||
av_log(NULL, AV_LOG_WARNING, "Multiple %s options specified for stream %d, only the last option '-%s%s%s "SPECIFIER_OPT_FMT_##type"' will be used.\n",\
|
||||
namestr, st->index, opt_name_##name[0], spec[0] ? ":" : "", spec, so->u.type);\
|
||||
}
|
||||
|
||||
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
|
||||
{\
|
||||
int i, ret, matches = 0;\
|
||||
SpecifierOpt *so;\
|
||||
int i, ret;\
|
||||
for (i = 0; i < o->nb_ ## name; i++) {\
|
||||
char *spec = o->name[i].specifier;\
|
||||
if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\
|
||||
if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0)\
|
||||
outvar = o->name[i].u.type;\
|
||||
so = &o->name[i];\
|
||||
matches++;\
|
||||
} else if (ret < 0)\
|
||||
else if (ret < 0)\
|
||||
exit_program(1);\
|
||||
}\
|
||||
if (matches > 1)\
|
||||
WARN_MULTIPLE_OPT_USAGE(name, type, so, st);\
|
||||
}
|
||||
|
||||
#define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\
|
||||
@@ -139,9 +71,13 @@ const HWAccel hwaccels[] = {
|
||||
#endif
|
||||
#if CONFIG_LIBMFX
|
||||
{ "qsv", qsv_init, HWACCEL_QSV, AV_PIX_FMT_QSV },
|
||||
#endif
|
||||
#if CONFIG_CUVID
|
||||
{ "cuvid", cuvid_init, HWACCEL_CUVID, AV_PIX_FMT_CUDA },
|
||||
#endif
|
||||
{ 0 },
|
||||
};
|
||||
AVBufferRef *hw_device_ctx;
|
||||
HWDevice *filter_hw_device;
|
||||
|
||||
char *vstats_filename;
|
||||
@@ -174,8 +110,6 @@ float max_error_rate = 2.0/3;
|
||||
int filter_nbthreads = 0;
|
||||
int filter_complex_nbthreads = 0;
|
||||
int vstats_version = 2;
|
||||
int auto_conversion_filters = 1;
|
||||
int64_t stats_period = 500000;
|
||||
|
||||
|
||||
static int intra_only = 0;
|
||||
@@ -232,17 +166,19 @@ static void init_options(OptionsContext *o)
|
||||
o->limit_filesize = UINT64_MAX;
|
||||
o->chapters_input_file = INT_MAX;
|
||||
o->accurate_seek = 1;
|
||||
o->thread_queue_size = -1;
|
||||
}
|
||||
|
||||
static int show_hwaccels(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
enum AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE;
|
||||
int i;
|
||||
|
||||
printf("Hardware acceleration methods:\n");
|
||||
while ((type = av_hwdevice_iterate_types(type)) !=
|
||||
AV_HWDEVICE_TYPE_NONE)
|
||||
printf("%s\n", av_hwdevice_get_type_name(type));
|
||||
for (i = 0; hwaccels[i].name; i++)
|
||||
printf("%s\n", hwaccels[i].name);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -268,9 +204,8 @@ static AVDictionary *strip_specifiers(AVDictionary *dict)
|
||||
static int opt_abort_on(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
static const AVOption opts[] = {
|
||||
{ "abort_on" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
|
||||
{ "empty_output" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = ABORT_ON_FLAG_EMPTY_OUTPUT }, .unit = "flags" },
|
||||
{ "empty_output_stream", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM }, .unit = "flags" },
|
||||
{ "abort_on" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
|
||||
{ "empty_output" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = ABORT_ON_FLAG_EMPTY_OUTPUT }, .unit = "flags" },
|
||||
{ NULL },
|
||||
};
|
||||
static const AVClass class = {
|
||||
@@ -284,21 +219,6 @@ static int opt_abort_on(void *optctx, const char *opt, const char *arg)
|
||||
return av_opt_eval_flags(&pclass, &opts[0], arg, &abort_on_flags);
|
||||
}
|
||||
|
||||
static int opt_stats_period(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
int64_t user_stats_period = parse_time_or_die(opt, arg, 1);
|
||||
|
||||
if (user_stats_period <= 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "stats_period %s must be positive.\n", arg);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
stats_period = user_stats_period;
|
||||
av_log(NULL, AV_LOG_INFO, "ffmpeg stats and -progress period set to %s.\n", arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opt_sameq(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
av_log(NULL, AV_LOG_ERROR, "Option '%s' was removed. "
|
||||
@@ -557,15 +477,21 @@ static int opt_sdp_file(void *optctx, const char *opt, const char *arg)
|
||||
#if CONFIG_VAAPI
|
||||
static int opt_vaapi_device(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
HWDevice *dev;
|
||||
const char *prefix = "vaapi:";
|
||||
char *tmp;
|
||||
int err;
|
||||
tmp = av_asprintf("%s%s", prefix, arg);
|
||||
if (!tmp)
|
||||
return AVERROR(ENOMEM);
|
||||
err = hw_device_init_from_string(tmp, NULL);
|
||||
err = hw_device_init_from_string(tmp, &dev);
|
||||
av_free(tmp);
|
||||
return err;
|
||||
if (err < 0)
|
||||
return err;
|
||||
hw_device_ctx = av_buffer_ref(dev->device_ref);
|
||||
if (!hw_device_ctx)
|
||||
return AVERROR(ENOMEM);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -766,13 +692,13 @@ static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int e
|
||||
return codec;
|
||||
}
|
||||
|
||||
static const AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
|
||||
static AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
|
||||
{
|
||||
char *codec_name = NULL;
|
||||
|
||||
MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, st);
|
||||
if (codec_name) {
|
||||
const AVCodec *codec = find_codec_or_die(codec_name, st->codecpar->codec_type, 0);
|
||||
AVCodec *codec = find_codec_or_die(codec_name, st->codecpar->codec_type, 0);
|
||||
st->codecpar->codec_id = codec->id;
|
||||
return codec;
|
||||
} else
|
||||
@@ -868,6 +794,15 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
if(!ist->dec)
|
||||
ist->dec = avcodec_find_decoder(par->codec_id);
|
||||
#if FF_API_LOWRES
|
||||
if (st->codec->lowres) {
|
||||
ist->dec_ctx->lowres = st->codec->lowres;
|
||||
ist->dec_ctx->width = st->codec->width;
|
||||
ist->dec_ctx->height = st->codec->height;
|
||||
ist->dec_ctx->coded_width = st->codec->coded_width;
|
||||
ist->dec_ctx->coded_height = st->codec->coded_height;
|
||||
}
|
||||
#endif
|
||||
|
||||
// avformat_find_stream_info() doesn't set this for us anymore.
|
||||
ist->dec_ctx->framerate = st->avg_frame_rate;
|
||||
@@ -884,28 +819,9 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
MATCH_PER_STREAM_OPT(top_field_first, i, ist->top_field_first, ic, st);
|
||||
|
||||
MATCH_PER_STREAM_OPT(hwaccels, str, hwaccel, ic, st);
|
||||
MATCH_PER_STREAM_OPT(hwaccel_output_formats, str,
|
||||
hwaccel_output_format, ic, st);
|
||||
|
||||
if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "cuvid")) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"WARNING: defaulting hwaccel_output_format to cuda for compatibility "
|
||||
"with old commandlines. This behaviour is DEPRECATED and will be removed "
|
||||
"in the future. Please explicitly set \"-hwaccel_output_format cuda\".\n");
|
||||
ist->hwaccel_output_format = AV_PIX_FMT_CUDA;
|
||||
} else if (hwaccel_output_format) {
|
||||
ist->hwaccel_output_format = av_get_pix_fmt(hwaccel_output_format);
|
||||
if (ist->hwaccel_output_format == AV_PIX_FMT_NONE) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Unrecognised hwaccel output "
|
||||
"format: %s", hwaccel_output_format);
|
||||
}
|
||||
} else {
|
||||
ist->hwaccel_output_format = AV_PIX_FMT_NONE;
|
||||
}
|
||||
|
||||
if (hwaccel) {
|
||||
// The NVDEC hwaccels use a CUDA device, so remap the name here.
|
||||
if (!strcmp(hwaccel, "nvdec") || !strcmp(hwaccel, "cuvid"))
|
||||
if (!strcmp(hwaccel, "nvdec"))
|
||||
hwaccel = "cuda";
|
||||
|
||||
if (!strcmp(hwaccel, "none"))
|
||||
@@ -939,6 +855,8 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
AV_HWDEVICE_TYPE_NONE)
|
||||
av_log(NULL, AV_LOG_FATAL, "%s ",
|
||||
av_hwdevice_get_type_name(type));
|
||||
for (i = 0; hwaccels[i].name; i++)
|
||||
av_log(NULL, AV_LOG_FATAL, "%s ", hwaccels[i].name);
|
||||
av_log(NULL, AV_LOG_FATAL, "\n");
|
||||
exit_program(1);
|
||||
}
|
||||
@@ -952,6 +870,18 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
MATCH_PER_STREAM_OPT(hwaccel_output_formats, str,
|
||||
hwaccel_output_format, ic, st);
|
||||
if (hwaccel_output_format) {
|
||||
ist->hwaccel_output_format = av_get_pix_fmt(hwaccel_output_format);
|
||||
if (ist->hwaccel_output_format == AV_PIX_FMT_NONE) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Unrecognised hwaccel output "
|
||||
"format: %s", hwaccel_output_format);
|
||||
}
|
||||
} else {
|
||||
ist->hwaccel_output_format = AV_PIX_FMT_NONE;
|
||||
}
|
||||
|
||||
ist->hwaccel_pix_fmt = AV_PIX_FMT_NONE;
|
||||
|
||||
break;
|
||||
@@ -1001,7 +931,7 @@ static void assert_file_overwrite(const char *filename)
|
||||
if (!file_overwrite) {
|
||||
if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) {
|
||||
if (stdin_interaction && !no_file_overwrite) {
|
||||
fprintf(stderr,"File '%s' already exists. Overwrite? [y/N] ", filename);
|
||||
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
|
||||
fflush(stderr);
|
||||
term_exit();
|
||||
signal(SIGINT, SIG_DFL);
|
||||
@@ -1280,11 +1210,8 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
f->loop = o->loop;
|
||||
f->duration = 0;
|
||||
f->time_base = (AVRational){ 1, 1 };
|
||||
f->pkt = av_packet_alloc();
|
||||
if (!f->pkt)
|
||||
exit_program(1);
|
||||
#if HAVE_THREADS
|
||||
f->thread_queue_size = o->thread_queue_size;
|
||||
f->thread_queue_size = o->thread_queue_size > 0 ? o->thread_queue_size : 8;
|
||||
#endif
|
||||
|
||||
/* check if all codec options have been used */
|
||||
@@ -1477,8 +1404,6 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
ost->encoder_opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc);
|
||||
|
||||
MATCH_PER_STREAM_OPT(presets, str, preset, oc, st);
|
||||
ost->autoscale = 1;
|
||||
MATCH_PER_STREAM_OPT(autoscale, i, ost->autoscale, oc, st);
|
||||
if (preset && (!(ret = get_preset_file_2(preset, ost->enc->name, &s)))) {
|
||||
do {
|
||||
buf = get_line(s);
|
||||
@@ -1546,12 +1471,54 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
MATCH_PER_STREAM_OPT(copy_prior_start, i, ost->copy_prior_start, oc ,st);
|
||||
|
||||
MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, oc, st);
|
||||
if (bsfs && *bsfs) {
|
||||
ret = av_bsf_list_parse_str(bsfs, &ost->bsf_ctx);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error parsing bitstream filter sequence '%s': %s\n", bsfs, av_err2str(ret));
|
||||
while (bsfs && *bsfs) {
|
||||
const AVBitStreamFilter *filter;
|
||||
char *bsf, *bsf_options_str, *bsf_name;
|
||||
|
||||
bsf = av_get_token(&bsfs, ",");
|
||||
if (!bsf)
|
||||
exit_program(1);
|
||||
bsf_name = av_strtok(bsf, "=", &bsf_options_str);
|
||||
if (!bsf_name)
|
||||
exit_program(1);
|
||||
|
||||
filter = av_bsf_get_by_name(bsf_name);
|
||||
if (!filter) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Unknown bitstream filter %s\n", bsf_name);
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
ost->bsf_ctx = av_realloc_array(ost->bsf_ctx,
|
||||
ost->nb_bitstream_filters + 1,
|
||||
sizeof(*ost->bsf_ctx));
|
||||
if (!ost->bsf_ctx)
|
||||
exit_program(1);
|
||||
|
||||
ret = av_bsf_alloc(filter, &ost->bsf_ctx[ost->nb_bitstream_filters]);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error allocating a bitstream filter context\n");
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
ost->nb_bitstream_filters++;
|
||||
|
||||
if (bsf_options_str && filter->priv_class) {
|
||||
const AVOption *opt = av_opt_next(ost->bsf_ctx[ost->nb_bitstream_filters-1]->priv_data, NULL);
|
||||
const char * shorthand[2] = {NULL};
|
||||
|
||||
if (opt)
|
||||
shorthand[0] = opt->name;
|
||||
|
||||
ret = av_opt_set_from_string(ost->bsf_ctx[ost->nb_bitstream_filters-1]->priv_data, bsf_options_str, shorthand, "=", ":");
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error parsing options for bitstream filter %s\n", bsf_name);
|
||||
exit_program(1);
|
||||
}
|
||||
}
|
||||
av_freep(&bsf);
|
||||
|
||||
if (*bsfs)
|
||||
bsfs++;
|
||||
}
|
||||
|
||||
MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, oc, st);
|
||||
@@ -1574,12 +1541,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
|
||||
ost->max_muxing_queue_size = 128;
|
||||
MATCH_PER_STREAM_OPT(max_muxing_queue_size, i, ost->max_muxing_queue_size, oc, st);
|
||||
ost->max_muxing_queue_size *= sizeof(ost->pkt);
|
||||
|
||||
ost->muxing_queue_data_size = 0;
|
||||
|
||||
ost->muxing_queue_data_threshold = 50*1024*1024;
|
||||
MATCH_PER_STREAM_OPT(muxing_queue_data_threshold, i, ost->muxing_queue_data_threshold, oc, st);
|
||||
ost->max_muxing_queue_size *= sizeof(AVPacket);
|
||||
|
||||
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
ost->enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
@@ -1692,7 +1654,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
AVStream *st;
|
||||
OutputStream *ost;
|
||||
AVCodecContext *video_enc;
|
||||
char *frame_rate = NULL, *max_frame_rate = NULL, *frame_aspect_ratio = NULL;
|
||||
char *frame_rate = NULL, *frame_aspect_ratio = NULL;
|
||||
|
||||
ost = new_output_stream(o, oc, AVMEDIA_TYPE_VIDEO, source_index);
|
||||
st = ost->st;
|
||||
@@ -1703,21 +1665,8 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid framerate value: %s\n", frame_rate);
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
MATCH_PER_STREAM_OPT(max_frame_rates, str, max_frame_rate, oc, st);
|
||||
if (max_frame_rate && av_parse_video_rate(&ost->max_frame_rate, max_frame_rate) < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid maximum framerate value: %s\n", max_frame_rate);
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
if (frame_rate && max_frame_rate) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Only one of -fpsmax and -r can be set for a stream.\n");
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
if ((frame_rate || max_frame_rate) &&
|
||||
video_sync_method == VSYNC_PASSTHROUGH)
|
||||
av_log(NULL, AV_LOG_ERROR, "Using -vsync 0 and -r/-fpsmax can produce invalid output files\n");
|
||||
if (frame_rate && video_sync_method == VSYNC_PASSTHROUGH)
|
||||
av_log(NULL, AV_LOG_ERROR, "Using -vsync 0 and -r can produce invalid output files\n");
|
||||
|
||||
MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st);
|
||||
if (frame_aspect_ratio) {
|
||||
@@ -1732,6 +1681,8 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
|
||||
MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st);
|
||||
MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st);
|
||||
if (o->nb_filters > 1)
|
||||
av_log(NULL, AV_LOG_ERROR, "Only '-vf %s' read, ignoring remaining -vf options: Use ',' to separate filters\n", ost->filters);
|
||||
|
||||
if (!ost->stream_copy) {
|
||||
const char *p = NULL;
|
||||
@@ -1913,6 +1864,8 @@ static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
|
||||
MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st);
|
||||
MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st);
|
||||
if (o->nb_filters > 1)
|
||||
av_log(NULL, AV_LOG_ERROR, "Only '-af %s' read, ignoring remaining -af options: Use ',' to separate filters\n", ost->filters);
|
||||
|
||||
if (!ost->stream_copy) {
|
||||
char *sample_fmt = NULL;
|
||||
@@ -2240,23 +2193,22 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
|
||||
/* video: highest resolution */
|
||||
if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
|
||||
int best_score = 0, idx = -1;
|
||||
int area = 0, idx = -1;
|
||||
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
int score;
|
||||
int new_area;
|
||||
ist = input_streams[i];
|
||||
score = ist->st->codecpar->width * ist->st->codecpar->height
|
||||
+ 100000000 * !!(ist->st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS)
|
||||
new_area = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames
|
||||
+ 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT);
|
||||
if (ist->user_set_discard == AVDISCARD_ALL)
|
||||
continue;
|
||||
if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
|
||||
score = 1;
|
||||
new_area = 1;
|
||||
if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
|
||||
score > best_score) {
|
||||
new_area > area) {
|
||||
if((qcr==MKTAG('A', 'P', 'I', 'C')) && !(ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
|
||||
continue;
|
||||
best_score = score;
|
||||
area = new_area;
|
||||
idx = i;
|
||||
}
|
||||
}
|
||||
@@ -2420,14 +2372,12 @@ loop_end:
|
||||
o->attachments[i]);
|
||||
exit_program(1);
|
||||
}
|
||||
if (len > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE ||
|
||||
!(attachment = av_malloc(len + AV_INPUT_BUFFER_PADDING_SIZE))) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Attachment %s too large.\n",
|
||||
if (!(attachment = av_malloc(len))) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Attachment %s too large to fit into memory.\n",
|
||||
o->attachments[i]);
|
||||
exit_program(1);
|
||||
}
|
||||
avio_read(pb, attachment, len);
|
||||
memset(attachment + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
ost = new_attachment_stream(o, oc, -1);
|
||||
ost->stream_copy = 0;
|
||||
@@ -2658,9 +2608,6 @@ loop_end:
|
||||
if(o->recording_time != INT64_MAX)
|
||||
av_dict_set(&oc->metadata, "duration", NULL, 0);
|
||||
av_dict_set(&oc->metadata, "creation_time", NULL, 0);
|
||||
av_dict_set(&oc->metadata, "company_name", NULL, 0);
|
||||
av_dict_set(&oc->metadata, "product_name", NULL, 0);
|
||||
av_dict_set(&oc->metadata, "product_version", NULL, 0);
|
||||
}
|
||||
if (!o->metadata_streams_manual)
|
||||
for (i = of->ost_index; i < nb_output_streams; i++) {
|
||||
@@ -2822,14 +2769,13 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
} else {
|
||||
/* Try to determine PAL/NTSC by peeking in the input files */
|
||||
if (nb_input_files) {
|
||||
int i, j;
|
||||
int i, j, fr;
|
||||
for (j = 0; j < nb_input_files; j++) {
|
||||
for (i = 0; i < input_files[j]->nb_streams; i++) {
|
||||
AVStream *st = input_files[j]->ctx->streams[i];
|
||||
int64_t fr;
|
||||
if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
|
||||
continue;
|
||||
fr = st->time_base.den * 1000LL / st->time_base.num;
|
||||
fr = st->time_base.den * 1000 / st->time_base.num;
|
||||
if (fr == 25000) {
|
||||
norm = PAL;
|
||||
break;
|
||||
@@ -3059,11 +3005,8 @@ static int opt_preset(void *optctx, const char *opt, const char *arg)
|
||||
static int opt_old2new(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
OptionsContext *o = optctx;
|
||||
int ret;
|
||||
char *s = av_asprintf("%s:%c", opt + 1, *opt);
|
||||
if (!s)
|
||||
return AVERROR(ENOMEM);
|
||||
ret = parse_option(o, s, arg, options);
|
||||
int ret = parse_option(o, s, arg, options);
|
||||
av_free(s);
|
||||
return ret;
|
||||
}
|
||||
@@ -3094,8 +3037,6 @@ static int opt_qscale(void *optctx, const char *opt, const char *arg)
|
||||
return parse_option(o, "q:v", arg, options);
|
||||
}
|
||||
s = av_asprintf("q%s", opt + 6);
|
||||
if (!s)
|
||||
return AVERROR(ENOMEM);
|
||||
ret = parse_option(o, s, arg, options);
|
||||
av_free(s);
|
||||
return ret;
|
||||
@@ -3140,11 +3081,8 @@ static int opt_vsync(void *optctx, const char *opt, const char *arg)
|
||||
static int opt_timecode(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
OptionsContext *o = optctx;
|
||||
int ret;
|
||||
char *tcr = av_asprintf("timecode=%s", arg);
|
||||
if (!tcr)
|
||||
return AVERROR(ENOMEM);
|
||||
ret = parse_option(o, "metadata:g", tcr, options);
|
||||
int ret = parse_option(o, "metadata:g", tcr, options);
|
||||
if (ret >= 0)
|
||||
ret = av_dict_set(&o->g->codec_opts, "gop_timecode", arg, 0);
|
||||
av_free(tcr);
|
||||
@@ -3246,7 +3184,7 @@ void show_help_default(const char *opt, const char *arg)
|
||||
" -h -- print basic options\n"
|
||||
" -h long -- print more options\n"
|
||||
" -h full -- print all options (including all format and codec specific options, very long)\n"
|
||||
" -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf/protocol\n"
|
||||
" -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf\n"
|
||||
" See man %s for detailed description of the options.\n"
|
||||
"\n", program_name);
|
||||
|
||||
@@ -3254,7 +3192,7 @@ void show_help_default(const char *opt, const char *arg)
|
||||
OPT_EXIT, 0, 0);
|
||||
|
||||
show_help_options(options, "Global options (affect whole program "
|
||||
"instead of just one file):",
|
||||
"instead of just one file:",
|
||||
0, per_file | OPT_EXIT | OPT_EXPERT, 0);
|
||||
if (show_advanced)
|
||||
show_help_options(options, "Advanced global options:", OPT_EXPERT,
|
||||
@@ -3330,7 +3268,6 @@ static int open_files(OptionGroupList *l, const char *inout,
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error parsing options for %s file "
|
||||
"%s.\n", inout, g->arg);
|
||||
uninit_options(&o);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -3504,7 +3441,7 @@ const OptionDef options[] = {
|
||||
{ "stdin", OPT_BOOL | OPT_EXPERT, { &stdin_interaction },
|
||||
"enable or disable interaction on standard input" },
|
||||
{ "timelimit", HAS_ARG | OPT_EXPERT, { .func_arg = opt_timelimit },
|
||||
"set max runtime in seconds in CPU user time", "limit" },
|
||||
"set max runtime in seconds", "limit" },
|
||||
{ "dump", OPT_BOOL | OPT_EXPERT, { &do_pkt_dump },
|
||||
"dump each input packet" },
|
||||
{ "hex", OPT_BOOL | OPT_EXPERT, { &do_hex_dump },
|
||||
@@ -3580,12 +3517,8 @@ const OptionDef options[] = {
|
||||
"create a complex filtergraph", "graph_description" },
|
||||
{ "filter_complex_script", HAS_ARG | OPT_EXPERT, { .func_arg = opt_filter_complex_script },
|
||||
"read complex filtergraph description from a file", "filename" },
|
||||
{ "auto_conversion_filters", OPT_BOOL | OPT_EXPERT, { &auto_conversion_filters },
|
||||
"enable automatic conversion filters globally" },
|
||||
{ "stats", OPT_BOOL, { &print_stats },
|
||||
"print progress report during encoding", },
|
||||
{ "stats_period", HAS_ARG | OPT_EXPERT, { .func_arg = opt_stats_period },
|
||||
"set the period at which ffmpeg updates stats and -progress output", "time" },
|
||||
{ "attach", HAS_ARG | OPT_PERFILE | OPT_EXPERT |
|
||||
OPT_OUTPUT, { .func_arg = opt_attach },
|
||||
"add an attachment to the output file", "filename" },
|
||||
@@ -3597,7 +3530,7 @@ const OptionDef options[] = {
|
||||
{ "debug_ts", OPT_BOOL | OPT_EXPERT, { &debug_ts },
|
||||
"print timestamp debugging info" },
|
||||
{ "max_error_rate", HAS_ARG | OPT_FLOAT, { &max_error_rate },
|
||||
"ratio of decoding errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.", "maximum error rate" },
|
||||
"ratio of errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.", "maximum error rate" },
|
||||
{ "discard", OPT_STRING | HAS_ARG | OPT_SPEC |
|
||||
OPT_INPUT, { .off = OFFSET(discard) },
|
||||
"discard", "" },
|
||||
@@ -3616,9 +3549,6 @@ const OptionDef options[] = {
|
||||
{ "r", OPT_VIDEO | HAS_ARG | OPT_STRING | OPT_SPEC |
|
||||
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(frame_rates) },
|
||||
"set frame rate (Hz value, fraction or abbreviation)", "rate" },
|
||||
{ "fpsmax", OPT_VIDEO | HAS_ARG | OPT_STRING | OPT_SPEC |
|
||||
OPT_OUTPUT, { .off = OFFSET(max_frame_rates) },
|
||||
"set max frame rate (Hz value, fraction or abbreviation)", "rate" },
|
||||
{ "s", OPT_VIDEO | HAS_ARG | OPT_SUBTITLE | OPT_STRING | OPT_SPEC |
|
||||
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(frame_sizes) },
|
||||
"set frame size (WxH or abbreviation)", "size" },
|
||||
@@ -3710,9 +3640,6 @@ const OptionDef options[] = {
|
||||
{ "autorotate", HAS_ARG | OPT_BOOL | OPT_SPEC |
|
||||
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(autorotate) },
|
||||
"automatically insert correct rotate filters" },
|
||||
{ "autoscale", HAS_ARG | OPT_BOOL | OPT_SPEC |
|
||||
OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(autoscale) },
|
||||
"automatically insert a scale filter at the end of the filter graph" },
|
||||
|
||||
/* audio options */
|
||||
{ "aframes", OPT_AUDIO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_audio_frames },
|
||||
@@ -3799,8 +3726,6 @@ const OptionDef options[] = {
|
||||
|
||||
{ "max_muxing_queue_size", HAS_ARG | OPT_INT | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(max_muxing_queue_size) },
|
||||
"maximum number of packets that can be buffered while waiting for all streams to initialize", "packets" },
|
||||
{ "muxing_queue_data_threshold", HAS_ARG | OPT_INT | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(muxing_queue_data_threshold) },
|
||||
"set the threshold after which max_muxing_queue_size is taken into account", "bytes" },
|
||||
|
||||
/* data codec support */
|
||||
{ "dcodec", HAS_ARG | OPT_DATA | OPT_PERFILE | OPT_EXPERT | OPT_INPUT | OPT_OUTPUT, { .func_arg = opt_data_codec },
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
#include "ffmpeg.h"
|
||||
|
||||
static AVBufferRef *hw_device_ctx;
|
||||
char *qsv_device = NULL;
|
||||
|
||||
static int qsv_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
|
||||
|
||||
@@ -51,12 +51,10 @@ static int videotoolbox_retrieve_data(AVCodecContext *s, AVFrame *frame)
|
||||
case kCVPixelFormatType_422YpCbCr8: vt->tmp_frame->format = AV_PIX_FMT_UYVY422; break;
|
||||
case kCVPixelFormatType_32BGRA: vt->tmp_frame->format = AV_PIX_FMT_BGRA; break;
|
||||
#ifdef kCFCoreFoundationVersionNumber10_7
|
||||
case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange:
|
||||
case kCVPixelFormatType_420YpCbCr8BiPlanarFullRange: vt->tmp_frame->format = AV_PIX_FMT_NV12; break;
|
||||
case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: vt->tmp_frame->format = AV_PIX_FMT_NV12; break;
|
||||
#endif
|
||||
#if HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE
|
||||
case kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange:
|
||||
case kCVPixelFormatType_420YpCbCr10BiPlanarFullRange: vt->tmp_frame->format = AV_PIX_FMT_P010; break;
|
||||
case kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange: vt->tmp_frame->format = AV_PIX_FMT_P010; break;
|
||||
#endif
|
||||
default:
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
@@ -67,7 +65,7 @@ static int videotoolbox_retrieve_data(AVCodecContext *s, AVFrame *frame)
|
||||
|
||||
vt->tmp_frame->width = frame->width;
|
||||
vt->tmp_frame->height = frame->height;
|
||||
ret = av_frame_get_buffer(vt->tmp_frame, 0);
|
||||
ret = av_frame_get_buffer(vt->tmp_frame, 32);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
314
fftools/ffplay.c
314
fftools/ffplay.c
@@ -36,12 +36,10 @@
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/fifo.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavdevice/avdevice.h"
|
||||
#include "libswscale/swscale.h"
|
||||
@@ -112,12 +110,13 @@ const int program_birth_year = 2003;
|
||||
static unsigned sws_flags = SWS_BICUBIC;
|
||||
|
||||
typedef struct MyAVPacketList {
|
||||
AVPacket *pkt;
|
||||
AVPacket pkt;
|
||||
struct MyAVPacketList *next;
|
||||
int serial;
|
||||
} MyAVPacketList;
|
||||
|
||||
typedef struct PacketQueue {
|
||||
AVFifoBuffer *pkt_list;
|
||||
MyAVPacketList *first_pkt, *last_pkt;
|
||||
int nb_packets;
|
||||
int size;
|
||||
int64_t duration;
|
||||
@@ -187,7 +186,7 @@ enum {
|
||||
};
|
||||
|
||||
typedef struct Decoder {
|
||||
AVPacket *pkt;
|
||||
AVPacket pkt;
|
||||
PacketQueue *queue;
|
||||
AVCodecContext *avctx;
|
||||
int pkt_serial;
|
||||
@@ -327,7 +326,7 @@ static int display_disable;
|
||||
static int borderless;
|
||||
static int alwaysontop;
|
||||
static int startup_volume = 100;
|
||||
static int show_status = -1;
|
||||
static int show_status = 1;
|
||||
static int av_sync_type = AV_SYNC_AUDIO_MASTER;
|
||||
static int64_t start_time = AV_NOPTS_VALUE;
|
||||
static int64_t duration = AV_NOPTS_VALUE;
|
||||
@@ -361,6 +360,8 @@ static int filter_nbthreads = 0;
|
||||
static int is_full_screen;
|
||||
static int64_t audio_callback_time;
|
||||
|
||||
static AVPacket flush_pkt;
|
||||
|
||||
#define FF_QUIT_EVENT (SDL_USEREVENT + 2)
|
||||
|
||||
static SDL_Window *window;
|
||||
@@ -425,23 +426,28 @@ int64_t get_valid_channel_layout(int64_t channel_layout, int channels)
|
||||
|
||||
static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt)
|
||||
{
|
||||
MyAVPacketList pkt1;
|
||||
MyAVPacketList *pkt1;
|
||||
|
||||
if (q->abort_request)
|
||||
return -1;
|
||||
|
||||
if (av_fifo_space(q->pkt_list) < sizeof(pkt1)) {
|
||||
if (av_fifo_grow(q->pkt_list, sizeof(pkt1)) < 0)
|
||||
return -1;
|
||||
}
|
||||
pkt1 = av_malloc(sizeof(MyAVPacketList));
|
||||
if (!pkt1)
|
||||
return -1;
|
||||
pkt1->pkt = *pkt;
|
||||
pkt1->next = NULL;
|
||||
if (pkt == &flush_pkt)
|
||||
q->serial++;
|
||||
pkt1->serial = q->serial;
|
||||
|
||||
pkt1.pkt = pkt;
|
||||
pkt1.serial = q->serial;
|
||||
|
||||
av_fifo_generic_write(q->pkt_list, &pkt1, sizeof(pkt1), NULL);
|
||||
if (!q->last_pkt)
|
||||
q->first_pkt = pkt1;
|
||||
else
|
||||
q->last_pkt->next = pkt1;
|
||||
q->last_pkt = pkt1;
|
||||
q->nb_packets++;
|
||||
q->size += pkt1.pkt->size + sizeof(pkt1);
|
||||
q->duration += pkt1.pkt->duration;
|
||||
q->size += pkt1->pkt.size + sizeof(*pkt1);
|
||||
q->duration += pkt1->pkt.duration;
|
||||
/* XXX: should duplicate packet data in DV case */
|
||||
SDL_CondSignal(q->cond);
|
||||
return 0;
|
||||
@@ -449,28 +455,24 @@ static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt)
|
||||
|
||||
static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
|
||||
{
|
||||
AVPacket *pkt1;
|
||||
int ret;
|
||||
|
||||
pkt1 = av_packet_alloc();
|
||||
if (!pkt1) {
|
||||
av_packet_unref(pkt);
|
||||
return -1;
|
||||
}
|
||||
av_packet_move_ref(pkt1, pkt);
|
||||
|
||||
SDL_LockMutex(q->mutex);
|
||||
ret = packet_queue_put_private(q, pkt1);
|
||||
ret = packet_queue_put_private(q, pkt);
|
||||
SDL_UnlockMutex(q->mutex);
|
||||
|
||||
if (ret < 0)
|
||||
av_packet_free(&pkt1);
|
||||
if (pkt != &flush_pkt && ret < 0)
|
||||
av_packet_unref(pkt);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int packet_queue_put_nullpacket(PacketQueue *q, AVPacket *pkt, int stream_index)
|
||||
static int packet_queue_put_nullpacket(PacketQueue *q, int stream_index)
|
||||
{
|
||||
AVPacket pkt1, *pkt = &pkt1;
|
||||
av_init_packet(pkt);
|
||||
pkt->data = NULL;
|
||||
pkt->size = 0;
|
||||
pkt->stream_index = stream_index;
|
||||
return packet_queue_put(q, pkt);
|
||||
}
|
||||
@@ -479,9 +481,6 @@ static int packet_queue_put_nullpacket(PacketQueue *q, AVPacket *pkt, int stream
|
||||
static int packet_queue_init(PacketQueue *q)
|
||||
{
|
||||
memset(q, 0, sizeof(PacketQueue));
|
||||
q->pkt_list = av_fifo_alloc(sizeof(MyAVPacketList));
|
||||
if (!q->pkt_list)
|
||||
return AVERROR(ENOMEM);
|
||||
q->mutex = SDL_CreateMutex();
|
||||
if (!q->mutex) {
|
||||
av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
|
||||
@@ -498,24 +497,25 @@ static int packet_queue_init(PacketQueue *q)
|
||||
|
||||
static void packet_queue_flush(PacketQueue *q)
|
||||
{
|
||||
MyAVPacketList pkt1;
|
||||
MyAVPacketList *pkt, *pkt1;
|
||||
|
||||
SDL_LockMutex(q->mutex);
|
||||
while (av_fifo_size(q->pkt_list) >= sizeof(pkt1)) {
|
||||
av_fifo_generic_read(q->pkt_list, &pkt1, sizeof(pkt1), NULL);
|
||||
av_packet_free(&pkt1.pkt);
|
||||
for (pkt = q->first_pkt; pkt; pkt = pkt1) {
|
||||
pkt1 = pkt->next;
|
||||
av_packet_unref(&pkt->pkt);
|
||||
av_freep(&pkt);
|
||||
}
|
||||
q->last_pkt = NULL;
|
||||
q->first_pkt = NULL;
|
||||
q->nb_packets = 0;
|
||||
q->size = 0;
|
||||
q->duration = 0;
|
||||
q->serial++;
|
||||
SDL_UnlockMutex(q->mutex);
|
||||
}
|
||||
|
||||
static void packet_queue_destroy(PacketQueue *q)
|
||||
{
|
||||
packet_queue_flush(q);
|
||||
av_fifo_freep(&q->pkt_list);
|
||||
SDL_DestroyMutex(q->mutex);
|
||||
SDL_DestroyCond(q->cond);
|
||||
}
|
||||
@@ -535,14 +535,14 @@ static void packet_queue_start(PacketQueue *q)
|
||||
{
|
||||
SDL_LockMutex(q->mutex);
|
||||
q->abort_request = 0;
|
||||
q->serial++;
|
||||
packet_queue_put_private(q, &flush_pkt);
|
||||
SDL_UnlockMutex(q->mutex);
|
||||
}
|
||||
|
||||
/* return < 0 if aborted, 0 if no packet and > 0 if packet. */
|
||||
static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block, int *serial)
|
||||
{
|
||||
MyAVPacketList pkt1;
|
||||
MyAVPacketList *pkt1;
|
||||
int ret;
|
||||
|
||||
SDL_LockMutex(q->mutex);
|
||||
@@ -553,15 +553,18 @@ static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block, int *seria
|
||||
break;
|
||||
}
|
||||
|
||||
if (av_fifo_size(q->pkt_list) >= sizeof(pkt1)) {
|
||||
av_fifo_generic_read(q->pkt_list, &pkt1, sizeof(pkt1), NULL);
|
||||
pkt1 = q->first_pkt;
|
||||
if (pkt1) {
|
||||
q->first_pkt = pkt1->next;
|
||||
if (!q->first_pkt)
|
||||
q->last_pkt = NULL;
|
||||
q->nb_packets--;
|
||||
q->size -= pkt1.pkt->size + sizeof(pkt1);
|
||||
q->duration -= pkt1.pkt->duration;
|
||||
av_packet_move_ref(pkt, pkt1.pkt);
|
||||
q->size -= pkt1->pkt.size + sizeof(*pkt1);
|
||||
q->duration -= pkt1->pkt.duration;
|
||||
*pkt = pkt1->pkt;
|
||||
if (serial)
|
||||
*serial = pkt1.serial;
|
||||
av_packet_free(&pkt1.pkt);
|
||||
*serial = pkt1->serial;
|
||||
av_free(pkt1);
|
||||
ret = 1;
|
||||
break;
|
||||
} else if (!block) {
|
||||
@@ -575,23 +578,21 @@ static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block, int *seria
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int decoder_init(Decoder *d, AVCodecContext *avctx, PacketQueue *queue, SDL_cond *empty_queue_cond) {
|
||||
static void decoder_init(Decoder *d, AVCodecContext *avctx, PacketQueue *queue, SDL_cond *empty_queue_cond) {
|
||||
memset(d, 0, sizeof(Decoder));
|
||||
d->pkt = av_packet_alloc();
|
||||
if (!d->pkt)
|
||||
return AVERROR(ENOMEM);
|
||||
d->avctx = avctx;
|
||||
d->queue = queue;
|
||||
d->empty_queue_cond = empty_queue_cond;
|
||||
d->start_pts = AV_NOPTS_VALUE;
|
||||
d->pkt_serial = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decoder_decode_frame(Decoder *d, AVFrame *frame, AVSubtitle *sub) {
|
||||
int ret = AVERROR(EAGAIN);
|
||||
|
||||
for (;;) {
|
||||
AVPacket pkt;
|
||||
|
||||
if (d->queue->serial == d->pkt_serial) {
|
||||
do {
|
||||
if (d->queue->abort_request)
|
||||
@@ -637,48 +638,46 @@ static int decoder_decode_frame(Decoder *d, AVFrame *frame, AVSubtitle *sub) {
|
||||
if (d->queue->nb_packets == 0)
|
||||
SDL_CondSignal(d->empty_queue_cond);
|
||||
if (d->packet_pending) {
|
||||
av_packet_move_ref(&pkt, &d->pkt);
|
||||
d->packet_pending = 0;
|
||||
} else {
|
||||
int old_serial = d->pkt_serial;
|
||||
if (packet_queue_get(d->queue, d->pkt, 1, &d->pkt_serial) < 0)
|
||||
if (packet_queue_get(d->queue, &pkt, 1, &d->pkt_serial) < 0)
|
||||
return -1;
|
||||
if (old_serial != d->pkt_serial) {
|
||||
avcodec_flush_buffers(d->avctx);
|
||||
d->finished = 0;
|
||||
d->next_pts = d->start_pts;
|
||||
d->next_pts_tb = d->start_pts_tb;
|
||||
}
|
||||
}
|
||||
if (d->queue->serial == d->pkt_serial)
|
||||
break;
|
||||
av_packet_unref(d->pkt);
|
||||
} while (1);
|
||||
} while (d->queue->serial != d->pkt_serial);
|
||||
|
||||
if (d->avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
|
||||
int got_frame = 0;
|
||||
ret = avcodec_decode_subtitle2(d->avctx, sub, &got_frame, d->pkt);
|
||||
if (ret < 0) {
|
||||
ret = AVERROR(EAGAIN);
|
||||
} else {
|
||||
if (got_frame && !d->pkt->data) {
|
||||
d->packet_pending = 1;
|
||||
}
|
||||
ret = got_frame ? 0 : (d->pkt->data ? AVERROR(EAGAIN) : AVERROR_EOF);
|
||||
}
|
||||
av_packet_unref(d->pkt);
|
||||
if (pkt.data == flush_pkt.data) {
|
||||
avcodec_flush_buffers(d->avctx);
|
||||
d->finished = 0;
|
||||
d->next_pts = d->start_pts;
|
||||
d->next_pts_tb = d->start_pts_tb;
|
||||
} else {
|
||||
if (avcodec_send_packet(d->avctx, d->pkt) == AVERROR(EAGAIN)) {
|
||||
av_log(d->avctx, AV_LOG_ERROR, "Receive_frame and send_packet both returned EAGAIN, which is an API violation.\n");
|
||||
d->packet_pending = 1;
|
||||
if (d->avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
|
||||
int got_frame = 0;
|
||||
ret = avcodec_decode_subtitle2(d->avctx, sub, &got_frame, &pkt);
|
||||
if (ret < 0) {
|
||||
ret = AVERROR(EAGAIN);
|
||||
} else {
|
||||
if (got_frame && !pkt.data) {
|
||||
d->packet_pending = 1;
|
||||
av_packet_move_ref(&d->pkt, &pkt);
|
||||
}
|
||||
ret = got_frame ? 0 : (pkt.data ? AVERROR(EAGAIN) : AVERROR_EOF);
|
||||
}
|
||||
} else {
|
||||
av_packet_unref(d->pkt);
|
||||
if (avcodec_send_packet(d->avctx, &pkt) == AVERROR(EAGAIN)) {
|
||||
av_log(d->avctx, AV_LOG_ERROR, "Receive_frame and send_packet both returned EAGAIN, which is an API violation.\n");
|
||||
d->packet_pending = 1;
|
||||
av_packet_move_ref(&d->pkt, &pkt);
|
||||
}
|
||||
}
|
||||
av_packet_unref(&pkt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void decoder_destroy(Decoder *d) {
|
||||
av_packet_free(&d->pkt);
|
||||
av_packet_unref(&d->pkt);
|
||||
avcodec_free_context(&d->avctx);
|
||||
}
|
||||
|
||||
@@ -1148,8 +1147,6 @@ static void video_audio_display(VideoState *s)
|
||||
if (realloc_texture(&s->vis_texture, SDL_PIXELFORMAT_ARGB8888, s->width, s->height, SDL_BLENDMODE_NONE, 1) < 0)
|
||||
return;
|
||||
|
||||
if (s->xpos >= s->width)
|
||||
s->xpos = 0;
|
||||
nb_display_channels= FFMIN(nb_display_channels, 2);
|
||||
if (rdft_bits != s->rdft_bits) {
|
||||
av_rdft_end(s->rdft);
|
||||
@@ -1199,6 +1196,8 @@ static void video_audio_display(VideoState *s)
|
||||
}
|
||||
if (!s->paused)
|
||||
s->xpos++;
|
||||
if (s->xpos >= s->width)
|
||||
s->xpos= s->xleft;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1644,37 +1643,37 @@ retry:
|
||||
}
|
||||
|
||||
if (is->subtitle_st) {
|
||||
while (frame_queue_nb_remaining(&is->subpq) > 0) {
|
||||
sp = frame_queue_peek(&is->subpq);
|
||||
while (frame_queue_nb_remaining(&is->subpq) > 0) {
|
||||
sp = frame_queue_peek(&is->subpq);
|
||||
|
||||
if (frame_queue_nb_remaining(&is->subpq) > 1)
|
||||
sp2 = frame_queue_peek_next(&is->subpq);
|
||||
else
|
||||
sp2 = NULL;
|
||||
if (frame_queue_nb_remaining(&is->subpq) > 1)
|
||||
sp2 = frame_queue_peek_next(&is->subpq);
|
||||
else
|
||||
sp2 = NULL;
|
||||
|
||||
if (sp->serial != is->subtitleq.serial
|
||||
|| (is->vidclk.pts > (sp->pts + ((float) sp->sub.end_display_time / 1000)))
|
||||
|| (sp2 && is->vidclk.pts > (sp2->pts + ((float) sp2->sub.start_display_time / 1000))))
|
||||
{
|
||||
if (sp->uploaded) {
|
||||
int i;
|
||||
for (i = 0; i < sp->sub.num_rects; i++) {
|
||||
AVSubtitleRect *sub_rect = sp->sub.rects[i];
|
||||
uint8_t *pixels;
|
||||
int pitch, j;
|
||||
if (sp->serial != is->subtitleq.serial
|
||||
|| (is->vidclk.pts > (sp->pts + ((float) sp->sub.end_display_time / 1000)))
|
||||
|| (sp2 && is->vidclk.pts > (sp2->pts + ((float) sp2->sub.start_display_time / 1000))))
|
||||
{
|
||||
if (sp->uploaded) {
|
||||
int i;
|
||||
for (i = 0; i < sp->sub.num_rects; i++) {
|
||||
AVSubtitleRect *sub_rect = sp->sub.rects[i];
|
||||
uint8_t *pixels;
|
||||
int pitch, j;
|
||||
|
||||
if (!SDL_LockTexture(is->sub_texture, (SDL_Rect *)sub_rect, (void **)&pixels, &pitch)) {
|
||||
for (j = 0; j < sub_rect->h; j++, pixels += pitch)
|
||||
memset(pixels, 0, sub_rect->w << 2);
|
||||
SDL_UnlockTexture(is->sub_texture);
|
||||
if (!SDL_LockTexture(is->sub_texture, (SDL_Rect *)sub_rect, (void **)&pixels, &pitch)) {
|
||||
for (j = 0; j < sub_rect->h; j++, pixels += pitch)
|
||||
memset(pixels, 0, sub_rect->w << 2);
|
||||
SDL_UnlockTexture(is->sub_texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
frame_queue_next(&is->subpq);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
frame_queue_next(&is->subpq);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
frame_queue_next(&is->pictq);
|
||||
@@ -1690,7 +1689,6 @@ display:
|
||||
}
|
||||
is->force_refresh = 0;
|
||||
if (show_status) {
|
||||
AVBPrint buf;
|
||||
static int64_t last_time;
|
||||
int64_t cur_time;
|
||||
int aqsize, vqsize, sqsize;
|
||||
@@ -1714,28 +1712,18 @@ display:
|
||||
av_diff = get_master_clock(is) - get_clock(&is->vidclk);
|
||||
else if (is->audio_st)
|
||||
av_diff = get_master_clock(is) - get_clock(&is->audclk);
|
||||
|
||||
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
|
||||
av_bprintf(&buf,
|
||||
"%7.2f %s:%7.3f fd=%4d aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r",
|
||||
get_master_clock(is),
|
||||
(is->audio_st && is->video_st) ? "A-V" : (is->video_st ? "M-V" : (is->audio_st ? "M-A" : " ")),
|
||||
av_diff,
|
||||
is->frame_drops_early + is->frame_drops_late,
|
||||
aqsize / 1024,
|
||||
vqsize / 1024,
|
||||
sqsize,
|
||||
is->video_st ? is->viddec.avctx->pts_correction_num_faulty_dts : 0,
|
||||
is->video_st ? is->viddec.avctx->pts_correction_num_faulty_pts : 0);
|
||||
|
||||
if (show_status == 1 && AV_LOG_INFO > av_log_get_level())
|
||||
fprintf(stderr, "%s", buf.str);
|
||||
else
|
||||
av_log(NULL, AV_LOG_INFO, "%s", buf.str);
|
||||
|
||||
fflush(stderr);
|
||||
av_bprint_finalize(&buf, NULL);
|
||||
|
||||
av_log(NULL, AV_LOG_INFO,
|
||||
"%7.2f %s:%7.3f fd=%4d aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r",
|
||||
get_master_clock(is),
|
||||
(is->audio_st && is->video_st) ? "A-V" : (is->video_st ? "M-V" : (is->audio_st ? "M-A" : " ")),
|
||||
av_diff,
|
||||
is->frame_drops_early + is->frame_drops_late,
|
||||
aqsize / 1024,
|
||||
vqsize / 1024,
|
||||
sqsize,
|
||||
is->video_st ? is->viddec.avctx->pts_correction_num_faulty_dts : 0,
|
||||
is->video_st ? is->viddec.avctx->pts_correction_num_faulty_pts : 0);
|
||||
fflush(stdout);
|
||||
last_time = cur_time;
|
||||
}
|
||||
}
|
||||
@@ -2005,7 +1993,7 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for
|
||||
|
||||
if (force_output_format) {
|
||||
channel_layouts[0] = is->audio_tgt.channel_layout;
|
||||
channels [0] = is->audio_tgt.channel_layout ? -1 : is->audio_tgt.channels;
|
||||
channels [0] = is->audio_tgt.channels;
|
||||
sample_rates [0] = is->audio_tgt.freq;
|
||||
if ((ret = av_opt_set_int(filt_asink, "all_channel_counts", 0, AV_OPT_SEARCH_CHILDREN)) < 0)
|
||||
goto end;
|
||||
@@ -2573,7 +2561,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
{
|
||||
AVFormatContext *ic = is->ic;
|
||||
AVCodecContext *avctx;
|
||||
const AVCodec *codec;
|
||||
AVCodec *codec;
|
||||
const char *forced_codec_name = NULL;
|
||||
AVDictionary *opts = NULL;
|
||||
AVDictionaryEntry *t = NULL;
|
||||
@@ -2628,6 +2616,8 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
av_dict_set(&opts, "threads", "auto", 0);
|
||||
if (stream_lowres)
|
||||
av_dict_set_int(&opts, "lowres", stream_lowres, 0);
|
||||
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
av_dict_set(&opts, "refcounted_frames", "1", 0);
|
||||
if ((ret = avcodec_open2(avctx, codec, &opts)) < 0) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -2680,8 +2670,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
is->audio_stream = stream_index;
|
||||
is->audio_st = ic->streams[stream_index];
|
||||
|
||||
if ((ret = decoder_init(&is->auddec, avctx, &is->audioq, is->continue_read_thread)) < 0)
|
||||
goto fail;
|
||||
decoder_init(&is->auddec, avctx, &is->audioq, is->continue_read_thread);
|
||||
if ((is->ic->iformat->flags & (AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK)) && !is->ic->iformat->read_seek) {
|
||||
is->auddec.start_pts = is->audio_st->start_time;
|
||||
is->auddec.start_pts_tb = is->audio_st->time_base;
|
||||
@@ -2694,8 +2683,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
is->video_stream = stream_index;
|
||||
is->video_st = ic->streams[stream_index];
|
||||
|
||||
if ((ret = decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread)) < 0)
|
||||
goto fail;
|
||||
decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread);
|
||||
if ((ret = decoder_start(&is->viddec, video_thread, "video_decoder", is)) < 0)
|
||||
goto out;
|
||||
is->queue_attachments_req = 1;
|
||||
@@ -2704,8 +2692,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
is->subtitle_stream = stream_index;
|
||||
is->subtitle_st = ic->streams[stream_index];
|
||||
|
||||
if ((ret = decoder_init(&is->subdec, avctx, &is->subtitleq, is->continue_read_thread)) < 0)
|
||||
goto fail;
|
||||
decoder_init(&is->subdec, avctx, &is->subtitleq, is->continue_read_thread);
|
||||
if ((ret = decoder_start(&is->subdec, subtitle_thread, "subtitle_decoder", is)) < 0)
|
||||
goto out;
|
||||
break;
|
||||
@@ -2758,7 +2745,7 @@ static int read_thread(void *arg)
|
||||
AVFormatContext *ic = NULL;
|
||||
int err, i, ret;
|
||||
int st_index[AVMEDIA_TYPE_NB];
|
||||
AVPacket *pkt = NULL;
|
||||
AVPacket pkt1, *pkt = &pkt1;
|
||||
int64_t stream_start_time;
|
||||
int pkt_in_play_range = 0;
|
||||
AVDictionaryEntry *t;
|
||||
@@ -2773,14 +2760,11 @@ static int read_thread(void *arg)
|
||||
}
|
||||
|
||||
memset(st_index, -1, sizeof(st_index));
|
||||
is->last_video_stream = is->video_stream = -1;
|
||||
is->last_audio_stream = is->audio_stream = -1;
|
||||
is->last_subtitle_stream = is->subtitle_stream = -1;
|
||||
is->eof = 0;
|
||||
|
||||
pkt = av_packet_alloc();
|
||||
if (!pkt) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Could not allocate packet.\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
ic = avformat_alloc_context();
|
||||
if (!ic) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Could not allocate context.\n");
|
||||
@@ -2964,12 +2948,18 @@ static int read_thread(void *arg)
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"%s: error while seeking\n", is->ic->url);
|
||||
} else {
|
||||
if (is->audio_stream >= 0)
|
||||
if (is->audio_stream >= 0) {
|
||||
packet_queue_flush(&is->audioq);
|
||||
if (is->subtitle_stream >= 0)
|
||||
packet_queue_put(&is->audioq, &flush_pkt);
|
||||
}
|
||||
if (is->subtitle_stream >= 0) {
|
||||
packet_queue_flush(&is->subtitleq);
|
||||
if (is->video_stream >= 0)
|
||||
packet_queue_put(&is->subtitleq, &flush_pkt);
|
||||
}
|
||||
if (is->video_stream >= 0) {
|
||||
packet_queue_flush(&is->videoq);
|
||||
packet_queue_put(&is->videoq, &flush_pkt);
|
||||
}
|
||||
if (is->seek_flags & AVSEEK_FLAG_BYTE) {
|
||||
set_clock(&is->extclk, NAN, 0);
|
||||
} else {
|
||||
@@ -2984,10 +2974,11 @@ static int read_thread(void *arg)
|
||||
}
|
||||
if (is->queue_attachments_req) {
|
||||
if (is->video_st && is->video_st->disposition & AV_DISPOSITION_ATTACHED_PIC) {
|
||||
if ((ret = av_packet_ref(pkt, &is->video_st->attached_pic)) < 0)
|
||||
AVPacket copy = { 0 };
|
||||
if ((ret = av_packet_ref(©, &is->video_st->attached_pic)) < 0)
|
||||
goto fail;
|
||||
packet_queue_put(&is->videoq, pkt);
|
||||
packet_queue_put_nullpacket(&is->videoq, pkt, is->video_stream);
|
||||
packet_queue_put(&is->videoq, ©);
|
||||
packet_queue_put_nullpacket(&is->videoq, is->video_stream);
|
||||
}
|
||||
is->queue_attachments_req = 0;
|
||||
}
|
||||
@@ -3018,19 +3009,15 @@ static int read_thread(void *arg)
|
||||
if (ret < 0) {
|
||||
if ((ret == AVERROR_EOF || avio_feof(ic->pb)) && !is->eof) {
|
||||
if (is->video_stream >= 0)
|
||||
packet_queue_put_nullpacket(&is->videoq, pkt, is->video_stream);
|
||||
packet_queue_put_nullpacket(&is->videoq, is->video_stream);
|
||||
if (is->audio_stream >= 0)
|
||||
packet_queue_put_nullpacket(&is->audioq, pkt, is->audio_stream);
|
||||
packet_queue_put_nullpacket(&is->audioq, is->audio_stream);
|
||||
if (is->subtitle_stream >= 0)
|
||||
packet_queue_put_nullpacket(&is->subtitleq, pkt, is->subtitle_stream);
|
||||
packet_queue_put_nullpacket(&is->subtitleq, is->subtitle_stream);
|
||||
is->eof = 1;
|
||||
}
|
||||
if (ic->pb && ic->pb->error) {
|
||||
if (autoexit)
|
||||
goto fail;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (ic->pb && ic->pb->error)
|
||||
break;
|
||||
SDL_LockMutex(wait_mutex);
|
||||
SDL_CondWaitTimeout(is->continue_read_thread, wait_mutex, 10);
|
||||
SDL_UnlockMutex(wait_mutex);
|
||||
@@ -3063,7 +3050,6 @@ static int read_thread(void *arg)
|
||||
if (ic && !is->ic)
|
||||
avformat_close_input(&ic);
|
||||
|
||||
av_packet_free(&pkt);
|
||||
if (ret != 0) {
|
||||
SDL_Event event;
|
||||
|
||||
@@ -3082,9 +3068,6 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
|
||||
is = av_mallocz(sizeof(VideoState));
|
||||
if (!is)
|
||||
return NULL;
|
||||
is->last_video_stream = is->video_stream = -1;
|
||||
is->last_audio_stream = is->audio_stream = -1;
|
||||
is->last_subtitle_stream = is->subtitle_stream = -1;
|
||||
is->filename = av_strdup(filename);
|
||||
if (!is->filename)
|
||||
goto fail;
|
||||
@@ -3736,6 +3719,9 @@ int main(int argc, char **argv)
|
||||
SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE);
|
||||
SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
|
||||
|
||||
av_init_packet(&flush_pkt);
|
||||
flush_pkt.data = (uint8_t *)&flush_pkt;
|
||||
|
||||
if (!display_disable) {
|
||||
int flags = SDL_WINDOW_HIDDEN;
|
||||
if (alwaysontop)
|
||||
|
||||
@@ -35,9 +35,7 @@
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/display.h"
|
||||
#include "libavutil/hash.h"
|
||||
#include "libavutil/hdr_dynamic_metadata.h"
|
||||
#include "libavutil/mastering_display_metadata.h"
|
||||
#include "libavutil/dovi_meta.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/spherical.h"
|
||||
@@ -256,7 +254,6 @@ static const OptionDef *options;
|
||||
|
||||
/* FFprobe context */
|
||||
static const char *input_filename;
|
||||
static const char *print_input_filename;
|
||||
static AVInputFormat *iformat = NULL;
|
||||
|
||||
static struct AVHashContext *hash;
|
||||
@@ -1086,12 +1083,12 @@ typedef struct CompactContext {
|
||||
#define OFFSET(x) offsetof(CompactContext, x)
|
||||
|
||||
static const AVOption compact_options[]= {
|
||||
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, 0, 0 },
|
||||
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, 0, 0 },
|
||||
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
|
||||
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
|
||||
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, 0, 0 },
|
||||
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, 0, 0 },
|
||||
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
|
||||
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
|
||||
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{NULL},
|
||||
@@ -1202,12 +1199,12 @@ static const Writer compact_writer = {
|
||||
#define OFFSET(x) offsetof(CompactContext, x)
|
||||
|
||||
static const AVOption csv_options[] = {
|
||||
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, 0, 0 },
|
||||
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, 0, 0 },
|
||||
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
|
||||
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
|
||||
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, 0, 0 },
|
||||
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, 0, 0 },
|
||||
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
|
||||
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
|
||||
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{NULL},
|
||||
@@ -1240,8 +1237,8 @@ typedef struct FlatContext {
|
||||
#define OFFSET(x) offsetof(FlatContext, x)
|
||||
|
||||
static const AVOption flat_options[]= {
|
||||
{"sep_char", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, 0, 0 },
|
||||
{"s", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, 0, 0 },
|
||||
{"sep_char", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
|
||||
{"s", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
|
||||
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{NULL},
|
||||
@@ -1538,7 +1535,7 @@ static void json_print_section_header(WriterContext *wctx)
|
||||
if (parent_section && parent_section->id == SECTION_ID_PACKETS_AND_FRAMES) {
|
||||
if (!json->compact)
|
||||
JSON_INDENT();
|
||||
printf("\"type\": \"%s\"", section->name);
|
||||
printf("\"type\": \"%s\"%s", section->name, json->item_sep);
|
||||
}
|
||||
}
|
||||
av_bprint_finalize(&buf, NULL);
|
||||
@@ -1582,10 +1579,8 @@ static inline void json_print_item_str(WriterContext *wctx,
|
||||
static void json_print_str(WriterContext *wctx, const char *key, const char *value)
|
||||
{
|
||||
JSONContext *json = wctx->priv;
|
||||
const struct section *parent_section = wctx->level ?
|
||||
wctx->section[wctx->level-1] : NULL;
|
||||
|
||||
if (wctx->nb_item[wctx->level] || (parent_section && parent_section->id == SECTION_ID_PACKETS_AND_FRAMES))
|
||||
if (wctx->nb_item[wctx->level])
|
||||
printf("%s", json->item_sep);
|
||||
if (!json->compact)
|
||||
JSON_INDENT();
|
||||
@@ -1595,11 +1590,9 @@ static void json_print_str(WriterContext *wctx, const char *key, const char *val
|
||||
static void json_print_int(WriterContext *wctx, const char *key, long long int value)
|
||||
{
|
||||
JSONContext *json = wctx->priv;
|
||||
const struct section *parent_section = wctx->level ?
|
||||
wctx->section[wctx->level-1] : NULL;
|
||||
AVBPrint buf;
|
||||
|
||||
if (wctx->nb_item[wctx->level] || (parent_section && parent_section->id == SECTION_ID_PACKETS_AND_FRAMES))
|
||||
if (wctx->nb_item[wctx->level])
|
||||
printf("%s", json->item_sep);
|
||||
if (!json->compact)
|
||||
JSON_INDENT();
|
||||
@@ -1672,6 +1665,24 @@ static av_cold int xml_init(WriterContext *wctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char *xml_escape_str(AVBPrint *dst, const char *src, void *log_ctx)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
for (p = src; *p; p++) {
|
||||
switch (*p) {
|
||||
case '&' : av_bprintf(dst, "%s", "&"); break;
|
||||
case '<' : av_bprintf(dst, "%s", "<"); break;
|
||||
case '>' : av_bprintf(dst, "%s", ">"); break;
|
||||
case '"' : av_bprintf(dst, "%s", """); break;
|
||||
case '\'': av_bprintf(dst, "%s", "'"); break;
|
||||
default: av_bprint_chars(dst, *p, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return dst->str;
|
||||
}
|
||||
|
||||
#define XML_INDENT() printf("%*c", xml->indent_level * 4, ' ')
|
||||
|
||||
static void xml_print_section_header(WriterContext *wctx)
|
||||
@@ -1743,22 +1754,14 @@ static void xml_print_str(WriterContext *wctx, const char *key, const char *valu
|
||||
|
||||
if (section->flags & SECTION_FLAG_HAS_VARIABLE_FIELDS) {
|
||||
XML_INDENT();
|
||||
av_bprint_escape(&buf, key, NULL,
|
||||
AV_ESCAPE_MODE_XML, AV_ESCAPE_FLAG_XML_DOUBLE_QUOTES);
|
||||
printf("<%s key=\"%s\"",
|
||||
section->element_name, buf.str);
|
||||
section->element_name, xml_escape_str(&buf, key, wctx));
|
||||
av_bprint_clear(&buf);
|
||||
|
||||
av_bprint_escape(&buf, value, NULL,
|
||||
AV_ESCAPE_MODE_XML, AV_ESCAPE_FLAG_XML_DOUBLE_QUOTES);
|
||||
printf(" value=\"%s\"/>\n", buf.str);
|
||||
printf(" value=\"%s\"/>\n", xml_escape_str(&buf, value, wctx));
|
||||
} else {
|
||||
if (wctx->nb_item[wctx->level])
|
||||
printf(" ");
|
||||
|
||||
av_bprint_escape(&buf, value, NULL,
|
||||
AV_ESCAPE_MODE_XML, AV_ESCAPE_FLAG_XML_DOUBLE_QUOTES);
|
||||
printf("%s=\"%s\"", key, buf.str);
|
||||
printf("%s=\"%s\"", key, xml_escape_str(&buf, value, wctx));
|
||||
}
|
||||
|
||||
av_bprint_finalize(&buf, NULL);
|
||||
@@ -1851,105 +1854,6 @@ static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void print_dynamic_hdr10_plus(WriterContext *w, const AVDynamicHDRPlus *metadata)
|
||||
{
|
||||
if (!metadata)
|
||||
return;
|
||||
print_int("application version", metadata->application_version);
|
||||
print_int("num_windows", metadata->num_windows);
|
||||
for (int n = 1; n < metadata->num_windows; n++) {
|
||||
const AVHDRPlusColorTransformParams *params = &metadata->params[n];
|
||||
print_q("window_upper_left_corner_x",
|
||||
params->window_upper_left_corner_x,'/');
|
||||
print_q("window_upper_left_corner_y",
|
||||
params->window_upper_left_corner_y,'/');
|
||||
print_q("window_lower_right_corner_x",
|
||||
params->window_lower_right_corner_x,'/');
|
||||
print_q("window_lower_right_corner_y",
|
||||
params->window_lower_right_corner_y,'/');
|
||||
print_q("window_upper_left_corner_x",
|
||||
params->window_upper_left_corner_x,'/');
|
||||
print_q("window_upper_left_corner_y",
|
||||
params->window_upper_left_corner_y,'/');
|
||||
print_int("center_of_ellipse_x",
|
||||
params->center_of_ellipse_x ) ;
|
||||
print_int("center_of_ellipse_y",
|
||||
params->center_of_ellipse_y );
|
||||
print_int("rotation_angle",
|
||||
params->rotation_angle);
|
||||
print_int("semimajor_axis_internal_ellipse",
|
||||
params->semimajor_axis_internal_ellipse);
|
||||
print_int("semimajor_axis_external_ellipse",
|
||||
params->semimajor_axis_external_ellipse);
|
||||
print_int("semiminor_axis_external_ellipse",
|
||||
params->semiminor_axis_external_ellipse);
|
||||
print_int("overlap_process_option",
|
||||
params->overlap_process_option);
|
||||
}
|
||||
print_q("targeted_system_display_maximum_luminance",
|
||||
metadata->targeted_system_display_maximum_luminance,'/');
|
||||
if (metadata->targeted_system_display_actual_peak_luminance_flag) {
|
||||
print_int("num_rows_targeted_system_display_actual_peak_luminance",
|
||||
metadata->num_rows_targeted_system_display_actual_peak_luminance);
|
||||
print_int("num_cols_targeted_system_display_actual_peak_luminance",
|
||||
metadata->num_cols_targeted_system_display_actual_peak_luminance);
|
||||
for (int i = 0; i < metadata->num_rows_targeted_system_display_actual_peak_luminance; i++) {
|
||||
for (int j = 0; j < metadata->num_cols_targeted_system_display_actual_peak_luminance; j++) {
|
||||
print_q("targeted_system_display_actual_peak_luminance",
|
||||
metadata->targeted_system_display_actual_peak_luminance[i][j],'/');
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int n = 0; n < metadata->num_windows; n++) {
|
||||
const AVHDRPlusColorTransformParams *params = &metadata->params[n];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
print_q("maxscl",params->maxscl[i],'/');
|
||||
}
|
||||
print_q("average_maxrgb",
|
||||
params->average_maxrgb,'/');
|
||||
print_int("num_distribution_maxrgb_percentiles",
|
||||
params->num_distribution_maxrgb_percentiles);
|
||||
for (int i = 0; i < params->num_distribution_maxrgb_percentiles; i++) {
|
||||
print_int("distribution_maxrgb_percentage",
|
||||
params->distribution_maxrgb[i].percentage);
|
||||
print_q("distribution_maxrgb_percentile",
|
||||
params->distribution_maxrgb[i].percentile,'/');
|
||||
}
|
||||
print_q("fraction_bright_pixels",
|
||||
params->fraction_bright_pixels,'/');
|
||||
}
|
||||
if (metadata->mastering_display_actual_peak_luminance_flag) {
|
||||
print_int("num_rows_mastering_display_actual_peak_luminance",
|
||||
metadata->num_rows_mastering_display_actual_peak_luminance);
|
||||
print_int("num_cols_mastering_display_actual_peak_luminance",
|
||||
metadata->num_cols_mastering_display_actual_peak_luminance);
|
||||
for (int i = 0; i < metadata->num_rows_mastering_display_actual_peak_luminance; i++) {
|
||||
for (int j = 0; j < metadata->num_cols_mastering_display_actual_peak_luminance; j++) {
|
||||
print_q("mastering_display_actual_peak_luminance",
|
||||
metadata->mastering_display_actual_peak_luminance[i][j],'/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int n = 0; n < metadata->num_windows; n++) {
|
||||
const AVHDRPlusColorTransformParams *params = &metadata->params[n];
|
||||
if (params->tone_mapping_flag) {
|
||||
print_q("knee_point_x", params->knee_point_x,'/');
|
||||
print_q("knee_point_y", params->knee_point_y,'/');
|
||||
print_int("num_bezier_curve_anchors",
|
||||
params->num_bezier_curve_anchors );
|
||||
for (int i = 0; i < params->num_bezier_curve_anchors; i++) {
|
||||
print_q("bezier_curve_anchors",
|
||||
params->bezier_curve_anchors[i],'/');
|
||||
}
|
||||
}
|
||||
if (params->color_saturation_mapping_flag) {
|
||||
print_q("color_saturation_weight",
|
||||
params->color_saturation_weight,'/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void print_pkt_side_data(WriterContext *w,
|
||||
AVCodecParameters *par,
|
||||
const AVPacketSideData *side_data,
|
||||
@@ -2019,16 +1923,6 @@ static void print_pkt_side_data(WriterContext *w,
|
||||
AVContentLightMetadata *metadata = (AVContentLightMetadata *)sd->data;
|
||||
print_int("max_content", metadata->MaxCLL);
|
||||
print_int("max_average", metadata->MaxFALL);
|
||||
} else if (sd->type == AV_PKT_DATA_DOVI_CONF) {
|
||||
AVDOVIDecoderConfigurationRecord *dovi = (AVDOVIDecoderConfigurationRecord *)sd->data;
|
||||
print_int("dv_version_major", dovi->dv_version_major);
|
||||
print_int("dv_version_minor", dovi->dv_version_minor);
|
||||
print_int("dv_profile", dovi->dv_profile);
|
||||
print_int("dv_level", dovi->dv_level);
|
||||
print_int("rpu_present_flag", dovi->rpu_present_flag);
|
||||
print_int("el_present_flag", dovi->el_present_flag);
|
||||
print_int("bl_present_flag", dovi->bl_present_flag);
|
||||
print_int("dv_bl_signal_compatibility_id", dovi->dv_bl_signal_compatibility_id);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
@@ -2158,6 +2052,8 @@ static void show_packet(WriterContext *w, InputFile *ifile, AVPacket *pkt, int p
|
||||
print_time("dts_time", pkt->dts, &st->time_base);
|
||||
print_duration_ts("duration", pkt->duration);
|
||||
print_duration_time("duration_time", pkt->duration, &st->time_base);
|
||||
print_duration_ts("convergence_duration", pkt->convergence_duration);
|
||||
print_duration_time("convergence_duration_time", pkt->convergence_duration, &st->time_base);
|
||||
print_val("size", pkt->size, unit_byte_str);
|
||||
if (pkt->pos != -1) print_fmt ("pos", "%"PRId64, pkt->pos);
|
||||
else print_str_opt("pos", "N/A");
|
||||
@@ -2313,7 +2209,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST);
|
||||
for (int j = 1; j <= m ; j++) {
|
||||
char tcbuf[AV_TIMECODE_STR_SIZE];
|
||||
av_timecode_make_smpte_tc_string2(tcbuf, stream->avg_frame_rate, tc[j], 0, 0);
|
||||
av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
|
||||
writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_TIMECODE);
|
||||
print_str("value", tcbuf);
|
||||
writer_print_section_footer(w);
|
||||
@@ -2338,9 +2234,6 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
print_q("min_luminance", metadata->min_luminance, '/');
|
||||
print_q("max_luminance", metadata->max_luminance, '/');
|
||||
}
|
||||
} else if (sd->type == AV_FRAME_DATA_DYNAMIC_HDR_PLUS) {
|
||||
AVDynamicHDRPlus *metadata = (AVDynamicHDRPlus *)sd->data;
|
||||
print_dynamic_hdr10_plus(w, metadata);
|
||||
} else if (sd->type == AV_FRAME_DATA_CONTENT_LIGHT_LEVEL) {
|
||||
AVContentLightMetadata *metadata = (AVContentLightMetadata *)sd->data;
|
||||
print_int("max_content", metadata->MaxCLL);
|
||||
@@ -2453,12 +2346,14 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile,
|
||||
const ReadInterval *interval, int64_t *cur_ts)
|
||||
{
|
||||
AVFormatContext *fmt_ctx = ifile->fmt_ctx;
|
||||
AVPacket *pkt = NULL;
|
||||
AVPacket pkt;
|
||||
AVFrame *frame = NULL;
|
||||
int ret = 0, i = 0, frame_count = 0;
|
||||
int64_t start = -INT64_MAX, end = interval->end;
|
||||
int has_start = 0, has_end = interval->has_end && !interval->end_is_offset;
|
||||
|
||||
av_init_packet(&pkt);
|
||||
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Processing read interval ");
|
||||
log_read_interval(interval, NULL, AV_LOG_VERBOSE);
|
||||
|
||||
@@ -2491,23 +2386,18 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile,
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
pkt = av_packet_alloc();
|
||||
if (!pkt) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
while (!av_read_frame(fmt_ctx, pkt)) {
|
||||
while (!av_read_frame(fmt_ctx, &pkt)) {
|
||||
if (fmt_ctx->nb_streams > nb_streams) {
|
||||
REALLOCZ_ARRAY_STREAM(nb_streams_frames, nb_streams, fmt_ctx->nb_streams);
|
||||
REALLOCZ_ARRAY_STREAM(nb_streams_packets, nb_streams, fmt_ctx->nb_streams);
|
||||
REALLOCZ_ARRAY_STREAM(selected_streams, nb_streams, fmt_ctx->nb_streams);
|
||||
nb_streams = fmt_ctx->nb_streams;
|
||||
}
|
||||
if (selected_streams[pkt->stream_index]) {
|
||||
AVRational tb = ifile->streams[pkt->stream_index].st->time_base;
|
||||
if (selected_streams[pkt.stream_index]) {
|
||||
AVRational tb = ifile->streams[pkt.stream_index].st->time_base;
|
||||
|
||||
if (pkt->pts != AV_NOPTS_VALUE)
|
||||
*cur_ts = av_rescale_q(pkt->pts, tb, AV_TIME_BASE_Q);
|
||||
if (pkt.pts != AV_NOPTS_VALUE)
|
||||
*cur_ts = av_rescale_q(pkt.pts, tb, AV_TIME_BASE_Q);
|
||||
|
||||
if (!has_start && *cur_ts != AV_NOPTS_VALUE) {
|
||||
start = *cur_ts;
|
||||
@@ -2529,27 +2419,26 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile,
|
||||
frame_count++;
|
||||
if (do_read_packets) {
|
||||
if (do_show_packets)
|
||||
show_packet(w, ifile, pkt, i++);
|
||||
nb_streams_packets[pkt->stream_index]++;
|
||||
show_packet(w, ifile, &pkt, i++);
|
||||
nb_streams_packets[pkt.stream_index]++;
|
||||
}
|
||||
if (do_read_frames) {
|
||||
int packet_new = 1;
|
||||
while (process_frame(w, ifile, frame, pkt, &packet_new) > 0);
|
||||
while (process_frame(w, ifile, frame, &pkt, &packet_new) > 0);
|
||||
}
|
||||
}
|
||||
av_packet_unref(pkt);
|
||||
av_packet_unref(&pkt);
|
||||
}
|
||||
av_packet_unref(pkt);
|
||||
av_packet_unref(&pkt);
|
||||
//Flush remaining frames that are cached in the decoder
|
||||
for (i = 0; i < fmt_ctx->nb_streams; i++) {
|
||||
pkt->stream_index = i;
|
||||
pkt.stream_index = i;
|
||||
if (do_read_frames)
|
||||
while (process_frame(w, ifile, frame, pkt, &(int){1}) > 0);
|
||||
while (process_frame(w, ifile, frame, &pkt, &(int){1}) > 0);
|
||||
}
|
||||
|
||||
end:
|
||||
av_frame_free(&frame);
|
||||
av_packet_free(&pkt);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Could not read packets in interval ");
|
||||
log_read_interval(interval, NULL, AV_LOG_ERROR);
|
||||
@@ -2625,6 +2514,10 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
s = av_get_media_type_string(par->codec_type);
|
||||
if (s) print_str ("codec_type", s);
|
||||
else print_str_opt("codec_type", "unknown");
|
||||
#if FF_API_LAVF_AVCTX
|
||||
if (dec_ctx)
|
||||
print_q("codec_time_base", dec_ctx->time_base, '/');
|
||||
#endif
|
||||
|
||||
/* print AVI/FourCC tag */
|
||||
print_str("codec_tag_string", av_fourcc2str(par->codec_tag));
|
||||
@@ -2634,11 +2527,12 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
print_int("width", par->width);
|
||||
print_int("height", par->height);
|
||||
#if FF_API_LAVF_AVCTX
|
||||
if (dec_ctx) {
|
||||
print_int("coded_width", dec_ctx->coded_width);
|
||||
print_int("coded_height", dec_ctx->coded_height);
|
||||
print_int("closed_captions", !!(dec_ctx->properties & FF_CODEC_PROPERTY_CLOSED_CAPTIONS));
|
||||
}
|
||||
#endif
|
||||
print_int("has_b_frames", par->video_delay);
|
||||
sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, NULL);
|
||||
if (sar.num) {
|
||||
@@ -2676,6 +2570,15 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
else
|
||||
print_str_opt("field_order", "unknown");
|
||||
|
||||
#if FF_API_PRIVATE_OPT
|
||||
if (dec_ctx && dec_ctx->timecode_frame_start >= 0) {
|
||||
char tcbuf[AV_TIMECODE_STR_SIZE];
|
||||
av_timecode_make_mpeg_tc_string(tcbuf, dec_ctx->timecode_frame_start);
|
||||
print_str("timecode", tcbuf);
|
||||
} else {
|
||||
print_str_opt("timecode", "N/A");
|
||||
}
|
||||
#endif
|
||||
if (dec_ctx)
|
||||
print_int("refs", dec_ctx->refs);
|
||||
break;
|
||||
@@ -2733,10 +2636,10 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
print_time("duration", stream->duration, &stream->time_base);
|
||||
if (par->bit_rate > 0) print_val ("bit_rate", par->bit_rate, unit_bit_per_second_str);
|
||||
else print_str_opt("bit_rate", "N/A");
|
||||
if (dec_ctx && dec_ctx->rc_max_rate > 0)
|
||||
print_val ("max_bit_rate", dec_ctx->rc_max_rate, unit_bit_per_second_str);
|
||||
else
|
||||
print_str_opt("max_bit_rate", "N/A");
|
||||
#if FF_API_LAVF_AVCTX
|
||||
if (stream->codec->rc_max_rate > 0) print_val ("max_bit_rate", stream->codec->rc_max_rate, unit_bit_per_second_str);
|
||||
else print_str_opt("max_bit_rate", "N/A");
|
||||
#endif
|
||||
if (dec_ctx && dec_ctx->bits_per_raw_sample > 0) print_fmt("bits_per_raw_sample", "%d", dec_ctx->bits_per_raw_sample);
|
||||
else print_str_opt("bits_per_raw_sample", "N/A");
|
||||
if (stream->nb_frames) print_fmt ("nb_frames", "%"PRId64, stream->nb_frames);
|
||||
@@ -2929,12 +2832,11 @@ static void show_error(WriterContext *w, int err)
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
static int open_input_file(InputFile *ifile, const char *filename,
|
||||
const char *print_filename)
|
||||
static int open_input_file(InputFile *ifile, const char *filename)
|
||||
{
|
||||
int err, i;
|
||||
AVFormatContext *fmt_ctx = NULL;
|
||||
AVDictionaryEntry *t = NULL;
|
||||
AVDictionaryEntry *t;
|
||||
int scan_all_pmts_set = 0;
|
||||
|
||||
fmt_ctx = avformat_alloc_context();
|
||||
@@ -2952,15 +2854,13 @@ static int open_input_file(InputFile *ifile, const char *filename,
|
||||
print_error(filename, err);
|
||||
return err;
|
||||
}
|
||||
if (print_filename) {
|
||||
av_freep(&fmt_ctx->url);
|
||||
fmt_ctx->url = av_strdup(print_filename);
|
||||
}
|
||||
ifile->fmt_ctx = fmt_ctx;
|
||||
if (scan_all_pmts_set)
|
||||
av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
|
||||
while ((t = av_dict_get(format_opts, "", t, AV_DICT_IGNORE_SUFFIX)))
|
||||
av_log(NULL, AV_LOG_WARNING, "Option %s skipped - not known to demuxer.\n", t->key);
|
||||
if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (find_stream_info) {
|
||||
AVDictionary **opts = setup_find_stream_info_opts(fmt_ctx, codec_opts);
|
||||
@@ -2990,7 +2890,7 @@ static int open_input_file(InputFile *ifile, const char *filename,
|
||||
for (i = 0; i < fmt_ctx->nb_streams; i++) {
|
||||
InputStream *ist = &ifile->streams[i];
|
||||
AVStream *stream = fmt_ctx->streams[i];
|
||||
const AVCodec *codec;
|
||||
AVCodec *codec;
|
||||
|
||||
ist->st = stream;
|
||||
|
||||
@@ -3028,6 +2928,11 @@ static int open_input_file(InputFile *ifile, const char *filename,
|
||||
}
|
||||
|
||||
ist->dec_ctx->pkt_timebase = stream->time_base;
|
||||
ist->dec_ctx->framerate = stream->avg_frame_rate;
|
||||
#if FF_API_LAVF_AVCTX
|
||||
ist->dec_ctx->coded_width = stream->codec->coded_width;
|
||||
ist->dec_ctx->coded_height = stream->codec->coded_height;
|
||||
#endif
|
||||
|
||||
if (avcodec_open2(ist->dec_ctx, codec, &opts) < 0) {
|
||||
av_log(NULL, AV_LOG_WARNING, "Could not open codec for input stream %d\n",
|
||||
@@ -3062,8 +2967,7 @@ static void close_input_file(InputFile *ifile)
|
||||
avformat_close_input(&ifile->fmt_ctx);
|
||||
}
|
||||
|
||||
static int probe_file(WriterContext *wctx, const char *filename,
|
||||
const char *print_filename)
|
||||
static int probe_file(WriterContext *wctx, const char *filename)
|
||||
{
|
||||
InputFile ifile = { 0 };
|
||||
int ret, i;
|
||||
@@ -3072,7 +2976,7 @@ static int probe_file(WriterContext *wctx, const char *filename,
|
||||
do_read_frames = do_show_frames || do_count_frames;
|
||||
do_read_packets = do_show_packets || do_count_packets;
|
||||
|
||||
ret = open_input_file(&ifile, filename, print_filename);
|
||||
ret = open_input_file(&ifile, filename);
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
|
||||
@@ -3228,6 +3132,9 @@ static void ffprobe_show_pixel_formats(WriterContext *w)
|
||||
PRINT_PIX_FMT_FLAG(HWACCEL, "hwaccel");
|
||||
PRINT_PIX_FMT_FLAG(PLANAR, "planar");
|
||||
PRINT_PIX_FMT_FLAG(RGB, "rgb");
|
||||
#if FF_API_PSEUDOPAL
|
||||
PRINT_PIX_FMT_FLAG(PSEUDOPAL, "pseudopal");
|
||||
#endif
|
||||
PRINT_PIX_FMT_FLAG(ALPHA, "alpha");
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
@@ -3375,12 +3282,6 @@ static int opt_input_file_i(void *optctx, const char *opt, const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opt_print_filename(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
print_input_filename = arg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_help_default(const char *opt, const char *arg)
|
||||
{
|
||||
av_log_set_callback(log_callback_help);
|
||||
@@ -3570,7 +3471,7 @@ static int opt_sections(void *optctx, const char *opt, const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opt_show_versions(void *optctx, const char *opt, const char *arg)
|
||||
static int opt_show_versions(const char *opt, const char *arg)
|
||||
{
|
||||
mark_section_show_entries(SECTION_ID_PROGRAM_VERSION, 1, NULL);
|
||||
mark_section_show_entries(SECTION_ID_LIBRARY_VERSION, 1, NULL);
|
||||
@@ -3578,7 +3479,7 @@ static int opt_show_versions(void *optctx, const char *opt, const char *arg)
|
||||
}
|
||||
|
||||
#define DEFINE_OPT_SHOW_SECTION(section, target_section_id) \
|
||||
static int opt_show_##section(void *optctx, const char *opt, const char *arg) \
|
||||
static int opt_show_##section(const char *opt, const char *arg) \
|
||||
{ \
|
||||
mark_section_show_entries(SECTION_ID_##target_section_id, 1, NULL); \
|
||||
return 0; \
|
||||
@@ -3606,40 +3507,39 @@ static const OptionDef real_options[] = {
|
||||
"use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
|
||||
{ "pretty", 0, {.func_arg = opt_pretty},
|
||||
"prettify the format of displayed values, make it more human readable" },
|
||||
{ "print_format", OPT_STRING | HAS_ARG, { &print_format },
|
||||
{ "print_format", OPT_STRING | HAS_ARG, {(void*)&print_format},
|
||||
"set the output printing format (available formats are: default, compact, csv, flat, ini, json, xml)", "format" },
|
||||
{ "of", OPT_STRING | HAS_ARG, { &print_format }, "alias for -print_format", "format" },
|
||||
{ "select_streams", OPT_STRING | HAS_ARG, { &stream_specifier }, "select the specified streams", "stream_specifier" },
|
||||
{ "of", OPT_STRING | HAS_ARG, {(void*)&print_format}, "alias for -print_format", "format" },
|
||||
{ "select_streams", OPT_STRING | HAS_ARG, {(void*)&stream_specifier}, "select the specified streams", "stream_specifier" },
|
||||
{ "sections", OPT_EXIT, {.func_arg = opt_sections}, "print sections structure and section information, and exit" },
|
||||
{ "show_data", OPT_BOOL, { &do_show_data }, "show packets data" },
|
||||
{ "show_data_hash", OPT_STRING | HAS_ARG, { &show_data_hash }, "show packets data hash" },
|
||||
{ "show_error", 0, { .func_arg = &opt_show_error }, "show probing error" },
|
||||
{ "show_format", 0, { .func_arg = &opt_show_format }, "show format/container info" },
|
||||
{ "show_frames", 0, { .func_arg = &opt_show_frames }, "show frames info" },
|
||||
{ "show_data", OPT_BOOL, {(void*)&do_show_data}, "show packets data" },
|
||||
{ "show_data_hash", OPT_STRING | HAS_ARG, {(void*)&show_data_hash}, "show packets data hash" },
|
||||
{ "show_error", 0, {(void*)&opt_show_error}, "show probing error" },
|
||||
{ "show_format", 0, {(void*)&opt_show_format}, "show format/container info" },
|
||||
{ "show_frames", 0, {(void*)&opt_show_frames}, "show frames info" },
|
||||
{ "show_format_entry", HAS_ARG, {.func_arg = opt_show_format_entry},
|
||||
"show a particular entry from the format/container info", "entry" },
|
||||
{ "show_entries", HAS_ARG, {.func_arg = opt_show_entries},
|
||||
"show a set of specified entries", "entry_list" },
|
||||
#if HAVE_THREADS
|
||||
{ "show_log", OPT_INT|HAS_ARG, { &do_show_log }, "show log" },
|
||||
{ "show_log", OPT_INT|HAS_ARG, {(void*)&do_show_log}, "show log" },
|
||||
#endif
|
||||
{ "show_packets", 0, { .func_arg = &opt_show_packets }, "show packets info" },
|
||||
{ "show_programs", 0, { .func_arg = &opt_show_programs }, "show programs info" },
|
||||
{ "show_streams", 0, { .func_arg = &opt_show_streams }, "show streams info" },
|
||||
{ "show_chapters", 0, { .func_arg = &opt_show_chapters }, "show chapters info" },
|
||||
{ "count_frames", OPT_BOOL, { &do_count_frames }, "count the number of frames per stream" },
|
||||
{ "count_packets", OPT_BOOL, { &do_count_packets }, "count the number of packets per stream" },
|
||||
{ "show_program_version", 0, { .func_arg = &opt_show_program_version }, "show ffprobe version" },
|
||||
{ "show_library_versions", 0, { .func_arg = &opt_show_library_versions }, "show library versions" },
|
||||
{ "show_versions", 0, { .func_arg = &opt_show_versions }, "show program and library versions" },
|
||||
{ "show_pixel_formats", 0, { .func_arg = &opt_show_pixel_formats }, "show pixel format descriptions" },
|
||||
{ "show_private_data", OPT_BOOL, { &show_private_data }, "show private data" },
|
||||
{ "private", OPT_BOOL, { &show_private_data }, "same as show_private_data" },
|
||||
{ "show_packets", 0, {(void*)&opt_show_packets}, "show packets info" },
|
||||
{ "show_programs", 0, {(void*)&opt_show_programs}, "show programs info" },
|
||||
{ "show_streams", 0, {(void*)&opt_show_streams}, "show streams info" },
|
||||
{ "show_chapters", 0, {(void*)&opt_show_chapters}, "show chapters info" },
|
||||
{ "count_frames", OPT_BOOL, {(void*)&do_count_frames}, "count the number of frames per stream" },
|
||||
{ "count_packets", OPT_BOOL, {(void*)&do_count_packets}, "count the number of packets per stream" },
|
||||
{ "show_program_version", 0, {(void*)&opt_show_program_version}, "show ffprobe version" },
|
||||
{ "show_library_versions", 0, {(void*)&opt_show_library_versions}, "show library versions" },
|
||||
{ "show_versions", 0, {(void*)&opt_show_versions}, "show program and library versions" },
|
||||
{ "show_pixel_formats", 0, {(void*)&opt_show_pixel_formats}, "show pixel format descriptions" },
|
||||
{ "show_private_data", OPT_BOOL, {(void*)&show_private_data}, "show private data" },
|
||||
{ "private", OPT_BOOL, {(void*)&show_private_data}, "same as show_private_data" },
|
||||
{ "bitexact", OPT_BOOL, {&do_bitexact}, "force bitexact output" },
|
||||
{ "read_intervals", HAS_ARG, {.func_arg = opt_read_intervals}, "set read intervals", "read_intervals" },
|
||||
{ "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg = opt_default}, "generic catch all option", "" },
|
||||
{ "i", HAS_ARG, {.func_arg = opt_input_file_i}, "read specified file", "input_file"},
|
||||
{ "print_filename", HAS_ARG, {.func_arg = opt_print_filename}, "override the printed input filename", "print_file"},
|
||||
{ "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT, { &find_stream_info },
|
||||
"read and decode the streams to fill missing information with heuristics" },
|
||||
{ NULL, },
|
||||
@@ -3788,7 +3688,7 @@ int main(int argc, char **argv)
|
||||
av_log(NULL, AV_LOG_ERROR, "Use -h to get full help or, even better, run 'man %s'.\n", program_name);
|
||||
ret = AVERROR(EINVAL);
|
||||
} else if (input_filename) {
|
||||
ret = probe_file(wctx, input_filename, print_input_filename);
|
||||
ret = probe_file(wctx, input_filename);
|
||||
if (ret < 0 && do_show_error)
|
||||
show_error(wctx, ret);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "libavutil/frame.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
#include "avcodec.h"
|
||||
#include "blockdsp.h"
|
||||
#include "bswapdsp.h"
|
||||
@@ -499,8 +498,8 @@ static int decode_i_block(FourXContext *f, int16_t *block)
|
||||
{
|
||||
int code, i, j, level, val;
|
||||
|
||||
if (get_bits_left(&f->pre_gb) < 2) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->pre_gb));
|
||||
if (get_bits_left(&f->gb) < 2){
|
||||
av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->gb));
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
if (avctx->bits_per_coded_sample <= 8) {
|
||||
buffer_size_t size;
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt,
|
||||
AV_PKT_DATA_PALETTE,
|
||||
&size);
|
||||
|
||||
@@ -164,7 +164,8 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
|
||||
case AV_CODEC_ID_8SVX_FIB: esc->table = fibonacci; break;
|
||||
case AV_CODEC_ID_8SVX_EXP: esc->table = exponential; break;
|
||||
default:
|
||||
av_assert1(0);
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid codec id %d.\n", avctx->codec->id);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
|
||||
|
||||
|
||||
@@ -6,18 +6,12 @@ HEADERS = ac3_parser.h \
|
||||
avcodec.h \
|
||||
avdct.h \
|
||||
avfft.h \
|
||||
bsf.h \
|
||||
codec.h \
|
||||
codec_desc.h \
|
||||
codec_id.h \
|
||||
codec_par.h \
|
||||
d3d11va.h \
|
||||
dirac.h \
|
||||
dv_profile.h \
|
||||
dxva2.h \
|
||||
jni.h \
|
||||
mediacodec.h \
|
||||
packet.h \
|
||||
qsv.h \
|
||||
vaapi.h \
|
||||
vdpau.h \
|
||||
@@ -29,7 +23,6 @@ HEADERS = ac3_parser.h \
|
||||
OBJS = ac3_parser.o \
|
||||
adts_parser.o \
|
||||
allcodecs.o \
|
||||
avcodec.o \
|
||||
avdct.o \
|
||||
avpacket.o \
|
||||
avpicture.o \
|
||||
@@ -38,7 +31,6 @@ OBJS = ac3_parser.o \
|
||||
bitstream_filters.o \
|
||||
bsf.o \
|
||||
codec_desc.o \
|
||||
codec_par.o \
|
||||
d3d11va.o \
|
||||
decode.o \
|
||||
dirac.o \
|
||||
@@ -50,6 +42,7 @@ OBJS = ac3_parser.o \
|
||||
mediacodec.o \
|
||||
mpeg12framerate.o \
|
||||
options.o \
|
||||
mjpegenc_huffman.o \
|
||||
parser.o \
|
||||
parsers.o \
|
||||
profiles.o \
|
||||
@@ -65,15 +58,14 @@ OBJS-$(CONFIG_AC3DSP) += ac3dsp.o ac3.o ac3tab.o
|
||||
OBJS-$(CONFIG_ADTS_HEADER) += adts_header.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_AMF) += amfenc.o
|
||||
OBJS-$(CONFIG_AUDIO_FRAME_QUEUE) += audio_frame_queue.o
|
||||
OBJS-$(CONFIG_ATSC_A53) += atsc_a53.o
|
||||
OBJS-$(CONFIG_AUDIODSP) += audiodsp.o
|
||||
OBJS-$(CONFIG_BLOCKDSP) += blockdsp.o
|
||||
OBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
|
||||
OBJS-$(CONFIG_CABAC) += cabac.o
|
||||
OBJS-$(CONFIG_CBS) += cbs.o cbs_bsf.o
|
||||
OBJS-$(CONFIG_CBS) += cbs.o
|
||||
OBJS-$(CONFIG_CBS_AV1) += cbs_av1.o
|
||||
OBJS-$(CONFIG_CBS_H264) += cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_H265) += cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_H264) += cbs_h2645.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_H265) += cbs_h2645.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_JPEG) += cbs_jpeg.o
|
||||
OBJS-$(CONFIG_CBS_MPEG2) += cbs_mpeg2.o
|
||||
OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o
|
||||
@@ -84,9 +76,10 @@ OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o
|
||||
OBJS-$(CONFIG_FAANDCT) += faandct.o
|
||||
OBJS-$(CONFIG_FAANIDCT) += faanidct.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o
|
||||
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft_float.o fft_fixed_32.o \
|
||||
fft_init_table.o $(FFT-OBJS-yes)
|
||||
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
|
||||
fft_fixed_32.o fft_init_table.o \
|
||||
$(FFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_FLACDSP) += flacdsp.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o
|
||||
OBJS-$(CONFIG_GOLOMB) += golomb.o
|
||||
@@ -96,8 +89,7 @@ OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o
|
||||
OBJS-$(CONFIG_H264PARSE) += h264_parse.o h2645_parse.o h264_ps.o
|
||||
OBJS-$(CONFIG_H264PRED) += h264pred.o
|
||||
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
|
||||
OBJS-$(CONFIG_HEVCPARSE) += hevc_parse.o h2645_parse.o hevc_ps.o hevc_sei.o hevc_data.o \
|
||||
dynamic_hdr10_plus.o
|
||||
OBJS-$(CONFIG_HEVCPARSE) += hevc_parse.o h2645_parse.o hevc_ps.o hevc_sei.o hevc_data.o
|
||||
OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
|
||||
OBJS-$(CONFIG_HUFFMAN) += huffman.o
|
||||
OBJS-$(CONFIG_HUFFYUVDSP) += huffyuvdsp.o
|
||||
@@ -115,11 +107,11 @@ OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o
|
||||
OBJS-$(CONFIG_LPC) += lpc.o
|
||||
OBJS-$(CONFIG_LSP) += lsp.o
|
||||
OBJS-$(CONFIG_LZF) += lzf.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct_float.o mdct_fixed_32.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_32.o
|
||||
OBJS-$(CONFIG_ME_CMP) += me_cmp.o
|
||||
OBJS-$(CONFIG_MEDIACODEC) += mediacodecdec_common.o mediacodec_surface.o mediacodec_wrapper.o mediacodec_sw_buffer.o
|
||||
OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodec_common.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o
|
||||
OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \
|
||||
mpegaudiodsp_data.o \
|
||||
mpegaudiodsp_fixed.o \
|
||||
@@ -142,7 +134,7 @@ OBJS-$(CONFIG_RANGECODER) += rangecoder.o
|
||||
OBJS-$(CONFIG_RDFT) += rdft.o
|
||||
OBJS-$(CONFIG_RV34DSP) += rv34dsp.o
|
||||
OBJS-$(CONFIG_SHARED) += log2_tab.o reverse.o
|
||||
OBJS-$(CONFIG_SINEWIN) += sinewin.o
|
||||
OBJS-$(CONFIG_SINEWIN) += sinewin.o sinewin_fixed.o
|
||||
OBJS-$(CONFIG_SNAPPY) += snappy.o
|
||||
OBJS-$(CONFIG_STARTCODE) += startcode.o
|
||||
OBJS-$(CONFIG_TEXTUREDSP) += texturedsp.o
|
||||
@@ -162,10 +154,10 @@ OBJS-$(CONFIG_WMV2DSP) += wmv2dsp.o
|
||||
OBJS-$(CONFIG_ZERO12V_DECODER) += 012v.o
|
||||
OBJS-$(CONFIG_A64MULTI_ENCODER) += a64multienc.o elbg.o
|
||||
OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o
|
||||
OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps_common.o aacps_float.o \
|
||||
OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps_float.o \
|
||||
mpeg4audio.o kbdwin.o \
|
||||
sbrdsp.o aacpsdsp_float.o cbrt_data.o
|
||||
OBJS-$(CONFIG_AAC_FIXED_DECODER) += aacdec_fixed.o aactab.o aacsbr_fixed.o aacps_common.o aacps_fixed.o \
|
||||
OBJS-$(CONFIG_AAC_FIXED_DECODER) += aacdec_fixed.o aactab.o aacsbr_fixed.o aacps_fixed.o \
|
||||
mpeg4audio.o kbdwin.o \
|
||||
sbrdsp_fixed.o aacpsdsp_fixed.o cbrt_data_fixed.o
|
||||
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacenctab.o \
|
||||
@@ -174,16 +166,13 @@ OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacenctab.o \
|
||||
aacenc_tns.o \
|
||||
aacenc_ltp.o \
|
||||
aacenc_pred.o \
|
||||
psymodel.o mpeg4audio.o kbdwin.o
|
||||
OBJS-$(CONFIG_AAC_MF_ENCODER) += mfenc.o mf_utils.o
|
||||
psymodel.o mpeg4audio.o kbdwin.o cbrt_data.o
|
||||
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
|
||||
OBJS-$(CONFIG_AC3_DECODER) += ac3dec_float.o ac3dec_data.o ac3.o kbdwin.o ac3tab.o
|
||||
OBJS-$(CONFIG_AC3_FIXED_DECODER) += ac3dec_fixed.o ac3dec_data.o ac3.o kbdwin.o ac3tab.o
|
||||
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \
|
||||
ac3.o kbdwin.o
|
||||
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o kbdwin.o
|
||||
OBJS-$(CONFIG_AC3_MF_ENCODER) += mfenc.o mf_utils.o
|
||||
OBJS-$(CONFIG_ACELP_KELVIN_DECODER) += g729dec.o lsp.o celp_math.o celp_filters.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o
|
||||
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o
|
||||
OBJS-$(CONFIG_AGM_DECODER) += agm.o
|
||||
OBJS-$(CONFIG_AIC_DECODER) += aic.o
|
||||
OBJS-$(CONFIG_ALAC_DECODER) += alac.o alac_data.o alacdsp.o
|
||||
@@ -204,14 +193,13 @@ OBJS-$(CONFIG_AMV_ENCODER) += mjpegenc.o mjpegenc_common.o \
|
||||
OBJS-$(CONFIG_ANM_DECODER) += anm.o
|
||||
OBJS-$(CONFIG_ANSI_DECODER) += ansi.o cga_data.o
|
||||
OBJS-$(CONFIG_APE_DECODER) += apedec.o
|
||||
OBJS-$(CONFIG_APTX_DECODER) += aptxdec.o aptx.o
|
||||
OBJS-$(CONFIG_APTX_ENCODER) += aptxenc.o aptx.o
|
||||
OBJS-$(CONFIG_APTX_HD_DECODER) += aptxdec.o aptx.o
|
||||
OBJS-$(CONFIG_APTX_HD_ENCODER) += aptxenc.o aptx.o
|
||||
OBJS-$(CONFIG_APTX_DECODER) += aptx.o
|
||||
OBJS-$(CONFIG_APTX_ENCODER) += aptx.o
|
||||
OBJS-$(CONFIG_APTX_HD_DECODER) += aptx.o
|
||||
OBJS-$(CONFIG_APTX_HD_ENCODER) += aptx.o
|
||||
OBJS-$(CONFIG_APNG_DECODER) += png.o pngdec.o pngdsp.o
|
||||
OBJS-$(CONFIG_APNG_ENCODER) += png.o pngenc.o
|
||||
OBJS-$(CONFIG_ARBC_DECODER) += arbc.o
|
||||
OBJS-$(CONFIG_ARGO_DECODER) += argo.o
|
||||
OBJS-$(CONFIG_SSA_DECODER) += assdec.o ass.o
|
||||
OBJS-$(CONFIG_SSA_ENCODER) += assenc.o ass.o
|
||||
OBJS-$(CONFIG_ASS_DECODER) += assdec.o ass.o
|
||||
@@ -230,9 +218,7 @@ OBJS-$(CONFIG_ATRAC3PAL_DECODER) += atrac3plusdec.o atrac3plus.o \
|
||||
OBJS-$(CONFIG_ATRAC9_DECODER) += atrac9dec.o
|
||||
OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
|
||||
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
|
||||
OBJS-$(CONFIG_AV1_DECODER) += av1dec.o
|
||||
OBJS-$(CONFIG_AV1_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o
|
||||
OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o mjpegdec.o
|
||||
OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o
|
||||
OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o
|
||||
OBJS-$(CONFIG_AVS_DECODER) += avs.o
|
||||
@@ -255,12 +241,10 @@ OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o
|
||||
OBJS-$(CONFIG_C93_DECODER) += c93.o
|
||||
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
|
||||
cavsdata.o
|
||||
OBJS-$(CONFIG_CCAPTION_DECODER) += ccaption_dec.o ass.o
|
||||
OBJS-$(CONFIG_CCAPTION_DECODER) += ccaption_dec.o
|
||||
OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o
|
||||
OBJS-$(CONFIG_CDTOONS_DECODER) += cdtoons.o
|
||||
OBJS-$(CONFIG_CDXL_DECODER) += cdxl.o
|
||||
OBJS-$(CONFIG_CFHD_DECODER) += cfhd.o cfhddata.o cfhddsp.o
|
||||
OBJS-$(CONFIG_CFHD_ENCODER) += cfhdenc.o cfhddata.o cfhdencdsp.o
|
||||
OBJS-$(CONFIG_CFHD_DECODER) += cfhd.o cfhddata.o
|
||||
OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
|
||||
OBJS-$(CONFIG_CINEPAK_ENCODER) += cinepakenc.o elbg.o
|
||||
OBJS-$(CONFIG_CLEARVIDEO_DECODER) += clearvideo.o
|
||||
@@ -271,22 +255,20 @@ OBJS-$(CONFIG_COMFORTNOISE_DECODER) += cngdec.o celp_filters.o
|
||||
OBJS-$(CONFIG_COMFORTNOISE_ENCODER) += cngenc.o
|
||||
OBJS-$(CONFIG_COOK_DECODER) += cook.o
|
||||
OBJS-$(CONFIG_CPIA_DECODER) += cpia.o
|
||||
OBJS-$(CONFIG_CRI_DECODER) += cri.o
|
||||
OBJS-$(CONFIG_CSCD_DECODER) += cscd.o
|
||||
OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
|
||||
OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadata.o dcahuff.o \
|
||||
dca_core.o dca_exss.o dca_xll.o dca_lbr.o \
|
||||
dcadsp.o dcadct.o synth_filter.o
|
||||
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dcadata.o dcahuff.o \
|
||||
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dca.o dcadata.o dcahuff.o \
|
||||
dcaadpcm.o
|
||||
OBJS-$(CONFIG_DDS_DECODER) += dds.o
|
||||
OBJS-$(CONFIG_DERF_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o diractab.o \
|
||||
dirac_arith.o dirac_dwt.o dirac_vlc.o
|
||||
OBJS-$(CONFIG_DFA_DECODER) += dfa.o
|
||||
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
|
||||
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o
|
||||
OBJS-$(CONFIG_DOLBY_E_DECODER) += dolby_e.o dolby_e_parse.o kbdwin.o
|
||||
OBJS-$(CONFIG_DOLBY_E_DECODER) += dolby_e.o kbdwin.o
|
||||
OBJS-$(CONFIG_DPX_DECODER) += dpx.o
|
||||
OBJS-$(CONFIG_DPX_ENCODER) += dpxenc.o
|
||||
OBJS-$(CONFIG_DSD_LSBF_DECODER) += dsddec.o dsd.o
|
||||
@@ -298,9 +280,9 @@ OBJS-$(CONFIG_DSICINVIDEO_DECODER) += dsicinvideo.o
|
||||
OBJS-$(CONFIG_DSS_SP_DECODER) += dss_sp.o
|
||||
OBJS-$(CONFIG_DST_DECODER) += dstdec.o dsd.o
|
||||
OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o
|
||||
OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsubenc.o
|
||||
OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o dvdsub.o
|
||||
OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o dvdsub.o
|
||||
OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o
|
||||
OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o
|
||||
OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
|
||||
OBJS-$(CONFIG_DVAUDIO_DECODER) += dvaudiodec.o
|
||||
OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dvenc.o dv.o dvdata.o
|
||||
@@ -322,8 +304,6 @@ OBJS-$(CONFIG_ESCAPE124_DECODER) += escape124.o
|
||||
OBJS-$(CONFIG_ESCAPE130_DECODER) += escape130.o
|
||||
OBJS-$(CONFIG_EVRC_DECODER) += evrcdec.o acelp_vectors.o lsp.o
|
||||
OBJS-$(CONFIG_EXR_DECODER) += exr.o exrdsp.o
|
||||
OBJS-$(CONFIG_EXR_ENCODER) += exrenc.o
|
||||
OBJS-$(CONFIG_FASTAUDIO_DECODER) += fastaudio.o
|
||||
OBJS-$(CONFIG_FFV1_DECODER) += ffv1dec.o ffv1.o
|
||||
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1enc.o ffv1.o
|
||||
OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
|
||||
@@ -331,19 +311,17 @@ OBJS-$(CONFIG_FIC_DECODER) += fic.o
|
||||
OBJS-$(CONFIG_FITS_DECODER) += fitsdec.o fits.o
|
||||
OBJS-$(CONFIG_FITS_ENCODER) += fitsenc.o
|
||||
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o vorbis_data.o
|
||||
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
|
||||
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
|
||||
OBJS-$(CONFIG_FLASHSV2_ENCODER) += flashsv2enc.o
|
||||
OBJS-$(CONFIG_FLASHSV2_DECODER) += flashsv.o
|
||||
OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
|
||||
OBJS-$(CONFIG_FLV_DECODER) += flvdec.o
|
||||
OBJS-$(CONFIG_FLV_ENCODER) += flvenc.o
|
||||
OBJS-$(CONFIG_FMVC_DECODER) += fmvc.o
|
||||
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
|
||||
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
|
||||
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
|
||||
OBJS-$(CONFIG_G2M_DECODER) += g2meet.o elsdec.o mjpegdec_common.o
|
||||
OBJS-$(CONFIG_G2M_DECODER) += g2meet.o elsdec.o
|
||||
OBJS-$(CONFIG_G723_1_DECODER) += g723_1dec.o g723_1.o \
|
||||
acelp_vectors.o celp_filters.o celp_math.o
|
||||
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1enc.o g723_1.o \
|
||||
@@ -358,11 +336,10 @@ OBJS-$(CONFIG_GSM_MS_DECODER) += gsmdec.o gsmdec_data.o msgsmdec.o
|
||||
OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261data.o h261.o
|
||||
OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261data.o h261.o
|
||||
OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
|
||||
mpeg4video.o mpeg4videodec.o \
|
||||
h263data.o
|
||||
OBJS-$(CONFIG_H263I_DECODER) += intelh263dec.o
|
||||
OBJS-$(CONFIG_H263_ENCODER) += mpeg4video.o \
|
||||
h263.o ituh263enc.o h263data.o
|
||||
mpeg4video.o mpeg4videodec.o flvdec.o\
|
||||
intelh263dec.o h263data.o
|
||||
OBJS-$(CONFIG_H263_ENCODER) += mpeg4videoenc.o mpeg4video.o \
|
||||
h263.o ituh263enc.o flvenc.o h263data.o
|
||||
OBJS-$(CONFIG_H263_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
OBJS-$(CONFIG_H263_V4L2M2M_ENCODER) += v4l2_m2m_enc.o
|
||||
OBJS-$(CONFIG_H264_DECODER) += h264dec.o h264_cabac.o h264_cavlc.o \
|
||||
@@ -373,13 +350,12 @@ OBJS-$(CONFIG_H264_DECODER) += h264dec.o h264_cabac.o h264_cavlc.o \
|
||||
OBJS-$(CONFIG_H264_AMF_ENCODER) += amfenc_h264.o
|
||||
OBJS-$(CONFIG_H264_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_H264_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_H264_MF_ENCODER) += mfenc.o mf_utils.o
|
||||
OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o
|
||||
OBJS-$(CONFIG_H264_NVENC_ENCODER) += nvenc_h264.o
|
||||
OBJS-$(CONFIG_NVENC_ENCODER) += nvenc_h264.o
|
||||
OBJS-$(CONFIG_NVENC_H264_ENCODER) += nvenc_h264.o
|
||||
OBJS-$(CONFIG_H264_OMX_ENCODER) += omx.o
|
||||
OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec_h2645.o
|
||||
OBJS-$(CONFIG_H264_QSV_ENCODER) += qsvenc_h264.o
|
||||
OBJS-$(CONFIG_H264_RKMPP_DECODER) += rkmppdec.o
|
||||
OBJS-$(CONFIG_H264_VAAPI_ENCODER) += vaapi_encode_h264.o h264_levels.o
|
||||
@@ -388,7 +364,6 @@ OBJS-$(CONFIG_H264_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
OBJS-$(CONFIG_H264_V4L2M2M_ENCODER) += v4l2_m2m_enc.o
|
||||
OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o
|
||||
OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o
|
||||
OBJS-$(CONFIG_HCA_DECODER) += hcadec.o
|
||||
OBJS-$(CONFIG_HCOM_DECODER) += hcom.o
|
||||
OBJS-$(CONFIG_HEVC_DECODER) += hevcdec.o hevc_mvs.o \
|
||||
hevc_cabac.o hevc_refs.o hevcpred.o \
|
||||
@@ -396,10 +371,9 @@ OBJS-$(CONFIG_HEVC_DECODER) += hevcdec.o hevc_mvs.o \
|
||||
OBJS-$(CONFIG_HEVC_AMF_ENCODER) += amfenc_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_HEVC_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_HEVC_MF_ENCODER) += mfenc.o mf_utils.o
|
||||
OBJS-$(CONFIG_HEVC_NVENC_ENCODER) += nvenc_hevc.o
|
||||
OBJS-$(CONFIG_NVENC_HEVC_ENCODER) += nvenc_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_DECODER) += qsvdec_h2645.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_ENCODER) += qsvenc_hevc.o hevc_ps_enc.o \
|
||||
hevc_data.o
|
||||
OBJS-$(CONFIG_HEVC_RKMPP_DECODER) += rkmppdec.o
|
||||
@@ -419,7 +393,6 @@ OBJS-$(CONFIG_IFF_ILBM_DECODER) += iff.o
|
||||
OBJS-$(CONFIG_ILBC_DECODER) += ilbcdec.o
|
||||
OBJS-$(CONFIG_IMC_DECODER) += imc.o
|
||||
OBJS-$(CONFIG_IMM4_DECODER) += imm4.o
|
||||
OBJS-$(CONFIG_IMM5_DECODER) += imm5.o
|
||||
OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
|
||||
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
|
||||
OBJS-$(CONFIG_INDEO4_DECODER) += indeo4.o ivi.o
|
||||
@@ -427,7 +400,6 @@ OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi.o
|
||||
OBJS-$(CONFIG_INTERPLAY_ACM_DECODER) += interplayacm.o
|
||||
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
|
||||
OBJS-$(CONFIG_IPU_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_JACOSUB_DECODER) += jacosubdec.o ass.o
|
||||
OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o jpeg2000.o \
|
||||
jpeg2000dwt.o
|
||||
@@ -441,7 +413,7 @@ OBJS-$(CONFIG_KMVC_DECODER) += kmvc.o
|
||||
OBJS-$(CONFIG_LAGARITH_DECODER) += lagarith.o lagarithrac.o
|
||||
OBJS-$(CONFIG_LJPEG_ENCODER) += ljpegenc.o mjpegenc_common.o
|
||||
OBJS-$(CONFIG_LOCO_DECODER) += loco.o
|
||||
OBJS-$(CONFIG_LSCR_DECODER) += lscrdec.o png.o pngdec.o pngdsp.o
|
||||
OBJS-$(CONFIG_LSCR_DECODER) += png.o pngdec.o pngdsp.o
|
||||
OBJS-$(CONFIG_M101_DECODER) += m101.o
|
||||
OBJS-$(CONFIG_MACE3_DECODER) += mace.o
|
||||
OBJS-$(CONFIG_MACE6_DECODER) += mace.o
|
||||
@@ -452,8 +424,7 @@ OBJS-$(CONFIG_METASOUND_DECODER) += metasound.o metasound_data.o \
|
||||
twinvq.o
|
||||
OBJS-$(CONFIG_MICRODVD_DECODER) += microdvddec.o ass.o
|
||||
OBJS-$(CONFIG_MIMIC_DECODER) += mimic.o
|
||||
OBJS-$(CONFIG_MJPEG_DECODER) += mjpegdec.o mjpegdec_common.o
|
||||
OBJS-$(CONFIG_MJPEG_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_MJPEG_DECODER) += mjpegdec.o
|
||||
OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpegenc_common.o \
|
||||
mjpegenc_huffman.o
|
||||
OBJS-$(CONFIG_MJPEGB_DECODER) += mjpegbdec.o
|
||||
@@ -463,7 +434,6 @@ OBJS-$(CONFIG_MJPEG_VAAPI_ENCODER) += vaapi_encode_mjpeg.o
|
||||
OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlpdsp.o
|
||||
OBJS-$(CONFIG_MLP_ENCODER) += mlpenc.o mlp.o
|
||||
OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o
|
||||
OBJS-$(CONFIG_MOBICLIP_DECODER) += mobiclip.o
|
||||
OBJS-$(CONFIG_MOTIONPIXELS_DECODER) += motionpixels.o
|
||||
OBJS-$(CONFIG_MOVTEXT_DECODER) += movtextdec.o ass.o
|
||||
OBJS-$(CONFIG_MOVTEXT_ENCODER) += movtextenc.o ass_split.o
|
||||
@@ -476,7 +446,6 @@ OBJS-$(CONFIG_MP2FIXED_ENCODER) += mpegaudioenc_fixed.o mpegaudio.o \
|
||||
mpegaudiodata.o mpegaudiodsp_data.o
|
||||
OBJS-$(CONFIG_MP2FLOAT_DECODER) += mpegaudiodec_float.o
|
||||
OBJS-$(CONFIG_MP3_DECODER) += mpegaudiodec_fixed.o
|
||||
OBJS-$(CONFIG_MP3_MF_ENCODER) += mfenc.o mf_utils.o
|
||||
OBJS-$(CONFIG_MP3ADU_DECODER) += mpegaudiodec_fixed.o
|
||||
OBJS-$(CONFIG_MP3ADUFLOAT_DECODER) += mpegaudiodec_float.o
|
||||
OBJS-$(CONFIG_MP3FLOAT_DECODER) += mpegaudiodec_float.o
|
||||
@@ -490,7 +459,7 @@ OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG1_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_MPEG1_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
OBJS-$(CONFIG_MPEG2_MMAL_DECODER) += mmaldec.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_DECODER) += qsvdec_other.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_ENCODER) += qsvenc_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
@@ -499,7 +468,6 @@ OBJS-$(CONFIG_MPEG2_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_ENCODER) += vaapi_encode_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
OBJS-$(CONFIG_MPEG4_DECODER) += xvididct.o
|
||||
OBJS-$(CONFIG_MPEG4_ENCODER) += mpeg4videoenc.o
|
||||
OBJS-$(CONFIG_MPEG4_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_MPEG4_OMX_ENCODER) += omx.o
|
||||
@@ -513,7 +481,6 @@ OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSP2_DECODER) += msp2dec.o
|
||||
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
|
||||
OBJS-$(CONFIG_MSS1_DECODER) += mss1.o mss12.o
|
||||
OBJS-$(CONFIG_MSS2_DECODER) += mss2.o mss12.o mss2dsp.o wmv2data.o
|
||||
@@ -521,23 +488,19 @@ OBJS-$(CONFIG_MSVIDEO1_DECODER) += msvideo1.o
|
||||
OBJS-$(CONFIG_MSVIDEO1_ENCODER) += msvideo1enc.o elbg.o
|
||||
OBJS-$(CONFIG_MSZH_DECODER) += lcldec.o
|
||||
OBJS-$(CONFIG_MTS2_DECODER) += mss4.o
|
||||
OBJS-$(CONFIG_MV30_DECODER) += mv30.o
|
||||
OBJS-$(CONFIG_MVC1_DECODER) += mvcdec.o
|
||||
OBJS-$(CONFIG_MVC2_DECODER) += mvcdec.o
|
||||
OBJS-$(CONFIG_MVDV_DECODER) += midivid.o
|
||||
OBJS-$(CONFIG_MVHA_DECODER) += mvha.o
|
||||
OBJS-$(CONFIG_MWSC_DECODER) += mwsc.o
|
||||
OBJS-$(CONFIG_MXPEG_DECODER) += mxpegdec.o
|
||||
OBJS-$(CONFIG_NELLYMOSER_DECODER) += nellymoserdec.o nellymoser.o
|
||||
OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o
|
||||
OBJS-$(CONFIG_NOTCHLC_DECODER) += notchlc.o
|
||||
OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
|
||||
OBJS-$(CONFIG_ON2AVC_DECODER) += on2avc.o on2avcdata.o
|
||||
OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opus.o opus_celt.o opus_rc.o \
|
||||
opus_pvq.o opus_silk.o opustab.o vorbis_data.o \
|
||||
opusdsp.o
|
||||
OBJS-$(CONFIG_OPUS_ENCODER) += opusenc.o opus.o opus_rc.o opustab.o opus_pvq.o \
|
||||
opusenc_psy.o vorbis_data.o
|
||||
opusenc_psy.o
|
||||
OBJS-$(CONFIG_PAF_AUDIO_DECODER) += pafaudio.o
|
||||
OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o
|
||||
OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o
|
||||
@@ -546,15 +509,11 @@ OBJS-$(CONFIG_PBM_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PBM_ENCODER) += pnmenc.o
|
||||
OBJS-$(CONFIG_PCX_DECODER) += pcx.o
|
||||
OBJS-$(CONFIG_PCX_ENCODER) += pcxenc.o
|
||||
OBJS-$(CONFIG_PFM_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PFM_ENCODER) += pnmenc.o
|
||||
OBJS-$(CONFIG_PGM_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o
|
||||
OBJS-$(CONFIG_PGMYUV_DECODER) += pnmdec.o pnm.o
|
||||
OBJS-$(CONFIG_PGMYUV_ENCODER) += pnmenc.o
|
||||
OBJS-$(CONFIG_PGSSUB_DECODER) += pgssubdec.o
|
||||
OBJS-$(CONFIG_PGX_DECODER) += pgxdec.o
|
||||
OBJS-$(CONFIG_PHOTOCD_DECODER) += photocd.o
|
||||
OBJS-$(CONFIG_PICTOR_DECODER) += pictordec.o cga_data.o
|
||||
OBJS-$(CONFIG_PIXLET_DECODER) += pixlet.o
|
||||
OBJS-$(CONFIG_PJS_DECODER) += textdec.o ass.o
|
||||
@@ -596,7 +555,6 @@ 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_RPZA_ENCODER) += rpzaenc.o
|
||||
OBJS-$(CONFIG_RSCC_DECODER) += rscc.o
|
||||
OBJS-$(CONFIG_RV10_DECODER) += rv10.o
|
||||
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
|
||||
@@ -611,7 +569,6 @@ OBJS-$(CONFIG_SANM_DECODER) += sanm.o
|
||||
OBJS-$(CONFIG_SCPR_DECODER) += scpr.o
|
||||
OBJS-$(CONFIG_SCREENPRESSO_DECODER) += screenpresso.o
|
||||
OBJS-$(CONFIG_SDX2_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_SGA_DECODER) += sga.o
|
||||
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
|
||||
OBJS-$(CONFIG_SGI_ENCODER) += sgienc.o rle.o
|
||||
OBJS-$(CONFIG_SGIRLE_DECODER) += sgirledec.o
|
||||
@@ -621,20 +578,18 @@ 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_SIREN_DECODER) += siren.o
|
||||
OBJS-$(CONFIG_SIMBIOSIS_IMX_DECODER) += imx.o
|
||||
OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
|
||||
OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
|
||||
OBJS-$(CONFIG_SMC_DECODER) += smc.o
|
||||
OBJS-$(CONFIG_SMVJPEG_DECODER) += smvjpegdec.o
|
||||
OBJS-$(CONFIG_SNOW_DECODER) += snowdec.o snow.o snow_dwt.o
|
||||
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o snow_dwt.o \
|
||||
h263.o h263data.o ituh263enc.o
|
||||
h263.o ituh263enc.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_SPEEDHQ_DECODER) += speedhq.o mpeg12.o mpeg12data.o simple_idct.o
|
||||
OBJS-$(CONFIG_SPEEDHQ_ENCODER) += speedhq.o mpeg12data.o mpeg12enc.o speedhqenc.o
|
||||
OBJS-$(CONFIG_SP5X_DECODER) += sp5xdec.o
|
||||
OBJS-$(CONFIG_SRGC_DECODER) += mscc.o
|
||||
OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o htmlsubtitles.o
|
||||
@@ -649,10 +604,10 @@ OBJS-$(CONFIG_SUNRAST_ENCODER) += sunrastenc.o
|
||||
OBJS-$(CONFIG_LIBRSVG_DECODER) += librsvgdec.o
|
||||
OBJS-$(CONFIG_SBC_DECODER) += sbcdec.o sbcdec_data.o sbc.o
|
||||
OBJS-$(CONFIG_SBC_ENCODER) += sbcenc.o sbc.o sbcdsp.o sbcdsp_data.o
|
||||
OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263data.o
|
||||
OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o svq13.o h263data.o
|
||||
OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o h263data.o \
|
||||
h263.o ituh263enc.o
|
||||
OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o mpegutils.o h264data.o
|
||||
OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o svq13.o mpegutils.o h264data.o
|
||||
OBJS-$(CONFIG_TEXT_DECODER) += textdec.o ass.o
|
||||
OBJS-$(CONFIG_TEXT_ENCODER) += srtenc.o ass_split.o
|
||||
OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o takdsp.o
|
||||
@@ -661,8 +616,8 @@ OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o
|
||||
OBJS-$(CONFIG_TARGA_Y216_DECODER) += targa_y216dec.o
|
||||
OBJS-$(CONFIG_TDSC_DECODER) += tdsc.o
|
||||
OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
|
||||
OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o faxcompr.o tiff_common.o
|
||||
OBJS-$(CONFIG_TIFF_ENCODER) += tiffenc.o rle.o lzwenc.o
|
||||
OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o faxcompr.o tiff_data.o tiff_common.o
|
||||
OBJS-$(CONFIG_TIFF_ENCODER) += tiffenc.o rle.o lzwenc.o tiff_data.o
|
||||
OBJS-$(CONFIG_TMV_DECODER) += tmv.o cga_data.o
|
||||
OBJS-$(CONFIG_TRUEHD_DECODER) += mlpdec.o mlpdsp.o
|
||||
OBJS-$(CONFIG_TRUEHD_ENCODER) += mlpenc.o mlp.o
|
||||
@@ -674,12 +629,11 @@ OBJS-$(CONFIG_TSCC_DECODER) += tscc.o msrledec.o
|
||||
OBJS-$(CONFIG_TSCC2_DECODER) += tscc2.o
|
||||
OBJS-$(CONFIG_TTA_DECODER) += tta.o ttadata.o ttadsp.o
|
||||
OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttaencdsp.o ttadata.o
|
||||
OBJS-$(CONFIG_TTML_ENCODER) += ttmlenc.o ass_split.o
|
||||
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o metasound_data.o
|
||||
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o
|
||||
OBJS-$(CONFIG_TXD_DECODER) += txd.o
|
||||
OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
|
||||
OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideodsp.o
|
||||
OBJS-$(CONFIG_UTVIDEO_ENCODER) += utvideoenc.o
|
||||
OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideo.o utvideodsp.o
|
||||
OBJS-$(CONFIG_UTVIDEO_ENCODER) += utvideoenc.o utvideo.o
|
||||
OBJS-$(CONFIG_V210_DECODER) += v210dec.o
|
||||
OBJS-$(CONFIG_V210_ENCODER) += v210enc.o
|
||||
OBJS-$(CONFIG_V210X_DECODER) += v210x.o
|
||||
@@ -697,7 +651,7 @@ OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o
|
||||
wmv2dsp.o wmv2data.o
|
||||
OBJS-$(CONFIG_VC1_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_VC1_MMAL_DECODER) += mmaldec.o
|
||||
OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec_other.o
|
||||
OBJS-$(CONFIG_VC1_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
OBJS-$(CONFIG_VC2_ENCODER) += vc2enc.o vc2enc_dwt.o diractab.o
|
||||
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
|
||||
@@ -716,7 +670,7 @@ OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP8_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_VP8_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_VP8_QSV_DECODER) += qsvdec_other.o
|
||||
OBJS-$(CONFIG_VP8_RKMPP_DECODER) += rkmppdec.o
|
||||
OBJS-$(CONFIG_VP8_VAAPI_ENCODER) += vaapi_encode_vp8.o
|
||||
OBJS-$(CONFIG_VP8_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
@@ -728,12 +682,11 @@ OBJS-$(CONFIG_VP9_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_VP9_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_VP9_RKMPP_DECODER) += rkmppdec.o
|
||||
OBJS-$(CONFIG_VP9_VAAPI_ENCODER) += vaapi_encode_vp9.o
|
||||
OBJS-$(CONFIG_VP9_QSV_ENCODER) += qsvenc_vp9.o
|
||||
OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o
|
||||
OBJS-$(CONFIG_VP9_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
|
||||
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o wavpackdata.o dsd.o
|
||||
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackdata.o wavpackenc.o
|
||||
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
|
||||
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackenc.o
|
||||
OBJS-$(CONFIG_WCMV_DECODER) += wcmv.o
|
||||
OBJS-$(CONFIG_WEBP_DECODER) += webp.o
|
||||
OBJS-$(CONFIG_WEBVTT_DECODER) += webvttdec.o ass.o
|
||||
@@ -748,7 +701,7 @@ OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
|
||||
celp_filters.o \
|
||||
acelp_vectors.o acelp_filters.o
|
||||
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV1_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV1_ENCODER) += msmpeg4enc.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2data.o \
|
||||
msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2data.o \
|
||||
@@ -834,7 +787,6 @@ OBJS-$(CONFIG_PCM_S64BE_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_S64BE_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_S64LE_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_S64LE_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_SGA_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_U8_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_U8_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_U16BE_DECODER) += pcm.o
|
||||
@@ -851,6 +803,7 @@ OBJS-$(CONFIG_PCM_U32LE_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_U32LE_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_VIDC_DECODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_VIDC_ENCODER) += pcm.o
|
||||
OBJS-$(CONFIG_PCM_ZORK_DECODER) += pcm.o
|
||||
|
||||
OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o
|
||||
@@ -858,8 +811,6 @@ OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o adx.o
|
||||
OBJS-$(CONFIG_ADPCM_AFC_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_AGM_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_AICA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_ARGO_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_ARGO_ENCODER) += adpcm.o adpcmenc.o
|
||||
OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_DTK_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o
|
||||
@@ -875,26 +826,17 @@ OBJS-$(CONFIG_ADPCM_G726_ENCODER) += g726.o
|
||||
OBJS-$(CONFIG_ADPCM_G726LE_DECODER) += g726.o
|
||||
OBJS-$(CONFIG_ADPCM_G726LE_ENCODER) += g726.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_ALP_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_ALP_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_APC_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_APM_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_APM_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_CUNNING_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_DAT4_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_MOFLEX_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_MTF_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_OKI_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_RAD_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_SSI_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_SSI_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
@@ -914,7 +856,6 @@ OBJS-$(CONFIG_ADPCM_VIMA_DECODER) += vima.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_ZORK_DECODER) += adpcm.o adpcm_data.o
|
||||
|
||||
# hardware accelerators
|
||||
OBJS-$(CONFIG_D3D11VA) += dxva2.o
|
||||
@@ -924,25 +865,21 @@ OBJS-$(CONFIG_VAAPI) += vaapi_decode.o
|
||||
OBJS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.o
|
||||
OBJS-$(CONFIG_VDPAU) += vdpau.o
|
||||
|
||||
OBJS-$(CONFIG_AV1_D3D11VA_HWACCEL) += dxva2_av1.o
|
||||
OBJS-$(CONFIG_AV1_DXVA2_HWACCEL) += dxva2_av1.o
|
||||
OBJS-$(CONFIG_AV1_NVDEC_HWACCEL) += nvdec_av1.o
|
||||
OBJS-$(CONFIG_AV1_VAAPI_HWACCEL) += vaapi_av1.o
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_H263_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
OBJS-$(CONFIG_H264_D3D11VA_HWACCEL) += dxva2_h264.o
|
||||
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
|
||||
OBJS-$(CONFIG_H264_NVDEC_HWACCEL) += nvdec_h264.o
|
||||
OBJS-$(CONFIG_H264_QSV_HWACCEL) += qsvdec.o
|
||||
OBJS-$(CONFIG_H264_QSV_HWACCEL) += qsvdec_h2645.o
|
||||
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
|
||||
OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
|
||||
OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL) += dxva2_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_NVDEC_HWACCEL) += nvdec_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_HWACCEL) += qsvdec.o
|
||||
OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o h265_profile_level.o
|
||||
OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o h265_profile_level.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_HWACCEL) += qsvdec_h2645.o
|
||||
OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
|
||||
OBJS-$(CONFIG_MJPEG_NVDEC_HWACCEL) += nvdec_mjpeg.o
|
||||
OBJS-$(CONFIG_MJPEG_VAAPI_HWACCEL) += vaapi_mjpeg.o
|
||||
OBJS-$(CONFIG_MPEG1_NVDEC_HWACCEL) += nvdec_mpeg12.o
|
||||
@@ -952,7 +889,7 @@ OBJS-$(CONFIG_MPEG1_XVMC_HWACCEL) += mpegvideo_xvmc.o
|
||||
OBJS-$(CONFIG_MPEG2_D3D11VA_HWACCEL) += dxva2_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_NVDEC_HWACCEL) += nvdec_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_HWACCEL) += qsvdec.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_HWACCEL) += qsvdec_other.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
@@ -964,7 +901,7 @@ OBJS-$(CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
OBJS-$(CONFIG_VC1_D3D11VA_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_NVDEC_HWACCEL) += nvdec_vc1.o
|
||||
OBJS-$(CONFIG_VC1_QSV_HWACCEL) += qsvdec.o
|
||||
OBJS-$(CONFIG_VC1_QSV_HWACCEL) += qsvdec_other.o
|
||||
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
|
||||
OBJS-$(CONFIG_VP8_NVDEC_HWACCEL) += nvdec_vp8.o
|
||||
@@ -973,25 +910,26 @@ OBJS-$(CONFIG_VP9_D3D11VA_HWACCEL) += dxva2_vp9.o
|
||||
OBJS-$(CONFIG_VP9_DXVA2_HWACCEL) += dxva2_vp9.o
|
||||
OBJS-$(CONFIG_VP9_NVDEC_HWACCEL) += nvdec_vp9.o
|
||||
OBJS-$(CONFIG_VP9_VAAPI_HWACCEL) += vaapi_vp9.o
|
||||
OBJS-$(CONFIG_VP9_VDPAU_HWACCEL) += vdpau_vp9.o
|
||||
OBJS-$(CONFIG_VP8_QSV_HWACCEL) += qsvdec.o
|
||||
OBJS-$(CONFIG_VP8_QSV_HWACCEL) += qsvdec_other.o
|
||||
|
||||
# libavformat dependencies
|
||||
OBJS-$(CONFIG_ISO_MEDIA) += mpeg4audio.o mpegaudiodata.o
|
||||
|
||||
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_CAF_DEMUXER) += ac3tab.o
|
||||
OBJS-$(CONFIG_CODEC2_DEMUXER) += codec2utils.o
|
||||
OBJS-$(CONFIG_CODEC2_MUXER) += codec2utils.o
|
||||
OBJS-$(CONFIG_CODEC2RAW_DEMUXER) += codec2utils.o
|
||||
OBJS-$(CONFIG_DNXHD_DEMUXER) += dnxhddata.o
|
||||
OBJS-$(CONFIG_FITS_DEMUXER) += fits.o
|
||||
OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_LATM_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_MATROSKA_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_MOV_DEMUXER) += ac3tab.o
|
||||
OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_MXF_MUXER) += dnxhddata.o
|
||||
OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
|
||||
OBJS-$(CONFIG_NUT_DEMUXER) += mpegaudiodata.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_RTP_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_SPDIF_MUXER) += dca.o
|
||||
OBJS-$(CONFIG_TAK_DEMUXER) += tak.o
|
||||
@@ -1050,14 +988,11 @@ OBJS-$(CONFIG_LIBOPUS_DECODER) += libopusdec.o libopus.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_LIBOPUS_ENCODER) += libopusenc.o libopus.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_LIBRAV1E_ENCODER) += librav1e.o
|
||||
OBJS-$(CONFIG_LIBSHINE_ENCODER) += libshine.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
||||
OBJS-$(CONFIG_LIBSVTAV1_ENCODER) += libsvtav1.o
|
||||
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
||||
OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
|
||||
OBJS-$(CONFIG_LIBUAVS3D_DECODER) += libuavs3d.o
|
||||
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \
|
||||
@@ -1066,6 +1001,7 @@ OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o
|
||||
OBJS-$(CONFIG_LIBWAVPACK_ENCODER) += libwavpackenc.o
|
||||
OBJS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.o libwebpenc.o
|
||||
OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER) += libwebpenc_common.o libwebpenc_animencoder.o
|
||||
OBJS-$(CONFIG_LIBX262_ENCODER) += libx264.o
|
||||
@@ -1084,21 +1020,19 @@ OBJS-$(CONFIG_AC3_PARSER) += ac3tab.o aac_ac3_parser.o
|
||||
OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o
|
||||
OBJS-$(CONFIG_AV1_PARSER) += av1_parser.o av1_parse.o
|
||||
OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o
|
||||
OBJS-$(CONFIG_AVS3_PARSER) += avs3_parser.o
|
||||
OBJS-$(CONFIG_BMP_PARSER) += bmp_parser.o
|
||||
OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
|
||||
OBJS-$(CONFIG_COOK_PARSER) += cook_parser.o
|
||||
OBJS-$(CONFIG_CRI_PARSER) += cri_parser.o
|
||||
OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o dca_exss.o dca.o
|
||||
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
|
||||
OBJS-$(CONFIG_DNXHD_PARSER) += dnxhd_parser.o dnxhddata.o
|
||||
OBJS-$(CONFIG_DOLBY_E_PARSER) += dolby_e_parser.o dolby_e_parse.o
|
||||
OBJS-$(CONFIG_DPX_PARSER) += dpx_parser.o
|
||||
OBJS-$(CONFIG_DVAUDIO_PARSER) += dvaudio_parser.o
|
||||
OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o
|
||||
OBJS-$(CONFIG_DVD_NAV_PARSER) += dvd_nav_parser.o
|
||||
OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
|
||||
OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_G723_1_PARSER) += g723_1_parser.o
|
||||
OBJS-$(CONFIG_G729_PARSER) += g729_parser.o
|
||||
OBJS-$(CONFIG_GIF_PARSER) += gif_parser.o
|
||||
@@ -1107,13 +1041,12 @@ OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
|
||||
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
|
||||
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264_sei.o h264data.o
|
||||
OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o hevc_data.o
|
||||
OBJS-$(CONFIG_IPU_PARSER) += ipu_parser.o
|
||||
OBJS-$(CONFIG_JPEG2000_PARSER) += jpeg2000_parser.o
|
||||
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
|
||||
OBJS-$(CONFIG_MLP_PARSER) += mlp_parse.o mlp_parser.o mlp.o
|
||||
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
|
||||
mpeg4videodec.o mpeg4video.o \
|
||||
ituh263dec.o h263dec.o h263data.o
|
||||
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
|
||||
mpeg12.o mpeg12data.o
|
||||
@@ -1131,14 +1064,11 @@ OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
|
||||
OBJS-$(CONFIG_VP3_PARSER) += vp3_parser.o
|
||||
OBJS-$(CONFIG_VP8_PARSER) += vp8_parser.o
|
||||
OBJS-$(CONFIG_VP9_PARSER) += vp9_parser.o
|
||||
OBJS-$(CONFIG_WEBP_PARSER) += webp_parser.o
|
||||
OBJS-$(CONFIG_XBM_PARSER) += xbm_parser.o
|
||||
OBJS-$(CONFIG_XMA_PARSER) += xma_parser.o
|
||||
|
||||
# bitstream filters
|
||||
OBJS-$(CONFIG_AAC_ADTSTOASC_BSF) += aac_adtstoasc_bsf.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_AV1_METADATA_BSF) += av1_metadata_bsf.o
|
||||
OBJS-$(CONFIG_AV1_FRAME_MERGE_BSF) += av1_frame_merge_bsf.o
|
||||
OBJS-$(CONFIG_AV1_FRAME_SPLIT_BSF) += av1_frame_split_bsf.o
|
||||
OBJS-$(CONFIG_CHOMP_BSF) += chomp_bsf.o
|
||||
OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += dump_extradata_bsf.o
|
||||
@@ -1163,11 +1093,8 @@ OBJS-$(CONFIG_MP3_HEADER_DECOMPRESS_BSF) += mp3_header_decompress_bsf.o \
|
||||
OBJS-$(CONFIG_MPEG2_METADATA_BSF) += mpeg2_metadata_bsf.o
|
||||
OBJS-$(CONFIG_NOISE_BSF) += noise_bsf.o
|
||||
OBJS-$(CONFIG_NULL_BSF) += null_bsf.o
|
||||
OBJS-$(CONFIG_OPUS_METADATA_BSF) += opus_metadata_bsf.o
|
||||
OBJS-$(CONFIG_PCM_RECHUNK_BSF) += pcm_rechunk_bsf.o
|
||||
OBJS-$(CONFIG_PRORES_METADATA_BSF) += prores_metadata_bsf.o
|
||||
OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF) += remove_extradata_bsf.o
|
||||
OBJS-$(CONFIG_SETTS_BSF) += setts_bsf.o
|
||||
OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
|
||||
OBJS-$(CONFIG_TRACE_HEADERS_BSF) += trace_headers_bsf.o
|
||||
OBJS-$(CONFIG_TRUEHD_CORE_BSF) += truehd_core_bsf.o mlp_parse.o mlp.o
|
||||
@@ -1203,13 +1130,13 @@ SKIPHEADERS-$(CONFIG_JNI) += ffjni.h
|
||||
SKIPHEADERS-$(CONFIG_LIBVPX) += libvpx.h
|
||||
SKIPHEADERS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.h
|
||||
SKIPHEADERS-$(CONFIG_MEDIACODEC) += mediacodecdec_common.h mediacodec_surface.h mediacodec_wrapper.h mediacodec_sw_buffer.h
|
||||
SKIPHEADERS-$(CONFIG_MEDIAFOUNDATION) += mf_utils.h
|
||||
SKIPHEADERS-$(CONFIG_NVDEC) += nvdec.h
|
||||
SKIPHEADERS-$(CONFIG_NVENC) += nvenc.h
|
||||
SKIPHEADERS-$(CONFIG_QSV) += qsv.h qsv_internal.h
|
||||
SKIPHEADERS-$(CONFIG_QSVDEC) += qsvdec.h
|
||||
SKIPHEADERS-$(CONFIG_QSVENC) += qsvenc.h
|
||||
SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
|
||||
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_decode.h vaapi_hevc.h vaapi_encode.h
|
||||
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_decode.h vaapi_encode.h
|
||||
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h
|
||||
SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h
|
||||
@@ -1221,15 +1148,16 @@ TESTPROGS = avpacket \
|
||||
imgconvert \
|
||||
jpeg2000dwt \
|
||||
mathops \
|
||||
options \
|
||||
mjpegenc_huffman \
|
||||
utils \
|
||||
|
||||
TESTPROGS-$(CONFIG_CABAC) += cabac
|
||||
TESTPROGS-$(CONFIG_DCT) += avfft
|
||||
TESTPROGS-$(CONFIG_FFT) += fft fft-fixed32
|
||||
TESTPROGS-$(CONFIG_FFT) += fft fft-fixed fft-fixed32
|
||||
TESTPROGS-$(CONFIG_GOLOMB) += golomb
|
||||
TESTPROGS-$(CONFIG_IDCTDSP) += dct
|
||||
TESTPROGS-$(CONFIG_IIRFILTER) += iirfilter
|
||||
TESTPROGS-$(CONFIG_MJPEG_ENCODER) += mjpegenc_huffman
|
||||
TESTPROGS-$(HAVE_MMX) += motion
|
||||
TESTPROGS-$(CONFIG_MPEGVIDEO) += mpeg12framerate
|
||||
TESTPROGS-$(CONFIG_H264_METADATA_BSF) += h264_levels
|
||||
@@ -1249,7 +1177,6 @@ HOSTPROGS = aacps_tablegen \
|
||||
dv_tablegen \
|
||||
motionpixels_tablegen \
|
||||
mpegaudio_tablegen \
|
||||
mpegaudiodec_common_tablegen \
|
||||
pcm_tablegen \
|
||||
qdm2_tablegen \
|
||||
sinewin_tablegen \
|
||||
@@ -1274,8 +1201,7 @@ endif
|
||||
|
||||
GEN_HEADERS = cbrt_tables.h cbrt_fixed_tables.h aacps_tables.h aacps_fixed_tables.h \
|
||||
dv_tables.h \
|
||||
sinewin_tables.h sinewin_fixed_tables.h mpegaudio_tables.h \
|
||||
mpegaudiodec_common_tables.h motionpixels_tables.h \
|
||||
sinewin_tables.h sinewin_fixed_tables.h mpegaudio_tables.h motionpixels_tables.h \
|
||||
pcm_tables.h qdm2_tables.h
|
||||
GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
|
||||
|
||||
@@ -1285,15 +1211,15 @@ $(GEN_HEADERS): $(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF)
|
||||
ifdef CONFIG_HARDCODED_TABLES
|
||||
$(SUBDIR)cbrt_data.o: $(SUBDIR)cbrt_tables.h
|
||||
$(SUBDIR)cbrt_data_fixed.o: $(SUBDIR)cbrt_fixed_tables.h
|
||||
$(SUBDIR)aacdec_fixed.o: $(SUBDIR)sinewin_fixed_tables.h
|
||||
$(SUBDIR)aacps_float.o: $(SUBDIR)aacps_tables.h
|
||||
$(SUBDIR)aacps_fixed.o: $(SUBDIR)aacps_fixed_tables.h
|
||||
$(SUBDIR)aactab_fixed.o: $(SUBDIR)aac_fixed_tables.h
|
||||
$(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
|
||||
$(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
|
||||
$(SUBDIR)mpegaudiodec_common.o: $(SUBDIR)mpegaudiodec_common_tables.h
|
||||
$(SUBDIR)mpegaudiodec_fixed.o: $(SUBDIR)mpegaudio_tables.h
|
||||
$(SUBDIR)mpegaudiodec_float.o: $(SUBDIR)mpegaudio_tables.h
|
||||
$(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h
|
||||
$(SUBDIR)qdm2.o: $(SUBDIR)qdm2_tables.h
|
||||
$(SUBDIR)sinewin.o: $(SUBDIR)sinewin_tables.h
|
||||
$(SUBDIR)sinewin_fixed.o: $(SUBDIR)sinewin_fixed_tables.h
|
||||
endif
|
||||
|
||||
@@ -407,7 +407,6 @@ AVCodec ff_a64multi_encoder = {
|
||||
.close = a64multi_close_encoder,
|
||||
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
|
||||
.capabilities = AV_CODEC_CAP_DELAY,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE,
|
||||
};
|
||||
#endif
|
||||
#if CONFIG_A64MULTI5_ENCODER
|
||||
@@ -422,6 +421,5 @@ AVCodec ff_a64multi5_encoder = {
|
||||
.close = a64multi_close_encoder,
|
||||
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
|
||||
.capabilities = AV_CODEC_CAP_DELAY,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "aac_defines.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "libavutil/fixed_dsp.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
#include "avcodec.h"
|
||||
#if !USE_FIXED
|
||||
#include "mdct15.h"
|
||||
@@ -357,7 +356,7 @@ struct AACContext {
|
||||
OutputConfiguration oc[2];
|
||||
int warned_num_aac_frames;
|
||||
int warned_960_sbr;
|
||||
unsigned warned_71_wide;
|
||||
|
||||
int warned_gain_control;
|
||||
|
||||
/* aacdec functions pointers */
|
||||
|
||||
@@ -89,7 +89,7 @@ get_next:
|
||||
the frame). */
|
||||
if (avctx->codec_id != AV_CODEC_ID_AAC) {
|
||||
avctx->sample_rate = s->sample_rate;
|
||||
if (!CONFIG_EAC3_DECODER || avctx->codec_id != AV_CODEC_ID_EAC3) {
|
||||
if (avctx->codec_id != AV_CODEC_ID_EAC3) {
|
||||
avctx->channels = s->channels;
|
||||
avctx->channel_layout = s->channel_layout;
|
||||
}
|
||||
@@ -97,12 +97,8 @@ get_next:
|
||||
avctx->audio_service_type = s->service_type;
|
||||
}
|
||||
|
||||
/* Calculate the average bit rate */
|
||||
s->frame_number++;
|
||||
if (!CONFIG_EAC3_DECODER || avctx->codec_id != AV_CODEC_ID_EAC3) {
|
||||
avctx->bit_rate +=
|
||||
(s->bit_rate - avctx->bit_rate) / s->frame_number;
|
||||
}
|
||||
if (avctx->codec_id != AV_CODEC_ID_EAC3)
|
||||
avctx->bit_rate = s->bit_rate;
|
||||
}
|
||||
|
||||
return i;
|
||||
|
||||
@@ -55,7 +55,6 @@ typedef struct AACAC3ParseContext {
|
||||
uint64_t state;
|
||||
|
||||
int need_next_header;
|
||||
int frame_number;
|
||||
enum AVCodecID codec_id;
|
||||
} AACAC3ParseContext;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
#include "adts_header.h"
|
||||
#include "adts_parser.h"
|
||||
#include "avcodec.h"
|
||||
#include "bsf.h"
|
||||
#include "bsf_internal.h"
|
||||
#include "put_bits.h"
|
||||
#include "get_bits.h"
|
||||
#include "mpeg4audio.h"
|
||||
@@ -134,8 +134,8 @@ static int aac_adtstoasc_init(AVBSFContext *ctx)
|
||||
/* Validate the extradata if the stream is already MPEG-4 AudioSpecificConfig */
|
||||
if (ctx->par_in->extradata) {
|
||||
MPEG4AudioConfig mp4ac;
|
||||
int ret = avpriv_mpeg4audio_get_config2(&mp4ac, ctx->par_in->extradata,
|
||||
ctx->par_in->extradata_size, 1, ctx);
|
||||
int ret = avpriv_mpeg4audio_get_config(&mp4ac, ctx->par_in->extradata,
|
||||
ctx->par_in->extradata_size * 8, 1);
|
||||
if (ret < 0) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Error parsing AudioSpecificConfig extradata!\n");
|
||||
return ret;
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#define AAC_RENAME(x) x ## _fixed
|
||||
#define AAC_RENAME_32(x) x ## _fixed_32
|
||||
#define AAC_RENAME2(x) x ## _fixed
|
||||
typedef int INTFLOAT;
|
||||
typedef unsigned UINTFLOAT; ///< Equivalent to INTFLOAT, Used as temporal cast to avoid undefined sign overflow operations.
|
||||
typedef int64_t INT64FLOAT;
|
||||
@@ -84,7 +83,6 @@ typedef int AAC_SIGNE;
|
||||
|
||||
#define AAC_RENAME(x) x
|
||||
#define AAC_RENAME_32(x) x
|
||||
#define AAC_RENAME2(x) ff_ ## x
|
||||
typedef float INTFLOAT;
|
||||
typedef float UINTFLOAT;
|
||||
typedef float INT64FLOAT;
|
||||
|
||||
@@ -69,11 +69,6 @@
|
||||
# include "mips/aacdec_mips.h"
|
||||
#endif
|
||||
|
||||
DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_120))[120];
|
||||
DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_960))[960];
|
||||
DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_long_960))[960];
|
||||
DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_short_120))[120];
|
||||
|
||||
static av_always_inline void reset_predict_state(PredictorState *ps)
|
||||
{
|
||||
ps->r0 = 0.0f;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
#include "fft.h"
|
||||
#include "lpc.h"
|
||||
#include "kbdwin.h"
|
||||
#include "sinewin_fixed_tablegen.h"
|
||||
#include "sinewin.h"
|
||||
|
||||
#include "aac.h"
|
||||
#include "aactab.h"
|
||||
@@ -86,9 +86,6 @@
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_long_1024))[1024];
|
||||
DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_short_128))[128];
|
||||
|
||||
static av_always_inline void reset_predict_state(PredictorState *ps)
|
||||
{
|
||||
ps->r0.mant = 0;
|
||||
@@ -158,9 +155,9 @@ static void vector_pow43(int *coefs, int len)
|
||||
for (i=0; i<len; i++) {
|
||||
coef = coefs[i];
|
||||
if (coef < 0)
|
||||
coef = -(int)ff_cbrt_tab_fixed[(-coef) & 8191];
|
||||
coef = -(int)ff_cbrt_tab_fixed[-coef];
|
||||
else
|
||||
coef = (int)ff_cbrt_tab_fixed[ coef & 8191];
|
||||
coef = (int)ff_cbrt_tab_fixed[coef];
|
||||
coefs[i] = coef;
|
||||
}
|
||||
}
|
||||
@@ -464,7 +461,7 @@ AVCodec ff_aac_fixed_decoder = {
|
||||
AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE
|
||||
},
|
||||
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
|
||||
.channel_layouts = aac_channel_layout,
|
||||
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
|
||||
.flush = flush,
|
||||
|
||||
@@ -198,7 +198,7 @@ struct elem_to_channel {
|
||||
|
||||
static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
|
||||
uint8_t (*layout_map)[3], int offset, uint64_t left,
|
||||
uint64_t right, int pos, uint64_t *layout)
|
||||
uint64_t right, int pos)
|
||||
{
|
||||
if (layout_map[offset][0] == TYPE_CPE) {
|
||||
e2c_vec[offset] = (struct elem_to_channel) {
|
||||
@@ -207,9 +207,6 @@ static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
|
||||
.elem_id = layout_map[offset][1],
|
||||
.aac_position = pos
|
||||
};
|
||||
if (e2c_vec[offset].av_position != UINT64_MAX)
|
||||
*layout |= e2c_vec[offset].av_position;
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
e2c_vec[offset] = (struct elem_to_channel) {
|
||||
@@ -224,12 +221,6 @@ static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
|
||||
.elem_id = layout_map[offset + 1][1],
|
||||
.aac_position = pos
|
||||
};
|
||||
if (left != UINT64_MAX)
|
||||
*layout |= left;
|
||||
|
||||
if (right != UINT64_MAX)
|
||||
*layout |= right;
|
||||
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
@@ -266,13 +257,12 @@ static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos,
|
||||
return num_pos_channels;
|
||||
}
|
||||
|
||||
#define PREFIX_FOR_22POINT2 (AV_CH_LAYOUT_7POINT1_WIDE_BACK|AV_CH_BACK_CENTER|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_LOW_FREQUENCY_2)
|
||||
static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
{
|
||||
int i, n, total_non_cc_elements;
|
||||
struct elem_to_channel e2c_vec[4 * MAX_ELEM_ID] = { { 0 } };
|
||||
int num_front_channels, num_side_channels, num_back_channels;
|
||||
uint64_t layout = 0;
|
||||
uint64_t layout;
|
||||
|
||||
if (FF_ARRAY_ELEMS(e2c_vec) < tags)
|
||||
return 0;
|
||||
@@ -304,7 +294,6 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
.elem_id = layout_map[i][1],
|
||||
.aac_position = AAC_CHANNEL_FRONT
|
||||
};
|
||||
layout |= e2c_vec[i].av_position;
|
||||
i++;
|
||||
num_front_channels--;
|
||||
}
|
||||
@@ -312,21 +301,21 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
AV_CH_FRONT_LEFT_OF_CENTER,
|
||||
AV_CH_FRONT_RIGHT_OF_CENTER,
|
||||
AAC_CHANNEL_FRONT, &layout);
|
||||
AAC_CHANNEL_FRONT);
|
||||
num_front_channels -= 2;
|
||||
}
|
||||
if (num_front_channels >= 2) {
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
AV_CH_FRONT_LEFT,
|
||||
AV_CH_FRONT_RIGHT,
|
||||
AAC_CHANNEL_FRONT, &layout);
|
||||
AAC_CHANNEL_FRONT);
|
||||
num_front_channels -= 2;
|
||||
}
|
||||
while (num_front_channels >= 2) {
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
UINT64_MAX,
|
||||
UINT64_MAX,
|
||||
AAC_CHANNEL_FRONT, &layout);
|
||||
AAC_CHANNEL_FRONT);
|
||||
num_front_channels -= 2;
|
||||
}
|
||||
|
||||
@@ -334,14 +323,14 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
AV_CH_SIDE_LEFT,
|
||||
AV_CH_SIDE_RIGHT,
|
||||
AAC_CHANNEL_FRONT, &layout);
|
||||
AAC_CHANNEL_FRONT);
|
||||
num_side_channels -= 2;
|
||||
}
|
||||
while (num_side_channels >= 2) {
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
UINT64_MAX,
|
||||
UINT64_MAX,
|
||||
AAC_CHANNEL_SIDE, &layout);
|
||||
AAC_CHANNEL_SIDE);
|
||||
num_side_channels -= 2;
|
||||
}
|
||||
|
||||
@@ -349,14 +338,14 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
UINT64_MAX,
|
||||
UINT64_MAX,
|
||||
AAC_CHANNEL_BACK, &layout);
|
||||
AAC_CHANNEL_BACK);
|
||||
num_back_channels -= 2;
|
||||
}
|
||||
if (num_back_channels >= 2) {
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
AV_CH_BACK_LEFT,
|
||||
AV_CH_BACK_RIGHT,
|
||||
AAC_CHANNEL_BACK, &layout);
|
||||
AAC_CHANNEL_BACK);
|
||||
num_back_channels -= 2;
|
||||
}
|
||||
if (num_back_channels) {
|
||||
@@ -366,7 +355,6 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
.elem_id = layout_map[i][1],
|
||||
.aac_position = AAC_CHANNEL_BACK
|
||||
};
|
||||
layout |= e2c_vec[i].av_position;
|
||||
i++;
|
||||
num_back_channels--;
|
||||
}
|
||||
@@ -378,17 +366,6 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
.elem_id = layout_map[i][1],
|
||||
.aac_position = AAC_CHANNEL_LFE
|
||||
};
|
||||
layout |= e2c_vec[i].av_position;
|
||||
i++;
|
||||
}
|
||||
if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
|
||||
e2c_vec[i] = (struct elem_to_channel) {
|
||||
.av_position = AV_CH_LOW_FREQUENCY_2,
|
||||
.syn_ele = TYPE_LFE,
|
||||
.elem_id = layout_map[i][1],
|
||||
.aac_position = AAC_CHANNEL_LFE
|
||||
};
|
||||
layout |= e2c_vec[i].av_position;
|
||||
i++;
|
||||
}
|
||||
while (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
|
||||
@@ -401,95 +378,26 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
i++;
|
||||
}
|
||||
|
||||
// The previous checks would end up at 8 at this point for 22.2
|
||||
if (layout == PREFIX_FOR_22POINT2 && tags == 16 && i == 8) {
|
||||
const uint8_t (*reference_layout_map)[3] = aac_channel_layout_map[12];
|
||||
for (int j = 0; j < tags; j++) {
|
||||
if (layout_map[j][0] != reference_layout_map[j][0] ||
|
||||
layout_map[j][2] != reference_layout_map[j][2])
|
||||
goto end_of_layout_definition;
|
||||
}
|
||||
|
||||
e2c_vec[i] = (struct elem_to_channel) {
|
||||
.av_position = AV_CH_TOP_FRONT_CENTER,
|
||||
.syn_ele = layout_map[i][0],
|
||||
.elem_id = layout_map[i][1],
|
||||
.aac_position = layout_map[i][2]
|
||||
}; layout |= e2c_vec[i].av_position; i++;
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
AV_CH_TOP_FRONT_LEFT,
|
||||
AV_CH_TOP_FRONT_RIGHT,
|
||||
AAC_CHANNEL_FRONT,
|
||||
&layout);
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
AV_CH_TOP_SIDE_LEFT,
|
||||
AV_CH_TOP_SIDE_RIGHT,
|
||||
AAC_CHANNEL_SIDE,
|
||||
&layout);
|
||||
e2c_vec[i] = (struct elem_to_channel) {
|
||||
.av_position = AV_CH_TOP_CENTER,
|
||||
.syn_ele = layout_map[i][0],
|
||||
.elem_id = layout_map[i][1],
|
||||
.aac_position = layout_map[i][2]
|
||||
}; layout |= e2c_vec[i].av_position; i++;
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
AV_CH_TOP_BACK_LEFT,
|
||||
AV_CH_TOP_BACK_RIGHT,
|
||||
AAC_CHANNEL_BACK,
|
||||
&layout);
|
||||
e2c_vec[i] = (struct elem_to_channel) {
|
||||
.av_position = AV_CH_TOP_BACK_CENTER,
|
||||
.syn_ele = layout_map[i][0],
|
||||
.elem_id = layout_map[i][1],
|
||||
.aac_position = layout_map[i][2]
|
||||
}; layout |= e2c_vec[i].av_position; i++;
|
||||
e2c_vec[i] = (struct elem_to_channel) {
|
||||
.av_position = AV_CH_BOTTOM_FRONT_CENTER,
|
||||
.syn_ele = layout_map[i][0],
|
||||
.elem_id = layout_map[i][1],
|
||||
.aac_position = layout_map[i][2]
|
||||
}; layout |= e2c_vec[i].av_position; i++;
|
||||
i += assign_pair(e2c_vec, layout_map, i,
|
||||
AV_CH_BOTTOM_FRONT_LEFT,
|
||||
AV_CH_BOTTOM_FRONT_RIGHT,
|
||||
AAC_CHANNEL_FRONT,
|
||||
&layout);
|
||||
}
|
||||
|
||||
end_of_layout_definition:
|
||||
|
||||
// Must choose a stable sort
|
||||
total_non_cc_elements = n = i;
|
||||
do {
|
||||
int next_n = 0;
|
||||
for (i = 1; i < n; i++)
|
||||
if (e2c_vec[i - 1].av_position > e2c_vec[i].av_position) {
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[i - 1], e2c_vec[i]);
|
||||
next_n = i;
|
||||
}
|
||||
n = next_n;
|
||||
} while (n > 0);
|
||||
|
||||
if (layout == AV_CH_LAYOUT_22POINT2) {
|
||||
// For 22.2 reorder the result as needed
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[2], e2c_vec[0]); // FL & FR first (final), FC third
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[2], e2c_vec[1]); // FC second (final), FLc & FRc third
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[6], e2c_vec[2]); // LFE1 third (final), FLc & FRc seventh
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[4], e2c_vec[3]); // BL & BR fourth (final), SiL & SiR fifth
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[6], e2c_vec[4]); // FLc & FRc fifth (final), SiL & SiR seventh
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[7], e2c_vec[6]); // LFE2 seventh (final), SiL & SiR eight (final)
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[9], e2c_vec[8]); // TpFL & TpFR ninth (final), TFC tenth (final)
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[11], e2c_vec[10]); // TC eleventh (final), TpSiL & TpSiR twelth
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[12], e2c_vec[11]); // TpBL & TpBR twelth (final), TpSiL & TpSiR thirteenth (final)
|
||||
} else {
|
||||
// For everything else, utilize the AV channel position define as a
|
||||
// stable sort.
|
||||
do {
|
||||
int next_n = 0;
|
||||
for (i = 1; i < n; i++)
|
||||
if (e2c_vec[i - 1].av_position > e2c_vec[i].av_position) {
|
||||
FFSWAP(struct elem_to_channel, e2c_vec[i - 1], e2c_vec[i]);
|
||||
next_n = i;
|
||||
}
|
||||
n = next_n;
|
||||
} while (n > 0);
|
||||
|
||||
}
|
||||
|
||||
layout = 0;
|
||||
for (i = 0; i < total_non_cc_elements; i++) {
|
||||
layout_map[i][0] = e2c_vec[i].syn_ele;
|
||||
layout_map[i][1] = e2c_vec[i].elem_id;
|
||||
layout_map[i][2] = e2c_vec[i].aac_position;
|
||||
if (e2c_vec[i].av_position != UINT64_MAX) {
|
||||
layout |= e2c_vec[i].av_position;
|
||||
}
|
||||
}
|
||||
|
||||
return layout;
|
||||
@@ -612,13 +520,13 @@ static void flush(AVCodecContext *avctx)
|
||||
*
|
||||
* @return Returns error status. 0 - OK, !0 - error
|
||||
*/
|
||||
static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx,
|
||||
static int set_default_channel_config(AVCodecContext *avctx,
|
||||
uint8_t (*layout_map)[3],
|
||||
int *tags,
|
||||
int channel_config)
|
||||
{
|
||||
if (channel_config < 1 || (channel_config > 7 && channel_config < 11) ||
|
||||
channel_config > 13) {
|
||||
channel_config > 12) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"invalid default channel configuration (%d)\n",
|
||||
channel_config);
|
||||
@@ -640,13 +548,10 @@ static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx,
|
||||
* 7.1 layout was intended.
|
||||
*/
|
||||
if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
|
||||
av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
|
||||
" instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
|
||||
" according to the specification instead.\n", FF_COMPLIANCE_STRICT);
|
||||
layout_map[2][2] = AAC_CHANNEL_SIDE;
|
||||
|
||||
if (!ac || !ac->warned_71_wide++) {
|
||||
av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
|
||||
" instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
|
||||
" according to the specification instead.\n", FF_COMPLIANCE_STRICT);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -668,7 +573,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
|
||||
|
||||
av_log(ac->avctx, AV_LOG_DEBUG, "mono with CPE\n");
|
||||
|
||||
if (set_default_channel_config(ac, ac->avctx, layout_map,
|
||||
if (set_default_channel_config(ac->avctx, layout_map,
|
||||
&layout_map_tags, 2) < 0)
|
||||
return NULL;
|
||||
if (output_configure(ac, layout_map, layout_map_tags,
|
||||
@@ -687,7 +592,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
|
||||
|
||||
av_log(ac->avctx, AV_LOG_DEBUG, "stereo with SCE\n");
|
||||
|
||||
if (set_default_channel_config(ac, ac->avctx, layout_map,
|
||||
if (set_default_channel_config(ac->avctx, layout_map,
|
||||
&layout_map_tags, 1) < 0)
|
||||
return NULL;
|
||||
if (output_configure(ac, layout_map, layout_map_tags,
|
||||
@@ -701,13 +606,6 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
|
||||
/* For indexed channel configurations map the channels solely based
|
||||
* on position. */
|
||||
switch (ac->oc[1].m4ac.chan_config) {
|
||||
case 13:
|
||||
if (ac->tags_mapped > 3 && ((type == TYPE_CPE && elem_id < 8) ||
|
||||
(type == TYPE_SCE && elem_id < 6) ||
|
||||
(type == TYPE_LFE && elem_id < 2))) {
|
||||
ac->tags_mapped++;
|
||||
return ac->tag_che_map[type][elem_id] = ac->che[type][elem_id];
|
||||
}
|
||||
case 12:
|
||||
case 7:
|
||||
if (ac->tags_mapped == 3 && type == TYPE_CPE) {
|
||||
@@ -943,7 +841,7 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
|
||||
if (tags < 0)
|
||||
return tags;
|
||||
} else {
|
||||
if ((ret = set_default_channel_config(ac, avctx, layout_map,
|
||||
if ((ret = set_default_channel_config(avctx, layout_map,
|
||||
&tags, channel_config)))
|
||||
return ret;
|
||||
}
|
||||
@@ -1039,7 +937,7 @@ static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
|
||||
skip_bits_long(gb, 8 * len);
|
||||
}
|
||||
|
||||
if ((ret = set_default_channel_config(ac, avctx, layout_map,
|
||||
if ((ret = set_default_channel_config(avctx, layout_map,
|
||||
&tags, channel_config)))
|
||||
return ret;
|
||||
|
||||
@@ -1077,7 +975,7 @@ static int decode_audio_specific_config_gb(AACContext *ac,
|
||||
int i, ret;
|
||||
GetBitContext gbc = *gb;
|
||||
|
||||
if ((i = ff_mpeg4audio_get_config_gb(m4ac, &gbc, sync_extension, avctx)) < 0)
|
||||
if ((i = ff_mpeg4audio_get_config_gb(m4ac, &gbc, sync_extension)) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (m4ac->sampling_index > 12) {
|
||||
@@ -1198,25 +1096,29 @@ static void reset_predictor_group(PredictorState *ps, int group_num)
|
||||
reset_predict_state(&ps[i]);
|
||||
}
|
||||
|
||||
#define AAC_INIT_VLC_STATIC(num, size) \
|
||||
INIT_VLC_STATIC(&vlc_spectral[num], 8, 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);
|
||||
|
||||
static void aacdec_init(AACContext *ac);
|
||||
|
||||
static av_cold void aac_static_table_init(void)
|
||||
{
|
||||
static VLC_TYPE vlc_buf[304 + 270 + 550 + 300 + 328 +
|
||||
294 + 306 + 268 + 510 + 366 + 462][2];
|
||||
for (unsigned i = 0, offset = 0; i < 11; i++) {
|
||||
vlc_spectral[i].table = &vlc_buf[offset];
|
||||
vlc_spectral[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset;
|
||||
ff_init_vlc_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i],
|
||||
ff_aac_spectral_bits[i], sizeof(ff_aac_spectral_bits[i][0]),
|
||||
sizeof(ff_aac_spectral_bits[i][0]),
|
||||
ff_aac_spectral_codes[i], sizeof(ff_aac_spectral_codes[i][0]),
|
||||
sizeof(ff_aac_spectral_codes[i][0]),
|
||||
ff_aac_codebook_vector_idx[i], sizeof(ff_aac_codebook_vector_idx[i][0]),
|
||||
sizeof(ff_aac_codebook_vector_idx[i][0]),
|
||||
INIT_VLC_STATIC_OVERLONG);
|
||||
offset += vlc_spectral[i].table_size;
|
||||
}
|
||||
AAC_INIT_VLC_STATIC( 0, 304);
|
||||
AAC_INIT_VLC_STATIC( 1, 270);
|
||||
AAC_INIT_VLC_STATIC( 2, 550);
|
||||
AAC_INIT_VLC_STATIC( 3, 300);
|
||||
AAC_INIT_VLC_STATIC( 4, 328);
|
||||
AAC_INIT_VLC_STATIC( 5, 294);
|
||||
AAC_INIT_VLC_STATIC( 6, 306);
|
||||
AAC_INIT_VLC_STATIC( 7, 268);
|
||||
AAC_INIT_VLC_STATIC( 8, 510);
|
||||
AAC_INIT_VLC_STATIC( 9, 366);
|
||||
AAC_INIT_VLC_STATIC(10, 462);
|
||||
|
||||
AAC_RENAME(ff_aac_sbr_init)();
|
||||
|
||||
@@ -1233,18 +1135,17 @@ static av_cold void aac_static_table_init(void)
|
||||
352);
|
||||
|
||||
// window initialization
|
||||
AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_long_1024), 4.0, 1024);
|
||||
AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_short_128), 6.0, 128);
|
||||
#if !USE_FIXED
|
||||
AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960);
|
||||
AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120);
|
||||
AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960);
|
||||
AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_120), 120);
|
||||
AAC_RENAME(ff_init_ff_sine_windows)(9);
|
||||
ff_aac_float_common_init();
|
||||
#else
|
||||
AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024);
|
||||
AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128);
|
||||
init_sine_windows_fixed();
|
||||
AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_long_960), 4.0, 960);
|
||||
AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_short_120), 6.0, 120);
|
||||
AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_960), 960);
|
||||
AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_120), 120);
|
||||
#endif
|
||||
AAC_RENAME(ff_init_ff_sine_windows)(10);
|
||||
AAC_RENAME(ff_init_ff_sine_windows)( 9);
|
||||
AAC_RENAME(ff_init_ff_sine_windows)( 7);
|
||||
|
||||
AAC_RENAME(ff_cbrt_tableinit)();
|
||||
}
|
||||
@@ -1299,7 +1200,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
ac->oc[1].m4ac.chan_config = i;
|
||||
|
||||
if (ac->oc[1].m4ac.chan_config) {
|
||||
int ret = set_default_channel_config(ac, avctx, layout_map,
|
||||
int ret = set_default_channel_config(avctx, layout_map,
|
||||
&layout_map_tags, ac->oc[1].m4ac.chan_config);
|
||||
if (!ret)
|
||||
output_configure(ac, layout_map, layout_map_tags,
|
||||
@@ -1802,6 +1703,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
|
||||
#if !USE_FIXED
|
||||
const float *vq = ff_aac_codebook_vector_vals[cbt_m1];
|
||||
#endif /* !USE_FIXED */
|
||||
const uint16_t *cb_vector_idx = ff_aac_codebook_vector_idx[cbt_m1];
|
||||
VLC_TYPE (*vlc_tab)[2] = vlc_spectral[cbt_m1].table;
|
||||
OPEN_READER(re, gb);
|
||||
|
||||
@@ -1817,7 +1719,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
|
||||
|
||||
UPDATE_CACHE(re, gb);
|
||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||
cb_idx = code;
|
||||
cb_idx = cb_vector_idx[code];
|
||||
#if USE_FIXED
|
||||
cf = DEC_SQUAD(cf, cb_idx);
|
||||
#else
|
||||
@@ -1840,7 +1742,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
|
||||
|
||||
UPDATE_CACHE(re, gb);
|
||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||
cb_idx = code;
|
||||
cb_idx = cb_vector_idx[code];
|
||||
nnz = cb_idx >> 8 & 15;
|
||||
bits = nnz ? GET_CACHE(re, gb) : 0;
|
||||
LAST_SKIP_BITS(re, gb, nnz);
|
||||
@@ -1864,7 +1766,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
|
||||
|
||||
UPDATE_CACHE(re, gb);
|
||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||
cb_idx = code;
|
||||
cb_idx = cb_vector_idx[code];
|
||||
#if USE_FIXED
|
||||
cf = DEC_SPAIR(cf, cb_idx);
|
||||
#else
|
||||
@@ -1888,7 +1790,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
|
||||
|
||||
UPDATE_CACHE(re, gb);
|
||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||
cb_idx = code;
|
||||
cb_idx = cb_vector_idx[code];
|
||||
nnz = cb_idx >> 8 & 15;
|
||||
sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
|
||||
LAST_SKIP_BITS(re, gb, nnz);
|
||||
@@ -1921,14 +1823,14 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
|
||||
|
||||
UPDATE_CACHE(re, gb);
|
||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||
cb_idx = code;
|
||||
|
||||
if (cb_idx == 0x0000) {
|
||||
if (!code) {
|
||||
*icf++ = 0;
|
||||
*icf++ = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
cb_idx = cb_vector_idx[code];
|
||||
nnz = cb_idx >> 12;
|
||||
nzt = cb_idx >> 8;
|
||||
bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
|
||||
@@ -2646,10 +2548,10 @@ static void apply_tns(INTFLOAT coef_param[1024], TemporalNoiseShaping *tns,
|
||||
static void windowing_and_mdct_ltp(AACContext *ac, INTFLOAT *out,
|
||||
INTFLOAT *in, IndividualChannelStream *ics)
|
||||
{
|
||||
const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024);
|
||||
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
|
||||
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024);
|
||||
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
|
||||
const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024);
|
||||
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
|
||||
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024);
|
||||
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
|
||||
|
||||
if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {
|
||||
ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024);
|
||||
@@ -2706,8 +2608,8 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce)
|
||||
IndividualChannelStream *ics = &sce->ics;
|
||||
INTFLOAT *saved = sce->saved;
|
||||
INTFLOAT *saved_ltp = sce->coeffs;
|
||||
const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024);
|
||||
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
|
||||
const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024);
|
||||
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
|
||||
int i;
|
||||
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
@@ -2745,9 +2647,9 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
|
||||
INTFLOAT *in = sce->coeffs;
|
||||
INTFLOAT *out = sce->ret;
|
||||
INTFLOAT *saved = sce->saved;
|
||||
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
|
||||
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024);
|
||||
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME2(aac_kbd_short_128) : AAC_RENAME2(sine_128);
|
||||
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
|
||||
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024);
|
||||
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
|
||||
INTFLOAT *buf = ac->buf_mdct;
|
||||
INTFLOAT *temp = ac->temp;
|
||||
int i;
|
||||
@@ -2814,9 +2716,9 @@ static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce)
|
||||
INTFLOAT *in = sce->coeffs;
|
||||
INTFLOAT *out = sce->ret;
|
||||
INTFLOAT *saved = sce->saved;
|
||||
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(aac_kbd_short_120) : AAC_RENAME(sine_120);
|
||||
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(aac_kbd_long_960) : AAC_RENAME(sine_960);
|
||||
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(aac_kbd_short_120) : AAC_RENAME(sine_120);
|
||||
const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(ff_sine_120);
|
||||
const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_960) : AAC_RENAME(ff_sine_960);
|
||||
const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(ff_sine_120);
|
||||
INTFLOAT *buf = ac->buf_mdct;
|
||||
INTFLOAT *temp = ac->temp;
|
||||
int i;
|
||||
@@ -2893,10 +2795,10 @@ static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
|
||||
if (ics->use_kb_window[1]) {
|
||||
// AAC LD uses a low overlap sine window instead of a KBD window
|
||||
memcpy(out, saved, 192 * sizeof(*out));
|
||||
ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, AAC_RENAME2(sine_128), 64);
|
||||
ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, AAC_RENAME(ff_sine_128), 64);
|
||||
memcpy( out + 320, buf + 64, 192 * sizeof(*out));
|
||||
} else {
|
||||
ac->fdsp->vector_fmul_window(out, saved, buf, AAC_RENAME2(sine_512), 256);
|
||||
ac->fdsp->vector_fmul_window(out, saved, buf, AAC_RENAME(ff_sine_512), 256);
|
||||
}
|
||||
|
||||
// buffer update
|
||||
@@ -2905,7 +2807,7 @@ static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
|
||||
|
||||
static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce)
|
||||
{
|
||||
UINTFLOAT *in = sce->coeffs;
|
||||
INTFLOAT *in = sce->coeffs;
|
||||
INTFLOAT *out = sce->ret;
|
||||
INTFLOAT *saved = sce->saved;
|
||||
INTFLOAT *buf = ac->buf_mdct;
|
||||
@@ -3100,7 +3002,7 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
|
||||
push_output_configuration(ac);
|
||||
if (hdr_info.chan_config) {
|
||||
ac->oc[1].m4ac.chan_config = hdr_info.chan_config;
|
||||
if ((ret = set_default_channel_config(ac, ac->avctx,
|
||||
if ((ret = set_default_channel_config(ac->avctx,
|
||||
layout_map,
|
||||
&layout_map_tags,
|
||||
hdr_info.chan_config)) < 0)
|
||||
@@ -3216,8 +3118,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, GetBitContext *gb,
|
||||
const AVPacket *avpkt)
|
||||
int *got_frame_ptr, GetBitContext *gb, AVPacket *avpkt)
|
||||
{
|
||||
AACContext *ac = avctx->priv_data;
|
||||
ChannelElement *che = NULL, *che_prev = NULL;
|
||||
@@ -3312,7 +3213,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
break;
|
||||
|
||||
case TYPE_PCE: {
|
||||
uint8_t layout_map[MAX_ELEM_ID*4][3] = {{0}};
|
||||
uint8_t layout_map[MAX_ELEM_ID*4][3];
|
||||
int tags;
|
||||
|
||||
int pushed = push_output_configuration(ac);
|
||||
@@ -3348,15 +3249,9 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
err = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
err = 0;
|
||||
while (elem_id > 0) {
|
||||
int ret = decode_extension_payload(ac, gb, elem_id, che_prev, che_prev_type);
|
||||
if (ret < 0) {
|
||||
err = ret;
|
||||
break;
|
||||
}
|
||||
elem_id -= ret;
|
||||
}
|
||||
while (elem_id > 0)
|
||||
elem_id -= decode_extension_payload(ac, gb, elem_id, che_prev, che_prev_type);
|
||||
err = 0; /* FIXME */
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -3437,11 +3332,11 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int buf_consumed;
|
||||
int buf_offset;
|
||||
int err;
|
||||
buffer_size_t new_extradata_size;
|
||||
int new_extradata_size;
|
||||
const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
|
||||
AV_PKT_DATA_NEW_EXTRADATA,
|
||||
&new_extradata_size);
|
||||
buffer_size_t jp_dualmono_size;
|
||||
int jp_dualmono_size;
|
||||
const uint8_t *jp_dualmono = av_packet_get_side_data(avpkt,
|
||||
AV_PKT_DATA_JP_DUALMONO,
|
||||
&jp_dualmono_size);
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 16, 5, 0 };
|
||||
static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 0, 5, 0 };
|
||||
|
||||
static const uint8_t aac_channel_layout_map[16][16][3] = {
|
||||
static const uint8_t aac_channel_layout_map[16][5][3] = {
|
||||
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, },
|
||||
{ { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
|
||||
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
|
||||
@@ -50,24 +50,6 @@ static const uint8_t aac_channel_layout_map[16][16][3] = {
|
||||
{ { 0, } },
|
||||
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
|
||||
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_SIDE }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
|
||||
{
|
||||
{ TYPE_SCE, 0, AAC_CHANNEL_FRONT }, // SCE1 = FC,
|
||||
{ TYPE_CPE, 0, AAC_CHANNEL_FRONT }, // CPE1 = FLc and FRc,
|
||||
{ TYPE_CPE, 1, AAC_CHANNEL_FRONT }, // CPE2 = FL and FR,
|
||||
{ TYPE_CPE, 2, AAC_CHANNEL_SIDE }, // CPE3 = SiL and SiR,
|
||||
{ TYPE_CPE, 3, AAC_CHANNEL_BACK }, // CPE4 = BL and BR,
|
||||
{ TYPE_SCE, 1, AAC_CHANNEL_BACK }, // SCE2 = BC,
|
||||
{ TYPE_LFE, 0, AAC_CHANNEL_LFE }, // LFE1 = LFE1,
|
||||
{ TYPE_LFE, 1, AAC_CHANNEL_LFE }, // LFE2 = LFE2,
|
||||
{ TYPE_SCE, 2, AAC_CHANNEL_FRONT }, // SCE3 = TpFC,
|
||||
{ TYPE_CPE, 4, AAC_CHANNEL_FRONT }, // CPE5 = TpFL and TpFR,
|
||||
{ TYPE_CPE, 5, AAC_CHANNEL_SIDE }, // CPE6 = TpSiL and TpSiR,
|
||||
{ TYPE_SCE, 3, AAC_CHANNEL_FRONT }, // SCE4 = TpC,
|
||||
{ TYPE_CPE, 6, AAC_CHANNEL_BACK }, // CPE7 = TpBL and TpBR,
|
||||
{ TYPE_SCE, 4, AAC_CHANNEL_BACK }, // SCE5 = TpBC,
|
||||
{ TYPE_SCE, 5, AAC_CHANNEL_FRONT }, // SCE6 = BtFC,
|
||||
{ TYPE_CPE, 7, AAC_CHANNEL_FRONT }, // CPE8 = BtFL and BtFR
|
||||
},
|
||||
{ { 0, } },
|
||||
/* TODO: Add 7+1 TOP configuration */
|
||||
};
|
||||
@@ -85,7 +67,6 @@ static const uint64_t aac_channel_layout[16] = {
|
||||
0,
|
||||
AV_CH_LAYOUT_6POINT1,
|
||||
AV_CH_LAYOUT_7POINT1,
|
||||
AV_CH_LAYOUT_22POINT2,
|
||||
0,
|
||||
/* AV_CH_LAYOUT_7POINT1_TOP, */
|
||||
};
|
||||
|
||||
@@ -30,14 +30,15 @@
|
||||
***********************************/
|
||||
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/thread.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "internal.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "kbdwin.h"
|
||||
#include "sinewin.h"
|
||||
#include "profiles.h"
|
||||
|
||||
#include "aac.h"
|
||||
#include "aactab.h"
|
||||
@@ -47,6 +48,8 @@
|
||||
|
||||
#include "psymodel.h"
|
||||
|
||||
static AVOnce aac_table_init = AV_ONCE_INIT;
|
||||
|
||||
static void put_pce(PutBitContext *pb, AVCodecContext *avctx)
|
||||
{
|
||||
int i, j;
|
||||
@@ -79,9 +82,9 @@ static void put_pce(PutBitContext *pb, AVCodecContext *avctx)
|
||||
}
|
||||
}
|
||||
|
||||
align_put_bits(pb);
|
||||
avpriv_align_put_bits(pb);
|
||||
put_bits(pb, 8, strlen(aux_data));
|
||||
ff_put_string(pb, aux_data, 0);
|
||||
avpriv_put_string(pb, aux_data, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -518,7 +521,7 @@ static void put_bitstream_info(AACEncContext *s, const char *name)
|
||||
put_bits(&s->pb, 8, namelen - 14);
|
||||
put_bits(&s->pb, 4, 0); //extension type - filler
|
||||
padbits = -put_bits_count(&s->pb) & 7;
|
||||
align_put_bits(&s->pb);
|
||||
avpriv_align_put_bits(&s->pb);
|
||||
for (i = 0; i < namelen - 2; i++)
|
||||
put_bits(&s->pb, 8, name[i]);
|
||||
put_bits(&s->pb, 12 - padbits, 0);
|
||||
@@ -921,7 +924,10 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
// window init
|
||||
ff_aac_float_common_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);
|
||||
|
||||
if ((ret = ff_mdct_init(&s->mdct1024, 11, 0, 32768.0)) < 0)
|
||||
return ret;
|
||||
@@ -934,14 +940,20 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
|
||||
static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
|
||||
{
|
||||
int ch;
|
||||
if (!FF_ALLOCZ_TYPED_ARRAY(s->buffer.samples, s->channels * 3 * 1024) ||
|
||||
!FF_ALLOCZ_TYPED_ARRAY(s->cpe, s->chan_map[0]))
|
||||
return AVERROR(ENOMEM);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->buffer.samples, s->channels, 3 * 1024 * sizeof(s->buffer.samples[0]), alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->cpe, s->chan_map[0], sizeof(ChannelElement), alloc_fail);
|
||||
|
||||
for(ch = 0; ch < s->channels; ch++)
|
||||
s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
|
||||
|
||||
return 0;
|
||||
alloc_fail:
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
static av_cold void aac_encode_init_tables(void)
|
||||
{
|
||||
ff_aac_tableinit();
|
||||
}
|
||||
|
||||
static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
@@ -1065,13 +1077,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
s->options.mid_side = 0;
|
||||
|
||||
if ((ret = dsp_init(avctx, s)) < 0)
|
||||
return ret;
|
||||
goto fail;
|
||||
|
||||
if ((ret = alloc_buffers(avctx, s)) < 0)
|
||||
return ret;
|
||||
goto fail;
|
||||
|
||||
if ((ret = put_audio_specific_config(avctx)))
|
||||
return ret;
|
||||
goto fail;
|
||||
|
||||
sizes[0] = ff_aac_swb_size_1024[s->samplerate_index];
|
||||
sizes[1] = ff_aac_swb_size_128[s->samplerate_index];
|
||||
@@ -1081,7 +1093,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
grouping[i] = s->chan_map[i + 1] == TYPE_CPE;
|
||||
if ((ret = ff_psy_init(&s->psy, avctx, 2, sizes, lengths,
|
||||
s->chan_map[0], grouping)) < 0)
|
||||
return ret;
|
||||
goto fail;
|
||||
s->psypp = ff_psy_preprocess_init(avctx);
|
||||
ff_lpc_init(&s->lpc, 2*avctx->frame_size, TNS_MAX_ORDER, FF_LPC_TYPE_LEVINSON);
|
||||
s->random_state = 0x1f2e3d4c;
|
||||
@@ -1095,10 +1107,15 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
if (HAVE_MIPSDSP)
|
||||
ff_aac_coder_init_mips(s);
|
||||
|
||||
if ((ret = ff_thread_once(&aac_table_init, &aac_encode_init_tables)) != 0)
|
||||
return AVERROR_UNKNOWN;
|
||||
|
||||
ff_af_queue_init(avctx, &s->afq);
|
||||
ff_aac_tableinit();
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
aac_encode_end(avctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
|
||||
@@ -1114,7 +1131,6 @@ static const AVOption aacenc_options[] = {
|
||||
{"aac_ltp", "Long term prediction", offsetof(AACEncContext, options.ltp), AV_OPT_TYPE_BOOL, {.i64 = 0}, -1, 1, AACENC_FLAGS},
|
||||
{"aac_pred", "AAC-Main prediction", offsetof(AACEncContext, options.pred), AV_OPT_TYPE_BOOL, {.i64 = 0}, -1, 1, AACENC_FLAGS},
|
||||
{"aac_pce", "Forces the use of PCEs", offsetof(AACEncContext, options.pce), AV_OPT_TYPE_BOOL, {.i64 = 0}, -1, 1, AACENC_FLAGS},
|
||||
FF_AAC_PROFILE_OPTS
|
||||
{NULL}
|
||||
};
|
||||
|
||||
@@ -1141,7 +1157,7 @@ AVCodec ff_aac_encoder = {
|
||||
.close = aac_encode_end,
|
||||
.defaults = aac_encode_defaults,
|
||||
.supported_samplerates = mpeg4audio_sample_rates,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
|
||||
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
|
||||
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
#define AVCODEC_AACENC_H
|
||||
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ static const uint8_t swb_size_1024_8[] = {
|
||||
32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80
|
||||
};
|
||||
|
||||
const uint8_t *const ff_aac_swb_size_128[] = {
|
||||
const uint8_t *ff_aac_swb_size_128[] = {
|
||||
swb_size_128_96, swb_size_128_96, swb_size_128_64,
|
||||
swb_size_128_48, swb_size_128_48, swb_size_128_48,
|
||||
swb_size_128_24, swb_size_128_24, swb_size_128_16,
|
||||
@@ -96,7 +96,7 @@ const uint8_t *const ff_aac_swb_size_128[] = {
|
||||
swb_size_128_8
|
||||
};
|
||||
|
||||
const uint8_t *const ff_aac_swb_size_1024[] = {
|
||||
const uint8_t *ff_aac_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,
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
#define AAC_MAX_CHANNELS 16
|
||||
|
||||
extern const uint8_t *const ff_aac_swb_size_1024[];
|
||||
extern const uint8_t *ff_aac_swb_size_1024[];
|
||||
extern const int ff_aac_swb_size_1024_len;
|
||||
extern const uint8_t *const ff_aac_swb_size_128[];
|
||||
extern const uint8_t *ff_aac_swb_size_128[];
|
||||
extern const int ff_aac_swb_size_128_len;
|
||||
|
||||
/* Supported layouts without using a PCE */
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include <stdint.h>
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
#include "avcodec.h"
|
||||
#include "get_bits.h"
|
||||
#include "aacps.h"
|
||||
#if USE_FIXED
|
||||
#include "aacps_fixed_tablegen.h"
|
||||
@@ -34,12 +34,118 @@
|
||||
#include "libavutil/internal.h"
|
||||
#include "aacps_tablegen.h"
|
||||
#endif /* USE_FIXED */
|
||||
#include "aacpsdata.c"
|
||||
|
||||
static const INTFLOAT g1_Q2[] = {
|
||||
Q31(0.0f), Q31(0.01899487526049f), Q31(0.0f), Q31(-0.07293139167538f),
|
||||
Q31(0.0f), Q31(0.30596630545168f), Q31(0.5f)
|
||||
#define PS_BASELINE 0 ///< Operate in Baseline PS mode
|
||||
///< Baseline implies 10 or 20 stereo bands,
|
||||
///< mixing mode A, and no ipd/opd
|
||||
|
||||
#define numQMFSlots 32 //numTimeSlots * RATE
|
||||
|
||||
static const int8_t num_env_tab[2][4] = {
|
||||
{ 0, 1, 2, 4, },
|
||||
{ 1, 2, 3, 4, },
|
||||
};
|
||||
|
||||
static const int8_t nr_iidicc_par_tab[] = {
|
||||
10, 20, 34, 10, 20, 34,
|
||||
};
|
||||
|
||||
static const int8_t nr_iidopd_par_tab[] = {
|
||||
5, 11, 17, 5, 11, 17,
|
||||
};
|
||||
|
||||
enum {
|
||||
huff_iid_df1,
|
||||
huff_iid_dt1,
|
||||
huff_iid_df0,
|
||||
huff_iid_dt0,
|
||||
huff_icc_df,
|
||||
huff_icc_dt,
|
||||
huff_ipd_df,
|
||||
huff_ipd_dt,
|
||||
huff_opd_df,
|
||||
huff_opd_dt,
|
||||
};
|
||||
|
||||
static const int huff_iid[] = {
|
||||
huff_iid_df0,
|
||||
huff_iid_df1,
|
||||
huff_iid_dt0,
|
||||
huff_iid_dt1,
|
||||
};
|
||||
|
||||
static VLC vlc_ps[10];
|
||||
|
||||
#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION) \
|
||||
/** \
|
||||
* Read Inter-channel Intensity Difference/Inter-Channel Coherence/ \
|
||||
* Inter-channel Phase Difference/Overall Phase Difference parameters from the \
|
||||
* bitstream. \
|
||||
* \
|
||||
* @param avctx contains the current codec context \
|
||||
* @param gb pointer to the input bitstream \
|
||||
* @param ps pointer to the Parametric Stereo context \
|
||||
* @param PAR pointer to the parameter to be read \
|
||||
* @param e envelope to decode \
|
||||
* @param dt 1: time delta-coded, 0: frequency delta-coded \
|
||||
*/ \
|
||||
static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \
|
||||
int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
|
||||
{ \
|
||||
int b, num = ps->nr_ ## PAR ## _par; \
|
||||
VLC_TYPE (*vlc_table)[2] = vlc_ps[table_idx].table; \
|
||||
if (dt) { \
|
||||
int e_prev = e ? e - 1 : ps->num_env_old - 1; \
|
||||
e_prev = FFMAX(e_prev, 0); \
|
||||
for (b = 0; b < num; b++) { \
|
||||
int val = PAR[e_prev][b] + get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \
|
||||
if (MASK) val &= MASK; \
|
||||
PAR[e][b] = val; \
|
||||
if (ERR_CONDITION) \
|
||||
goto err; \
|
||||
} \
|
||||
} else { \
|
||||
int val = 0; \
|
||||
for (b = 0; b < num; b++) { \
|
||||
val += get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \
|
||||
if (MASK) val &= MASK; \
|
||||
PAR[e][b] = val; \
|
||||
if (ERR_CONDITION) \
|
||||
goto err; \
|
||||
} \
|
||||
} \
|
||||
return 0; \
|
||||
err: \
|
||||
av_log(avctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \
|
||||
return AVERROR_INVALIDDATA; \
|
||||
}
|
||||
|
||||
READ_PAR_DATA(iid, huff_offset[table_idx], 0, FFABS(ps->iid_par[e][b]) > 7 + 8 * ps->iid_quant)
|
||||
READ_PAR_DATA(icc, huff_offset[table_idx], 0, ps->icc_par[e][b] > 7U)
|
||||
READ_PAR_DATA(ipdopd, 0, 0x07, 0)
|
||||
|
||||
static int ps_read_extension_data(GetBitContext *gb, PSContext *ps, int ps_extension_id)
|
||||
{
|
||||
int e;
|
||||
int count = get_bits_count(gb);
|
||||
|
||||
if (ps_extension_id)
|
||||
return 0;
|
||||
|
||||
ps->enable_ipdopd = get_bits1(gb);
|
||||
if (ps->enable_ipdopd) {
|
||||
for (e = 0; e < ps->num_env; e++) {
|
||||
int dt = get_bits1(gb);
|
||||
read_ipdopd_data(NULL, gb, ps, ps->ipd_par, dt ? huff_ipd_dt : huff_ipd_df, e, dt);
|
||||
dt = get_bits1(gb);
|
||||
read_ipdopd_data(NULL, gb, ps, ps->opd_par, dt ? huff_opd_dt : huff_opd_df, e, dt);
|
||||
}
|
||||
}
|
||||
skip_bits1(gb); //reserved_ps
|
||||
return get_bits_count(gb) - count;
|
||||
}
|
||||
|
||||
static void ipdopd_reset(int8_t *ipd_hist, int8_t *opd_hist)
|
||||
{
|
||||
int i;
|
||||
@@ -49,6 +155,163 @@ static void ipdopd_reset(int8_t *ipd_hist, int8_t *opd_hist)
|
||||
}
|
||||
}
|
||||
|
||||
int AAC_RENAME(ff_ps_read_data)(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps, int bits_left)
|
||||
{
|
||||
int e;
|
||||
int bit_count_start = get_bits_count(gb_host);
|
||||
int header;
|
||||
int bits_consumed;
|
||||
GetBitContext gbc = *gb_host, *gb = &gbc;
|
||||
|
||||
header = get_bits1(gb);
|
||||
if (header) { //enable_ps_header
|
||||
ps->enable_iid = get_bits1(gb);
|
||||
if (ps->enable_iid) {
|
||||
int iid_mode = get_bits(gb, 3);
|
||||
if (iid_mode > 5) {
|
||||
av_log(avctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n",
|
||||
iid_mode);
|
||||
goto err;
|
||||
}
|
||||
ps->nr_iid_par = nr_iidicc_par_tab[iid_mode];
|
||||
ps->iid_quant = iid_mode > 2;
|
||||
ps->nr_ipdopd_par = nr_iidopd_par_tab[iid_mode];
|
||||
}
|
||||
ps->enable_icc = get_bits1(gb);
|
||||
if (ps->enable_icc) {
|
||||
ps->icc_mode = get_bits(gb, 3);
|
||||
if (ps->icc_mode > 5) {
|
||||
av_log(avctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n",
|
||||
ps->icc_mode);
|
||||
goto err;
|
||||
}
|
||||
ps->nr_icc_par = nr_iidicc_par_tab[ps->icc_mode];
|
||||
}
|
||||
ps->enable_ext = get_bits1(gb);
|
||||
}
|
||||
|
||||
ps->frame_class = get_bits1(gb);
|
||||
ps->num_env_old = ps->num_env;
|
||||
ps->num_env = num_env_tab[ps->frame_class][get_bits(gb, 2)];
|
||||
|
||||
ps->border_position[0] = -1;
|
||||
if (ps->frame_class) {
|
||||
for (e = 1; e <= ps->num_env; e++) {
|
||||
ps->border_position[e] = get_bits(gb, 5);
|
||||
if (ps->border_position[e] < ps->border_position[e-1]) {
|
||||
av_log(avctx, AV_LOG_ERROR, "border_position non monotone.\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
} else
|
||||
for (e = 1; e <= ps->num_env; e++)
|
||||
ps->border_position[e] = (e * numQMFSlots >> ff_log2_tab[ps->num_env]) - 1;
|
||||
|
||||
if (ps->enable_iid) {
|
||||
for (e = 0; e < ps->num_env; e++) {
|
||||
int dt = get_bits1(gb);
|
||||
if (read_iid_data(avctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt))
|
||||
goto err;
|
||||
}
|
||||
} else
|
||||
memset(ps->iid_par, 0, sizeof(ps->iid_par));
|
||||
|
||||
if (ps->enable_icc)
|
||||
for (e = 0; e < ps->num_env; e++) {
|
||||
int dt = get_bits1(gb);
|
||||
if (read_icc_data(avctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt))
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
memset(ps->icc_par, 0, sizeof(ps->icc_par));
|
||||
|
||||
if (ps->enable_ext) {
|
||||
int cnt = get_bits(gb, 4);
|
||||
if (cnt == 15) {
|
||||
cnt += get_bits(gb, 8);
|
||||
}
|
||||
cnt *= 8;
|
||||
while (cnt > 7) {
|
||||
int ps_extension_id = get_bits(gb, 2);
|
||||
cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id);
|
||||
}
|
||||
if (cnt < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt);
|
||||
goto err;
|
||||
}
|
||||
skip_bits(gb, cnt);
|
||||
}
|
||||
|
||||
ps->enable_ipdopd &= !PS_BASELINE;
|
||||
|
||||
//Fix up envelopes
|
||||
if (!ps->num_env || ps->border_position[ps->num_env] < numQMFSlots - 1) {
|
||||
//Create a fake envelope
|
||||
int source = ps->num_env ? ps->num_env - 1 : ps->num_env_old - 1;
|
||||
int b;
|
||||
if (source >= 0 && source != ps->num_env) {
|
||||
if (ps->enable_iid) {
|
||||
memcpy(ps->iid_par+ps->num_env, ps->iid_par+source, sizeof(ps->iid_par[0]));
|
||||
}
|
||||
if (ps->enable_icc) {
|
||||
memcpy(ps->icc_par+ps->num_env, ps->icc_par+source, sizeof(ps->icc_par[0]));
|
||||
}
|
||||
if (ps->enable_ipdopd) {
|
||||
memcpy(ps->ipd_par+ps->num_env, ps->ipd_par+source, sizeof(ps->ipd_par[0]));
|
||||
memcpy(ps->opd_par+ps->num_env, ps->opd_par+source, sizeof(ps->opd_par[0]));
|
||||
}
|
||||
}
|
||||
if (ps->enable_iid){
|
||||
for (b = 0; b < ps->nr_iid_par; b++) {
|
||||
if (FFABS(ps->iid_par[ps->num_env][b]) > 7 + 8 * ps->iid_quant) {
|
||||
av_log(avctx, AV_LOG_ERROR, "iid_par invalid\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ps->enable_icc){
|
||||
for (b = 0; b < ps->nr_iid_par; b++) {
|
||||
if (ps->icc_par[ps->num_env][b] > 7U) {
|
||||
av_log(avctx, AV_LOG_ERROR, "icc_par invalid\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
ps->num_env++;
|
||||
ps->border_position[ps->num_env] = numQMFSlots - 1;
|
||||
}
|
||||
|
||||
|
||||
ps->is34bands_old = ps->is34bands;
|
||||
if (!PS_BASELINE && (ps->enable_iid || ps->enable_icc))
|
||||
ps->is34bands = (ps->enable_iid && ps->nr_iid_par == 34) ||
|
||||
(ps->enable_icc && ps->nr_icc_par == 34);
|
||||
|
||||
//Baseline
|
||||
if (!ps->enable_ipdopd) {
|
||||
memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
|
||||
memset(ps->opd_par, 0, sizeof(ps->opd_par));
|
||||
}
|
||||
|
||||
if (header)
|
||||
ps->start = 1;
|
||||
|
||||
bits_consumed = get_bits_count(gb) - bit_count_start;
|
||||
if (bits_consumed <= bits_left) {
|
||||
skip_bits_long(gb_host, bits_consumed);
|
||||
return bits_consumed;
|
||||
}
|
||||
av_log(avctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed);
|
||||
err:
|
||||
ps->start = 0;
|
||||
skip_bits_long(gb_host, bits_left);
|
||||
memset(ps->iid_par, 0, sizeof(ps->iid_par));
|
||||
memset(ps->icc_par, 0, sizeof(ps->icc_par));
|
||||
memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
|
||||
memset(ps->opd_par, 0, sizeof(ps->opd_par));
|
||||
return bits_left;
|
||||
}
|
||||
|
||||
/** Split one subband into 2 subsubbands with a symmetric real filter.
|
||||
* The filter must have its non-center even coefficients equal to zero. */
|
||||
static void hybrid2_re(INTFLOAT (*in)[2], INTFLOAT (*out)[32][2], const INTFLOAT filter[8], int len, int reverse)
|
||||
@@ -409,14 +672,14 @@ static void decorrelation(PSContext *ps, INTFLOAT (*out)[32][2], const INTFLOAT
|
||||
const float transient_impact = 1.5f;
|
||||
const float a_smooth = 0.25f; ///< Smoothing coefficient
|
||||
#endif /* USE_FIXED */
|
||||
const int8_t *const k_to_i = is34 ? ff_k_to_i_34 : ff_k_to_i_20;
|
||||
const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
|
||||
int i, k, m, n;
|
||||
int n0 = 0, nL = 32;
|
||||
const INTFLOAT peak_decay_factor = Q31(0.76592833836465f);
|
||||
|
||||
memset(power, 0, 34 * sizeof(*power));
|
||||
|
||||
if (is34 != ps->common.is34bands_old) {
|
||||
if (is34 != ps->is34bands_old) {
|
||||
memset(ps->peak_decay_nrg, 0, sizeof(ps->peak_decay_nrg));
|
||||
memset(ps->power_smooth, 0, sizeof(ps->power_smooth));
|
||||
memset(ps->peak_decay_diff_smooth, 0, sizeof(ps->peak_decay_diff_smooth));
|
||||
@@ -558,7 +821,6 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
{
|
||||
int e, b, k;
|
||||
|
||||
PSCommonContext *const ps2 = &ps->common;
|
||||
INTFLOAT (*H11)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H11;
|
||||
INTFLOAT (*H12)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H12;
|
||||
INTFLOAT (*H21)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H21;
|
||||
@@ -573,29 +835,29 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
int8_t (*icc_mapped)[PS_MAX_NR_IIDICC] = icc_mapped_buf;
|
||||
int8_t (*ipd_mapped)[PS_MAX_NR_IIDICC] = ipd_mapped_buf;
|
||||
int8_t (*opd_mapped)[PS_MAX_NR_IIDICC] = opd_mapped_buf;
|
||||
const int8_t *const k_to_i = is34 ? ff_k_to_i_34 : ff_k_to_i_20;
|
||||
TABLE_CONST INTFLOAT (*H_LUT)[8][4] = (PS_BASELINE || ps2->icc_mode < 3) ? HA : HB;
|
||||
const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
|
||||
TABLE_CONST INTFLOAT (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;
|
||||
|
||||
//Remapping
|
||||
if (ps2->num_env_old) {
|
||||
memcpy(H11[0][0], H11[0][ps2->num_env_old], sizeof(H11[0][0]));
|
||||
memcpy(H11[1][0], H11[1][ps2->num_env_old], sizeof(H11[1][0]));
|
||||
memcpy(H12[0][0], H12[0][ps2->num_env_old], sizeof(H12[0][0]));
|
||||
memcpy(H12[1][0], H12[1][ps2->num_env_old], sizeof(H12[1][0]));
|
||||
memcpy(H21[0][0], H21[0][ps2->num_env_old], sizeof(H21[0][0]));
|
||||
memcpy(H21[1][0], H21[1][ps2->num_env_old], sizeof(H21[1][0]));
|
||||
memcpy(H22[0][0], H22[0][ps2->num_env_old], sizeof(H22[0][0]));
|
||||
memcpy(H22[1][0], H22[1][ps2->num_env_old], sizeof(H22[1][0]));
|
||||
if (ps->num_env_old) {
|
||||
memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
|
||||
memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
|
||||
memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
|
||||
memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
|
||||
memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
|
||||
memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
|
||||
memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
|
||||
memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
|
||||
}
|
||||
|
||||
if (is34) {
|
||||
remap34(&iid_mapped, ps2->iid_par, ps2->nr_iid_par, ps2->num_env, 1);
|
||||
remap34(&icc_mapped, ps2->icc_par, ps2->nr_icc_par, ps2->num_env, 1);
|
||||
if (ps2->enable_ipdopd) {
|
||||
remap34(&ipd_mapped, ps2->ipd_par, ps2->nr_ipdopd_par, ps2->num_env, 0);
|
||||
remap34(&opd_mapped, ps2->opd_par, ps2->nr_ipdopd_par, ps2->num_env, 0);
|
||||
remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
|
||||
remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
|
||||
if (ps->enable_ipdopd) {
|
||||
remap34(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0);
|
||||
remap34(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0);
|
||||
}
|
||||
if (!ps2->is34bands_old) {
|
||||
if (!ps->is34bands_old) {
|
||||
map_val_20_to_34(H11[0][0]);
|
||||
map_val_20_to_34(H11[1][0]);
|
||||
map_val_20_to_34(H12[0][0]);
|
||||
@@ -607,13 +869,13 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
ipdopd_reset(ipd_hist, opd_hist);
|
||||
}
|
||||
} else {
|
||||
remap20(&iid_mapped, ps2->iid_par, ps2->nr_iid_par, ps2->num_env, 1);
|
||||
remap20(&icc_mapped, ps2->icc_par, ps2->nr_icc_par, ps2->num_env, 1);
|
||||
if (ps2->enable_ipdopd) {
|
||||
remap20(&ipd_mapped, ps2->ipd_par, ps2->nr_ipdopd_par, ps2->num_env, 0);
|
||||
remap20(&opd_mapped, ps2->opd_par, ps2->nr_ipdopd_par, ps2->num_env, 0);
|
||||
remap20(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
|
||||
remap20(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
|
||||
if (ps->enable_ipdopd) {
|
||||
remap20(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0);
|
||||
remap20(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0);
|
||||
}
|
||||
if (ps2->is34bands_old) {
|
||||
if (ps->is34bands_old) {
|
||||
map_val_34_to_20(H11[0][0]);
|
||||
map_val_34_to_20(H11[1][0]);
|
||||
map_val_34_to_20(H12[0][0]);
|
||||
@@ -627,15 +889,15 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
}
|
||||
|
||||
//Mixing
|
||||
for (e = 0; e < ps2->num_env; e++) {
|
||||
for (e = 0; e < ps->num_env; e++) {
|
||||
for (b = 0; b < NR_PAR_BANDS[is34]; b++) {
|
||||
INTFLOAT h11, h12, h21, h22;
|
||||
h11 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps2->iid_quant][icc_mapped[e][b]][0];
|
||||
h12 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps2->iid_quant][icc_mapped[e][b]][1];
|
||||
h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps2->iid_quant][icc_mapped[e][b]][2];
|
||||
h22 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps2->iid_quant][icc_mapped[e][b]][3];
|
||||
h11 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][0];
|
||||
h12 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][1];
|
||||
h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][2];
|
||||
h22 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][3];
|
||||
|
||||
if (!PS_BASELINE && ps2->enable_ipdopd && b < NR_IPDOPD_BANDS[is34]) {
|
||||
if (!PS_BASELINE && ps->enable_ipdopd && b < NR_IPDOPD_BANDS[is34]) {
|
||||
//The spec say says to only run this smoother when enable_ipdopd
|
||||
//is set but the reference decoder appears to run it constantly
|
||||
INTFLOAT h11i, h12i, h21i, h22i;
|
||||
@@ -672,8 +934,8 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
for (k = 0; k < NR_BANDS[is34]; k++) {
|
||||
LOCAL_ALIGNED_16(INTFLOAT, h, [2], [4]);
|
||||
LOCAL_ALIGNED_16(INTFLOAT, h_step, [2], [4]);
|
||||
int start = ps2->border_position[e];
|
||||
int stop = ps2->border_position[e+1];
|
||||
int start = ps->border_position[e];
|
||||
int stop = ps->border_position[e+1];
|
||||
INTFLOAT width = Q30(1.f) / ((stop - start) ? (stop - start) : 1);
|
||||
#if USE_FIXED
|
||||
width = FFMIN(2U*width, INT_MAX);
|
||||
@@ -683,7 +945,7 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
h[0][1] = H12[0][e][b];
|
||||
h[0][2] = H21[0][e][b];
|
||||
h[0][3] = H22[0][e][b];
|
||||
if (!PS_BASELINE && ps2->enable_ipdopd) {
|
||||
if (!PS_BASELINE && ps->enable_ipdopd) {
|
||||
//Is this necessary? ps_04_new seems unchanged
|
||||
if ((is34 && k <= 13 && k >= 9) || (!is34 && k <= 1)) {
|
||||
h[1][0] = -H11[1][e][b];
|
||||
@@ -702,14 +964,14 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
h_step[0][1] = AAC_MSUB31_V3(H12[0][e+1][b], h[0][1], width);
|
||||
h_step[0][2] = AAC_MSUB31_V3(H21[0][e+1][b], h[0][2], width);
|
||||
h_step[0][3] = AAC_MSUB31_V3(H22[0][e+1][b], h[0][3], width);
|
||||
if (!PS_BASELINE && ps2->enable_ipdopd) {
|
||||
if (!PS_BASELINE && ps->enable_ipdopd) {
|
||||
h_step[1][0] = AAC_MSUB31_V3(H11[1][e+1][b], h[1][0], width);
|
||||
h_step[1][1] = AAC_MSUB31_V3(H12[1][e+1][b], h[1][1], width);
|
||||
h_step[1][2] = AAC_MSUB31_V3(H21[1][e+1][b], h[1][2], width);
|
||||
h_step[1][3] = AAC_MSUB31_V3(H22[1][e+1][b], h[1][3], width);
|
||||
}
|
||||
if (stop - start)
|
||||
ps->dsp.stereo_interpolate[!PS_BASELINE && ps2->enable_ipdopd](
|
||||
ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd](
|
||||
l[k] + 1 + start, r[k] + 1 + start,
|
||||
h, h_step, stop - start);
|
||||
}
|
||||
@@ -721,7 +983,7 @@ int AAC_RENAME(ff_ps_apply)(AVCodecContext *avctx, PSContext *ps, INTFLOAT L[2][
|
||||
INTFLOAT (*Lbuf)[32][2] = ps->Lbuf;
|
||||
INTFLOAT (*Rbuf)[32][2] = ps->Rbuf;
|
||||
const int len = 32;
|
||||
int is34 = ps->common.is34bands;
|
||||
int is34 = ps->is34bands;
|
||||
|
||||
top += NR_BANDS[is34] - 64;
|
||||
memset(ps->delay+top, 0, (NR_BANDS[is34] - top)*sizeof(ps->delay[0]));
|
||||
@@ -737,9 +999,45 @@ int AAC_RENAME(ff_ps_apply)(AVCodecContext *avctx, PSContext *ps, INTFLOAT L[2][
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define PS_INIT_VLC_STATIC(num, size) \
|
||||
INIT_VLC_STATIC(&vlc_ps[num], 9, ps_tmp[num].table_size / ps_tmp[num].elem_size, \
|
||||
ps_tmp[num].ps_bits, 1, 1, \
|
||||
ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \
|
||||
size);
|
||||
|
||||
#define PS_VLC_ROW(name) \
|
||||
{ name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
|
||||
|
||||
av_cold void AAC_RENAME(ff_ps_init)(void) {
|
||||
// Syntax initialization
|
||||
static const struct {
|
||||
const void *ps_codes, *ps_bits;
|
||||
const unsigned int table_size, elem_size;
|
||||
} ps_tmp[] = {
|
||||
PS_VLC_ROW(huff_iid_df1),
|
||||
PS_VLC_ROW(huff_iid_dt1),
|
||||
PS_VLC_ROW(huff_iid_df0),
|
||||
PS_VLC_ROW(huff_iid_dt0),
|
||||
PS_VLC_ROW(huff_icc_df),
|
||||
PS_VLC_ROW(huff_icc_dt),
|
||||
PS_VLC_ROW(huff_ipd_df),
|
||||
PS_VLC_ROW(huff_ipd_dt),
|
||||
PS_VLC_ROW(huff_opd_df),
|
||||
PS_VLC_ROW(huff_opd_dt),
|
||||
};
|
||||
|
||||
PS_INIT_VLC_STATIC(0, 1544);
|
||||
PS_INIT_VLC_STATIC(1, 832);
|
||||
PS_INIT_VLC_STATIC(2, 1024);
|
||||
PS_INIT_VLC_STATIC(3, 1036);
|
||||
PS_INIT_VLC_STATIC(4, 544);
|
||||
PS_INIT_VLC_STATIC(5, 544);
|
||||
PS_INIT_VLC_STATIC(6, 512);
|
||||
PS_INIT_VLC_STATIC(7, 512);
|
||||
PS_INIT_VLC_STATIC(8, 512);
|
||||
PS_INIT_VLC_STATIC(9, 512);
|
||||
|
||||
ps_tableinit();
|
||||
ff_ps_init_common();
|
||||
}
|
||||
|
||||
av_cold void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps)
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/mem_internal.h"
|
||||
|
||||
#include "aacpsdsp.h"
|
||||
#include "avcodec.h"
|
||||
#include "get_bits.h"
|
||||
@@ -39,13 +37,8 @@
|
||||
#define PS_MAX_DELAY 14
|
||||
#define PS_AP_LINKS 3
|
||||
#define PS_MAX_AP_DELAY 5
|
||||
#define PS_BASELINE 0 ///< Operate in Baseline PS mode
|
||||
///< Baseline implies 10 or 20 stereo bands,
|
||||
///< mixing mode A, and no ipd/opd
|
||||
|
||||
#define numQMFSlots 32 //numTimeSlots * RATE
|
||||
|
||||
typedef struct PSCommonContext {
|
||||
typedef struct PSContext {
|
||||
int start;
|
||||
int enable_iid;
|
||||
int iid_quant;
|
||||
@@ -67,10 +60,6 @@ typedef struct PSCommonContext {
|
||||
int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Overall Phase Difference Parameters
|
||||
int is34bands;
|
||||
int is34bands_old;
|
||||
} PSCommonContext;
|
||||
|
||||
typedef struct PSContext {
|
||||
PSCommonContext common;
|
||||
|
||||
DECLARE_ALIGNED(16, INTFLOAT, in_buf)[5][44][2];
|
||||
DECLARE_ALIGNED(16, INTFLOAT, delay)[PS_MAX_SSB][PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2];
|
||||
@@ -89,14 +78,9 @@ typedef struct PSContext {
|
||||
PSDSPContext dsp;
|
||||
} PSContext;
|
||||
|
||||
extern const int8_t ff_k_to_i_20[];
|
||||
extern const int8_t ff_k_to_i_34[];
|
||||
|
||||
void ff_ps_init_common(void);
|
||||
void AAC_RENAME(ff_ps_init)(void);
|
||||
void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps);
|
||||
int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb,
|
||||
PSCommonContext *ps, int bits_left);
|
||||
int AAC_RENAME(ff_ps_read_data)(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, int bits_left);
|
||||
int AAC_RENAME(ff_ps_apply)(AVCodecContext *avctx, PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R[2][38][64], int top);
|
||||
|
||||
#endif /* AVCODEC_AACPS_H */
|
||||
|
||||
@@ -1,336 +0,0 @@
|
||||
/*
|
||||
* Functions common to fixed/float MPEG-4 Parametric Stereo decoding
|
||||
* 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 <stdint.h>
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/thread.h"
|
||||
#include "aacps.h"
|
||||
#include "get_bits.h"
|
||||
#include "aacpsdata.c"
|
||||
|
||||
static const int8_t num_env_tab[2][4] = {
|
||||
{ 0, 1, 2, 4, },
|
||||
{ 1, 2, 3, 4, },
|
||||
};
|
||||
|
||||
static const int8_t nr_iidicc_par_tab[] = {
|
||||
10, 20, 34, 10, 20, 34,
|
||||
};
|
||||
|
||||
static const int8_t nr_iidopd_par_tab[] = {
|
||||
5, 11, 17, 5, 11, 17,
|
||||
};
|
||||
|
||||
enum {
|
||||
huff_iid_df1,
|
||||
huff_iid_dt1,
|
||||
huff_iid_df0,
|
||||
huff_iid_dt0,
|
||||
huff_icc_df,
|
||||
huff_icc_dt,
|
||||
huff_ipd_df,
|
||||
huff_ipd_dt,
|
||||
huff_opd_df,
|
||||
huff_opd_dt,
|
||||
};
|
||||
|
||||
static const int huff_iid[] = {
|
||||
huff_iid_df0,
|
||||
huff_iid_df1,
|
||||
huff_iid_dt0,
|
||||
huff_iid_dt1,
|
||||
};
|
||||
|
||||
static VLC vlc_ps[10];
|
||||
|
||||
#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION, NB_BITS, MAX_DEPTH) \
|
||||
/** \
|
||||
* Read Inter-channel Intensity Difference/Inter-Channel Coherence/ \
|
||||
* Inter-channel Phase Difference/Overall Phase Difference parameters from the \
|
||||
* bitstream. \
|
||||
* \
|
||||
* @param avctx contains the current codec context \
|
||||
* @param gb pointer to the input bitstream \
|
||||
* @param ps pointer to the Parametric Stereo context \
|
||||
* @param PAR pointer to the parameter to be read \
|
||||
* @param e envelope to decode \
|
||||
* @param dt 1: time delta-coded, 0: frequency delta-coded \
|
||||
*/ \
|
||||
static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSCommonContext *ps, \
|
||||
int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
|
||||
{ \
|
||||
int b, num = ps->nr_ ## PAR ## _par; \
|
||||
VLC_TYPE (*vlc_table)[2] = vlc_ps[table_idx].table; \
|
||||
if (dt) { \
|
||||
int e_prev = e ? e - 1 : ps->num_env_old - 1; \
|
||||
e_prev = FFMAX(e_prev, 0); \
|
||||
for (b = 0; b < num; b++) { \
|
||||
int val = PAR[e_prev][b] + get_vlc2(gb, vlc_table, NB_BITS, MAX_DEPTH) - OFFSET; \
|
||||
if (MASK) val &= MASK; \
|
||||
PAR[e][b] = val; \
|
||||
if (ERR_CONDITION) \
|
||||
goto err; \
|
||||
} \
|
||||
} else { \
|
||||
int val = 0; \
|
||||
for (b = 0; b < num; b++) { \
|
||||
val += get_vlc2(gb, vlc_table, NB_BITS, MAX_DEPTH) - OFFSET; \
|
||||
if (MASK) val &= MASK; \
|
||||
PAR[e][b] = val; \
|
||||
if (ERR_CONDITION) \
|
||||
goto err; \
|
||||
} \
|
||||
} \
|
||||
return 0; \
|
||||
err: \
|
||||
av_log(avctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \
|
||||
return AVERROR_INVALIDDATA; \
|
||||
}
|
||||
|
||||
READ_PAR_DATA(iid, huff_offset[table_idx], 0, FFABS(ps->iid_par[e][b]) > 7 + 8 * ps->iid_quant, 9, 3)
|
||||
READ_PAR_DATA(icc, huff_offset[table_idx], 0, ps->icc_par[e][b] > 7U, 9, 2)
|
||||
READ_PAR_DATA(ipdopd, 0, 0x07, 0, 5, 1)
|
||||
|
||||
static int ps_read_extension_data(GetBitContext *gb, PSCommonContext *ps,
|
||||
int ps_extension_id)
|
||||
{
|
||||
int e;
|
||||
int count = get_bits_count(gb);
|
||||
|
||||
if (ps_extension_id)
|
||||
return 0;
|
||||
|
||||
ps->enable_ipdopd = get_bits1(gb);
|
||||
if (ps->enable_ipdopd) {
|
||||
for (e = 0; e < ps->num_env; e++) {
|
||||
int dt = get_bits1(gb);
|
||||
read_ipdopd_data(NULL, gb, ps, ps->ipd_par, dt ? huff_ipd_dt : huff_ipd_df, e, dt);
|
||||
dt = get_bits1(gb);
|
||||
read_ipdopd_data(NULL, gb, ps, ps->opd_par, dt ? huff_opd_dt : huff_opd_df, e, dt);
|
||||
}
|
||||
}
|
||||
skip_bits1(gb); //reserved_ps
|
||||
return get_bits_count(gb) - count;
|
||||
}
|
||||
|
||||
int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
|
||||
PSCommonContext *ps, int bits_left)
|
||||
{
|
||||
int e;
|
||||
int bit_count_start = get_bits_count(gb_host);
|
||||
int header;
|
||||
int bits_consumed;
|
||||
GetBitContext gbc = *gb_host, *gb = &gbc;
|
||||
|
||||
header = get_bits1(gb);
|
||||
if (header) { //enable_ps_header
|
||||
ps->enable_iid = get_bits1(gb);
|
||||
if (ps->enable_iid) {
|
||||
int iid_mode = get_bits(gb, 3);
|
||||
if (iid_mode > 5) {
|
||||
av_log(avctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n",
|
||||
iid_mode);
|
||||
goto err;
|
||||
}
|
||||
ps->nr_iid_par = nr_iidicc_par_tab[iid_mode];
|
||||
ps->iid_quant = iid_mode > 2;
|
||||
ps->nr_ipdopd_par = nr_iidopd_par_tab[iid_mode];
|
||||
}
|
||||
ps->enable_icc = get_bits1(gb);
|
||||
if (ps->enable_icc) {
|
||||
ps->icc_mode = get_bits(gb, 3);
|
||||
if (ps->icc_mode > 5) {
|
||||
av_log(avctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n",
|
||||
ps->icc_mode);
|
||||
goto err;
|
||||
}
|
||||
ps->nr_icc_par = nr_iidicc_par_tab[ps->icc_mode];
|
||||
}
|
||||
ps->enable_ext = get_bits1(gb);
|
||||
}
|
||||
|
||||
ps->frame_class = get_bits1(gb);
|
||||
ps->num_env_old = ps->num_env;
|
||||
ps->num_env = num_env_tab[ps->frame_class][get_bits(gb, 2)];
|
||||
|
||||
ps->border_position[0] = -1;
|
||||
if (ps->frame_class) {
|
||||
for (e = 1; e <= ps->num_env; e++) {
|
||||
ps->border_position[e] = get_bits(gb, 5);
|
||||
if (ps->border_position[e] < ps->border_position[e-1]) {
|
||||
av_log(avctx, AV_LOG_ERROR, "border_position non monotone.\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
} else
|
||||
for (e = 1; e <= ps->num_env; e++)
|
||||
ps->border_position[e] = (e * numQMFSlots >> ff_log2_tab[ps->num_env]) - 1;
|
||||
|
||||
if (ps->enable_iid) {
|
||||
for (e = 0; e < ps->num_env; e++) {
|
||||
int dt = get_bits1(gb);
|
||||
if (read_iid_data(avctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt))
|
||||
goto err;
|
||||
}
|
||||
} else
|
||||
memset(ps->iid_par, 0, sizeof(ps->iid_par));
|
||||
|
||||
if (ps->enable_icc)
|
||||
for (e = 0; e < ps->num_env; e++) {
|
||||
int dt = get_bits1(gb);
|
||||
if (read_icc_data(avctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt))
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
memset(ps->icc_par, 0, sizeof(ps->icc_par));
|
||||
|
||||
if (ps->enable_ext) {
|
||||
int cnt = get_bits(gb, 4);
|
||||
if (cnt == 15) {
|
||||
cnt += get_bits(gb, 8);
|
||||
}
|
||||
cnt *= 8;
|
||||
while (cnt > 7) {
|
||||
int ps_extension_id = get_bits(gb, 2);
|
||||
cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id);
|
||||
}
|
||||
if (cnt < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt);
|
||||
goto err;
|
||||
}
|
||||
skip_bits(gb, cnt);
|
||||
}
|
||||
|
||||
ps->enable_ipdopd &= !PS_BASELINE;
|
||||
|
||||
//Fix up envelopes
|
||||
if (!ps->num_env || ps->border_position[ps->num_env] < numQMFSlots - 1) {
|
||||
//Create a fake envelope
|
||||
int source = ps->num_env ? ps->num_env - 1 : ps->num_env_old - 1;
|
||||
int b;
|
||||
if (source >= 0 && source != ps->num_env) {
|
||||
if (ps->enable_iid) {
|
||||
memcpy(ps->iid_par+ps->num_env, ps->iid_par+source, sizeof(ps->iid_par[0]));
|
||||
}
|
||||
if (ps->enable_icc) {
|
||||
memcpy(ps->icc_par+ps->num_env, ps->icc_par+source, sizeof(ps->icc_par[0]));
|
||||
}
|
||||
if (ps->enable_ipdopd) {
|
||||
memcpy(ps->ipd_par+ps->num_env, ps->ipd_par+source, sizeof(ps->ipd_par[0]));
|
||||
memcpy(ps->opd_par+ps->num_env, ps->opd_par+source, sizeof(ps->opd_par[0]));
|
||||
}
|
||||
}
|
||||
if (ps->enable_iid){
|
||||
for (b = 0; b < ps->nr_iid_par; b++) {
|
||||
if (FFABS(ps->iid_par[ps->num_env][b]) > 7 + 8 * ps->iid_quant) {
|
||||
av_log(avctx, AV_LOG_ERROR, "iid_par invalid\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ps->enable_icc){
|
||||
for (b = 0; b < ps->nr_iid_par; b++) {
|
||||
if (ps->icc_par[ps->num_env][b] > 7U) {
|
||||
av_log(avctx, AV_LOG_ERROR, "icc_par invalid\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
ps->num_env++;
|
||||
ps->border_position[ps->num_env] = numQMFSlots - 1;
|
||||
}
|
||||
|
||||
|
||||
ps->is34bands_old = ps->is34bands;
|
||||
if (!PS_BASELINE && (ps->enable_iid || ps->enable_icc))
|
||||
ps->is34bands = (ps->enable_iid && ps->nr_iid_par == 34) ||
|
||||
(ps->enable_icc && ps->nr_icc_par == 34);
|
||||
|
||||
//Baseline
|
||||
if (!ps->enable_ipdopd) {
|
||||
memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
|
||||
memset(ps->opd_par, 0, sizeof(ps->opd_par));
|
||||
}
|
||||
|
||||
if (header)
|
||||
ps->start = 1;
|
||||
|
||||
bits_consumed = get_bits_count(gb) - bit_count_start;
|
||||
if (bits_consumed <= bits_left) {
|
||||
skip_bits_long(gb_host, bits_consumed);
|
||||
return bits_consumed;
|
||||
}
|
||||
av_log(avctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed);
|
||||
err:
|
||||
ps->start = 0;
|
||||
skip_bits_long(gb_host, bits_left);
|
||||
memset(ps->iid_par, 0, sizeof(ps->iid_par));
|
||||
memset(ps->icc_par, 0, sizeof(ps->icc_par));
|
||||
memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
|
||||
memset(ps->opd_par, 0, sizeof(ps->opd_par));
|
||||
return bits_left;
|
||||
}
|
||||
|
||||
#define PS_INIT_VLC_STATIC(num, nb_bits, size) \
|
||||
INIT_VLC_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \
|
||||
ps_tmp[num].ps_bits, 1, 1, \
|
||||
ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \
|
||||
size);
|
||||
|
||||
#define PS_VLC_ROW(name) \
|
||||
{ name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
|
||||
|
||||
static av_cold void ps_init_common(void)
|
||||
{
|
||||
// Syntax initialization
|
||||
static const struct {
|
||||
const void *ps_codes, *ps_bits;
|
||||
const unsigned int table_size, elem_size;
|
||||
} ps_tmp[] = {
|
||||
PS_VLC_ROW(huff_iid_df1),
|
||||
PS_VLC_ROW(huff_iid_dt1),
|
||||
PS_VLC_ROW(huff_iid_df0),
|
||||
PS_VLC_ROW(huff_iid_dt0),
|
||||
PS_VLC_ROW(huff_icc_df),
|
||||
PS_VLC_ROW(huff_icc_dt),
|
||||
PS_VLC_ROW(huff_ipd_df),
|
||||
PS_VLC_ROW(huff_ipd_dt),
|
||||
PS_VLC_ROW(huff_opd_df),
|
||||
PS_VLC_ROW(huff_opd_dt),
|
||||
};
|
||||
|
||||
PS_INIT_VLC_STATIC(0, 9, 1544);
|
||||
PS_INIT_VLC_STATIC(1, 9, 832);
|
||||
PS_INIT_VLC_STATIC(2, 9, 1024);
|
||||
PS_INIT_VLC_STATIC(3, 9, 1036);
|
||||
PS_INIT_VLC_STATIC(4, 9, 544);
|
||||
PS_INIT_VLC_STATIC(5, 9, 544);
|
||||
PS_INIT_VLC_STATIC(6, 5, 32);
|
||||
PS_INIT_VLC_STATIC(7, 5, 32);
|
||||
PS_INIT_VLC_STATIC(8, 5, 32);
|
||||
PS_INIT_VLC_STATIC(9, 5, 32);
|
||||
}
|
||||
|
||||
av_cold void ff_ps_init_common(void)
|
||||
{
|
||||
static AVOnce init_static_once = AV_ONCE_INIT;
|
||||
ff_thread_once(&init_static_once, ps_init_common);
|
||||
}
|
||||
@@ -36,12 +36,7 @@
|
||||
#else
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#ifdef BUILD_TABLES
|
||||
#undef DECLARE_ALIGNED
|
||||
#define DECLARE_ALIGNED(align, type, variable) type variable
|
||||
#else
|
||||
#include "libavutil/mem_internal.h"
|
||||
#endif
|
||||
#include "libavutil/mem.h"
|
||||
|
||||
#include "aac_defines.h"
|
||||
#include "libavutil/softfloat.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#define BUILD_TABLES
|
||||
#define CONFIG_HARDCODED_TABLES 0
|
||||
#include "aac_defines.h"
|
||||
|
||||
|
||||
@@ -142,17 +142,22 @@ static const int8_t huff_offset[] = {
|
||||
};
|
||||
|
||||
///Table 8.48
|
||||
const int8_t ff_k_to_i_20[] = {
|
||||
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
|
||||
const int8_t ff_k_to_i_34[] = {
|
||||
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 INTFLOAT g1_Q2[] = {
|
||||
Q31(0.0f), Q31(0.01899487526049f), Q31(0.0f), Q31(-0.07293139167538f),
|
||||
Q31(0.0f), Q31(0.30596630545168f), Q31(0.5f)
|
||||
};
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "sbr.h"
|
||||
#include "aacsbr.h"
|
||||
#include "aacsbrdata.h"
|
||||
#include "aacsbr_tablegen.h"
|
||||
#include "fft.h"
|
||||
#include "internal.h"
|
||||
#include "aacps.h"
|
||||
@@ -38,7 +39,6 @@
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <float.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user