Compare commits
301 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a697577a64 | ||
![]() |
99f3f5a8d5 | ||
![]() |
d4a7e89793 | ||
![]() |
e681e92d2c | ||
![]() |
123d356829 | ||
![]() |
119659b759 | ||
![]() |
f0cc6f74fc | ||
![]() |
f5060bce31 | ||
![]() |
cde38373d1 | ||
![]() |
a2b234b917 | ||
![]() |
f1cdd93517 | ||
![]() |
0e3c36518d | ||
![]() |
858f43043f | ||
![]() |
d0fd9bec1f | ||
![]() |
d755045e78 | ||
![]() |
3820c6a979 | ||
![]() |
7cfea0d41c | ||
![]() |
8c08247990 | ||
![]() |
2316c35865 | ||
![]() |
3dd0d43d8c | ||
![]() |
2f6d3459d9 | ||
![]() |
2c58d73413 | ||
![]() |
5b14f436c6 | ||
![]() |
d7a13ff23b | ||
![]() |
b65c06ee5e | ||
![]() |
a7a7c6e44c | ||
![]() |
d41b91ba33 | ||
![]() |
34c5f6685a | ||
![]() |
784506c2b5 | ||
![]() |
26241af6f8 | ||
![]() |
7ad0581686 | ||
![]() |
3219de21f4 | ||
![]() |
93eda8dcba | ||
![]() |
1dc135e03d | ||
![]() |
f040f3e5d5 | ||
![]() |
7f320ed15d | ||
![]() |
5b88d24f24 | ||
![]() |
3e187a9a2d | ||
![]() |
4bfaa040fc | ||
![]() |
5124bf8ea6 | ||
![]() |
50ce06cc7c | ||
![]() |
a628b70831 | ||
![]() |
e274976c92 | ||
![]() |
1586fda2fc | ||
![]() |
34b9c7612d | ||
![]() |
ea4b99f82c | ||
![]() |
8b30abd020 | ||
![]() |
435b0ab969 | ||
![]() |
c78d268e9f | ||
![]() |
e56d322032 | ||
![]() |
3ffc224435 | ||
![]() |
e7e4c65571 | ||
![]() |
4aa876f288 | ||
![]() |
a9ce4583df | ||
![]() |
93fa19addf | ||
![]() |
5c7ffbbda3 | ||
![]() |
8be41ad2bb | ||
![]() |
9a8d2f51cf | ||
![]() |
d013f51303 | ||
![]() |
548a07cdc4 | ||
![]() |
0f331f94c0 | ||
![]() |
0a06e2824a | ||
![]() |
dc0bc71471 | ||
![]() |
5af5396970 | ||
![]() |
d17298b666 | ||
![]() |
ece3912daf | ||
![]() |
d092b7f04c | ||
![]() |
1601420be4 | ||
![]() |
bdf79f29db | ||
![]() |
4e80d4bf25 | ||
![]() |
e3ffc7ab4a | ||
![]() |
76cb34f7f5 | ||
![]() |
da87a699ea | ||
![]() |
86a52988bd | ||
![]() |
d259a0534e | ||
![]() |
710dccf036 | ||
![]() |
fc69fa8474 | ||
![]() |
88ccca204a | ||
![]() |
07a3024631 | ||
![]() |
cf1f615b67 | ||
![]() |
900039e7dc | ||
![]() |
fad0748b92 | ||
![]() |
6c25411c06 | ||
![]() |
c1d29678f1 | ||
![]() |
4fe6f9f627 | ||
![]() |
694416e327 | ||
![]() |
c1db1a5ff4 | ||
![]() |
8ef86669ca | ||
![]() |
0cd23e0d1e | ||
![]() |
ed3d433676 | ||
![]() |
1258bdf7f0 | ||
![]() |
54e94522b8 | ||
![]() |
8405b63294 | ||
![]() |
e6264f00ad | ||
![]() |
183f580594 | ||
![]() |
70373bde2d | ||
![]() |
67ed1ee680 | ||
![]() |
1f6c88e287 | ||
![]() |
725d7fb2c6 | ||
![]() |
258584cfaf | ||
![]() |
9e3848328d | ||
![]() |
27f3696502 | ||
![]() |
65dc698607 | ||
![]() |
185126415e | ||
![]() |
93f3752b97 | ||
![]() |
cf115791da | ||
![]() |
bc3d86cddb | ||
![]() |
aa9dadccac | ||
![]() |
0ecde45570 | ||
![]() |
ca43c6e1f5 | ||
![]() |
2deaccfe67 | ||
![]() |
a9c73b13c1 | ||
![]() |
d972df307a | ||
![]() |
082bdba4e7 | ||
![]() |
1039803823 | ||
![]() |
acba2a36b3 | ||
![]() |
588a7769c7 | ||
![]() |
08940cd545 | ||
![]() |
196be9284a | ||
![]() |
d61c3d1fca | ||
![]() |
ec1f59150d | ||
![]() |
b996cde193 | ||
![]() |
63465f0070 | ||
![]() |
3300005351 | ||
![]() |
4eb67f3ddc | ||
![]() |
ae270314c7 | ||
![]() |
b9a3e0af07 | ||
![]() |
132bd4bc4f | ||
![]() |
cd8bedb9fa | ||
![]() |
d332aa6ec6 | ||
![]() |
169a02da1e | ||
![]() |
af3a608e7e | ||
![]() |
327dd70690 | ||
![]() |
bcedc2b0f0 | ||
![]() |
6ad10cbec9 | ||
![]() |
b0b1b208f5 | ||
![]() |
6acf5ff1d3 | ||
![]() |
e98f3ba221 | ||
![]() |
32808460cc | ||
![]() |
edf06a0562 | ||
![]() |
5ae4842122 | ||
![]() |
ab6f4bc064 | ||
![]() |
c3ce508135 | ||
![]() |
c6cb24ffbf | ||
![]() |
06c87da410 | ||
![]() |
f7ef265387 | ||
![]() |
6d3f047a85 | ||
![]() |
f43dac169e | ||
![]() |
f10ba15d73 | ||
![]() |
54661cf0b2 | ||
![]() |
50f62fef19 | ||
![]() |
abd20c2057 | ||
![]() |
d1de492330 | ||
![]() |
04ad22d77a | ||
![]() |
a30a30b59a | ||
![]() |
484eb2b0e3 | ||
![]() |
746a65640f | ||
![]() |
50e4d38ce4 | ||
![]() |
1e7ff902f2 | ||
![]() |
dceec28eac | ||
![]() |
95db0aa276 | ||
![]() |
1e6f641052 | ||
![]() |
03ef13889c | ||
![]() |
ab3f129011 | ||
![]() |
ab91919e57 | ||
![]() |
13aaefb70e | ||
![]() |
19a29c92db | ||
![]() |
ffcd26d25b | ||
![]() |
42fd94b514 | ||
![]() |
679df05683 | ||
![]() |
717c3ebfa4 | ||
![]() |
43b094fa03 | ||
![]() |
483f5bccc1 | ||
![]() |
ce17111ed1 | ||
![]() |
a8c8a2f3f4 | ||
![]() |
485372e91c | ||
![]() |
b87fc3526f | ||
![]() |
d165ec179e | ||
![]() |
94541f5f76 | ||
![]() |
5e71f4aa6a | ||
![]() |
1900d023ae | ||
![]() |
2c8a8a114c | ||
![]() |
99ab664ff8 | ||
![]() |
131f2c366e | ||
![]() |
9362282fd1 | ||
![]() |
1f25a3ddb8 | ||
![]() |
e69d8fc619 | ||
![]() |
6197d35a93 | ||
![]() |
8f00ff5ae0 | ||
![]() |
eee1faef75 | ||
![]() |
1ef419447e | ||
![]() |
6752f8ef04 | ||
![]() |
98fdd0baf3 | ||
![]() |
f7cb979766 | ||
![]() |
0fb4a85603 | ||
![]() |
2ef386d0a6 | ||
![]() |
114c0f002a | ||
![]() |
6b6932471e | ||
![]() |
5ac6daf995 | ||
![]() |
763c0d25b1 | ||
![]() |
b1863e3d94 | ||
![]() |
4afccfdc04 | ||
![]() |
a3d45dbcc1 | ||
![]() |
15466db69e | ||
![]() |
27816fb9ef | ||
![]() |
f06d9dced4 | ||
![]() |
26cb351452 | ||
![]() |
762a5878a6 | ||
![]() |
f0af6e705f | ||
![]() |
70b97a89d2 | ||
![]() |
1d1adf5ff4 | ||
![]() |
acfad331ad | ||
![]() |
43f8a422b3 | ||
![]() |
95bd0f3a4b | ||
![]() |
eddf146ada | ||
![]() |
7293372959 | ||
![]() |
2e1226a695 | ||
![]() |
f66d2bf949 | ||
![]() |
4a6ac71742 | ||
![]() |
08337cca05 | ||
![]() |
9c655d2a57 | ||
![]() |
f00f799833 | ||
![]() |
05684cee42 | ||
![]() |
e693af81b7 | ||
![]() |
73ebc4046e | ||
![]() |
1cbd7b08f6 | ||
![]() |
a330aca126 | ||
![]() |
2e7bd0f725 | ||
![]() |
a066b2cedd | ||
![]() |
a18e8d82de | ||
![]() |
441ef87ea8 | ||
![]() |
6e53134f98 | ||
![]() |
237751eb25 | ||
![]() |
264eb0074f | ||
![]() |
7db809a373 | ||
![]() |
0df814cf97 | ||
![]() |
88fa3243dd | ||
![]() |
2a6f2cd848 | ||
![]() |
c001472226 | ||
![]() |
1ec0541ae0 | ||
![]() |
151554e1eb | ||
![]() |
ac91bfe086 | ||
![]() |
bbcf6f5c62 | ||
![]() |
e740506d31 | ||
![]() |
65aac419e5 | ||
![]() |
662714abbe | ||
![]() |
51782e8690 | ||
![]() |
0afb004d3c | ||
![]() |
a9c3b588af | ||
![]() |
f775a92054 | ||
![]() |
cccb06b095 | ||
![]() |
be54d1f104 | ||
![]() |
e84d17c7c9 | ||
![]() |
254fabe758 | ||
![]() |
d1f8eaf3d2 | ||
![]() |
483a02e25f | ||
![]() |
3f06023bd2 | ||
![]() |
ce3a8c983f | ||
![]() |
f5c880cecb | ||
![]() |
2af2c7ecff | ||
![]() |
12aa4220dd | ||
![]() |
e40688ed80 | ||
![]() |
d403242a28 | ||
![]() |
f921a47fae | ||
![]() |
a7fa1c9b2b | ||
![]() |
6ff54eb87b | ||
![]() |
7f2ab5e50f | ||
![]() |
aebb9410c5 | ||
![]() |
459090181f | ||
![]() |
071d7f4e17 | ||
![]() |
620197d1ff | ||
![]() |
73e7fe8e64 | ||
![]() |
973e67e5d2 | ||
![]() |
d89cd16afa | ||
![]() |
7cbceb16ad | ||
![]() |
157dd52700 | ||
![]() |
23614d09d5 | ||
![]() |
bea4894d0c | ||
![]() |
250cf2d4da | ||
![]() |
93d076b4fd | ||
![]() |
8749b83e0b | ||
![]() |
a9b600cf39 | ||
![]() |
c3c8365dbd | ||
![]() |
6432f8826d | ||
![]() |
e04ae11fa0 | ||
![]() |
08fadda68a | ||
![]() |
9473e5a05d | ||
![]() |
8a24ccfee3 | ||
![]() |
3ba55ea4ae | ||
![]() |
265db41540 | ||
![]() |
ed5041143e | ||
![]() |
965f96c5ed | ||
![]() |
3b6aeb148b | ||
![]() |
259bb2555b | ||
![]() |
665b67014f | ||
![]() |
1051c152f9 | ||
![]() |
5a0862af55 | ||
![]() |
6e94e77632 | ||
![]() |
f5bb7b9992 | ||
![]() |
0e9209183a | ||
![]() |
90932a9e3c |
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
*.a
|
||||
*.o
|
||||
*.o.*
|
||||
*.d
|
||||
*.def
|
||||
*.dll
|
||||
@@ -21,8 +20,6 @@
|
||||
*-example
|
||||
*-test
|
||||
*_g
|
||||
\#*
|
||||
.\#*
|
||||
/.config
|
||||
/.version
|
||||
/ffmpeg
|
||||
@@ -31,7 +28,6 @@
|
||||
/ffserver
|
||||
/config.*
|
||||
/coverage.info
|
||||
/avversion.h
|
||||
/doc/*.1
|
||||
/doc/*.3
|
||||
/doc/*.html
|
||||
@@ -40,7 +36,7 @@
|
||||
/doc/avoptions_codec.texi
|
||||
/doc/avoptions_format.texi
|
||||
/doc/doxy/html/
|
||||
/doc/examples/avio_dir_cmd
|
||||
/doc/examples/avio_list_dir
|
||||
/doc/examples/avio_reading
|
||||
/doc/examples/decoding_encoding
|
||||
/doc/examples/demuxing_decoding
|
||||
@@ -64,10 +60,8 @@
|
||||
/libavcodec/*_tables.h
|
||||
/libavutil/avconfig.h
|
||||
/libavutil/ffversion.h
|
||||
/src
|
||||
/tests/audiogen
|
||||
/tests/base64
|
||||
/tests/checkasm/checkasm
|
||||
/tests/data/
|
||||
/tests/pixfmts.mak
|
||||
/tests/rotozoom
|
||||
|
26
.travis.yml
26
.travis.yml
@@ -1,26 +0,0 @@
|
||||
language: c
|
||||
sudo: false
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- yasm
|
||||
- diffutils
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
cache:
|
||||
directories:
|
||||
- ffmpeg-samples
|
||||
before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi
|
||||
install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install yasm; fi
|
||||
script:
|
||||
- mkdir -p ffmpeg-samples
|
||||
- ./configure --samples=ffmpeg-samples --cc=$CC
|
||||
- make -j 8
|
||||
- make fate-rsync
|
||||
- make check -j 8
|
398
Changelog
398
Changelog
@@ -1,119 +1,299 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
version 2.7.5
|
||||
- configure: bump copyright year to 2016
|
||||
- avformat/hls: Even stricter URL checks
|
||||
- avformat/hls: More strict url checks
|
||||
- swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
|
||||
- swscale/yuv2rgb: Increase YUV2RGB table headroom
|
||||
- swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
|
||||
- avformat/hls: forbid all protocols except http(s) & file
|
||||
- avformat/aviobuf: Fix end check in put_str16()
|
||||
- avformat/asfenc: Check pts
|
||||
- avcodec/mpeg4video: Check time_incr
|
||||
- avcodec/wavpackenc: Check the number of channels
|
||||
- avcodec/wavpackenc: Headers are per channel
|
||||
- avcodec/aacdec_template: Check id_map
|
||||
- avcodec/dvdec: Fix "left shift of negative value -254"
|
||||
- avcodec/mjpegdec: Fix negative shift
|
||||
- avcodec/mss2: Check for repeat overflow
|
||||
- avformat: Add integer fps from 31 to 60 to get_std_framerate()
|
||||
- avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
|
||||
- avfilter/vf_scale: set proper out frame color range
|
||||
- avcodec/motion_est: Fix mv_penalty table size
|
||||
- avcodec/h264_slice: Fix integer overflow in implicit weight computation
|
||||
- swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
|
||||
- avcodec/put_bits: Always check buffer end before writing
|
||||
- mjpegdec: extend check for incompatible values of s->rgb and s->ls
|
||||
- swscale/utils: Fix intermediate format for cascaded alpha downscaling
|
||||
- x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
|
||||
- avfilter/vf_zoompan: do not free frame we pushed to lavfi
|
||||
|
||||
|
||||
version 3.0:
|
||||
- Common Encryption (CENC) MP4 encoding and decoding support
|
||||
- DXV decoding
|
||||
- extrastereo filter
|
||||
- ocr filter
|
||||
- alimiter filter
|
||||
- stereowiden filter
|
||||
- stereotools filter
|
||||
- rubberband filter
|
||||
- tremolo filter
|
||||
- agate filter
|
||||
- chromakey filter
|
||||
- maskedmerge filter
|
||||
- Screenpresso SPV1 decoding
|
||||
- chromaprint fingerprinting muxer
|
||||
- ffplay dynamic volume control
|
||||
- displace filter
|
||||
- selectivecolor filter
|
||||
- extensive native AAC encoder improvements and removal of experimental flag
|
||||
- ADPCM PSX decoder
|
||||
- 3dostr, dcstr, fsb, genh, vag, xvag, ads, msf, svag & vpk demuxer
|
||||
- zscale filter
|
||||
- wve demuxer
|
||||
- zero-copy Intel QSV transcoding in ffmpeg
|
||||
- shuffleframes filter
|
||||
- SDX2 DPCM decoder
|
||||
- vibrato filter
|
||||
- innoHeim/Rsupport Screen Capture Codec decoder
|
||||
- ADPCM AICA decoder
|
||||
- Interplay ACM demuxer and audio decoder
|
||||
- XMA1 & XMA2 decoder
|
||||
- realtime filter
|
||||
- anoisesrc audio filter source
|
||||
- IVR demuxer
|
||||
- compensationdelay filter
|
||||
- acompressor filter
|
||||
- support encoding 16-bit RLE SGI images
|
||||
- apulsator filter
|
||||
- sidechaingate audio filter
|
||||
- mipsdspr1 option has been renamed to mipsdsp
|
||||
- aemphasis filter
|
||||
- mips32r5 option has been removed
|
||||
- mips64r6 option has been removed
|
||||
- DXVA2-accelerated VP9 decoding
|
||||
- SOFAlizer: virtual binaural acoustics filter
|
||||
- VAAPI VP9 hwaccel
|
||||
- audio high-order multiband parametric equalizer
|
||||
- automatic bitstream filtering
|
||||
- showspectrumpic filter
|
||||
- libstagefright support removed
|
||||
- spectrumsynth filter
|
||||
- ahistogram filter
|
||||
- only seek with the right mouse button in ffplay
|
||||
- toggle full screen when double-clicking with the left mouse button in ffplay
|
||||
- afftfilt filter
|
||||
- convolution filter
|
||||
- libquvi support removed
|
||||
- support for dvaudio in wav and avi
|
||||
- libaacplus and libvo-aacenc support removed
|
||||
- Cineform HD decoder
|
||||
- new DCA decoder with full support for DTS-HD extensions
|
||||
- significant performance improvements in Windows Television (WTV) demuxer
|
||||
- nnedi deinterlacer
|
||||
- streamselect video and astreamselect audio filter
|
||||
- swaprect filter
|
||||
- metadata video and ametadata audio filter
|
||||
- SMPTE VC-2 HQ profile support for the Dirac decoder
|
||||
- SMPTE VC-2 native encoder supporting the HQ profile
|
||||
version 2.7.4
|
||||
- nuv: sanitize negative fps rate
|
||||
- rawdec: only exempt BIT0 with need_copy from buffer sanity check
|
||||
- mlvdec: check that index_entries exist
|
||||
- nutdec: reject negative value_len in read_sm_data
|
||||
- xwddec: prevent overflow of lsize * avctx->height
|
||||
- nutdec: only copy the header if it exists
|
||||
- exr: fix out of bounds read in get_code
|
||||
- on2avc: limit number of bits to 30 in get_egolomb
|
||||
- avcodec/mpeg4videodec: also for empty partitioned slices
|
||||
- avcodec/h264_refs: Fix long_idx check
|
||||
- avcodec/h264_mc_template: prefetch list1 only if it is used in the MB
|
||||
- avcodec/h264_slice: Simplify ref2frm indexing
|
||||
- Revert "avcodec/aarch64/neon.S: Update neon.s for transpose_4x4H"
|
||||
- avfilter/vf_mpdecimate: Add missing emms_c()
|
||||
- sonic: make sure num_taps * channels is not larger than frame_size
|
||||
- opus_silk: fix typo causing overflow in silk_stabilize_lsf
|
||||
- ffm: reject invalid codec_id and codec_type
|
||||
- golomb: always check for invalid UE golomb codes in get_ue_golomb
|
||||
- aaccoder: prevent crash of anmr coder
|
||||
- ffmdec: reject zero-sized chunks
|
||||
- swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
|
||||
- swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
|
||||
- avformat/mxfenc: Do not crash if there is no packet in the first stream
|
||||
- avcodec/aarch64/neon.S: Update neon.s for transpose_4x4H
|
||||
- avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
|
||||
- avformat/matroskaenc: Check codecdelay before use
|
||||
- avutil/mathematics: Fix division by 0
|
||||
- mjpegdec: consider chroma subsampling in size check
|
||||
- avcodec/hevc: Check max ctb addresses for WPP
|
||||
- avcodec/vp3: ensure header is parsed successfully before tables
|
||||
- avcodec/jpeg2000dec: Check bpno in decode_cblk()
|
||||
- avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
|
||||
- swscale/utils: Fix for runtime error: left shift of negative value -1
|
||||
- avcodec/hevc: Fix integer overflow of entry_point_offset
|
||||
- avcodec/dirac_parser: Check that there is a previous PU before accessing it
|
||||
- avcodec/dirac_parser: Add basic validity checks for next_pu_offset and prev_pu_offset
|
||||
- avcodec/dirac_parser: Fix potential overflows in pointer checks
|
||||
- avcodec/wmaprodec: Check bits per sample to be within the range not causing integer overflows
|
||||
- avcodec/wmaprodec: Fix overflow of cutoff
|
||||
- avformat/smacker: fix integer overflow with pts_inc
|
||||
- avcodec/vp3: Fix "runtime error: left shift of negative value"
|
||||
- mpegencts: Fix overflow in cbr mode period calculations
|
||||
- avutil/timecode: Fix fps check
|
||||
- avutil/mathematics: return INT64_MIN (=AV_NOPTS_VALUE) from av_rescale_rnd() for overflows
|
||||
- avcodec/apedec: Check length in long_filter_high_3800()
|
||||
- avcodec/vp3: always set pix_fmt in theora_decode_header()
|
||||
- avcodec/mpeg4videodec: Check available data before reading custom matrix
|
||||
- avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rnd
|
||||
- avutil/integer: Fix av_mod_i() with negative dividend
|
||||
- avformat/dump: Fix integer overflow in av_dump_format()
|
||||
- avcodec/h264_refs: Check that long references match before use
|
||||
- avcodec/utils: Clear dimensions in ff_get_buffer() on failure
|
||||
- avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
|
||||
- avcodec/vp3: Clear context on reinitialization failure
|
||||
- avcodec/hevc: allocate entries unconditionally
|
||||
- avcodec/hevc_cabac: Fix multiple integer overflows
|
||||
- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
|
||||
- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
|
||||
- avcodec/hevc: Check entry_point_offsets
|
||||
- avcodec/cabac: Check initial cabac decoder state
|
||||
- avcodec/cabac_functions: Fix "left shift of negative value -31767"
|
||||
- avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
|
||||
- avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
|
||||
- avcodec/ffv1dec: Clear quant_table_count if its invalid
|
||||
- avcodec/ffv1dec: Print an error if the quant table count is invalid
|
||||
- doc/filters/drawtext: fix centering example
|
||||
- hqx: correct type and size check of info_offset
|
||||
- mxfdec: check edit_rate also for physical_track
|
||||
- mpegvideo: clear overread in clear_context
|
||||
- dvdsubdec: validate offset2 similar to offset1
|
||||
- aacdec: don't return frames without data from aac_decode_er_frame
|
||||
- avcodec/takdec: Use memove, avoid undefined memcpy() use
|
||||
- riffdec: prevent negative bit rate
|
||||
|
||||
|
||||
version 2.8:
|
||||
- colorkey video filter
|
||||
- BFSTM/BCSTM demuxer
|
||||
- little-endian ADPCM_THP decoder
|
||||
- Hap decoder and encoder
|
||||
- DirectDraw Surface image/texture decoder
|
||||
- ssim filter
|
||||
- optional new ASF demuxer
|
||||
- showvolume filter
|
||||
- Many improvements to the JPEG 2000 decoder
|
||||
- Go2Meeting decoding support
|
||||
- adrawgraph audio and drawgraph video filter
|
||||
- removegrain video filter
|
||||
- Intel QSV-accelerated MPEG-2 video and HEVC encoding
|
||||
- Intel QSV-accelerated MPEG-2 video and HEVC decoding
|
||||
- Intel QSV-accelerated VC-1 video decoding
|
||||
- libkvazaar HEVC encoder
|
||||
- erosion, dilation, deflate and inflate video filters
|
||||
- Dynamic Audio Normalizer as dynaudnorm filter
|
||||
- Reverse video and areverse audio filter
|
||||
- Random filter
|
||||
- deband filter
|
||||
- AAC fixed-point decoding
|
||||
- sidechaincompress audio filter
|
||||
- bitstream filter for converting HEVC from MP4 to Annex B
|
||||
- acrossfade audio filter
|
||||
- allyuv and allrgb video sources
|
||||
- atadenoise video filter
|
||||
- OS X VideoToolbox support
|
||||
- aphasemeter filter
|
||||
- showfreqs filter
|
||||
- vectorscope filter
|
||||
- waveform filter
|
||||
- hstack and vstack filter
|
||||
- Support DNx100 (1440x1080@8)
|
||||
- VAAPI hevc hwaccel
|
||||
- VDPAU hevc hwaccel
|
||||
- framerate filter
|
||||
- Switched default encoders for webm to VP9 and Opus
|
||||
- Removed experimental flag from the JPEG 2000 encoder
|
||||
version 2.7.3:
|
||||
- rtmpcrypt: Do the xtea decryption in little endian mode
|
||||
- Update versions for 2.7.3
|
||||
- avformat/matroskadec: Check subtitle stream before dereferencing
|
||||
- avformat/utils: Do not init parser if probing is unfinished
|
||||
- avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
|
||||
- avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
|
||||
- avcodec/jpeg2000: Check comp coords to be within the supported size
|
||||
- avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
|
||||
- avcodec/wmaprodec: Check for overread in decode_packet()
|
||||
- avcodec/smacker: Check that the data size is a multiple of a sample vector
|
||||
- avcodec/takdec: Skip last p2 sample (which is unused)
|
||||
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()
|
||||
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
|
||||
- avcodec/error_resilience: avoid accessing previous or next frames tables beyond height
|
||||
- avcodec/dpx: Move need_align to act per line
|
||||
- avcodec/flashsv: Check size before updating it
|
||||
- avcodec/ivi: Check image dimensions
|
||||
- avcodec/utils: Better check for channels in av_get_audio_frame_duration()
|
||||
- avcodec/jpeg2000dec: Check for duplicate SIZ marker
|
||||
- tests/fate/avformat: Fix fate-lavf
|
||||
- doc/ffmpeg: Clarify that the sdp_file option requires an rtp output.
|
||||
- ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format.
|
||||
- apng: use correct size for output buffer
|
||||
- jvdec: avoid unsigned overflow in comparison
|
||||
- avcodec/hevc_ps: Check chroma_format_idc
|
||||
- avcodec/jpeg2000dec: Clip all tile coordinates
|
||||
- avcodec/microdvddec: Check for string end in 'P' case
|
||||
- avcodec/dirac_parser: Fix undefined memcpy() use
|
||||
- avformat/xmv: Discard remainder of packet on error
|
||||
- avformat/xmv: factor return check out of if/else
|
||||
- avcodec/mpeg12dec: Do not call show_bits() with invalid bits
|
||||
- libavutil/channel_layout: Check strtol*() for failure
|
||||
- avcodec/ffv1dec: Check for 0 quant tables
|
||||
- avcodec/mjpegdec: Reinitialize IDCT on BPP changes
|
||||
- avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
|
||||
- avutil/file_open: avoid file handle inheritance on Windows
|
||||
- avcodec/h264_slice: Disable slice threads if there are multiple access units in a packet
|
||||
- opusdec: Don't run vector_fmul_scalar on zero length arrays
|
||||
- avcodec/ffv1: Initialize vlc_state on allocation
|
||||
- avcodec/ffv1dec: update progress in case of broken pointer chains
|
||||
- avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
|
||||
- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
|
||||
- avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
|
||||
- avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
|
||||
- avcodec/ffv1dec: Explicitly check read_quant_table() return value
|
||||
- avcodec/rangecoder: Check e
|
||||
- avutil/log: fix zero length gnu_printf format string warning
|
||||
- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
|
||||
- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
|
||||
- avfilter/af_asyncts: use llabs for int64_t
|
||||
- avcodec/g2meet: Also clear tile dimensions on header_fail
|
||||
- avcodec/g2meet: Fix potential overflow in tile dimensions check
|
||||
- avcodec/svq1dec: Check init_get_bits8() for failure
|
||||
- avcodec/tta: Check init_get_bits8() for failure
|
||||
- avcodec/vp3: Check init_get_bits8() for failure
|
||||
- swresample/swresample: Fix integer overflow in seed calculation
|
||||
- avformat/mov: Fix integer overflow in FFABS
|
||||
- avutil/common: Add FFNABS()
|
||||
- avutil/common: Document FFABS() corner case
|
||||
- avformat/dump: Fix integer overflow in aspect ratio calculation
|
||||
- avformat/mxg: Use memmove()
|
||||
- avcodec/truemotion1: Check for even width
|
||||
- avcodec/mpeg12dec: Set dimensions in mpeg1_decode_sequence() only in absence of errors
|
||||
- avcodec/libopusenc: Fix infinite loop on flushing after 0 input
|
||||
- avformat/hevc: Check num_long_term_ref_pics_sps to avoid potentially long loops
|
||||
- avformat/hevc: Fix parsing errors
|
||||
- ffmpeg: Use correct codec_id for av_parser_change() check
|
||||
- ffmpeg: Check av_parser_change() for failure
|
||||
- ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
|
||||
- ffmpeg: check avpicture_fill() return value
|
||||
- avformat/mux: Update sidedata in ff_write_chained()
|
||||
- avcodec/flashsvenc: Correct max dimension in error message
|
||||
- avcodec/svq1enc: Check dimensions
|
||||
- avcodec/dcaenc: clear bitstream end
|
||||
- libavcodec/aacdec_template: Use init_get_bits8() in aac_decode_frame()
|
||||
- rawdec: fix mjpeg probing buffer size check
|
||||
- rawdec: fix mjpeg probing
|
||||
- configure: loongson disable expensive optimizations in gcc O3 optimization
|
||||
- videodsp: don't overread edges in vfix3 emu_edge.
|
||||
- avformat/mp3dec: improve junk skipping heuristic
|
||||
- avformat/hls: add support for EXT-X-MAP
|
||||
- avformat/hls: fix segment selection regression on track changes of live streams
|
||||
- lavf/matroskadec: Fully parse and repack MP3 packets
|
||||
- avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
|
||||
- avformat/oggenc: Check segments_count for headers too
|
||||
- avformat/segment: atomically update list if possible
|
||||
- avformat/avidec: Workaround broken initial frame
|
||||
- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
|
||||
- hevc: fix wpp threading deadlock.
|
||||
- avcodec/ffv1: separate slice_count from max_slice_count
|
||||
- lavf/img2dec: Fix memory leak
|
||||
- avcodec/mp3: fix skipping zeros
|
||||
- avformat/srtdec: make sure we probe a number
|
||||
- avformat/srtdec: more lenient first line probing
|
||||
- doc: mention libavcodec can decode Opus natively
|
||||
- avcodec/ffv1enc: fix assertion failure with unset bits per raw sample
|
||||
- MAINTAINERS: Remove myself as leader
|
||||
- mips/hevcdsp: fix string concatenation on macros
|
||||
|
||||
|
||||
version 2.7.2:
|
||||
- imc: use correct position for flcoeffs2 calculation
|
||||
- hevc: check slice address length
|
||||
- snow: remove an obsolete av_assert2
|
||||
- webp: fix infinite loop in webp_decode_frame
|
||||
- wavpack: limit extra_bits to 32 and use get_bits_long
|
||||
- ffmpeg: only count got_output/errors in decode_error_stat
|
||||
- ffmpeg: exit_on_error if decoding a packet failed
|
||||
- pthread_frame: forward error codes when flushing
|
||||
- huffyuvdec: validate image size
|
||||
- wavpack: use get_bits_long to read up to 32 bits
|
||||
- nutdec: check maxpos in read_sm_data before returning success
|
||||
- s302m: fix arithmetic exception
|
||||
- vc1dec: use get_bits_long and limit the read bits to 32
|
||||
- mpegaudiodec: copy AVFloatDSPContext from first context to all contexts
|
||||
- avcodec/vp8: Check buffer size in vp8_decode_frame_header()
|
||||
- avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()
|
||||
- avcodec/diracdec: Check for hpel_base allocation failure
|
||||
- avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()
|
||||
- avfilter/af_aresample: Check ff_all_* for allocation failures
|
||||
- avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case
|
||||
- swscale/utils: Clear pix buffers
|
||||
- avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()
|
||||
- ffmpeg: Fix cleanup after failed allocation of output_files
|
||||
- avformat/mov: Fix deallocation when MOVStreamContext failed to allocate
|
||||
- ffmpeg: Fix crash with ost->last_frame allocation failure
|
||||
- ffmpeg: Fix cleanup with ost = NULL
|
||||
- avcodec/pthread_frame: check avctx on deallocation
|
||||
- avcodec/sanm: Reset sizes in destroy_buffers()
|
||||
- avcodec/alac: Clear pointers in allocate_buffers()
|
||||
- bytestream2: set the reader to the end when reading more than available
|
||||
- avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
|
||||
- avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()
|
||||
- oggparsedirac: check return value of init_get_bits
|
||||
- wmalosslessdec: reset frame->nb_samples on packet loss
|
||||
- wmalosslessdec: avoid reading 0 bits with get_bits
|
||||
- Put a space between string literals and macros.
|
||||
- avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
|
||||
- avcodec/aacsbr: check that the element type matches before applying SBR
|
||||
- avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
|
||||
- vp9/update_prob: prevent out of bounds table read
|
||||
- avfilter/vf_transpose: Fix rounding error
|
||||
- avcodec/h264_refs: discard mismatching references
|
||||
- avcodec/mjpegdec: Fix small picture upscale
|
||||
- avcodec/pngdec: Check values before updating context in decode_fctl_chunk()
|
||||
- avcodec/pngdec: Copy IHDR & plte state from last thread
|
||||
- avcodec/pngdec: Require a IHDR chunk before fctl
|
||||
- avcodec/pngdec: Only allow one IHDR chunk
|
||||
- wmavoice: limit wmavoice_decode_packet return value to packet size
|
||||
- swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian
|
||||
- ffmpeg: Do not use the data/size of a bitstream filter after failure
|
||||
- swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}
|
||||
- vda: unlock the pixel buffer base address.
|
||||
- swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
|
||||
- swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE
|
||||
- swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
|
||||
- swr: Remember previously set int_sample_format from user
|
||||
- swresample: soxr implementation for swr_get_out_samples()
|
||||
- avformat/swfdec: Do not error out on pixel format changes
|
||||
- ffmpeg_opt: Fix forcing fourccs
|
||||
- configure: Check for x265_api_get
|
||||
- swscale/x86/rgb2rgb_template: don't call emms on sse2/avx functions
|
||||
- swscale/x86/rgb2rgb_template: add missing xmm clobbers
|
||||
- library.mak: Workaround SDL redefining main and breaking fate tests on mingw
|
||||
- vaapi_h264: fix RefPicList[] field flags.
|
||||
|
||||
version 2.7.1:
|
||||
- postproc: fix unaligned access
|
||||
- avformat: clarify what package needs to be compiled with SSL support
|
||||
- avcodec/libx264: Avoid reconfig on equivalent aspect ratios
|
||||
- avcodec/flacenc: Fix Invalid Rice order
|
||||
- tls_gnutls: fix hang on disconnection
|
||||
- avcodec/hevc_ps: Only discard overread VPS if a previous is available
|
||||
- ffmpeg: Free last_frame instead of just unref
|
||||
- avcodec/ffv1enc: fix bps for >8bit yuv when not explicitly set
|
||||
- avio: fix potential crashes when combining ffio_ensure_seekback + crc
|
||||
- examples/demuxing_decoding: use properties from frame instead of video_dec_ctx
|
||||
- h264: er: Copy from the previous reference only if compatible
|
||||
- doc: fix spelling errors
|
||||
- configure: only disable VSX for !ppc64el
|
||||
- ffmpeg_opt: Check for localtime() failure
|
||||
- avformat/singlejpeg: fix standalone compilation
|
||||
- configure: Disable VSX on unspecified / generic CPUs
|
||||
- avformat: Fix bug in parse_rps for HEVC.
|
||||
- takdec: ensure chan2 is a valid channel index
|
||||
- avcodec/h264_slice: Use AVFrame dimensions for grayscale handling
|
||||
|
||||
|
||||
version 2.7:
|
||||
|
@@ -16,7 +16,6 @@ Specifically, the GPL parts of FFmpeg are:
|
||||
- optional x86 optimizations in the files
|
||||
- `libavcodec/x86/flac_dsp_gpl.asm`
|
||||
- `libavcodec/x86/idct_mmx.c`
|
||||
- `libavfilter/x86/vf_removegrain.asm`
|
||||
- libutvideo encoding/decoding wrappers in
|
||||
`libavcodec/libutvideo*.cpp`
|
||||
- the X11 grabber in `libavdevice/x11grab.c`
|
||||
@@ -85,7 +84,6 @@ compatible libraries
|
||||
The following libraries are under GPL:
|
||||
- frei0r
|
||||
- libcdio
|
||||
- librubberband
|
||||
- libutvideo
|
||||
- libvidstab
|
||||
- libx264
|
||||
@@ -104,7 +102,7 @@ license version needs to be upgraded by passing `--enable-version3` to configure
|
||||
incompatible libraries
|
||||
----------------------
|
||||
|
||||
The Fraunhofer AAC library and FAAC are under licenses which
|
||||
The Fraunhofer AAC library, FAAC and aacplus are under licenses which
|
||||
are incompatible with the GPLv2 and v3. We do not know for certain if their
|
||||
licenses are compatible with the LGPL.
|
||||
If you wish to enable these libraries, pass `--enable-nonfree` to configure.
|
||||
|
45
MAINTAINERS
45
MAINTAINERS
@@ -42,7 +42,7 @@ QuickTime faststart:
|
||||
Miscellaneous Areas
|
||||
===================
|
||||
|
||||
documentation Stefano Sabatini, Mike Melanson, Timothy Gu, Lou Logan
|
||||
documentation Stefano Sabatini, Mike Melanson, Timothy Gu
|
||||
build system (configure, makefiles) Diego Biurrun, Mans Rullgard
|
||||
project server Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Lou Logan
|
||||
presets Robert Swain
|
||||
@@ -71,7 +71,6 @@ Internal Interfaces:
|
||||
libavutil/common.h Michael Niedermayer
|
||||
|
||||
Other:
|
||||
aes_ctr.c, aes_ctr.h Eran Kornblau
|
||||
bprint Nicolas George
|
||||
bswap.h
|
||||
des Reimar Doeffinger
|
||||
@@ -138,7 +137,6 @@ Codecs:
|
||||
4xm.c Michael Niedermayer
|
||||
8bps.c Roberto Togni
|
||||
8svx.c Jaikrishnan Menon
|
||||
aacenc*, aaccoder.c Rostislav Pehlivanov
|
||||
aasc.c Kostya Shishkov
|
||||
ac3* Justin Ruggles
|
||||
alacenc.c Jaikrishnan Menon
|
||||
@@ -165,7 +163,6 @@ Codecs:
|
||||
crystalhd.c Philip Langdale
|
||||
cscd.c Reimar Doeffinger
|
||||
dca.c Kostya Shishkov, Benjamin Larsson
|
||||
dirac* Rostislav Pehlivanov
|
||||
dnxhd* Baptiste Coudurier
|
||||
dpcm.c Mike Melanson
|
||||
dss_sp.c Oleksij Rempel, Michael Niedermayer
|
||||
@@ -173,7 +170,6 @@ Codecs:
|
||||
dvbsubdec.c Anshul Maheshwari
|
||||
dxa.c Kostya Shishkov
|
||||
eacmv*, eaidct*, eat* Peter Ross
|
||||
evrc* Paul B Mahol
|
||||
exif.c, exif.h Thilo Borgmann
|
||||
ffv1* Michael Niedermayer
|
||||
ffwavesynth.c Nicolas George
|
||||
@@ -187,7 +183,6 @@ Codecs:
|
||||
h261* Michael Niedermayer
|
||||
h263* Michael Niedermayer
|
||||
h264* Loren Merritt, Michael Niedermayer
|
||||
hap* Tom Butterworth
|
||||
huffyuv* Michael Niedermayer, Christophe Gisquet
|
||||
idcinvideo.c Mike Melanson
|
||||
imc* Benjamin Larsson
|
||||
@@ -204,13 +199,12 @@ Codecs:
|
||||
libcelt_dec.c Nicolas George
|
||||
libdirac* David Conrad
|
||||
libgsm.c Michel Bardiaux
|
||||
libkvazaar.c Arttu Ylä-Outinen
|
||||
libopenjpeg.c Jaikrishnan Menon
|
||||
libopenjpegenc.c Michael Bradshaw
|
||||
libschroedinger* David Conrad
|
||||
libspeexdec.c Justin Ruggles
|
||||
libtheoraenc.c David Conrad
|
||||
libutvideo* Carl Eugen Hoyos
|
||||
libutvideo* Derek Buitenhuis
|
||||
libvorbis.c David Conrad
|
||||
libvpx* James Zern
|
||||
libx264.c Mans Rullgard, Jason Garrett-Glaser
|
||||
@@ -242,7 +236,6 @@ Codecs:
|
||||
qdm2.c, qdm2data.h Roberto Togni, Benjamin Larsson
|
||||
qdrw.c Kostya Shishkov
|
||||
qpeg.c Kostya Shishkov
|
||||
qsv* Ivan Uskov
|
||||
qtrle.c Mike Melanson
|
||||
ra144.c, ra144.h, ra288.c, ra288.h Roberto Togni
|
||||
resample2.c Michael Niedermayer
|
||||
@@ -276,7 +269,6 @@ Codecs:
|
||||
vb.c Kostya Shishkov
|
||||
vble.c Derek Buitenhuis
|
||||
vc1* Kostya Shishkov, Christophe Gisquet
|
||||
vc2* Rostislav Pehlivanov
|
||||
vcr1.c Michael Niedermayer
|
||||
vda_h264_dec.c Xidorn Quan
|
||||
vima.c Paul B Mahol
|
||||
@@ -305,11 +297,11 @@ Codecs:
|
||||
|
||||
Hardware acceleration:
|
||||
crystalhd.c Philip Langdale
|
||||
dxva2* Hendrik Leppkes, Laurent Aimar
|
||||
dxva2* Laurent Aimar
|
||||
libstagefright.cpp Mohamed Naufal
|
||||
vaapi* Gwenole Beauchesne
|
||||
vda* Sebastien Zwickert
|
||||
vdpau* Philip Langdale, Carl Eugen Hoyos
|
||||
videotoolbox* Sebastien Zwickert
|
||||
vdpau* Carl Eugen Hoyos
|
||||
|
||||
|
||||
libavdevice
|
||||
@@ -341,7 +333,6 @@ Generic parts:
|
||||
graphdump.c Nicolas George
|
||||
|
||||
Filters:
|
||||
f_drawgraph.c Paul B Mahol
|
||||
af_adelay.c Paul B Mahol
|
||||
af_aecho.c Paul B Mahol
|
||||
af_afade.c Paul B Mahol
|
||||
@@ -349,26 +340,19 @@ Filters:
|
||||
af_aphaser.c Paul B Mahol
|
||||
af_aresample.c Michael Niedermayer
|
||||
af_astats.c Paul B Mahol
|
||||
af_astreamsync.c Nicolas George
|
||||
af_atempo.c Pavel Koshevoy
|
||||
af_biquads.c Paul B Mahol
|
||||
af_chorus.c Paul B Mahol
|
||||
af_compand.c Paul B Mahol
|
||||
af_ladspa.c Paul B Mahol
|
||||
af_pan.c Nicolas George
|
||||
af_sidechaincompress.c Paul B Mahol
|
||||
af_silenceremove.c Paul B Mahol
|
||||
avf_aphasemeter.c Paul B Mahol
|
||||
avf_avectorscope.c Paul B Mahol
|
||||
avf_showcqt.c Muhammad Faiz
|
||||
vf_blend.c Paul B Mahol
|
||||
vf_chromakey.c Timo Rothenpieler
|
||||
vf_colorchannelmixer.c Paul B Mahol
|
||||
vf_colorbalance.c Paul B Mahol
|
||||
vf_colorkey.c Timo Rothenpieler
|
||||
vf_colorlevels.c Paul B Mahol
|
||||
vf_deband.c Paul B Mahol
|
||||
vf_dejudder.c Nicholas Robbins
|
||||
vf_delogo.c Jean Delvare (CC <jdelvare@suse.com>)
|
||||
vf_delogo.c Jean Delvare (CC <khali@linux-fr.org>)
|
||||
vf_drawbox.c/drawgrid Andrey Utkin
|
||||
vf_extractplanes.c Paul B Mahol
|
||||
vf_histogram.c Paul B Mahol
|
||||
@@ -377,16 +361,12 @@ Filters:
|
||||
vf_il.c Paul B Mahol
|
||||
vf_lenscorrection.c Daniel Oberhoff
|
||||
vf_mergeplanes.c Paul B Mahol
|
||||
vf_neighbor.c Paul B Mahol
|
||||
vf_psnr.c Paul B Mahol
|
||||
vf_random.c Paul B Mahol
|
||||
vf_scale.c Michael Niedermayer
|
||||
vf_separatefields.c Paul B Mahol
|
||||
vf_ssim.c Paul B Mahol
|
||||
vf_stereo3d.c Paul B Mahol
|
||||
vf_telecine.c Paul B Mahol
|
||||
vf_yadif.c Michael Niedermayer
|
||||
vf_zoompan.c Paul B Mahol
|
||||
|
||||
Sources:
|
||||
vsrc_mandelbrot.c Michael Niedermayer
|
||||
@@ -403,7 +383,6 @@ Generic parts:
|
||||
|
||||
Muxers/Demuxers:
|
||||
4xm.c Mike Melanson
|
||||
aadec.c Vesselin Bontchev (vesselin.bontchev at yandex dot com)
|
||||
adtsenc.c Robert Swain
|
||||
afc.c Paul B Mahol
|
||||
aiffdec.c Baptiste Coudurier, Matthieu Bouron
|
||||
@@ -435,7 +414,6 @@ Muxers/Demuxers:
|
||||
gxf.c Reimar Doeffinger
|
||||
gxfenc.c Baptiste Coudurier
|
||||
hls.c Anssi Hannula
|
||||
hls encryption (hlsenc.c) Christian Suloway
|
||||
idcin.c Mike Melanson
|
||||
idroqdec.c Mike Melanson
|
||||
iff.c Jaikrishnan Menon
|
||||
@@ -460,7 +438,6 @@ Muxers/Demuxers:
|
||||
mm.c Peter Ross
|
||||
mov.c Michael Niedermayer, Baptiste Coudurier
|
||||
movenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
movenccenc.c Eran Kornblau
|
||||
mpc.c Kostya Shishkov
|
||||
mpeg.c Michael Niedermayer
|
||||
mpegenc.c Michael Niedermayer
|
||||
@@ -477,7 +454,6 @@ Muxers/Demuxers:
|
||||
oggdec.c, oggdec.h David Conrad
|
||||
oggenc.c Baptiste Coudurier
|
||||
oggparse*.c David Conrad
|
||||
oggparsedaala* Rostislav Pehlivanov
|
||||
oma.c Maxim Poliakovski
|
||||
paf.c Paul B Mahol
|
||||
psxstr.c Mike Melanson
|
||||
@@ -523,7 +499,6 @@ Muxers/Demuxers:
|
||||
wvenc.c Paul B Mahol
|
||||
|
||||
Protocols:
|
||||
async.c Zhang Rui
|
||||
bluray.c Petri Hintukainen
|
||||
ftp.c Lukasz Marek
|
||||
http.c Ronald S. Bultje
|
||||
@@ -559,7 +534,7 @@ Amiga / PowerPC Colin Ward
|
||||
Linux / PowerPC Luca Barbato
|
||||
Windows MinGW Alex Beregszaszi, Ramiro Polla
|
||||
Windows Cygwin Victor Paesa
|
||||
Windows MSVC Matthew Oliver, Hendrik Leppkes
|
||||
Windows MSVC Matthew Oliver
|
||||
Windows ICL Matthew Oliver
|
||||
ADI/Blackfin DSP Marc Hoffman
|
||||
Sparc Roman Shaposhnik
|
||||
@@ -569,11 +544,11 @@ x86 Michael Niedermayer
|
||||
Releases
|
||||
========
|
||||
|
||||
2.8 Michael Niedermayer
|
||||
2.7 Michael Niedermayer
|
||||
2.6 Michael Niedermayer
|
||||
2.5 Michael Niedermayer
|
||||
2.4 Michael Niedermayer
|
||||
2.2 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
@@ -593,7 +568,6 @@ Clément Bœsch 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF
|
||||
Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
|
||||
Diego Biurrun 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5
|
||||
FFmpeg release signing key FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8
|
||||
Ganesh Ajjanagadde C96A 848E 97C3 CEA2 AB72 5CE4 45F9 6A2D 3C36 FB1B
|
||||
Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
|
||||
Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
|
||||
Jean Delvare 7CA6 9F44 60F1 BDC4 1FD2 C858 A552 6B9B B3CD 4E6A
|
||||
@@ -605,7 +579,6 @@ Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
|
||||
Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93
|
||||
Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029
|
||||
Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
|
||||
Philip Langdale 5DC5 8D66 5FBA 3A43 18EC 045E F8D6 B194 6A75 682E
|
||||
Reimar Doeffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
|
||||
Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
|
||||
Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A
|
||||
|
20
Makefile
20
Makefile
@@ -4,7 +4,6 @@ include config.mak
|
||||
vpath %.c $(SRC_PATH)
|
||||
vpath %.cpp $(SRC_PATH)
|
||||
vpath %.h $(SRC_PATH)
|
||||
vpath %.inc $(SRC_PATH)
|
||||
vpath %.m $(SRC_PATH)
|
||||
vpath %.S $(SRC_PATH)
|
||||
vpath %.asm $(SRC_PATH)
|
||||
@@ -32,11 +31,7 @@ $(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_o
|
||||
OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
|
||||
OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
|
||||
OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
|
||||
ifndef CONFIG_VIDEOTOOLBOX
|
||||
OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_videotoolbox.o
|
||||
endif
|
||||
OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
|
||||
OBJS-ffmpeg-$(CONFIG_LIBMFX) += ffmpeg_qsv.o
|
||||
OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_vda.o
|
||||
OBJS-ffserver += ffserver_config.o
|
||||
|
||||
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
|
||||
@@ -65,7 +60,6 @@ include $(SRC_PATH)/common.mak
|
||||
|
||||
FF_EXTRALIBS := $(FFEXTRALIBS)
|
||||
FF_DEP_LIBS := $(DEP_LIBS)
|
||||
FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
|
||||
|
||||
all: $(AVPROGS)
|
||||
|
||||
@@ -86,8 +80,8 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
|
||||
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
|
||||
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
|
||||
ALTIVEC-OBJS MMX-OBJS YASM-OBJS \
|
||||
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
|
||||
MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
|
||||
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MSA-OBJS \
|
||||
LOONGSON3-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
|
||||
|
||||
define RESET
|
||||
$(1) :=
|
||||
@@ -177,15 +171,11 @@ clean::
|
||||
$(RM) $(CLEANSUFFIXES)
|
||||
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
||||
$(RM) -r coverage-html
|
||||
$(RM) -rf coverage.info coverage.info.in lcov
|
||||
$(RM) -rf coverage.info lcov
|
||||
|
||||
distclean::
|
||||
$(RM) $(DISTCLEANSUFFIXES)
|
||||
$(RM) config.* .config libavutil/avconfig.h .version avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h
|
||||
ifeq ($(SRC_LINK),src)
|
||||
$(RM) src
|
||||
endif
|
||||
$(RM) -rf doc/examples/pc-uninstalled
|
||||
$(RM) config.* .config libavutil/avconfig.h .version version.h libavutil/ffversion.h libavcodec/codec_names.h
|
||||
|
||||
config:
|
||||
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
|
||||
|
19
README.md
19
README.md
@@ -16,12 +16,12 @@ such as audio, video, subtitles and related metadata.
|
||||
|
||||
## Tools
|
||||
|
||||
* [ffmpeg](https://ffmpeg.org/ffmpeg.html) is a command line toolbox to
|
||||
* [ffmpeg](http://ffmpeg.org/ffmpeg.html) is a command line toolbox to
|
||||
manipulate, convert and stream multimedia content.
|
||||
* [ffplay](https://ffmpeg.org/ffplay.html) is a minimalistic multimedia player.
|
||||
* [ffprobe](https://ffmpeg.org/ffprobe.html) is a simple analysis tool to inspect
|
||||
* [ffplay](http://ffmpeg.org/ffplay.html) is a minimalistic multimedia player.
|
||||
* [ffprobe](http://ffmpeg.org/ffprobe.html) is a simple analysis tool to inspect
|
||||
multimedia content.
|
||||
* [ffserver](https://ffmpeg.org/ffserver.html) is a multimedia streaming server
|
||||
* [ffserver](http://ffmpeg.org/ffserver.html) is a multimedia streaming server
|
||||
for live broadcasts.
|
||||
* Additional small tools such as `aviocat`, `ismindex` and `qt-faststart`.
|
||||
|
||||
@@ -29,8 +29,8 @@ such as audio, video, subtitles and related metadata.
|
||||
|
||||
The offline documentation is available in the **doc/** directory.
|
||||
|
||||
The online documentation is available in the main [website](https://ffmpeg.org)
|
||||
and in the [wiki](https://trac.ffmpeg.org).
|
||||
The online documentation is available in the main [website](http://ffmpeg.org)
|
||||
and in the [wiki](http://trac.ffmpeg.org).
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -40,10 +40,3 @@ Coding examples are available in the **doc/examples** directory.
|
||||
|
||||
FFmpeg codebase is mainly LGPL-licensed with optional components licensed under
|
||||
GPL. Please refer to the LICENSE file for detailed information.
|
||||
|
||||
## Contributing
|
||||
|
||||
Patches should be submitted to the ffmpeg-devel mailing list using
|
||||
`git format-patch` or `git send-email`. Github pull requests should be
|
||||
avoided because they are not part of our review process. Few developers
|
||||
follow pull requests so they will likely be ignored.
|
||||
|
15
RELEASE_NOTES
Normal file
15
RELEASE_NOTES
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
┌─────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 2.7 "Nash" │
|
||||
└─────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 2.7 "Nash", about 3
|
||||
months after the release of FFmpeg 2.6.
|
||||
|
||||
A complete Changelog is available at the root of the project, and the
|
||||
complete Git history on http://source.ffmpeg.org.
|
||||
|
||||
We hope you will like this release as much as we enjoyed working on it, and
|
||||
as usual, if you have any questions about it, or any FFmpeg related topic,
|
||||
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
|
||||
on the mailing-lists.
|
4
arch.mak
4
arch.mak
@@ -5,10 +5,10 @@ OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
|
||||
OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes)
|
||||
OBJS-$(HAVE_MIPSDSP) += $(MIPSDSP-OBJS) $(MIPSDSP-OBJS-yes)
|
||||
OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS) $(MIPSDSPR1-OBJS-yes)
|
||||
OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS) $(MIPSDSPR2-OBJS-yes)
|
||||
OBJS-$(HAVE_MSA) += $(MSA-OBJS) $(MSA-OBJS-yes)
|
||||
OBJS-$(HAVE_MMI) += $(MMI-OBJS) $(MMI-OBJS-yes)
|
||||
OBJS-$(HAVE_LOONGSON3) += $(LOONGSON3-OBJS) $(LOONGSON3-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
|
||||
OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)
|
||||
|
185
cmdutils.c
185
cmdutils.c
@@ -52,7 +52,6 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/ffversion.h"
|
||||
#include "libavutil/version.h"
|
||||
#include "cmdutils.h"
|
||||
#if CONFIG_NETWORK
|
||||
#include "libavformat/network.h"
|
||||
@@ -64,7 +63,7 @@
|
||||
|
||||
static int init_report(const char *env);
|
||||
|
||||
AVDictionary *sws_dict;
|
||||
struct SwsContext *sws_opts;
|
||||
AVDictionary *swr_opts;
|
||||
AVDictionary *format_opts, *codec_opts, *resample_opts;
|
||||
|
||||
@@ -74,13 +73,20 @@ int hide_banner = 0;
|
||||
|
||||
void init_opts(void)
|
||||
{
|
||||
av_dict_set(&sws_dict, "flags", "bicubic", 0);
|
||||
|
||||
if(CONFIG_SWSCALE)
|
||||
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
void uninit_opts(void)
|
||||
{
|
||||
#if CONFIG_SWSCALE
|
||||
sws_freeContext(sws_opts);
|
||||
sws_opts = NULL;
|
||||
#endif
|
||||
|
||||
av_dict_free(&swr_opts);
|
||||
av_dict_free(&sws_dict);
|
||||
av_dict_free(&format_opts);
|
||||
av_dict_free(&codec_opts);
|
||||
av_dict_free(&resample_opts);
|
||||
@@ -523,7 +529,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit,
|
||||
return o;
|
||||
}
|
||||
|
||||
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0
|
||||
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
|
||||
int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
const AVOption *o;
|
||||
@@ -534,12 +540,7 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
#if CONFIG_AVRESAMPLE
|
||||
const AVClass *rc = avresample_get_class();
|
||||
#endif
|
||||
#if CONFIG_SWSCALE
|
||||
const AVClass *sc = sws_get_class();
|
||||
#endif
|
||||
#if CONFIG_SWRESAMPLE
|
||||
const AVClass *swr_class = swr_get_class();
|
||||
#endif
|
||||
const AVClass *sc, *swr_class;
|
||||
|
||||
if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
|
||||
av_log_set_level(AV_LOG_DEBUG);
|
||||
@@ -563,24 +564,15 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
consumed = 1;
|
||||
}
|
||||
#if CONFIG_SWSCALE
|
||||
if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
struct SwsContext *sws = sws_alloc_context();
|
||||
int ret = av_opt_set(sws, opt, arg, 0);
|
||||
sws_freeContext(sws);
|
||||
if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
|
||||
!strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
|
||||
!strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
sc = sws_get_class();
|
||||
if (!consumed && opt_find(&sc, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
|
||||
// XXX we only support sws_flags, not arbitrary sws options
|
||||
int ret = av_opt_set(sws_opts, opt, arg, 0);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
av_dict_set(&sws_dict, opt, arg, FLAGS);
|
||||
|
||||
consumed = 1;
|
||||
}
|
||||
#else
|
||||
@@ -590,6 +582,7 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
}
|
||||
#endif
|
||||
#if CONFIG_SWRESAMPLE
|
||||
swr_class = swr_get_class();
|
||||
if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
||||
struct SwrContext *swr = swr_alloc();
|
||||
@@ -653,7 +646,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
|
||||
*g = octx->cur_group;
|
||||
g->arg = arg;
|
||||
g->group_def = l->group_def;
|
||||
g->sws_dict = sws_dict;
|
||||
#if CONFIG_SWSCALE
|
||||
g->sws_opts = sws_opts;
|
||||
#endif
|
||||
g->swr_opts = swr_opts;
|
||||
g->codec_opts = codec_opts;
|
||||
g->format_opts = format_opts;
|
||||
@@ -662,7 +657,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
|
||||
codec_opts = NULL;
|
||||
format_opts = NULL;
|
||||
resample_opts = NULL;
|
||||
sws_dict = NULL;
|
||||
#if CONFIG_SWSCALE
|
||||
sws_opts = NULL;
|
||||
#endif
|
||||
swr_opts = NULL;
|
||||
init_opts();
|
||||
|
||||
@@ -718,8 +715,9 @@ void uninit_parse_context(OptionParseContext *octx)
|
||||
av_dict_free(&l->groups[j].codec_opts);
|
||||
av_dict_free(&l->groups[j].format_opts);
|
||||
av_dict_free(&l->groups[j].resample_opts);
|
||||
|
||||
av_dict_free(&l->groups[j].sws_dict);
|
||||
#if CONFIG_SWSCALE
|
||||
sws_freeContext(l->groups[j].sws_opts);
|
||||
#endif
|
||||
av_dict_free(&l->groups[j].swr_opts);
|
||||
}
|
||||
av_freep(&l->groups);
|
||||
@@ -1059,8 +1057,7 @@ static int warned_cfg = 0;
|
||||
LIB##LIBNAME##_VERSION_MAJOR, \
|
||||
LIB##LIBNAME##_VERSION_MINOR, \
|
||||
LIB##LIBNAME##_VERSION_MICRO, \
|
||||
AV_VERSION_MAJOR(version), AV_VERSION_MINOR(version),\
|
||||
AV_VERSION_MICRO(version)); \
|
||||
version >> 16, version >> 8 & 0xff, version & 0xff); \
|
||||
} \
|
||||
if (flags & SHOW_CONFIG) { \
|
||||
const char *cfg = libname##_configuration(); \
|
||||
@@ -1324,47 +1321,16 @@ static void print_codec(const AVCodec *c)
|
||||
printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name,
|
||||
c->long_name ? c->long_name : "");
|
||||
|
||||
printf(" General capabilities: ");
|
||||
if (c->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)
|
||||
printf("horizband ");
|
||||
if (c->capabilities & AV_CODEC_CAP_DR1)
|
||||
printf("dr1 ");
|
||||
if (c->capabilities & AV_CODEC_CAP_TRUNCATED)
|
||||
printf("trunc ");
|
||||
if (c->capabilities & AV_CODEC_CAP_DELAY)
|
||||
printf("delay ");
|
||||
if (c->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME)
|
||||
printf("small ");
|
||||
if (c->capabilities & AV_CODEC_CAP_SUBFRAMES)
|
||||
printf("subframes ");
|
||||
if (c->capabilities & AV_CODEC_CAP_EXPERIMENTAL)
|
||||
printf("exp ");
|
||||
if (c->capabilities & AV_CODEC_CAP_CHANNEL_CONF)
|
||||
printf("chconf ");
|
||||
if (c->capabilities & AV_CODEC_CAP_PARAM_CHANGE)
|
||||
printf("paramchange ");
|
||||
if (c->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
|
||||
printf("variable ");
|
||||
if (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS |
|
||||
AV_CODEC_CAP_AUTO_THREADS))
|
||||
printf("threads ");
|
||||
if (!c->capabilities)
|
||||
printf("none");
|
||||
printf("\n");
|
||||
|
||||
if (c->type == AVMEDIA_TYPE_VIDEO ||
|
||||
c->type == AVMEDIA_TYPE_AUDIO) {
|
||||
printf(" Threading capabilities: ");
|
||||
switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS |
|
||||
AV_CODEC_CAP_AUTO_THREADS)) {
|
||||
case AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
|
||||
case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break;
|
||||
case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break;
|
||||
case AV_CODEC_CAP_AUTO_THREADS : printf("auto"); break;
|
||||
default: printf("none"); break;
|
||||
switch (c->capabilities & (CODEC_CAP_FRAME_THREADS |
|
||||
CODEC_CAP_SLICE_THREADS)) {
|
||||
case CODEC_CAP_FRAME_THREADS |
|
||||
CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
|
||||
case CODEC_CAP_FRAME_THREADS: printf("frame"); break;
|
||||
case CODEC_CAP_SLICE_THREADS: printf("slice"); break;
|
||||
default: printf("no"); break;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
@@ -1423,7 +1389,7 @@ static int compare_codec_desc(const void *a, const void *b)
|
||||
const AVCodecDescriptor * const *da = a;
|
||||
const AVCodecDescriptor * const *db = b;
|
||||
|
||||
return (*da)->type != (*db)->type ? FFDIFFSIGN((*da)->type, (*db)->type) :
|
||||
return (*da)->type != (*db)->type ? (*da)->type - (*db)->type :
|
||||
strcmp((*da)->name, (*db)->name);
|
||||
}
|
||||
|
||||
@@ -1537,11 +1503,11 @@ static void print_codecs(int encoder)
|
||||
|
||||
while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
|
||||
printf(" %c", get_media_type_char(desc->type));
|
||||
printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
|
||||
printf((codec->capabilities & AV_CODEC_CAP_DR1) ? "D" : ".");
|
||||
printf((codec->capabilities & CODEC_CAP_FRAME_THREADS) ? "F" : ".");
|
||||
printf((codec->capabilities & CODEC_CAP_SLICE_THREADS) ? "S" : ".");
|
||||
printf((codec->capabilities & CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
|
||||
printf((codec->capabilities & CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
|
||||
printf((codec->capabilities & CODEC_CAP_DR1) ? "D" : ".");
|
||||
|
||||
printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
|
||||
if (strcmp(codec->name, desc->name))
|
||||
@@ -1615,17 +1581,17 @@ int show_filters(void *optctx, const char *opt, const char *arg)
|
||||
*(descr_cur++) = '>';
|
||||
}
|
||||
pad = i ? filter->outputs : filter->inputs;
|
||||
for (j = 0; pad && avfilter_pad_get_name(pad, j); j++) {
|
||||
for (j = 0; pad && pad[j].name; j++) {
|
||||
if (descr_cur >= descr + sizeof(descr) - 4)
|
||||
break;
|
||||
*(descr_cur++) = get_media_type_char(avfilter_pad_get_type(pad, j));
|
||||
*(descr_cur++) = get_media_type_char(pad[j].type);
|
||||
}
|
||||
if (!j)
|
||||
*(descr_cur++) = ((!i && (filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) ||
|
||||
( i && (filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|';
|
||||
}
|
||||
*descr_cur = 0;
|
||||
printf(" %c%c%c %-17s %-10s %s\n",
|
||||
printf(" %c%c%c %-16s %-10s %s\n",
|
||||
filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.',
|
||||
filter->flags & AVFILTER_FLAG_SLICE_THREADS ? 'S' : '.',
|
||||
filter->process_command ? 'C' : '.',
|
||||
@@ -1909,6 +1875,64 @@ int read_yesno(void)
|
||||
return yesno;
|
||||
}
|
||||
|
||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
||||
{
|
||||
int64_t ret;
|
||||
FILE *f = av_fopen_utf8(filename, "rb");
|
||||
|
||||
if (!f) {
|
||||
ret = AVERROR(errno);
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename,
|
||||
strerror(errno));
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = fseek(f, 0, SEEK_END);
|
||||
if (ret == -1) {
|
||||
ret = AVERROR(errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = ftell(f);
|
||||
if (ret < 0) {
|
||||
ret = AVERROR(errno);
|
||||
goto out;
|
||||
}
|
||||
*size = ret;
|
||||
|
||||
ret = fseek(f, 0, SEEK_SET);
|
||||
if (ret == -1) {
|
||||
ret = AVERROR(errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
*bufptr = av_malloc(*size + 1);
|
||||
if (!*bufptr) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto out;
|
||||
}
|
||||
ret = fread(*bufptr, 1, *size, f);
|
||||
if (ret < *size) {
|
||||
av_free(*bufptr);
|
||||
if (ferror(f)) {
|
||||
ret = AVERROR(errno);
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while reading file '%s': %s\n",
|
||||
filename, strerror(errno));
|
||||
} else
|
||||
ret = AVERROR_EOF;
|
||||
} else {
|
||||
ret = 0;
|
||||
(*bufptr)[(*size)++] = '\0';
|
||||
}
|
||||
|
||||
out:
|
||||
if (ret < 0)
|
||||
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", av_err2str(ret));
|
||||
fclose(f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
FILE *get_preset_file(char *filename, size_t filename_size,
|
||||
const char *preset_name, int is_path,
|
||||
const char *codec_name)
|
||||
@@ -2082,10 +2106,7 @@ double get_rotation(AVStream *st)
|
||||
theta -= 360*floor(theta/360 + 0.9/360);
|
||||
|
||||
if (fabs(theta - 90*round(theta/90)) > 2)
|
||||
av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n"
|
||||
"If you want to help, upload a sample "
|
||||
"of this file to ftp://upload.ffmpeg.org/incoming/ "
|
||||
"and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)");
|
||||
av_log_ask_for_sample(NULL, "Odd rotation angle\n");
|
||||
|
||||
return theta;
|
||||
}
|
||||
|
20
cmdutils.h
20
cmdutils.h
@@ -19,8 +19,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef CMDUTILS_H
|
||||
#define CMDUTILS_H
|
||||
#ifndef FFMPEG_CMDUTILS_H
|
||||
#define FFMPEG_CMDUTILS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -46,7 +46,7 @@ extern const int program_birth_year;
|
||||
|
||||
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
||||
extern AVFormatContext *avformat_opts;
|
||||
extern AVDictionary *sws_dict;
|
||||
extern struct SwsContext *sws_opts;
|
||||
extern AVDictionary *swr_opts;
|
||||
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
|
||||
extern int hide_banner;
|
||||
@@ -277,7 +277,7 @@ typedef struct OptionGroup {
|
||||
AVDictionary *codec_opts;
|
||||
AVDictionary *format_opts;
|
||||
AVDictionary *resample_opts;
|
||||
AVDictionary *sws_dict;
|
||||
struct SwsContext *sws_opts;
|
||||
AVDictionary *swr_opts;
|
||||
} OptionGroup;
|
||||
|
||||
@@ -529,6 +529,18 @@ int show_colors(void *optctx, const char *opt, const char *arg);
|
||||
*/
|
||||
int read_yesno(void);
|
||||
|
||||
/**
|
||||
* Read the file with name filename, and put its content in a newly
|
||||
* allocated 0-terminated buffer.
|
||||
*
|
||||
* @param filename file to read from
|
||||
* @param bufptr location where pointer to buffer is returned
|
||||
* @param size location where size of buffer is returned
|
||||
* @return >= 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR error code in case of failure.
|
||||
*/
|
||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
|
||||
|
||||
/**
|
||||
* Get a file corresponding to a preset file.
|
||||
*
|
||||
|
@@ -206,9 +206,7 @@ end:
|
||||
|
||||
static int compare_ocl_device_desc(const void *a, const void *b)
|
||||
{
|
||||
const OpenCLDeviceBenchmark* va = (const OpenCLDeviceBenchmark*)a;
|
||||
const OpenCLDeviceBenchmark* vb = (const OpenCLDeviceBenchmark*)b;
|
||||
return FFDIFFSIGN(va->runtime , vb->runtime);
|
||||
return ((OpenCLDeviceBenchmark*)a)->runtime - ((OpenCLDeviceBenchmark*)b)->runtime;
|
||||
}
|
||||
|
||||
int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
|
||||
|
24
common.mak
24
common.mak
@@ -18,7 +18,7 @@ ifndef SUBDIR
|
||||
ifndef V
|
||||
Q = @
|
||||
ECHO = printf "$(1)\t%s\n" $(2)
|
||||
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES
|
||||
BRIEF = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES
|
||||
SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
|
||||
|
||||
MSG = $@
|
||||
@@ -32,12 +32,10 @@ endif
|
||||
ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil postproc swscale swresample
|
||||
|
||||
# NASM requires -I path terminated with /
|
||||
IFLAGS := -I. -I$(SRC_LINK)/
|
||||
IFLAGS := -I. -I$(SRC_PATH)/
|
||||
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
|
||||
CFLAGS += $(ECFLAGS)
|
||||
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
|
||||
OBJCFLAGS += $(EOBJCFLAGS)
|
||||
OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
|
||||
ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
|
||||
CXXFLAGS += $(CPPFLAGS) $(CFLAGS)
|
||||
YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
|
||||
@@ -47,13 +45,12 @@ LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
|
||||
|
||||
define COMPILE
|
||||
$(call $(1)DEP,$(1))
|
||||
$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
|
||||
$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
|
||||
endef
|
||||
|
||||
COMPILE_C = $(call COMPILE,CC)
|
||||
COMPILE_CXX = $(call COMPILE,CXX)
|
||||
COMPILE_S = $(call COMPILE,AS)
|
||||
COMPILE_M = $(call COMPILE,OBJCC)
|
||||
COMPILE_HOSTC = $(call COMPILE,HOSTCC)
|
||||
|
||||
%.o: %.c
|
||||
@@ -63,10 +60,10 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
|
||||
$(COMPILE_CXX)
|
||||
|
||||
%.o: %.m
|
||||
$(COMPILE_M)
|
||||
$(COMPILE_C)
|
||||
|
||||
%.s: %.c
|
||||
$(CC) $(CCFLAGS) -S -o $@ $<
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $<
|
||||
|
||||
%.o: %.S
|
||||
$(COMPILE_S)
|
||||
@@ -84,9 +81,7 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
|
||||
$(Q)echo '#include "$*.h"' >$@
|
||||
|
||||
%.ver: %.v
|
||||
$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ | sed -e 's/:/:\
|
||||
/' -e 's/; /;\
|
||||
/g' > $@
|
||||
$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
|
||||
|
||||
%.c %.h: TAG = GEN
|
||||
|
||||
@@ -123,9 +118,8 @@ TOOLOBJS := $(TOOLS:%=tools/%.o)
|
||||
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
|
||||
HEADERS += $(HEADERS-yes)
|
||||
|
||||
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
|
||||
DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
|
||||
STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
|
||||
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
|
||||
DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
|
||||
|
||||
SRC_DIR := $(SRC_PATH)/lib$(NAME)
|
||||
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
||||
@@ -152,7 +146,7 @@ $(TOOLOBJS): | tools
|
||||
|
||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
|
||||
|
||||
CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ver-sol2 *.ho *.gcno *.gcda *$(DEFAULT_YASMD).asm
|
||||
CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda *$(DEFAULT_YASMD).asm
|
||||
DISTCLEANSUFFIXES = *.pc
|
||||
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
|
||||
|
||||
|
@@ -19,8 +19,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_AIX_MATH_H
|
||||
#define COMPAT_AIX_MATH_H
|
||||
#ifndef FFMPEG_COMPAT_AIX_MATH_H
|
||||
#define FFMPEG_COMPAT_AIX_MATH_H
|
||||
|
||||
#define class class_in_math_h_causes_problems
|
||||
|
||||
@@ -28,4 +28,4 @@
|
||||
|
||||
#undef class
|
||||
|
||||
#endif /* COMPAT_AIX_MATH_H */
|
||||
#endif /* FFMPEG_COMPAT_AIX_MATH_H */
|
||||
|
@@ -19,8 +19,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_MSVCRT_SNPRINTF_H
|
||||
#define COMPAT_MSVCRT_SNPRINTF_H
|
||||
#ifndef COMPAT_SNPRINTF_H
|
||||
#define COMPAT_SNPRINTF_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
@@ -35,4 +35,4 @@ int avpriv_vsnprintf(char *s, size_t n, const char *fmt, va_list ap);
|
||||
#define _snprintf avpriv_snprintf
|
||||
#define vsnprintf avpriv_vsnprintf
|
||||
|
||||
#endif /* COMPAT_MSVCRT_SNPRINTF_H */
|
||||
#endif /* COMPAT_SNPRINTF_H */
|
||||
|
@@ -23,8 +23,8 @@
|
||||
* os2threads to pthreads wrapper
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_OS2THREADS_H
|
||||
#define COMPAT_OS2THREADS_H
|
||||
#ifndef AVCODEC_OS2PTHREADS_H
|
||||
#define AVCODEC_OS2PTHREADS_H
|
||||
|
||||
#define INCL_DOS
|
||||
#include <os2.h>
|
||||
@@ -32,18 +32,9 @@
|
||||
#undef __STRICT_ANSI__ /* for _beginthread() */
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sys/builtin.h>
|
||||
#include <sys/fmutex.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
typedef struct {
|
||||
TID tid;
|
||||
void *(*start_routine)(void *);
|
||||
void *arg;
|
||||
void *result;
|
||||
} pthread_t;
|
||||
#include "libavutil/mem.h"
|
||||
|
||||
typedef TID pthread_t;
|
||||
typedef void pthread_attr_t;
|
||||
|
||||
typedef HMTX pthread_mutex_t;
|
||||
@@ -51,52 +42,49 @@ typedef void pthread_mutexattr_t;
|
||||
|
||||
typedef struct {
|
||||
HEV event_sem;
|
||||
HEV ack_sem;
|
||||
volatile unsigned wait_count;
|
||||
int wait_count;
|
||||
} pthread_cond_t;
|
||||
|
||||
typedef void pthread_condattr_t;
|
||||
|
||||
typedef struct {
|
||||
volatile int done;
|
||||
_fmutex mtx;
|
||||
} pthread_once_t;
|
||||
|
||||
#define PTHREAD_ONCE_INIT {0, _FMUTEX_INITIALIZER}
|
||||
struct thread_arg {
|
||||
void *(*start_routine)(void *);
|
||||
void *arg;
|
||||
};
|
||||
|
||||
static void thread_entry(void *arg)
|
||||
{
|
||||
pthread_t *thread = arg;
|
||||
struct thread_arg *thread_arg = arg;
|
||||
|
||||
thread->result = thread->start_routine(thread->arg);
|
||||
thread_arg->start_routine(thread_arg->arg);
|
||||
|
||||
av_free(thread_arg);
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_create(pthread_t *thread,
|
||||
const pthread_attr_t *attr,
|
||||
void *(*start_routine)(void*),
|
||||
void *arg)
|
||||
static av_always_inline int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg)
|
||||
{
|
||||
thread->start_routine = start_routine;
|
||||
thread->arg = arg;
|
||||
thread->result = NULL;
|
||||
struct thread_arg *thread_arg;
|
||||
|
||||
thread->tid = _beginthread(thread_entry, NULL, 1024 * 1024, thread);
|
||||
thread_arg = av_mallocz(sizeof(struct thread_arg));
|
||||
if (!thread_arg)
|
||||
return ENOMEM;
|
||||
|
||||
thread_arg->start_routine = start_routine;
|
||||
thread_arg->arg = arg;
|
||||
|
||||
*thread = _beginthread(thread_entry, NULL, 256 * 1024, thread_arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_join(pthread_t thread, void **value_ptr)
|
||||
{
|
||||
DosWaitThread(&thread.tid, DCWW_WAIT);
|
||||
|
||||
if (value_ptr)
|
||||
*value_ptr = thread.result;
|
||||
DosWaitThread((PTID)&thread, DCWW_WAIT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex,
|
||||
const pthread_mutexattr_t *attr)
|
||||
static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
|
||||
{
|
||||
DosCreateMutexSem(NULL, (PHMTX)mutex, 0, FALSE);
|
||||
|
||||
@@ -124,11 +112,9 @@ static av_always_inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_cond_init(pthread_cond_t *cond,
|
||||
const pthread_condattr_t *attr)
|
||||
static av_always_inline int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
|
||||
{
|
||||
DosCreateEventSem(NULL, &cond->event_sem, DCE_POSTONE, FALSE);
|
||||
DosCreateEventSem(NULL, &cond->ack_sem, DCE_POSTONE, FALSE);
|
||||
|
||||
cond->wait_count = 0;
|
||||
|
||||
@@ -138,16 +124,16 @@ static av_always_inline int pthread_cond_init(pthread_cond_t *cond,
|
||||
static av_always_inline int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
DosCloseEventSem(cond->event_sem);
|
||||
DosCloseEventSem(cond->ack_sem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
if (!__atomic_cmpxchg32(&cond->wait_count, 0, 0)) {
|
||||
if (cond->wait_count > 0) {
|
||||
DosPostEventSem(cond->event_sem);
|
||||
DosWaitEventSem(cond->ack_sem, SEM_INDEFINITE_WAIT);
|
||||
|
||||
cond->wait_count--;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -155,47 +141,26 @@ static av_always_inline int pthread_cond_signal(pthread_cond_t *cond)
|
||||
|
||||
static av_always_inline int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
while (!__atomic_cmpxchg32(&cond->wait_count, 0, 0))
|
||||
pthread_cond_signal(cond);
|
||||
while (cond->wait_count > 0) {
|
||||
DosPostEventSem(cond->event_sem);
|
||||
|
||||
cond->wait_count--;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_cond_wait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex)
|
||||
static av_always_inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
||||
{
|
||||
__atomic_increment(&cond->wait_count);
|
||||
cond->wait_count++;
|
||||
|
||||
pthread_mutex_unlock(mutex);
|
||||
|
||||
DosWaitEventSem(cond->event_sem, SEM_INDEFINITE_WAIT);
|
||||
|
||||
__atomic_decrement(&cond->wait_count);
|
||||
|
||||
DosPostEventSem(cond->ack_sem);
|
||||
|
||||
pthread_mutex_lock(mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_always_inline int pthread_once(pthread_once_t *once_control,
|
||||
void (*init_routine)(void))
|
||||
{
|
||||
if (!once_control->done)
|
||||
{
|
||||
_fmutex_request(&once_control->mtx, 0);
|
||||
|
||||
if (!once_control->done)
|
||||
{
|
||||
init_routine();
|
||||
|
||||
once_control->done = 1;
|
||||
}
|
||||
|
||||
_fmutex_release(&once_control->mtx);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* COMPAT_OS2THREADS_H */
|
||||
#endif /* AVCODEC_OS2PTHREADS_H */
|
||||
|
@@ -1,352 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# make_sunver.pl
|
||||
#
|
||||
# Copyright (C) 2010, 2011, 2012, 2013
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING.GPLv3. If not see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This script takes at least two arguments, a GNU style version script and
|
||||
# a list of object and archive files, and generates a corresponding Sun
|
||||
# style version script as follows:
|
||||
#
|
||||
# Each glob pattern, C++ mangled pattern or literal in the input script is
|
||||
# matched against all global symbols in the input objects, emitting those
|
||||
# that matched (or nothing if no match was found).
|
||||
# A comment with the original pattern and its type is left in the output
|
||||
# file to make it easy to understand the matches.
|
||||
#
|
||||
# It uses elfdump when present (native), GNU readelf otherwise.
|
||||
# It depends on the GNU version of c++filt, since it must understand the
|
||||
# GNU mangling style.
|
||||
|
||||
use FileHandle;
|
||||
use IPC::Open2;
|
||||
|
||||
# Enforce C locale.
|
||||
$ENV{'LC_ALL'} = "C";
|
||||
$ENV{'LANG'} = "C";
|
||||
|
||||
# Input version script, GNU style.
|
||||
my $symvers = shift;
|
||||
|
||||
##########
|
||||
# Get all the symbols from the library, match them, and add them to a hash.
|
||||
|
||||
my %sym_hash = ();
|
||||
|
||||
# List of objects and archives to process.
|
||||
my @OBJECTS = ();
|
||||
|
||||
# List of shared objects to omit from processing.
|
||||
my @SHAREDOBJS = ();
|
||||
|
||||
# Filter out those input archives that have corresponding shared objects to
|
||||
# avoid adding all symbols matched in the archive to the output map.
|
||||
foreach $file (@ARGV) {
|
||||
if (($so = $file) =~ s/\.a$/.so/ && -e $so) {
|
||||
printf STDERR "omitted $file -> $so\n";
|
||||
push (@SHAREDOBJS, $so);
|
||||
} else {
|
||||
push (@OBJECTS, $file);
|
||||
}
|
||||
}
|
||||
|
||||
# We need to detect and ignore hidden symbols. Solaris nm can only detect
|
||||
# this in the harder to parse default output format, and GNU nm not at all,
|
||||
# so use elfdump -s in the native case and GNU readelf -s otherwise.
|
||||
# GNU objdump -t cannot be used since it produces a variable number of
|
||||
# columns.
|
||||
|
||||
# The path to elfdump.
|
||||
my $elfdump = "/usr/ccs/bin/elfdump";
|
||||
|
||||
if (-f $elfdump) {
|
||||
open ELFDUMP,$elfdump.' -s '.(join ' ',@OBJECTS).'|' or die $!;
|
||||
my $skip_arsym = 0;
|
||||
|
||||
while (<ELFDUMP>) {
|
||||
chomp;
|
||||
|
||||
# Ignore empty lines.
|
||||
if (/^$/) {
|
||||
# End of archive symbol table, stop skipping.
|
||||
$skip_arsym = 0 if $skip_arsym;
|
||||
next;
|
||||
}
|
||||
|
||||
# Keep skipping until end of archive symbol table.
|
||||
next if ($skip_arsym);
|
||||
|
||||
# Ignore object name header for individual objects and archives.
|
||||
next if (/:$/);
|
||||
|
||||
# Ignore table header lines.
|
||||
next if (/^Symbol Table Section:/);
|
||||
next if (/index.*value.*size/);
|
||||
|
||||
# Start of archive symbol table: start skipping.
|
||||
if (/^Symbol Table: \(archive/) {
|
||||
$skip_arsym = 1;
|
||||
next;
|
||||
}
|
||||
|
||||
# Split table.
|
||||
(undef, undef, undef, undef, $bind, $oth, undef, $shndx, $name) = split;
|
||||
|
||||
# Error out for unknown input.
|
||||
die "unknown input line:\n$_" unless defined($bind);
|
||||
|
||||
# Ignore local symbols.
|
||||
next if ($bind eq "LOCL");
|
||||
# Ignore hidden symbols.
|
||||
next if ($oth eq "H");
|
||||
# Ignore undefined symbols.
|
||||
next if ($shndx eq "UNDEF");
|
||||
# Error out for unhandled cases.
|
||||
if ($bind !~ /^(GLOB|WEAK)/ or $oth ne "D") {
|
||||
die "unhandled symbol:\n$_";
|
||||
}
|
||||
|
||||
# Remember symbol.
|
||||
$sym_hash{$name}++;
|
||||
}
|
||||
close ELFDUMP or die "$elfdump error";
|
||||
} else {
|
||||
open READELF, 'readelf -s -W '.(join ' ',@OBJECTS).'|' or die $!;
|
||||
# Process each symbol.
|
||||
while (<READELF>) {
|
||||
chomp;
|
||||
|
||||
# Ignore empty lines.
|
||||
next if (/^$/);
|
||||
|
||||
# Ignore object name header.
|
||||
next if (/^File: .*$/);
|
||||
|
||||
# Ignore table header lines.
|
||||
next if (/^Symbol table.*contains.*:/);
|
||||
next if (/Num:.*Value.*Size/);
|
||||
|
||||
# Split table.
|
||||
(undef, undef, undef, undef, $bind, $vis, $ndx, $name) = split;
|
||||
|
||||
# Error out for unknown input.
|
||||
die "unknown input line:\n$_" unless defined($bind);
|
||||
|
||||
# Ignore local symbols.
|
||||
next if ($bind eq "LOCAL");
|
||||
# Ignore hidden symbols.
|
||||
next if ($vis eq "HIDDEN");
|
||||
# Ignore undefined symbols.
|
||||
next if ($ndx eq "UND");
|
||||
# Error out for unhandled cases.
|
||||
if ($bind !~ /^(GLOBAL|WEAK)/ or $vis ne "DEFAULT") {
|
||||
die "unhandled symbol:\n$_";
|
||||
}
|
||||
|
||||
# Remember symbol.
|
||||
$sym_hash{$name}++;
|
||||
}
|
||||
close READELF or die "readelf error";
|
||||
}
|
||||
|
||||
##########
|
||||
# The various types of glob patterns.
|
||||
#
|
||||
# A glob pattern that is to be applied to the demangled name: 'cxx'.
|
||||
# A glob patterns that applies directly to the name in the .o files: 'glob'.
|
||||
# This pattern is ignored; used for local variables (usually just '*'): 'ign'.
|
||||
|
||||
# The type of the current pattern.
|
||||
my $glob = 'glob';
|
||||
|
||||
# We're currently inside `extern "C++"', which Sun ld doesn't understand.
|
||||
my $in_extern = 0;
|
||||
|
||||
# The c++filt command to use. This *must* be GNU c++filt; the Sun Studio
|
||||
# c++filt doesn't handle the GNU mangling style.
|
||||
my $cxxfilt = $ENV{'CXXFILT'} || "c++filt";
|
||||
|
||||
# The current version name.
|
||||
my $current_version = "";
|
||||
|
||||
# Was there any attempt to match a symbol to this version?
|
||||
my $matches_attempted;
|
||||
|
||||
# The number of versions which matched this symbol.
|
||||
my $matched_symbols;
|
||||
|
||||
open F,$symvers or die $!;
|
||||
|
||||
# Print information about generating this file
|
||||
print "# This file was generated by make_sunver.pl. DO NOT EDIT!\n";
|
||||
print "# It was generated by:\n";
|
||||
printf "# %s %s %s\n", $0, $symvers, (join ' ',@ARGV);
|
||||
printf "# Omitted archives with corresponding shared libraries: %s\n",
|
||||
(join ' ', @SHAREDOBJS) if $#SHAREDOBJS >= 0;
|
||||
print "#\n\n";
|
||||
|
||||
print "\$mapfile_version 2\n";
|
||||
|
||||
while (<F>) {
|
||||
# Lines of the form '};'
|
||||
if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) {
|
||||
$glob = 'glob';
|
||||
if ($in_extern) {
|
||||
$in_extern--;
|
||||
print "$1##$2\n";
|
||||
} else {
|
||||
print;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
# Lines of the form '} SOME_VERSION_NAME_1.0;'
|
||||
if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) {
|
||||
$glob = 'glob';
|
||||
# We tried to match symbols agains this version, but none matched.
|
||||
# Emit dummy hidden symbol to avoid marking this version WEAK.
|
||||
if ($matches_attempted && $matched_symbols == 0) {
|
||||
print " hidden:\n";
|
||||
print " .force_WEAK_off_$current_version = DATA S0x0 V0x0;\n";
|
||||
}
|
||||
print; next;
|
||||
}
|
||||
|
||||
# Comment and blank lines
|
||||
if (/^[ \t]*\#/) { print; next; }
|
||||
if (/^[ \t]*$/) { print; next; }
|
||||
|
||||
# Lines of the form '{'
|
||||
if (/^([ \t]*){$/) {
|
||||
if ($in_extern) {
|
||||
print "$1##{\n";
|
||||
} else {
|
||||
print;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
# Lines of the form 'SOME_VERSION_NAME_1.1 {'
|
||||
if (/^([A-Z0-9_.]+)[ \t]+{$/) {
|
||||
# Record version name.
|
||||
$current_version = $1;
|
||||
# Reset match attempts, #matched symbols for this version.
|
||||
$matches_attempted = 0;
|
||||
$matched_symbols = 0;
|
||||
print "SYMBOL_VERSION $1 {\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# Ignore 'global:'
|
||||
if (/^[ \t]*global:$/) { print; next; }
|
||||
|
||||
# After 'local:', globs should be ignored, they won't be exported.
|
||||
if (/^[ \t]*local:$/) {
|
||||
$glob = 'ign';
|
||||
print;
|
||||
next;
|
||||
}
|
||||
|
||||
# After 'extern "C++"', globs are C++ patterns
|
||||
if (/^([ \t]*)(extern \"C\+\+\"[ \t]*)$/) {
|
||||
$in_extern++;
|
||||
$glob = 'cxx';
|
||||
# Need to comment, Sun ld cannot handle this.
|
||||
print "$1##$2\n"; next;
|
||||
}
|
||||
|
||||
# Chomp newline now we're done with passing through the input file.
|
||||
chomp;
|
||||
|
||||
# Catch globs. Note that '{}' is not allowed in globs by this script,
|
||||
# so only '*' and '[]' are available.
|
||||
if (/^([ \t]*)([^ \t;{}#]+);?[ \t]*$/) {
|
||||
my $ws = $1;
|
||||
my $ptn = $2;
|
||||
# Turn the glob into a regex by replacing '*' with '.*', '?' with '.'.
|
||||
# Keep $ptn so we can still print the original form.
|
||||
($pattern = $ptn) =~ s/\*/\.\*/g;
|
||||
$pattern =~ s/\?/\./g;
|
||||
|
||||
if ($glob eq 'ign') {
|
||||
# We're in a local: * section; just continue.
|
||||
print "$_\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# Print the glob commented for human readers.
|
||||
print "$ws##$ptn ($glob)\n";
|
||||
# We tried to match a symbol to this version.
|
||||
$matches_attempted++;
|
||||
|
||||
if ($glob eq 'glob') {
|
||||
my %ptn_syms = ();
|
||||
|
||||
# Match ptn against symbols in %sym_hash.
|
||||
foreach my $sym (keys %sym_hash) {
|
||||
# Maybe it matches one of the patterns based on the symbol in
|
||||
# the .o file.
|
||||
$ptn_syms{$sym}++ if ($sym =~ /^$pattern$/);
|
||||
}
|
||||
|
||||
foreach my $sym (sort keys(%ptn_syms)) {
|
||||
$matched_symbols++;
|
||||
print "$ws$sym;\n";
|
||||
}
|
||||
} elsif ($glob eq 'cxx') {
|
||||
my %dem_syms = ();
|
||||
|
||||
# Verify that we're actually using GNU c++filt. Other versions
|
||||
# most likely cannot handle GNU style symbol mangling.
|
||||
my $cxxout = `$cxxfilt --version 2>&1`;
|
||||
$cxxout =~ m/GNU/ or die "$0 requires GNU c++filt to function";
|
||||
|
||||
# Talk to c++filt through a pair of file descriptors.
|
||||
# Need to start a fresh instance per pattern, otherwise the
|
||||
# process grows to 500+ MB.
|
||||
my $pid = open2(*FILTIN, *FILTOUT, $cxxfilt) or die $!;
|
||||
|
||||
# Match ptn against symbols in %sym_hash.
|
||||
foreach my $sym (keys %sym_hash) {
|
||||
# No? Well, maybe its demangled form matches one of those
|
||||
# patterns.
|
||||
printf FILTOUT "%s\n",$sym;
|
||||
my $dem = <FILTIN>;
|
||||
chomp $dem;
|
||||
$dem_syms{$sym}++ if ($dem =~ /^$pattern$/);
|
||||
}
|
||||
|
||||
close FILTOUT or die "c++filt error";
|
||||
close FILTIN or die "c++filt error";
|
||||
# Need to wait for the c++filt process to avoid lots of zombies.
|
||||
waitpid $pid, 0;
|
||||
|
||||
foreach my $sym (sort keys(%dem_syms)) {
|
||||
$matched_symbols++;
|
||||
print "$ws$sym;\n";
|
||||
}
|
||||
} else {
|
||||
# No? Well, then ignore it.
|
||||
}
|
||||
next;
|
||||
}
|
||||
# Important sanity check. This script can't handle lots of formats
|
||||
# that GNU ld can, so be sure to error out if one is seen!
|
||||
die "strange line `$_'";
|
||||
}
|
||||
close F;
|
@@ -16,8 +16,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_TMS470_MATH_H
|
||||
#define COMPAT_TMS470_MATH_H
|
||||
#ifndef FFMPEG_COMPAT_TMS470_MATH_H
|
||||
#define FFMPEG_COMPAT_TMS470_MATH_H
|
||||
|
||||
#include_next <math.h>
|
||||
|
||||
@@ -27,4 +27,4 @@
|
||||
#define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 }))
|
||||
#define NAN (*(const float*)((const unsigned []){ 0x7fc00000 }))
|
||||
|
||||
#endif /* COMPAT_TMS470_MATH_H */
|
||||
#endif /* FFMPEG_COMPAT_TMS470_MATH_H */
|
||||
|
@@ -19,9 +19,6 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_VA_COPY_H
|
||||
#define COMPAT_VA_COPY_H
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#if !defined(va_copy) && defined(_MSC_VER)
|
||||
@@ -30,5 +27,3 @@
|
||||
#if !defined(va_copy) && defined(__GNUC__) && __GNUC__ < 3
|
||||
#define va_copy(dst, src) __va_copy(dst, src)
|
||||
#endif
|
||||
|
||||
#endif /* COMPAT_VA_COPY_H */
|
||||
|
@@ -26,8 +26,8 @@
|
||||
* w32threads to pthreads wrapper
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_W32PTHREADS_H
|
||||
#define COMPAT_W32PTHREADS_H
|
||||
#ifndef FFMPEG_COMPAT_W32PTHREADS_H
|
||||
#define FFMPEG_COMPAT_W32PTHREADS_H
|
||||
|
||||
/* Build up a pthread-like API using underlying Windows API. Have only static
|
||||
* methods so as to not conflict with a potentially linked in pthread-win32
|
||||
@@ -39,11 +39,6 @@
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#if _WIN32_WINNT < 0x0600 && defined(__MINGW32__)
|
||||
#undef MemoryBarrier
|
||||
#define MemoryBarrier __sync_synchronize
|
||||
#endif
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/internal.h"
|
||||
@@ -87,29 +82,19 @@ static av_unused int pthread_create(pthread_t *thread, const void *unused_attr,
|
||||
{
|
||||
thread->func = start_routine;
|
||||
thread->arg = arg;
|
||||
#if HAVE_WINRT
|
||||
thread->handle = (void*)CreateThread(NULL, 0, win32thread_worker, thread,
|
||||
0, NULL);
|
||||
#else
|
||||
thread->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, thread,
|
||||
0, NULL);
|
||||
#endif
|
||||
return !thread->handle;
|
||||
}
|
||||
|
||||
static av_unused int pthread_join(pthread_t thread, void **value_ptr)
|
||||
static av_unused void pthread_join(pthread_t thread, void **value_ptr)
|
||||
{
|
||||
DWORD ret = WaitForSingleObject(thread.handle, INFINITE);
|
||||
if (ret != WAIT_OBJECT_0) {
|
||||
if (ret == WAIT_ABANDONED)
|
||||
return EINVAL;
|
||||
else
|
||||
return EDEADLK;
|
||||
}
|
||||
if (ret != WAIT_OBJECT_0)
|
||||
return;
|
||||
if (value_ptr)
|
||||
*value_ptr = thread.ret;
|
||||
CloseHandle(thread.handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_init(pthread_mutex_t *m, void* attr)
|
||||
@@ -134,19 +119,6 @@ static inline int pthread_mutex_unlock(pthread_mutex_t *m)
|
||||
}
|
||||
|
||||
#if _WIN32_WINNT >= 0x0600
|
||||
typedef INIT_ONCE pthread_once_t;
|
||||
#define PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT
|
||||
|
||||
static av_unused int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
|
||||
{
|
||||
BOOL pending = FALSE;
|
||||
InitOnceBeginInitialize(once_control, 0, &pending, NULL);
|
||||
if (pending)
|
||||
init_routine();
|
||||
InitOnceComplete(once_control, 0, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
|
||||
{
|
||||
InitializeConditionVariable(cond);
|
||||
@@ -154,15 +126,14 @@ static inline int pthread_cond_init(pthread_cond_t *cond, const void *unused_att
|
||||
}
|
||||
|
||||
/* native condition variables do not destroy */
|
||||
static inline int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
static inline void pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
static inline void pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
WakeAllConditionVariable(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
||||
@@ -171,77 +142,14 @@ static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_signal(pthread_cond_t *cond)
|
||||
static inline void pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
WakeConditionVariable(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else // _WIN32_WINNT < 0x0600
|
||||
|
||||
/* atomic init state of dynamically loaded functions */
|
||||
static LONG w32thread_init_state = 0;
|
||||
static av_unused void w32thread_init(void);
|
||||
|
||||
/* for pre-Windows 6.0 platforms, define INIT_ONCE struct,
|
||||
* compatible to the one used in the native API */
|
||||
|
||||
typedef union pthread_once_t {
|
||||
void * Ptr; ///< For the Windows 6.0+ native functions
|
||||
LONG state; ///< For the pre-Windows 6.0 compat code
|
||||
} pthread_once_t;
|
||||
|
||||
#define PTHREAD_ONCE_INIT {0}
|
||||
|
||||
/* function pointers to init once API on windows 6.0+ kernels */
|
||||
static BOOL (WINAPI *initonce_begin)(pthread_once_t *lpInitOnce, DWORD dwFlags, BOOL *fPending, void **lpContext);
|
||||
static BOOL (WINAPI *initonce_complete)(pthread_once_t *lpInitOnce, DWORD dwFlags, void *lpContext);
|
||||
|
||||
/* pre-Windows 6.0 compat using a spin-lock */
|
||||
static inline void w32thread_once_fallback(LONG volatile *state, void (*init_routine)(void))
|
||||
{
|
||||
switch (InterlockedCompareExchange(state, 1, 0)) {
|
||||
/* Initial run */
|
||||
case 0:
|
||||
init_routine();
|
||||
InterlockedExchange(state, 2);
|
||||
break;
|
||||
/* Another thread is running init */
|
||||
case 1:
|
||||
while (1) {
|
||||
MemoryBarrier();
|
||||
if (*state == 2)
|
||||
break;
|
||||
Sleep(0);
|
||||
}
|
||||
break;
|
||||
/* Initialization complete */
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static av_unused int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
|
||||
{
|
||||
w32thread_once_fallback(&w32thread_init_state, w32thread_init);
|
||||
|
||||
/* Use native functions on Windows 6.0+ */
|
||||
if (initonce_begin && initonce_complete) {
|
||||
BOOL pending = FALSE;
|
||||
initonce_begin(once_control, 0, &pending, NULL);
|
||||
if (pending)
|
||||
init_routine();
|
||||
initonce_complete(once_control, 0, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
w32thread_once_fallback(&once_control->state, init_routine);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* for pre-Windows 6.0 platforms we need to define and use our own condition
|
||||
* variable and api */
|
||||
|
||||
typedef struct win32_cond_t {
|
||||
pthread_mutex_t mtx_broadcast;
|
||||
pthread_mutex_t mtx_waiter_count;
|
||||
@@ -261,9 +169,6 @@ static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
|
||||
{
|
||||
win32_cond_t *win32_cond = NULL;
|
||||
|
||||
w32thread_once_fallback(&w32thread_init_state, w32thread_init);
|
||||
|
||||
if (cond_init) {
|
||||
cond_init(cond);
|
||||
return 0;
|
||||
@@ -286,12 +191,12 @@ static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_unused int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->Ptr;
|
||||
/* native condition variables do not destroy */
|
||||
if (cond_init)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
/* non native condition variables */
|
||||
CloseHandle(win32_cond->semaphore);
|
||||
@@ -300,17 +205,16 @@ static av_unused int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
pthread_mutex_destroy(&win32_cond->mtx_broadcast);
|
||||
av_freep(&win32_cond);
|
||||
cond->Ptr = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_unused int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->Ptr;
|
||||
int have_waiter;
|
||||
|
||||
if (cond_broadcast) {
|
||||
cond_broadcast(cond);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* non native condition variables */
|
||||
@@ -332,7 +236,6 @@ static av_unused int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
} else
|
||||
pthread_mutex_unlock(&win32_cond->mtx_waiter_count);
|
||||
pthread_mutex_unlock(&win32_cond->mtx_broadcast);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
||||
@@ -367,13 +270,13 @@ static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mu
|
||||
return pthread_mutex_lock(mutex);
|
||||
}
|
||||
|
||||
static av_unused int pthread_cond_signal(pthread_cond_t *cond)
|
||||
static av_unused void pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->Ptr;
|
||||
int have_waiter;
|
||||
if (cond_signal) {
|
||||
cond_signal(cond);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&win32_cond->mtx_broadcast);
|
||||
@@ -390,7 +293,6 @@ static av_unused int pthread_cond_signal(pthread_cond_t *cond)
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&win32_cond->mtx_broadcast);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -407,12 +309,8 @@ static av_unused void w32thread_init(void)
|
||||
(void*)GetProcAddress(kernel_dll, "WakeConditionVariable");
|
||||
cond_wait =
|
||||
(void*)GetProcAddress(kernel_dll, "SleepConditionVariableCS");
|
||||
initonce_begin =
|
||||
(void*)GetProcAddress(kernel_dll, "InitOnceBeginInitialize");
|
||||
initonce_complete =
|
||||
(void*)GetProcAddress(kernel_dll, "InitOnceComplete");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif /* COMPAT_W32PTHREADS_H */
|
||||
#endif /* FFMPEG_COMPAT_W32PTHREADS_H */
|
||||
|
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
LINK_EXE_PATH=$(dirname "$(command -v cl)")/link
|
||||
if [ -x "$LINK_EXE_PATH" ]; then
|
||||
"$LINK_EXE_PATH" $@
|
||||
else
|
||||
link $@
|
||||
fi
|
||||
exit $?
|
167
doc/APIchanges
167
doc/APIchanges
@@ -2,156 +2,19 @@ Never assume the API of libav* to be stable unless at least 1 month has passed
|
||||
since the last major version increase or the API was added.
|
||||
|
||||
The last version increases were:
|
||||
libavcodec: 2015-08-28
|
||||
libavdevice: 2015-08-28
|
||||
libavfilter: 2015-08-28
|
||||
libavformat: 2015-08-28
|
||||
libavresample: 2015-08-28
|
||||
libpostproc: 2015-08-28
|
||||
libswresample: 2015-08-28
|
||||
libswscale: 2015-08-28
|
||||
libavutil: 2015-08-28
|
||||
libavcodec: 2014-08-09
|
||||
libavdevice: 2014-08-09
|
||||
libavfilter: 2014-08-09
|
||||
libavformat: 2014-08-09
|
||||
libavresample: 2014-08-09
|
||||
libpostproc: 2014-08-09
|
||||
libswresample: 2014-08-09
|
||||
libswscale: 2014-08-09
|
||||
libavutil: 2014-08-09
|
||||
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
-------- 8< --------- FFmpeg 3.0 was cut here -------- 8< ---------
|
||||
|
||||
2016-02-10 - bc9a596 / 9f61abc - lavf 57.25.100 / 57.3.0 - avformat.h
|
||||
Add AVFormatContext.opaque, io_open and io_close, allowing custom IO
|
||||
|
||||
2016-02-01 - 1dba837 - lavf 57.24.100 - avformat.h, avio.h
|
||||
Add protocol_whitelist to AVFormatContext, AVIOContext
|
||||
|
||||
2016-01-31 - 66e9d2f - lavu 55.17.100 - frame.h
|
||||
Add AV_FRAME_DATA_GOP_TIMECODE for exporting MPEG1/2 GOP timecodes.
|
||||
|
||||
2016-01-01 - 5e8b053 / 2c68113 - lavc 57.21.100 / 57.12.0 - avcodec.h
|
||||
Add AVCodecDescriptor.profiles and avcodec_profile_name().
|
||||
|
||||
2015-12-28 - 1f9139b - lavf 57.21.100 - avformat.h
|
||||
Add automatic bitstream filtering; add av_apply_bitstream_filters()
|
||||
|
||||
2015-12-22 - 39a09e9 - lavfi 6.21.101 - avfilter.h
|
||||
Deprecate avfilter_link_set_closed().
|
||||
Applications are not supposed to mess with links,
|
||||
they should close the sinks.
|
||||
|
||||
2015-12-17 - lavc 57.18.100 / 57.11.0 - avcodec.h dirac.h
|
||||
xxxxxxx - Add av_packet_add_side_data().
|
||||
xxxxxxx - Add AVCodecContext.coded_side_data.
|
||||
xxxxxxx - Add AVCPBProperties API.
|
||||
xxxxxxx - Add a new public header dirac.h containing
|
||||
av_dirac_parse_sequence_header()
|
||||
|
||||
2015-12-11 - 676a93f - lavf 57.20.100 - avformat.h
|
||||
Add av_program_add_stream_index()
|
||||
|
||||
2015-11-29 - 93fb4a4 - lavc 57.16.101 - avcodec.h
|
||||
Deprecate rtp_callback without replacement, i.e. it won't be possible to
|
||||
get image slices before the full frame is encoded any more. The libavformat
|
||||
rtpenc muxer can still be used for RFC-2190 packetization.
|
||||
|
||||
2015-11-22 - fe20e34 - lavc 57.16.100 - avcodec.h
|
||||
Add AV_PKT_DATA_FALLBACK_TRACK for making fallback associations between
|
||||
streams.
|
||||
|
||||
2015-11-22 - ad317c9 - lavf 57.19.100 - avformat.h
|
||||
Add av_stream_new_side_data().
|
||||
|
||||
2015-11-22 - e12f403 - lavu 55.8.100 - xtea.h
|
||||
Add av_xtea_le_init and av_xtea_le_crypt
|
||||
|
||||
2015-11-18 - lavu 55.7.100 - mem.h
|
||||
Add av_fast_mallocz()
|
||||
|
||||
2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h
|
||||
xxxxxx - Deprecate av_free_packet(). Use av_packet_unref() as replacement,
|
||||
it resets the packet in a more consistent way.
|
||||
xxxxxx - Deprecate av_dup_packet(), it is a no-op for most cases.
|
||||
Use av_packet_ref() to make a non-refcounted AVPacket refcounted.
|
||||
xxxxxx - Add av_packet_alloc(), av_packet_clone(), av_packet_free().
|
||||
They match the AVFrame functions with the same name.
|
||||
|
||||
2015-10-27 - 1e477a9 - lavu 55.5.100 - cpu.h
|
||||
Add AV_CPU_FLAG_AESNI.
|
||||
|
||||
2015-10-22 - ee573b4 / a17a766 - lavc 57.9.100 / 57.5.0 - avcodec.h
|
||||
Add data and linesize array to AVSubtitleRect, to be used instead of
|
||||
the ones from the embedded AVPicture.
|
||||
|
||||
2015-10-22 - 866a417 / dc923bc - lavc 57.8.100 / 57.0.0 - qsv.h
|
||||
Add an API for allocating opaque surfaces.
|
||||
|
||||
2015-10-15 - 2c2d162 - lavf 57.4.100
|
||||
Remove the latm demuxer that was a duplicate of the loas demuxer.
|
||||
|
||||
2015-10-14 - b994788 / 11c5f43 - lavu 55.4.100 / 55.2.0 - dict.h
|
||||
Change return type of av_dict_copy() from void to int, so that a proper
|
||||
error code can be reported.
|
||||
|
||||
2015-09-29 - b01891a / 948f3c1 - lavc 57.3.100 / 57.2.0 - avcodec.h
|
||||
Change type of AVPacket.duration from int to int64_t.
|
||||
|
||||
2015-09-17 - 7c46f24 / e3d4784 - lavc 57.3.100 / 57.2.0 - d3d11va.h
|
||||
Add av_d3d11va_alloc_context(). This function must from now on be used for
|
||||
allocating AVD3D11VAContext.
|
||||
|
||||
2015-09-15 - lavf 57.2.100 - avformat.h
|
||||
probesize and max_analyze_duration switched to 64bit, both
|
||||
are only accessible through AVOptions
|
||||
|
||||
2015-09-15 - lavf 57.1.100 - avformat.h
|
||||
bit_rate was changed to 64bit, make sure you update any
|
||||
printf() or other type sensitive code
|
||||
|
||||
2015-09-15 - lavc 57.2.100 - avcodec.h
|
||||
bit_rate/rc_max_rate/rc_min_rate were changed to 64bit, make sure you update
|
||||
any printf() or other type sensitive code
|
||||
|
||||
2015-09-07 - lavu 55.0.100 / 55.0.0
|
||||
c734b34 / b8b5d82 - Change type of AVPixFmtDescriptor.flags from uint8_t to uint64_t.
|
||||
f53569a / 6b3ef7f - Change type of AVComponentDescriptor fields from uint16_t to int
|
||||
and drop bit packing.
|
||||
151aa2e / 2268db2 - Add step, offset, and depth to AVComponentDescriptor to replace
|
||||
the deprecated step_minus1, offset_plus1, and depth_minus1.
|
||||
|
||||
-------- 8< --------- FFmpeg 2.8 was cut here -------- 8< ---------
|
||||
|
||||
2015-08-27 - 1dd854e1 - lavc 56.58.100 - vaapi.h
|
||||
Deprecate old VA-API context (vaapi_context) fields that were only
|
||||
set and used by libavcodec. They are all managed internally now.
|
||||
|
||||
2015-08-19 - 9f8e57ef - lavu 54.31.100 - pixfmt.h
|
||||
Add a unique pixel format for VA-API (AV_PIX_FMT_VAAPI) that
|
||||
indicates the nature of the underlying storage: a VA surface. This
|
||||
yields the same value as AV_PIX_FMT_VAAPI_VLD.
|
||||
Deprecate old VA-API related pixel formats: AV_PIX_FMT_VAAPI_MOCO,
|
||||
AV_PIX_FMT_VAAPI_IDCT, AV_PIX_FMT_VAAPI_VLD.
|
||||
|
||||
2015-08-02 - lavu 54.30.100 / 54.17.0
|
||||
9ed59f1 / 7a7df34c - Add av_blowfish_alloc().
|
||||
a130ec9 / ae365453 - Add av_rc4_alloc().
|
||||
9ca1997 / 5d8bea3b - Add av_xtea_alloc().
|
||||
3cf08e9 / d9e8b47e - Add av_des_alloc().
|
||||
|
||||
2015-07-27 - lavc 56.56.100 / 56.35.0 - avcodec.h
|
||||
94d68a4 / 7c6eb0a1 - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
|
||||
444e987 / def97856 - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
|
||||
29d147c / 059a9348 - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
|
||||
to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.
|
||||
|
||||
2015-07-22 - c40ecff - lavc 56.51.100 - avcodec.h
|
||||
Add AV_PKT_DATA_QUALITY_STATS to export the quality value, PSNR, and pict_type
|
||||
of an AVPacket.
|
||||
|
||||
2015-07-16 - 8dad213 - lavc 56.49.100
|
||||
Add av_codec_get_codec_properties(), FF_CODEC_PROPERTY_LOSSLESS
|
||||
and FF_CODEC_PROPERTY_CLOSED_CAPTIONS
|
||||
|
||||
2015-07-03 - d563e13 / 83212943 - lavu 54.28.100 / 56.15.0
|
||||
Add av_version_info().
|
||||
|
||||
-------- 8< --------- FFmpeg 2.7 was cut here -------- 8< ---------
|
||||
|
||||
2015-06-04 - cc17b43 - lswr 1.2.100
|
||||
@@ -829,9 +692,6 @@ API changes, most recent first:
|
||||
av_ripemd_update()
|
||||
av_ripemd_final()
|
||||
|
||||
2013-06-10 - 82ef670 - lavu 52.35.101 - hmac.h
|
||||
Add AV_HMAC_SHA224, AV_HMAC_SHA256, AV_HMAC_SHA384, AV_HMAC_SHA512
|
||||
|
||||
2013-06-04 - 30b491f / fc962d4 - lavu 52.35.100 / 52.13.0 - mem.h
|
||||
Add av_realloc_array and av_reallocp_array
|
||||
|
||||
@@ -1121,14 +981,15 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
|
||||
Add avresample_set_channel_mapping() for input channel reordering,
|
||||
duplication, and silencing.
|
||||
|
||||
2012-12-29 - lavu 52.13.100 / 52.3.0 - avstring.h
|
||||
2ce43b3 / d8fd06c - Add av_basename() and av_dirname().
|
||||
e13d5e9 / c1a02e8 - Add av_pix_fmt_get_chroma_sub_sample and deprecate
|
||||
avcodec_get_chroma_sub_sample.
|
||||
2012-12-29 - 2ce43b3 / d8fd06c - lavu 52.13.100 / 52.3.0 - avstring.h
|
||||
Add av_basename() and av_dirname().
|
||||
|
||||
2012-11-11 - 03b0787 / 5980f5d - lavu 52.6.100 / 52.2.0 - audioconvert.h
|
||||
Rename audioconvert.h to channel_layout.h. audioconvert.h is now deprecated.
|
||||
|
||||
2012-11-05 - 7d26be6 / dfde8a3 - lavu 52.5.100 / 52.1.0 - intmath.h
|
||||
Add av_ctz() for trailing zero bit count
|
||||
|
||||
2012-10-21 - e3a91c5 / a893655 - lavu 51.77.100 / 51.45.0 - error.h
|
||||
Add AVERROR_EXPERIMENTAL
|
||||
|
||||
|
@@ -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 =
|
||||
PROJECT_NUMBER = 2.7.5
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
@@ -1360,7 +1360,6 @@ PREDEFINED = "__attribute__(x)=" \
|
||||
"offsetof(x,y)=0x42" \
|
||||
av_alloc_size \
|
||||
AV_GCC_VERSION_AT_LEAST(x,y)=1 \
|
||||
AV_GCC_VERSION_AT_MOST(x,y)=0 \
|
||||
__GNUC__=1 \
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||
|
@@ -36,7 +36,7 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES)
|
||||
DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES)
|
||||
DOCS = $(DOCS-yes)
|
||||
|
||||
DOC_EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE) += avio_dir_cmd
|
||||
DOC_EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
|
||||
DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading
|
||||
DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec
|
||||
DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
|
||||
@@ -124,12 +124,11 @@ $(DOCS) doc/doxy/html: | doc/
|
||||
$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
|
||||
OBJDIRS += doc/examples
|
||||
|
||||
DOXY_INPUT = $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c)
|
||||
DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT))
|
||||
DOXY_INPUT = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
|
||||
|
||||
doc/doxy/html: TAG = DOXY
|
||||
doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)
|
||||
$(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT);
|
||||
doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT)
|
||||
$(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXYGEN) $(DOXY_INPUT)
|
||||
|
||||
install-doc: install-html install-man
|
||||
|
||||
|
@@ -9,7 +9,7 @@ V
|
||||
|
||||
DBG
|
||||
Preprocess x86 external assembler files to a .dbg.asm file in the object
|
||||
directory, which then gets compiled. Helps in developing those assembler
|
||||
directory, which then gets compiled. Helps developping those assembler
|
||||
files.
|
||||
|
||||
DESTDIR
|
||||
@@ -25,10 +25,10 @@ all
|
||||
Default target, builds all the libraries and the executables.
|
||||
|
||||
fate
|
||||
Run the fate test suite, note that you must have installed it.
|
||||
Run the fate test suite, note you must have installed it
|
||||
|
||||
fate-list
|
||||
List all fate/regression test targets.
|
||||
Will list all fate/regression test targets
|
||||
|
||||
install
|
||||
Install headers, libraries and programs.
|
||||
@@ -43,22 +43,22 @@ libavcodec/api-example
|
||||
Build the libavcodec basic example.
|
||||
|
||||
libswscale/swscale-test
|
||||
Build the swscale self-test (useful also as an example).
|
||||
Build the swscale self-test (useful also as example).
|
||||
|
||||
config
|
||||
Reconfigure the project with the current configuration.
|
||||
Reconfigure the project with current configuration.
|
||||
|
||||
|
||||
Useful standard make commands:
|
||||
make -t <target>
|
||||
Touch all files that otherwise would be built, this is useful to reduce
|
||||
unneeded rebuilding when changing headers, but note that you must force rebuilds
|
||||
Touch all files that otherwise would be build, this is useful to reduce
|
||||
unneeded rebuilding when changing headers, but note you must force rebuilds
|
||||
of files that actually need it by hand then.
|
||||
|
||||
make -j<num>
|
||||
Rebuild with multiple jobs at the same time. Faster on multi processor systems.
|
||||
rebuild with multiple jobs at the same time. Faster on multi processor systems
|
||||
|
||||
make -k
|
||||
Continue build in case of errors, this is useful for the regression tests
|
||||
sometimes but note that it will still not run all reg tests.
|
||||
continue build in case of errors, this is useful for the regression tests
|
||||
sometimes but note it will still not run all reg tests.
|
||||
|
||||
|
@@ -129,7 +129,7 @@ should be @code{1 / frame_rate} and timestamp increments should be
|
||||
identically 1.
|
||||
|
||||
@item g @var{integer} (@emph{encoding,video})
|
||||
Set the group of picture (GOP) size. Default value is 12.
|
||||
Set the group of picture size. Default value is 12.
|
||||
|
||||
@item ar @var{integer} (@emph{decoding/encoding,audio})
|
||||
Set audio sampling rate (in Hz).
|
||||
@@ -475,9 +475,6 @@ per-block quantization parameter (QP)
|
||||
motion vector
|
||||
@item dct_coeff
|
||||
|
||||
@item green_metadata
|
||||
display complexity metadata for the upcoming frame, GoP or for a given duration.
|
||||
|
||||
@item skip
|
||||
|
||||
@item startcode
|
||||
@@ -817,17 +814,13 @@ for codecs that support it. See also @file{doc/examples/export_mvs.c}.
|
||||
Deprecated, use mpegvideo private options instead.
|
||||
|
||||
@item threads @var{integer} (@emph{decoding/encoding,video})
|
||||
Set the number of threads to be used, in case the selected codec
|
||||
implementation supports multi-threading.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item auto, 0
|
||||
automatically select the number of threads to set
|
||||
@item auto
|
||||
detect a good number of threads
|
||||
@end table
|
||||
|
||||
Default value is @samp{auto}.
|
||||
|
||||
@item me_threshold @var{integer} (@emph{encoding,video})
|
||||
Set motion estimation threshold.
|
||||
|
||||
@@ -1049,11 +1042,7 @@ Possible values:
|
||||
@item color_primaries @var{integer} (@emph{decoding/encoding,video})
|
||||
@item color_trc @var{integer} (@emph{decoding/encoding,video})
|
||||
@item colorspace @var{integer} (@emph{decoding/encoding,video})
|
||||
|
||||
@item color_range @var{integer} (@emph{decoding/encoding,video})
|
||||
If used as input parameter, it serves as a hint to the decoder, which
|
||||
color_range the input has.
|
||||
|
||||
@item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
|
||||
|
||||
@item log_level_offset @var{integer}
|
||||
|
@@ -25,13 +25,6 @@ enabled decoders.
|
||||
A description of some of the currently available video decoders
|
||||
follows.
|
||||
|
||||
@section hevc
|
||||
|
||||
HEVC / H.265 decoder.
|
||||
|
||||
Note: the @option{skip_loop_filter} option has effect only at level
|
||||
@code{all}.
|
||||
|
||||
@section rawvideo
|
||||
|
||||
Raw video decoder.
|
||||
@@ -195,25 +188,6 @@ without this library.
|
||||
@chapter Subtitles Decoders
|
||||
@c man begin SUBTILES DECODERS
|
||||
|
||||
@section dvbsub
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item compute_clut
|
||||
@table @option
|
||||
@item -1
|
||||
Compute clut if no matching CLUT is in the stream.
|
||||
@item 0
|
||||
Never compute CLUT
|
||||
@item 1
|
||||
Always compute CLUT and override the one provided in the stream.
|
||||
@end table
|
||||
@item dvb_substream
|
||||
Selects the dvb substream, or all substreams if -1 which is default.
|
||||
|
||||
@end table
|
||||
|
||||
@section dvdsub
|
||||
|
||||
This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
|
||||
@@ -282,13 +256,7 @@ Sets the display duration of the decoded teletext pages or subtitles in
|
||||
miliseconds. Default value is 30000 which is 30 seconds.
|
||||
@item txt_transparent
|
||||
Force transparent background of the generated teletext bitmaps. Default value
|
||||
is 0 which means an opaque background.
|
||||
@item txt_opacity
|
||||
Sets the opacity (0-255) of the teletext background. If
|
||||
@option{txt_transparent} is not set, it only affects characters between a start
|
||||
box and an end box, typically subtitles. Default value is 0 if
|
||||
@option{txt_transparent} is set, 255 otherwise.
|
||||
|
||||
is 0 which means an opaque (black) background.
|
||||
@end table
|
||||
|
||||
@c man end SUBTILES DECODERS
|
||||
|
@@ -18,12 +18,6 @@ enabled demuxers.
|
||||
|
||||
The description of some of the currently available demuxers follows.
|
||||
|
||||
@section aa
|
||||
|
||||
Audible Format 2, 3, and 4 demuxer.
|
||||
|
||||
This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
|
||||
|
||||
@section applehttp
|
||||
|
||||
Apple HTTP Live Streaming demuxer.
|
||||
@@ -118,47 +112,6 @@ file is not available or accurate.
|
||||
If the duration is set for all files, then it is possible to seek in the
|
||||
whole concatenated video.
|
||||
|
||||
@item @code{inpoint @var{timestamp}}
|
||||
In point of the file. When the demuxer opens the file it instantly seeks to the
|
||||
specified timestamp. Seeking is done so that all streams can be presented
|
||||
successfully at In point.
|
||||
|
||||
This directive works best with intra frame codecs, because for non-intra frame
|
||||
ones you will usually get extra packets before the actual In point and the
|
||||
decoded content will most likely contain frames before In point too.
|
||||
|
||||
For each file, packets before the file In point will have timestamps less than
|
||||
the calculated start timestamp of the file (negative in case of the first
|
||||
file), and the duration of the files (if not specified by the @code{duration}
|
||||
directive) will be reduced based on their specified In point.
|
||||
|
||||
Because of potential packets before the specified In point, packet timestamps
|
||||
may overlap between two concatenated files.
|
||||
|
||||
@item @code{outpoint @var{timestamp}}
|
||||
Out point of the file. When the demuxer reaches the specified decoding
|
||||
timestamp in any of the streams, it handles it as an end of file condition and
|
||||
skips the current and all the remaining packets from all streams.
|
||||
|
||||
Out point is exclusive, which means that the demuxer will not output packets
|
||||
with a decoding timestamp greater or equal to Out point.
|
||||
|
||||
This directive works best with intra frame codecs and formats where all streams
|
||||
are tightly interleaved. For non-intra frame codecs you will usually get
|
||||
additional packets with presentation timestamp after Out point therefore the
|
||||
decoded content will most likely contain frames after Out point too. If your
|
||||
streams are not tightly interleaved you may not get all the packets from all
|
||||
streams before Out point and you may only will be able to decode the earliest
|
||||
stream until Out point.
|
||||
|
||||
The duration of the files (if not specified by the @code{duration}
|
||||
directive) will be reduced based on their specified Out point.
|
||||
|
||||
@item @code{file_packet_metadata @var{key=value}}
|
||||
Metadata of the packets of the file. The specified metadata will be set for
|
||||
each file packet. You can specify this directive multiple times to add multiple
|
||||
metadata entries.
|
||||
|
||||
@item @code{stream}
|
||||
Introduce a stream in the virtual file.
|
||||
All subsequent stream-related directives apply to the last introduced
|
||||
@@ -204,43 +157,8 @@ Currently, the only conversion is adding the h264_mp4toannexb bitstream
|
||||
filter to H.264 streams in MP4 format. This is necessary in particular if
|
||||
there are resolution changes.
|
||||
|
||||
@item segment_time_metadata
|
||||
If set to 1, every packet will contain the @var{lavf.concat.start_time} and the
|
||||
@var{lavf.concat.duration} packet metadata values which are the start_time and
|
||||
the duration of the respective file segments in the concatenated output
|
||||
expressed in microseconds. The duration metadata is only set if it is known
|
||||
based on the concat file.
|
||||
The default is 0.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Use absolute filenames and include some comments:
|
||||
@example
|
||||
# my first filename
|
||||
file /mnt/share/file-1.wav
|
||||
# my second filename including whitespace
|
||||
file '/mnt/share/file 2.wav'
|
||||
# my third filename including whitespace plus single quote
|
||||
file '/mnt/share/file 3'\''.wav'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Allow for input format auto-probing, use safe filenames and set the duration of
|
||||
the first file:
|
||||
@example
|
||||
ffconcat version 1.0
|
||||
|
||||
file file-1.wav
|
||||
duration 20.0
|
||||
|
||||
file subdir/file-2.wav
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section flv
|
||||
|
||||
Adobe Flash Video Format demuxer.
|
||||
@@ -265,6 +183,18 @@ track. Track indexes start at 0. The demuxer exports the number of tracks as
|
||||
|
||||
For very large files, the @option{max_size} option may have to be adjusted.
|
||||
|
||||
@section libquvi
|
||||
|
||||
Play media from Internet services using the quvi project.
|
||||
|
||||
The demuxer accepts a @option{format} option to request a specific quality. It
|
||||
is by default set to @var{best}.
|
||||
|
||||
See @url{http://quvi.sourceforge.net/} for more information.
|
||||
|
||||
FFmpeg needs to be built with @code{--enable-libquvi} for this demuxer to be
|
||||
enabled.
|
||||
|
||||
@section gif
|
||||
|
||||
Animated GIF demuxer.
|
||||
@@ -439,62 +369,17 @@ ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section mov/mp4/3gp/Quicktme
|
||||
|
||||
Quicktime / MP4 demuxer.
|
||||
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
@item enable_drefs
|
||||
Enable loading of external tracks, disabled by default.
|
||||
Enabling this can theoretically leak information in some use cases.
|
||||
|
||||
@item use_absolute_path
|
||||
Allows loading of external tracks via absolute paths, disabled by default.
|
||||
Enabling this poses a security risk. It should only be enabled if the source
|
||||
is known to be non malicious.
|
||||
|
||||
@end table
|
||||
|
||||
@section mpegts
|
||||
|
||||
MPEG-2 transport stream demuxer.
|
||||
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
@item resync_size
|
||||
Set size limit for looking up a new synchronization. Default value is
|
||||
65536.
|
||||
|
||||
@item fix_teletext_pts
|
||||
Override teletext packet PTS and DTS values with the timestamps calculated
|
||||
Overrides teletext packet PTS and DTS values with the timestamps calculated
|
||||
from the PCR of the first program which the teletext stream is part of and is
|
||||
not discarded. Default value is 1, set this option to 0 if you want your
|
||||
teletext packet PTS and DTS values untouched.
|
||||
|
||||
@item ts_packetsize
|
||||
Output option carrying the raw packet size in bytes.
|
||||
Show the detected raw packet size, cannot be set by the user.
|
||||
|
||||
@item scan_all_pmts
|
||||
Scan and combine all PMTs. The value is an integer with value from -1
|
||||
to 1 (-1 means automatic setting, 1 means enabled, 0 means
|
||||
disabled). Default value is -1.
|
||||
@end table
|
||||
|
||||
@section mpjpeg
|
||||
|
||||
MJPEG encapsulated in multi-part MIME demuxer.
|
||||
|
||||
This demuxer allows reading of MJPEG, where each frame is represented as a part of
|
||||
multipart/x-mixed-replace stream.
|
||||
@table @option
|
||||
|
||||
@item strict_mime_boundary
|
||||
Default implementation applies a relaxed standard to multi-part MIME boundary detection,
|
||||
to prevent regression with numerous existing endpoints not generating a proper MIME
|
||||
MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
|
||||
of the boundary value.
|
||||
@end table
|
||||
|
||||
@section rawvideo
|
||||
|
@@ -28,14 +28,14 @@ this document.
|
||||
|
||||
For more detailed legal information about the use of FFmpeg in
|
||||
external programs read the @file{LICENSE} file in the source tree and
|
||||
consult @url{https://ffmpeg.org/legal.html}.
|
||||
consult @url{http://ffmpeg.org/legal.html}.
|
||||
|
||||
@section Contributing
|
||||
|
||||
There are 3 ways by which code gets into FFmpeg.
|
||||
There are 3 ways by which code gets into ffmpeg.
|
||||
@itemize @bullet
|
||||
@item Submitting patches to the main developer mailing list.
|
||||
See @ref{Submitting patches} for details.
|
||||
@item Submitting Patches to the main developer mailing list
|
||||
see @ref{Submitting patches} for details.
|
||||
@item Directly committing changes to the main tree.
|
||||
@item Committing changes to a git clone, for example on github.com or
|
||||
gitorious.org. And asking us to merge these changes.
|
||||
@@ -65,9 +65,6 @@ rejected by the git repository.
|
||||
@item
|
||||
You should try to limit your code lines to 80 characters; however, do so if
|
||||
and only if this improves readability.
|
||||
|
||||
@item
|
||||
K&R coding style is used.
|
||||
@end itemize
|
||||
The presentation is one inspired by 'indent -i4 -kr -nut'.
|
||||
|
||||
@@ -127,10 +124,10 @@ the @samp{inline} keyword;
|
||||
@samp{//} comments;
|
||||
|
||||
@item
|
||||
designated struct initializers (@samp{struct s x = @{ .i = 17 @};});
|
||||
designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
|
||||
|
||||
@item
|
||||
compound literals (@samp{x = (struct s) @{ 17, 23 @};}).
|
||||
compound literals (@samp{x = (struct s) @{ 17, 23 @};})
|
||||
@end itemize
|
||||
|
||||
These features are supported by all compilers we care about, so we will not
|
||||
@@ -159,7 +156,7 @@ GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
|
||||
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
|
||||
for example structs and enums; they should always be in CamelCase.
|
||||
for example structs and enums; they should always be in the CamelCase
|
||||
|
||||
There are the following conventions for naming variables and functions:
|
||||
|
||||
@@ -397,8 +394,8 @@ or obfuscates the code.
|
||||
Make sure that no parts of the codebase that you maintain are missing from the
|
||||
@file{MAINTAINERS} file. If something that you want to maintain is missing add it with
|
||||
your name after it.
|
||||
If at some point you no longer want to maintain some code, then please help in
|
||||
finding a new maintainer and also don't forget to update the @file{MAINTAINERS} file.
|
||||
If at some point you no longer want to maintain some code, then please help
|
||||
finding a new maintainer and also don't forget updating the @file{MAINTAINERS} file.
|
||||
@end enumerate
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
@@ -410,7 +407,7 @@ First, read the @ref{Coding Rules} above if you did not yet, in particular
|
||||
the rules regarding patch submission.
|
||||
|
||||
When you submit your patch, please use @code{git format-patch} or
|
||||
@code{git send-email}. We cannot read other diffs :-).
|
||||
@code{git send-email}. We cannot read other diffs :-)
|
||||
|
||||
Also please do not submit a patch which contains several unrelated changes.
|
||||
Split it into separate, self-contained pieces. This does not mean splitting
|
||||
@@ -433,7 +430,7 @@ 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{https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel, ffmpeg-devel}
|
||||
@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
|
||||
@@ -546,10 +543,6 @@ tools/trasher, the noise bitstream filter, and
|
||||
should not crash, end in a (near) infinite loop, or allocate ridiculous
|
||||
amounts of memory when fed damaged data.
|
||||
|
||||
@item
|
||||
Did you test your decoder or demuxer against sample files?
|
||||
Samples may be obtained at @url{https://samples.ffmpeg.org}.
|
||||
|
||||
@item
|
||||
Does the patch not mix functional and cosmetic changes?
|
||||
|
||||
@@ -570,7 +563,7 @@ If the patch fixes a bug, did you provide a verbose analysis of the bug?
|
||||
If the patch fixes a bug, did you provide enough information, including
|
||||
a sample, so the bug can be reproduced and the fix can be verified?
|
||||
Note please do not attach samples >100k to mails but rather provide a
|
||||
URL, you can upload to ftp://upload.ffmpeg.org.
|
||||
URL, you can upload to ftp://upload.ffmpeg.org
|
||||
|
||||
@item
|
||||
Did you provide a verbose summary about what the patch does change?
|
||||
@@ -599,10 +592,10 @@ Lines with similar content should be aligned vertically when doing so
|
||||
improves readability.
|
||||
|
||||
@item
|
||||
Consider adding a regression test for your code.
|
||||
Consider to add a regression test for your code.
|
||||
|
||||
@item
|
||||
If you added YASM code please check that things still work with --disable-yasm.
|
||||
If you added YASM code please check that things still work with --disable-yasm
|
||||
|
||||
@item
|
||||
Make sure you check the return values of function and return appropriate
|
||||
@@ -640,10 +633,6 @@ not related to the comments received during review. Such patches will
|
||||
be rejected. Instead, submit significant changes or new features as
|
||||
separate patches.
|
||||
|
||||
Everyone is welcome to review patches. Also if you are waiting for your patch
|
||||
to be reviewed, please consider helping to review other patches, that is a great
|
||||
way to get everyone's patches reviewed sooner.
|
||||
|
||||
@anchor{Regression tests}
|
||||
@section Regression tests
|
||||
|
||||
@@ -667,6 +656,7 @@ Once you have a working fate test and fate sample, provide in the commit
|
||||
message or introductory message for the patch series that you post to
|
||||
the ffmpeg-devel mailing list, a direct link to download the sample media.
|
||||
|
||||
|
||||
@subsection Visualizing Test Coverage
|
||||
|
||||
The FFmpeg build system allows visualizing the test coverage in an easy
|
||||
@@ -714,7 +704,7 @@ FFmpeg maintains a set of @strong{release branches}, which are the
|
||||
recommended deliverable for system integrators and distributors (such as
|
||||
Linux distributions, etc.). At regular times, a @strong{release
|
||||
manager} prepares, tests and publishes tarballs on the
|
||||
@url{https://ffmpeg.org} website.
|
||||
@url{http://ffmpeg.org} website.
|
||||
|
||||
There are two kinds of releases:
|
||||
|
||||
@@ -793,7 +783,7 @@ Prepare the release tarballs in @code{bz2} and @code{gz} formats, and
|
||||
supplementing files that contain @code{gpg} signatures
|
||||
|
||||
@item
|
||||
Publish the tarballs at @url{https://ffmpeg.org/releases}. Create and
|
||||
Publish the tarballs at @url{http://ffmpeg.org/releases}. Create and
|
||||
push an annotated tag in the form @code{nX}, with @code{X}
|
||||
containing the version number.
|
||||
|
||||
@@ -805,7 +795,7 @@ with a news entry for the website.
|
||||
Publish the news entry.
|
||||
|
||||
@item
|
||||
Send an announcement to the mailing list.
|
||||
Send announcement to the mailing list.
|
||||
@end enumerate
|
||||
|
||||
@bye
|
||||
|
@@ -1,21 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
OUT_DIR="${1}"
|
||||
SRC_PATH="${1}"
|
||||
DOXYFILE="${2}"
|
||||
DOXYGEN="${3}"
|
||||
|
||||
shift 3
|
||||
|
||||
if [ -e "VERSION" ]; then
|
||||
VERSION=`cat "VERSION"`
|
||||
if [ -e "$SRC_PATH/VERSION" ]; then
|
||||
VERSION=`cat "$SRC_PATH/VERSION"`
|
||||
else
|
||||
VERSION=`git describe`
|
||||
VERSION=`cd "$SRC_PATH"; git describe`
|
||||
fi
|
||||
|
||||
$DOXYGEN - <<EOF
|
||||
@INCLUDE = ${DOXYFILE}
|
||||
INPUT = $@
|
||||
EXAMPLE_PATH = ${SRC_PATH}/doc/examples
|
||||
HTML_TIMESTAMP = NO
|
||||
PROJECT_NUMBER = $VERSION
|
||||
OUTPUT_DIRECTORY = $OUT_DIR
|
||||
EOF
|
||||
|
@@ -30,119 +30,81 @@ follows.
|
||||
|
||||
Advanced Audio Coding (AAC) encoder.
|
||||
|
||||
This encoder is the default AAC encoder, natively implemented into FFmpeg. Its
|
||||
quality is on par or better than libfdk_aac at the default bitrate of 128kbps.
|
||||
This encoder also implements more options, profiles and samplerates than
|
||||
other encoders (with only the AAC-HE profile pending to be implemented) so this
|
||||
encoder has become the default and is the recommended choice.
|
||||
This encoder is an experimental FFmpeg-native AAC encoder. Currently only the
|
||||
low complexity (AAC-LC) profile is supported. To use this encoder, you must set
|
||||
@option{strict} option to @samp{experimental} or lower.
|
||||
|
||||
As this encoder is experimental, unexpected behavior may exist from time to
|
||||
time. For a more stable AAC encoder, see @ref{libvo-aacenc}. However, be warned
|
||||
that it has a worse quality reported by some users.
|
||||
|
||||
@c todo @ref{libaacplus}
|
||||
See also @ref{libfdk-aac-enc,,libfdk_aac} and @ref{libfaac}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item b
|
||||
Set bit rate in bits/s. Setting this automatically activates constant bit rate
|
||||
(CBR) mode. If this option is unspecified it is set to 128kbps.
|
||||
(CBR) mode.
|
||||
|
||||
@item q
|
||||
Set quality for variable bit rate (VBR) mode. This option is valid only using
|
||||
the @command{ffmpeg} command-line tool. For library interface users, use
|
||||
@option{global_quality}.
|
||||
|
||||
@item cutoff
|
||||
Set cutoff frequency. If unspecified will allow the encoder to dynamically
|
||||
adjust the cutoff to improve clarity on low bitrates.
|
||||
@item stereo_mode
|
||||
Set stereo encoding mode. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item auto
|
||||
Automatically selected by the encoder.
|
||||
|
||||
@item ms_off
|
||||
Disable middle/side encoding. This is the default.
|
||||
|
||||
@item ms_force
|
||||
Force middle/side encoding.
|
||||
@end table
|
||||
|
||||
@item aac_coder
|
||||
Set AAC encoder coding method. Possible values:
|
||||
|
||||
@table @samp
|
||||
@item faac
|
||||
FAAC-inspired method.
|
||||
|
||||
This method is a simplified reimplementation of the method used in FAAC, which
|
||||
sets thresholds proportional to the band energies, and then decreases all the
|
||||
thresholds with quantizer steps to find the appropriate quantization with
|
||||
distortion below threshold band by band.
|
||||
|
||||
The quality of this method is comparable to the two loop searching method
|
||||
described below, but somewhat a little better and slower.
|
||||
|
||||
@item anmr
|
||||
Average noise to mask ratio (ANMR) trellis-based solution.
|
||||
|
||||
This has a theoretic best quality out of all the coding methods, but at the
|
||||
cost of the slowest speed.
|
||||
|
||||
@item twoloop
|
||||
Two loop searching (TLS) method.
|
||||
|
||||
This method first sets quantizers depending on band thresholds and then tries
|
||||
to find an optimal combination by adding or subtracting a specific value from
|
||||
all quantizers and adjusting some individual quantizer a little.
|
||||
Will tune itself based on whether aac_is/aac_ms/aac_pns are enabled.
|
||||
This is the default choice for a coder.
|
||||
|
||||
@item anmr
|
||||
Average noise to mask ratio (ANMR) trellis-based solution.
|
||||
|
||||
This is an experimental coder which currently produces a lower quality, is more
|
||||
unstable and is slower than the default twoloop coder but has potential.
|
||||
Currently has no support for the @option{aac_is} or @option{aac_pns} options.
|
||||
Not currently recommended.
|
||||
This method produces similar quality with the FAAC method and is the default.
|
||||
|
||||
@item fast
|
||||
Constant quantizer method.
|
||||
|
||||
This method sets a constant quantizer for all bands. This is the fastest of all
|
||||
the methods and has no rate control or support for @option{aac_is} or
|
||||
@option{aac_pns}.
|
||||
Not recommended.
|
||||
the methods, yet produces the worst quality.
|
||||
|
||||
@end table
|
||||
|
||||
@item aac_ms
|
||||
Sets mid/side coding mode. The default value of auto will automatically use
|
||||
M/S with bands which will benefit from such coding. Can be forced for all bands
|
||||
using the value "enable", which is mainly useful for debugging or disabled using
|
||||
"disable".
|
||||
|
||||
@item aac_is
|
||||
Sets intensity stereo coding tool usage. By default, it's enabled and will
|
||||
automatically toggle IS for similar pairs of stereo bands if it's benefitial.
|
||||
Can be disabled for debugging by setting the value to "disable".
|
||||
|
||||
@item aac_pns
|
||||
Uses perceptual noise substitution to replace low entropy high frequency bands
|
||||
with imperceivable white noise during the decoding process. By default, it's
|
||||
enabled, but can be disabled for debugging purposes by using "disable".
|
||||
|
||||
@item aac_tns
|
||||
Enables the use of a multitap FIR filter which spans through the high frequency
|
||||
bands to hide quantization noise during the encoding process and is reverted
|
||||
by the decoder. As well as decreasing unpleasant artifacts in the high range
|
||||
this also reduces the entropy in the high bands and allows for more bits to
|
||||
be used by the mid-low bands. By default it's enabled but can be disabled for
|
||||
debugging by setting the option to "disable".
|
||||
|
||||
@item aac_ltp
|
||||
Enables the use of the long term prediction extension which increases coding
|
||||
efficiency in very low bandwidth situations such as encoding of voice or
|
||||
solo piano music by extending constant harmonic peaks in bands throughout
|
||||
frames. This option is implied by profile:a aac_low and is incompatible with
|
||||
aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
|
||||
|
||||
@item aac_pred
|
||||
Enables the use of a more traditional style of prediction where the spectral
|
||||
coefficients transmitted are replaced by the difference of the current
|
||||
coefficients minus the previous "predicted" coefficients. In theory and sometimes
|
||||
in practice this can improve quality for low to mid bitrate audio.
|
||||
This option implies the aac_main profile and is incompatible with aac_ltp.
|
||||
|
||||
@item profile
|
||||
Sets the encoding profile, possible values:
|
||||
|
||||
@table @samp
|
||||
@item aac_low
|
||||
The default, AAC "Low-complexity" profile. Is the most compatible and produces
|
||||
decent quality.
|
||||
|
||||
@item mpeg2_aac_low
|
||||
Equivalent to -profile:a aac_low -aac_pns 0. PNS was introduced with the MPEG4
|
||||
specifications.
|
||||
|
||||
@item aac_ltp
|
||||
Long term prediction profile, is enabled by and will enable the aac_ltp option.
|
||||
Introduced in MPEG4.
|
||||
|
||||
@item aac_main
|
||||
Main-type prediction profile, is enabled by and will enable the aac_pred option.
|
||||
Introduced in MPEG2.
|
||||
|
||||
If this option is unspecified it is set to @samp{aac_low}.
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@section ac3 and ac3_fixed
|
||||
@@ -616,14 +578,16 @@ and slightly improves compression.
|
||||
|
||||
libfaac AAC (Advanced Audio Coding) encoder wrapper.
|
||||
|
||||
This encoder is of much lower quality and is more unstable than any other AAC
|
||||
encoders, so it's highly recommended to instead use other encoders, like
|
||||
@ref{aacenc,,the native FFmpeg AAC encoder}.
|
||||
|
||||
This encoder also requires the presence of the libfaac headers and library
|
||||
during configuration. You need to explicitly configure the build with
|
||||
Requires the presence of the libfaac headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libfaac --enable-nonfree}.
|
||||
|
||||
This encoder is considered to be of higher quality with respect to the
|
||||
@ref{aacenc,,the native experimental FFmpeg AAC encoder}.
|
||||
|
||||
For more information see the libfaac project at
|
||||
@url{http://www.audiocoding.com/faac.html/}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following shared FFmpeg codec options are recognized.
|
||||
@@ -730,10 +694,9 @@ configuration. You need to explicitly configure the build with
|
||||
so if you allow the use of GPL, you should configure with
|
||||
@code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
|
||||
|
||||
This encoder is considered to produce output on par or worse at 128kbps to the
|
||||
@ref{aacenc,,the native FFmpeg AAC encoder} but can often produce better
|
||||
sounding audio at identical or lower bitrates and has support for the
|
||||
AAC-HE profiles.
|
||||
This encoder is considered to be of higher quality with respect to
|
||||
both @ref{aacenc,,the native experimental FFmpeg AAC encoder} and
|
||||
@ref{libfaac}.
|
||||
|
||||
VBR encoding, enabled through the @option{vbr} or @option{flags
|
||||
+qscale} options, is experimental and only works with some
|
||||
@@ -1075,6 +1038,31 @@ Set MPEG audio original flag when set to 1. The default value is 0
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{libvo-aacenc}
|
||||
@section libvo-aacenc
|
||||
|
||||
VisualOn AAC encoder.
|
||||
|
||||
Requires the presence of the libvo-aacenc headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libvo-aacenc --enable-version3}.
|
||||
|
||||
This encoder is considered to be worse than the
|
||||
@ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
|
||||
multiple sources.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The VisualOn AAC encoder only support encoding AAC-LC and up to 2
|
||||
channels. It is also CBR-only.
|
||||
|
||||
@table @option
|
||||
|
||||
@item b
|
||||
Set bit rate in bits/s.
|
||||
|
||||
@end table
|
||||
|
||||
@section libvo-amrwbenc
|
||||
|
||||
VisualOn Adaptive Multi-Rate Wideband encoder.
|
||||
@@ -1137,7 +1125,7 @@ kilobits/s.
|
||||
|
||||
@item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
|
||||
Set VBR mode. The FFmpeg @option{vbr} option has the following
|
||||
valid arguments, with the @command{opusenc} equivalent options
|
||||
valid arguments, with the their @command{opusenc} equivalent options
|
||||
in parentheses:
|
||||
|
||||
@table @samp
|
||||
@@ -1354,96 +1342,6 @@ disabled
|
||||
A description of some of the currently available video encoders
|
||||
follows.
|
||||
|
||||
@section libopenh264
|
||||
|
||||
Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
|
||||
|
||||
This encoder requires the presence of the libopenh264 headers and
|
||||
library during configuration. You need to explicitly configure the
|
||||
build with @code{--enable-libopenh264}. The library is detected using
|
||||
@command{pkg-config}.
|
||||
|
||||
For more information about the library see
|
||||
@url{http://www.openh264.org}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following FFmpeg global options affect the configurations of the
|
||||
libopenh264 encoder.
|
||||
|
||||
@table @option
|
||||
@item b
|
||||
Set the bitrate (as a number of bits per second).
|
||||
|
||||
@item g
|
||||
Set the GOP size.
|
||||
|
||||
@item maxrate
|
||||
Set the max bitrate (as a number of bits per second).
|
||||
|
||||
@item flags +global_header
|
||||
Set global header in the bitstream.
|
||||
|
||||
@item slices
|
||||
Set the number of slices, used in parallelized encoding. Default value
|
||||
is 0. This is only used when @option{slice_mode} is set to
|
||||
@samp{fixed}.
|
||||
|
||||
@item slice_mode
|
||||
Set slice mode. Can assume one of the follwing possible values:
|
||||
|
||||
@table @samp
|
||||
@item fixed
|
||||
a fixed number of slices
|
||||
@item rowmb
|
||||
one slice per row of macroblocks
|
||||
@item auto
|
||||
automatic number of slices according to number of threads
|
||||
@item dyn
|
||||
dynamic slicing
|
||||
@end table
|
||||
|
||||
Default value is @samp{auto}.
|
||||
|
||||
@item loopfilter
|
||||
Enable loop filter, if set to 1 (automatically enabled). To disable
|
||||
set a value of 0.
|
||||
|
||||
@item profile
|
||||
Set profile restrictions. If set to the value of @samp{main} enable
|
||||
CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
|
||||
|
||||
@item max_nal_size
|
||||
Set maximum NAL size in bytes.
|
||||
|
||||
@item allow_skip_frames
|
||||
Allow skipping frames to hit the target bitrate if set to 1.
|
||||
@end table
|
||||
|
||||
@section jpeg2000
|
||||
|
||||
The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
|
||||
option can be used to set the encoding quality. Lossless encoding
|
||||
can be selected with @code{-pred 1}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item format
|
||||
Can be set to either @code{j2k} or @code{jp2} (the default) that
|
||||
makes it possible to store non-rgb pix_fmts.
|
||||
|
||||
@end table
|
||||
|
||||
@section snow
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item iterative_dia_size
|
||||
dia size for the iterative motion estimation
|
||||
@end table
|
||||
|
||||
@section libtheora
|
||||
|
||||
libtheora Theora encoder wrapper.
|
||||
@@ -1518,159 +1416,113 @@ You need to explicitly configure the build with @code{--enable-libvpx}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The following options are supported by the libvpx wrapper. The
|
||||
@command{vpxenc}-equivalent options or values are listed in parentheses
|
||||
for easy migration.
|
||||
|
||||
To reduce the duplication of documentation, only the private options
|
||||
and some others requiring special attention are documented here. For
|
||||
the documentation of the undocumented generic options, see
|
||||
@ref{codec-options,,the Codec Options chapter}.
|
||||
|
||||
To get more documentation of the libvpx options, invoke the command
|
||||
@command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
|
||||
@command{vpxenc --help}. Further information is available in the libvpx API
|
||||
documentation.
|
||||
Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
|
||||
|
||||
@table @option
|
||||
|
||||
@item b (@emph{target-bitrate})
|
||||
Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
|
||||
expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
|
||||
kilobits/s.
|
||||
@item threads
|
||||
g_threads
|
||||
|
||||
@item g (@emph{kf-max-dist})
|
||||
@item profile
|
||||
g_profile
|
||||
|
||||
@item keyint_min (@emph{kf-min-dist})
|
||||
@item vb
|
||||
rc_target_bitrate
|
||||
|
||||
@item qmin (@emph{min-q})
|
||||
@item g
|
||||
kf_max_dist
|
||||
|
||||
@item qmax (@emph{max-q})
|
||||
@item keyint_min
|
||||
kf_min_dist
|
||||
|
||||
@item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
|
||||
Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
|
||||
specified in milliseconds, the libvpx wrapper converts this value as follows:
|
||||
@code{buf-sz = bufsize * 1000 / bitrate},
|
||||
@code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
|
||||
@item qmin
|
||||
rc_min_quantizer
|
||||
|
||||
@item rc_init_occupancy (@emph{buf-initial-sz})
|
||||
Set number of bits which should be loaded into the rc buffer before decoding
|
||||
starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
|
||||
wrapper converts this value as follows:
|
||||
@code{rc_init_occupancy * 1000 / bitrate}.
|
||||
@item qmax
|
||||
rc_max_quantizer
|
||||
|
||||
@item undershoot-pct
|
||||
Set datarate undershoot (min) percentage of the target bitrate.
|
||||
@item bufsize, vb
|
||||
rc_buf_sz
|
||||
@code{(bufsize * 1000 / vb)}
|
||||
|
||||
@item overshoot-pct
|
||||
Set datarate overshoot (max) percentage of the target bitrate.
|
||||
rc_buf_optimal_sz
|
||||
@code{(bufsize * 1000 / vb * 5 / 6)}
|
||||
|
||||
@item skip_threshold (@emph{drop-frame})
|
||||
@item rc_init_occupancy, vb
|
||||
rc_buf_initial_sz
|
||||
@code{(rc_init_occupancy * 1000 / vb)}
|
||||
|
||||
@item qcomp (@emph{bias-pct})
|
||||
@item rc_buffer_aggressivity
|
||||
rc_undershoot_pct
|
||||
|
||||
@item maxrate (@emph{maxsection-pct})
|
||||
Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
|
||||
percentage of the target bitrate, the libvpx wrapper converts this value as
|
||||
follows: @code{(maxrate * 100 / bitrate)}.
|
||||
@item skip_threshold
|
||||
rc_dropframe_thresh
|
||||
|
||||
@item minrate (@emph{minsection-pct})
|
||||
Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
|
||||
percentage of the target bitrate, the libvpx wrapper converts this value as
|
||||
follows: @code{(minrate * 100 / bitrate)}.
|
||||
@item qcomp
|
||||
rc_2pass_vbr_bias_pct
|
||||
|
||||
@item minrate, maxrate, b @emph{end-usage=cbr}
|
||||
@code{(minrate == maxrate == bitrate)}.
|
||||
@item maxrate, vb
|
||||
rc_2pass_vbr_maxsection_pct
|
||||
@code{(maxrate * 100 / vb)}
|
||||
|
||||
@item crf (@emph{end-usage=cq}, @emph{cq-level})
|
||||
@item minrate, vb
|
||||
rc_2pass_vbr_minsection_pct
|
||||
@code{(minrate * 100 / vb)}
|
||||
|
||||
@item tune (@emph{tune})
|
||||
@table @samp
|
||||
@item psnr (@emph{psnr})
|
||||
@item ssim (@emph{ssim})
|
||||
@item minrate, maxrate, vb
|
||||
@code{VPX_CBR}
|
||||
@code{(minrate == maxrate == vb)}
|
||||
|
||||
@item crf
|
||||
@code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
|
||||
|
||||
@item quality
|
||||
@table @option
|
||||
@item @var{best}
|
||||
@code{VPX_DL_BEST_QUALITY}
|
||||
@item @var{good}
|
||||
@code{VPX_DL_GOOD_QUALITY}
|
||||
@item @var{realtime}
|
||||
@code{VPX_DL_REALTIME}
|
||||
@end table
|
||||
|
||||
@item quality, deadline (@emph{deadline})
|
||||
@table @samp
|
||||
@item best
|
||||
Use best quality deadline. Poorly named and quite slow, this option should be
|
||||
avoided as it may give worse quality output than good.
|
||||
@item good
|
||||
Use good quality deadline. This is a good trade-off between speed and quality
|
||||
when used with the @option{cpu-used} option.
|
||||
@item realtime
|
||||
Use realtime quality deadline.
|
||||
@end table
|
||||
@item speed
|
||||
@code{VP8E_SET_CPUUSED}
|
||||
|
||||
@item speed, cpu-used (@emph{cpu-used})
|
||||
Set quality/speed ratio modifier. Higher values speed up the encode at the cost
|
||||
of quality.
|
||||
@item nr
|
||||
@code{VP8E_SET_NOISE_SENSITIVITY}
|
||||
|
||||
@item nr (@emph{noise-sensitivity})
|
||||
@item mb_threshold
|
||||
@code{VP8E_SET_STATIC_THRESHOLD}
|
||||
|
||||
@item static-thresh
|
||||
Set a change threshold on blocks below which they will be skipped by the
|
||||
encoder.
|
||||
|
||||
@item slices (@emph{token-parts})
|
||||
Note that FFmpeg's @option{slices} option gives the total number of partitions,
|
||||
while @command{vpxenc}'s @option{token-parts} is given as
|
||||
@code{log2(partitions)}.
|
||||
@item slices
|
||||
@code{VP8E_SET_TOKEN_PARTITIONS}
|
||||
|
||||
@item max-intra-rate
|
||||
Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
|
||||
means unlimited.
|
||||
@code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
|
||||
|
||||
@item force_key_frames
|
||||
@code{VPX_EFLAG_FORCE_KF}
|
||||
|
||||
@item Alternate reference frame related
|
||||
@table @option
|
||||
@item auto-alt-ref
|
||||
Enable use of alternate reference frames (2-pass only).
|
||||
@item arnr-max-frames
|
||||
Set altref noise reduction max frame count.
|
||||
@item arnr-type
|
||||
Set altref noise reduction filter type: backward, forward, centered.
|
||||
@item arnr-strength
|
||||
Set altref noise reduction filter strength.
|
||||
@item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
|
||||
Set number of frames to look ahead for frametype and ratecontrol.
|
||||
@item vp8flags altref
|
||||
@code{VP8E_SET_ENABLEAUTOALTREF}
|
||||
@item @var{arnr_max_frames}
|
||||
@code{VP8E_SET_ARNR_MAXFRAMES}
|
||||
@item @var{arnr_type}
|
||||
@code{VP8E_SET_ARNR_TYPE}
|
||||
@item @var{arnr_strength}
|
||||
@code{VP8E_SET_ARNR_STRENGTH}
|
||||
@item @var{rc_lookahead}
|
||||
g_lag_in_frames
|
||||
@end table
|
||||
|
||||
@item error-resilient
|
||||
Enable error resiliency features.
|
||||
@item vp8flags error_resilient
|
||||
g_error_resilient
|
||||
|
||||
@item VP9-specific options
|
||||
@table @option
|
||||
@item lossless
|
||||
Enable lossless mode.
|
||||
@item tile-columns
|
||||
Set number of tile columns to use. Note this is given as
|
||||
@code{log2(tile_columns)}. For example, 8 tile columns would be requested by
|
||||
setting the @option{tile-columns} option to 3.
|
||||
@item tile-rows
|
||||
Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
|
||||
For example, 4 tile rows would be requested by setting the @option{tile-rows}
|
||||
option to 2.
|
||||
@item frame-parallel
|
||||
Enable frame parallel decodability features.
|
||||
@item aq-mode
|
||||
Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
|
||||
cyclic refresh).
|
||||
@item colorspace @emph{color-space}
|
||||
Set input color space. The VP9 bitstream supports signaling the following
|
||||
colorspaces:
|
||||
@table @option
|
||||
@item @samp{rgb} @emph{sRGB}
|
||||
@item @samp{bt709} @emph{bt709}
|
||||
@item @samp{unspecified} @emph{unknown}
|
||||
@item @samp{bt470bg} @emph{bt601}
|
||||
@item @samp{smpte170m} @emph{smpte170}
|
||||
@item @samp{smpte240m} @emph{smpte240}
|
||||
@item @samp{bt2020_ncl} @emph{bt2020}
|
||||
@end table
|
||||
@end table
|
||||
@item aq_mode
|
||||
@code{VP9E_SET_AQ_MODE}
|
||||
|
||||
@end table
|
||||
|
||||
@@ -2095,10 +1947,6 @@ For example to specify libx264 encoding options with @command{ffmpeg}:
|
||||
ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
|
||||
@end example
|
||||
|
||||
@item a53cc @var{boolean}
|
||||
Import closed captions (which must be ATSC compatible format) into output.
|
||||
Only the mpeg2 and h264 decoders provide these. Default is 0 (off).
|
||||
|
||||
@item x264-params (N.A.)
|
||||
Override the x264 configuration using a :-separated list of key=value
|
||||
parameters.
|
||||
@@ -2412,180 +2260,6 @@ Setting a higher @option{bits_per_mb} limit will improve the speed.
|
||||
For the fastest encoding speed set the @option{qscale} parameter (4 is the
|
||||
recommended value) and do not set a size constraint.
|
||||
|
||||
@section libkvazaar
|
||||
|
||||
Kvazaar H.265/HEVC encoder.
|
||||
|
||||
Requires the presence of the libkvazaar headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@option{--enable-libkvazaar}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item b
|
||||
Set target video bitrate in bit/s and enable rate control.
|
||||
|
||||
@item kvazaar-params
|
||||
Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
|
||||
by commas (,). See kvazaar documentation for a list of options.
|
||||
|
||||
@end table
|
||||
|
||||
@section QSV encoders
|
||||
|
||||
The family of Intel QuickSync Video encoders (MPEG-2, H.264 and HEVC)
|
||||
|
||||
The ratecontrol method is selected as follows:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
When @option{global_quality} is specified, a quality-based mode is used.
|
||||
Specifically this means either
|
||||
@itemize @minus
|
||||
@item
|
||||
@var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
|
||||
also set (the @option{-qscale} ffmpeg option).
|
||||
|
||||
@item
|
||||
@var{LA_ICQ} - intelligent constant quality with lookahead, when the
|
||||
@option{look_ahead} option is also set.
|
||||
|
||||
@item
|
||||
@var{ICQ} -- intelligent constant quality otherwise.
|
||||
@end itemize
|
||||
|
||||
@item
|
||||
Otherwise, a bitrate-based mode is used. For all of those, you should specify at
|
||||
least the desired average bitrate with the @option{b} option.
|
||||
@itemize @minus
|
||||
@item
|
||||
@var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
|
||||
|
||||
@item
|
||||
@var{VCM} - video conferencing mode, when the @option{vcm} option is set.
|
||||
|
||||
@item
|
||||
@var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
|
||||
the average bitrate.
|
||||
|
||||
@item
|
||||
@var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
|
||||
than the average bitrate.
|
||||
|
||||
@item
|
||||
@var{AVBR} - average VBR mode, when @option{maxrate} is not specified. This mode
|
||||
is further configured by the @option{avbr_accuracy} and
|
||||
@option{avbr_convergence} options.
|
||||
@end itemize
|
||||
@end itemize
|
||||
|
||||
Note that depending on your system, a different mode than the one you specified
|
||||
may be selected by the encoder. Set the verbosity level to @var{verbose} or
|
||||
higher to see the actual settings used by the QSV runtime.
|
||||
|
||||
Additional libavcodec global options are mapped to MSDK options as follows:
|
||||
|
||||
@itemize
|
||||
@item
|
||||
@option{g/gop_size} -> @option{GopPicSize}
|
||||
|
||||
@item
|
||||
@option{bf/max_b_frames}+1 -> @option{GopRefDist}
|
||||
|
||||
@item
|
||||
@option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
|
||||
@option{InitialDelayInKB}
|
||||
|
||||
@item
|
||||
@option{slices} -> @option{NumSlice}
|
||||
|
||||
@item
|
||||
@option{refs} -> @option{NumRefFrame}
|
||||
|
||||
@item
|
||||
@option{b_strategy/b_frame_strategy} -> @option{BRefType}
|
||||
|
||||
@item
|
||||
@option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
|
||||
|
||||
@item
|
||||
For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
|
||||
@option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
|
||||
and @var{QPP} and @var{QPB} respectively.
|
||||
|
||||
@item
|
||||
Setting the @option{coder} option to the value @var{vlc} will make the H.264
|
||||
encoder use CAVLC instead of CABAC.
|
||||
|
||||
@end itemize
|
||||
|
||||
@section vc2
|
||||
|
||||
SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
|
||||
professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
|
||||
8 (limited range or full range), 10 or 12 bits, this makes it suitable for
|
||||
other tasks which require low overhead and low compression (like screen
|
||||
recording).
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item b
|
||||
Sets target video bitrate. Usually that's around 1:6 of the uncompressed
|
||||
video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
|
||||
values (close to the uncompressed bitrate) turn on lossless compression mode.
|
||||
|
||||
@item field_order
|
||||
Enables field coding when set (e.g. to tt - top field first) for interlaced
|
||||
inputs. Should increase compression with interlaced content as it splits the
|
||||
fields and encodes each separately.
|
||||
|
||||
@item wavelet_depth
|
||||
Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
|
||||
Lower values reduce compression and quality. Less capable decoders may not be
|
||||
able to handle values of @option{wavelet_depth} over 3.
|
||||
|
||||
@item wavelet_type
|
||||
Sets the transform type. Currently only @var{5_3} (LeGall) and @var{9_7}
|
||||
(Deslauriers-Dubuc)
|
||||
are implemented, with 9_7 being the one with better compression and thus
|
||||
is the default.
|
||||
|
||||
@item slice_width
|
||||
@item slice_height
|
||||
Sets the slice size for each slice. Larger values result in better compression.
|
||||
For compatibility with other more limited decoders use @option{slice_width} of
|
||||
32 and @option{slice_height} of 8.
|
||||
|
||||
@item tolerance
|
||||
Sets the undershoot tolerance of the rate control system in percent. This is
|
||||
to prevent an expensive search from being run.
|
||||
|
||||
@item qm
|
||||
Sets the quantization matrix preset to use by default or when @option{wavelet_depth}
|
||||
is set to 5
|
||||
@itemize @minus
|
||||
@item
|
||||
@var{default}
|
||||
Uses the default quantization matrix from the specifications, extended with
|
||||
values for the fifth level. This provides a good balance between keeping detail
|
||||
and omitting artifacts.
|
||||
|
||||
@item
|
||||
@var{flat}
|
||||
Use a completely zeroed out quantization matrix. This increases PSNR but might
|
||||
reduce perception. Use in bogus benchmarks.
|
||||
|
||||
@item
|
||||
@var{color}
|
||||
Reduces detail but attempts to preserve color at extremely low bitrates.
|
||||
@end itemize
|
||||
|
||||
@end table
|
||||
|
||||
@c man end VIDEO ENCODERS
|
||||
|
||||
@chapter Subtitles Encoders
|
||||
|
@@ -11,14 +11,13 @@ CFLAGS += -Wall -g
|
||||
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
|
||||
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
|
||||
|
||||
EXAMPLES= avio_dir_cmd \
|
||||
EXAMPLES= avio_list_dir \
|
||||
avio_reading \
|
||||
decoding_encoding \
|
||||
demuxing_decoding \
|
||||
extract_mvs \
|
||||
filtering_video \
|
||||
filtering_audio \
|
||||
http_multiclient \
|
||||
metadata \
|
||||
muxing \
|
||||
remuxing \
|
||||
|
@@ -54,13 +54,28 @@ static const char *type_string(int type)
|
||||
return "<UNKNOWN>";
|
||||
}
|
||||
|
||||
static int list_op(const char *input_dir)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *input_dir = NULL;
|
||||
AVIODirEntry *entry = NULL;
|
||||
AVIODirContext *ctx = NULL;
|
||||
int cnt, ret;
|
||||
char filemode[4], uid_and_gid[20];
|
||||
|
||||
av_log_set_level(AV_LOG_DEBUG);
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s input_dir\n"
|
||||
"API example program to show how to list files in directory "
|
||||
"accessed through AVIOContext.\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
input_dir = argv[1];
|
||||
|
||||
/* register codecs and formats and other lavf/lavc components*/
|
||||
av_register_all();
|
||||
avformat_network_init();
|
||||
|
||||
if ((ret = avio_open_dir(&ctx, input_dir, NULL)) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot open directory: %s.\n", av_err2str(ret));
|
||||
goto fail;
|
||||
@@ -99,81 +114,6 @@ static int list_op(const char *input_dir)
|
||||
|
||||
fail:
|
||||
avio_close_dir(&ctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int del_op(const char *url)
|
||||
{
|
||||
int ret = avpriv_io_delete(url);
|
||||
if (ret < 0)
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int move_op(const char *src, const char *dst)
|
||||
{
|
||||
int ret = avpriv_io_move(src, dst);
|
||||
if (ret < 0)
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, dst, av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static void usage(const char *program_name)
|
||||
{
|
||||
fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
|
||||
"API example program to show how to manipulate resources "
|
||||
"accessed through AVIOContext.\n"
|
||||
"OPERATIONS:\n"
|
||||
"list list content of the directory\n"
|
||||
"move rename content in directory\n"
|
||||
"del delete content in directory\n",
|
||||
program_name);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *op = NULL;
|
||||
int ret;
|
||||
|
||||
av_log_set_level(AV_LOG_DEBUG);
|
||||
|
||||
if (argc < 2) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* register codecs and formats and other lavf/lavc components*/
|
||||
av_register_all();
|
||||
avformat_network_init();
|
||||
|
||||
op = argv[1];
|
||||
if (strcmp(op, "list") == 0) {
|
||||
if (argc < 3) {
|
||||
av_log(NULL, AV_LOG_INFO, "Missing argument for list operation.\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
} else {
|
||||
ret = list_op(argv[2]);
|
||||
}
|
||||
} else if (strcmp(op, "del") == 0) {
|
||||
if (argc < 3) {
|
||||
av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
} else {
|
||||
ret = del_op(argv[2]);
|
||||
}
|
||||
} else if (strcmp(op, "move") == 0) {
|
||||
if (argc < 4) {
|
||||
av_log(NULL, AV_LOG_INFO, "Missing argument for move operation.\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
} else {
|
||||
ret = move_op(argv[2], argv[3]);
|
||||
}
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_INFO, "Invalid operation %s\n", op);
|
||||
ret = AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
avformat_network_deinit();
|
||||
|
||||
return ret < 0 ? 1 : 0;
|
@@ -211,7 +211,7 @@ static void audio_encode_example(const char *filename)
|
||||
}
|
||||
if (got_output) {
|
||||
fwrite(pkt.data, 1, pkt.size, f);
|
||||
av_packet_unref(&pkt);
|
||||
av_free_packet(&pkt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ static void audio_encode_example(const char *filename)
|
||||
|
||||
if (got_output) {
|
||||
fwrite(pkt.data, 1, pkt.size, f);
|
||||
av_packet_unref(&pkt);
|
||||
av_free_packet(&pkt);
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
@@ -245,7 +245,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
||||
AVCodecContext *c= NULL;
|
||||
int len;
|
||||
FILE *f, *outfile;
|
||||
uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
|
||||
uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||
AVPacket avpkt;
|
||||
AVFrame *decoded_frame = NULL;
|
||||
|
||||
@@ -454,7 +454,7 @@ static void video_encode_example(const char *filename, int codec_id)
|
||||
if (got_output) {
|
||||
printf("Write frame %3d (size=%5d)\n", i, pkt.size);
|
||||
fwrite(pkt.data, 1, pkt.size, f);
|
||||
av_packet_unref(&pkt);
|
||||
av_free_packet(&pkt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ static void video_encode_example(const char *filename, int codec_id)
|
||||
if (got_output) {
|
||||
printf("Write frame %3d (size=%5d)\n", i, pkt.size);
|
||||
fwrite(pkt.data, 1, pkt.size, f);
|
||||
av_packet_unref(&pkt);
|
||||
av_free_packet(&pkt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ static int decode_write_frame(const char *outfilename, AVCodecContext *avctx,
|
||||
/* the picture is allocated by the decoder, no need to free it */
|
||||
snprintf(buf, sizeof(buf), outfilename, *frame_count);
|
||||
pgm_save(frame->data[0], frame->linesize[0],
|
||||
frame->width, frame->height, buf);
|
||||
avctx->width, avctx->height, buf);
|
||||
(*frame_count)++;
|
||||
}
|
||||
if (pkt->data) {
|
||||
@@ -538,13 +538,13 @@ static void video_decode_example(const char *outfilename, const char *filename)
|
||||
int frame_count;
|
||||
FILE *f;
|
||||
AVFrame *frame;
|
||||
uint8_t inbuf[INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
|
||||
uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||
AVPacket avpkt;
|
||||
|
||||
av_init_packet(&avpkt);
|
||||
|
||||
/* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
|
||||
memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
printf("Decode video file %s to %s\n", filename, outfilename);
|
||||
|
||||
@@ -561,8 +561,8 @@ static void video_decode_example(const char *outfilename, const char *filename)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (codec->capabilities & AV_CODEC_CAP_TRUNCATED)
|
||||
c->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames
|
||||
if(codec->capabilities&CODEC_CAP_TRUNCATED)
|
||||
c->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */
|
||||
|
||||
/* For some codecs, such as msmpeg4 and mpeg4, width and height
|
||||
MUST be initialized there because this information is not
|
||||
|
@@ -55,11 +55,17 @@ static AVPacket pkt;
|
||||
static int video_frame_count = 0;
|
||||
static int audio_frame_count = 0;
|
||||
|
||||
/* Enable or disable frame reference counting. You are not supposed to support
|
||||
* both paths in your application but pick the one most appropriate to your
|
||||
* needs. Look for the use of refcount in this example to see what are the
|
||||
* differences of API usage between them. */
|
||||
static int refcount = 0;
|
||||
/* The different ways of decoding and managing data memory. You are not
|
||||
* supposed to support all the modes in your application but pick the one most
|
||||
* appropriate to your needs. Look for the use of api_mode in this example to
|
||||
* see what are the differences of API usage between them */
|
||||
enum {
|
||||
API_MODE_OLD = 0, /* old method, deprecated */
|
||||
API_MODE_NEW_API_REF_COUNT = 1, /* new method, using the frame reference counting */
|
||||
API_MODE_NEW_API_NO_REF_COUNT = 2, /* new method, without reference counting */
|
||||
};
|
||||
|
||||
static int api_mode = API_MODE_OLD;
|
||||
|
||||
static int decode_packet(int *got_frame, int cached)
|
||||
{
|
||||
@@ -139,9 +145,9 @@ static int decode_packet(int *got_frame, int cached)
|
||||
}
|
||||
}
|
||||
|
||||
/* If we use frame reference counting, we own the data and need
|
||||
/* If we use the new API with reference counting, we own the data and need
|
||||
* to de-reference it when we don't use it anymore */
|
||||
if (*got_frame && refcount)
|
||||
if (*got_frame && api_mode == API_MODE_NEW_API_REF_COUNT)
|
||||
av_frame_unref(frame);
|
||||
|
||||
return decoded;
|
||||
@@ -175,7 +181,8 @@ static int open_codec_context(int *stream_idx,
|
||||
}
|
||||
|
||||
/* Init the decoders, with or without reference counting */
|
||||
av_dict_set(&opts, "refcounted_frames", refcount ? "1" : "0", 0);
|
||||
if (api_mode == API_MODE_NEW_API_REF_COUNT)
|
||||
av_dict_set(&opts, "refcounted_frames", "1", 0);
|
||||
if ((ret = avcodec_open2(dec_ctx, dec, &opts)) < 0) {
|
||||
fprintf(stderr, "Failed to open %s codec\n",
|
||||
av_get_media_type_string(type));
|
||||
@@ -221,19 +228,28 @@ int main (int argc, char **argv)
|
||||
int ret = 0, got_frame;
|
||||
|
||||
if (argc != 4 && argc != 5) {
|
||||
fprintf(stderr, "usage: %s [-refcount] input_file video_output_file audio_output_file\n"
|
||||
fprintf(stderr, "usage: %s [-refcount=<old|new_norefcount|new_refcount>] "
|
||||
"input_file video_output_file audio_output_file\n"
|
||||
"API example program to show how to read frames from an input file.\n"
|
||||
"This program reads frames from a file, decodes them, and writes decoded\n"
|
||||
"video frames to a rawvideo file named video_output_file, and decoded\n"
|
||||
"audio frames to a rawaudio file named audio_output_file.\n\n"
|
||||
"If the -refcount option is specified, the program use the\n"
|
||||
"reference counting frame system which allows keeping a copy of\n"
|
||||
"the data for longer than one decode call.\n"
|
||||
"the data for longer than one decode call. If unset, it's using\n"
|
||||
"the classic old method.\n"
|
||||
"\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
if (argc == 5 && !strcmp(argv[1], "-refcount")) {
|
||||
refcount = 1;
|
||||
if (argc == 5) {
|
||||
const char *mode = argv[1] + strlen("-refcount=");
|
||||
if (!strcmp(mode, "old")) api_mode = API_MODE_OLD;
|
||||
else if (!strcmp(mode, "new_norefcount")) api_mode = API_MODE_NEW_API_NO_REF_COUNT;
|
||||
else if (!strcmp(mode, "new_refcount")) api_mode = API_MODE_NEW_API_REF_COUNT;
|
||||
else {
|
||||
fprintf(stderr, "unknow mode '%s'\n", mode);
|
||||
exit(1);
|
||||
}
|
||||
argv++;
|
||||
}
|
||||
src_filename = argv[1];
|
||||
@@ -299,6 +315,11 @@ int main (int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* When using the new API, you need to use the libavutil/frame.h API, while
|
||||
* the classic frame management is available in libavcodec */
|
||||
if (api_mode == API_MODE_OLD)
|
||||
frame = avcodec_alloc_frame();
|
||||
else
|
||||
frame = av_frame_alloc();
|
||||
if (!frame) {
|
||||
fprintf(stderr, "Could not allocate frame\n");
|
||||
@@ -326,7 +347,7 @@ int main (int argc, char **argv)
|
||||
pkt.data += ret;
|
||||
pkt.size -= ret;
|
||||
} while (pkt.size > 0);
|
||||
av_packet_unref(&orig_pkt);
|
||||
av_free_packet(&orig_pkt);
|
||||
}
|
||||
|
||||
/* flush cached frames */
|
||||
@@ -376,6 +397,9 @@ end:
|
||||
fclose(video_dst_file);
|
||||
if (audio_dst_file)
|
||||
fclose(audio_dst_file);
|
||||
if (api_mode == API_MODE_OLD)
|
||||
avcodec_free_frame(&frame);
|
||||
else
|
||||
av_frame_free(&frame);
|
||||
av_free(video_dst_data[0]);
|
||||
|
||||
|
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
|
||||
pkt.data += ret;
|
||||
pkt.size -= ret;
|
||||
} while (pkt.size > 0);
|
||||
av_packet_unref(&orig_pkt);
|
||||
av_free_packet(&orig_pkt);
|
||||
}
|
||||
|
||||
/* flush cached frames */
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/avfiltergraph.h>
|
||||
#include <libavfilter/avcodec.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include <libavutil/opt.h>
|
||||
@@ -273,10 +274,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (packet.size <= 0)
|
||||
av_packet_unref(&packet0);
|
||||
av_free_packet(&packet0);
|
||||
} else {
|
||||
/* discard non-wanted packets */
|
||||
av_packet_unref(&packet0);
|
||||
av_free_packet(&packet0);
|
||||
}
|
||||
}
|
||||
end:
|
||||
|
@@ -33,14 +33,12 @@
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/avfiltergraph.h>
|
||||
#include <libavfilter/avcodec.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include <libavutil/opt.h>
|
||||
|
||||
const char *filter_descr = "scale=78:24,transpose=cclock";
|
||||
/* other way:
|
||||
scale=78:24 [scl]; [scl] transpose=cclock // assumes "[in]" and "[out]" to be input output pads respectively
|
||||
*/
|
||||
const char *filter_descr = "scale=78:24";
|
||||
|
||||
static AVFormatContext *fmt_ctx;
|
||||
static AVCodecContext *dec_ctx;
|
||||
@@ -262,7 +260,7 @@ int main(int argc, char **argv)
|
||||
av_frame_unref(frame);
|
||||
}
|
||||
}
|
||||
av_packet_unref(&packet);
|
||||
av_free_packet(&packet);
|
||||
}
|
||||
end:
|
||||
avfilter_graph_free(&filter_graph);
|
||||
|
@@ -1,155 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Stephan Holljes
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* libavformat multi-client network API usage example.
|
||||
*
|
||||
* @example http_multiclient.c
|
||||
* This example will serve a file without decoding or demuxing it over http.
|
||||
* Multiple clients can connect and will receive the same file.
|
||||
*/
|
||||
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavutil/opt.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void process_client(AVIOContext *client, const char *in_uri)
|
||||
{
|
||||
AVIOContext *input = NULL;
|
||||
uint8_t buf[1024];
|
||||
int ret, n, reply_code;
|
||||
char *resource = NULL;
|
||||
while ((ret = avio_handshake(client)) > 0) {
|
||||
av_opt_get(client, "resource", AV_OPT_SEARCH_CHILDREN, &resource);
|
||||
// check for strlen(resource) is necessary, because av_opt_get()
|
||||
// may return empty string.
|
||||
if (resource && strlen(resource))
|
||||
break;
|
||||
}
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
av_log(client, AV_LOG_TRACE, "resource=%p\n", resource);
|
||||
if (resource && resource[0] == '/' && !strcmp((resource + 1), in_uri)) {
|
||||
reply_code = 200;
|
||||
} else {
|
||||
reply_code = AVERROR_HTTP_NOT_FOUND;
|
||||
}
|
||||
if ((ret = av_opt_set_int(client, "reply_code", reply_code, AV_OPT_SEARCH_CHILDREN)) < 0) {
|
||||
av_log(client, AV_LOG_ERROR, "Failed to set reply_code: %s.\n", av_err2str(ret));
|
||||
goto end;
|
||||
}
|
||||
av_log(client, AV_LOG_TRACE, "Set reply code to %d\n", reply_code);
|
||||
|
||||
while ((ret = avio_handshake(client)) > 0);
|
||||
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
|
||||
fprintf(stderr, "Handshake performed.\n");
|
||||
if (reply_code != 200)
|
||||
goto end;
|
||||
fprintf(stderr, "Opening input file.\n");
|
||||
if ((ret = avio_open2(&input, in_uri, AVIO_FLAG_READ, NULL, NULL)) < 0) {
|
||||
av_log(input, AV_LOG_ERROR, "Failed to open input: %s: %s.\n", in_uri,
|
||||
av_err2str(ret));
|
||||
goto end;
|
||||
}
|
||||
for(;;) {
|
||||
n = avio_read(input, buf, sizeof(buf));
|
||||
if (n < 0) {
|
||||
if (n == AVERROR_EOF)
|
||||
break;
|
||||
av_log(input, AV_LOG_ERROR, "Error reading from input: %s.\n",
|
||||
av_err2str(n));
|
||||
break;
|
||||
}
|
||||
avio_write(client, buf, n);
|
||||
avio_flush(client);
|
||||
}
|
||||
end:
|
||||
fprintf(stderr, "Flushing client\n");
|
||||
avio_flush(client);
|
||||
fprintf(stderr, "Closing client\n");
|
||||
avio_close(client);
|
||||
fprintf(stderr, "Closing input\n");
|
||||
avio_close(input);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
av_log_set_level(AV_LOG_TRACE);
|
||||
AVDictionary *options = NULL;
|
||||
AVIOContext *client = NULL, *server = NULL;
|
||||
const char *in_uri, *out_uri;
|
||||
int ret, pid;
|
||||
if (argc < 3) {
|
||||
printf("usage: %s input http://hostname[:port]\n"
|
||||
"API example program to serve http to multiple clients.\n"
|
||||
"\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
in_uri = argv[1];
|
||||
out_uri = argv[2];
|
||||
|
||||
av_register_all();
|
||||
avformat_network_init();
|
||||
|
||||
if ((ret = av_dict_set(&options, "listen", "2", 0)) < 0) {
|
||||
fprintf(stderr, "Failed to set listen mode for server: %s\n", av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
if ((ret = avio_open2(&server, out_uri, AVIO_FLAG_WRITE, NULL, &options)) < 0) {
|
||||
fprintf(stderr, "Failed to open server: %s\n", av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
fprintf(stderr, "Entering main loop.\n");
|
||||
for(;;) {
|
||||
if ((ret = avio_accept(server, &client)) < 0)
|
||||
goto end;
|
||||
fprintf(stderr, "Accepted client, forking process.\n");
|
||||
// XXX: Since we don't reap our children and don't ignore signals
|
||||
// this produces zombie processes.
|
||||
pid = fork();
|
||||
if (pid < 0) {
|
||||
perror("Fork failed");
|
||||
ret = AVERROR(errno);
|
||||
goto end;
|
||||
}
|
||||
if (pid == 0) {
|
||||
fprintf(stderr, "In child.\n");
|
||||
process_client(client, in_uri);
|
||||
avio_close(server);
|
||||
exit(0);
|
||||
}
|
||||
if (pid > 0)
|
||||
avio_close(client);
|
||||
}
|
||||
end:
|
||||
avio_close(server);
|
||||
if (ret < 0 && ret != AVERROR_EOF) {
|
||||
fprintf(stderr, "Some errors occurred: %s\n", av_err2str(ret));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
@@ -172,7 +172,7 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
|
||||
|
||||
/* Some formats want stream headers to be separate. */
|
||||
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
@@ -230,7 +230,7 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
|
||||
/* increment frequency by 110 Hz per second */
|
||||
ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;
|
||||
|
||||
if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
|
||||
if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
|
||||
nb_samples = 10000;
|
||||
else
|
||||
nb_samples = c->frame_size;
|
||||
@@ -493,12 +493,30 @@ static int write_video_frame(AVFormatContext *oc, OutputStream *ost)
|
||||
AVCodecContext *c;
|
||||
AVFrame *frame;
|
||||
int got_packet = 0;
|
||||
AVPacket pkt = { 0 };
|
||||
|
||||
c = ost->st->codec;
|
||||
|
||||
frame = get_video_frame(ost);
|
||||
|
||||
if (oc->oformat->flags & AVFMT_RAWPICTURE) {
|
||||
/* a hack to avoid data copy with some raw video muxers */
|
||||
AVPacket pkt;
|
||||
av_init_packet(&pkt);
|
||||
|
||||
if (!frame)
|
||||
return 1;
|
||||
|
||||
pkt.flags |= AV_PKT_FLAG_KEY;
|
||||
pkt.stream_index = ost->st->index;
|
||||
pkt.data = (uint8_t *)frame;
|
||||
pkt.size = sizeof(AVPicture);
|
||||
|
||||
pkt.pts = pkt.dts = frame->pts;
|
||||
av_packet_rescale_ts(&pkt, c->time_base, ost->st->time_base);
|
||||
|
||||
ret = av_interleaved_write_frame(oc, &pkt);
|
||||
} else {
|
||||
AVPacket pkt = { 0 };
|
||||
av_init_packet(&pkt);
|
||||
|
||||
/* encode the image */
|
||||
@@ -513,6 +531,7 @@ static int write_video_frame(AVFormatContext *oc, OutputStream *ost)
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error while writing video frame: %s\n", av_err2str(ret));
|
||||
|
@@ -116,6 +116,15 @@ fail:
|
||||
|
||||
static mfxStatus frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp)
|
||||
{
|
||||
DecodeContext *decode = pthis;
|
||||
|
||||
if (decode->surfaces)
|
||||
vaDestroySurfaces(decode->va_dpy, decode->surfaces, decode->nb_surfaces);
|
||||
av_freep(&decode->surfaces);
|
||||
av_freep(&decode->surface_ids);
|
||||
av_freep(&decode->surface_used);
|
||||
decode->nb_surfaces = 0;
|
||||
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
@@ -135,16 +144,6 @@ static mfxStatus frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
static void free_surfaces(DecodeContext *decode)
|
||||
{
|
||||
if (decode->surfaces)
|
||||
vaDestroySurfaces(decode->va_dpy, decode->surfaces, decode->nb_surfaces);
|
||||
av_freep(&decode->surfaces);
|
||||
av_freep(&decode->surface_ids);
|
||||
av_freep(&decode->surface_used);
|
||||
decode->nb_surfaces = 0;
|
||||
}
|
||||
|
||||
static void free_buffer(void *opaque, uint8_t *data)
|
||||
{
|
||||
int *used = opaque;
|
||||
@@ -406,7 +405,7 @@ int main(int argc, char **argv)
|
||||
decoder_ctx->codec_id = AV_CODEC_ID_H264;
|
||||
if (video_st->codec->extradata_size) {
|
||||
decoder_ctx->extradata = av_mallocz(video_st->codec->extradata_size +
|
||||
AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!decoder_ctx->extradata) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto finish;
|
||||
@@ -468,12 +467,6 @@ finish:
|
||||
|
||||
av_frame_free(&frame);
|
||||
|
||||
if (decoder_ctx)
|
||||
av_freep(&decoder_ctx->hwaccel_context);
|
||||
avcodec_free_context(&decoder_ctx);
|
||||
|
||||
free_surfaces(&decode);
|
||||
|
||||
if (decode.mfx_session)
|
||||
MFXClose(decode.mfx_session);
|
||||
if (decode.va_dpy)
|
||||
@@ -481,6 +474,10 @@ finish:
|
||||
if (dpy)
|
||||
XCloseDisplay(dpy);
|
||||
|
||||
if (decoder_ctx)
|
||||
av_freep(&decoder_ctx->hwaccel_context);
|
||||
avcodec_free_context(&decoder_ctx);
|
||||
|
||||
avio_close(output_ctx);
|
||||
|
||||
return ret;
|
||||
|
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
out_stream->codec->codec_tag = 0;
|
||||
if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
out_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
}
|
||||
av_dump_format(ofmt_ctx, 0, out_filename, 1);
|
||||
|
||||
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, "Error muxing packet\n");
|
||||
break;
|
||||
}
|
||||
av_packet_unref(&pkt);
|
||||
av_free_packet(&pkt);
|
||||
}
|
||||
|
||||
av_write_trailer(ofmt_ctx);
|
||||
|
@@ -192,7 +192,7 @@ static int open_output_file(const char *filename,
|
||||
* Mark the encoder so that it behaves accordingly.
|
||||
*/
|
||||
if ((*output_format_context)->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
(*output_codec_context)->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
(*output_codec_context)->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
|
||||
/** Open the encoder for the audio stream to use it later. */
|
||||
if ((error = avcodec_open2(*output_codec_context, output_codec, NULL)) < 0) {
|
||||
@@ -332,7 +332,7 @@ static int decode_audio_frame(AVFrame *frame,
|
||||
data_present, &input_packet)) < 0) {
|
||||
fprintf(stderr, "Could not decode frame (error '%s')\n",
|
||||
get_error_text(error));
|
||||
av_packet_unref(&input_packet);
|
||||
av_free_packet(&input_packet);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ static int decode_audio_frame(AVFrame *frame,
|
||||
*/
|
||||
if (*finished && *data_present)
|
||||
*finished = 0;
|
||||
av_packet_unref(&input_packet);
|
||||
av_free_packet(&input_packet);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -571,7 +571,7 @@ static int encode_audio_frame(AVFrame *frame,
|
||||
frame, data_present)) < 0) {
|
||||
fprintf(stderr, "Could not encode frame (error '%s')\n",
|
||||
get_error_text(error));
|
||||
av_packet_unref(&output_packet);
|
||||
av_free_packet(&output_packet);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -580,11 +580,11 @@ static int encode_audio_frame(AVFrame *frame,
|
||||
if ((error = av_write_frame(output_format_context, &output_packet)) < 0) {
|
||||
fprintf(stderr, "Could not write frame (error '%s')\n",
|
||||
get_error_text(error));
|
||||
av_packet_unref(&output_packet);
|
||||
av_free_packet(&output_packet);
|
||||
return error;
|
||||
}
|
||||
|
||||
av_packet_unref(&output_packet);
|
||||
av_free_packet(&output_packet);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/avfiltergraph.h>
|
||||
#include <libavfilter/avcodec.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include <libavutil/opt.h>
|
||||
@@ -160,7 +161,7 @@ static int open_output_file(const char *filename)
|
||||
}
|
||||
|
||||
if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
|
||||
}
|
||||
av_dump_format(ofmt_ctx, 0, filename, 1);
|
||||
@@ -448,7 +449,7 @@ static int flush_encoder(unsigned int stream_index)
|
||||
int got_frame;
|
||||
|
||||
if (!(ofmt_ctx->streams[stream_index]->codec->codec->capabilities &
|
||||
AV_CODEC_CAP_DELAY))
|
||||
CODEC_CAP_DELAY))
|
||||
return 0;
|
||||
|
||||
while (1) {
|
||||
@@ -536,7 +537,7 @@ int main(int argc, char **argv)
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
}
|
||||
av_packet_unref(&packet);
|
||||
av_free_packet(&packet);
|
||||
}
|
||||
|
||||
/* flush filters and encoders */
|
||||
@@ -560,7 +561,7 @@ int main(int argc, char **argv)
|
||||
|
||||
av_write_trailer(ofmt_ctx);
|
||||
end:
|
||||
av_packet_unref(&packet);
|
||||
av_free_packet(&packet);
|
||||
av_frame_free(&frame);
|
||||
for (i = 0; i < ifmt_ctx->nb_streams; i++) {
|
||||
avcodec_close(ifmt_ctx->streams[i]->codec);
|
||||
|
18
doc/faq.texi
18
doc/faq.texi
@@ -147,7 +147,7 @@ exec /usr/bin/pkg-config "$@@"
|
||||
|
||||
Try a @code{make distclean} in the ffmpeg source directory before the build.
|
||||
If this does not help see
|
||||
(@url{https://ffmpeg.org/bugreports.html}).
|
||||
(@url{http://ffmpeg.org/bugreports.html}).
|
||||
|
||||
@section How do I encode single pictures into movies?
|
||||
|
||||
@@ -311,18 +311,18 @@ invoking ffmpeg with several @option{-i} options.
|
||||
For audio, to put all channels together in a single stream (example: two
|
||||
mono streams into one stereo stream): this is sometimes called to
|
||||
@emph{merge} them, and can be done using the
|
||||
@url{https://ffmpeg.org/ffmpeg-filters.html#amerge, @code{amerge}} filter.
|
||||
@url{http://ffmpeg.org/ffmpeg-filters.html#amerge, @code{amerge}} filter.
|
||||
|
||||
@item
|
||||
For audio, to play one on top of the other: this is called to @emph{mix}
|
||||
them, and can be done by first merging them into a single stream and then
|
||||
using the @url{https://ffmpeg.org/ffmpeg-filters.html#pan, @code{pan}} filter to mix
|
||||
using the @url{http://ffmpeg.org/ffmpeg-filters.html#pan, @code{pan}} filter to mix
|
||||
the channels at will.
|
||||
|
||||
@item
|
||||
For video, to display both together, side by side or one on top of a part of
|
||||
the other; it can be done using the
|
||||
@url{https://ffmpeg.org/ffmpeg-filters.html#overlay, @code{overlay}} video filter.
|
||||
@url{http://ffmpeg.org/ffmpeg-filters.html#overlay, @code{overlay}} video filter.
|
||||
|
||||
@end itemize
|
||||
|
||||
@@ -333,19 +333,19 @@ There are several solutions, depending on the exact circumstances.
|
||||
|
||||
@subsection Concatenating using the concat @emph{filter}
|
||||
|
||||
FFmpeg has a @url{https://ffmpeg.org/ffmpeg-filters.html#concat,
|
||||
FFmpeg has a @url{http://ffmpeg.org/ffmpeg-filters.html#concat,
|
||||
@code{concat}} filter designed specifically for that, with examples in the
|
||||
documentation. This operation is recommended if you need to re-encode.
|
||||
|
||||
@subsection Concatenating using the concat @emph{demuxer}
|
||||
|
||||
FFmpeg has a @url{https://www.ffmpeg.org/ffmpeg-formats.html#concat,
|
||||
FFmpeg has a @url{http://www.ffmpeg.org/ffmpeg-formats.html#concat,
|
||||
@code{concat}} demuxer which you can use when you want to avoid a re-encode and
|
||||
your format doesn't support file level concatenation.
|
||||
|
||||
@subsection Concatenating using the concat @emph{protocol} (file level)
|
||||
|
||||
FFmpeg has a @url{https://ffmpeg.org/ffmpeg-protocols.html#concat,
|
||||
FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
|
||||
@code{concat}} protocol designed specifically for that, with examples in the
|
||||
documentation.
|
||||
|
||||
@@ -485,7 +485,7 @@ scaling adjusts the SAR to keep the DAR constant.
|
||||
|
||||
If you want to stretch, or “unstretch”, the image, you need to override the
|
||||
information with the
|
||||
@url{https://ffmpeg.org/ffmpeg-filters.html#setdar_002c-setsar, @code{setdar or setsar filters}}.
|
||||
@url{http://ffmpeg.org/ffmpeg-filters.html#setdar_002c-setsar, @code{setdar or setsar filters}}.
|
||||
|
||||
Do not forget to examine carefully the original video to check whether the
|
||||
stretching comes from the image or from the aspect ratio information.
|
||||
@@ -589,7 +589,7 @@ see @file{libavformat/aviobuf.c} in FFmpeg and @file{libmpdemux/demux_lavf.c} in
|
||||
|
||||
@section Where is the documentation about ffv1, msmpeg4, asv1, 4xm?
|
||||
|
||||
see @url{https://www.ffmpeg.org/~michael/}
|
||||
see @url{http://www.ffmpeg.org/~michael/}
|
||||
|
||||
@section How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?
|
||||
|
||||
|
114
doc/ffmpeg.texi
114
doc/ffmpeg.texi
@@ -253,10 +253,6 @@ Overwrite output files without asking.
|
||||
Do not overwrite output files, and exit immediately if a specified
|
||||
output file already exists.
|
||||
|
||||
@item -stream_loop @var{number} (@emph{input})
|
||||
Set number of times input stream shall be looped. Loop 0 means no loop,
|
||||
loop -1 means infinite loop.
|
||||
|
||||
@item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
|
||||
@itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
|
||||
Select an encoder (when used before an output file) or a decoder (when used
|
||||
@@ -284,27 +280,23 @@ data read from the input file.
|
||||
When used as an output option (before an output filename), stop writing the
|
||||
output after its duration reaches @var{duration}.
|
||||
|
||||
@var{duration} must be a time duration specification,
|
||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
@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} must be a time duration specification,
|
||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
@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. No further chunk of bytes is written
|
||||
after the limit is exceeded. The size of the output file is slightly more than the
|
||||
requested file size.
|
||||
Set the file size limit, expressed in bytes.
|
||||
|
||||
@item -ss @var{position} (@emph{input/output})
|
||||
When used as an input option (before @code{-i}), seeks in this input file to
|
||||
@var{position}. Note that in most formats it is not possible to seek exactly,
|
||||
so @command{ffmpeg} will seek to the closest seek point before @var{position}.
|
||||
@var{position}. Note the in most formats it is not possible to seek exactly, so
|
||||
@command{ffmpeg} will seek to the closest seek point before @var{position}.
|
||||
When transcoding and @option{-accurate_seek} is enabled (the default), this
|
||||
extra segment between the seek point and @var{position} will be decoded and
|
||||
discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
|
||||
@@ -313,13 +305,7 @@ will be preserved.
|
||||
When used as an output option (before an output filename), decodes but discards
|
||||
input until the timestamps reach @var{position}.
|
||||
|
||||
@var{position} must be a time duration specification,
|
||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
|
||||
@item -sseof @var{position} (@emph{input/output})
|
||||
|
||||
Like the @code{-ss} option but relative to the "end of file". That is negative
|
||||
values are earlier in the file, 0 is at EOF.
|
||||
@var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
|
||||
|
||||
@item -itsoffset @var{offset} (@emph{input})
|
||||
Set the input time offset.
|
||||
@@ -334,15 +320,15 @@ the time duration specified in @var{offset}.
|
||||
@item -timestamp @var{date} (@emph{output})
|
||||
Set the recording timestamp in the container.
|
||||
|
||||
@var{date} must be a date specification,
|
||||
@var{date} must be a time duration specification,
|
||||
see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
|
||||
@item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
|
||||
Set a metadata key/value pair.
|
||||
|
||||
An optional @var{metadata_specifier} may be given to set metadata
|
||||
on streams, chapters or programs. See @code{-map_metadata}
|
||||
documentation for details.
|
||||
on streams or chapters. See @code{-map_metadata} documentation for
|
||||
details.
|
||||
|
||||
This option overrides metadata set with @code{-map_metadata}. It is
|
||||
also possible to delete metadata by using an empty value.
|
||||
@@ -357,11 +343,6 @@ To set the language of the first audio stream:
|
||||
ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
|
||||
@end example
|
||||
|
||||
@item -program [title=@var{title}:][program_num=@var{program_num}:]st=@var{stream}[:st=@var{stream}...] (@emph{output})
|
||||
|
||||
Creates a program with the specified @var{title}, @var{program_num} and adds the specified
|
||||
@var{stream}(s) to it.
|
||||
|
||||
@item -target @var{type} (@emph{output})
|
||||
Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
|
||||
@code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
|
||||
@@ -682,16 +663,6 @@ Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
|
||||
|
||||
@item dxva2
|
||||
Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
|
||||
|
||||
@item qsv
|
||||
Use the Intel QuickSync Video acceleration for video transcoding.
|
||||
|
||||
Unlike most other values, this option does not enable accelerated decoding (that
|
||||
is used automatically whenever a qsv decoder is selected), but accelerated
|
||||
transcoding, without copying the frames into the system memory.
|
||||
|
||||
For it to work, both the decoder and the encoder must support QSV acceleration
|
||||
and no filters must be used.
|
||||
@end table
|
||||
|
||||
This option has no effect if the selected hwaccel is not available or not
|
||||
@@ -718,27 +689,9 @@ is not specified, the value of the @var{DISPLAY} environment variable is used
|
||||
@item dxva2
|
||||
For DXVA2, this option should contain the number of the display adapter to use.
|
||||
If this option is not specified, the default adapter is used.
|
||||
|
||||
@item qsv
|
||||
For QSV, this option corresponds to the valus of MFX_IMPL_* . Allowed values
|
||||
are:
|
||||
@table @option
|
||||
@item auto
|
||||
@item sw
|
||||
@item hw
|
||||
@item auto_any
|
||||
@item hw_any
|
||||
@item hw2
|
||||
@item hw3
|
||||
@item hw4
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@item -hwaccels
|
||||
List all hardware acceleration methods supported in this build of ffmpeg.
|
||||
|
||||
@end table
|
||||
|
||||
@section Audio Options
|
||||
|
||||
@table @option
|
||||
@@ -1268,14 +1221,6 @@ Discard all frames excepts keyframes.
|
||||
Discard all frames.
|
||||
@end table
|
||||
|
||||
@item -abort_on @var{flags} (@emph{global})
|
||||
Stop and abort on various conditions. The following flags are available:
|
||||
|
||||
@table @option
|
||||
@item empty_output
|
||||
No packets were passed to the muxer, the output is empty.
|
||||
@end table
|
||||
|
||||
@item -xerror (@emph{global})
|
||||
Stop and exit on error
|
||||
|
||||
@@ -1354,6 +1299,47 @@ If no such file is found, then ffmpeg will search for a file named
|
||||
|
||||
@c man end OPTIONS
|
||||
|
||||
@chapter Tips
|
||||
@c man begin TIPS
|
||||
|
||||
@itemize
|
||||
@item
|
||||
For streaming at very low bitrates, use a low frame rate
|
||||
and a small GOP size. This is especially true for RealVideo where
|
||||
the Linux player does not seem to be very fast, so it can miss
|
||||
frames. An example is:
|
||||
|
||||
@example
|
||||
ffmpeg -g 3 -r 3 -t 10 -b:v 50k -s qcif -f rv10 /tmp/b.rm
|
||||
@end example
|
||||
|
||||
@item
|
||||
The parameter 'q' which is displayed while encoding is the current
|
||||
quantizer. The value 1 indicates that a very good quality could
|
||||
be achieved. The value 31 indicates the worst quality. If q=31 appears
|
||||
too often, it means that the encoder cannot compress enough to meet
|
||||
your bitrate. You must either increase the bitrate, decrease the
|
||||
frame rate or decrease the frame size.
|
||||
|
||||
@item
|
||||
If your computer is not fast enough, you can speed up the
|
||||
compression at the expense of the compression ratio. You can use
|
||||
'-me zero' to speed up motion estimation, and '-g 0' to disable
|
||||
motion estimation completely (you have only I-frames, which means it
|
||||
is about as good as JPEG compression).
|
||||
|
||||
@item
|
||||
To have very low audio bitrates, reduce the sampling frequency
|
||||
(down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
|
||||
|
||||
@item
|
||||
To have a constant quality (but a variable bitrate), use the option
|
||||
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
|
||||
quality).
|
||||
|
||||
@end itemize
|
||||
@c man end TIPS
|
||||
|
||||
@chapter Examples
|
||||
@c man begin EXAMPLES
|
||||
|
||||
|
@@ -47,17 +47,9 @@ Disable video.
|
||||
@item -sn
|
||||
Disable subtitles.
|
||||
@item -ss @var{pos}
|
||||
Seek to @var{pos}. Note that in most formats it is not possible to seek
|
||||
exactly, so @command{ffplay} will seek to the nearest seek point to
|
||||
@var{pos}.
|
||||
|
||||
@var{pos} must be a time duration specification,
|
||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
Seek to a given position in seconds.
|
||||
@item -t @var{duration}
|
||||
Play @var{duration} seconds of audio/video.
|
||||
|
||||
@var{duration} must be a time duration specification,
|
||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
play <duration> seconds of audio/video
|
||||
@item -bytes
|
||||
Seek by bytes.
|
||||
@item -nodisp
|
||||
@@ -197,15 +189,6 @@ Toggle full screen.
|
||||
@item p, SPC
|
||||
Pause.
|
||||
|
||||
@item m
|
||||
Toggle mute.
|
||||
|
||||
@item 9, 0
|
||||
Decrease and increase volume respectively.
|
||||
|
||||
@item /, *
|
||||
Decrease and increase volume respectively.
|
||||
|
||||
@item a
|
||||
Cycle audio channel in the current program.
|
||||
|
||||
@@ -238,12 +221,9 @@ Seek to the previous/next chapter.
|
||||
or if there are no chapters
|
||||
Seek backward/forward 10 minutes.
|
||||
|
||||
@item right mouse click
|
||||
@item mouse click
|
||||
Seek to percentage in file corresponding to fraction of width.
|
||||
|
||||
@item left mouse double-click
|
||||
Toggle full screen.
|
||||
|
||||
@end table
|
||||
|
||||
@c man end
|
||||
|
@@ -36,10 +36,8 @@ Possible forms of stream specifiers are:
|
||||
Matches the stream with this index. E.g. @code{-threads:1 4} would set the
|
||||
thread count for the second stream to 4.
|
||||
@item @var{stream_type}[:@var{stream_index}]
|
||||
@var{stream_type} is one of following: 'v' or 'V' for video, 'a' for audio, 's'
|
||||
for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video
|
||||
streams, 'V' only matches video streams which are not attached pictures, video
|
||||
thumbnails or cover arts. If @var{stream_index} is given, then it matches
|
||||
@var{stream_type} is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
|
||||
'd' for data, and 't' for attachments. If @var{stream_index} is given, then it matches
|
||||
stream number @var{stream_index} of this type. Otherwise, it matches all
|
||||
streams of this type.
|
||||
@item p:@var{program_id}[:@var{stream_index}]
|
||||
|
@@ -98,7 +98,7 @@ Buffer references ownership and permissions
|
||||
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 and partial_buf are used by libavfilter internally
|
||||
src_buf, cur_buf_copy and partial_buf are used by libavfilter internally
|
||||
and must not be accessed by filters.
|
||||
|
||||
Reference permissions
|
||||
@@ -232,8 +232,7 @@ Frame scheduling
|
||||
one of its inputs, repeatedly until at least one frame has been pushed.
|
||||
|
||||
Return values:
|
||||
if request_frame could produce a frame, or at least make progress
|
||||
towards producing a frame, it should return 0;
|
||||
if request_frame could produce a frame, it should return 0;
|
||||
if it could not for temporary reasons, it should return AVERROR(EAGAIN);
|
||||
if it could not because there are no more frames, it should return
|
||||
AVERROR_EOF.
|
||||
@@ -245,6 +244,7 @@ Frame scheduling
|
||||
push_one_frame();
|
||||
return 0;
|
||||
}
|
||||
while (!frame_pushed) {
|
||||
input = input_where_a_frame_is_most_needed();
|
||||
ret = ff_request_frame(input);
|
||||
if (ret == AVERROR_EOF) {
|
||||
@@ -252,11 +252,12 @@ Frame scheduling
|
||||
} else if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
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 possibly will be called and do the work.
|
||||
the filter_frame method will be called and do the work.
|
||||
|
||||
Legacy API
|
||||
==========
|
||||
|
4206
doc/filters.texi
4206
doc/filters.texi
File diff suppressed because it is too large
Load Diff
@@ -53,6 +53,14 @@ instructions for installing the libraries.
|
||||
Then pass @code{--enable-libopencore-amrnb} and/or
|
||||
@code{--enable-libopencore-amrwb} to configure to enable them.
|
||||
|
||||
@subsection VisualOn AAC encoder library
|
||||
|
||||
FFmpeg can make use of the VisualOn AACenc library for AAC encoding.
|
||||
|
||||
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
|
||||
instructions for installing the library.
|
||||
Then pass @code{--enable-libvo-aacenc} to configure to enable it.
|
||||
|
||||
@subsection VisualOn AMR-WB encoder library
|
||||
|
||||
FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
|
||||
@@ -137,14 +145,6 @@ x265 is under the GNU Public License Version 2 or later
|
||||
details), you must upgrade FFmpeg's license to GPL in order to use it.
|
||||
@end float
|
||||
|
||||
@section kvazaar
|
||||
|
||||
FFmpeg can make use of the kvazaar library for HEVC encoding.
|
||||
|
||||
Go to @url{https://github.com/ultravideo/kvazaar} and follow the
|
||||
instructions for installing the library. Then pass
|
||||
@code{--enable-libkvazaar} to configure to enable it.
|
||||
|
||||
@section libilbc
|
||||
|
||||
iLBC is a narrowband speech codec that has been made freely available
|
||||
@@ -165,6 +165,12 @@ Go to @url{http://sourceforge.net/projects/zapping/} and follow the instructions
|
||||
installing the library. Then pass @code{--enable-libzvbi} to configure to
|
||||
enable it.
|
||||
|
||||
@float NOTE
|
||||
libzvbi is licensed under the GNU General Public License Version 2 or later
|
||||
(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for details),
|
||||
you must upgrade FFmpeg's license to GPL in order to use it.
|
||||
@end float
|
||||
|
||||
@section AviSynth
|
||||
|
||||
FFmpeg can read AviSynth scripts as input. To enable support, pass
|
||||
@@ -186,17 +192,6 @@ end user having AviSynth or AvxSynth installed - they'll only need to be
|
||||
installed to use AviSynth scripts (obviously).
|
||||
@end float
|
||||
|
||||
@section Intel QuickSync Video
|
||||
|
||||
FFmpeg can use Intel QuickSync Video (QSV) for accelerated encoding and decoding
|
||||
of multiple codecs. To use QSV, FFmpeg must be linked against the @code{libmfx}
|
||||
dispatcher, which loads the actual decoding libraries.
|
||||
|
||||
The dispatcher is open source and can be downloaded from
|
||||
@url{https://github.com/lu-zero/mfx_dispatch.git}. FFmpeg needs to be configured
|
||||
with the @code{--enable-libmfx} option and @code{pkg-config} needs to be able to
|
||||
locate the dispatcher's @code{.pc} files.
|
||||
|
||||
|
||||
@chapter Supported File Formats, Codecs or Features
|
||||
|
||||
@@ -209,14 +204,9 @@ library:
|
||||
|
||||
@multitable @columnfractions .4 .1 .1 .4
|
||||
@item Name @tab Encoding @tab Decoding @tab Comments
|
||||
@item 3dostr @tab @tab X
|
||||
@item 4xm @tab @tab X
|
||||
@tab 4X Technologies format, used in some games.
|
||||
@item 8088flex TMV @tab @tab X
|
||||
@item AAX @tab @tab X
|
||||
@tab Audible Enhanced Audio format, used in audiobooks.
|
||||
@item AA @tab @tab X
|
||||
@tab Audible Format 2, 3, and 4, used in audiobooks.
|
||||
@item ACT Voice @tab @tab X
|
||||
@tab contains G.729 audio
|
||||
@item Adobe Filmstrip @tab X @tab X
|
||||
@@ -228,14 +218,10 @@ library:
|
||||
@tab Multimedia format used in game Heart Of Darkness.
|
||||
@item Apple HTTP Live Streaming @tab @tab X
|
||||
@item Artworx Data Format @tab @tab X
|
||||
@item Interplay ACM @tab @tab X
|
||||
@tab Audio only format used in some Interplay games.
|
||||
@item ADP @tab @tab X
|
||||
@tab Audio format used on the Nintendo Gamecube.
|
||||
@item AFC @tab @tab X
|
||||
@tab Audio format used on the Nintendo Gamecube.
|
||||
@item ADS/SS2 @tab @tab X
|
||||
@tab Audio format used on the PS2.
|
||||
@item APNG @tab X @tab X
|
||||
@item ASF @tab X @tab X
|
||||
@item AST @tab X @tab X
|
||||
@@ -257,8 +243,6 @@ library:
|
||||
@tab Used in Z and Z95 games.
|
||||
@item Brute Force & Ignorance @tab @tab X
|
||||
@tab Used in the game Flash Traffic: City of Angels.
|
||||
@item BFSTM @tab @tab X
|
||||
@tab Audio format used on the Nintendo WiiU (based on BRSTM).
|
||||
@item BRSTM @tab @tab X
|
||||
@tab Audio format used on the Nintendo Wii.
|
||||
@item BWF @tab X @tab X
|
||||
@@ -276,7 +260,6 @@ library:
|
||||
@item CD+G @tab @tab X
|
||||
@tab Video format used by CD+G karaoke disks
|
||||
@item Phantom Cine @tab @tab X
|
||||
@item Cineform HD @tab @tab X
|
||||
@item Commodore CDXL @tab @tab X
|
||||
@tab Amiga CD video format
|
||||
@item Core Audio Format @tab X @tab X
|
||||
@@ -288,10 +271,8 @@ library:
|
||||
@tab Audio format used in some games by CRYO Interactive Entertainment.
|
||||
@item D-Cinema audio @tab X @tab X
|
||||
@item Deluxe Paint Animation @tab @tab X
|
||||
@item DCSTR @tab @tab X
|
||||
@item DFA @tab @tab X
|
||||
@tab This format is used in Chronomaster game
|
||||
@item DirectDraw Surface @tab @tab X
|
||||
@item DSD Stream File (DSF) @tab @tab X
|
||||
@item DV video @tab X @tab X
|
||||
@item DXA @tab @tab X
|
||||
@@ -315,8 +296,6 @@ library:
|
||||
@item G.723.1 @tab X @tab X
|
||||
@item G.729 BIT @tab X @tab X
|
||||
@item G.729 raw @tab @tab X
|
||||
@item GENH @tab @tab X
|
||||
@tab Audio format for various games.
|
||||
@item GIF Animation @tab X @tab X
|
||||
@item GXF @tab X @tab X
|
||||
@tab General eXchange Format SMPTE 360M, used by Thomson Grass Valley
|
||||
@@ -339,7 +318,6 @@ library:
|
||||
@tab A format generated by IndigoVision 8000 video server.
|
||||
@item IVF (On2) @tab X @tab X
|
||||
@tab A format used by libvpx
|
||||
@item Internet Video Recording @tab @tab X
|
||||
@item IRCAM @tab X @tab X
|
||||
@item LATM @tab X @tab X
|
||||
@item LMLM4 @tab @tab X
|
||||
@@ -376,8 +354,6 @@ library:
|
||||
@tab also known as DVB Transport Stream
|
||||
@item MPEG-4 @tab X @tab X
|
||||
@tab MPEG-4 is a variant of QuickTime.
|
||||
@item MSF @tab @tab X
|
||||
@tab Audio format used on the PS3.
|
||||
@item Mirillis FIC video @tab @tab X
|
||||
@tab No cursor rendering.
|
||||
@item MIME multipart JPEG @tab X @tab
|
||||
@@ -461,7 +437,6 @@ library:
|
||||
@item Redirector @tab @tab X
|
||||
@item RedSpark @tab @tab X
|
||||
@item Renderware TeXture Dictionary @tab @tab X
|
||||
@item Resolume DXV @tab @tab X
|
||||
@item RL2 @tab @tab X
|
||||
@tab Audio and video format used in some games by Entertainment Software Partners.
|
||||
@item RPL/ARMovie @tab @tab X
|
||||
@@ -494,8 +469,6 @@ library:
|
||||
@item SoX native format @tab X @tab X
|
||||
@item SUN AU format @tab X @tab X
|
||||
@item SUP raw PGS subtitles @tab @tab X
|
||||
@item SVAG @tab @tab X
|
||||
@tab Audio format used in Konami PS2 games.
|
||||
@item TDSC @tab @tab X
|
||||
@item Text files @tab @tab X
|
||||
@item THP @tab @tab X
|
||||
@@ -503,13 +476,8 @@ library:
|
||||
@item Tiertex Limited SEQ @tab @tab X
|
||||
@tab Tiertex .seq files used in the DOS CD-ROM version of the game Flashback.
|
||||
@item True Audio @tab @tab X
|
||||
@item VAG @tab @tab X
|
||||
@tab Audio format used in many Sony PS2 games.
|
||||
@item VC-1 test bitstream @tab X @tab X
|
||||
@item Vidvox Hap @tab X @tab X
|
||||
@item Vivo @tab @tab X
|
||||
@item VPK @tab @tab X
|
||||
@tab Audio format used in Sony PS games.
|
||||
@item WAV @tab X @tab X
|
||||
@item WavPack @tab X @tab X
|
||||
@item WebM @tab X @tab X
|
||||
@@ -520,11 +488,8 @@ library:
|
||||
@tab Multimedia format used in Westwood Studios games.
|
||||
@item Westwood Studios VQA @tab @tab X
|
||||
@tab Multimedia format used in Westwood Studios games.
|
||||
@item WVE @tab @tab X
|
||||
@item XMV @tab @tab X
|
||||
@tab Microsoft video container used in Xbox games.
|
||||
@item XVAG @tab @tab X
|
||||
@tab Audio format used on the PS3.
|
||||
@item xWMA @tab @tab X
|
||||
@tab Microsoft audio container used by XAudio 2.
|
||||
@item eXtended BINary text (XBIN) @tab @tab X
|
||||
@@ -698,8 +663,6 @@ following image formats are supported:
|
||||
@tab Sorenson H.263 used in Flash
|
||||
@item Forward Uncompressed @tab @tab X
|
||||
@item Fraps @tab @tab X
|
||||
@item Go2Meeting @tab @tab X
|
||||
@tab fourcc: G2M2, G2M3
|
||||
@item Go2Webinar @tab @tab X
|
||||
@tab fourcc: G2M4
|
||||
@item H.261 @tab X @tab X
|
||||
@@ -708,7 +671,7 @@ following image formats are supported:
|
||||
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 @tab E @tab X
|
||||
@tab encoding supported through external library libx264 and OpenH264
|
||||
@item HEVC @tab X @tab X
|
||||
@tab encoding supported through external library libx265 and libkvazaar
|
||||
@tab encoding supported through the external library libx265
|
||||
@item HNM version 4 @tab @tab X
|
||||
@item HuffYUV @tab X @tab X
|
||||
@item HuffYUV FFmpeg variant @tab X @tab X
|
||||
@@ -807,7 +770,6 @@ following image formats are supported:
|
||||
@tab Texture dictionaries used by the Renderware Engine.
|
||||
@item RL2 video @tab @tab X
|
||||
@tab used in some games by Entertainment Software Partners
|
||||
@item Screenpresso @tab @tab X
|
||||
@item Sierra VMD video @tab @tab X
|
||||
@tab Used in Sierra VMD files.
|
||||
@item Silicon Graphics Motion Video Compressor 1 (MVC1) @tab @tab X
|
||||
@@ -874,13 +836,12 @@ following image formats are supported:
|
||||
@item Name @tab Encoding @tab Decoding @tab Comments
|
||||
@item 8SVX exponential @tab @tab X
|
||||
@item 8SVX fibonacci @tab @tab X
|
||||
@item AAC @tab EX @tab X
|
||||
@tab encoding supported through internal encoder and external libraries libfaac and libfdk-aac
|
||||
@item AAC+ @tab E @tab IX
|
||||
@tab encoding supported through external library libfdk-aac
|
||||
@item AAC+ @tab E @tab X
|
||||
@tab encoding supported through external library libaacplus
|
||||
@item AAC @tab E @tab X
|
||||
@tab encoding supported through external library libfaac and libvo-aacenc
|
||||
@item AC-3 @tab IX @tab IX
|
||||
@item ADPCM 4X Movie @tab @tab X
|
||||
@item APDCM Yamaha AICA @tab @tab X
|
||||
@item ADPCM CDROM XA @tab @tab X
|
||||
@item ADPCM Creative Technology @tab @tab X
|
||||
@tab 16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
|
||||
@@ -915,8 +876,7 @@ following image formats are supported:
|
||||
@item ADPCM MS IMA @tab X @tab X
|
||||
@item ADPCM Nintendo Gamecube AFC @tab @tab X
|
||||
@item ADPCM Nintendo Gamecube DTK @tab @tab X
|
||||
@item ADPCM Nintendo THP @tab @tab X
|
||||
@item APDCM Playstation @tab @tab X
|
||||
@item ADPCM Nintendo Gamecube THP @tab @tab X
|
||||
@item ADPCM QT IMA @tab X @tab X
|
||||
@item ADPCM SEGA CRI ADX @tab X @tab X
|
||||
@tab Used in Sega Dreamcast games.
|
||||
@@ -924,7 +884,7 @@ following image formats are supported:
|
||||
@item ADPCM Sound Blaster Pro 2-bit @tab @tab X
|
||||
@item ADPCM Sound Blaster Pro 2.6-bit @tab @tab X
|
||||
@item ADPCM Sound Blaster Pro 4-bit @tab @tab X
|
||||
@item ADPCM VIMA @tab @tab X
|
||||
@item ADPCM VIMA
|
||||
@tab Used in LucasArts SMUSH animations.
|
||||
@item ADPCM Westwood Studios IMA @tab @tab X
|
||||
@tab Used in Westwood Studios games like Command and Conquer.
|
||||
@@ -955,8 +915,6 @@ following image formats are supported:
|
||||
@tab Used in Quake III, Jedi Knight 2 and other computer games.
|
||||
@item DPCM Interplay @tab @tab X
|
||||
@tab Used in various Interplay computer games.
|
||||
@item DPCM Squareroot-Delta-Exact @tab @tab X
|
||||
@tab Used in various games.
|
||||
@item DPCM Sierra Online @tab @tab X
|
||||
@tab Used in Sierra Online game audio files.
|
||||
@item DPCM Sol @tab @tab X
|
||||
@@ -981,7 +939,6 @@ following image formats are supported:
|
||||
@item iLBC (Internet Low Bitrate Codec) @tab E @tab E
|
||||
@tab encoding and decoding supported through external library libilbc
|
||||
@item IMC (Intel Music Coder) @tab @tab X
|
||||
@item Interplay ACM @tab @tab X
|
||||
@item MACE (Macintosh Audio Compression/Expansion) 3:1 @tab @tab X
|
||||
@item MACE (Macintosh Audio Compression/Expansion) 6:1 @tab @tab X
|
||||
@item MLP (Meridian Lossless Packing) @tab @tab X
|
||||
@@ -1066,8 +1023,6 @@ following image formats are supported:
|
||||
@item Windows Media Audio Lossless @tab @tab X
|
||||
@item Windows Media Audio Pro @tab @tab X
|
||||
@item Windows Media Audio Voice @tab @tab X
|
||||
@item Xbox Media Audio 1 @tab @tab X
|
||||
@item Xbox Media Audio 2 @tab @tab X
|
||||
@end multitable
|
||||
|
||||
@code{X} means that encoding (resp. decoding) is supported.
|
||||
|
@@ -1,10 +1,10 @@
|
||||
\input texinfo @c -*- texinfo -*-
|
||||
@documentencoding UTF-8
|
||||
|
||||
@settitle Using Git to develop FFmpeg
|
||||
@settitle Using git to develop FFmpeg
|
||||
|
||||
@titlepage
|
||||
@center @titlefont{Using Git to develop FFmpeg}
|
||||
@center @titlefont{Using git to develop FFmpeg}
|
||||
@end titlepage
|
||||
|
||||
@top
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
@chapter Introduction
|
||||
|
||||
This document aims in giving some quick references on a set of useful Git
|
||||
This document aims in giving some quick references on a set of useful git
|
||||
commands. You should always use the extensive and detailed documentation
|
||||
provided directly by Git:
|
||||
provided directly by git:
|
||||
|
||||
@example
|
||||
git --help
|
||||
@@ -32,21 +32,22 @@ man git-<command>
|
||||
shows information about the subcommand <command>.
|
||||
|
||||
Additional information could be found on the
|
||||
@url{http://gitref.org, Git Reference} website.
|
||||
@url{http://gitref.org, Git Reference} website
|
||||
|
||||
For more information about the Git project, visit the
|
||||
@url{http://git-scm.com/, Git website}.
|
||||
|
||||
@url{http://git-scm.com/, Git website}
|
||||
|
||||
Consult these resources whenever you have problems, they are quite exhaustive.
|
||||
|
||||
What follows now is a basic introduction to Git and some FFmpeg-specific
|
||||
guidelines to ease the contribution to the project.
|
||||
guidelines to ease the contribution to the project
|
||||
|
||||
@chapter Basics Usage
|
||||
|
||||
@section Get Git
|
||||
@section Get GIT
|
||||
|
||||
You can get Git from @url{http://git-scm.com/}
|
||||
You can get git from @url{http://git-scm.com/}
|
||||
Most distribution and operating system provide a package for it.
|
||||
|
||||
|
||||
@@ -65,21 +66,6 @@ git clone git@@source.ffmpeg.org:ffmpeg <target>
|
||||
This will put the FFmpeg sources into the directory @var{<target>} and let
|
||||
you push back your changes to the remote repository.
|
||||
|
||||
@example
|
||||
git clone gil@@ffmpeg.org:ffmpeg-web <target>
|
||||
@end example
|
||||
|
||||
This will put the source of the FFmpeg website into the directory
|
||||
@var{<target>} and let you push back your changes to the remote repository.
|
||||
(Note that @var{gil} stands for GItoLite and is not a typo of @var{git}.)
|
||||
|
||||
If you don't have write-access to the ffmpeg-web repository, you can
|
||||
create patches after making a read-only ffmpeg-web clone:
|
||||
|
||||
@example
|
||||
git clone git://ffmpeg.org/ffmpeg-web <target>
|
||||
@end example
|
||||
|
||||
Make sure that you do not have Windows line endings in your checkouts,
|
||||
otherwise you may experience spurious compilation failures. One way to
|
||||
achieve this is to run
|
||||
@@ -122,7 +108,7 @@ git add [-A] <filename/dirname>
|
||||
git rm [-r] <filename/dirname>
|
||||
@end example
|
||||
|
||||
Git needs to get notified of all changes you make to your working
|
||||
GIT needs to get notified of all changes you make to your working
|
||||
directory that makes files appear or disappear.
|
||||
Line moves across files are automatically tracked.
|
||||
|
||||
@@ -142,8 +128,8 @@ will show all local modifications in your working directory as unified diff.
|
||||
git log <filename(s)>
|
||||
@end example
|
||||
|
||||
You may also use the graphical tools like @command{gitview} or @command{gitk}
|
||||
or the web interface available at @url{http://source.ffmpeg.org/}.
|
||||
You may also use the graphical tools like gitview or gitk or the web
|
||||
interface available at http://source.ffmpeg.org/
|
||||
|
||||
@section Checking source tree status
|
||||
|
||||
@@ -164,7 +150,6 @@ git diff --check
|
||||
to double check your changes before committing them to avoid trouble later
|
||||
on. All experienced developers do this on each and every commit, no matter
|
||||
how small.
|
||||
|
||||
Every one of them has been saved from looking like a fool by this many times.
|
||||
It's very easy for stray debug output or cosmetic modifications to slip in,
|
||||
please avoid problems through this extra level of scrutiny.
|
||||
@@ -187,14 +172,14 @@ to make sure you don't have untracked files or deletions.
|
||||
git add [-i|-p|-A] <filenames/dirnames>
|
||||
@end example
|
||||
|
||||
Make sure you have told Git your name and email address
|
||||
Make sure you have told git your name and email address
|
||||
|
||||
@example
|
||||
git config --global user.name "My Name"
|
||||
git config --global user.email my@@email.invalid
|
||||
@end example
|
||||
|
||||
Use @option{--global} to set the global configuration for all your Git checkouts.
|
||||
Use @var{--global} to set the global configuration for all your git checkouts.
|
||||
|
||||
Git will select the changes to the files for commit. Optionally you can use
|
||||
the interactive or the patch mode to select hunk by hunk what should be
|
||||
@@ -225,7 +210,7 @@ include filenames in log messages, Git provides that information.
|
||||
|
||||
Possibly make the commit message have a terse, descriptive first line, an
|
||||
empty line and then a full description. The first line will be used to name
|
||||
the patch by @command{git format-patch}.
|
||||
the patch by git format-patch.
|
||||
|
||||
@section Preparing a patchset
|
||||
|
||||
@@ -341,12 +326,10 @@ faulty commit disappear from the history.
|
||||
@section Pushing changes to remote trees
|
||||
|
||||
@example
|
||||
git push origin master --dry-run
|
||||
git push
|
||||
@end example
|
||||
|
||||
Will simulate a push of the local master branch to the default remote
|
||||
(@var{origin}). And list which branches and ranges or commits would have been
|
||||
pushed.
|
||||
Will push the changes to the default remote (@var{origin}).
|
||||
Git will prevent you from pushing changes if the local and remote trees are
|
||||
out of sync. Refer to @ref{Updating the source tree to the latest revision}.
|
||||
|
||||
@@ -367,24 +350,23 @@ branches matching the local ones.
|
||||
|
||||
@section Finding a specific svn revision
|
||||
|
||||
Since version 1.7.1 Git supports @samp{:/foo} syntax for specifying commits
|
||||
Since version 1.7.1 git supports @var{:/foo} syntax for specifying commits
|
||||
based on a regular expression. see man gitrevisions
|
||||
|
||||
@example
|
||||
git show :/'as revision 23456'
|
||||
@end example
|
||||
|
||||
will show the svn changeset @samp{r23456}. With older Git versions searching in
|
||||
will show the svn changeset @var{r23456}. With older git versions searching in
|
||||
the @command{git log} output is the easiest option (especially if a pager with
|
||||
search capabilities is used).
|
||||
|
||||
This commit can be checked out with
|
||||
|
||||
@example
|
||||
git checkout -b svn_23456 :/'as revision 23456'
|
||||
@end example
|
||||
|
||||
or for Git < 1.7.1 with
|
||||
or for git < 1.7.1 with
|
||||
|
||||
@example
|
||||
git checkout -b svn_23456 $SHA1
|
||||
@@ -393,7 +375,7 @@ git checkout -b svn_23456 $SHA1
|
||||
where @var{$SHA1} is the commit hash from the @command{git log} output.
|
||||
|
||||
|
||||
@chapter Pre-push checklist
|
||||
@chapter pre-push checklist
|
||||
|
||||
Once you have a set of commits that you feel are ready for pushing,
|
||||
work through the following checklist to doublecheck everything is in
|
||||
@@ -404,7 +386,7 @@ Apply your common sense, but if in doubt, err on the side of caution.
|
||||
First, make sure that the commits and branches you are going to push
|
||||
match what you want pushed and that nothing is missing, extraneous or
|
||||
wrong. You can see what will be pushed by running the git push command
|
||||
with @option{--dry-run} first. And then inspecting the commits listed with
|
||||
with --dry-run first. And then inspecting the commits listed with
|
||||
@command{git log -p 1234567..987654}. The @command{git status} command
|
||||
may help in finding local changes that have been forgotten to be added.
|
||||
|
||||
@@ -413,7 +395,7 @@ Next let the code pass through a full run of our testsuite.
|
||||
@itemize
|
||||
@item @command{make distclean}
|
||||
@item @command{/path/to/ffmpeg/configure}
|
||||
@item @command{make fate}
|
||||
@item @command{make check}
|
||||
@item if fate fails due to missing samples run @command{make fate-rsync} and retry
|
||||
@end itemize
|
||||
|
||||
@@ -431,5 +413,5 @@ recommended.
|
||||
|
||||
@chapter Server Issues
|
||||
|
||||
Contact the project admins at @email{root@@ffmpeg.org} if you have technical
|
||||
problems with the Git server.
|
||||
Contact the project admins @email{root@@ffmpeg.org} if you have technical
|
||||
problems with the GIT server.
|
||||
|
216
doc/indevs.texi
216
doc/indevs.texi
@@ -51,18 +51,6 @@ ffmpeg -f alsa -i hw:0 alsaout.wav
|
||||
For more information see:
|
||||
@url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item sample_rate
|
||||
Set the sample rate in Hz. Default is 48000.
|
||||
|
||||
@item channels
|
||||
Set the number of channels. Default is 2.
|
||||
|
||||
@end table
|
||||
|
||||
@section avfoundation
|
||||
|
||||
AVFoundation input device.
|
||||
@@ -121,24 +109,11 @@ Specify the audio device by its index. Overrides anything given in the input fil
|
||||
@item -pixel_format <FORMAT>
|
||||
Request the video device to use a specific pixel format.
|
||||
If the specified format is not supported, a list of available formats is given
|
||||
and the first one in this list is used instead. Available pixel formats are:
|
||||
und the first one in this list is used instead. Available pixel formats are:
|
||||
@code{monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
|
||||
bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
|
||||
yuv420p, nv12, yuyv422, gray}
|
||||
|
||||
@item -framerate
|
||||
Set the grabbing frame rate. Default is @code{ntsc}, corresponding to a
|
||||
frame rate of @code{30000/1001}.
|
||||
|
||||
@item -video_size
|
||||
Set the video frame size.
|
||||
|
||||
@item -capture_cursor
|
||||
Capture the mouse pointer. Default is 0.
|
||||
|
||||
@item -capture_mouse_clicks
|
||||
Capture the screen mouse clicks. Default is 0.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -175,36 +150,6 @@ $ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
|
||||
|
||||
BSD video input device.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item framerate
|
||||
Set the frame rate.
|
||||
|
||||
@item video_size
|
||||
Set the video frame size. Default is @code{vga}.
|
||||
|
||||
@item standard
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item pal
|
||||
|
||||
@item ntsc
|
||||
|
||||
@item secam
|
||||
|
||||
@item paln
|
||||
|
||||
@item palm
|
||||
|
||||
@item ntscj
|
||||
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@section decklink
|
||||
|
||||
The decklink input device provides capture capabilities for Blackmagic
|
||||
@@ -218,8 +163,7 @@ On Windows, you need to run the IDL files through @command{widl}.
|
||||
DeckLink is very picky about the formats it supports. Pixel format is
|
||||
uyvy422 or v210, framerate and video size must be determined for your device with
|
||||
@command{-list_formats 1}. Audio sample rate is always 48 kHz and the number
|
||||
of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
|
||||
audio track.
|
||||
of channels can be 2, 8 or 16.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@@ -237,20 +181,6 @@ Defaults to @option{false}.
|
||||
If set to @samp{1}, video is captured in 10 bit v210 instead
|
||||
of uyvy422. Not all Blackmagic devices support this option.
|
||||
|
||||
@item teletext_lines
|
||||
If set to nonzero, an additional teletext stream will be captured from the
|
||||
vertical ancillary data. This option is a bitmask of the VBI lines checked,
|
||||
specifically lines 6 to 22, and lines 318 to 335. Line 6 is the LSB in the mask.
|
||||
Selected lines which do not contain teletext information will be ignored. You
|
||||
can use the special @option{all} constant to select all possible lines, or
|
||||
@option{standard} to skip lines 6, 318 and 319, which are not compatible with all
|
||||
receivers. Capturing teletext only works for SD PAL sources in 8 bit mode.
|
||||
To use this option, ffmpeg needs to be compiled with @code{--enable-libzvbi}.
|
||||
|
||||
@item channels
|
||||
Defines number of audio channels to capture. Must be @samp{2}, @samp{8} or @samp{16}.
|
||||
Defaults to @samp{2}.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -282,9 +212,15 @@ ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy -v
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 1080i50 with 16 audio channels:
|
||||
Capture video clip at 720p50 with 32bit audio:
|
||||
@example
|
||||
ffmpeg -channels 16 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy -vcodec copy output.avi
|
||||
ffmpeg -bm_audiodepth 32 -f decklink -i 'UltraStudio Mini Recorder@@14' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 576i50 with 8 audio channels:
|
||||
@example
|
||||
ffmpeg -bm_channels 8 -f decklink -i 'UltraStudio Mini Recorder@@3' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
@@ -339,11 +275,11 @@ If set to @option{true}, print a list of selected device's options
|
||||
and exit.
|
||||
|
||||
@item video_device_number
|
||||
Set video device number for devices with the same name (starts at 0,
|
||||
Set video device number for devices with same name (starts at 0,
|
||||
defaults to 0).
|
||||
|
||||
@item audio_device_number
|
||||
Set audio device number for devices with the same name (starts at 0,
|
||||
Set audio device number for devices with same name (starts at 0,
|
||||
defaults to 0).
|
||||
|
||||
@item pixel_format
|
||||
@@ -493,27 +429,6 @@ $ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_numbe
|
||||
|
||||
Linux DV 1394 input device.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item framerate
|
||||
Set the frame rate. Default is 25.
|
||||
|
||||
@item standard
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item pal
|
||||
|
||||
@item ntsc
|
||||
|
||||
@end table
|
||||
|
||||
Default value is @code{ntsc}.
|
||||
|
||||
@end table
|
||||
|
||||
@section fbdev
|
||||
|
||||
Linux framebuffer input device.
|
||||
@@ -526,27 +441,18 @@ console. It is accessed through a file device node, usually
|
||||
For more detailed information read the file
|
||||
Documentation/fb/framebuffer.txt included in the Linux source tree.
|
||||
|
||||
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
|
||||
|
||||
To record from the framebuffer device @file{/dev/fb0} with
|
||||
@command{ffmpeg}:
|
||||
@example
|
||||
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
|
||||
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
|
||||
@end example
|
||||
|
||||
You can take a single screenshot image with the command:
|
||||
@example
|
||||
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
|
||||
ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
|
||||
@end example
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item framerate
|
||||
Set the frame rate. Default is 25.
|
||||
|
||||
@end table
|
||||
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
|
||||
|
||||
@section gdigrab
|
||||
|
||||
@@ -732,15 +638,6 @@ $ jack_connect metro:120_bpm ffmpeg:input_1
|
||||
For more information read:
|
||||
@url{http://jackaudio.org/}
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item channels
|
||||
Set the number of channels. Default is 2.
|
||||
|
||||
@end table
|
||||
|
||||
@section lavfi
|
||||
|
||||
Libavfilter input virtual device.
|
||||
@@ -781,9 +678,6 @@ Set the filename of the filtergraph to be read and sent to the other
|
||||
filters. Syntax of the filtergraph is the same as the one specified by
|
||||
the option @var{graph}.
|
||||
|
||||
@item dumpgraph
|
||||
Dump graph to stderr.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -985,19 +879,6 @@ ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
|
||||
For more information about OSS see:
|
||||
@url{http://manuals.opensound.com/usersguide/dsp.html}
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item sample_rate
|
||||
Set the sample rate in Hz. Default is 48000.
|
||||
|
||||
@item channels
|
||||
Set the number of channels. Default is 2.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@section pulse
|
||||
|
||||
PulseAudio input device.
|
||||
@@ -1038,10 +919,6 @@ Specify the number of bytes per frame, by default it is set to 1024.
|
||||
@item fragment_size
|
||||
Specify the minimal buffering fragment in PulseAudio, it will affect the
|
||||
audio latency. By default it is unset.
|
||||
|
||||
@item wallclock
|
||||
Set the initial PTS using the current time. Default is 1.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -1077,22 +954,6 @@ ffmpeg -f qtkit -i "default" out.mpg
|
||||
ffmpeg -f qtkit -list_devices true -i ""
|
||||
@end example
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item frame_rate
|
||||
Set frame rate. Default is 30.
|
||||
|
||||
@item list_devices
|
||||
If set to @code{true}, print a list of devices and exit. Default is
|
||||
@code{false}.
|
||||
|
||||
@item video_device_index
|
||||
Select the video device by index for devices with the same name (starts at 0).
|
||||
|
||||
@end table
|
||||
|
||||
@section sndio
|
||||
|
||||
sndio input device.
|
||||
@@ -1110,18 +971,6 @@ command:
|
||||
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
|
||||
@end example
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item sample_rate
|
||||
Set the sample rate in Hz. Default is 48000.
|
||||
|
||||
@item channels
|
||||
Set the number of channels. Default is 2.
|
||||
|
||||
@end table
|
||||
|
||||
@section video4linux2, v4l2
|
||||
|
||||
Video4Linux2 input video device.
|
||||
@@ -1244,10 +1093,6 @@ Force conversion from monotonic to absolute timestamps.
|
||||
@end table
|
||||
|
||||
Default value is @code{default}.
|
||||
|
||||
@item use_libv4l2
|
||||
Use libv4l2 (v4l-utils) conversion functions. Default is 0.
|
||||
|
||||
@end table
|
||||
|
||||
@section vfwcap
|
||||
@@ -1258,19 +1103,6 @@ The filename passed as input is the capture driver number, ranging from
|
||||
0 to 9. You may use "list" as filename to print a list of drivers. Any
|
||||
other filename will be interpreted as device number 0.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item video_size
|
||||
Set the video frame size.
|
||||
|
||||
@item framerate
|
||||
Set the grabbing frame rate. Default value is @code{ntsc},
|
||||
corresponding to a frame rate of @code{30000/1001}.
|
||||
|
||||
@end table
|
||||
|
||||
@section x11grab
|
||||
|
||||
X11 video input device.
|
||||
@@ -1373,13 +1205,17 @@ Set the video frame size. Default value is @code{vga}.
|
||||
Use the MIT-SHM extension for shared memory. Default value is @code{1}.
|
||||
It may be necessary to disable it for remote displays (legacy x11grab
|
||||
only).
|
||||
|
||||
@item grab_x
|
||||
@item grab_y
|
||||
Set the grabbing region coordinates. They are expressed as offset from
|
||||
the top left corner of the X11 window and correspond to the
|
||||
@var{x_offset} and @var{y_offset} parameters in the device name. The
|
||||
default value for both options is 0.
|
||||
@end table
|
||||
|
||||
@subsection @var{grab_x} @var{grab_y} AVOption
|
||||
|
||||
The syntax is:
|
||||
@example
|
||||
-grab_x @var{x_offset} -grab_y @var{y_offset}
|
||||
@end example
|
||||
|
||||
Set the grabbing region coordinates. They are expressed as offset from the top left
|
||||
corner of the X11 window. The default value is 0.
|
||||
|
||||
|
||||
@c man end INPUT DEVICES
|
||||
|
@@ -1,6 +1,8 @@
|
||||
FFmpeg's bug/feature request tracker manual
|
||||
=================================================
|
||||
|
||||
NOTE: This is a draft.
|
||||
|
||||
Overview:
|
||||
---------
|
||||
|
||||
@@ -20,9 +22,9 @@ a mail for every change to every issue.
|
||||
(the above does all work already after light testing)
|
||||
|
||||
The subscription URL for the ffmpeg-trac list is:
|
||||
https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
||||
http(s)://lists.ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
||||
The URL of the webinterface of the tracker is:
|
||||
https://trac.ffmpeg.org
|
||||
http(s)://trac.ffmpeg.org
|
||||
|
||||
Type:
|
||||
-----
|
||||
@@ -40,16 +42,12 @@ feature request / enhancement
|
||||
where the current implementation cannot be considered wrong.
|
||||
|
||||
license violation
|
||||
Ticket to keep track of (L)GPL violations of ffmpeg by others.
|
||||
ticket to keep track of (L)GPL violations of ffmpeg by others
|
||||
|
||||
sponsoring request
|
||||
Developer requests for hardware, software, specifications, money,
|
||||
refunds, etc.
|
||||
|
||||
task
|
||||
A task/reminder such as setting up a FATE client, adding filters to
|
||||
Trac, etc.
|
||||
|
||||
Priority:
|
||||
---------
|
||||
critical
|
||||
@@ -68,8 +66,7 @@ important
|
||||
don't exist in a past revision or another branch.
|
||||
|
||||
normal
|
||||
Default setting. Use this if the bug does not match the other
|
||||
priorities or if you are unsure of what priority to choose.
|
||||
|
||||
|
||||
minor
|
||||
Bugs about things like spelling errors, "mp2" instead of
|
||||
@@ -166,23 +163,14 @@ Component:
|
||||
avcodec
|
||||
issues in libavcodec/*
|
||||
|
||||
avdevice
|
||||
issues in libavdevice/*
|
||||
|
||||
avfilter
|
||||
issues in libavfilter/*
|
||||
|
||||
avformat
|
||||
issues in libavformat/*
|
||||
|
||||
avutil
|
||||
issues in libavutil/*
|
||||
|
||||
build system
|
||||
issues in or related to configure/Makefile
|
||||
|
||||
documentation
|
||||
issues in or related to doc/*
|
||||
regression test
|
||||
issues in tests/*
|
||||
|
||||
ffmpeg
|
||||
issues in or related to ffmpeg.c
|
||||
@@ -196,23 +184,11 @@ ffprobe
|
||||
ffserver
|
||||
issues in or related to ffserver.c
|
||||
|
||||
postproc
|
||||
issues in libpostproc/*
|
||||
build system
|
||||
issues in or related to configure/Makefile
|
||||
|
||||
swresample
|
||||
issues in libswresample/*
|
||||
|
||||
swscale
|
||||
issues in libswscale/*
|
||||
regression
|
||||
bugs which were not present in a past revision
|
||||
|
||||
trac
|
||||
issues related to our issue tracker
|
||||
|
||||
undetermined
|
||||
default component; choose this if unsure
|
||||
|
||||
website
|
||||
issues related to the website
|
||||
|
||||
wiki
|
||||
issues related to the wiki
|
||||
|
@@ -47,16 +47,12 @@ Files that have MIPS copyright notice in them:
|
||||
* libavutil/mips/
|
||||
float_dsp_mips.c
|
||||
libm_mips.h
|
||||
softfloat_tables.h
|
||||
* libavcodec/
|
||||
fft_fixed_32.c
|
||||
fft_init_table.c
|
||||
fft_table.h
|
||||
mdct_fixed_32.c
|
||||
* libavcodec/mips/
|
||||
aacdec_fixed.c
|
||||
aacsbr_fixed.c
|
||||
aacsbr_template.c
|
||||
aaccoder_mips.c
|
||||
aacpsy_mips.h
|
||||
ac3dsp_mips.c
|
||||
|
@@ -54,7 +54,7 @@ thread.
|
||||
If the codec allocates writable tables in its init(), add an init_thread_copy()
|
||||
which re-allocates them for other threads.
|
||||
|
||||
Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
|
||||
Add CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
|
||||
speed gain at this point but it should work.
|
||||
|
||||
If there are inter-frame dependencies, so the codec calls
|
||||
|
178
doc/muxers.texi
178
doc/muxers.texi
@@ -37,61 +37,6 @@ ID3v2.3 and ID3v2.4) are supported. The default is version 4.
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{asf}
|
||||
@section asf
|
||||
|
||||
Advanced Systems Format muxer.
|
||||
|
||||
Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
|
||||
muxer too.
|
||||
|
||||
@subsection Options
|
||||
|
||||
It accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item packet_size
|
||||
Set the muxer packet size. By tuning this setting you may reduce data
|
||||
fragmentation or muxer overhead depending on your source. Default value is
|
||||
3200, minimum is 100, maximum is 64k.
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{chromaprint}
|
||||
@section chromaprint
|
||||
|
||||
Chromaprint fingerprinter
|
||||
|
||||
This muxer feeds audio data to the Chromaprint library, which generates
|
||||
a fingerprint for the provided audio data. It takes a single signed
|
||||
native-endian 16-bit raw audio stream.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item silence_threshold
|
||||
Threshold for detecting silence, ranges from 0 to 32767. -1 for default
|
||||
(required for use with the AcoustID service).
|
||||
|
||||
@item algorithm
|
||||
Algorithm index to fingerprint with.
|
||||
|
||||
@item fp_format
|
||||
Format to output the fingerprint as. Accepts the following options:
|
||||
@table @samp
|
||||
@item raw
|
||||
Binary raw fingerprint
|
||||
|
||||
@item compressed
|
||||
Binary compressed fingerprint
|
||||
|
||||
@item base64
|
||||
Base64 compressed fingerprint
|
||||
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@anchor{crc}
|
||||
@section crc
|
||||
|
||||
@@ -318,62 +263,6 @@ ffmpeg in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
|
||||
This example will produce the playlist, @file{out.m3u8}, and segment files:
|
||||
@file{file000.ts}, @file{file001.ts}, @file{file002.ts}, etc.
|
||||
|
||||
@item hls_key_info_file @var{key_info_file}
|
||||
Use the information in @var{key_info_file} for segment encryption. The first
|
||||
line of @var{key_info_file} specifies the key URI written to the playlist. The
|
||||
key URL is used to access the encryption key during playback. The second line
|
||||
specifies the path to the key file used to obtain the key during the encryption
|
||||
process. The key file is read as a single packed array of 16 octets in binary
|
||||
format. The optional third line specifies the initialization vector (IV) as a
|
||||
hexadecimal string to be used instead of the segment sequence number (default)
|
||||
for encryption. Changes to @var{key_info_file} will result in segment
|
||||
encryption with the new key/IV and an entry in the playlist for the new key
|
||||
URI/IV.
|
||||
|
||||
Key info file format:
|
||||
@example
|
||||
@var{key URI}
|
||||
@var{key file path}
|
||||
@var{IV} (optional)
|
||||
@end example
|
||||
|
||||
Example key URIs:
|
||||
@example
|
||||
http://server/file.key
|
||||
/path/to/file.key
|
||||
file.key
|
||||
@end example
|
||||
|
||||
Example key file paths:
|
||||
@example
|
||||
file.key
|
||||
/path/to/file.key
|
||||
@end example
|
||||
|
||||
Example IV:
|
||||
@example
|
||||
0123456789ABCDEF0123456789ABCDEF
|
||||
@end example
|
||||
|
||||
Key info file example:
|
||||
@example
|
||||
http://server/file.key
|
||||
/path/to/file.key
|
||||
0123456789ABCDEF0123456789ABCDEF
|
||||
@end example
|
||||
|
||||
Example shell script:
|
||||
@example
|
||||
#!/bin/sh
|
||||
BASE_URL=$@{1:-'.'@}
|
||||
openssl rand 16 > file.key
|
||||
echo $BASE_URL/file.key > file.keyinfo
|
||||
echo file.key >> file.keyinfo
|
||||
echo $(openssl rand -hex 16) >> file.keyinfo
|
||||
ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
|
||||
-hls_key_info_file file.keyinfo out.m3u8
|
||||
@end example
|
||||
|
||||
@item hls_flags single_file
|
||||
If this flag is set, the muxer will store all segments in a single MPEG-TS
|
||||
file, and will use byte ranges in the playlist. HLS playlists generated with
|
||||
@@ -604,7 +493,7 @@ MD5 testing format.
|
||||
This muxer computes and prints the MD5 hash of all the input audio
|
||||
and video frames. By default audio frames are converted to signed
|
||||
16-bit raw audio and video frames to raw video before computing the
|
||||
hash. Timestamps are ignored.
|
||||
hash.
|
||||
|
||||
The output of the muxer consists of a single line of the form:
|
||||
MD5=@var{MD5}, where @var{MD5} is a hexadecimal number representing
|
||||
@@ -722,13 +611,6 @@ point on IIS with this muxer. Example:
|
||||
ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
|
||||
@end example
|
||||
|
||||
@subsection Audible AAX
|
||||
|
||||
Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
|
||||
@example
|
||||
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
|
||||
@end example
|
||||
|
||||
@section mp3
|
||||
|
||||
The MP3 muxer writes a raw MP3 stream with the following optional features:
|
||||
@@ -821,10 +703,6 @@ Set a constant muxrate (default VBR).
|
||||
@item -pcr_period @var{numer}
|
||||
Override the default PCR retransmission time (default 20ms), ignored
|
||||
if variable muxrate is selected.
|
||||
@item pat_period @var{number}
|
||||
Maximal time in seconds between PAT/PMT tables.
|
||||
@item sdt_period @var{number}
|
||||
Maximal time in seconds between SDT tables.
|
||||
@item -pes_payload_size @var{number}
|
||||
Set minimum PES packet payload in bytes.
|
||||
@item -mpegts_flags @var{flags}
|
||||
@@ -876,10 +754,6 @@ Option mpegts_flags may take a set of such flags:
|
||||
Reemit PAT/PMT before writing the next packet.
|
||||
@item latm
|
||||
Use LATM packetization for AAC.
|
||||
@item pat_pmt_at_frames
|
||||
Reemit PAT and PMT at each video frame.
|
||||
@item system_b
|
||||
Conform to System B (DVB) instead of System A (ATSC).
|
||||
@end table
|
||||
|
||||
@subsection Example
|
||||
@@ -896,21 +770,6 @@ ffmpeg -i file.mpg -c copy \
|
||||
-y out.ts
|
||||
@end example
|
||||
|
||||
@section mxf, mxf_d10
|
||||
|
||||
MXF muxer.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The muxer options are:
|
||||
|
||||
@table @option
|
||||
@item store_user_comments @var{bool}
|
||||
Set if user comments should be stored if available or never.
|
||||
IRT D-10 does not allow user comments. The default is thus to write them for
|
||||
mxf but not for mxf_d10
|
||||
@end table
|
||||
|
||||
@section null
|
||||
|
||||
Null muxer.
|
||||
@@ -1049,6 +908,13 @@ Allow caching (only affects M3U8 list files).
|
||||
Allow live-friendly file generation.
|
||||
@end table
|
||||
|
||||
@item segment_list_type @var{type}
|
||||
Select the listing format.
|
||||
@table @option
|
||||
@item @var{flat} use a simple flat list of entries.
|
||||
@item @var{hls} use a m3u8-like structure.
|
||||
@end table
|
||||
|
||||
@item segment_list_size @var{size}
|
||||
Update the list file so that it contains at most @var{size}
|
||||
segments. If 0 the list file will contain all the segments. Default
|
||||
@@ -1058,9 +924,6 @@ value is 0.
|
||||
Prepend @var{prefix} to each entry. Useful to generate absolute paths.
|
||||
By default no prefix is applied.
|
||||
|
||||
@item segment_list_type @var{type}
|
||||
Select the listing format.
|
||||
|
||||
The following values are recognized:
|
||||
@table @samp
|
||||
@item flat
|
||||
@@ -1120,28 +983,6 @@ to create files at 12:00 o'clock, 12:15, 12:30, etc.
|
||||
|
||||
Default value is "0".
|
||||
|
||||
@item segment_clocktime_offset @var{duration}
|
||||
Delay the segment splitting times with the specified duration when using
|
||||
@option{segment_atclocktime}.
|
||||
|
||||
For example with @option{segment_time} set to "900" and
|
||||
@option{segment_clocktime_offset} set to "300" this makes it possible to
|
||||
create files at 12:05, 12:20, 12:35, etc.
|
||||
|
||||
Default value is "0".
|
||||
|
||||
@item segment_clocktime_wrap_duration @var{duration}
|
||||
Force the segmenter to only start a new segment if a packet reaches the muxer
|
||||
within the specified duration after the segmenting clock time. This way you
|
||||
can make the segmenter more resilient to backward local time jumps, such as
|
||||
leap seconds or transition to standard time from daylight savings time.
|
||||
|
||||
Assuming that the delay between the packets of your source is less than 0.5
|
||||
second you can detect a leap second by specifying 0.5 as the duration.
|
||||
|
||||
Default is the maximum possible duration which means starting a new segment
|
||||
regardless of the elapsed time since the last clock time.
|
||||
|
||||
@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".
|
||||
@@ -1331,8 +1172,7 @@ Several bitstream filters can be specified, separated by ",".
|
||||
@item select
|
||||
Select the streams that should be mapped to the slave output,
|
||||
specified by a stream specifier. If not specified, this defaults to
|
||||
all the input streams. You may use multiple stream specifiers
|
||||
separated by commas (@code{,}) e.g.: @code{a:0,v}
|
||||
all the input streams.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
@@ -107,13 +107,8 @@ Notes:
|
||||
|
||||
@itemize
|
||||
|
||||
@item Building for the MSYS environment is discouraged, MSYS2 provides a full
|
||||
MinGW-w64 environment through @file{mingw64_shell.bat} or
|
||||
@file{mingw32_shell.bat} that should be used instead of the environment
|
||||
provided by @file{msys2_shell.bat}.
|
||||
|
||||
@item Building using MSYS2 can be sped up by disabling implicit rules in the
|
||||
Makefile by calling @code{make -r} instead of plain @code{make}. This
|
||||
@item Building natively using MSYS2 can be sped up by disabling implicit rules
|
||||
in the Makefile by calling @code{make -r} instead of plain @code{make}. This
|
||||
speed up is close to non-existent for normal one-off builds and is only
|
||||
noticeable when running make for a second time (for example during
|
||||
@code{make install}).
|
||||
@@ -127,25 +122,6 @@ libavformat) as DLLs.
|
||||
|
||||
@end itemize
|
||||
|
||||
@subsection Native Windows compilation using MSYS2
|
||||
|
||||
The MSYS2 MinGW-w64 environment provides ready to use toolchains and dependencies
|
||||
through @command{pacman}.
|
||||
|
||||
Make sure to use @file{mingw64_shell.bat} or @file{mingw32_shell.bat} to have
|
||||
the correct MinGW-w64 environment. The default install provides shortcuts to
|
||||
them under @command{MinGW-w64 Win64 Shell} and @command{MinGW-w64 Win32 Shell}.
|
||||
|
||||
@example
|
||||
# normal msys2 packages
|
||||
pacman -S make pkgconf diffutils
|
||||
|
||||
# mingw-w64 packages and toolchains
|
||||
pacman -S mingw-w64-x86_64-yasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL
|
||||
@end example
|
||||
|
||||
To target 32bit replace the @code{x86_64} with @code{i686} in the command above.
|
||||
|
||||
@section Microsoft Visual C++ or Intel C++ Compiler for Windows
|
||||
|
||||
FFmpeg can be built with MSVC 2012 or earlier using a C99-to-C89 conversion utility
|
||||
@@ -199,6 +175,12 @@ Notes:
|
||||
|
||||
@itemize
|
||||
|
||||
@item It is possible that coreutils' @code{link.exe} conflicts with MSVC's linker.
|
||||
You can find out by running @code{which link} to see which @code{link.exe} you
|
||||
are using. If it is located at @code{/bin/link.exe}, then you have the wrong one
|
||||
in your @code{PATH}. Either move or remove that copy, or make sure MSVC's
|
||||
@code{link.exe} takes precedence in your @code{PATH} over coreutils'.
|
||||
|
||||
@item If you wish to build with zlib support, you will have to grab a compatible
|
||||
zlib binary from somewhere, with an MSVC import lib, or if you wish to link
|
||||
statically, you can follow the instructions below to build a compatible
|
||||
@@ -314,7 +296,7 @@ These library packages are only available from
|
||||
@uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
|
||||
|
||||
@example
|
||||
yasm, libSDL-devel, libfaac-devel, libgsm-devel, libmp3lame-devel,
|
||||
yasm, libSDL-devel, libfaac-devel, libaacplus-devel, libgsm-devel, libmp3lame-devel,
|
||||
libschroedinger1.0-devel, speex-devel, libtheora-devel, libxvidcore-devel
|
||||
@end example
|
||||
|
||||
|
@@ -1,22 +1,3 @@
|
||||
@chapter Protocol Options
|
||||
@c man begin PROTOCOL OPTIONS
|
||||
|
||||
The libavformat library provides some generic global options, which
|
||||
can be set on all the protocols. In addition each protocol may support
|
||||
so-called private options, which are specific for that component.
|
||||
|
||||
The list of supported options follows:
|
||||
|
||||
@table @option
|
||||
@item protocol_whitelist @var{list} (@emph{input})
|
||||
Set a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocols
|
||||
prefixed by "-" are disabled.
|
||||
All protocols are allowed by default but protocols used by an another
|
||||
protocol (nested protocols) are restricted to a per protocol subset.
|
||||
@end table
|
||||
|
||||
@c man end PROTOCOL OPTIONS
|
||||
|
||||
@chapter Protocols
|
||||
@c man begin PROTOCOLS
|
||||
|
||||
@@ -38,18 +19,6 @@ supported protocols.
|
||||
|
||||
A description of the currently available protocols follows.
|
||||
|
||||
@section async
|
||||
|
||||
Asynchronous data filling wrapper for input stream.
|
||||
|
||||
Fill data in a background thread, to decouple I/O operation from demux thread.
|
||||
|
||||
@example
|
||||
async:@var{URL}
|
||||
async:http://host/resource
|
||||
async:cache:http://host/resource
|
||||
@end example
|
||||
|
||||
@section bluray
|
||||
|
||||
Read BluRay playlist.
|
||||
@@ -259,9 +228,6 @@ If set to 1 use chunked Transfer-Encoding for posts, default is 1.
|
||||
@item content_type
|
||||
Set a specific content type for the POST messages.
|
||||
|
||||
@item http_proxy
|
||||
set HTTP proxy to tunnel through e.g. http://example.com:1234
|
||||
|
||||
@item headers
|
||||
Set custom HTTP headers, can override built in default headers. The
|
||||
value must be a string encoding the headers.
|
||||
@@ -282,16 +248,6 @@ Set timeout in microseconds of socket I/O operations used by the underlying low
|
||||
operation. By default it is set to -1, which means that the timeout is
|
||||
not specified.
|
||||
|
||||
@item reconnect_at_eof
|
||||
If set then eof is treated like an error and causes reconnection, this is useful
|
||||
for live / endless streams.
|
||||
|
||||
@item reconnect_streamed
|
||||
If set then even streamed/non seekable streams will be reconnected on errors.
|
||||
|
||||
@item reconnect_delay_max
|
||||
Sets the maximum delay in seconds after which to give up reconnecting
|
||||
|
||||
@item mime_type
|
||||
Export the MIME type.
|
||||
|
||||
@@ -336,8 +292,6 @@ autodetection in the future.
|
||||
If set to 1 enables experimental HTTP server. This can be used to send data when
|
||||
used as an output option, or read data from a client with HTTP POST when used as
|
||||
an input option.
|
||||
If set to 2 enables experimental mutli-client HTTP server. This is not yet implemented
|
||||
in ffmpeg.c or ffserver.c and thus must not be used as a command line option.
|
||||
@example
|
||||
# Server side (sending):
|
||||
ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://@var{server}:@var{port}
|
||||
@@ -1166,12 +1120,6 @@ than this time interval, raise error.
|
||||
|
||||
@item listen_timeout=@var{milliseconds}
|
||||
Set listen timeout, expressed in milliseconds.
|
||||
|
||||
@item recv_buffer_size=@var{bytes}
|
||||
Set receive buffer size, expressed bytes.
|
||||
|
||||
@item send_buffer_size=@var{bytes}
|
||||
Set send buffer size, expressed bytes.
|
||||
@end table
|
||||
|
||||
The following example shows how to setup a listening TCP connection
|
||||
|
@@ -66,8 +66,8 @@ Set rematrix volume. Default value is 1.0.
|
||||
|
||||
@item rematrix_maxval
|
||||
Set maximum output value for rematrixing.
|
||||
This can be used to prevent clipping vs. preventing volume reduction.
|
||||
A value of 1.0 prevents clipping.
|
||||
This can be used to prevent clipping vs. preventing volumn reduction
|
||||
A value of 1.0 prevents cliping.
|
||||
|
||||
@item flags, swr_flags
|
||||
Set flags used by the converter. Default value is 0.
|
||||
@@ -94,13 +94,13 @@ select triangular dither
|
||||
@item triangular_hp
|
||||
select triangular dither with high pass
|
||||
@item lipshitz
|
||||
select Lipshitz noise shaping dither.
|
||||
select lipshitz noise shaping dither
|
||||
@item shibata
|
||||
select Shibata noise shaping dither.
|
||||
select shibata noise shaping dither
|
||||
@item low_shibata
|
||||
select low Shibata noise shaping dither.
|
||||
select low shibata noise shaping dither
|
||||
@item high_shibata
|
||||
select high Shibata noise shaping dither.
|
||||
select high shibata noise shaping dither
|
||||
@item f_weighted
|
||||
select f-weighted noise shaping dither
|
||||
@item modified_e_weighted
|
||||
@@ -132,7 +132,7 @@ For swr only, set resampling phase shift, default value is 10, and must be in
|
||||
the interval [0,30].
|
||||
|
||||
@item linear_interp
|
||||
Use linear interpolation if set to 1, default value is 0.
|
||||
Use Linear Interpolation if set to 1, default value is 0.
|
||||
|
||||
@item cutoff
|
||||
Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
|
||||
@@ -214,13 +214,13 @@ It accepts the following values:
|
||||
@item cubic
|
||||
select cubic
|
||||
@item blackman_nuttall
|
||||
select Blackman Nuttall windowed sinc
|
||||
select Blackman Nuttall Windowed Sinc
|
||||
@item kaiser
|
||||
select Kaiser windowed sinc
|
||||
select Kaiser Windowed Sinc
|
||||
@end table
|
||||
|
||||
@item kaiser_beta
|
||||
For swr only, set Kaiser window beta value. Must be a double float value in the
|
||||
For swr only, set Kaiser Window Beta value. Must be an integer in the
|
||||
interval [2,16], default value is 9.
|
||||
|
||||
@item output_sample_bits
|
||||
|
@@ -46,7 +46,7 @@ Select Gaussian rescaling algorithm.
|
||||
Select sinc rescaling algorithm.
|
||||
|
||||
@item lanczos
|
||||
Select Lanczos rescaling algorithm.
|
||||
Select lanczos rescaling algorithm.
|
||||
|
||||
@item spline
|
||||
Select natural bicubic spline rescaling algorithm.
|
||||
@@ -91,7 +91,6 @@ Select source range.
|
||||
@item dst_range
|
||||
Select destination range.
|
||||
|
||||
@anchor{sws_params}
|
||||
@item param0, param1
|
||||
Set scaling algorithm parameters. The specified values are specific of
|
||||
some scaling algorithms and ignored by others. The specified values
|
||||
@@ -123,22 +122,6 @@ a_dither).
|
||||
|
||||
@end table
|
||||
|
||||
@item alphablend
|
||||
Set the alpha blending to use when the input has alpha but the output does not.
|
||||
Default value is @samp{none}.
|
||||
|
||||
@table @samp
|
||||
@item uniform_color
|
||||
Blend onto a uniform background color
|
||||
|
||||
@item checkerboard
|
||||
Blend onto a checkerboard
|
||||
|
||||
@item none
|
||||
No blending
|
||||
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@c man end SCALER OPTIONS
|
||||
|
@@ -384,7 +384,7 @@ sub postprocess
|
||||
# @* is also impossible in .pod; we discard it and any newline that
|
||||
# follows it. Similarly, our macro @gol must be discarded.
|
||||
|
||||
s/\@anchor\{(?:[^\}]*)\}//g;
|
||||
s/\@anchor{(?:[^\}]*)\}//g;
|
||||
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
|
||||
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
|
||||
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
|
||||
|
@@ -238,14 +238,6 @@ The following abbreviations are recognized:
|
||||
480x320
|
||||
@item qhd
|
||||
960x540
|
||||
@item 2kdci
|
||||
2048x1080
|
||||
@item 4kdci
|
||||
4096x2160
|
||||
@item uhd2160
|
||||
3840x2160
|
||||
@item uhd4320
|
||||
7680x4320
|
||||
@end table
|
||||
|
||||
@anchor{video rate syntax}
|
||||
|
@@ -3,8 +3,8 @@ libavfilter.
|
||||
|
||||
Foreword: just like everything else in FFmpeg, libavfilter is monolithic, which
|
||||
means that it is highly recommended that you submit your filters to the FFmpeg
|
||||
development mailing-list and make sure that they are applied. Otherwise, your filters
|
||||
are likely to have a very short lifetime due to more or less regular internal API
|
||||
development mailing-list and make sure it is applied. Otherwise, your filter is
|
||||
likely to have a very short lifetime due to more a less regular internal API
|
||||
changes, and a limited distribution, review, and testing.
|
||||
|
||||
Bootstrap
|
||||
@@ -64,7 +64,7 @@ filter, so you can update the boilerplate with your credits.
|
||||
Doxy
|
||||
----
|
||||
|
||||
Next chunk is the Doxygen about the file. See https://ffmpeg.org/doxygen/trunk/.
|
||||
Next chunk is the Doxygen about the file. See http://ffmpeg.org/doxygen/trunk/.
|
||||
Detail here what the filter is, does, and add some references if you feel like
|
||||
it.
|
||||
|
||||
@@ -73,11 +73,11 @@ Context
|
||||
|
||||
Skip the headers and scroll down to the definition of FoobarContext. This is
|
||||
your local state context. It is already filled with 0 when you get it so do not
|
||||
worry about uninitialized reads into this context. This is where you put all
|
||||
"global" information that you need; typically the variables storing the user options.
|
||||
worry about uninitialized read into this context. This is where you put every
|
||||
"global" information you need, typically the variable storing the user options.
|
||||
You'll notice the first field "const AVClass *class"; it's the only field you
|
||||
need to keep assuming you have a context. There is some magic you don't need to
|
||||
care about around this field, just let it be (in the first position) for now.
|
||||
need to keep assuming you have a context. There are some magic you don't care
|
||||
about around this field, just let it be (in first position) for now.
|
||||
|
||||
Options
|
||||
-------
|
||||
@@ -87,7 +87,7 @@ options. For example, -vf foobar=mode=colormix:high=0.4:low=0.1. Most options
|
||||
have the following pattern:
|
||||
name, description, offset, type, default value, minimum value, maximum value, flags
|
||||
|
||||
- name is the option name, keep it simple and lowercase
|
||||
- name is the option name, keep it simple, lowercase
|
||||
- description are short, in lowercase, without period, and describe what they
|
||||
do, for example "set the foo of the bar"
|
||||
- offset is the offset of the field in your local context, see the OFFSET()
|
||||
@@ -99,7 +99,7 @@ have the following pattern:
|
||||
- min and max values define the range of available values, inclusive
|
||||
- flags are AVOption generic flags. See AV_OPT_FLAG_* definitions
|
||||
|
||||
When in doubt, just look at the other AVOption definitions all around the codebase,
|
||||
In doubt, just look at the other AVOption definitions all around the codebase,
|
||||
there are tons of examples.
|
||||
|
||||
Class
|
||||
@@ -146,14 +146,14 @@ we won't cover this here since vf_foobar is just a simple 1:1 filter.
|
||||
uninit()
|
||||
~~~~~~~~
|
||||
|
||||
Similarly, there is the uninit() callback, doing what the name suggests. Free
|
||||
Similarly, there is the uninit() callback, doing what the name suggest. Free
|
||||
everything you allocated here.
|
||||
|
||||
query_formats()
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
This follows the init() and is used for the format negotiation. Basically
|
||||
you specify here what pixel format(s) (gray, rgb 32, yuv 4:2:0, ...) you accept
|
||||
This is following the init() and is used for the format negotiation, basically
|
||||
where you say what pixel format(s) (gray, rgb 32, yuv 4:2:0, ...) you accept
|
||||
for your inputs, and what you can output. All pixel formats are defined in
|
||||
libavutil/pixfmt.h. If you don't change the pixel format between the input and
|
||||
the output, you just have to define a pixel formats array and call
|
||||
@@ -182,7 +182,7 @@ will update outlink->w and outlink->h.
|
||||
filter_frame()
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
This is the callback you are waiting for from the beginning: it is where you
|
||||
This is the callback you are waiting from the beginning: it is where you
|
||||
process the received frames. Along with the frame, you get the input link from
|
||||
where the frame comes from.
|
||||
|
||||
@@ -317,7 +317,7 @@ Adding timeline support
|
||||
feature to add. In the most simple case, you just have to add
|
||||
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC to the AVFilter.flags. You can typically
|
||||
do this when your filter does not need to save the previous context frames, or
|
||||
basically if your filter just alters whatever goes in and doesn't need
|
||||
basically if your filter just alter whatever goes in and doesn't need
|
||||
previous/future information. See for instance commit 86cb986ce that adds
|
||||
timeline support to the fieldorder filter.
|
||||
|
||||
|
41
ffmpeg.h
41
ffmpeg.h
@@ -63,8 +63,6 @@ enum HWAccelID {
|
||||
HWACCEL_VDPAU,
|
||||
HWACCEL_DXVA2,
|
||||
HWACCEL_VDA,
|
||||
HWACCEL_VIDEOTOOLBOX,
|
||||
HWACCEL_QSV,
|
||||
};
|
||||
|
||||
typedef struct HWAccel {
|
||||
@@ -94,7 +92,6 @@ typedef struct OptionsContext {
|
||||
|
||||
/* input/output options */
|
||||
int64_t start_time;
|
||||
int64_t start_time_eof;
|
||||
int seek_timestamp;
|
||||
const char *format;
|
||||
|
||||
@@ -113,7 +110,6 @@ typedef struct OptionsContext {
|
||||
|
||||
/* input options */
|
||||
int64_t input_ts_offset;
|
||||
int loop;
|
||||
int rate_emu;
|
||||
int accurate_seek;
|
||||
int thread_queue_size;
|
||||
@@ -216,8 +212,6 @@ typedef struct OptionsContext {
|
||||
int nb_discard;
|
||||
SpecifierOpt *disposition;
|
||||
int nb_disposition;
|
||||
SpecifierOpt *program;
|
||||
int nb_program;
|
||||
} OptionsContext;
|
||||
|
||||
typedef struct InputFilter {
|
||||
@@ -235,7 +229,6 @@ typedef struct OutputFilter {
|
||||
|
||||
/* temporary storage until stream maps are processed */
|
||||
AVFilterInOut *out_tmp;
|
||||
enum AVMediaType type;
|
||||
} OutputFilter;
|
||||
|
||||
typedef struct FilterGraph {
|
||||
@@ -277,10 +270,6 @@ typedef struct InputStream {
|
||||
|
||||
int64_t filter_in_rescale_delta_last;
|
||||
|
||||
int64_t min_pts; /* pts with the smallest value in a current stream */
|
||||
int64_t max_pts; /* pts with the higher value in a current stream */
|
||||
int64_t nb_samples; /* number of samples in the last decoded audio frame before looping */
|
||||
|
||||
double ts_scale;
|
||||
int saw_first_ts;
|
||||
int showed_multi_packet_warning;
|
||||
@@ -350,12 +339,7 @@ typedef struct InputFile {
|
||||
int eof_reached; /* true if eof reached */
|
||||
int eagain; /* true if last read attempt returned EAGAIN */
|
||||
int ist_index; /* index of first stream in input_streams */
|
||||
int loop; /* set number of times input stream should be looped */
|
||||
int64_t duration; /* actual duration of the longest stream in a file
|
||||
at the moment when looping happens */
|
||||
AVRational time_base; /* time base of the duration */
|
||||
int64_t input_ts_offset;
|
||||
|
||||
int64_t ts_offset;
|
||||
int64_t last_ts;
|
||||
int64_t start_time; /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
|
||||
@@ -385,8 +369,6 @@ enum forced_keyframes_const {
|
||||
FKF_NB
|
||||
};
|
||||
|
||||
#define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0)
|
||||
|
||||
extern const char *const forced_keyframes_const_names[];
|
||||
|
||||
typedef enum {
|
||||
@@ -416,14 +398,11 @@ typedef struct OutputStream {
|
||||
int64_t max_frames;
|
||||
AVFrame *filtered_frame;
|
||||
AVFrame *last_frame;
|
||||
int last_dropped;
|
||||
int last_droped;
|
||||
int last_nb0_frames[3];
|
||||
|
||||
void *hwaccel_ctx;
|
||||
|
||||
/* video only */
|
||||
AVRational frame_rate;
|
||||
int is_cfr;
|
||||
int force_fps;
|
||||
int top_field_first;
|
||||
int rotate_overridden;
|
||||
@@ -450,10 +429,11 @@ typedef struct OutputStream {
|
||||
char *filters; ///< filtergraph associated to the -filter option
|
||||
char *filters_script; ///< filtergraph script associated to the -filter_script option
|
||||
|
||||
int64_t sws_flags;
|
||||
AVDictionary *encoder_opts;
|
||||
AVDictionary *sws_dict;
|
||||
AVDictionary *swr_opts;
|
||||
AVDictionary *resample_opts;
|
||||
AVDictionary *bsf_args;
|
||||
char *apad;
|
||||
OSTFinished finished; /* no more packets should be written for this stream */
|
||||
int unavailable; /* true if the steram is unavailable (possibly temporarily) */
|
||||
@@ -475,15 +455,6 @@ typedef struct OutputStream {
|
||||
// number of frames/samples sent to the encoder
|
||||
uint64_t frames_encoded;
|
||||
uint64_t samples_encoded;
|
||||
|
||||
/* packet quality factor */
|
||||
int quality;
|
||||
|
||||
/* packet picture type */
|
||||
int pict_type;
|
||||
|
||||
/* frame encode sum of squared error values */
|
||||
int64_t error[4];
|
||||
} OutputStream;
|
||||
|
||||
typedef struct OutputFile {
|
||||
@@ -531,7 +502,6 @@ extern int start_at_zero;
|
||||
extern int copy_tb;
|
||||
extern int debug_ts;
|
||||
extern int exit_on_error;
|
||||
extern int abort_on_flags;
|
||||
extern int print_stats;
|
||||
extern int qp_hist;
|
||||
extern int stdin_interaction;
|
||||
@@ -539,7 +509,6 @@ extern int frame_bits_per_raw_sample;
|
||||
extern AVIOContext *progress_avio;
|
||||
extern float max_error_rate;
|
||||
extern int vdpau_api_ver;
|
||||
extern char *videotoolbox_pixfmt;
|
||||
|
||||
extern const AVIOInterruptCB int_cb;
|
||||
|
||||
@@ -567,15 +536,11 @@ int configure_filtergraph(FilterGraph *fg);
|
||||
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out);
|
||||
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
|
||||
FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
|
||||
int init_complex_filtergraph(FilterGraph *fg);
|
||||
|
||||
int ffmpeg_parse_options(int argc, char **argv);
|
||||
|
||||
int vdpau_init(AVCodecContext *s);
|
||||
int dxva2_init(AVCodecContext *s);
|
||||
int vda_init(AVCodecContext *s);
|
||||
int videotoolbox_init(AVCodecContext *s);
|
||||
int qsv_init(AVCodecContext *s);
|
||||
int qsv_transcode_init(OutputStream *ost);
|
||||
|
||||
#endif /* FFMPEG_H */
|
||||
|
@@ -53,7 +53,6 @@ DEFINE_GUID(DXVADDI_Intel_ModeH264_E, 0x604F8E68, 0x4951,0x4C54,0x88,0xFE,0xAB,0
|
||||
DEFINE_GUID(DXVA2_ModeVC1_D, 0x1b81beA3, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
|
||||
DEFINE_GUID(DXVA2_ModeVC1_D2010, 0x1b81beA4, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
|
||||
DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main, 0x5b11d51b, 0x2f4c,0x4452,0xbc,0xc3,0x09,0xf2,0xa1,0x16,0x0c,0xc0);
|
||||
DEFINE_GUID(DXVA2_ModeVP9_VLD_Profile0, 0x463707f8, 0xa1d0,0x4585,0x87,0x6d,0x83,0xaa,0x6d,0x60,0xb8,0x9e);
|
||||
DEFINE_GUID(DXVA2_NoEncrypt, 0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
|
||||
DEFINE_GUID(GUID_NULL, 0x00000000, 0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
|
||||
|
||||
@@ -85,9 +84,6 @@ static const dxva2_mode dxva2_modes[] = {
|
||||
/* HEVC/H.265 */
|
||||
{ &DXVA2_ModeHEVC_VLD_Main, AV_CODEC_ID_HEVC },
|
||||
|
||||
/* VP8/9 */
|
||||
{ &DXVA2_ModeVP9_VLD_Profile0, AV_CODEC_ID_VP9 },
|
||||
|
||||
{ NULL, 0 },
|
||||
};
|
||||
|
||||
@@ -547,8 +543,6 @@ static int dxva2_create_decoder(AVCodecContext *s)
|
||||
/* add surfaces based on number of possible refs */
|
||||
if (s->codec_id == AV_CODEC_ID_H264 || s->codec_id == AV_CODEC_ID_HEVC)
|
||||
ctx->num_surfaces += 16;
|
||||
else if (s->codec_id == AV_CODEC_ID_VP9)
|
||||
ctx->num_surfaces += 8;
|
||||
else
|
||||
ctx->num_surfaces += 2;
|
||||
|
||||
|
169
ffmpeg_filter.c
169
ffmpeg_filter.c
@@ -38,28 +38,6 @@
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
|
||||
static const enum AVPixelFormat *get_compliance_unofficial_pix_fmts(enum AVCodecID codec_id, const enum AVPixelFormat default_formats[])
|
||||
{
|
||||
static const enum AVPixelFormat mjpeg_formats[] =
|
||||
{ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
|
||||
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
|
||||
AV_PIX_FMT_NONE };
|
||||
static const enum AVPixelFormat ljpeg_formats[] =
|
||||
{ AV_PIX_FMT_BGR24 , AV_PIX_FMT_BGRA , AV_PIX_FMT_BGR0,
|
||||
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
|
||||
AV_PIX_FMT_YUV420P , AV_PIX_FMT_YUV444P , AV_PIX_FMT_YUV422P,
|
||||
AV_PIX_FMT_NONE};
|
||||
|
||||
if (codec_id == AV_CODEC_ID_MJPEG) {
|
||||
return mjpeg_formats;
|
||||
} else if (codec_id == AV_CODEC_ID_LJPEG) {
|
||||
return ljpeg_formats;
|
||||
} else {
|
||||
return default_formats;
|
||||
}
|
||||
}
|
||||
|
||||
enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, AVCodec *codec, enum AVPixelFormat target)
|
||||
{
|
||||
if (codec && codec->pix_fmts) {
|
||||
@@ -67,9 +45,18 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, AVCod
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
|
||||
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
|
||||
enum AVPixelFormat best= AV_PIX_FMT_NONE;
|
||||
static const enum AVPixelFormat mjpeg_formats[] =
|
||||
{ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
|
||||
static const enum AVPixelFormat ljpeg_formats[] =
|
||||
{ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
|
||||
|
||||
if (enc_ctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
|
||||
p = get_compliance_unofficial_pix_fmts(enc_ctx->codec_id, p);
|
||||
if (enc_ctx->codec_id == AV_CODEC_ID_MJPEG) {
|
||||
p = mjpeg_formats;
|
||||
} else if (enc_ctx->codec_id == AV_CODEC_ID_LJPEG) {
|
||||
p =ljpeg_formats;
|
||||
}
|
||||
}
|
||||
for (; *p != AV_PIX_FMT_NONE; p++) {
|
||||
best= avcodec_find_best_pix_fmt_of_2(best, *p, target, has_alpha, NULL);
|
||||
@@ -98,7 +85,7 @@ void choose_sample_fmt(AVStream *st, AVCodec *codec)
|
||||
break;
|
||||
}
|
||||
if (*p == -1) {
|
||||
if((codec->capabilities & AV_CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codec->sample_fmt) > av_get_sample_fmt_name(codec->sample_fmts[0]))
|
||||
if((codec->capabilities & CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codec->sample_fmt) > av_get_sample_fmt_name(codec->sample_fmts[0]))
|
||||
av_log(NULL, AV_LOG_ERROR, "Conversion will not be lossless.\n");
|
||||
if(av_get_sample_fmt_name(st->codec->sample_fmt))
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
@@ -139,7 +126,12 @@ static char *choose_pix_fmts(OutputStream *ost)
|
||||
|
||||
p = ost->enc->pix_fmts;
|
||||
if (ost->enc_ctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
|
||||
p = get_compliance_unofficial_pix_fmts(ost->enc_ctx->codec_id, p);
|
||||
if (ost->enc_ctx->codec_id == AV_CODEC_ID_MJPEG) {
|
||||
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
|
||||
} else if (ost->enc_ctx->codec_id == AV_CODEC_ID_LJPEG) {
|
||||
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
|
||||
}
|
||||
}
|
||||
|
||||
for (; *p != AV_PIX_FMT_NONE; p++) {
|
||||
@@ -297,45 +289,6 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
ist->filters[ist->nb_filters - 1] = fg->inputs[fg->nb_inputs - 1];
|
||||
}
|
||||
|
||||
int init_complex_filtergraph(FilterGraph *fg)
|
||||
{
|
||||
AVFilterInOut *inputs, *outputs, *cur;
|
||||
AVFilterGraph *graph;
|
||||
int ret = 0;
|
||||
|
||||
/* this graph is only used for determining the kinds of inputs
|
||||
* and outputs we have, and is discarded on exit from this function */
|
||||
graph = avfilter_graph_alloc();
|
||||
if (!graph)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
ret = avfilter_graph_parse2(graph, fg->graph_desc, &inputs, &outputs);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
for (cur = inputs; cur; cur = cur->next)
|
||||
init_input_filter(fg, cur);
|
||||
|
||||
for (cur = outputs; cur;) {
|
||||
GROW_ARRAY(fg->outputs, fg->nb_outputs);
|
||||
fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]));
|
||||
if (!fg->outputs[fg->nb_outputs - 1])
|
||||
exit_program(1);
|
||||
|
||||
fg->outputs[fg->nb_outputs - 1]->graph = fg;
|
||||
fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
|
||||
fg->outputs[fg->nb_outputs - 1]->type = avfilter_pad_get_type(cur->filter_ctx->output_pads,
|
||||
cur->pad_idx);
|
||||
cur = cur->next;
|
||||
fg->outputs[fg->nb_outputs - 1]->out_tmp->next = NULL;
|
||||
}
|
||||
|
||||
fail:
|
||||
avfilter_inout_free(&inputs);
|
||||
avfilter_graph_free(&graph);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int insert_trim(int64_t start_time, int64_t duration,
|
||||
AVFilterContext **last_filter, int *pad_idx,
|
||||
const char *filter_name)
|
||||
@@ -431,17 +384,11 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
if (codec->width || codec->height) {
|
||||
char args[255];
|
||||
AVFilterContext *filter;
|
||||
AVDictionaryEntry *e = NULL;
|
||||
|
||||
snprintf(args, sizeof(args), "%d:%d",
|
||||
snprintf(args, sizeof(args), "%d:%d:0x%X",
|
||||
codec->width,
|
||||
codec->height);
|
||||
|
||||
while ((e = av_dict_get(ost->sws_dict, "", e,
|
||||
AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_strlcatf(args, sizeof(args), ":%s=%s", e->key, e->value);
|
||||
}
|
||||
|
||||
codec->height,
|
||||
(unsigned)ost->sws_flags);
|
||||
snprintf(name, sizeof(name), "scaler for output stream %d:%d",
|
||||
ost->file_index, ost->index);
|
||||
if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
|
||||
@@ -552,7 +499,7 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
av_get_default_channel_layout(ost->audio_channels_mapped));
|
||||
for (i = 0; i < ost->audio_channels_mapped; i++)
|
||||
if (ost->audio_channels_map[i] != -1)
|
||||
av_bprintf(&pan_buf, "|c%d=c%d", i, ost->audio_channels_map[i]);
|
||||
av_bprintf(&pan_buf, ":c%d=c%d", i, ost->audio_channels_map[i]);
|
||||
|
||||
AUTO_INSERT_FILTER("-map_channel", "pan", pan_buf.str);
|
||||
av_bprint_finalize(&pan_buf, NULL);
|
||||
@@ -655,11 +602,6 @@ int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOu
|
||||
av_freep(&ofilter->name);
|
||||
DESCRIBE_FILTER_LINK(ofilter, out, 0);
|
||||
|
||||
if (!ofilter->ost) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Filter %s has a unconnected output\n", ofilter->name);
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
switch (avfilter_pad_get_type(out->filter_ctx->output_pads, out->pad_idx)) {
|
||||
case AVMEDIA_TYPE_VIDEO: return configure_output_video_filter(fg, ofilter, out);
|
||||
case AVMEDIA_TYPE_AUDIO: return configure_output_audio_filter(fg, ofilter, out);
|
||||
@@ -690,8 +632,8 @@ static int sub2video_prepare(InputStream *ist)
|
||||
}
|
||||
av_log(avf, AV_LOG_INFO, "sub2video: using %dx%d canvas\n", w, h);
|
||||
}
|
||||
ist->sub2video.w = ist->resample_width = w;
|
||||
ist->sub2video.h = ist->resample_height = h;
|
||||
ist->sub2video.w = ist->dec_ctx->width = ist->resample_width = w;
|
||||
ist->sub2video.h = ist->dec_ctx->height = ist->resample_height = h;
|
||||
|
||||
/* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the
|
||||
palettes for all rectangles are identical or compatible */
|
||||
@@ -746,7 +688,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
ist->resample_height,
|
||||
ist->hwaccel_retrieve_data ? ist->hwaccel_retrieved_pix_fmt : ist->resample_pix_fmt,
|
||||
tb.num, tb.den, sar.num, sar.den,
|
||||
SWS_BILINEAR + ((ist->dec_ctx->flags&AV_CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0));
|
||||
SWS_BILINEAR + ((ist->dec_ctx->flags&CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0));
|
||||
if (fr.num && fr.den)
|
||||
av_bprintf(&args, ":frame_rate=%d/%d", fr.num, fr.den);
|
||||
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
|
||||
@@ -962,7 +904,7 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
int configure_filtergraph(FilterGraph *fg)
|
||||
{
|
||||
AVFilterInOut *inputs, *outputs, *cur;
|
||||
int ret, i, simple = !fg->graph_desc;
|
||||
int ret, i, init = !fg->graph, simple = !fg->graph_desc;
|
||||
const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
|
||||
fg->graph_desc;
|
||||
|
||||
@@ -975,13 +917,7 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
char args[512];
|
||||
AVDictionaryEntry *e = NULL;
|
||||
|
||||
args[0] = 0;
|
||||
while ((e = av_dict_get(ost->sws_dict, "", e,
|
||||
AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
|
||||
}
|
||||
if (strlen(args))
|
||||
args[strlen(args)-1] = 0;
|
||||
snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
|
||||
fg->graph->scale_sws_opts = av_strdup(args);
|
||||
|
||||
args[0] = 0;
|
||||
@@ -1011,30 +947,14 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
return ret;
|
||||
|
||||
if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
|
||||
const char *num_inputs;
|
||||
const char *num_outputs;
|
||||
if (!outputs) {
|
||||
num_outputs = "0";
|
||||
} else if (outputs->next) {
|
||||
num_outputs = ">1";
|
||||
} else {
|
||||
num_outputs = "1";
|
||||
}
|
||||
if (!inputs) {
|
||||
num_inputs = "0";
|
||||
} else if (inputs->next) {
|
||||
num_inputs = ">1";
|
||||
} else {
|
||||
num_inputs = "1";
|
||||
}
|
||||
av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' was expected "
|
||||
"to have exactly 1 input and 1 output."
|
||||
" However, it had %s input(s) and %s output(s)."
|
||||
" Please adjust, or use a complex filtergraph (-filter_complex) instead.\n",
|
||||
graph_desc, num_inputs, num_outputs);
|
||||
av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' does not have "
|
||||
"exactly one input and output.\n", graph_desc);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
for (cur = inputs; !simple && init && cur; cur = cur->next)
|
||||
init_input_filter(fg, cur);
|
||||
|
||||
for (cur = inputs, i = 0; cur; cur = cur->next, i++)
|
||||
if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0) {
|
||||
avfilter_inout_free(&inputs);
|
||||
@@ -1043,26 +963,35 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
}
|
||||
avfilter_inout_free(&inputs);
|
||||
|
||||
if (!init || simple) {
|
||||
/* we already know the mappings between lavfi outputs and output streams,
|
||||
* so we can finish the setup */
|
||||
for (cur = outputs, i = 0; cur; cur = cur->next, i++)
|
||||
configure_output_filter(fg, fg->outputs[i], cur);
|
||||
avfilter_inout_free(&outputs);
|
||||
|
||||
if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
|
||||
return ret;
|
||||
} else {
|
||||
/* wait until output mappings are processed */
|
||||
for (cur = outputs; cur;) {
|
||||
GROW_ARRAY(fg->outputs, fg->nb_outputs);
|
||||
if (!(fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]))))
|
||||
exit_program(1);
|
||||
fg->outputs[fg->nb_outputs - 1]->graph = fg;
|
||||
fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
|
||||
cur = cur->next;
|
||||
fg->outputs[fg->nb_outputs - 1]->out_tmp->next = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
fg->reconfiguration = 1;
|
||||
|
||||
for (i = 0; i < fg->nb_outputs; i++) {
|
||||
OutputStream *ost = fg->outputs[i]->ost;
|
||||
if (!ost->enc) {
|
||||
/* identical to the same check in ffmpeg.c, needed because
|
||||
complex filter graphs are initialized earlier */
|
||||
av_log(NULL, AV_LOG_ERROR, "Encoder (codec %s) not found for output stream #%d:%d\n",
|
||||
avcodec_get_name(ost->st->codec->codec_id), ost->file_index, ost->index);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
|
||||
!(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
|
||||
if (ost &&
|
||||
ost->enc->type == AVMEDIA_TYPE_AUDIO &&
|
||||
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
|
||||
av_buffersink_set_frame_size(ost->filter->filter,
|
||||
ost->enc_ctx->frame_size);
|
||||
}
|
||||
|
312
ffmpeg_opt.c
312
ffmpeg_opt.c
@@ -40,9 +40,6 @@
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/time_internal.h"
|
||||
|
||||
#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
|
||||
|
||||
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
|
||||
{\
|
||||
@@ -74,13 +71,7 @@ const HWAccel hwaccels[] = {
|
||||
{ "dxva2", dxva2_init, HWACCEL_DXVA2, AV_PIX_FMT_DXVA2_VLD },
|
||||
#endif
|
||||
#if CONFIG_VDA
|
||||
{ "vda", videotoolbox_init, HWACCEL_VDA, AV_PIX_FMT_VDA },
|
||||
#endif
|
||||
#if CONFIG_VIDEOTOOLBOX
|
||||
{ "videotoolbox", videotoolbox_init, HWACCEL_VIDEOTOOLBOX, AV_PIX_FMT_VIDEOTOOLBOX },
|
||||
#endif
|
||||
#if CONFIG_LIBMFX
|
||||
{ "qsv", qsv_init, HWACCEL_QSV, AV_PIX_FMT_QSV },
|
||||
{ "vda", vda_init, HWACCEL_VDA, AV_PIX_FMT_VDA },
|
||||
#endif
|
||||
{ 0 },
|
||||
};
|
||||
@@ -106,7 +97,6 @@ int start_at_zero = 0;
|
||||
int copy_tb = -1;
|
||||
int debug_ts = 0;
|
||||
int exit_on_error = 0;
|
||||
int abort_on_flags = 0;
|
||||
int print_stats = -1;
|
||||
int qp_hist = 0;
|
||||
int stdin_interaction = 1;
|
||||
@@ -163,25 +153,12 @@ static void init_options(OptionsContext *o)
|
||||
o->stop_time = INT64_MAX;
|
||||
o->mux_max_delay = 0.7;
|
||||
o->start_time = AV_NOPTS_VALUE;
|
||||
o->start_time_eof = AV_NOPTS_VALUE;
|
||||
o->recording_time = INT64_MAX;
|
||||
o->limit_filesize = UINT64_MAX;
|
||||
o->chapters_input_file = INT_MAX;
|
||||
o->accurate_seek = 1;
|
||||
}
|
||||
|
||||
static int show_hwaccels(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Hardware acceleration methods:\n");
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(hwaccels) - 1; i++) {
|
||||
printf("%s\n", hwaccels[i].name);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* return a copy of the input with the stream specifiers removed from the keys */
|
||||
static AVDictionary *strip_specifiers(AVDictionary *dict)
|
||||
{
|
||||
@@ -200,24 +177,6 @@ static AVDictionary *strip_specifiers(AVDictionary *dict)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int opt_abort_on(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
static const AVOption opts[] = {
|
||||
{ "abort_on" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
|
||||
{ "empty_output" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = ABORT_ON_FLAG_EMPTY_OUTPUT }, .unit = "flags" },
|
||||
{ NULL },
|
||||
};
|
||||
static const AVClass class = {
|
||||
.class_name = "",
|
||||
.item_name = av_default_item_name,
|
||||
.option = opts,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
const AVClass *pclass = &class;
|
||||
|
||||
return av_opt_eval_flags(&pclass, &opts[0], arg, &abort_on_flags);
|
||||
}
|
||||
|
||||
static int opt_sameq(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
av_log(NULL, AV_LOG_ERROR, "Option '%s' was removed. "
|
||||
@@ -271,7 +230,6 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
int sync_file_idx = -1, sync_stream_idx = 0;
|
||||
char *p, *sync;
|
||||
char *map;
|
||||
char *allow_unused;
|
||||
|
||||
if (*arg == '-') {
|
||||
negative = 1;
|
||||
@@ -316,8 +274,6 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
exit_program(1);
|
||||
}
|
||||
} else {
|
||||
if (allow_unused = strchr(map, '?'))
|
||||
*allow_unused = 0;
|
||||
file_idx = strtol(map, &p, 0);
|
||||
if (file_idx >= nb_input_files || file_idx < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid input file index: %d.\n", file_idx);
|
||||
@@ -355,14 +311,9 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
}
|
||||
|
||||
if (!m) {
|
||||
if (allow_unused) {
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Stream map '%s' matches no streams; ignoring.\n", arg);
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n"
|
||||
"To ignore this, add a trailing '?' to the map.\n", arg);
|
||||
av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n", arg);
|
||||
exit_program(1);
|
||||
}
|
||||
}
|
||||
|
||||
av_freep(&map);
|
||||
return 0;
|
||||
@@ -649,9 +600,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
ist->file_index = nb_input_files;
|
||||
ist->discard = 1;
|
||||
st->discard = AVDISCARD_ALL;
|
||||
ist->nb_samples = 0;
|
||||
ist->min_pts = INT64_MAX;
|
||||
ist->max_pts = INT64_MIN;
|
||||
|
||||
ist->ts_scale = 1.0;
|
||||
MATCH_PER_STREAM_OPT(ts_scale, dbl, ist->ts_scale, ic, st);
|
||||
@@ -699,11 +647,9 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
if(!ist->dec)
|
||||
ist->dec = avcodec_find_decoder(dec->codec_id);
|
||||
#if FF_API_EMU_EDGE
|
||||
if (av_codec_get_lowres(dec)) {
|
||||
dec->flags |= CODEC_FLAG_EMU_EDGE;
|
||||
}
|
||||
#endif
|
||||
|
||||
ist->resample_height = ist->dec_ctx->height;
|
||||
ist->resample_width = ist->dec_ctx->width;
|
||||
@@ -976,12 +922,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
}
|
||||
}
|
||||
|
||||
if (o->start_time_eof != AV_NOPTS_VALUE) {
|
||||
if (ic->duration>0) {
|
||||
o->start_time = o->start_time_eof + ic->duration;
|
||||
} else
|
||||
av_log(NULL, AV_LOG_WARNING, "Cannot use -sseof, duration of %s not known\n", filename);
|
||||
}
|
||||
timestamp = (o->start_time == AV_NOPTS_VALUE) ? 0 : o->start_time;
|
||||
/* add the stream start time */
|
||||
if (!o->seek_timestamp && ic->start_time != AV_NOPTS_VALUE)
|
||||
@@ -1030,9 +970,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
f->nb_streams = ic->nb_streams;
|
||||
f->rate_emu = o->rate_emu;
|
||||
f->accurate_seek = o->accurate_seek;
|
||||
f->loop = o->loop;
|
||||
f->duration = 0;
|
||||
f->time_base = (AVRational){ 1, 1 };
|
||||
#if HAVE_PTHREADS
|
||||
f->thread_queue_size = o->thread_queue_size > 0 ? o->thread_queue_size : 8;
|
||||
#endif
|
||||
@@ -1255,11 +1192,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
bsfc_prev->next = bsfc;
|
||||
else
|
||||
ost->bitstream_filters = bsfc;
|
||||
if (arg)
|
||||
if (!(bsfc->args = av_strdup(arg))) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Bitstream filter memory allocation failed\n");
|
||||
exit_program(1);
|
||||
}
|
||||
av_dict_set(&ost->bsf_args, bsfc->filter->name, arg, 0);
|
||||
|
||||
bsfc_prev = bsfc;
|
||||
bsf = next;
|
||||
@@ -1276,7 +1209,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
|
||||
MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st);
|
||||
if (qscale >= 0) {
|
||||
ost->enc_ctx->flags |= AV_CODEC_FLAG_QSCALE;
|
||||
ost->enc_ctx->flags |= CODEC_FLAG_QSCALE;
|
||||
ost->enc_ctx->global_quality = FF_QP2LAMBDA * qscale;
|
||||
}
|
||||
|
||||
@@ -1284,9 +1217,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
ost->disposition = av_strdup(ost->disposition);
|
||||
|
||||
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
ost->enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
ost->enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
|
||||
av_dict_copy(&ost->sws_dict, o->g->sws_dict, 0);
|
||||
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)
|
||||
@@ -1506,17 +1439,17 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
video_enc->rc_override_count = i;
|
||||
|
||||
if (do_psnr)
|
||||
video_enc->flags|= AV_CODEC_FLAG_PSNR;
|
||||
video_enc->flags|= CODEC_FLAG_PSNR;
|
||||
|
||||
/* two pass mode */
|
||||
MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st);
|
||||
if (do_pass) {
|
||||
if (do_pass & 1) {
|
||||
video_enc->flags |= AV_CODEC_FLAG_PASS1;
|
||||
video_enc->flags |= CODEC_FLAG_PASS1;
|
||||
av_dict_set(&ost->encoder_opts, "flags", "+pass1", AV_DICT_APPEND);
|
||||
}
|
||||
if (do_pass & 2) {
|
||||
video_enc->flags |= AV_CODEC_FLAG_PASS2;
|
||||
video_enc->flags |= CODEC_FLAG_PASS2;
|
||||
av_dict_set(&ost->encoder_opts, "flags", "+pass2", AV_DICT_APPEND);
|
||||
}
|
||||
}
|
||||
@@ -1526,40 +1459,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
!(ost->logfile_prefix = av_strdup(ost->logfile_prefix)))
|
||||
exit_program(1);
|
||||
|
||||
if (do_pass) {
|
||||
char logfilename[1024];
|
||||
FILE *f;
|
||||
|
||||
snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
|
||||
ost->logfile_prefix ? ost->logfile_prefix :
|
||||
DEFAULT_PASS_LOGFILENAME_PREFIX,
|
||||
i);
|
||||
if (!strcmp(ost->enc->name, "libx264")) {
|
||||
av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
|
||||
} else {
|
||||
if (video_enc->flags & AV_CODEC_FLAG_PASS2) {
|
||||
char *logbuffer = read_file(logfilename);
|
||||
|
||||
if (!logbuffer) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
|
||||
logfilename);
|
||||
exit_program(1);
|
||||
}
|
||||
video_enc->stats_in = logbuffer;
|
||||
}
|
||||
if (video_enc->flags & AV_CODEC_FLAG_PASS1) {
|
||||
f = av_fopen_utf8(logfilename, "wb");
|
||||
if (!f) {
|
||||
av_log(NULL, AV_LOG_FATAL,
|
||||
"Cannot write log file '%s' for pass-1 encoding: %s\n",
|
||||
logfilename, strerror(errno));
|
||||
exit_program(1);
|
||||
}
|
||||
ost->logfile = f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st);
|
||||
if (ost->forced_keyframes)
|
||||
ost->forced_keyframes = av_strdup(ost->forced_keyframes);
|
||||
@@ -1838,7 +1737,8 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
|
||||
{
|
||||
OutputStream *ost;
|
||||
|
||||
switch (ofilter->type) {
|
||||
switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
|
||||
ofilter->out_tmp->pad_idx)) {
|
||||
case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc, -1); break;
|
||||
case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc, -1); break;
|
||||
default:
|
||||
@@ -1871,21 +1771,13 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
if (configure_output_filter(ofilter->graph, ofilter, ofilter->out_tmp) < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Error configuring filter.\n");
|
||||
exit_program(1);
|
||||
}
|
||||
avfilter_inout_free(&ofilter->out_tmp);
|
||||
}
|
||||
|
||||
static int init_complex_filters(void)
|
||||
{
|
||||
int i, ret = 0;
|
||||
|
||||
for (i = 0; i < nb_filtergraphs; i++) {
|
||||
ret = init_complex_filtergraph(filtergraphs[i]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int configure_complex_filters(void)
|
||||
{
|
||||
int i, ret = 0;
|
||||
@@ -1908,6 +1800,10 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
AVDictionary *unused_opts = NULL;
|
||||
AVDictionaryEntry *e = NULL;
|
||||
|
||||
if (configure_complex_filters() < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Error configuring filters.\n");
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) {
|
||||
o->stop_time = INT64_MAX;
|
||||
@@ -1962,7 +1858,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
if (!ofilter->out_tmp || ofilter->out_tmp->name)
|
||||
continue;
|
||||
|
||||
switch (ofilter->type) {
|
||||
switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
|
||||
ofilter->out_tmp->pad_idx)) {
|
||||
case AVMEDIA_TYPE_VIDEO: o->video_disable = 1; break;
|
||||
case AVMEDIA_TYPE_AUDIO: o->audio_disable = 1; break;
|
||||
case AVMEDIA_TYPE_SUBTITLE: o->subtitle_disable = 1; break;
|
||||
@@ -2021,7 +1918,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
int new_area;
|
||||
ist = input_streams[i];
|
||||
new_area = ist->st->codec->width * ist->st->codec->height + 100000000*!!ist->st->codec_info_nb_frames;
|
||||
new_area = ist->st->codec->width * ist->st->codec->height;
|
||||
if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
|
||||
new_area = 1;
|
||||
if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
|
||||
@@ -2038,14 +1935,12 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
|
||||
/* audio: most channels */
|
||||
if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
|
||||
int best_score = 0, idx = -1;
|
||||
int channels = 0, idx = -1;
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
int score;
|
||||
ist = input_streams[i];
|
||||
score = ist->st->codec->channels + 100000000*!!ist->st->codec_info_nb_frames;
|
||||
if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
|
||||
score > best_score) {
|
||||
best_score = score;
|
||||
ist->st->codec->channels > channels) {
|
||||
channels = ist->st->codec->channels;
|
||||
idx = i;
|
||||
}
|
||||
}
|
||||
@@ -2132,7 +2027,6 @@ loop_end:
|
||||
if(o-> data_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_DATA)
|
||||
continue;
|
||||
|
||||
ost = NULL;
|
||||
switch (ist->st->codec->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO: ost = new_video_stream (o, oc, src_idx); break;
|
||||
case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream (o, oc, src_idx); break;
|
||||
@@ -2156,9 +2050,6 @@ loop_end:
|
||||
exit_program(1);
|
||||
}
|
||||
}
|
||||
if (ost)
|
||||
ost->sync_ist = input_streams[ input_files[map->sync_file_index]->ist_index
|
||||
+ map->sync_stream_index];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2188,7 +2079,7 @@ loop_end:
|
||||
avio_read(pb, attachment, len);
|
||||
|
||||
ost = new_attachment_stream(o, oc, -1);
|
||||
ost->stream_copy = 1;
|
||||
ost->stream_copy = 0;
|
||||
ost->attachment_filename = o->attachments[i];
|
||||
ost->finished = 1;
|
||||
ost->st->codec->extradata = attachment;
|
||||
@@ -2210,12 +2101,6 @@ loop_end:
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
|
||||
av_dump_format(oc, nb_output_files - 1, oc->filename, 1);
|
||||
av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", nb_output_files - 1);
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
/* check if all codec options have been used */
|
||||
unused_opts = strip_specifiers(o->g->codec_opts);
|
||||
for (i = of->ost_index; i < nb_output_streams; i++) {
|
||||
@@ -2258,17 +2143,6 @@ loop_end:
|
||||
}
|
||||
av_dict_free(&unused_opts);
|
||||
|
||||
/* set the encoding/decoding_needed flags */
|
||||
for (i = of->ost_index; i < nb_output_streams; i++) {
|
||||
OutputStream *ost = output_streams[i];
|
||||
|
||||
ost->encoding_needed = !ost->stream_copy;
|
||||
if (ost->encoding_needed && ost->source_index >= 0) {
|
||||
InputStream *ist = input_streams[ost->source_index];
|
||||
ist->decoding_needed |= DECODING_FOR_OST;
|
||||
}
|
||||
}
|
||||
|
||||
/* check filename in case of an image number is expected */
|
||||
if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
|
||||
if (!av_filename_number_test(oc->filename)) {
|
||||
@@ -2358,79 +2232,12 @@ loop_end:
|
||||
}
|
||||
}
|
||||
|
||||
/* process manually set programs */
|
||||
for (i = 0; i < o->nb_program; i++) {
|
||||
const char *p = o->program[i].u.str;
|
||||
int progid = i+1;
|
||||
AVProgram *program;
|
||||
|
||||
while(*p) {
|
||||
const char *p2 = av_get_token(&p, ":");
|
||||
const char *to_dealloc = p2;
|
||||
char *key;
|
||||
if (!p2)
|
||||
break;
|
||||
|
||||
if(*p) p++;
|
||||
|
||||
key = av_get_token(&p2, "=");
|
||||
if (!key || !*p2) {
|
||||
av_freep(&to_dealloc);
|
||||
av_freep(&key);
|
||||
break;
|
||||
}
|
||||
p2++;
|
||||
|
||||
if (!strcmp(key, "program_num"))
|
||||
progid = strtol(p2, NULL, 0);
|
||||
av_freep(&to_dealloc);
|
||||
av_freep(&key);
|
||||
}
|
||||
|
||||
program = av_new_program(oc, progid);
|
||||
|
||||
p = o->program[i].u.str;
|
||||
while(*p) {
|
||||
const char *p2 = av_get_token(&p, ":");
|
||||
const char *to_dealloc = p2;
|
||||
char *key;
|
||||
if (!p2)
|
||||
break;
|
||||
if(*p) p++;
|
||||
|
||||
key = av_get_token(&p2, "=");
|
||||
if (!key) {
|
||||
av_log(NULL, AV_LOG_FATAL,
|
||||
"No '=' character in program string %s.\n",
|
||||
p2);
|
||||
exit_program(1);
|
||||
}
|
||||
if (!*p2)
|
||||
exit_program(1);
|
||||
p2++;
|
||||
|
||||
if (!strcmp(key, "title")) {
|
||||
av_dict_set(&program->metadata, "title", p2, 0);
|
||||
} else if (!strcmp(key, "program_num")) {
|
||||
} else if (!strcmp(key, "st")) {
|
||||
int st_num = strtol(p2, NULL, 0);
|
||||
av_program_add_stream_index(oc, progid, st_num);
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_FATAL, "Unknown program key %s.\n", key);
|
||||
exit_program(1);
|
||||
}
|
||||
av_freep(&to_dealloc);
|
||||
av_freep(&key);
|
||||
}
|
||||
}
|
||||
|
||||
/* process manually set metadata */
|
||||
for (i = 0; i < o->nb_metadata; i++) {
|
||||
AVDictionary **m;
|
||||
char type, *val;
|
||||
const char *stream_spec;
|
||||
int index = 0, j, ret = 0;
|
||||
char now_time[256];
|
||||
|
||||
val = strchr(o->metadata[i].u.str, '=');
|
||||
if (!val) {
|
||||
@@ -2440,17 +2247,6 @@ loop_end:
|
||||
}
|
||||
*val++ = 0;
|
||||
|
||||
if (!strcmp(o->metadata[i].u.str, "creation_time") &&
|
||||
!strcmp(val, "now")) {
|
||||
time_t now = time(0);
|
||||
struct tm *ptm, tmbuf;
|
||||
ptm = localtime_r(&now, &tmbuf);
|
||||
if (ptm) {
|
||||
if (strftime(now_time, sizeof(now_time), "%Y-%m-%d %H:%M:%S", ptm))
|
||||
val = now_time;
|
||||
}
|
||||
}
|
||||
|
||||
parse_meta_type(o->metadata[i].specifier, &type, &index, &stream_spec);
|
||||
if (type == 's') {
|
||||
for (j = 0; j < oc->nb_streams; j++) {
|
||||
@@ -2476,13 +2272,6 @@ loop_end:
|
||||
}
|
||||
m = &oc->chapters[index]->metadata;
|
||||
break;
|
||||
case 'p':
|
||||
if (index < 0 || index >= oc->nb_programs) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid program index %d in metadata specifier.\n", index);
|
||||
exit_program(1);
|
||||
}
|
||||
m = &oc->programs[index]->metadata;
|
||||
break;
|
||||
default:
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", o->metadata[i].specifier);
|
||||
exit_program(1);
|
||||
@@ -2650,10 +2439,8 @@ static int opt_vstats(void *optctx, const char *opt, const char *arg)
|
||||
time_t today2 = time(NULL);
|
||||
struct tm *today = localtime(&today2);
|
||||
|
||||
if (!today) { // maybe tomorrow
|
||||
av_log(NULL, AV_LOG_FATAL, "Unable to get current time: %s\n", strerror(errno));
|
||||
exit_program(1);
|
||||
}
|
||||
if (!today)
|
||||
return AVERROR(errno);
|
||||
|
||||
snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
|
||||
today->tm_sec);
|
||||
@@ -2928,7 +2715,6 @@ void show_help_default(const char *opt, const char *arg)
|
||||
" -h -- print basic options\n"
|
||||
" -h long -- print more options\n"
|
||||
" -h full -- print all options (including all format and codec specific options, very long)\n"
|
||||
" -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter\n"
|
||||
" See man %s for detailed description of the options.\n"
|
||||
"\n", program_name);
|
||||
|
||||
@@ -3056,13 +2842,6 @@ int ffmpeg_parse_options(int argc, char **argv)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* create the complex filtergraphs */
|
||||
ret = init_complex_filters();
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Error initializing complex filters.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* open output files */
|
||||
ret = open_files(&octx.groups[GROUP_OUTFILE], "output", open_output_file);
|
||||
if (ret < 0) {
|
||||
@@ -3070,13 +2849,6 @@ int ffmpeg_parse_options(int argc, char **argv)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* configure the complex filtergraphs */
|
||||
ret = configure_complex_filters();
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Error configuring complex filters.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
fail:
|
||||
uninit_parse_context(&octx);
|
||||
if (ret < 0) {
|
||||
@@ -3151,9 +2923,6 @@ const OptionDef options[] = {
|
||||
{ "ss", HAS_ARG | OPT_TIME | OPT_OFFSET |
|
||||
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(start_time) },
|
||||
"set the start time offset", "time_off" },
|
||||
{ "sseof", HAS_ARG | OPT_TIME | OPT_OFFSET |
|
||||
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(start_time_eof) },
|
||||
"set the start time offset relative to EOF", "time_off" },
|
||||
{ "seek_timestamp", HAS_ARG | OPT_INT | OPT_OFFSET |
|
||||
OPT_INPUT, { .off = OFFSET(seek_timestamp) },
|
||||
"enable/disable seeking by timestamp with -ss" },
|
||||
@@ -3170,8 +2939,6 @@ const OptionDef options[] = {
|
||||
"set the recording timestamp ('now' to set the current time)", "time" },
|
||||
{ "metadata", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(metadata) },
|
||||
"add metadata", "string=string" },
|
||||
{ "program", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(program) },
|
||||
"add program with specified streams", "title=string:st=number..." },
|
||||
{ "dframes", HAS_ARG | OPT_PERFILE | OPT_EXPERT |
|
||||
OPT_OUTPUT, { .func_arg = opt_data_frames },
|
||||
"set the number of data frames to output", "number" },
|
||||
@@ -3193,9 +2960,9 @@ const OptionDef options[] = {
|
||||
OPT_INPUT, { .off = OFFSET(rate_emu) },
|
||||
"read input at native frame rate", "" },
|
||||
{ "target", HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_target },
|
||||
"specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" "
|
||||
"with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")", "type" },
|
||||
{ "vsync", HAS_ARG | OPT_EXPERT, { .func_arg = opt_vsync },
|
||||
"specify target file type (\"vcd\", \"svcd\", \"dvd\","
|
||||
" \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", "type" },
|
||||
{ "vsync", HAS_ARG | OPT_EXPERT, { opt_vsync },
|
||||
"video sync method", "" },
|
||||
{ "frame_drop_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &frame_drop_threshold },
|
||||
"frame drop threshold", "" },
|
||||
@@ -3221,8 +2988,6 @@ const OptionDef options[] = {
|
||||
"timestamp error delta threshold", "threshold" },
|
||||
{ "xerror", OPT_BOOL | OPT_EXPERT, { &exit_on_error },
|
||||
"exit on error", "error" },
|
||||
{ "abort_on", HAS_ARG | OPT_EXPERT, { .func_arg = opt_abort_on },
|
||||
"abort on the specified condition flags", "flags" },
|
||||
{ "copyinkf", OPT_BOOL | OPT_EXPERT | OPT_SPEC |
|
||||
OPT_OUTPUT, { .off = OFFSET(copy_initial_nonkeyframes) },
|
||||
"copy initial non-keyframes" },
|
||||
@@ -3261,8 +3026,6 @@ const OptionDef options[] = {
|
||||
{ "dump_attachment", HAS_ARG | OPT_STRING | OPT_SPEC |
|
||||
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(dump_attachment) },
|
||||
"extract an attachment into a file", "filename" },
|
||||
{ "stream_loop", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_INPUT |
|
||||
OPT_OFFSET, { .off = OFFSET(loop) }, "set number of times input stream shall be looped", "loop count" },
|
||||
{ "debug_ts", OPT_BOOL | OPT_EXPERT, { &debug_ts },
|
||||
"print timestamp debugging info" },
|
||||
{ "max_error_rate", HAS_ARG | OPT_FLOAT, { &max_error_rate },
|
||||
@@ -3319,9 +3082,9 @@ const OptionDef options[] = {
|
||||
"this option is deprecated, use the yadif filter instead" },
|
||||
{ "psnr", OPT_VIDEO | OPT_BOOL | OPT_EXPERT, { &do_psnr },
|
||||
"calculate PSNR of compressed frames" },
|
||||
{ "vstats", OPT_VIDEO | OPT_EXPERT , { .func_arg = opt_vstats },
|
||||
{ "vstats", OPT_VIDEO | OPT_EXPERT , { &opt_vstats },
|
||||
"dump video coding statistics to file" },
|
||||
{ "vstats_file", OPT_VIDEO | HAS_ARG | OPT_EXPERT , { .func_arg = opt_vstats_file },
|
||||
{ "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 | OPT_OUTPUT, { .func_arg = opt_video_filters },
|
||||
"set video filters", "filter_graph" },
|
||||
@@ -3360,15 +3123,10 @@ const OptionDef options[] = {
|
||||
"use HW accelerated decoding", "hwaccel name" },
|
||||
{ "hwaccel_device", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
|
||||
OPT_SPEC | OPT_INPUT, { .off = OFFSET(hwaccel_devices) },
|
||||
"select a device for HW acceleration", "devicename" },
|
||||
"select a device for HW acceleration" "devicename" },
|
||||
#if HAVE_VDPAU_X11
|
||||
{ "vdpau_api_ver", HAS_ARG | OPT_INT | OPT_EXPERT, { &vdpau_api_ver }, "" },
|
||||
#endif
|
||||
#if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
|
||||
{ "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { &videotoolbox_pixfmt}, "" },
|
||||
#endif
|
||||
{ "hwaccels", OPT_EXIT, { .func_arg = show_hwaccels },
|
||||
"show available HW acceleration methods" },
|
||||
{ "autorotate", HAS_ARG | OPT_BOOL | OPT_SPEC |
|
||||
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(autorotate) },
|
||||
"automatically insert correct rotate filters" },
|
||||
@@ -3431,7 +3189,7 @@ const OptionDef options[] = {
|
||||
"set the initial demux-decode delay", "seconds" },
|
||||
{ "override_ffserver", OPT_BOOL | OPT_EXPERT | OPT_OUTPUT, { &override_ffserver },
|
||||
"override the options from ffserver", "" },
|
||||
{ "sdp_file", HAS_ARG | OPT_EXPERT | OPT_OUTPUT, { .func_arg = opt_sdp_file },
|
||||
{ "sdp_file", HAS_ARG | OPT_EXPERT | OPT_OUTPUT, { opt_sdp_file },
|
||||
"specify a file in which to print sdp information", "file" },
|
||||
|
||||
{ "bsf", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(bitstream_filters) },
|
||||
|
268
ffmpeg_qsv.c
268
ffmpeg_qsv.c
@@ -1,268 +0,0 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <mfx/mfxvideo.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavcodec/qsv.h"
|
||||
|
||||
#include "ffmpeg.h"
|
||||
|
||||
typedef struct QSVContext {
|
||||
OutputStream *ost;
|
||||
|
||||
mfxSession session;
|
||||
|
||||
mfxExtOpaqueSurfaceAlloc opaque_alloc;
|
||||
AVBufferRef *opaque_surfaces_buf;
|
||||
|
||||
uint8_t *surface_used;
|
||||
mfxFrameSurface1 **surface_ptrs;
|
||||
int nb_surfaces;
|
||||
|
||||
mfxExtBuffer *ext_buffers[1];
|
||||
} QSVContext;
|
||||
|
||||
static void buffer_release(void *opaque, uint8_t *data)
|
||||
{
|
||||
*(uint8_t*)opaque = 0;
|
||||
}
|
||||
|
||||
static int qsv_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
QSVContext *qsv = ist->hwaccel_ctx;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < qsv->nb_surfaces; i++) {
|
||||
if (qsv->surface_used[i])
|
||||
continue;
|
||||
|
||||
frame->buf[0] = av_buffer_create((uint8_t*)qsv->surface_ptrs[i], sizeof(*qsv->surface_ptrs[i]),
|
||||
buffer_release, &qsv->surface_used[i], 0);
|
||||
if (!frame->buf[0])
|
||||
return AVERROR(ENOMEM);
|
||||
frame->data[3] = (uint8_t*)qsv->surface_ptrs[i];
|
||||
qsv->surface_used[i] = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
static int init_opaque_surf(QSVContext *qsv)
|
||||
{
|
||||
AVQSVContext *hwctx_enc = qsv->ost->enc_ctx->hwaccel_context;
|
||||
mfxFrameSurface1 *surfaces;
|
||||
int i;
|
||||
|
||||
qsv->nb_surfaces = hwctx_enc->nb_opaque_surfaces;
|
||||
|
||||
qsv->opaque_surfaces_buf = av_buffer_ref(hwctx_enc->opaque_surfaces);
|
||||
qsv->surface_ptrs = av_mallocz_array(qsv->nb_surfaces, sizeof(*qsv->surface_ptrs));
|
||||
qsv->surface_used = av_mallocz_array(qsv->nb_surfaces, sizeof(*qsv->surface_used));
|
||||
if (!qsv->opaque_surfaces_buf || !qsv->surface_ptrs || !qsv->surface_used)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
surfaces = (mfxFrameSurface1*)qsv->opaque_surfaces_buf->data;
|
||||
for (i = 0; i < qsv->nb_surfaces; i++)
|
||||
qsv->surface_ptrs[i] = surfaces + i;
|
||||
|
||||
qsv->opaque_alloc.Out.Surfaces = qsv->surface_ptrs;
|
||||
qsv->opaque_alloc.Out.NumSurface = qsv->nb_surfaces;
|
||||
qsv->opaque_alloc.Out.Type = hwctx_enc->opaque_alloc_type;
|
||||
|
||||
qsv->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION;
|
||||
qsv->opaque_alloc.Header.BufferSz = sizeof(qsv->opaque_alloc);
|
||||
qsv->ext_buffers[0] = (mfxExtBuffer*)&qsv->opaque_alloc;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void qsv_uninit(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
QSVContext *qsv = ist->hwaccel_ctx;
|
||||
|
||||
av_freep(&qsv->ost->enc_ctx->hwaccel_context);
|
||||
av_freep(&s->hwaccel_context);
|
||||
|
||||
av_buffer_unref(&qsv->opaque_surfaces_buf);
|
||||
av_freep(&qsv->surface_used);
|
||||
av_freep(&qsv->surface_ptrs);
|
||||
|
||||
av_freep(&qsv);
|
||||
}
|
||||
|
||||
int qsv_init(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
QSVContext *qsv = ist->hwaccel_ctx;
|
||||
AVQSVContext *hwctx_dec;
|
||||
int ret;
|
||||
|
||||
if (!qsv) {
|
||||
av_log(NULL, AV_LOG_ERROR, "QSV transcoding is not initialized. "
|
||||
"-hwaccel qsv should only be used for one-to-one QSV transcoding "
|
||||
"with no filters.\n");
|
||||
return AVERROR_BUG;
|
||||
}
|
||||
|
||||
ret = init_opaque_surf(qsv);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
hwctx_dec = av_qsv_alloc_context();
|
||||
if (!hwctx_dec)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
hwctx_dec->session = qsv->session;
|
||||
hwctx_dec->iopattern = MFX_IOPATTERN_OUT_OPAQUE_MEMORY;
|
||||
hwctx_dec->ext_buffers = qsv->ext_buffers;
|
||||
hwctx_dec->nb_ext_buffers = FF_ARRAY_ELEMS(qsv->ext_buffers);
|
||||
|
||||
av_freep(&s->hwaccel_context);
|
||||
s->hwaccel_context = hwctx_dec;
|
||||
|
||||
ist->hwaccel_get_buffer = qsv_get_buffer;
|
||||
ist->hwaccel_uninit = qsv_uninit;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static mfxIMPL choose_implementation(const InputStream *ist)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
mfxIMPL impl;
|
||||
} impl_map[] = {
|
||||
{ "auto", MFX_IMPL_AUTO },
|
||||
{ "sw", MFX_IMPL_SOFTWARE },
|
||||
{ "hw", MFX_IMPL_HARDWARE },
|
||||
{ "auto_any", MFX_IMPL_AUTO_ANY },
|
||||
{ "hw_any", MFX_IMPL_HARDWARE_ANY },
|
||||
{ "hw2", MFX_IMPL_HARDWARE2 },
|
||||
{ "hw3", MFX_IMPL_HARDWARE3 },
|
||||
{ "hw4", MFX_IMPL_HARDWARE4 },
|
||||
};
|
||||
|
||||
mfxIMPL impl = MFX_IMPL_AUTO_ANY;
|
||||
int i;
|
||||
|
||||
if (ist->hwaccel_device) {
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(impl_map); i++)
|
||||
if (!strcmp(ist->hwaccel_device, impl_map[i].name)) {
|
||||
impl = impl_map[i].impl;
|
||||
break;
|
||||
}
|
||||
if (i == FF_ARRAY_ELEMS(impl_map))
|
||||
impl = strtol(ist->hwaccel_device, NULL, 0);
|
||||
}
|
||||
|
||||
return impl;
|
||||
}
|
||||
|
||||
int qsv_transcode_init(OutputStream *ost)
|
||||
{
|
||||
InputStream *ist;
|
||||
const enum AVPixelFormat *pix_fmt;
|
||||
|
||||
AVDictionaryEntry *e;
|
||||
const AVOption *opt;
|
||||
int flags = 0;
|
||||
|
||||
int err, i;
|
||||
|
||||
QSVContext *qsv = NULL;
|
||||
AVQSVContext *hwctx = NULL;
|
||||
mfxIMPL impl;
|
||||
mfxVersion ver = { { 3, 1 } };
|
||||
|
||||
/* check if the encoder supports QSV */
|
||||
if (!ost->enc->pix_fmts)
|
||||
return 0;
|
||||
for (pix_fmt = ost->enc->pix_fmts; *pix_fmt != AV_PIX_FMT_NONE; pix_fmt++)
|
||||
if (*pix_fmt == AV_PIX_FMT_QSV)
|
||||
break;
|
||||
if (*pix_fmt == AV_PIX_FMT_NONE)
|
||||
return 0;
|
||||
|
||||
if (strcmp(ost->avfilter, "null") || ost->source_index < 0)
|
||||
return 0;
|
||||
|
||||
/* check if the decoder supports QSV and the output only goes to this stream */
|
||||
ist = input_streams[ost->source_index];
|
||||
if (ist->nb_filters || ist->hwaccel_id != HWACCEL_QSV ||
|
||||
!ist->dec || !ist->dec->pix_fmts)
|
||||
return 0;
|
||||
for (pix_fmt = ist->dec->pix_fmts; *pix_fmt != AV_PIX_FMT_NONE; pix_fmt++)
|
||||
if (*pix_fmt == AV_PIX_FMT_QSV)
|
||||
break;
|
||||
if (*pix_fmt == AV_PIX_FMT_NONE)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < nb_output_streams; i++)
|
||||
if (output_streams[i] != ost &&
|
||||
output_streams[i]->source_index == ost->source_index)
|
||||
return 0;
|
||||
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Setting up QSV transcoding\n");
|
||||
|
||||
qsv = av_mallocz(sizeof(*qsv));
|
||||
hwctx = av_qsv_alloc_context();
|
||||
if (!qsv || !hwctx)
|
||||
goto fail;
|
||||
|
||||
impl = choose_implementation(ist);
|
||||
|
||||
err = MFXInit(impl, &ver, &qsv->session);
|
||||
if (err != MFX_ERR_NONE) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error initializing an MFX session: %d\n", err);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
e = av_dict_get(ost->encoder_opts, "flags", NULL, 0);
|
||||
opt = av_opt_find(ost->enc_ctx, "flags", NULL, 0, 0);
|
||||
if (e && opt)
|
||||
av_opt_eval_flags(ost->enc_ctx, opt, e->value, &flags);
|
||||
|
||||
qsv->ost = ost;
|
||||
|
||||
hwctx->session = qsv->session;
|
||||
hwctx->iopattern = MFX_IOPATTERN_IN_OPAQUE_MEMORY;
|
||||
hwctx->opaque_alloc = 1;
|
||||
hwctx->nb_opaque_surfaces = 16;
|
||||
|
||||
ost->hwaccel_ctx = qsv;
|
||||
ost->enc_ctx->hwaccel_context = hwctx;
|
||||
ost->enc_ctx->pix_fmt = AV_PIX_FMT_QSV;
|
||||
|
||||
ist->hwaccel_ctx = qsv;
|
||||
ist->dec_ctx->pix_fmt = AV_PIX_FMT_QSV;
|
||||
ist->resample_pix_fmt = AV_PIX_FMT_QSV;
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
av_freep(&hwctx);
|
||||
av_freep(&qsv);
|
||||
return AVERROR_UNKNOWN;
|
||||
}
|
136
ffmpeg_vda.c
Normal file
136
ffmpeg_vda.c
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/vda.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
|
||||
#include "ffmpeg.h"
|
||||
|
||||
typedef struct VDAContext {
|
||||
AVFrame *tmp_frame;
|
||||
} VDAContext;
|
||||
|
||||
static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
VDAContext *vda = ist->hwaccel_ctx;
|
||||
CVPixelBufferRef pixbuf = (CVPixelBufferRef)frame->data[3];
|
||||
OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
|
||||
CVReturn err;
|
||||
uint8_t *data[4] = { 0 };
|
||||
int linesize[4] = { 0 };
|
||||
int planes, ret, i;
|
||||
|
||||
av_frame_unref(vda->tmp_frame);
|
||||
|
||||
switch (pixel_format) {
|
||||
case kCVPixelFormatType_420YpCbCr8Planar: vda->tmp_frame->format = AV_PIX_FMT_YUV420P; break;
|
||||
case kCVPixelFormatType_422YpCbCr8: vda->tmp_frame->format = AV_PIX_FMT_UYVY422; break;
|
||||
default:
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Unsupported pixel format: %u\n", pixel_format);
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
vda->tmp_frame->width = frame->width;
|
||||
vda->tmp_frame->height = frame->height;
|
||||
ret = av_frame_get_buffer(vda->tmp_frame, 32);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
err = CVPixelBufferLockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
|
||||
if (err != kCVReturnSuccess) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error locking the pixel buffer.\n");
|
||||
return AVERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
if (CVPixelBufferIsPlanar(pixbuf)) {
|
||||
|
||||
planes = CVPixelBufferGetPlaneCount(pixbuf);
|
||||
for (i = 0; i < planes; i++) {
|
||||
data[i] = CVPixelBufferGetBaseAddressOfPlane(pixbuf, i);
|
||||
linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(pixbuf, i);
|
||||
}
|
||||
} else {
|
||||
data[0] = CVPixelBufferGetBaseAddress(pixbuf);
|
||||
linesize[0] = CVPixelBufferGetBytesPerRow(pixbuf);
|
||||
}
|
||||
|
||||
av_image_copy(vda->tmp_frame->data, vda->tmp_frame->linesize,
|
||||
(const uint8_t **)data, linesize, vda->tmp_frame->format,
|
||||
frame->width, frame->height);
|
||||
|
||||
ret = av_frame_copy_props(vda->tmp_frame, frame);
|
||||
CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
av_frame_unref(frame);
|
||||
av_frame_move_ref(frame, vda->tmp_frame);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vda_uninit(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
VDAContext *vda = ist->hwaccel_ctx;
|
||||
|
||||
ist->hwaccel_uninit = NULL;
|
||||
ist->hwaccel_retrieve_data = NULL;
|
||||
|
||||
av_frame_free(&vda->tmp_frame);
|
||||
|
||||
av_vda_default_free(s);
|
||||
av_freep(&ist->hwaccel_ctx);
|
||||
}
|
||||
|
||||
int vda_init(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
|
||||
VDAContext *vda;
|
||||
int ret;
|
||||
|
||||
vda = av_mallocz(sizeof(*vda));
|
||||
if (!vda)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
ist->hwaccel_ctx = vda;
|
||||
ist->hwaccel_uninit = vda_uninit;
|
||||
ist->hwaccel_retrieve_data = vda_retrieve_data;
|
||||
|
||||
vda->tmp_frame = av_frame_alloc();
|
||||
if (!vda->tmp_frame) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = av_vda_default_init(s);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, loglevel, "Error creating VDA decoder.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
vda_uninit(s);
|
||||
return ret;
|
||||
}
|
@@ -289,8 +289,7 @@ do {
|
||||
|
||||
s->hwaccel_context = vdpau_ctx;
|
||||
} else
|
||||
if (av_vdpau_bind_context(s, ctx->device, ctx->get_proc_address,
|
||||
AV_HWACCEL_FLAG_IGNORE_LEVEL))
|
||||
if (av_vdpau_bind_context(s, ctx->device, ctx->get_proc_address, 0))
|
||||
goto fail;
|
||||
|
||||
ctx->get_information_string(&vendor);
|
||||
|
@@ -1,202 +0,0 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_UTGETOSTYPEFROMSTRING
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#if CONFIG_VDA
|
||||
# include "libavcodec/vda.h"
|
||||
#endif
|
||||
#if CONFIG_VIDEOTOOLBOX
|
||||
# include "libavcodec/videotoolbox.h"
|
||||
#endif
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "ffmpeg.h"
|
||||
|
||||
typedef struct VTContext {
|
||||
AVFrame *tmp_frame;
|
||||
} VTContext;
|
||||
|
||||
char *videotoolbox_pixfmt;
|
||||
|
||||
static int videotoolbox_retrieve_data(AVCodecContext *s, AVFrame *frame)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
VTContext *vt = ist->hwaccel_ctx;
|
||||
CVPixelBufferRef pixbuf = (CVPixelBufferRef)frame->data[3];
|
||||
OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
|
||||
CVReturn err;
|
||||
uint8_t *data[4] = { 0 };
|
||||
int linesize[4] = { 0 };
|
||||
int planes, ret, i;
|
||||
char codec_str[32];
|
||||
|
||||
av_frame_unref(vt->tmp_frame);
|
||||
|
||||
switch (pixel_format) {
|
||||
case kCVPixelFormatType_420YpCbCr8Planar: vt->tmp_frame->format = AV_PIX_FMT_YUV420P; break;
|
||||
case kCVPixelFormatType_422YpCbCr8: vt->tmp_frame->format = AV_PIX_FMT_UYVY422; break;
|
||||
case kCVPixelFormatType_32BGRA: vt->tmp_frame->format = AV_PIX_FMT_BGRA; break;
|
||||
#ifdef kCFCoreFoundationVersionNumber10_7
|
||||
case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: vt->tmp_frame->format = AV_PIX_FMT_NV12; break;
|
||||
#endif
|
||||
default:
|
||||
av_get_codec_tag_string(codec_str, sizeof(codec_str), s->codec_tag);
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"%s: Unsupported pixel format: %s\n", codec_str, videotoolbox_pixfmt);
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
vt->tmp_frame->width = frame->width;
|
||||
vt->tmp_frame->height = frame->height;
|
||||
ret = av_frame_get_buffer(vt->tmp_frame, 32);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
err = CVPixelBufferLockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
|
||||
if (err != kCVReturnSuccess) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error locking the pixel buffer.\n");
|
||||
return AVERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
if (CVPixelBufferIsPlanar(pixbuf)) {
|
||||
|
||||
planes = CVPixelBufferGetPlaneCount(pixbuf);
|
||||
for (i = 0; i < planes; i++) {
|
||||
data[i] = CVPixelBufferGetBaseAddressOfPlane(pixbuf, i);
|
||||
linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(pixbuf, i);
|
||||
}
|
||||
} else {
|
||||
data[0] = CVPixelBufferGetBaseAddress(pixbuf);
|
||||
linesize[0] = CVPixelBufferGetBytesPerRow(pixbuf);
|
||||
}
|
||||
|
||||
av_image_copy(vt->tmp_frame->data, vt->tmp_frame->linesize,
|
||||
(const uint8_t **)data, linesize, vt->tmp_frame->format,
|
||||
frame->width, frame->height);
|
||||
|
||||
ret = av_frame_copy_props(vt->tmp_frame, frame);
|
||||
CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
av_frame_unref(frame);
|
||||
av_frame_move_ref(frame, vt->tmp_frame);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void videotoolbox_uninit(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
VTContext *vt = ist->hwaccel_ctx;
|
||||
|
||||
ist->hwaccel_uninit = NULL;
|
||||
ist->hwaccel_retrieve_data = NULL;
|
||||
|
||||
av_frame_free(&vt->tmp_frame);
|
||||
|
||||
if (ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX) {
|
||||
#if CONFIG_VIDEOTOOLBOX
|
||||
av_videotoolbox_default_free(s);
|
||||
#endif
|
||||
} else {
|
||||
#if CONFIG_VDA
|
||||
av_vda_default_free(s);
|
||||
#endif
|
||||
}
|
||||
av_freep(&ist->hwaccel_ctx);
|
||||
}
|
||||
|
||||
int videotoolbox_init(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
|
||||
int ret = 0;
|
||||
VTContext *vt;
|
||||
|
||||
vt = av_mallocz(sizeof(*vt));
|
||||
if (!vt)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
ist->hwaccel_ctx = vt;
|
||||
ist->hwaccel_uninit = videotoolbox_uninit;
|
||||
ist->hwaccel_retrieve_data = videotoolbox_retrieve_data;
|
||||
|
||||
vt->tmp_frame = av_frame_alloc();
|
||||
if (!vt->tmp_frame) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX) {
|
||||
#if CONFIG_VIDEOTOOLBOX
|
||||
if (!videotoolbox_pixfmt) {
|
||||
ret = av_videotoolbox_default_init(s);
|
||||
} else {
|
||||
AVVideotoolboxContext *vtctx = av_videotoolbox_alloc_context();
|
||||
CFStringRef pixfmt_str = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
videotoolbox_pixfmt,
|
||||
kCFStringEncodingUTF8);
|
||||
#if HAVE_UTGETOSTYPEFROMSTRING
|
||||
vtctx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
|
||||
#else
|
||||
av_log(s, loglevel, "UTGetOSTypeFromString() is not available "
|
||||
"on this platform, %s pixel format can not be honored from "
|
||||
"the command line\n", videotoolbox_pixfmt);
|
||||
#endif
|
||||
ret = av_videotoolbox_default_init2(s, vtctx);
|
||||
CFRelease(pixfmt_str);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#if CONFIG_VDA
|
||||
if (!videotoolbox_pixfmt) {
|
||||
ret = av_vda_default_init(s);
|
||||
} else {
|
||||
AVVDAContext *vdactx = av_vda_alloc_context();
|
||||
CFStringRef pixfmt_str = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
videotoolbox_pixfmt,
|
||||
kCFStringEncodingUTF8);
|
||||
#if HAVE_UTGETOSTYPEFROMSTRING
|
||||
vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
|
||||
#else
|
||||
av_log(s, loglevel, "UTGetOSTypeFromString() is not available "
|
||||
"on this platform, %s pixel format can not be honored from "
|
||||
"the command line\n", videotoolbox_pixfmt);
|
||||
#endif
|
||||
ret = av_vda_default_init2(s, vdactx);
|
||||
CFRelease(pixfmt_str);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (ret < 0) {
|
||||
av_log(NULL, loglevel,
|
||||
"Error creating %s decoder.\n", ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX ? "Videotoolbox" : "VDA");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
videotoolbox_uninit(s);
|
||||
return ret;
|
||||
}
|
134
ffprobe.c
134
ffprobe.c
@@ -77,7 +77,6 @@ static int do_show_format_tags = 0;
|
||||
static int do_show_frame_tags = 0;
|
||||
static int do_show_program_tags = 0;
|
||||
static int do_show_stream_tags = 0;
|
||||
static int do_show_packet_tags = 0;
|
||||
|
||||
static int show_value_unit = 0;
|
||||
static int use_value_prefix = 0;
|
||||
@@ -136,7 +135,6 @@ typedef enum {
|
||||
SECTION_ID_LIBRARY_VERSION,
|
||||
SECTION_ID_LIBRARY_VERSIONS,
|
||||
SECTION_ID_PACKET,
|
||||
SECTION_ID_PACKET_TAGS,
|
||||
SECTION_ID_PACKETS,
|
||||
SECTION_ID_PACKETS_AND_FRAMES,
|
||||
SECTION_ID_PACKET_SIDE_DATA_LIST,
|
||||
@@ -180,8 +178,7 @@ static struct section sections[] = {
|
||||
[SECTION_ID_LIBRARY_VERSION] = { SECTION_ID_LIBRARY_VERSION, "library_version", 0, { -1 } },
|
||||
[SECTION_ID_PACKETS] = { SECTION_ID_PACKETS, "packets", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
|
||||
[SECTION_ID_PACKETS_AND_FRAMES] = { SECTION_ID_PACKETS_AND_FRAMES, "packets_and_frames", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
|
||||
[SECTION_ID_PACKET] = { SECTION_ID_PACKET, "packet", 0, { SECTION_ID_PACKET_TAGS, SECTION_ID_PACKET_SIDE_DATA_LIST, -1 } },
|
||||
[SECTION_ID_PACKET_TAGS] = { SECTION_ID_PACKET_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "packet_tags" },
|
||||
[SECTION_ID_PACKET] = { SECTION_ID_PACKET, "packet", 0, { SECTION_ID_PACKET_SIDE_DATA_LIST, -1 } },
|
||||
[SECTION_ID_PACKET_SIDE_DATA_LIST] ={ SECTION_ID_PACKET_SIDE_DATA_LIST, "side_data_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET_SIDE_DATA, -1 } },
|
||||
[SECTION_ID_PACKET_SIDE_DATA] = { SECTION_ID_PACKET_SIDE_DATA, "side_data", 0, { -1 } },
|
||||
[SECTION_ID_PIXEL_FORMATS] = { SECTION_ID_PIXEL_FORMATS, "pixel_formats", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PIXEL_FORMAT, -1 } },
|
||||
@@ -218,19 +215,8 @@ static AVInputFormat *iformat = NULL;
|
||||
|
||||
static struct AVHashContext *hash;
|
||||
|
||||
static const struct {
|
||||
double bin_val;
|
||||
double dec_val;
|
||||
const char *bin_str;
|
||||
const char *dec_str;
|
||||
} si_prefixes[] = {
|
||||
{ 1.0, 1.0, "", "" },
|
||||
{ 1.024e3, 1e3, "Ki", "K" },
|
||||
{ 1.048576e6, 1e6, "Mi", "M" },
|
||||
{ 1.073741824e9, 1e9, "Gi", "G" },
|
||||
{ 1.099511627776e12, 1e12, "Ti", "T" },
|
||||
{ 1.125899906842624e15, 1e15, "Pi", "P" },
|
||||
};
|
||||
static const char *const binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
|
||||
static const char *const decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P" };
|
||||
|
||||
static const char unit_second_str[] = "s" ;
|
||||
static const char unit_hertz_str[] = "Hz" ;
|
||||
@@ -284,14 +270,14 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
|
||||
|
||||
if (uv.unit == unit_byte_str && use_byte_value_binary_prefix) {
|
||||
index = (long long int) (log2(vald)) / 10;
|
||||
index = av_clip(index, 0, FF_ARRAY_ELEMS(si_prefixes) - 1);
|
||||
vald /= si_prefixes[index].bin_val;
|
||||
prefix_string = si_prefixes[index].bin_str;
|
||||
index = av_clip(index, 0, FF_ARRAY_ELEMS(binary_unit_prefixes) - 1);
|
||||
vald /= exp2(index * 10);
|
||||
prefix_string = binary_unit_prefixes[index];
|
||||
} else {
|
||||
index = (long long int) (log10(vald)) / 3;
|
||||
index = av_clip(index, 0, FF_ARRAY_ELEMS(si_prefixes) - 1);
|
||||
vald /= si_prefixes[index].dec_val;
|
||||
prefix_string = si_prefixes[index].dec_str;
|
||||
index = av_clip(index, 0, FF_ARRAY_ELEMS(decimal_unit_prefixes) - 1);
|
||||
vald /= pow(10, index * 3);
|
||||
prefix_string = decimal_unit_prefixes[index];
|
||||
}
|
||||
vali = vald;
|
||||
}
|
||||
@@ -821,10 +807,10 @@ typedef struct DefaultContext {
|
||||
#define OFFSET(x) offsetof(DefaultContext, x)
|
||||
|
||||
static const AVOption default_options[] = {
|
||||
{ "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{ "nw", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{ "nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{ "nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{ "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{ "nw", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{ "nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{ "nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{NULL},
|
||||
};
|
||||
|
||||
@@ -977,12 +963,12 @@ typedef struct CompactContext {
|
||||
static const AVOption compact_options[]= {
|
||||
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
|
||||
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
|
||||
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
|
||||
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
|
||||
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{NULL},
|
||||
};
|
||||
|
||||
@@ -1093,12 +1079,12 @@ static const Writer compact_writer = {
|
||||
static const AVOption csv_options[] = {
|
||||
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
|
||||
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
|
||||
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
|
||||
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
|
||||
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{NULL},
|
||||
};
|
||||
|
||||
@@ -1131,8 +1117,8 @@ typedef struct FlatContext {
|
||||
static const AVOption flat_options[]= {
|
||||
{"sep_char", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
|
||||
{"s", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
|
||||
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{NULL},
|
||||
};
|
||||
|
||||
@@ -1251,8 +1237,8 @@ typedef struct INIContext {
|
||||
#define OFFSET(x) offsetof(INIContext, x)
|
||||
|
||||
static const AVOption ini_options[] = {
|
||||
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
|
||||
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
|
||||
{NULL},
|
||||
};
|
||||
|
||||
@@ -1357,8 +1343,8 @@ typedef struct JSONContext {
|
||||
#define OFFSET(x) offsetof(JSONContext, x)
|
||||
|
||||
static const AVOption json_options[]= {
|
||||
{ "compact", "enable compact output", OFFSET(compact), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{ "c", "enable compact output", OFFSET(compact), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{ "compact", "enable compact output", OFFSET(compact), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{ "c", "enable compact output", OFFSET(compact), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@@ -1520,10 +1506,10 @@ typedef struct XMLContext {
|
||||
#define OFFSET(x) offsetof(XMLContext, x)
|
||||
|
||||
static const AVOption xml_options[] = {
|
||||
{"fully_qualified", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{"q", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{"xsd_strict", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{"x", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
|
||||
{"fully_qualified", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{"q", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{"xsd_strict", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{"x", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
|
||||
{NULL},
|
||||
};
|
||||
|
||||
@@ -1776,16 +1762,6 @@ static void show_packet(WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pk
|
||||
|
||||
if (pkt->side_data_elems) {
|
||||
int i;
|
||||
int size;
|
||||
const uint8_t *side_metadata;
|
||||
|
||||
side_metadata = av_packet_get_side_data(pkt, AV_PKT_DATA_STRINGS_METADATA, &size);
|
||||
if (side_metadata && size && do_show_packet_tags) {
|
||||
AVDictionary *dict = NULL;
|
||||
if (av_packet_unpack_dictionary(side_metadata, size, &dict) >= 0)
|
||||
show_tags(w, dict, SECTION_ID_PACKET_TAGS);
|
||||
av_dict_free(&dict);
|
||||
}
|
||||
writer_print_section_header(w, SECTION_ID_PACKET_SIDE_DATA_LIST);
|
||||
for (i = 0; i < pkt->side_data_elems; i++) {
|
||||
AVPacketSideData *sd = &pkt->side_data[i];
|
||||
@@ -1838,7 +1814,6 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
AVFormatContext *fmt_ctx)
|
||||
{
|
||||
AVBPrint pbuf;
|
||||
char val_str[128];
|
||||
const char *s;
|
||||
int i;
|
||||
|
||||
@@ -1861,7 +1836,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
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));
|
||||
else print_str_opt("pkt_pos", "N/A");
|
||||
if (av_frame_get_pkt_size(frame) != -1) print_val ("pkt_size", av_frame_get_pkt_size(frame), unit_byte_str);
|
||||
if (av_frame_get_pkt_size(frame) != -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) {
|
||||
@@ -1915,12 +1890,9 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
print_str("side_data_type", name ? name : "unknown");
|
||||
print_int("side_data_size", sd->size);
|
||||
if (sd->type == AV_FRAME_DATA_DISPLAYMATRIX && sd->size >= 9*4) {
|
||||
abort();
|
||||
writer_print_integers(w, "displaymatrix", sd->data, 9, " %11d", 3, 4, 1);
|
||||
print_int("rotation", av_display_rotation_get((int32_t *)sd->data));
|
||||
} else if (sd->type == AV_FRAME_DATA_GOP_TIMECODE && sd->size >= 8) {
|
||||
char tcbuf[AV_TIMECODE_STR_SIZE];
|
||||
av_timecode_make_mpeg_tc_string(tcbuf, *(int64_t *)(sd->data));
|
||||
print_str("timecode", tcbuf);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
@@ -2084,7 +2056,7 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
|
||||
while (pkt1.size && process_frame(w, fmt_ctx, frame, &pkt1) > 0);
|
||||
}
|
||||
}
|
||||
av_packet_unref(&pkt);
|
||||
av_free_packet(&pkt);
|
||||
}
|
||||
av_init_packet(&pkt);
|
||||
pkt.data = NULL;
|
||||
@@ -2164,16 +2136,10 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
}
|
||||
}
|
||||
|
||||
if (!do_bitexact && dec && (profile = av_get_profile_name(dec, dec_ctx->profile)))
|
||||
if (dec && (profile = av_get_profile_name(dec, dec_ctx->profile)))
|
||||
print_str("profile", profile);
|
||||
else {
|
||||
if (dec_ctx->profile != FF_PROFILE_UNKNOWN) {
|
||||
char profile_num[12];
|
||||
snprintf(profile_num, sizeof(profile_num), "%d", dec_ctx->profile);
|
||||
print_str("profile", profile_num);
|
||||
} else
|
||||
else
|
||||
print_str_opt("profile", "unknown");
|
||||
}
|
||||
|
||||
s = av_get_media_type_string(dec_ctx->codec_type);
|
||||
if (s) print_str ("codec_type", s);
|
||||
@@ -2231,7 +2197,6 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
else
|
||||
print_str_opt("chroma_location", av_chroma_location_name(dec_ctx->chroma_sample_location));
|
||||
|
||||
#if FF_API_PRIVATE_OPT
|
||||
if (dec_ctx->timecode_frame_start >= 0) {
|
||||
char tcbuf[AV_TIMECODE_STR_SIZE];
|
||||
av_timecode_make_mpeg_tc_string(tcbuf, dec_ctx->timecode_frame_start);
|
||||
@@ -2239,7 +2204,6 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
} else {
|
||||
print_str_opt("timecode", "N/A");
|
||||
}
|
||||
#endif
|
||||
print_int("refs", dec_ctx->refs);
|
||||
break;
|
||||
|
||||
@@ -2758,7 +2722,7 @@ static void ffprobe_show_pixel_formats(WriterContext *w)
|
||||
for (i = 0; i < pixdesc->nb_components; i++) {
|
||||
writer_print_section_header(w, SECTION_ID_PIXEL_FORMAT_COMPONENT);
|
||||
print_int("index", i + 1);
|
||||
print_int("bit_depth", pixdesc->comp[i].depth);
|
||||
print_int("bit_depth", pixdesc->comp[i].depth_minus1 + 1);
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
@@ -2867,9 +2831,6 @@ static int opt_show_format_entry(void *optctx, const char *opt, const char *arg)
|
||||
char *buf = av_asprintf("format=%s", arg);
|
||||
int ret;
|
||||
|
||||
if (!buf)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"Option '%s' is deprecated, use '-show_entries format=%s' instead\n",
|
||||
opt, arg);
|
||||
@@ -3098,16 +3059,16 @@ static int opt_show_versions(const char *opt, const char *arg)
|
||||
return 0; \
|
||||
}
|
||||
|
||||
DEFINE_OPT_SHOW_SECTION(chapters, CHAPTERS)
|
||||
DEFINE_OPT_SHOW_SECTION(error, ERROR)
|
||||
DEFINE_OPT_SHOW_SECTION(format, FORMAT)
|
||||
DEFINE_OPT_SHOW_SECTION(frames, FRAMES)
|
||||
DEFINE_OPT_SHOW_SECTION(library_versions, LIBRARY_VERSIONS)
|
||||
DEFINE_OPT_SHOW_SECTION(packets, PACKETS)
|
||||
DEFINE_OPT_SHOW_SECTION(pixel_formats, PIXEL_FORMATS)
|
||||
DEFINE_OPT_SHOW_SECTION(program_version, PROGRAM_VERSION)
|
||||
DEFINE_OPT_SHOW_SECTION(streams, STREAMS)
|
||||
DEFINE_OPT_SHOW_SECTION(programs, PROGRAMS)
|
||||
DEFINE_OPT_SHOW_SECTION(chapters, CHAPTERS);
|
||||
DEFINE_OPT_SHOW_SECTION(error, ERROR);
|
||||
DEFINE_OPT_SHOW_SECTION(format, FORMAT);
|
||||
DEFINE_OPT_SHOW_SECTION(frames, FRAMES);
|
||||
DEFINE_OPT_SHOW_SECTION(library_versions, LIBRARY_VERSIONS);
|
||||
DEFINE_OPT_SHOW_SECTION(packets, PACKETS);
|
||||
DEFINE_OPT_SHOW_SECTION(pixel_formats, PIXEL_FORMATS);
|
||||
DEFINE_OPT_SHOW_SECTION(program_version, PROGRAM_VERSION);
|
||||
DEFINE_OPT_SHOW_SECTION(streams, STREAMS);
|
||||
DEFINE_OPT_SHOW_SECTION(programs, PROGRAMS);
|
||||
|
||||
static const OptionDef real_options[] = {
|
||||
#include "cmdutils_common_opts.h"
|
||||
@@ -3214,7 +3175,6 @@ int main(int argc, char **argv)
|
||||
SET_DO_SHOW(FRAME_TAGS, frame_tags);
|
||||
SET_DO_SHOW(PROGRAM_TAGS, program_tags);
|
||||
SET_DO_SHOW(STREAM_TAGS, stream_tags);
|
||||
SET_DO_SHOW(PACKET_TAGS, packet_tags);
|
||||
|
||||
if (do_bitexact && (do_show_program_version || do_show_library_versions)) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
|
715
ffserver.c
715
ffserver.c
File diff suppressed because it is too large
Load Diff
@@ -116,8 +116,7 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
|
||||
{
|
||||
char arg[1024];
|
||||
FFServerIPAddressACL acl;
|
||||
FFServerIPAddressACL *nacl;
|
||||
FFServerIPAddressACL **naclp;
|
||||
int errors = 0;
|
||||
|
||||
ffserver_get_arg(arg, sizeof(arg), &p);
|
||||
if (av_strcasecmp(arg, "allow") == 0)
|
||||
@@ -127,7 +126,7 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
|
||||
else {
|
||||
fprintf(stderr, "%s:%d: ACL action '%s' should be ALLOW or DENY.\n",
|
||||
filename, line_num, arg);
|
||||
goto bail;
|
||||
errors++;
|
||||
}
|
||||
|
||||
ffserver_get_arg(arg, sizeof(arg), &p);
|
||||
@@ -136,9 +135,8 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
|
||||
fprintf(stderr,
|
||||
"%s:%d: ACL refers to invalid host or IP address '%s'\n",
|
||||
filename, line_num, arg);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
errors++;
|
||||
} else
|
||||
acl.last = acl.first;
|
||||
|
||||
ffserver_get_arg(arg, sizeof(arg), &p);
|
||||
@@ -148,12 +146,13 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
|
||||
fprintf(stderr,
|
||||
"%s:%d: ACL refers to invalid host or IP address '%s'\n",
|
||||
filename, line_num, arg);
|
||||
goto bail;
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
|
||||
nacl = av_mallocz(sizeof(*nacl));
|
||||
naclp = 0;
|
||||
if (!errors) {
|
||||
FFServerIPAddressACL *nacl = av_mallocz(sizeof(*nacl));
|
||||
FFServerIPAddressACL **naclp = 0;
|
||||
|
||||
acl.next = 0;
|
||||
*nacl = acl;
|
||||
@@ -164,9 +163,11 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
|
||||
naclp = &feed->acl;
|
||||
else if (ext_acl)
|
||||
naclp = &ext_acl;
|
||||
else
|
||||
else {
|
||||
fprintf(stderr, "%s:%d: ACL found not in <Stream> or <Feed>\n",
|
||||
filename, line_num);
|
||||
errors++;
|
||||
}
|
||||
|
||||
if (naclp) {
|
||||
while (*naclp)
|
||||
@@ -175,10 +176,7 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
|
||||
*naclp = nacl;
|
||||
} else
|
||||
av_free(nacl);
|
||||
|
||||
bail:
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* add a codec and set the default parameters */
|
||||
@@ -232,9 +230,9 @@ static void add_codec(FFServerStream *stream, AVCodecContext *av,
|
||||
/* compute default parameters */
|
||||
switch(av->codec_type) {
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
if (!av_dict_get(recommended, "b", NULL, 0)) {
|
||||
if (!av_dict_get(recommended, "ab", NULL, 0)) {
|
||||
av->bit_rate = 64000;
|
||||
av_dict_set_int(&recommended, "b", av->bit_rate, 0);
|
||||
av_dict_set_int(&recommended, "ab", av->bit_rate, 0);
|
||||
WARNING("Setting default value for audio bit rate = %d. "
|
||||
"Use NoDefaults to disable it.\n",
|
||||
av->bit_rate);
|
||||
@@ -460,7 +458,7 @@ static int ffserver_set_int_param(int *dest, const char *value, int factor,
|
||||
if (tmp < min || tmp > max)
|
||||
goto error;
|
||||
if (factor) {
|
||||
if (tmp == INT_MIN || FFABS(tmp) > INT_MAX / FFABS(factor))
|
||||
if (FFABS(tmp) > INT_MAX / FFABS(factor))
|
||||
goto error;
|
||||
tmp *= factor;
|
||||
}
|
||||
@@ -685,8 +683,8 @@ static int ffserver_parse_config_global(FFServerConfig *config, const char *cmd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ffserver_parse_config_feed(FFServerConfig *config, const char *cmd,
|
||||
const char **p, FFServerStream **pfeed)
|
||||
static int ffserver_parse_config_feed(FFServerConfig *config, const char *cmd, const char **p,
|
||||
FFServerStream **pfeed)
|
||||
{
|
||||
FFServerStream *feed;
|
||||
char arg[1024];
|
||||
@@ -793,8 +791,7 @@ static int ffserver_parse_config_feed(FFServerConfig *config, const char *cmd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd,
|
||||
const char **p,
|
||||
static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, const char **p,
|
||||
FFServerStream **pstream)
|
||||
{
|
||||
char arg[1024], arg2[1024];
|
||||
@@ -926,7 +923,7 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd,
|
||||
ffserver_get_arg(arg, sizeof(arg), p);
|
||||
ffserver_set_float_param(&f, arg, 1000, -FLT_MAX, FLT_MAX, config,
|
||||
"Invalid %s: '%s'\n", cmd, arg);
|
||||
if (ffserver_save_avoption_int("b", (int64_t)lrintf(f),
|
||||
if (ffserver_save_avoption_int("ab", (int64_t)lrintf(f),
|
||||
AV_OPT_FLAG_AUDIO_PARAM, config) < 0)
|
||||
goto nomem;
|
||||
} else if (!av_strcasecmp(cmd, "AudioChannels")) {
|
||||
|
@@ -151,5 +151,5 @@ AVCodec ff_zero12v_decoder = {
|
||||
.id = AV_CODEC_ID_012V,
|
||||
.init = zero12v_decode_init,
|
||||
.decode = zero12v_decode_frame,
|
||||
.capabilities = AV_CODEC_CAP_DR1,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
};
|
||||
|
@@ -559,7 +559,7 @@ static inline void idct_put(FourXContext *f, int x, int y)
|
||||
idct(block[i]);
|
||||
}
|
||||
|
||||
if (!(f->avctx->flags & AV_CODEC_FLAG_GRAY)) {
|
||||
if (!(f->avctx->flags & CODEC_FLAG_GRAY)) {
|
||||
for (i = 4; i < 6; i++)
|
||||
idct(block[i]);
|
||||
}
|
||||
@@ -883,11 +883,11 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
cfrm = &f->cfrm[i];
|
||||
|
||||
if (data_size > UINT_MAX - cfrm->size - AV_INPUT_BUFFER_PADDING_SIZE)
|
||||
if (data_size > UINT_MAX - cfrm->size - FF_INPUT_BUFFER_PADDING_SIZE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
cfrm->data = av_fast_realloc(cfrm->data, &cfrm->allocated_size,
|
||||
cfrm->size + data_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
// explicit check needed as memcpy below might not catch a NULL
|
||||
if (!cfrm->data) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "realloc failure\n");
|
||||
@@ -1026,5 +1026,5 @@ AVCodec ff_fourxm_decoder = {
|
||||
.init = decode_init,
|
||||
.close = decode_end,
|
||||
.decode = decode_frame,
|
||||
.capabilities = AV_CODEC_CAP_DR1,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
};
|
||||
|
@@ -184,5 +184,5 @@ AVCodec ff_eightbps_decoder = {
|
||||
.priv_data_size = sizeof(EightBpsContext),
|
||||
.init = decode_init,
|
||||
.decode = decode_frame,
|
||||
.capabilities = AV_CODEC_CAP_DR1,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
};
|
||||
|
@@ -194,7 +194,7 @@ AVCodec ff_eightsvx_fib_decoder = {
|
||||
.init = eightsvx_decode_init,
|
||||
.decode = eightsvx_decode_frame,
|
||||
.close = eightsvx_decode_close,
|
||||
.capabilities = AV_CODEC_CAP_DR1,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
};
|
||||
@@ -209,7 +209,7 @@ AVCodec ff_eightsvx_exp_decoder = {
|
||||
.init = eightsvx_decode_init,
|
||||
.decode = eightsvx_decode_frame,
|
||||
.close = eightsvx_decode_close,
|
||||
.capabilities = AV_CODEC_CAP_DR1,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
};
|
||||
|
@@ -3,18 +3,16 @@ include $(SUBDIR)../config.mak
|
||||
NAME = avcodec
|
||||
|
||||
HEADERS = avcodec.h \
|
||||
avdct.h \
|
||||
avfft.h \
|
||||
dv_profile.h \
|
||||
d3d11va.h \
|
||||
dirac.h \
|
||||
dxva2.h \
|
||||
old_codec_ids.h \
|
||||
qsv.h \
|
||||
vaapi.h \
|
||||
vda.h \
|
||||
vdpau.h \
|
||||
version.h \
|
||||
videotoolbox.h \
|
||||
vorbis_parser.h \
|
||||
xvmc.h \
|
||||
|
||||
@@ -26,14 +24,11 @@ OBJS = allcodecs.o \
|
||||
bitstream.o \
|
||||
bitstream_filter.o \
|
||||
codec_desc.o \
|
||||
d3d11va.o \
|
||||
dirac.o \
|
||||
dv_profile.o \
|
||||
imgconvert.o \
|
||||
mathtables.o \
|
||||
options.o \
|
||||
parser.o \
|
||||
profiles.o \
|
||||
qsv_api.o \
|
||||
raw.o \
|
||||
resample.o \
|
||||
@@ -61,7 +56,6 @@ FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
|
||||
fft_fixed_32.o fft_init_table.o \
|
||||
$(FFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_FLACDSP) += flacdsp.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o
|
||||
OBJS-$(CONFIG_GOLOMB) += golomb.o
|
||||
OBJS-$(CONFIG_H263DSP) += h263dsp.o
|
||||
@@ -77,14 +71,12 @@ OBJS-$(CONFIG_IDCTDSP) += idctdsp.o simple_idct.o jrevdct.o
|
||||
OBJS-$(CONFIG_IIRFILTER) += iirfilter.o
|
||||
OBJS-$(CONFIG_IMDCT15) += imdct15.o
|
||||
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o
|
||||
OBJS-$(CONFIG_IVIDSP) += ivi_dsp.o
|
||||
OBJS-$(CONFIG_JPEGTABLES) += jpegtables.o
|
||||
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
|
||||
OBJS-$(CONFIG_LLAUDDSP) += lossless_audiodsp.o
|
||||
OBJS-$(CONFIG_LLVIDDSP) += lossless_videodsp.o
|
||||
OBJS-$(CONFIG_LPC) += lpc.o
|
||||
OBJS-$(CONFIG_LSP) += lsp.o
|
||||
OBJS-$(CONFIG_LZF) += lzf.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_32.o
|
||||
OBJS-$(CONFIG_ME_CMP) += me_cmp.o
|
||||
OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o
|
||||
@@ -96,11 +88,10 @@ OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \
|
||||
mpegaudiodsp_float.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o mpegvideodsp.o rl.o \
|
||||
mpegvideo_motion.o mpegutils.o \
|
||||
mpegvideodata.o mpegpicture.o
|
||||
mpegvideodata.o
|
||||
OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
|
||||
motion_est.o ratecontrol.o \
|
||||
mpegvideoencdsp.o
|
||||
OBJS-$(CONFIG_MSS34DSP) += mss34dsp.o
|
||||
OBJS-$(CONFIG_NVENC) += nvenc.o
|
||||
OBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o
|
||||
OBJS-$(CONFIG_QPELDSP) += qpeldsp.o
|
||||
@@ -110,37 +101,23 @@ OBJS-$(CONFIG_QSVENC) += qsvenc.o
|
||||
OBJS-$(CONFIG_RANGECODER) += rangecoder.o
|
||||
RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
|
||||
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_RV34DSP) += rv34dsp.o
|
||||
OBJS-$(CONFIG_SHARED) += log2_tab.o reverse.o
|
||||
OBJS-$(CONFIG_SINEWIN) += sinewin.o sinewin_fixed.o
|
||||
OBJS-$(CONFIG_SNAPPY) += snappy.o
|
||||
OBJS-$(CONFIG_SHARED) += log2_tab.o
|
||||
OBJS-$(CONFIG_SINEWIN) += sinewin.o
|
||||
OBJS-$(CONFIG_STARTCODE) += startcode.o
|
||||
OBJS-$(CONFIG_TEXTUREDSP) += texturedsp.o
|
||||
OBJS-$(CONFIG_TEXTUREDSPENC) += texturedspenc.o
|
||||
OBJS-$(CONFIG_TPELDSP) += tpeldsp.o
|
||||
OBJS-$(CONFIG_VIDEODSP) += videodsp.o
|
||||
OBJS-$(CONFIG_VP3DSP) += vp3dsp.o
|
||||
OBJS-$(CONFIG_VP56DSP) += vp56dsp.o
|
||||
OBJS-$(CONFIG_VP8DSP) += vp8dsp.o
|
||||
OBJS-$(CONFIG_WMA_FREQS) += wma_freqs.o
|
||||
OBJS-$(CONFIG_WMV2DSP) += wmv2dsp.o
|
||||
|
||||
# decoders/encoders
|
||||
OBJS-$(CONFIG_ZERO12V_DECODER) += 012v.o
|
||||
OBJS-$(CONFIG_A64MULTI_ENCODER) += a64multienc.o elbg.o
|
||||
OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o
|
||||
OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps_float.o \
|
||||
OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps.o \
|
||||
aacadtsdec.o mpeg4audio.o kbdwin.o \
|
||||
sbrdsp.o aacpsdsp_float.o
|
||||
OBJS-$(CONFIG_AAC_FIXED_DECODER) += aacdec_fixed.o aactab.o aacsbr_fixed.o aacps_fixed.o \
|
||||
aacadtsdec.o mpeg4audio.o kbdwin.o \
|
||||
sbrdsp_fixed.o aacpsdsp_fixed.o
|
||||
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacenctab.o \
|
||||
sbrdsp.o aacpsdsp.o
|
||||
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
|
||||
aacpsy.o aactab.o \
|
||||
aacenc_is.o \
|
||||
aacenc_tns.o \
|
||||
aacenc_ltp.o \
|
||||
aacenc_pred.o \
|
||||
psymodel.o mpeg4audio.o kbdwin.o
|
||||
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
|
||||
OBJS-$(CONFIG_AC3_DECODER) += ac3dec_float.o ac3dec_data.o ac3.o kbdwin.o
|
||||
@@ -149,7 +126,7 @@ OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \
|
||||
ac3.o kbdwin.o
|
||||
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o
|
||||
OBJS-$(CONFIG_AIC_DECODER) += aic.o
|
||||
OBJS-$(CONFIG_ALAC_DECODER) += alac.o alac_data.o alacdsp.o
|
||||
OBJS-$(CONFIG_ALAC_DECODER) += alac.o alac_data.o
|
||||
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o alac_data.o
|
||||
OBJS-$(CONFIG_ALIAS_PIX_DECODER) += aliaspixdec.o
|
||||
OBJS-$(CONFIG_ALIAS_PIX_ENCODER) += aliaspixenc.o
|
||||
@@ -210,7 +187,6 @@ OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
|
||||
OBJS-$(CONFIG_CCAPTION_DECODER) += ccaption_dec.o
|
||||
OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o
|
||||
OBJS-$(CONFIG_CDXL_DECODER) += cdxl.o
|
||||
OBJS-$(CONFIG_CFHD_DECODER) += cfhd.o cfhddata.o
|
||||
OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
|
||||
OBJS-$(CONFIG_CINEPAK_ENCODER) += cinepakenc.o elbg.o
|
||||
OBJS-$(CONFIG_CLJR_DECODER) += cljrdec.o
|
||||
@@ -222,12 +198,11 @@ OBJS-$(CONFIG_COMFORTNOISE_ENCODER) += cngenc.o
|
||||
OBJS-$(CONFIG_CPIA_DECODER) += cpia.o
|
||||
OBJS-$(CONFIG_CSCD_DECODER) += cscd.o
|
||||
OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o
|
||||
OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadata.o \
|
||||
dca_core.o dca_exss.o dca_xll.o \
|
||||
dcadsp.o dcadct.o synth_filter.o
|
||||
OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \
|
||||
dcadata.o dca_exss.o \
|
||||
dca_xll.o synth_filter.o
|
||||
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dca.o dcadata.o
|
||||
OBJS-$(CONFIG_DDS_DECODER) += dds.o
|
||||
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o diractab.o \
|
||||
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o \
|
||||
dirac_arith.o mpeg12data.o dirac_dwt.o
|
||||
OBJS-$(CONFIG_DFA_DECODER) += dfa.o
|
||||
OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o
|
||||
@@ -245,12 +220,10 @@ OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o
|
||||
OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o
|
||||
OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o
|
||||
OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
|
||||
OBJS-$(CONFIG_DVAUDIO_DECODER) += dvaudiodec.o
|
||||
OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dvenc.o dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
||||
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
|
||||
OBJS-$(CONFIG_DXV_DECODER) += dxv.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3_data.o
|
||||
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o eac3_data.o
|
||||
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
|
||||
@@ -270,8 +243,8 @@ OBJS-$(CONFIG_FFV1_DECODER) += ffv1dec.o ffv1.o
|
||||
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1enc.o ffv1.o
|
||||
OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
|
||||
OBJS-$(CONFIG_FIC_DECODER) += fic.o
|
||||
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o
|
||||
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o vorbis_data.o
|
||||
OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o flacdsp.o
|
||||
OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o flacdsp.o vorbis_data.o
|
||||
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
|
||||
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
|
||||
OBJS-$(CONFIG_FLASHSV2_ENCODER) += flashsv2enc.o
|
||||
@@ -280,11 +253,10 @@ OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
|
||||
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
|
||||
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
|
||||
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
|
||||
OBJS-$(CONFIG_G2M_DECODER) += g2meet.o elsdec.o
|
||||
OBJS-$(CONFIG_G723_1_DECODER) += g723_1dec.o g723_1.o \
|
||||
acelp_vectors.o celp_filters.o celp_math.o
|
||||
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1enc.o g723_1.o \
|
||||
acelp_vectors.o celp_filters.o celp_math.o
|
||||
OBJS-$(CONFIG_G2M_DECODER) += g2meet.o
|
||||
OBJS-$(CONFIG_G723_1_DECODER) += g723_1.o acelp_vectors.o \
|
||||
celp_filters.o celp_math.o
|
||||
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1.o acelp_vectors.o celp_math.o
|
||||
OBJS-$(CONFIG_G729_DECODER) += g729dec.o lsp.o celp_math.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o
|
||||
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
|
||||
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
|
||||
@@ -294,24 +266,20 @@ OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261data.o h261.o
|
||||
OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261data.o h261.o
|
||||
OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
|
||||
mpeg4video.o mpeg4videodec.o flvdec.o\
|
||||
intelh263dec.o h263data.o
|
||||
intelh263dec.o
|
||||
OBJS-$(CONFIG_H263_ENCODER) += mpeg4videoenc.o mpeg4video.o \
|
||||
h263.o h263data.o ituh263enc.o flvenc.o
|
||||
h263.o ituh263enc.o flvenc.o
|
||||
OBJS-$(CONFIG_H264_DECODER) += h264.o h264_cabac.o h264_cavlc.o \
|
||||
h264_direct.o h264_loopfilter.o \
|
||||
h264_mb.o h264_picture.o h264_ps.o \
|
||||
h264_refs.o h264_sei.o h264_slice.o
|
||||
OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o
|
||||
OBJS-$(CONFIG_H264_VDA_DECODER) += vda_h264_dec.o
|
||||
OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec_h2645.o
|
||||
OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec_h264.o
|
||||
OBJS-$(CONFIG_H264_QSV_ENCODER) += qsvenc_h264.o
|
||||
OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o
|
||||
OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o
|
||||
OBJS-$(CONFIG_HEVC_DECODER) += hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o \
|
||||
hevc_cabac.o hevc_refs.o hevcpred.o \
|
||||
hevcdsp.o hevc_filter.o hevc_parse.o hevc_data.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_DECODER) += qsvdec_h2645.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_ENCODER) += qsvenc_hevc.o hevc_ps_enc.o hevc_parse.o
|
||||
hevcdsp.o hevc_filter.o
|
||||
OBJS-$(CONFIG_HNM4_VIDEO_DECODER) += hnm4video.o
|
||||
OBJS-$(CONFIG_HQ_HQA_DECODER) += hq_hqa.o hq_hqadata.o hq_hqadsp.o \
|
||||
canopus.o
|
||||
@@ -320,13 +288,13 @@ OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o huffyuvdec.o
|
||||
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o huffyuvenc.o
|
||||
OBJS-$(CONFIG_IDCIN_DECODER) += idcinvideo.o
|
||||
OBJS-$(CONFIG_IDF_DECODER) += bintext.o cga_data.o
|
||||
OBJS-$(CONFIG_IFF_BYTERUN1_DECODER) += iff.o
|
||||
OBJS-$(CONFIG_IFF_ILBM_DECODER) += iff.o
|
||||
OBJS-$(CONFIG_IMC_DECODER) += imc.o
|
||||
OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
|
||||
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
|
||||
OBJS-$(CONFIG_INDEO4_DECODER) += indeo4.o ivi.o
|
||||
OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi.o
|
||||
OBJS-$(CONFIG_INTERPLAY_ACM_DECODER) += interplayacm.o
|
||||
OBJS-$(CONFIG_INDEO4_DECODER) += indeo4.o ivi.o ivi_dsp.o
|
||||
OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi.o ivi_dsp.o
|
||||
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
|
||||
OBJS-$(CONFIG_JACOSUB_DECODER) += jacosubdec.o ass.o
|
||||
@@ -378,9 +346,6 @@ OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2_MMAL_DECODER) += mmaldec.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_DECODER) += qsvdec_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_ENCODER) += qsvenc_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG4_DECODER) += xvididct.o
|
||||
OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
@@ -389,13 +354,13 @@ OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
|
||||
OBJS-$(CONFIG_MSA1_DECODER) += mss3.o
|
||||
OBJS-$(CONFIG_MSA1_DECODER) += mss3.o mss34dsp.o
|
||||
OBJS-$(CONFIG_MSS1_DECODER) += mss1.o mss12.o
|
||||
OBJS-$(CONFIG_MSS2_DECODER) += mss2.o mss12.o mss2dsp.o
|
||||
OBJS-$(CONFIG_MSVIDEO1_DECODER) += msvideo1.o
|
||||
OBJS-$(CONFIG_MSVIDEO1_ENCODER) += msvideo1enc.o elbg.o
|
||||
OBJS-$(CONFIG_MSZH_DECODER) += lcldec.o
|
||||
OBJS-$(CONFIG_MTS2_DECODER) += mss4.o
|
||||
OBJS-$(CONFIG_MTS2_DECODER) += mss4.o mss34dsp.o
|
||||
OBJS-$(CONFIG_MVC1_DECODER) += mvcdec.o
|
||||
OBJS-$(CONFIG_MVC2_DECODER) += mvcdec.o
|
||||
OBJS-$(CONFIG_MXPEG_DECODER) += mxpegdec.o
|
||||
@@ -455,19 +420,16 @@ OBJS-$(CONFIG_ROQ_ENCODER) += roqvideoenc.o roqvideo.o elbg.o
|
||||
OBJS-$(CONFIG_ROQ_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_ROQ_DPCM_ENCODER) += roqaudioenc.o
|
||||
OBJS-$(CONFIG_RPZA_DECODER) += rpza.o
|
||||
OBJS-$(CONFIG_RSCC_DECODER) += rscc.o
|
||||
OBJS-$(CONFIG_RV10_DECODER) += rv10.o
|
||||
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
|
||||
OBJS-$(CONFIG_RV20_DECODER) += rv10.o
|
||||
OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o
|
||||
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o
|
||||
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv40dsp.o
|
||||
OBJS-$(CONFIG_SAMI_DECODER) += samidec.o ass.o htmlsubtitles.o
|
||||
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o rv34dsp.o
|
||||
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv34dsp.o rv40dsp.o
|
||||
OBJS-$(CONFIG_SAMI_DECODER) += samidec.o ass.o
|
||||
OBJS-$(CONFIG_S302M_DECODER) += s302m.o
|
||||
OBJS-$(CONFIG_S302M_ENCODER) += s302menc.o
|
||||
OBJS-$(CONFIG_SANM_DECODER) += sanm.o
|
||||
OBJS-$(CONFIG_SCREENPRESSO_DECODER) += screenpresso.o
|
||||
OBJS-$(CONFIG_SDX2_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
|
||||
OBJS-$(CONFIG_SGI_ENCODER) += sgienc.o rle.o
|
||||
OBJS-$(CONFIG_SGIRLE_DECODER) += sgirledec.o
|
||||
@@ -488,10 +450,10 @@ OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
|
||||
OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o
|
||||
OBJS-$(CONFIG_SONIC_LS_ENCODER) += sonic.o
|
||||
OBJS-$(CONFIG_SP5X_DECODER) += sp5xdec.o
|
||||
OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o htmlsubtitles.o
|
||||
OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o
|
||||
OBJS-$(CONFIG_SRT_ENCODER) += srtenc.o ass_split.o
|
||||
OBJS-$(CONFIG_STL_DECODER) += textdec.o ass.o
|
||||
OBJS-$(CONFIG_SUBRIP_DECODER) += srtdec.o ass.o htmlsubtitles.o
|
||||
OBJS-$(CONFIG_SUBRIP_DECODER) += srtdec.o ass.o
|
||||
OBJS-$(CONFIG_SUBRIP_ENCODER) += srtenc.o ass_split.o
|
||||
OBJS-$(CONFIG_SUBVIEWER1_DECODER) += textdec.o ass.o
|
||||
OBJS-$(CONFIG_SUBVIEWER_DECODER) += subviewerdec.o ass.o
|
||||
@@ -502,8 +464,7 @@ OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o \
|
||||
h263.o ituh263enc.o
|
||||
OBJS-$(CONFIG_SVQ3_DECODER) += svq3.o svq13.o mpegutils.o
|
||||
OBJS-$(CONFIG_TEXT_DECODER) += textdec.o ass.o
|
||||
OBJS-$(CONFIG_TEXT_ENCODER) += srtenc.o ass_split.o
|
||||
OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o takdsp.o
|
||||
OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o
|
||||
OBJS-$(CONFIG_TARGA_DECODER) += targa.o
|
||||
OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o
|
||||
OBJS-$(CONFIG_TARGA_Y216_DECODER) += targa_y216dec.o
|
||||
@@ -521,7 +482,7 @@ OBJS-$(CONFIG_TSCC2_DECODER) += tscc2.o
|
||||
OBJS-$(CONFIG_TTA_DECODER) += tta.o ttadata.o ttadsp.o
|
||||
OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttadata.o
|
||||
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o
|
||||
OBJS-$(CONFIG_TXD_DECODER) += txd.o
|
||||
OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
|
||||
OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
|
||||
OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideo.o
|
||||
OBJS-$(CONFIG_UTVIDEO_ENCODER) += utvideoenc.o utvideo.o
|
||||
@@ -541,9 +502,6 @@ OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o
|
||||
vc1dsp.o \
|
||||
msmpeg4dec.o msmpeg4.o msmpeg4data.o \
|
||||
wmv2dsp.o
|
||||
OBJS-$(CONFIG_VC1_MMAL_DECODER) += mmaldec.o
|
||||
OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec_vc1.o
|
||||
OBJS-$(CONFIG_VC2_ENCODER) += vc2enc.o vc2enc_dwt.o diractab.o
|
||||
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
|
||||
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdaudio.o
|
||||
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdvideo.o
|
||||
@@ -553,18 +511,20 @@ OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbisdsp.o vorbis.o \
|
||||
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_VP3_DECODER) += vp3.o
|
||||
OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o \
|
||||
OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp56dsp.o \
|
||||
vp56rac.o
|
||||
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
|
||||
vp6dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp8dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_VP9_DECODER) += vp9.o vp9dsp.o vp56rac.o vp9dsp_8bpp.o \
|
||||
vp9dsp_10bpp.o vp9dsp_12bpp.o
|
||||
OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o
|
||||
OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
|
||||
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
|
||||
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackenc.o
|
||||
OBJS-$(CONFIG_WEBP_DECODER) += webp.o
|
||||
OBJS-$(CONFIG_WEBP_DECODER) += vp8.o vp8dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_WEBP_DECODER) += webp.o exif.o tiff_common.o
|
||||
OBJS-$(CONFIG_WEBVTT_DECODER) += webvttdec.o ass.o
|
||||
OBJS-$(CONFIG_WEBVTT_ENCODER) += webvttenc.o ass_split.o
|
||||
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma_common.o
|
||||
@@ -578,13 +538,12 @@ OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
|
||||
acelp_vectors.o acelp_filters.o
|
||||
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV1_ENCODER) += msmpeg4enc.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o \
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2dsp.o \
|
||||
msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o \
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2dsp.o \
|
||||
msmpeg4.o msmpeg4enc.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
|
||||
OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
|
||||
OBJS-$(CONFIG_WRAPPED_AVFRAME_ENCODER) += wrapped_avframe.o
|
||||
OBJS-$(CONFIG_XAN_DPCM_DECODER) += dpcm.o
|
||||
OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o
|
||||
OBJS-$(CONFIG_XAN_WC4_DECODER) += xxan.o
|
||||
@@ -594,8 +553,6 @@ OBJS-$(CONFIG_XBM_ENCODER) += xbmenc.o
|
||||
OBJS-$(CONFIG_XFACE_DECODER) += xfacedec.o xface.o
|
||||
OBJS-$(CONFIG_XFACE_ENCODER) += xfaceenc.o xface.o
|
||||
OBJS-$(CONFIG_XL_DECODER) += xl.o
|
||||
OBJS-$(CONFIG_XMA1_DECODER) += wmaprodec.o wma.o wma_common.o
|
||||
OBJS-$(CONFIG_XMA2_DECODER) += wmaprodec.o wma.o wma_common.o
|
||||
OBJS-$(CONFIG_XSUB_DECODER) += xsubdec.o
|
||||
OBJS-$(CONFIG_XSUB_ENCODER) += xsubenc.o
|
||||
OBJS-$(CONFIG_XWD_DECODER) += xwddec.o
|
||||
@@ -673,7 +630,6 @@ OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o
|
||||
OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o adx.o
|
||||
OBJS-$(CONFIG_ADPCM_AFC_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_AICA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_DTK_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o
|
||||
@@ -704,7 +660,6 @@ OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_WS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_MS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_MS_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_PSX_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER) += adpcm.o adpcm_data.o
|
||||
@@ -715,50 +670,40 @@ OBJS-$(CONFIG_ADPCM_VIMA_DECODER) += vima.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_VIMA_DECODER) += vima.o adpcm_data.o
|
||||
|
||||
# hardware accelerators
|
||||
OBJS-$(CONFIG_D3D11VA) += dxva2.o
|
||||
OBJS-$(CONFIG_DXVA2) += dxva2.o
|
||||
OBJS-$(CONFIG_VAAPI) += vaapi.o
|
||||
OBJS-$(CONFIG_VDA) += vda.o videotoolbox.o
|
||||
OBJS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.o
|
||||
OBJS-$(CONFIG_VDA) += vda.o
|
||||
OBJS-$(CONFIG_VDPAU) += vdpau.o
|
||||
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_H263_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
OBJS-$(CONFIG_H263_VDPAU_HWACCEL) += vdpau_mpeg4.o
|
||||
OBJS-$(CONFIG_H264_D3D11VA_HWACCEL) += dxva2_h264.o
|
||||
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_VDPAU_HWACCEL) += vdpau_h264.o
|
||||
OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL) += dxva2_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
|
||||
OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
|
||||
OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
OBJS-$(CONFIG_MPEG1_XVMC_HWACCEL) += mpegvideo_xvmc.o
|
||||
OBJS-$(CONFIG_MPEG2_D3D11VA_HWACCEL) += dxva2_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
OBJS-$(CONFIG_MPEG2_XVMC_HWACCEL) += mpegvideo_xvmc.o
|
||||
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL) += vdpau_mpeg4.o
|
||||
OBJS-$(CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
OBJS-$(CONFIG_VC1_D3D11VA_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
|
||||
OBJS-$(CONFIG_VP9_D3D11VA_HWACCEL) += dxva2_vp9.o
|
||||
OBJS-$(CONFIG_VP9_DXVA2_HWACCEL) += dxva2_vp9.o
|
||||
OBJS-$(CONFIG_VP9_VAAPI_HWACCEL) += vaapi_vp9.o
|
||||
|
||||
# libavformat dependencies
|
||||
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_AVI_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \
|
||||
ac3tab.o
|
||||
OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o vorbis_data.o
|
||||
@@ -800,6 +745,7 @@ OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_ELBG_FILTER) += elbg.o
|
||||
|
||||
# external codec libraries
|
||||
OBJS-$(CONFIG_LIBAACPLUS_ENCODER) += libaacplus.o
|
||||
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
|
||||
OBJS-$(CONFIG_LIBDCADEC_DECODER) += libdcadec.o dca.o
|
||||
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
|
||||
@@ -811,7 +757,6 @@ OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsmdec.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_ENCODER) += libgsmenc.o
|
||||
OBJS-$(CONFIG_LIBILBC_DECODER) += libilbc.o
|
||||
OBJS-$(CONFIG_LIBILBC_ENCODER) += libilbc.o
|
||||
OBJS-$(CONFIG_LIBKVAZAAR_ENCODER) += libkvazaar.o
|
||||
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o mpegaudiodecheader.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
|
||||
@@ -830,10 +775,12 @@ OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
|
||||
OBJS-$(CONFIG_LIBSHINE_ENCODER) += libshine.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
||||
OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o
|
||||
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
||||
OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
|
||||
OBJS-$(CONFIG_LIBUTVIDEO_DECODER) += libutvideodec.o
|
||||
OBJS-$(CONFIG_LIBUTVIDEO_ENCODER) += libutvideoenc.o
|
||||
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \
|
||||
@@ -845,7 +792,6 @@ OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o
|
||||
OBJS-$(CONFIG_LIBWAVPACK_ENCODER) += libwavpackenc.o
|
||||
OBJS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.o libwebpenc.o
|
||||
OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER) += libwebpenc_common.o libwebpenc_animencoder.o
|
||||
OBJS-$(CONFIG_LIBX262_ENCODER) += libx264.o
|
||||
OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
|
||||
OBJS-$(CONFIG_LIBX265_ENCODER) += libx265.o
|
||||
OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o
|
||||
@@ -866,23 +812,21 @@ OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o dca.o
|
||||
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
|
||||
OBJS-$(CONFIG_DNXHD_PARSER) += dnxhd_parser.o
|
||||
OBJS-$(CONFIG_DPX_PARSER) += dpx_parser.o
|
||||
OBJS-$(CONFIG_DVAUDIO_PARSER) += dvaudio_parser.o
|
||||
OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o
|
||||
OBJS-$(CONFIG_DVD_NAV_PARSER) += dvd_nav_parser.o
|
||||
OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
|
||||
OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_G729_PARSER) += g729_parser.o
|
||||
OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o
|
||||
OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
|
||||
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
|
||||
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o
|
||||
OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o hevc_parse.o hevc_ps.o hevc_data.o
|
||||
OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o
|
||||
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
|
||||
OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
|
||||
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
|
||||
mpeg4videodec.o mpeg4video.o \
|
||||
ituh263dec.o h263dec.o h263data.o
|
||||
ituh263dec.o h263dec.o
|
||||
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \
|
||||
mpegaudiodecheader.o mpegaudiodata.o
|
||||
@@ -905,7 +849,6 @@ OBJS-$(CONFIG_AAC_ADTSTOASC_BSF) += aac_adtstoasc_bsf.o aacadtsdec.o \
|
||||
OBJS-$(CONFIG_CHOMP_BSF) += chomp_bsf.o
|
||||
OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += dump_extradata_bsf.o
|
||||
OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o
|
||||
OBJS-$(CONFIG_HEVC_MP4TOANNEXB_BSF) += hevc_mp4toannexb_bsf.o
|
||||
OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += imx_dump_header_bsf.o
|
||||
OBJS-$(CONFIG_MJPEG2JPEG_BSF) += mjpeg2jpeg_bsf.o
|
||||
OBJS-$(CONFIG_MJPEGA_DUMP_HEADER_BSF) += mjpega_dump_header_bsf.o
|
||||
@@ -928,36 +871,33 @@ SLIBOBJS-$(HAVE_GNU_WINDRES) += avcodecres.o
|
||||
|
||||
SKIPHEADERS += %_tablegen.h \
|
||||
%_tables.h \
|
||||
aac_tablegen_decl.h \
|
||||
fft-internal.h \
|
||||
libutvideo.h \
|
||||
old_codec_ids.h \
|
||||
tableprint.h \
|
||||
tableprint_vlc.h \
|
||||
aaccoder_twoloop.h \
|
||||
aaccoder_trellis.h \
|
||||
aacenc_quantization.h \
|
||||
aacenc_quantization_misc.h \
|
||||
$(ARCH)/vp56_arith.h \
|
||||
|
||||
SKIPHEADERS-$(CONFIG_D3D11VA) += d3d11va.h dxva2_internal.h
|
||||
SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h
|
||||
SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h
|
||||
SKIPHEADERS-$(CONFIG_LIBUTVIDEO) += libutvideo.h
|
||||
SKIPHEADERS-$(CONFIG_LIBVPX) += libvpx.h
|
||||
SKIPHEADERS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.h
|
||||
SKIPHEADERS-$(CONFIG_QSV) += qsv.h qsv_internal.h
|
||||
SKIPHEADERS-$(CONFIG_QSVDEC) += qsvdec.h
|
||||
SKIPHEADERS-$(CONFIG_QSVENC) += qsvenc.h
|
||||
SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
|
||||
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VDA) += vda.h vda_vt_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VDA) += vda.h vda_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vda_vt_internal.h
|
||||
|
||||
TESTPROGS = imgconvert \
|
||||
jpeg2000dwt \
|
||||
mathops \
|
||||
options \
|
||||
avfft \
|
||||
|
||||
TESTPROGS += api-flac
|
||||
|
||||
TESTPROGS-$(CONFIG_CABAC) += cabac
|
||||
TESTPROGS-$(CONFIG_FFT) += fft fft-fixed fft-fixed32
|
||||
TESTPROGS-$(CONFIG_IDCTDSP) += dct
|
||||
@@ -971,18 +911,19 @@ TESTOBJS = dctref.o
|
||||
|
||||
TOOLS = fourcc2pixfmt
|
||||
|
||||
HOSTPROGS = aacps_tablegen \
|
||||
aacps_fixed_tablegen \
|
||||
HOSTPROGS = aac_tablegen \
|
||||
aacps_tablegen \
|
||||
aacsbr_tablegen \
|
||||
cabac_tablegen \
|
||||
cbrt_tablegen \
|
||||
cbrt_fixed_tablegen \
|
||||
cos_tablegen \
|
||||
dsd_tablegen \
|
||||
dv_tablegen \
|
||||
motionpixels_tablegen \
|
||||
mpegaudio_tablegen \
|
||||
pcm_tablegen \
|
||||
qdm2_tablegen \
|
||||
sinewin_tablegen \
|
||||
sinewin_fixed_tablegen \
|
||||
|
||||
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
|
||||
|
||||
@@ -1001,9 +942,8 @@ else
|
||||
$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
|
||||
endif
|
||||
|
||||
GEN_HEADERS = cbrt_tables.h cbrt_fixed_tables.h aacps_tables.h aacps_fixed_tables.h \
|
||||
dv_tables.h \
|
||||
sinewin_tables.h sinewin_fixed_tables.h mpegaudio_tables.h motionpixels_tables.h \
|
||||
GEN_HEADERS = cabac_tables.h cbrt_tables.h aacps_tables.h aacsbr_tables.h aac_tables.h dsd_tables.h dv_tables.h \
|
||||
sinewin_tables.h mpegaudio_tables.h motionpixels_tables.h \
|
||||
pcm_tables.h qdm2_tables.h
|
||||
GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
|
||||
|
||||
@@ -1012,13 +952,13 @@ $(GEN_HEADERS): $(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF)
|
||||
|
||||
ifdef CONFIG_HARDCODED_TABLES
|
||||
$(SUBDIR)aacdec.o: $(SUBDIR)cbrt_tables.h
|
||||
$(SUBDIR)aacdec_fixed.o: $(SUBDIR)cbrt_fixed_tables.h
|
||||
$(SUBDIR)aacps_float.o: $(SUBDIR)aacps_tables.h
|
||||
$(SUBDIR)aacps_fixed.o: $(SUBDIR)aacps_fixed_tables.h
|
||||
$(SUBDIR)aactab_fixed.o: $(SUBDIR)aac_fixed_tables.h
|
||||
$(SUBDIR)aacps.o: $(SUBDIR)aacps_tables.h
|
||||
$(SUBDIR)aacsbr.o: $(SUBDIR)aacsbr_tables.h
|
||||
$(SUBDIR)aactab.o: $(SUBDIR)aac_tables.h
|
||||
$(SUBDIR)cabac.o: $(SUBDIR)cabac_tables.h
|
||||
$(SUBDIR)dsddec.o: $(SUBDIR)dsd_tables.h
|
||||
$(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
|
||||
$(SUBDIR)sinewin.o: $(SUBDIR)sinewin_tables.h
|
||||
$(SUBDIR)sinewin_fixed.o: $(SUBDIR)sinewin_fixed_tables.h
|
||||
$(SUBDIR)mpegaudiodec_fixed.o: $(SUBDIR)mpegaudio_tables.h
|
||||
$(SUBDIR)mpegaudiodec_float.o: $(SUBDIR)mpegaudio_tables.h
|
||||
$(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
|
||||
|
@@ -66,8 +66,7 @@ static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
|
||||
//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7};
|
||||
//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3};
|
||||
|
||||
static void to_meta_with_crop(AVCodecContext *avctx,
|
||||
const AVFrame *p, int *dest)
|
||||
static void to_meta_with_crop(AVCodecContext *avctx, const AVFrame *p, int *dest)
|
||||
{
|
||||
int blockx, blocky, x, y;
|
||||
int luma = 0;
|
||||
@@ -235,7 +234,7 @@ static av_cold int a64multi_encode_init(AVCodecContext *avctx)
|
||||
}
|
||||
|
||||
/* set up extradata */
|
||||
if (!(avctx->extradata = av_mallocz(8 * 4 + AV_INPUT_BUFFER_PADDING_SIZE))) {
|
||||
if (!(avctx->extradata = av_mallocz(8 * 4 + FF_INPUT_BUFFER_PADDING_SIZE))) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Failed to allocate memory for extradata.\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
@@ -328,7 +327,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
/* any frames to encode? */
|
||||
if (c->mc_lifetime) {
|
||||
int alloc_size = charset_size + c->mc_lifetime*(screen_size + colram_size);
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, alloc_size, 0)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, alloc_size)) < 0)
|
||||
return ret;
|
||||
buf = pkt->data;
|
||||
|
||||
@@ -406,7 +405,7 @@ AVCodec ff_a64multi_encoder = {
|
||||
.encode2 = a64multi_encode_frame,
|
||||
.close = a64multi_close_encoder,
|
||||
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
|
||||
.capabilities = AV_CODEC_CAP_DELAY,
|
||||
.capabilities = CODEC_CAP_DELAY,
|
||||
};
|
||||
#endif
|
||||
#if CONFIG_A64MULTI5_ENCODER
|
||||
@@ -420,6 +419,6 @@ AVCodec ff_a64multi5_encoder = {
|
||||
.encode2 = a64multi_encode_frame,
|
||||
.close = a64multi_close_encoder,
|
||||
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
|
||||
.capabilities = AV_CODEC_CAP_DELAY,
|
||||
.capabilities = CODEC_CAP_DELAY,
|
||||
};
|
||||
#endif
|
||||
|
@@ -30,14 +30,9 @@
|
||||
#ifndef AVCODEC_AAC_H
|
||||
#define AVCODEC_AAC_H
|
||||
|
||||
|
||||
#include "aac_defines.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "libavutil/fixed_dsp.h"
|
||||
#include "avcodec.h"
|
||||
#if !USE_FIXED
|
||||
#include "imdct15.h"
|
||||
#endif
|
||||
#include "fft.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "sbr.h"
|
||||
@@ -50,8 +45,6 @@
|
||||
#define TNS_MAX_ORDER 20
|
||||
#define MAX_LTP_LONG_SFB 40
|
||||
|
||||
#define CLIP_AVOIDANCE_FACTOR 0.95f
|
||||
|
||||
enum RawDataBlockType {
|
||||
TYPE_SCE,
|
||||
TYPE_CPE,
|
||||
@@ -83,10 +76,9 @@ enum BandType {
|
||||
ZERO_BT = 0, ///< Scalefactors and spectral data are all zero.
|
||||
FIRST_PAIR_BT = 5, ///< This and later band types encode two values (rather than four) with one code word.
|
||||
ESC_BT = 11, ///< Spectral data are coded with an escape sequence.
|
||||
RESERVED_BT = 12, ///< Band types following are encoded differently from others.
|
||||
NOISE_BT = 13, ///< Spectral data are scaled white noise not coded in the bitstream.
|
||||
INTENSITY_BT2 = 14, ///< Scalefactor data are intensity stereo positions (out of phase).
|
||||
INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions (in phase).
|
||||
INTENSITY_BT2 = 14, ///< Scalefactor data are intensity stereo positions.
|
||||
INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions.
|
||||
};
|
||||
|
||||
#define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10)
|
||||
@@ -133,14 +125,12 @@ typedef struct OutputConfiguration {
|
||||
* Predictor State
|
||||
*/
|
||||
typedef struct PredictorState {
|
||||
AAC_FLOAT cor0;
|
||||
AAC_FLOAT cor1;
|
||||
AAC_FLOAT var0;
|
||||
AAC_FLOAT var1;
|
||||
AAC_FLOAT r0;
|
||||
AAC_FLOAT r1;
|
||||
AAC_FLOAT k1;
|
||||
AAC_FLOAT x_est;
|
||||
float cor0;
|
||||
float cor1;
|
||||
float var0;
|
||||
float var1;
|
||||
float r0;
|
||||
float r1;
|
||||
} PredictorState;
|
||||
|
||||
#define MAX_PREDICTORS 672
|
||||
@@ -151,8 +141,6 @@ typedef struct PredictorState {
|
||||
#define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard
|
||||
#define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference
|
||||
|
||||
#define POW_SF2_ZERO 200 ///< ff_aac_pow2sf_tab index corresponding to pow(2, 0);
|
||||
|
||||
#define NOISE_PRE 256 ///< preamble for NOISE_BT, put in bitstream with the first noise band
|
||||
#define NOISE_PRE_BITS 9 ///< length of preamble
|
||||
#define NOISE_OFFSET 90 ///< subtracted from global gain, used as offset for the preamble
|
||||
@@ -163,8 +151,7 @@ typedef struct PredictorState {
|
||||
typedef struct LongTermPrediction {
|
||||
int8_t present;
|
||||
int16_t lag;
|
||||
int coef_idx;
|
||||
INTFLOAT coef;
|
||||
float coef;
|
||||
int8_t used[MAX_LTP_LONG_SFB];
|
||||
} LongTermPrediction;
|
||||
|
||||
@@ -186,10 +173,7 @@ typedef struct IndividualChannelStream {
|
||||
int predictor_present;
|
||||
int predictor_initialized;
|
||||
int predictor_reset_group;
|
||||
int predictor_reset_count[31]; ///< used by encoder to count prediction resets
|
||||
uint8_t prediction_used[41];
|
||||
uint8_t window_clipping[8]; ///< set if a certain window is near clipping
|
||||
float clip_avoidance_factor; ///< set if any window is near clipping to the necessary atennuation factor to avoid it
|
||||
} IndividualChannelStream;
|
||||
|
||||
/**
|
||||
@@ -201,8 +185,7 @@ typedef struct TemporalNoiseShaping {
|
||||
int length[8][4];
|
||||
int direction[8][4];
|
||||
int order[8][4];
|
||||
int coef_idx[8][4][TNS_MAX_ORDER];
|
||||
INTFLOAT coef[8][4][TNS_MAX_ORDER];
|
||||
float coef[8][4][TNS_MAX_ORDER];
|
||||
} TemporalNoiseShaping;
|
||||
|
||||
/**
|
||||
@@ -239,7 +222,7 @@ typedef struct ChannelCoupling {
|
||||
int ch_select[8]; /**< [0] shared list of gains; [1] list of gains for right channel;
|
||||
* [2] list of gains for left channel; [3] lists of gains for both channels
|
||||
*/
|
||||
INTFLOAT gain[16][120];
|
||||
float gain[16][120];
|
||||
} ChannelCoupling;
|
||||
|
||||
/**
|
||||
@@ -250,23 +233,17 @@ typedef struct SingleChannelElement {
|
||||
TemporalNoiseShaping tns;
|
||||
Pulse pulse;
|
||||
enum BandType band_type[128]; ///< band types
|
||||
enum BandType band_alt[128]; ///< alternative band type (used by encoder)
|
||||
int band_type_run_end[120]; ///< band type run end points
|
||||
INTFLOAT sf[120]; ///< scalefactors
|
||||
float sf[120]; ///< scalefactors
|
||||
int sf_idx[128]; ///< scalefactor indices (used by encoder)
|
||||
uint8_t zeroes[128]; ///< band is not coded (used by encoder)
|
||||
uint8_t can_pns[128]; ///< band is allowed to PNS (informative)
|
||||
float is_ener[128]; ///< Intensity stereo pos (used by encoder)
|
||||
float pns_ener[128]; ///< Noise energy values (used by encoder)
|
||||
DECLARE_ALIGNED(32, INTFLOAT, pcoeffs)[1024]; ///< coefficients for IMDCT, pristine
|
||||
DECLARE_ALIGNED(32, INTFLOAT, coeffs)[1024]; ///< coefficients for IMDCT, maybe processed
|
||||
DECLARE_ALIGNED(32, INTFLOAT, saved)[1536]; ///< overlap
|
||||
DECLARE_ALIGNED(32, INTFLOAT, ret_buf)[2048]; ///< PCM output buffer
|
||||
DECLARE_ALIGNED(16, INTFLOAT, ltp_state)[3072]; ///< time signal for LTP
|
||||
DECLARE_ALIGNED(32, AAC_FLOAT, lcoeffs)[1024]; ///< MDCT of LTP coefficients (used by encoder)
|
||||
DECLARE_ALIGNED(32, AAC_FLOAT, prcoeffs)[1024]; ///< Main prediction coefs (used by encoder)
|
||||
DECLARE_ALIGNED(32, float, pcoeffs)[1024]; ///< coefficients for IMDCT, pristine
|
||||
DECLARE_ALIGNED(32, float, coeffs)[1024]; ///< coefficients for IMDCT, maybe processed
|
||||
DECLARE_ALIGNED(32, float, saved)[1536]; ///< overlap
|
||||
DECLARE_ALIGNED(32, float, ret_buf)[2048]; ///< PCM output buffer
|
||||
DECLARE_ALIGNED(16, float, ltp_state)[3072]; ///< time signal for LTP
|
||||
PredictorState predictor_state[MAX_PREDICTORS];
|
||||
INTFLOAT *ret; ///< PCM output
|
||||
float *ret; ///< PCM output
|
||||
} SingleChannelElement;
|
||||
|
||||
/**
|
||||
@@ -277,9 +254,7 @@ typedef struct ChannelElement {
|
||||
// CPE specific
|
||||
int common_window; ///< Set if channels share a common 'IndividualChannelStream' in bitstream.
|
||||
int ms_mode; ///< Signals mid/side stereo flags coding mode (used by encoder)
|
||||
uint8_t is_mode; ///< Set if any bands have been encoded using intensity stereo (used by encoder)
|
||||
uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band
|
||||
uint8_t is_mask[128]; ///< Set if intensity stereo is used (used by encoder)
|
||||
// shared
|
||||
SingleChannelElement ch[2];
|
||||
// CCE specific
|
||||
@@ -313,7 +288,7 @@ struct AACContext {
|
||||
* (We do not want to have these on the stack.)
|
||||
* @{
|
||||
*/
|
||||
DECLARE_ALIGNED(32, INTFLOAT, buf_mdct)[1024];
|
||||
DECLARE_ALIGNED(32, float, buf_mdct)[1024];
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
@@ -324,12 +299,8 @@ struct AACContext {
|
||||
FFTContext mdct_small;
|
||||
FFTContext mdct_ld;
|
||||
FFTContext mdct_ltp;
|
||||
#if USE_FIXED
|
||||
AVFixedDSPContext *fdsp;
|
||||
#else
|
||||
IMDCT15Context *mdct480;
|
||||
AVFloatDSPContext *fdsp;
|
||||
#endif /* USE_FIXED */
|
||||
int random_state;
|
||||
/** @} */
|
||||
|
||||
@@ -349,7 +320,7 @@ struct AACContext {
|
||||
int dmono_mode; ///< 0->not dmono, 1->use first channel, 2->use second channel
|
||||
/** @} */
|
||||
|
||||
DECLARE_ALIGNED(32, INTFLOAT, temp)[128];
|
||||
DECLARE_ALIGNED(32, float, temp)[128];
|
||||
|
||||
OutputConfiguration oc[2];
|
||||
int warned_num_aac_frames;
|
||||
@@ -357,13 +328,11 @@ struct AACContext {
|
||||
/* aacdec functions pointers */
|
||||
void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce);
|
||||
void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce);
|
||||
void (*apply_tns)(INTFLOAT coef[1024], TemporalNoiseShaping *tns,
|
||||
void (*apply_tns)(float coef[1024], TemporalNoiseShaping *tns,
|
||||
IndividualChannelStream *ics, int decode);
|
||||
void (*windowing_and_mdct_ltp)(AACContext *ac, INTFLOAT *out,
|
||||
INTFLOAT *in, IndividualChannelStream *ics);
|
||||
void (*windowing_and_mdct_ltp)(AACContext *ac, float *out,
|
||||
float *in, IndividualChannelStream *ics);
|
||||
void (*update_ltp)(AACContext *ac, SingleChannelElement *sce);
|
||||
void (*vector_pow43)(int *coefs, int len);
|
||||
void (*subband_scale)(int *dst, int *src, int scale, int offset, int len);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -84,6 +84,14 @@ get_next:
|
||||
avctx->sample_rate = s->sample_rate;
|
||||
|
||||
/* (E-)AC-3: allow downmixing to stereo or mono */
|
||||
#if FF_API_REQUEST_CHANNELS
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (avctx->request_channels == 1)
|
||||
avctx->request_channel_layout = AV_CH_LAYOUT_MONO;
|
||||
else if (avctx->request_channels == 2)
|
||||
avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
if (s->channels > 1 &&
|
||||
avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
|
||||
avctx->channels = 1;
|
||||
|
@@ -89,7 +89,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
||||
}
|
||||
av_free(avctx->extradata);
|
||||
avctx->extradata_size = 2 + pce_size;
|
||||
avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!avctx->extradata) {
|
||||
avctx->extradata_size = 0;
|
||||
return AVERROR(ENOMEM);
|
||||
|
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* AAC defines
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AAC_DEFINES_H
|
||||
#define AVCODEC_AAC_DEFINES_H
|
||||
|
||||
#ifndef USE_FIXED
|
||||
#define USE_FIXED 0
|
||||
#endif
|
||||
|
||||
#if USE_FIXED
|
||||
|
||||
#include "libavutil/softfloat.h"
|
||||
|
||||
#define FFT_FLOAT 0
|
||||
#define FFT_FIXED_32 1
|
||||
|
||||
#define AAC_RENAME(x) x ## _fixed
|
||||
#define AAC_RENAME_32(x) x ## _fixed_32
|
||||
typedef int INTFLOAT;
|
||||
typedef int64_t INT64FLOAT;
|
||||
typedef int16_t SHORTFLOAT;
|
||||
typedef SoftFloat AAC_FLOAT;
|
||||
typedef int AAC_SIGNE;
|
||||
#define FIXR(a) ((int)((a) * 1 + 0.5))
|
||||
#define FIXR10(a) ((int)((a) * 1024.0 + 0.5))
|
||||
#define Q23(a) (int)((a) * 8388608.0 + 0.5)
|
||||
#define Q30(x) (int)((x)*1073741824.0 + 0.5)
|
||||
#define Q31(x) (int)((x)*2147483648.0 + 0.5)
|
||||
#define RANGE15(x) x
|
||||
#define GET_GAIN(x, y) (-(y) << (x)) + 1024
|
||||
#define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16)
|
||||
#define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26)
|
||||
#define AAC_MUL30(x, y) (int)(((int64_t)(x) * (y) + 0x20000000) >> 30)
|
||||
#define AAC_MUL31(x, y) (int)(((int64_t)(x) * (y) + 0x40000000) >> 31)
|
||||
#define AAC_MADD28(x, y, a, b) (int)((((int64_t)(x) * (y)) + \
|
||||
((int64_t)(a) * (b)) + \
|
||||
0x8000000) >> 28)
|
||||
#define AAC_MADD30(x, y, a, b) (int)((((int64_t)(x) * (y)) + \
|
||||
((int64_t)(a) * (b)) + \
|
||||
0x20000000) >> 30)
|
||||
#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \
|
||||
((int64_t)(a) * (b)) + \
|
||||
((int64_t)(c) * (d)) + \
|
||||
((int64_t)(e) * (f)) + \
|
||||
0x20000000) >> 30)
|
||||
#define AAC_MSUB30(x, y, a, b) (int)((((int64_t)(x) * (y)) - \
|
||||
((int64_t)(a) * (b)) + \
|
||||
0x20000000) >> 30)
|
||||
#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \
|
||||
((int64_t)(a) * (b)) - \
|
||||
((int64_t)(c) * (d)) - \
|
||||
((int64_t)(e) * (f)) + \
|
||||
0x20000000) >> 30)
|
||||
#define AAC_MSUB31_V3(x, y, z) (int)((((int64_t)(x) * (z)) - \
|
||||
((int64_t)(y) * (z)) + \
|
||||
0x40000000) >> 31)
|
||||
#define AAC_HALF_SUM(x, y) (x) >> 1 + (y) >> 1
|
||||
#define AAC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))
|
||||
|
||||
#else
|
||||
|
||||
#define FFT_FLOAT 1
|
||||
#define FFT_FIXED_32 0
|
||||
|
||||
#define AAC_RENAME(x) x
|
||||
#define AAC_RENAME_32(x) x
|
||||
typedef float INTFLOAT;
|
||||
typedef float INT64FLOAT;
|
||||
typedef float SHORTFLOAT;
|
||||
typedef float AAC_FLOAT;
|
||||
typedef unsigned AAC_SIGNE;
|
||||
#define FIXR(x) ((float)(x))
|
||||
#define FIXR10(x) ((float)(x))
|
||||
#define Q23(x) x
|
||||
#define Q30(x) x
|
||||
#define Q31(x) x
|
||||
#define RANGE15(x) (32768.0 * (x))
|
||||
#define GET_GAIN(x, y) powf((x), -(y))
|
||||
#define AAC_MUL16(x, y) ((x) * (y))
|
||||
#define AAC_MUL26(x, y) ((x) * (y))
|
||||
#define AAC_MUL30(x, y) ((x) * (y))
|
||||
#define AAC_MUL31(x, y) ((x) * (y))
|
||||
#define AAC_MADD28(x, y, a, b) ((x) * (y) + (a) * (b))
|
||||
#define AAC_MADD30(x, y, a, b) ((x) * (y) + (a) * (b))
|
||||
#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) + \
|
||||
(c) * (d) + (e) * (f))
|
||||
#define AAC_MSUB30(x, y, a, b) ((x) * (y) - (a) * (b))
|
||||
#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) - \
|
||||
(c) * (d) - (e) * (f))
|
||||
#define AAC_MSUB31_V3(x, y, z) ((x) - (y)) * (z)
|
||||
#define AAC_HALF_SUM(x, y) ((x) + (y)) * 0.5f
|
||||
#define AAC_SRA_R(x, y) (x)
|
||||
|
||||
#endif /* USE_FIXED */
|
||||
|
||||
#endif /* AVCODEC_AAC_DEFINES_H */
|
@@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
||||
int size;
|
||||
union {
|
||||
uint64_t u64;
|
||||
uint8_t u8[8 + AV_INPUT_BUFFER_PADDING_SIZE];
|
||||
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||
} tmp;
|
||||
|
||||
tmp.u64 = av_be2ne64(state);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Generate a header file for hardcoded AAC cube-root table
|
||||
* Generate a header file for hardcoded AAC tables
|
||||
*
|
||||
* Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
|
||||
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
@@ -22,17 +22,16 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#define CONFIG_HARDCODED_TABLES 0
|
||||
#include "libavutil/tablegen.h"
|
||||
#include "cbrt_tablegen.h"
|
||||
#include "aac_tablegen.h"
|
||||
#include "tableprint.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
AAC_RENAME(cbrt_tableinit)();
|
||||
ff_aac_tableinit();
|
||||
|
||||
write_fileheader();
|
||||
|
||||
WRITE_ARRAY("static const", uint32_t, cbrt_tab);
|
||||
WRITE_ARRAY("const", float, ff_aac_pow2sf_tab);
|
||||
|
||||
return 0;
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* MPEG-4 Parametric Stereo decoding functions
|
||||
* Header file for hardcoded AAC tables
|
||||
*
|
||||
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
@@ -19,6 +20,23 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define USE_FIXED 1
|
||||
#ifndef AVCODEC_AAC_TABLEGEN_H
|
||||
#define AVCODEC_AAC_TABLEGEN_H
|
||||
|
||||
#include "aacps.c"
|
||||
#include "aac_tablegen_decl.h"
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
#include "libavcodec/aac_tables.h"
|
||||
#else
|
||||
#include "libavutil/mathematics.h"
|
||||
float ff_aac_pow2sf_tab[428];
|
||||
|
||||
av_cold void ff_aac_tableinit(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 428; i++)
|
||||
ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.0);
|
||||
}
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
#endif /* AVCODEC_AAC_TABLEGEN_H */
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Generate a header file for hardcoded Parametric Stereo tables
|
||||
* Header file for hardcoded AAC tables
|
||||
*
|
||||
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
|
||||
*
|
||||
@@ -20,5 +20,17 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define USE_FIXED 1
|
||||
#include "aacps_tablegen_template.c"
|
||||
#ifndef AVCODEC_AAC_TABLEGEN_DECL_H
|
||||
#define AVCODEC_AAC_TABLEGEN_DECL_H
|
||||
|
||||
#define POW_SF2_ZERO 200 ///< ff_aac_pow2sf_tab index corresponding to pow(2, 0);
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
#define ff_aac_tableinit()
|
||||
extern const float ff_aac_pow2sf_tab[428];
|
||||
#else
|
||||
void ff_aac_tableinit(void);
|
||||
extern float ff_aac_pow2sf_tab[428];
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
#endif /* AVCODEC_AAC_TABLEGEN_DECL_H */
|
File diff suppressed because it is too large
Load Diff
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
* AAC encoder trellis codebook selector
|
||||
* Copyright (C) 2008-2009 Konstantin Shishkov
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* AAC encoder trellis codebook selector
|
||||
* @author Konstantin Shishkov
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file contains a template for the codebook_trellis_rate selector function.
|
||||
* It needs to be provided, externally, as an already included declaration,
|
||||
* the following functions from aacenc_quantization/util.h. They're not included
|
||||
* explicitly here to make it possible to provide alternative implementations:
|
||||
* - quantize_band_cost_bits
|
||||
* - abs_pow34_v
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AACCODER_TRELLIS_H
|
||||
#define AVCODEC_AACCODER_TRELLIS_H
|
||||
|
||||
#include <float.h>
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "aac.h"
|
||||
#include "aacenc.h"
|
||||
#include "aactab.h"
|
||||
#include "aacenctab.h"
|
||||
|
||||
/**
|
||||
* structure used in optimal codebook search
|
||||
*/
|
||||
typedef struct TrellisBandCodingPath {
|
||||
int prev_idx; ///< pointer to the previous path point
|
||||
float cost; ///< path cost
|
||||
int run;
|
||||
} TrellisBandCodingPath;
|
||||
|
||||
|
||||
static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
|
||||
int win, int group_len, const float lambda)
|
||||
{
|
||||
TrellisBandCodingPath path[120][CB_TOT_ALL];
|
||||
int w, swb, cb, start, size;
|
||||
int i, j;
|
||||
const int max_sfb = sce->ics.max_sfb;
|
||||
const int run_bits = sce->ics.num_windows == 1 ? 5 : 3;
|
||||
const int run_esc = (1 << run_bits) - 1;
|
||||
int idx, ppos, count;
|
||||
int stackrun[120], stackcb[120], stack_len;
|
||||
float next_minbits = INFINITY;
|
||||
int next_mincb = 0;
|
||||
|
||||
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
|
||||
start = win*128;
|
||||
for (cb = 0; cb < CB_TOT_ALL; cb++) {
|
||||
path[0][cb].cost = run_bits+4;
|
||||
path[0][cb].prev_idx = -1;
|
||||
path[0][cb].run = 0;
|
||||
}
|
||||
for (swb = 0; swb < max_sfb; swb++) {
|
||||
size = sce->ics.swb_sizes[swb];
|
||||
if (sce->zeroes[win*16 + swb]) {
|
||||
float cost_stay_here = path[swb][0].cost;
|
||||
float cost_get_here = next_minbits + run_bits + 4;
|
||||
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][0].run]
|
||||
!= run_value_bits[sce->ics.num_windows == 8][path[swb][0].run+1])
|
||||
cost_stay_here += run_bits;
|
||||
if (cost_get_here < cost_stay_here) {
|
||||
path[swb+1][0].prev_idx = next_mincb;
|
||||
path[swb+1][0].cost = cost_get_here;
|
||||
path[swb+1][0].run = 1;
|
||||
} else {
|
||||
path[swb+1][0].prev_idx = 0;
|
||||
path[swb+1][0].cost = cost_stay_here;
|
||||
path[swb+1][0].run = path[swb][0].run + 1;
|
||||
}
|
||||
next_minbits = path[swb+1][0].cost;
|
||||
next_mincb = 0;
|
||||
for (cb = 1; cb < CB_TOT_ALL; cb++) {
|
||||
path[swb+1][cb].cost = 61450;
|
||||
path[swb+1][cb].prev_idx = -1;
|
||||
path[swb+1][cb].run = 0;
|
||||
}
|
||||
} else {
|
||||
float minbits = next_minbits;
|
||||
int mincb = next_mincb;
|
||||
int startcb = sce->band_type[win*16+swb];
|
||||
startcb = aac_cb_in_map[startcb];
|
||||
next_minbits = INFINITY;
|
||||
next_mincb = 0;
|
||||
for (cb = 0; cb < startcb; cb++) {
|
||||
path[swb+1][cb].cost = 61450;
|
||||
path[swb+1][cb].prev_idx = -1;
|
||||
path[swb+1][cb].run = 0;
|
||||
}
|
||||
for (cb = startcb; cb < CB_TOT_ALL; cb++) {
|
||||
float cost_stay_here, cost_get_here;
|
||||
float bits = 0.0f;
|
||||
if (cb >= 12 && sce->band_type[win*16+swb] != aac_cb_out_map[cb]) {
|
||||
path[swb+1][cb].cost = 61450;
|
||||
path[swb+1][cb].prev_idx = -1;
|
||||
path[swb+1][cb].run = 0;
|
||||
continue;
|
||||
}
|
||||
for (w = 0; w < group_len; w++) {
|
||||
bits += quantize_band_cost_bits(s, &sce->coeffs[start + w*128],
|
||||
&s->scoefs[start + w*128], size,
|
||||
sce->sf_idx[win*16+swb],
|
||||
aac_cb_out_map[cb],
|
||||
0, INFINITY, NULL, NULL, 0);
|
||||
}
|
||||
cost_stay_here = path[swb][cb].cost + bits;
|
||||
cost_get_here = minbits + bits + run_bits + 4;
|
||||
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
|
||||
!= run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
|
||||
cost_stay_here += run_bits;
|
||||
if (cost_get_here < cost_stay_here) {
|
||||
path[swb+1][cb].prev_idx = mincb;
|
||||
path[swb+1][cb].cost = cost_get_here;
|
||||
path[swb+1][cb].run = 1;
|
||||
} else {
|
||||
path[swb+1][cb].prev_idx = cb;
|
||||
path[swb+1][cb].cost = cost_stay_here;
|
||||
path[swb+1][cb].run = path[swb][cb].run + 1;
|
||||
}
|
||||
if (path[swb+1][cb].cost < next_minbits) {
|
||||
next_minbits = path[swb+1][cb].cost;
|
||||
next_mincb = cb;
|
||||
}
|
||||
}
|
||||
}
|
||||
start += sce->ics.swb_sizes[swb];
|
||||
}
|
||||
|
||||
//convert resulting path from backward-linked list
|
||||
stack_len = 0;
|
||||
idx = 0;
|
||||
for (cb = 1; cb < CB_TOT_ALL; cb++)
|
||||
if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
|
||||
idx = cb;
|
||||
ppos = max_sfb;
|
||||
while (ppos > 0) {
|
||||
av_assert1(idx >= 0);
|
||||
cb = idx;
|
||||
stackrun[stack_len] = path[ppos][cb].run;
|
||||
stackcb [stack_len] = cb;
|
||||
idx = path[ppos-path[ppos][cb].run+1][cb].prev_idx;
|
||||
ppos -= path[ppos][cb].run;
|
||||
stack_len++;
|
||||
}
|
||||
//perform actual band info encoding
|
||||
start = 0;
|
||||
for (i = stack_len - 1; i >= 0; i--) {
|
||||
cb = aac_cb_out_map[stackcb[i]];
|
||||
put_bits(&s->pb, 4, cb);
|
||||
count = stackrun[i];
|
||||
memset(sce->zeroes + win*16 + start, !cb, count);
|
||||
//XXX: memset when band_type is also uint8_t
|
||||
for (j = 0; j < count; j++) {
|
||||
sce->band_type[win*16 + start] = cb;
|
||||
start++;
|
||||
}
|
||||
while (count >= run_esc) {
|
||||
put_bits(&s->pb, run_bits, run_esc);
|
||||
count -= run_esc;
|
||||
}
|
||||
put_bits(&s->pb, run_bits, count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* AVCODEC_AACCODER_TRELLIS_H */
|
@@ -1,755 +0,0 @@
|
||||
/*
|
||||
* AAC encoder twoloop coder
|
||||
* Copyright (C) 2008-2009 Konstantin Shishkov
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* AAC encoder twoloop coder
|
||||
* @author Konstantin Shishkov, Claudio Freire
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file contains a template for the twoloop coder function.
|
||||
* It needs to be provided, externally, as an already included declaration,
|
||||
* the following functions from aacenc_quantization/util.h. They're not included
|
||||
* explicitly here to make it possible to provide alternative implementations:
|
||||
* - quantize_band_cost
|
||||
* - abs_pow34_v
|
||||
* - find_max_val
|
||||
* - find_min_book
|
||||
* - find_form_factor
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AACCODER_TWOLOOP_H
|
||||
#define AVCODEC_AACCODER_TWOLOOP_H
|
||||
|
||||
#include <float.h>
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "mathops.h"
|
||||
#include "avcodec.h"
|
||||
#include "put_bits.h"
|
||||
#include "aac.h"
|
||||
#include "aacenc.h"
|
||||
#include "aactab.h"
|
||||
#include "aacenctab.h"
|
||||
|
||||
/** Frequency in Hz for lower limit of noise substitution **/
|
||||
#define NOISE_LOW_LIMIT 4000
|
||||
|
||||
#define sclip(x) av_clip(x,60,218)
|
||||
|
||||
/* Reflects the cost to change codebooks */
|
||||
static inline int ff_pns_bits(SingleChannelElement *sce, int w, int g)
|
||||
{
|
||||
return (!g || !sce->zeroes[w*16+g-1] || !sce->can_pns[w*16+g-1]) ? 9 : 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* two-loop quantizers search taken from ISO 13818-7 Appendix C
|
||||
*/
|
||||
static void search_for_quantizers_twoloop(AVCodecContext *avctx,
|
||||
AACEncContext *s,
|
||||
SingleChannelElement *sce,
|
||||
const float lambda)
|
||||
{
|
||||
int start = 0, i, w, w2, g, recomprd;
|
||||
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate
|
||||
/ ((avctx->flags & CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
|
||||
* (lambda / 120.f);
|
||||
int refbits = destbits;
|
||||
int toomanybits, toofewbits;
|
||||
char nzs[128];
|
||||
uint8_t nextband[128];
|
||||
int maxsf[128];
|
||||
float dists[128] = { 0 }, qenergies[128] = { 0 }, uplims[128], euplims[128], energies[128];
|
||||
float maxvals[128], spread_thr_r[128];
|
||||
float min_spread_thr_r, max_spread_thr_r;
|
||||
|
||||
/**
|
||||
* rdlambda controls the maximum tolerated distortion. Twoloop
|
||||
* will keep iterating until it fails to lower it or it reaches
|
||||
* ulimit * rdlambda. Keeping it low increases quality on difficult
|
||||
* signals, but lower it too much, and bits will be taken from weak
|
||||
* signals, creating "holes". A balance is necesary.
|
||||
* rdmax and rdmin specify the relative deviation from rdlambda
|
||||
* allowed for tonality compensation
|
||||
*/
|
||||
float rdlambda = av_clipf(2.0f * 120.f / lambda, 0.0625f, 16.0f);
|
||||
const float nzslope = 1.5f;
|
||||
float rdmin = 0.03125f;
|
||||
float rdmax = 1.0f;
|
||||
|
||||
/**
|
||||
* sfoffs controls an offset of optmium allocation that will be
|
||||
* applied based on lambda. Keep it real and modest, the loop
|
||||
* will take care of the rest, this just accelerates convergence
|
||||
*/
|
||||
float sfoffs = av_clipf(log2f(120.0f / lambda) * 4.0f, -5, 10);
|
||||
|
||||
int fflag, minscaler, maxscaler, nminscaler;
|
||||
int its = 0;
|
||||
int maxits = 30;
|
||||
int allz = 0;
|
||||
int tbits;
|
||||
int cutoff = 1024;
|
||||
int pns_start_pos;
|
||||
int prev;
|
||||
|
||||
/**
|
||||
* zeroscale controls a multiplier of the threshold, if band energy
|
||||
* is below this, a zero is forced. Keep it lower than 1, unless
|
||||
* low lambda is used, because energy < threshold doesn't mean there's
|
||||
* no audible signal outright, it's just energy. Also make it rise
|
||||
* slower than rdlambda, as rdscale has due compensation with
|
||||
* noisy band depriorization below, whereas zeroing logic is rather dumb
|
||||
*/
|
||||
float zeroscale;
|
||||
if (lambda > 120.f) {
|
||||
zeroscale = av_clipf(powf(120.f / lambda, 0.25f), 0.0625f, 1.0f);
|
||||
} else {
|
||||
zeroscale = 1.f;
|
||||
}
|
||||
|
||||
if (s->psy.bitres.alloc >= 0) {
|
||||
/**
|
||||
* Psy granted us extra bits to use, from the reservoire
|
||||
* adjust for lambda except what psy already did
|
||||
*/
|
||||
destbits = s->psy.bitres.alloc
|
||||
* (lambda / (avctx->global_quality ? avctx->global_quality : 120));
|
||||
}
|
||||
|
||||
if (avctx->flags & CODEC_FLAG_QSCALE) {
|
||||
/**
|
||||
* Constant Q-scale doesn't compensate MS coding on its own
|
||||
* No need to be overly precise, this only controls RD
|
||||
* adjustment CB limits when going overboard
|
||||
*/
|
||||
if (s->options.mid_side && s->cur_type == TYPE_CPE)
|
||||
destbits *= 2;
|
||||
|
||||
/**
|
||||
* When using a constant Q-scale, don't adjust bits, just use RD
|
||||
* Don't let it go overboard, though... 8x psy target is enough
|
||||
*/
|
||||
toomanybits = 5800;
|
||||
toofewbits = destbits / 16;
|
||||
|
||||
/** Don't offset scalers, just RD */
|
||||
sfoffs = sce->ics.num_windows - 1;
|
||||
rdlambda = sqrtf(rdlambda);
|
||||
|
||||
/** search further */
|
||||
maxits *= 2;
|
||||
} else {
|
||||
/* When using ABR, be strict, but a reasonable leeway is
|
||||
* critical to allow RC to smoothly track desired bitrate
|
||||
* without sudden quality drops that cause audible artifacts.
|
||||
* Symmetry is also desirable, to avoid systematic bias.
|
||||
*/
|
||||
toomanybits = destbits + destbits/8;
|
||||
toofewbits = destbits - destbits/8;
|
||||
|
||||
sfoffs = 0;
|
||||
rdlambda = sqrtf(rdlambda);
|
||||
}
|
||||
|
||||
/** and zero out above cutoff frequency */
|
||||
{
|
||||
int wlen = 1024 / sce->ics.num_windows;
|
||||
int bandwidth;
|
||||
|
||||
/**
|
||||
* Scale, psy gives us constant quality, this LP only scales
|
||||
* bitrate by lambda, so we save bits on subjectively unimportant HF
|
||||
* rather than increase quantization noise. Adjust nominal bitrate
|
||||
* to effective bitrate according to encoding parameters,
|
||||
* AAC_CUTOFF_FROM_BITRATE is calibrated for effective bitrate.
|
||||
*/
|
||||
float rate_bandwidth_multiplier = 1.5f;
|
||||
int frame_bit_rate = (avctx->flags & CODEC_FLAG_QSCALE)
|
||||
? (refbits * rate_bandwidth_multiplier * avctx->sample_rate / 1024)
|
||||
: (avctx->bit_rate / avctx->channels);
|
||||
|
||||
/** Compensate for extensions that increase efficiency */
|
||||
if (s->options.pns || s->options.intensity_stereo)
|
||||
frame_bit_rate *= 1.15f;
|
||||
|
||||
if (avctx->cutoff > 0) {
|
||||
bandwidth = avctx->cutoff;
|
||||
} else {
|
||||
bandwidth = FFMAX(3000, AAC_CUTOFF_FROM_BITRATE(frame_bit_rate, 1, avctx->sample_rate));
|
||||
s->psy.cutoff = bandwidth;
|
||||
}
|
||||
|
||||
cutoff = bandwidth * 2 * wlen / avctx->sample_rate;
|
||||
pns_start_pos = NOISE_LOW_LIMIT * 2 * wlen / avctx->sample_rate;
|
||||
}
|
||||
|
||||
/**
|
||||
* for values above this the decoder might end up in an endless loop
|
||||
* due to always having more bits than what can be encoded.
|
||||
*/
|
||||
destbits = FFMIN(destbits, 5800);
|
||||
toomanybits = FFMIN(toomanybits, 5800);
|
||||
toofewbits = FFMIN(toofewbits, 5800);
|
||||
/**
|
||||
* XXX: some heuristic to determine initial quantizers will reduce search time
|
||||
* determine zero bands and upper distortion limits
|
||||
*/
|
||||
min_spread_thr_r = -1;
|
||||
max_spread_thr_r = -1;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) {
|
||||
int nz = 0;
|
||||
float uplim = 0.0f, energy = 0.0f, spread = 0.0f;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
||||
if (start >= cutoff || band->energy <= (band->threshold * zeroscale) || band->threshold == 0.0f) {
|
||||
sce->zeroes[(w+w2)*16+g] = 1;
|
||||
continue;
|
||||
}
|
||||
nz = 1;
|
||||
}
|
||||
if (!nz) {
|
||||
uplim = 0.0f;
|
||||
} else {
|
||||
nz = 0;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
||||
if (band->energy <= (band->threshold * zeroscale) || band->threshold == 0.0f)
|
||||
continue;
|
||||
uplim += band->threshold;
|
||||
energy += band->energy;
|
||||
spread += band->spread;
|
||||
nz++;
|
||||
}
|
||||
}
|
||||
uplims[w*16+g] = uplim;
|
||||
energies[w*16+g] = energy;
|
||||
nzs[w*16+g] = nz;
|
||||
sce->zeroes[w*16+g] = !nz;
|
||||
allz |= nz;
|
||||
if (nz && sce->can_pns[w*16+g]) {
|
||||
spread_thr_r[w*16+g] = energy * nz / (uplim * spread);
|
||||
if (min_spread_thr_r < 0) {
|
||||
min_spread_thr_r = max_spread_thr_r = spread_thr_r[w*16+g];
|
||||
} else {
|
||||
min_spread_thr_r = FFMIN(min_spread_thr_r, spread_thr_r[w*16+g]);
|
||||
max_spread_thr_r = FFMAX(max_spread_thr_r, spread_thr_r[w*16+g]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Compute initial scalers */
|
||||
minscaler = 65535;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
if (sce->zeroes[w*16+g]) {
|
||||
sce->sf_idx[w*16+g] = SCALE_ONE_POS;
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* log2f-to-distortion ratio is, technically, 2 (1.5db = 4, but it's power vs level so it's 2).
|
||||
* But, as offsets are applied, low-frequency signals are too sensitive to the induced distortion,
|
||||
* so we make scaling more conservative by choosing a lower log2f-to-distortion ratio, and thus
|
||||
* more robust.
|
||||
*/
|
||||
sce->sf_idx[w*16+g] = av_clip(
|
||||
SCALE_ONE_POS
|
||||
+ 1.75*log2f(FFMAX(0.00125f,uplims[w*16+g]) / sce->ics.swb_sizes[g])
|
||||
+ sfoffs,
|
||||
60, SCALE_MAX_POS);
|
||||
minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
|
||||
}
|
||||
}
|
||||
|
||||
/** Clip */
|
||||
minscaler = av_clip(minscaler, SCALE_ONE_POS - SCALE_DIV_512, SCALE_MAX_POS - SCALE_DIV_512);
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
|
||||
for (g = 0; g < sce->ics.num_swb; g++)
|
||||
if (!sce->zeroes[w*16+g])
|
||||
sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF - 1);
|
||||
|
||||
if (!allz)
|
||||
return;
|
||||
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
|
||||
ff_quantize_band_cost_cache_init(s);
|
||||
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
const float *scaled = s->scoefs + start;
|
||||
maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled);
|
||||
start += sce->ics.swb_sizes[g];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scale uplims to match rate distortion to quality
|
||||
* bu applying noisy band depriorization and tonal band priorization.
|
||||
* Maxval-energy ratio gives us an idea of how noisy/tonal the band is.
|
||||
* If maxval^2 ~ energy, then that band is mostly noise, and we can relax
|
||||
* rate distortion requirements.
|
||||
*/
|
||||
memcpy(euplims, uplims, sizeof(euplims));
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
/** psy already priorizes transients to some extent */
|
||||
float de_psy_factor = (sce->ics.num_windows > 1) ? 8.0f / sce->ics.group_len[w] : 1.0f;
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
if (nzs[g] > 0) {
|
||||
float cleanup_factor = ff_sqrf(av_clipf(start / (cutoff * 0.75f), 1.0f, 2.0f));
|
||||
float energy2uplim = find_form_factor(
|
||||
sce->ics.group_len[w], sce->ics.swb_sizes[g],
|
||||
uplims[w*16+g] / (nzs[g] * sce->ics.swb_sizes[w]),
|
||||
sce->coeffs + start,
|
||||
nzslope * cleanup_factor);
|
||||
energy2uplim *= de_psy_factor;
|
||||
if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
|
||||
/** In ABR, we need to priorize less and let rate control do its thing */
|
||||
energy2uplim = sqrtf(energy2uplim);
|
||||
}
|
||||
energy2uplim = FFMAX(0.015625f, FFMIN(1.0f, energy2uplim));
|
||||
uplims[w*16+g] *= av_clipf(rdlambda * energy2uplim, rdmin, rdmax)
|
||||
* sce->ics.group_len[w];
|
||||
|
||||
energy2uplim = find_form_factor(
|
||||
sce->ics.group_len[w], sce->ics.swb_sizes[g],
|
||||
uplims[w*16+g] / (nzs[g] * sce->ics.swb_sizes[w]),
|
||||
sce->coeffs + start,
|
||||
2.0f);
|
||||
energy2uplim *= de_psy_factor;
|
||||
if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
|
||||
/** In ABR, we need to priorize less and let rate control do its thing */
|
||||
energy2uplim = sqrtf(energy2uplim);
|
||||
}
|
||||
energy2uplim = FFMAX(0.015625f, FFMIN(1.0f, energy2uplim));
|
||||
euplims[w*16+g] *= av_clipf(rdlambda * energy2uplim * sce->ics.group_len[w],
|
||||
0.5f, 1.0f);
|
||||
}
|
||||
start += sce->ics.swb_sizes[g];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(maxsf) / sizeof(maxsf[0]); ++i)
|
||||
maxsf[i] = SCALE_MAX_POS;
|
||||
|
||||
//perform two-loop search
|
||||
//outer loop - improve quality
|
||||
do {
|
||||
//inner loop - quantize spectrum to fit into given number of bits
|
||||
int overdist;
|
||||
int qstep = its ? 1 : 32;
|
||||
do {
|
||||
int changed = 0;
|
||||
prev = -1;
|
||||
recomprd = 0;
|
||||
tbits = 0;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
const float *coefs = &sce->coeffs[start];
|
||||
const float *scaled = &s->scoefs[start];
|
||||
int bits = 0;
|
||||
int cb;
|
||||
float dist = 0.0f;
|
||||
float qenergy = 0.0f;
|
||||
|
||||
if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
|
||||
start += sce->ics.swb_sizes[g];
|
||||
if (sce->can_pns[w*16+g]) {
|
||||
/** PNS isn't free */
|
||||
tbits += ff_pns_bits(sce, w, g);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
int b;
|
||||
float sqenergy;
|
||||
dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128,
|
||||
scaled + w2*128,
|
||||
sce->ics.swb_sizes[g],
|
||||
sce->sf_idx[w*16+g],
|
||||
cb,
|
||||
1.0f,
|
||||
INFINITY,
|
||||
&b, &sqenergy,
|
||||
0);
|
||||
bits += b;
|
||||
qenergy += sqenergy;
|
||||
}
|
||||
dists[w*16+g] = dist - bits;
|
||||
qenergies[w*16+g] = qenergy;
|
||||
if (prev != -1) {
|
||||
int sfdiff = av_clip(sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO, 0, 2*SCALE_MAX_DIFF);
|
||||
bits += ff_aac_scalefactor_bits[sfdiff];
|
||||
}
|
||||
tbits += bits;
|
||||
start += sce->ics.swb_sizes[g];
|
||||
prev = sce->sf_idx[w*16+g];
|
||||
}
|
||||
}
|
||||
if (tbits > toomanybits) {
|
||||
recomprd = 1;
|
||||
for (i = 0; i < 128; i++) {
|
||||
if (sce->sf_idx[i] < (SCALE_MAX_POS - SCALE_DIV_512)) {
|
||||
int maxsf_i = (tbits > 5800) ? SCALE_MAX_POS : maxsf[i];
|
||||
int new_sf = FFMIN(maxsf_i, sce->sf_idx[i] + qstep);
|
||||
if (new_sf != sce->sf_idx[i]) {
|
||||
sce->sf_idx[i] = new_sf;
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (tbits < toofewbits) {
|
||||
recomprd = 1;
|
||||
for (i = 0; i < 128; i++) {
|
||||
if (sce->sf_idx[i] > SCALE_ONE_POS) {
|
||||
int new_sf = FFMAX(SCALE_ONE_POS, sce->sf_idx[i] - qstep);
|
||||
if (new_sf != sce->sf_idx[i]) {
|
||||
sce->sf_idx[i] = new_sf;
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
qstep >>= 1;
|
||||
if (!qstep && tbits > toomanybits && sce->sf_idx[0] < 217 && changed)
|
||||
qstep = 1;
|
||||
} while (qstep);
|
||||
|
||||
overdist = 1;
|
||||
fflag = tbits < toofewbits;
|
||||
for (i = 0; i < 2 && (overdist || recomprd); ++i) {
|
||||
if (recomprd) {
|
||||
/** Must recompute distortion */
|
||||
prev = -1;
|
||||
tbits = 0;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
const float *coefs = sce->coeffs + start;
|
||||
const float *scaled = s->scoefs + start;
|
||||
int bits = 0;
|
||||
int cb;
|
||||
float dist = 0.0f;
|
||||
float qenergy = 0.0f;
|
||||
|
||||
if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
|
||||
start += sce->ics.swb_sizes[g];
|
||||
if (sce->can_pns[w*16+g]) {
|
||||
/** PNS isn't free */
|
||||
tbits += ff_pns_bits(sce, w, g);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
int b;
|
||||
float sqenergy;
|
||||
dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128,
|
||||
scaled + w2*128,
|
||||
sce->ics.swb_sizes[g],
|
||||
sce->sf_idx[w*16+g],
|
||||
cb,
|
||||
1.0f,
|
||||
INFINITY,
|
||||
&b, &sqenergy,
|
||||
0);
|
||||
bits += b;
|
||||
qenergy += sqenergy;
|
||||
}
|
||||
dists[w*16+g] = dist - bits;
|
||||
qenergies[w*16+g] = qenergy;
|
||||
if (prev != -1) {
|
||||
int sfdiff = av_clip(sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO, 0, 2*SCALE_MAX_DIFF);
|
||||
bits += ff_aac_scalefactor_bits[sfdiff];
|
||||
}
|
||||
tbits += bits;
|
||||
start += sce->ics.swb_sizes[g];
|
||||
prev = sce->sf_idx[w*16+g];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!i && s->options.pns && its > maxits/2 && tbits > toofewbits) {
|
||||
float maxoverdist = 0.0f;
|
||||
float ovrfactor = 1.f+(maxits-its)*16.f/maxits;
|
||||
overdist = recomprd = 0;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) {
|
||||
if (!sce->zeroes[w*16+g] && sce->sf_idx[w*16+g] > SCALE_ONE_POS && dists[w*16+g] > uplims[w*16+g]*ovrfactor) {
|
||||
float ovrdist = dists[w*16+g] / FFMAX(uplims[w*16+g],euplims[w*16+g]);
|
||||
maxoverdist = FFMAX(maxoverdist, ovrdist);
|
||||
overdist++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (overdist) {
|
||||
/* We have overdistorted bands, trade for zeroes (that can be noise)
|
||||
* Zero the bands in the lowest 1.25% spread-energy-threshold ranking
|
||||
*/
|
||||
float minspread = max_spread_thr_r;
|
||||
float maxspread = min_spread_thr_r;
|
||||
float zspread;
|
||||
int zeroable = 0;
|
||||
int zeroed = 0;
|
||||
int maxzeroed, zloop;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) {
|
||||
if (start >= pns_start_pos && !sce->zeroes[w*16+g] && sce->can_pns[w*16+g]) {
|
||||
minspread = FFMIN(minspread, spread_thr_r[w*16+g]);
|
||||
maxspread = FFMAX(maxspread, spread_thr_r[w*16+g]);
|
||||
zeroable++;
|
||||
}
|
||||
}
|
||||
}
|
||||
zspread = (maxspread-minspread) * 0.0125f + minspread;
|
||||
/* Don't PNS everything even if allowed. It suppresses bit starvation signals from RC,
|
||||
* and forced the hand of the later search_for_pns step.
|
||||
* Instead, PNS a fraction of the spread_thr_r range depending on how starved for bits we are,
|
||||
* and leave further PNSing to search_for_pns if worthwhile.
|
||||
*/
|
||||
zspread = FFMIN3(min_spread_thr_r * 8.f, zspread,
|
||||
((toomanybits - tbits) * min_spread_thr_r + (tbits - toofewbits) * max_spread_thr_r) / (toomanybits - toofewbits + 1));
|
||||
maxzeroed = FFMIN(zeroable, FFMAX(1, (zeroable * its + maxits - 1) / (2 * maxits)));
|
||||
for (zloop = 0; zloop < 2; zloop++) {
|
||||
/* Two passes: first distorted stuff - two birds in one shot and all that,
|
||||
* then anything viable. Viable means not zero, but either CB=zero-able
|
||||
* (too high SF), not SF <= 1 (that means we'd be operating at very high
|
||||
* quality, we don't want PNS when doing VHQ), PNS allowed, and within
|
||||
* the lowest ranking percentile.
|
||||
*/
|
||||
float loopovrfactor = (zloop) ? 1.0f : ovrfactor;
|
||||
int loopminsf = (zloop) ? (SCALE_ONE_POS - SCALE_DIV_512) : SCALE_ONE_POS;
|
||||
int mcb;
|
||||
for (g = sce->ics.num_swb-1; g > 0 && zeroed < maxzeroed; g--) {
|
||||
if (sce->ics.swb_offset[g] < pns_start_pos)
|
||||
continue;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
if (!sce->zeroes[w*16+g] && sce->can_pns[w*16+g] && spread_thr_r[w*16+g] <= zspread
|
||||
&& sce->sf_idx[w*16+g] > loopminsf
|
||||
&& (dists[w*16+g] > loopovrfactor*uplims[w*16+g] || !(mcb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]))
|
||||
|| (mcb <= 1 && dists[w*16+g] > FFMIN(uplims[w*16+g], euplims[w*16+g]))) ) {
|
||||
sce->zeroes[w*16+g] = 1;
|
||||
sce->band_type[w*16+g] = 0;
|
||||
zeroed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (zeroed)
|
||||
recomprd = fflag = 1;
|
||||
} else {
|
||||
overdist = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
minscaler = SCALE_MAX_POS;
|
||||
maxscaler = 0;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
if (!sce->zeroes[w*16+g]) {
|
||||
minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
|
||||
maxscaler = FFMAX(maxscaler, sce->sf_idx[w*16+g]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
minscaler = nminscaler = av_clip(minscaler, SCALE_ONE_POS - SCALE_DIV_512, SCALE_MAX_POS - SCALE_DIV_512);
|
||||
prev = -1;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
/** Start with big steps, end up fine-tunning */
|
||||
int depth = (its > maxits/2) ? ((its > maxits*2/3) ? 1 : 3) : 10;
|
||||
int edepth = depth+2;
|
||||
float uplmax = its / (maxits*0.25f) + 1.0f;
|
||||
uplmax *= (tbits > destbits) ? FFMIN(2.0f, tbits / (float)FFMAX(1,destbits)) : 1.0f;
|
||||
start = w * 128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
int prevsc = sce->sf_idx[w*16+g];
|
||||
if (prev < 0 && !sce->zeroes[w*16+g])
|
||||
prev = sce->sf_idx[0];
|
||||
if (!sce->zeroes[w*16+g]) {
|
||||
const float *coefs = sce->coeffs + start;
|
||||
const float *scaled = s->scoefs + start;
|
||||
int cmb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
|
||||
int mindeltasf = FFMAX(0, prev - SCALE_MAX_DIFF);
|
||||
int maxdeltasf = FFMIN(SCALE_MAX_POS - SCALE_DIV_512, prev + SCALE_MAX_DIFF);
|
||||
if ((!cmb || dists[w*16+g] > uplims[w*16+g]) && sce->sf_idx[w*16+g] > mindeltasf) {
|
||||
/* Try to make sure there is some energy in every nonzero band
|
||||
* NOTE: This algorithm must be forcibly imbalanced, pushing harder
|
||||
* on holes or more distorted bands at first, otherwise there's
|
||||
* no net gain (since the next iteration will offset all bands
|
||||
* on the opposite direction to compensate for extra bits)
|
||||
*/
|
||||
for (i = 0; i < edepth && sce->sf_idx[w*16+g] > mindeltasf; ++i) {
|
||||
int cb, bits;
|
||||
float dist, qenergy;
|
||||
int mb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]-1);
|
||||
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
|
||||
dist = qenergy = 0.f;
|
||||
bits = 0;
|
||||
if (!cb) {
|
||||
maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g]-1, maxsf[w*16+g]);
|
||||
} else if (i >= depth && dists[w*16+g] < euplims[w*16+g]) {
|
||||
break;
|
||||
}
|
||||
/* !g is the DC band, it's important, since quantization error here
|
||||
* applies to less than a cycle, it creates horrible intermodulation
|
||||
* distortion if it doesn't stick to what psy requests
|
||||
*/
|
||||
if (!g && sce->ics.num_windows > 1 && dists[w*16+g] >= euplims[w*16+g])
|
||||
maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g], maxsf[w*16+g]);
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
int b;
|
||||
float sqenergy;
|
||||
dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128,
|
||||
scaled + w2*128,
|
||||
sce->ics.swb_sizes[g],
|
||||
sce->sf_idx[w*16+g]-1,
|
||||
cb,
|
||||
1.0f,
|
||||
INFINITY,
|
||||
&b, &sqenergy,
|
||||
0);
|
||||
bits += b;
|
||||
qenergy += sqenergy;
|
||||
}
|
||||
sce->sf_idx[w*16+g]--;
|
||||
dists[w*16+g] = dist - bits;
|
||||
qenergies[w*16+g] = qenergy;
|
||||
if (mb && (sce->sf_idx[w*16+g] < mindeltasf || (
|
||||
(dists[w*16+g] < FFMIN(uplmax*uplims[w*16+g], euplims[w*16+g]))
|
||||
&& (fabsf(qenergies[w*16+g]-energies[w*16+g]) < euplims[w*16+g])
|
||||
) )) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (tbits > toofewbits && sce->sf_idx[w*16+g] < FFMIN(maxdeltasf, maxsf[w*16+g])
|
||||
&& (dists[w*16+g] < FFMIN(euplims[w*16+g], uplims[w*16+g]))
|
||||
&& (fabsf(qenergies[w*16+g]-energies[w*16+g]) < euplims[w*16+g])
|
||||
) {
|
||||
/** Um... over target. Save bits for more important stuff. */
|
||||
for (i = 0; i < depth && sce->sf_idx[w*16+g] < maxdeltasf; ++i) {
|
||||
int cb, bits;
|
||||
float dist, qenergy;
|
||||
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]+1);
|
||||
if (cb > 0) {
|
||||
dist = qenergy = 0.f;
|
||||
bits = 0;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
int b;
|
||||
float sqenergy;
|
||||
dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128,
|
||||
scaled + w2*128,
|
||||
sce->ics.swb_sizes[g],
|
||||
sce->sf_idx[w*16+g]+1,
|
||||
cb,
|
||||
1.0f,
|
||||
INFINITY,
|
||||
&b, &sqenergy,
|
||||
0);
|
||||
bits += b;
|
||||
qenergy += sqenergy;
|
||||
}
|
||||
dist -= bits;
|
||||
if (dist < FFMIN(euplims[w*16+g], uplims[w*16+g])) {
|
||||
sce->sf_idx[w*16+g]++;
|
||||
dists[w*16+g] = dist;
|
||||
qenergies[w*16+g] = qenergy;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g], maxsf[w*16+g]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
prev = sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], mindeltasf, maxdeltasf);
|
||||
if (sce->sf_idx[w*16+g] != prevsc)
|
||||
fflag = 1;
|
||||
nminscaler = FFMIN(nminscaler, sce->sf_idx[w*16+g]);
|
||||
sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
|
||||
}
|
||||
start += sce->ics.swb_sizes[g];
|
||||
}
|
||||
}
|
||||
|
||||
/** SF difference limit violation risk. Must re-clamp. */
|
||||
prev = -1;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
if (!sce->zeroes[w*16+g]) {
|
||||
int prevsf = sce->sf_idx[w*16+g];
|
||||
if (prev < 0)
|
||||
prev = prevsf;
|
||||
sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], prev - SCALE_MAX_DIFF, prev + SCALE_MAX_DIFF);
|
||||
sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
|
||||
prev = sce->sf_idx[w*16+g];
|
||||
if (!fflag && prevsf != sce->sf_idx[w*16+g])
|
||||
fflag = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
its++;
|
||||
} while (fflag && its < maxits);
|
||||
|
||||
/** Scout out next nonzero bands */
|
||||
ff_init_nextband_map(sce, nextband);
|
||||
|
||||
prev = -1;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
/** Make sure proper codebooks are set */
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
if (!sce->zeroes[w*16+g]) {
|
||||
sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
|
||||
if (sce->band_type[w*16+g] <= 0) {
|
||||
if (!ff_sfdelta_can_remove_band(sce, nextband, prev, w*16+g)) {
|
||||
/** Cannot zero out, make sure it's not attempted */
|
||||
sce->band_type[w*16+g] = 1;
|
||||
} else {
|
||||
sce->zeroes[w*16+g] = 1;
|
||||
sce->band_type[w*16+g] = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sce->band_type[w*16+g] = 0;
|
||||
}
|
||||
/** Check that there's no SF delta range violations */
|
||||
if (!sce->zeroes[w*16+g]) {
|
||||
if (prev != -1) {
|
||||
av_unused int sfdiff = sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO;
|
||||
av_assert1(sfdiff >= 0 && sfdiff <= 2*SCALE_MAX_DIFF);
|
||||
} else if (sce->zeroes[0]) {
|
||||
/** Set global gain to something useful */
|
||||
sce->sf_idx[0] = sce->sf_idx[w*16+g];
|
||||
}
|
||||
prev = sce->sf_idx[w*16+g];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* AVCODEC_AACCODER_TWOLOOP_H */
|
3048
libavcodec/aacdec.c
3048
libavcodec/aacdec.c
File diff suppressed because it is too large
Load Diff
@@ -1,446 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013
|
||||
* MIPS Technologies, Inc., California.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* AAC decoder fixed-point implementation
|
||||
*
|
||||
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
|
||||
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* AAC decoder
|
||||
* @author Oded Shimon ( ods15 ods15 dyndns org )
|
||||
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
|
||||
*
|
||||
* Fixed point implementation
|
||||
* @author Stanislav Ocovaj ( stanislav.ocovaj imgtec com )
|
||||
*/
|
||||
|
||||
#define FFT_FLOAT 0
|
||||
#define FFT_FIXED_32 1
|
||||
#define USE_FIXED 1
|
||||
|
||||
#include "libavutil/fixed_dsp.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
#include "get_bits.h"
|
||||
#include "fft.h"
|
||||
#include "lpc.h"
|
||||
#include "kbdwin.h"
|
||||
#include "sinewin.h"
|
||||
|
||||
#include "aac.h"
|
||||
#include "aactab.h"
|
||||
#include "aacdectab.h"
|
||||
#include "cbrt_tablegen.h"
|
||||
#include "sbr.h"
|
||||
#include "aacsbr.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "aacadtsdec.h"
|
||||
#include "profiles.h"
|
||||
#include "libavutil/intfloat.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
static av_always_inline void reset_predict_state(PredictorState *ps)
|
||||
{
|
||||
ps->r0.mant = 0;
|
||||
ps->r0.exp = 0;
|
||||
ps->r1.mant = 0;
|
||||
ps->r1.exp = 0;
|
||||
ps->cor0.mant = 0;
|
||||
ps->cor0.exp = 0;
|
||||
ps->cor1.mant = 0;
|
||||
ps->cor1.exp = 0;
|
||||
ps->var0.mant = 0x20000000;
|
||||
ps->var0.exp = 1;
|
||||
ps->var1.mant = 0x20000000;
|
||||
ps->var1.exp = 1;
|
||||
}
|
||||
|
||||
static const int exp2tab[4] = { Q31(1.0000000000/2), Q31(1.1892071150/2), Q31(1.4142135624/2), Q31(1.6817928305/2) }; // 2^0, 2^0.25, 2^0.5, 2^0.75
|
||||
|
||||
static inline int *DEC_SPAIR(int *dst, unsigned idx)
|
||||
{
|
||||
dst[0] = (idx & 15) - 4;
|
||||
dst[1] = (idx >> 4 & 15) - 4;
|
||||
|
||||
return dst + 2;
|
||||
}
|
||||
|
||||
static inline int *DEC_SQUAD(int *dst, unsigned idx)
|
||||
{
|
||||
dst[0] = (idx & 3) - 1;
|
||||
dst[1] = (idx >> 2 & 3) - 1;
|
||||
dst[2] = (idx >> 4 & 3) - 1;
|
||||
dst[3] = (idx >> 6 & 3) - 1;
|
||||
|
||||
return dst + 4;
|
||||
}
|
||||
|
||||
static inline int *DEC_UPAIR(int *dst, unsigned idx, unsigned sign)
|
||||
{
|
||||
dst[0] = (idx & 15) * (1 - (sign & 0xFFFFFFFE));
|
||||
dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) << 1));
|
||||
|
||||
return dst + 2;
|
||||
}
|
||||
|
||||
static inline int *DEC_UQUAD(int *dst, unsigned idx, unsigned sign)
|
||||
{
|
||||
unsigned nz = idx >> 12;
|
||||
|
||||
dst[0] = (idx & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[1] = (idx >> 2 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[2] = (idx >> 4 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[3] = (idx >> 6 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
|
||||
return dst + 4;
|
||||
}
|
||||
|
||||
static void vector_pow43(int *coefs, int len)
|
||||
{
|
||||
int i, coef;
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
coef = coefs[i];
|
||||
if (coef < 0)
|
||||
coef = -(int)cbrt_tab[-coef];
|
||||
else
|
||||
coef = (int)cbrt_tab[coef];
|
||||
coefs[i] = coef;
|
||||
}
|
||||
}
|
||||
|
||||
static void subband_scale(int *dst, int *src, int scale, int offset, int len)
|
||||
{
|
||||
int ssign = scale < 0 ? -1 : 1;
|
||||
int s = FFABS(scale);
|
||||
unsigned int round;
|
||||
int i, out, c = exp2tab[s & 3];
|
||||
|
||||
s = offset - (s >> 2);
|
||||
|
||||
if (s > 0) {
|
||||
round = 1 << (s-1);
|
||||
for (i=0; i<len; i++) {
|
||||
out = (int)(((int64_t)src[i] * c) >> 32);
|
||||
dst[i] = ((int)(out+round) >> s) * ssign;
|
||||
}
|
||||
}
|
||||
else {
|
||||
s = s + 32;
|
||||
round = 1 << (s-1);
|
||||
for (i=0; i<len; i++) {
|
||||
out = (int)((int64_t)((int64_t)src[i] * c + round) >> s);
|
||||
dst[i] = out * ssign;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void noise_scale(int *coefs, int scale, int band_energy, int len)
|
||||
{
|
||||
int ssign = scale < 0 ? -1 : 1;
|
||||
int s = FFABS(scale);
|
||||
unsigned int round;
|
||||
int i, out, c = exp2tab[s & 3];
|
||||
int nlz = 0;
|
||||
|
||||
while (band_energy > 0x7fff) {
|
||||
band_energy >>= 1;
|
||||
nlz++;
|
||||
}
|
||||
c /= band_energy;
|
||||
s = 21 + nlz - (s >> 2);
|
||||
|
||||
if (s > 0) {
|
||||
round = 1 << (s-1);
|
||||
for (i=0; i<len; i++) {
|
||||
out = (int)(((int64_t)coefs[i] * c) >> 32);
|
||||
coefs[i] = ((int)(out+round) >> s) * ssign;
|
||||
}
|
||||
}
|
||||
else {
|
||||
s = s + 32;
|
||||
round = 1 << (s-1);
|
||||
for (i=0; i<len; i++) {
|
||||
out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
|
||||
coefs[i] = out * ssign;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static av_always_inline SoftFloat flt16_round(SoftFloat pf)
|
||||
{
|
||||
SoftFloat tmp;
|
||||
int s;
|
||||
|
||||
tmp.exp = pf.exp;
|
||||
s = pf.mant >> 31;
|
||||
tmp.mant = (pf.mant ^ s) - s;
|
||||
tmp.mant = (tmp.mant + 0x00200000U) & 0xFFC00000U;
|
||||
tmp.mant = (tmp.mant ^ s) - s;
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static av_always_inline SoftFloat flt16_even(SoftFloat pf)
|
||||
{
|
||||
SoftFloat tmp;
|
||||
int s;
|
||||
|
||||
tmp.exp = pf.exp;
|
||||
s = pf.mant >> 31;
|
||||
tmp.mant = (pf.mant ^ s) - s;
|
||||
tmp.mant = (tmp.mant + 0x001FFFFFU + (tmp.mant & 0x00400000U >> 16)) & 0xFFC00000U;
|
||||
tmp.mant = (tmp.mant ^ s) - s;
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static av_always_inline SoftFloat flt16_trunc(SoftFloat pf)
|
||||
{
|
||||
SoftFloat pun;
|
||||
int s;
|
||||
|
||||
pun.exp = pf.exp;
|
||||
s = pf.mant >> 31;
|
||||
pun.mant = (pf.mant ^ s) - s;
|
||||
pun.mant = pun.mant & 0xFFC00000U;
|
||||
pun.mant = (pun.mant ^ s) - s;
|
||||
|
||||
return pun;
|
||||
}
|
||||
|
||||
static av_always_inline void predict(PredictorState *ps, int *coef,
|
||||
int output_enable)
|
||||
{
|
||||
const SoftFloat a = { 1023410176, 0 }; // 61.0 / 64
|
||||
const SoftFloat alpha = { 973078528, 0 }; // 29.0 / 32
|
||||
SoftFloat e0, e1;
|
||||
SoftFloat pv;
|
||||
SoftFloat k1, k2;
|
||||
SoftFloat r0 = ps->r0, r1 = ps->r1;
|
||||
SoftFloat cor0 = ps->cor0, cor1 = ps->cor1;
|
||||
SoftFloat var0 = ps->var0, var1 = ps->var1;
|
||||
SoftFloat tmp;
|
||||
|
||||
if (var0.exp > 1 || (var0.exp == 1 && var0.mant > 0x20000000)) {
|
||||
k1 = av_mul_sf(cor0, flt16_even(av_div_sf(a, var0)));
|
||||
}
|
||||
else {
|
||||
k1.mant = 0;
|
||||
k1.exp = 0;
|
||||
}
|
||||
|
||||
if (var1.exp > 1 || (var1.exp == 1 && var1.mant > 0x20000000)) {
|
||||
k2 = av_mul_sf(cor1, flt16_even(av_div_sf(a, var1)));
|
||||
}
|
||||
else {
|
||||
k2.mant = 0;
|
||||
k2.exp = 0;
|
||||
}
|
||||
|
||||
tmp = av_mul_sf(k1, r0);
|
||||
pv = flt16_round(av_add_sf(tmp, av_mul_sf(k2, r1)));
|
||||
if (output_enable) {
|
||||
int shift = 28 - pv.exp;
|
||||
|
||||
if (shift < 31)
|
||||
*coef += (pv.mant + (1 << (shift - 1))) >> shift;
|
||||
}
|
||||
|
||||
e0 = av_int2sf(*coef, 2);
|
||||
e1 = av_sub_sf(e0, tmp);
|
||||
|
||||
ps->cor1 = flt16_trunc(av_add_sf(av_mul_sf(alpha, cor1), av_mul_sf(r1, e1)));
|
||||
tmp = av_add_sf(av_mul_sf(r1, r1), av_mul_sf(e1, e1));
|
||||
tmp.exp--;
|
||||
ps->var1 = flt16_trunc(av_add_sf(av_mul_sf(alpha, var1), tmp));
|
||||
ps->cor0 = flt16_trunc(av_add_sf(av_mul_sf(alpha, cor0), av_mul_sf(r0, e0)));
|
||||
tmp = av_add_sf(av_mul_sf(r0, r0), av_mul_sf(e0, e0));
|
||||
tmp.exp--;
|
||||
ps->var0 = flt16_trunc(av_add_sf(av_mul_sf(alpha, var0), tmp));
|
||||
|
||||
ps->r1 = flt16_trunc(av_mul_sf(a, av_sub_sf(r0, av_mul_sf(k1, e0))));
|
||||
ps->r0 = flt16_trunc(av_mul_sf(a, e0));
|
||||
}
|
||||
|
||||
|
||||
static const int cce_scale_fixed[8] = {
|
||||
Q30(1.0), //2^(0/8)
|
||||
Q30(1.0905077327), //2^(1/8)
|
||||
Q30(1.1892071150), //2^(2/8)
|
||||
Q30(1.2968395547), //2^(3/8)
|
||||
Q30(1.4142135624), //2^(4/8)
|
||||
Q30(1.5422108254), //2^(5/8)
|
||||
Q30(1.6817928305), //2^(6/8)
|
||||
Q30(1.8340080864), //2^(7/8)
|
||||
};
|
||||
|
||||
/**
|
||||
* Apply dependent channel coupling (applied before IMDCT).
|
||||
*
|
||||
* @param index index into coupling gain array
|
||||
*/
|
||||
static void apply_dependent_coupling_fixed(AACContext *ac,
|
||||
SingleChannelElement *target,
|
||||
ChannelElement *cce, int index)
|
||||
{
|
||||
IndividualChannelStream *ics = &cce->ch[0].ics;
|
||||
const uint16_t *offsets = ics->swb_offset;
|
||||
int *dest = target->coeffs;
|
||||
const int *src = cce->ch[0].coeffs;
|
||||
int g, i, group, k, idx = 0;
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Dependent coupling is not supported together with LTP\n");
|
||||
return;
|
||||
}
|
||||
for (g = 0; g < ics->num_window_groups; g++) {
|
||||
for (i = 0; i < ics->max_sfb; i++, idx++) {
|
||||
if (cce->ch[0].band_type[idx] != ZERO_BT) {
|
||||
const int gain = cce->coup.gain[index][idx];
|
||||
int shift, round, c, tmp;
|
||||
|
||||
if (gain < 0) {
|
||||
c = -cce_scale_fixed[-gain & 7];
|
||||
shift = (-gain-1024) >> 3;
|
||||
}
|
||||
else {
|
||||
c = cce_scale_fixed[gain & 7];
|
||||
shift = (gain-1024) >> 3;
|
||||
}
|
||||
|
||||
if (shift < 0) {
|
||||
shift = -shift;
|
||||
round = 1 << (shift - 1);
|
||||
|
||||
for (group = 0; group < ics->group_len[g]; group++) {
|
||||
for (k = offsets[i]; k < offsets[i + 1]; k++) {
|
||||
tmp = (int)(((int64_t)src[group * 128 + k] * c + \
|
||||
(int64_t)0x1000000000) >> 37);
|
||||
dest[group * 128 + k] += (tmp + round) >> shift;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (group = 0; group < ics->group_len[g]; group++) {
|
||||
for (k = offsets[i]; k < offsets[i + 1]; k++) {
|
||||
tmp = (int)(((int64_t)src[group * 128 + k] * c + \
|
||||
(int64_t)0x1000000000) >> 37);
|
||||
dest[group * 128 + k] += tmp << shift;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dest += ics->group_len[g] * 128;
|
||||
src += ics->group_len[g] * 128;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply independent channel coupling (applied after IMDCT).
|
||||
*
|
||||
* @param index index into coupling gain array
|
||||
*/
|
||||
static void apply_independent_coupling_fixed(AACContext *ac,
|
||||
SingleChannelElement *target,
|
||||
ChannelElement *cce, int index)
|
||||
{
|
||||
int i, c, shift, round, tmp;
|
||||
const int gain = cce->coup.gain[index][0];
|
||||
const int *src = cce->ch[0].ret;
|
||||
int *dest = target->ret;
|
||||
const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
|
||||
|
||||
c = cce_scale_fixed[gain & 7];
|
||||
shift = (gain-1024) >> 3;
|
||||
if (shift < 0) {
|
||||
shift = -shift;
|
||||
round = 1 << (shift - 1);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
|
||||
dest[i] += (tmp + round) >> shift;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < len; i++) {
|
||||
tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
|
||||
dest[i] += tmp << shift;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "aacdec_template.c"
|
||||
|
||||
AVCodec ff_aac_fixed_decoder = {
|
||||
.name = "aac_fixed",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = AV_CODEC_ID_AAC,
|
||||
.priv_data_size = sizeof(AACContext),
|
||||
.init = aac_decode_init,
|
||||
.close = aac_decode_close,
|
||||
.decode = aac_decode_frame,
|
||||
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||
AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE
|
||||
},
|
||||
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
|
||||
.channel_layouts = aac_channel_layout,
|
||||
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
|
||||
.flush = flush,
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@@ -35,6 +35,49 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* @name ltp_coef
|
||||
* Table of the LTP coefficients
|
||||
*/
|
||||
static const float ltp_coef[8] = {
|
||||
0.570829, 0.696616, 0.813004, 0.911304,
|
||||
0.984900, 1.067894, 1.194601, 1.369533,
|
||||
};
|
||||
|
||||
/* @name tns_tmp2_map
|
||||
* Tables of the tmp2[] arrays of LPC coefficients used for TNS.
|
||||
* The suffix _M_N[] indicate the values of coef_compress and coef_res
|
||||
* respectively.
|
||||
* @{
|
||||
*/
|
||||
static const float tns_tmp2_map_1_3[4] = {
|
||||
0.00000000, -0.43388373, 0.64278758, 0.34202015,
|
||||
};
|
||||
|
||||
static const float tns_tmp2_map_0_3[8] = {
|
||||
0.00000000, -0.43388373, -0.78183150, -0.97492790,
|
||||
0.98480773, 0.86602539, 0.64278758, 0.34202015,
|
||||
};
|
||||
|
||||
static const float tns_tmp2_map_1_4[8] = {
|
||||
0.00000000, -0.20791170, -0.40673664, -0.58778524,
|
||||
0.67369562, 0.52643216, 0.36124167, 0.18374951,
|
||||
};
|
||||
|
||||
static const float tns_tmp2_map_0_4[16] = {
|
||||
0.00000000, -0.20791170, -0.40673664, -0.58778524,
|
||||
-0.74314481, -0.86602539, -0.95105654, -0.99452192,
|
||||
0.99573416, 0.96182561, 0.89516330, 0.79801720,
|
||||
0.67369562, 0.52643216, 0.36124167, 0.18374951,
|
||||
};
|
||||
|
||||
static const float * const tns_tmp2_map[4] = {
|
||||
tns_tmp2_map_0_3,
|
||||
tns_tmp2_map_0_4,
|
||||
tns_tmp2_map_1_3,
|
||||
tns_tmp2_map_1_4
|
||||
};
|
||||
// @}
|
||||
|
||||
static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 0, 5, 0 };
|
||||
|
||||
static const uint8_t aac_channel_layout_map[16][5][3] = {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user