Compare commits
530 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
523da8eac1 | ||
|
|
912cb27f73 | ||
|
|
4adc99ecb6 | ||
|
|
8be3724e55 | ||
|
|
142c1737e3 | ||
|
|
61b86ae8ce | ||
|
|
b3ae6cfe11 | ||
|
|
d053b25b59 | ||
|
|
3aa8440baf | ||
|
|
c9992efd84 | ||
|
|
87cc0b0474 | ||
|
|
d59582a567 | ||
|
|
17a9e90d1f | ||
|
|
3aca3f1257 | ||
|
|
9f2e4c26a0 | ||
|
|
1febd817b1 | ||
|
|
3f3ee3e62f | ||
|
|
8be687a81f | ||
|
|
1827fe0989 | ||
|
|
02073b5ab1 | ||
|
|
1825f7670a | ||
|
|
2647ca4581 | ||
|
|
2e44b10418 | ||
|
|
c6fbff1358 | ||
|
|
774461ea62 | ||
|
|
94a0a484b7 | ||
|
|
a127f51140 | ||
|
|
07ca8300a6 | ||
|
|
f7e18dea7a | ||
|
|
16c0d8aa46 | ||
|
|
1ec9fd15b9 | ||
|
|
4a947f4385 | ||
|
|
e0cb113f9b | ||
|
|
15abba737b | ||
|
|
5bfb0b02b6 | ||
|
|
c472c1b3e7 | ||
|
|
e8dfe3f34a | ||
|
|
d3fc5c17de | ||
|
|
606b21353d | ||
|
|
fb93771072 | ||
|
|
3f8bb78f3e | ||
|
|
a5989651f0 | ||
|
|
1e512388ee | ||
|
|
31d46dc97d | ||
|
|
5790ce6273 | ||
|
|
f202fefdb0 | ||
|
|
3af916db37 | ||
|
|
518beeb72f | ||
|
|
46edc6d5ef | ||
|
|
046cc06f5a | ||
|
|
970781f5f2 | ||
|
|
d8ec9e97b9 | ||
|
|
028c87be95 | ||
|
|
b45e112bbd | ||
|
|
56b120630f | ||
|
|
22cd4aa221 | ||
|
|
8a7b2fbf6f | ||
|
|
8f27508f1c | ||
|
|
7552f6fc1b | ||
|
|
70ca4ce17a | ||
|
|
ccda73a711 | ||
|
|
0b948b1b8d | ||
|
|
f76947fd56 | ||
|
|
71fa32bbb7 | ||
|
|
8a56b31e7c | ||
|
|
2260c0776a | ||
|
|
5c55f9881e | ||
|
|
dc821d42a2 | ||
|
|
b3ac458a5a | ||
|
|
3148d1c25f | ||
|
|
f964046c58 | ||
|
|
0cc619e0d7 | ||
|
|
0e8c44076d | ||
|
|
a94f846e2d | ||
|
|
c5fb9df38a | ||
|
|
51ff17d6b9 | ||
|
|
e14da0578c | ||
|
|
afd0f8f775 | ||
|
|
13c249e2b5 | ||
|
|
698528207a | ||
|
|
1e86f1a646 | ||
|
|
ecc5bada26 | ||
|
|
b0a5794e30 | ||
|
|
63504a2d44 | ||
|
|
f9e76d3304 | ||
|
|
3213adceb2 | ||
|
|
744f78ce0d | ||
|
|
147a387fba | ||
|
|
2312d1d979 | ||
|
|
1604a2b1e6 | ||
|
|
f39522b6e7 | ||
|
|
09411a7d5e | ||
|
|
ef32b162e8 | ||
|
|
41b1ec0810 | ||
|
|
e3f8b32279 | ||
|
|
fe4c6aeb99 | ||
|
|
3177ea512f | ||
|
|
e25441912b | ||
|
|
abe16359ba | ||
|
|
b9ab4db9f9 | ||
|
|
8328c07fb1 | ||
|
|
865e3f5553 | ||
|
|
d1c87a4a6f | ||
|
|
b480ca4dbd | ||
|
|
bb83ff8b41 | ||
|
|
d609986f39 | ||
|
|
b9ec80322b | ||
|
|
62b2b2195b | ||
|
|
239f75d6c3 | ||
|
|
a772613100 | ||
|
|
ca216c71c7 | ||
|
|
ab737ab31d | ||
|
|
69b00a7fb6 | ||
|
|
d828aabf03 | ||
|
|
0ffdabb58d | ||
|
|
e1ab851da6 | ||
|
|
0bdfdd6d2f | ||
|
|
f8dcc9e718 | ||
|
|
175a95bfdd | ||
|
|
ac60619acd | ||
|
|
48c51b796a | ||
|
|
26eccf4bd8 | ||
|
|
8ddeae57ae | ||
|
|
c32ce247a0 | ||
|
|
2f9bc30956 | ||
|
|
562f2ba4ed | ||
|
|
5a96b4b443 | ||
|
|
33ec0280f3 | ||
|
|
2b135f266d | ||
|
|
e965fedf7e | ||
|
|
7132e71a84 | ||
|
|
7a2329fac1 | ||
|
|
65fff8e71a | ||
|
|
3988470ee3 | ||
|
|
3a6b27caf8 | ||
|
|
942c3bfbdf | ||
|
|
486aa4fe39 | ||
|
|
da12d544bf | ||
|
|
73e09e371b | ||
|
|
d3ecb24539 | ||
|
|
0f6e244bb0 | ||
|
|
054db63120 | ||
|
|
4a0b0cffc1 | ||
|
|
9fefd76eec | ||
|
|
087bd8fbdf | ||
|
|
40ffbe7678 | ||
|
|
ed7fe48445 | ||
|
|
d9ad05abce | ||
|
|
bfca58ee2f | ||
|
|
8a32f19d5b | ||
|
|
1dd34bdb09 | ||
|
|
04987035ff | ||
|
|
a4484854db | ||
|
|
003fa5c3e3 | ||
|
|
166921c23e | ||
|
|
591c0b527c | ||
|
|
731848ef80 | ||
|
|
76fd8145a1 | ||
|
|
5af0ada442 | ||
|
|
ffb503c9a1 | ||
|
|
2bbbd3e50a | ||
|
|
669fc1338f | ||
|
|
9fe1012910 | ||
|
|
90b27febc6 | ||
|
|
c1c6cb21b7 | ||
|
|
2e0af764b3 | ||
|
|
8857dc6cd8 | ||
|
|
67c7f8ca14 | ||
|
|
500cf2e159 | ||
|
|
345231336f | ||
|
|
fc6f314838 | ||
|
|
3bbef6082a | ||
|
|
0aaf66fb2e | ||
|
|
330f4ef48c | ||
|
|
8887dafda1 | ||
|
|
e9b7ae08d6 | ||
|
|
da4ea97161 | ||
|
|
4e4afe29b9 | ||
|
|
2a15860227 | ||
|
|
66443b0cf3 | ||
|
|
58a7500492 | ||
|
|
3003277103 | ||
|
|
05b33258e3 | ||
|
|
c6e3682a0c | ||
|
|
e80a4ce69f | ||
|
|
edc61e3aba | ||
|
|
5127cb2e78 | ||
|
|
70b3e170f9 | ||
|
|
4e174d95f5 | ||
|
|
21fb4d1282 | ||
|
|
b5d4b1731e | ||
|
|
ef54c14425 | ||
|
|
a35e6ec1bd | ||
|
|
a286f1a5ff | ||
|
|
d7c15fb25a | ||
|
|
5c289c932f | ||
|
|
e8b1ce8d1b | ||
|
|
d77e1c712b | ||
|
|
d2e473a245 | ||
|
|
4818e074a0 | ||
|
|
7dac928e61 | ||
|
|
49fc295612 | ||
|
|
d10f4744ff | ||
|
|
bf76124c51 | ||
|
|
48c25d0512 | ||
|
|
69942c4f6d | ||
|
|
7aaab36874 | ||
|
|
36e5854801 | ||
|
|
82492c3a96 | ||
|
|
175110a041 | ||
|
|
76c157cfd7 | ||
|
|
f9f9f31c6c | ||
|
|
800334947d | ||
|
|
4ccb97650a | ||
|
|
a3d698dcb1 | ||
|
|
1e9aa7907e | ||
|
|
23ef5996a5 | ||
|
|
b3a64fc039 | ||
|
|
21a6b7930e | ||
|
|
530192b0e0 | ||
|
|
8dd71d0bd4 | ||
|
|
536f6c4ec2 | ||
|
|
af21d609a0 | ||
|
|
b15ae71305 | ||
|
|
6fec0dbd2e | ||
|
|
0dc379cfa6 | ||
|
|
b432d883e6 | ||
|
|
736e42bc33 | ||
|
|
cb88f428b3 | ||
|
|
e0d53cbeef | ||
|
|
9819998342 | ||
|
|
85cfcb87ff | ||
|
|
971f47f2eb | ||
|
|
00393c56da | ||
|
|
f77b656b6e | ||
|
|
8ed4b44657 | ||
|
|
642c54270b | ||
|
|
d64ff3a6a9 | ||
|
|
c6f6829ce6 | ||
|
|
b9551e71bf | ||
|
|
828d85bf86 | ||
|
|
aa833e1a60 | ||
|
|
61850f1c84 | ||
|
|
6897859b5a | ||
|
|
f121ed611e | ||
|
|
6eb76b34ca | ||
|
|
034edcec6d | ||
|
|
8008a029ab | ||
|
|
d640bc7545 | ||
|
|
93559adfbf | ||
|
|
4679e54388 | ||
|
|
782257ba66 | ||
|
|
e188c267c8 | ||
|
|
407ab167c0 | ||
|
|
d7fbd03660 | ||
|
|
2cd41c5d52 | ||
|
|
1272b88d04 | ||
|
|
cf99f0dd0f | ||
|
|
247bb203e4 | ||
|
|
94b9e7caae | ||
|
|
6ffaf40c02 | ||
|
|
e3d7796336 | ||
|
|
667a23a032 | ||
|
|
7b0fb4fdf7 | ||
|
|
40ebeee3fc | ||
|
|
b8fa3ff95d | ||
|
|
063928910f | ||
|
|
e303ca3ac9 | ||
|
|
28f89bc439 | ||
|
|
23b903aaf4 | ||
|
|
4676e20a9d | ||
|
|
0c5a71fece | ||
|
|
07da25548f | ||
|
|
be9b89314f | ||
|
|
cdac68fbab | ||
|
|
1fd9556062 | ||
|
|
c781a1e14b | ||
|
|
b7d54d6e07 | ||
|
|
90c2256ee5 | ||
|
|
f459afdd72 | ||
|
|
d408261b65 | ||
|
|
d7f7586c3f | ||
|
|
f05e0e76d6 | ||
|
|
e5567f2f69 | ||
|
|
b8382a1fae | ||
|
|
9cad208223 | ||
|
|
34e06ce309 | ||
|
|
df4ee166f1 | ||
|
|
cb4ba7456a | ||
|
|
d79b6dd9f9 | ||
|
|
36861557a7 | ||
|
|
3fb97a01ce | ||
|
|
6457cd17be | ||
|
|
aee9aa9216 | ||
|
|
14c63dc9b0 | ||
|
|
709abc74f5 | ||
|
|
83c0df90b0 | ||
|
|
0a6324fe93 | ||
|
|
2f65366c11 | ||
|
|
3e3aa25afa | ||
|
|
6a1bf98b3a | ||
|
|
79f407b79a | ||
|
|
174ec7d744 | ||
|
|
778c8de40f | ||
|
|
38f8c80901 | ||
|
|
945ae04fab | ||
|
|
6d7b4dbcb4 | ||
|
|
644179e0d4 | ||
|
|
9be3441c31 | ||
|
|
63ecbb82fc | ||
|
|
bdc6ba4604 | ||
|
|
3a3be02208 | ||
|
|
cabd9ae5be | ||
|
|
cfbf608c0a | ||
|
|
1dddd5371a | ||
|
|
e4a6a8553e | ||
|
|
748d5fa2ed | ||
|
|
796f1a24f5 | ||
|
|
0b24a0e0f1 | ||
|
|
a79a5c32f9 | ||
|
|
b9087aa651 | ||
|
|
7e94ea3dd1 | ||
|
|
cb44683a8c | ||
|
|
dcd837e41c | ||
|
|
507e0314c0 | ||
|
|
76af12f542 | ||
|
|
20a48eaaf1 | ||
|
|
31aeb96533 | ||
|
|
95a144ae62 | ||
|
|
1450a39ad4 | ||
|
|
d07f658201 | ||
|
|
07b43fb69a | ||
|
|
e3f08d9359 | ||
|
|
f87d2617d5 | ||
|
|
cd83f899c9 | ||
|
|
5e105aca01 | ||
|
|
a9c721da12 | ||
|
|
4608cc176b | ||
|
|
2e54b8c379 | ||
|
|
913c642c21 | ||
|
|
cb4985ea9a | ||
|
|
d27d59fef7 | ||
|
|
ea4d9cb3e5 | ||
|
|
e5a4044771 | ||
|
|
af44545613 | ||
|
|
10fc3d690c | ||
|
|
0fa92fee43 | ||
|
|
cf79fd0317 | ||
|
|
b253035ab2 | ||
|
|
ded0a04153 | ||
|
|
16c5da92d9 | ||
|
|
0e3ec7db53 | ||
|
|
73966b0161 | ||
|
|
b8621a2e98 | ||
|
|
aa9ac199b8 | ||
|
|
f2258e9899 | ||
|
|
e04b039b15 | ||
|
|
d295ddffe1 | ||
|
|
aab65146af | ||
|
|
8cd3def81d | ||
|
|
460710500e | ||
|
|
4d9999705f | ||
|
|
3d69716bae | ||
|
|
2fbf723585 | ||
|
|
7372b42b18 | ||
|
|
fe89682d7c | ||
|
|
ce6dd54711 | ||
|
|
d32c9723a6 | ||
|
|
1cbc2cb508 | ||
|
|
e348769544 | ||
|
|
9ce96a688b | ||
|
|
9d5bdca3d8 | ||
|
|
31e54f41a0 | ||
|
|
aa3101a9e8 | ||
|
|
ff3e717003 | ||
|
|
1c6243228c | ||
|
|
482bece29b | ||
|
|
644296e736 | ||
|
|
a353cc44a6 | ||
|
|
4c718691ea | ||
|
|
24c504bd0a | ||
|
|
6b91701de3 | ||
|
|
1290c85c9d | ||
|
|
b70f7d20e1 | ||
|
|
71a3113333 | ||
|
|
859a6edaed | ||
|
|
2dc1f3a02b | ||
|
|
9a9dda615b | ||
|
|
b3bc05290a | ||
|
|
093e58228e | ||
|
|
948d93d3f4 | ||
|
|
824e72d9b7 | ||
|
|
c7a970a3a0 | ||
|
|
6af38b2718 | ||
|
|
0ce7baa245 | ||
|
|
7f0b58947d | ||
|
|
f64ffbbdc0 | ||
|
|
c0748b9954 | ||
|
|
dbfec68d32 | ||
|
|
34f2d74555 | ||
|
|
22017f7745 | ||
|
|
b372ad819e | ||
|
|
bdbfc12e7f | ||
|
|
c3a44a2a55 | ||
|
|
d1d48d4319 | ||
|
|
6b0bc64f54 | ||
|
|
983e63b490 | ||
|
|
bf2f7115d9 | ||
|
|
ef699b4135 | ||
|
|
a8513826dd | ||
|
|
df31acda64 | ||
|
|
d09fd0736a | ||
|
|
c3f276b608 | ||
|
|
510d88ae93 | ||
|
|
c4133b25f8 | ||
|
|
c9b3451da3 | ||
|
|
46f83b059b | ||
|
|
ce2664f5f7 | ||
|
|
8364d607ac | ||
|
|
21e42d9b0d | ||
|
|
e10c353ca5 | ||
|
|
72be96ac55 | ||
|
|
6581e40e1a | ||
|
|
0f9c617979 | ||
|
|
f9998d1994 | ||
|
|
7ad4bf4899 | ||
|
|
43ada90fc5 | ||
|
|
476ddffccb | ||
|
|
b533998d0a | ||
|
|
acd203fc0d | ||
|
|
402c4a9f81 | ||
|
|
6e4bfbe936 | ||
|
|
f38beb47da | ||
|
|
efa9128556 | ||
|
|
3de8521667 | ||
|
|
edf5e88eac | ||
|
|
8d634be4ce | ||
|
|
9a6d581076 | ||
|
|
84f8157662 | ||
|
|
e5a2f5e74d | ||
|
|
dac3598563 | ||
|
|
c0cd8747ef | ||
|
|
e217224456 | ||
|
|
56419053bc | ||
|
|
11b4822ddb | ||
|
|
2de2959305 | ||
|
|
b93a8bd838 | ||
|
|
2817eb514c | ||
|
|
6e085f9a32 | ||
|
|
a7bbb7fb88 | ||
|
|
1290037626 | ||
|
|
c7174d5204 | ||
|
|
ff30907205 | ||
|
|
a6ae88bb25 | ||
|
|
4567cba0b8 | ||
|
|
fdb8842639 | ||
|
|
c6c801d993 | ||
|
|
aa34146e41 | ||
|
|
fcb8ee98f6 | ||
|
|
2f5f940bef | ||
|
|
6ac9d6303f | ||
|
|
81a2ad762b | ||
|
|
c8a1324d1e | ||
|
|
6a0e10ae0d | ||
|
|
3f3e12c768 | ||
|
|
6616762134 | ||
|
|
96b87d5cfa | ||
|
|
e0e28dad90 | ||
|
|
1a67b0f9ae | ||
|
|
e3fcd88f08 | ||
|
|
68a6178ef0 | ||
|
|
d51ddd45b2 | ||
|
|
c2db8ebc08 | ||
|
|
b46efcb293 | ||
|
|
40934e0e9b | ||
|
|
bb3b4ad460 | ||
|
|
13d3749424 | ||
|
|
173053a125 | ||
|
|
8118fdf8bb | ||
|
|
f235f511a0 | ||
|
|
c149a4afee | ||
|
|
02d8abf0f5 | ||
|
|
9579550b2b | ||
|
|
7ec05ae969 | ||
|
|
b9841ba98c | ||
|
|
39df4d2475 | ||
|
|
635831c087 | ||
|
|
291a2f1ea7 | ||
|
|
ee1bcd3436 | ||
|
|
408240267a | ||
|
|
eca7b0dcce | ||
|
|
64b659673a | ||
|
|
1d9d300d65 | ||
|
|
a931ad554d | ||
|
|
7236080d27 | ||
|
|
6dcd2ebd34 | ||
|
|
83d75c70df | ||
|
|
818ebcbf5c | ||
|
|
837113ab5f | ||
|
|
97340bdfa3 | ||
|
|
61fd5a3072 | ||
|
|
f5f9c166a1 | ||
|
|
01bf0a178d | ||
|
|
3cd1be9702 | ||
|
|
d4b1fe72c2 | ||
|
|
a8d0dcbafa | ||
|
|
2a6103a082 | ||
|
|
3fedd64d4b | ||
|
|
9bbcd1cc7b | ||
|
|
9801c9524a | ||
|
|
08fc0d771a | ||
|
|
a3db85581e | ||
|
|
ddbb8d5eda | ||
|
|
41aa6b2095 | ||
|
|
fb0d41932d | ||
|
|
aa46ae8848 | ||
|
|
c3021738fc | ||
|
|
b72c184194 | ||
|
|
d86c5f8de8 | ||
|
|
0752e44b1f | ||
|
|
1d42df7292 | ||
|
|
eaabfe8ef8 | ||
|
|
90d29c3d04 | ||
|
|
48211b0c0d | ||
|
|
aa661d3672 | ||
|
|
8cd24f8fe7 | ||
|
|
7e853879ce | ||
|
|
f598ca088e | ||
|
|
2710c14a83 | ||
|
|
1a56be9cdc |
505
Changelog
505
Changelog
@@ -1,7 +1,510 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
version 2.8.11
|
||||
- avcodec/h264_slice: Clear ref_counts on redundant slices
|
||||
- lavf/mov.c: Avoid heap allocation wrap in mov_read_uuid
|
||||
- lavf/mov.c: Avoid heap allocation wrap in mov_read_hdlr
|
||||
- avcodec/pictordec: Fix logic error
|
||||
- avcodec/movtextdec: Fix decode_styl() cleanup
|
||||
- lavf/matroskadec: fix is_keyframe for early Blocks
|
||||
- configure: bump year
|
||||
- avcodec/pngdec: Check trns more completely
|
||||
- avcodec/interplayvideo: Move parameter change check up
|
||||
- avcodec/mjpegdec: Check for for the bitstream end in mjpeg_decode_scan_progressive_ac()
|
||||
- avformat/flacdec: Check avio_read result when reading flac block header.
|
||||
- avcodec/utils: correct align value for interplay
|
||||
- avcodec/vp56: Check for the bitstream end, pass error codes on
|
||||
- avcodec/mjpegdec: Check remaining bitstream in ljpeg_decode_yuv_scan()
|
||||
- avcodec/pngdec: Fix off by 1 size in decode_zbuf()
|
||||
- avformat/avidec: skip odml master index chunks in avi_sync
|
||||
- avcodec/mjpegdec: Check for rgb before flipping
|
||||
- avutil/random_seed: Reduce the time needed on systems with very low precision clock()
|
||||
- avutil/random_seed: Improve get_generic_seed() with higher precision clock()
|
||||
- avformat/utils: Print verbose error message if stream count exceeds max_streams
|
||||
- avformat/options_table: Set the default maximum number of streams to 1000
|
||||
- avutil: Add av_image_check_size2()
|
||||
- avformat: Add max_streams option
|
||||
- avcodec/ffv1enc: Allocate smaller packet if the worst case size cannot be allocated
|
||||
- avcodec/mpeg4videodec: Fix undefined shifts in mpeg4_decode_sprite_trajectory()
|
||||
- avformat/oggdec: Skip streams in duration correction that did not had their duration set.
|
||||
- avcodec/ffv1enc: Fix size of first slice
|
||||
- pgssubdec: reset rle_data_len/rle_remaining_len on allocation error
|
||||
|
||||
version 2.8.10
|
||||
- avformat/http: Match chunksize checks to master..3.0
|
||||
- Changelog: fix typos
|
||||
- ffserver: Check chunk size
|
||||
- Avoid using the term "file" and prefer "url" in some docs and comments
|
||||
- avformat/rtmppkt: Check for packet size mismatches
|
||||
- zmqsend: Initialize ret to 0
|
||||
- configure: check for strtoull on msvc
|
||||
- http: move chunk handling from http_read_stream() to http_buf_read().
|
||||
- http: make length/offset-related variables unsigned.
|
||||
|
||||
version 2.8.9
|
||||
- avcodec/flacdec: Fix undefined shift in decode_subframe()
|
||||
- avcodec/get_bits: Fix get_sbits_long(0)
|
||||
- avformat/ffmdec: Check media type for chunks
|
||||
- avcodec/flacdec: Fix signed integer overflow in decode_subframe_fixed()
|
||||
- avcodec/flacdsp_template: Fix undefined shift in flac_decorrelate_indep_c
|
||||
- avformat/oggparsespeex: Check frames_per_packet and packet_size
|
||||
- avformat/utils: Check start/end before computing duration in update_stream_timings()
|
||||
- avcodec/flac_parser: Update nb_headers_buffered
|
||||
- avformat/idroqdec: Check chunk_size for being too large
|
||||
- filmstripdec: correctly check image dimensions
|
||||
- mss2: only use error correction for matching block counts
|
||||
- softfloat: decrease MIN_EXP to cover full float range
|
||||
- libopusdec: default to stereo for invalid number of channels
|
||||
- sbgdec: prevent NULL pointer access
|
||||
- smacker: limit recursion depth of smacker_decode_bigtree
|
||||
- mxfdec: fix NULL pointer dereference in mxf_read_packet_old
|
||||
- libschroedingerdec: fix leaking of framewithpts
|
||||
- libschroedingerdec: don't produce empty frames
|
||||
- softfloat: handle -INT_MAX correctly
|
||||
- pnmdec: make sure v is capped by maxval
|
||||
- smvjpegdec: make sure cur_frame is not negative
|
||||
- icodec: correctly check avio_read return value
|
||||
- icodec: fix leaking pkt on error
|
||||
- dvbsubdec: fix division by zero in compute_default_clut
|
||||
- proresdec_lgpl: explicitly check coff[3] against slice_data_size
|
||||
- escape124: reject codebook size 0
|
||||
- mpegts: prevent division by zero
|
||||
- matroskadec: fix NULL pointer dereference in webm_dash_manifest_read_header
|
||||
- mpegaudio_parser: don't return AVERROR_PATCHWELCOME
|
||||
- mxfdec: fix NULL pointer dereference
|
||||
- diracdec: check return code of get_buffer_with_edge
|
||||
- ppc: pixblockdsp: do unaligned block accesses correctly again
|
||||
- mpeg12dec: unref discarded picture from extradata
|
||||
- cavsdec: unref frame before referencing again
|
||||
- avformat: prevent triggering request_probe assert in ff_read_packet
|
||||
- avformat/mpeg: Adjust vid probe threshold to correct mis-detection
|
||||
- avcodec/rv40: Test remaining space in loop of get_dimension()
|
||||
- avcodec/ituh263dec: Avoid spending a long time in slice sync
|
||||
- avcodec/movtextdec: Add error message for tsmb_size check
|
||||
- avcodec/movtextdec: Fix tsmb_size check==0 check
|
||||
- avcodec/movtextdec: Fix potential integer overflow
|
||||
- avcodec/sunrast: Fix input buffer pointer check
|
||||
- avcodec/tscc: Check side data size before use
|
||||
- avcodec/rawdec: Check side data size before use
|
||||
- avcodec/msvideo1: Check side data size before use
|
||||
- avcodec/qpeg: Check side data size before use
|
||||
- avcodec/qtrle: Check side data size before use
|
||||
- avcodec/msrle: Check side data size before use
|
||||
- avcodec/kmvc: Check side data size before use
|
||||
- avcodec/idcinvideo: Check side data size before use
|
||||
- avcodec/cinepak: Check side data size before use
|
||||
- avcodec/8bps: Check side data size before use
|
||||
- avcodec/dvdsubdec: Fix off by 1 error
|
||||
- avcodec/dvdsubdec: Fix buf_size check
|
||||
- vp9: change order of operations in adapt_prob().
|
||||
- avcodec/interplayvideo: Check side data size before use
|
||||
- avformat/mxfdec: Check size to avoid integer overflow in mxf_read_utf16_string()
|
||||
- avcodec/mpegvideo_enc: Clear mmx state in ff_mpv_reallocate_putbitbuffer()
|
||||
- avcodec/utils: Clear MMX state before returning from avcodec_default_execute*()
|
||||
- cmdutils: fix typos
|
||||
- lavfi: fix typos
|
||||
- lavc: fix typos
|
||||
- tools: fix grammar error
|
||||
- avutil/mips/generic_macros_msa: rename macro variable which causes segfault for mips r6
|
||||
- videodsp: fix 1-byte overread in top/bottom READ_NUM_BYTES iterations.
|
||||
- avformat/avidec: Check nb_streams in read_gab2_sub()
|
||||
- avformat/avidec: Remove ancient assert
|
||||
- lavc/movtextdec.c: Avoid infinite loop on invalid data.
|
||||
- avcodec/ansi: Check dimensions
|
||||
- avcodec/cavsdsp: use av_clip_uint8() for idct
|
||||
|
||||
version 2.8.8
|
||||
- avformat/movenc: Check packet in mov_write_single_packet() too
|
||||
- avformat/movenc: Factor check_pkt() out
|
||||
- avformat/utils: fix timebase error in avformat_seek_file()
|
||||
- avcodec/g726: Add missing ADDB output mask
|
||||
- avcodec/avpacket: clear side_data_elems
|
||||
- avcodec/ccaption_dec: Use simple array instead of AVBuffer
|
||||
- swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
|
||||
- swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices
|
||||
- avformat/avidec: Fix infinite loop in avi_read_nikon()
|
||||
- cmdutils: fix implicit declaration of SetDllDirectory function
|
||||
- cmdutils: check for SetDllDirectory() availability
|
||||
- avcodec/aacenc: Tighter input checks
|
||||
- libavcodec/wmalosslessdec: Check the remaining bits
|
||||
- avcodec/diracdec: Check numx/y
|
||||
- avcodec/indeo2: check ctab
|
||||
- avformat/swfdec: Fix inflate() error code check
|
||||
- avcodec/h264: Put context_count check back
|
||||
- cmdutils: remove the current working directory from the DLL search path on win32
|
||||
- avcodec/raw: Fix decoding of ilacetest.mov
|
||||
- avcodec/ffv1enc: Fix assertion failure with non zero bits per sample
|
||||
- avformat/oggdec: Fix integer overflow with invalid pts
|
||||
- ffplay: Fix invalid array index
|
||||
- avcodec/vp9_parser: Check the input frame sizes for being consistent
|
||||
- libavformat/rtpdec_asf: zero initialize the AVIOContext struct
|
||||
- libavutil/opt: Small bugfix in example.
|
||||
- libx264: Increase x264 opts character limit to 4096
|
||||
- avformat/mov: Check sample size
|
||||
- avformat/format: Fix registering a format more than once and related races
|
||||
- avcodec/flac_parser: Raise threshold for detecting invalid data
|
||||
- avfilter/vf_telecine: Make frame writable before writing into it
|
||||
- avcodec/mpc8: Correct end truncation
|
||||
- avcodec/mpegvideo: Do not clear the parse context during init
|
||||
- MAINTAINERs cleanup (remove myself from things i de facto do not maintain)
|
||||
- avcodec/h264: Fix off by 1 context count
|
||||
- avcodec/alsdec: Check r to prevent out of array read
|
||||
- avcodec/alsdec: fix max bits in ltp prefix code
|
||||
- avcodec/utils: check skip_samples signedness
|
||||
- avformat/mpegts: Do not trust BSSD descriptor, it is sometimes not an S302M stream
|
||||
- avcodec/bmp_parser: Check fsize
|
||||
- avcodec/bmp_parser: reset state
|
||||
- avcodec/bmp_parser: Fix remaining size
|
||||
- avcodec/bmp_parser: Fix frame_start_found in cross frame cases
|
||||
- avfilter/af_amix: do not fail if there are no samples in output_frame()
|
||||
- avformat/allformats: Making av_register_all() thread-safe.
|
||||
- avcodec/mpegvideo: Deallocate last/next picture earlier
|
||||
- avcodec/bmp_parser: Fix state
|
||||
- avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c
|
||||
- doc/developer.texi: Add a code of conduct
|
||||
- avformat/avidec: Detect index with too short entries
|
||||
- avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()
|
||||
- avformat/utils: Do not compute the bitrate from duration == 0
|
||||
- ffmpeg: Check that r_frame_rate is set before attempting to use it
|
||||
- swresample/rematrix: Use clipping s16 rematrixing if overflows are possible
|
||||
- swresample/rematrix: Use error diffusion to avoid error in the DC component of the matrix
|
||||
- libavformat/oggdec: Free stream private when header parsing fails.
|
||||
- avformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()
|
||||
- avformat/oggparseopus: Check that granule pos is within the supported range
|
||||
- avcodec/mjpegdec: Do not try to detect last scan but apply idct after all scans for progressive jpeg
|
||||
- avformat/options_table: Add missing identifier for very strict compliance
|
||||
- librtmp: Avoid an infiniloop setting connection arguments
|
||||
- avformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame
|
||||
|
||||
|
||||
version 2.8.7
|
||||
- avcodec/motion_est: Attempt to fix "short data segment overflowed" on IA64
|
||||
- avformat/ffmdec: Check pix_fmt
|
||||
- avcodec/ttaenc: Reallocate packet if its too small
|
||||
- pgssubdec: fix subpicture output colorspace and range
|
||||
- avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
|
||||
- avfilter/vf_drawtext: Check return code of load_glyph()
|
||||
- avcodec/takdec: add code that got somehow lost in process of REing
|
||||
- avcodec/apedec: fix decoding of stereo files with one channel full of silence
|
||||
- avcodec/avpacket: Fix off by 5 error
|
||||
- avcodec/h264: Fix for H.264 configuration parsing
|
||||
- avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
|
||||
- avfilter/src_movie: fix how we check for overflows with seek_point
|
||||
- avcodec/j2kenc: Add attribution to OpenJPEG project:
|
||||
- avcodec/h264_slice: Check PPS more extensively when its not copied
|
||||
- avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
|
||||
- avformat/rtpdec_jpeg: fix low contrast image on low quality setting
|
||||
- avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
|
||||
- lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.
|
||||
- avcodec/resample: Remove disabled and faulty code
|
||||
- indeo2: Fix banding artefacts
|
||||
- indeo2data: K&R formatting cosmetics
|
||||
- avcodec/imgconvert: Support non-planar colorspaces while padding
|
||||
- avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
|
||||
- avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
|
||||
- avformat/concatdec: set safe mode to enabled instead of auto
|
||||
- avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
|
||||
- avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
|
||||
- avformat/cache: Fix memleak of tree entries
|
||||
- lavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216 (cherry picked from commit 22dbc1caaf13e4bb17c9e0164a5b1ccaf490e428)
|
||||
- lavf/mov: fix sidx with edit lists (cherry picked from commit 3617e69d50dd9dd07b5011dfb9477a9d1a630354)
|
||||
- avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
|
||||
- libwebpenc_animencoder: print library messages in verbose log levels
|
||||
- libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct
|
||||
- doc/utils: fix typo for min() description
|
||||
- avcodec/avpacket: clear priv in av_init_packet()
|
||||
- swscale/utils: Fix chrSrcHSubSample for GBRAP16
|
||||
- swscale/input: Fix GBRAP16 input
|
||||
- postproc: fix unaligned access
|
||||
- avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
|
||||
- avcodec/h264: Execute error concealment before marking the frame as done.
|
||||
- swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
|
||||
- swscale/x86/output: Move code into yuv2planeX_mainloop
|
||||
- avutil/frame: Free destination qp_table_buf in frame_copy_props()
|
||||
|
||||
|
||||
version 2.8.6
|
||||
- avcodec/jpeg2000dec: More completely check cdef
|
||||
- avutil/opt: check for and handle errors in av_opt_set_dict2()
|
||||
- avcodec/flacenc: fix calculation of bits required in case of custom sample rate
|
||||
- avformat: Document urls a bit
|
||||
- avformat/libquvi: Set default demuxer and protocol limitations
|
||||
- avformat/concat: Check protocol prefix
|
||||
- doc/demuxers: Document enable_drefs and use_absolute_path
|
||||
- avcodec/mjpegdec: Check for end for both bytes in unescaping
|
||||
- avcodec/mpegvideo_enc: Check for integer overflow in ff_mpv_reallocate_putbitbuffer()
|
||||
- avformat/avformat: Replace some references to filenames by urls
|
||||
- avcodec/wmaenc: Check ff_wma_init() for failure
|
||||
- avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
|
||||
- avformat/img2dec: Use AVOpenCallback
|
||||
- avformat/avio: Limit url option parsing to the documented cases
|
||||
- avformat/img2dec: do not interpret the filename by default if a IO context has been opened
|
||||
- avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
|
||||
- mov: Add an option to toggle dref opening
|
||||
- avcodec/gif: Fix lzw buffer size
|
||||
- avcodec/put_bits: Assert buf_ptr in flush_put_bits()
|
||||
- avcodec/tiff: Check subsample & rps values more completely
|
||||
- swscale/swscale: Add some sanity checks for srcSlice* parameters
|
||||
- swscale/x86/rgb2rgb_template: Fix planar2x() for short width
|
||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
|
||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
|
||||
- avcodec/aacenc: Check both channels for finiteness
|
||||
- asfdec_o: check for too small size in asf_read_unknown
|
||||
- asfdec_o: break if EOF is reached after asf_read_packet_header
|
||||
- asfdec_o: make sure packet_size is non-zero before seeking
|
||||
- asfdec_o: prevent overflow causing seekback
|
||||
- asfdec_o: check avio_skip in asf_read_simple_index
|
||||
- asfdec_o: reject size > INT64_MAX in asf_read_unknown
|
||||
- asfdec_o: only set asf_pkt->data_size after sanity checks
|
||||
- Merge commit '8375dc1dd101d51baa430f34c0bcadfa37873896'
|
||||
- dca: fix misaligned access in avpriv_dca_convert_bitstream
|
||||
- brstm: fix missing closing brace
|
||||
- brstm: also allocate b->table in read_packet
|
||||
- brstm: make sure an ADPC chunk was read for adpcm_thp
|
||||
- vorbisdec: reject rangebits 0 with non-0 partitions
|
||||
- vorbisdec: reject channel mapping with less than two channels
|
||||
- ffmdec: reset packet_end in case of failure
|
||||
- avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
|
||||
- avformat/brstm: fix overflow
|
||||
|
||||
|
||||
version 2.8.5
|
||||
- avformat/hls: Even stricter URL checks
|
||||
- avformat/hls: More strict url checks
|
||||
- avcodec/pngenc: Fix mixed up linesizes
|
||||
- avcodec/pngenc: Replace memcpy by av_image_copy()
|
||||
- swscale/vscale: Check that 2 tap filters are bilinear before using bilinear code
|
||||
- swscale: Move VScalerContext into vscale.c
|
||||
- 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/g2meet: Check for ff_els_decode_bit() failure in epic_decode_run_length()
|
||||
- avcodec/mjpegdec: Fix negative shift
|
||||
- avcodec/mss2: Check for repeat overflow
|
||||
- avformat: Add integer fps from 31 to 60 to get_std_framerate()
|
||||
- avformat/ivfenc: fix division by zero
|
||||
- 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
|
||||
- avformat/mov: Update handbrake_version threshold for full mp3 parsing
|
||||
- x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
|
||||
- avfilter/vf_zoompan: do not free frame we pushed to lavfi
|
||||
- nuv: sanitize negative fps rate
|
||||
- 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
|
||||
|
||||
|
||||
version 2.8.4
|
||||
- rawdec: only exempt BIT0 with need_copy from buffer sanity check
|
||||
- mlvdec: check that index_entries exist
|
||||
- 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
|
||||
- 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
|
||||
- sbr_qmf_analysis: sanitize input for 32-bit imdct
|
||||
- sbrdsp_fixed: assert that input values are in the valid range
|
||||
- aacsbr: ensure strictly monotone time borders
|
||||
- aacenc: update max_sfb when num_swb changes
|
||||
- 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
|
||||
- lavf/tee: fix side data double free.
|
||||
- avformat/hlsenc: Check the return code of avformat_write_header()
|
||||
- avformat/mov: Enable parser for mp3s by old HandBrake
|
||||
- avformat/mxfenc: Fix integer overflow in length computation
|
||||
- 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
|
||||
- libvpxenc: remove some unused ctrl id mappings
|
||||
- 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"
|
||||
- avformat/riffdec: Initialize bitrate
|
||||
- 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/hevc: Check max ctb addresses for WPP
|
||||
- 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
|
||||
- lavf/rtpenc_jpeg: Less strict check for standard Huffman tables.
|
||||
- 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
|
||||
|
||||
|
||||
version 2.8.3
|
||||
- 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
|
||||
- rtmpcrypt: Do the xtea decryption in little endian mode
|
||||
- avformat/matroskadec: Check subtitle stream before dereferencing
|
||||
- avcodec/pngdec: Replace assert by request for sample for unsupported TRNS cases
|
||||
- avformat/utils: Do not init parser if probing is unfinished
|
||||
- avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
|
||||
- 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
|
||||
- aacsbr: don't call sbr_dequant twice without intermediate read_sbr_data
|
||||
- hqx: correct type and size check of info_offset
|
||||
- mxfdec: check edit_rate also for physical_track
|
||||
- avcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or height
|
||||
- avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
|
||||
- avcodec/jpeg2000: Check comp coords to be within the supported size
|
||||
- mpegvideo: clear overread in clear_context
|
||||
- avcodec/avrndec: Use the AVFrame format instead of the context
|
||||
- dds: disable palette flag for compressed images
|
||||
- dds: validate compressed source buffer size
|
||||
- dds: validate source buffer size before copying
|
||||
- dvdsubdec: validate offset2 similar to offset1
|
||||
- brstm: reject negative sample rate
|
||||
- aacps: avoid division by zero in stereo_processing
|
||||
- softfloat: assert when the argument of av_sqrt_sf is negative
|
||||
|
||||
version 2.8.2
|
||||
- various fixes in the aac_fixed decoder
|
||||
- various fixes in softfloat
|
||||
- swresample/resample: increase precision for compensation
|
||||
- lavf/mov: add support for sidx fragment indexes
|
||||
- avformat/mxfenc: Only store user comment related tags when needed
|
||||
- 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/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
|
||||
- avcodec/faxcompr: Add missing runs check in decode_uncompressed()
|
||||
- libavutil/channel_layout: Check strtol*() for failure
|
||||
- avformat/mpegts: Only start probing data streams within probe_packets
|
||||
- avcodec/hevc_ps: Check chroma_format_idc
|
||||
- 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
|
||||
- avformat/hls: update cookies on setcookie response
|
||||
- opusdec: Don't run vector_fmul_scalar on zero length arrays
|
||||
- avcodec/opusdec: Fix extra samples read index
|
||||
- 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
|
||||
- rtsp: Allow $ as interleaved packet indicator before a complete response header
|
||||
- videodsp: don't overread edges in vfix3 emu_edge.
|
||||
- avformat/mp3dec: improve junk skipping heuristic
|
||||
- concatdec: fix file_start_time calculation regression
|
||||
- avcodec: loongson optimize h264dsp idct and loop filter with mmi
|
||||
- avcodec/jpeg2000dec: Clear properties in jpeg2000_dec_cleanup() too
|
||||
- avformat/hls: add support for EXT-X-MAP
|
||||
- avformat/hls: fix segment selection regression on track changes of live streams
|
||||
- configure: Require libkvazaar < 0.7.
|
||||
- avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
|
||||
|
||||
|
||||
version 2.8.1:
|
||||
- swscale: fix ticket #4881
|
||||
- doc: fix spelling errors
|
||||
- hls: only seek if there is an offset
|
||||
- asfdec: add more checks for size left in asf packet buffer
|
||||
- asfdec: alloc enough space for storing name in asf_read_metadata_obj
|
||||
- avcodec/pngdec: Check blend_op.
|
||||
- h264_mp4toannexb: fix pps offfset fault when there are more than one sps in avcc
|
||||
- avcodec/h264_mp4toannexb_bsf: Use av_freep() to free spspps_buf
|
||||
- avformat/avidec: Workaround broken initial frame
|
||||
- avformat/hls: fix some cases of HLS streams which require cookies
|
||||
- avcodec/pngdec: reset has_trns after every decode_frame_png()
|
||||
- lavf/img2dec: Fix memory leak
|
||||
- avcodec/mp3: fix skipping zeros
|
||||
- avformat/srtdec: make sure we probe a number
|
||||
- configure: check for ID3D11VideoContext
|
||||
- avformat/vobsub: compare correct packet stream IDs
|
||||
- avformat/srtdec: more lenient first line probing
|
||||
- avformat/srtdec: fix number check for the first character
|
||||
- avcodec/mips: build fix for MSA 64bit
|
||||
- avcodec/mips: build fix for MSA
|
||||
- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
|
||||
- libavformat/hlsenc: Use of uninitialized memory unlinking old files
|
||||
- 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
|
||||
- dnxhddata: correct weight tables
|
||||
- dnxhddec: decode and use interlace mb flag
|
||||
- swscale: fix ticket #4877
|
||||
- avcodec/rangecoder: Check e
|
||||
- avcodec/ffv1: separate slice_count from max_slice_count
|
||||
- swscale: fix ticket 4850
|
||||
- cmdutils: Filter dst/srcw/h
|
||||
- avutil/log: fix zero length gnu_printf format string warning
|
||||
- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
|
||||
- swscale/swscale: Fix "unused variable" warning
|
||||
- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
|
||||
- MAINTAINERS: add 2.8, drop 2.2
|
||||
- doc: mention libavcodec can decode Opus natively
|
||||
- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
|
||||
- avfilter/af_ladspa: process all channels for nb_handles > 1
|
||||
- configure: add libsoxr to swresample's pkgconfig
|
||||
- lavc: Fix compilation with --disable-everything --enable-parser=mpeg4video.
|
||||
|
||||
version 2.8:
|
||||
- colorkey video filter
|
||||
- BFSTM/BCSTM demuxer
|
||||
- little-endian ADPCM_THP decoder
|
||||
|
||||
12
MAINTAINERS
12
MAINTAINERS
@@ -56,7 +56,7 @@ Communication
|
||||
website Deby Barbara Lepage
|
||||
fate.ffmpeg.org Timothy Gu
|
||||
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos, Lou Logan
|
||||
mailing lists Michael Niedermayer, Baptiste Coudurier, Lou Logan
|
||||
mailing lists Baptiste Coudurier, Lou Logan
|
||||
Google+ Paul B Mahol, Michael Niedermayer, Alexander Strasser
|
||||
Twitter Lou Logan, Reynaldo H. Verdejo Pinochet
|
||||
Launchpad Timothy Gu
|
||||
@@ -166,7 +166,7 @@ Codecs:
|
||||
dca.c Kostya Shishkov, Benjamin Larsson
|
||||
dnxhd* Baptiste Coudurier
|
||||
dpcm.c Mike Melanson
|
||||
dss_sp.c Oleksij Rempel, Michael Niedermayer
|
||||
dss_sp.c Oleksij Rempel
|
||||
dv.c Roman Shaposhnik
|
||||
dvbsubdec.c Anshul Maheshwari
|
||||
dxa.c Kostya Shishkov
|
||||
@@ -419,7 +419,7 @@ Muxers/Demuxers:
|
||||
cdxl.c Paul B Mahol
|
||||
crc.c Michael Niedermayer
|
||||
daud.c Reimar Doeffinger
|
||||
dss.c Oleksij Rempel, Michael Niedermayer
|
||||
dss.c Oleksij Rempel
|
||||
dtshddec.c Paul B Mahol
|
||||
dv.c Roman Shaposhnik
|
||||
dxa.c Kostya Shishkov
|
||||
@@ -455,7 +455,7 @@ Muxers/Demuxers:
|
||||
mgsts.c Paul B Mahol
|
||||
microdvd* Aurelien Jacobs
|
||||
mm.c Peter Ross
|
||||
mov.c Michael Niedermayer, Baptiste Coudurier
|
||||
mov.c Baptiste Coudurier
|
||||
movenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
mpc.c Kostya Shishkov
|
||||
mpeg.c Michael Niedermayer
|
||||
@@ -558,17 +558,17 @@ Windows MSVC Matthew Oliver, Hendrik Leppkes
|
||||
Windows ICL Matthew Oliver
|
||||
ADI/Blackfin DSP Marc Hoffman
|
||||
Sparc Roman Shaposhnik
|
||||
x86 Michael Niedermayer
|
||||
OS/2 KO Myung-Hun
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
15
RELEASE_NOTES
Normal file
15
RELEASE_NOTES
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
┌────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 2.8 "Feynman" │
|
||||
└────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 2.8 "Feynman", about 3
|
||||
months after the release of FFmpeg 2.7.
|
||||
|
||||
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.
|
||||
22
cmdutils.c
22
cmdutils.c
@@ -60,6 +60,9 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#if HAVE_SETDLLDIRECTORY
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
static int init_report(const char *env);
|
||||
|
||||
@@ -106,6 +109,15 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
|
||||
}
|
||||
}
|
||||
|
||||
void init_dynload(void)
|
||||
{
|
||||
#if HAVE_SETDLLDIRECTORY
|
||||
/* Calling SetDllDirectory with the empty string (but not NULL) removes the
|
||||
* current working directory from the DLL search path as a security pre-caution. */
|
||||
SetDllDirectory("");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void (*program_exit)(int ret);
|
||||
|
||||
void register_exit(void (*cb)(int ret))
|
||||
@@ -563,6 +575,12 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
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);
|
||||
}
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
|
||||
return ret;
|
||||
@@ -2057,7 +2075,7 @@ static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Audo-detected sources for %s:\n", fmt->name);
|
||||
printf("Auto-detected sources for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sources. Not implemented.\n");
|
||||
@@ -2087,7 +2105,7 @@ static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Audo-detected sinks for %s:\n", fmt->name);
|
||||
printf("Auto-detected sinks for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sinks. Not implemented.\n");
|
||||
|
||||
@@ -61,6 +61,11 @@ void register_exit(void (*cb)(int ret));
|
||||
*/
|
||||
void exit_program(int ret) av_noreturn;
|
||||
|
||||
/**
|
||||
* Initialize dynamic library loading
|
||||
*/
|
||||
void init_dynload(void);
|
||||
|
||||
/**
|
||||
* Initialize the cmdutils option system, in particular
|
||||
* allocate the *_opts contexts.
|
||||
@@ -445,13 +450,13 @@ int show_devices(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
#if CONFIG_AVDEVICE
|
||||
/**
|
||||
* Print a listing containing audodetected sinks of the output device.
|
||||
* Print a listing containing autodetected sinks of the output device.
|
||||
* Device name with options may be passed as an argument to limit results.
|
||||
*/
|
||||
int show_sinks(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing audodetected sources of the input device.
|
||||
* Print a listing containing autodetected sources of the input device.
|
||||
* Device name with options may be passed as an argument to limit results.
|
||||
*/
|
||||
int show_sources(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
14
configure
vendored
14
configure
vendored
@@ -1797,6 +1797,7 @@ SYSTEM_FUNCS="
|
||||
sched_getaffinity
|
||||
SetConsoleTextAttribute
|
||||
SetConsoleCtrlHandler
|
||||
SetDllDirectory
|
||||
setmode
|
||||
setrlimit
|
||||
Sleep
|
||||
@@ -2374,7 +2375,7 @@ zmbv_encoder_select="zlib"
|
||||
|
||||
# hardware accelerators
|
||||
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
|
||||
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
|
||||
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
|
||||
dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
|
||||
vaapi_deps="va_va_h"
|
||||
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads CoreServices_CoreServices_h"
|
||||
@@ -5102,6 +5103,7 @@ check_func_headers windows.h MapViewOfFile
|
||||
check_func_headers windows.h PeekNamedPipe
|
||||
check_func_headers windows.h SetConsoleTextAttribute
|
||||
check_func_headers windows.h SetConsoleCtrlHandler
|
||||
check_func_headers windows.h SetDllDirectory
|
||||
check_func_headers windows.h Sleep
|
||||
check_func_headers windows.h VirtualAlloc
|
||||
check_struct windows.h "CONDITION_VARIABLE" Ptr
|
||||
@@ -5147,6 +5149,7 @@ check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
|
||||
|
||||
check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
|
||||
check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
|
||||
check_type "windows.h d3d11.h" "ID3D11VideoContext"
|
||||
check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
|
||||
|
||||
check_type "va/va.h" "VAPictureParameterBufferHEVC"
|
||||
@@ -5239,7 +5242,7 @@ enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
|
||||
check_lib "${gsm_hdr}" gsm_create -lgsm && break;
|
||||
done || die "ERROR: libgsm not found"; }
|
||||
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
|
||||
enabled libkvazaar && require_pkg_config kvazaar kvazaar.h kvz_api_get
|
||||
enabled libkvazaar && require_pkg_config "kvazaar < 0.7.0" kvazaar.h kvz_api_get
|
||||
enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
|
||||
enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
|
||||
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
|
||||
@@ -5261,7 +5264,7 @@ enabled libshine && require_pkg_config shine shine/layer3.h shine_encod
|
||||
enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
|
||||
require smbclient libsmbclient.h smbc_init -lsmbclient; }
|
||||
enabled libsnappy && require snappy snappy-c.h snappy_compress -lsnappy
|
||||
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
||||
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
|
||||
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
|
||||
enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
|
||||
enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
|
||||
@@ -5734,6 +5737,7 @@ __declspec($_restrict) void* foo(int);
|
||||
EOF
|
||||
fi
|
||||
check_func strtoll || add_cflags -Dstrtoll=_strtoi64
|
||||
check_func strtoull || add_cflags -Dstrtoull=_strtoui64
|
||||
fi
|
||||
|
||||
for pfx in "" host_; do
|
||||
@@ -6140,7 +6144,7 @@ cat > $TMPH <<EOF
|
||||
#define FFMPEG_CONFIG_H
|
||||
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
||||
#define FFMPEG_LICENSE "$(c_escape $license)"
|
||||
#define CONFIG_THIS_YEAR 2015
|
||||
#define CONFIG_THIS_YEAR 2017
|
||||
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
||||
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
||||
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
||||
@@ -6264,4 +6268,4 @@ pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVF
|
||||
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
|
||||
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
|
||||
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
|
||||
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"
|
||||
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM $LIBSOXR"
|
||||
|
||||
@@ -15,27 +15,29 @@ libavutil: 2014-08-09
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2015-xx-xx - lavc 56.58.100 - vaapi.h
|
||||
-------- 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-xx-xx - lavu 54.31.100 - pixfmt.h
|
||||
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-xx-xx - lavu 54.30.0
|
||||
xxxxxxx - Add av_blowfish_alloc().
|
||||
xxxxxxx - Add av_rc4_alloc().
|
||||
xxxxxxx - Add av_xtea_alloc().
|
||||
xxxxxxx - Add av_des_alloc().
|
||||
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-xx-xx - lavc 56.35.0 - avcodec.h
|
||||
xxxxxxxxx - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
|
||||
xxxxxxxxx - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
|
||||
xxxxxxxxx - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
|
||||
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
|
||||
|
||||
@@ -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.8.11
|
||||
|
||||
# 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
|
||||
|
||||
@@ -104,7 +104,7 @@ All subsequent file-related directives apply to that file.
|
||||
|
||||
@item @code{ffconcat version 1.0}
|
||||
Identify the script type and version. It also sets the @option{safe} option
|
||||
to 1 if it was to its default -1.
|
||||
to 1 if it was -1.
|
||||
|
||||
To make FFmpeg recognize the format automatically, this directive must
|
||||
appears exactly as is (no extra space or byte-order-mark) on the very first
|
||||
@@ -192,7 +192,9 @@ component.
|
||||
|
||||
If set to 0, any file name is accepted.
|
||||
|
||||
The default is -1, it is equivalent to 1 if the format was automatically
|
||||
The default is 1.
|
||||
|
||||
-1 is equivalent to 1 if the format was automatically
|
||||
probed and 0 otherwise.
|
||||
|
||||
@item auto_convert
|
||||
@@ -416,6 +418,23 @@ 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.
|
||||
|
||||
@@ -400,6 +400,35 @@ finding a new maintainer and also don't forget updating the @file{MAINTAINERS} f
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
@section Code of conduct
|
||||
|
||||
Be friendly and respectful towards others and third parties.
|
||||
Treat others the way you yourself want to be treated.
|
||||
|
||||
Be considerate. Not everyone shares the same viewpoint and priorities as you do.
|
||||
Different opinions and interpretations help the project.
|
||||
Looking at issues from a different perspective assists development.
|
||||
|
||||
Do not assume malice for things that can be attributed to incompetence. Even if
|
||||
it is malice, it's rarely good to start with that as initial assumption.
|
||||
|
||||
Stay friendly even if someone acts contrarily. Everyone has a bad day
|
||||
once in a while.
|
||||
If you yourself have a bad day or are angry then try to take a break and reply
|
||||
once you are calm and without anger if you have to.
|
||||
|
||||
Try to help other team members and cooperate if you can.
|
||||
|
||||
The goal of software development is to create technical excellence, not for any
|
||||
individual to be better and "win" against the others. Large software projects
|
||||
are only possible and successful through teamwork.
|
||||
|
||||
If someone struggles do not put them down. Give them a helping hand
|
||||
instead and point them in the right direction.
|
||||
|
||||
Finally, keep in mind the immortal words of Bill and Ted,
|
||||
"Be excellent to each other."
|
||||
|
||||
@anchor{Submitting patches}
|
||||
@section Submitting patches
|
||||
|
||||
|
||||
@@ -1353,7 +1353,7 @@ can be selected with @code{-pred 1}.
|
||||
@table @option
|
||||
@item format
|
||||
Can be set to either @code{j2k} or @code{jp2} (the default) that
|
||||
allows to store non-rgb pix_fmts.
|
||||
makes it possible to store non-rgb pix_fmts.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_file}@} ... @{[@var{output_file_options}] @file{output_file}@} ...
|
||||
ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_url}@} ... @{[@var{output_file_options}] @file{output_url}@} ...
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -24,10 +24,10 @@ rates and resize video on the fly with a high quality polyphase filter.
|
||||
@command{ffmpeg} reads from an arbitrary number of input "files" (which can be regular
|
||||
files, pipes, network streams, grabbing devices, etc.), specified by the
|
||||
@code{-i} option, and writes to an arbitrary number of output "files", which are
|
||||
specified by a plain output filename. Anything found on the command line which
|
||||
cannot be interpreted as an option is considered to be an output filename.
|
||||
specified by a plain output url. Anything found on the command line which
|
||||
cannot be interpreted as an option is considered to be an output url.
|
||||
|
||||
Each input or output file can, in principle, contain any number of streams of
|
||||
Each input or output url can, in principle, contain any number of streams of
|
||||
different types (video/audio/subtitle/attachment/data). The allowed number and/or
|
||||
types of streams may be limited by the container format. Selecting which
|
||||
streams from which inputs will go into which output is either done automatically
|
||||
@@ -243,8 +243,8 @@ Force input or output file format. The format is normally auto detected for inpu
|
||||
files and guessed from the file extension for output files, so this option is not
|
||||
needed in most cases.
|
||||
|
||||
@item -i @var{filename} (@emph{input})
|
||||
input file name
|
||||
@item -i @var{url} (@emph{input})
|
||||
input file url
|
||||
|
||||
@item -y (@emph{global})
|
||||
Overwrite output files without asking.
|
||||
@@ -277,7 +277,7 @@ libx264, and the 138th audio, which will be encoded with libvorbis.
|
||||
When used as an input option (before @code{-i}), limit the @var{duration} of
|
||||
data read from the input file.
|
||||
|
||||
When used as an output option (before an output filename), stop writing the
|
||||
When used as an output option (before an output url), stop writing the
|
||||
output after its duration reaches @var{duration}.
|
||||
|
||||
@var{duration} must be a time duration specification,
|
||||
@@ -304,7 +304,7 @@ 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
|
||||
will be preserved.
|
||||
|
||||
When used as an output option (before an output filename), decodes but discards
|
||||
When used as an output option (before an output url), decodes but discards
|
||||
input until the timestamps reach @var{position}.
|
||||
|
||||
@var{position} must be a time duration specification,
|
||||
@@ -1094,7 +1094,7 @@ may be reassigned to a different value.
|
||||
For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
|
||||
an output mpegts file:
|
||||
@example
|
||||
ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
|
||||
ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
|
||||
@end example
|
||||
|
||||
@item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
|
||||
@@ -1205,9 +1205,9 @@ The option is intended for cases where features are needed that cannot be
|
||||
specified to @command{ffserver} but can be to @command{ffmpeg}.
|
||||
|
||||
@item -sdp_file @var{file} (@emph{global})
|
||||
Print sdp information to @var{file}.
|
||||
Print sdp information for an output stream to @var{file}.
|
||||
This allows dumping sdp information when at least one output isn't an
|
||||
rtp stream.
|
||||
rtp stream. (Requires at least one of the output formats to be rtp).
|
||||
|
||||
@item -discard (@emph{input})
|
||||
Allows discarding specific streams or frames of streams at the demuxer.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffplay [@var{options}] [@file{input_file}]
|
||||
ffplay [@var{options}] [@file{input_url}]
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -106,8 +106,8 @@ the input audio.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
sources and sinks).
|
||||
|
||||
@item -i @var{input_file}
|
||||
Read @var{input_file}.
|
||||
@item -i @var{input_url}
|
||||
Read @var{input_url}.
|
||||
@end table
|
||||
|
||||
@section Advanced options
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffprobe [@var{options}] [@file{input_file}]
|
||||
ffprobe [@var{options}] [@file{input_url}]
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -24,8 +24,8 @@ For example it can be used to check the format of the container used
|
||||
by a multimedia stream and the format and type of each media stream
|
||||
contained in it.
|
||||
|
||||
If a filename is specified in input, ffprobe will try to open and
|
||||
probe the file content. If the file cannot be opened or recognized as
|
||||
If a url is specified in input, ffprobe will try to open and
|
||||
probe the url content. If the url cannot be opened or recognized as
|
||||
a multimedia file, a positive exit code is returned.
|
||||
|
||||
ffprobe may be employed both as a standalone application or in
|
||||
@@ -332,8 +332,8 @@ with name "PIXEL_FORMAT".
|
||||
Force bitexact output, useful to produce output which is not dependent
|
||||
on the specific build.
|
||||
|
||||
@item -i @var{input_file}
|
||||
Read @var{input_file}.
|
||||
@item -i @var{input_url}
|
||||
Read @var{input_url}.
|
||||
|
||||
@end table
|
||||
@c man end
|
||||
|
||||
@@ -1032,7 +1032,7 @@ Number_of_samples
|
||||
For example full key look like this @code{lavfi.astats.1.DC_offset} or
|
||||
this @code{lavfi.astats.Overall.Peak_count}.
|
||||
|
||||
For description what each key means read bellow.
|
||||
For description what each key means read below.
|
||||
|
||||
@item reset
|
||||
Set number of frame after which stats are going to be recalculated.
|
||||
@@ -2199,7 +2199,7 @@ Amount of milliseconds the signal has to rise above the threshold before gain
|
||||
reduction starts. Default is 20. Range is between 0.01 and 2000.
|
||||
|
||||
@item release
|
||||
Amount of milliseconds the signal has to fall bellow the threshold before
|
||||
Amount of milliseconds the signal has to fall below the threshold before
|
||||
reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
|
||||
|
||||
@item makeup
|
||||
@@ -4118,7 +4118,7 @@ It accepts the following options:
|
||||
@item threshold1
|
||||
@item threshold2
|
||||
@item threshold3
|
||||
Allows to limit the maximum change for each plane, default is 65535.
|
||||
Limit the maximum change for each plane, default is 65535.
|
||||
If 0, plane will remain unchanged.
|
||||
@end table
|
||||
|
||||
@@ -4321,7 +4321,7 @@ It accepts the following options:
|
||||
@item threshold1
|
||||
@item threshold2
|
||||
@item threshold3
|
||||
Allows to limit the maximum change for each plane, default is 65535.
|
||||
Limit the maximum change for each plane, default is 65535.
|
||||
If 0, plane will remain unchanged.
|
||||
|
||||
@item coordinates
|
||||
@@ -4967,7 +4967,7 @@ within the parameter list.
|
||||
@item
|
||||
Show the text at the center of the video frame:
|
||||
@example
|
||||
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
|
||||
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
|
||||
@end example
|
||||
|
||||
@item
|
||||
@@ -5206,7 +5206,7 @@ It accepts the following options:
|
||||
@item threshold1
|
||||
@item threshold2
|
||||
@item threshold3
|
||||
Allows to limit the maximum change for each plane, default is 65535.
|
||||
Limit the maximum change for each plane, default is 65535.
|
||||
If 0, plane will remain unchanged.
|
||||
|
||||
@item coordinates
|
||||
@@ -6900,7 +6900,7 @@ It accepts the following options:
|
||||
@item threshold1
|
||||
@item threshold2
|
||||
@item threshold3
|
||||
Allows to limit the maximum change for each plane, default is 65535.
|
||||
Limit the maximum change for each plane, default is 65535.
|
||||
If 0, plane will remain unchanged.
|
||||
@end table
|
||||
|
||||
@@ -9881,7 +9881,7 @@ stereo3d=sbsl:aybd
|
||||
@end example
|
||||
|
||||
@item
|
||||
Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
|
||||
Convert input video from above below (left eye above, right eye below) to side by side crosseye.
|
||||
@example
|
||||
stereo3d=abl:sbsr
|
||||
@end example
|
||||
|
||||
@@ -205,6 +205,10 @@ For example to separate the fields with newlines and indention:
|
||||
ffprobe -dump_separator "
|
||||
" -i ~/videos/matrixbench_mpeg2.mpg
|
||||
@end example
|
||||
|
||||
@item max_streams @var{integer} (@emph{input})
|
||||
Specifies the maximum number of streams. This can be used to reject files that
|
||||
would require too many resources due to a large number of streams.
|
||||
@end table
|
||||
|
||||
@c man end FORMAT OPTIONS
|
||||
|
||||
@@ -983,8 +983,8 @@ following image formats are supported:
|
||||
@item Musepack SV8 @tab @tab X
|
||||
@item Nellymoser Asao @tab X @tab X
|
||||
@item On2 AVC (Audio for Video Codec) @tab @tab X
|
||||
@item Opus @tab E @tab E
|
||||
@tab supported through external library libopus
|
||||
@item Opus @tab E @tab X
|
||||
@tab encoding supported through external library libopus
|
||||
@item PCM A-law @tab X @tab X
|
||||
@item PCM mu-law @tab X @tab X
|
||||
@item PCM signed 8-bit planar @tab X @tab X
|
||||
|
||||
@@ -839,6 +839,21 @@ 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.
|
||||
|
||||
@@ -869,7 +869,7 @@ Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
|
||||
@item min(x, y)
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
Return the minimum between @var{x} and @var{y}.
|
||||
|
||||
@item mod(x, y)
|
||||
Compute the remainder of division of @var{x} by @var{y}.
|
||||
|
||||
9
ffmpeg.c
9
ffmpeg.c
@@ -2447,6 +2447,9 @@ static void print_sdp(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!j)
|
||||
goto fail;
|
||||
|
||||
av_sdp_create(avc, j, sdp, sizeof(sdp));
|
||||
|
||||
if (!sdp_filename) {
|
||||
@@ -2462,6 +2465,7 @@ static void print_sdp(void)
|
||||
}
|
||||
}
|
||||
|
||||
fail:
|
||||
av_freep(&avc);
|
||||
}
|
||||
|
||||
@@ -2878,7 +2882,8 @@ static int transcode_init(void)
|
||||
* overhead
|
||||
*/
|
||||
if(!strcmp(oc->oformat->name, "avi")) {
|
||||
if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
if ( copy_tb<0 && ist->st->r_frame_rate.num
|
||||
&& av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(dec_ctx->time_base)
|
||||
&& av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500
|
||||
@@ -4113,6 +4118,8 @@ int main(int argc, char **argv)
|
||||
int ret;
|
||||
int64_t ti;
|
||||
|
||||
init_dynload();
|
||||
|
||||
register_exit(ffmpeg_cleanup);
|
||||
|
||||
setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */
|
||||
|
||||
@@ -2883,8 +2883,8 @@ enum OptGroup {
|
||||
};
|
||||
|
||||
static const OptionGroupDef groups[] = {
|
||||
[GROUP_OUTFILE] = { "output file", NULL, OPT_OUTPUT },
|
||||
[GROUP_INFILE] = { "input file", "i", OPT_INPUT },
|
||||
[GROUP_OUTFILE] = { "output url", NULL, OPT_OUTPUT },
|
||||
[GROUP_INFILE] = { "input url", "i", OPT_INPUT },
|
||||
};
|
||||
|
||||
static int open_files(OptionGroupList *l, const char *inout,
|
||||
|
||||
4
ffplay.c
4
ffplay.c
@@ -2869,7 +2869,7 @@ static int read_thread(void *arg)
|
||||
AVStream *st = ic->streams[i];
|
||||
enum AVMediaType type = st->codec->codec_type;
|
||||
st->discard = AVDISCARD_ALL;
|
||||
if (wanted_stream_spec[type] && st_index[type] == -1)
|
||||
if (type >= 0 && wanted_stream_spec[type] && st_index[type] == -1)
|
||||
if (avformat_match_stream_specifier(ic, st, wanted_stream_spec[type]) > 0)
|
||||
st_index[type] = i;
|
||||
}
|
||||
@@ -3684,6 +3684,8 @@ int main(int argc, char **argv)
|
||||
VideoState *is;
|
||||
char dummy_videodriver[] = "SDL_VIDEODRIVER=dummy";
|
||||
|
||||
init_dynload();
|
||||
|
||||
av_log_set_flags(AV_LOG_SKIP_REPEATED);
|
||||
parse_loglevel(argc, argv, options);
|
||||
|
||||
|
||||
@@ -3142,6 +3142,8 @@ int main(int argc, char **argv)
|
||||
char *w_name = NULL, *w_args = NULL;
|
||||
int ret, i;
|
||||
|
||||
init_dynload();
|
||||
|
||||
av_log_set_flags(AV_LOG_SKIP_REPEATED);
|
||||
register_exit(ffprobe_cleanup);
|
||||
|
||||
|
||||
@@ -2580,8 +2580,10 @@ static int http_receive_data(HTTPContext *c)
|
||||
} else if (c->buffer_ptr - c->buffer >= 2 &&
|
||||
!memcmp(c->buffer_ptr - 1, "\r\n", 2)) {
|
||||
c->chunk_size = strtol(c->buffer, 0, 16);
|
||||
if (c->chunk_size == 0) // end of stream
|
||||
if (c->chunk_size <= 0) { // end of stream or invalid chunk size
|
||||
c->chunk_size = 0;
|
||||
goto fail;
|
||||
}
|
||||
c->buffer_ptr = c->buffer;
|
||||
break;
|
||||
} else if (++loop_run > 10)
|
||||
@@ -2603,6 +2605,7 @@ static int http_receive_data(HTTPContext *c)
|
||||
/* end of connection : close it */
|
||||
goto fail;
|
||||
else {
|
||||
av_assert0(len <= c->chunk_size);
|
||||
c->chunk_size -= len;
|
||||
c->buffer_ptr += len;
|
||||
c->data_count += len;
|
||||
@@ -3817,6 +3820,8 @@ int main(int argc, char **argv)
|
||||
struct sigaction sigact = { { 0 } };
|
||||
int ret = 0;
|
||||
|
||||
init_dynload();
|
||||
|
||||
config.filename = av_strdup("/etc/ffserver.conf");
|
||||
|
||||
parse_loglevel(argc, argv, options);
|
||||
|
||||
@@ -120,12 +120,15 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
if (avctx->bits_per_coded_sample <= 8) {
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt,
|
||||
AV_PKT_DATA_PALETTE,
|
||||
NULL);
|
||||
if (pal) {
|
||||
&size);
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(c->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
|
||||
memcpy (frame->data[1], c->pal, AVPALETTE_SIZE);
|
||||
|
||||
@@ -861,7 +861,7 @@ 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
|
||||
ituh263dec.o h263dec.o h263data.o
|
||||
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \
|
||||
mpegaudiodecheader.o mpegaudiodata.o
|
||||
|
||||
@@ -499,7 +499,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
|
||||
}
|
||||
while (idx) {
|
||||
sce->sf_idx[bandaddr[idx]] = minq + q0;
|
||||
minq = paths[idx][minq].prev;
|
||||
minq = FFMAX(paths[idx][minq].prev, 0);
|
||||
idx--;
|
||||
}
|
||||
//set the same quantizers inside window groups
|
||||
|
||||
@@ -449,6 +449,10 @@ static int output_configure(AACContext *ac,
|
||||
int type = layout_map[i][0];
|
||||
int id = layout_map[i][1];
|
||||
id_map[type][id] = type_counts[type]++;
|
||||
if (id_map[type][id] >= MAX_ELEM_ID) {
|
||||
avpriv_request_sample(ac->avctx, "Remapped id too large\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
}
|
||||
// Try to sniff a reasonable channel order, otherwise output the
|
||||
// channels in the order the PCE declared them.
|
||||
@@ -2889,6 +2893,11 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
spectral_to_sample(ac, samples);
|
||||
|
||||
if (!ac->frame->data[0] && samples) {
|
||||
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
ac->frame->nb_samples = samples;
|
||||
ac->frame->sample_rate = avctx->sample_rate;
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
@@ -493,6 +493,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
int ms_mode = 0, is_mode = 0, tns_mode = 0, pred_mode = 0;
|
||||
int chan_el_counter[4];
|
||||
FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
|
||||
int k;
|
||||
|
||||
if (s->last_frame == 2)
|
||||
return 0;
|
||||
@@ -547,6 +548,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
ics->num_windows = wi[ch].num_windows;
|
||||
ics->swb_sizes = s->psy.bands [ics->num_windows == 8];
|
||||
ics->num_swb = tag == TYPE_LFE ? ics->num_swb : s->psy.num_bands[ics->num_windows == 8];
|
||||
ics->max_sfb = FFMIN(ics->max_sfb, ics->num_swb);
|
||||
ics->swb_offset = wi[ch].window_type[0] == EIGHT_SHORT_SEQUENCE ?
|
||||
ff_swb_offset_128 [s->samplerate_index]:
|
||||
ff_swb_offset_1024[s->samplerate_index];
|
||||
@@ -571,9 +573,12 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
}
|
||||
|
||||
apply_window_and_mdct(s, &cpe->ch[ch], overlap);
|
||||
if (isnan(cpe->ch->coeffs[0])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN\n");
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
for (k = 0; k < 1024; k++) {
|
||||
if (!(fabs(cpe->ch[ch].coeffs[k]) < 1E16)) { // Ensure headroom for energy calculation
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains (near) NaN/+-Inf\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
avoid_clipping(s, &cpe->ch[ch]);
|
||||
}
|
||||
|
||||
@@ -940,7 +940,7 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
LOCAL_ALIGNED_16(INTFLOAT, h_step, [2], [4]);
|
||||
int start = ps->border_position[e];
|
||||
int stop = ps->border_position[e+1];
|
||||
INTFLOAT width = Q30(1.f) / (stop - start);
|
||||
INTFLOAT width = Q30(1.f) / ((stop - start) ? (stop - start) : 1);
|
||||
#if USE_FIXED
|
||||
width <<= 1;
|
||||
#endif
|
||||
|
||||
@@ -169,6 +169,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
else
|
||||
temp1.mant = 0x20000000;
|
||||
temp1.exp = (temp1.exp >> 1) + 1;
|
||||
if (temp1.exp > 66) { // temp1 > 1E20
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
temp1 = FLOAT_1;
|
||||
}
|
||||
|
||||
temp2.exp = (pan_offset - sbr->data[1].env_facs[e][k].mant) * alpha;
|
||||
if (temp2.exp & 1)
|
||||
@@ -188,6 +192,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
temp1.exp = NOISE_FLOOR_OFFSET - \
|
||||
sbr->data[0].noise_facs[e][k].mant + 2;
|
||||
temp1.mant = 0x20000000;
|
||||
if (temp1.exp > 66) { // temp1 > 1E20
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
temp1 = FLOAT_1;
|
||||
}
|
||||
temp2.exp = 12 - sbr->data[1].noise_facs[e][k].mant + 1;
|
||||
temp2.mant = 0x20000000;
|
||||
fac = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2));
|
||||
@@ -208,7 +216,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
else
|
||||
temp1.mant = 0x20000000;
|
||||
temp1.exp = (temp1.exp >> 1) + 1;
|
||||
|
||||
if (temp1.exp > 66) { // temp1 > 1E20
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
temp1 = FLOAT_1;
|
||||
}
|
||||
sbr->data[ch].env_facs[e][k] = temp1;
|
||||
}
|
||||
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
|
||||
@@ -397,7 +408,8 @@ static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
|
||||
int delta = !((e == e_a[1]) || (e == e_a[0]));
|
||||
for (k = 0; k < sbr->n_lim; k++) {
|
||||
SoftFloat gain_boost, gain_max;
|
||||
SoftFloat sum[2] = { { 0, 0}, { 0, 0 } };
|
||||
SoftFloat sum[2];
|
||||
sum[0] = sum[1] = FLOAT_0;
|
||||
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
|
||||
const SoftFloat temp = av_div_sf(sbr->e_origmapped[e][m],
|
||||
av_add_sf(FLOAT_1, sbr->q_mapped[e][m]));
|
||||
|
||||
@@ -70,6 +70,7 @@ av_cold void AAC_RENAME(ff_aac_sbr_init)(void)
|
||||
/** Places SBR in pure upsampling mode. */
|
||||
static void sbr_turnoff(SpectralBandReplication *sbr) {
|
||||
sbr->start = 0;
|
||||
sbr->ready_for_dequant = 0;
|
||||
// Init defults used in pure upsampling mode
|
||||
sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
|
||||
sbr->m[1] = 0;
|
||||
@@ -177,6 +178,7 @@ static unsigned int read_sbr_header(SpectralBandReplication *sbr, GetBitContext
|
||||
SpectrumParameters old_spectrum_params;
|
||||
|
||||
sbr->start = 1;
|
||||
sbr->ready_for_dequant = 0;
|
||||
|
||||
// Save last spectrum parameters variables to compare to new ones
|
||||
memcpy(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters));
|
||||
@@ -716,8 +718,8 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
|
||||
}
|
||||
|
||||
for (i = 1; i <= ch_data->bs_num_env; i++) {
|
||||
if (ch_data->t_env[i-1] > ch_data->t_env[i]) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Non monotone time borders\n");
|
||||
if (ch_data->t_env[i-1] >= ch_data->t_env[i]) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Not strictly monotone time borders\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1032,6 +1034,7 @@ static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
|
||||
unsigned int cnt = get_bits_count(gb);
|
||||
|
||||
sbr->id_aac = id_aac;
|
||||
sbr->ready_for_dequant = 1;
|
||||
|
||||
if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
|
||||
if (read_sbr_single_channel_element(ac, sbr, gb)) {
|
||||
@@ -1151,6 +1154,9 @@ static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
|
||||
INTFLOAT z[320], INTFLOAT W[2][32][32][2], int buf_idx)
|
||||
{
|
||||
int i;
|
||||
#if USE_FIXED
|
||||
int j;
|
||||
#endif
|
||||
memcpy(x , x+1024, (320-32)*sizeof(x[0]));
|
||||
memcpy(x+288, in, 1024*sizeof(x[0]));
|
||||
for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
|
||||
@@ -1158,6 +1164,21 @@ static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
|
||||
dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
|
||||
sbrdsp->sum64x5(z);
|
||||
sbrdsp->qmf_pre_shuffle(z);
|
||||
#if USE_FIXED
|
||||
for (j = 64; j < 128; j++) {
|
||||
if (z[j] > 1<<24) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"sbr_qmf_analysis: value %09d too large, setting to %09d\n",
|
||||
z[j], 1<<24);
|
||||
z[j] = 1<<24;
|
||||
} else if (z[j] < -(1<<24)) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"sbr_qmf_analysis: value %09d too small, setting to %09d\n",
|
||||
z[j], -(1<<24));
|
||||
z[j] = -(1<<24);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
mdct->imdct_half(mdct, z, z+64);
|
||||
sbrdsp->qmf_post_shuffle(W[buf_idx][i], z);
|
||||
x += 32;
|
||||
@@ -1412,7 +1433,7 @@ static void sbr_env_estimate(AAC_FLOAT (*e_curr)[48], INTFLOAT X_high[64][40][2]
|
||||
|
||||
for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) {
|
||||
#if USE_FIXED
|
||||
SoftFloat sum = { 0, 0 };
|
||||
SoftFloat sum = FLOAT_0;
|
||||
const SoftFloat den = av_int2sf(0x20000000 / (env_size * (table[p + 1] - table[p])), 29);
|
||||
for (k = table[p]; k < table[p + 1]; k++) {
|
||||
sum = av_add_sf(sum, sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb));
|
||||
@@ -1449,6 +1470,12 @@ void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int
|
||||
sbr_turnoff(sbr);
|
||||
}
|
||||
|
||||
if (sbr->start && !sbr->ready_for_dequant) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"No quantized data read for sbr_dequant.\n");
|
||||
sbr_turnoff(sbr);
|
||||
}
|
||||
|
||||
if (!sbr->kx_and_m_pushed) {
|
||||
sbr->kx[0] = sbr->kx[1];
|
||||
sbr->m[0] = sbr->m[1];
|
||||
@@ -1458,6 +1485,7 @@ void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int
|
||||
|
||||
if (sbr->start) {
|
||||
sbr_dequant(sbr, id_aac);
|
||||
sbr->ready_for_dequant = 0;
|
||||
}
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* decode channel */
|
||||
|
||||
@@ -901,11 +901,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
ff_eac3_default_spx_band_struct,
|
||||
&s->num_spx_bands,
|
||||
s->spx_band_sizes);
|
||||
} else {
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!s->eac3 || !s->spx_in_use) {
|
||||
s->spx_in_use = 0;
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -765,8 +765,13 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
|
||||
bd->ltp_gain[0] = decode_rice(gb, 1) << 3;
|
||||
bd->ltp_gain[1] = decode_rice(gb, 2) << 3;
|
||||
|
||||
r = get_unary(gb, 0, 3);
|
||||
r = get_unary(gb, 0, 4);
|
||||
c = get_bits(gb, 2);
|
||||
if (r >= 4) {
|
||||
av_log(avctx, AV_LOG_ERROR, "r overflow\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
bd->ltp_gain[2] = ltp_gain_values[r][c];
|
||||
|
||||
bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
|
||||
|
||||
@@ -94,6 +94,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else if (avctx->width % FONT_WIDTH || avctx->height % s->font_height) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid dimensions %d %d\n", avctx->width, avctx->height);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -892,6 +892,9 @@ static void long_filter_high_3800(int32_t *buffer, int order, int shift, int len
|
||||
int32_t dotprod, sign;
|
||||
int32_t coeffs[256], delay[256];
|
||||
|
||||
if (order >= length)
|
||||
return;
|
||||
|
||||
memset(coeffs, 0, order * sizeof(*coeffs));
|
||||
for (i = 0; i < order; i++)
|
||||
delay[i] = buffer[i];
|
||||
@@ -1369,7 +1372,7 @@ static void ape_unpack_stereo(APEContext *ctx, int count)
|
||||
int32_t *decoded0 = ctx->decoded[0];
|
||||
int32_t *decoded1 = ctx->decoded[1];
|
||||
|
||||
if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
|
||||
if ((ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) == APE_FRAMECODE_STEREO_SILENCE) {
|
||||
/* We are pure silence, so we're done. */
|
||||
av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence stereo\n");
|
||||
return;
|
||||
|
||||
@@ -525,7 +525,7 @@ ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style)
|
||||
if (!style || !*style)
|
||||
style = "Default";
|
||||
for (i=0; i<ass->styles_count; i++)
|
||||
if (!strcmp(ass->styles[i].name, style))
|
||||
if (ass->styles[i].name && !strcmp(ass->styles[i].name, style))
|
||||
return ass->styles + i;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ static inline void asv2_put_level(ASV1Context *a, PutBitContext *pb, int level)
|
||||
} else {
|
||||
put_bits(pb, ff_asv2_level_tab[31][1], ff_asv2_level_tab[31][0]);
|
||||
if (level < -128 || level > 127) {
|
||||
av_log(a->avctx, AV_LOG_WARNING, "Cliping level %d, increase qscale\n", level);
|
||||
av_log(a->avctx, AV_LOG_WARNING, "Clipping level %d, increase qscale\n", level);
|
||||
level = av_clip_int8(level);
|
||||
}
|
||||
asv2_put_bits(pb, 8, level & 0xFF);
|
||||
|
||||
@@ -58,6 +58,7 @@ void av_init_packet(AVPacket *pkt)
|
||||
#if FF_API_DESTRUCT_PACKET
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
pkt->destruct = NULL;
|
||||
pkt->priv = NULL;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
pkt->buf = NULL;
|
||||
@@ -194,6 +195,7 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
|
||||
{
|
||||
pkt->data = NULL;
|
||||
pkt->side_data = NULL;
|
||||
pkt->side_data_elems = 0;
|
||||
if (pkt->buf) {
|
||||
AVBufferRef *ref = av_buffer_ref(src->buf);
|
||||
if (!ref)
|
||||
@@ -208,9 +210,11 @@ FF_DISABLE_DEPRECATION_WARNINGS
|
||||
pkt->destruct = dummy_destruct_packet;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
if (pkt->side_data_elems && dup)
|
||||
if (src->side_data_elems && dup) {
|
||||
pkt->side_data = src->side_data;
|
||||
if (pkt->side_data_elems && !dup) {
|
||||
pkt->side_data_elems = src->side_data_elems;
|
||||
}
|
||||
if (src->side_data_elems && !dup) {
|
||||
return av_copy_packet_side_data(pkt, src);
|
||||
}
|
||||
return 0;
|
||||
@@ -410,10 +414,12 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p = pkt->data + pkt->size - 8 - 5;
|
||||
for (i=1; ; i++){
|
||||
size = AV_RB32(p);
|
||||
if (size>INT_MAX || p - pkt->data < size)
|
||||
if (size>INT_MAX - 5 || p - pkt->data < size)
|
||||
return 0;
|
||||
if (p[4]&128)
|
||||
break;
|
||||
if (p - pkt->data < size + 5)
|
||||
return 0;
|
||||
p-= size+5;
|
||||
}
|
||||
|
||||
@@ -424,7 +430,7 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p= pkt->data + pkt->size - 8 - 5;
|
||||
for (i=0; ; i++){
|
||||
size= AV_RB32(p);
|
||||
av_assert0(size<=INT_MAX && p - pkt->data >= size);
|
||||
av_assert0(size<=INT_MAX - 5 && p - pkt->data >= size);
|
||||
pkt->side_data[i].data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
pkt->side_data[i].size = size;
|
||||
pkt->side_data[i].type = p[4]&127;
|
||||
|
||||
@@ -113,7 +113,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
int shift = p->height - avctx->height;
|
||||
int subsample_h, subsample_v;
|
||||
|
||||
av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &subsample_h, &subsample_v);
|
||||
av_pix_fmt_get_chroma_sub_sample(p->format, &subsample_h, &subsample_v);
|
||||
|
||||
p->data[0] += p->linesize[0] * shift;
|
||||
if (p->data[2]) {
|
||||
|
||||
@@ -53,7 +53,8 @@ restart:
|
||||
if (bpc->pc.frame_start_found == 0) {
|
||||
if ((state >> 48) == (('B' << 8) | 'M')) {
|
||||
bpc->fsize = av_bswap32(state >> 16);
|
||||
bpc->pc.frame_start_found = 1;
|
||||
if (bpc->fsize > 17)
|
||||
bpc->pc.frame_start_found = 1;
|
||||
}
|
||||
} else if (bpc->pc.frame_start_found == 2+4+4) {
|
||||
// unsigned hsize = av_bswap32(state>>32);
|
||||
@@ -67,8 +68,12 @@ restart:
|
||||
|
||||
if (bpc->pc.index + i > 17) {
|
||||
next = i - 17;
|
||||
} else
|
||||
state = 0;
|
||||
break;
|
||||
} else {
|
||||
bpc->pc.state64 = 0;
|
||||
goto restart;
|
||||
}
|
||||
} else if (bpc->pc.frame_start_found)
|
||||
bpc->pc.frame_start_found++;
|
||||
}
|
||||
@@ -89,7 +94,10 @@ flush:
|
||||
if (ff_combine_frame(&bpc->pc, next, &buf, &buf_size) < 0)
|
||||
return buf_size;
|
||||
|
||||
bpc->pc.frame_start_found = 0;
|
||||
if (next != END_NOT_FOUND && next < 0)
|
||||
bpc->pc.frame_start_found = FFMAX(bpc->pc.frame_start_found - i - 1, 0);
|
||||
else
|
||||
bpc->pc.frame_start_found = 0;
|
||||
|
||||
*poutbuf = buf;
|
||||
*poutbuf_size = buf_size;
|
||||
|
||||
@@ -51,7 +51,7 @@ void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size){
|
||||
*
|
||||
* @param buf_size size of buf in bits
|
||||
*/
|
||||
void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
c->bytestream_start=
|
||||
c->bytestream= buf;
|
||||
c->bytestream_end= buf + buf_size;
|
||||
@@ -64,6 +64,9 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
#endif
|
||||
c->low+= ((*c->bytestream++)<<2) + 2;
|
||||
c->range= 0x1FE;
|
||||
if ((c->range<<(CABAC_BITS+1)) < c->low)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ff_init_cabac_states(void)
|
||||
|
||||
@@ -56,7 +56,7 @@ typedef struct CABACContext{
|
||||
}CABACContext;
|
||||
|
||||
void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size);
|
||||
void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
|
||||
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
|
||||
void ff_init_cabac_states(void);
|
||||
|
||||
#endif /* AVCODEC_CABAC_H */
|
||||
|
||||
@@ -74,7 +74,8 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
|
||||
|
||||
#ifndef get_cabac_inline
|
||||
static void refill2(CABACContext *c){
|
||||
int i, x;
|
||||
int i;
|
||||
unsigned x;
|
||||
|
||||
x= c->low ^ (c->low-1);
|
||||
i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)];
|
||||
@@ -190,7 +191,8 @@ static av_unused const uint8_t* skip_bytes(CABACContext *c, int n) {
|
||||
#endif
|
||||
if ((int) (c->bytestream_end - ptr) < n)
|
||||
return NULL;
|
||||
ff_init_cabac_decoder(c, ptr + n, c->bytestream_end - ptr - n);
|
||||
if (ff_init_cabac_decoder(c, ptr + n, c->bytestream_end - ptr - n) < 0)
|
||||
return NULL;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@@ -1218,6 +1218,8 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
h->got_keyframe = 1;
|
||||
}
|
||||
case PIC_PB_START_CODE:
|
||||
if (*got_frame)
|
||||
av_frame_unref(data);
|
||||
*got_frame = 0;
|
||||
if (!h->got_keyframe)
|
||||
break;
|
||||
|
||||
@@ -188,7 +188,6 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc
|
||||
static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
|
||||
int i;
|
||||
int16_t (*src)[8] = (int16_t(*)[8])block;
|
||||
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
|
||||
|
||||
src[0][0] += 8;
|
||||
|
||||
@@ -243,14 +242,14 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
|
||||
const int b2 = a5 - a7;
|
||||
const int b3 = a4 - a6;
|
||||
|
||||
dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((b0 + b4) >> 7)];
|
||||
dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((b1 + b5) >> 7)];
|
||||
dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((b2 + b6) >> 7)];
|
||||
dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((b3 + b7) >> 7)];
|
||||
dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((b3 - b7) >> 7)];
|
||||
dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b2 - b6) >> 7)];
|
||||
dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b1 - b5) >> 7)];
|
||||
dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b4) >> 7)];
|
||||
dst[i + 0*stride] = av_clip_uint8( dst[i + 0*stride] + ((b0 + b4) >> 7));
|
||||
dst[i + 1*stride] = av_clip_uint8( dst[i + 1*stride] + ((b1 + b5) >> 7));
|
||||
dst[i + 2*stride] = av_clip_uint8( dst[i + 2*stride] + ((b2 + b6) >> 7));
|
||||
dst[i + 3*stride] = av_clip_uint8( dst[i + 3*stride] + ((b3 + b7) >> 7));
|
||||
dst[i + 4*stride] = av_clip_uint8( dst[i + 4*stride] + ((b3 - b7) >> 7));
|
||||
dst[i + 5*stride] = av_clip_uint8( dst[i + 5*stride] + ((b2 - b6) >> 7));
|
||||
dst[i + 6*stride] = av_clip_uint8( dst[i + 6*stride] + ((b1 - b5) >> 7));
|
||||
dst[i + 7*stride] = av_clip_uint8( dst[i + 7*stride] + ((b0 - b4) >> 7));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,8 @@ typedef struct CCaptionSubContext {
|
||||
int64_t end_time;
|
||||
char prev_cmd[2];
|
||||
/* buffer to store pkt data */
|
||||
AVBufferRef *pktbuf;
|
||||
uint8_t *pktbuf;
|
||||
int pktbuf_size;
|
||||
}CCaptionSubContext;
|
||||
|
||||
|
||||
@@ -185,11 +186,7 @@ static av_cold int init_decoder(AVCodecContext *avctx)
|
||||
if(ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
/* allocate pkt buffer */
|
||||
ctx->pktbuf = av_buffer_alloc(128);
|
||||
if( !ctx->pktbuf) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -197,7 +194,8 @@ static av_cold int close_decoder(AVCodecContext *avctx)
|
||||
{
|
||||
CCaptionSubContext *ctx = avctx->priv_data;
|
||||
av_bprint_finalize( &ctx->buffer, NULL);
|
||||
av_buffer_unref(&ctx->pktbuf);
|
||||
av_freep(&ctx->pktbuf);
|
||||
ctx->pktbuf_size = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -529,16 +527,13 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
if ( ctx->pktbuf->size < len) {
|
||||
ret = av_buffer_realloc(&ctx->pktbuf, len);
|
||||
if(ret < 0) {
|
||||
av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated to %d\n",len, ctx->pktbuf->size);
|
||||
len = ctx->pktbuf->size;
|
||||
ret = 0;
|
||||
}
|
||||
av_fast_padded_malloc(&ctx->pktbuf, &ctx->pktbuf_size, len);
|
||||
if (!ctx->pktbuf) {
|
||||
av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated to %d\n", len, ctx->pktbuf_size);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(ctx->pktbuf->data, avpkt->data, len);
|
||||
bptr = ctx->pktbuf->data;
|
||||
memcpy(ctx->pktbuf, avpkt->data, len);
|
||||
bptr = ctx->pktbuf;
|
||||
|
||||
|
||||
for (i = 0; i < len; i += 3) {
|
||||
|
||||
@@ -443,10 +443,13 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
|
||||
if (s->palette_video) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
if (pal) {
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
s->frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,6 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
|
||||
{
|
||||
uint32_t mrk;
|
||||
int i, tmp;
|
||||
const uint16_t *ssrc = (const uint16_t *) src;
|
||||
uint16_t *sdst = (uint16_t *) dst;
|
||||
PutBitContext pb;
|
||||
|
||||
if ((unsigned) src_size > (unsigned) max_size)
|
||||
@@ -54,8 +52,11 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
|
||||
memcpy(dst, src, src_size);
|
||||
return src_size;
|
||||
case DCA_SYNCWORD_CORE_LE:
|
||||
for (i = 0; i < (src_size + 1) >> 1; i++)
|
||||
*sdst++ = av_bswap16(*ssrc++);
|
||||
for (i = 0; i < (src_size + 1) >> 1; i++) {
|
||||
AV_WB16(dst, AV_RL16(src));
|
||||
src += 2;
|
||||
dst += 2;
|
||||
}
|
||||
return src_size;
|
||||
case DCA_SYNCWORD_CORE_14B_BE:
|
||||
case DCA_SYNCWORD_CORE_14B_LE:
|
||||
|
||||
@@ -141,6 +141,12 @@ static int parse_pixel_format(AVCodecContext *avctx)
|
||||
normal_map = flags & DDPF_NORMALMAP;
|
||||
fourcc = bytestream2_get_le32(gbc);
|
||||
|
||||
if (ctx->compressed && ctx->paletted) {
|
||||
av_log(avctx, AV_LOG_WARNING,
|
||||
"Disabling invalid palette flag for compressed dds.\n");
|
||||
ctx->paletted = 0;
|
||||
}
|
||||
|
||||
bpp = bytestream2_get_le32(gbc); // rgbbitcount
|
||||
r = bytestream2_get_le32(gbc); // rbitmask
|
||||
g = bytestream2_get_le32(gbc); // gbitmask
|
||||
@@ -642,9 +648,18 @@ static int dds_decode(AVCodecContext *avctx, void *data,
|
||||
return ret;
|
||||
|
||||
if (ctx->compressed) {
|
||||
int size = (avctx->coded_height / TEXTURE_BLOCK_H) *
|
||||
(avctx->coded_width / TEXTURE_BLOCK_W) * ctx->tex_ratio;
|
||||
ctx->slice_count = av_clip(avctx->thread_count, 1,
|
||||
avctx->coded_height / TEXTURE_BLOCK_H);
|
||||
|
||||
if (bytestream2_get_bytes_left(gbc) < size) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Compressed Buffer is too small (%d < %d).\n",
|
||||
bytestream2_get_bytes_left(gbc), size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* Use the decompress function on the texture, one block per thread. */
|
||||
ctx->tex_data = gbc->buffer;
|
||||
avctx->execute2(avctx, decompress_texture_thread, frame, NULL, ctx->slice_count);
|
||||
@@ -666,6 +681,12 @@ static int dds_decode(AVCodecContext *avctx, void *data,
|
||||
frame->palette_has_changed = 1;
|
||||
}
|
||||
|
||||
if (bytestream2_get_bytes_left(gbc) < frame->height * linesize) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Buffer is too small (%d < %d).\n",
|
||||
bytestream2_get_bytes_left(gbc), frame->height * linesize);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
av_image_copy_plane(frame->data[0], frame->linesize[0],
|
||||
gbc->buffer, linesize,
|
||||
linesize, frame->height);
|
||||
|
||||
@@ -100,10 +100,12 @@ typedef struct DiracParseUnit {
|
||||
static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
|
||||
int offset)
|
||||
{
|
||||
uint8_t *start = pc->buffer + offset;
|
||||
uint8_t *end = pc->buffer + pc->index;
|
||||
if (start < pc->buffer || (start + 13 > end))
|
||||
int8_t *start;
|
||||
|
||||
if (offset < 0 || pc->index - 13 < offset)
|
||||
return 0;
|
||||
|
||||
start = pc->buffer + offset;
|
||||
pu->pu_type = start[4];
|
||||
|
||||
pu->next_pu_offset = AV_RB32(start + 5);
|
||||
@@ -112,6 +114,15 @@ static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
|
||||
if (pu->pu_type == 0x10 && pu->next_pu_offset == 0)
|
||||
pu->next_pu_offset = 13;
|
||||
|
||||
if (pu->next_pu_offset && pu->next_pu_offset < 13) {
|
||||
av_log(NULL, AV_LOG_ERROR, "next_pu_offset %d is invalid\n", pu->next_pu_offset);
|
||||
return 0;
|
||||
}
|
||||
if (pu->prev_pu_offset && pu->prev_pu_offset < 13) {
|
||||
av_log(NULL, AV_LOG_ERROR, "prev_pu_offset %d is invalid\n", pu->prev_pu_offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -123,7 +134,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
DiracParseContext *pc = s->priv_data;
|
||||
|
||||
if (pc->overread_index) {
|
||||
memcpy(pc->buffer, pc->buffer + pc->overread_index,
|
||||
memmove(pc->buffer, pc->buffer + pc->overread_index,
|
||||
pc->index - pc->overread_index);
|
||||
pc->index -= pc->overread_index;
|
||||
pc->overread_index = 0;
|
||||
@@ -190,7 +201,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
/* Get the picture number to set the pts and dts*/
|
||||
if (parse_timing_info) {
|
||||
if (parse_timing_info && pu1.prev_pu_offset >= 13) {
|
||||
uint8_t *cur_pu = pc->buffer +
|
||||
pc->index - 13 - pu1.prev_pu_offset;
|
||||
int pts = AV_RB32(cur_pu + 13);
|
||||
|
||||
@@ -1031,6 +1031,13 @@ static int dirac_unpack_idwt_params(DiracContext *s)
|
||||
/*[DIRAC_STD] 11.3.4 Slice coding Parameters (low delay syntax only). slice_parameters() */
|
||||
s->lowdelay.num_x = svq3_get_ue_golomb(gb);
|
||||
s->lowdelay.num_y = svq3_get_ue_golomb(gb);
|
||||
if (s->lowdelay.num_x * s->lowdelay.num_y == 0 ||
|
||||
s->lowdelay.num_x * (uint64_t)s->lowdelay.num_y > INT_MAX) {
|
||||
av_log(s->avctx,AV_LOG_ERROR,"Invalid numx/y\n");
|
||||
s->lowdelay.num_x = s->lowdelay.num_y = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->lowdelay.bytes.num = svq3_get_ue_golomb(gb);
|
||||
s->lowdelay.bytes.den = svq3_get_ue_golomb(gb);
|
||||
|
||||
@@ -1760,7 +1767,9 @@ static int dirac_decode_picture_header(DiracContext *s)
|
||||
for (j = 0; j < MAX_FRAMES; j++)
|
||||
if (!s->all_frames[j].avframe->data[0]) {
|
||||
s->ref_pics[i] = &s->all_frames[j];
|
||||
get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
|
||||
ret = get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ static const uint8_t dnxhd_1235_chroma_weight[] = {
|
||||
90, 90, 85, 79, 73, 73, 73, 73,
|
||||
};
|
||||
|
||||
/* Used in CID 1237, 1253 */
|
||||
/* Used in CID 1237, 1253, 1259 */
|
||||
static const uint8_t dnxhd_1237_luma_weight[] = {
|
||||
0, 32, 33, 34, 34, 36, 37, 36,
|
||||
36, 37, 38, 38, 38, 39, 41, 44,
|
||||
@@ -60,7 +60,7 @@ static const uint8_t dnxhd_1237_luma_weight[] = {
|
||||
97, 100, 104, 102, 98, 98, 99, 99,
|
||||
};
|
||||
|
||||
/* Used in CID 1237, 1253 */
|
||||
/* Used in CID 1237, 1253, 1259 */
|
||||
static const uint8_t dnxhd_1237_chroma_weight[] = {
|
||||
0, 32, 36, 39, 39, 38, 39, 41,
|
||||
45, 51, 57, 58, 53, 48, 47, 51,
|
||||
@@ -204,6 +204,7 @@ static const uint8_t dnxhd_1251_chroma_weight[] = {
|
||||
61, 59, 59, 59, 61, 62, 62, 62,
|
||||
};
|
||||
|
||||
/* Used in CID 1252, 1258 */
|
||||
static const uint8_t dnxhd_1252_luma_weight[] = {
|
||||
0, 32, 34, 35, 36, 36, 36, 37,
|
||||
36, 37, 39, 40, 41, 40, 40, 40,
|
||||
@@ -214,6 +215,8 @@ static const uint8_t dnxhd_1252_luma_weight[] = {
|
||||
71, 82, 90, 90, 88, 87, 90, 95,
|
||||
100, 107, 103, 97, 95, 93, 99, 99,
|
||||
};
|
||||
|
||||
/* Used in CID 1252, 1258 */
|
||||
static const uint8_t dnxhd_1252_chroma_weight[] = {
|
||||
0, 32, 35, 36, 37, 37, 38, 40,
|
||||
42, 46, 49, 50, 50, 49, 49, 53,
|
||||
@@ -226,80 +229,36 @@ static const uint8_t dnxhd_1252_chroma_weight[] = {
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1256_chroma_weight[] = {
|
||||
0, 32, 32, 32, 32, 32, 32, 33,
|
||||
32, 32, 32, 32, 32, 32, 32, 34,
|
||||
32, 32, 32, 32, 32, 32, 33, 37,
|
||||
32, 32, 32, 32, 32, 32, 36, 39,
|
||||
32, 32, 32, 32, 32, 34, 39, 44,
|
||||
32, 37, 32, 32, 35, 40, 43, 49,
|
||||
32, 33, 36, 36, 40, 43, 50, 60,
|
||||
34, 37, 39, 44, 51, 56, 61, 70,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1258_luma_weight[] = {
|
||||
0, 32, 36, 36, 40, 40, 55, 60,
|
||||
34, 36, 37, 40, 41, 48, 57, 82,
|
||||
35, 36, 41, 41, 46, 52, 73, 82,
|
||||
37, 40, 42, 45, 50, 65, 80, 87,
|
||||
39, 41, 44, 49, 62, 78, 88, 90,
|
||||
41, 44, 49, 58, 73, 90, 95, 95,
|
||||
43, 52, 55, 68, 90, 100, 97, 93,
|
||||
52, 53, 71, 82, 107, 103, 99, 99,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1258_chroma_weight[] = {
|
||||
0, 32, 37, 38, 49, 53, 65, 66,
|
||||
35, 37, 40, 49, 56, 64, 65, 82,
|
||||
36, 42, 50, 56, 64, 67, 73, 85,
|
||||
46, 50, 57, 63, 71, 72, 89, 87,
|
||||
49, 58, 65, 72, 78, 88, 88, 90,
|
||||
60, 64, 74, 81, 84, 90, 95, 134,
|
||||
62, 74, 77, 80, 90, 114, 129, 125,
|
||||
74, 74, 90, 100, 128, 125, 116, 116,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1259_luma_weight[] = {
|
||||
0, 32, 36, 37, 41, 44, 54, 60,
|
||||
33, 34, 36, 39, 43, 51, 62, 78,
|
||||
34, 36, 38, 41, 49, 59, 73, 79,
|
||||
37, 38, 40, 47, 55, 66, 80, 95,
|
||||
38, 41, 46, 54, 63, 79, 93, 96,
|
||||
46, 47, 56, 64, 78, 90, 97, 98,
|
||||
49, 58, 66, 78, 89, 97, 102, 98,
|
||||
61, 65, 82, 87, 100, 104, 99, 99,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1259_chroma_weight[] = {
|
||||
0, 32, 38, 39, 47, 51, 77, 83,
|
||||
36, 39, 41, 48, 55, 74, 85, 95,
|
||||
39, 45, 53, 58, 72, 83, 105, 89,
|
||||
51, 58, 66, 73, 82, 109, 92, 95,
|
||||
57, 75, 78, 89, 105, 95, 93, 96,
|
||||
81, 82, 99, 99, 94, 90, 97, 98,
|
||||
83, 96, 97, 93, 89, 97, 102, 98,
|
||||
90, 94, 92, 88, 100, 104, 99, 99,
|
||||
0, 32, 32, 32, 32, 32, 32, 32,
|
||||
32, 32, 32, 32, 32, 32, 32, 32,
|
||||
32, 32, 32, 32, 32, 32, 37, 32,
|
||||
32, 32, 32, 32, 33, 32, 32, 32,
|
||||
32, 32, 33, 34, 37, 36, 32, 32,
|
||||
32, 33, 34, 37, 36, 34, 35, 36,
|
||||
39, 44, 40, 40, 39, 39, 44, 43,
|
||||
43, 51, 56, 50, 49, 60, 61, 70,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1260_luma_weight[] = {
|
||||
0, 32, 37, 37, 40, 41, 52, 53,
|
||||
33, 36, 36, 38, 40, 48, 49, 52,
|
||||
34, 34, 37, 39, 44, 47, 49, 54,
|
||||
33, 35, 38, 40, 45, 46, 54, 51,
|
||||
34, 37, 37, 42, 44, 49, 52, 48,
|
||||
34, 34, 38, 43, 44, 51, 50, 50,
|
||||
33, 36, 41, 44, 51, 52, 50, 54,
|
||||
36, 38, 44, 47, 53, 53, 54, 54,
|
||||
0, 32, 33, 34, 36, 37, 37, 36,
|
||||
34, 33, 34, 35, 37, 38, 40, 41,
|
||||
40, 39, 38, 37, 34, 33, 34, 37,
|
||||
40, 44, 48, 52, 53, 49, 47, 45,
|
||||
42, 38, 36, 36, 38, 41, 43, 44,
|
||||
46, 49, 52, 54, 54, 49, 44, 44,
|
||||
44, 47, 51, 51, 52, 51, 48, 50,
|
||||
52, 53, 53, 50, 50, 54, 54, 54,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1260_chroma_weight[] = {
|
||||
0, 32, 40, 38, 42, 40, 45, 45,
|
||||
34, 42, 36, 43, 38, 46, 46, 49,
|
||||
38, 35, 43, 39, 44, 47, 47, 49,
|
||||
35, 42, 43, 42, 46, 47, 49, 52,
|
||||
38, 43, 43, 44, 50, 49, 56, 50,
|
||||
42, 43, 44, 50, 51, 57, 52, 53,
|
||||
41, 45, 46, 53, 53, 56, 53, 54,
|
||||
46, 46, 51, 49, 56, 53, 58, 58,
|
||||
0, 32, 34, 38, 42, 40, 38, 36,
|
||||
35, 35, 38, 42, 43, 43, 42, 40,
|
||||
38, 39, 43, 43, 42, 41, 43, 43,
|
||||
42, 44, 46, 45, 45, 46, 47, 46,
|
||||
44, 44, 45, 46, 46, 46, 50, 50,
|
||||
47, 47, 49, 49, 49, 49, 51, 53,
|
||||
51, 49, 53, 57, 56, 52, 50, 52,
|
||||
56, 56, 53, 53, 53, 54, 58, 58,
|
||||
};
|
||||
|
||||
/* Used in CID 1235, 1241, 1250, 1256 */
|
||||
@@ -1090,14 +1049,14 @@ const CIDEntry ff_dnxhd_cid_table[] = {
|
||||
{ 350, 390, 440, 730, 880 },
|
||||
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
|
||||
{ 1258, 960, 720, 0, 212992, 212992, 4, 8, 5,
|
||||
dnxhd_1258_luma_weight, dnxhd_1258_chroma_weight,
|
||||
dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight,
|
||||
dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
|
||||
dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
|
||||
dnxhd_1252_ac_flags,
|
||||
dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
|
||||
{ 42, 60, 75, 115 } },
|
||||
{ 1259, 1440, 1080, 0, 417792, 417792, 4, 8, 3,
|
||||
dnxhd_1259_luma_weight, dnxhd_1259_chroma_weight,
|
||||
dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
|
||||
dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
|
||||
dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
|
||||
dnxhd_1237_ac_flags,
|
||||
|
||||
@@ -349,7 +349,12 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
uint8_t *dest_y, *dest_u, *dest_v;
|
||||
int dct_y_offset, dct_x_offset;
|
||||
int qscale, i;
|
||||
int interlaced_mb = 0;
|
||||
|
||||
if (ctx->cid_table->cid == 1260) {
|
||||
interlaced_mb = get_bits1(&ctx->gb);
|
||||
qscale = get_bits(&ctx->gb, 10);
|
||||
} else
|
||||
qscale = get_bits(&ctx->gb, 11);
|
||||
skip_bits1(&ctx->gb);
|
||||
|
||||
@@ -386,8 +391,12 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
dest_u += frame->linesize[1];
|
||||
dest_v += frame->linesize[2];
|
||||
}
|
||||
if (interlaced_mb) {
|
||||
dct_linesize_luma <<= 1;
|
||||
dct_linesize_chroma <<= 1;
|
||||
}
|
||||
|
||||
dct_y_offset = dct_linesize_luma << 3;
|
||||
dct_y_offset = interlaced_mb ? frame->linesize[0] : (dct_linesize_luma << 3);
|
||||
dct_x_offset = 8 << shift1;
|
||||
if (!ctx->is_444) {
|
||||
ctx->idsp.idct_put(dest_y, dct_linesize_luma, ctx->blocks[0]);
|
||||
@@ -396,7 +405,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]);
|
||||
|
||||
if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
|
||||
dct_y_offset = dct_linesize_chroma << 3;
|
||||
dct_y_offset = interlaced_mb ? frame->linesize[1] : (dct_linesize_chroma << 3);
|
||||
ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
|
||||
ctx->idsp.idct_put(dest_v, dct_linesize_chroma, ctx->blocks[3]);
|
||||
ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[6]);
|
||||
@@ -409,7 +418,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[7]);
|
||||
|
||||
if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
|
||||
dct_y_offset = dct_linesize_chroma << 3;
|
||||
dct_y_offset = interlaced_mb ? frame->linesize[1] : (dct_linesize_chroma << 3);
|
||||
ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
|
||||
ctx->idsp.idct_put(dest_u + dct_x_offset, dct_linesize_chroma, ctx->blocks[3]);
|
||||
ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[8]);
|
||||
|
||||
@@ -348,11 +348,11 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
// For 12 bit, ignore alpha
|
||||
if (elements == 4)
|
||||
buf += 2;
|
||||
// Jump to next aligned position
|
||||
buf += need_align;
|
||||
}
|
||||
for (i = 0; i < 3; i++)
|
||||
ptr[i] += p->linesize[i];
|
||||
// Jump to next aligned position
|
||||
buf += need_align;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
|
||||
@@ -810,7 +810,7 @@ static void compute_default_clut(AVPicture *frame, int w, int h)
|
||||
list_inv[ i ] = bestv;
|
||||
}
|
||||
|
||||
count = i - 1;
|
||||
count = FFMAX(i - 1, 1);
|
||||
for (i--; i>=0; i--) {
|
||||
int v = i*255/count;
|
||||
AV_WN32(frame->data[1] + 4*list_inv[i], RGBA(v/2,v,v/2,v));
|
||||
|
||||
@@ -347,7 +347,7 @@ retry:
|
||||
dct_mode * 22 * 64 +
|
||||
(quant + ff_dv_quant_offset[class1]) * 64];
|
||||
}
|
||||
dc = dc << 2;
|
||||
dc = dc * 4;
|
||||
/* convert to unsigned because 128 is not added in the
|
||||
* standard IDCT */
|
||||
dc += 1024;
|
||||
|
||||
@@ -185,7 +185,7 @@ static void guess_palette(DVDSubContext* ctx,
|
||||
for(i = 0; i < 4; i++) {
|
||||
if (alpha[i] != 0) {
|
||||
if (!color_used[colormap[i]]) {
|
||||
level = level_map[nb_opaque_colors][j];
|
||||
level = level_map[nb_opaque_colors - 1][j];
|
||||
r = (((subtitle_color >> 16) & 0xff) * level) >> 8;
|
||||
g = (((subtitle_color >> 8) & 0xff) * level) >> 8;
|
||||
b = (((subtitle_color >> 0) & 0xff) * level) >> 8;
|
||||
@@ -346,7 +346,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
||||
}
|
||||
}
|
||||
the_end:
|
||||
if (offset1 >= 0) {
|
||||
if (offset1 >= 0 && offset2 >= 0) {
|
||||
int w, h;
|
||||
uint8_t *bitmap;
|
||||
|
||||
@@ -516,7 +516,8 @@ static int append_to_cached_buf(AVCodecContext *avctx,
|
||||
{
|
||||
DVDSubContext *ctx = avctx->priv_data;
|
||||
|
||||
if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
|
||||
av_assert0(buf_size >= 0 && ctx->buf_size <= sizeof(ctx->buf));
|
||||
if (buf_size >= sizeof(ctx->buf) - ctx->buf_size) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
|
||||
"too large SPU packets aborted.\n");
|
||||
ctx->buf_size = 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < avctx->width * avctx->height * 9LL / 8) {
|
||||
if (src_size < FFALIGN(avctx->width, 4) * FFALIGN(avctx->height, 4) * 9LL / 8) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y1, *Y2, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < avctx->width * avctx->height * 3LL / 2) {
|
||||
if (src_size < FFALIGN(avctx->width, 2) * FFALIGN(avctx->height, 2) * 3LL / 2) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -381,14 +381,19 @@ static void guess_mv(ERContext *s)
|
||||
#define MV_UNCHANGED 1
|
||||
const int mb_stride = s->mb_stride;
|
||||
const int mb_width = s->mb_width;
|
||||
const int mb_height = s->mb_height;
|
||||
int mb_height = s->mb_height;
|
||||
int i, depth, num_avail;
|
||||
int mb_x, mb_y, mot_step, mot_stride;
|
||||
|
||||
if (s->last_pic.f && s->last_pic.f->data[0])
|
||||
mb_height = FFMIN(mb_height, (s->last_pic.f->height+15)>>4);
|
||||
if (s->next_pic.f && s->next_pic.f->data[0])
|
||||
mb_height = FFMIN(mb_height, (s->next_pic.f->height+15)>>4);
|
||||
|
||||
set_mv_strides(s, &mot_step, &mot_stride);
|
||||
|
||||
num_avail = 0;
|
||||
for (i = 0; i < s->mb_num; i++) {
|
||||
for (i = 0; i < mb_width * mb_height; i++) {
|
||||
const int mb_xy = s->mb_index2xy[i];
|
||||
int f = 0;
|
||||
int error = s->error_status_table[mb_xy];
|
||||
@@ -413,7 +418,7 @@ static void guess_mv(ERContext *s)
|
||||
|
||||
if ((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) ||
|
||||
num_avail <= mb_width / 2) {
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
const int mb_xy = mb_x + mb_y * s->mb_stride;
|
||||
int mv_dir = (s->last_pic.f && s->last_pic.f->data[0]) ? MV_DIR_FORWARD : MV_DIR_BACKWARD;
|
||||
@@ -442,7 +447,7 @@ static void guess_mv(ERContext *s)
|
||||
int score_sum = 0;
|
||||
|
||||
changed = 0;
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
const int mb_xy = mb_x + mb_y * s->mb_stride;
|
||||
int mv_predictor[8][2] = { { 0 } };
|
||||
@@ -675,7 +680,7 @@ skip_last_mv:
|
||||
if (none_left)
|
||||
return;
|
||||
|
||||
for (i = 0; i < s->mb_num; i++) {
|
||||
for (i = 0; i < mb_width * mb_height; i++) {
|
||||
int mb_xy = s->mb_index2xy[i];
|
||||
if (fixed[mb_xy])
|
||||
fixed[mb_xy] = MV_FROZEN;
|
||||
|
||||
@@ -250,6 +250,10 @@ static int escape124_decode_frame(AVCodecContext *avctx,
|
||||
// This codebook can be cut off at places other than
|
||||
// powers of 2, leaving some of the entries undefined.
|
||||
cb_size = get_bits_long(&gb, 20);
|
||||
if (!cb_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid codebook size 0.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
cb_depth = av_log2(cb_size - 1) + 1;
|
||||
} else {
|
||||
cb_depth = get_bits(&gb, 4);
|
||||
|
||||
@@ -459,7 +459,7 @@ static int huf_build_dec_table(const uint64_t *hcode, int im,
|
||||
lc += 8; \
|
||||
}
|
||||
|
||||
#define get_code(po, rlc, c, lc, gb, out, oe) \
|
||||
#define get_code(po, rlc, c, lc, gb, out, oe, outb) \
|
||||
{ \
|
||||
if (po == rlc) { \
|
||||
if (lc < 8) \
|
||||
@@ -468,7 +468,7 @@ static int huf_build_dec_table(const uint64_t *hcode, int im,
|
||||
\
|
||||
cs = c >> lc; \
|
||||
\
|
||||
if (out + cs > oe) \
|
||||
if (out + cs > oe || out == outb) \
|
||||
return AVERROR_INVALIDDATA; \
|
||||
\
|
||||
s = out[-1]; \
|
||||
@@ -501,7 +501,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
|
||||
if (pl.len) {
|
||||
lc -= pl.len;
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe);
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe, outb);
|
||||
} else {
|
||||
int j;
|
||||
|
||||
@@ -518,7 +518,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
if ((hcode[pl.p[j]] >> 6) ==
|
||||
((c >> (lc - l)) & ((1LL << l) - 1))) {
|
||||
lc -= l;
|
||||
get_code(pl.p[j], rlc, c, lc, gb, out, oe);
|
||||
get_code(pl.p[j], rlc, c, lc, gb, out, oe, outb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -539,7 +539,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
|
||||
if (pl.len) {
|
||||
lc -= pl.len;
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe);
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe, outb);
|
||||
} else {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -189,6 +189,10 @@ static int decode_uncompressed(AVCodecContext *avctx, GetBitContext *gb,
|
||||
*mode = !*mode;
|
||||
if (newmode != *mode) { //FIXME CHECK
|
||||
*(*runs)++ = 0;
|
||||
if (*runs >= runend) {
|
||||
av_log(avctx, AV_LOG_ERROR, "uncompressed run overrun\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
*mode = newmode;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -66,7 +66,7 @@ av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
|
||||
|
||||
av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
{
|
||||
int j;
|
||||
int j, i;
|
||||
|
||||
fs->plane_count = f->plane_count;
|
||||
fs->transparency = f->transparency;
|
||||
@@ -80,10 +80,15 @@ av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
if (!p->state)
|
||||
return AVERROR(ENOMEM);
|
||||
} else {
|
||||
if (!p->vlc_state)
|
||||
p->vlc_state = av_malloc_array(p->context_count, sizeof(VlcState));
|
||||
if (!p->vlc_state)
|
||||
return AVERROR(ENOMEM);
|
||||
if (!p->vlc_state) {
|
||||
p->vlc_state = av_mallocz_array(p->context_count, sizeof(VlcState));
|
||||
if (!p->vlc_state)
|
||||
return AVERROR(ENOMEM);
|
||||
for (i = 0; i < p->context_count; i++) {
|
||||
p->vlc_state[i].error_sum = 4;
|
||||
p->vlc_state[i].count = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +106,7 @@ av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
|
||||
{
|
||||
int i, ret;
|
||||
for (i = 0; i < f->slice_count; i++) {
|
||||
for (i = 0; i < f->max_slice_count; i++) {
|
||||
FFV1Context *fs = f->slice_context[i];
|
||||
if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -113,10 +118,10 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
|
||||
{
|
||||
int i;
|
||||
|
||||
f->slice_count = f->num_h_slices * f->num_v_slices;
|
||||
av_assert0(f->slice_count > 0);
|
||||
f->max_slice_count = f->num_h_slices * f->num_v_slices;
|
||||
av_assert0(f->max_slice_count > 0);
|
||||
|
||||
for (i = 0; i < f->slice_count; i++) {
|
||||
for (i = 0; i < f->max_slice_count; i++) {
|
||||
int sx = i % f->num_h_slices;
|
||||
int sy = i / f->num_h_slices;
|
||||
int sxs = f->avctx->width * sx / f->num_h_slices;
|
||||
@@ -210,7 +215,7 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx)
|
||||
ff_thread_release_buffer(avctx, &s->last_picture);
|
||||
av_frame_free(&s->last_picture.f);
|
||||
|
||||
for (j = 0; j < s->slice_count; j++) {
|
||||
for (j = 0; j < s->max_slice_count; j++) {
|
||||
FFV1Context *fs = s->slice_context[j];
|
||||
for (i = 0; i < s->plane_count; i++) {
|
||||
PlaneContext *p = &fs->plane[i];
|
||||
@@ -224,14 +229,14 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx)
|
||||
av_freep(&avctx->stats_out);
|
||||
for (j = 0; j < s->quant_table_count; j++) {
|
||||
av_freep(&s->initial_states[j]);
|
||||
for (i = 0; i < s->slice_count; i++) {
|
||||
for (i = 0; i < s->max_slice_count; i++) {
|
||||
FFV1Context *sf = s->slice_context[i];
|
||||
av_freep(&sf->rc_stat2[j]);
|
||||
}
|
||||
av_freep(&s->rc_stat2[j]);
|
||||
}
|
||||
|
||||
for (i = 0; i < s->slice_count; i++)
|
||||
for (i = 0; i < s->max_slice_count; i++)
|
||||
av_freep(&s->slice_context[i]);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -118,6 +118,7 @@ typedef struct FFV1Context {
|
||||
|
||||
struct FFV1Context *slice_context[MAX_SLICES];
|
||||
int slice_count;
|
||||
int max_slice_count;
|
||||
int num_v_slices;
|
||||
int num_h_slices;
|
||||
int slice_width;
|
||||
|
||||
@@ -47,8 +47,11 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
|
||||
else {
|
||||
int i, e, a;
|
||||
e = 0;
|
||||
while (get_rac(c, state + 1 + FFMIN(e, 9))) // 1..10
|
||||
while (get_rac(c, state + 1 + FFMIN(e, 9))) { // 1..10
|
||||
e++;
|
||||
if (e > 31)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
a = 1;
|
||||
for (i = e - 1; i >= 0; i--)
|
||||
@@ -302,7 +305,7 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
|
||||
for (i = 0; i < f->plane_count; i++) {
|
||||
PlaneContext * const p = &fs->plane[i];
|
||||
int idx = get_symbol(c, state, 0);
|
||||
if (idx > (unsigned)f->quant_table_count) {
|
||||
if (idx >= (unsigned)f->quant_table_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -405,6 +408,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
|
||||
if (ff_ffv1_init_slice_state(f, fs) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
if (decode_slice_header(f, fs) < 0) {
|
||||
fs->slice_x = fs->slice_y = fs->slice_height = fs->slice_width = 0;
|
||||
fs->slice_damaged = 1;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -499,7 +503,10 @@ static int read_quant_tables(RangeCoder *c,
|
||||
int context_count = 1;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
context_count *= read_quant_table(c, quant_table[i], context_count);
|
||||
int ret = read_quant_table(c, quant_table[i], context_count);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
context_count *= ret;
|
||||
if (context_count > 32768U) {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -562,8 +569,11 @@ static int read_extra_header(FFV1Context *f)
|
||||
}
|
||||
|
||||
f->quant_table_count = get_symbol(c, state, 0);
|
||||
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES)
|
||||
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count);
|
||||
f->quant_table_count = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (i = 0; i < f->quant_table_count; i++) {
|
||||
f->context_count[i] = read_quant_tables(c, f->quant_tables[i]);
|
||||
@@ -775,6 +785,7 @@ static int read_header(FFV1Context *f)
|
||||
av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
f->slice_count = f->max_slice_count;
|
||||
} else if (f->version < 3) {
|
||||
f->slice_count = get_symbol(c, state, 0);
|
||||
} else {
|
||||
@@ -789,8 +800,8 @@ static int read_header(FFV1Context *f)
|
||||
p -= size + trailer;
|
||||
}
|
||||
}
|
||||
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid\n", f->slice_count);
|
||||
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0 || f->slice_count > f->max_slice_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid (max=%d)\n", f->slice_count, f->max_slice_count);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -932,6 +943,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
else v = buf_p - c->bytestream_start;
|
||||
if (buf_p - c->bytestream_start < v) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice pointer chain broken\n");
|
||||
ff_thread_report_progress(&f->picture, INT_MAX, 0);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
buf_p -= v;
|
||||
@@ -1016,6 +1028,7 @@ static int init_thread_copy(AVCodecContext *avctx)
|
||||
f->picture.f = NULL;
|
||||
f->last_picture.f = NULL;
|
||||
f->sample_buffer = NULL;
|
||||
f->max_slice_count = 0;
|
||||
f->slice_count = 0;
|
||||
|
||||
for (i = 0; i < f->quant_table_count; i++) {
|
||||
@@ -1091,7 +1104,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
|
||||
av_assert0(!fdst->sample_buffer);
|
||||
}
|
||||
|
||||
av_assert1(fdst->slice_count == fsrc->slice_count);
|
||||
av_assert1(fdst->max_slice_count == fsrc->max_slice_count);
|
||||
|
||||
|
||||
ff_thread_release_buffer(dst, &fdst->picture);
|
||||
|
||||
@@ -763,14 +763,12 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
s->colorspace = 1;
|
||||
s->transparency = 1;
|
||||
s->chroma_planes = 1;
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
s->bits_per_raw_sample = 8;
|
||||
s->bits_per_raw_sample = 8;
|
||||
break;
|
||||
case AV_PIX_FMT_0RGB32:
|
||||
s->colorspace = 1;
|
||||
s->chroma_planes = 1;
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
s->bits_per_raw_sample = 8;
|
||||
s->bits_per_raw_sample = 8;
|
||||
break;
|
||||
case AV_PIX_FMT_GBRP9:
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
@@ -977,6 +975,7 @@ slices_ok:
|
||||
|
||||
if ((ret = ff_ffv1_init_slice_contexts(s)) < 0)
|
||||
return ret;
|
||||
s->slice_count = s->max_slice_count;
|
||||
if ((ret = ff_ffv1_init_slices_state(s)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -986,7 +985,7 @@ slices_ok:
|
||||
if (!avctx->stats_out)
|
||||
return AVERROR(ENOMEM);
|
||||
for (i = 0; i < s->quant_table_count; i++)
|
||||
for (j = 0; j < s->slice_count; j++) {
|
||||
for (j = 0; j < s->max_slice_count; j++) {
|
||||
FFV1Context *sf = s->slice_context[j];
|
||||
av_assert0(!sf->rc_stat2[i]);
|
||||
sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
|
||||
@@ -1193,7 +1192,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
FFV1Context *f = avctx->priv_data;
|
||||
RangeCoder *const c = &f->slice_context[0]->c;
|
||||
AVFrame *const p = f->picture.f;
|
||||
int used_count = 0;
|
||||
uint8_t keystate = 128;
|
||||
uint8_t *buf_p;
|
||||
int i, ret;
|
||||
@@ -1210,6 +1208,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
for (i = 0; i < f->quant_table_count; i++)
|
||||
memset(f->rc_stat2[i], 0, f->context_count[i] * sizeof(*f->rc_stat2[i]));
|
||||
|
||||
av_assert0(f->slice_count == f->max_slice_count);
|
||||
for (j = 0; j < f->slice_count; j++) {
|
||||
FFV1Context *fs = f->slice_context[j];
|
||||
for (i = 0; i < 256; i++) {
|
||||
@@ -1248,6 +1247,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
if (f->version > 3)
|
||||
maxsize = AV_INPUT_BUFFER_MIN_SIZE + avctx->width*avctx->height*3LL*4;
|
||||
|
||||
if (maxsize > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - 32) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Cannot allocate worst case packet size, the encoding could fail\n");
|
||||
maxsize = INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - 32;
|
||||
}
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, maxsize, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -1277,11 +1281,17 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 1; i < f->slice_count; i++) {
|
||||
for (i = 0; i < f->slice_count; i++) {
|
||||
FFV1Context *fs = f->slice_context[i];
|
||||
uint8_t *start = pkt->data + (pkt->size - used_count) * (int64_t)i / f->slice_count;
|
||||
uint8_t *start = pkt->data + pkt->size * (int64_t)i / f->slice_count;
|
||||
int len = pkt->size / f->slice_count;
|
||||
ff_init_range_encoder(&fs->c, start, len);
|
||||
if (i) {
|
||||
ff_init_range_encoder(&fs->c, start, len);
|
||||
} else {
|
||||
av_assert0(fs->c.bytestream_end >= fs->c.bytestream_start + len);
|
||||
av_assert0(fs->c.bytestream < fs->c.bytestream_start + len);
|
||||
fs->c.bytestream_end = fs->c.bytestream_start + len;
|
||||
}
|
||||
}
|
||||
avctx->execute(avctx, encode_slice, &f->slice_context[0], NULL,
|
||||
f->slice_count, sizeof(void *));
|
||||
|
||||
@@ -586,10 +586,12 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
temp = curr->next;
|
||||
av_freep(&curr->link_penalty);
|
||||
av_free(curr);
|
||||
fpc->nb_headers_buffered--;
|
||||
}
|
||||
fpc->headers = fpc->best_header->next;
|
||||
av_freep(&fpc->best_header->link_penalty);
|
||||
av_freep(&fpc->best_header);
|
||||
fpc->nb_headers_buffered--;
|
||||
}
|
||||
|
||||
/* Find and score new headers. */
|
||||
@@ -617,8 +619,8 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
|
||||
if (!av_fifo_space(fpc->fifo_buf) &&
|
||||
av_fifo_size(fpc->fifo_buf) / FLAC_AVG_FRAME_SIZE >
|
||||
fpc->nb_headers_buffered * 10) {
|
||||
/* There is less than one valid flac header buffered for 10 headers
|
||||
fpc->nb_headers_buffered * 20) {
|
||||
/* There is less than one valid flac header buffered for 20 headers
|
||||
* buffered. Therefore the fifo is most likely filled with invalid
|
||||
* data and the input is not a flac file. */
|
||||
goto handle_error;
|
||||
|
||||
@@ -268,7 +268,8 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded,
|
||||
int pred_order, int bps)
|
||||
{
|
||||
const int blocksize = s->blocksize;
|
||||
int av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d), i;
|
||||
unsigned av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d);
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
/* warm up samples */
|
||||
@@ -447,7 +448,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
|
||||
if (wasted) {
|
||||
int i;
|
||||
for (i = 0; i < s->blocksize; i++)
|
||||
decoded[i] <<= wasted;
|
||||
decoded[i] = (unsigned)decoded[i] << wasted;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -56,7 +56,7 @@ static void FUNC(flac_decorrelate_indep_c)(uint8_t **out, int32_t **in,
|
||||
|
||||
for (j = 0; j < len; j++)
|
||||
for (i = 0; i < channels; i++)
|
||||
S(samples, i, j) = in[i][j] << shift;
|
||||
S(samples, i, j) = (int)((unsigned)in[i][j] << shift);
|
||||
}
|
||||
|
||||
static void FUNC(flac_decorrelate_ls_c)(uint8_t **out, int32_t **in,
|
||||
|
||||
@@ -1021,7 +1021,7 @@ static int count_frame_header(FlacEncodeContext *s)
|
||||
count += 16;
|
||||
|
||||
/* explicit sample rate */
|
||||
count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12)) * 8;
|
||||
count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12) * 2) * 8;
|
||||
|
||||
/* frame header CRC-8 */
|
||||
count += 8;
|
||||
|
||||
@@ -413,6 +413,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
if (has_diff) {
|
||||
if (size < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "size too small for diff\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (!s->keyframe) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Inter frame without keyframe\n");
|
||||
@@ -440,6 +444,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int row = get_bits(&gb, 8);
|
||||
av_log(avctx, AV_LOG_DEBUG, "%dx%d zlibprime_curr %dx%d\n",
|
||||
i, j, col, row);
|
||||
if (size < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "size too small for zlibprime_curr\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
size -= 2;
|
||||
avpriv_request_sample(avctx, "zlibprime_curr");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
|
||||
@@ -631,6 +631,8 @@ static int epic_decode_run_length(ePICContext *dc, int x, int y, int tile_width,
|
||||
(NN != N) << 1 |
|
||||
(NNW != NW);
|
||||
WWneW = ff_els_decode_bit(&dc->els_ctx, &dc->W_ctx_rung[idx]);
|
||||
if (WWneW < 0)
|
||||
return WWneW;
|
||||
}
|
||||
|
||||
if (WWneW)
|
||||
@@ -837,10 +839,13 @@ static int epic_decode_tile(ePICContext *dc, uint8_t *out, int tile_height,
|
||||
if (y < 2 || x < 2 || x == tile_width - 1) {
|
||||
run = 1;
|
||||
got_pixel = epic_handle_edges(dc, x, y, curr_row, above_row, &pix);
|
||||
} else
|
||||
} else {
|
||||
got_pixel = epic_decode_run_length(dc, x, y, tile_width,
|
||||
curr_row, above_row,
|
||||
above2_row, &pix, &run);
|
||||
if (got_pixel < 0)
|
||||
return got_pixel;
|
||||
}
|
||||
|
||||
if (!got_pixel && !epic_predict_from_NW_NE(dc, x, y, run,
|
||||
tile_width, curr_row,
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
/**
|
||||
* G.726 11bit float.
|
||||
* G.726 Standard uses rather odd 11bit floating point arithmentic for
|
||||
* G.726 Standard uses rather odd 11bit floating point arithmetic for
|
||||
* numerous occasions. It's a mystery to me why they did it this way
|
||||
* instead of simply using 32bit integer arithmetic.
|
||||
*/
|
||||
@@ -206,7 +206,7 @@ static int16_t g726_decode(G726Context* c, int I)
|
||||
|
||||
if (I_sig) /* get the sign */
|
||||
dq = -dq;
|
||||
re_signal = c->se + dq;
|
||||
re_signal = (int16_t)(c->se + dq);
|
||||
|
||||
/* Update second order predictor coefficient A2 and A1 */
|
||||
pk0 = (c->sez + dq) ? sgn(c->sez + dq) : 0;
|
||||
|
||||
@@ -374,6 +374,10 @@ static inline uint64_t get_bits64(GetBitContext *s, int n)
|
||||
*/
|
||||
static inline int get_sbits_long(GetBitContext *s, int n)
|
||||
{
|
||||
// sign_extend(x, 0) is undefined
|
||||
if (!n)
|
||||
return 0;
|
||||
|
||||
return sign_extend(get_bits_long(s, n), n);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ typedef struct GIFContext {
|
||||
const AVClass *class;
|
||||
LZWState *lzw;
|
||||
uint8_t *buf;
|
||||
int buf_size;
|
||||
AVFrame *last_frame;
|
||||
int flags;
|
||||
uint32_t palette[AVPALETTE_COUNT]; ///< local reference palette for !pal8
|
||||
@@ -174,7 +175,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
||||
|
||||
bytestream_put_byte(bytestream, 0x08);
|
||||
|
||||
ff_lzw_encode_init(s->lzw, s->buf, 2 * width * height,
|
||||
ff_lzw_encode_init(s->lzw, s->buf, s->buf_size,
|
||||
12, FF_LZW_GIF, put_bits);
|
||||
|
||||
ptr = buf + y_start*linesize + x_start;
|
||||
@@ -231,7 +232,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
s->transparent_index = -1;
|
||||
|
||||
s->lzw = av_mallocz(ff_lzw_encode_state_size);
|
||||
s->buf = av_malloc(avctx->width*avctx->height*2);
|
||||
s->buf_size = avctx->width*avctx->height*2 + 1000;
|
||||
s->buf = av_malloc(s->buf_size);
|
||||
s->tmpl = av_malloc(avctx->width);
|
||||
if (!s->tmpl || !s->buf || !s->lzw)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -321,6 +323,7 @@ static int gif_encode_close(AVCodecContext *avctx)
|
||||
|
||||
av_freep(&s->lzw);
|
||||
av_freep(&s->buf);
|
||||
s->buf_size = 0;
|
||||
av_frame_free(&s->last_frame);
|
||||
av_freep(&s->tmpl);
|
||||
return 0;
|
||||
|
||||
@@ -68,7 +68,7 @@ static inline int get_ue_golomb(GetBitContext *gb)
|
||||
int log = 2 * av_log2(buf) - 31;
|
||||
LAST_SKIP_BITS(re, gb, 32 - log);
|
||||
CLOSE_READER(re, gb);
|
||||
if (CONFIG_FTRAPV && log < 0) {
|
||||
if (log < 7) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Invalid UE golomb code\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -1587,7 +1587,9 @@ again:
|
||||
#endif
|
||||
} else
|
||||
context_count++;
|
||||
}
|
||||
} else
|
||||
sl->ref_count[0] = sl->ref_count[1] = 0;
|
||||
break;
|
||||
break;
|
||||
case NAL_DPA:
|
||||
case NAL_DPB:
|
||||
@@ -1652,8 +1654,8 @@ again:
|
||||
av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
|
||||
sl->ref_count[0] = sl->ref_count[1] = sl->list_count = 0;
|
||||
} else if (err == SLICE_SINGLETHREAD) {
|
||||
if (context_count > 1) {
|
||||
ret = ff_h264_execute_decode_slices(h, context_count - 1);
|
||||
if (context_count > 0) {
|
||||
ret = ff_h264_execute_decode_slices(h, context_count);
|
||||
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
|
||||
goto end;
|
||||
context_count = 0;
|
||||
@@ -1674,6 +1676,47 @@ again:
|
||||
|
||||
ret = 0;
|
||||
end:
|
||||
|
||||
#if CONFIG_ERROR_RESILIENCE
|
||||
sl = h->slice_ctx;
|
||||
/*
|
||||
* FIXME: Error handling code does not seem to support interlaced
|
||||
* when slices span multiple rows
|
||||
* The ff_er_add_slice calls don't work right for bottom
|
||||
* fields; they cause massive erroneous error concealing
|
||||
* Error marking covers both fields (top and bottom).
|
||||
* This causes a mismatched s->error_count
|
||||
* and a bad error table. Further, the error count goes to
|
||||
* INT_MAX when called for bottom field, because mb_y is
|
||||
* past end by one (callers fault) and resync_mb_y != 0
|
||||
* causes problems for the first MB line, too.
|
||||
*/
|
||||
if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) {
|
||||
int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0];
|
||||
|
||||
ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr);
|
||||
|
||||
if (use_last_pic) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec);
|
||||
sl->ref_list[0][0].parent = &h->last_pic_for_ec;
|
||||
memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data));
|
||||
memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize));
|
||||
sl->ref_list[0][0].reference = h->last_pic_for_ec.reference;
|
||||
} else if (sl->ref_count[0]) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent);
|
||||
} else
|
||||
ff_h264_set_erpic(&sl->er.last_pic, NULL);
|
||||
|
||||
if (sl->ref_count[1])
|
||||
ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent);
|
||||
|
||||
sl->er.ref_count = sl->ref_count[0];
|
||||
|
||||
ff_er_frame_end(&sl->er);
|
||||
if (use_last_pic)
|
||||
memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0]));
|
||||
}
|
||||
#endif /* CONFIG_ERROR_RESILIENCE */
|
||||
/* clean up */
|
||||
if (h->cur_pic_ptr && !h->droppable) {
|
||||
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
|
||||
@@ -1736,7 +1779,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
|
||||
const uint8_t *p= buf+6;
|
||||
while(cnt--){
|
||||
int nalsize= AV_RB16(p) + 2;
|
||||
if(nalsize > buf_size - (p-buf) || p[2]!=0x67)
|
||||
if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 7)
|
||||
return 0;
|
||||
p += nalsize;
|
||||
}
|
||||
@@ -1745,7 +1788,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
|
||||
return 0;
|
||||
while(cnt--){
|
||||
int nalsize= AV_RB16(p) + 2;
|
||||
if(nalsize > buf_size - (p-buf) || p[2]!=0x68)
|
||||
if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 8)
|
||||
return 0;
|
||||
p += nalsize;
|
||||
}
|
||||
|
||||
@@ -2026,6 +2026,7 @@ decode_intra_mb:
|
||||
const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] *
|
||||
h->sps.bit_depth_luma >> 3;
|
||||
const uint8_t *ptr;
|
||||
int ret;
|
||||
|
||||
// We assume these blocks are very rare so we do not optimize it.
|
||||
// FIXME The two following lines get the bitstream position in the cabac
|
||||
@@ -2042,7 +2043,9 @@ decode_intra_mb:
|
||||
sl->intra_pcm_ptr = ptr;
|
||||
ptr += mb_size;
|
||||
|
||||
ff_init_cabac_decoder(&sl->cabac, ptr, sl->cabac.bytestream_end - ptr);
|
||||
ret = ff_init_cabac_decoder(&sl->cabac, ptr, sl->cabac.bytestream_end - ptr);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
// All blocks are present
|
||||
h->cbp_table[mb_xy] = 0xf7ef;
|
||||
|
||||
@@ -158,6 +158,7 @@ static void MCFUNC(hl_motion)(const H264Context *h, H264SliceContext *sl,
|
||||
}
|
||||
}
|
||||
|
||||
prefetch_motion(h, sl, 1, PIXEL_SHIFT, CHROMA_IDC);
|
||||
if (USES_LIST(mb_type, 1))
|
||||
prefetch_motion(h, sl, 1, PIXEL_SHIFT, CHROMA_IDC);
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ pps:
|
||||
if (!unit_nb && !sps_done++) {
|
||||
unit_nb = *extradata++; /* number of pps unit(s) */
|
||||
if (unit_nb) {
|
||||
ctx->pps_offset = (extradata - 1) - (avctx->extradata + 4);
|
||||
ctx->pps_offset = total_size;
|
||||
pps_seen = 1;
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ static void h264_mp4toannexb_filter_close(AVBitStreamFilterContext *bsfc)
|
||||
{
|
||||
H264BSFContext *ctx = bsfc->priv_data;
|
||||
if (ctx->private_spspps)
|
||||
av_free(ctx->spspps_buf);
|
||||
av_freep(&ctx->spspps_buf);
|
||||
}
|
||||
|
||||
AVBitStreamFilter ff_h264_mp4toannexb_bsf = {
|
||||
|
||||
@@ -186,47 +186,6 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
|
||||
ff_vdpau_h264_picture_complete(h);
|
||||
#endif
|
||||
|
||||
#if CONFIG_ERROR_RESILIENCE
|
||||
av_assert0(sl == h->slice_ctx);
|
||||
/*
|
||||
* FIXME: Error handling code does not seem to support interlaced
|
||||
* when slices span multiple rows
|
||||
* The ff_er_add_slice calls don't work right for bottom
|
||||
* fields; they cause massive erroneous error concealing
|
||||
* Error marking covers both fields (top and bottom).
|
||||
* This causes a mismatched s->error_count
|
||||
* and a bad error table. Further, the error count goes to
|
||||
* INT_MAX when called for bottom field, because mb_y is
|
||||
* past end by one (callers fault) and resync_mb_y != 0
|
||||
* causes problems for the first MB line, too.
|
||||
*/
|
||||
if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) {
|
||||
int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0];
|
||||
|
||||
ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr);
|
||||
|
||||
if (use_last_pic) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec);
|
||||
sl->ref_list[0][0].parent = &h->last_pic_for_ec;
|
||||
memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data));
|
||||
memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize));
|
||||
sl->ref_list[0][0].reference = h->last_pic_for_ec.reference;
|
||||
} else if (sl->ref_count[0]) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent);
|
||||
} else
|
||||
ff_h264_set_erpic(&sl->er.last_pic, NULL);
|
||||
|
||||
if (sl->ref_count[1])
|
||||
ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent);
|
||||
|
||||
sl->er.ref_count = sl->ref_count[0];
|
||||
|
||||
ff_er_frame_end(&sl->er);
|
||||
if (use_last_pic)
|
||||
memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0]));
|
||||
}
|
||||
#endif /* CONFIG_ERROR_RESILIENCE */
|
||||
|
||||
if (!in_setup && !h->droppable)
|
||||
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
|
||||
h->picture_structure == PICT_BOTTOM_FIELD);
|
||||
|
||||
@@ -122,6 +122,14 @@ static int add_sorted(H264Picture **sorted, H264Picture **src, int len, int limi
|
||||
return out_i;
|
||||
}
|
||||
|
||||
static int mismatches_ref(H264Context *h, H264Picture *pic)
|
||||
{
|
||||
AVFrame *f = pic->f;
|
||||
return (h->cur_pic_ptr->f->width != f->width ||
|
||||
h->cur_pic_ptr->f->height != f->height ||
|
||||
h->cur_pic_ptr->f->format != f->format);
|
||||
}
|
||||
|
||||
int ff_h264_fill_default_ref_list(H264Context *h, H264SliceContext *sl)
|
||||
{
|
||||
int i, len;
|
||||
@@ -193,10 +201,7 @@ int ff_h264_fill_default_ref_list(H264Context *h, H264SliceContext *sl)
|
||||
for (j = 0; j<1+(sl->slice_type_nos == AV_PICTURE_TYPE_B); j++) {
|
||||
for (i = 0; i < sl->ref_count[j]; i++) {
|
||||
if (h->default_ref_list[j][i].parent) {
|
||||
AVFrame *f = h->default_ref_list[j][i].parent->f;
|
||||
if (h->cur_pic_ptr->f->width != f->width ||
|
||||
h->cur_pic_ptr->f->height != f->height ||
|
||||
h->cur_pic_ptr->f->format != f->format) {
|
||||
if (mismatches_ref(h, h->default_ref_list[j][i].parent)) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Discarding mismatching reference\n");
|
||||
memset(&h->default_ref_list[j][i], 0, sizeof(h->default_ref_list[j][i]));
|
||||
}
|
||||
@@ -298,14 +303,14 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl)
|
||||
|
||||
long_idx = pic_num_extract(h, pic_id, &pic_structure);
|
||||
|
||||
if (long_idx > 31) {
|
||||
if (long_idx > 31U) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"long_term_pic_idx overflow\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
ref = h->long_ref[long_idx];
|
||||
assert(!(ref && !ref->reference));
|
||||
if (ref && (ref->reference & pic_structure)) {
|
||||
if (ref && (ref->reference & pic_structure) && !mismatches_ref(h, ref)) {
|
||||
ref->pic_id = pic_id;
|
||||
assert(ref->long_ref);
|
||||
i = 0;
|
||||
|
||||
@@ -182,8 +182,6 @@ static int decode_registered_user_data_closed_caption(H264Context *h, int size)
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
avpriv_request_sample(h->avctx, "Subtitles with data type 0x%02x",
|
||||
user_data_type_code);
|
||||
for (i = 0; i < size - 1; i++)
|
||||
skip_bits(&h->gb, 8);
|
||||
}
|
||||
|
||||
@@ -783,7 +783,7 @@ static void implicit_weight_table(const H264Context *h, H264SliceContext *sl, in
|
||||
cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure - 1];
|
||||
}
|
||||
if (sl->ref_count[0] == 1 && sl->ref_count[1] == 1 && !FRAME_MBAFF(h) &&
|
||||
sl->ref_list[0][0].poc + sl->ref_list[1][0].poc == 2 * cur_poc) {
|
||||
sl->ref_list[0][0].poc + (int64_t)sl->ref_list[1][0].poc == 2 * cur_poc) {
|
||||
sl->use_weight = 0;
|
||||
sl->use_weight_chroma = 0;
|
||||
return;
|
||||
@@ -804,7 +804,7 @@ static void implicit_weight_table(const H264Context *h, H264SliceContext *sl, in
|
||||
sl->chroma_log2_weight_denom = 5;
|
||||
|
||||
for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
|
||||
int poc0 = sl->ref_list[0][ref0].poc;
|
||||
int64_t poc0 = sl->ref_list[0][ref0].poc;
|
||||
for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
|
||||
int w = 32;
|
||||
if (!sl->ref_list[0][ref0].parent->long_ref && !sl->ref_list[1][ref1].parent->long_ref) {
|
||||
@@ -1097,6 +1097,7 @@ static int h264_slice_header_init(H264Context *h)
|
||||
nb_slices = max_slices;
|
||||
}
|
||||
h->slice_context_count = nb_slices;
|
||||
h->max_contexts = FFMIN(h->max_contexts, nb_slices);
|
||||
|
||||
if (!HAVE_THREADS || !(h->avctx->active_thread_type & FF_THREAD_SLICE)) {
|
||||
ret = ff_h264_slice_context_init(h, &h->slice_ctx[0]);
|
||||
@@ -1177,6 +1178,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (h->max_contexts > 1) {
|
||||
if (!h->single_decode_warning) {
|
||||
av_log(h->avctx, AV_LOG_WARNING, "Cannot decode multiple access units as slice threads\n");
|
||||
h->single_decode_warning = 1;
|
||||
}
|
||||
h->max_contexts = 1;
|
||||
return SLICE_SINGLETHREAD;
|
||||
}
|
||||
|
||||
if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) {
|
||||
ret = ff_h264_field_end(h, h->slice_ctx, 1);
|
||||
h->current_slice = 0;
|
||||
@@ -1272,9 +1282,13 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
|
||||
|
||||
if (first_slice) {
|
||||
h->pps = *h->pps_buffers[pps_id];
|
||||
} else if (h->setup_finished && h->dequant_coeff_pps != pps_id) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else {
|
||||
if (h->pps.sps_id != pps->sps_id ||
|
||||
h->pps.transform_8x8_mode != pps->transform_8x8_mode ||
|
||||
(h->setup_finished && h->dequant_coeff_pps != pps_id)) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
if (pps->sps_id != h->sps.sps_id ||
|
||||
@@ -1983,12 +1997,12 @@ static av_always_inline void fill_filter_caches_inter(const H264Context *h,
|
||||
if (USES_LIST(top_type, list)) {
|
||||
const int b_xy = h->mb2b_xy[top_xy] + 3 * b_stride;
|
||||
const int b8_xy = 4 * top_xy + 2;
|
||||
int (*ref2frm)[64] = (void*)(sl->ref2frm[h->slice_table[top_xy] & (MAX_SLICES - 1)][0] + (MB_MBAFF(sl) ? 20 : 2));
|
||||
int *ref2frm = sl->ref2frm[h->slice_table[top_xy] & (MAX_SLICES - 1)][list] + (MB_MBAFF(sl) ? 20 : 2);
|
||||
AV_COPY128(mv_dst - 1 * 8, h->cur_pic.motion_val[list][b_xy + 0]);
|
||||
ref_cache[0 - 1 * 8] =
|
||||
ref_cache[1 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 0]];
|
||||
ref_cache[1 - 1 * 8] = ref2frm[h->cur_pic.ref_index[list][b8_xy + 0]];
|
||||
ref_cache[2 - 1 * 8] =
|
||||
ref_cache[3 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 1]];
|
||||
ref_cache[3 - 1 * 8] = ref2frm[h->cur_pic.ref_index[list][b8_xy + 1]];
|
||||
} else {
|
||||
AV_ZERO128(mv_dst - 1 * 8);
|
||||
AV_WN32A(&ref_cache[0 - 1 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
|
||||
@@ -1998,15 +2012,15 @@ static av_always_inline void fill_filter_caches_inter(const H264Context *h,
|
||||
if (USES_LIST(left_type[LTOP], list)) {
|
||||
const int b_xy = h->mb2b_xy[left_xy[LTOP]] + 3;
|
||||
const int b8_xy = 4 * left_xy[LTOP] + 1;
|
||||
int (*ref2frm)[64] =(void*)( sl->ref2frm[h->slice_table[left_xy[LTOP]] & (MAX_SLICES - 1)][0] + (MB_MBAFF(sl) ? 20 : 2));
|
||||
int *ref2frm = sl->ref2frm[h->slice_table[left_xy[LTOP]] & (MAX_SLICES - 1)][list] + (MB_MBAFF(sl) ? 20 : 2);
|
||||
AV_COPY32(mv_dst - 1 + 0, h->cur_pic.motion_val[list][b_xy + b_stride * 0]);
|
||||
AV_COPY32(mv_dst - 1 + 8, h->cur_pic.motion_val[list][b_xy + b_stride * 1]);
|
||||
AV_COPY32(mv_dst - 1 + 16, h->cur_pic.motion_val[list][b_xy + b_stride * 2]);
|
||||
AV_COPY32(mv_dst - 1 + 24, h->cur_pic.motion_val[list][b_xy + b_stride * 3]);
|
||||
ref_cache[-1 + 0] =
|
||||
ref_cache[-1 + 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 0]];
|
||||
ref_cache[-1 + 8] = ref2frm[h->cur_pic.ref_index[list][b8_xy + 2 * 0]];
|
||||
ref_cache[-1 + 16] =
|
||||
ref_cache[-1 + 24] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 1]];
|
||||
ref_cache[-1 + 24] = ref2frm[h->cur_pic.ref_index[list][b8_xy + 2 * 1]];
|
||||
} else {
|
||||
AV_ZERO32(mv_dst - 1 + 0);
|
||||
AV_ZERO32(mv_dst - 1 + 8);
|
||||
@@ -2031,9 +2045,9 @@ static av_always_inline void fill_filter_caches_inter(const H264Context *h,
|
||||
|
||||
{
|
||||
int8_t *ref = &h->cur_pic.ref_index[list][4 * mb_xy];
|
||||
int (*ref2frm)[64] = (void*)(sl->ref2frm[sl->slice_num & (MAX_SLICES - 1)][0] + (MB_MBAFF(sl) ? 20 : 2));
|
||||
uint32_t ref01 = (pack16to32(ref2frm[list][ref[0]], ref2frm[list][ref[1]]) & 0x00FF00FF) * 0x0101;
|
||||
uint32_t ref23 = (pack16to32(ref2frm[list][ref[2]], ref2frm[list][ref[3]]) & 0x00FF00FF) * 0x0101;
|
||||
int *ref2frm = sl->ref2frm[sl->slice_num & (MAX_SLICES - 1)][list] + (MB_MBAFF(sl) ? 20 : 2);
|
||||
uint32_t ref01 = (pack16to32(ref2frm[ref[0]], ref2frm[ref[1]]) & 0x00FF00FF) * 0x0101;
|
||||
uint32_t ref23 = (pack16to32(ref2frm[ref[2]], ref2frm[ref[3]]) & 0x00FF00FF) * 0x0101;
|
||||
AV_WN32A(&ref_cache[0 * 8], ref01);
|
||||
AV_WN32A(&ref_cache[1 * 8], ref01);
|
||||
AV_WN32A(&ref_cache[2 * 8], ref23);
|
||||
@@ -2362,9 +2376,11 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
|
||||
align_get_bits(&sl->gb);
|
||||
|
||||
/* init cabac */
|
||||
ff_init_cabac_decoder(&sl->cabac,
|
||||
ret = ff_init_cabac_decoder(&sl->cabac,
|
||||
sl->gb.buffer + get_bits_count(&sl->gb) / 8,
|
||||
(get_bits_left(&sl->gb) + 7) / 8);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ff_h264_init_cabac_states(h, sl);
|
||||
|
||||
|
||||
@@ -744,7 +744,7 @@ static int hls_slice_header(HEVCContext *s)
|
||||
av_freep(&sh->entry_point_offset);
|
||||
av_freep(&sh->offset);
|
||||
av_freep(&sh->size);
|
||||
sh->entry_point_offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
|
||||
sh->entry_point_offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(unsigned));
|
||||
sh->offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
|
||||
sh->size = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
|
||||
if (!sh->entry_point_offset || !sh->offset || !sh->size) {
|
||||
@@ -809,6 +809,8 @@ static int hls_slice_header(HEVCContext *s)
|
||||
s->HEVClc->tu.cu_qp_offset_cb = 0;
|
||||
s->HEVClc->tu.cu_qp_offset_cr = 0;
|
||||
|
||||
s->no_rasl_output_flag = IS_IDR(s) || IS_BLA(s) || (s->nal_unit_type == NAL_CRA_NUT && s->last_eos);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2438,8 +2440,8 @@ static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
|
||||
HEVCLocalContext *lc = s->HEVClc;
|
||||
int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
|
||||
int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
|
||||
int offset;
|
||||
int startheader, cmpt = 0;
|
||||
int64_t offset;
|
||||
int64_t startheader, cmpt = 0;
|
||||
int i, j, res = 0;
|
||||
|
||||
if (!ret || !arg) {
|
||||
@@ -2448,11 +2450,18 @@ static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
if (s->sh.slice_ctb_addr_rs + s->sh.num_entry_point_offsets * s->ps.sps->ctb_width >= s->ps.sps->ctb_width * s->ps.sps->ctb_height) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "WPP ctb addresses are wrong (%d %d %d %d)\n",
|
||||
s->sh.slice_ctb_addr_rs, s->sh.num_entry_point_offsets,
|
||||
s->ps.sps->ctb_width, s->ps.sps->ctb_height
|
||||
);
|
||||
res = AVERROR_INVALIDDATA;
|
||||
goto error;
|
||||
}
|
||||
|
||||
ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
|
||||
|
||||
if (!s->sList[1]) {
|
||||
ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
|
||||
|
||||
|
||||
for (i = 1; i < s->threads_number; i++) {
|
||||
s->sList[i] = av_malloc(sizeof(HEVCContext));
|
||||
memcpy(s->sList[i], s, sizeof(HEVCContext));
|
||||
@@ -2485,6 +2494,11 @@ static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
|
||||
}
|
||||
if (s->sh.num_entry_point_offsets != 0) {
|
||||
offset += s->sh.entry_point_offset[s->sh.num_entry_point_offsets - 1] - cmpt;
|
||||
if (length < offset) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "entry_point_offset table is corrupted\n");
|
||||
res = AVERROR_INVALIDDATA;
|
||||
goto error;
|
||||
}
|
||||
s->sh.size[s->sh.num_entry_point_offsets - 1] = length - offset;
|
||||
s->sh.offset[s->sh.num_entry_point_offsets - 1] = offset;
|
||||
|
||||
@@ -2511,6 +2525,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
|
||||
|
||||
for (i = 0; i <= s->sh.num_entry_point_offsets; i++)
|
||||
res += ret[i];
|
||||
error:
|
||||
av_free(ret);
|
||||
av_free(arg);
|
||||
return res;
|
||||
@@ -3135,6 +3150,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
|
||||
s->pocTid0 = s0->pocTid0;
|
||||
s->max_ra = s0->max_ra;
|
||||
s->eos = s0->eos;
|
||||
s->no_rasl_output_flag = s0->no_rasl_output_flag;
|
||||
|
||||
s->is_nalff = s0->is_nalff;
|
||||
s->nal_length_size = s0->nal_length_size;
|
||||
@@ -3239,6 +3255,7 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
|
||||
|
||||
s->enable_parallel_tiles = 0;
|
||||
s->picture_struct = 0;
|
||||
s->eos = 1;
|
||||
|
||||
if(avctx->active_thread_type & FF_THREAD_SLICE)
|
||||
s->threads_number = avctx->thread_count;
|
||||
@@ -3280,6 +3297,7 @@ static void hevc_decode_flush(AVCodecContext *avctx)
|
||||
HEVCContext *s = avctx->priv_data;
|
||||
ff_hevc_flush_dpb(s);
|
||||
s->max_ra = INT_MAX;
|
||||
s->eos = 1;
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(HEVCContext, x)
|
||||
|
||||
@@ -622,7 +622,7 @@ typedef struct SliceHeader {
|
||||
|
||||
unsigned int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
|
||||
|
||||
int *entry_point_offset;
|
||||
unsigned *entry_point_offset;
|
||||
int * offset;
|
||||
int * size;
|
||||
int num_entry_point_offsets;
|
||||
@@ -866,6 +866,7 @@ typedef struct HEVCContext {
|
||||
int bs_height;
|
||||
|
||||
int is_decoded;
|
||||
int no_rasl_output_flag;
|
||||
|
||||
HEVCPredContext hpc;
|
||||
HEVCDSPContext hevcdsp;
|
||||
|
||||
@@ -831,11 +831,13 @@ static av_always_inline int mvd_decode(HEVCContext *s)
|
||||
int k = 1;
|
||||
|
||||
while (k < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc)) {
|
||||
ret += 1 << k;
|
||||
ret += 1U << k;
|
||||
k++;
|
||||
}
|
||||
if (k == CABAC_MAX_BIN)
|
||||
if (k == CABAC_MAX_BIN) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k);
|
||||
return 0;
|
||||
}
|
||||
while (k--)
|
||||
ret += get_cabac_bypass(&s->HEVClc->cc) << k;
|
||||
return get_cabac_bypass_sign(&s->HEVClc->cc, -ret);
|
||||
@@ -973,8 +975,10 @@ static av_always_inline int coeff_abs_level_remaining_decode(HEVCContext *s, int
|
||||
|
||||
while (prefix < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc))
|
||||
prefix++;
|
||||
if (prefix == CABAC_MAX_BIN)
|
||||
if (prefix == CABAC_MAX_BIN) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", prefix);
|
||||
return 0;
|
||||
}
|
||||
if (prefix < 3) {
|
||||
for (i = 0; i < rc_rice_param; i++)
|
||||
suffix = (suffix << 1) | get_cabac_bypass(&s->HEVClc->cc);
|
||||
|
||||
@@ -232,8 +232,14 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
|
||||
++buf;
|
||||
--length;
|
||||
if (length < 4) {
|
||||
av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (pkt->nb_nals > 0) {
|
||||
// No more start codes: we discarded some irrelevant
|
||||
// bytes at the end of the packet.
|
||||
return 0;
|
||||
} else {
|
||||
av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -834,6 +834,10 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
|
||||
}
|
||||
|
||||
sps->chroma_format_idc = get_ue_golomb_long(gb);
|
||||
if (sps->chroma_format_idc > 3U) {
|
||||
av_log(avctx, AV_LOG_ERROR, "chroma_format_idc %d is invalid\n", sps->chroma_format_idc);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (sps->chroma_format_idc == 3)
|
||||
sps->separate_colour_plane_flag = get_bits1(gb);
|
||||
|
||||
@@ -174,7 +174,7 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
|
||||
int min_poc = INT_MAX;
|
||||
int i, min_idx, ret;
|
||||
|
||||
if (s->sh.no_output_of_prior_pics_flag == 1) {
|
||||
if (s->sh.no_output_of_prior_pics_flag == 1 && s->no_rasl_output_flag == 1) {
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
|
||||
HEVCFrame *frame = &s->DPB[i];
|
||||
if (!(frame->flags & HEVC_FRAME_FLAG_BUMPING) && frame->poc != s->poc &&
|
||||
|
||||
@@ -417,8 +417,8 @@ static int hqx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
info_tag = AV_RL32(src);
|
||||
if (info_tag == MKTAG('I', 'N', 'F', 'O')) {
|
||||
int info_offset = AV_RL32(src + 4);
|
||||
if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->size) {
|
||||
unsigned info_offset = AV_RL32(src + 4);
|
||||
if (info_offset > INT_MAX || info_offset + 8 > avpkt->size) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Invalid INFO header offset: 0x%08"PRIX32" is too large.\n",
|
||||
info_offset);
|
||||
|
||||
@@ -214,7 +214,8 @@ static int idcin_decode_frame(AVCodecContext *avctx,
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
IdcinContext *s = avctx->priv_data;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
int pal_size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
|
||||
AVFrame *frame = data;
|
||||
int ret;
|
||||
|
||||
@@ -227,9 +228,11 @@ static int idcin_decode_frame(AVCodecContext *avctx,
|
||||
if (idcin_decode_vlcs(s, frame))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (pal) {
|
||||
if (pal && pal_size == AVPALETTE_SIZE) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
|
||||
}
|
||||
/* make the palette available on the way out */
|
||||
memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
|
||||
|
||||
@@ -236,9 +236,41 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
|
||||
int x_shift;
|
||||
int yheight;
|
||||
int i, y;
|
||||
int max_step[4];
|
||||
|
||||
if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB ||
|
||||
!is_yuv_planar(desc)) return -1;
|
||||
if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
|
||||
return -1;
|
||||
|
||||
if (!is_yuv_planar(desc)) {
|
||||
if (src)
|
||||
return -1; //TODO: Not yet implemented
|
||||
|
||||
av_image_fill_max_pixsteps(max_step, NULL, desc);
|
||||
|
||||
if (padtop || padleft) {
|
||||
memset(dst->data[0], color[0],
|
||||
dst->linesize[0] * padtop + (padleft * max_step[0]));
|
||||
}
|
||||
|
||||
if (padleft || padright) {
|
||||
optr = dst->data[0] + dst->linesize[0] * padtop +
|
||||
(dst->linesize[0] - (padright * max_step[0]));
|
||||
yheight = height - 1 - (padtop + padbottom);
|
||||
for (y = 0; y < yheight; y++) {
|
||||
memset(optr, color[0], (padleft + padright) * max_step[0]);
|
||||
optr += dst->linesize[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (padbottom || padright) {
|
||||
optr = dst->data[0] + dst->linesize[0] * (height - padbottom) -
|
||||
(padright * max_step[0]);
|
||||
memset(optr, color[0], dst->linesize[0] * padbottom +
|
||||
(padright * max_step[0]));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
x_shift = i ? desc->log2_chroma_w : 0;
|
||||
@@ -284,6 +316,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
|
||||
(padbottom >> y_shift) + (padright >> x_shift));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,6 +146,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
AVFrame *picture = data;
|
||||
AVFrame * const p = s->picture;
|
||||
int start, ret;
|
||||
int ltab, ctab;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, p)) < 0)
|
||||
return ret;
|
||||
@@ -167,34 +168,42 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
|
||||
init_get_bits(&s->gb, buf + start, (buf_size - start) * 8);
|
||||
|
||||
ltab = buf[0x22] & 3;
|
||||
ctab = buf[0x22] >> 2;
|
||||
|
||||
if (ctab > 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "ctab %d is invalid\n", ctab);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (s->decode_delta) { /* intraframe */
|
||||
if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
|
||||
p->data[0], p->linesize[0],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ltab])) < 0)
|
||||
return ret;
|
||||
|
||||
/* swapped U and V */
|
||||
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[2], p->linesize[2],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[1], p->linesize[1],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
} else { /* interframe */
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width, avctx->height,
|
||||
p->data[0], p->linesize[0],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ltab])) < 0)
|
||||
return ret;
|
||||
/* swapped U and V */
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[2], p->linesize[2],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[1], p->linesize[1],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,115 +27,211 @@
|
||||
#define IR2_CODES 143
|
||||
static const uint16_t ir2_codes[IR2_CODES][2] = {
|
||||
#ifdef BITSTREAM_READER_LE
|
||||
{0x0000, 3}, {0x0004, 3}, {0x0006, 3}, {0x0001, 5},
|
||||
{0x0009, 5}, {0x0019, 5}, {0x000D, 5}, {0x001D, 5},
|
||||
{0x0023, 6}, {0x0013, 6}, {0x0033, 6}, {0x000B, 6},
|
||||
{0x002B, 6}, {0x001B, 6}, {0x0007, 8}, {0x0087, 8},
|
||||
{0x0027, 8}, {0x00A7, 8}, {0x0067, 8}, {0x00E7, 8},
|
||||
{0x0097, 8}, {0x0057, 8}, {0x0037, 8}, {0x00B7, 8},
|
||||
{0x00F7, 8}, {0x000F, 9}, {0x008F, 9}, {0x018F, 9},
|
||||
{0x014F, 9}, {0x00CF, 9}, {0x002F, 9}, {0x012F, 9},
|
||||
{0x01AF, 9}, {0x006F, 9}, {0x00EF, 9}, {0x01EF, 9},
|
||||
{0x001F, 10}, {0x021F, 10}, {0x011F, 10}, {0x031F, 10},
|
||||
{0x009F, 10}, {0x029F, 10}, {0x019F, 10}, {0x039F, 10},
|
||||
{0x005F, 10}, {0x025F, 10}, {0x015F, 10}, {0x035F, 10},
|
||||
{0x00DF, 10}, {0x02DF, 10}, {0x01DF, 10}, {0x03DF, 10},
|
||||
{0x003F, 13}, {0x103F, 13}, {0x083F, 13}, {0x183F, 13},
|
||||
{0x043F, 13}, {0x143F, 13}, {0x0C3F, 13}, {0x1C3F, 13},
|
||||
{0x023F, 13}, {0x123F, 13}, {0x0A3F, 13}, {0x1A3F, 13},
|
||||
{0x063F, 13}, {0x163F, 13}, {0x0E3F, 13}, {0x1E3F, 13},
|
||||
{0x013F, 13}, {0x113F, 13}, {0x093F, 13}, {0x193F, 13},
|
||||
{0x053F, 13}, {0x153F, 13}, {0x0D3F, 13}, {0x1D3F, 13},
|
||||
{0x033F, 13}, {0x133F, 13}, {0x0B3F, 13}, {0x1B3F, 13},
|
||||
{0x073F, 13}, {0x173F, 13}, {0x0F3F, 13}, {0x1F3F, 13},
|
||||
{0x00BF, 13}, {0x10BF, 13}, {0x08BF, 13}, {0x18BF, 13},
|
||||
{0x04BF, 13}, {0x14BF, 13}, {0x0CBF, 13}, {0x1CBF, 13},
|
||||
{0x02BF, 13}, {0x12BF, 13}, {0x0ABF, 13}, {0x1ABF, 13},
|
||||
{0x06BF, 13}, {0x16BF, 13}, {0x0EBF, 13}, {0x1EBF, 13},
|
||||
{0x01BF, 13}, {0x11BF, 13}, {0x09BF, 13}, {0x19BF, 13},
|
||||
{0x05BF, 13}, {0x15BF, 13}, {0x0DBF, 13}, {0x1DBF, 13},
|
||||
{0x03BF, 13}, {0x13BF, 13}, {0x0BBF, 13}, {0x1BBF, 13},
|
||||
{0x07BF, 13}, {0x17BF, 13}, {0x0FBF, 13}, {0x1FBF, 13},
|
||||
{0x007F, 14}, {0x207F, 14}, {0x107F, 14}, {0x307F, 14},
|
||||
{0x087F, 14}, {0x287F, 14}, {0x187F, 14}, {0x387F, 14},
|
||||
{0x047F, 14}, {0x247F, 14}, {0x147F, 14}, {0x0002, 3},
|
||||
{0x0011, 5}, {0x0005, 5}, {0x0015, 5}, {0x0003, 6},
|
||||
{0x003B, 6}, {0x0047, 8}, {0x00C7, 8}, {0x0017, 8},
|
||||
{0x00D7, 8}, {0x0077, 8}, {0x010F, 9}, {0x004F, 9},
|
||||
{0x01CF, 9}, {0x00AF, 9}, {0x016F, 9},
|
||||
{ 0x0000, 3 }, { 0x0004, 3 }, { 0x0006, 3 }, { 0x0001, 5 },
|
||||
{ 0x0009, 5 }, { 0x0019, 5 }, { 0x000D, 5 }, { 0x001D, 5 },
|
||||
{ 0x0023, 6 }, { 0x0013, 6 }, { 0x0033, 6 }, { 0x000B, 6 },
|
||||
{ 0x002B, 6 }, { 0x001B, 6 }, { 0x0007, 8 }, { 0x0087, 8 },
|
||||
{ 0x0027, 8 }, { 0x00A7, 8 }, { 0x0067, 8 }, { 0x00E7, 8 },
|
||||
{ 0x0097, 8 }, { 0x0057, 8 }, { 0x0037, 8 }, { 0x00B7, 8 },
|
||||
{ 0x00F7, 8 }, { 0x000F, 9 }, { 0x008F, 9 }, { 0x018F, 9 },
|
||||
{ 0x014F, 9 }, { 0x00CF, 9 }, { 0x002F, 9 }, { 0x012F, 9 },
|
||||
{ 0x01AF, 9 }, { 0x006F, 9 }, { 0x00EF, 9 }, { 0x01EF, 9 },
|
||||
{ 0x001F, 10 }, { 0x021F, 10 }, { 0x011F, 10 }, { 0x031F, 10 },
|
||||
{ 0x009F, 10 }, { 0x029F, 10 }, { 0x019F, 10 }, { 0x039F, 10 },
|
||||
{ 0x005F, 10 }, { 0x025F, 10 }, { 0x015F, 10 }, { 0x035F, 10 },
|
||||
{ 0x00DF, 10 }, { 0x02DF, 10 }, { 0x01DF, 10 }, { 0x03DF, 10 },
|
||||
{ 0x003F, 13 }, { 0x103F, 13 }, { 0x083F, 13 }, { 0x183F, 13 },
|
||||
{ 0x043F, 13 }, { 0x143F, 13 }, { 0x0C3F, 13 }, { 0x1C3F, 13 },
|
||||
{ 0x023F, 13 }, { 0x123F, 13 }, { 0x0A3F, 13 }, { 0x1A3F, 13 },
|
||||
{ 0x063F, 13 }, { 0x163F, 13 }, { 0x0E3F, 13 }, { 0x1E3F, 13 },
|
||||
{ 0x013F, 13 }, { 0x113F, 13 }, { 0x093F, 13 }, { 0x193F, 13 },
|
||||
{ 0x053F, 13 }, { 0x153F, 13 }, { 0x0D3F, 13 }, { 0x1D3F, 13 },
|
||||
{ 0x033F, 13 }, { 0x133F, 13 }, { 0x0B3F, 13 }, { 0x1B3F, 13 },
|
||||
{ 0x073F, 13 }, { 0x173F, 13 }, { 0x0F3F, 13 }, { 0x1F3F, 13 },
|
||||
{ 0x00BF, 13 }, { 0x10BF, 13 }, { 0x08BF, 13 }, { 0x18BF, 13 },
|
||||
{ 0x04BF, 13 }, { 0x14BF, 13 }, { 0x0CBF, 13 }, { 0x1CBF, 13 },
|
||||
{ 0x02BF, 13 }, { 0x12BF, 13 }, { 0x0ABF, 13 }, { 0x1ABF, 13 },
|
||||
{ 0x06BF, 13 }, { 0x16BF, 13 }, { 0x0EBF, 13 }, { 0x1EBF, 13 },
|
||||
{ 0x01BF, 13 }, { 0x11BF, 13 }, { 0x09BF, 13 }, { 0x19BF, 13 },
|
||||
{ 0x05BF, 13 }, { 0x15BF, 13 }, { 0x0DBF, 13 }, { 0x1DBF, 13 },
|
||||
{ 0x03BF, 13 }, { 0x13BF, 13 }, { 0x0BBF, 13 }, { 0x1BBF, 13 },
|
||||
{ 0x07BF, 13 }, { 0x17BF, 13 }, { 0x0FBF, 13 }, { 0x1FBF, 13 },
|
||||
{ 0x007F, 14 }, { 0x207F, 14 }, { 0x107F, 14 }, { 0x307F, 14 },
|
||||
{ 0x087F, 14 }, { 0x287F, 14 }, { 0x187F, 14 }, { 0x387F, 14 },
|
||||
{ 0x047F, 14 }, { 0x247F, 14 }, { 0x147F, 14 }, { 0x0002, 3 },
|
||||
{ 0x0011, 5 }, { 0x0005, 5 }, { 0x0015, 5 }, { 0x0003, 6 },
|
||||
{ 0x003B, 6 }, { 0x0047, 8 }, { 0x00C7, 8 }, { 0x0017, 8 },
|
||||
{ 0x00D7, 8 }, { 0x0077, 8 }, { 0x010F, 9 }, { 0x004F, 9 },
|
||||
{ 0x01CF, 9 }, { 0x00AF, 9 }, { 0x016F, 9 },
|
||||
#else
|
||||
{0x0000, 3}, {0x0001, 3}, {0x0003, 3}, {0x0010, 5},
|
||||
{0x0012, 5}, {0x0013, 5}, {0x0016, 5}, {0x0017, 5},
|
||||
{0x0031, 6}, {0x0032, 6}, {0x0033, 6}, {0x0034, 6},
|
||||
{0x0035, 6}, {0x0036, 6}, {0x00E0, 8}, {0x00E1, 8},
|
||||
{0x00E4, 8}, {0x00E5, 8}, {0x00E6, 8}, {0x00E7, 8},
|
||||
{0x00E9, 8}, {0x00EA, 8}, {0x00EC, 8}, {0x00ED, 8},
|
||||
{0x00EF, 8}, {0x01E0, 9}, {0x01E2, 9}, {0x01E3, 9},
|
||||
{0x01E5, 9}, {0x01E6, 9}, {0x01E8, 9}, {0x01E9, 9},
|
||||
{0x01EB, 9}, {0x01EC, 9}, {0x01EE, 9}, {0x01EF, 9},
|
||||
{0x03E0, 10}, {0x03E1, 10}, {0x03E2, 10}, {0x03E3, 10},
|
||||
{0x03E4, 10}, {0x03E5, 10}, {0x03E6, 10}, {0x03E7, 10},
|
||||
{0x03E8, 10}, {0x03E9, 10}, {0x03EA, 10}, {0x03EB, 10},
|
||||
{0x03EC, 10}, {0x03ED, 10}, {0x03EE, 10}, {0x03EF, 10},
|
||||
{0x1F80, 13}, {0x1F81, 13}, {0x1F82, 13}, {0x1F83, 13},
|
||||
{0x1F84, 13}, {0x1F85, 13}, {0x1F86, 13}, {0x1F87, 13},
|
||||
{0x1F88, 13}, {0x1F89, 13}, {0x1F8A, 13}, {0x1F8B, 13},
|
||||
{0x1F8C, 13}, {0x1F8D, 13}, {0x1F8E, 13}, {0x1F8F, 13},
|
||||
{0x1F90, 13}, {0x1F91, 13}, {0x1F92, 13}, {0x1F93, 13},
|
||||
{0x1F94, 13}, {0x1F95, 13}, {0x1F96, 13}, {0x1F97, 13},
|
||||
{0x1F98, 13}, {0x1F99, 13}, {0x1F9A, 13}, {0x1F9B, 13},
|
||||
{0x1F9C, 13}, {0x1F9D, 13}, {0x1F9E, 13}, {0x1F9F, 13},
|
||||
{0x1FA0, 13}, {0x1FA1, 13}, {0x1FA2, 13}, {0x1FA3, 13},
|
||||
{0x1FA4, 13}, {0x1FA5, 13}, {0x1FA6, 13}, {0x1FA7, 13},
|
||||
{0x1FA8, 13}, {0x1FA9, 13}, {0x1FAA, 13}, {0x1FAB, 13},
|
||||
{0x1FAC, 13}, {0x1FAD, 13}, {0x1FAE, 13}, {0x1FAF, 13},
|
||||
{0x1FB0, 13}, {0x1FB1, 13}, {0x1FB2, 13}, {0x1FB3, 13},
|
||||
{0x1FB4, 13}, {0x1FB5, 13}, {0x1FB6, 13}, {0x1FB7, 13},
|
||||
{0x1FB8, 13}, {0x1FB9, 13}, {0x1FBA, 13}, {0x1FBB, 13},
|
||||
{0x1FBC, 13}, {0x1FBD, 13}, {0x1FBE, 13}, {0x1FBF, 13},
|
||||
{0x3F80, 14}, {0x3F81, 14}, {0x3F82, 14}, {0x3F83, 14},
|
||||
{0x3F84, 14}, {0x3F85, 14}, {0x3F86, 14}, {0x3F87, 14},
|
||||
{0x3F88, 14}, {0x3F89, 14}, {0x3F8A, 14}, {0x0002, 3},
|
||||
{0x0011, 5}, {0x0014, 5}, {0x0015, 5}, {0x0030, 6},
|
||||
{0x0037, 6}, {0x00E2, 8}, {0x00E3, 8}, {0x00E8, 8},
|
||||
{0x00EB, 8}, {0x00EE, 8}, {0x01E1, 9}, {0x01E4, 9},
|
||||
{0x01E7, 9}, {0x01EA, 9}, {0x01ED, 9}
|
||||
{ 0x0000, 3 }, { 0x0001, 3 }, { 0x0003, 3 }, { 0x0010, 5 },
|
||||
{ 0x0012, 5 }, { 0x0013, 5 }, { 0x0016, 5 }, { 0x0017, 5 },
|
||||
{ 0x0031, 6 }, { 0x0032, 6 }, { 0x0033, 6 }, { 0x0034, 6 },
|
||||
{ 0x0035, 6 }, { 0x0036, 6 }, { 0x00E0, 8 }, { 0x00E1, 8 },
|
||||
{ 0x00E4, 8 }, { 0x00E5, 8 }, { 0x00E6, 8 }, { 0x00E7, 8 },
|
||||
{ 0x00E9, 8 }, { 0x00EA, 8 }, { 0x00EC, 8 }, { 0x00ED, 8 },
|
||||
{ 0x00EF, 8 }, { 0x01E0, 9 }, { 0x01E2, 9 }, { 0x01E3, 9 },
|
||||
{ 0x01E5, 9 }, { 0x01E6, 9 }, { 0x01E8, 9 }, { 0x01E9, 9 },
|
||||
{ 0x01EB, 9 }, { 0x01EC, 9 }, { 0x01EE, 9 }, { 0x01EF, 9 },
|
||||
{ 0x03E0, 10 }, { 0x03E1, 10 }, { 0x03E2, 10 }, { 0x03E3, 10 },
|
||||
{ 0x03E4, 10 }, { 0x03E5, 10 }, { 0x03E6, 10 }, { 0x03E7, 10 },
|
||||
{ 0x03E8, 10 }, { 0x03E9, 10 }, { 0x03EA, 10 }, { 0x03EB, 10 },
|
||||
{ 0x03EC, 10 }, { 0x03ED, 10 }, { 0x03EE, 10 }, { 0x03EF, 10 },
|
||||
{ 0x1F80, 13 }, { 0x1F81, 13 }, { 0x1F82, 13 }, { 0x1F83, 13 },
|
||||
{ 0x1F84, 13 }, { 0x1F85, 13 }, { 0x1F86, 13 }, { 0x1F87, 13 },
|
||||
{ 0x1F88, 13 }, { 0x1F89, 13 }, { 0x1F8A, 13 }, { 0x1F8B, 13 },
|
||||
{ 0x1F8C, 13 }, { 0x1F8D, 13 }, { 0x1F8E, 13 }, { 0x1F8F, 13 },
|
||||
{ 0x1F90, 13 }, { 0x1F91, 13 }, { 0x1F92, 13 }, { 0x1F93, 13 },
|
||||
{ 0x1F94, 13 }, { 0x1F95, 13 }, { 0x1F96, 13 }, { 0x1F97, 13 },
|
||||
{ 0x1F98, 13 }, { 0x1F99, 13 }, { 0x1F9A, 13 }, { 0x1F9B, 13 },
|
||||
{ 0x1F9C, 13 }, { 0x1F9D, 13 }, { 0x1F9E, 13 }, { 0x1F9F, 13 },
|
||||
{ 0x1FA0, 13 }, { 0x1FA1, 13 }, { 0x1FA2, 13 }, { 0x1FA3, 13 },
|
||||
{ 0x1FA4, 13 }, { 0x1FA5, 13 }, { 0x1FA6, 13 }, { 0x1FA7, 13 },
|
||||
{ 0x1FA8, 13 }, { 0x1FA9, 13 }, { 0x1FAA, 13 }, { 0x1FAB, 13 },
|
||||
{ 0x1FAC, 13 }, { 0x1FAD, 13 }, { 0x1FAE, 13 }, { 0x1FAF, 13 },
|
||||
{ 0x1FB0, 13 }, { 0x1FB1, 13 }, { 0x1FB2, 13 }, { 0x1FB3, 13 },
|
||||
{ 0x1FB4, 13 }, { 0x1FB5, 13 }, { 0x1FB6, 13 }, { 0x1FB7, 13 },
|
||||
{ 0x1FB8, 13 }, { 0x1FB9, 13 }, { 0x1FBA, 13 }, { 0x1FBB, 13 },
|
||||
{ 0x1FBC, 13 }, { 0x1FBD, 13 }, { 0x1FBE, 13 }, { 0x1FBF, 13 },
|
||||
{ 0x3F80, 14 }, { 0x3F81, 14 }, { 0x3F82, 14 }, { 0x3F83, 14 },
|
||||
{ 0x3F84, 14 }, { 0x3F85, 14 }, { 0x3F86, 14 }, { 0x3F87, 14 },
|
||||
{ 0x3F88, 14 }, { 0x3F89, 14 }, { 0x3F8A, 14 }, { 0x0002, 3 },
|
||||
{ 0x0011, 5 }, { 0x0014, 5 }, { 0x0015, 5 }, { 0x0030, 6 },
|
||||
{ 0x0037, 6 }, { 0x00E2, 8 }, { 0x00E3, 8 }, { 0x00E8, 8 },
|
||||
{ 0x00EB, 8 }, { 0x00EE, 8 }, { 0x01E1, 9 }, { 0x01E4, 9 },
|
||||
{ 0x01E7, 9 }, { 0x01EA, 9 }, { 0x01ED, 9 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static const uint8_t ir2_luma_table[256] = {
|
||||
0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
|
||||
0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
|
||||
0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
|
||||
0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
|
||||
0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
|
||||
0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
|
||||
0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
|
||||
0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
|
||||
0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
|
||||
0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
|
||||
0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
|
||||
0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
|
||||
0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
|
||||
0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
|
||||
0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
|
||||
0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
|
||||
0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
|
||||
0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
|
||||
0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
|
||||
0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
|
||||
0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
|
||||
0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
|
||||
0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
|
||||
0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
|
||||
0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
|
||||
0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
|
||||
0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
|
||||
0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
|
||||
0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
|
||||
0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
|
||||
0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
|
||||
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80
|
||||
static const uint8_t ir2_delta_table[4][256] = {
|
||||
{ 0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
|
||||
0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
|
||||
0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
|
||||
0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
|
||||
0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
|
||||
0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
|
||||
0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
|
||||
0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
|
||||
0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
|
||||
0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
|
||||
0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
|
||||
0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
|
||||
0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
|
||||
0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
|
||||
0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
|
||||
0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
|
||||
0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
|
||||
0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
|
||||
0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
|
||||
0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
|
||||
0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
|
||||
0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
|
||||
0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
|
||||
0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
|
||||
0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
|
||||
0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
|
||||
0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
|
||||
0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
|
||||
0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
|
||||
0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
|
||||
0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
|
||||
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x85, 0x85, 0x7B, 0x7B, 0x7E, 0x87,
|
||||
0x82, 0x79, 0x87, 0x7E, 0x79, 0x82, 0x8F, 0x8F,
|
||||
0x71, 0x71, 0x84, 0x8F, 0x7C, 0x71, 0x8F, 0x84,
|
||||
0x71, 0x7C, 0x75, 0x8B, 0x8B, 0x75, 0x8B, 0x75,
|
||||
0x75, 0x8B, 0x8E, 0x9A, 0x72, 0x66, 0x9A, 0x8E,
|
||||
0x66, 0x72, 0x7B, 0x93, 0x85, 0x6D, 0x93, 0x7B,
|
||||
0x6D, 0x85, 0x9B, 0x9B, 0x65, 0x65, 0x82, 0x9D,
|
||||
0x7E, 0x63, 0x9D, 0x82, 0x63, 0x7E, 0x9B, 0xA8,
|
||||
0x65, 0x58, 0xA8, 0x9B, 0x58, 0x65, 0xA9, 0xA9,
|
||||
0x57, 0x57, 0x8D, 0xAA, 0x73, 0x56, 0xAA, 0x8D,
|
||||
0x56, 0x73, 0x6E, 0x99, 0x92, 0x67, 0x99, 0x6E,
|
||||
0x67, 0x92, 0x76, 0xA2, 0x8A, 0x5E, 0xA2, 0x76,
|
||||
0x5E, 0x8A, 0x7F, 0xAF, 0x81, 0x51, 0xAF, 0x7F,
|
||||
0x51, 0x81, 0xAB, 0xBA, 0x55, 0x46, 0xBA, 0xAB,
|
||||
0x46, 0x55, 0x9A, 0xBB, 0x66, 0x45, 0xBB, 0x9A,
|
||||
0x45, 0x66, 0xBB, 0xBB, 0x45, 0x45, 0x60, 0xA0,
|
||||
0xA0, 0x60, 0xA0, 0x60, 0x60, 0xA0, 0x8B, 0xBE,
|
||||
0x75, 0x42, 0xBE, 0x8B, 0x42, 0x75, 0x66, 0xAA,
|
||||
0x9A, 0x56, 0xAA, 0x66, 0x56, 0x9A, 0x70, 0xB5,
|
||||
0x90, 0x4B, 0xB5, 0x70, 0x4B, 0x90, 0xBE, 0xCF,
|
||||
0x42, 0x31, 0xCF, 0xBE, 0x31, 0x42, 0xAB, 0xD0,
|
||||
0x55, 0x30, 0xD0, 0xAB, 0x30, 0x55, 0xD1, 0xD1,
|
||||
0x2F, 0x2F, 0x9A, 0xD3, 0x66, 0x2D, 0xD3, 0x9A,
|
||||
0x2D, 0x66, 0x7B, 0xC5, 0x85, 0x3B, 0xC5, 0x7B,
|
||||
0x3B, 0x85, 0x54, 0xB4, 0xAC, 0x4C, 0xB4, 0x54,
|
||||
0x4C, 0xAC, 0x5E, 0xBE, 0xA2, 0x42, 0xBE, 0x5E,
|
||||
0x42, 0xA2, 0x87, 0xD8, 0x79, 0x28, 0xD8, 0x87,
|
||||
0x28, 0x79, 0xC0, 0xE8, 0x40, 0x18, 0xE8, 0xC0,
|
||||
0x18, 0x40, 0xD5, 0xE8, 0x2B, 0x18, 0xE8, 0xD5,
|
||||
0x18, 0x2B, 0xAB, 0xE9, 0x55, 0x17, 0xE9, 0xAB,
|
||||
0x17, 0x55, 0x68, 0xCD, 0x98, 0x33, 0xCD, 0x68,
|
||||
0x33, 0x98, 0xEA, 0xEA, 0x16, 0x16, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x86, 0x86, 0x7A, 0x7A, 0x7E, 0x88,
|
||||
0x82, 0x78, 0x88, 0x7E, 0x78, 0x82, 0x92, 0x92,
|
||||
0x6E, 0x6E, 0x85, 0x92, 0x7B, 0x6E, 0x92, 0x85,
|
||||
0x6E, 0x7B, 0x73, 0x8D, 0x8D, 0x73, 0x8D, 0x73,
|
||||
0x73, 0x8D, 0x91, 0x9E, 0x6F, 0x62, 0x9E, 0x91,
|
||||
0x62, 0x6F, 0x79, 0x97, 0x87, 0x69, 0x97, 0x79,
|
||||
0x69, 0x87, 0xA0, 0xA0, 0x60, 0x60, 0x83, 0xA2,
|
||||
0x7D, 0x5E, 0xA2, 0x83, 0x5E, 0x7D, 0xA0, 0xB0,
|
||||
0x60, 0x50, 0xB0, 0xA0, 0x50, 0x60, 0xB1, 0xB1,
|
||||
0x4F, 0x4F, 0x8F, 0xB2, 0x71, 0x4E, 0xB2, 0x8F,
|
||||
0x4E, 0x71, 0x6B, 0x9E, 0x95, 0x62, 0x9E, 0x6B,
|
||||
0x62, 0x95, 0x74, 0xA9, 0x8C, 0x57, 0xA9, 0x74,
|
||||
0x57, 0x8C, 0x7F, 0xB8, 0x81, 0x48, 0xB8, 0x7F,
|
||||
0x48, 0x81, 0xB4, 0xC5, 0x4C, 0x3B, 0xC5, 0xB4,
|
||||
0x3B, 0x4C, 0x9F, 0xC6, 0x61, 0x3A, 0xC6, 0x9F,
|
||||
0x3A, 0x61, 0xC6, 0xC6, 0x3A, 0x3A, 0x59, 0xA7,
|
||||
0xA7, 0x59, 0xA7, 0x59, 0x59, 0xA7, 0x8D, 0xCA,
|
||||
0x73, 0x36, 0xCA, 0x8D, 0x36, 0x73, 0x61, 0xB2,
|
||||
0x9F, 0x4E, 0xB2, 0x61, 0x4E, 0x9F, 0x6D, 0xBF,
|
||||
0x93, 0x41, 0xBF, 0x6D, 0x41, 0x93, 0xCA, 0xDF,
|
||||
0x36, 0x21, 0xDF, 0xCA, 0x21, 0x36, 0xB3, 0xDF,
|
||||
0x4D, 0x21, 0xDF, 0xB3, 0x21, 0x4D, 0xE1, 0xE1,
|
||||
0x1F, 0x1F, 0x9F, 0xE3, 0x61, 0x1D, 0xE3, 0x9F,
|
||||
0x1D, 0x61, 0x7A, 0xD3, 0x86, 0x2D, 0xD3, 0x7A,
|
||||
0x2D, 0x86, 0x4C, 0xBE, 0xB4, 0x42, 0xBE, 0x4C,
|
||||
0x42, 0xB4, 0x57, 0xCA, 0xA9, 0x36, 0xCA, 0x57,
|
||||
0x36, 0xA9, 0x88, 0xE9, 0x78, 0x17, 0xE9, 0x88,
|
||||
0x17, 0x78, 0xCC, 0xFB, 0x34, 0x05, 0xFB, 0xCC,
|
||||
0x05, 0x34, 0xE6, 0xFB, 0x1A, 0x05, 0xFB, 0xE6,
|
||||
0x05, 0x1A, 0xB4, 0xFD, 0x4C, 0x03, 0xFD, 0xB4,
|
||||
0x03, 0x4C, 0x63, 0xDC, 0x9D, 0x24, 0xDC, 0x63,
|
||||
0x24, 0x9D, 0xFE, 0xFE, 0x02, 0x02, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x87, 0x87, 0x79, 0x79, 0x7E, 0x89,
|
||||
0x82, 0x77, 0x89, 0x7E, 0x77, 0x82, 0x95, 0x95,
|
||||
0x6B, 0x6B, 0x86, 0x96, 0x7A, 0x6A, 0x96, 0x86,
|
||||
0x6A, 0x7A, 0x70, 0x90, 0x90, 0x70, 0x90, 0x70,
|
||||
0x70, 0x90, 0x94, 0xA4, 0x6C, 0x5C, 0xA4, 0x94,
|
||||
0x5C, 0x6C, 0x78, 0x9B, 0x88, 0x65, 0x9B, 0x78,
|
||||
0x65, 0x88, 0xA6, 0xA6, 0x5A, 0x5A, 0x83, 0xA9,
|
||||
0x7D, 0x57, 0xA9, 0x83, 0x57, 0x7D, 0xA6, 0xB9,
|
||||
0x5A, 0x47, 0xB9, 0xA6, 0x47, 0x5A, 0xBA, 0xBA,
|
||||
0x46, 0x46, 0x92, 0xBC, 0x6E, 0x44, 0xBC, 0x92,
|
||||
0x44, 0x6E, 0x67, 0xA3, 0x99, 0x5D, 0xA3, 0x67,
|
||||
0x5D, 0x99, 0x72, 0xB0, 0x8E, 0x50, 0xB0, 0x72,
|
||||
0x50, 0x8E, 0x7F, 0xC3, 0x81, 0x3D, 0xC3, 0x7F,
|
||||
0x3D, 0x81, 0xBE, 0xD2, 0x42, 0x2E, 0xD2, 0xBE,
|
||||
0x2E, 0x42, 0xA5, 0xD4, 0x5B, 0x2C, 0xD4, 0xA5,
|
||||
0x2C, 0x5B, 0xD4, 0xD4, 0x2C, 0x2C, 0x52, 0xAE,
|
||||
0xAE, 0x52, 0xAE, 0x52, 0x52, 0xAE, 0x8F, 0xD8,
|
||||
0x71, 0x28, 0xD8, 0x8F, 0x28, 0x71, 0x5B, 0xBB,
|
||||
0xA5, 0x45, 0xBB, 0x5B, 0x45, 0xA5, 0x69, 0xCB,
|
||||
0x97, 0x35, 0xCB, 0x69, 0x35, 0x97, 0xD8, 0xF0,
|
||||
0x28, 0x10, 0xF0, 0xD8, 0x10, 0x28, 0xBD, 0xF1,
|
||||
0x43, 0x0F, 0xF1, 0xBD, 0x0F, 0x43, 0xF3, 0xF3,
|
||||
0x0D, 0x0D, 0xA5, 0xF6, 0x5B, 0x0A, 0xF6, 0xA5,
|
||||
0x0A, 0x5B, 0x78, 0xE2, 0x88, 0x1E, 0xE2, 0x78,
|
||||
0x1E, 0x88, 0x42, 0xC9, 0xBE, 0x37, 0xC9, 0x42,
|
||||
0x37, 0xBE, 0x4F, 0xD8, 0xB1, 0x28, 0xD8, 0x4F,
|
||||
0x28, 0xB1, 0x8A, 0xFD, 0x76, 0x03, 0xFD, 0x8A,
|
||||
0x03, 0x76, 0xDB, 0xFF, 0x25, 0x01, 0xFF, 0xDB,
|
||||
0x01, 0x25, 0xF9, 0xFF, 0x07, 0x01, 0xFF, 0xF9,
|
||||
0x01, 0x07, 0xBE, 0xFF, 0x42, 0x01, 0xFF, 0xBE,
|
||||
0x01, 0x42, 0x5E, 0xED, 0xA2, 0x13, 0xED, 0x5E,
|
||||
0x13, 0xA2, 0xFF, 0xFF, 0x01, 0x01, 0x80, 0x80, },
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_INDEO2DATA_H */
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avcodec.h"
|
||||
#include "bytestream.h"
|
||||
#include "hpeldsp.h"
|
||||
@@ -949,7 +950,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s, AVFrame *frame)
|
||||
}
|
||||
}
|
||||
if (bytestream2_get_bytes_left(&s->stream_ptr) > 1) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
av_log(s->avctx, AV_LOG_DEBUG,
|
||||
"decode finished with %d bytes left over\n",
|
||||
bytestream2_get_bytes_left(&s->stream_ptr));
|
||||
}
|
||||
@@ -987,31 +988,38 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
AVFrame *frame = data;
|
||||
int ret;
|
||||
|
||||
/* decoding map contains 4 bits of information per 8x8 block */
|
||||
s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
|
||||
|
||||
/* compressed buffer needs to be large enough to at least hold an entire
|
||||
* decoding map */
|
||||
if (buf_size < s->decoding_map_size)
|
||||
return buf_size;
|
||||
|
||||
if (av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, NULL)) {
|
||||
av_frame_unref(s->last_frame);
|
||||
av_frame_unref(s->second_last_frame);
|
||||
}
|
||||
|
||||
s->decoding_map = buf;
|
||||
bytestream2_init(&s->stream_ptr, buf + s->decoding_map_size,
|
||||
if (buf_size < 2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* decoding map contains 4 bits of information per 8x8 block */
|
||||
s->decoding_map_size = AV_RL16(avpkt->data);
|
||||
|
||||
/* compressed buffer needs to be large enough to at least hold an entire
|
||||
* decoding map */
|
||||
if (buf_size < s->decoding_map_size + 2)
|
||||
return buf_size;
|
||||
|
||||
|
||||
s->decoding_map = buf + 2;
|
||||
bytestream2_init(&s->stream_ptr, buf + 2 + s->decoding_map_size,
|
||||
buf_size - s->decoding_map_size);
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||
return ret;
|
||||
|
||||
if (!s->is_16bpp) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
if (pal) {
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ static int h263_decode_gob_header(MpegEncContext *s)
|
||||
/* We have a GBSC probably with GSTUFF */
|
||||
skip_bits(&s->gb, 16); /* Drop the zeros */
|
||||
left= get_bits_left(&s->gb);
|
||||
left = FFMIN(left, 32);
|
||||
//MN: we must check the bits left or we might end in a infinite loop (or segfault)
|
||||
for(;left>13; left--){
|
||||
if(get_bits1(&s->gb)) break; /* Seek the '1' bit */
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/**
|
||||
* Table of number of bits a motion vector component needs.
|
||||
*/
|
||||
static uint8_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
|
||||
static uint8_t mv_penalty[MAX_FCODE+1][MAX_DMV*2+1];
|
||||
|
||||
/**
|
||||
* Minimal fcode that a motion vector component would need.
|
||||
@@ -678,7 +678,7 @@ static av_cold void init_mv_penalty_and_fcode(MpegEncContext *s)
|
||||
int mv;
|
||||
|
||||
for(f_code=1; f_code<=MAX_FCODE; f_code++){
|
||||
for(mv=-MAX_MV; mv<=MAX_MV; mv++){
|
||||
for(mv=-MAX_DMV; mv<=MAX_DMV; mv++){
|
||||
int len;
|
||||
|
||||
if(mv==0) len= ff_mvtab[0][1];
|
||||
@@ -699,7 +699,7 @@ static av_cold void init_mv_penalty_and_fcode(MpegEncContext *s)
|
||||
}
|
||||
}
|
||||
|
||||
mv_penalty[f_code][mv+MAX_MV]= len;
|
||||
mv_penalty[f_code][mv+MAX_DMV]= len;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user