Compare commits
350 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2e00dd4d62 | ||
![]() |
91138821fb | ||
![]() |
a4681d1043 | ||
![]() |
151c2ca8c7 | ||
![]() |
dafd8228bc | ||
![]() |
d9ab7c6292 | ||
![]() |
426715ccbd | ||
![]() |
a4e3bb0106 | ||
![]() |
cd2d8aca84 | ||
![]() |
e9d9fd1137 | ||
![]() |
e4bae0a140 | ||
![]() |
520c3d2303 | ||
![]() |
82a627c2c3 | ||
![]() |
0cb4887b83 | ||
![]() |
4a45535836 | ||
![]() |
4427e96bb1 | ||
![]() |
731f4bb6fd | ||
![]() |
898ce4d6e2 | ||
![]() |
93f80cf2cc | ||
![]() |
204c8798a8 | ||
![]() |
9767d7513c | ||
![]() |
d2b9da2f37 | ||
![]() |
395538e073 | ||
![]() |
a367ab657f | ||
![]() |
63235b8d41 | ||
![]() |
5353bd0285 | ||
![]() |
065996b984 | ||
![]() |
1ace588f4a | ||
![]() |
50a3442120 | ||
![]() |
008ae91bcc | ||
![]() |
d2d38531d6 | ||
![]() |
600bc1deba | ||
![]() |
77a2f4cbcf | ||
![]() |
7f8b55b560 | ||
![]() |
1ab4578c88 | ||
![]() |
52ab9e8984 | ||
![]() |
2922ab7e6f | ||
![]() |
5772cbb343 | ||
![]() |
46e1d05991 | ||
![]() |
a6f7fc8f3b | ||
![]() |
0662967d2b | ||
![]() |
ddeb6eeeb1 | ||
![]() |
5aac081110 | ||
![]() |
d8745de6ae | ||
![]() |
46fd6e4f2e | ||
![]() |
6cad940989 | ||
![]() |
c046890191 | ||
![]() |
d70bad04de | ||
![]() |
c8462bd17f | ||
![]() |
a3410b5a1f | ||
![]() |
43039f9386 | ||
![]() |
d0c4d61c8b | ||
![]() |
95db1624ef | ||
![]() |
b0b33ce148 | ||
![]() |
fa4192e31f | ||
![]() |
4c412580fd | ||
![]() |
8f558c3e10 | ||
![]() |
5ebdfbe893 | ||
![]() |
094a35aeef | ||
![]() |
62f9253781 | ||
![]() |
858864d350 | ||
![]() |
ba31b72f46 | ||
![]() |
7594868296 | ||
![]() |
09e391abd8 | ||
![]() |
b90816d94b | ||
![]() |
05015d03da | ||
![]() |
34ecaf6e88 | ||
![]() |
bb46240cbb | ||
![]() |
5ee539f69d | ||
![]() |
8ba3198549 | ||
![]() |
8355383802 | ||
![]() |
c0f7df9662 | ||
![]() |
fc6825ebb6 | ||
![]() |
f074618a9f | ||
![]() |
c6dce25967 | ||
![]() |
aba56c03b9 | ||
![]() |
2e06758479 | ||
![]() |
fc7071cb53 | ||
![]() |
2dfe3a7b4d | ||
![]() |
9d5f16f6fe | ||
![]() |
dc794d7096 | ||
![]() |
31a77177ff | ||
![]() |
9b0d0fd3c4 | ||
![]() |
9925dca119 | ||
![]() |
3d5323a351 | ||
![]() |
69659389a3 | ||
![]() |
731902bd19 | ||
![]() |
85a685ac0a | ||
![]() |
bd593a98dc | ||
![]() |
6f787aa79b | ||
![]() |
1e7f825a9b | ||
![]() |
c50241080d | ||
![]() |
a0361a6c30 | ||
![]() |
22c27e1f4a | ||
![]() |
9d4355d90a | ||
![]() |
0b0e87bb54 | ||
![]() |
4fb6fa477e | ||
![]() |
c8557235fd | ||
![]() |
f719e6566c | ||
![]() |
b9a1efa6f4 | ||
![]() |
3ee967c1d8 | ||
![]() |
e44f89371c | ||
![]() |
e586e4d93b | ||
![]() |
f156dc54f8 | ||
![]() |
685f50b374 | ||
![]() |
6086a4d74d | ||
![]() |
88089eecfd | ||
![]() |
0daf1428e8 | ||
![]() |
97cc2f286f | ||
![]() |
21d568be17 | ||
![]() |
d84c51904c | ||
![]() |
0cb3cab343 | ||
![]() |
b77d9cbbd5 | ||
![]() |
905f5c8a1e | ||
![]() |
20373a66ec | ||
![]() |
d48da91373 | ||
![]() |
62a657de16 | ||
![]() |
747fbe0c21 | ||
![]() |
c1f479e8df | ||
![]() |
d3b40af01f | ||
![]() |
74880e78d8 | ||
![]() |
60dd8b5733 | ||
![]() |
77cf052e39 | ||
![]() |
146eac0a0c | ||
![]() |
4852b3aabd | ||
![]() |
41313bdcc5 | ||
![]() |
088ba9bc3e | ||
![]() |
b642e45d8c | ||
![]() |
a8fc0bb608 | ||
![]() |
7c8beec48c | ||
![]() |
992957ac30 | ||
![]() |
b3c8fd1f0e | ||
![]() |
7327505883 | ||
![]() |
a3b3096772 | ||
![]() |
704952fee5 | ||
![]() |
b6f5a1ca58 | ||
![]() |
efa8603518 | ||
![]() |
1b0082eabc | ||
![]() |
78dbb1a7e1 | ||
![]() |
4f3f2fe14b | ||
![]() |
cdbaaa4f00 | ||
![]() |
d4d1f32e48 | ||
![]() |
c6c4dc6935 | ||
![]() |
494ddd377a | ||
![]() |
37e99e384e | ||
![]() |
73d6f4651e | ||
![]() |
50ebb524cd | ||
![]() |
98e96652f1 | ||
![]() |
4bde8c1369 | ||
![]() |
ece16d91ee | ||
![]() |
3348e66e2e | ||
![]() |
6e8ed38fab | ||
![]() |
f64e4a8c9a | ||
![]() |
d92a7870d7 | ||
![]() |
5fb5ac7148 | ||
![]() |
8d3bc52acd | ||
![]() |
dc745b76aa | ||
![]() |
b6ae41e7f4 | ||
![]() |
670128ff13 | ||
![]() |
1f9073f41b | ||
![]() |
a991c0673f | ||
![]() |
77493bfd97 | ||
![]() |
bb3f1cad17 | ||
![]() |
a6403a3b69 | ||
![]() |
e2cf32ca5f | ||
![]() |
48fd461977 | ||
![]() |
612b28194b | ||
![]() |
8bce2c60b8 | ||
![]() |
488ffb8135 | ||
![]() |
b786ddc0f2 | ||
![]() |
88ae77cea4 | ||
![]() |
5bed920971 | ||
![]() |
705e89d75f | ||
![]() |
ef688e7425 | ||
![]() |
02d1efdd5b | ||
![]() |
469cb61193 | ||
![]() |
a642be972d | ||
![]() |
bc9d341be8 | ||
![]() |
80ddf7889e | ||
![]() |
4be63111d1 | ||
![]() |
6626a7df53 | ||
![]() |
ab434bf0d0 | ||
![]() |
52b18c1fde | ||
![]() |
0b2b8ab979 | ||
![]() |
65bf4c9c45 | ||
![]() |
7c40a0449b | ||
![]() |
811a504c6b | ||
![]() |
75211f2b8c | ||
![]() |
f6687bbb64 | ||
![]() |
1400f1a1e4 | ||
![]() |
1ea5bbc594 | ||
![]() |
f5955d9f6f | ||
![]() |
e14564b926 | ||
![]() |
0f5a0a4155 | ||
![]() |
7acfa7758c | ||
![]() |
56b6909b39 | ||
![]() |
c6f59b95c5 | ||
![]() |
d61c6ebccf | ||
![]() |
b9a287f237 | ||
![]() |
6407800521 | ||
![]() |
6c62098827 | ||
![]() |
a23d6ea1e4 | ||
![]() |
e492818d89 | ||
![]() |
1ca25bc387 | ||
![]() |
057051b848 | ||
![]() |
71fee2ab1e | ||
![]() |
7d3e217623 | ||
![]() |
2ac6b573a4 | ||
![]() |
7f8846405e | ||
![]() |
81bcf9454e | ||
![]() |
5a3c8f95d5 | ||
![]() |
358e4081ed | ||
![]() |
6baaaa0174 | ||
![]() |
9e3e11a348 | ||
![]() |
1d20d975aa | ||
![]() |
e67491a2a4 | ||
![]() |
e1a86b1433 | ||
![]() |
5310da7e83 | ||
![]() |
4eede1fca2 | ||
![]() |
b7765d00f9 | ||
![]() |
5479e08cc4 | ||
![]() |
d0249f1c2e | ||
![]() |
108ca6fad1 | ||
![]() |
5bee21d724 | ||
![]() |
1f8bf163e4 | ||
![]() |
7e35c50b81 | ||
![]() |
e835ce83e2 | ||
![]() |
00bf66785f | ||
![]() |
e0e4250421 | ||
![]() |
901682ff78 | ||
![]() |
5af78cc98d | ||
![]() |
59f22ef91a | ||
![]() |
5393a5600d | ||
![]() |
077beee465 | ||
![]() |
02d3ad8609 | ||
![]() |
b48cf5412b | ||
![]() |
5f3fa5f930 | ||
![]() |
0e1bb99f26 | ||
![]() |
d2c1a8dc2d | ||
![]() |
5a97a5291a | ||
![]() |
f6b50924a5 | ||
![]() |
a55c274f51 | ||
![]() |
eaa9d2cd6b | ||
![]() |
d3bec24739 | ||
![]() |
3ef1538121 | ||
![]() |
47e462eecc | ||
![]() |
f3d1670606 | ||
![]() |
9547034f91 | ||
![]() |
62c9beda0c | ||
![]() |
0e68b6ddce | ||
![]() |
75e88db330 | ||
![]() |
6baa549249 | ||
![]() |
22561bc0e9 | ||
![]() |
8a4464514f | ||
![]() |
85e94a30ee | ||
![]() |
3445bec6fc | ||
![]() |
c8dace2728 | ||
![]() |
9bcb84810f | ||
![]() |
54e19092fd | ||
![]() |
3d67f52f9d | ||
![]() |
bfd586577c | ||
![]() |
5589549c1d | ||
![]() |
5c316acaa0 | ||
![]() |
f4fb841ad1 | ||
![]() |
c2d11275f7 | ||
![]() |
b54c155f5b | ||
![]() |
ea2d44503f | ||
![]() |
59f7d583a3 | ||
![]() |
fb876e4572 | ||
![]() |
c2d2bf1d6b | ||
![]() |
302094e1d2 | ||
![]() |
8d55c2441c | ||
![]() |
d7e7e12abc | ||
![]() |
a856623e87 | ||
![]() |
348cd84fc8 | ||
![]() |
62de693a17 | ||
![]() |
33769e908d | ||
![]() |
1a28948eb3 | ||
![]() |
01050448cf | ||
![]() |
edc00dea02 | ||
![]() |
8d0631c8fa | ||
![]() |
1135928903 | ||
![]() |
6f3bc92c29 | ||
![]() |
bd531038e8 | ||
![]() |
90da0cb60e | ||
![]() |
3049d5b9b3 | ||
![]() |
43c6b45a53 | ||
![]() |
68a0477bc0 | ||
![]() |
ccf0cd967d | ||
![]() |
002ad7cd39 | ||
![]() |
397fafad23 | ||
![]() |
30f0cd2f1e | ||
![]() |
4d6d8d9ae9 | ||
![]() |
9348514a67 | ||
![]() |
17704500fb | ||
![]() |
2338eda8d8 | ||
![]() |
6a0633e961 | ||
![]() |
16dc41de27 | ||
![]() |
ab471e17e4 | ||
![]() |
3be8aeb14e | ||
![]() |
b48e251360 | ||
![]() |
65a4b90840 | ||
![]() |
59956a5957 | ||
![]() |
d4a08e560d | ||
![]() |
dacac91973 | ||
![]() |
d39400fed7 | ||
![]() |
07174ed841 | ||
![]() |
e7475335b1 | ||
![]() |
722bfe4e7c | ||
![]() |
cc8ab98656 | ||
![]() |
d7cff9f8e8 | ||
![]() |
9bfda9df71 | ||
![]() |
0a837b6317 | ||
![]() |
c3c1db7c56 | ||
![]() |
21ca4ab944 | ||
![]() |
c749bec8c3 | ||
![]() |
a95306e2d7 | ||
![]() |
ed12d1ecad | ||
![]() |
05ed9b7005 | ||
![]() |
76477c3843 | ||
![]() |
ccc4219558 | ||
![]() |
9d60f608af | ||
![]() |
6a4803a6a9 | ||
![]() |
c3b67720f9 | ||
![]() |
1c373456f6 | ||
![]() |
9636266cbd | ||
![]() |
dc3349024a | ||
![]() |
66a3112100 | ||
![]() |
72eca26bf9 | ||
![]() |
e44d56b18d | ||
![]() |
71e00caeab | ||
![]() |
7a2ee770f5 | ||
![]() |
fadebd256e | ||
![]() |
3dab6e5429 | ||
![]() |
bc182a6aca | ||
![]() |
fbde7b2d0a | ||
![]() |
58baa367d6 | ||
![]() |
ca2e3f1131 | ||
![]() |
ebd3aa429c | ||
![]() |
ddb0317154 | ||
![]() |
606aa3baee | ||
![]() |
36dac6da41 | ||
![]() |
9202824e1b | ||
![]() |
0135dd73bb | ||
![]() |
c01be297ce | ||
![]() |
42bd6d9cf6 | ||
![]() |
79013a59c0 | ||
![]() |
c1555ae4b6 | ||
![]() |
a557005417 | ||
![]() |
8069b44ebf |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -37,7 +37,6 @@
|
||||
/doc/examples/filtering_video
|
||||
/doc/examples/metadata
|
||||
/doc/examples/muxing
|
||||
/doc/examples/pc-uninstalled
|
||||
/doc/examples/resampling_audio
|
||||
/doc/examples/scaling_video
|
||||
/doc/fate.txt
|
||||
@@ -67,4 +66,3 @@
|
||||
/tools/probetest
|
||||
/tools/qt-faststart
|
||||
/tools/trasher
|
||||
/tools/seek_print
|
||||
|
59
CREDITS
59
CREDITS
@@ -1,6 +1,55 @@
|
||||
See the Git history of the project (git://source.ffmpeg.org/ffmpeg) to
|
||||
get the names of people who have contributed to FFmpeg.
|
||||
This file contains the names of some of the people who have contributed to
|
||||
FFmpeg. The names are sorted alphabetically by last name. As this file is
|
||||
currently quite outdated and git serves as a much better tool for determining
|
||||
authorship, it remains here for historical reasons only.
|
||||
|
||||
To check the log, you can type the command "git log" in the FFmpeg
|
||||
source directory, or browse the online repository at
|
||||
http://source.ffmpeg.org.
|
||||
Dénes Balatoni
|
||||
Michel Bardiaux
|
||||
Fabrice Bellard
|
||||
Patrice Bensoussan
|
||||
Alex Beregszaszi
|
||||
BERO
|
||||
Thilo Borgmann
|
||||
Mario Brito
|
||||
Ronald Bultje
|
||||
Alex Converse
|
||||
Maarten Daniels
|
||||
Reimar Doeffinger
|
||||
Tim Ferguson
|
||||
Brian Foley
|
||||
Arpad Gereoffy
|
||||
Philip Gladstone
|
||||
Vladimir Gneushev
|
||||
Roine Gustafsson
|
||||
David Hammerton
|
||||
Wolfgang Hesseler
|
||||
Marc Hoffman
|
||||
Falk Hueffner
|
||||
Aurélien Jacobs
|
||||
Steven Johnson
|
||||
Zdenek Kabelac
|
||||
Robin Kay
|
||||
Todd Kirby
|
||||
Nick Kurshev
|
||||
Benjamin Larsson
|
||||
Loïc Le Loarer
|
||||
Daniel Maas
|
||||
Mike Melanson
|
||||
Loren Merritt
|
||||
Jeff Muizelaar
|
||||
Michael Niedermayer
|
||||
François Revol
|
||||
Peter Ross
|
||||
Måns Rullgård
|
||||
Stefano Sabatini
|
||||
Roman Shaposhnik
|
||||
Oded Shimon
|
||||
Dieter Shirley
|
||||
Konstantin Shishkov
|
||||
Juan J. Sierralta
|
||||
Ewald Snel
|
||||
Sascha Sommer
|
||||
Leon van Stuivenberg
|
||||
Roberto Togni
|
||||
Lionel Ulmer
|
||||
Reynaldo Verdejo
|
||||
|
145
Changelog
145
Changelog
@@ -1,29 +1,130 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 1.2:
|
||||
version <next>:
|
||||
- aac: check the maximum number of channels to avoid invalid writes
|
||||
- indeo3: fix off by one in MV validity check
|
||||
- id3v2: check for end of file while unescaping tags to avoid invalid
|
||||
writes, reported by Google Security Team
|
||||
- afifo: fix request_samples on the last frame in certain cases
|
||||
- hls, segment: fix splitting for audio-only streams
|
||||
- wav: Always seek to an even offset, Bug #500, LP: #1174737
|
||||
- swscale: Use alpha from the right row in yuva2rgba_c, Bug #504
|
||||
- indeo3: use unaligned reads on reference blocks, Bug #503
|
||||
- oma: properly forward errors in oma_read_packet
|
||||
- af_asyncts: fix offset calculation
|
||||
|
||||
- VDPAU hardware acceleration through normal hwaccel
|
||||
- SRTP support
|
||||
- Error diffusion dither in Swscale
|
||||
- Chained Ogg support
|
||||
- Theora Midstream reconfiguration support
|
||||
- EVRC decoder
|
||||
- audio fade filter
|
||||
- filtering audio with unknown channel layout
|
||||
- allpass, bass, bandpass, bandreject, biquad, equalizer, highpass, lowpass
|
||||
and treble audio filter
|
||||
- improved showspectrum filter, with multichannel support and sox-like colors
|
||||
- histogram filter
|
||||
- tee muxer
|
||||
- il filter ported from libmpcodecs
|
||||
- support ID3v2 tags in ASF files
|
||||
- encrypted TTA stream decoding support
|
||||
- RF64 support in WAV muxer
|
||||
- noise filter ported from libmpcodecs
|
||||
- Subtitles character encoding conversion
|
||||
- blend filter
|
||||
- stereo3d filter ported from libmpcodecs
|
||||
Most of the following fixes resulted from test samples that the Google
|
||||
Security Team has kindly made available to us:
|
||||
|
||||
- af_channelmap: sanity check input channel indices in all cases
|
||||
- avfiltergraph: check for sws opts being non-NULL before using them
|
||||
- bmv: check for len being valid in bmv_decode_frame()
|
||||
- configure: Enable hwaccels without external dependencies by default
|
||||
- dfa: check for invalid access in decode_wdlt()
|
||||
- id3v2: pad the APIC packets as required by lavc
|
||||
- indeo3: check motion vectors
|
||||
- indeo3: fix data size check
|
||||
- indeo3: switch parsing the header to bytestream2
|
||||
- lavf: make sure stream probe data gets freed
|
||||
- matroska: Update the available size after lace parsing
|
||||
- matroska: fix a corner case in ebml-lace parsing
|
||||
- matroska: pass the lace size to the matroska_parse_rm_audio
|
||||
- mp3dec: fallback to generic seeking when a TOC is not present
|
||||
- oggdec: fix faulty cleanup prototype
|
||||
- oma: Validate sample rates
|
||||
- qdm2: check that the FFT size is a power of 2
|
||||
- riff: check for eof if chunk size and code are 0 to prevent an infinite loop
|
||||
- rv10: check that extradata is large enough
|
||||
- svq1dec: check that the reference frame has the same dimensions as the current one
|
||||
- svq1dec: clip motion vectors to the frame size
|
||||
- xmv: check audio track parameters validity
|
||||
- xmv: do not leak memory in the error paths in xmv_read_header()
|
||||
- atrac3: avoid oversized shifting in decode_bytes()
|
||||
- eamad: allocate a dummy reference frame when the real one is missing
|
||||
- ffv1: fix calculating slice dimensions for version 2
|
||||
- flacdec: simplify bounds checking in flac_probe()
|
||||
- h264: check for luma and chroma bit dept being equal (CVE-2013-2277)
|
||||
- hqdn3d: Fix out of array read in LOWPASS
|
||||
- iff: validate CMAP palette size (CVE-2013-2495)
|
||||
- ivi_common: do not call MC for intra frames when dc_transform is unset
|
||||
- libmp3lame: use the correct remaining buffer size when flushing
|
||||
- lzo: fix overflow checking in copy_backptr()
|
||||
- mp3dec: Fix VBR bit rate parsing
|
||||
- png: use av_mallocz_array() for the zlib zalloc function
|
||||
- roqvideodec: fix a potential infinite loop in roqvideo_decode_frame()
|
||||
- shorten: fix various programming mistakes
|
||||
- vf_gradfun: fix uninitialized variable use
|
||||
- vf_hqdn3d: fix uninitialized variable use
|
||||
- vmdaudio: fix invalid reads when packet size is not a multiple of chunk size
|
||||
- wmadec: require block_align to be set
|
||||
- wmaprodec: require block_align to be set
|
||||
- wmaprodec: return an error, not 0, when the input is too small
|
||||
- xxan: fix invalid memory access in xan_decode_frame_type0()
|
||||
- h264: fix deadlocks with broken/fuzzed files
|
||||
- flvdec: make decoder more robust
|
||||
- vorbisdec: fix buffer overflow (CVE-2013-0894)
|
||||
- ac3dec: validate channel output mode against channel count
|
||||
- doc: minor improvements
|
||||
- loco: check that there is data left after decoding a plane.
|
||||
- mov: use the format context for logging.
|
||||
- lagarith: avoid infinite loop in lag_rac_refill() with corrupted files
|
||||
- flicvideo: avoid an infinite loop in byte run compression
|
||||
- av_memcpy_backptr: avoid an infinite loop for back = 0
|
||||
- mlpdec: do not try to allocate a zero-sized output buffer.
|
||||
- qtrle: add more checks against pixel_ptr being negative.
|
||||
- 4xm: check the return value of read_huffman_tables().
|
||||
- cavs: initialize various context tables, avoids crashes with corrupted files
|
||||
- x86/H.264: Don't use redzone in AVX h264_deblock on Win64
|
||||
- VQA video: check chunk sizes before reading chunks
|
||||
- RoQ video decoder: check dimensions validity
|
||||
- QDM2: check array index before use, fix out of array accesses
|
||||
- mpegvideo: Do REBASE_PICTURE with byte pointers
|
||||
- SVQ3: unbreak decoding
|
||||
- libopencore-amrwb: Make AMR-WB ifdeffery more precise
|
||||
- libopencore-amr: Conditionally compile decoder and encoder bits
|
||||
- arm: Fall back to runtime cpu feature detection via /proc/cpuinfo
|
||||
- xxan: properly handle odd heights
|
||||
- msrledec: check bounds before constructing a possibly invalid pointer (CVE-2496)
|
||||
- qtrle: fix the topmost line for 1bit
|
||||
- aasc: fix output for msrle compression
|
||||
- yop: check for input overreads
|
||||
- yop: check that extradata is large enough
|
||||
- fraps: fix off-by one bug for version 1
|
||||
- vf_delogo: fix copying the input frame
|
||||
- vf_delogo: fix an uninitialized read
|
||||
- dnxhdenc: fix invalid reads in dnxhd_mb_var_thread()
|
||||
- ATRAC3: use correct loop variable in add_tonal_components()
|
||||
- MLP: store the channel layout for each substream
|
||||
- MLP decoder: TrueHD: use Libav channel order
|
||||
- x86: ac3: Fix HAVE_MMXEXT condition to only refer to external assembly
|
||||
- arm: vp8: Fix the plain-armv6 version of vp8_luma_dc_wht
|
||||
- lavr: call mix_function_init() in ff_audio_mix_set_matrix()
|
||||
- rtpenc_chain: Use the original AVFormatContext for getting payload type
|
||||
- rtp: Make sure the output format pointer is set
|
||||
- rtp: Make sure priv_data is set before reading it
|
||||
- videodsp_armv5te: remove #if HAVE_ARMV5TE_EXTERNAL
|
||||
- get_bits: change the failure condition in init_get_bits
|
||||
- mpegvideo: fix loop condition in draw_line()
|
||||
- fate: update ref after rv30_loop_filter fix
|
||||
- RV30: fix masking in rv30_loop_filter()
|
||||
- libcdio: support recent cdio-paranoia
|
||||
- Theora: Skip zero-sized headers
|
||||
- H.264: add 3 pixels below for subpixel filter wait position
|
||||
- H.264: fix ff_generate_sliding_window_mmcos() prototype
|
||||
- H.264: don't clobber mmco opcode tables for non-first slice headers
|
||||
- libx264: use the library specific default rc_initial_buffer_occupancy
|
||||
- lavc: set the default rc_initial_buffer_occupancy
|
||||
- lavc: introduce the convenience function init_get_bits8
|
||||
- lavc: check for overflow in init_get_bits
|
||||
- configure: enable pic for shared libs on AArch64
|
||||
- zmbv: Reset the decoder on keyframe errors
|
||||
- VC1 decoder: prevent a crash due missing pred_flag parameter
|
||||
- matroska: Fix use after free
|
||||
- VP3: Fix double free in vp3_decode_end()
|
||||
- Fix a crash on windows platforms related to automatic stack alignment
|
||||
in libavresample
|
||||
- Fix memleaks in the Ogg demuxer. Related to CVE-2012-2882
|
||||
|
||||
|
||||
version 1.1:
|
||||
|
12
LICENSE
12
LICENSE
@@ -36,20 +36,13 @@ Specifically, the GPL parts of FFmpeg are
|
||||
- vf_hue.c
|
||||
- vf_kerndeint.c
|
||||
- vf_mp.c
|
||||
- vf_noise.c
|
||||
- vf_pp.c
|
||||
- vf_smartblur.c
|
||||
- vf_stereo3d.c
|
||||
- vf_super2xsai.c
|
||||
- vf_tinterlace.c
|
||||
- vf_yadif.c
|
||||
- vsrc_mptestsrc.c
|
||||
|
||||
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
|
||||
the configure parameter --enable-version3 will activate this licensing option
|
||||
for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
|
||||
COPYING.GPLv3 to learn the exact legal terms that apply in this case.
|
||||
|
||||
There are a handful of files under other licensing terms, namely:
|
||||
|
||||
* The files libavcodec/jfdctfst.c, libavcodec/jfdctint_template.c and
|
||||
@@ -59,6 +52,11 @@ There are a handful of files under other licensing terms, namely:
|
||||
You must also indicate any changes including additions and deletions to
|
||||
those three files in the documentation.
|
||||
|
||||
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
|
||||
the configure parameter --enable-version3 will activate this licensing option
|
||||
for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
|
||||
COPYING.GPLv3 to learn the exact legal terms that apply in this case.
|
||||
|
||||
|
||||
external libraries
|
||||
==================
|
||||
|
@@ -449,6 +449,7 @@ Releases
|
||||
1.1 Michael Niedermayer
|
||||
1.0 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
|
||||
GnuPG Fingerprints of maintainers and contributors
|
||||
|
58
cmdutils.c
58
cmdutils.c
@@ -62,8 +62,8 @@
|
||||
static int init_report(const char *env);
|
||||
|
||||
struct SwsContext *sws_opts;
|
||||
AVDictionary *swr_opts;
|
||||
AVDictionary *format_opts, *codec_opts, *resample_opts;
|
||||
SwrContext *swr_opts;
|
||||
AVDictionary *format_opts, *codec_opts;
|
||||
|
||||
const int this_year = 2013;
|
||||
|
||||
@@ -75,6 +75,9 @@ void init_opts(void)
|
||||
if(CONFIG_SWSCALE)
|
||||
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if(CONFIG_SWRESAMPLE)
|
||||
swr_opts = swr_alloc();
|
||||
}
|
||||
|
||||
void uninit_opts(void)
|
||||
@@ -84,10 +87,11 @@ void uninit_opts(void)
|
||||
sws_opts = NULL;
|
||||
#endif
|
||||
|
||||
av_dict_free(&swr_opts);
|
||||
if(CONFIG_SWRESAMPLE)
|
||||
swr_free(&swr_opts);
|
||||
|
||||
av_dict_free(&format_opts);
|
||||
av_dict_free(&codec_opts);
|
||||
av_dict_free(&resample_opts);
|
||||
}
|
||||
|
||||
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
|
||||
@@ -474,9 +478,6 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
char opt_stripped[128];
|
||||
const char *p;
|
||||
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
|
||||
#if CONFIG_AVRESAMPLE
|
||||
const AVClass *rc = avresample_get_class();
|
||||
#endif
|
||||
const AVClass *sc, *swr_class;
|
||||
|
||||
if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
|
||||
@@ -515,23 +516,13 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
#endif
|
||||
#if CONFIG_SWRESAMPLE
|
||||
swr_class = swr_get_class();
|
||||
if (!consumed && (o=av_opt_find(&swr_class, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
struct SwrContext *swr = swr_alloc();
|
||||
int ret = av_opt_set(swr, opt, arg, 0);
|
||||
swr_free(&swr);
|
||||
if (!consumed && av_opt_find(&swr_class, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
|
||||
int ret = av_opt_set(swr_opts, opt, arg, 0);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
|
||||
return ret;
|
||||
}
|
||||
av_dict_set(&swr_opts, opt, arg, FLAGS);
|
||||
consumed = 1;
|
||||
}
|
||||
#endif
|
||||
#if CONFIG_AVRESAMPLE
|
||||
if ((o=av_opt_find(&rc, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
av_dict_set(&resample_opts, opt, arg, FLAGS);
|
||||
consumed = 1;
|
||||
}
|
||||
#endif
|
||||
@@ -584,11 +575,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
|
||||
g->swr_opts = swr_opts;
|
||||
g->codec_opts = codec_opts;
|
||||
g->format_opts = format_opts;
|
||||
g->resample_opts = resample_opts;
|
||||
|
||||
codec_opts = NULL;
|
||||
format_opts = NULL;
|
||||
resample_opts = NULL;
|
||||
#if CONFIG_SWSCALE
|
||||
sws_opts = NULL;
|
||||
#endif
|
||||
@@ -646,11 +635,11 @@ void uninit_parse_context(OptionParseContext *octx)
|
||||
av_freep(&l->groups[j].opts);
|
||||
av_dict_free(&l->groups[j].codec_opts);
|
||||
av_dict_free(&l->groups[j].format_opts);
|
||||
av_dict_free(&l->groups[j].resample_opts);
|
||||
#if CONFIG_SWSCALE
|
||||
sws_freeContext(l->groups[j].sws_opts);
|
||||
#endif
|
||||
av_dict_free(&l->groups[j].swr_opts);
|
||||
if(CONFIG_SWRESAMPLE)
|
||||
swr_free(&l->groups[j].swr_opts);
|
||||
}
|
||||
av_freep(&l->groups);
|
||||
}
|
||||
@@ -667,7 +656,6 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
|
||||
const OptionGroupDef *groups, int nb_groups)
|
||||
{
|
||||
int optindex = 1;
|
||||
int dashdash = -2;
|
||||
|
||||
/* perform system-dependent conversions for arguments list */
|
||||
prepare_app_arguments(&argc, &argv);
|
||||
@@ -682,12 +670,8 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[],
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
|
||||
|
||||
if (opt[0] == '-' && opt[1] == '-' && !opt[2]) {
|
||||
dashdash = optindex;
|
||||
continue;
|
||||
}
|
||||
/* unnamed group separators, e.g. output filename */
|
||||
if (opt[0] != '-' || !opt[1] || dashdash+1 == optindex) {
|
||||
if (opt[0] != '-' || !opt[1]) {
|
||||
finish_group(octx, 0, opt);
|
||||
av_log(NULL, AV_LOG_DEBUG, " matched as %s.\n", groups[0].name);
|
||||
continue;
|
||||
@@ -759,7 +743,7 @@ do { \
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts)
|
||||
if (octx->cur_group.nb_opts || codec_opts || format_opts)
|
||||
av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the "
|
||||
"commandline.\n");
|
||||
|
||||
@@ -1628,7 +1612,7 @@ int show_help(void *optctx, const char *opt, const char *arg)
|
||||
int read_yesno(void)
|
||||
{
|
||||
int c = getchar();
|
||||
int yesno = (av_toupper(c) == 'Y');
|
||||
int yesno = (toupper(c) == 'Y');
|
||||
|
||||
while (c != '\n' && c != EOF)
|
||||
c = getchar();
|
||||
@@ -1749,8 +1733,10 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
|
||||
if (!codec)
|
||||
codec = s->oformat ? avcodec_find_encoder(codec_id)
|
||||
: avcodec_find_decoder(codec_id);
|
||||
if (!codec)
|
||||
return NULL;
|
||||
|
||||
switch (st->codec->codec_type) {
|
||||
switch (codec->type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
prefix = 'v';
|
||||
flags |= AV_OPT_FLAG_VIDEO_PARAM;
|
||||
@@ -1862,6 +1848,12 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
|
||||
av_log(s, AV_LOG_ERROR, "alloc_buffer: av_image_alloc() failed\n");
|
||||
return ret;
|
||||
}
|
||||
/* XXX this shouldn't be needed, but some tests break without this line
|
||||
* those decoders are buggy and need to be fixed.
|
||||
* the following tests fail:
|
||||
* cdgraphics, ansi
|
||||
*/
|
||||
memset(buf->base[0], 128, ret);
|
||||
|
||||
avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {
|
||||
|
@@ -51,8 +51,8 @@ extern const int this_year;
|
||||
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
||||
extern AVFormatContext *avformat_opts;
|
||||
extern struct SwsContext *sws_opts;
|
||||
extern AVDictionary *swr_opts;
|
||||
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
|
||||
extern struct SwrContext *swr_opts;
|
||||
extern AVDictionary *format_opts, *codec_opts;
|
||||
|
||||
/**
|
||||
* Initialize the cmdutils option system, in particular
|
||||
@@ -123,7 +123,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type,
|
||||
* not zero timestr is interpreted as a duration, otherwise as a
|
||||
* date
|
||||
*
|
||||
* @see av_parse_time()
|
||||
* @see parse_date()
|
||||
*/
|
||||
int64_t parse_time_or_die(const char *context, const char *timestr,
|
||||
int is_duration);
|
||||
@@ -253,9 +253,8 @@ typedef struct OptionGroup {
|
||||
|
||||
AVDictionary *codec_opts;
|
||||
AVDictionary *format_opts;
|
||||
AVDictionary *resample_opts;
|
||||
struct SwsContext *sws_opts;
|
||||
AVDictionary *swr_opts;
|
||||
struct SwrContext *swr_opts;
|
||||
} OptionGroup;
|
||||
|
||||
/**
|
||||
|
@@ -32,7 +32,7 @@ ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
|
||||
CXXFLAGS += $(CPPFLAGS) $(CFLAGS)
|
||||
YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
|
||||
|
||||
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
|
||||
HOSTCCFLAGS = $(IFLAGS) $(HOSTCFLAGS)
|
||||
LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
|
||||
|
||||
define COMPILE
|
||||
@@ -117,12 +117,12 @@ $(HOSTPROGS): %$(HOSTEXESUF): %.o
|
||||
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $< $(HOSTLIBS)
|
||||
|
||||
$(OBJS): | $(sort $(dir $(OBJS)))
|
||||
$(HOBJS): | $(sort $(dir $(HOBJS)))
|
||||
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
|
||||
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
|
||||
$(HOBJS): | $(sort $(dir $(HOBJS)))
|
||||
$(TOOLOBJS): | tools
|
||||
|
||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
|
||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS) $(HOBJS))
|
||||
|
||||
CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda
|
||||
DISTCLEANSUFFIXES = *.pc
|
||||
|
@@ -19,6 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -48,7 +49,7 @@ double avpriv_strtod(const char *nptr, char **endptr)
|
||||
double res;
|
||||
|
||||
/* Skip leading spaces */
|
||||
while (av_isspace(*nptr))
|
||||
while (isspace(*nptr))
|
||||
nptr++;
|
||||
|
||||
if (!av_strncasecmp(nptr, "infinity", 8)) {
|
||||
|
404
configure
vendored
404
configure
vendored
@@ -130,6 +130,7 @@ Component options:
|
||||
--disable-pthreads disable pthreads [auto]
|
||||
--disable-w32threads disable Win32 threads [auto]
|
||||
--disable-os2threads disable OS/2 threads [auto]
|
||||
--enable-x11grab enable X11 grabbing [no]
|
||||
--disable-network disable network support [no]
|
||||
--disable-dct disable DCT code
|
||||
--disable-dwt disable DWT code
|
||||
@@ -138,12 +139,10 @@ Component options:
|
||||
--disable-mdct disable MDCT code
|
||||
--disable-rdft disable RDFT code
|
||||
--disable-fft disable FFT code
|
||||
|
||||
Hardware accelerators:
|
||||
--enable-dxva2 enable DXVA2 code
|
||||
--enable-vaapi enable VAAPI code
|
||||
--enable-vda enable VDA code
|
||||
--enable-vdpau enable VDPAU code
|
||||
--enable-vaapi enable VAAPI code [autodetect]
|
||||
--enable-vda enable VDA code [autodetect]
|
||||
--enable-vdpau enable VDPAU code [autodetect]
|
||||
|
||||
Individual component options:
|
||||
--disable-everything disable all components listed below
|
||||
@@ -188,7 +187,6 @@ External library support:
|
||||
--enable-fontconfig enable fontconfig
|
||||
--enable-frei0r enable frei0r video filtering
|
||||
--enable-gnutls enable gnutls [no]
|
||||
--enable-iconv enable iconv [autodetect]
|
||||
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
|
||||
--enable-libass enable libass subtitles rendering [no]
|
||||
--enable-libbluray enable BluRay reading using libbluray [no]
|
||||
@@ -227,14 +225,13 @@ External library support:
|
||||
--enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
|
||||
--enable-libvorbis enable Vorbis en/decoding via libvorbis,
|
||||
native implementation exists [no]
|
||||
--enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
|
||||
--enable-libvpx enable VP8 de/encoding via libvpx [no]
|
||||
--enable-libx264 enable H.264 encoding via x264 [no]
|
||||
--enable-libxavs enable AVS encoding via xavs [no]
|
||||
--enable-libxvid enable Xvid encoding via xvidcore,
|
||||
native MPEG-4/Xvid encoder exists [no]
|
||||
--enable-openal enable OpenAL 1.1 capture support [no]
|
||||
--enable-openssl enable openssl [no]
|
||||
--enable-x11grab enable X11 grabbing [no]
|
||||
--enable-zlib enable zlib [autodetect]
|
||||
|
||||
Advanced options (experts only):
|
||||
@@ -256,7 +253,6 @@ Advanced options (experts only):
|
||||
--ld=LD use linker LD [$ld_default]
|
||||
--host-cc=HOSTCC use host C compiler HOSTCC
|
||||
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
|
||||
--host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
|
||||
--host-ld=HOSTLD use host linker HOSTLD
|
||||
--host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
|
||||
--host-libs=HLIBS use libs HLIBS when linking for host
|
||||
@@ -456,18 +452,14 @@ set_weak(){
|
||||
done
|
||||
}
|
||||
|
||||
sanitize_var_name(){
|
||||
echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
|
||||
}
|
||||
|
||||
set_safe(){
|
||||
var=$1
|
||||
shift
|
||||
eval $(sanitize_var_name "$var")='$*'
|
||||
eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*'
|
||||
}
|
||||
|
||||
get_safe(){
|
||||
eval echo \$$(sanitize_var_name "$1")
|
||||
eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g')
|
||||
}
|
||||
|
||||
pushvar(){
|
||||
@@ -705,10 +697,6 @@ add_extralibs(){
|
||||
prepend extralibs $($ldflags_filter "$@")
|
||||
}
|
||||
|
||||
add_host_cppflags(){
|
||||
append host_cppflags "$@"
|
||||
}
|
||||
|
||||
add_host_cflags(){
|
||||
append host_cflags $($host_cflags_filter "$@")
|
||||
}
|
||||
@@ -1024,7 +1012,7 @@ check_type(){
|
||||
}
|
||||
|
||||
check_struct(){
|
||||
log check_struct "$@"
|
||||
log check_type "$@"
|
||||
headers=$1
|
||||
struct=$2
|
||||
member=$3
|
||||
@@ -1034,16 +1022,6 @@ check_struct(){
|
||||
enable_safe "${struct}_${member}"
|
||||
}
|
||||
|
||||
check_builtin(){
|
||||
log check_builtin "$@"
|
||||
name=$1
|
||||
headers=$2
|
||||
builtin=$3
|
||||
shift 3
|
||||
disable "$name"
|
||||
check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
|
||||
}
|
||||
|
||||
require(){
|
||||
name="$1"
|
||||
header="$2"
|
||||
@@ -1086,13 +1064,6 @@ check_host_cc(){
|
||||
check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
|
||||
}
|
||||
|
||||
check_host_cppflags(){
|
||||
log check_host_cppflags "$@"
|
||||
check_host_cc "$@" <<EOF && append host_cppflags "$@"
|
||||
int x;
|
||||
EOF
|
||||
}
|
||||
|
||||
check_host_cflags(){
|
||||
log check_host_cflags "$@"
|
||||
set -- $($host_cflags_filter "$@")
|
||||
@@ -1130,14 +1101,54 @@ COMPONENT_LIST="
|
||||
protocols
|
||||
"
|
||||
|
||||
EXTERNAL_LIBRARY_LIST="
|
||||
DOCUMENT_LIST="
|
||||
doc
|
||||
htmlpages
|
||||
manpages
|
||||
podpages
|
||||
txtpages
|
||||
"
|
||||
|
||||
LIBRARY_LIST="
|
||||
avcodec
|
||||
avdevice
|
||||
avfilter
|
||||
avformat
|
||||
avresample
|
||||
avutil
|
||||
postproc
|
||||
swresample
|
||||
swscale
|
||||
"
|
||||
|
||||
PROGRAM_LIST="
|
||||
ffplay
|
||||
ffprobe
|
||||
ffserver
|
||||
ffmpeg
|
||||
"
|
||||
|
||||
CONFIG_LIST="
|
||||
$COMPONENT_LIST
|
||||
$DOCUMENT_LIST
|
||||
$LIBRARY_LIST
|
||||
$PROGRAM_LIST
|
||||
avisynth
|
||||
bzlib
|
||||
crystalhd
|
||||
dct
|
||||
dwt
|
||||
dxva2
|
||||
fast_unaligned
|
||||
fft
|
||||
fontconfig
|
||||
frei0r
|
||||
ftrapv
|
||||
gnutls
|
||||
iconv
|
||||
gpl
|
||||
gray
|
||||
hardcoded_tables
|
||||
incompatible_fork_abi
|
||||
libaacplus
|
||||
libass
|
||||
libbluray
|
||||
@@ -1177,62 +1188,6 @@ EXTERNAL_LIBRARY_LIST="
|
||||
libx264
|
||||
libxavs
|
||||
libxvid
|
||||
openal
|
||||
openssl
|
||||
x11grab
|
||||
zlib
|
||||
"
|
||||
|
||||
DOCUMENT_LIST="
|
||||
doc
|
||||
htmlpages
|
||||
manpages
|
||||
podpages
|
||||
txtpages
|
||||
"
|
||||
|
||||
HWACCEL_LIST="
|
||||
dxva2
|
||||
vaapi
|
||||
vda
|
||||
vdpau
|
||||
"
|
||||
|
||||
LIBRARY_LIST="
|
||||
avcodec
|
||||
avdevice
|
||||
avfilter
|
||||
avformat
|
||||
avresample
|
||||
avutil
|
||||
postproc
|
||||
swresample
|
||||
swscale
|
||||
"
|
||||
|
||||
PROGRAM_LIST="
|
||||
ffplay
|
||||
ffprobe
|
||||
ffserver
|
||||
ffmpeg
|
||||
"
|
||||
|
||||
CONFIG_LIST="
|
||||
$COMPONENT_LIST
|
||||
$DOCUMENT_LIST
|
||||
$EXTERNAL_LIBRARY_LIST
|
||||
$HWACCEL_LIST
|
||||
$LIBRARY_LIST
|
||||
$PROGRAM_LIST
|
||||
dct
|
||||
dwt
|
||||
fast_unaligned
|
||||
fft
|
||||
ftrapv
|
||||
gpl
|
||||
gray
|
||||
hardcoded_tables
|
||||
incompatible_fork_abi
|
||||
lsp
|
||||
lzo
|
||||
mdct
|
||||
@@ -1240,6 +1195,8 @@ CONFIG_LIST="
|
||||
memory_poisoning
|
||||
network
|
||||
nonfree
|
||||
openal
|
||||
openssl
|
||||
pic
|
||||
rdft
|
||||
runtime_cpudetect
|
||||
@@ -1250,8 +1207,13 @@ CONFIG_LIST="
|
||||
static
|
||||
swscale_alpha
|
||||
thumb
|
||||
vaapi
|
||||
vda
|
||||
vdpau
|
||||
version3
|
||||
xmm_clobber_test
|
||||
x11grab
|
||||
zlib
|
||||
"
|
||||
|
||||
THREADS_LIST='
|
||||
@@ -1338,7 +1300,6 @@ HAVE_LIST_PUB='
|
||||
MATH_FUNCS="
|
||||
atanf
|
||||
atan2f
|
||||
cbrt
|
||||
cbrtf
|
||||
cosf
|
||||
exp2
|
||||
@@ -1420,7 +1381,6 @@ HAVE_LIST="
|
||||
gettimeofday
|
||||
glob
|
||||
gnu_as
|
||||
gsm_h
|
||||
ibm_asm
|
||||
inet_aton
|
||||
io_h
|
||||
@@ -1600,7 +1560,6 @@ CMDLINE_SET="
|
||||
CMDLINE_APPEND="
|
||||
extra_cflags
|
||||
extra_cxxflags
|
||||
host_cppflags
|
||||
"
|
||||
|
||||
# code dependency declarations
|
||||
@@ -1670,7 +1629,7 @@ mdct_select="fft"
|
||||
rdft_select="fft"
|
||||
mpegaudio_select="mpegaudiodsp"
|
||||
mpegaudiodsp_select="dct"
|
||||
mpegvideo_select="error_resilience videodsp h264chroma"
|
||||
mpegvideo_select="videodsp"
|
||||
mpegvideoenc_select="mpegvideo"
|
||||
|
||||
# decoders / encoders
|
||||
@@ -1688,13 +1647,13 @@ atrac1_decoder_select="mdct sinewin"
|
||||
atrac3_decoder_select="mdct"
|
||||
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
|
||||
binkaudio_rdft_decoder_select="mdct rdft sinewin"
|
||||
cavs_decoder_select="golomb h264chroma mpegvideo"
|
||||
cavs_decoder_select="golomb mpegvideo"
|
||||
comfortnoise_encoder_select="lpc"
|
||||
cook_decoder_select="mdct sinewin"
|
||||
cscd_decoder_select="lzo"
|
||||
cscd_decoder_suggest="zlib"
|
||||
dca_decoder_select="mdct"
|
||||
dirac_decoder_select="dwt golomb videodsp"
|
||||
dirac_decoder_select="dwt golomb"
|
||||
dnxhd_encoder_select="aandcttables mpegvideoenc"
|
||||
dxa_decoder_select="zlib"
|
||||
eac3_decoder_select="ac3_decoder"
|
||||
@@ -1721,7 +1680,7 @@ h263_decoder_select="error_resilience h263_parser mpegvideo"
|
||||
h263_encoder_select="aandcttables error_resilience mpegvideoenc"
|
||||
h263i_decoder_select="h263_decoder"
|
||||
h263p_encoder_select="h263_encoder"
|
||||
h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
|
||||
h264_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
|
||||
huffyuv_encoder_select="huffman"
|
||||
iac_decoder_select="fft mdct sinewin"
|
||||
imc_decoder_select="fft mdct sinewin"
|
||||
@@ -1776,8 +1735,8 @@ rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvi
|
||||
rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
|
||||
shorten_decoder_select="golomb"
|
||||
sipr_decoder_select="lsp"
|
||||
snow_decoder_select="dwt h264qpel rangecoder"
|
||||
snow_encoder_select="aandcttables dwt h264qpel error_resilience mpegvideoenc rangecoder"
|
||||
snow_decoder_select="dwt rangecoder"
|
||||
snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder"
|
||||
sonic_decoder_select="golomb"
|
||||
sonic_encoder_select="golomb"
|
||||
sonic_ls_encoder_select="golomb"
|
||||
@@ -1797,8 +1756,8 @@ vc1image_decoder_select="vc1_decoder"
|
||||
vorbis_decoder_select="mdct"
|
||||
vorbis_encoder_select="mdct"
|
||||
vp3_decoder_select="vp3dsp videodsp"
|
||||
vp5_decoder_select="h264chroma vp3dsp videodsp"
|
||||
vp6_decoder_select="h264chroma huffman vp3dsp videodsp"
|
||||
vp5_decoder_select="vp3dsp videodsp"
|
||||
vp6_decoder_select="huffman vp3dsp videodsp"
|
||||
vp6a_decoder_select="vp6_decoder"
|
||||
vp6f_decoder_select="vp6_decoder"
|
||||
vp8_decoder_select="h264pred videodsp"
|
||||
@@ -1825,64 +1784,41 @@ crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
|
||||
dxva2_deps="dxva2api_h"
|
||||
vaapi_deps="va_va_h"
|
||||
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
|
||||
vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
|
||||
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
|
||||
|
||||
h263_vaapi_hwaccel_deps="vaapi"
|
||||
h263_vaapi_hwaccel_select="h263_decoder"
|
||||
h263_vdpau_hwaccel_deps="vdpau"
|
||||
h263_vdpau_hwaccel_select="h263_decoder"
|
||||
h263_vaapi_hwaccel_select="vaapi h263_decoder"
|
||||
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
|
||||
h264_dxva2_hwaccel_deps="dxva2"
|
||||
h264_dxva2_hwaccel_select="h264_decoder"
|
||||
h264_vaapi_hwaccel_deps="vaapi"
|
||||
h264_vaapi_hwaccel_select="h264_decoder"
|
||||
h264_vda_decoder_deps="vda"
|
||||
h264_vda_decoder_select="h264_decoder"
|
||||
h264_vda_hwaccel_deps="vda"
|
||||
h264_vda_hwaccel_select="h264_decoder"
|
||||
h264_vdpau_decoder_deps="vdpau"
|
||||
h264_vdpau_decoder_select="h264_decoder"
|
||||
h264_vdpau_hwaccel_deps="vdpau"
|
||||
h264_vdpau_hwaccel_select="h264_decoder"
|
||||
mpeg_vdpau_decoder_deps="vdpau"
|
||||
mpeg_vdpau_decoder_select="mpegvideo_decoder"
|
||||
mpeg1_vdpau_decoder_deps="vdpau"
|
||||
mpeg1_vdpau_decoder_select="mpeg1video_decoder"
|
||||
mpeg1_vdpau_hwaccel_deps="vdpau"
|
||||
mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
|
||||
h264_vaapi_hwaccel_select="vaapi h264_decoder"
|
||||
h264_vda_decoder_select="vda h264_parser h264_decoder"
|
||||
h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
|
||||
h264_vda_hwaccel_select="vda h264_decoder"
|
||||
h264_vdpau_decoder_select="vdpau h264_decoder"
|
||||
mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
|
||||
mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
|
||||
mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
|
||||
mpeg2_crystalhd_decoder_select="crystalhd"
|
||||
mpeg2_dxva2_hwaccel_deps="dxva2"
|
||||
mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
|
||||
mpeg2_vaapi_hwaccel_deps="vaapi"
|
||||
mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
|
||||
mpeg2_vdpau_hwaccel_deps="vdpau"
|
||||
mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
|
||||
mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
|
||||
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
|
||||
mpeg4_crystalhd_decoder_select="crystalhd"
|
||||
mpeg4_vaapi_hwaccel_deps="vaapi"
|
||||
mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
|
||||
mpeg4_vdpau_decoder_deps="vdpau"
|
||||
mpeg4_vdpau_decoder_select="mpeg4_decoder"
|
||||
mpeg4_vdpau_hwaccel_deps="vdpau"
|
||||
mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
|
||||
mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
|
||||
mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
|
||||
msmpeg4_crystalhd_decoder_select="crystalhd"
|
||||
vc1_crystalhd_decoder_select="crystalhd"
|
||||
vc1_dxva2_hwaccel_deps="dxva2"
|
||||
vc1_dxva2_hwaccel_select="vc1_decoder"
|
||||
vc1_vaapi_hwaccel_deps="vaapi"
|
||||
vc1_vaapi_hwaccel_select="vc1_decoder"
|
||||
vc1_vdpau_decoder_deps="vdpau"
|
||||
vc1_vdpau_decoder_select="vc1_decoder"
|
||||
vc1_vdpau_hwaccel_deps="vdpau"
|
||||
vc1_vdpau_hwaccel_select="vc1_decoder"
|
||||
vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
|
||||
vc1_vdpau_decoder_select="vdpau vc1_decoder"
|
||||
wmv3_crystalhd_decoder_select="crystalhd"
|
||||
wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
|
||||
wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
|
||||
wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
|
||||
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
|
||||
|
||||
# parsers
|
||||
h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
|
||||
h264_parser_select="error_resilience golomb h264dsp h264pred mpegvideo"
|
||||
mpeg4video_parser_select="error_resilience mpegvideo"
|
||||
mpegvideo_parser_select="error_resilience mpegvideo"
|
||||
vc1_parser_select="error_resilience mpegvideo"
|
||||
@@ -1926,10 +1862,8 @@ libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
|
||||
libvorbis_decoder_deps="libvorbis"
|
||||
libvorbis_encoder_deps="libvorbis"
|
||||
libvorbis_encoder_select="audio_frame_queue"
|
||||
libvpx_vp8_decoder_deps="libvpx"
|
||||
libvpx_vp8_encoder_deps="libvpx"
|
||||
libvpx_vp9_decoder_deps="libvpx"
|
||||
libvpx_vp9_encoder_deps="libvpx"
|
||||
libvpx_decoder_deps="libvpx"
|
||||
libvpx_encoder_deps="libvpx"
|
||||
libx264_encoder_deps="libx264"
|
||||
libx264rgb_encoder_deps="libx264"
|
||||
libxavs_encoder_deps="libxavs"
|
||||
@@ -2036,7 +1970,6 @@ rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
|
||||
rtp_protocol_select="udp_protocol"
|
||||
sctp_protocol_deps="struct_sctp_event_subscribe"
|
||||
sctp_protocol_select="network"
|
||||
srtp_protocol_select="rtp_protocol"
|
||||
tcp_protocol_select="network"
|
||||
tls_protocol_deps_any="openssl gnutls"
|
||||
tls_protocol_select="tcp_protocol"
|
||||
@@ -2072,7 +2005,6 @@ movie_filter_deps="avcodec avformat"
|
||||
mp_filter_deps="gpl avcodec swscale inline_asm"
|
||||
mptestsrc_filter_deps="gpl"
|
||||
negate_filter_deps="lut_filter"
|
||||
noise_filter_deps="gpl"
|
||||
resample_filter_deps="avresample"
|
||||
ocv_filter_deps="libopencv"
|
||||
pan_filter_deps="swresample"
|
||||
@@ -2081,7 +2013,6 @@ removelogo_filter_deps="avcodec avformat swscale"
|
||||
scale_filter_deps="swscale"
|
||||
smartblur_filter_deps="gpl swscale"
|
||||
showspectrum_filter_deps="avcodec rdft"
|
||||
stereo3d_filter_deps="gpl"
|
||||
subtitles_filter_deps="avformat avcodec libass"
|
||||
super2xsai_filter_deps="gpl"
|
||||
tinterlace_filter_deps="gpl"
|
||||
@@ -2136,7 +2067,7 @@ cxx_default="g++"
|
||||
host_cc_default="gcc"
|
||||
cp_f="cp -f"
|
||||
install="install"
|
||||
ln_s="ln -s -f"
|
||||
ln_s="ln -sf"
|
||||
nm_default="nm -g"
|
||||
objformat="elf"
|
||||
pkg_config_default=pkg-config
|
||||
@@ -2206,8 +2137,7 @@ HOSTCC_C='-c'
|
||||
HOSTCC_O='-o $@'
|
||||
HOSTLD_O='-o $@'
|
||||
|
||||
host_cflags='-O3 -g'
|
||||
host_cppflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600'
|
||||
host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
|
||||
host_libs='-lm'
|
||||
host_cflags_filter=echo
|
||||
host_ldflags_filter=echo
|
||||
@@ -2284,14 +2214,10 @@ die_unknown(){
|
||||
exit 1
|
||||
}
|
||||
|
||||
print_3_columns() {
|
||||
cat | tr ' ' '\n' | sort | pr -r -3 -t
|
||||
}
|
||||
|
||||
show_list() {
|
||||
suffix=_$1
|
||||
shift
|
||||
echo $* | sed s/$suffix//g | print_3_columns
|
||||
echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
|
||||
exit 0
|
||||
}
|
||||
|
||||
@@ -2579,8 +2505,7 @@ suncc_flags(){
|
||||
core2) echo -xarch=ssse3 -xchip=core2 ;;
|
||||
corei7) echo -xarch=sse4_2 -xchip=nehalem ;;
|
||||
corei7-avx) echo -xarch=avx -xchip=sandybridge ;;
|
||||
amdfam10|barcelona) echo -xtarget=barcelona ;;
|
||||
bdver*) echo -xarch=avx ;;
|
||||
amdfam10|barcelona|bdver*) echo -xarch=sse4_1 ;;
|
||||
athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
|
||||
k8|opteron|athlon64|athlon-fx)
|
||||
echo -xarch=sse2a ;;
|
||||
@@ -2591,8 +2516,7 @@ suncc_flags(){
|
||||
-fomit-frame-pointer) echo -xregs=frameptr ;;
|
||||
-fPIC) echo -KPIC -xcode=pic32 ;;
|
||||
-W*,*) echo $flag ;;
|
||||
-f*-*|-W*|-mimpure-text) ;;
|
||||
-shared) echo -G ;;
|
||||
-f*-*|-W*) ;;
|
||||
*) echo $flag ;;
|
||||
esac
|
||||
done
|
||||
@@ -2655,7 +2579,7 @@ probe_cc(){
|
||||
fi
|
||||
_cflags_speed='-O3'
|
||||
_cflags_size='-Os'
|
||||
elif $_cc --version 2>/dev/null | grep -q ^icc; then
|
||||
elif $_cc --version 2>/dev/null | grep -q Intel; then
|
||||
_type=icc
|
||||
_ident=$($_cc --version | head -n1)
|
||||
_depflags='-MMD'
|
||||
@@ -3230,9 +3154,15 @@ case $target_os in
|
||||
enabled gcc || check_ldflags -Wl,-zmuldefs
|
||||
;;
|
||||
openbsd|bitrig)
|
||||
# On OpenBSD 4.5. the compiler does not use PIC unless
|
||||
# explicitly using -fPIC. FFmpeg builds fine without PIC,
|
||||
# however the generated executable will not do anything
|
||||
# (simply quits with exit-code 1, no crash, no output).
|
||||
# Thus explicitly enable PIC here.
|
||||
enable pic
|
||||
disable symver
|
||||
SHFLAGS='-shared'
|
||||
SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
|
||||
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)'
|
||||
SLIB_INSTALL_LINKS=
|
||||
oss_indev_extralibs="-lossaudio"
|
||||
oss_outdev_extralibs="-lossaudio"
|
||||
@@ -3296,6 +3226,7 @@ case $target_os in
|
||||
objformat="win32"
|
||||
ranlib=:
|
||||
enable dos_paths
|
||||
add_cppflags -U__STRICT_ANSI__
|
||||
;;
|
||||
win32|win64)
|
||||
if enabled shared; then
|
||||
@@ -3410,6 +3341,7 @@ case $target_os in
|
||||
network_extralibs='-lbsd'
|
||||
exeobjs=compat/plan9/main.o
|
||||
disable ffserver
|
||||
ln_s='ln -s -f'
|
||||
cp_f='cp'
|
||||
;;
|
||||
none)
|
||||
@@ -3421,29 +3353,26 @@ esac
|
||||
|
||||
# determine libc flavour
|
||||
|
||||
# uclibc defines __GLIBC__, so it needs to be checked before glibc.
|
||||
if check_cpp_condition features.h "defined __UCLIBC__"; then
|
||||
libc_type=uclibc
|
||||
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
|
||||
elif check_cpp_condition features.h "defined __GLIBC__"; then
|
||||
libc_type=glibc
|
||||
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
|
||||
# MinGW headers can be installed on Cygwin, so check for newlib first.
|
||||
elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
|
||||
libc_type=newlib
|
||||
add_cppflags -U__STRICT_ANSI__
|
||||
elif check_header _mingw.h; then
|
||||
libc_type=mingw
|
||||
check_cpp_condition _mingw.h \
|
||||
"defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \
|
||||
(__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
|
||||
die "ERROR: MinGW runtime version must be >= 3.15."
|
||||
add_cppflags -U__STRICT_ANSI__
|
||||
if check_cpp_condition _mingw.h "defined(__MINGW64_VERSION_MAJOR) && \
|
||||
__MINGW64_VERSION_MAJOR < 3"; then
|
||||
add_compat msvcrt/snprintf.o
|
||||
add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
|
||||
fi
|
||||
elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
|
||||
libc_type=newlib
|
||||
add_cppflags -U__STRICT_ANSI__
|
||||
elif check_func_headers stdlib.h _get_doserrno; then
|
||||
libc_type=msvcrt
|
||||
add_compat strtod.o strtod=avpriv_strtod
|
||||
@@ -3658,8 +3587,9 @@ elif enabled sparc; then
|
||||
|
||||
elif enabled x86; then
|
||||
|
||||
check_builtin rdtsc intrin.h "__rdtsc()"
|
||||
check_builtin mm_empty mmintrin.h "_mm_empty()"
|
||||
check_code ld intrin.h "__rdtsc()" "cc" && enable rdtsc
|
||||
|
||||
check_code ld mmintrin.h "_mm_empty()" "cc" && enable mm_empty
|
||||
|
||||
enable local_aligned_8 local_aligned_16
|
||||
|
||||
@@ -3831,7 +3761,6 @@ check_header termios.h
|
||||
check_header unistd.h
|
||||
check_header vdpau/vdpau.h
|
||||
check_header vdpau/vdpau_x11.h
|
||||
check_header VideoDecodeAcceleration/VDADecoder.h
|
||||
check_header windows.h
|
||||
check_header X11/extensions/XvMClib.h
|
||||
check_header asm/types.h
|
||||
@@ -3839,6 +3768,14 @@ check_header asm/types.h
|
||||
disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
|
||||
disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
|
||||
|
||||
# check for VDA header
|
||||
if ! disabled vda && ! enabled ppc; then
|
||||
if check_header VideoDecodeAcceleration/VDADecoder.h; then
|
||||
enable vda
|
||||
add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! disabled w32threads && ! enabled pthreads; then
|
||||
check_func_headers "windows.h process.h" _beginthreadex && enable w32threads
|
||||
fi
|
||||
@@ -3904,9 +3841,7 @@ enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-
|
||||
flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
|
||||
enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
|
||||
enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
|
||||
enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
|
||||
check_lib "${gsm_hdr}" gsm_create -lgsm && break;
|
||||
done || die "ERROR: libgsm not found"; }
|
||||
enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
|
||||
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
|
||||
enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
|
||||
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
|
||||
@@ -3936,12 +3871,10 @@ enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -l
|
||||
enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
|
||||
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
|
||||
enabled libvpx && {
|
||||
enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
|
||||
die "ERROR: libvpx decoder version must be >=0.9.1"; }
|
||||
enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
|
||||
die "ERROR: libvpx encoder version must be >=0.9.7"; }
|
||||
enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
|
||||
enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } }
|
||||
enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
|
||||
die "ERROR: libvpx decoder must be installed and version must be >=0.9.1"; }
|
||||
enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
|
||||
die "ERROR: libvpx encoder version must be >=0.9.7"; } }
|
||||
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
|
||||
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
|
||||
die "ERROR: libx264 must be installed and version must be >= 0.118."; }
|
||||
@@ -4051,12 +3984,10 @@ if ! disabled vaapi; then
|
||||
} || disable vaapi
|
||||
fi
|
||||
|
||||
enabled vdpau &&
|
||||
if ! disabled vdpau && enabled vdpau_vdpau_h; then
|
||||
check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
|
||||
disable vdpau
|
||||
|
||||
# Funny iconv installations are not unusual, so check it after all flags have been set
|
||||
disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
|
||||
{ echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." && disable vdpau; }
|
||||
fi
|
||||
|
||||
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
|
||||
enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
|
||||
@@ -4147,16 +4078,17 @@ if enabled icc; then
|
||||
check_cflags -w1
|
||||
# -wd: Disable following warnings
|
||||
# 144, 167, 556: -Wno-pointer-sign
|
||||
# 188: enumerated type mixed with another type
|
||||
# 1292: attribute "foo" ignored
|
||||
# 1419: external declaration in primary source file
|
||||
# 10006: ignoring unknown option -fno-signed-zeros
|
||||
# 10148: ignoring unknown option -Wno-parentheses
|
||||
# 10156: ignoring option '-W'; no argument required
|
||||
check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156
|
||||
check_cflags -wd144,167,556,1292,1419,10006,10148,10156
|
||||
# 11030: Warning unknown option --as-needed
|
||||
# 10156: ignoring option '-export'; no argument required
|
||||
check_ldflags -wd10156,11030
|
||||
# Allow to compile with optimizations
|
||||
check_ldflags -march=$cpu
|
||||
# icc 11.0 and 11.1 work with ebp_available, but don't pass the test
|
||||
enable ebp_available
|
||||
if enabled x86_32; then
|
||||
@@ -4319,6 +4251,52 @@ echo "network support ${network-no}"
|
||||
echo "threading support ${thread_type-no}"
|
||||
echo "safe bitstream reader ${safe_bitstream_reader-no}"
|
||||
echo "SDL support ${sdl-no}"
|
||||
echo "libdxva2 enabled ${dxva2-no}"
|
||||
echo "libva enabled ${vaapi-no}"
|
||||
echo "libvdpau enabled ${vdpau-no}"
|
||||
echo "AVISynth enabled ${avisynth-no}"
|
||||
echo "frei0r enabled ${frei0r-no}"
|
||||
echo "gnutls enabled ${gnutls-no}"
|
||||
echo "libaacplus enabled ${libaacplus-no}"
|
||||
echo "libass enabled ${libass-no}"
|
||||
echo "libcaca enabled ${libcaca-no}"
|
||||
echo "libcdio support ${libcdio-no}"
|
||||
echo "libcelt enabled ${libcelt-no}"
|
||||
echo "libdc1394 support ${libdc1394-no}"
|
||||
echo "libfaac enabled ${libfaac-no}"
|
||||
echo "libfdk-aac enabled ${libfdk_aac-no}"
|
||||
echo "libgsm enabled ${libgsm-no}"
|
||||
echo "libiec61883 support ${libiec61883-no}"
|
||||
echo "libilbc enabled ${libilbc-no}"
|
||||
echo "libmodplug enabled ${libmodplug-no}"
|
||||
echo "libmp3lame enabled ${libmp3lame-no}"
|
||||
echo "libnut enabled ${libnut-no}"
|
||||
echo "libopencore-amrnb support ${libopencore_amrnb-no}"
|
||||
echo "libopencore-amrwb support ${libopencore_amrwb-no}"
|
||||
echo "libopencv support ${libopencv-no}"
|
||||
echo "libopenjpeg enabled ${libopenjpeg-no}"
|
||||
echo "libopus enabled ${libopus-no}"
|
||||
echo "libpulse enabled ${libpulse-no}"
|
||||
echo "librtmp enabled ${librtmp-no}"
|
||||
echo "libschroedinger enabled ${libschroedinger-no}"
|
||||
echo "libsoxr enabled ${libsoxr-no}"
|
||||
echo "libspeex enabled ${libspeex-no}"
|
||||
echo "libstagefright-h264 enabled ${libstagefright_h264-no}"
|
||||
echo "libtheora enabled ${libtheora-no}"
|
||||
echo "libtwolame enabled ${libtwolame-no}"
|
||||
echo "libutvideo enabled ${libutvideo-no}"
|
||||
echo "libv4l2 enabled ${libv4l2-no}"
|
||||
echo "libvo-aacenc support ${libvo_aacenc-no}"
|
||||
echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
|
||||
echo "libvorbis enabled ${libvorbis-no}"
|
||||
echo "libvpx enabled ${libvpx-no}"
|
||||
echo "libx264 enabled ${libx264-no}"
|
||||
echo "libxavs enabled ${libxavs-no}"
|
||||
echo "libxvid enabled ${libxvid-no}"
|
||||
echo "openal enabled ${openal-no}"
|
||||
echo "openssl enabled ${openssl-no}"
|
||||
echo "zlib enabled ${zlib-no}"
|
||||
echo "bzlib enabled ${bzlib-no}"
|
||||
echo "texi2html enabled ${texi2html-no}"
|
||||
echo "perl enabled ${perl-no}"
|
||||
echo "pod2man enabled ${pod2man-no}"
|
||||
@@ -4327,14 +4305,10 @@ test -n "$random_seed" &&
|
||||
echo "random seed ${random_seed}"
|
||||
echo
|
||||
|
||||
echo "External libraries:"
|
||||
print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
|
||||
echo
|
||||
|
||||
for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
|
||||
echo "Enabled ${type}s:"
|
||||
eval list=\$$(toupper $type)_LIST
|
||||
print_enabled '_*' $list | print_3_columns
|
||||
print_enabled '_*' $list | sort | pr -r -3 -t
|
||||
echo
|
||||
done
|
||||
|
||||
@@ -4411,7 +4385,7 @@ LD_PATH=$LD_PATH
|
||||
DLLTOOL=$dlltool
|
||||
LDFLAGS=$LDFLAGS
|
||||
LDFLAGS-ffserver=$FFSERVERLDFLAGS
|
||||
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
|
||||
SHFLAGS=$SHFLAGS
|
||||
YASMFLAGS=$YASMFLAGS
|
||||
BUILDSUF=$build_suffix
|
||||
PROGSSUF=$progs_suffix
|
||||
@@ -4433,7 +4407,6 @@ AS_DEPFLAGS=$AS_DEPFLAGS
|
||||
HOSTCC=$host_cc
|
||||
HOSTLD=$host_ld
|
||||
HOSTCFLAGS=$host_cflags
|
||||
HOSTCPPFLAGS=$host_cppflags
|
||||
HOSTEXESUF=$HOSTEXESUF
|
||||
HOSTLDFLAGS=$host_ldflags
|
||||
HOSTLIBS=$host_libs
|
||||
@@ -4477,7 +4450,6 @@ get_version(){
|
||||
eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
|
||||
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
|
||||
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
|
||||
eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
|
||||
}
|
||||
|
||||
map 'get_version $v' $LIBRARY_LIST
|
||||
@@ -4552,7 +4524,7 @@ pkgconfig_generate(){
|
||||
requires=$5
|
||||
enabled ${name#lib} || return 0
|
||||
mkdir -p $name
|
||||
cat <<EOF > $name/$name${build_suffix}.pc
|
||||
cat <<EOF > $name/$name.pc
|
||||
prefix=$prefix
|
||||
exec_prefix=\${prefix}
|
||||
libdir=$libdir
|
||||
@@ -4588,27 +4560,27 @@ Cflags: -I\${includedir}
|
||||
EOF
|
||||
}
|
||||
|
||||
libavfilter_pc_deps="libavutil${build_suffix} = $LIBAVUTIL_VERSION"
|
||||
enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec${build_suffix} = $LIBAVCODEC_VERSION,"
|
||||
enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat${build_suffix} = $LIBAVFORMAT_VERSION,"
|
||||
enabled libavfilter_deps_avresample && prepend libavfilter_pc_deps "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION,"
|
||||
enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale${build_suffix} = $LIBSWSCALE_VERSION,"
|
||||
enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION,"
|
||||
enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION,"
|
||||
libavfilter_pc_deps="libavutil = $LIBAVUTIL_VERSION"
|
||||
enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
|
||||
enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
|
||||
enabled libavfilter_deps_avresample && prepend libavfilter_pc_deps "libavresample = $LIBAVRESAMPLE_VERSION,"
|
||||
enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
|
||||
enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION,"
|
||||
enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION,"
|
||||
libavfilter_pc_deps=${libavfilter_pc_deps%, }
|
||||
|
||||
libavdevice_pc_deps="libavformat${build_suffix} = $LIBAVFORMAT_VERSION"
|
||||
enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter${build_suffix} = $LIBAVFILTER_VERSION,"
|
||||
libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION"
|
||||
enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION,"
|
||||
|
||||
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
|
||||
pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION"
|
||||
pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
|
||||
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
|
||||
pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
|
||||
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
|
||||
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
|
||||
|
||||
fix_ffmpeg_remote(){
|
||||
git_remote_from=$1
|
||||
|
@@ -15,19 +15,7 @@ libavutil: 2012-10-22
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2013-03-07 - xxxxxx - lavu 52.18.100 - avstring.h,bprint.h
|
||||
Add av_escape() and av_bprint_escape() API.
|
||||
|
||||
2013-02-24 - xxxxxx - lavfi 3.41.100 - buffersink.h
|
||||
Add sample_rates field to AVABufferSinkParams.
|
||||
|
||||
2013-01-17 - a1a707f - lavf 54.61.100
|
||||
Add av_codec_get_tag2().
|
||||
|
||||
2013-01-01 - 2eb2e17 - lavfi 3.34.100
|
||||
Add avfilter_get_audio_buffer_ref_from_arrays_channels.
|
||||
|
||||
2012-12-20 - 34de47aa - lavfi 3.29.100 - avfilter.h
|
||||
2012-12-20 - xxxxxxx - lavfi 3.28.100 - avfilter.h
|
||||
Add AVFilterLink.channels, avfilter_link_get_channels()
|
||||
and avfilter_ref_get_channels().
|
||||
|
||||
@@ -144,30 +132,6 @@ API changes, most recent first:
|
||||
2012-03-26 - a67d9cf - lavfi 2.66.100
|
||||
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
|
||||
|
||||
2013-xx-xx - xxxxxxx - lavfi 3.4.0 - avfiltergraph.h
|
||||
Add resample_lavr_opts to AVFilterGraph for setting libavresample options
|
||||
for auto-inserted resample filters.
|
||||
|
||||
2013-xx-xx - xxxxxxx - lavu 52.7.0 - dict.h
|
||||
Add av_dict_parse_string() to set multiple key/value pairs at once from a
|
||||
string.
|
||||
|
||||
2013-01-xx - xxxxxxx - lavu 52.6.0 - avstring.h
|
||||
Add av_strnstr()
|
||||
|
||||
2013-01-xx - xxxxxxx - lavu 52.5.0 - hmac.h
|
||||
Add AVHMAC.
|
||||
|
||||
2013-01-13 - xxxxxxx - lavc 54.87.100 / 54.36.0 - vdpau.h
|
||||
Add AVVDPAUContext struct for VDPAU hardware-accelerated decoding.
|
||||
|
||||
2013-01-12 - dae382b / 169fb94 - lavu 52.14.100 / 52.4.0 - pixdesc.h
|
||||
Add AV_PIX_FMT_VDPAU flag.
|
||||
|
||||
2013-01-07 - 249fca3 / 074a00d - lavr 1.1.0
|
||||
Add avresample_set_channel_mapping() for input channel reordering,
|
||||
duplication, and silencing.
|
||||
|
||||
2012-12-29 - 2ce43b3 / d8fd06c - lavu 52.13.100 / 52.3.0 - avstring.h
|
||||
Add av_basename() and av_dirname().
|
||||
|
||||
|
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.2.1
|
||||
PROJECT_NUMBER = 1.1.5
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
@@ -62,7 +62,7 @@ doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
|
||||
$(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
|
||||
|
||||
doc/%.pod: TAG = POD
|
||||
doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
|
||||
doc/%.pod: doc/%.texi $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
* 1.2 "Magic" March, 2013
|
||||
* 1.1 "Fire Flower" January, 2013
|
||||
|
||||
|
||||
General notes
|
||||
@@ -14,3 +14,12 @@ accepted. If you are experiencing issues with any formally released version of
|
||||
FFmpeg, please try git master to check if the issue still exists. If it does,
|
||||
make your report against the development code following the usual bug reporting
|
||||
guidelines.
|
||||
|
||||
Of big interest to our Windows users, FFmpeg now supports building with the MSVC
|
||||
compiler. Since MSVC does not support C99 features used extensively by FFmpeg,
|
||||
this has been accomplished using a converter that turns C99 code to C89. See the
|
||||
platform-specific documentation for more detailed documentation on building
|
||||
FFmpeg with MSVC.
|
||||
|
||||
The used output sample format for several audio decoders has changed, make
|
||||
sure you always check/use AVCodecContext.sample_fmt or AVFrame.format.
|
||||
|
@@ -6,100 +6,18 @@ multimedia streams from a particular type of file.
|
||||
|
||||
When you configure your FFmpeg build, all the supported demuxers
|
||||
are enabled by default. You can list all available ones using the
|
||||
configure option @code{--list-demuxers}.
|
||||
configure option "--list-demuxers".
|
||||
|
||||
You can disable all the demuxers using the configure option
|
||||
@code{--disable-demuxers}, and selectively enable a single demuxer with
|
||||
the option @code{--enable-demuxer=@var{DEMUXER}}, or disable it
|
||||
with the option @code{--disable-demuxer=@var{DEMUXER}}.
|
||||
"--disable-demuxers", and selectively enable a single demuxer with
|
||||
the option "--enable-demuxer=@var{DEMUXER}", or disable it
|
||||
with the option "--disable-demuxer=@var{DEMUXER}".
|
||||
|
||||
The option @code{-formats} of the ff* tools will display the list of
|
||||
The option "-formats" of the ff* tools will display the list of
|
||||
enabled demuxers.
|
||||
|
||||
The description of some of the currently available demuxers follows.
|
||||
|
||||
@section applehttp
|
||||
|
||||
Apple HTTP Live Streaming demuxer.
|
||||
|
||||
This demuxer presents all AVStreams from all variant streams.
|
||||
The id field is set to the bitrate variant index number. By setting
|
||||
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
|
||||
the caller can decide which variant streams to actually receive.
|
||||
The total bitrate of the variant that the stream belongs to is
|
||||
available in a metadata key named "variant_bitrate".
|
||||
|
||||
@anchor{concat}
|
||||
@section concat
|
||||
|
||||
Virtual concatenation script demuxer.
|
||||
|
||||
This demuxer reads a list of files and other directives from a text file and
|
||||
demuxes them one after the other, as if all their packet had been muxed
|
||||
together.
|
||||
|
||||
The timestamps in the files are adjusted so that the first file starts at 0
|
||||
and each next file starts where the previous one finishes. Note that it is
|
||||
done globally and may cause gaps if all streams do not have exactly the same
|
||||
length.
|
||||
|
||||
All files must have the same streams (same codecs, same time base, etc.).
|
||||
|
||||
The duration of each file is used to adjust the timestamps of the next file:
|
||||
if the duration is incorrect (because it was computed using the bit-rate or
|
||||
because the file is truncated, for example), it can cause artifacts. The
|
||||
@code{duration} directive can be used to override the duration stored in
|
||||
each file.
|
||||
|
||||
@subsection Syntax
|
||||
|
||||
The script is a text file in extended-ASCII, with one directive per line.
|
||||
Empty lines, leading spaces and lines starting with '#' are ignored. The
|
||||
following directive is recognized:
|
||||
|
||||
@table @option
|
||||
|
||||
@item @code{file @var{path}}
|
||||
Path to a file to read; special characters and spaces must be escaped with
|
||||
backslash or single quotes.
|
||||
|
||||
All subsequent directives apply to that file.
|
||||
|
||||
@item @code{ffconcat version 1.0}
|
||||
Identify the script type and version. It also sets the @option{safe} option
|
||||
to 1 if it was to its default -1.
|
||||
|
||||
To make FFmpeg recognize the format automatically, this directive must
|
||||
appears exactly as is (no extra space or byte-order-mark) on the very first
|
||||
line of the script.
|
||||
|
||||
@item @code{duration @var{dur}}
|
||||
Duration of the file. This information can be specified from the file;
|
||||
specifying it here may be more efficient or help if the information from the
|
||||
file is not available or accurate.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Options
|
||||
|
||||
This demuxer accepts the following option:
|
||||
|
||||
@table @option
|
||||
|
||||
@item safe
|
||||
If set to 1, reject unsafe file paths. A file path is considered safe if it
|
||||
does not contain a protocol specification and is relative and all components
|
||||
only contain characters from the portable character set (letters, digits,
|
||||
period, underscore and hyphen) and have no period at the beginning of a
|
||||
component.
|
||||
|
||||
If set to 0, any file name is accepted.
|
||||
|
||||
The default is -1, it is equivalent to 1 if the format was automatically
|
||||
probed and 0 otherwise.
|
||||
|
||||
@end table
|
||||
|
||||
@section image2
|
||||
|
||||
Image file demuxer.
|
||||
@@ -225,34 +143,16 @@ ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section rawvideo
|
||||
@section applehttp
|
||||
|
||||
Raw video demuxer.
|
||||
Apple HTTP Live Streaming demuxer.
|
||||
|
||||
This demuxer allows to read raw video data. Since there is no header
|
||||
specifying the assumed video parameters, the user must specify them
|
||||
in order to be able to decode the data correctly.
|
||||
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
|
||||
@item framerate
|
||||
Set input video frame rate. Default value is 25.
|
||||
|
||||
@item pixel_format
|
||||
Set the input video pixel format. Default value is @code{yuv420p}.
|
||||
|
||||
@item video_size
|
||||
Set the input video size. This value must be specified explicitly.
|
||||
@end table
|
||||
|
||||
For example to read a rawvideo file @file{input.raw} with
|
||||
@command{ffplay}, assuming a pixel format of @code{rgb24}, a video
|
||||
size of @code{320x240}, and a frame rate of 10 images per second, use
|
||||
the command:
|
||||
@example
|
||||
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
|
||||
@end example
|
||||
This demuxer presents all AVStreams from all variant streams.
|
||||
The id field is set to the bitrate variant index number. By setting
|
||||
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
|
||||
the caller can decide which variant streams to actually receive.
|
||||
The total bitrate of the variant that the stream belongs to is
|
||||
available in a metadata key named "variant_bitrate".
|
||||
|
||||
@section sbg
|
||||
|
||||
@@ -284,6 +184,37 @@ the script is directly played, the actual times will match the absolute
|
||||
timestamps up to the sound controller's clock accuracy, but if the user
|
||||
somehow pauses the playback or seeks, all times will be shifted accordingly.
|
||||
|
||||
@section concat
|
||||
|
||||
Virtual concatenation script demuxer.
|
||||
|
||||
This demuxer reads a list of files and other directives from a text file and
|
||||
demuxes them one after the other, as if all their packet had been muxed
|
||||
together.
|
||||
|
||||
The timestamps in the files are adjusted so that the first file starts at 0
|
||||
and each next file starts where the previous one finishes. Note that it is
|
||||
done globally and may cause gaps if all streams do not have exactly the same
|
||||
length.
|
||||
|
||||
All files must have the same streams (same codecs, same time base, etc.).
|
||||
|
||||
This script format can currently not be probed, it must be specified explicitly.
|
||||
|
||||
@subsection Syntax
|
||||
|
||||
The script is a text file in extended-ASCII, with one directive per line.
|
||||
Empty lines, leading spaces and lines starting with '#' are ignored. The
|
||||
following directive is recognized:
|
||||
|
||||
@table @option
|
||||
|
||||
@item @code{file @var{path}}
|
||||
Path to a file to read; special characters and spaces must be escaped with
|
||||
backslash or single quotes.
|
||||
|
||||
@end table
|
||||
|
||||
@section tedcaptions
|
||||
|
||||
JSON captions used for @url{http://www.ted.com/, TED Talks}.
|
||||
@@ -305,4 +236,4 @@ Example: convert the captions to a format most players understand:
|
||||
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
|
||||
@end example
|
||||
|
||||
@c man end DEMUXERS
|
||||
@c man end INPUT DEVICES
|
||||
|
@@ -147,41 +147,29 @@ GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
|
||||
@end itemize
|
||||
|
||||
@subsection Naming conventions
|
||||
All names should be composed with underscores (_), not CamelCase. For example,
|
||||
@samp{avfilter_get_video_buffer} is an acceptable function name and
|
||||
@samp{AVFilterGetVideo} is not. The exception from this are type names, like
|
||||
All names are using underscores (_), not CamelCase. For example, @samp{avfilter_get_video_buffer} is
|
||||
a valid function name and @samp{AVFilterGetVideo} is not. The exception from this are type names, like
|
||||
for example structs and enums; they should always be in the CamelCase
|
||||
|
||||
There are the following conventions for naming variables and functions:
|
||||
|
||||
There are following conventions for naming variables and functions:
|
||||
@itemize @bullet
|
||||
@item
|
||||
For local variables no prefix is required.
|
||||
@item
|
||||
For variables and functions declared as @code{static} no prefix is required.
|
||||
For variables and functions declared as @code{static} no prefixes are required.
|
||||
@item
|
||||
For variables and functions used internally by a library an @code{ff_}
|
||||
prefix should be used, e.g. @samp{ff_w64_demuxer}.
|
||||
For variables and functions used internally by the library, @code{ff_} prefix
|
||||
should be used.
|
||||
For example, @samp{ff_w64_demuxer}.
|
||||
@item
|
||||
For variables and functions used internally across multiple libraries, use
|
||||
@code{avpriv_}. For example, @samp{avpriv_aac_parse_header}.
|
||||
@item
|
||||
Each library has its own prefix for public symbols, in addition to the
|
||||
commonly used @code{av_} (@code{avformat_} for libavformat,
|
||||
@code{avcodec_} for libavcodec, @code{swr_} for libswresample, etc).
|
||||
Check the existing code and choose names accordingly.
|
||||
Note that some symbols without these prefixes are also exported for
|
||||
retro-compatibility reasons. These exceptions are declared in the
|
||||
@code{lib<name>/lib<name>.v} files.
|
||||
For exported names, each library has its own prefixes. Just check the existing
|
||||
code and name accordingly.
|
||||
@end itemize
|
||||
|
||||
Furthermore, name space reserved for the system should not be invaded.
|
||||
Identifiers ending in @code{_t} are reserved by
|
||||
@url{http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html#tag_02_02_02, POSIX}.
|
||||
Also avoid names starting with @code{__} or @code{_} followed by an uppercase
|
||||
letter as they are reserved by the C standard. Names starting with @code{_}
|
||||
are reserved at the file level and may not be used for externally visible
|
||||
symbols. If in doubt, just avoid names starting with @code{_} altogether.
|
||||
|
||||
@subsection Miscellaneous conventions
|
||||
@itemize @bullet
|
||||
@item
|
||||
@@ -229,13 +217,8 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Contributions should be licensed under the
|
||||
@uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
|
||||
including an "or any later version" clause, or, if you prefer
|
||||
a gift-style license, the
|
||||
@uref{http://www.isc.org/software/license/, ISC} or
|
||||
@uref{http://mit-license.org/, MIT} license.
|
||||
@uref{http://www.gnu.org/licenses/gpl-2.0.html, GPL 2} including
|
||||
Contributions should be licensed under the LGPL 2.1, including an
|
||||
"or any later version" clause, or the MIT license. GPL 2 including
|
||||
an "or any later version" clause is also acceptable, but LGPL is
|
||||
preferred.
|
||||
@item
|
||||
@@ -245,13 +228,6 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
|
||||
You can commit unfinished stuff (for testing etc), but it must be disabled
|
||||
(#ifdef etc) by default so it does not interfere with other developers'
|
||||
work.
|
||||
@item
|
||||
The commit message should have a short first line in the form of
|
||||
a @samp{topic: short description} as a header, separated by a newline
|
||||
from the body consisting of an explanation of why the change is necessary.
|
||||
If the commit fixes a known bug on the bug tracker, the commit message
|
||||
should include its bug ID. Referring to the issue on the bug tracker does
|
||||
not exempt you from writing an excerpt of the bug in the commit message.
|
||||
@item
|
||||
You do not have to over-test things. If it works for you, and you think it
|
||||
should work for others, then commit. If your code has problems
|
||||
@@ -358,6 +334,8 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
Note, these rules are mostly borrowed from the MPlayer project.
|
||||
|
||||
@anchor{Submitting patches}
|
||||
@section Submitting patches
|
||||
|
||||
@@ -380,6 +358,11 @@ The tool is located in the tools directory.
|
||||
Run the @ref{Regression tests} before submitting a patch in order to verify
|
||||
it does not cause unexpected problems.
|
||||
|
||||
Patches should be posted as base64 encoded attachments (or any other
|
||||
encoding which ensures that the patch will not be trashed during
|
||||
transmission) to the ffmpeg-devel mailing list, see
|
||||
@url{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel}
|
||||
|
||||
It also helps quite a bit if you tell us what the patch does (for example
|
||||
'replaces lrint by lrintf'), and why (for example '*BSD isn't C99 compliant
|
||||
and has no lrint()')
|
||||
@@ -387,13 +370,6 @@ and has no lrint()')
|
||||
Also please if you send several patches, send each patch as a separate mail,
|
||||
do not attach several unrelated patches to the same mail.
|
||||
|
||||
Patches should be posted to the
|
||||
@uref{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel, ffmpeg-devel}
|
||||
mailing list. Use @code{git send-email} when possible since it will properly
|
||||
send patches without requiring extra care. If you cannot, then send patches
|
||||
as base64-encoded attachments, so your patch is not trashed during
|
||||
transmission.
|
||||
|
||||
Your patch will be reviewed on the mailing list. You will likely be asked
|
||||
to make some changes and are expected to send in an improved version that
|
||||
incorporates the requests from the review. This process may go through
|
||||
@@ -422,7 +398,7 @@ send a reminder by email. Your patch should eventually be dealt with.
|
||||
When adding new codec IDs, also add an entry to the codec descriptor
|
||||
list in @file{libavcodec/codec_desc.c}.
|
||||
@item
|
||||
If it has a FourCC, did you add it to @file{libavformat/riff.c},
|
||||
If it has a fourCC, did you add it to @file{libavformat/riff.c},
|
||||
even if it is only a decoder?
|
||||
@item
|
||||
Did you add a rule to compile the appropriate files in the Makefile?
|
||||
@@ -475,10 +451,8 @@ send a reminder by email. Your patch should eventually be dealt with.
|
||||
other security issues?
|
||||
@item
|
||||
Did you test your decoder or demuxer against damaged data? If no, see
|
||||
tools/trasher, the noise bitstream filter, and
|
||||
@uref{http://caca.zoy.org/wiki/zzuf, zzuf}. Your decoder or demuxer
|
||||
should not crash, end in a (near) infinite loop, or allocate ridiculous
|
||||
amounts of memory when fed damaged data.
|
||||
tools/trasher and the noise bitstream filter. Your decoder or demuxer
|
||||
should not crash or end in a (near) infinite loop when fed damaged data.
|
||||
@item
|
||||
Does the patch not mix functional and cosmetic changes?
|
||||
@item
|
||||
@@ -522,9 +496,6 @@ send a reminder by email. Your patch should eventually be dealt with.
|
||||
Make sure you check the return values of function and return appropriate
|
||||
error codes. Especially memory allocation functions like @code{av_malloc()}
|
||||
are notoriously left unchecked, which is a serious problem.
|
||||
@item
|
||||
Test your code with valgrind and or Address Sanitizer to ensure it's free
|
||||
of leaks, out of array accesses, etc.
|
||||
@end enumerate
|
||||
|
||||
@section Patch review process
|
||||
|
@@ -581,175 +581,40 @@ For more information about libvpx see:
|
||||
|
||||
@section libx264
|
||||
|
||||
x264 H.264/MPEG-4 AVC encoder wrapper
|
||||
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 format supported through
|
||||
libx264.
|
||||
|
||||
Requires the presence of the libx264 headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libx264}.
|
||||
|
||||
x264 supports an impressive number of features, including 8x8 and 4x4 adaptive
|
||||
spatial transform, adaptive B-frame placement, CAVLC/CABAC entropy coding,
|
||||
interlacing (MBAFF), lossless mode, psy optimizations for detail retention
|
||||
(adaptive quantization, psy-RD, psy-trellis).
|
||||
@subsection Options
|
||||
|
||||
The FFmpeg wrapper provides a mapping for most of them using global options
|
||||
that match those of the encoders and provides private options for the unique
|
||||
encoder options. Additionally an expert override is provided to directly pass
|
||||
a list of key=value tuples as accepted by x264_param_parse.
|
||||
|
||||
@subsection Option Mapping
|
||||
|
||||
The following options are supported by the x264 wrapper, the x264-equivalent
|
||||
options follow the FFmpeg ones.
|
||||
|
||||
@multitable @columnfractions .2 .2
|
||||
@item b @tab bitrate
|
||||
FFmpeg @code{b} option is expressed in bits/s, x264 @code{bitrate} in kilobits/s.
|
||||
@item bf @tab bframes
|
||||
Maximum number of B-frames.
|
||||
@item g @tab keyint
|
||||
Maximum GOP size.
|
||||
@item qmin @tab qpmin
|
||||
@item qmax @tab qpmax
|
||||
@item qdiff @tab qpstep
|
||||
@item qblur @tab qblur
|
||||
@item qcomp @tab qcomp
|
||||
@item refs @tab ref
|
||||
@item sc_threshold @tab scenecut
|
||||
@item trellis @tab trellis
|
||||
@item nr @tab nr
|
||||
Noise reduction.
|
||||
@item me_range @tab merange
|
||||
@item me_method @tab me
|
||||
@item subq @tab subme
|
||||
@item b_strategy @tab b-adapt
|
||||
@item keyint_min @tab keyint-min
|
||||
@item coder @tab cabac
|
||||
Set coder to @code{ac} to use CABAC.
|
||||
@item cmp @tab chroma-me
|
||||
Set to @code{chroma} to use chroma motion estimation.
|
||||
@item threads @tab threads
|
||||
@item thread_type @tab sliced_threads
|
||||
Set to @code{slice} to use sliced threading instead of frame threading.
|
||||
@item flags -cgop @tab open-gop
|
||||
Set @code{-cgop} to use recovery points to close GOPs.
|
||||
@item rc_init_occupancy @tab vbv-init
|
||||
Initial buffer occupancy.
|
||||
@end multitable
|
||||
|
||||
@subsection Private Options
|
||||
@table @option
|
||||
@item -preset @var{string}
|
||||
Set the encoding preset (cf. x264 --fullhelp).
|
||||
@item -tune @var{string}
|
||||
Tune the encoding params (cf. x264 --fullhelp).
|
||||
@item -profile @var{string}
|
||||
Set profile restrictions (cf. x264 --fullhelp).
|
||||
@item -fastfirstpass @var{integer}
|
||||
Use fast settings when encoding first pass.
|
||||
@item -crf @var{float}
|
||||
Select the quality for constant quality mode.
|
||||
@item -crf_max @var{float}
|
||||
In CRF mode, prevents VBV from lowering quality beyond this point.
|
||||
@item -qp @var{integer}
|
||||
Constant quantization parameter rate control method.
|
||||
@item -aq-mode @var{integer}
|
||||
AQ method
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item none
|
||||
@item preset @var{preset_name}
|
||||
Set the encoding preset.
|
||||
|
||||
@item variance
|
||||
Variance AQ (complexity mask).
|
||||
@item autovariance
|
||||
Auto-variance AQ (experimental).
|
||||
@end table
|
||||
@item -aq-strength @var{float}
|
||||
AQ strength, reduces blocking and blurring in flat and textured areas.
|
||||
@item -psy @var{integer}
|
||||
Use psychovisual optimizations.
|
||||
@item -psy-rd @var{string}
|
||||
Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.
|
||||
@item -rc-lookahead @var{integer}
|
||||
Number of frames to look ahead for frametype and ratecontrol.
|
||||
@item -weightb @var{integer}
|
||||
Weighted prediction for B-frames.
|
||||
@item -weightp @var{integer}
|
||||
Weighted prediction analysis method.
|
||||
@item tune @var{tune_name}
|
||||
Tune the encoding params.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item none
|
||||
@item fastfirstpass @var{bool}
|
||||
Use fast settings when encoding first pass, default value is 1.
|
||||
|
||||
@item simple
|
||||
@item profile @var{profile_name}
|
||||
Set profile restrictions.
|
||||
|
||||
@item smart
|
||||
@item level @var{level}
|
||||
Specify level (as defined by Annex A).
|
||||
Deprecated in favor of @var{x264opts}.
|
||||
|
||||
@end table
|
||||
@item -ssim @var{integer}
|
||||
Calculate and print SSIM stats.
|
||||
@item -intra-refresh @var{integer}
|
||||
Use Periodic Intra Refresh instead of IDR frames.
|
||||
@item -b-bias @var{integer}
|
||||
Influences how often B-frames are used.
|
||||
@item -b-pyramid @var{integer}
|
||||
Keep some B-frames as references.
|
||||
@item passlogfile @var{filename}
|
||||
Specify filename for 2 pass stats.
|
||||
Deprecated in favor of @var{x264opts} (see @var{stats} libx264 option).
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item none
|
||||
|
||||
@item strict
|
||||
Strictly hierarchical pyramid.
|
||||
@item normal
|
||||
Non-strict (not Blu-ray compatible).
|
||||
@end table
|
||||
@item -mixed-refs @var{integer}
|
||||
One reference per partition, as opposed to one reference per macroblock.
|
||||
@item -8x8dct @var{integer}
|
||||
High profile 8x8 transform.
|
||||
@item -fast-pskip @var{integer}
|
||||
@item -aud @var{integer}
|
||||
Use access unit delimiters.
|
||||
@item -mbtree @var{integer}
|
||||
Use macroblock tree ratecontrol.
|
||||
@item -deblock @var{string}
|
||||
Loop filter parameters, in <alpha:beta> form.
|
||||
@item -cplxblur @var{float}
|
||||
Reduce fluctuations in QP (before curve compression).
|
||||
@item -partitions @var{string}
|
||||
A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all.
|
||||
@item -direct-pred @var{integer}
|
||||
Direct MV prediction mode
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item none
|
||||
|
||||
@item spatial
|
||||
|
||||
@item temporal
|
||||
|
||||
@item auto
|
||||
|
||||
@end table
|
||||
@item -slice-max-size @var{integer}
|
||||
Limit the size of each slice in bytes.
|
||||
@item -stats @var{string}
|
||||
Filename for 2 pass stats.
|
||||
@item -nal-hrd @var{integer}
|
||||
Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4).
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item none
|
||||
|
||||
@item vbr
|
||||
|
||||
@item cbr
|
||||
|
||||
@end table
|
||||
@item wpredp @var{wpred_type}
|
||||
Specify Weighted prediction for P-frames.
|
||||
Deprecated in favor of @var{x264opts} (see @var{weightp} libx264 option).
|
||||
|
||||
@item x264opts @var{options}
|
||||
Allow to set any x264 option, see @code{x264 --fullhelp} for a list.
|
||||
@@ -758,6 +623,7 @@ Allow to set any x264 option, see @code{x264 --fullhelp} for a list.
|
||||
":". In @var{filter} and @var{psy-rd} options that use ":" as a separator
|
||||
themselves, use "," instead. They accept it as well since long ago but this
|
||||
is kept undocumented for some reason.
|
||||
@end table
|
||||
|
||||
For example to specify libx264 encoding options with @command{ffmpeg}:
|
||||
@example
|
||||
@@ -767,14 +633,4 @@ ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
|
||||
For more information about libx264 and the supported options see:
|
||||
@url{http://www.videolan.org/developers/x264.html}
|
||||
|
||||
@item -x264-params @var{string}
|
||||
Override the x264 configuration using a :-separated list of key=value parameters.
|
||||
@example
|
||||
-x264-params level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0
|
||||
@end example
|
||||
@end table
|
||||
|
||||
Encoding avpresets for common usages are provided so they can be used with the
|
||||
general presets system (e.g. passing the @code{-pre} option).
|
||||
|
||||
@c man end VIDEO ENCODERS
|
||||
|
302
doc/eval.texi
302
doc/eval.texi
@@ -20,93 +20,57 @@ The following unary operators are available: @code{+}, @code{-}.
|
||||
|
||||
The following functions are available:
|
||||
@table @option
|
||||
@item abs(x)
|
||||
Compute absolute value of @var{x}.
|
||||
|
||||
@item acos(x)
|
||||
Compute arccosine of @var{x}.
|
||||
|
||||
@item asin(x)
|
||||
Compute arcsine of @var{x}.
|
||||
|
||||
@item atan(x)
|
||||
Compute arctangent of @var{x}.
|
||||
|
||||
@item ceil(expr)
|
||||
Round the value of expression @var{expr} upwards to the nearest
|
||||
integer. For example, "ceil(1.5)" is "2.0".
|
||||
|
||||
@item cos(x)
|
||||
Compute cosine of @var{x}.
|
||||
@item sinh(x)
|
||||
Compute hyperbolic sine of @var{x}.
|
||||
|
||||
@item cosh(x)
|
||||
Compute hyperbolic cosine of @var{x}.
|
||||
|
||||
@item eq(x, y)
|
||||
Return 1 if @var{x} and @var{y} are equivalent, 0 otherwise.
|
||||
@item tanh(x)
|
||||
Compute hyperbolic tangent of @var{x}.
|
||||
|
||||
@item sin(x)
|
||||
Compute sine of @var{x}.
|
||||
|
||||
@item cos(x)
|
||||
Compute cosine of @var{x}.
|
||||
|
||||
@item tan(x)
|
||||
Compute tangent of @var{x}.
|
||||
|
||||
@item atan(x)
|
||||
Compute arctangent of @var{x}.
|
||||
|
||||
@item asin(x)
|
||||
Compute arcsine of @var{x}.
|
||||
|
||||
@item acos(x)
|
||||
Compute arccosine of @var{x}.
|
||||
|
||||
@item exp(x)
|
||||
Compute exponential of @var{x} (with base @code{e}, the Euler's number).
|
||||
|
||||
@item floor(expr)
|
||||
Round the value of expression @var{expr} downwards to the nearest
|
||||
integer. For example, "floor(-1.5)" is "-2.0".
|
||||
@item log(x)
|
||||
Compute natural logarithm of @var{x}.
|
||||
|
||||
@item abs(x)
|
||||
Compute absolute value of @var{x}.
|
||||
|
||||
@item squish(x)
|
||||
Compute expression @code{1/(1 + exp(4*x))}.
|
||||
|
||||
@item gauss(x)
|
||||
Compute Gauss function of @var{x}, corresponding to
|
||||
@code{exp(-x*x/2) / sqrt(2*PI)}.
|
||||
|
||||
@item gcd(x, y)
|
||||
Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
|
||||
@var{y} are 0 or either or both are less than zero then behavior is undefined.
|
||||
|
||||
@item gt(x, y)
|
||||
Return 1 if @var{x} is greater than @var{y}, 0 otherwise.
|
||||
|
||||
@item gte(x, y)
|
||||
Return 1 if @var{x} is greater than or equal to @var{y}, 0 otherwise.
|
||||
|
||||
@item hypot(x, y)
|
||||
This function is similar to the C function with the same name; it returns
|
||||
"sqrt(@var{x}*@var{x} + @var{y}*@var{y})", the length of the hypotenuse of a
|
||||
right triangle with sides of length @var{x} and @var{y}, or the distance of the
|
||||
point (@var{x}, @var{y}) from the origin.
|
||||
|
||||
@item if(x, y)
|
||||
Evaluate @var{x}, and if the result is non-zero return the result of
|
||||
the evaluation of @var{y}, return 0 otherwise.
|
||||
|
||||
@item if(x, y, z)
|
||||
Evaluate @var{x}, and if the result is non-zero return the evaluation
|
||||
result of @var{y}, otherwise the evaluation result of @var{z}.
|
||||
|
||||
@item ifnot(x, y)
|
||||
Evaluate @var{x}, and if the result is zero return the result of the
|
||||
evaluation of @var{y}, return 0 otherwise.
|
||||
|
||||
@item ifnot(x, y, z)
|
||||
Evaluate @var{x}, and if the result is zero return the evaluation
|
||||
result of @var{y}, otherwise the evaluation result of @var{z}.
|
||||
|
||||
@item isinf(x)
|
||||
Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
|
||||
|
||||
@item isnan(x)
|
||||
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
|
||||
|
||||
@item ld(var)
|
||||
Allow to load the value of the internal variable with number
|
||||
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
|
||||
The function returns the loaded value.
|
||||
|
||||
@item log(x)
|
||||
Compute natural logarithm of @var{x}.
|
||||
|
||||
@item lt(x, y)
|
||||
Return 1 if @var{x} is lesser than @var{y}, 0 otherwise.
|
||||
|
||||
@item lte(x, y)
|
||||
Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
|
||||
@item mod(x, y)
|
||||
Compute the remainder of division of @var{x} by @var{y}.
|
||||
|
||||
@item max(x, y)
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
@@ -114,53 +78,20 @@ Return the maximum between @var{x} and @var{y}.
|
||||
@item min(x, y)
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
|
||||
@item mod(x, y)
|
||||
Compute the remainder of division of @var{x} by @var{y}.
|
||||
@item eq(x, y)
|
||||
Return 1 if @var{x} and @var{y} are equivalent, 0 otherwise.
|
||||
|
||||
@item not(expr)
|
||||
Return 1.0 if @var{expr} is zero, 0.0 otherwise.
|
||||
@item gte(x, y)
|
||||
Return 1 if @var{x} is greater than or equal to @var{y}, 0 otherwise.
|
||||
|
||||
@item pow(x, y)
|
||||
Compute the power of @var{x} elevated @var{y}, it is equivalent to
|
||||
"(@var{x})^(@var{y})".
|
||||
@item gt(x, y)
|
||||
Return 1 if @var{x} is greater than @var{y}, 0 otherwise.
|
||||
|
||||
@item print(t)
|
||||
@item print(t, l)
|
||||
Print the value of expression @var{t} with loglevel @var{l}. If
|
||||
@var{l} is not specified then a default log level is used.
|
||||
Returns the value of the expression printed.
|
||||
@item lte(x, y)
|
||||
Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
|
||||
|
||||
Prints t with loglevel l
|
||||
|
||||
@item random(x)
|
||||
Return a pseudo random value between 0.0 and 1.0. @var{x} is the index of the
|
||||
internal variable which will be used to save the seed/state.
|
||||
|
||||
@item root(expr, max)
|
||||
Find an input value for which the function represented by @var{expr}
|
||||
with argument @var{ld(0)} is 0 in the interval 0..@var{max}.
|
||||
|
||||
The expression in @var{expr} must denote a continuous function or the
|
||||
result is undefined.
|
||||
|
||||
@var{ld(0)} is used to represent the function input value, which means
|
||||
that the given expression will be evaluated multiple times with
|
||||
various input values that the expression can access through
|
||||
@code{ld(0)}. When the expression evaluates to 0 then the
|
||||
corresponding input value will be returned.
|
||||
|
||||
@item sin(x)
|
||||
Compute sine of @var{x}.
|
||||
|
||||
@item sinh(x)
|
||||
Compute hyperbolic sine of @var{x}.
|
||||
|
||||
@item sqrt(expr)
|
||||
Compute the square root of @var{expr}. This is equivalent to
|
||||
"(@var{expr})^.5".
|
||||
|
||||
@item squish(x)
|
||||
Compute expression @code{1/(1 + exp(4*x))}.
|
||||
@item lt(x, y)
|
||||
Return 1 if @var{x} is lesser than @var{y}, 0 otherwise.
|
||||
|
||||
@item st(var, expr)
|
||||
Allow to store the value of the expression @var{expr} in an internal
|
||||
@@ -169,38 +100,72 @@ store the value, and it is a value ranging from 0 to 9. The function
|
||||
returns the value stored in the internal variable.
|
||||
Note, Variables are currently not shared between expressions.
|
||||
|
||||
@item tan(x)
|
||||
Compute tangent of @var{x}.
|
||||
|
||||
@item tanh(x)
|
||||
Compute hyperbolic tangent of @var{x}.
|
||||
|
||||
@item taylor(expr, x)
|
||||
@item taylor(expr, x, id)
|
||||
Evaluate a Taylor series at @var{x}, given an expression representing
|
||||
the @code{ld(id)}-th derivative of a function at 0.
|
||||
|
||||
When the series does not converge the result is undefined.
|
||||
|
||||
@var{ld(id)} is used to represent the derivative order in @var{expr},
|
||||
which means that the given expression will be evaluated multiple times
|
||||
with various input values that the expression can access through
|
||||
@code{ld(id)}. If @var{id} is not specified then 0 is assumed.
|
||||
|
||||
Note, when you have the derivatives at y instead of 0,
|
||||
@code{taylor(expr, x-y)} can be used.
|
||||
|
||||
@item time(0)
|
||||
Return the current (wallclock) time in seconds.
|
||||
|
||||
@item trunc(expr)
|
||||
Round the value of expression @var{expr} towards zero to the nearest
|
||||
integer. For example, "trunc(-1.5)" is "-1.0".
|
||||
@item ld(var)
|
||||
Allow to load the value of the internal variable with number
|
||||
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
|
||||
The function returns the loaded value.
|
||||
|
||||
@item while(cond, expr)
|
||||
Evaluate expression @var{expr} while the expression @var{cond} is
|
||||
non-zero, and returns the value of the last @var{expr} evaluation, or
|
||||
NAN if @var{cond} was always false.
|
||||
|
||||
@item ceil(expr)
|
||||
Round the value of expression @var{expr} upwards to the nearest
|
||||
integer. For example, "ceil(1.5)" is "2.0".
|
||||
|
||||
@item floor(expr)
|
||||
Round the value of expression @var{expr} downwards to the nearest
|
||||
integer. For example, "floor(-1.5)" is "-2.0".
|
||||
|
||||
@item trunc(expr)
|
||||
Round the value of expression @var{expr} towards zero to the nearest
|
||||
integer. For example, "trunc(-1.5)" is "-1.0".
|
||||
|
||||
@item sqrt(expr)
|
||||
Compute the square root of @var{expr}. This is equivalent to
|
||||
"(@var{expr})^.5".
|
||||
|
||||
@item not(expr)
|
||||
Return 1.0 if @var{expr} is zero, 0.0 otherwise.
|
||||
|
||||
@item pow(x, y)
|
||||
Compute the power of @var{x} elevated @var{y}, it is equivalent to
|
||||
"(@var{x})^(@var{y})".
|
||||
|
||||
@item random(x)
|
||||
Return a pseudo random value between 0.0 and 1.0. @var{x} is the index of the
|
||||
internal variable which will be used to save the seed/state.
|
||||
|
||||
@item hypot(x, y)
|
||||
This function is similar to the C function with the same name; it returns
|
||||
"sqrt(@var{x}*@var{x} + @var{y}*@var{y})", the length of the hypotenuse of a
|
||||
right triangle with sides of length @var{x} and @var{y}, or the distance of the
|
||||
point (@var{x}, @var{y}) from the origin.
|
||||
|
||||
@item gcd(x, y)
|
||||
Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
|
||||
@var{y} are 0 or either or both are less than zero then behavior is undefined.
|
||||
|
||||
@item if(x, y)
|
||||
Evaluate @var{x}, and if the result is non-zero return the result of
|
||||
the evaluation of @var{y}, return 0 otherwise.
|
||||
|
||||
@item ifnot(x, y)
|
||||
Evaluate @var{x}, and if the result is zero return the result of the
|
||||
evaluation of @var{y}, return 0 otherwise.
|
||||
|
||||
@item taylor(expr, x) taylor(expr, x, id)
|
||||
Evaluate a taylor series at x.
|
||||
expr represents the LD(id)-th derivates of f(x) at 0. If id is not specified
|
||||
then 0 is assumed.
|
||||
note, when you have the derivatives at y instead of 0
|
||||
taylor(expr, x-y) can be used
|
||||
When the series does not converge the results are undefined.
|
||||
|
||||
@item root(expr, max)
|
||||
Finds x where f(x)=0 in the interval 0..max.
|
||||
f() must be continuous or the result is undefined.
|
||||
@end table
|
||||
|
||||
The following constants are available:
|
||||
@@ -220,69 +185,68 @@ value, note that:
|
||||
|
||||
@code{+} works like OR
|
||||
|
||||
For example the construct:
|
||||
and the construct:
|
||||
@example
|
||||
if (A AND B) then C
|
||||
if A then B else C
|
||||
@end example
|
||||
is equivalent to:
|
||||
is equivalent to
|
||||
@example
|
||||
if(A*B, C)
|
||||
if(A,B) + ifnot(A,C)
|
||||
@end example
|
||||
|
||||
In your C code, you can extend the list of unary and binary functions,
|
||||
and define recognized constants, so that they are available for your
|
||||
expressions.
|
||||
|
||||
The evaluator also recognizes the International System unit prefixes.
|
||||
If 'i' is appended after the prefix, binary prefixes are used, which
|
||||
are based on powers of 1024 instead of powers of 1000.
|
||||
The 'B' postfix multiplies the value by 8, and can be appended after a
|
||||
unit prefix or used alone. This allows using for example 'KB', 'MiB',
|
||||
'G' and 'B' as number postfix.
|
||||
The evaluator also recognizes the International System number
|
||||
postfixes. If 'i' is appended after the postfix, powers of 2 are used
|
||||
instead of powers of 10. The 'B' postfix multiplies the value for 8,
|
||||
and can be appended after another postfix or used alone. This allows
|
||||
using for example 'KB', 'MiB', 'G' and 'B' as postfix.
|
||||
|
||||
The list of available International System prefixes follows, with
|
||||
Follows the list of available International System postfixes, with
|
||||
indication of the corresponding powers of 10 and of 2.
|
||||
@table @option
|
||||
@item y
|
||||
10^-24 / 2^-80
|
||||
-24 / -80
|
||||
@item z
|
||||
10^-21 / 2^-70
|
||||
-21 / -70
|
||||
@item a
|
||||
10^-18 / 2^-60
|
||||
-18 / -60
|
||||
@item f
|
||||
10^-15 / 2^-50
|
||||
-15 / -50
|
||||
@item p
|
||||
10^-12 / 2^-40
|
||||
-12 / -40
|
||||
@item n
|
||||
10^-9 / 2^-30
|
||||
-9 / -30
|
||||
@item u
|
||||
10^-6 / 2^-20
|
||||
-6 / -20
|
||||
@item m
|
||||
10^-3 / 2^-10
|
||||
-3 / -10
|
||||
@item c
|
||||
10^-2
|
||||
-2
|
||||
@item d
|
||||
10^-1
|
||||
-1
|
||||
@item h
|
||||
10^2
|
||||
2
|
||||
@item k
|
||||
10^3 / 2^10
|
||||
3 / 10
|
||||
@item K
|
||||
10^3 / 2^10
|
||||
3 / 10
|
||||
@item M
|
||||
10^6 / 2^20
|
||||
6 / 20
|
||||
@item G
|
||||
10^9 / 2^30
|
||||
9 / 30
|
||||
@item T
|
||||
10^12 / 2^40
|
||||
12 / 40
|
||||
@item P
|
||||
10^15 / 2^40
|
||||
15 / 40
|
||||
@item E
|
||||
10^18 / 2^50
|
||||
18 / 50
|
||||
@item Z
|
||||
10^21 / 2^60
|
||||
21 / 60
|
||||
@item Y
|
||||
10^24 / 2^70
|
||||
24 / 70
|
||||
@end table
|
||||
|
||||
@c man end
|
||||
|
@@ -98,7 +98,7 @@ static int decode_packet(int *got_frame, int cached)
|
||||
audio_frame_count++, frame->nb_samples,
|
||||
av_ts2timestr(frame->pts, &audio_dec_ctx->time_base));
|
||||
|
||||
ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, av_frame_get_channels(frame),
|
||||
ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, frame->channels,
|
||||
frame->nb_samples, frame->format, 1);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate audio buffer\n");
|
||||
@@ -107,13 +107,13 @@ static int decode_packet(int *got_frame, int cached)
|
||||
|
||||
/* TODO: extend return code of the av_samples_* functions so that this call is not needed */
|
||||
audio_dst_bufsize =
|
||||
av_samples_get_buffer_size(NULL, av_frame_get_channels(frame),
|
||||
av_samples_get_buffer_size(NULL, frame->channels,
|
||||
frame->nb_samples, frame->format, 1);
|
||||
|
||||
/* copy audio data to destination buffer:
|
||||
* this is required since rawaudio expects non aligned data */
|
||||
av_samples_copy(audio_dst_data, frame->data, 0, 0,
|
||||
frame->nb_samples, av_frame_get_channels(frame), frame->format);
|
||||
frame->nb_samples, frame->channels, frame->format);
|
||||
|
||||
/* write to rawaudio file */
|
||||
fwrite(audio_dst_data[0], 1, audio_dst_bufsize, audio_dst_file);
|
||||
@@ -292,10 +292,8 @@ 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) {
|
||||
while (av_read_frame(fmt_ctx, &pkt) >= 0)
|
||||
decode_packet(&got_frame, 0);
|
||||
av_free_packet(&pkt);
|
||||
}
|
||||
|
||||
/* flush cached frames */
|
||||
pkt.data = NULL;
|
||||
|
@@ -169,13 +169,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
AVPacket packet;
|
||||
AVFrame *frame = avcodec_alloc_frame();
|
||||
AVFrame frame;
|
||||
int got_frame;
|
||||
|
||||
if (!frame) {
|
||||
perror("Could not allocate frame");
|
||||
exit(1);
|
||||
}
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s file | %s\n", argv[0], player);
|
||||
exit(1);
|
||||
@@ -197,9 +193,9 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
if (packet.stream_index == audio_stream_index) {
|
||||
avcodec_get_frame_defaults(frame);
|
||||
avcodec_get_frame_defaults(&frame);
|
||||
got_frame = 0;
|
||||
ret = avcodec_decode_audio4(dec_ctx, frame, &got_frame, &packet);
|
||||
ret = avcodec_decode_audio4(dec_ctx, &frame, &got_frame, &packet);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error decoding audio\n");
|
||||
continue;
|
||||
@@ -207,7 +203,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (got_frame) {
|
||||
/* push the audio data from decoded frame into the filtergraph */
|
||||
if (av_buffersrc_add_frame(buffersrc_ctx, frame, 0) < 0) {
|
||||
if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while feeding the audio filtergraph\n");
|
||||
break;
|
||||
}
|
||||
@@ -233,7 +229,6 @@ end:
|
||||
if (dec_ctx)
|
||||
avcodec_close(dec_ctx);
|
||||
avformat_close_input(&fmt_ctx);
|
||||
av_freep(&frame);
|
||||
|
||||
if (ret < 0 && ret != AVERROR_EOF) {
|
||||
char buf[1024];
|
||||
|
@@ -173,13 +173,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
AVPacket packet;
|
||||
AVFrame *frame = avcodec_alloc_frame();
|
||||
AVFrame frame;
|
||||
int got_frame;
|
||||
|
||||
if (!frame) {
|
||||
perror("Could not allocate frame");
|
||||
exit(1);
|
||||
}
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s file\n", argv[0]);
|
||||
exit(1);
|
||||
@@ -201,19 +197,19 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
if (packet.stream_index == video_stream_index) {
|
||||
avcodec_get_frame_defaults(frame);
|
||||
avcodec_get_frame_defaults(&frame);
|
||||
got_frame = 0;
|
||||
ret = avcodec_decode_video2(dec_ctx, frame, &got_frame, &packet);
|
||||
ret = avcodec_decode_video2(dec_ctx, &frame, &got_frame, &packet);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error decoding video\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (got_frame) {
|
||||
frame->pts = av_frame_get_best_effort_timestamp(frame);
|
||||
frame.pts = av_frame_get_best_effort_timestamp(&frame);
|
||||
|
||||
/* push the decoded frame into the filtergraph */
|
||||
if (av_buffersrc_add_frame(buffersrc_ctx, frame, 0) < 0) {
|
||||
if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
|
||||
break;
|
||||
}
|
||||
@@ -240,7 +236,6 @@ end:
|
||||
if (dec_ctx)
|
||||
avcodec_close(dec_ctx);
|
||||
avformat_close_input(&fmt_ctx);
|
||||
av_freep(&frame);
|
||||
|
||||
if (ret < 0 && ret != AVERROR_EOF) {
|
||||
char buf[1024];
|
||||
|
@@ -86,6 +86,7 @@ static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
avcodec_get_context_defaults3(c, *codec);
|
||||
c->codec_id = codec_id;
|
||||
|
||||
c->bit_rate = 400000;
|
||||
@@ -395,7 +396,7 @@ int main(int argc, char **argv)
|
||||
AVStream *audio_st, *video_st;
|
||||
AVCodec *audio_codec, *video_codec;
|
||||
double audio_pts, video_pts;
|
||||
int ret;
|
||||
int ret, i;
|
||||
|
||||
/* Initialize libavcodec, and register all codecs and formats. */
|
||||
av_register_all();
|
||||
@@ -503,12 +504,18 @@ int main(int argc, char **argv)
|
||||
if (audio_st)
|
||||
close_audio(oc, audio_st);
|
||||
|
||||
/* Free the streams. */
|
||||
for (i = 0; i < oc->nb_streams; i++) {
|
||||
av_freep(&oc->streams[i]->codec);
|
||||
av_freep(&oc->streams[i]);
|
||||
}
|
||||
|
||||
if (!(fmt->flags & AVFMT_NOFILE))
|
||||
/* Close the output file. */
|
||||
avio_close(oc->pb);
|
||||
|
||||
/* free the stream */
|
||||
avformat_free_context(oc);
|
||||
av_free(oc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -107,7 +107,7 @@ int main(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* buffer is going to be written to rawvideo file, no alignment */
|
||||
/* buffer is going to be written to rawvideo file, no alignmnet */
|
||||
if ((ret = av_image_alloc(dst_data, dst_linesize,
|
||||
dst_w, dst_h, dst_pix_fmt, 1)) < 0) {
|
||||
fprintf(stderr, "Could not allocate destination image\n");
|
||||
|
@@ -294,12 +294,8 @@ your format doesn't support file level concatenation.
|
||||
|
||||
@subsection Concatenating using the concat @emph{protocol} (file level)
|
||||
|
||||
FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
|
||||
@code{concat}} protocol designed specifically for that, with examples in the
|
||||
documentation.
|
||||
|
||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
|
||||
video by merely concatenating the files containing them.
|
||||
video by merely concatenating the files them.
|
||||
|
||||
Hence you may concatenate your multimedia files by first transcoding them to
|
||||
these privileged formats, then using the humble @code{cat} command (or the
|
||||
|
@@ -1098,9 +1098,6 @@ Set sample format audio decoders should prefer. Default value is
|
||||
@code{none}.
|
||||
|
||||
@item pkt_timebase @var{rational number}
|
||||
|
||||
@item sub_charenc @var{encoding} (@emph{decoding,subtitles})
|
||||
Set the input subtitles character encoding.
|
||||
@end table
|
||||
|
||||
@c man end CODEC OPTIONS
|
||||
|
@@ -77,9 +77,7 @@ Reduce the latency introduced by optional buffering
|
||||
@end table
|
||||
|
||||
@item analyzeduration @var{integer} (@emph{input})
|
||||
Specify how many microseconds are analyzed to probe the input. A
|
||||
higher value will allow to detect more accurate information, but will
|
||||
increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
|
||||
Specify how many microseconds are analyzed to estimate duration.
|
||||
|
||||
@item cryptokey @var{hexadecimal string} (@emph{input})
|
||||
Set decryption key.
|
||||
|
@@ -43,7 +43,7 @@ value is not mandatory if the corresponding channel layout
|
||||
@option{out_channel_layout} is set.
|
||||
|
||||
@item uch, used_channel_count
|
||||
Set the number of used input channels. Default value is 0. This option is
|
||||
Set the number of used channels. Default value is 0. This option is
|
||||
only used for special remapping.
|
||||
|
||||
@item isr, in_sample_rate
|
||||
@@ -60,7 +60,6 @@ Specify the output sample format. It is set by default to @code{none}.
|
||||
|
||||
@item tsf, internal_sample_fmt
|
||||
Set the internal sample format. Default value is @code{none}.
|
||||
This will automatically be chosen when it is not explicitly set.
|
||||
|
||||
@item icl, in_channel_layout
|
||||
Set the input channel layout.
|
||||
@@ -69,17 +68,15 @@ Set the input channel layout.
|
||||
Set the output channel layout.
|
||||
|
||||
@item clev, center_mix_level
|
||||
Set the center mix level. It is a value expressed in deciBel, and must be
|
||||
in the interval [-32,32].
|
||||
Set center mix level. It is a value expressed in deciBel, and must be
|
||||
inclusively included between -32 and +32.
|
||||
|
||||
@item slev, surround_mix_level
|
||||
Set the surround mix level. It is a value expressed in deciBel, and must
|
||||
be in the interval [-32,32].
|
||||
Set surround mix level. It is a value expressed in deciBel, and must
|
||||
be inclusively included between -32 and +32.
|
||||
|
||||
@item lfe_mix_level
|
||||
Set LFE mix into non LFE level. It is used when there is a LFE input but no
|
||||
LFE output. It is a value expressed in deciBel, and must
|
||||
be in the interval [-32,32].
|
||||
@item lfe_mix_evel
|
||||
Set LFE mix level.
|
||||
|
||||
@item rmvol, rematrix_volume
|
||||
Set rematrix volume. Default value is 1.0.
|
||||
@@ -90,8 +87,7 @@ Set flags used by the converter. Default value is 0.
|
||||
It supports the following individual flags:
|
||||
@table @option
|
||||
@item res
|
||||
force resampling, this flag forces resampling to be used even when the
|
||||
input and output sample rates match.
|
||||
force resampling
|
||||
@end table
|
||||
|
||||
@item dither_scale
|
||||
@@ -108,21 +104,6 @@ select rectangular dither
|
||||
select triangular dither
|
||||
@item triangular_hp
|
||||
select triangular dither with high pass
|
||||
@item lipshitz
|
||||
select lipshitz noise shaping dither
|
||||
@item shibata
|
||||
select shibata noise shaping dither
|
||||
@item low_shibata
|
||||
select low shibata noise shaping dither
|
||||
@item high_shibata
|
||||
select high shibata noise shaping dither
|
||||
@item f_weighted
|
||||
select f-weighted noise shaping dither
|
||||
@item modified_e_weighted
|
||||
select modified-e-weighted noise shaping dither
|
||||
@item improved_e_weighted
|
||||
select improved-e-weighted noise shaping dither
|
||||
|
||||
@end table
|
||||
|
||||
@item resampler
|
||||
@@ -143,8 +124,8 @@ case.
|
||||
For swr only, set resampling filter size, default value is 32.
|
||||
|
||||
@item phase_shift
|
||||
For swr only, set resampling phase shift, default value is 10, and must be in
|
||||
the interval [0,30].
|
||||
For swr only, set resampling phase shift, default value is 10, must be included
|
||||
between 0 and 30.
|
||||
|
||||
@item linear_interp
|
||||
Use Linear Interpolation if set to 1, default value is 0.
|
||||
@@ -172,14 +153,6 @@ may be stretched or squeezed for each second.
|
||||
Default value is 0, thus no compensation is applied to make the samples match
|
||||
the audio timestamps.
|
||||
|
||||
@item first_pts
|
||||
For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
|
||||
This allows for padding/trimming at the start of stream. By default, no
|
||||
assumption is made about the first frame's expected pts, so no padding or
|
||||
trimming is done. For example, this could be set to 0 to pad the beginning with
|
||||
silence if an audio stream starts after the video stream or to trim any samples
|
||||
with a negative pts due to encoder delay.
|
||||
|
||||
@item min_comp
|
||||
For swr only, set the minimum difference between timestamps and audio data (in
|
||||
seconds) to trigger stretching/squeezing/filling or trimming of the
|
||||
@@ -235,8 +208,8 @@ select Kaiser Windowed Sinc
|
||||
@end table
|
||||
|
||||
@item kaiser_beta
|
||||
For swr only, set Kaiser Window Beta value. Must be an integer in the
|
||||
interval [2,16], default value is 9.
|
||||
For swr only, set Kaiser Window Beta value. Must be an integer included between
|
||||
2 and 16, default value is 9.
|
||||
|
||||
@end table
|
||||
|
||||
|
118
doc/ffmpeg.texi
118
doc/ffmpeg.texi
@@ -256,14 +256,6 @@ libx264, and the 138th audio, which will be encoded with libvorbis.
|
||||
Stop writing the output after its duration reaches @var{duration}.
|
||||
@var{duration} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
|
||||
|
||||
-to and -t are mutually exclusive and -t has priority.
|
||||
|
||||
@item -to @var{position} (@emph{output})
|
||||
Stop writing the output at @var{position}.
|
||||
@var{position} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
|
||||
|
||||
-to and -t are mutually exclusive and -t has priority.
|
||||
|
||||
@item -fs @var{limit_size} (@emph{output})
|
||||
Set the file size limit, expressed in bytes.
|
||||
|
||||
@@ -342,21 +334,13 @@ Stop writing to the stream after @var{framecount} frames.
|
||||
Use fixed quality scale (VBR). The meaning of @var{q} is
|
||||
codec-dependent.
|
||||
|
||||
@anchor{filter_option}
|
||||
@item -filter[:@var{stream_specifier}] @var{filter_graph} (@emph{output,per-stream})
|
||||
Create the filter graph specified by @var{filter_graph} and use it to
|
||||
filter the stream.
|
||||
|
||||
@var{filter_graph} is a description of the filter graph to apply to
|
||||
the stream, and must have a single input and a single output of the
|
||||
same type of the stream. In the filter graph, the input is associated
|
||||
to the label @code{in}, and the output to the label @code{out}. See
|
||||
the ffmpeg-filters manual for more information about the filtergraph
|
||||
syntax.
|
||||
|
||||
See the @ref{filter_complex_option,,-filter_complex option} if you
|
||||
want to create filter graphs with multiple inputs and/or outputs.
|
||||
the stream. Use @code{-filters} to show all the available filters
|
||||
(including also sources and sinks).
|
||||
|
||||
See also the @option{-filter_complex} option if you want to create filter graphs
|
||||
with multiple inputs and/or outputs.
|
||||
@item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
|
||||
Specify the preset for matching stream(s).
|
||||
|
||||
@@ -411,11 +395,11 @@ will be used.
|
||||
|
||||
E.g. to extract the first attachment to a file named 'out.ttf':
|
||||
@example
|
||||
ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
|
||||
ffmpeg -dump_attachment:t:0 out.ttf INPUT
|
||||
@end example
|
||||
To extract all attachments to files determined by the @code{filename} tag:
|
||||
@example
|
||||
ffmpeg -dump_attachment:t "" -i INPUT
|
||||
ffmpeg -dump_attachment:t "" INPUT
|
||||
@end example
|
||||
|
||||
Technical note -- attachments are implemented as codec extradata, so this
|
||||
@@ -459,6 +443,21 @@ form @var{num}:@var{den}, where @var{num} and @var{den} are the
|
||||
numerator and denominator of the aspect ratio. For example "4:3",
|
||||
"16:9", "1.3333", and "1.7777" are valid argument values.
|
||||
|
||||
@item -croptop @var{size}
|
||||
@item -cropbottom @var{size}
|
||||
@item -cropleft @var{size}
|
||||
@item -cropright @var{size}
|
||||
All the crop options have been removed. Use -vf
|
||||
crop=width:height:x:y instead.
|
||||
|
||||
@item -padtop @var{size}
|
||||
@item -padbottom @var{size}
|
||||
@item -padleft @var{size}
|
||||
@item -padright @var{size}
|
||||
@item -padcolor @var{hex_color}
|
||||
All the pad options have been removed. Use -vf
|
||||
pad=width:height:x:y:color instead.
|
||||
|
||||
@item -vn (@emph{output})
|
||||
Disable video recording.
|
||||
|
||||
@@ -488,10 +487,11 @@ stream
|
||||
Set the ISO 639 language code (3 letters) of the current video stream.
|
||||
|
||||
@item -vf @var{filter_graph} (@emph{output})
|
||||
Create the filter graph specified by @var{filter_graph} and use it to
|
||||
filter the stream.
|
||||
@var{filter_graph} is a description of the filter graph to apply to
|
||||
the input video.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
also sources and sinks). This is an alias for @code{-filter:v}.
|
||||
|
||||
This is an alias for @code{-filter:v}, see the @ref{filter_option,,-filter option}.
|
||||
@end table
|
||||
|
||||
@section Advanced Video Options
|
||||
@@ -545,58 +545,12 @@ Force video tag/fourcc. This is an alias for @code{-tag:v}.
|
||||
Show QP histogram
|
||||
@item -vbsf @var{bitstream_filter}
|
||||
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})
|
||||
Force key frames at the specified timestamps, more precisely at the first
|
||||
frames after each specified time.
|
||||
|
||||
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
|
||||
@var{delta}, expressed as a time in seconds.
|
||||
This option can be useful to ensure that a seek point is present at a
|
||||
chapter mark or any other designated place in the output file.
|
||||
|
||||
For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
|
||||
before the beginning of every chapter:
|
||||
@example
|
||||
-force_key_frames 0:05:00,chapters-0.1
|
||||
@end example
|
||||
|
||||
The expression in @var{expr} can contain the following constants:
|
||||
@table @option
|
||||
@item n
|
||||
the number of current processed frame, starting from 0
|
||||
@item n_forced
|
||||
the number of forced frames
|
||||
@item prev_forced_n
|
||||
the number of the previous forced frame, it is @code{NAN} when no
|
||||
keyframe was forced yet
|
||||
@item prev_forced_t
|
||||
the time of the previous forced frame, it is @code{NAN} when no
|
||||
keyframe was forced yet
|
||||
@item t
|
||||
the time of the current processed frame
|
||||
@end table
|
||||
|
||||
For example to force a key frame every 5 seconds, you can specify:
|
||||
@example
|
||||
-force_key_frames expr:gte(t,n_forced*5)
|
||||
@end example
|
||||
|
||||
To force a key frame 5 seconds after the time of the last forced one,
|
||||
starting from second 13:
|
||||
@example
|
||||
-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
|
||||
@end example
|
||||
|
||||
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.
|
||||
The timestamps must be specified in ascending order.
|
||||
|
||||
@item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
|
||||
When doing stream copy, copy also non-key frames found at the
|
||||
@@ -627,12 +581,11 @@ Set the audio codec. This is an alias for @code{-codec:a}.
|
||||
@item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})
|
||||
Set the audio sample format. Use @code{-sample_fmts} to get a list
|
||||
of supported sample formats.
|
||||
|
||||
@item -af @var{filter_graph} (@emph{output})
|
||||
Create the filter graph specified by @var{filter_graph} and use it to
|
||||
filter the stream.
|
||||
|
||||
This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter option}.
|
||||
@var{filter_graph} is a description of the filter graph to apply to
|
||||
the input audio.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
also sources and sinks). This is an alias for @code{-filter:a}.
|
||||
@end table
|
||||
|
||||
@section Advanced Audio options:
|
||||
@@ -642,12 +595,6 @@ This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter optio
|
||||
Force audio tag/fourcc. This is an alias for @code{-tag:a}.
|
||||
@item -absf @var{bitstream_filter}
|
||||
Deprecated, see -bsf
|
||||
@item -guess_layout_max @var{channels} (@emph{input,per-stream})
|
||||
If some input channel layout is not known, try to guess only if it
|
||||
corresponds to at most the specified number of channels. For example, 2
|
||||
tells to @command{ffmpeg} to recognize 1 channel as mono and 2 channels as
|
||||
stereo but not 6 channels as 5.1. The default is to always try to guess. Use
|
||||
0 to disable all guessing.
|
||||
@end table
|
||||
|
||||
@section Subtitle options:
|
||||
@@ -981,7 +928,6 @@ Specify Timecode for writing. @var{SEP} is ':' for non drop timecode and ';'
|
||||
ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
|
||||
@end example
|
||||
|
||||
@anchor{filter_complex_option}
|
||||
@item -filter_complex @var{filtergraph} (@emph{global})
|
||||
Define a complex filter graph, i.e. one with arbitrary number of inputs and/or
|
||||
outputs. For simple graphs -- those with one input and one output of the same
|
||||
@@ -1026,7 +972,7 @@ ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
|
||||
|
||||
To generate 5 seconds of pure red video using lavfi @code{color} source:
|
||||
@example
|
||||
ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
|
||||
ffmpeg -filter_complex 'color=red' -t 5 out.mkv
|
||||
@end example
|
||||
@end table
|
||||
|
||||
@@ -1338,7 +1284,7 @@ ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
|
||||
@url{ffmpeg-scaler.html,ffmpeg-scaler},
|
||||
@url{ffmpeg-resampler.html,ffmpeg-resampler},
|
||||
@url{ffmpeg-codecs.html,ffmpeg-codecs},
|
||||
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-formats.html,ffmpeg-formats},
|
||||
@url{ffmpeg-devices.html,ffmpeg-devices},
|
||||
@url{ffmpeg-protocols.html,ffmpeg-protocols},
|
||||
|
@@ -74,15 +74,10 @@ You can interactively cycle through the available show modes by
|
||||
pressing the key @key{w}.
|
||||
|
||||
@item -vf @var{filter_graph}
|
||||
Create the filter graph specified by @var{filter_graph} and use it to
|
||||
filter the video stream.
|
||||
|
||||
@var{filter_graph} is a description of the filter graph to apply to
|
||||
the stream, and must have a single video input and a single video
|
||||
output. In the filter graph, the input is associated to the label
|
||||
@code{in}, and the output to the label @code{out}. See the
|
||||
ffmpeg-filters manual for more information about the filtergraph
|
||||
syntax.
|
||||
the input video.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
also sources and sinks).
|
||||
|
||||
@item -i @var{input_file}
|
||||
Read @var{input_file}.
|
||||
@@ -199,7 +194,7 @@ Seek to percentage in file corresponding to fraction of width.
|
||||
@url{ffmpeg-scaler.html,ffmpeg-scaler},
|
||||
@url{ffmpeg-resampler.html,ffmpeg-resampler},
|
||||
@url{ffmpeg-codecs.html,ffmpeg-codecs},
|
||||
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-formats.html,ffmpeg-formats},
|
||||
@url{ffmpeg-devices.html,ffmpeg-devices},
|
||||
@url{ffmpeg-protocols.html,ffmpeg-protocols},
|
||||
|
@@ -495,7 +495,7 @@ DV, GXF and AVI timecodes are available in format metadata
|
||||
@url{ffmpeg-scaler.html,ffmpeg-scaler},
|
||||
@url{ffmpeg-resampler.html,ffmpeg-resampler},
|
||||
@url{ffmpeg-codecs.html,ffmpeg-codecs},
|
||||
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-formats.html,ffmpeg-formats},
|
||||
@url{ffmpeg-devices.html,ffmpeg-devices},
|
||||
@url{ffmpeg-protocols.html,ffmpeg-protocols},
|
||||
|
@@ -16,28 +16,34 @@ ffserver [@var{options}]
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
|
||||
@command{ffserver} is a streaming server for both audio and video. It
|
||||
supports several live feeds, streaming from files and time shifting on
|
||||
live feeds (you can seek to positions in the past on each live feed,
|
||||
provided you specify a big enough feed storage in
|
||||
@file{ffserver.conf}).
|
||||
ffserver is a streaming server for both audio and video. It supports
|
||||
|
||||
@command{ffserver} receives prerecorded files or FFM streams from some
|
||||
@command{ffmpeg} instance as input, then streams them over
|
||||
RTP/RTSP/HTTP.
|
||||
several live feeds, streaming from files and time shifting on live feeds
|
||||
(you can seek to positions in the past on each live feed, provided you
|
||||
specify a big enough feed storage in ffserver.conf).
|
||||
|
||||
An @command{ffserver} instance will listen on some port as specified
|
||||
in the configuration file. You can launch one or more instances of
|
||||
@command{ffmpeg} and send one or more FFM streams to the port where
|
||||
ffserver is expecting to receive them. Alternately, you can make
|
||||
@command{ffserver} launch such @command{ffmpeg} instances at startup.
|
||||
This documentation covers only the streaming aspects of ffserver /
|
||||
ffmpeg. All questions about parameters for ffmpeg, codec questions,
|
||||
etc. are not covered here. Read @file{ffmpeg.html} for more
|
||||
information.
|
||||
|
||||
Input streams are called feeds, and each one is specified by a
|
||||
@code{<Feed>} section in the configuration file.
|
||||
@section How does it work?
|
||||
|
||||
ffserver receives prerecorded files or FFM streams from some ffmpeg
|
||||
instance as input, then streams them over RTP/RTSP/HTTP.
|
||||
|
||||
An ffserver instance will listen on some port as specified in the
|
||||
configuration file. You can launch one or more instances of ffmpeg and
|
||||
send one or more FFM streams to the port where ffserver is expecting
|
||||
to receive them. Alternately, you can make ffserver launch such ffmpeg
|
||||
instances at startup.
|
||||
|
||||
Input streams are called feeds, and each one is specified by a <Feed>
|
||||
section in the configuration file.
|
||||
|
||||
For each feed you can have different output streams in various
|
||||
formats, each one specified by a @code{<Stream>} section in the
|
||||
configuration file.
|
||||
formats, each one specified by a <Stream> section in the configuration
|
||||
file.
|
||||
|
||||
@section Status stream
|
||||
|
||||
@@ -73,6 +79,14 @@ web server can be used to serve up the files just as well.
|
||||
It can stream prerecorded video from .ffm files, though it is somewhat tricky
|
||||
to make it work correctly.
|
||||
|
||||
@section What do I need?
|
||||
|
||||
I use Linux on a 900 MHz Duron with a cheap Bt848 based TV capture card. I'm
|
||||
using stock Linux 2.4.17 with the stock drivers. [Actually that isn't true,
|
||||
I needed some special drivers for my motherboard-based sound card.]
|
||||
|
||||
I understand that FreeBSD systems work just fine as well.
|
||||
|
||||
@section How do I make it work?
|
||||
|
||||
First, build the kit. It *really* helps to have installed LAME first. Then when
|
||||
@@ -221,7 +235,7 @@ of an infinite movie or a whole movie.
|
||||
|
||||
FFM is version specific, and there is limited compatibility of FFM files
|
||||
generated by one version of ffmpeg/ffserver and another version of
|
||||
ffmpeg/ffserver. It may work but it is not guaranteed to work.
|
||||
ffmpeg/ffserver. It may work but its not guaranteed to work.
|
||||
|
||||
FFM2 is extensible while maintaining compatibility and should work between
|
||||
differing versions of tools. FFM2 is the default.
|
||||
@@ -255,7 +269,7 @@ The @file{doc/ffserver.conf} example,
|
||||
@url{ffmpeg-scaler.html,ffmpeg-scaler},
|
||||
@url{ffmpeg-resampler.html,ffmpeg-resampler},
|
||||
@url{ffmpeg-codecs.html,ffmpeg-codecs},
|
||||
@url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-bitstream-filters,ffmpeg-bitstream-filters},
|
||||
@url{ffmpeg-formats.html,ffmpeg-formats},
|
||||
@url{ffmpeg-devices.html,ffmpeg-devices},
|
||||
@url{ffmpeg-protocols.html,ffmpeg-protocols},
|
||||
|
@@ -15,13 +15,13 @@ Format negotiation
|
||||
the list of supported formats.
|
||||
|
||||
For video links, that means pixel format. For audio links, that means
|
||||
channel layout, sample format (the sample packing is implied by the sample
|
||||
format) and sample rate.
|
||||
channel layout, and sample format (the sample packing is implied by the
|
||||
sample format).
|
||||
|
||||
The lists are not just lists, they are references to shared objects. When
|
||||
the negotiation mechanism computes the intersection of the formats
|
||||
supported at each end of a link, all references to both lists are replaced
|
||||
with a reference to the intersection. And when a single format is
|
||||
supported at each ends of a link, all references to both lists are
|
||||
replaced with a reference to the intersection. And when a single format is
|
||||
eventually chosen for a link amongst the remaining list, again, all
|
||||
references to the list are updated.
|
||||
|
||||
@@ -68,15 +68,15 @@ Buffer references ownership and permissions
|
||||
|
||||
Here are the (fairly obvious) rules for reference ownership:
|
||||
|
||||
* A reference received by the filter_frame method (or its start_frame
|
||||
deprecated version) belongs to the corresponding filter.
|
||||
* A reference received by the start_frame or filter_frame method
|
||||
belong to the corresponding filter.
|
||||
|
||||
Special exception: for video references: the reference may be used
|
||||
internally for automatic copying and must not be destroyed before
|
||||
end_frame; it can be given away to ff_start_frame.
|
||||
|
||||
* A reference passed to ff_filter_frame (or the deprecated
|
||||
ff_start_frame) is given away and must no longer be used.
|
||||
* A reference passed to ff_start_frame or ff_filter_frame is given
|
||||
away and must no longer be used.
|
||||
|
||||
* A reference created with avfilter_ref_buffer belongs to the code that
|
||||
created it.
|
||||
@@ -90,11 +90,27 @@ Buffer references ownership and permissions
|
||||
Link reference fields
|
||||
---------------------
|
||||
|
||||
The AVFilterLink structure has a few AVFilterBufferRef fields. The
|
||||
cur_buf and out_buf were used with the deprecated
|
||||
start_frame/draw_slice/end_frame API and should no longer be used.
|
||||
src_buf, cur_buf_copy and partial_buf are used by libavfilter internally
|
||||
and must not be accessed by filters.
|
||||
The AVFilterLink structure has a few AVFilterBufferRef fields. Here are
|
||||
the rules to handle them:
|
||||
|
||||
* cur_buf is set before the start_frame and filter_frame methods to
|
||||
the same reference given as argument to the methods and belongs to the
|
||||
destination filter of the link. If it has not been cleared after
|
||||
end_frame or filter_frame, libavfilter will automatically destroy
|
||||
the reference; therefore, any filter that needs to keep the reference
|
||||
for longer must set cur_buf to NULL.
|
||||
|
||||
* out_buf belongs to the source filter of the link and can be used to
|
||||
store a reference to the buffer that has been sent to the destination.
|
||||
If it is not NULL after end_frame or filter_frame, libavfilter will
|
||||
automatically destroy the reference.
|
||||
|
||||
If a video input pad does not have a start_frame method, the default
|
||||
method will request a buffer on the first output of the filter, store
|
||||
the reference in out_buf and push a second reference to the output.
|
||||
|
||||
* src_buf, cur_buf_copy and partial_buf are used by libavfilter
|
||||
internally and must not be accessed by filters.
|
||||
|
||||
Reference permissions
|
||||
---------------------
|
||||
@@ -103,10 +119,8 @@ Buffer references ownership and permissions
|
||||
the code that owns the reference is allowed to do to the buffer data.
|
||||
Different references for the same buffer can have different permissions.
|
||||
|
||||
For video filters that implement the deprecated
|
||||
start_frame/draw_slice/end_frame API, the permissions only apply to the
|
||||
parts of the buffer that have already been covered by the draw_slice
|
||||
method.
|
||||
For video filters, the permissions only apply to the parts of the buffer
|
||||
that have already been covered by the draw_slice method.
|
||||
|
||||
The value is a binary OR of the following constants:
|
||||
|
||||
@@ -165,9 +179,9 @@ Buffer references ownership and permissions
|
||||
with the WRITE permission.
|
||||
|
||||
* Filters that intend to keep a reference after the filtering process
|
||||
is finished (after filter_frame returns) must have the PRESERVE
|
||||
permission on it and remove the WRITE permission if they create a new
|
||||
reference to give it away.
|
||||
is finished (after end_frame or filter_frame returns) must have the
|
||||
PRESERVE permission on it and remove the WRITE permission if they
|
||||
create a new reference to give it away.
|
||||
|
||||
* Filters that intend to modify a reference they have kept after the end
|
||||
of the filtering process need the REUSE2 permission and must remove
|
||||
@@ -184,11 +198,11 @@ Frame scheduling
|
||||
Simple filters that output one frame for each input frame should not have
|
||||
to worry about it.
|
||||
|
||||
filter_frame
|
||||
------------
|
||||
start_frame / filter_frame
|
||||
----------------------------
|
||||
|
||||
This method is called when a frame is pushed to the filter's input. It
|
||||
can be called at any time except in a reentrant way.
|
||||
These methods are called when a frame is pushed to the filter's input.
|
||||
They can be called at any time except in a reentrant way.
|
||||
|
||||
If the input frame is enough to produce output, then the filter should
|
||||
push the output frames on the output link immediately.
|
||||
@@ -199,7 +213,7 @@ Frame scheduling
|
||||
filter; these buffered frames must be flushed immediately if a new input
|
||||
produces new output.
|
||||
|
||||
(Example: framerate-doubling filter: filter_frame must (1) flush the
|
||||
(Example: framerate-doubling filter: start_frame must (1) flush the
|
||||
second copy of the previous frame, if it is still there, (2) push the
|
||||
first copy of the incoming frame, (3) keep the second copy for later.)
|
||||
|
||||
@@ -219,8 +233,8 @@ Frame scheduling
|
||||
|
||||
This method is called when a frame is wanted on an output.
|
||||
|
||||
For an input, it should directly call filter_frame on the corresponding
|
||||
output.
|
||||
For an input, it should directly call start_frame or filter_frame on
|
||||
the corresponding output.
|
||||
|
||||
For a filter, if there are queued frames already ready, one of these
|
||||
frames should be pushed. If not, the filter should request a frame on
|
||||
@@ -241,7 +255,7 @@ Frame scheduling
|
||||
}
|
||||
while (!frame_pushed) {
|
||||
input = input_where_a_frame_is_most_needed();
|
||||
ret = ff_request_frame(input);
|
||||
ret = avfilter_request_frame(input);
|
||||
if (ret == AVERROR_EOF) {
|
||||
process_eof_on_input();
|
||||
} else if (ret < 0) {
|
||||
@@ -252,14 +266,4 @@ Frame scheduling
|
||||
|
||||
Note that, except for filters that can have queued frames, request_frame
|
||||
does not push frames: it requests them to its input, and as a reaction,
|
||||
the filter_frame method will be called and do the work.
|
||||
|
||||
Legacy API
|
||||
==========
|
||||
|
||||
Until libavfilter 3.23, the filter_frame method was split:
|
||||
|
||||
- for video filters, it was made of start_frame, draw_slice (that could be
|
||||
called several times on distinct parts of the frame) and end_frame;
|
||||
|
||||
- for audio filters, it was called filter_samples.
|
||||
the start_frame / filter_frame method will be called and do the work.
|
||||
|
1549
doc/filters.texi
1549
doc/filters.texi
File diff suppressed because it is too large
Load Diff
@@ -814,7 +814,6 @@ following image formats are supported:
|
||||
@item DSP Group TrueSpeech @tab @tab X
|
||||
@item DV audio @tab @tab X
|
||||
@item Enhanced AC-3 @tab X @tab X
|
||||
@item EVRC (Enhanced Variable Rate Codec) @tab @tab X
|
||||
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX
|
||||
@item G.723.1 @tab X @tab X
|
||||
@item G.729 @tab @tab X
|
||||
|
100
doc/indevs.texi
100
doc/indevs.texi
@@ -583,16 +583,10 @@ command:
|
||||
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
|
||||
@end example
|
||||
|
||||
@section video4linux2, v4l2
|
||||
@section video4linux2
|
||||
|
||||
Video4Linux2 input video device.
|
||||
|
||||
"v4l2" can be used as alias for "video4linux2".
|
||||
|
||||
If FFmpeg is built with v4l-utils support (by using the
|
||||
@code{--enable-libv4l2} configure option), the device will always rely
|
||||
on libv4l2.
|
||||
|
||||
The name of the device to grab is a file device node, usually Linux
|
||||
systems tend to automatically create such nodes when the device
|
||||
(e.g. an USB webcam) is plugged into the system, and has a name of the
|
||||
@@ -602,8 +596,8 @@ the device.
|
||||
Video4Linux2 devices usually support a limited set of
|
||||
@var{width}x@var{height} sizes and framerates. You can check which are
|
||||
supported using @command{-list_formats all} for Video4Linux2 devices.
|
||||
Some devices, like TV cards, support one or more standards. It is possible
|
||||
to list all the supported standards using @command{-list_standards all}.
|
||||
|
||||
Some usage examples of the video4linux2 devices with ffmpeg and ffplay:
|
||||
|
||||
The time base for the timestamps is 1 microsecond. Depending on the kernel
|
||||
version and configuration, the timestamps may be derived from the real time
|
||||
@@ -612,93 +606,19 @@ boot time, unaffected by NTP or manual changes to the clock). The
|
||||
@option{-timestamps abs} or @option{-ts abs} option can be used to force
|
||||
conversion into the real time clock.
|
||||
|
||||
Some usage examples of the video4linux2 device with @command{ffmpeg}
|
||||
and @command{ffplay}:
|
||||
@itemize
|
||||
@item
|
||||
Grab and show the input of a video4linux2 device:
|
||||
Note that if FFmpeg is build with v4l-utils support ("--enable-libv4l2"
|
||||
option), it will always be used.
|
||||
@example
|
||||
# Grab and show the input of a video4linux2 device.
|
||||
ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
|
||||
@end example
|
||||
|
||||
@item
|
||||
Grab and record the input of a video4linux2 device, leave the
|
||||
framerate and size as previously set:
|
||||
@example
|
||||
# Grab and record the input of a video4linux2 device, leave the
|
||||
framerate and size as previously set.
|
||||
ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
For more information about Video4Linux, check @url{http://linuxtv.org/}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item standard
|
||||
Set the standard. Must be the name of a supported standard. To get a
|
||||
list of the supported standards, use the @option{list_standards}
|
||||
option.
|
||||
|
||||
@item channel
|
||||
Set the input channel number. Default to 0.
|
||||
|
||||
@item video_size
|
||||
Set the video frame size. The argument must be a string in the form
|
||||
@var{WIDTH}x@var{HEIGHT} or a valid size abbreviation.
|
||||
|
||||
@item pixel_format
|
||||
Select the pixel format (only valid for raw video input).
|
||||
|
||||
@item input_format
|
||||
Set the preferred pixel format (for raw video) or a codec name.
|
||||
This option allows to select the input format, when several are
|
||||
available.
|
||||
|
||||
@item framerate
|
||||
Set the preferred video framerate.
|
||||
|
||||
@item list_formats
|
||||
List available formats (supported pixel formats, codecs, and frame
|
||||
sizes) and exit.
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item all
|
||||
Show all available (compressed and non-compressed) formats.
|
||||
|
||||
@item raw
|
||||
Show only raw video (non-compressed) formats.
|
||||
|
||||
@item compressed
|
||||
Show only compressed formats.
|
||||
@end table
|
||||
|
||||
@item list_standards
|
||||
List supported standards and exit.
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item all
|
||||
Show all supported standards.
|
||||
@end table
|
||||
|
||||
@item timestamps, ts
|
||||
Set type of timestamps for grabbed frames.
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item default
|
||||
Use timestamps from the kernel.
|
||||
|
||||
@item abs
|
||||
Use absolute timestamps (wall clock).
|
||||
|
||||
@item mono2abs
|
||||
Force conversion from monotonic to absolute timestamps.
|
||||
@end table
|
||||
|
||||
Default value is @code{default}.
|
||||
@end table
|
||||
"v4l" and "v4l2" can be used as aliases for the respective "video4linux" and
|
||||
"video4linux2".
|
||||
|
||||
@section vfwcap
|
||||
|
||||
|
101
doc/muxers.texi
101
doc/muxers.texi
@@ -241,13 +241,8 @@ ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
|
||||
@end example
|
||||
|
||||
@table @option
|
||||
@item start_number @var{number}
|
||||
Start the sequence from @var{number}. Default value is 1. Must be a
|
||||
positive number.
|
||||
|
||||
@item updatefirst 1|0
|
||||
If set to 1, update the first written image file again and
|
||||
again. Default value is 0.
|
||||
@item -start_number @var{number}
|
||||
Start the sequence from @var{number}.
|
||||
@end table
|
||||
|
||||
The image muxer supports the .Y.U.V image file format. This format is
|
||||
@@ -351,8 +346,6 @@ This option is implicitly set when writing ismv (Smooth Streaming) files.
|
||||
Run a second pass moving the moov atom on top of the file. This
|
||||
operation can take a while, and will not work in various situations such
|
||||
as fragmented output, thus it is not enabled by default.
|
||||
@item -movflags rtphint
|
||||
Add RTP hinting tracks to the output file.
|
||||
@end table
|
||||
|
||||
Smooth Streaming content can be pushed in real time to a publishing
|
||||
@@ -528,11 +521,9 @@ reference stream. The default value is ``auto''.
|
||||
@item segment_format @var{format}
|
||||
Override the inner container format, by default it is guessed by the filename
|
||||
extension.
|
||||
|
||||
@item segment_list @var{name}
|
||||
Generate also a listfile named @var{name}. If not specified no
|
||||
listfile is generated.
|
||||
|
||||
@item segment_list_flags @var{flags}
|
||||
Set flags affecting the segment list generation.
|
||||
|
||||
@@ -543,15 +534,17 @@ Allow caching (only affects M3U8 list files).
|
||||
|
||||
@item live
|
||||
Allow live-friendly file generation.
|
||||
|
||||
This currently only affects M3U8 lists. In particular, write a fake
|
||||
EXT-X-TARGETDURATION duration field at the top of the file, based on
|
||||
the specified @var{segment_time}.
|
||||
@end table
|
||||
|
||||
Default value is @code{cache}.
|
||||
|
||||
@item segment_list_size @var{size}
|
||||
Update the list file so that it contains at most the last @var{size}
|
||||
segments. If 0 the list file will contain all the segments. Default
|
||||
value is 0.
|
||||
|
||||
Overwrite the listfile once it reaches @var{size} entries. If 0
|
||||
the listfile is never overwritten. Default value is 0.
|
||||
@item segment_list type @var{type}
|
||||
Specify the format for the segment list file.
|
||||
|
||||
@@ -579,34 +572,19 @@ auto-select this format.
|
||||
|
||||
@code{ext} is deprecated in favor or @code{csv}.
|
||||
|
||||
@item ffconcat
|
||||
Generate an ffconcat file for the created segments. The resulting file
|
||||
can be read using the FFmpeg @ref{concat} demuxer.
|
||||
|
||||
A list file with the suffix @code{".ffcat"} or @code{".ffconcat"} will
|
||||
auto-select this format.
|
||||
|
||||
@item m3u8
|
||||
Generate an extended M3U8 file, version 3, compliant with
|
||||
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming}.
|
||||
Generate an extended M3U8 file, version 4, compliant with
|
||||
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming-08.txt}.
|
||||
|
||||
A list file with the suffix @code{".m3u8"} will auto-select this format.
|
||||
@end table
|
||||
|
||||
If not specified the type is guessed from the list file name suffix.
|
||||
|
||||
@item segment_time @var{time}
|
||||
Set segment duration to @var{time}, the value must be a duration
|
||||
specification. Default value is "2". See also the
|
||||
@option{segment_times} option.
|
||||
|
||||
Note that splitting may not be accurate, unless you force the
|
||||
reference stream key-frames at the given time. See the introductory
|
||||
notice and the examples below.
|
||||
|
||||
Set segment duration to @var{time}. Default value is "2".
|
||||
@item segment_time_delta @var{delta}
|
||||
Specify the accuracy time when selecting the start time for a
|
||||
segment, expressed as a duration specification. Default value is "0".
|
||||
segment. Default value is "0".
|
||||
|
||||
When delta is specified a key-frame will start a new segment if its
|
||||
PTS satisfies the relation:
|
||||
@@ -628,8 +606,7 @@ the specified time and the time set by @var{force_key_frames}.
|
||||
|
||||
@item segment_times @var{times}
|
||||
Specify a list of split points. @var{times} contains a list of comma
|
||||
separated duration specifications, in increasing order. See also
|
||||
the @option{segment_time} option.
|
||||
separated duration specifications, in increasing order.
|
||||
|
||||
@item segment_frames @var{frames}
|
||||
Specify a list of split video frame numbers. @var{frames} contains a
|
||||
@@ -652,7 +629,7 @@ of the generated segments. May not work with some combinations of
|
||||
muxers/codecs. It is set to @code{0} by default.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@section Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
@@ -741,54 +718,4 @@ ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
|
||||
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
|
||||
@end example
|
||||
|
||||
@section ogg
|
||||
|
||||
Ogg container muxer.
|
||||
|
||||
@table @option
|
||||
@item -page_duration @var{duration}
|
||||
Preferred page duration, in microseconds. The muxer will attempt to create
|
||||
pages that are approximately @var{duration} microseconds long. This allows the
|
||||
user to compromise between seek granularity and container overhead. The default
|
||||
is 1 second. A value of 0 will fill all segments, making pages as large as
|
||||
possible. A value of 1 will effectively use 1 packet-per-page in most
|
||||
situations, giving a small seek granularity at the cost of additional container
|
||||
overhead.
|
||||
@end table
|
||||
|
||||
@section tee
|
||||
|
||||
The tee muxer can be used to write the same data to several files or any
|
||||
other kind of muxer. It can be used, for example, to both stream a video to
|
||||
the network and save it to disk at the same time.
|
||||
|
||||
It is different from specifying several outputs to the @command{ffmpeg}
|
||||
command-line tool because the audio and video data will be encoded only once
|
||||
with the tee muxer; encoding can be a very expensive process. It is not
|
||||
useful when using the libavformat API directly because it is then possible
|
||||
to feed the same packets to several muxers directly.
|
||||
|
||||
The slave outputs are specified in the file name given to the muxer,
|
||||
separated by '|'. If any of the slave name contains the '|' separator,
|
||||
leading or trailing spaces or any special character, it must be
|
||||
escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
|
||||
manual).
|
||||
|
||||
Options can be specified for each slave by prepending them as a list of
|
||||
@var{key}=@var{value} pairs separated by ':', between square brackets. If
|
||||
the options values contain a special character or the ':' separator, they
|
||||
must be escaped; note that this is a second level escaping.
|
||||
|
||||
Example: encode something and both archive it in a WebM file and stream it
|
||||
as MPEG-TS over UDP (the streams need to be explicitly mapped):
|
||||
|
||||
@example
|
||||
ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
|
||||
"archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
|
||||
@end example
|
||||
|
||||
Note: some codecs may need different options depending on the output format;
|
||||
the auto-detection of this can not work with the tee muxer. The main example
|
||||
is the @option{global_header} flag.
|
||||
|
||||
@c man end MUXERS
|
||||
|
@@ -148,7 +148,7 @@ Alignment:
|
||||
Some instructions on some architectures have strict alignment restrictions,
|
||||
for example most SSE/SSE2 instructions on x86.
|
||||
The minimum guaranteed alignment is written in the .h files, for example:
|
||||
void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
|
||||
void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
|
||||
|
||||
|
||||
General Tips:
|
||||
|
@@ -128,63 +128,6 @@ m3u8 files.
|
||||
|
||||
HTTP (Hyper Text Transfer Protocol).
|
||||
|
||||
This protocol accepts the following options.
|
||||
|
||||
@table @option
|
||||
@item seekable
|
||||
Control seekability of connection. If set to 1 the resource is
|
||||
supposed to be seekable, if set to 0 it is assumed not to be seekable,
|
||||
if set to -1 it will try to autodetect if it is seekable. Default
|
||||
value is -1.
|
||||
|
||||
@item chunked_post
|
||||
If set to 1 use chunked transfer-encoding for posts, default is 1.
|
||||
|
||||
@item headers
|
||||
Set custom HTTP headers, can override built in default headers. The
|
||||
value must be a string encoding the headers.
|
||||
|
||||
@item content_type
|
||||
Force a content type.
|
||||
|
||||
@item user-agent
|
||||
Override User-Agent header. If not specified the protocol will use a
|
||||
string describing the libavformat build.
|
||||
|
||||
@item multiple_requests
|
||||
Use persistent connections if set to 1. By default it is 0.
|
||||
|
||||
@item post_data
|
||||
Set custom HTTP post data.
|
||||
|
||||
@item timeout
|
||||
Set timeout 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 mime_type
|
||||
Set MIME type.
|
||||
|
||||
@item cookies
|
||||
Set the cookies to be sent in future requests. The format of each cookie is the
|
||||
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
|
||||
delimited by a newline character.
|
||||
@end table
|
||||
|
||||
@subsection HTTP Cookies
|
||||
|
||||
Some HTTP requests will be denied unless cookie values are passed in with the
|
||||
request. The @option{cookies} option allows these cookies to be specified. At
|
||||
the very least, each cookie must specify a value along with a path and domain.
|
||||
HTTP requests that match both the domain and path will automatically include the
|
||||
cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
|
||||
by a newline.
|
||||
|
||||
The required syntax to play a stream specifying a cookie is:
|
||||
@example
|
||||
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
|
||||
@end example
|
||||
|
||||
@section mmst
|
||||
|
||||
MMS (Microsoft Media Server) protocol over TCP.
|
||||
|
@@ -32,9 +32,9 @@ Special Converter v
|
||||
Output
|
||||
|
||||
Planar/Packed conversion is done when needed during sample format conversion.
|
||||
Every step can be skipped without memcpy when it is not needed.
|
||||
Every step can be skipped without memcpy when its not needed.
|
||||
Either Resampling and Rematrixing can be performed first depending on which
|
||||
way it is faster.
|
||||
way its faster.
|
||||
The Buffers are needed for resampling due to resamplng being a process that
|
||||
requires future and past data, it thus also introduces inevitably a delay when
|
||||
used.
|
||||
|
@@ -98,7 +98,7 @@ year-month-day.
|
||||
|
||||
The accepted syntax is:
|
||||
@example
|
||||
[-][HH:]MM:SS[.m...]
|
||||
[-]HH:MM:SS[.m...]
|
||||
[-]S+[.m...]
|
||||
@end example
|
||||
|
||||
@@ -112,22 +112,6 @@ Specify the size of the sourced video, it may be a string of the form
|
||||
|
||||
The following abbreviations are recognized:
|
||||
@table @samp
|
||||
@item ntsc
|
||||
720x480
|
||||
@item pal
|
||||
720x576
|
||||
@item qntsc
|
||||
352x240
|
||||
@item qpal
|
||||
352x288
|
||||
@item sntsc
|
||||
640x480
|
||||
@item spal
|
||||
768x576
|
||||
@item film
|
||||
352x240
|
||||
@item ntsc-film
|
||||
352x240
|
||||
@item sqcif
|
||||
128x96
|
||||
@item qcif
|
||||
@@ -186,18 +170,6 @@ The following abbreviations are recognized:
|
||||
1280x720
|
||||
@item hd1080
|
||||
1920x1080
|
||||
@item 2k
|
||||
2048x1080
|
||||
@item 2kflat
|
||||
1998x1080
|
||||
@item 2kscope
|
||||
2048x858
|
||||
@item 4k
|
||||
4096x2160
|
||||
@item 4kflat
|
||||
3996x2160
|
||||
@item 4kscope
|
||||
4096x1716
|
||||
@end table
|
||||
|
||||
@anchor{video rate syntax}
|
||||
@@ -215,17 +187,17 @@ The following abbreviations are recognized:
|
||||
@item pal
|
||||
25/1
|
||||
@item qntsc
|
||||
30000/1001
|
||||
30000/1
|
||||
@item qpal
|
||||
25/1
|
||||
@item sntsc
|
||||
30000/1001
|
||||
30000/1
|
||||
@item spal
|
||||
25/1
|
||||
@item film
|
||||
24/1
|
||||
@item ntsc-film
|
||||
24000/1001
|
||||
24000/1
|
||||
@end table
|
||||
|
||||
@anchor{ratio syntax}
|
||||
|
@@ -68,7 +68,7 @@ $print_page_head = \&FFmpeg_print_page_head;
|
||||
sub FFmpeg_print_page_head($$)
|
||||
{
|
||||
my $fh = shift;
|
||||
my $longtitle = "$Texi2HTML::THISDOC{'fulltitle_no_texi'}";
|
||||
my $longtitle = "$Texi2HTML::THISDOC{'title_no_texi'}";
|
||||
$longtitle .= ": $Texi2HTML::NO_TEXI{'This'}" if exists $Texi2HTML::NO_TEXI{'This'};
|
||||
my $description = $DOCUMENT_DESCRIPTION;
|
||||
$description = $longtitle if (!defined($description));
|
||||
|
@@ -169,7 +169,7 @@ INF: while(<$inf>) {
|
||||
} elsif ($ended =~ /^(?:example|smallexample|display)$/) {
|
||||
$shift = "";
|
||||
$_ = ""; # need a paragraph break
|
||||
} elsif ($ended =~ /^(?:itemize|enumerate|(?:multi|[fv])?table)$/) {
|
||||
} elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
|
||||
$_ = "\n=back\n";
|
||||
$ic = pop @icstack;
|
||||
} else {
|
||||
@@ -269,7 +269,7 @@ INF: while(<$inf>) {
|
||||
$endw = "enumerate";
|
||||
};
|
||||
|
||||
/^\@((?:multi|[fv])?table)\s+(\@[a-z]+)/ and do {
|
||||
/^\@([fv]?table)\s+(\@[a-z]+)/ and do {
|
||||
push @endwstack, $endw;
|
||||
push @icstack, $ic;
|
||||
$endw = $1;
|
||||
@@ -278,7 +278,6 @@ INF: while(<$inf>) {
|
||||
$ic =~ s/\@(?:code|kbd)/C/;
|
||||
$ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
|
||||
$ic =~ s/\@(?:file)/F/;
|
||||
$ic =~ s/\@(?:columnfractions)//;
|
||||
$_ = "\n=over 4\n";
|
||||
};
|
||||
|
||||
@@ -289,21 +288,6 @@ INF: while(<$inf>) {
|
||||
$_ = ""; # need a paragraph break
|
||||
};
|
||||
|
||||
/^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
|
||||
my $columns = $1;
|
||||
$columns =~ s/\@tab/ : /;
|
||||
|
||||
$_ = "\n=item B<". $columns .">\n";
|
||||
};
|
||||
|
||||
/^\@tab\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
|
||||
my $columns = $1;
|
||||
$columns =~ s/\@tab/ : /;
|
||||
|
||||
$_ = " : ". $columns;
|
||||
$chapter =~ s/\n+\s+$//;
|
||||
};
|
||||
|
||||
/^\@itemx?\s*(.+)?$/ and do {
|
||||
if (defined $1) {
|
||||
# Entity escapes prevent munging by the <> processing below.
|
||||
@@ -377,7 +361,6 @@ sub postprocess
|
||||
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
|
||||
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
|
||||
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
|
||||
s/\@ref\{(?:[^,\}]*,)(?:[^,\}]*,)([^,\}]*).*\}/$1/g;
|
||||
s/\@ref\{([^\}]*)\}/$1/g;
|
||||
s/\@noindent\s*//g;
|
||||
s/\@refill//g;
|
||||
|
170
ffmpeg.c
170
ffmpeg.c
@@ -109,18 +109,8 @@ const int program_birth_year = 2000;
|
||||
|
||||
static FILE *vstats_file;
|
||||
|
||||
const char *const forced_keyframes_const_names[] = {
|
||||
"n",
|
||||
"n_forced",
|
||||
"prev_forced_n",
|
||||
"prev_forced_t",
|
||||
"t",
|
||||
NULL
|
||||
};
|
||||
|
||||
static void do_video_stats(OutputStream *ost, int frame_size);
|
||||
static int64_t getutime(void);
|
||||
static int64_t getmaxrss(void);
|
||||
|
||||
static int run_as_daemon = 0;
|
||||
static int64_t video_size = 0;
|
||||
@@ -409,11 +399,6 @@ static void exit_program(void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
if (do_benchmark) {
|
||||
int maxrss = getmaxrss() / 1024;
|
||||
printf("bench: maxrss=%ikB\n", maxrss);
|
||||
}
|
||||
|
||||
for (i = 0; i < nb_filtergraphs; i++) {
|
||||
avfilter_graph_free(&filtergraphs[i]->graph);
|
||||
for (j = 0; j < filtergraphs[i]->nb_inputs; j++) {
|
||||
@@ -452,7 +437,6 @@ static void exit_program(void)
|
||||
avcodec_free_frame(&output_streams[i]->filtered_frame);
|
||||
|
||||
av_freep(&output_streams[i]->forced_keyframes);
|
||||
av_expr_free(output_streams[i]->forced_keyframes_pexpr);
|
||||
av_freep(&output_streams[i]->avfilter);
|
||||
av_freep(&output_streams[i]->logfile_prefix);
|
||||
av_freep(&output_streams[i]);
|
||||
@@ -465,7 +449,6 @@ static void exit_program(void)
|
||||
avcodec_free_frame(&input_streams[i]->decoded_frame);
|
||||
av_dict_free(&input_streams[i]->opts);
|
||||
free_buffer_pool(&input_streams[i]->buffer_pool);
|
||||
avsubtitle_free(&input_streams[i]->prev_sub.subtitle);
|
||||
avfilter_unref_bufferp(&input_streams[i]->sub2video.ref);
|
||||
av_freep(&input_streams[i]->filters);
|
||||
av_freep(&input_streams[i]);
|
||||
@@ -681,7 +664,6 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
|
||||
}
|
||||
}
|
||||
|
||||
#if FF_API_DEINTERLACE
|
||||
static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp)
|
||||
{
|
||||
AVCodecContext *dec;
|
||||
@@ -692,7 +674,7 @@ static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void *
|
||||
dec = ist->st->codec;
|
||||
|
||||
/* deinterlace : must be done before any resize */
|
||||
if (FF_API_DEINTERLACE && do_deinterlace) {
|
||||
if (do_deinterlace) {
|
||||
int size;
|
||||
|
||||
/* create temporary picture */
|
||||
@@ -722,7 +704,6 @@ static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void *
|
||||
*picture = *picture2;
|
||||
*bufp = buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void do_subtitle_out(AVFormatContext *s,
|
||||
OutputStream *ost,
|
||||
@@ -891,9 +872,8 @@ static void do_video_out(AVFormatContext *s,
|
||||
video_size += pkt.size;
|
||||
write_frame(s, &pkt, ost);
|
||||
} else {
|
||||
int got_packet, forced_keyframe = 0;
|
||||
int got_packet;
|
||||
AVFrame big_picture;
|
||||
double pts_time;
|
||||
|
||||
big_picture = *in_picture;
|
||||
/* better than nothing: use input picture interlaced
|
||||
@@ -917,41 +897,11 @@ static void do_video_out(AVFormatContext *s,
|
||||
big_picture.quality = ost->st->codec->global_quality;
|
||||
if (!enc->me_threshold)
|
||||
big_picture.pict_type = 0;
|
||||
|
||||
pts_time = big_picture.pts != AV_NOPTS_VALUE ?
|
||||
big_picture.pts * av_q2d(enc->time_base) : NAN;
|
||||
if (ost->forced_kf_index < ost->forced_kf_count &&
|
||||
big_picture.pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
|
||||
ost->forced_kf_index++;
|
||||
forced_keyframe = 1;
|
||||
} else if (ost->forced_keyframes_pexpr) {
|
||||
double res;
|
||||
ost->forced_keyframes_expr_const_values[FKF_T] = pts_time;
|
||||
res = av_expr_eval(ost->forced_keyframes_pexpr,
|
||||
ost->forced_keyframes_expr_const_values, NULL);
|
||||
av_dlog(NULL, "force_key_frame: n:%f n_forced:%f prev_forced_n:%f t:%f prev_forced_t:%f -> res:%f\n",
|
||||
ost->forced_keyframes_expr_const_values[FKF_N],
|
||||
ost->forced_keyframes_expr_const_values[FKF_N_FORCED],
|
||||
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N],
|
||||
ost->forced_keyframes_expr_const_values[FKF_T],
|
||||
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T],
|
||||
res);
|
||||
if (res) {
|
||||
forced_keyframe = 1;
|
||||
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] =
|
||||
ost->forced_keyframes_expr_const_values[FKF_N];
|
||||
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] =
|
||||
ost->forced_keyframes_expr_const_values[FKF_T];
|
||||
ost->forced_keyframes_expr_const_values[FKF_N_FORCED] += 1;
|
||||
}
|
||||
|
||||
ost->forced_keyframes_expr_const_values[FKF_N] += 1;
|
||||
}
|
||||
if (forced_keyframe) {
|
||||
big_picture.pict_type = AV_PICTURE_TYPE_I;
|
||||
av_log(NULL, AV_LOG_DEBUG, "Forced keyframe at time %f\n", pts_time);
|
||||
ost->forced_kf_index++;
|
||||
}
|
||||
|
||||
update_benchmark(NULL);
|
||||
ret = avcodec_encode_video2(enc, &pkt, &big_picture, &got_packet);
|
||||
update_benchmark("encode_video %d.%d", ost->file_index, ost->index);
|
||||
@@ -1111,12 +1061,6 @@ static int reap_filters(void)
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
avfilter_copy_buf_props(filtered_frame, picref);
|
||||
filtered_frame->pts = frame_pts;
|
||||
if (!(ost->st->codec->codec->capabilities & CODEC_CAP_PARAM_CHANGE) &&
|
||||
ost->st->codec->channels != av_frame_get_channels(filtered_frame)) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Audio filter graph output is not normalized and encoder does not support parameter changes\n");
|
||||
break;
|
||||
}
|
||||
do_audio_out(of->ctx, ost, filtered_frame);
|
||||
break;
|
||||
default:
|
||||
@@ -1223,7 +1167,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
||||
p = psnr(error / scale);
|
||||
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%c:%2.2f ", type[j], p);
|
||||
av_bprintf(&buf_script, "stream_%d_%d_psnr_%c=%2.2f\n",
|
||||
ost->file_index, ost->index, type[j] | 32, p);
|
||||
ost->file_index, ost->index, type[i] | 32, p);
|
||||
}
|
||||
p = psnr(error_sum / scale_sum);
|
||||
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "*:%2.2f ", psnr(error_sum / scale_sum));
|
||||
@@ -1271,10 +1215,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
||||
av_bprintf(&buf_script, "drop_frames=%d\n", nb_frames_drop);
|
||||
|
||||
if (print_stats || is_last_report) {
|
||||
if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
|
||||
fprintf(stderr, "%s \r", buf);
|
||||
} else
|
||||
av_log(NULL, AV_LOG_INFO, "%s \r", buf);
|
||||
av_log(NULL, AV_LOG_INFO, "%s \r", buf);
|
||||
|
||||
fflush(stderr);
|
||||
}
|
||||
@@ -1501,8 +1442,6 @@ int guess_input_channel_layout(InputStream *ist)
|
||||
if (!dec->channel_layout) {
|
||||
char layout_name[256];
|
||||
|
||||
if (dec->channels > ist->guess_layout_max)
|
||||
return 0;
|
||||
dec->channel_layout = av_get_default_channel_layout(dec->channels);
|
||||
if (!dec->channel_layout)
|
||||
return 0;
|
||||
@@ -1677,9 +1616,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
}
|
||||
|
||||
pkt->size = 0;
|
||||
#if FF_API_DEINTERLACE
|
||||
pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);
|
||||
#endif
|
||||
|
||||
rate_emu_sleep(ist);
|
||||
|
||||
@@ -1932,7 +1869,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
|
||||
|
||||
static void print_sdp(void)
|
||||
{
|
||||
char sdp[16384];
|
||||
char sdp[2048];
|
||||
int i;
|
||||
AVFormatContext **avc = av_malloc(sizeof(*avc) * nb_output_files);
|
||||
|
||||
@@ -1960,7 +1897,7 @@ static int init_input_stream(int ist_index, char *error, int error_len)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
ist->dr1 = (codec->capabilities & CODEC_CAP_DR1) && !(FF_API_DEINTERLACE && do_deinterlace);
|
||||
ist->dr1 = (codec->capabilities & CODEC_CAP_DR1) && !do_deinterlace;
|
||||
if (codec->type == AVMEDIA_TYPE_VIDEO && ist->dr1) {
|
||||
ist->st->codec->get_buffer = codec_get_buffer;
|
||||
ist->st->codec->release_buffer = codec_release_buffer;
|
||||
@@ -1993,25 +1930,19 @@ static InputStream *get_input_stream(OutputStream *ost)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int compare_int64(const void *a, const void *b)
|
||||
{
|
||||
int64_t va = *(int64_t *)a, vb = *(int64_t *)b;
|
||||
return va < vb ? -1 : va > vb ? +1 : 0;
|
||||
}
|
||||
|
||||
static void parse_forced_key_frames(char *kf, OutputStream *ost,
|
||||
AVCodecContext *avctx)
|
||||
{
|
||||
char *p;
|
||||
int n = 1, i, size, index = 0;
|
||||
int64_t t, *pts;
|
||||
int n = 1, i;
|
||||
int64_t t;
|
||||
|
||||
for (p = kf; *p; p++)
|
||||
if (*p == ',')
|
||||
n++;
|
||||
size = n;
|
||||
pts = av_malloc(sizeof(*pts) * size);
|
||||
if (!pts) {
|
||||
ost->forced_kf_count = n;
|
||||
ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n);
|
||||
if (!ost->forced_kf_pts) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -2023,43 +1954,11 @@ static void parse_forced_key_frames(char *kf, OutputStream *ost,
|
||||
if (next)
|
||||
*next++ = 0;
|
||||
|
||||
if (!memcmp(p, "chapters", 8)) {
|
||||
|
||||
AVFormatContext *avf = output_files[ost->file_index]->ctx;
|
||||
int j;
|
||||
|
||||
if (avf->nb_chapters > INT_MAX - size ||
|
||||
!(pts = av_realloc_f(pts, size += avf->nb_chapters - 1,
|
||||
sizeof(*pts)))) {
|
||||
av_log(NULL, AV_LOG_FATAL,
|
||||
"Could not allocate forced key frames array.\n");
|
||||
exit(1);
|
||||
}
|
||||
t = p[8] ? parse_time_or_die("force_key_frames", p + 8, 1) : 0;
|
||||
t = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
|
||||
|
||||
for (j = 0; j < avf->nb_chapters; j++) {
|
||||
AVChapter *c = avf->chapters[j];
|
||||
av_assert1(index < size);
|
||||
pts[index++] = av_rescale_q(c->start, c->time_base,
|
||||
avctx->time_base) + t;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
t = parse_time_or_die("force_key_frames", p, 1);
|
||||
av_assert1(index < size);
|
||||
pts[index++] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
|
||||
|
||||
}
|
||||
t = parse_time_or_die("force_key_frames", p, 1);
|
||||
ost->forced_kf_pts[i] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
|
||||
|
||||
p = next;
|
||||
}
|
||||
|
||||
av_assert0(index == size);
|
||||
qsort(pts, size, sizeof(*pts), compare_int64);
|
||||
ost->forced_kf_count = size;
|
||||
ost->forced_kf_pts = pts;
|
||||
}
|
||||
|
||||
static void report_new_stream(int input_index, AVPacket *pkt)
|
||||
@@ -2146,10 +2045,9 @@ static int transcode_init(void)
|
||||
codec->codec_type = icodec->codec_type;
|
||||
|
||||
if (!codec->codec_tag) {
|
||||
unsigned int codec_tag;
|
||||
if (!oc->oformat->codec_tag ||
|
||||
av_codec_get_id (oc->oformat->codec_tag, icodec->codec_tag) == codec->codec_id ||
|
||||
!av_codec_get_tag2(oc->oformat->codec_tag, icodec->codec_id, &codec_tag))
|
||||
av_codec_get_tag(oc->oformat->codec_tag, icodec->codec_id) <= 0)
|
||||
codec->codec_tag = icodec->codec_tag;
|
||||
}
|
||||
|
||||
@@ -2226,7 +2124,7 @@ static int transcode_init(void)
|
||||
codec->frame_size = icodec->frame_size;
|
||||
codec->audio_service_type = icodec->audio_service_type;
|
||||
codec->block_align = icodec->block_align;
|
||||
if((codec->block_align == 1 || codec->block_align == 1152 || codec->block_align == 576) && codec->codec_id == AV_CODEC_ID_MP3)
|
||||
if((codec->block_align == 1 || codec->block_align == 1152) && codec->codec_id == AV_CODEC_ID_MP3)
|
||||
codec->block_align= 0;
|
||||
if(codec->codec_id == AV_CODEC_ID_AC3)
|
||||
codec->block_align= 0;
|
||||
@@ -2300,7 +2198,7 @@ static int transcode_init(void)
|
||||
codec->sample_fmt = ost->filter->filter->inputs[0]->format;
|
||||
codec->sample_rate = ost->filter->filter->inputs[0]->sample_rate;
|
||||
codec->channel_layout = ost->filter->filter->inputs[0]->channel_layout;
|
||||
codec->channels = avfilter_link_get_channels(ost->filter->filter->inputs[0]);
|
||||
codec->channels = av_get_channel_layout_nb_channels(codec->channel_layout);
|
||||
codec->time_base = (AVRational){ 1, codec->sample_rate };
|
||||
break;
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
@@ -2332,23 +2230,9 @@ static int transcode_init(void)
|
||||
codec->bits_per_raw_sample = frame_bits_per_raw_sample;
|
||||
}
|
||||
|
||||
if (ost->forced_keyframes) {
|
||||
if (!strncmp(ost->forced_keyframes, "expr:", 5)) {
|
||||
ret = av_expr_parse(&ost->forced_keyframes_pexpr, ost->forced_keyframes+5,
|
||||
forced_keyframes_const_names, NULL, NULL, NULL, NULL, 0, NULL);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Invalid force_key_frames expression '%s'\n", ost->forced_keyframes+5);
|
||||
return ret;
|
||||
}
|
||||
ost->forced_keyframes_expr_const_values[FKF_N] = 0;
|
||||
ost->forced_keyframes_expr_const_values[FKF_N_FORCED] = 0;
|
||||
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] = NAN;
|
||||
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] = NAN;
|
||||
} else {
|
||||
parse_forced_key_frames(ost->forced_keyframes, ost, ost->st->codec);
|
||||
}
|
||||
}
|
||||
if (ost->forced_keyframes)
|
||||
parse_forced_key_frames(ost->forced_keyframes, ost,
|
||||
ost->st->codec);
|
||||
break;
|
||||
case AVMEDIA_TYPE_SUBTITLE:
|
||||
codec->time_base = (AVRational){1, 1000};
|
||||
@@ -2437,20 +2321,13 @@ static int transcode_init(void)
|
||||
|
||||
if (ost->st->codec->me_threshold)
|
||||
input_streams[ost->source_index]->st->codec->debug |= FF_DEBUG_MV;
|
||||
} else {
|
||||
av_opt_set_dict(ost->st->codec, &ost->opts);
|
||||
}
|
||||
}
|
||||
|
||||
/* init input streams */
|
||||
for (i = 0; i < nb_input_streams; i++)
|
||||
if ((ret = init_input_stream(i, error, sizeof(error))) < 0) {
|
||||
for (i = 0; i < nb_output_streams; i++) {
|
||||
ost = output_streams[i];
|
||||
avcodec_close(ost->st->codec);
|
||||
}
|
||||
if ((ret = init_input_stream(i, error, sizeof(error))) < 0)
|
||||
goto dump_format;
|
||||
}
|
||||
|
||||
/* discard unused programs */
|
||||
for (i = 0; i < nb_input_files; i++) {
|
||||
@@ -3233,8 +3110,6 @@ static int transcode(void)
|
||||
av_freep(&ost->st->codec->subtitle_header);
|
||||
av_free(ost->forced_kf_pts);
|
||||
av_dict_free(&ost->opts);
|
||||
av_dict_free(&ost->swr_opts);
|
||||
av_dict_free(&ost->resample_opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3340,7 +3215,8 @@ int main(int argc, char **argv)
|
||||
exit(1);
|
||||
ti = getutime() - ti;
|
||||
if (do_benchmark) {
|
||||
printf("bench: utime=%0.3fs\n", ti / 1000000.0);
|
||||
int maxrss = getmaxrss() / 1024;
|
||||
printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
|
||||
}
|
||||
|
||||
exit(received_nb_signals ? 255 : 0);
|
||||
|
24
ffmpeg.h
24
ffmpeg.h
@@ -41,7 +41,6 @@
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/eval.h"
|
||||
#include "libavutil/fifo.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/rational.h"
|
||||
@@ -114,7 +113,6 @@ typedef struct OptionsContext {
|
||||
int chapters_input_file;
|
||||
|
||||
int64_t recording_time;
|
||||
int64_t stop_time;
|
||||
uint64_t limit_filesize;
|
||||
float mux_preload;
|
||||
float mux_max_delay;
|
||||
@@ -173,8 +171,6 @@ typedef struct OptionsContext {
|
||||
int nb_pass;
|
||||
SpecifierOpt *passlogfiles;
|
||||
int nb_passlogfiles;
|
||||
SpecifierOpt *guess_layout_max;
|
||||
int nb_guess_layout_max;
|
||||
} OptionsContext;
|
||||
|
||||
typedef struct InputFilter {
|
||||
@@ -199,7 +195,6 @@ typedef struct FilterGraph {
|
||||
const char *graph_desc;
|
||||
|
||||
AVFilterGraph *graph;
|
||||
int reconfiguration;
|
||||
|
||||
InputFilter **inputs;
|
||||
int nb_inputs;
|
||||
@@ -234,7 +229,6 @@ typedef struct InputStream {
|
||||
AVDictionary *opts;
|
||||
AVRational framerate; /* framerate forced with -r */
|
||||
int top_field_first;
|
||||
int guess_layout_max;
|
||||
|
||||
int resample_height;
|
||||
int resample_width;
|
||||
@@ -292,17 +286,6 @@ typedef struct InputFile {
|
||||
#endif
|
||||
} InputFile;
|
||||
|
||||
enum forced_keyframes_const {
|
||||
FKF_N,
|
||||
FKF_N_FORCED,
|
||||
FKF_PREV_FORCED_N,
|
||||
FKF_PREV_FORCED_T,
|
||||
FKF_T,
|
||||
FKF_NB
|
||||
};
|
||||
|
||||
extern const char *const forced_keyframes_const_names[];
|
||||
|
||||
typedef struct OutputStream {
|
||||
int file_index; /* file index */
|
||||
int index; /* stream index in the output file */
|
||||
@@ -334,8 +317,6 @@ typedef struct OutputStream {
|
||||
int forced_kf_count;
|
||||
int forced_kf_index;
|
||||
char *forced_keyframes;
|
||||
AVExpr *forced_keyframes_pexpr;
|
||||
double forced_keyframes_expr_const_values[FKF_NB];
|
||||
|
||||
/* audio only */
|
||||
int audio_channels_map[SWR_CH_MAX]; /* list of the channels id to pick from the source stream */
|
||||
@@ -348,9 +329,10 @@ typedef struct OutputStream {
|
||||
char *avfilter;
|
||||
|
||||
int64_t sws_flags;
|
||||
int64_t swr_filter_type;
|
||||
int64_t swr_dither_method;
|
||||
double swr_dither_scale;
|
||||
AVDictionary *opts;
|
||||
AVDictionary *swr_opts;
|
||||
AVDictionary *resample_opts;
|
||||
int finished; /* no more packets should be written for this stream */
|
||||
int unavailable; /* true if the steram is unavailable (possibly temporarily) */
|
||||
int stream_copy;
|
||||
|
@@ -24,8 +24,6 @@
|
||||
#include "libavfilter/avfiltergraph.h"
|
||||
#include "libavfilter/buffersink.h"
|
||||
|
||||
#include "libavresample/avresample.h"
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/bprint.h"
|
||||
@@ -141,7 +139,7 @@ static char *choose_ ## var ## s(OutputStream *ost) \
|
||||
if (ost->st->codec->var != none) { \
|
||||
get_name(ost->st->codec->var); \
|
||||
return av_strdup(name); \
|
||||
} else if (ost->enc && ost->enc->supported_list) { \
|
||||
} else if (ost->enc->supported_list) { \
|
||||
const type *p; \
|
||||
AVIOContext *s = NULL; \
|
||||
uint8_t *ret; \
|
||||
@@ -369,16 +367,12 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
char *sample_fmts, *sample_rates, *channel_layouts;
|
||||
char name[255];
|
||||
int ret;
|
||||
AVABufferSinkParams *params = av_abuffersink_params_alloc();
|
||||
|
||||
if (!params)
|
||||
return AVERROR(ENOMEM);
|
||||
params->all_channel_counts = 1;
|
||||
|
||||
snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
|
||||
ret = avfilter_graph_create_filter(&ofilter->filter,
|
||||
avfilter_get_by_name("ffabuffersink"),
|
||||
name, NULL, params, fg->graph);
|
||||
av_freep(¶ms);
|
||||
name, NULL, NULL, fg->graph);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@@ -528,7 +522,7 @@ static int sub2video_prepare(InputStream *ist)
|
||||
|
||||
/* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the
|
||||
palettes for all rectangles are identical or compatible */
|
||||
ist->resample_pix_fmt = ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
|
||||
ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
|
||||
|
||||
ret = av_image_alloc(image, linesize, w, h, AV_PIX_FMT_RGB32, 32);
|
||||
if (ret < 0)
|
||||
@@ -626,25 +620,20 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
AVFilter *filter = avfilter_get_by_name("abuffer");
|
||||
InputStream *ist = ifilter->ist;
|
||||
int pad_idx = in->pad_idx;
|
||||
AVBPrint args;
|
||||
char name[255];
|
||||
char args[255], name[255];
|
||||
int ret;
|
||||
|
||||
av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
|
||||
av_bprintf(&args, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s",
|
||||
snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s"
|
||||
":channel_layout=0x%"PRIx64,
|
||||
1, ist->st->codec->sample_rate,
|
||||
ist->st->codec->sample_rate,
|
||||
av_get_sample_fmt_name(ist->st->codec->sample_fmt));
|
||||
if (ist->st->codec->channel_layout)
|
||||
av_bprintf(&args, ":channel_layout=0x%"PRIx64,
|
||||
ist->st->codec->channel_layout);
|
||||
else
|
||||
av_bprintf(&args, ":channels=%d", ist->st->codec->channels);
|
||||
av_get_sample_fmt_name(ist->st->codec->sample_fmt),
|
||||
ist->st->codec->channel_layout);
|
||||
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
|
||||
ist->file_index, ist->st->index);
|
||||
|
||||
if ((ret = avfilter_graph_create_filter(&ifilter->filter, filter,
|
||||
name, args.str, NULL,
|
||||
name, args, NULL,
|
||||
fg->graph)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -675,8 +664,6 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
av_strlcatf(args, sizeof(args), "async=%d", audio_sync_method);
|
||||
if (audio_drift_threshold != 0.1)
|
||||
av_strlcatf(args, sizeof(args), ":min_hard_comp=%f", audio_drift_threshold);
|
||||
if (!fg->reconfiguration)
|
||||
av_strlcatf(args, sizeof(args), ":first_pts=0");
|
||||
AUTO_INSERT_FILTER_INPUT("-async", "aresample", args);
|
||||
}
|
||||
|
||||
@@ -734,29 +721,20 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
|
||||
if (simple) {
|
||||
OutputStream *ost = fg->outputs[0]->ost;
|
||||
char args[512];
|
||||
AVDictionaryEntry *e = NULL;
|
||||
|
||||
char args[255];
|
||||
snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
|
||||
fg->graph->scale_sws_opts = av_strdup(args);
|
||||
|
||||
args[0] = 0;
|
||||
while ((e = av_dict_get(ost->swr_opts, "", e,
|
||||
AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
|
||||
}
|
||||
if (ost->swr_filter_type != SWR_FILTER_TYPE_KAISER)
|
||||
av_strlcatf(args, sizeof(args), "filter_type=%d:", (int)ost->swr_filter_type);
|
||||
if (ost->swr_dither_method)
|
||||
av_strlcatf(args, sizeof(args), "dither_method=%d:", (int)ost->swr_dither_method);
|
||||
if (ost->swr_dither_scale != 1.0)
|
||||
av_strlcatf(args, sizeof(args), "dither_scale=%f:", ost->swr_dither_scale);
|
||||
if (strlen(args))
|
||||
args[strlen(args)-1] = 0;
|
||||
av_opt_set(fg->graph, "aresample_swr_opts", args, 0);
|
||||
|
||||
args[0] = '\0';
|
||||
while ((e = av_dict_get(fg->outputs[0]->ost->resample_opts, "", e,
|
||||
AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
|
||||
}
|
||||
if (strlen(args))
|
||||
args[strlen(args) - 1] = '\0';
|
||||
fg->graph->resample_lavr_opts = av_strdup(args);
|
||||
}
|
||||
|
||||
if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)
|
||||
@@ -798,7 +776,6 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
}
|
||||
}
|
||||
|
||||
fg->reconfiguration = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
82
ffmpeg_opt.c
82
ffmpeg_opt.c
@@ -81,7 +81,7 @@ int copy_ts = 0;
|
||||
int copy_tb = -1;
|
||||
int debug_ts = 0;
|
||||
int exit_on_error = 0;
|
||||
int print_stats = -1;
|
||||
int print_stats = 1;
|
||||
int qp_hist = 0;
|
||||
int stdin_interaction = 1;
|
||||
int frame_bits_per_raw_sample = 0;
|
||||
@@ -126,7 +126,6 @@ static void uninit_options(OptionsContext *o, int is_input)
|
||||
av_freep(&o->stream_maps);
|
||||
av_freep(&o->audio_channel_maps);
|
||||
av_freep(&o->streamid_map);
|
||||
av_freep(&o->attachments);
|
||||
|
||||
if (is_input)
|
||||
recording_time = o->recording_time;
|
||||
@@ -144,13 +143,24 @@ static void init_options(OptionsContext *o, int is_input)
|
||||
"-t is not an input option, keeping it for the next output;"
|
||||
" consider fixing your command line.\n");
|
||||
} else
|
||||
o->recording_time = INT64_MAX;
|
||||
o->stop_time = INT64_MAX;
|
||||
o->recording_time = INT64_MAX;
|
||||
o->mux_max_delay = 0.7;
|
||||
o->limit_filesize = UINT64_MAX;
|
||||
o->chapters_input_file = INT_MAX;
|
||||
}
|
||||
|
||||
static int opt_frame_crop(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
av_log(NULL, AV_LOG_FATAL, "Option '%s' has been removed, use the crop filter instead\n", opt);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
static int opt_pad(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
av_log(NULL, AV_LOG_FATAL, "Option '%s' has been removed, use the pad filter instead\n", opt);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int opt_sameq(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
av_log(NULL, AV_LOG_ERROR, "Option '%s' was removed. "
|
||||
@@ -606,8 +616,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
ist->guess_layout_max = INT_MAX;
|
||||
MATCH_PER_STREAM_OPT(guess_layout_max, i, ist->guess_layout_max, ic, st);
|
||||
guess_input_channel_layout(ist);
|
||||
|
||||
ist->resample_sample_fmt = dec->sample_fmt;
|
||||
@@ -957,8 +965,6 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
preset, ost->file_index, ost->index);
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
ost->opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
|
||||
}
|
||||
|
||||
avcodec_get_context_defaults3(st->codec, ost->enc);
|
||||
@@ -1005,12 +1011,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
|
||||
av_opt_get_int(o->g->sws_opts, "sws_flags", 0, &ost->sws_flags);
|
||||
|
||||
av_dict_copy(&ost->swr_opts, o->g->swr_opts, 0);
|
||||
if (ost->enc && av_get_exact_bits_per_sample(ost->enc->id) == 24)
|
||||
av_dict_set(&ost->swr_opts, "output_sample_bits", "24", 0);
|
||||
|
||||
av_dict_copy(&ost->resample_opts, o->g->resample_opts, 0);
|
||||
av_opt_get_int (o->g->swr_opts, "filter_type" , 0, &ost->swr_filter_type);
|
||||
av_opt_get_int (o->g->swr_opts, "dither_method", 0, &ost->swr_dither_method);
|
||||
av_opt_get_double(o->g->swr_opts, "dither_scale" , 0, &ost->swr_dither_scale);
|
||||
|
||||
ost->source_index = source_index;
|
||||
if (source_index >= 0) {
|
||||
@@ -1659,20 +1662,6 @@ loop_end:
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) {
|
||||
o->stop_time = INT64_MAX;
|
||||
av_log(NULL, AV_LOG_WARNING, "-t and -to cannot be used together; using -t.\n");
|
||||
}
|
||||
|
||||
if (o->stop_time != INT64_MAX && o->recording_time == INT64_MAX) {
|
||||
if (o->stop_time <= o->start_time) {
|
||||
av_log(NULL, AV_LOG_WARNING, "-to value smaller than -ss; ignoring -to.\n");
|
||||
o->stop_time = INT64_MAX;
|
||||
} else {
|
||||
o->recording_time = o->stop_time - o->start_time;
|
||||
}
|
||||
}
|
||||
|
||||
GROW_ARRAY(output_files, nb_output_files);
|
||||
if (!(output_files[nb_output_files - 1] = av_mallocz(sizeof(*output_files[0]))))
|
||||
exit(1);
|
||||
@@ -1706,8 +1695,7 @@ loop_end:
|
||||
print_error(filename, err);
|
||||
exit(1);
|
||||
}
|
||||
} else if (strcmp(oc->oformat->name, "image2")==0 && !av_filename_number_test(filename))
|
||||
assert_file_overwrite(filename);
|
||||
}
|
||||
|
||||
if (o->mux_preload) {
|
||||
uint8_t buf[64];
|
||||
@@ -2129,14 +2117,12 @@ static int opt_vsync(void *optctx, const char *opt, const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if FF_API_DEINTERLACE
|
||||
static int opt_deinterlace(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
av_log(NULL, AV_LOG_WARNING, "-%s is deprecated, use -filter:v yadif instead\n", opt);
|
||||
do_deinterlace = 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int opt_timecode(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
@@ -2311,7 +2297,7 @@ static int open_files(OptionGroupList *l, const char *inout,
|
||||
inout, g->arg);
|
||||
return ret;
|
||||
}
|
||||
av_log(NULL, AV_LOG_DEBUG, "Successfully opened the file.\n");
|
||||
av_log(NULL, AV_LOG_DEBUG, "Successfully openened the file.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2409,8 +2395,6 @@ const OptionDef options[] = {
|
||||
{ "t", HAS_ARG | OPT_TIME | OPT_OFFSET, { .off = OFFSET(recording_time) },
|
||||
"record or transcode \"duration\" seconds of audio/video",
|
||||
"duration" },
|
||||
{ "to", HAS_ARG | OPT_TIME | OPT_OFFSET, { .off = OFFSET(stop_time) },
|
||||
"record or transcode stop time", "time_stop" },
|
||||
{ "fs", HAS_ARG | OPT_INT64 | OPT_OFFSET, { .off = OFFSET(limit_filesize) },
|
||||
"set the limit file size in bytes", "limit_size" },
|
||||
{ "ss", HAS_ARG | OPT_TIME | OPT_OFFSET, { .off = OFFSET(start_time) },
|
||||
@@ -2477,7 +2461,7 @@ const OptionDef options[] = {
|
||||
{ "profile", HAS_ARG | OPT_EXPERT | OPT_PERFILE, { .func_arg = opt_profile },
|
||||
"set profile", "profile" },
|
||||
{ "filter", HAS_ARG | OPT_STRING | OPT_SPEC, { .off = OFFSET(filters) },
|
||||
"set stream filtergraph", "filter_graph" },
|
||||
"set stream filterchain", "filter_list" },
|
||||
{ "reinit_filter", HAS_ARG | OPT_INT | OPT_SPEC, { .off = OFFSET(reinit_filters) },
|
||||
"reinit filtergraph on input parameter changes", "" },
|
||||
{ "filter_complex", HAS_ARG | OPT_EXPERT, { .func_arg = opt_filter_complex },
|
||||
@@ -2504,6 +2488,24 @@ const OptionDef options[] = {
|
||||
"set pixel format", "format" },
|
||||
{ "bits_per_raw_sample", OPT_VIDEO | OPT_INT | HAS_ARG, { &frame_bits_per_raw_sample },
|
||||
"set the number of bits per raw sample", "number" },
|
||||
{ "croptop", OPT_VIDEO | HAS_ARG, { .func_arg = opt_frame_crop },
|
||||
"Removed, use the crop filter instead", "size" },
|
||||
{ "cropbottom", OPT_VIDEO | HAS_ARG, { .func_arg = opt_frame_crop },
|
||||
"Removed, use the crop filter instead", "size" },
|
||||
{ "cropleft", OPT_VIDEO | HAS_ARG, { .func_arg = opt_frame_crop },
|
||||
"Removed, use the crop filter instead", "size" },
|
||||
{ "cropright", OPT_VIDEO | HAS_ARG, { .func_arg = opt_frame_crop },
|
||||
"Removed, use the crop filter instead", "size" },
|
||||
{ "padtop", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
|
||||
"Removed, use the pad filter instead", "size" },
|
||||
{ "padbottom", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
|
||||
"Removed, use the pad filter instead", "size" },
|
||||
{ "padleft", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
|
||||
"Removed, use the pad filter instead", "size" },
|
||||
{ "padright", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
|
||||
"Removed, use the pad filter instead", "size" },
|
||||
{ "padcolor", OPT_VIDEO | HAS_ARG, { .func_arg = opt_pad },
|
||||
"Removed, use the pad filter instead", "color" },
|
||||
{ "intra", OPT_VIDEO | OPT_BOOL | OPT_EXPERT, { &intra_only },
|
||||
"deprecated use -g 1" },
|
||||
{ "vn", OPT_VIDEO | OPT_BOOL | OPT_OFFSET, { .off = OFFSET(video_disable) },
|
||||
@@ -2524,10 +2526,8 @@ const OptionDef options[] = {
|
||||
"select the pass number (1 to 3)", "n" },
|
||||
{ "passlogfile", OPT_VIDEO | HAS_ARG | OPT_STRING | OPT_EXPERT | OPT_SPEC, { .off = OFFSET(passlogfiles) },
|
||||
"select two pass log file name prefix", "prefix" },
|
||||
#if FF_API_DEINTERLACE
|
||||
{ "deinterlace", OPT_VIDEO | OPT_EXPERT , { .func_arg = opt_deinterlace },
|
||||
"this option is deprecated, use the yadif filter instead" },
|
||||
#endif
|
||||
{ "psnr", OPT_VIDEO | OPT_BOOL | OPT_EXPERT, { &do_psnr },
|
||||
"calculate PSNR of compressed frames" },
|
||||
{ "vstats", OPT_VIDEO | OPT_EXPERT , { &opt_vstats },
|
||||
@@ -2535,7 +2535,7 @@ const OptionDef options[] = {
|
||||
{ "vstats_file", OPT_VIDEO | HAS_ARG | OPT_EXPERT , { opt_vstats_file },
|
||||
"dump video coding statistics to file", "file" },
|
||||
{ "vf", OPT_VIDEO | HAS_ARG | OPT_PERFILE, { .func_arg = opt_video_filters },
|
||||
"set video filters", "filter_graph" },
|
||||
"video filters", "filter list" },
|
||||
{ "intra_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC, { .off = OFFSET(intra_matrices) },
|
||||
"specify intra matrix coeffs", "matrix" },
|
||||
{ "inter_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC, { .off = OFFSET(inter_matrices) },
|
||||
@@ -2580,9 +2580,7 @@ const OptionDef options[] = {
|
||||
{ "channel_layout", OPT_AUDIO | HAS_ARG | OPT_EXPERT | OPT_PERFILE, { .func_arg = opt_channel_layout },
|
||||
"set channel layout", "layout" },
|
||||
{ "af", OPT_AUDIO | HAS_ARG | OPT_PERFILE, { .func_arg = opt_audio_filters },
|
||||
"set audio filters", "filter_graph" },
|
||||
{ "guess_layout_max", OPT_AUDIO | HAS_ARG | OPT_INT | OPT_SPEC | OPT_EXPERT, { .off = OFFSET(guess_layout_max) },
|
||||
"set the maximum number of channels to try to guess the channel layout" },
|
||||
"audio filters", "filter list" },
|
||||
|
||||
/* subtitle options */
|
||||
{ "sn", OPT_SUBTITLE | OPT_BOOL | OPT_OFFSET, { .off = OFFSET(subtitle_disable) },
|
||||
|
307
ffplay.c
307
ffplay.c
@@ -86,9 +86,6 @@ const int program_birth_year = 2003;
|
||||
/* we use about AUDIO_DIFF_AVG_NB A-V differences to make the average */
|
||||
#define AUDIO_DIFF_AVG_NB 20
|
||||
|
||||
/* polls for possible required screen refresh at least this often, should be less than 1/fps */
|
||||
#define REFRESH_RATE 0.01
|
||||
|
||||
/* NOTE: the size must be big enough to compensate the hardware audio buffersize size */
|
||||
/* TODO: We assume that a decoded and resampled frame fits into this buffer */
|
||||
#define SAMPLE_ARRAY_SIZE (8 * 65536)
|
||||
@@ -119,6 +116,7 @@ typedef struct PacketQueue {
|
||||
typedef struct VideoPicture {
|
||||
double pts; // presentation timestamp for this picture
|
||||
int64_t pos; // byte position in file
|
||||
int skip;
|
||||
SDL_Overlay *bmp;
|
||||
int width, height; /* source height & width */
|
||||
AVRational sample_aspect_ratio;
|
||||
@@ -139,7 +137,7 @@ typedef struct SubPicture {
|
||||
typedef struct AudioParams {
|
||||
int freq;
|
||||
int channels;
|
||||
int64_t channel_layout;
|
||||
int channel_layout;
|
||||
enum AVSampleFormat fmt;
|
||||
} AudioParams;
|
||||
|
||||
@@ -152,6 +150,7 @@ enum {
|
||||
typedef struct VideoState {
|
||||
SDL_Thread *read_tid;
|
||||
SDL_Thread *video_tid;
|
||||
SDL_Thread *refresh_tid;
|
||||
AVInputFormat *iformat;
|
||||
int no_background;
|
||||
int abort_request;
|
||||
@@ -176,7 +175,6 @@ typedef struct VideoState {
|
||||
double external_clock_speed; ///< speed of the external clock
|
||||
|
||||
double audio_clock;
|
||||
int audio_clock_serial;
|
||||
double audio_diff_cum; /* used for AV difference average computation */
|
||||
double audio_diff_avg_coef;
|
||||
double audio_diff_threshold;
|
||||
@@ -184,11 +182,11 @@ typedef struct VideoState {
|
||||
AVStream *audio_st;
|
||||
PacketQueue audioq;
|
||||
int audio_hw_buf_size;
|
||||
DECLARE_ALIGNED(16,uint8_t,audio_buf2)[AVCODEC_MAX_AUDIO_FRAME_SIZE * 4];
|
||||
uint8_t silence_buf[SDL_AUDIO_BUFFER_SIZE];
|
||||
uint8_t *audio_buf;
|
||||
uint8_t *audio_buf1;
|
||||
unsigned int audio_buf_size; /* in bytes */
|
||||
unsigned int audio_buf1_size;
|
||||
int audio_buf_index; /* in bytes */
|
||||
int audio_write_buf_size;
|
||||
AVPacket audio_pkt_temp;
|
||||
@@ -213,7 +211,6 @@ typedef struct VideoState {
|
||||
int rdft_bits;
|
||||
FFTSample *rdft_data;
|
||||
int xpos;
|
||||
double last_vis_time;
|
||||
|
||||
SDL_Thread *subtitle_tid;
|
||||
int subtitle_stream;
|
||||
@@ -232,14 +229,14 @@ typedef struct VideoState {
|
||||
double frame_last_returned_time;
|
||||
double frame_last_filter_delay;
|
||||
int64_t frame_last_dropped_pos;
|
||||
double video_clock; // pts of last decoded frame / predicted pts of next decoded frame
|
||||
int video_stream;
|
||||
AVStream *video_st;
|
||||
PacketQueue videoq;
|
||||
double video_current_pts; // current displayed pts
|
||||
double video_current_pts; // current displayed pts (different from video_clock if frame fifos are used)
|
||||
double video_current_pts_drift; // video_current_pts - time (av_gettime) at which we updated video_current_pts - used to have running video pts
|
||||
int64_t video_current_pos; // current displayed file pos
|
||||
double max_frame_duration; // maximum duration of a frame - above this, we consider the jump a timestamp discontinuity
|
||||
int video_clock_serial;
|
||||
VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE];
|
||||
int pictq_size, pictq_rindex, pictq_windex;
|
||||
SDL_mutex *pictq_mutex;
|
||||
@@ -260,6 +257,7 @@ typedef struct VideoState {
|
||||
FrameBuffer *buffer_pool;
|
||||
#endif
|
||||
|
||||
int refresh;
|
||||
int last_video_stream, last_audio_stream, last_subtitle_stream;
|
||||
|
||||
SDL_cond *continue_read_thread;
|
||||
@@ -271,13 +269,10 @@ static const char *input_filename;
|
||||
static const char *window_title;
|
||||
static int fs_screen_width;
|
||||
static int fs_screen_height;
|
||||
static int default_width = 640;
|
||||
static int default_height = 480;
|
||||
static int screen_width = 0;
|
||||
static int screen_height = 0;
|
||||
static int audio_disable;
|
||||
static int video_disable;
|
||||
static int subtitle_disable;
|
||||
static int wanted_stream[AVMEDIA_TYPE_NB] = {
|
||||
[AVMEDIA_TYPE_AUDIO] = -1,
|
||||
[AVMEDIA_TYPE_VIDEO] = -1,
|
||||
@@ -309,7 +304,7 @@ static enum ShowMode show_mode = SHOW_MODE_NONE;
|
||||
static const char *audio_codec_name;
|
||||
static const char *subtitle_codec_name;
|
||||
static const char *video_codec_name;
|
||||
double rdftspeed = 0.02;
|
||||
static int rdftspeed = 20;
|
||||
static int64_t cursor_last_shown;
|
||||
static int cursor_hidden = 0;
|
||||
#if CONFIG_AVFILTER
|
||||
@@ -323,6 +318,7 @@ static int64_t audio_callback_time;
|
||||
static AVPacket flush_pkt;
|
||||
|
||||
#define FF_ALLOC_EVENT (SDL_USEREVENT)
|
||||
#define FF_REFRESH_EVENT (SDL_USEREVENT + 1)
|
||||
#define FF_QUIT_EVENT (SDL_USEREVENT + 2)
|
||||
|
||||
static SDL_Surface *screen;
|
||||
@@ -975,6 +971,7 @@ static void stream_close(VideoState *is)
|
||||
/* XXX: use a special url_shutdown call to abort parse cleanly */
|
||||
is->abort_request = 1;
|
||||
SDL_WaitThread(is->read_tid, NULL);
|
||||
SDL_WaitThread(is->refresh_tid, NULL);
|
||||
packet_queue_destroy(&is->videoq);
|
||||
packet_queue_destroy(&is->audioq);
|
||||
packet_queue_destroy(&is->subtitleq);
|
||||
@@ -996,7 +993,8 @@ static void stream_close(VideoState *is)
|
||||
SDL_DestroyCond(is->subpq_cond);
|
||||
SDL_DestroyCond(is->continue_read_thread);
|
||||
#if !CONFIG_AVFILTER
|
||||
sws_freeContext(is->img_convert_ctx);
|
||||
if (is->img_convert_ctx)
|
||||
sws_freeContext(is->img_convert_ctx);
|
||||
#endif
|
||||
av_free(is);
|
||||
}
|
||||
@@ -1025,30 +1023,29 @@ static void sigterm_handler(int sig)
|
||||
exit(123);
|
||||
}
|
||||
|
||||
static int video_open(VideoState *is, int force_set_video_mode, VideoPicture *vp)
|
||||
static int video_open(VideoState *is, int force_set_video_mode)
|
||||
{
|
||||
int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
|
||||
int w,h;
|
||||
VideoPicture *vp = &is->pictq[is->pictq_rindex];
|
||||
SDL_Rect rect;
|
||||
|
||||
if (is_full_screen) flags |= SDL_FULLSCREEN;
|
||||
else flags |= SDL_RESIZABLE;
|
||||
|
||||
if (vp && vp->width) {
|
||||
calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp);
|
||||
default_width = rect.w;
|
||||
default_height = rect.h;
|
||||
}
|
||||
|
||||
if (is_full_screen && fs_screen_width) {
|
||||
w = fs_screen_width;
|
||||
h = fs_screen_height;
|
||||
} else if (!is_full_screen && screen_width) {
|
||||
w = screen_width;
|
||||
h = screen_height;
|
||||
} else if (vp->width) {
|
||||
calculate_display_rect(&rect, 0, 0, INT_MAX, vp->height, vp);
|
||||
w = rect.w;
|
||||
h = rect.h;
|
||||
} else {
|
||||
w = default_width;
|
||||
h = default_height;
|
||||
w = 640;
|
||||
h = 480;
|
||||
}
|
||||
if (screen && is->width == screen->w && screen->w == w
|
||||
&& is->height== screen->h && screen->h == h && !force_set_video_mode)
|
||||
@@ -1072,18 +1069,33 @@ static int video_open(VideoState *is, int force_set_video_mode, VideoPicture *vp
|
||||
static void video_display(VideoState *is)
|
||||
{
|
||||
if (!screen)
|
||||
video_open(is, 0, NULL);
|
||||
video_open(is, 0);
|
||||
if (is->audio_st && is->show_mode != SHOW_MODE_VIDEO)
|
||||
video_audio_display(is);
|
||||
else if (is->video_st)
|
||||
video_image_display(is);
|
||||
}
|
||||
|
||||
static int refresh_thread(void *opaque)
|
||||
{
|
||||
VideoState *is= opaque;
|
||||
while (!is->abort_request) {
|
||||
SDL_Event event;
|
||||
event.type = FF_REFRESH_EVENT;
|
||||
event.user.data1 = opaque;
|
||||
if (!is->refresh && (!is->paused || is->force_refresh)) {
|
||||
is->refresh = 1;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
//FIXME ideally we should wait the correct time but SDLs event passing is so slow it would be silly
|
||||
av_usleep(is->audio_st && is->show_mode != SHOW_MODE_VIDEO ? rdftspeed*1000 : 5000);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get the current audio clock value */
|
||||
static double get_audio_clock(VideoState *is)
|
||||
{
|
||||
if (is->audio_clock_serial != is->audioq.serial)
|
||||
return NAN;
|
||||
if (is->paused) {
|
||||
return is->audio_current_pts;
|
||||
} else {
|
||||
@@ -1094,8 +1106,6 @@ static double get_audio_clock(VideoState *is)
|
||||
/* get the current video clock value */
|
||||
static double get_video_clock(VideoState *is)
|
||||
{
|
||||
if (is->video_clock_serial != is->videoq.serial)
|
||||
return NAN;
|
||||
if (is->paused) {
|
||||
return is->video_current_pts;
|
||||
} else {
|
||||
@@ -1157,8 +1167,7 @@ static void update_external_clock_pts(VideoState *is, double pts)
|
||||
}
|
||||
|
||||
static void check_external_clock_sync(VideoState *is, double pts) {
|
||||
double ext_clock = get_external_clock(is);
|
||||
if (isnan(ext_clock) || fabs(ext_clock - pts) > AV_NOSYNC_THRESHOLD) {
|
||||
if (fabs(get_external_clock(is) - pts) > AV_NOSYNC_THRESHOLD) {
|
||||
update_external_clock_pts(is, pts);
|
||||
}
|
||||
}
|
||||
@@ -1192,7 +1201,6 @@ static void stream_seek(VideoState *is, int64_t pos, int64_t rel, int seek_by_by
|
||||
if (seek_by_bytes)
|
||||
is->seek_flags |= AVSEEK_FLAG_BYTE;
|
||||
is->seek_req = 1;
|
||||
SDL_CondSignal(is->continue_read_thread);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1210,20 +1218,6 @@ static void stream_toggle_pause(VideoState *is)
|
||||
is->paused = !is->paused;
|
||||
}
|
||||
|
||||
static void toggle_pause(VideoState *is)
|
||||
{
|
||||
stream_toggle_pause(is);
|
||||
is->step = 0;
|
||||
}
|
||||
|
||||
static void step_to_next_frame(VideoState *is)
|
||||
{
|
||||
/* if the stream is paused unpause it, then step */
|
||||
if (is->paused)
|
||||
stream_toggle_pause(is);
|
||||
is->step = 1;
|
||||
}
|
||||
|
||||
static double compute_target_delay(double delay, VideoState *is)
|
||||
{
|
||||
double sync_threshold, diff;
|
||||
@@ -1238,7 +1232,7 @@ static double compute_target_delay(double delay, VideoState *is)
|
||||
delay to compute the threshold. I still don't know
|
||||
if it is the best guess */
|
||||
sync_threshold = FFMAX(AV_SYNC_THRESHOLD, delay);
|
||||
if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD) {
|
||||
if (fabs(diff) < AV_NOSYNC_THRESHOLD) {
|
||||
if (diff <= -sync_threshold)
|
||||
delay = 0;
|
||||
else if (diff >= sync_threshold)
|
||||
@@ -1263,23 +1257,20 @@ static void pictq_next_picture(VideoState *is) {
|
||||
SDL_UnlockMutex(is->pictq_mutex);
|
||||
}
|
||||
|
||||
static int pictq_prev_picture(VideoState *is) {
|
||||
static void pictq_prev_picture(VideoState *is) {
|
||||
VideoPicture *prevvp;
|
||||
int ret = 0;
|
||||
/* update queue size and signal for the previous picture */
|
||||
prevvp = &is->pictq[(is->pictq_rindex + VIDEO_PICTURE_QUEUE_SIZE - 1) % VIDEO_PICTURE_QUEUE_SIZE];
|
||||
if (prevvp->allocated && prevvp->serial == is->videoq.serial) {
|
||||
if (prevvp->allocated && !prevvp->skip) {
|
||||
SDL_LockMutex(is->pictq_mutex);
|
||||
if (is->pictq_size < VIDEO_PICTURE_QUEUE_SIZE - 1) {
|
||||
if (--is->pictq_rindex == -1)
|
||||
is->pictq_rindex = VIDEO_PICTURE_QUEUE_SIZE - 1;
|
||||
is->pictq_size++;
|
||||
ret = 1;
|
||||
}
|
||||
SDL_CondSignal(is->pictq_cond);
|
||||
SDL_UnlockMutex(is->pictq_mutex);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void update_video_pts(VideoState *is, double pts, int64_t pos, int serial) {
|
||||
@@ -1289,13 +1280,12 @@ static void update_video_pts(VideoState *is, double pts, int64_t pos, int serial
|
||||
is->video_current_pts_drift = is->video_current_pts - time;
|
||||
is->video_current_pos = pos;
|
||||
is->frame_last_pts = pts;
|
||||
is->video_clock_serial = serial;
|
||||
if (is->videoq.serial == serial)
|
||||
check_external_clock_sync(is, is->video_current_pts);
|
||||
}
|
||||
|
||||
/* called to display each frame */
|
||||
static void video_refresh(void *opaque, double *remaining_time)
|
||||
static void video_refresh(void *opaque)
|
||||
{
|
||||
VideoState *is = opaque;
|
||||
VideoPicture *vp;
|
||||
@@ -1306,19 +1296,12 @@ static void video_refresh(void *opaque, double *remaining_time)
|
||||
if (!is->paused && get_master_sync_type(is) == AV_SYNC_EXTERNAL_CLOCK && is->realtime)
|
||||
check_external_clock_speed(is);
|
||||
|
||||
if (!display_disable && is->show_mode != SHOW_MODE_VIDEO && is->audio_st) {
|
||||
time = av_gettime() / 1000000.0;
|
||||
if (is->force_refresh || is->last_vis_time + rdftspeed < time) {
|
||||
video_display(is);
|
||||
is->last_vis_time = time;
|
||||
}
|
||||
*remaining_time = FFMIN(*remaining_time, is->last_vis_time + rdftspeed - time);
|
||||
}
|
||||
if (!display_disable && is->show_mode != SHOW_MODE_VIDEO && is->audio_st)
|
||||
video_display(is);
|
||||
|
||||
if (is->video_st) {
|
||||
int redisplay = 0;
|
||||
if (is->force_refresh)
|
||||
redisplay = pictq_prev_picture(is);
|
||||
pictq_prev_picture(is);
|
||||
retry:
|
||||
if (is->pictq_size == 0) {
|
||||
SDL_LockMutex(is->pictq_mutex);
|
||||
@@ -1333,9 +1316,8 @@ retry:
|
||||
/* dequeue the picture */
|
||||
vp = &is->pictq[is->pictq_rindex];
|
||||
|
||||
if (vp->serial != is->videoq.serial) {
|
||||
if (vp->skip) {
|
||||
pictq_next_picture(is);
|
||||
redisplay = 0;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
@@ -1351,10 +1333,8 @@ retry:
|
||||
delay = compute_target_delay(is->frame_last_duration, is);
|
||||
|
||||
time= av_gettime()/1000000.0;
|
||||
if (time < is->frame_timer + delay) {
|
||||
*remaining_time = FFMIN(is->frame_timer + delay - time, *remaining_time);
|
||||
if (time < is->frame_timer + delay)
|
||||
return;
|
||||
}
|
||||
|
||||
if (delay > 0)
|
||||
is->frame_timer += delay * FFMAX(1, floor((time-is->frame_timer) / delay));
|
||||
@@ -1366,11 +1346,9 @@ retry:
|
||||
if (is->pictq_size > 1) {
|
||||
VideoPicture *nextvp = &is->pictq[(is->pictq_rindex + 1) % VIDEO_PICTURE_QUEUE_SIZE];
|
||||
duration = nextvp->pts - vp->pts;
|
||||
if(!is->step && (redisplay || framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) && time > is->frame_timer + duration){
|
||||
if (!redisplay)
|
||||
is->frame_drops_late++;
|
||||
if(!is->step && (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) && time > is->frame_timer + duration){
|
||||
is->frame_drops_late++;
|
||||
pictq_next_picture(is);
|
||||
redisplay = 0;
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
@@ -1481,7 +1459,7 @@ static void alloc_picture(VideoState *is)
|
||||
avfilter_unref_bufferp(&vp->picref);
|
||||
#endif
|
||||
|
||||
video_open(is, 0, vp);
|
||||
video_open(is, 0);
|
||||
|
||||
vp->bmp = SDL_CreateYUVOverlay(vp->width, vp->height,
|
||||
SDL_YV12_OVERLAY,
|
||||
@@ -1519,13 +1497,29 @@ static void duplicate_right_border_pixels(SDL_Overlay *bmp) {
|
||||
}
|
||||
}
|
||||
|
||||
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t pos, int serial)
|
||||
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_t pos, int serial)
|
||||
{
|
||||
VideoPicture *vp;
|
||||
double frame_delay, pts = pts1;
|
||||
|
||||
/* compute the exact PTS for the picture if it is omitted in the stream
|
||||
* pts1 is the dts of the pkt / pts of the frame */
|
||||
if (pts != 0) {
|
||||
/* update video clock with pts, if present */
|
||||
is->video_clock = pts;
|
||||
} else {
|
||||
pts = is->video_clock;
|
||||
}
|
||||
/* update video clock for next frame */
|
||||
frame_delay = av_q2d(is->video_st->codec->time_base);
|
||||
/* for MPEG2, the frame can be repeated, so we update the
|
||||
clock accordingly */
|
||||
frame_delay += src_frame->repeat_pict * (frame_delay * 0.5);
|
||||
is->video_clock += frame_delay;
|
||||
|
||||
#if defined(DEBUG_SYNC) && 0
|
||||
printf("frame_type=%c pts=%0.3f\n",
|
||||
av_get_picture_type_char(src_frame->pict_type), pts);
|
||||
printf("frame_type=%c clock=%0.3f pts=%0.3f\n",
|
||||
av_get_picture_type_char(src_frame->pict_type), pts, pts1);
|
||||
#endif
|
||||
|
||||
/* wait until we have space to put a new picture */
|
||||
@@ -1625,6 +1619,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
|
||||
|
||||
vp->pts = pts;
|
||||
vp->pos = pos;
|
||||
vp->skip = 0;
|
||||
vp->serial = serial;
|
||||
|
||||
/* now we can update the picture count */
|
||||
@@ -1639,7 +1634,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
|
||||
|
||||
static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt, int *serial)
|
||||
{
|
||||
int got_picture;
|
||||
int got_picture, i;
|
||||
|
||||
if (packet_queue_get(&is->videoq, pkt, 1, serial) < 0)
|
||||
return -1;
|
||||
@@ -1649,6 +1644,9 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
|
||||
|
||||
SDL_LockMutex(is->pictq_mutex);
|
||||
// Make sure there are no long delay timers (ideally we should just flush the queue but that's harder)
|
||||
for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
|
||||
is->pictq[i].skip = 1;
|
||||
}
|
||||
while (is->pictq_size && !is->videoq.abort_request) {
|
||||
SDL_CondWait(is->pictq_cond, is->pictq_mutex);
|
||||
}
|
||||
@@ -1686,7 +1684,7 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
|
||||
double clockdiff = get_video_clock(is) - get_master_clock(is);
|
||||
double dpts = av_q2d(is->video_st->time_base) * *pts;
|
||||
double ptsdiff = dpts - is->frame_last_pts;
|
||||
if (!isnan(clockdiff) && fabs(clockdiff) < AV_NOSYNC_THRESHOLD &&
|
||||
if (fabs(clockdiff) < AV_NOSYNC_THRESHOLD &&
|
||||
ptsdiff > 0 && ptsdiff < AV_NOSYNC_THRESHOLD &&
|
||||
clockdiff + ptsdiff - is->frame_last_filter_delay < 0) {
|
||||
is->frame_last_dropped_pos = pkt->pos;
|
||||
@@ -1755,7 +1753,6 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
|
||||
if (!buffersink_params)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
av_opt_get_int(sws_opts, "sws_flags", 0, &sws_flags);
|
||||
snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%"PRId64, sws_flags);
|
||||
graph->scale_sws_opts = av_strdup(sws_flags_str);
|
||||
|
||||
@@ -1817,7 +1814,6 @@ static int video_thread(void *arg)
|
||||
int last_w = 0;
|
||||
int last_h = 0;
|
||||
enum AVPixelFormat last_format = -2;
|
||||
int last_serial = -1;
|
||||
|
||||
if (codec->codec->capabilities & CODEC_CAP_DR1) {
|
||||
is->use_dr1 = 1;
|
||||
@@ -1848,14 +1844,9 @@ static int video_thread(void *arg)
|
||||
#if CONFIG_AVFILTER
|
||||
if ( last_w != frame->width
|
||||
|| last_h != frame->height
|
||||
|| last_format != frame->format
|
||||
|| last_serial != serial) {
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"Video frame changed from size:%dx%d format:%s serial:%d to size:%dx%d format:%s serial:%d\n",
|
||||
last_w, last_h,
|
||||
(const char *)av_x_if_null(av_get_pix_fmt_name(last_format), "none"), last_serial,
|
||||
frame->width, frame->height,
|
||||
(const char *)av_x_if_null(av_get_pix_fmt_name(frame->format), "none"), serial);
|
||||
|| last_format != frame->format) {
|
||||
av_log(NULL, AV_LOG_INFO, "Frame changed from size:%dx%d to size:%dx%d\n",
|
||||
last_w, last_h, frame->width, frame->height);
|
||||
avfilter_graph_free(&graph);
|
||||
graph = avfilter_graph_alloc();
|
||||
if ((ret = configure_video_filters(graph, is, vfilters, frame)) < 0) {
|
||||
@@ -1871,7 +1862,6 @@ static int video_thread(void *arg)
|
||||
last_w = frame->width;
|
||||
last_h = frame->height;
|
||||
last_format = frame->format;
|
||||
last_serial = serial;
|
||||
}
|
||||
|
||||
frame->pts = pts_int;
|
||||
@@ -2047,7 +2037,7 @@ static int synchronize_audio(VideoState *is, int nb_samples)
|
||||
|
||||
diff = get_audio_clock(is) - get_master_clock(is);
|
||||
|
||||
if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD) {
|
||||
if (fabs(diff) < AV_NOSYNC_THRESHOLD) {
|
||||
is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum;
|
||||
if (is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) {
|
||||
/* not enough measures to have a correct estimate */
|
||||
@@ -2062,9 +2052,9 @@ static int synchronize_audio(VideoState *is, int nb_samples)
|
||||
max_nb_samples = ((nb_samples * (100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100));
|
||||
wanted_nb_samples = FFMIN(FFMAX(wanted_nb_samples, min_nb_samples), max_nb_samples);
|
||||
}
|
||||
av_dlog(NULL, "diff=%f adiff=%f sample_diff=%d apts=%0.3f %f\n",
|
||||
av_dlog(NULL, "diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
|
||||
diff, avg_diff, wanted_nb_samples - nb_samples,
|
||||
is->audio_clock, is->audio_diff_threshold);
|
||||
is->audio_clock, is->video_clock, is->audio_diff_threshold);
|
||||
}
|
||||
} else {
|
||||
/* too big difference : may be initial PTS errors, so
|
||||
@@ -2077,14 +2067,8 @@ static int synchronize_audio(VideoState *is, int nb_samples)
|
||||
return wanted_nb_samples;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode one audio frame and return its uncompressed size.
|
||||
*
|
||||
* The processed audio frame is decoded, converted if required, and
|
||||
* stored in is->audio_buf, with size in bytes given by the return
|
||||
* value.
|
||||
*/
|
||||
static int audio_decode_frame(VideoState *is)
|
||||
/* decode one audio frame and returns its uncompressed size */
|
||||
static int audio_decode_frame(VideoState *is, double *pts_ptr)
|
||||
{
|
||||
AVPacket *pkt_temp = &is->audio_pkt_temp;
|
||||
AVPacket *pkt = &is->audio_pkt;
|
||||
@@ -2092,7 +2076,7 @@ static int audio_decode_frame(VideoState *is)
|
||||
int len1, len2, data_size, resampled_data_size;
|
||||
int64_t dec_channel_layout;
|
||||
int got_frame;
|
||||
av_unused double audio_clock0;
|
||||
double pts;
|
||||
int new_packet = 0;
|
||||
int flush_complete = 0;
|
||||
int wanted_nb_samples;
|
||||
@@ -2106,9 +2090,6 @@ static int audio_decode_frame(VideoState *is)
|
||||
} else
|
||||
avcodec_get_frame_defaults(is->frame);
|
||||
|
||||
if (is->audioq.serial != is->audio_pkt_temp_serial)
|
||||
break;
|
||||
|
||||
if (is->paused)
|
||||
return -1;
|
||||
|
||||
@@ -2131,13 +2112,13 @@ static int audio_decode_frame(VideoState *is)
|
||||
flush_complete = 1;
|
||||
continue;
|
||||
}
|
||||
data_size = av_samples_get_buffer_size(NULL, av_frame_get_channels(is->frame),
|
||||
data_size = av_samples_get_buffer_size(NULL, is->frame->channels,
|
||||
is->frame->nb_samples,
|
||||
is->frame->format, 1);
|
||||
|
||||
dec_channel_layout =
|
||||
(is->frame->channel_layout && av_frame_get_channels(is->frame) == av_get_channel_layout_nb_channels(is->frame->channel_layout)) ?
|
||||
is->frame->channel_layout : av_get_default_channel_layout(av_frame_get_channels(is->frame));
|
||||
(is->frame->channel_layout && is->frame->channels == av_get_channel_layout_nb_channels(is->frame->channel_layout)) ?
|
||||
is->frame->channel_layout : av_get_default_channel_layout(is->frame->channels);
|
||||
wanted_nb_samples = synchronize_audio(is, is->frame->nb_samples);
|
||||
|
||||
if (is->frame->format != is->audio_src.fmt ||
|
||||
@@ -2151,21 +2132,20 @@ static int audio_decode_frame(VideoState *is)
|
||||
0, NULL);
|
||||
if (!is->swr_ctx || swr_init(is->swr_ctx) < 0) {
|
||||
fprintf(stderr, "Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n",
|
||||
is->frame->sample_rate, av_get_sample_fmt_name(is->frame->format), av_frame_get_channels(is->frame),
|
||||
is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.channels);
|
||||
is->frame->sample_rate, av_get_sample_fmt_name(is->frame->format), (int)is->frame->channels,
|
||||
is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.channels);
|
||||
break;
|
||||
}
|
||||
is->audio_src.channel_layout = dec_channel_layout;
|
||||
is->audio_src.channels = av_frame_get_channels(is->frame);
|
||||
is->audio_src.channels = is->frame->channels;
|
||||
is->audio_src.freq = is->frame->sample_rate;
|
||||
is->audio_src.fmt = is->frame->format;
|
||||
}
|
||||
|
||||
if (is->swr_ctx) {
|
||||
const uint8_t **in = (const uint8_t **)is->frame->extended_data;
|
||||
uint8_t **out = &is->audio_buf1;
|
||||
int out_count = (int64_t)wanted_nb_samples * is->audio_tgt.freq / is->frame->sample_rate + 256;
|
||||
int out_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, out_count, is->audio_tgt.fmt, 0);
|
||||
uint8_t *out[] = {is->audio_buf2};
|
||||
int out_count = sizeof(is->audio_buf2) / is->audio_tgt.channels / av_get_bytes_per_sample(is->audio_tgt.fmt);
|
||||
if (wanted_nb_samples != is->frame->nb_samples) {
|
||||
if (swr_set_compensation(is->swr_ctx, (wanted_nb_samples - is->frame->nb_samples) * is->audio_tgt.freq / is->frame->sample_rate,
|
||||
wanted_nb_samples * is->audio_tgt.freq / is->frame->sample_rate) < 0) {
|
||||
@@ -2173,9 +2153,6 @@ static int audio_decode_frame(VideoState *is)
|
||||
break;
|
||||
}
|
||||
}
|
||||
av_fast_malloc(&is->audio_buf1, &is->audio_buf1_size, out_size);
|
||||
if (!is->audio_buf1)
|
||||
return AVERROR(ENOMEM);
|
||||
len2 = swr_convert(is->swr_ctx, out, out_count, in, is->frame->nb_samples);
|
||||
if (len2 < 0) {
|
||||
fprintf(stderr, "swr_convert() failed\n");
|
||||
@@ -2185,22 +2162,24 @@ static int audio_decode_frame(VideoState *is)
|
||||
fprintf(stderr, "warning: audio buffer is probably too small\n");
|
||||
swr_init(is->swr_ctx);
|
||||
}
|
||||
is->audio_buf = is->audio_buf1;
|
||||
is->audio_buf = is->audio_buf2;
|
||||
resampled_data_size = len2 * is->audio_tgt.channels * av_get_bytes_per_sample(is->audio_tgt.fmt);
|
||||
} else {
|
||||
is->audio_buf = is->frame->data[0];
|
||||
resampled_data_size = data_size;
|
||||
}
|
||||
|
||||
audio_clock0 = is->audio_clock;
|
||||
/* if no pts, then compute it */
|
||||
pts = is->audio_clock;
|
||||
*pts_ptr = pts;
|
||||
is->audio_clock += (double)data_size /
|
||||
(av_frame_get_channels(is->frame) * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
|
||||
(is->frame->channels * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
|
||||
#ifdef DEBUG
|
||||
{
|
||||
static double last_clock;
|
||||
printf("audio: delay=%0.3f clock=%0.3f clock0=%0.3f\n",
|
||||
printf("audio: delay=%0.3f clock=%0.3f pts=%0.3f\n",
|
||||
is->audio_clock - last_clock,
|
||||
is->audio_clock, audio_clock0);
|
||||
is->audio_clock, pts);
|
||||
last_clock = is->audio_clock;
|
||||
}
|
||||
#endif
|
||||
@@ -2212,7 +2191,7 @@ static int audio_decode_frame(VideoState *is)
|
||||
av_free_packet(pkt);
|
||||
memset(pkt_temp, 0, sizeof(*pkt_temp));
|
||||
|
||||
if (is->audioq.abort_request) {
|
||||
if (is->paused || is->audioq.abort_request) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2233,7 +2212,6 @@ static int audio_decode_frame(VideoState *is)
|
||||
/* if update the audio clock with the pts */
|
||||
if (pkt->pts != AV_NOPTS_VALUE) {
|
||||
is->audio_clock = av_q2d(is->audio_st->time_base)*pkt->pts;
|
||||
is->audio_clock_serial = is->audio_pkt_temp_serial;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2245,12 +2223,13 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
|
||||
int audio_size, len1;
|
||||
int bytes_per_sec;
|
||||
int frame_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, 1, is->audio_tgt.fmt, 1);
|
||||
double pts;
|
||||
|
||||
audio_callback_time = av_gettime();
|
||||
|
||||
while (len > 0) {
|
||||
if (is->audio_buf_index >= is->audio_buf_size) {
|
||||
audio_size = audio_decode_frame(is);
|
||||
audio_size = audio_decode_frame(is, &pts);
|
||||
if (audio_size < 0) {
|
||||
/* if error, just output silence */
|
||||
is->audio_buf = is->silence_buf;
|
||||
@@ -2275,7 +2254,7 @@ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
|
||||
/* Let's assume the audio driver that is used by SDL has two periods. */
|
||||
is->audio_current_pts = is->audio_clock - (double)(2 * is->audio_hw_buf_size + is->audio_write_buf_size) / bytes_per_sec;
|
||||
is->audio_current_pts_drift = is->audio_current_pts - audio_callback_time / 1000000.0;
|
||||
if (is->audioq.serial == is->audio_clock_serial)
|
||||
if (is->audioq.serial == is->audio_pkt_temp_serial)
|
||||
check_external_clock_sync(is, is->audio_current_pts);
|
||||
}
|
||||
|
||||
@@ -2459,7 +2438,6 @@ static void stream_component_close(VideoState *is, int stream_index)
|
||||
av_free_packet(&is->audio_pkt);
|
||||
swr_free(&is->swr_ctx);
|
||||
av_freep(&is->audio_buf1);
|
||||
is->audio_buf1_size = 0;
|
||||
is->audio_buf = NULL;
|
||||
avcodec_free_frame(&is->frame);
|
||||
|
||||
@@ -2636,7 +2614,7 @@ static int read_thread(void *arg)
|
||||
wanted_stream[AVMEDIA_TYPE_AUDIO],
|
||||
st_index[AVMEDIA_TYPE_VIDEO],
|
||||
NULL, 0);
|
||||
if (!video_disable && !subtitle_disable)
|
||||
if (!video_disable)
|
||||
st_index[AVMEDIA_TYPE_SUBTITLE] =
|
||||
av_find_best_stream(ic, AVMEDIA_TYPE_SUBTITLE,
|
||||
wanted_stream[AVMEDIA_TYPE_SUBTITLE],
|
||||
@@ -2659,6 +2637,7 @@ static int read_thread(void *arg)
|
||||
if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) {
|
||||
ret = stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]);
|
||||
}
|
||||
is->refresh_tid = SDL_CreateThread(refresh_thread, is);
|
||||
if (is->show_mode == SHOW_MODE_NONE)
|
||||
is->show_mode = ret >= 0 ? SHOW_MODE_VIDEO : SHOW_MODE_RDFT;
|
||||
|
||||
@@ -2719,15 +2698,14 @@ static int read_thread(void *arg)
|
||||
packet_queue_put(&is->videoq, &flush_pkt);
|
||||
}
|
||||
if (is->seek_flags & AVSEEK_FLAG_BYTE) {
|
||||
update_external_clock_pts(is, NAN);
|
||||
//FIXME: use a cleaner way to signal obsolete external clock...
|
||||
update_external_clock_pts(is, (double)AV_NOPTS_VALUE);
|
||||
} else {
|
||||
update_external_clock_pts(is, seek_target / (double)AV_TIME_BASE);
|
||||
}
|
||||
}
|
||||
is->seek_req = 0;
|
||||
eof = 0;
|
||||
if (is->paused)
|
||||
step_to_next_frame(is);
|
||||
}
|
||||
if (is->queue_attachments_req) {
|
||||
avformat_queue_attached_pictures(ic);
|
||||
@@ -2855,12 +2833,11 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
|
||||
|
||||
is->continue_read_thread = SDL_CreateCond();
|
||||
|
||||
update_external_clock_pts(is, NAN);
|
||||
//FIXME: use a cleaner way to signal obsolete external clock...
|
||||
update_external_clock_pts(is, (double)AV_NOPTS_VALUE);
|
||||
update_external_clock_speed(is, 1.0);
|
||||
is->audio_current_pts_drift = -av_gettime() / 1000000.0;
|
||||
is->video_current_pts_drift = is->audio_current_pts_drift;
|
||||
is->audio_clock_serial = -1;
|
||||
is->video_clock_serial = -1;
|
||||
is->av_sync_type = av_sync_type;
|
||||
is->read_tid = SDL_CreateThread(read_thread, is);
|
||||
if (!is->read_tid) {
|
||||
@@ -2937,40 +2914,30 @@ static void toggle_full_screen(VideoState *is)
|
||||
is->pictq[i].reallocate = 1;
|
||||
#endif
|
||||
is_full_screen = !is_full_screen;
|
||||
video_open(is, 1, NULL);
|
||||
video_open(is, 1);
|
||||
}
|
||||
|
||||
static void toggle_pause(VideoState *is)
|
||||
{
|
||||
stream_toggle_pause(is);
|
||||
is->step = 0;
|
||||
}
|
||||
|
||||
static void step_to_next_frame(VideoState *is)
|
||||
{
|
||||
/* if the stream is paused unpause it, then step */
|
||||
if (is->paused)
|
||||
stream_toggle_pause(is);
|
||||
is->step = 1;
|
||||
}
|
||||
|
||||
static void toggle_audio_display(VideoState *is)
|
||||
{
|
||||
int bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
|
||||
int next = is->show_mode;
|
||||
do {
|
||||
next = (next + 1) % SHOW_MODE_NB;
|
||||
} while (next != is->show_mode && (next == SHOW_MODE_VIDEO && !is->video_st || next != SHOW_MODE_VIDEO && !is->audio_st));
|
||||
if (is->show_mode != next) {
|
||||
fill_rectangle(screen,
|
||||
is->xleft, is->ytop, is->width, is->height,
|
||||
bgcolor, 1);
|
||||
is->force_refresh = 1;
|
||||
is->show_mode = next;
|
||||
}
|
||||
}
|
||||
|
||||
static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) {
|
||||
double remaining_time = 0.0;
|
||||
SDL_PumpEvents();
|
||||
while (!SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)) {
|
||||
if (!cursor_hidden && av_gettime() - cursor_last_shown > CURSOR_HIDE_DELAY) {
|
||||
SDL_ShowCursor(0);
|
||||
cursor_hidden = 1;
|
||||
}
|
||||
if (remaining_time > 0.0)
|
||||
av_usleep((int64_t)(remaining_time * 1000000.0));
|
||||
remaining_time = REFRESH_RATE;
|
||||
if (is->show_mode != SHOW_MODE_NONE && (!is->paused || is->force_refresh))
|
||||
video_refresh(is, &remaining_time);
|
||||
SDL_PumpEvents();
|
||||
}
|
||||
is->show_mode = (is->show_mode + 1) % SHOW_MODE_NB;
|
||||
fill_rectangle(screen,
|
||||
is->xleft, is->ytop, is->width, is->height,
|
||||
bgcolor, 1);
|
||||
}
|
||||
|
||||
/* handle an event sent by the GUI */
|
||||
@@ -2981,7 +2948,7 @@ static void event_loop(VideoState *cur_stream)
|
||||
|
||||
for (;;) {
|
||||
double x;
|
||||
refresh_loop_wait_event(cur_stream, &event);
|
||||
SDL_WaitEvent(&event);
|
||||
switch (event.type) {
|
||||
case SDL_KEYDOWN:
|
||||
if (exit_on_keydown) {
|
||||
@@ -3015,6 +2982,7 @@ static void event_loop(VideoState *cur_stream)
|
||||
break;
|
||||
case SDLK_w:
|
||||
toggle_audio_display(cur_stream);
|
||||
cur_stream->force_refresh = 1;
|
||||
break;
|
||||
case SDLK_PAGEUP:
|
||||
incr = 600.0;
|
||||
@@ -3049,8 +3017,6 @@ static void event_loop(VideoState *cur_stream)
|
||||
stream_seek(cur_stream, pos, incr, 1);
|
||||
} else {
|
||||
pos = get_master_clock(cur_stream);
|
||||
if (isnan(pos))
|
||||
pos = (double)cur_stream->seek_pos / AV_TIME_BASE;
|
||||
pos += incr;
|
||||
if (cur_stream->ic->start_time != AV_NOPTS_VALUE && pos < cur_stream->ic->start_time / (double)AV_TIME_BASE)
|
||||
pos = cur_stream->ic->start_time / (double)AV_TIME_BASE;
|
||||
@@ -3120,6 +3086,14 @@ static void event_loop(VideoState *cur_stream)
|
||||
case FF_ALLOC_EVENT:
|
||||
alloc_picture(event.user.data1);
|
||||
break;
|
||||
case FF_REFRESH_EVENT:
|
||||
if (!cursor_hidden && av_gettime() - cursor_last_shown > CURSOR_HIDE_DELAY) {
|
||||
SDL_ShowCursor(0);
|
||||
cursor_hidden = 1;
|
||||
}
|
||||
video_refresh(event.user.data1);
|
||||
cur_stream->refresh = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -3238,7 +3212,6 @@ static const OptionDef options[] = {
|
||||
{ "fs", OPT_BOOL, { &is_full_screen }, "force full screen" },
|
||||
{ "an", OPT_BOOL, { &audio_disable }, "disable audio" },
|
||||
{ "vn", OPT_BOOL, { &video_disable }, "disable video" },
|
||||
{ "sn", OPT_BOOL, { &subtitle_disable }, "disable subtitling" },
|
||||
{ "ast", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_AUDIO] }, "select desired audio stream", "stream_number" },
|
||||
{ "vst", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_VIDEO] }, "select desired video stream", "stream_number" },
|
||||
{ "sst", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_SUBTITLE] }, "select desired subtitle stream", "stream_number" },
|
||||
@@ -3268,7 +3241,7 @@ static const OptionDef options[] = {
|
||||
{ "infbuf", OPT_BOOL | OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" },
|
||||
{ "window_title", OPT_STRING | HAS_ARG, { &window_title }, "set window title", "window title" },
|
||||
#if CONFIG_AVFILTER
|
||||
{ "vf", OPT_STRING | HAS_ARG, { &vfilters }, "set video filters", "filter_graph" },
|
||||
{ "vf", OPT_STRING | HAS_ARG, { &vfilters }, "video filters", "filter list" },
|
||||
#endif
|
||||
{ "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, { &rdftspeed }, "rdft speed", "msecs" },
|
||||
{ "showmode", HAS_ARG, { .func_arg = opt_show_mode}, "select show mode (0 = video, 1 = waves, 2 = RDFT)", "mode" },
|
||||
|
@@ -1472,11 +1472,11 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
print_time("pkt_pts_time", frame->pkt_pts, &stream->time_base);
|
||||
print_ts ("pkt_dts", frame->pkt_dts);
|
||||
print_time("pkt_dts_time", frame->pkt_dts, &stream->time_base);
|
||||
print_duration_ts ("pkt_duration", av_frame_get_pkt_duration(frame));
|
||||
print_duration_time("pkt_duration_time", av_frame_get_pkt_duration(frame), &stream->time_base);
|
||||
if (av_frame_get_pkt_pos (frame) != -1) print_fmt ("pkt_pos", "%"PRId64, av_frame_get_pkt_pos(frame));
|
||||
print_duration_ts ("pkt_duration", frame->pkt_duration);
|
||||
print_duration_time("pkt_duration_time", frame->pkt_duration, &stream->time_base);
|
||||
if (frame->pkt_pos != -1) print_fmt ("pkt_pos", "%"PRId64, frame->pkt_pos);
|
||||
else print_str_opt("pkt_pos", "N/A");
|
||||
if (av_frame_get_pkt_size(frame) != -1) print_fmt ("pkt_size", "%d", av_frame_get_pkt_size(frame));
|
||||
if (frame->pkt_size != -1) print_fmt ("pkt_size", "%d", av_frame_get_pkt_size(frame));
|
||||
else print_str_opt("pkt_size", "N/A");
|
||||
|
||||
switch (stream->codec->codec_type) {
|
||||
|
20
ffserver.c
20
ffserver.c
@@ -1125,7 +1125,7 @@ static int extract_rates(char *rates, int ratelen, const char *request)
|
||||
if (av_strncasecmp(p, "Pragma:", 7) == 0) {
|
||||
const char *q = p + 7;
|
||||
|
||||
while (*q && *q != '\n' && av_isspace(*q))
|
||||
while (*q && *q != '\n' && isspace(*q))
|
||||
q++;
|
||||
|
||||
if (av_strncasecmp(q, "stream-switch-entry=", 20) == 0) {
|
||||
@@ -1147,7 +1147,7 @@ static int extract_rates(char *rates, int ratelen, const char *request)
|
||||
if (stream_no < ratelen && stream_no >= 0)
|
||||
rates[stream_no] = rate_no;
|
||||
|
||||
while (*q && *q != '\n' && !av_isspace(*q))
|
||||
while (*q && *q != '\n' && !isspace(*q))
|
||||
q++;
|
||||
}
|
||||
|
||||
@@ -1258,7 +1258,7 @@ static void get_word(char *buf, int buf_size, const char **pp)
|
||||
p = *pp;
|
||||
skip_spaces(&p);
|
||||
q = buf;
|
||||
while (!av_isspace(*p) && *p != '\0') {
|
||||
while (!isspace(*p) && *p != '\0') {
|
||||
if ((q - buf) < buf_size - 1)
|
||||
*q++ = *p;
|
||||
p++;
|
||||
@@ -1275,7 +1275,7 @@ static void get_arg(char *buf, int buf_size, const char **pp)
|
||||
int quote;
|
||||
|
||||
p = *pp;
|
||||
while (av_isspace(*p)) p++;
|
||||
while (isspace(*p)) p++;
|
||||
q = buf;
|
||||
quote = 0;
|
||||
if (*p == '\"' || *p == '\'')
|
||||
@@ -1285,7 +1285,7 @@ static void get_arg(char *buf, int buf_size, const char **pp)
|
||||
if (*p == quote)
|
||||
break;
|
||||
} else {
|
||||
if (av_isspace(*p))
|
||||
if (isspace(*p))
|
||||
break;
|
||||
}
|
||||
if (*p == '\0')
|
||||
@@ -1389,7 +1389,7 @@ static IPAddressACL* parse_dynamic_acl(FFStream *stream, HTTPContext *c)
|
||||
break;
|
||||
line_num++;
|
||||
p = line;
|
||||
while (av_isspace(*p))
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
if (*p == '\0' || *p == '#')
|
||||
continue;
|
||||
@@ -1540,7 +1540,7 @@ static int http_parse_request(HTTPContext *c)
|
||||
for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
|
||||
if (av_strncasecmp(p, "User-Agent:", 11) == 0) {
|
||||
useragent = p + 11;
|
||||
if (*useragent && *useragent != '\n' && av_isspace(*useragent))
|
||||
if (*useragent && *useragent != '\n' && isspace(*useragent))
|
||||
useragent++;
|
||||
break;
|
||||
}
|
||||
@@ -1668,7 +1668,7 @@ static int http_parse_request(HTTPContext *c)
|
||||
char *eoh;
|
||||
char hostbuf[260];
|
||||
|
||||
while (av_isspace(*hostinfo))
|
||||
while (isspace(*hostinfo))
|
||||
hostinfo++;
|
||||
|
||||
eoh = strchr(hostinfo, '\n');
|
||||
@@ -4100,7 +4100,7 @@ static int parse_ffconfig(const char *filename)
|
||||
break;
|
||||
line_num++;
|
||||
p = line;
|
||||
while (av_isspace(*p))
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
if (*p == '\0' || *p == '#')
|
||||
continue;
|
||||
@@ -4237,7 +4237,7 @@ static int parse_ffconfig(const char *filename)
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
p1 = arg;
|
||||
fsize = strtod(p1, &p1);
|
||||
switch(av_toupper(*p1)) {
|
||||
switch(toupper(*p1)) {
|
||||
case 'K':
|
||||
fsize *= 1024;
|
||||
break;
|
||||
|
129
libavcodec/4xm.c
129
libavcodec/4xm.c
@@ -130,7 +130,7 @@ typedef struct CFrameBuffer {
|
||||
typedef struct FourXContext {
|
||||
AVCodecContext *avctx;
|
||||
DSPContext dsp;
|
||||
AVFrame *current_picture, *last_picture;
|
||||
AVFrame current_picture, last_picture;
|
||||
GetBitContext pre_gb; ///< ac/dc prefix
|
||||
GetBitContext gb;
|
||||
GetByteContext g;
|
||||
@@ -138,7 +138,7 @@ typedef struct FourXContext {
|
||||
int mv[256];
|
||||
VLC pre_vlc;
|
||||
int last_dc;
|
||||
DECLARE_ALIGNED(16, int16_t, block)[6][64];
|
||||
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
|
||||
void *bitstream_buffer;
|
||||
unsigned int bitstream_buffer_size;
|
||||
int version;
|
||||
@@ -153,7 +153,7 @@ typedef struct FourXContext {
|
||||
|
||||
#define MULTIPLY(var, const) (((var) * (const)) >> 16)
|
||||
|
||||
static void idct(int16_t block[64])
|
||||
static void idct(DCTELEM block[64])
|
||||
{
|
||||
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
||||
int tmp10, tmp11, tmp12, tmp13;
|
||||
@@ -261,9 +261,9 @@ static void init_mv(FourXContext *f)
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
if (f->version > 1)
|
||||
f->mv[i] = mv[i][0] + mv[i][1] * f->current_picture->linesize[0] / 2;
|
||||
f->mv[i] = mv[i][0] + mv[i][1] * f->current_picture.linesize[0] / 2;
|
||||
else
|
||||
f->mv[i] = (i & 15) - 8 + ((i >> 4) - 8) * f->current_picture->linesize[0] / 2;
|
||||
f->mv[i] = (i & 15) - 8 + ((i >> 4) - 8) * f->current_picture.linesize[0] / 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
|
||||
int code = get_vlc2(&f->gb,
|
||||
block_type_vlc[1 - (f->version > 1)][index].table,
|
||||
BLOCK_TYPE_VLC_BITS, 1);
|
||||
uint16_t *start = (uint16_t *)f->last_picture->data[0];
|
||||
uint16_t *start = (uint16_t *)f->last_picture.data[0];
|
||||
uint16_t *end = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
|
||||
|
||||
av_assert2(code >= 0 && code <= 6);
|
||||
@@ -409,9 +409,9 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
int x, y;
|
||||
const int width = f->avctx->width;
|
||||
const int height = f->avctx->height;
|
||||
uint16_t *src = (uint16_t *)f->last_picture->data[0];
|
||||
uint16_t *dst = (uint16_t *)f->current_picture->data[0];
|
||||
const int stride = f->current_picture->linesize[0] >> 1;
|
||||
uint16_t *src = (uint16_t *)f->last_picture.data[0];
|
||||
uint16_t *dst = (uint16_t *)f->current_picture.data[0];
|
||||
const int stride = f->current_picture.linesize[0] >> 1;
|
||||
unsigned int bitstream_size, bytestream_size, wordstream_size, extra,
|
||||
bytestream_offset, wordstream_offset;
|
||||
|
||||
@@ -435,7 +435,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
extra > length - bytestream_size - bitstream_size - wordstream_size) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
|
||||
bitstream_size+ bytestream_size+ wordstream_size - length);
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
}
|
||||
|
||||
av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size,
|
||||
@@ -471,7 +471,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
* decode block and dequantize.
|
||||
* Note this is almost identical to MJPEG.
|
||||
*/
|
||||
static int decode_i_block(FourXContext *f, int16_t *block)
|
||||
static int decode_i_block(FourXContext *f, DCTELEM *block)
|
||||
{
|
||||
int code, i, j, level, val;
|
||||
|
||||
@@ -521,10 +521,10 @@ static int decode_i_block(FourXContext *f, int16_t *block)
|
||||
|
||||
static inline void idct_put(FourXContext *f, int x, int y)
|
||||
{
|
||||
int16_t (*block)[64] = f->block;
|
||||
int stride = f->current_picture->linesize[0] >> 1;
|
||||
DCTELEM (*block)[64] = f->block;
|
||||
int stride = f->current_picture.linesize[0] >> 1;
|
||||
int i;
|
||||
uint16_t *dst = ((uint16_t*)f->current_picture->data[0]) + y * stride + x;
|
||||
uint16_t *dst = ((uint16_t*)f->current_picture.data[0]) + y * stride + x;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
block[i][0] += 0x80 * 8 * 8;
|
||||
@@ -542,7 +542,7 @@ static inline void idct_put(FourXContext *f, int x, int y)
|
||||
* cr = (-1b - 4g + 5r) / 14 */
|
||||
for (y = 0; y < 8; y++) {
|
||||
for (x = 0; x < 8; x++) {
|
||||
int16_t *temp = block[(x >> 2) + 2 * (y >> 2)] +
|
||||
DCTELEM *temp = block[(x >> 2) + 2 * (y >> 2)] +
|
||||
2 * (x & 3) + 2 * 8 * (y & 3); // FIXME optimize
|
||||
int cb = block[4][x + 8 * y];
|
||||
int cr = block[5][x + 8 * y];
|
||||
@@ -567,14 +567,13 @@ static inline void idct_put(FourXContext *f, int x, int y)
|
||||
|
||||
static int decode_i_mb(FourXContext *f)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
f->dsp.clear_blocks(f->block[0]);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
if ((ret = decode_i_block(f, f->block[i])) < 0)
|
||||
return ret;
|
||||
if (decode_i_block(f, f->block[i]) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -599,10 +598,8 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
|
||||
for (;;) {
|
||||
int i;
|
||||
|
||||
if (ptr_end - ptr < FFMAX(end - start + 1, 0) + 1) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "invalid data in read_huffman_tables\n");
|
||||
if (start <= end && ptr_end - ptr < end - start + 1 + 1)
|
||||
return NULL;
|
||||
}
|
||||
for (i = start; i <= end; i++)
|
||||
frequency[i] = *ptr++;
|
||||
start = *ptr++;
|
||||
@@ -616,11 +613,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
|
||||
while ((ptr - buf) & 3)
|
||||
ptr++; // 4byte align
|
||||
|
||||
if (ptr > ptr_end) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "ptr overflow in read_huffman_tables\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (j = 257; j < 512; j++) {
|
||||
int min_freq[2] = { 256 * 256, 256 * 256 };
|
||||
int smallest[2] = { 0, 0 };
|
||||
@@ -688,8 +680,8 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
const int width = f->avctx->width;
|
||||
const int height = f->avctx->height;
|
||||
const int mbs = (FFALIGN(width, 16) >> 4) * (FFALIGN(height, 16) >> 4);
|
||||
uint16_t *dst = (uint16_t*)f->current_picture->data[0];
|
||||
const int stride = f->current_picture->linesize[0]>>1;
|
||||
uint16_t *dst = (uint16_t*)f->current_picture.data[0];
|
||||
const int stride = f->current_picture.linesize[0]>>1;
|
||||
const uint8_t *buf_end = buf + length;
|
||||
GetByteContext g3;
|
||||
|
||||
@@ -733,7 +725,7 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
|
||||
static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
{
|
||||
int x, y, ret;
|
||||
int x, y;
|
||||
const int width = f->avctx->width;
|
||||
const int height = f->avctx->height;
|
||||
const unsigned int bitstream_size = AV_RL32(buf);
|
||||
@@ -753,7 +745,7 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
|| prestream_size > (1 << 26)) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n",
|
||||
prestream_size, bitstream_size, length);
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
}
|
||||
|
||||
prestream = read_huffman_tables(f, prestream, buf + length - prestream);
|
||||
@@ -762,8 +754,6 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
av_assert0(prestream <= buf + length);
|
||||
|
||||
init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);
|
||||
|
||||
prestream_size = length + buf - prestream;
|
||||
@@ -782,8 +772,8 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
|
||||
for (y = 0; y < height; y += 16) {
|
||||
for (x = 0; x < width; x += 16) {
|
||||
if ((ret = decode_i_mb(f)) < 0)
|
||||
return ret;
|
||||
if (decode_i_mb(f) < 0)
|
||||
return -1;
|
||||
|
||||
idct_put(f, x, y);
|
||||
}
|
||||
@@ -802,8 +792,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
int buf_size = avpkt->size;
|
||||
FourXContext *const f = avctx->priv_data;
|
||||
AVFrame *picture = data;
|
||||
AVFrame *p;
|
||||
int i, frame_4cc, frame_size, ret;
|
||||
AVFrame *p, temp;
|
||||
int i, frame_4cc, frame_size;
|
||||
|
||||
if (buf_size < 12)
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -855,7 +845,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
// explicit check needed as memcpy below might not catch a NULL
|
||||
if (!cfrm->data) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "realloc failure\n");
|
||||
return AVERROR(ENOMEM);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(cfrm->data + cfrm->size, buf + 20, data_size);
|
||||
@@ -878,47 +868,49 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
frame_size = buf_size - 12;
|
||||
}
|
||||
|
||||
FFSWAP(AVFrame*, f->current_picture, f->last_picture);
|
||||
temp = f->current_picture;
|
||||
f->current_picture = f->last_picture;
|
||||
f->last_picture = temp;
|
||||
|
||||
p = f->current_picture;
|
||||
p = &f->current_picture;
|
||||
avctx->coded_frame = p;
|
||||
|
||||
// alternatively we would have to use our own buffer management
|
||||
avctx->flags |= CODEC_FLAG_EMU_EDGE;
|
||||
|
||||
p->reference= 3;
|
||||
if ((ret = avctx->reget_buffer(avctx, p)) < 0) {
|
||||
if (avctx->reget_buffer(avctx, p) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (frame_4cc == AV_RL32("ifr2")) {
|
||||
p->pict_type= AV_PICTURE_TYPE_I;
|
||||
if ((ret = decode_i2_frame(f, buf - 4, frame_size + 4)) < 0) {
|
||||
if (decode_i2_frame(f, buf - 4, frame_size + 4) < 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "decode i2 frame failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
} else if (frame_4cc == AV_RL32("ifrm")) {
|
||||
p->pict_type= AV_PICTURE_TYPE_I;
|
||||
if ((ret = decode_i_frame(f, buf, frame_size)) < 0) {
|
||||
if (decode_i_frame(f, buf, frame_size) < 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "decode i frame failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
} else if (frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")) {
|
||||
if (!f->last_picture->data[0]) {
|
||||
f->last_picture->reference = 3;
|
||||
if ((ret = ff_get_buffer(avctx, f->last_picture)) < 0) {
|
||||
if (!f->last_picture.data[0]) {
|
||||
f->last_picture.reference = 3;
|
||||
if (ff_get_buffer(avctx, &f->last_picture) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
for (i=0; i<avctx->height; i++)
|
||||
memset(f->last_picture->data[0] + i*f->last_picture->linesize[0], 0, 2*avctx->width);
|
||||
memset(f->last_picture.data[0] + i*f->last_picture.linesize[0], 0, 2*avctx->width);
|
||||
}
|
||||
|
||||
p->pict_type = AV_PICTURE_TYPE_P;
|
||||
if ((ret = decode_p_frame(f, buf, frame_size)) < 0) {
|
||||
if (decode_p_frame(f, buf, frame_size) < 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "decode p frame failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
} else if (frame_4cc == AV_RL32("snd_")) {
|
||||
av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n",
|
||||
@@ -938,6 +930,16 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
|
||||
static av_cold void common_init(AVCodecContext *avctx)
|
||||
{
|
||||
FourXContext * const f = avctx->priv_data;
|
||||
|
||||
ff_dsputil_init(&f->dsp, avctx);
|
||||
|
||||
f->avctx = avctx;
|
||||
}
|
||||
|
||||
static av_cold int decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
FourXContext * const f = avctx->priv_data;
|
||||
@@ -951,9 +953,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
avcodec_get_frame_defaults(&f->current_picture);
|
||||
avcodec_get_frame_defaults(&f->last_picture);
|
||||
f->version = AV_RL32(avctx->extradata) >> 16;
|
||||
ff_dsputil_init(&f->dsp, avctx);
|
||||
f->avctx = avctx;
|
||||
common_init(avctx);
|
||||
init_vlcs(f);
|
||||
|
||||
if (f->version > 2)
|
||||
@@ -961,14 +964,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
else
|
||||
avctx->pix_fmt = AV_PIX_FMT_BGR555;
|
||||
|
||||
f->current_picture = avcodec_alloc_frame();
|
||||
f->last_picture = avcodec_alloc_frame();
|
||||
if (!f->current_picture || !f->last_picture) {
|
||||
avcodec_free_frame(&f->current_picture);
|
||||
avcodec_free_frame(&f->last_picture);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -985,12 +980,10 @@ static av_cold int decode_end(AVCodecContext *avctx)
|
||||
f->cfrm[i].allocated_size = 0;
|
||||
}
|
||||
ff_free_vlc(&f->pre_vlc);
|
||||
if (f->current_picture->data[0])
|
||||
avctx->release_buffer(avctx, f->current_picture);
|
||||
if (f->last_picture->data[0])
|
||||
avctx->release_buffer(avctx, f->last_picture);
|
||||
avcodec_free_frame(&f->current_picture);
|
||||
avcodec_free_frame(&f->last_picture);
|
||||
if (f->current_picture.data[0])
|
||||
avctx->release_buffer(avctx, &f->current_picture);
|
||||
if (f->last_picture.data[0])
|
||||
avctx->release_buffer(avctx, &f->last_picture);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -68,16 +68,15 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
unsigned char count;
|
||||
unsigned int planes = c->planes;
|
||||
unsigned char *planemap = c->planemap;
|
||||
int ret;
|
||||
|
||||
if (c->pic.data[0])
|
||||
avctx->release_buffer(avctx, &c->pic);
|
||||
|
||||
c->pic.reference = 0;
|
||||
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
|
||||
if ((ret = ff_get_buffer(avctx, &c->pic)) < 0) {
|
||||
if (ff_get_buffer(avctx, &c->pic) < 0){
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Set data pointer after line lengths */
|
||||
@@ -97,14 +96,14 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
/* Decode a row of this plane */
|
||||
while (dlen > 0) {
|
||||
if (dp + 1 >= buf + buf_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
if ((count = *dp++) <= 127) {
|
||||
count++;
|
||||
dlen -= count + 1;
|
||||
if (pixptr + count * planes > pixptr_end)
|
||||
break;
|
||||
if (dp + count > buf + buf_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
while (count--) {
|
||||
*pixptr = *dp++;
|
||||
pixptr += planes;
|
||||
@@ -182,7 +181,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
default:
|
||||
av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n",
|
||||
avctx->bits_per_coded_sample);
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -44,6 +44,7 @@
|
||||
|
||||
/** decoder context */
|
||||
typedef struct EightSvxContext {
|
||||
AVFrame frame;
|
||||
uint8_t fib_acc[2];
|
||||
const int8_t *table;
|
||||
|
||||
@@ -87,7 +88,6 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
EightSvxContext *esc = avctx->priv_data;
|
||||
AVFrame *frame = data;
|
||||
int buf_size;
|
||||
int ch, ret;
|
||||
int hdr_size = 2;
|
||||
@@ -135,20 +135,21 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = buf_size * 2;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
esc->frame.nb_samples = buf_size * 2;
|
||||
if ((ret = ff_get_buffer(avctx, &esc->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (ch = 0; ch < avctx->channels; ch++) {
|
||||
delta_decode(frame->data[ch], &esc->data[ch][esc->data_idx],
|
||||
delta_decode(esc->frame.data[ch], &esc->data[ch][esc->data_idx],
|
||||
buf_size, &esc->fib_acc[ch], esc->table);
|
||||
}
|
||||
|
||||
esc->data_idx += buf_size;
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = esc->frame;
|
||||
|
||||
return ((avctx->frame_number == 0)*hdr_size + buf_size)*avctx->channels;
|
||||
}
|
||||
@@ -171,6 +172,9 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
|
||||
}
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
|
||||
|
||||
avcodec_get_frame_defaults(&esc->frame);
|
||||
avctx->coded_frame = &esc->frame;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,7 @@ OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
|
||||
OBJS-$(CONFIG_AUDIO_FRAME_QUEUE) += audio_frame_queue.o
|
||||
OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o
|
||||
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
|
||||
OBJS-$(CONFIG_DWT) += dwt.o snow.o
|
||||
OBJS-$(CONFIG_DXVA2) += dxva2.o
|
||||
OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
|
||||
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
|
||||
@@ -48,10 +49,8 @@ FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
|
||||
$(FFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_GOLOMB) += golomb.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += h264chroma.o
|
||||
OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o
|
||||
OBJS-$(CONFIG_H264PRED) += h264pred.o
|
||||
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
|
||||
OBJS-$(CONFIG_HUFFMAN) += huffman.o
|
||||
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
|
||||
OBJS-$(CONFIG_LPC) += lpc.o
|
||||
@@ -159,7 +158,7 @@ OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \
|
||||
dca_parser.o synth_filter.o
|
||||
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dca.o
|
||||
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o \
|
||||
dirac_arith.o mpeg12data.o dirac_dwt.o
|
||||
dirac_arith.o mpeg12data.o dwt.o
|
||||
OBJS-$(CONFIG_DFA_DECODER) += dfa.o
|
||||
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
|
||||
OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o
|
||||
@@ -189,7 +188,6 @@ OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER) += 8svx.o
|
||||
OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o
|
||||
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
|
||||
OBJS-$(CONFIG_FFV1_DECODER) += ffv1dec.o ffv1.o
|
||||
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1enc.o ffv1.o
|
||||
@@ -220,7 +218,6 @@ OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
|
||||
mpeg4video.o mpeg4videodec.o flvdec.o\
|
||||
intelh263dec.o
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_H263_VDPAU_HWACCEL) += vdpau_mpeg4.o
|
||||
OBJS-$(CONFIG_H263_ENCODER) += mpeg4videoenc.o mpeg4video.o \
|
||||
h263.o ituh263enc.o flvenc.o
|
||||
OBJS-$(CONFIG_H264_DECODER) += h264.o \
|
||||
@@ -231,7 +228,6 @@ OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
|
||||
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
|
||||
OBJS-$(CONFIG_H264_VDA_HWACCEL) += vda_h264.o
|
||||
OBJS-$(CONFIG_H264_VDA_DECODER) += vda_h264_dec.o
|
||||
OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
|
||||
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o huffyuvdec.o
|
||||
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o huffyuvenc.o
|
||||
OBJS-$(CONFIG_IAC_DECODER) += imc.o
|
||||
@@ -288,18 +284,15 @@ OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG_XVMC_DECODER) += mpegvideo_xvmc.o
|
||||
OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o \
|
||||
timecode.o
|
||||
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o \
|
||||
timecode.o
|
||||
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL) += vdpau_mpeg4.o
|
||||
OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4.o msmpeg4data.o h263dec.o \
|
||||
@@ -396,8 +389,8 @@ OBJS-$(CONFIG_SIPR_DECODER) += sipr.o acelp_pitch_delay.o \
|
||||
OBJS-$(CONFIG_SMACKAUD_DECODER) += smacker.o
|
||||
OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o
|
||||
OBJS-$(CONFIG_SMC_DECODER) += smc.o
|
||||
OBJS-$(CONFIG_SNOW_DECODER) += snowdec.o snow.o snow_dwt.o
|
||||
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o snow_dwt.o \
|
||||
OBJS-$(CONFIG_SNOW_DECODER) += snowdec.o snow.o
|
||||
OBJS-$(CONFIG_SNOW_ENCODER) += snowenc.o snow.o \
|
||||
h263.o ituh263enc.o
|
||||
OBJS-$(CONFIG_SOL_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
|
||||
@@ -458,12 +451,12 @@ OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
|
||||
intrax8.o intrax8dsp.o
|
||||
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
|
||||
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
|
||||
OBJS-$(CONFIG_VCR1_ENCODER) += vcr1.o
|
||||
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdav.o
|
||||
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdav.o
|
||||
OBJS-$(CONFIG_VMNC_DECODER) += vmnc.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbisdsp.o vorbis.o \
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbis.o \
|
||||
vorbis_data.o xiph.o
|
||||
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \
|
||||
vorbis_data.o
|
||||
@@ -487,10 +480,10 @@ OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
|
||||
celp_filters.o \
|
||||
acelp_vectors.o acelp_filters.o
|
||||
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2dsp.o \
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o \
|
||||
msmpeg4.o msmpeg4data.o \
|
||||
intrax8.o intrax8dsp.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2dsp.o \
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o \
|
||||
msmpeg4.o msmpeg4enc.o msmpeg4data.o \
|
||||
mpeg4videodec.o ituh263dec.o h263dec.o
|
||||
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
|
||||
@@ -699,10 +692,8 @@ OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \
|
||||
vorbis_data.o vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBVPX_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
|
||||
OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o
|
||||
OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvid.o
|
||||
|
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "fft.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "sbr.h"
|
||||
@@ -259,10 +260,10 @@ typedef struct ChannelElement {
|
||||
/**
|
||||
* main AAC context
|
||||
*/
|
||||
struct AACContext {
|
||||
typedef struct AACContext {
|
||||
AVClass *class;
|
||||
AVCodecContext *avctx;
|
||||
AVFrame *frame;
|
||||
AVFrame frame;
|
||||
|
||||
int is_saved; ///< Set if elements have stored overlap from previous frame.
|
||||
DynamicRangeControl che_drc;
|
||||
@@ -291,6 +292,7 @@ struct AACContext {
|
||||
FFTContext mdct;
|
||||
FFTContext mdct_small;
|
||||
FFTContext mdct_ltp;
|
||||
DSPContext dsp;
|
||||
FmtConvertContext fmt_conv;
|
||||
AVFloatDSPContext fdsp;
|
||||
int random_state;
|
||||
@@ -316,18 +318,6 @@ struct AACContext {
|
||||
|
||||
OutputConfiguration oc[2];
|
||||
int warned_num_aac_frames;
|
||||
|
||||
/* aacdec functions pointers */
|
||||
void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce);
|
||||
void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce);
|
||||
void (*apply_tns)(float coef[1024], TemporalNoiseShaping *tns,
|
||||
IndividualChannelStream *ics, int decode);
|
||||
void (*windowing_and_mdct_ltp)(AACContext *ac, float *out,
|
||||
float *in, IndividualChannelStream *ics);
|
||||
void (*update_ltp)(AACContext *ac, SingleChannelElement *sce);
|
||||
|
||||
};
|
||||
|
||||
void ff_aacdec_init_mips(AACContext *c);
|
||||
} AACContext;
|
||||
|
||||
#endif /* AVCODEC_AAC_H */
|
||||
|
@@ -84,6 +84,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
#include "get_bits.h"
|
||||
#include "dsputil.h"
|
||||
#include "fft.h"
|
||||
#include "fmtconvert.h"
|
||||
#include "lpc.h"
|
||||
@@ -107,8 +108,6 @@
|
||||
|
||||
#if ARCH_ARM
|
||||
# include "arm/aac.h"
|
||||
#elif ARCH_MIPS
|
||||
# include "mips/aacdec_mips.h"
|
||||
#endif
|
||||
|
||||
static VLC vlc_scalefactors;
|
||||
@@ -148,6 +147,8 @@ static av_cold int che_configure(AACContext *ac,
|
||||
enum ChannelPosition che_pos,
|
||||
int type, int id, int *channels)
|
||||
{
|
||||
if (*channels >= MAX_CHANNELS)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (che_pos) {
|
||||
if (!ac->che[type][id]) {
|
||||
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
|
||||
@@ -190,8 +191,8 @@ static int frame_configure_elements(AVCodecContext *avctx)
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
ac->frame->nb_samples = 2048;
|
||||
if ((ret = ff_get_buffer(avctx, ac->frame)) < 0) {
|
||||
ac->frame.nb_samples = 2048;
|
||||
if ((ret = ff_get_buffer(avctx, &ac->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
@@ -199,7 +200,7 @@ static int frame_configure_elements(AVCodecContext *avctx)
|
||||
/* map output channel pointers to AVFrame data */
|
||||
for (ch = 0; ch < avctx->channels; ch++) {
|
||||
if (ac->output_element[ch])
|
||||
ac->output_element[ch]->ret = (float *)ac->frame->extended_data[ch];
|
||||
ac->output_element[ch]->ret = (float *)ac->frame.extended_data[ch];
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -781,15 +782,13 @@ static int decode_audio_specific_config(AACContext *ac,
|
||||
{
|
||||
GetBitContext gb;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
av_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);
|
||||
for (i = 0; i < bit_size >> 3; i++)
|
||||
av_dlog(avctx, "%02x ", data[i]);
|
||||
av_dlog(avctx, "\n");
|
||||
|
||||
if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
|
||||
return ret;
|
||||
init_get_bits(&gb, data, bit_size);
|
||||
|
||||
if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size, sync_extension)) < 0)
|
||||
return -1;
|
||||
@@ -879,8 +878,6 @@ static void reset_predictor_group(PredictorState *ps, int group_num)
|
||||
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 int aac_decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
AACContext *ac = avctx->priv_data;
|
||||
@@ -888,8 +885,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
ac->avctx = avctx;
|
||||
ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
|
||||
|
||||
aacdec_init(ac);
|
||||
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
|
||||
|
||||
if (avctx->extradata_size > 0) {
|
||||
@@ -946,6 +941,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
|
||||
ff_aac_sbr_init();
|
||||
|
||||
ff_dsputil_init(&ac->dsp, avctx);
|
||||
ff_fmt_convert_init(&ac->fmt_conv, avctx);
|
||||
avpriv_float_dsp_init(&ac->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
|
||||
@@ -969,6 +965,9 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
|
||||
cbrt_tableinit();
|
||||
|
||||
avcodec_get_frame_defaults(&ac->frame);
|
||||
avctx->coded_frame = &ac->frame;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1408,7 +1407,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
||||
cfo[k] = ac->random_state;
|
||||
}
|
||||
|
||||
band_energy = ac->fdsp.scalarproduct_float(cfo, cfo, off_len);
|
||||
band_energy = ac->dsp.scalarproduct_float(cfo, cfo, off_len);
|
||||
scale = sf[idx] / sqrtf(band_energy);
|
||||
ac->fdsp.vector_fmul_scalar(cfo, cfo, scale, off_len);
|
||||
}
|
||||
@@ -1743,9 +1742,9 @@ static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
|
||||
if (cpe->ms_mask[idx] &&
|
||||
cpe->ch[0].band_type[idx] < NOISE_BT && cpe->ch[1].band_type[idx] < NOISE_BT) {
|
||||
for (group = 0; group < ics->group_len[g]; group++) {
|
||||
ac->fdsp.butterflies_float(ch0 + group * 128 + offsets[i],
|
||||
ch1 + group * 128 + offsets[i],
|
||||
offsets[i+1] - offsets[i]);
|
||||
ac->dsp.butterflies_float(ch0 + group * 128 + offsets[i],
|
||||
ch1 + group * 128 + offsets[i],
|
||||
offsets[i+1] - offsets[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2145,9 +2144,9 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
|
||||
ac->fdsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
|
||||
}
|
||||
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
|
||||
ac->fdsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
|
||||
ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
|
||||
} else {
|
||||
ac->fdsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
|
||||
ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
|
||||
memset(in + 1024 + 576, 0, 448 * sizeof(float));
|
||||
}
|
||||
ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);
|
||||
@@ -2173,10 +2172,10 @@ static void apply_ltp(AACContext *ac, SingleChannelElement *sce)
|
||||
predTime[i] = sce->ltp_state[i + 2048 - ltp->lag] * ltp->coef;
|
||||
memset(&predTime[i], 0, (2048 - i) * sizeof(float));
|
||||
|
||||
ac->windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
|
||||
windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
|
||||
|
||||
if (sce->tns.present)
|
||||
ac->apply_tns(predFreq, &sce->tns, &sce->ics, 0);
|
||||
apply_tns(predFreq, &sce->tns, &sce->ics, 0);
|
||||
|
||||
for (sfb = 0; sfb < FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++)
|
||||
if (ltp->used[sfb])
|
||||
@@ -2200,17 +2199,17 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce)
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
memcpy(saved_ltp, saved, 512 * sizeof(float));
|
||||
memset(saved_ltp + 576, 0, 448 * sizeof(float));
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
ac->dsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
for (i = 0; i < 64; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
|
||||
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
|
||||
memcpy(saved_ltp, ac->buf_mdct + 512, 448 * sizeof(float));
|
||||
memset(saved_ltp + 576, 0, 448 * sizeof(float));
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
ac->dsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
for (i = 0; i < 64; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
|
||||
} else { // LONG_STOP or ONLY_LONG
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
|
||||
ac->dsp.vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
|
||||
for (i = 0; i < 512; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * lwindow[511 - i];
|
||||
}
|
||||
@@ -2251,35 +2250,35 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
|
||||
*/
|
||||
if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
|
||||
(ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
|
||||
ac->fdsp.vector_fmul_window( out, saved, buf, lwindow_prev, 512);
|
||||
ac->dsp.vector_fmul_window( out, saved, buf, lwindow_prev, 512);
|
||||
} else {
|
||||
memcpy( out, saved, 448 * sizeof(float));
|
||||
memcpy( out, saved, 448 * sizeof(float));
|
||||
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
|
||||
memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
|
||||
ac->dsp.vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
|
||||
ac->dsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
|
||||
memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
|
||||
} else {
|
||||
ac->fdsp.vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
|
||||
memcpy( out + 576, buf + 64, 448 * sizeof(float));
|
||||
ac->dsp.vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
|
||||
memcpy( out + 576, buf + 64, 448 * sizeof(float));
|
||||
}
|
||||
}
|
||||
|
||||
// buffer update
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
memcpy( saved, temp + 64, 64 * sizeof(float));
|
||||
ac->fdsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
memcpy( saved, temp + 64, 64 * sizeof(float));
|
||||
ac->dsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
|
||||
ac->dsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
|
||||
memcpy( saved, buf + 512, 448 * sizeof(float));
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
memcpy( saved, buf + 512, 448 * sizeof(float));
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
} else { // LONG_STOP or ONLY_LONG
|
||||
memcpy( saved, buf + 512, 512 * sizeof(float));
|
||||
memcpy( saved, buf + 512, 512 * sizeof(float));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2388,25 +2387,25 @@ static void spectral_to_sample(AACContext *ac)
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
|
||||
if (che->ch[0].ics.predictor_present) {
|
||||
if (che->ch[0].ics.ltp.present)
|
||||
ac->apply_ltp(ac, &che->ch[0]);
|
||||
apply_ltp(ac, &che->ch[0]);
|
||||
if (che->ch[1].ics.ltp.present && type == TYPE_CPE)
|
||||
ac->apply_ltp(ac, &che->ch[1]);
|
||||
apply_ltp(ac, &che->ch[1]);
|
||||
}
|
||||
}
|
||||
if (che->ch[0].tns.present)
|
||||
ac->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
|
||||
apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
|
||||
if (che->ch[1].tns.present)
|
||||
ac->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
|
||||
apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
|
||||
if (type <= TYPE_CPE)
|
||||
apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, apply_dependent_coupling);
|
||||
if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {
|
||||
ac->imdct_and_windowing(ac, &che->ch[0]);
|
||||
imdct_and_windowing(ac, &che->ch[0]);
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
|
||||
ac->update_ltp(ac, &che->ch[0]);
|
||||
update_ltp(ac, &che->ch[0]);
|
||||
if (type == TYPE_CPE) {
|
||||
ac->imdct_and_windowing(ac, &che->ch[1]);
|
||||
imdct_and_windowing(ac, &che->ch[1]);
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
|
||||
ac->update_ltp(ac, &che->ch[1]);
|
||||
update_ltp(ac, &che->ch[1]);
|
||||
}
|
||||
if (ac->oc[1].m4ac.sbr > 0) {
|
||||
ff_sbr_apply(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);
|
||||
@@ -2486,8 +2485,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
int samples = 0, multiplier, audio_found = 0, pce_found = 0;
|
||||
int is_dmono, sce_count = 0;
|
||||
|
||||
ac->frame = data;
|
||||
|
||||
if (show_bits(gb, 12) == 0xfff) {
|
||||
if (parse_adts_frame_header(ac, gb) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
|
||||
@@ -2559,6 +2556,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
if (pce_found) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Not evaluating a further program_config_element as this construct is dubious at best.\n");
|
||||
pop_output_configuration(ac);
|
||||
} else {
|
||||
err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE, 1);
|
||||
if (!err)
|
||||
@@ -2607,8 +2605,10 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
is_dmono = ac->dmono_mode && sce_count == 2 &&
|
||||
ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
|
||||
|
||||
if (samples)
|
||||
ac->frame->nb_samples = samples;
|
||||
if (samples) {
|
||||
ac->frame.nb_samples = samples;
|
||||
*(AVFrame *)data = ac->frame;
|
||||
}
|
||||
*got_frame_ptr = !!samples;
|
||||
|
||||
if (is_dmono) {
|
||||
@@ -2626,7 +2626,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
|
||||
if (multiplier) {
|
||||
int side_size;
|
||||
const uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
|
||||
uint32_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
|
||||
if (side && side_size>=4)
|
||||
AV_WL32(side, 2*AV_RL32(side));
|
||||
}
|
||||
@@ -2678,9 +2678,6 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (ac->force_dmono_mode >= 0)
|
||||
ac->dmono_mode = ac->force_dmono_mode;
|
||||
|
||||
if (INT_MAX / 8 <= buf_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
init_get_bits(&gb, buf, buf_size * 8);
|
||||
|
||||
if ((err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt)) < 0)
|
||||
@@ -2770,7 +2767,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
|
||||
if(latmctx->initialized) {
|
||||
av_log(avctx, AV_LOG_INFO, "audio config changed\n");
|
||||
} else {
|
||||
av_log(avctx, AV_LOG_DEBUG, "initializing latmctx\n");
|
||||
av_log(avctx, AV_LOG_INFO, "initializing latmctx\n");
|
||||
}
|
||||
latmctx->initialized = 0;
|
||||
|
||||
@@ -2931,8 +2928,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
|
||||
int muxlength, err;
|
||||
GetBitContext gb;
|
||||
|
||||
if ((err = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
|
||||
return err;
|
||||
init_get_bits(&gb, avpkt->data, avpkt->size * 8);
|
||||
|
||||
// check for LOAS sync word
|
||||
if (get_bits(&gb, 11) != LOAS_SYNC_WORD)
|
||||
@@ -2986,17 +2982,6 @@ static av_cold int latm_decode_init(AVCodecContext *avctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void aacdec_init(AACContext *c)
|
||||
{
|
||||
c->imdct_and_windowing = imdct_and_windowing;
|
||||
c->apply_ltp = apply_ltp;
|
||||
c->apply_tns = apply_tns;
|
||||
c->windowing_and_mdct_ltp = windowing_and_mdct_ltp;
|
||||
c->update_ltp = update_ltp;
|
||||
|
||||
if(ARCH_MIPS)
|
||||
ff_aacdec_init_mips(c);
|
||||
}
|
||||
/**
|
||||
* AVOptions for Japanese DTV specific extensions (ADTS only)
|
||||
*/
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "dsputil.h"
|
||||
#include "internal.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "kbdwin.h"
|
||||
@@ -182,7 +183,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
|
||||
}
|
||||
|
||||
#define WINDOW_FUNC(type) \
|
||||
static void apply_ ##type ##_window(AVFloatDSPContext *fdsp, \
|
||||
static void apply_ ##type ##_window(DSPContext *dsp, AVFloatDSPContext *fdsp, \
|
||||
SingleChannelElement *sce, \
|
||||
const float *audio)
|
||||
|
||||
@@ -192,8 +193,8 @@ WINDOW_FUNC(only_long)
|
||||
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
|
||||
float *out = sce->ret_buf;
|
||||
|
||||
fdsp->vector_fmul (out, audio, lwindow, 1024);
|
||||
fdsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024);
|
||||
fdsp->vector_fmul (out, audio, lwindow, 1024);
|
||||
dsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024);
|
||||
}
|
||||
|
||||
WINDOW_FUNC(long_start)
|
||||
@@ -204,7 +205,7 @@ WINDOW_FUNC(long_start)
|
||||
|
||||
fdsp->vector_fmul(out, audio, lwindow, 1024);
|
||||
memcpy(out + 1024, audio + 1024, sizeof(out[0]) * 448);
|
||||
fdsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128);
|
||||
dsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128);
|
||||
memset(out + 1024 + 576, 0, sizeof(out[0]) * 448);
|
||||
}
|
||||
|
||||
@@ -217,7 +218,7 @@ WINDOW_FUNC(long_stop)
|
||||
memset(out, 0, sizeof(out[0]) * 448);
|
||||
fdsp->vector_fmul(out + 448, audio + 448, swindow, 128);
|
||||
memcpy(out + 576, audio + 576, sizeof(out[0]) * 448);
|
||||
fdsp->vector_fmul_reverse(out + 1024, audio + 1024, lwindow, 1024);
|
||||
dsp->vector_fmul_reverse(out + 1024, audio + 1024, lwindow, 1024);
|
||||
}
|
||||
|
||||
WINDOW_FUNC(eight_short)
|
||||
@@ -229,15 +230,15 @@ WINDOW_FUNC(eight_short)
|
||||
int w;
|
||||
|
||||
for (w = 0; w < 8; w++) {
|
||||
fdsp->vector_fmul (out, in, w ? pwindow : swindow, 128);
|
||||
fdsp->vector_fmul (out, in, w ? pwindow : swindow, 128);
|
||||
out += 128;
|
||||
in += 128;
|
||||
fdsp->vector_fmul_reverse(out, in, swindow, 128);
|
||||
dsp->vector_fmul_reverse(out, in, swindow, 128);
|
||||
out += 128;
|
||||
}
|
||||
}
|
||||
|
||||
static void (*const apply_window[4])(AVFloatDSPContext *fdsp,
|
||||
static void (*const apply_window[4])(DSPContext *dsp, AVFloatDSPContext *fdsp,
|
||||
SingleChannelElement *sce,
|
||||
const float *audio) = {
|
||||
[ONLY_LONG_SEQUENCE] = apply_only_long_window,
|
||||
@@ -252,7 +253,7 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
|
||||
int i;
|
||||
float *output = sce->ret_buf;
|
||||
|
||||
apply_window[sce->ics.window_sequence[0]](&s->fdsp, sce, audio);
|
||||
apply_window[sce->ics.window_sequence[0]](&s->dsp, &s->fdsp, sce, audio);
|
||||
|
||||
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE)
|
||||
s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
|
||||
@@ -570,8 +571,10 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
}
|
||||
start_ch += chans;
|
||||
}
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels))) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
|
||||
return ret;
|
||||
}
|
||||
do {
|
||||
int frame_bits;
|
||||
|
||||
@@ -689,6 +692,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ff_dsputil_init(&s->dsp, avctx);
|
||||
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
|
||||
// window init
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "dsputil.h"
|
||||
|
||||
#include "aac.h"
|
||||
#include "audio_frame_queue.h"
|
||||
@@ -60,6 +61,7 @@ typedef struct AACEncContext {
|
||||
PutBitContext pb;
|
||||
FFTContext mdct1024; ///< long (1024 samples) frame transform context
|
||||
FFTContext mdct128; ///< short (128 samples) frame transform context
|
||||
DSPContext dsp;
|
||||
AVFloatDSPContext fdsp;
|
||||
float *planar_samples[6]; ///< saved preprocessed input
|
||||
|
||||
|
@@ -21,13 +21,13 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "avcodec.h"
|
||||
#include "get_bits.h"
|
||||
#include "aacps.h"
|
||||
#include "aacps_tablegen.h"
|
||||
#include "aacpsdata.c"
|
||||
#include "dsputil.h"
|
||||
|
||||
#define PS_BASELINE 0 ///< Operate in Baseline PS mode
|
||||
///< Baseline implies 10 or 20 stereo bands,
|
||||
|
@@ -211,6 +211,4 @@ av_cold void ff_psdsp_init(PSDSPContext *s)
|
||||
|
||||
if (ARCH_ARM)
|
||||
ff_psdsp_init_arm(s);
|
||||
if (ARCH_MIPS)
|
||||
ff_psdsp_init_mips(s);
|
||||
}
|
||||
|
@@ -49,6 +49,5 @@ typedef struct PSDSPContext {
|
||||
|
||||
void ff_psdsp_init(PSDSPContext *s);
|
||||
void ff_psdsp_init_arm(PSDSPContext *s);
|
||||
void ff_psdsp_init_mips(PSDSPContext *s);
|
||||
|
||||
#endif /* LIBAVCODEC_AACPSDSP_H */
|
||||
|
@@ -541,10 +541,8 @@ static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
|
||||
float thr = band->thr;
|
||||
|
||||
if (band->energy > thr) {
|
||||
thr = sqrtf(thr);
|
||||
thr = sqrtf(thr) + reduction;
|
||||
thr *= thr;
|
||||
thr *= thr;
|
||||
thr = powf(thr, 0.25f) + reduction;
|
||||
thr = powf(thr, 4.0f);
|
||||
|
||||
/* This deviates from the 3GPP spec to match the reference encoder.
|
||||
* It performs min(thr_reduced, max(thr, energy/min_snr)) only for bands
|
||||
@@ -584,15 +582,13 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
|
||||
AacPsyBand *band = &pch->band[w+g];
|
||||
|
||||
float form_factor = 0.0f;
|
||||
float Temp;
|
||||
band->energy = 0.0f;
|
||||
for (i = 0; i < band_sizes[g]; i++) {
|
||||
band->energy += coefs[start+i] * coefs[start+i];
|
||||
form_factor += sqrtf(fabs(coefs[start+i]));
|
||||
}
|
||||
Temp = band->energy > 0 ? sqrtf((float)band_sizes[g] / band->energy) : 0;
|
||||
band->thr = band->energy * 0.001258925f;
|
||||
band->nz_lines = form_factor * sqrtf(Temp);
|
||||
band->nz_lines = band->energy>0 ? form_factor / powf(band->energy / band_sizes[g], 0.25f) : 0;
|
||||
|
||||
start += band_sizes[g];
|
||||
}
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include "fft.h"
|
||||
#include "aacps.h"
|
||||
#include "sbrdsp.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/avassert.h"
|
||||
|
||||
@@ -44,10 +43,6 @@
|
||||
#define ENVELOPE_ADJUSTMENT_OFFSET 2
|
||||
#define NOISE_FLOOR_OFFSET 6.0f
|
||||
|
||||
#if ARCH_MIPS
|
||||
#include "mips/aacsbr_mips.h"
|
||||
#endif /* ARCH_MIPS */
|
||||
|
||||
/**
|
||||
* SBR VLC tables
|
||||
*/
|
||||
@@ -91,8 +86,6 @@ static const int8_t vlc_sbr_lav[10] =
|
||||
#define SBR_VLC_ROW(name) \
|
||||
{ name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
|
||||
|
||||
static void aacsbr_func_ptr_init(AACSBRContext *c);
|
||||
|
||||
av_cold void ff_aac_sbr_init(void)
|
||||
{
|
||||
int n;
|
||||
@@ -161,7 +154,6 @@ av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
|
||||
ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0 * 32768.0);
|
||||
ff_ps_ctx_init(&sbr->ps);
|
||||
ff_sbrdsp_init(&sbr->dsp);
|
||||
aacsbr_func_ptr_init(&sbr->c);
|
||||
}
|
||||
|
||||
av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr)
|
||||
@@ -399,8 +391,6 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
|
||||
max_qmf_subbands = 35;
|
||||
} else if (sbr->sample_rate >= 48000)
|
||||
max_qmf_subbands = 32;
|
||||
else
|
||||
av_assert0(0);
|
||||
|
||||
if (sbr->k[2] - sbr->k[0] > max_qmf_subbands) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
@@ -1182,8 +1172,7 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
* @param x pointer to the beginning of the first sample window
|
||||
* @param W array of complex-valued samples split into subbands
|
||||
*/
|
||||
#ifndef sbr_qmf_analysis
|
||||
static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
|
||||
static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct,
|
||||
SBRDSPContext *sbrdsp, const float *in, float *x,
|
||||
float z[320], float W[2][32][32][2], int buf_idx)
|
||||
{
|
||||
@@ -1200,15 +1189,13 @@ static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
|
||||
x += 32;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Synthesis QMF Bank (14496-3 sp04 p206) and Downsampled Synthesis QMF Bank
|
||||
* (14496-3 sp04 p206)
|
||||
*/
|
||||
#ifndef sbr_qmf_synthesis
|
||||
static void sbr_qmf_synthesis(FFTContext *mdct,
|
||||
SBRDSPContext *sbrdsp, AVFloatDSPContext *dsp,
|
||||
static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
|
||||
SBRDSPContext *sbrdsp, AVFloatDSPContext *fdsp,
|
||||
float *out, float X[2][38][64],
|
||||
float mdct_buf[2][64],
|
||||
float *v0, int *v_off, const unsigned int div)
|
||||
@@ -1239,7 +1226,7 @@ static void sbr_qmf_synthesis(FFTContext *mdct,
|
||||
mdct->imdct_half(mdct, mdct_buf[1], X[1][i]);
|
||||
sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]);
|
||||
}
|
||||
dsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div);
|
||||
fdsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div);
|
||||
dsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out , 64 >> div);
|
||||
dsp->vector_fmul_add(out, v + ( 256 >> div), sbr_qmf_window + (128 >> div), out , 64 >> div);
|
||||
dsp->vector_fmul_add(out, v + ( 448 >> div), sbr_qmf_window + (192 >> div), out , 64 >> div);
|
||||
@@ -1252,7 +1239,6 @@ static void sbr_qmf_synthesis(FFTContext *mdct,
|
||||
out += 64 >> div;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
|
||||
* (14496-3 sp04 p214)
|
||||
@@ -1698,13 +1684,13 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
}
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* decode channel */
|
||||
sbr_qmf_analysis(&ac->fdsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
|
||||
sbr_qmf_analysis(&ac->dsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
|
||||
(float*)sbr->qmf_filter_scratch,
|
||||
sbr->data[ch].W, sbr->data[ch].Ypos);
|
||||
sbr->c.sbr_lf_gen(ac, sbr, sbr->X_low, sbr->data[ch].W, sbr->data[ch].Ypos);
|
||||
sbr_lf_gen(ac, sbr, sbr->X_low, sbr->data[ch].W, sbr->data[ch].Ypos);
|
||||
sbr->data[ch].Ypos ^= 1;
|
||||
if (sbr->start) {
|
||||
sbr->c.sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]);
|
||||
sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]);
|
||||
sbr_chirp(sbr, &sbr->data[ch]);
|
||||
sbr_hf_gen(ac, sbr, sbr->X_high, sbr->X_low, sbr->alpha0, sbr->alpha1,
|
||||
sbr->data[ch].bw_array, sbr->data[ch].t_env,
|
||||
@@ -1715,14 +1701,14 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
if (!err) {
|
||||
sbr_env_estimate(sbr->e_curr, sbr->X_high, sbr, &sbr->data[ch]);
|
||||
sbr_gain_calc(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a);
|
||||
sbr->c.sbr_hf_assemble(sbr->data[ch].Y[sbr->data[ch].Ypos],
|
||||
sbr_hf_assemble(sbr->data[ch].Y[sbr->data[ch].Ypos],
|
||||
sbr->X_high, sbr, &sbr->data[ch],
|
||||
sbr->data[ch].e_a);
|
||||
}
|
||||
}
|
||||
|
||||
/* synthesis */
|
||||
sbr->c.sbr_x_gen(sbr, sbr->X[ch],
|
||||
sbr_x_gen(sbr, sbr->X[ch],
|
||||
sbr->data[ch].Y[1-sbr->data[ch].Ypos],
|
||||
sbr->data[ch].Y[ sbr->data[ch].Ypos],
|
||||
sbr->X_low, ch);
|
||||
@@ -1737,26 +1723,15 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
nch = 2;
|
||||
}
|
||||
|
||||
sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, &ac->fdsp,
|
||||
sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, &ac->fdsp,
|
||||
L, sbr->X[0], sbr->qmf_filter_scratch,
|
||||
sbr->data[0].synthesis_filterbank_samples,
|
||||
&sbr->data[0].synthesis_filterbank_samples_offset,
|
||||
downsampled);
|
||||
if (nch == 2)
|
||||
sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, &ac->fdsp,
|
||||
sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, &ac->fdsp,
|
||||
R, sbr->X[1], sbr->qmf_filter_scratch,
|
||||
sbr->data[1].synthesis_filterbank_samples,
|
||||
&sbr->data[1].synthesis_filterbank_samples_offset,
|
||||
downsampled);
|
||||
}
|
||||
|
||||
static void aacsbr_func_ptr_init(AACSBRContext *c)
|
||||
{
|
||||
c->sbr_lf_gen = sbr_lf_gen;
|
||||
c->sbr_hf_assemble = sbr_hf_assemble;
|
||||
c->sbr_x_gen = sbr_x_gen;
|
||||
c->sbr_hf_inverse_filter = sbr_hf_inverse_filter;
|
||||
|
||||
if(ARCH_MIPS)
|
||||
ff_aacsbr_func_ptr_init_mips(c);
|
||||
}
|
||||
|
@@ -34,11 +34,11 @@
|
||||
#include "sbr.h"
|
||||
|
||||
/** Initialize SBR. */
|
||||
void ff_aac_sbr_init(void);
|
||||
av_cold void ff_aac_sbr_init(void);
|
||||
/** Initialize one SBR context. */
|
||||
void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr);
|
||||
av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr);
|
||||
/** Close one SBR context. */
|
||||
void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr);
|
||||
av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr);
|
||||
/** Decode one SBR element. */
|
||||
int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
|
||||
GetBitContext *gb, int crc, int cnt, int id_aac);
|
||||
@@ -46,6 +46,4 @@ int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
|
||||
void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
float* L, float *R);
|
||||
|
||||
void ff_aacsbr_func_ptr_init_mips(AACSBRContext *c);
|
||||
|
||||
#endif /* AVCODEC_AACSBR_H */
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "msrledec.h"
|
||||
|
||||
typedef struct AascContext {
|
||||
@@ -80,7 +81,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
AascContext *s = avctx->priv_data;
|
||||
int compr, i, stride, psize, ret;
|
||||
int compr, i, stride, psize;
|
||||
|
||||
if (buf_size < 4) {
|
||||
av_log(avctx, AV_LOG_ERROR, "frame too short\n");
|
||||
@@ -89,9 +90,9 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
||||
|
||||
s->frame.reference = 3;
|
||||
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
|
||||
if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) {
|
||||
if (avctx->reget_buffer(avctx, &s->frame)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
|
||||
compr = AV_RL32(buf);
|
||||
@@ -123,7 +124,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
||||
break;
|
||||
default:
|
||||
av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr);
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@@ -170,7 +170,6 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
|
||||
ff_mdct_init(&s->imdct_512, 9, 1, 1.0);
|
||||
ff_kbd_window_init(s->window, 5.0, 256);
|
||||
ff_dsputil_init(&s->dsp, avctx);
|
||||
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
ff_fmt_convert_init(&s->fmt_conv, avctx);
|
||||
av_lfg_init(&s->dith_state, 0);
|
||||
@@ -185,6 +184,9 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
|
||||
}
|
||||
s->downmixed = 1;
|
||||
|
||||
avcodec_get_frame_defaults(&s->frame);
|
||||
avctx->coded_frame = &s->frame;
|
||||
|
||||
for (i = 0; i < AC3_MAX_CHANNELS; i++) {
|
||||
s->xcfptr[i] = s->transform_coeffs[i];
|
||||
s->dlyptr[i] = s->delay[i];
|
||||
@@ -439,9 +441,8 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
|
||||
int mantissa;
|
||||
switch (bap) {
|
||||
case 0:
|
||||
/* random noise with approximate range of -0.707 to 0.707 */
|
||||
if (dither)
|
||||
mantissa = (((av_lfg_get(&s->dith_state)>>8)*181)>>8) - 5931008;
|
||||
mantissa = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
|
||||
else
|
||||
mantissa = 0;
|
||||
break;
|
||||
@@ -605,15 +606,15 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
|
||||
for (i = 0; i < 128; i++)
|
||||
x[i] = s->transform_coeffs[ch][2 * i];
|
||||
s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x);
|
||||
s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->tmp_output, s->window, 128);
|
||||
s->dsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->tmp_output, s->window, 128);
|
||||
for (i = 0; i < 128; i++)
|
||||
x[i] = s->transform_coeffs[ch][2 * i + 1];
|
||||
s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch - 1], x);
|
||||
} else {
|
||||
s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
|
||||
s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->tmp_output, s->window, 128);
|
||||
s->dsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->tmp_output, s->window, 128);
|
||||
memcpy(s->delay[ch - 1], s->tmp_output + 128, 128 * sizeof(float));
|
||||
}
|
||||
}
|
||||
@@ -1264,7 +1265,6 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
AVFrame *frame = data;
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
AC3DecodeContext *s = avctx->priv_data;
|
||||
@@ -1374,8 +1374,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
||||
avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = s->num_blocks * 256;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
s->frame.nb_samples = s->num_blocks * 256;
|
||||
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
@@ -1388,7 +1388,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
||||
}
|
||||
for (ch = 0; ch < s->channels; ch++) {
|
||||
if (ch < s->out_channels)
|
||||
s->outptr[channel_map[ch]] = (float *)frame->data[ch];
|
||||
s->outptr[channel_map[ch]] = (float *)s->frame.data[ch];
|
||||
}
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
if (!err && decode_audio_block(s, blk)) {
|
||||
@@ -1397,7 +1397,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
||||
}
|
||||
if (err)
|
||||
for (ch = 0; ch < s->out_channels; ch++)
|
||||
memcpy(((float*)frame->data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], 1024);
|
||||
memcpy(((float*)s->frame.data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], 1024);
|
||||
for (ch = 0; ch < s->out_channels; ch++)
|
||||
output[ch] = s->outptr[channel_map[ch]];
|
||||
for (ch = 0; ch < s->out_channels; ch++) {
|
||||
@@ -1406,13 +1406,14 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
||||
}
|
||||
}
|
||||
|
||||
av_frame_set_decode_error_flags(frame, err ? FF_DECODE_ERROR_INVALID_BITSTREAM : 0);
|
||||
s->frame.decode_error_flags = err ? FF_DECODE_ERROR_INVALID_BITSTREAM : 0;
|
||||
|
||||
/* keep last block for error concealment in next frame */
|
||||
for (ch = 0; ch < s->out_channels; ch++)
|
||||
memcpy(s->output[ch], output[ch], 1024);
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = s->frame;
|
||||
|
||||
return FFMIN(buf_size, s->frame_size);
|
||||
}
|
||||
|
@@ -50,7 +50,6 @@
|
||||
#ifndef AVCODEC_AC3DEC_H
|
||||
#define AVCODEC_AC3DEC_H
|
||||
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "libavutil/lfg.h"
|
||||
#include "ac3.h"
|
||||
#include "ac3dsp.h"
|
||||
@@ -69,6 +68,7 @@
|
||||
typedef struct AC3DecodeContext {
|
||||
AVClass *class; ///< class for AVOptions
|
||||
AVCodecContext *avctx; ///< parent context
|
||||
AVFrame frame; ///< AVFrame for decoded output
|
||||
GetBitContext gbc; ///< bitstream reader
|
||||
|
||||
///@name Bit stream information
|
||||
@@ -199,7 +199,6 @@ typedef struct AC3DecodeContext {
|
||||
|
||||
///@name Optimization
|
||||
DSPContext dsp; ///< for optimization
|
||||
AVFloatDSPContext fdsp;
|
||||
AC3DSPContext ac3dsp;
|
||||
FmtConvertContext fmt_conv; ///< optimized conversion functions
|
||||
///@}
|
||||
|
@@ -34,10 +34,10 @@
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/crc.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "dsputil.h"
|
||||
#include "ac3dsp.h"
|
||||
#include "ac3.h"
|
||||
#include "fft.h"
|
||||
|
@@ -28,7 +28,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/internal.h"
|
||||
|
||||
/* prototypes for static functions in ac3enc_fixed.c and ac3enc_float.c */
|
||||
|
||||
@@ -133,7 +132,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
|
||||
#else
|
||||
int32_t (*fixed_cpl_coords)[AC3_MAX_CHANNELS][16] = cpl_coords;
|
||||
#endif
|
||||
int av_uninit(blk), ch, bnd, i, j;
|
||||
int blk, ch, bnd, i, j;
|
||||
CoefSumType energy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS][16] = {{{0}}};
|
||||
int cpl_start, num_cpl_coefs;
|
||||
|
||||
@@ -337,7 +336,7 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s)
|
||||
{
|
||||
int nb_coefs;
|
||||
int blk, bnd;
|
||||
AC3Block *block, *block0 = NULL;
|
||||
AC3Block *block, *block0;
|
||||
|
||||
if (s->channel_mode != AC3_CHMODE_STEREO)
|
||||
return;
|
||||
@@ -435,7 +434,7 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
|
||||
ff_ac3_quantize_mantissas(s);
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size)))
|
||||
return ret;
|
||||
ff_ac3_output_frame(s, avpkt->data);
|
||||
|
||||
|
@@ -21,10 +21,10 @@
|
||||
*/
|
||||
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "acelp_pitch_delay.h"
|
||||
#include "celp_math.h"
|
||||
|
||||
@@ -132,7 +132,7 @@ float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
|
||||
// Note 10^(0.05 * -10log(average x2)) = 1/sqrt((average x2)).
|
||||
float val = fixed_gain_factor *
|
||||
exp2f(M_LOG2_10 * 0.05 *
|
||||
(avpriv_scalarproduct_float_c(pred_table, prediction_error, 4) +
|
||||
(ff_scalarproduct_float_c(pred_table, prediction_error, 4) +
|
||||
energy_mean)) /
|
||||
sqrtf(fixed_mean_energy);
|
||||
|
||||
|
@@ -23,8 +23,8 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "acelp_vectors.h"
|
||||
|
||||
const uint8_t ff_fc_2pulses_9bits_track1[16] =
|
||||
@@ -203,7 +203,7 @@ void ff_adaptive_gain_control(float *out, const float *in, float speech_energ,
|
||||
int size, float alpha, float *gain_mem)
|
||||
{
|
||||
int i;
|
||||
float postfilter_energ = avpriv_scalarproduct_float_c(in, in, size);
|
||||
float postfilter_energ = ff_scalarproduct_float_c(in, in, size);
|
||||
float gain_scale_factor = 1.0;
|
||||
float mem = *gain_mem;
|
||||
|
||||
@@ -224,7 +224,7 @@ void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in,
|
||||
float sum_of_squares, const int n)
|
||||
{
|
||||
int i;
|
||||
float scalefactor = avpriv_scalarproduct_float_c(in, in, n);
|
||||
float scalefactor = ff_scalarproduct_float_c(in, in, n);
|
||||
if (scalefactor)
|
||||
scalefactor = sqrt(sum_of_squares / scalefactor);
|
||||
for (i = 0; i < n; i++)
|
||||
|
@@ -85,6 +85,7 @@ static const int swf_index_tables[4][16] = {
|
||||
/* end of tables */
|
||||
|
||||
typedef struct ADPCMDecodeContext {
|
||||
AVFrame frame;
|
||||
ADPCMChannelStatus status[6];
|
||||
int vqa_version; /**< VQA version. Used for ADPCM_IMA_WS */
|
||||
} ADPCMDecodeContext;
|
||||
@@ -158,6 +159,9 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||
}
|
||||
|
||||
avcodec_get_frame_defaults(&c->frame);
|
||||
avctx->coded_frame = &c->frame;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -615,7 +619,6 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
|
||||
static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
AVFrame *frame = data;
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
ADPCMDecodeContext *c = avctx->priv_data;
|
||||
@@ -636,20 +639,20 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = nb_samples;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
c->frame.nb_samples = nb_samples;
|
||||
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
samples = (short *)frame->data[0];
|
||||
samples_p = (int16_t **)frame->extended_data;
|
||||
samples = (short *)c->frame.data[0];
|
||||
samples_p = (int16_t **)c->frame.extended_data;
|
||||
|
||||
/* use coded_samples when applicable */
|
||||
/* it is always <= nb_samples, so the output buffer will be large enough */
|
||||
if (coded_samples) {
|
||||
if (coded_samples != nb_samples)
|
||||
av_log(avctx, AV_LOG_WARNING, "mismatch in coded sample count\n");
|
||||
frame->nb_samples = nb_samples = coded_samples;
|
||||
c->frame.nb_samples = nb_samples = coded_samples;
|
||||
}
|
||||
|
||||
st = avctx->channels == 2 ? 1 : 0;
|
||||
@@ -735,7 +738,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
for (i = 0; i < avctx->channels; i++) {
|
||||
samples = (int16_t *)frame->data[i];
|
||||
samples = (int16_t *)c->frame.data[i];
|
||||
cs = &c->status[i];
|
||||
for (n = nb_samples >> 1; n > 0; n--) {
|
||||
int v = bytestream2_get_byteu(&gb);
|
||||
@@ -1132,7 +1135,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
}
|
||||
|
||||
frame->nb_samples = count * 28;
|
||||
c->frame.nb_samples = count * 28;
|
||||
bytestream2_seek(&gb, 0, SEEK_END);
|
||||
break;
|
||||
}
|
||||
@@ -1375,7 +1378,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = c->frame;
|
||||
|
||||
return bytestream2_tell(&gb);
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "get_bits.h"
|
||||
#include "put_bits.h"
|
||||
#include "bytestream.h"
|
||||
#include "adpcm.h"
|
||||
@@ -494,7 +495,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
pkt_size = (2 + avctx->channels * (22 + 4 * (frame->nb_samples - 1)) + 7) / 8;
|
||||
else
|
||||
pkt_size = avctx->block_align;
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)))
|
||||
return ret;
|
||||
dst = avpkt->data;
|
||||
|
||||
|
@@ -40,6 +40,7 @@ typedef struct ADXChannelState {
|
||||
} ADXChannelState;
|
||||
|
||||
typedef struct ADXContext {
|
||||
AVFrame frame;
|
||||
int channels;
|
||||
ADXChannelState prev[2];
|
||||
int header_parsed;
|
||||
|
@@ -52,6 +52,9 @@ static av_cold int adx_decode_init(AVCodecContext *avctx)
|
||||
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
|
||||
|
||||
avcodec_get_frame_defaults(&c->frame);
|
||||
avctx->coded_frame = &c->frame;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -95,7 +98,6 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset,
|
||||
static int adx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
AVFrame *frame = data;
|
||||
int buf_size = avpkt->size;
|
||||
ADXContext *c = avctx->priv_data;
|
||||
int16_t **samples;
|
||||
@@ -141,12 +143,12 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = num_blocks * BLOCK_SAMPLES;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
c->frame.nb_samples = num_blocks * BLOCK_SAMPLES;
|
||||
if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
samples = (int16_t **)frame->extended_data;
|
||||
samples = (int16_t **)c->frame.extended_data;
|
||||
samples_offset = 0;
|
||||
|
||||
while (num_blocks--) {
|
||||
@@ -162,7 +164,8 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
samples_offset += BLOCK_SAMPLES;
|
||||
}
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = c->frame;
|
||||
|
||||
return buf - avpkt->data;
|
||||
}
|
||||
|
@@ -107,14 +107,6 @@ static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
|
||||
return HEADER_SIZE;
|
||||
}
|
||||
|
||||
#if FF_API_OLD_ENCODE_AUDIO
|
||||
static av_cold int adx_encode_close(AVCodecContext *avctx)
|
||||
{
|
||||
av_freep(&avctx->coded_frame);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static av_cold int adx_encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
ADXContext *c = avctx->priv_data;
|
||||
@@ -126,8 +118,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
|
||||
avctx->frame_size = BLOCK_SAMPLES;
|
||||
|
||||
#if FF_API_OLD_ENCODE_AUDIO
|
||||
if (!(avctx->coded_frame = avcodec_alloc_frame()))
|
||||
return AVERROR(ENOMEM);
|
||||
avcodec_get_frame_defaults(&c->frame);
|
||||
avctx->coded_frame = &c->frame;
|
||||
#endif
|
||||
|
||||
/* the cutoff can be adjusted, but this seems to work pretty well */
|
||||
@@ -175,9 +167,6 @@ AVCodec ff_adpcm_adx_encoder = {
|
||||
.id = AV_CODEC_ID_ADPCM_ADX,
|
||||
.priv_data_size = sizeof(ADXContext),
|
||||
.init = adx_encode_init,
|
||||
#if FF_API_OLD_ENCODE_AUDIO
|
||||
.close = adx_encode_close,
|
||||
#endif
|
||||
.encode2 = adx_encode_frame,
|
||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
|
@@ -58,6 +58,7 @@
|
||||
|
||||
typedef struct {
|
||||
AVCodecContext *avctx;
|
||||
AVFrame frame;
|
||||
GetBitContext gb;
|
||||
int channels;
|
||||
|
||||
@@ -253,7 +254,7 @@ static void append_extra_bits(int32_t *buffer[2], int32_t *extra_bits_buffer[2],
|
||||
buffer[ch][i] = (buffer[ch][i] << extra_bits) | extra_bits_buffer[ch][i];
|
||||
}
|
||||
|
||||
static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
static int decode_element(AVCodecContext *avctx, void *data, int ch_index,
|
||||
int channels)
|
||||
{
|
||||
ALACContext *alac = avctx->priv_data;
|
||||
@@ -288,8 +289,8 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
}
|
||||
if (!alac->nb_samples) {
|
||||
/* get output buffer */
|
||||
frame->nb_samples = output_samples;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
alac->frame.nb_samples = output_samples;
|
||||
if ((ret = ff_get_buffer(avctx, &alac->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
@@ -301,7 +302,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
alac->nb_samples = output_samples;
|
||||
if (alac->direct_output) {
|
||||
for (ch = 0; ch < channels; ch++)
|
||||
alac->output_samples_buffer[ch] = (int32_t *)frame->extended_data[ch_index + ch];
|
||||
alac->output_samples_buffer[ch] = (int32_t *)alac->frame.extended_data[ch_index + ch];
|
||||
}
|
||||
|
||||
if (is_compressed) {
|
||||
@@ -389,7 +390,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
switch(alac->sample_size) {
|
||||
case 16: {
|
||||
for (ch = 0; ch < channels; ch++) {
|
||||
int16_t *outbuffer = (int16_t *)frame->extended_data[ch_index + ch];
|
||||
int16_t *outbuffer = (int16_t *)alac->frame.extended_data[ch_index + ch];
|
||||
for (i = 0; i < alac->nb_samples; i++)
|
||||
*outbuffer++ = alac->output_samples_buffer[ch][i];
|
||||
}}
|
||||
@@ -404,7 +405,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
}else{
|
||||
switch(alac->sample_size) {
|
||||
case 16: {
|
||||
int16_t *outbuffer = ((int16_t *)frame->extended_data[0]) + ch_index;
|
||||
int16_t *outbuffer = ((int16_t *)alac->frame.extended_data[0]) + ch_index;
|
||||
for (i = 0; i < alac->nb_samples; i++) {
|
||||
for (ch = 0; ch < channels; ch++)
|
||||
*outbuffer++ = alac->output_samples_buffer[ch][i];
|
||||
@@ -413,7 +414,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
}
|
||||
break;
|
||||
case 24: {
|
||||
int32_t *outbuffer = ((int32_t *)frame->extended_data[0]) + ch_index;
|
||||
int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
|
||||
for (i = 0; i < alac->nb_samples; i++) {
|
||||
for (ch = 0; ch < channels; ch++)
|
||||
*outbuffer++ = alac->output_samples_buffer[ch][i] << 8;
|
||||
@@ -422,7 +423,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
}
|
||||
break;
|
||||
case 32: {
|
||||
int32_t *outbuffer = ((int32_t *)frame->extended_data[0]) + ch_index;
|
||||
int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
|
||||
for (i = 0; i < alac->nb_samples; i++) {
|
||||
for (ch = 0; ch < channels; ch++)
|
||||
*outbuffer++ = alac->output_samples_buffer[ch][i];
|
||||
@@ -440,7 +441,6 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
ALACContext *alac = avctx->priv_data;
|
||||
AVFrame *frame = data;
|
||||
enum AlacRawDataBlockType element;
|
||||
int channels;
|
||||
int ch, ret, got_end;
|
||||
@@ -469,7 +469,7 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
ret = decode_element(avctx, frame,
|
||||
ret = decode_element(avctx, data,
|
||||
ff_alac_channel_layout_offsets[alac->channels - 1][ch],
|
||||
channels);
|
||||
if (ret < 0 && get_bits_left(&alac->gb))
|
||||
@@ -487,7 +487,8 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
avpkt->size * 8 - get_bits_count(&alac->gb));
|
||||
}
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = alac->frame;
|
||||
|
||||
return avpkt->size;
|
||||
}
|
||||
@@ -615,6 +616,9 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
avcodec_get_frame_defaults(&alac->frame);
|
||||
avctx->coded_frame = &alac->frame;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "dsputil.h"
|
||||
#include "internal.h"
|
||||
#include "lpc.h"
|
||||
#include "mathops.h"
|
||||
@@ -613,7 +614,7 @@ static int alac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
else
|
||||
max_frame_size = s->max_coded_frame_size;
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * max_frame_size)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * max_frame_size)))
|
||||
return ret;
|
||||
|
||||
/* use verbatim mode for compression_level 0 */
|
||||
|
@@ -74,23 +74,18 @@ void avcodec_register_all(void)
|
||||
|
||||
/* hardware accelerators */
|
||||
REGISTER_HWACCEL(H263_VAAPI, h263_vaapi);
|
||||
REGISTER_HWACCEL(H263_VDPAU, h263_vdpau);
|
||||
REGISTER_HWACCEL(H264_DXVA2, h264_dxva2);
|
||||
REGISTER_HWACCEL(H264_VAAPI, h264_vaapi);
|
||||
REGISTER_HWACCEL(H264_VDA, h264_vda);
|
||||
REGISTER_HWACCEL(H264_VDPAU, h264_vdpau);
|
||||
REGISTER_HWACCEL(MPEG1_VDPAU, mpeg1_vdpau);
|
||||
REGISTER_HWACCEL(MPEG2_DXVA2, mpeg2_dxva2);
|
||||
REGISTER_HWACCEL(MPEG2_VAAPI, mpeg2_vaapi);
|
||||
REGISTER_HWACCEL(MPEG2_VDPAU, mpeg2_vdpau);
|
||||
REGISTER_HWACCEL(MPEG4_VAAPI, mpeg4_vaapi);
|
||||
REGISTER_HWACCEL(MPEG4_VDPAU, mpeg4_vdpau);
|
||||
REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2);
|
||||
REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi);
|
||||
REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau);
|
||||
REGISTER_HWACCEL(WMV3_DXVA2, wmv3_dxva2);
|
||||
REGISTER_HWACCEL(WMV3_VAAPI, wmv3_vaapi);
|
||||
REGISTER_HWACCEL(WMV3_VDPAU, wmv3_vdpau);
|
||||
|
||||
/* video codecs */
|
||||
REGISTER_ENCODER(A64MULTI, a64multi);
|
||||
@@ -323,7 +318,6 @@ void avcodec_register_all(void)
|
||||
REGISTER_ENCDEC (DCA, dca);
|
||||
REGISTER_DECODER(DSICINAUDIO, dsicinaudio);
|
||||
REGISTER_ENCDEC (EAC3, eac3);
|
||||
REGISTER_DECODER(EVRC, evrc);
|
||||
REGISTER_DECODER(FFWAVESYNTH, ffwavesynth);
|
||||
REGISTER_ENCDEC (FLAC, flac);
|
||||
REGISTER_ENCDEC (G723_1, g723_1);
|
||||
@@ -489,8 +483,7 @@ void avcodec_register_all(void)
|
||||
REGISTER_ENCODER(LIBVO_AACENC, libvo_aacenc);
|
||||
REGISTER_ENCODER(LIBVO_AMRWBENC, libvo_amrwbenc);
|
||||
REGISTER_ENCDEC (LIBVORBIS, libvorbis);
|
||||
REGISTER_ENCDEC (LIBVPX_VP8, libvpx_vp8);
|
||||
REGISTER_ENCDEC (LIBVPX_VP9, libvpx_vp9);
|
||||
REGISTER_ENCDEC (LIBVPX, libvpx);
|
||||
REGISTER_ENCODER(LIBX264, libx264);
|
||||
REGISTER_ENCODER(LIBX264RGB, libx264rgb);
|
||||
REGISTER_ENCODER(LIBXAVS, libxavs);
|
||||
|
@@ -19,21 +19,20 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_alpha.h"
|
||||
#include "asm.h"
|
||||
|
||||
void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
|
||||
void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
|
||||
void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
|
||||
#if 0
|
||||
/* These functions were the base for the optimized assembler routines,
|
||||
and remain here for documentation purposes. */
|
||||
static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size)
|
||||
static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
|
||||
int line_size)
|
||||
{
|
||||
int i = 8;
|
||||
uint64_t clampmask = zap(-1, 0xaa); /* 0x00ff00ff00ff00ff */
|
||||
@@ -56,8 +55,8 @@ static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
|
||||
} while (--i);
|
||||
}
|
||||
|
||||
void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size)
|
||||
void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
|
||||
int line_size)
|
||||
{
|
||||
int h = 8;
|
||||
/* Keep this function a leaf function by generating the constants
|
||||
@@ -101,9 +100,9 @@ void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
|
||||
}
|
||||
#endif
|
||||
|
||||
static void clear_blocks_axp(int16_t *blocks) {
|
||||
static void clear_blocks_axp(DCTELEM *blocks) {
|
||||
uint64_t *p = (uint64_t *) blocks;
|
||||
int n = sizeof(int16_t) * 6 * 64;
|
||||
int n = sizeof(DCTELEM) * 6 * 64;
|
||||
|
||||
do {
|
||||
p[0] = 0;
|
||||
@@ -212,8 +211,8 @@ static inline uint64_t avg4(uint64_t l1, uint64_t l2, uint64_t l3, uint64_t l4)
|
||||
|
||||
#define MAKE_OP(OPNAME, SUFF, OPKIND, STORE) \
|
||||
static void OPNAME ## _pixels ## SUFF ## _axp \
|
||||
(uint8_t *restrict block, const uint8_t *restrict pixels, \
|
||||
ptrdiff_t line_size, int h) \
|
||||
(uint8_t *av_restrict block, const uint8_t *av_restrict pixels, \
|
||||
int line_size, int h) \
|
||||
{ \
|
||||
if ((size_t) pixels & 0x7) { \
|
||||
OPKIND(uldq, STORE); \
|
||||
@@ -223,8 +222,8 @@ static void OPNAME ## _pixels ## SUFF ## _axp \
|
||||
} \
|
||||
\
|
||||
static void OPNAME ## _pixels16 ## SUFF ## _axp \
|
||||
(uint8_t *restrict block, const uint8_t *restrict pixels, \
|
||||
ptrdiff_t line_size, int h) \
|
||||
(uint8_t *av_restrict block, const uint8_t *av_restrict pixels, \
|
||||
int line_size, int h) \
|
||||
{ \
|
||||
OPNAME ## _pixels ## SUFF ## _axp(block, pixels, line_size, h); \
|
||||
OPNAME ## _pixels ## SUFF ## _axp(block + 8, pixels + 8, line_size, h); \
|
||||
@@ -263,13 +262,13 @@ PIXOP(put_no_rnd, STORE);
|
||||
PIXOP(avg_no_rnd, STORE);
|
||||
|
||||
static void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels,
|
||||
ptrdiff_t line_size, int h)
|
||||
int line_size, int h)
|
||||
{
|
||||
put_pixels_axp_asm(block, pixels, line_size, h);
|
||||
put_pixels_axp_asm(block + 8, pixels + 8, line_size, h);
|
||||
}
|
||||
|
||||
av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
|
||||
void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
@@ -289,10 +288,10 @@ av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
|
||||
c->avg_pixels_tab[0][2] = avg_pixels16_y2_axp;
|
||||
c->avg_pixels_tab[0][3] = avg_pixels16_xy2_axp;
|
||||
|
||||
c->avg_no_rnd_pixels_tab[0] = avg_no_rnd_pixels16_axp;
|
||||
c->avg_no_rnd_pixels_tab[1] = avg_no_rnd_pixels16_x2_axp;
|
||||
c->avg_no_rnd_pixels_tab[2] = avg_no_rnd_pixels16_y2_axp;
|
||||
c->avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels16_xy2_axp;
|
||||
c->avg_no_rnd_pixels_tab[0][0] = avg_no_rnd_pixels16_axp;
|
||||
c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_axp;
|
||||
c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_axp;
|
||||
c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_axp;
|
||||
|
||||
c->put_pixels_tab[1][0] = put_pixels_axp_asm;
|
||||
c->put_pixels_tab[1][1] = put_pixels_x2_axp;
|
||||
@@ -309,6 +308,11 @@ av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
|
||||
c->avg_pixels_tab[1][2] = avg_pixels_y2_axp;
|
||||
c->avg_pixels_tab[1][3] = avg_pixels_xy2_axp;
|
||||
|
||||
c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels_axp;
|
||||
c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels_x2_axp;
|
||||
c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels_y2_axp;
|
||||
c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels_xy2_axp;
|
||||
|
||||
c->clear_blocks = clear_blocks_axp;
|
||||
}
|
||||
|
||||
|
@@ -19,27 +19,26 @@
|
||||
#ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H
|
||||
#define AVCODEC_ALPHA_DSPUTIL_ALPHA_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "libavcodec/dsputil.h"
|
||||
|
||||
void ff_simple_idct_axp(int16_t *block);
|
||||
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct_axp(DCTELEM *block);
|
||||
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block);
|
||||
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block);
|
||||
|
||||
void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,
|
||||
ptrdiff_t line_size, int h);
|
||||
void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
|
||||
int line_size, int h);
|
||||
void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
|
||||
void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
|
||||
extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
|
||||
extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
|
||||
void get_pixels_mvi(int16_t *restrict block,
|
||||
const uint8_t *restrict pixels, int line_size);
|
||||
void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
|
||||
void get_pixels_mvi(DCTELEM *av_restrict block,
|
||||
const uint8_t *av_restrict pixels, int line_size);
|
||||
void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,
|
||||
int stride);
|
||||
int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
|
||||
int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
|
||||
|
@@ -135,7 +135,7 @@ $aligned:
|
||||
.end put_pixels_axp_asm
|
||||
|
||||
/************************************************************************
|
||||
* void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
|
||||
* void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
|
||||
* int line_size)
|
||||
*/
|
||||
.align 6
|
||||
@@ -185,7 +185,7 @@ put_pixels_clamped_mvi_asm:
|
||||
.end put_pixels_clamped_mvi_asm
|
||||
|
||||
/************************************************************************
|
||||
* void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
|
||||
* void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
|
||||
* int line_size)
|
||||
*/
|
||||
.align 6
|
||||
|
@@ -19,11 +19,12 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_alpha.h"
|
||||
#include "asm.h"
|
||||
|
||||
void get_pixels_mvi(int16_t *restrict block,
|
||||
const uint8_t *restrict pixels, int line_size)
|
||||
void get_pixels_mvi(DCTELEM *av_restrict block,
|
||||
const uint8_t *av_restrict pixels, int line_size)
|
||||
{
|
||||
int h = 8;
|
||||
|
||||
@@ -39,7 +40,7 @@ void get_pixels_mvi(int16_t *restrict block,
|
||||
} while (--h);
|
||||
}
|
||||
|
||||
void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
|
||||
void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,
|
||||
int stride) {
|
||||
int h = 8;
|
||||
uint64_t mask = 0x4040;
|
||||
|
@@ -19,11 +19,11 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "libavcodec/mpegvideo.h"
|
||||
#include "asm.h"
|
||||
|
||||
static void dct_unquantize_h263_axp(int16_t *block, int n_coeffs,
|
||||
static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs,
|
||||
uint64_t qscale, uint64_t qadd)
|
||||
{
|
||||
uint64_t qmul = qscale << 1;
|
||||
@@ -69,12 +69,12 @@ static void dct_unquantize_h263_axp(int16_t *block, int n_coeffs,
|
||||
}
|
||||
}
|
||||
|
||||
static void dct_unquantize_h263_intra_axp(MpegEncContext *s, int16_t *block,
|
||||
static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block,
|
||||
int n, int qscale)
|
||||
{
|
||||
int n_coeffs;
|
||||
uint64_t qadd;
|
||||
int16_t block0 = block[0];
|
||||
DCTELEM block0 = block[0];
|
||||
|
||||
if (!s->h263_aic) {
|
||||
if (n < 4)
|
||||
@@ -96,14 +96,14 @@ static void dct_unquantize_h263_intra_axp(MpegEncContext *s, int16_t *block,
|
||||
block[0] = block0;
|
||||
}
|
||||
|
||||
static void dct_unquantize_h263_inter_axp(MpegEncContext *s, int16_t *block,
|
||||
static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block,
|
||||
int n, int qscale)
|
||||
{
|
||||
int n_coeffs = s->inter_scantable.raster_end[s->block_last_index[n]];
|
||||
dct_unquantize_h263_axp(block, n_coeffs, qscale, (qscale - 1) | 1);
|
||||
}
|
||||
|
||||
av_cold void ff_MPV_common_init_axp(MpegEncContext *s)
|
||||
void ff_MPV_common_init_axp(MpegEncContext *s)
|
||||
{
|
||||
s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_axp;
|
||||
s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_axp;
|
||||
|
@@ -26,6 +26,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_alpha.h"
|
||||
#include "asm.h"
|
||||
|
||||
@@ -43,7 +44,7 @@
|
||||
#define COL_SHIFT 20
|
||||
|
||||
/* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */
|
||||
static inline int idct_row(int16_t *row)
|
||||
static inline int idct_row(DCTELEM *row)
|
||||
{
|
||||
int a0, a1, a2, a3, b0, b1, b2, b3, t;
|
||||
uint64_t l, r, t2;
|
||||
@@ -151,7 +152,7 @@ static inline int idct_row(int16_t *row)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static inline void idct_col(int16_t *col)
|
||||
static inline void idct_col(DCTELEM *col)
|
||||
{
|
||||
int a0, a1, a2, a3, b0, b1, b2, b3;
|
||||
|
||||
@@ -228,7 +229,7 @@ static inline void idct_col(int16_t *col)
|
||||
|
||||
/* If all rows but the first one are zero after row transformation,
|
||||
all rows will be identical after column transformation. */
|
||||
static inline void idct_col2(int16_t *col)
|
||||
static inline void idct_col2(DCTELEM *col)
|
||||
{
|
||||
int i;
|
||||
uint64_t l, r;
|
||||
@@ -250,7 +251,7 @@ static inline void idct_col2(int16_t *col)
|
||||
stq(l, col + 14 * 4); stq(r, col + 15 * 4);
|
||||
}
|
||||
|
||||
void ff_simple_idct_axp(int16_t *block)
|
||||
void ff_simple_idct_axp(DCTELEM *block)
|
||||
{
|
||||
|
||||
int i;
|
||||
@@ -290,13 +291,13 @@ void ff_simple_idct_axp(int16_t *block)
|
||||
}
|
||||
}
|
||||
|
||||
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block)
|
||||
{
|
||||
ff_simple_idct_axp(block);
|
||||
put_pixels_clamped_axp_p(block, dest, line_size);
|
||||
}
|
||||
|
||||
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block)
|
||||
{
|
||||
ff_simple_idct_axp(block);
|
||||
add_pixels_clamped_axp_p(block, dest, line_size);
|
||||
|
@@ -192,6 +192,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
AVCodecContext *avctx;
|
||||
AVFrame frame;
|
||||
ALSSpecificConfig sconf;
|
||||
GetBitContext gb;
|
||||
DSPContext dsp;
|
||||
@@ -288,10 +289,8 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
|
||||
ALSSpecificConfig *sconf = &ctx->sconf;
|
||||
AVCodecContext *avctx = ctx->avctx;
|
||||
uint32_t als_id, header_size, trailer_size;
|
||||
int ret;
|
||||
|
||||
if ((ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size)) < 0)
|
||||
return ret;
|
||||
init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8);
|
||||
|
||||
config_offset = avpriv_mpeg4audio_get_config(&m4ac, avctx->extradata,
|
||||
avctx->extradata_size * 8, 1);
|
||||
@@ -1449,7 +1448,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
AVPacket *avpkt)
|
||||
{
|
||||
ALSDecContext *ctx = avctx->priv_data;
|
||||
AVFrame *frame = data;
|
||||
ALSSpecificConfig *sconf = &ctx->sconf;
|
||||
const uint8_t *buffer = avpkt->data;
|
||||
int buffer_size = avpkt->size;
|
||||
@@ -1479,8 +1477,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
ctx->frame_id++;
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = ctx->cur_frame_length;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
ctx->frame.nb_samples = ctx->cur_frame_length;
|
||||
if ((ret = ff_get_buffer(avctx, &ctx->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n");
|
||||
return ret;
|
||||
}
|
||||
@@ -1488,7 +1486,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
// transform decoded frame into output format
|
||||
#define INTERLEAVE_OUTPUT(bps) \
|
||||
{ \
|
||||
int##bps##_t *dest = (int##bps##_t*)frame->data[0]; \
|
||||
int##bps##_t *dest = (int##bps##_t*)ctx->frame.data[0]; \
|
||||
shift = bps - ctx->avctx->bits_per_raw_sample; \
|
||||
if (!ctx->cs_switch) { \
|
||||
for (sample = 0; sample < ctx->cur_frame_length; sample++) \
|
||||
@@ -1512,7 +1510,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
int swap = HAVE_BIGENDIAN != sconf->msb_first;
|
||||
|
||||
if (ctx->avctx->bits_per_raw_sample == 24) {
|
||||
int32_t *src = (int32_t *)frame->data[0];
|
||||
int32_t *src = (int32_t *)ctx->frame.data[0];
|
||||
|
||||
for (sample = 0;
|
||||
sample < ctx->cur_frame_length * avctx->channels;
|
||||
@@ -1533,7 +1531,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
|
||||
if (swap) {
|
||||
if (ctx->avctx->bits_per_raw_sample <= 16) {
|
||||
int16_t *src = (int16_t*) frame->data[0];
|
||||
int16_t *src = (int16_t*) ctx->frame.data[0];
|
||||
int16_t *dest = (int16_t*) ctx->crc_buffer;
|
||||
for (sample = 0;
|
||||
sample < ctx->cur_frame_length * avctx->channels;
|
||||
@@ -1541,12 +1539,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
*dest++ = av_bswap16(src[sample]);
|
||||
} else {
|
||||
ctx->dsp.bswap_buf((uint32_t*)ctx->crc_buffer,
|
||||
(uint32_t *)frame->data[0],
|
||||
(uint32_t *)ctx->frame.data[0],
|
||||
ctx->cur_frame_length * avctx->channels);
|
||||
}
|
||||
crc_source = ctx->crc_buffer;
|
||||
} else {
|
||||
crc_source = frame->data[0];
|
||||
crc_source = ctx->frame.data[0];
|
||||
}
|
||||
|
||||
ctx->crc = av_crc(ctx->crc_table, ctx->crc, crc_source,
|
||||
@@ -1562,7 +1560,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = ctx->frame;
|
||||
|
||||
|
||||
bytes_read = invalid_frame ? buffer_size :
|
||||
(get_bits_count(&ctx->gb) + 7) >> 3;
|
||||
@@ -1759,6 +1759,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
|
||||
ff_dsputil_init(&ctx->dsp, avctx);
|
||||
|
||||
avcodec_get_frame_defaults(&ctx->frame);
|
||||
avctx->coded_frame = &ctx->frame;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -44,8 +44,8 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "celp_math.h"
|
||||
@@ -98,6 +98,7 @@
|
||||
#define AMR_AGC_ALPHA 0.9
|
||||
|
||||
typedef struct AMRContext {
|
||||
AVFrame avframe; ///< AVFrame for decoded samples
|
||||
AMRNBFrame frame; ///< decoded AMR parameters (lsf coefficients, codebook indexes, etc)
|
||||
uint8_t bad_frame_indicator; ///< bad frame ? 1 : 0
|
||||
enum Mode cur_frame_mode;
|
||||
@@ -184,6 +185,9 @@ static av_cold int amrnb_decode_init(AVCodecContext *avctx)
|
||||
for (i = 0; i < 4; i++)
|
||||
p->prediction_error[i] = MIN_ENERGY;
|
||||
|
||||
avcodec_get_frame_defaults(&p->avframe);
|
||||
avctx->coded_frame = &p->avframe;
|
||||
|
||||
ff_acelp_filter_init(&p->acelpf_ctx);
|
||||
ff_acelp_vectors_init(&p->acelpv_ctx);
|
||||
ff_celp_filter_init(&p->celpf_ctx);
|
||||
@@ -806,7 +810,7 @@ static int synthesis(AMRContext *p, float *lpc,
|
||||
// emphasize pitch vector contribution
|
||||
if (p->pitch_gain[4] > 0.5 && !overflow) {
|
||||
float energy = p->celpm_ctx.dot_productf(excitation, excitation,
|
||||
AMR_SUBFRAME_SIZE);
|
||||
AMR_SUBFRAME_SIZE);
|
||||
float pitch_factor =
|
||||
p->pitch_gain[4] *
|
||||
(p->cur_frame_mode == MODE_12k2 ?
|
||||
@@ -907,7 +911,7 @@ static void postfilter(AMRContext *p, float *lpc, float *buf_out)
|
||||
float *samples = p->samples_in + LP_FILTER_ORDER; // Start of input
|
||||
|
||||
float speech_gain = p->celpm_ctx.dot_productf(samples, samples,
|
||||
AMR_SUBFRAME_SIZE);
|
||||
AMR_SUBFRAME_SIZE);
|
||||
|
||||
float pole_out[AMR_SUBFRAME_SIZE + LP_FILTER_ORDER]; // Output of pole filter
|
||||
const float *gamma_n, *gamma_d; // Formant filter factor table
|
||||
@@ -950,7 +954,6 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
{
|
||||
|
||||
AMRContext *p = avctx->priv_data; // pointer to private data
|
||||
AVFrame *frame = data;
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
float *buf_out; // pointer to the output data buffer
|
||||
@@ -962,12 +965,12 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
const float *synth_fixed_vector; // pointer to the fixed vector that synthesis should use
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = AMR_BLOCK_SIZE;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
p->avframe.nb_samples = AMR_BLOCK_SIZE;
|
||||
if ((ret = ff_get_buffer(avctx, &p->avframe)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
buf_out = (float *)frame->data[0];
|
||||
buf_out = (float *)p->avframe.data[0];
|
||||
|
||||
p->cur_frame_mode = unpack_bitstream(p, buf, buf_size);
|
||||
if (p->cur_frame_mode == NO_DATA) {
|
||||
@@ -1015,8 +1018,8 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
p->fixed_gain[4] =
|
||||
ff_amr_set_fixed_gain(fixed_gain_factor,
|
||||
p->celpm_ctx.dot_productf(p->fixed_vector,
|
||||
p->fixed_vector,
|
||||
AMR_SUBFRAME_SIZE) /
|
||||
p->fixed_vector,
|
||||
AMR_SUBFRAME_SIZE) /
|
||||
AMR_SUBFRAME_SIZE,
|
||||
p->prediction_error,
|
||||
energy_mean[p->cur_frame_mode], energy_pred_fac);
|
||||
@@ -1075,7 +1078,8 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
p->acelpv_ctx.weighted_vector_sumf(p->lsf_avg, p->lsf_avg, p->lsf_q[3],
|
||||
0.84, 0.16, LP_FILTER_ORDER);
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = p->avframe;
|
||||
|
||||
/* return the amount of bytes consumed if everything was OK */
|
||||
return frame_sizes_nb[p->cur_frame_mode] + 1; // +7 for rounding and +8 for TOC
|
||||
|
@@ -26,10 +26,10 @@
|
||||
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "libavutil/lfg.h"
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "lsp.h"
|
||||
#include "celp_filters.h"
|
||||
#include "celp_math.h"
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "mips/amrwbdec_mips.h"
|
||||
|
||||
typedef struct {
|
||||
AVFrame avframe; ///< AVFrame for decoded samples
|
||||
AMRWBFrame frame; ///< AMRWB parameters decoded from bitstream
|
||||
enum Mode fr_cur_mode; ///< mode index of current frame
|
||||
uint8_t fr_quality; ///< frame quality index (FQI)
|
||||
@@ -120,6 +121,9 @@ static av_cold int amrwb_decode_init(AVCodecContext *avctx)
|
||||
for (i = 0; i < 4; i++)
|
||||
ctx->prediction_error[i] = MIN_ENERGY;
|
||||
|
||||
avcodec_get_frame_defaults(&ctx->avframe);
|
||||
avctx->coded_frame = &ctx->avframe;
|
||||
|
||||
ff_acelp_filter_init(&ctx->acelpf_ctx);
|
||||
ff_acelp_vectors_init(&ctx->acelpv_ctx);
|
||||
ff_celp_filter_init(&ctx->celpf_ctx);
|
||||
@@ -608,11 +612,11 @@ static float voice_factor(float *p_vector, float p_gain,
|
||||
CELPMContext *ctx)
|
||||
{
|
||||
double p_ener = (double) ctx->dot_productf(p_vector, p_vector,
|
||||
AMRWB_SFR_SIZE) *
|
||||
p_gain * p_gain;
|
||||
AMRWB_SFR_SIZE) *
|
||||
p_gain * p_gain;
|
||||
double f_ener = (double) ctx->dot_productf(f_vector, f_vector,
|
||||
AMRWB_SFR_SIZE) *
|
||||
f_gain * f_gain;
|
||||
AMRWB_SFR_SIZE) *
|
||||
f_gain * f_gain;
|
||||
|
||||
return (p_ener - f_ener) / (p_ener + f_ener);
|
||||
}
|
||||
@@ -781,7 +785,7 @@ static void synthesis(AMRWBContext *ctx, float *lpc, float *excitation,
|
||||
if (ctx->pitch_gain[0] > 0.5 && ctx->fr_cur_mode <= MODE_8k85) {
|
||||
int i;
|
||||
float energy = ctx->celpm_ctx.dot_productf(excitation, excitation,
|
||||
AMRWB_SFR_SIZE);
|
||||
AMRWB_SFR_SIZE);
|
||||
|
||||
// XXX: Weird part in both ref code and spec. A unknown parameter
|
||||
// {beta} seems to be identical to the current pitch gain
|
||||
@@ -842,8 +846,8 @@ static void upsample_5_4(float *out, const float *in, int o_size, CELPMContext *
|
||||
|
||||
for (k = 1; k < 5; k++) {
|
||||
out[i] = ctx->dot_productf(in0 + int_part,
|
||||
upsample_fir[4 - frac_part],
|
||||
UPS_MEM_SIZE);
|
||||
upsample_fir[4 - frac_part],
|
||||
UPS_MEM_SIZE);
|
||||
int_part++;
|
||||
frac_part--;
|
||||
i++;
|
||||
@@ -889,8 +893,7 @@ static void scaled_hb_excitation(AMRWBContext *ctx, float *hb_exc,
|
||||
const float *synth_exc, float hb_gain)
|
||||
{
|
||||
int i;
|
||||
float energy = ctx->celpm_ctx.dot_productf(synth_exc, synth_exc,
|
||||
AMRWB_SFR_SIZE);
|
||||
float energy = ctx->celpm_ctx.dot_productf(synth_exc, synth_exc, AMRWB_SFR_SIZE);
|
||||
|
||||
/* Generate a white-noise excitation */
|
||||
for (i = 0; i < AMRWB_SFR_SIZE_16k; i++)
|
||||
@@ -1093,7 +1096,6 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
AMRWBContext *ctx = avctx->priv_data;
|
||||
AVFrame *frame = data;
|
||||
AMRWBFrame *cf = &ctx->frame;
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
@@ -1111,12 +1113,12 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int sub, i, ret;
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = 4 * AMRWB_SFR_SIZE_16k;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
ctx->avframe.nb_samples = 4 * AMRWB_SFR_SIZE_16k;
|
||||
if ((ret = ff_get_buffer(avctx, &ctx->avframe)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
buf_out = (float *)frame->data[0];
|
||||
buf_out = (float *)ctx->avframe.data[0];
|
||||
|
||||
header_size = decode_mime_header(ctx, buf);
|
||||
if (ctx->fr_cur_mode > MODE_SID) {
|
||||
@@ -1187,8 +1189,8 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
ctx->fixed_gain[0] =
|
||||
ff_amr_set_fixed_gain(fixed_gain_factor,
|
||||
ctx->celpm_ctx.dot_productf(ctx->fixed_vector,
|
||||
ctx->fixed_vector,
|
||||
AMRWB_SFR_SIZE) /
|
||||
ctx->fixed_vector,
|
||||
AMRWB_SFR_SIZE) /
|
||||
AMRWB_SFR_SIZE,
|
||||
ctx->prediction_error,
|
||||
ENERGY_MEAN, energy_pred_fac);
|
||||
@@ -1262,7 +1264,8 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
memcpy(ctx->isp_sub4_past, ctx->isp[3], LP_ORDER * sizeof(ctx->isp[3][0]));
|
||||
memcpy(ctx->isf_past_final, ctx->isf_cur, LP_ORDER * sizeof(float));
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = ctx->avframe;
|
||||
|
||||
return expected_fr_size;
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
uint8_t *dst, *dst_end;
|
||||
int count, ret;
|
||||
|
||||
if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0){
|
||||
if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
@@ -434,8 +434,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
av_log(avctx, AV_LOG_WARNING, "args overflow (%i)\n", s->nb_args);
|
||||
if (s->nb_args < MAX_NB_ARGS && s->args[s->nb_args] >= 0)
|
||||
s->nb_args++;
|
||||
if ((ret = execute_code(avctx, buf[0])) < 0)
|
||||
return ret;
|
||||
if (execute_code(avctx, buf[0]) < 0)
|
||||
return -1;
|
||||
s->state = STATE_NORMAL;
|
||||
}
|
||||
break;
|
||||
|
@@ -129,6 +129,7 @@ typedef struct APEPredictor {
|
||||
typedef struct APEContext {
|
||||
AVClass *class; ///< class for AVOptions
|
||||
AVCodecContext *avctx;
|
||||
AVFrame frame;
|
||||
DSPContext dsp;
|
||||
int channels;
|
||||
int samples; ///< samples left to decode in current frame
|
||||
@@ -234,6 +235,9 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
|
||||
ff_dsputil_init(&s->dsp, avctx);
|
||||
avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
|
||||
|
||||
avcodec_get_frame_defaults(&s->frame);
|
||||
avctx->coded_frame = &s->frame;
|
||||
|
||||
return 0;
|
||||
filter_alloc_fail:
|
||||
ape_decode_close(avctx);
|
||||
@@ -822,7 +826,6 @@ static void ape_unpack_stereo(APEContext *ctx, int count)
|
||||
static int ape_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
AVFrame *frame = data;
|
||||
const uint8_t *buf = avpkt->data;
|
||||
APEContext *s = avctx->priv_data;
|
||||
uint8_t *sample8;
|
||||
@@ -903,8 +906,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
|
||||
s->decoded[1] = s->decoded_buffer + FFALIGN(blockstodecode, 8);
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = blockstodecode;
|
||||
if ((ret = ff_get_buffer(avctx, frame)) < 0) {
|
||||
s->frame.nb_samples = blockstodecode;
|
||||
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
@@ -926,21 +929,21 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
|
||||
switch (s->bps) {
|
||||
case 8:
|
||||
for (ch = 0; ch < s->channels; ch++) {
|
||||
sample8 = (uint8_t *)frame->data[ch];
|
||||
sample8 = (uint8_t *)s->frame.data[ch];
|
||||
for (i = 0; i < blockstodecode; i++)
|
||||
*sample8++ = (s->decoded[ch][i] + 0x80) & 0xff;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
for (ch = 0; ch < s->channels; ch++) {
|
||||
sample16 = (int16_t *)frame->data[ch];
|
||||
sample16 = (int16_t *)s->frame.data[ch];
|
||||
for (i = 0; i < blockstodecode; i++)
|
||||
*sample16++ = s->decoded[ch][i];
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
for (ch = 0; ch < s->channels; ch++) {
|
||||
sample24 = (int32_t *)frame->data[ch];
|
||||
sample24 = (int32_t *)s->frame.data[ch];
|
||||
for (i = 0; i < blockstodecode; i++)
|
||||
*sample24++ = s->decoded[ch][i] << 8;
|
||||
}
|
||||
@@ -949,7 +952,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
s->samples -= blockstodecode;
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
*got_frame_ptr = 1;
|
||||
*(AVFrame *)data = s->frame;
|
||||
|
||||
return !s->samples ? avpkt->size : 0;
|
||||
}
|
||||
|
@@ -1,5 +1,3 @@
|
||||
ARCH_HEADERS = mathops.h
|
||||
|
||||
OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
|
||||
arm/ac3dsp_arm.o
|
||||
|
||||
@@ -17,7 +15,6 @@ OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
|
||||
ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
|
||||
|
||||
OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP5_DECODER) += arm/vp56dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP6_DECODER) += arm/vp56dsp_init_arm.o
|
||||
@@ -26,10 +23,8 @@ ARMV6-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8_armv6.o \
|
||||
arm/vp8dsp_init_armv6.o \
|
||||
arm/vp8dsp_armv6.o
|
||||
|
||||
OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o
|
||||
OBJS-$(CONFIG_H264DSP) += arm/h264dsp_init_arm.o
|
||||
OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o
|
||||
OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o
|
||||
|
||||
OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o
|
||||
OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \
|
||||
@@ -60,6 +55,9 @@ ARMV6-OBJS += arm/dsputil_init_armv6.o \
|
||||
|
||||
VFP-OBJS-$(HAVE_ARMV6) += arm/fmtconvert_vfp.o
|
||||
|
||||
VFP-OBJS += arm/dsputil_vfp.o \
|
||||
arm/dsputil_init_vfp.o \
|
||||
|
||||
NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \
|
||||
arm/fft_fixed_neon.o \
|
||||
|
||||
@@ -68,14 +66,12 @@ NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
|
||||
|
||||
NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o \
|
||||
|
||||
NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_neon.o \
|
||||
arm/h264idct_neon.o \
|
||||
arm/h264cmc_neon.o \
|
||||
|
||||
NEON-OBJS-$(CONFIG_H264PRED) += arm/h264pred_neon.o \
|
||||
|
||||
NEON-OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_neon.o \
|
||||
|
||||
NEON-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_neon.o
|
||||
|
||||
NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/sbrdsp_neon.o \
|
||||
@@ -88,8 +84,7 @@ NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
|
||||
NEON-OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_neon.o \
|
||||
arm/rv40dsp_neon.o \
|
||||
|
||||
NEON-OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_neon.o
|
||||
arm/h264cmc_neon.o \
|
||||
|
||||
NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o
|
||||
|
||||
|
@@ -22,9 +22,8 @@
|
||||
#define AVCODEC_ARM_DCA_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "libavcodec/mathops.h"
|
||||
#include "libavutil/intmath.h"
|
||||
|
||||
#if HAVE_ARMV6_INLINE && AV_GCC_VERSION_AT_LEAST(4,4) && !CONFIG_THUMB
|
||||
|
||||
|
@@ -19,27 +19,27 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_arm.h"
|
||||
|
||||
void ff_j_rev_dct_arm(int16_t *data);
|
||||
void ff_simple_idct_arm(int16_t *data);
|
||||
void ff_j_rev_dct_arm(DCTELEM *data);
|
||||
void ff_simple_idct_arm(DCTELEM *data);
|
||||
|
||||
/* XXX: local hack */
|
||||
static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
|
||||
static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
|
||||
static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
|
||||
static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
|
||||
|
||||
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
|
||||
void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
|
||||
void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
|
||||
void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
|
||||
|
||||
void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
|
||||
void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
|
||||
void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
|
||||
|
||||
void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
|
||||
|
||||
CALL_2X_PIXELS(ff_put_pixels16_x2_arm, ff_put_pixels8_x2_arm, 8)
|
||||
CALL_2X_PIXELS(ff_put_pixels16_y2_arm, ff_put_pixels8_y2_arm, 8)
|
||||
@@ -48,33 +48,33 @@ CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8)
|
||||
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
|
||||
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
|
||||
|
||||
void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
|
||||
void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest,
|
||||
int line_size);
|
||||
|
||||
/* XXX: those functions should be suppressed ASAP when all IDCTs are
|
||||
converted */
|
||||
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
|
||||
{
|
||||
ff_j_rev_dct_arm (block);
|
||||
ff_put_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
|
||||
{
|
||||
ff_j_rev_dct_arm (block);
|
||||
ff_add_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
|
||||
{
|
||||
ff_simple_idct_arm (block);
|
||||
ff_put_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
|
||||
{
|
||||
ff_simple_idct_arm (block);
|
||||
ff_add_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
|
||||
av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx)
|
||||
void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
@@ -121,5 +121,6 @@ av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx)
|
||||
|
||||
if (have_armv5te(cpu_flags)) ff_dsputil_init_armv5te(c, avctx);
|
||||
if (have_armv6(cpu_flags)) ff_dsputil_init_armv6(c, avctx);
|
||||
if (have_vfp(cpu_flags)) ff_dsputil_init_vfp(c, avctx);
|
||||
if (have_neon(cpu_flags)) ff_dsputil_init_neon(c, avctx);
|
||||
}
|
||||
|
@@ -18,11 +18,12 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_arm.h"
|
||||
|
||||
void ff_simple_idct_armv5te(int16_t *data);
|
||||
void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_armv5te(DCTELEM *data);
|
||||
void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, DCTELEM *data);
|
||||
void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data);
|
||||
|
||||
av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
|
@@ -21,36 +21,37 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_arm.h"
|
||||
|
||||
void ff_simple_idct_armv6(int16_t *data);
|
||||
void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_armv6(DCTELEM *data);
|
||||
void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data);
|
||||
void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data);
|
||||
|
||||
void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_y2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_y2_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
void ff_put_pixels16_x2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_y2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_x2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_y2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
void ff_avg_pixels16_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
void ff_put_pixels8_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_x2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_y2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_x2_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_y2_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
void ff_put_pixels8_x2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_x2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
void ff_add_pixels_clamped_armv6(const int16_t *block,
|
||||
uint8_t *restrict pixels,
|
||||
void ff_add_pixels_clamped_armv6(const DCTELEM *block,
|
||||
uint8_t *av_restrict pixels,
|
||||
int line_size);
|
||||
|
||||
void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride);
|
||||
void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,
|
||||
void ff_get_pixels_armv6(DCTELEM *block, const uint8_t *pixels, int stride);
|
||||
void ff_diff_pixels_armv6(DCTELEM *block, const uint8_t *s1,
|
||||
const uint8_t *s2, int stride);
|
||||
|
||||
int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
|
||||
|
@@ -21,53 +21,143 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_arm.h"
|
||||
|
||||
void ff_simple_idct_neon(int16_t *data);
|
||||
void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_neon(DCTELEM *data);
|
||||
void ff_simple_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
|
||||
void ff_simple_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
|
||||
|
||||
void ff_clear_block_neon(int16_t *block);
|
||||
void ff_clear_blocks_neon(int16_t *blocks);
|
||||
void ff_clear_block_neon(DCTELEM *block);
|
||||
void ff_clear_blocks_neon(DCTELEM *blocks);
|
||||
|
||||
void ff_put_pixels16_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_y2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_xy2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_x2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_y2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_xy2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_put_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
void ff_avg_pixels16_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels16_y2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels16_xy2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels8_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels8_x2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels8_y2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels8_xy2_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
void ff_avg_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int);
|
||||
void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int);
|
||||
void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int);
|
||||
void ff_add_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);
|
||||
void ff_put_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);
|
||||
void ff_put_signed_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);
|
||||
|
||||
void ff_put_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc20_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc30_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc01_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc11_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc21_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc31_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc02_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc12_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc22_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc32_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc03_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc13_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc23_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel16_mc33_neon(uint8_t *, uint8_t *, int);
|
||||
|
||||
void ff_put_h264_qpel8_mc00_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc10_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc20_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc30_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc01_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc11_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc21_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc31_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc02_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc12_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc22_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc32_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc03_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc13_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc23_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_put_h264_qpel8_mc33_neon(uint8_t *, uint8_t *, int);
|
||||
|
||||
void ff_avg_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc20_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc30_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc01_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc11_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc21_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc31_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc02_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc12_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc22_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc32_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc03_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc13_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc23_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel16_mc33_neon(uint8_t *, uint8_t *, int);
|
||||
|
||||
void ff_avg_h264_qpel8_mc00_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc10_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc20_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc30_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc01_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc11_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc21_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc31_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc02_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc12_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc22_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc32_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc03_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc13_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc23_neon(uint8_t *, uint8_t *, int);
|
||||
void ff_avg_h264_qpel8_mc33_neon(uint8_t *, uint8_t *, int);
|
||||
|
||||
void ff_put_h264_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
void ff_put_h264_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
void ff_put_h264_chroma_mc2_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
|
||||
void ff_avg_h264_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
void ff_avg_h264_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
void ff_avg_h264_chroma_mc2_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
|
||||
void ff_vector_fmul_window_neon(float *dst, const float *src0,
|
||||
const float *src1, const float *win, int len);
|
||||
void ff_butterflies_float_neon(float *v1, float *v2, int len);
|
||||
float ff_scalarproduct_float_neon(const float *v1, const float *v2, int len);
|
||||
void ff_vector_fmul_reverse_neon(float *dst, const float *src0,
|
||||
const float *src1, int len);
|
||||
void ff_vector_fmul_add_neon(float *dst, const float *src0, const float *src1,
|
||||
const float *src2, int len);
|
||||
|
||||
void ff_vector_clipf_neon(float *dst, const float *src, float min, float max,
|
||||
int len);
|
||||
void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min,
|
||||
int32_t max, unsigned int len);
|
||||
|
||||
void ff_vorbis_inverse_coupling_neon(float *mag, float *ang, int blocksize);
|
||||
|
||||
int32_t ff_scalarproduct_int16_neon(const int16_t *v1, const int16_t *v2, int len);
|
||||
int32_t ff_scalarproduct_and_madd_int16_neon(int16_t *v1, const int16_t *v2,
|
||||
const int16_t *v3, int len, int mul);
|
||||
@@ -75,7 +165,7 @@ int32_t ff_scalarproduct_and_madd_int16_neon(int16_t *v1, const int16_t *v2,
|
||||
void ff_apply_window_int16_neon(int16_t *dst, const int16_t *src,
|
||||
const int16_t *window, unsigned n);
|
||||
|
||||
av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
|
||||
void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
@@ -120,19 +210,109 @@ av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
|
||||
c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_neon;
|
||||
c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_neon;
|
||||
|
||||
c->avg_no_rnd_pixels_tab[0] = ff_avg_pixels16_neon;
|
||||
c->avg_no_rnd_pixels_tab[1] = ff_avg_pixels16_x2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[2] = ff_avg_pixels16_y2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[3] = ff_avg_pixels16_xy2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[0][0] = ff_avg_pixels16_neon;
|
||||
c->avg_no_rnd_pixels_tab[0][1] = ff_avg_pixels16_x2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[0][2] = ff_avg_pixels16_y2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[0][3] = ff_avg_pixels16_xy2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[1][0] = ff_avg_pixels8_neon;
|
||||
c->avg_no_rnd_pixels_tab[1][1] = ff_avg_pixels8_x2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[1][2] = ff_avg_pixels8_y2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[1][3] = ff_avg_pixels8_xy2_no_rnd_neon;
|
||||
}
|
||||
|
||||
c->add_pixels_clamped = ff_add_pixels_clamped_neon;
|
||||
c->put_pixels_clamped = ff_put_pixels_clamped_neon;
|
||||
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon;
|
||||
|
||||
if (CONFIG_H264_DECODER && !high_bit_depth) {
|
||||
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_neon;
|
||||
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_neon;
|
||||
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_neon;
|
||||
|
||||
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_neon;
|
||||
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_neon;
|
||||
c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_neon;
|
||||
|
||||
c->put_h264_qpel_pixels_tab[0][ 0] = ff_put_h264_qpel16_mc00_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 1] = ff_put_h264_qpel16_mc10_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 2] = ff_put_h264_qpel16_mc20_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 3] = ff_put_h264_qpel16_mc30_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 4] = ff_put_h264_qpel16_mc01_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 5] = ff_put_h264_qpel16_mc11_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 6] = ff_put_h264_qpel16_mc21_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 7] = ff_put_h264_qpel16_mc31_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 8] = ff_put_h264_qpel16_mc02_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 9] = ff_put_h264_qpel16_mc12_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_neon;
|
||||
|
||||
c->put_h264_qpel_pixels_tab[1][ 0] = ff_put_h264_qpel8_mc00_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 1] = ff_put_h264_qpel8_mc10_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 2] = ff_put_h264_qpel8_mc20_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 3] = ff_put_h264_qpel8_mc30_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 4] = ff_put_h264_qpel8_mc01_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 5] = ff_put_h264_qpel8_mc11_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 6] = ff_put_h264_qpel8_mc21_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 7] = ff_put_h264_qpel8_mc31_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 8] = ff_put_h264_qpel8_mc02_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 9] = ff_put_h264_qpel8_mc12_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_neon;
|
||||
|
||||
c->avg_h264_qpel_pixels_tab[0][ 0] = ff_avg_h264_qpel16_mc00_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 1] = ff_avg_h264_qpel16_mc10_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 2] = ff_avg_h264_qpel16_mc20_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 3] = ff_avg_h264_qpel16_mc30_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 4] = ff_avg_h264_qpel16_mc01_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 5] = ff_avg_h264_qpel16_mc11_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 6] = ff_avg_h264_qpel16_mc21_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 7] = ff_avg_h264_qpel16_mc31_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 8] = ff_avg_h264_qpel16_mc02_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 9] = ff_avg_h264_qpel16_mc12_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_neon;
|
||||
|
||||
c->avg_h264_qpel_pixels_tab[1][ 0] = ff_avg_h264_qpel8_mc00_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 1] = ff_avg_h264_qpel8_mc10_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 2] = ff_avg_h264_qpel8_mc20_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 3] = ff_avg_h264_qpel8_mc30_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 4] = ff_avg_h264_qpel8_mc01_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 5] = ff_avg_h264_qpel8_mc11_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 6] = ff_avg_h264_qpel8_mc21_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 7] = ff_avg_h264_qpel8_mc31_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 8] = ff_avg_h264_qpel8_mc02_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 9] = ff_avg_h264_qpel8_mc12_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_neon;
|
||||
}
|
||||
|
||||
c->vector_fmul_window = ff_vector_fmul_window_neon;
|
||||
c->butterflies_float = ff_butterflies_float_neon;
|
||||
c->scalarproduct_float = ff_scalarproduct_float_neon;
|
||||
c->vector_fmul_reverse = ff_vector_fmul_reverse_neon;
|
||||
c->vector_fmul_add = ff_vector_fmul_add_neon;
|
||||
c->vector_clipf = ff_vector_clipf_neon;
|
||||
c->vector_clip_int32 = ff_vector_clip_int32_neon;
|
||||
|
||||
if (CONFIG_VORBIS_DECODER)
|
||||
c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_neon;
|
||||
|
||||
c->scalarproduct_int16 = ff_scalarproduct_int16_neon;
|
||||
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_neon;
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2008 Siarhei Siamashka <ssvb@users.sourceforge.net>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
@@ -16,18 +18,13 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "vorbisdsp.h"
|
||||
#include "vorbis.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_arm.h"
|
||||
|
||||
void ff_vorbisdsp_init(VorbisDSPContext *dsp)
|
||||
void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
|
||||
const float *src1, int len);
|
||||
|
||||
void ff_dsputil_init_vfp(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling;
|
||||
|
||||
if (ARCH_X86)
|
||||
ff_vorbisdsp_init_x86(dsp);
|
||||
if (ARCH_PPC)
|
||||
ff_vorbisdsp_init_ppc(dsp);
|
||||
if (ARCH_ARM)
|
||||
ff_vorbisdsp_init_arm(dsp);
|
||||
c->vector_fmul_reverse = ff_vector_fmul_reverse_vfp;
|
||||
}
|
@@ -19,6 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
function ff_clear_block_neon, export=1
|
||||
@@ -421,9 +422,9 @@ function ff_avg_h264_qpel8_mc00_neon, export=1
|
||||
endfunc
|
||||
|
||||
pixfunc avg_, pixels8, avg=1
|
||||
pixfunc avg_, pixels8_x2, avg=1
|
||||
pixfunc avg_, pixels8_y2, avg=1
|
||||
pixfunc avg_, pixels8_xy2, avg=1
|
||||
pixfunc2 avg_, pixels8_x2, avg=1
|
||||
pixfunc2 avg_, pixels8_y2, avg=1
|
||||
pixfunc2 avg_, pixels8_xy2, avg=1
|
||||
|
||||
function ff_put_pixels_clamped_neon, export=1
|
||||
vld1.16 {d16-d19}, [r0,:128]!
|
||||
@@ -531,6 +532,192 @@ function ff_add_pixels_clamped_neon, export=1
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function ff_vector_fmul_window_neon, export=1
|
||||
push {r4,r5,lr}
|
||||
ldr lr, [sp, #12]
|
||||
sub r2, r2, #8
|
||||
sub r5, lr, #2
|
||||
add r2, r2, r5, lsl #2
|
||||
add r4, r3, r5, lsl #3
|
||||
add ip, r0, r5, lsl #3
|
||||
mov r5, #-16
|
||||
vld1.32 {d0,d1}, [r1,:128]!
|
||||
vld1.32 {d2,d3}, [r2,:128], r5
|
||||
vld1.32 {d4,d5}, [r3,:128]!
|
||||
vld1.32 {d6,d7}, [r4,:128], r5
|
||||
1: subs lr, lr, #4
|
||||
vmul.f32 d22, d0, d4
|
||||
vrev64.32 q3, q3
|
||||
vmul.f32 d23, d1, d5
|
||||
vrev64.32 q1, q1
|
||||
vmul.f32 d20, d0, d7
|
||||
vmul.f32 d21, d1, d6
|
||||
beq 2f
|
||||
vmla.f32 d22, d3, d7
|
||||
vld1.32 {d0,d1}, [r1,:128]!
|
||||
vmla.f32 d23, d2, d6
|
||||
vld1.32 {d18,d19},[r2,:128], r5
|
||||
vmls.f32 d20, d3, d4
|
||||
vld1.32 {d24,d25},[r3,:128]!
|
||||
vmls.f32 d21, d2, d5
|
||||
vld1.32 {d6,d7}, [r4,:128], r5
|
||||
vmov q1, q9
|
||||
vrev64.32 q11, q11
|
||||
vmov q2, q12
|
||||
vswp d22, d23
|
||||
vst1.32 {d20,d21},[r0,:128]!
|
||||
vst1.32 {d22,d23},[ip,:128], r5
|
||||
b 1b
|
||||
2: vmla.f32 d22, d3, d7
|
||||
vmla.f32 d23, d2, d6
|
||||
vmls.f32 d20, d3, d4
|
||||
vmls.f32 d21, d2, d5
|
||||
vrev64.32 q11, q11
|
||||
vswp d22, d23
|
||||
vst1.32 {d20,d21},[r0,:128]!
|
||||
vst1.32 {d22,d23},[ip,:128], r5
|
||||
pop {r4,r5,pc}
|
||||
endfunc
|
||||
|
||||
#if CONFIG_VORBIS_DECODER
|
||||
function ff_vorbis_inverse_coupling_neon, export=1
|
||||
vmov.i32 q10, #1<<31
|
||||
subs r2, r2, #4
|
||||
mov r3, r0
|
||||
mov r12, r1
|
||||
beq 3f
|
||||
|
||||
vld1.32 {d24-d25},[r1,:128]!
|
||||
vld1.32 {d22-d23},[r0,:128]!
|
||||
vcle.s32 q8, q12, #0
|
||||
vand q9, q11, q10
|
||||
veor q12, q12, q9
|
||||
vand q2, q12, q8
|
||||
vbic q3, q12, q8
|
||||
vadd.f32 q12, q11, q2
|
||||
vsub.f32 q11, q11, q3
|
||||
1: vld1.32 {d2-d3}, [r1,:128]!
|
||||
vld1.32 {d0-d1}, [r0,:128]!
|
||||
vcle.s32 q8, q1, #0
|
||||
vand q9, q0, q10
|
||||
veor q1, q1, q9
|
||||
vst1.32 {d24-d25},[r3, :128]!
|
||||
vst1.32 {d22-d23},[r12,:128]!
|
||||
vand q2, q1, q8
|
||||
vbic q3, q1, q8
|
||||
vadd.f32 q1, q0, q2
|
||||
vsub.f32 q0, q0, q3
|
||||
subs r2, r2, #8
|
||||
ble 2f
|
||||
vld1.32 {d24-d25},[r1,:128]!
|
||||
vld1.32 {d22-d23},[r0,:128]!
|
||||
vcle.s32 q8, q12, #0
|
||||
vand q9, q11, q10
|
||||
veor q12, q12, q9
|
||||
vst1.32 {d2-d3}, [r3, :128]!
|
||||
vst1.32 {d0-d1}, [r12,:128]!
|
||||
vand q2, q12, q8
|
||||
vbic q3, q12, q8
|
||||
vadd.f32 q12, q11, q2
|
||||
vsub.f32 q11, q11, q3
|
||||
b 1b
|
||||
|
||||
2: vst1.32 {d2-d3}, [r3, :128]!
|
||||
vst1.32 {d0-d1}, [r12,:128]!
|
||||
it lt
|
||||
bxlt lr
|
||||
|
||||
3: vld1.32 {d2-d3}, [r1,:128]
|
||||
vld1.32 {d0-d1}, [r0,:128]
|
||||
vcle.s32 q8, q1, #0
|
||||
vand q9, q0, q10
|
||||
veor q1, q1, q9
|
||||
vand q2, q1, q8
|
||||
vbic q3, q1, q8
|
||||
vadd.f32 q1, q0, q2
|
||||
vsub.f32 q0, q0, q3
|
||||
vst1.32 {d2-d3}, [r0,:128]!
|
||||
vst1.32 {d0-d1}, [r1,:128]!
|
||||
bx lr
|
||||
endfunc
|
||||
#endif
|
||||
|
||||
function ff_butterflies_float_neon, export=1
|
||||
1: vld1.32 {q0},[r0,:128]
|
||||
vld1.32 {q1},[r1,:128]
|
||||
vsub.f32 q2, q0, q1
|
||||
vadd.f32 q1, q0, q1
|
||||
vst1.32 {q2},[r1,:128]!
|
||||
vst1.32 {q1},[r0,:128]!
|
||||
subs r2, r2, #4
|
||||
bgt 1b
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function ff_scalarproduct_float_neon, export=1
|
||||
vmov.f32 q2, #0.0
|
||||
1: vld1.32 {q0},[r0,:128]!
|
||||
vld1.32 {q1},[r1,:128]!
|
||||
vmla.f32 q2, q0, q1
|
||||
subs r2, r2, #4
|
||||
bgt 1b
|
||||
vadd.f32 d0, d4, d5
|
||||
vpadd.f32 d0, d0, d0
|
||||
NOVFP vmov.32 r0, d0[0]
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function ff_vector_fmul_reverse_neon, export=1
|
||||
add r2, r2, r3, lsl #2
|
||||
sub r2, r2, #32
|
||||
mov r12, #-32
|
||||
vld1.32 {q0-q1}, [r1,:128]!
|
||||
vld1.32 {q2-q3}, [r2,:128], r12
|
||||
1: pld [r1, #32]
|
||||
vrev64.32 q3, q3
|
||||
vmul.f32 d16, d0, d7
|
||||
vmul.f32 d17, d1, d6
|
||||
pld [r2, #-32]
|
||||
vrev64.32 q2, q2
|
||||
vmul.f32 d18, d2, d5
|
||||
vmul.f32 d19, d3, d4
|
||||
subs r3, r3, #8
|
||||
beq 2f
|
||||
vld1.32 {q0-q1}, [r1,:128]!
|
||||
vld1.32 {q2-q3}, [r2,:128], r12
|
||||
vst1.32 {q8-q9}, [r0,:128]!
|
||||
b 1b
|
||||
2: vst1.32 {q8-q9}, [r0,:128]!
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function ff_vector_fmul_add_neon, export=1
|
||||
ldr r12, [sp]
|
||||
vld1.32 {q0-q1}, [r1,:128]!
|
||||
vld1.32 {q8-q9}, [r2,:128]!
|
||||
vld1.32 {q2-q3}, [r3,:128]!
|
||||
vmul.f32 q10, q0, q8
|
||||
vmul.f32 q11, q1, q9
|
||||
1: vadd.f32 q12, q2, q10
|
||||
vadd.f32 q13, q3, q11
|
||||
pld [r1, #16]
|
||||
pld [r2, #16]
|
||||
pld [r3, #16]
|
||||
subs r12, r12, #8
|
||||
beq 2f
|
||||
vld1.32 {q0}, [r1,:128]!
|
||||
vld1.32 {q8}, [r2,:128]!
|
||||
vmul.f32 q10, q0, q8
|
||||
vld1.32 {q1}, [r1,:128]!
|
||||
vld1.32 {q9}, [r2,:128]!
|
||||
vmul.f32 q11, q1, q9
|
||||
vld1.32 {q2-q3}, [r3,:128]!
|
||||
vst1.32 {q12-q13},[r0,:128]!
|
||||
b 1b
|
||||
2: vst1.32 {q12-q13},[r0,:128]!
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function ff_vector_clipf_neon, export=1
|
||||
VFP vdup.32 q1, d0[1]
|
||||
VFP vdup.32 q0, d0[0]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user