Compare commits
499 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b33d01d8a2 | ||
|
|
dac9ef7108 | ||
|
|
f2afdab8e4 | ||
|
|
abe2d4de92 | ||
|
|
30415662ef | ||
|
|
c54a76bf71 | ||
|
|
676ba8eff8 | ||
|
|
cf44f0ae6a | ||
|
|
a1627fe928 | ||
|
|
a1babbd4de | ||
|
|
c32237e948 | ||
|
|
28f2341e2f | ||
|
|
e79851f2e7 | ||
|
|
dcbebc931e | ||
|
|
e05148dfe6 | ||
|
|
cd4674f608 | ||
|
|
55d320ddf8 | ||
|
|
ec7206fdf8 | ||
|
|
9cd39ab7d3 | ||
|
|
c82ea252e3 | ||
|
|
2790054dc2 | ||
|
|
8198258d9e | ||
|
|
edf7bd14a8 | ||
|
|
98dff828d8 | ||
|
|
0246760e94 | ||
|
|
a359138fb3 | ||
|
|
eeece50aa2 | ||
|
|
e2fd01c282 | ||
|
|
99cbee2a2f | ||
|
|
49109b0c6f | ||
|
|
4ffab6703b | ||
|
|
52f4c9c31f | ||
|
|
e1fcdf1930 | ||
|
|
f857975bfd | ||
|
|
09ac75c47c | ||
|
|
c24bff130d | ||
|
|
f8502c267f | ||
|
|
113bba3a2a | ||
|
|
03b8d285df | ||
|
|
4bc3ae5533 | ||
|
|
d302803c39 | ||
|
|
86a7a933fc | ||
|
|
b2d2e59174 | ||
|
|
43965feca7 | ||
|
|
188e015c7b | ||
|
|
a53182a71c | ||
|
|
b8c80b9d2d | ||
|
|
d75f932e77 | ||
|
|
07e8da34fa | ||
|
|
47c6f1b600 | ||
|
|
ddc77f1f1e | ||
|
|
3cb8d1f2c1 | ||
|
|
ee12581551 | ||
|
|
3812e40894 | ||
|
|
c0744d7549 | ||
|
|
743c419a59 | ||
|
|
7b4d0a2402 | ||
|
|
00e8a7adf4 | ||
|
|
742ccace7c | ||
|
|
7956757d7d | ||
|
|
70cc62271b | ||
|
|
4800f38ffb | ||
|
|
dfda82809c | ||
|
|
c1a6521df8 | ||
|
|
0fed5947bd | ||
|
|
bac7b59542 | ||
|
|
c152707dc1 | ||
|
|
de5b23ead6 | ||
|
|
154c73b63e | ||
|
|
3724f36b09 | ||
|
|
6cb55a7032 | ||
|
|
6c15025dee | ||
|
|
386767ecea | ||
|
|
6b334460de | ||
|
|
f903400a0b | ||
|
|
51e4936798 | ||
|
|
e4b1426e1b | ||
|
|
9320f86494 | ||
|
|
d55d821b9e | ||
|
|
d93c75f037 | ||
|
|
87c1cff598 | ||
|
|
c4371e8b2f | ||
|
|
9371fef23c | ||
|
|
95700803f4 | ||
|
|
2d8a3daddb | ||
|
|
7465d229cb | ||
|
|
0caf6fa51e | ||
|
|
74f35b9d5e | ||
|
|
daa9bca16b | ||
|
|
05b8e57aba | ||
|
|
c99e86556c | ||
|
|
a5c7c22c66 | ||
|
|
6f57b9d715 | ||
|
|
9f4e2b15e0 | ||
|
|
65ec573358 | ||
|
|
969689d7d7 | ||
|
|
94a58e597b | ||
|
|
c78e5a2cb4 | ||
|
|
903c4b2c3c | ||
|
|
1e034a9ffe | ||
|
|
93702fd208 | ||
|
|
317c043316 | ||
|
|
4a58c5a3b9 | ||
|
|
d0947505dc | ||
|
|
c93df94fe3 | ||
|
|
e488ad44aa | ||
|
|
2871d8dbb5 | ||
|
|
add1e9c371 | ||
|
|
c4ae78ef06 | ||
|
|
ca6277e1ee | ||
|
|
8054b21f8d | ||
|
|
2fe493ed72 | ||
|
|
7d0830c546 | ||
|
|
27fbb554fc | ||
|
|
d0ac194ea4 | ||
|
|
79d027ae7c | ||
|
|
32f047ce5c | ||
|
|
4a6426d3cb | ||
|
|
487ea209f8 | ||
|
|
6828048800 | ||
|
|
53c2b81281 | ||
|
|
b2af4884a9 | ||
|
|
345ae4e8df | ||
|
|
b3328c069c | ||
|
|
8bca0d7651 | ||
|
|
19a58a10fd | ||
|
|
b1d5c2de2b | ||
|
|
351dc1f33a | ||
|
|
70e26e9c25 | ||
|
|
ed0c3290f8 | ||
|
|
98f93f5272 | ||
|
|
0cbd48a38b | ||
|
|
408242556c | ||
|
|
cc4a13b8a7 | ||
|
|
0a13449b28 | ||
|
|
f1e6c03739 | ||
|
|
fd5f357461 | ||
|
|
72b968361b | ||
|
|
6a70c38e39 | ||
|
|
5e69ec6c2f | ||
|
|
9ff9e3931b | ||
|
|
8df6363188 | ||
|
|
bb0baaf580 | ||
|
|
7b91d4f07b | ||
|
|
625044336e | ||
|
|
8b4386ab87 | ||
|
|
e4d5f9bf93 | ||
|
|
41beb7297f | ||
|
|
b7239fec9d | ||
|
|
f458d65bb4 | ||
|
|
868de78861 | ||
|
|
a44c53f8d7 | ||
|
|
ab92ed6365 | ||
|
|
20c36f04b9 | ||
|
|
250d2b402a | ||
|
|
e8fb38f48c | ||
|
|
5a4709e9e3 | ||
|
|
6da1353a5a | ||
|
|
89ffe4e0e0 | ||
|
|
2e7621d615 | ||
|
|
c66899d5e4 | ||
|
|
99696ad046 | ||
|
|
d6419e984f | ||
|
|
a9d1e7d3c8 | ||
|
|
37400a9068 | ||
|
|
a18c76cb78 | ||
|
|
97bbd8e8d3 | ||
|
|
2fd1ab16d9 | ||
|
|
9a891b843c | ||
|
|
bb4ca14d13 | ||
|
|
537b2b8ab5 | ||
|
|
a132c3f3be | ||
|
|
404fbd980b | ||
|
|
9f225bbcab | ||
|
|
f4f5f69082 | ||
|
|
a38d6d36a8 | ||
|
|
e11e2574c7 | ||
|
|
5740278de2 | ||
|
|
49130f4145 | ||
|
|
8b644b9563 | ||
|
|
067bd9877f | ||
|
|
095449d272 | ||
|
|
f6908d087e | ||
|
|
3c8c0c0162 | ||
|
|
336a4c5f79 | ||
|
|
674cd62f07 | ||
|
|
065440d96b | ||
|
|
90f7b5fd16 | ||
|
|
7aaac74f58 | ||
|
|
783ba62dae | ||
|
|
fe27d3f02f | ||
|
|
0465fc58e8 | ||
|
|
1f4f22eb0f | ||
|
|
5cfd259820 | ||
|
|
d5cdae9e35 | ||
|
|
48706b9fef | ||
|
|
4c97b79cf5 | ||
|
|
2423dd9656 | ||
|
|
dffd455b9b | ||
|
|
9b6af4561b | ||
|
|
c63e587566 | ||
|
|
b5c13002d1 | ||
|
|
a5dabd4013 | ||
|
|
3295d22f3a | ||
|
|
dc1e099bf2 | ||
|
|
4f7064c9da | ||
|
|
bb504aa5eb | ||
|
|
4730d0d385 | ||
|
|
be0e26d107 | ||
|
|
e8b94e5ce4 | ||
|
|
c595b1da4f | ||
|
|
f9a96bac28 | ||
|
|
9797929749 | ||
|
|
dfca37f0e5 | ||
|
|
a71d22d84d | ||
|
|
44eaff5e6d | ||
|
|
cfbab85809 | ||
|
|
3e03d12c83 | ||
|
|
02323b1d02 | ||
|
|
99c78466ff | ||
|
|
a6639334df | ||
|
|
72d5addc0b | ||
|
|
a0b7a3c8aa | ||
|
|
c4b36ccd02 | ||
|
|
198c8924c6 | ||
|
|
4535861ef8 | ||
|
|
1a168061da | ||
|
|
76961f4f42 | ||
|
|
7dd1cc6076 | ||
|
|
667c9ed1f1 | ||
|
|
efa164aa68 | ||
|
|
7c68d5e701 | ||
|
|
0bcc7ea5dc | ||
|
|
b408dba231 | ||
|
|
c1435f9dfb | ||
|
|
726faff0aa | ||
|
|
2e3f0a1c6f | ||
|
|
1768e02a04 | ||
|
|
e0d1db72da | ||
|
|
a5513ae7bc | ||
|
|
9c0b2b9d5b | ||
|
|
d111c9ce13 | ||
|
|
6e1bc747df | ||
|
|
2c6792b0c6 | ||
|
|
66bf84e2c4 | ||
|
|
9f7eb718e9 | ||
|
|
2d66fbc853 | ||
|
|
2f26f3de78 | ||
|
|
e9003828dd | ||
|
|
66e8f87ebc | ||
|
|
6bee6ef0c2 | ||
|
|
ff01dbb6ec | ||
|
|
2caee48576 | ||
|
|
63caf18787 | ||
|
|
8ad4e1c1cb | ||
|
|
27fbf8f110 | ||
|
|
3f9a24f06d | ||
|
|
083919e9c4 | ||
|
|
bc63205ae2 | ||
|
|
4251dc6d7e | ||
|
|
8fd3293fa1 | ||
|
|
7affe32738 | ||
|
|
1bc7215e8a | ||
|
|
51aa6d0987 | ||
|
|
136fc7084e | ||
|
|
adc86ad32f | ||
|
|
e0dd617ed7 | ||
|
|
9cab9b878f | ||
|
|
3549871847 | ||
|
|
9ec40eacb1 | ||
|
|
8cca6b06ec | ||
|
|
642cd5de4d | ||
|
|
d54aa2de17 | ||
|
|
bab7d72d46 | ||
|
|
9128ef0302 | ||
|
|
86f5b73429 | ||
|
|
9375a7d85e | ||
|
|
e8ab2bd2ac | ||
|
|
45b18fbb9a | ||
|
|
0496403c08 | ||
|
|
88bf1d2749 | ||
|
|
dbad792487 | ||
|
|
5d2f1ffef1 | ||
|
|
80b85300ae | ||
|
|
48d24cca13 | ||
|
|
1c282152c1 | ||
|
|
4ffd5805af | ||
|
|
57665e04e2 | ||
|
|
48496e4d4f | ||
|
|
e93934e100 | ||
|
|
b32c9941a2 | ||
|
|
69673d0279 | ||
|
|
3047b0a4a3 | ||
|
|
27888d13b8 | ||
|
|
416a8a06b9 | ||
|
|
e14cc2f197 | ||
|
|
05e6606ba9 | ||
|
|
c3307f7e9e | ||
|
|
3d82cebdd2 | ||
|
|
5801482379 | ||
|
|
e6197a6ce9 | ||
|
|
e78d9f3f35 | ||
|
|
ef2d91e9c3 | ||
|
|
dcc8d2418a | ||
|
|
087b777415 | ||
|
|
aca7f5f060 | ||
|
|
aa32d41527 | ||
|
|
a1e6daeb1e | ||
|
|
30d542d55d | ||
|
|
1d439041ec | ||
|
|
0009cf348a | ||
|
|
492bbe5890 | ||
|
|
5771a0c823 | ||
|
|
f309b698e6 | ||
|
|
0887f1835d | ||
|
|
de42af2bee | ||
|
|
ada229e66f | ||
|
|
047e0049d1 | ||
|
|
88f52f2f8f | ||
|
|
8baf2d8fad | ||
|
|
17b8e7799f | ||
|
|
6457346e6a | ||
|
|
27f1fb1251 | ||
|
|
c993a11e56 | ||
|
|
ef5b120e2d | ||
|
|
b9a1d389b2 | ||
|
|
8c43f32057 | ||
|
|
77d5a237ef | ||
|
|
fb7617df4e | ||
|
|
82b58841c9 | ||
|
|
e5bf7ab3e7 | ||
|
|
63f951601e | ||
|
|
7fefa4138d | ||
|
|
a1f77124c8 | ||
|
|
f2f7d49f41 | ||
|
|
9357aa6757 | ||
|
|
26a8fc1c00 | ||
|
|
b7b3b0086d | ||
|
|
d669b7f4f6 | ||
|
|
9259b7f38e | ||
|
|
cb8a29f872 | ||
|
|
6744d3f6b9 | ||
|
|
73b644cdee | ||
|
|
3512ed3622 | ||
|
|
1d90326f95 | ||
|
|
1b47c278a6 | ||
|
|
cd91aaa4cc | ||
|
|
2858f77fd4 | ||
|
|
fe7366ee93 | ||
|
|
4ab41164d2 | ||
|
|
d794d97d96 | ||
|
|
93534cd642 | ||
|
|
ca92adafb0 | ||
|
|
815a4439c3 | ||
|
|
17035c8d2e | ||
|
|
426b959e37 | ||
|
|
61fcba7546 | ||
|
|
66bd740e0b | ||
|
|
534dc63089 | ||
|
|
09d1854063 | ||
|
|
ab9616428a | ||
|
|
e7c00a2814 | ||
|
|
2a8441e949 | ||
|
|
7876fd679d | ||
|
|
8b3d9c33d6 | ||
|
|
c575726621 | ||
|
|
6e6609f5dd | ||
|
|
6e13acaadd | ||
|
|
a5680d83af | ||
|
|
811d560378 | ||
|
|
c34f0616d9 | ||
|
|
96ce6f64cc | ||
|
|
13b6852225 | ||
|
|
d13ba39606 | ||
|
|
19b86db2b3 | ||
|
|
694d37eb52 | ||
|
|
4e5d1c45f1 | ||
|
|
2577cfd207 | ||
|
|
280587b4ab | ||
|
|
5bf11223dd | ||
|
|
679e869496 | ||
|
|
7216068e42 | ||
|
|
e7a064efa6 | ||
|
|
a004e2e4f1 | ||
|
|
f50f7adf7a | ||
|
|
9cf85419a3 | ||
|
|
b3fe93e73b | ||
|
|
603fd4f771 | ||
|
|
76a239768f | ||
|
|
fca62cc6a7 | ||
|
|
9f1e8b4fb2 | ||
|
|
b2a2b1a88b | ||
|
|
f3c1a76ffd | ||
|
|
b62191f9c1 | ||
|
|
21c36d83f8 | ||
|
|
4774eb8128 | ||
|
|
96f5019bde | ||
|
|
bffe1c4222 | ||
|
|
fbdf5ca763 | ||
|
|
c6470d8193 | ||
|
|
e5942c1436 | ||
|
|
dab82a2a7c | ||
|
|
7f864badc0 | ||
|
|
cc1e01d8b6 | ||
|
|
69c3dfdd54 | ||
|
|
241f1e603f | ||
|
|
4d9fdca053 | ||
|
|
b11900251f | ||
|
|
145b18ce9a | ||
|
|
e5d167149d | ||
|
|
ed71759fd0 | ||
|
|
d7ae13d479 | ||
|
|
1cd872a7d5 | ||
|
|
f6586db165 | ||
|
|
7c43c48fda | ||
|
|
069eea16d9 | ||
|
|
79181b97d4 | ||
|
|
46360e36d9 | ||
|
|
ef2b8416d9 | ||
|
|
9491f47035 | ||
|
|
2fc7e5c1b5 | ||
|
|
68dcb46205 | ||
|
|
8dce66d33d | ||
|
|
08c21bcb5d | ||
|
|
e675926a4f | ||
|
|
c66f4d1ae6 | ||
|
|
ad559492dc | ||
|
|
8d0cfa68b9 | ||
|
|
83eaaae005 | ||
|
|
a5638dbfba | ||
|
|
666754c665 | ||
|
|
4c896d6bd4 | ||
|
|
f2e9e4757f | ||
|
|
512c064cd9 | ||
|
|
7626fb6cbf | ||
|
|
6fdd122b11 | ||
|
|
264c9fe6aa | ||
|
|
76573c5239 | ||
|
|
14fdebc4ff | ||
|
|
325d0b64d5 | ||
|
|
6103a8453f | ||
|
|
47f0d80ee0 | ||
|
|
5d79566ab3 | ||
|
|
fda00aa774 | ||
|
|
9b1b674ebe | ||
|
|
00b54d4625 | ||
|
|
26d29f0c3d | ||
|
|
7b1e020fc5 | ||
|
|
3d9ebfd272 | ||
|
|
f01919b57a | ||
|
|
6cb5bbc660 | ||
|
|
f281cb4ea9 | ||
|
|
b176ab0556 | ||
|
|
1cbe4ff2ac | ||
|
|
7c2576e15d | ||
|
|
526c7b2186 | ||
|
|
2d0e415482 | ||
|
|
daa6dc0a3b | ||
|
|
6e5648ad42 | ||
|
|
e15a48d35a | ||
|
|
0fae52d7e3 | ||
|
|
50a639a62a | ||
|
|
d6adcab842 | ||
|
|
bf80b1d88d | ||
|
|
53fffc9fc4 | ||
|
|
b0e836466f | ||
|
|
e158936712 | ||
|
|
c8977ec6e9 | ||
|
|
934bc32acc | ||
|
|
64f2b48be0 | ||
|
|
756f4b586a | ||
|
|
56c4dca5ae | ||
|
|
da6ccfe18e | ||
|
|
27a61302b7 | ||
|
|
b4be953c55 | ||
|
|
3b179b6302 | ||
|
|
bf8f2fae2a | ||
|
|
0d7343f8dd | ||
|
|
fb8676eb1c | ||
|
|
ca5c639446 | ||
|
|
bd79dbfa2b | ||
|
|
c4765a41b9 | ||
|
|
be5acd6cb1 | ||
|
|
c3e7a7ef3f | ||
|
|
9e4d297ba7 | ||
|
|
373bc77a35 | ||
|
|
20d89a3a32 | ||
|
|
ee7c347935 | ||
|
|
9da31a0373 | ||
|
|
eb46065f4a | ||
|
|
b80083a5c1 | ||
|
|
449ff0e3fd | ||
|
|
0aa2fbddb1 | ||
|
|
c40983a6f6 | ||
|
|
bd0497b28b | ||
|
|
4d95207938 | ||
|
|
1e8a75fae4 | ||
|
|
380980e0d2 | ||
|
|
1fd8eb4d4f |
479
Changelog
479
Changelog
@@ -1,7 +1,482 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
version 3.0.8
|
||||
- avcodec/aacdec: Fix runtime error: signed integer overflow: 2147483520 + 255 cannot be represented in type 'int'
|
||||
- avcodec/aacdec_template: Fix fixed point scale in decode_cce()
|
||||
- avcodec/flicvideo: Check frame_size before decrementing
|
||||
- avcodec/mlpdec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/takdec: Fix runtime error: left shift of negative value -42
|
||||
- avcodec/hq_hqa: Fix: runtime error: signed integer overflow: -255 * 10180917 cannot be represented in type 'int'
|
||||
- avcodec/truemotion1: Fix multiple runtime error: signed integer overflow: 1246906962 * 2 cannot be represented in type 'int'
|
||||
- avcodec/svq3: Fix runtime error: left shift of negative value -6
|
||||
- avcodec/tiff: reset sampling[] if its invalid
|
||||
- avcodec/aacps: Fix undefined behavior
|
||||
- avcodec/opus_silk: Fix integer overflow and out of array read
|
||||
- avcodec/flacdec: Return error code instead of 0 for failures
|
||||
- avcodec/snowdec: Check width
|
||||
- avcodec/webp: Update canvas size in vp8_lossy_decode_frame() as in vp8_lossless_decode_frame()
|
||||
- avcodec/webp: Factor update_canvas_size() out
|
||||
- avcodec/cllc: Check prefix
|
||||
- avcodec/rscc: Check pixel_size for overflow
|
||||
- avcodec/dds: Fix runtime error: left shift of 210 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/mpeg4videodec: Clear sprite wraping on unsupported cases in VOP decode
|
||||
- avcodec/ac3dec: Fix: runtime error: index -1 out of bounds for type 'INTFLOAT [2]'
|
||||
- avcodec/hqxdsp: Fix runtime error: signed integer overflow: -196264 * 11585 cannot be represented in type 'int'
|
||||
- avcodec/g723_1dec: Fix LCG type
|
||||
- libswscale/tests/swscale: Fix uninitialized variables
|
||||
- avcodec/ffv1dec: Fix runtime error: signed integer overflow: 1550964438 + 1550964438 cannot be represented in type 'int'
|
||||
- avcodec/webp: Fix signedness in prefix_code check
|
||||
- avcodec/svq3: Fix runtime error: signed integer overflow: 169 * 12717677 cannot be represented in type 'int'
|
||||
- avcodec/mlpdec: Check that there is enough data for headers
|
||||
- avcodec/ac3dec: Keep track of band structure
|
||||
- avcodec/webp: Add missing input padding
|
||||
- avcodec/aacdec_fixed: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/aacsbr_template: Do not change bs_num_env before its checked
|
||||
- avcodec/mlp: Fix multiple runtime error: left shift of negative value -1
|
||||
- avcodec/vp8dsp: vp7_luma_dc_wht_c: Fix multiple runtime error: signed integer overflow: -1366381240 + -1262413604 cannot be represented in type 'int'
|
||||
- avcodec/avcodec: Limit the number of side data elements per packet
|
||||
- avcodec/texturedsp: Fix runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/g723_1dec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/wmv2dsp: Fix runtime error: signed integer overflow: 181 * -17047030 cannot be represented in type 'int'
|
||||
- avcodec/diracdec: Fix Assertion frame->buf[0] failed at libavcodec/decode.c:610
|
||||
- avcodec/msmpeg4dec: Check for cbpy VLC errors
|
||||
- avcodec/cllc: Check num_bits
|
||||
- avcodec/cllc: Factor VLC_BITS/DEPTH out, do not use repeated literal numbers
|
||||
- avcodec/dvbsubdec: Check entry_id
|
||||
- avcodec/aacdec_fixed: Fix multiple shift exponent 33 is too large for 32-bit type 'int'
|
||||
- avcodec/mpeg12dec: Fixes runtime error: division by zero
|
||||
- avcodec/webp: Always set pix_fmt
|
||||
- avfilter/vf_uspp: Fix currently unused input frame dimensions
|
||||
- avcodec/truemotion1: Fix multiple runtime error: left shift of negative value -1
|
||||
- avcodec/eatqi: Fix runtime error: signed integer overflow: 4466147 * 1075 cannot be represented in type 'int'
|
||||
- avcodec/dss_sp: Fix runtime error: signed integer overflow: 2147481189 + 4096 cannot be represented in type 'int'
|
||||
- avformat/wavdec: Check chunk_size
|
||||
- avcodec/cavs: Check updated MV
|
||||
- avcodec/y41pdec: Fix width in input buffer size check
|
||||
- avcodec/svq3: Fix multiple runtime error: signed integer overflow: -237341 * 24552 cannot be represented in type 'int'
|
||||
- avcodec/texturedsp: Fix runtime error: left shift of 218 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/lagarith: Check scale_factor
|
||||
- avcodec/lagarith: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/takdec: Fix multiple runtime error: left shift of negative value -1
|
||||
- avcodec/indeo2: Check for invalid VLCs
|
||||
- avcodec/g723_1dec: Fix several integer related cases of undefined behaviour
|
||||
- avcodec/htmlsubtitles: Check for string truncation and return error
|
||||
- avcodec/bmvvideo: Fix runtime error: left shift of 137 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/dss_sp: Fix multiple runtime error: signed integer overflow: -15699 * -164039 cannot be represented in type 'int'
|
||||
- avcodec/dvbsubdec: check region dimensions
|
||||
- avcodec/vp8dsp: Fixes: runtime error: signed integer overflow: 1330143360 - -1023040530 cannot be represented in type 'int'
|
||||
- avcodec/hqxdsp: Fix multiple runtime error: signed integer overflow: 248220 * 21407 cannot be represented in type 'int' in idct_col()
|
||||
- avcodec/cavsdec: Check sym_factor
|
||||
- avcodec/cdxl: Check format for BGR24
|
||||
- avcodec/ffv1dec: Fix copying planes of paletted formats
|
||||
- avcodec/wmv2dsp: Fix runtime error: signed integer overflow: 181 * -12156865 cannot be represented in type 'int'
|
||||
- avcodec/xwddec: Check bpp more completely
|
||||
- avcodec/s302m: Fix left shift of 8 by 28 places cannot be represented in type 'int'
|
||||
- avcodec/eamad: Fix runtime error: signed integer overflow: 49674 * 49858 cannot be represented in type 'int'
|
||||
- avcodec/g726: Fix runtime error: left shift of negative value -2
|
||||
- avcodec/ra144: Fix runtime error: left shift of negative value -798
|
||||
- avcodec/mss34dsp: Fix multiple signed integer overflow
|
||||
- avcodec/targa_y216dec: Fix width type
|
||||
- avcodec/texturedsp: Fix multiple runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/ivi_dsp: Fix multiple left shift of negative value -2
|
||||
- avcodec/svq3: Fix multiple runtime error: signed integer overflow: 44161 * 61694 cannot be represented in type 'int'
|
||||
- avcodec/msmpeg4dec: Correct table depth
|
||||
- avcodec/dds: Fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
|
||||
- avcodec/cdxl: Check format parameter
|
||||
- avutil/softfloat: Fix overflow in av_div_sf()
|
||||
- avcodec/hq_hqa: Fix runtime error: left shift of negative value -207
|
||||
- avcodec/mss3: Change types in rac_get_model_sym() to match the types they are initialized from
|
||||
- avcodec/shorten: Check k in get_uint()
|
||||
- avcodec/webp: Fix null pointer dereference
|
||||
- avcodec/dfa: Fix signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
|
||||
- avcodec/g723_1: Fix multiple runtime error: left shift of negative value
|
||||
- avcodec/mimic: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/fic: Fix multiple left shift of negative value -15
|
||||
- avcodec/mlpdec: Fix runtime error: left shift of negative value -22
|
||||
- avcodec/snowdec: Check qbias
|
||||
- avutil/softfloat: Fix multiple runtime error: left shift of negative value -8
|
||||
- avcodec/aacsbr_template: Do not leave bs_num_env invalid
|
||||
- avcodec/mdec: Fix signed integer overflow: 28835400 * 83 cannot be represented in type 'int'
|
||||
- avcodec/dfa: Fix off by 1 error
|
||||
- avcodec/nellymoser: Fix multiple left shift of negative value -8591
|
||||
- avcodec/cdxl: Fix signed integer overflow: 14243456 * 164 cannot be represented in type 'int'
|
||||
- avcodec/g722: Fix multiple runtime error: left shift of negative value -1
|
||||
- avcodec/dss_sp: Fix multiple left shift of negative value -466
|
||||
- avcodec/wnv1: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/tiertexseqv: set the fixed dimenasions, do not depend on the demuxer doing so
|
||||
- avcodec/mjpegdec: Fix runtime error: signed integer overflow: -24543 * 2031616 cannot be represented in type 'int'
|
||||
- avcodec/cavsdec: Fix undefined behavior from integer overflow
|
||||
- avcodec/dvdsubdec: Fix runtime error: left shift of 242 by 24 places cannot be represented in type 'int'
|
||||
- libavcodec/mpeg4videodec: Convert sprite_offset to 64bit
|
||||
- avcodec/pngdec: Use ff_set_dimensions()
|
||||
- avcodec/msvideo1: Check buffer size before re-getting the frame
|
||||
- avcodec/h264_cavlc: Fix undefined behavior on qscale overflow
|
||||
- avcodec/dcadsp: Fix runtime error: signed integer overflow
|
||||
- avcodec/svq3: Increase offsets to prevent integer overflows
|
||||
- avcodec/indeo2: Check remaining bits in ir2_decode_plane()
|
||||
- avcodec/vp3: Check remaining bits in unpack_dct_coeffs()
|
||||
- doc/developer: Add terse documentation of assumed C implementation defined behavior
|
||||
- avcodec/mdec: Fix runtime error: left shift of negative value -127
|
||||
- avcodec/x86/vc1dsp_init: Fix build failure with --disable-optimizations and clang
|
||||
- libavcodec/exr : fix float to uint16 conversion for negative float value
|
||||
- avformat/webmdashenc: Validate the 'streams' adaptation sets parameter
|
||||
- avformat/webmdashenc: Require the 'adaptation_sets' option to be set
|
||||
- avcodec/dvdsubdec: Fixes 2 runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
|
||||
- avformat/oggparsedaala: Do not leave an invalid value in gpshift
|
||||
- avformat/oggparsedaala: Check duration for AV_NOPTS_VALUE
|
||||
- avfilter/af_sofalizer: Fix bad shift
|
||||
- avfilter/avfiltergraph: Add assert to write down in machine readable form what is assumed about sample rates in swap_samplerates_on_filter()
|
||||
- avcodec/tiff: Perform multiply in tiff_unpack_lzma() as 64bit
|
||||
- avcodec/vdpau_hevc: Fix potential out-of-bounds write
|
||||
- avcodec/tiff: Check geotag count for being non zero
|
||||
- avcodec/vp56: Check avctx->error_concealment before enabling EC
|
||||
- avcodec/tiff: Check stripsize strippos for overflow
|
||||
- avcodec/mpegaudiodec_template: Make l3_unscale() work with e=0
|
||||
- avcodec/tiff: Check for multiple geo key directories
|
||||
- avcodec/wavpack: Fix runtime error: shift exponent 32 is too large for 32-bit type 'int'
|
||||
- avcodec/rv34: Fix runtime error: signed integer overflow: 36880 * 66288 cannot be represented in type 'int'
|
||||
- avcodec/amrwbdec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: -135088512 * 16 cannot be represented in type 'int'
|
||||
- avcodec/h264_mvpred: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/mjpegdec: Fix runtime error: left shift of negative value -127
|
||||
- avcodec/wavpack: Fix runtime error: left shift of negative value -5
|
||||
- avcodec/wavpack: Fix runtime error: left shift of negative value -2
|
||||
- avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: 134527392 * 16 cannot be represented in type 'int'
|
||||
- avcodec/mpeg12dec: Fix runtime error: left shift of negative value -13
|
||||
- avcodec/h264_mvpred: Fix multiple runtime error: left shift of negative value
|
||||
- avcodec/adxdec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/mpeg4videodec: Improve the overflow checks in mpeg4_decode_sprite_trajectory()
|
||||
- avcodec/mjpegdec: Fix runtime error: left shift of negative value -511
|
||||
- avcodec/h264_direct: Fix runtime error: left shift of negative value -14
|
||||
- avcodec/pictordec: Check plane value before doing value/mask computations
|
||||
- avcodec/mpeg4videodec: Fix runtime error: left shift of negative value -2650
|
||||
- avcodec/eac3dec: Fix runtime error: left shift of negative value -3
|
||||
- avcodec/mpeg12dec: Fix runtime error: left shift of negative value -2
|
||||
- avcodec/mpeg4videodec: Check the other 3 sprite points for intermediate overflows
|
||||
- avcodec/mpeg4videodec: Check sprite_offset in addition to shifts
|
||||
- avcodec/mpeg4video: Fix runtime error: left shift of negative value
|
||||
- avcodec/ituh263dec: Fix runtime error: left shift of negative value -22
|
||||
- avcodec/rv40: Fix runtime error: left shift of negative value
|
||||
- avcodec/h264_cabac: runtime error: signed integer overflow: 2147483647 + 14 cannot be represented in type 'int'
|
||||
- avcodec/mpeg4videodec: Fix runtime error: shift exponent -2 is negative
|
||||
- avcodec/mjpegdec: Fix runtime error: left shift of negative value -507
|
||||
- avcodec/eac3dec: Fix runtime error: left shift of negative value
|
||||
- avcodec/htmlsubtitles: Fix reading one byte beyond the array
|
||||
- avcodec/vp6: clear dimensions on failed resolution change in vp6_parse_header()
|
||||
- avcodec/vp56: Reset have_undamaged_frame on resolution changes
|
||||
- avcodec/vp8: Fix hang with slice threads
|
||||
- avcodec/vp8: Check for the bitstream end per MB in decode_mb_row_no_filter()
|
||||
- avcodec/vp568: Check that there is enough data for ff_vp56_init_range_decoder()
|
||||
- avcodec/vp8: remove redundant check
|
||||
- avcodec/vp56: Require a correctly decoded frame before using vp56_conceal_mb()
|
||||
- avcodec/vp3: Do not return random positive values but the buf size
|
||||
- avcodec/vp8: Check for bitsteam end in decode_mb_row_no_filter()
|
||||
- avcodec/vp56: Factorize vp56_render_mb() out
|
||||
- avcodec/vp3dsp: Fix multiple signed integer overflow: 46341 * 47523 cannot be represented in type 'int'
|
||||
- Add CHECK/SUINT code
|
||||
- avcodec/mpeg12dec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/vp56: Clear dimensions in case of failure in the middle of a resolution change
|
||||
- avcodec/vp56: Implement very basic error concealment
|
||||
- avcodec/amrwbdec: Fix 2 runtime errors: left shift of negative value -1
|
||||
- avcodec/pngdec: Fix runtime error: left shift of 152 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/vp56: Fix sign typo
|
||||
- avcodec/mpegaudiodec_template: Correct return code on id3 tag discarding
|
||||
- avcodec/rv34: Simplify and factor get_slice_offset() code
|
||||
- avcodec/pictordec: Do not read more than nb_planes
|
||||
- avcodec/srtdec: Fix signed integer overflow: 1811992524 * 384 cannot be represented in type 'int'
|
||||
- avcodec/pngdec: Check bit depth for validity
|
||||
- avcodec/mpeg12dec: Fix runtime error: left shift of negative value
|
||||
- avcodec/wavpacl: Fix runtime error: left shift of negative value -1
|
||||
- avformat/http: Check for truncated buffers in http_connect()
|
||||
- avformat/apng: fix setting frame delay when max_fps is set to no limit
|
||||
- swresample/resample: free existing ResampleContext on reinit
|
||||
- swresample/resample: move resample_free() higher in the file
|
||||
- lavf/mpeg: Initialize a stack variable used by memcmp().
|
||||
- lavc/avpacket: Initialize a variable in error path.
|
||||
|
||||
version 3.0.7
|
||||
- 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
|
||||
|
||||
version 3.0.6:
|
||||
- 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
|
||||
- pgssubdec: reset rle_data_len/rle_remaining_len on allocation error
|
||||
- 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
|
||||
|
||||
|
||||
version 3.0.5:
|
||||
- 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.
|
||||
- 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
|
||||
- avcodec/rawdec: check for side data before checking its size
|
||||
- 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
|
||||
- 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*()
|
||||
- avformat/icodec: Fix crash probing fuzzed file
|
||||
- dcstr: fix division by zero
|
||||
- rsd: limit number of channels
|
||||
- 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
|
||||
- pgssubdec: only set w/h/linesize when allocating data
|
||||
- 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
|
||||
- filmstripdec: correctly check image dimensions
|
||||
- pnmdec: make sure v is capped by maxval
|
||||
- smvjpegdec: make sure cur_frame is not negative
|
||||
- icodec: correctly check avio_read return value
|
||||
- dvbsubdec: fix division by zero in compute_default_clut
|
||||
- proresdec_lgpl: explicitly check coff[3] against slice_data_size
|
||||
- escape124: reject codebook size 0
|
||||
- icodec: add ico_read_close to fix leaking ico->images
|
||||
- icodec: fix leaking pkt on error
|
||||
- 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
|
||||
- lzf: update pointer p after realloc
|
||||
- diracdec: check return code of get_buffer_with_edge
|
||||
- ppc: pixblockdsp: do unaligned block accesses correctly again
|
||||
- interplayacm: increase bitstream buffer size by AV_INPUT_BUFFER_PADDING_SIZE
|
||||
- interplayacm: validate number of channels
|
||||
- interplayacm: check for too large b
|
||||
- mpeg12dec: unref discarded picture from extradata
|
||||
- cavsdec: unref frame before referencing again
|
||||
- avformat: prevent triggering request_probe assert in ff_read_packet
|
||||
- avcodec/avpacket: fix leak on realloc in av_packet_add_side_data()
|
||||
|
||||
|
||||
version 3.0.4:
|
||||
- libopenjpegenc: fix out-of-bounds reads when filling the edges
|
||||
- libopenjpegenc: stop reusing image data buffer for openjpeg 2
|
||||
- configure: fix detection of libopenjpeg
|
||||
- cmdutils: fix typos
|
||||
- lavfi: fix typos
|
||||
- lavc: fix typos
|
||||
- tools: fix grammar error
|
||||
- ffmpeg: remove unused and errorneous AVFrame timestamp check
|
||||
- Support for MIPS cpu P6600
|
||||
- avutil/mips/generic_macros_msa: rename macro variable which causes segfault for mips r
|
||||
- avformat/avidec: Check nb_streams in read_gab2_sub()
|
||||
- avformat/avidec: Remove ancient assert
|
||||
- avformat/avidec: Fix memleak with dv in avi
|
||||
- lavc/movtextdec.c: Avoid infinite loop on invalid data.
|
||||
- avcodec/ansi: Check dimensions
|
||||
- avcodec/cavsdsp: use av_clip_uint8() for idct
|
||||
- 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
|
||||
- avformat/movenc: Check first DTS similar to dts difference
|
||||
- avcodec/ccaption_dec: Use simple array instead of AVBuffer
|
||||
- avformat/mov: Fix potential integer overflow in mov_read_keys
|
||||
- swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
|
||||
- swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices
|
||||
- lavf/utils: Avoid an overflow for huge negative durations.
|
||||
|
||||
version 3.0.3:
|
||||
- avformat/avidec: Fix infinite loop in avi_read_nikon()
|
||||
- avcodec/aacenc: Tighter input checks
|
||||
- avformat/wtvdec: Check pointer before use
|
||||
- libavcodec/wmalosslessdec: Check the remaining bits
|
||||
- avcodec/diracdec: Check numx/y
|
||||
- avcodec/cfhd: Increase minimum band dimension to 3
|
||||
- avcodec/indeo2: check ctab
|
||||
- avformat/swfdec: Fix inflate() error code check
|
||||
- avcodec/rawdec: Fix bits_per_coded_sample checks
|
||||
- lavc/mjpegdec: Do not skip reading quantization tables.
|
||||
- cmdutils: fix implicit declaration of SetDllDirectory function
|
||||
- cmdutils: check for SetDllDirectory() availability
|
||||
- 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
|
||||
- avformat/flacdec: Fix seeking close to EOF
|
||||
- avcodec/flac_parser: Raise threshold for detecting invalid data
|
||||
- avformat/flvdec: Accept last size if its off by 1
|
||||
- tests/api/api-codec-param-test: Do not directly access caps_internal
|
||||
- avcodec: Add avpriv_codec_get_cap_skip_frame_fill_param()
|
||||
- avfilter/vf_telecine: Make frame writable before writing into it
|
||||
- avformat/mpegts: adjust probe score for low check_count
|
||||
- avcodec/mpc8: Correct end truncation
|
||||
- avformat/mp3dec: Increase probe score slightly when the whole data from begin to end is mp3
|
||||
- avcodec/cfhd: Set dimensions unconditionally
|
||||
- avcodec/mpegvideo: Do not clear the parse context during init
|
||||
- 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.
|
||||
- librtmp: Avoid an infiniloop setting connection arguments
|
||||
- avformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame
|
||||
- Revert "configure: Enable GCC vectorization on ≥4.9 on x86"
|
||||
- avcodec/libopenjpegenc: Set numresolutions by default to a value that is not too large
|
||||
- ffplay: Fix usage of private lavfi API
|
||||
- tests/checkasm/checkasm: Disable checkasm_check_pixblockdsp for ppc64be
|
||||
- avcodec/mpegvideo: Deallocate last/next picture earlier
|
||||
- avcodec/bmp_parser: Fix state
|
||||
- avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c
|
||||
- avformat/utils: avoid overflow in compute_chapters_end() with huge durations
|
||||
- avformat/utils: avoid overflow in update_stream_timings() with huge durations
|
||||
- doc/developer.texi: Add a code of conduct
|
||||
- ffserver: fixed deallocation bug in build_feed_streams
|
||||
- avcodec/diracdec: Fix potential integer overflow
|
||||
- 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/resample: Fix division by 0 with tap_count=1
|
||||
- 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
|
||||
- hevc: Fix memory leak related to a53_caption data
|
||||
- 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
|
||||
- avformat/ffmdec: Check pix_fmt
|
||||
- doc/general: update supported DCA extensions
|
||||
- avcodec/rscc: check input buffer size for deflate mode
|
||||
- avcodec/dca: fix sync word search error condition
|
||||
- lavf/mpegts: Return small probe score for very short transport streams.
|
||||
|
||||
|
||||
version 3.0.2:
|
||||
- avcodec/ttaenc: Reallocate packet if its too small
|
||||
- configure: build fix for P5600 with mips code restructuring
|
||||
- mips: add support for R6
|
||||
- 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()
|
||||
- avformat/mux: Check that deinit is set before calling it
|
||||
- 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
|
||||
- avcodec/pngdec: Fix alpha detection with skip_frame
|
||||
- Changelog: Make formating consistent
|
||||
- avfilter/src_movie: fix how we check for overflows with seek_point
|
||||
- avcodec/j2kenc: Add attribution to OpenJPEG project:
|
||||
|
||||
|
||||
version 3.0.1:
|
||||
- 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
|
||||
- avformat/mpegtsenc: Fix used service
|
||||
- avformat/mpegtsenc: Keep track of the program for each service
|
||||
- avformat/file: Add crypto to default whitelist
|
||||
- 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
|
||||
- avformat/hlsenc: Fix passing options, regression since bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce
|
||||
- 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
|
||||
- avcodec/dca: clear X96 channels if nothing was decoded
|
||||
- fate/aac: Increase fuzz from of fate-aac-pns-encode from 72 to 74 for Loongson
|
||||
- avformat/cache: Fix memleak of tree entries
|
||||
- lavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216
|
||||
- lavf/mov: fix sidx with edit lists
|
||||
- avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
|
||||
- swscale/utils: Fix chrSrcHSubSample for GBRAP16
|
||||
- swscale/input: Fix GBRAP16 input
|
||||
- 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
|
||||
- MAINTAINERS: add myself as an OS/2 maintainer
|
||||
- libwebpenc_animencoder: print library messages in verbose log levels
|
||||
- libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct
|
||||
- configure: check for SEC_I_CONTEXT_EXPIRED before enabling SChannel
|
||||
- lavf/http: Add httpproxy to the default protocol whitelist.
|
||||
- doc/utils: fix typo for min() description
|
||||
- ffserver&ffm: Fixed issues preventing ffserver write_index and files_size from being set correctly which was breaking ffserver streaming.
|
||||
- postproc: fix unaligned access
|
||||
- vc2enc: fix use of uninitialized variables in the rate control system, correctly zero out coefficient array padding
|
||||
- aacenc: optimize encoding speed
|
||||
- avcodec/diracdec: check bitstream size related fields for overflows
|
||||
- avcodec/h264_slice: Check PPS more extensively when its not copied
|
||||
|
||||
|
||||
version 3.0:
|
||||
@@ -70,6 +545,8 @@ version 3.0:
|
||||
- streamselect video and astreamselect audio filter
|
||||
- swaprect filter
|
||||
- metadata video and ametadata audio filter
|
||||
- SMPTE VC-2 HQ profile support for the Dirac decoder
|
||||
- SMPTE VC-2 native encoder supporting the HQ profile
|
||||
|
||||
|
||||
version 2.8:
|
||||
|
||||
10
MAINTAINERS
10
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
|
||||
@@ -168,7 +168,7 @@ Codecs:
|
||||
dirac* Rostislav Pehlivanov
|
||||
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
|
||||
@@ -422,7 +422,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
|
||||
@@ -458,7 +458,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
|
||||
movenccenc.c Eran Kornblau
|
||||
mpc.c Kostya Shishkov
|
||||
@@ -563,7 +563,7 @@ 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
|
||||
|
||||
15
RELEASE_NOTES
Normal file
15
RELEASE_NOTES
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
┌─────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 3.0 "Einstein" │
|
||||
└─────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 3.0 "Einstein", about 5
|
||||
months after the release of FFmpeg 2.8.
|
||||
|
||||
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.
|
||||
16
cmdutils.c
16
cmdutils.c
@@ -61,6 +61,9 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#if HAVE_SETDLLDIRECTORY
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
static int init_report(const char *env);
|
||||
|
||||
@@ -107,6 +110,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))
|
||||
@@ -2099,7 +2111,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");
|
||||
@@ -2129,7 +2141,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);
|
||||
|
||||
278
configure
vendored
278
configure
vendored
@@ -913,6 +913,25 @@ void foo(void){ __asm__ volatile($code); }
|
||||
EOF
|
||||
}
|
||||
|
||||
check_inline_asm_flags(){
|
||||
log check_inline_asm_flags "$@"
|
||||
name="$1"
|
||||
code="$2"
|
||||
flags=''
|
||||
shift 2
|
||||
while [ "$1" != "" ]; do
|
||||
append flags $1
|
||||
shift
|
||||
done;
|
||||
disable $name
|
||||
cat > $TMPC <<EOF
|
||||
void foo(void){ __asm__ volatile($code); }
|
||||
EOF
|
||||
log_file $TMPC
|
||||
check_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
|
||||
enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
|
||||
}
|
||||
|
||||
check_insn(){
|
||||
log check_insn "$@"
|
||||
check_inline_asm ${1}_inline "\"$2\""
|
||||
@@ -1657,6 +1676,7 @@ ARCH_EXT_LIST_ARM="
|
||||
ARCH_EXT_LIST_MIPS="
|
||||
mipsfpu
|
||||
mips32r2
|
||||
mips32r5
|
||||
mips64r2
|
||||
mips32r6
|
||||
mips64r6
|
||||
@@ -1880,6 +1900,7 @@ SYSTEM_FUNCS="
|
||||
sched_getaffinity
|
||||
SetConsoleTextAttribute
|
||||
SetConsoleCtrlHandler
|
||||
SetDllDirectory
|
||||
setmode
|
||||
setrlimit
|
||||
Sleep
|
||||
@@ -2150,10 +2171,11 @@ mipsfpu_deps="mips"
|
||||
mipsdsp_deps="mips"
|
||||
mipsdspr2_deps="mips"
|
||||
mips32r2_deps="mips"
|
||||
mips32r5_deps="mips"
|
||||
mips32r6_deps="mips"
|
||||
mips64r2_deps="mips"
|
||||
mips64r6_deps="mips"
|
||||
msa_deps="mips"
|
||||
msa_deps="mipsfpu"
|
||||
mmi_deps="mips"
|
||||
|
||||
altivec_deps="ppc"
|
||||
@@ -4153,118 +4175,94 @@ elif enabled mips; then
|
||||
|
||||
cpuflags="-march=$cpu"
|
||||
|
||||
case $cpu in
|
||||
24kc)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsfpu
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
24kf*)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
24kec|34kc|1004kc)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsfpu
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
24kef*|34kf*|1004kf*)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
74kc)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsfpu
|
||||
disable msa
|
||||
;;
|
||||
74kf)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable msa
|
||||
;;
|
||||
p5600)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
check_cflags "-mtune=p5600" &&
|
||||
check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
|
||||
add_asflags "-mfp64"
|
||||
;;
|
||||
i6400)
|
||||
disable mips32r2
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
check_cflags "-mtune=i6400 -mabi=64" &&
|
||||
check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
|
||||
check_ldflags "-mabi=64" &&
|
||||
add_asflags "-mfp64"
|
||||
;;
|
||||
loongson*)
|
||||
disable mips32r2
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsfpu
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
enable local_aligned_8 local_aligned_16 local_aligned_32
|
||||
enable simd_align_16
|
||||
enable fast_64bit
|
||||
enable fast_clz
|
||||
enable fast_cmov
|
||||
enable fast_unaligned
|
||||
disable aligned_stack
|
||||
case $cpu in
|
||||
loongson3*)
|
||||
cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
loongson2e)
|
||||
cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
loongson2f)
|
||||
cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
generic)
|
||||
disable mips64r6
|
||||
disable msa
|
||||
;;
|
||||
*)
|
||||
# Unknown CPU. Disable everything.
|
||||
warn "unknown CPU. Disabling all MIPS optimizations."
|
||||
disable mipsfpu
|
||||
disable mips32r2
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
esac
|
||||
if [ "$cpu" != "generic" ]; then
|
||||
disable mips32r2
|
||||
disable mips32r5
|
||||
disable mips64r2
|
||||
disable mips32r6
|
||||
disable mips64r6
|
||||
disable loongson2
|
||||
disable loongson3
|
||||
|
||||
case $cpu in
|
||||
24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
|
||||
enable mips32r2
|
||||
disable msa
|
||||
;;
|
||||
p5600|i6400|p6600)
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
;;
|
||||
loongson*)
|
||||
enable loongson2
|
||||
enable loongson3
|
||||
enable local_aligned_8 local_aligned_16 local_aligned_32
|
||||
enable simd_align_16
|
||||
enable fast_64bit
|
||||
enable fast_clz
|
||||
enable fast_cmov
|
||||
enable fast_unaligned
|
||||
disable aligned_stack
|
||||
case $cpu in
|
||||
loongson3*)
|
||||
cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
loongson2e)
|
||||
cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
loongson2f)
|
||||
cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Unknown CPU. Disable everything.
|
||||
warn "unknown CPU. Disabling all MIPS optimizations."
|
||||
disable mipsfpu
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
disable mmi
|
||||
;;
|
||||
esac
|
||||
|
||||
case $cpu in
|
||||
24kc)
|
||||
disable mipsfpu
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
;;
|
||||
24kf*)
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
;;
|
||||
24kec|34kc|1004kc)
|
||||
disable mipsfpu
|
||||
disable mipsdspr2
|
||||
;;
|
||||
24kef*|34kf*|1004kf*)
|
||||
disable mipsdspr2
|
||||
;;
|
||||
74kc)
|
||||
disable mipsfpu
|
||||
;;
|
||||
p5600)
|
||||
enable mips32r5
|
||||
check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
|
||||
;;
|
||||
i6400)
|
||||
enable mips64r6
|
||||
check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
|
||||
;;
|
||||
p6600)
|
||||
enable mips64r6
|
||||
check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# We do not disable anything. Is up to the user to disable the unwanted features.
|
||||
warn 'generic cpu selected'
|
||||
fi
|
||||
|
||||
elif enabled ppc; then
|
||||
|
||||
@@ -5073,27 +5071,22 @@ elif enabled mips; then
|
||||
enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
|
||||
|
||||
# Enable minimum ISA based on selected options
|
||||
if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
|
||||
add_cflags "-mips64r2"
|
||||
add_asflags "-mips64r2"
|
||||
elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled loongson3; then
|
||||
add_cflags "-mips64"
|
||||
add_asflags "-mips64"
|
||||
elif enabled mipsdsp || enabled mipsdspr2; then
|
||||
add_cflags "-mips32r2 -mfp32"
|
||||
add_asflags "-mips32r2 -mfp32"
|
||||
if enabled mips64; then
|
||||
enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
|
||||
enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
|
||||
disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
|
||||
else
|
||||
enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
|
||||
enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
|
||||
enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
|
||||
disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
|
||||
fi
|
||||
|
||||
enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
|
||||
check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
|
||||
enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
|
||||
check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
|
||||
enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
|
||||
check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
|
||||
enabled msa && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
|
||||
check_inline_asm msa '"addvi.b $w0, $w1, 1"'
|
||||
|
||||
enabled msa && add_asflags "-mmsa"
|
||||
enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
|
||||
enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
|
||||
enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_header msa.h || disable msa
|
||||
enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
|
||||
enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
|
||||
|
||||
elif enabled parisc; then
|
||||
|
||||
@@ -5329,6 +5322,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
|
||||
@@ -5491,10 +5485,11 @@ enabled libopencv && { check_header opencv2/core/core_c.h &&
|
||||
require_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
|
||||
require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
|
||||
enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
|
||||
enabled libopenjpeg && { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
|
||||
check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
|
||||
check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
|
||||
check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
|
||||
enabled libopenjpeg && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
|
||||
check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
|
||||
{ check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
|
||||
{ check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
|
||||
{ check_lib2 openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
|
||||
die "ERROR: libopenjpeg not found"; }
|
||||
enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
|
||||
enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
|
||||
@@ -5659,7 +5654,7 @@ disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreF
|
||||
enable securetransport; }
|
||||
|
||||
disabled schannel || { check_func_headers "windows.h Security.h" InitializeSecurityContext -DSECURITY_WIN32 -lSecur32 &&
|
||||
enable schannel && add_extralibs -lSecur32; }
|
||||
check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lSecur32; }
|
||||
|
||||
makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
|
||||
enabled makeinfo \
|
||||
@@ -5935,11 +5930,7 @@ elif enabled ccc; then
|
||||
add_cflags -msg_disable nonstandcast
|
||||
add_cflags -msg_disable unsupieee
|
||||
elif enabled gcc; then
|
||||
case $gcc_basever in
|
||||
4.9*) enabled x86 || check_optflags -fno-tree-vectorize ;;
|
||||
4.*) check_optflags -fno-tree-vectorize ;;
|
||||
*) enabled x86 || check_optflags -fno-tree-vectorize ;;
|
||||
esac
|
||||
check_optflags -fno-tree-vectorize
|
||||
check_cflags -Werror=format-security
|
||||
check_cflags -Werror=implicit-function-declaration
|
||||
check_cflags -Werror=missing-prototypes
|
||||
@@ -6004,6 +5995,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
|
||||
@@ -6420,7 +6412,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 2016
|
||||
#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})"
|
||||
|
||||
@@ -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 = 3.0.8
|
||||
|
||||
# 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
|
||||
|
||||
@@ -131,6 +131,11 @@ designated struct initializers (@samp{struct s x = @{ .i = 17 @};});
|
||||
|
||||
@item
|
||||
compound literals (@samp{x = (struct s) @{ 17, 23 @};}).
|
||||
|
||||
@item
|
||||
Implementation defined behavior for signed integers is assumed to match the
|
||||
expected behavior for two's complement. Non representable values in integer
|
||||
casts are binary truncated. Shift right of signed values uses sign extension.
|
||||
@end itemize
|
||||
|
||||
These features are supported by all compilers we care about, so we will not
|
||||
@@ -403,6 +408,35 @@ finding a new maintainer and also don't forget to update the @file{MAINTAINERS}
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -93,10 +93,9 @@ static int decode_packet(int *got_frame, int cached)
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("video_frame%s n:%d coded_n:%d pts:%s\n",
|
||||
printf("video_frame%s n:%d coded_n:%d\n",
|
||||
cached ? "(cached)" : "",
|
||||
video_frame_count++, frame->coded_picture_number,
|
||||
av_ts2timestr(frame->pts, &video_dec_ctx->time_base));
|
||||
video_frame_count++, frame->coded_picture_number);
|
||||
|
||||
/* copy decoded frame to destination buffer:
|
||||
* this is required since rawvideo expects non aligned data */
|
||||
|
||||
@@ -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.
|
||||
@@ -281,7 +281,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,
|
||||
@@ -310,7 +310,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,
|
||||
@@ -1129,7 +1129,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})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -950,7 +950,7 @@ following image formats are supported:
|
||||
@item COOK @tab @tab X
|
||||
@tab All versions except 5.1 are supported.
|
||||
@item DCA (DTS Coherent Acoustics) @tab X @tab X
|
||||
@tab supported extensions: XCh, XLL (partially)
|
||||
@tab supported extensions: XCh, XXCH, X96, XBR, XLL
|
||||
@item DPCM id RoQ @tab X @tab X
|
||||
@tab Used in Quake III, Jedi Knight 2 and other computer games.
|
||||
@item DPCM Interplay @tab @tab X
|
||||
|
||||
@@ -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}.
|
||||
|
||||
12
ffmpeg.c
12
ffmpeg.c
@@ -2014,12 +2014,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
}
|
||||
}
|
||||
|
||||
/* if the decoder provides a pts, use it instead of the last packet pts.
|
||||
the decoder could be delaying output by a packet or more. */
|
||||
if (decoded_frame->pts != AV_NOPTS_VALUE) {
|
||||
ist->dts = ist->next_dts = ist->pts = ist->next_pts = av_rescale_q(decoded_frame->pts, avctx->time_base, AV_TIME_BASE_Q);
|
||||
decoded_frame_tb = avctx->time_base;
|
||||
} else if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
|
||||
if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
|
||||
decoded_frame->pts = decoded_frame->pkt_pts;
|
||||
decoded_frame_tb = ist->st->time_base;
|
||||
} else if (pkt->pts != AV_NOPTS_VALUE) {
|
||||
@@ -2893,7 +2888,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
|
||||
@@ -4267,6 +4263,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 */
|
||||
|
||||
@@ -2989,8 +2989,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,
|
||||
|
||||
6
ffplay.c
6
ffplay.c
@@ -2730,7 +2730,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
goto fail;
|
||||
link = is->out_audio_filter->inputs[0];
|
||||
sample_rate = link->sample_rate;
|
||||
nb_channels = link->channels;
|
||||
nb_channels = avfilter_link_get_channels(link);
|
||||
channel_layout = link->channel_layout;
|
||||
}
|
||||
#else
|
||||
@@ -2931,7 +2931,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;
|
||||
}
|
||||
@@ -3771,6 +3771,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);
|
||||
|
||||
|
||||
@@ -3178,6 +3178,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);
|
||||
|
||||
|
||||
12
ffserver.c
12
ffserver.c
@@ -373,8 +373,8 @@ static void ffm_set_write_index(AVFormatContext *s, int64_t pos,
|
||||
int64_t file_size)
|
||||
{
|
||||
av_opt_set_int(s, "server_attached", 1, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(s, "write_index", pos, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(s, "file_size", file_size, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(s, "ffm_write_index", pos, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(s, "ffm_file_size", file_size, AV_OPT_SEARCH_CHILDREN);
|
||||
}
|
||||
|
||||
static char *ctime1(char *buf2, size_t buf_size)
|
||||
@@ -2701,8 +2701,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)
|
||||
@@ -2724,6 +2726,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;
|
||||
@@ -3858,6 +3861,8 @@ drop:
|
||||
if (avformat_write_header(s, NULL) < 0) {
|
||||
http_log("Container doesn't support the required parameters\n");
|
||||
avio_closep(&s->pb);
|
||||
s->streams = NULL;
|
||||
s->nb_streams = 0;
|
||||
avformat_free_context(s);
|
||||
goto bail;
|
||||
}
|
||||
@@ -3973,6 +3978,7 @@ int main(int argc, char **argv)
|
||||
int cfg_parsed;
|
||||
int ret = EXIT_FAILURE;
|
||||
|
||||
init_dynload();
|
||||
|
||||
config.filename = av_strdup("/etc/ffserver.conf");
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -424,6 +424,8 @@ static int read_payload_length_info(struct LATMContext *ctx, GetBitContext *gb)
|
||||
if (ctx->frame_length_type == 0) {
|
||||
int mux_slot_length = 0;
|
||||
do {
|
||||
if (get_bits_left(gb) < 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
tmp = get_bits(gb, 8);
|
||||
mux_slot_length += tmp;
|
||||
} while (tmp == 255);
|
||||
@@ -453,7 +455,7 @@ static int read_audio_mux_element(struct LATMContext *latmctx,
|
||||
}
|
||||
if (latmctx->audio_mux_version_A == 0) {
|
||||
int mux_slot_length_bytes = read_payload_length_info(latmctx, gb);
|
||||
if (mux_slot_length_bytes * 8 > get_bits_left(gb)) {
|
||||
if (mux_slot_length_bytes < 0 || mux_slot_length_bytes * 8LL > get_bits_left(gb)) {
|
||||
av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) {
|
||||
|
||||
@@ -125,7 +125,7 @@ static inline int *DEC_SQUAD(int *dst, unsigned idx)
|
||||
static inline int *DEC_UPAIR(int *dst, unsigned idx, unsigned sign)
|
||||
{
|
||||
dst[0] = (idx & 15) * (1 - (sign & 0xFFFFFFFE));
|
||||
dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) << 1));
|
||||
dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) * 2));
|
||||
|
||||
return dst + 2;
|
||||
}
|
||||
@@ -134,16 +134,16 @@ static inline int *DEC_UQUAD(int *dst, unsigned idx, unsigned sign)
|
||||
{
|
||||
unsigned nz = idx >> 12;
|
||||
|
||||
dst[0] = (idx & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
dst[0] = (idx & 3) * (1 + (((int)sign >> 31) * 2));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[1] = (idx >> 2 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
dst[1] = (idx >> 2 & 3) * (1 + (((int)sign >> 31) * 2));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[2] = (idx >> 4 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
dst[2] = (idx >> 4 & 3) * (1 + (((int)sign >> 31) * 2));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[3] = (idx >> 6 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
dst[3] = (idx >> 6 & 3) * (1 + (((int)sign >> 31) * 2));
|
||||
|
||||
return dst + 4;
|
||||
}
|
||||
@@ -171,7 +171,11 @@ static void subband_scale(int *dst, int *src, int scale, int offset, int len)
|
||||
|
||||
s = offset - (s >> 2);
|
||||
|
||||
if (s > 0) {
|
||||
if (s > 31) {
|
||||
for (i=0; i<len; i++) {
|
||||
dst[i] = 0;
|
||||
}
|
||||
} else if (s > 0) {
|
||||
round = 1 << (s-1);
|
||||
for (i=0; i<len; i++) {
|
||||
out = (int)(((int64_t)src[i] * c) >> 32);
|
||||
|
||||
@@ -2155,7 +2155,11 @@ static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
|
||||
coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
|
||||
|
||||
sign = get_bits(gb, 1);
|
||||
scale = AAC_RENAME(cce_scale)[get_bits(gb, 2)];
|
||||
#if USE_FIXED
|
||||
scale = get_bits(gb, 2);
|
||||
#else
|
||||
scale = cce_scale[get_bits(gb, 2)];
|
||||
#endif
|
||||
|
||||
if ((ret = decode_ics(ac, sce, gb, 0, 0)))
|
||||
return ret;
|
||||
|
||||
@@ -609,8 +609,8 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
}
|
||||
|
||||
for (k = 0; k < 1024; k++) {
|
||||
if (!isfinite(cpe->ch[ch].coeffs[k])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN/+-Inf\n");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#ifndef AVCODEC_AACENC_UTILS_H
|
||||
#define AVCODEC_AACENC_UTILS_H
|
||||
|
||||
#include "libavutil/internal.h"
|
||||
#include "aac.h"
|
||||
#include "aacenctab.h"
|
||||
#include "aactab.h"
|
||||
@@ -66,13 +67,13 @@ static inline void quantize_bands(int *out, const float *in, const float *scaled
|
||||
const float rounding)
|
||||
{
|
||||
int i;
|
||||
double qc;
|
||||
for (i = 0; i < size; i++) {
|
||||
qc = scaled[i] * Q34;
|
||||
out[i] = (int)FFMIN(qc + rounding, (double)maxval);
|
||||
float qc = scaled[i] * Q34;
|
||||
int tmp = (int)FFMIN(qc + rounding, (float)maxval);
|
||||
if (is_signed && in[i] < 0.0f) {
|
||||
out[i] = -out[i];
|
||||
tmp = -tmp;
|
||||
}
|
||||
out[i] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,8 +91,7 @@ static inline float find_max_val(int group_len, int swb_size, const float *scale
|
||||
|
||||
static inline int find_min_book(float maxval, int sf)
|
||||
{
|
||||
float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
|
||||
float Q34 = sqrtf(Q * sqrtf(Q));
|
||||
float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
|
||||
int qmaxval, cb;
|
||||
qmaxval = maxval * Q34 + C_QUANT;
|
||||
if (qmaxval >= (FF_ARRAY_ELEMS(aac_maxval_cb)))
|
||||
@@ -123,7 +123,10 @@ static inline float find_form_factor(int group_len, int swb_size, float thresh,
|
||||
if (s >= ethresh) {
|
||||
nzl += 1.0f;
|
||||
} else {
|
||||
nzl += powf(s / ethresh, nzslope);
|
||||
if (nzslope == 2.f)
|
||||
nzl += (s / ethresh) * (s / ethresh);
|
||||
else
|
||||
nzl += ff_fast_powf(s / ethresh, nzslope);
|
||||
}
|
||||
}
|
||||
if (e2 > thresh) {
|
||||
|
||||
@@ -975,7 +975,7 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
h_step[1][3] = AAC_MSUB31_V3(H22[1][e+1][b], h[1][3], width);
|
||||
}
|
||||
ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd](
|
||||
l[k] + start + 1, r[k] + start + 1,
|
||||
l[k] + 1 + start, r[k] + 1 + start,
|
||||
h, h_step, stop - start);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -623,24 +623,26 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
|
||||
int abs_bord_trail = 16;
|
||||
int num_rel_lead, num_rel_trail;
|
||||
unsigned bs_num_env_old = ch_data->bs_num_env;
|
||||
int bs_frame_class, bs_num_env;
|
||||
|
||||
ch_data->bs_freq_res[0] = ch_data->bs_freq_res[ch_data->bs_num_env];
|
||||
ch_data->bs_amp_res = sbr->bs_amp_res_header;
|
||||
ch_data->t_env_num_env_old = ch_data->t_env[bs_num_env_old];
|
||||
|
||||
switch (ch_data->bs_frame_class = get_bits(gb, 2)) {
|
||||
switch (bs_frame_class = get_bits(gb, 2)) {
|
||||
case FIXFIX:
|
||||
ch_data->bs_num_env = 1 << get_bits(gb, 2);
|
||||
bs_num_env = 1 << get_bits(gb, 2);
|
||||
if (bs_num_env > 4) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
|
||||
bs_num_env);
|
||||
return -1;
|
||||
}
|
||||
ch_data->bs_num_env = bs_num_env;
|
||||
num_rel_lead = ch_data->bs_num_env - 1;
|
||||
if (ch_data->bs_num_env == 1)
|
||||
ch_data->bs_amp_res = 0;
|
||||
|
||||
if (ch_data->bs_num_env > 4) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
|
||||
ch_data->bs_num_env);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ch_data->t_env[0] = 0;
|
||||
ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
|
||||
@@ -688,14 +690,15 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
|
||||
abs_bord_trail += get_bits(gb, 2);
|
||||
num_rel_lead = get_bits(gb, 2);
|
||||
num_rel_trail = get_bits(gb, 2);
|
||||
ch_data->bs_num_env = num_rel_lead + num_rel_trail + 1;
|
||||
bs_num_env = num_rel_lead + num_rel_trail + 1;
|
||||
|
||||
if (ch_data->bs_num_env > 5) {
|
||||
if (bs_num_env > 5) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
|
||||
ch_data->bs_num_env);
|
||||
bs_num_env);
|
||||
return -1;
|
||||
}
|
||||
ch_data->bs_num_env = bs_num_env;
|
||||
|
||||
ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
|
||||
|
||||
@@ -710,6 +713,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
|
||||
get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env);
|
||||
break;
|
||||
}
|
||||
ch_data->bs_frame_class = bs_frame_class;
|
||||
|
||||
av_assert0(bs_pointer >= 0);
|
||||
if (bs_pointer > ch_data->bs_num_env + 1) {
|
||||
|
||||
@@ -744,30 +744,31 @@ static void ac3_upmix_delay(AC3DecodeContext *s)
|
||||
* @param[in] default_band_struct default band structure table
|
||||
* @param[out] num_bands number of bands (optionally NULL)
|
||||
* @param[out] band_sizes array containing the number of bins in each band (optionally NULL)
|
||||
* @param[in,out] band_struct current band structure
|
||||
*/
|
||||
static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
|
||||
int ecpl, int start_subband, int end_subband,
|
||||
const uint8_t *default_band_struct,
|
||||
int *num_bands, uint8_t *band_sizes)
|
||||
int *num_bands, uint8_t *band_sizes,
|
||||
uint8_t *band_struct, int band_struct_size)
|
||||
{
|
||||
int subbnd, bnd, n_subbands, n_bands=0;
|
||||
uint8_t bnd_sz[22];
|
||||
uint8_t coded_band_struct[22];
|
||||
const uint8_t *band_struct;
|
||||
|
||||
n_subbands = end_subband - start_subband;
|
||||
|
||||
if (!blk)
|
||||
memcpy(band_struct, default_band_struct, band_struct_size);
|
||||
|
||||
av_assert0(band_struct_size >= start_subband + n_subbands);
|
||||
|
||||
band_struct += start_subband + 1;
|
||||
|
||||
/* decode band structure from bitstream or use default */
|
||||
if (!eac3 || get_bits1(gbc)) {
|
||||
for (subbnd = 0; subbnd < n_subbands - 1; subbnd++) {
|
||||
coded_band_struct[subbnd] = get_bits1(gbc);
|
||||
band_struct[subbnd] = get_bits1(gbc);
|
||||
}
|
||||
band_struct = coded_band_struct;
|
||||
} else if (!blk) {
|
||||
band_struct = &default_band_struct[start_subband+1];
|
||||
} else {
|
||||
/* no change in band structure */
|
||||
return;
|
||||
}
|
||||
|
||||
/* calculate number of bands and band sizes based on band structure.
|
||||
@@ -894,12 +895,15 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
start_subband, end_subband,
|
||||
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;
|
||||
}
|
||||
s->spx_band_sizes,
|
||||
s->spx_band_struct, sizeof(s->spx_band_struct));
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1026,7 +1030,8 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
decode_band_structure(gbc, blk, s->eac3, 0, cpl_start_subband,
|
||||
cpl_end_subband,
|
||||
ff_eac3_default_cpl_band_struct,
|
||||
&s->num_cpl_bands, s->cpl_band_sizes);
|
||||
&s->num_cpl_bands, s->cpl_band_sizes,
|
||||
s->cpl_band_struct, sizeof(s->cpl_band_struct));
|
||||
} else {
|
||||
/* coupling not in use */
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
@@ -1326,7 +1331,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
for (ch = 1; ch <= s->channels; ch++) {
|
||||
int audio_channel = 0;
|
||||
INTFLOAT gain;
|
||||
if (s->channel_mode == AC3_CHMODE_DUALMONO)
|
||||
if (s->channel_mode == AC3_CHMODE_DUALMONO && ch <= 2)
|
||||
audio_channel = 2-ch;
|
||||
if (s->heavy_compression && s->compression_exists[audio_channel])
|
||||
gain = s->heavy_dynamic_range[audio_channel];
|
||||
|
||||
@@ -126,6 +126,7 @@ typedef struct AC3DecodeContext {
|
||||
int phase_flags_in_use; ///< phase flags in use (phsflginu)
|
||||
int phase_flags[AC3_MAX_CPL_BANDS]; ///< phase flags (phsflg)
|
||||
int num_cpl_bands; ///< number of coupling bands (ncplbnd)
|
||||
uint8_t cpl_band_struct[AC3_MAX_CPL_BANDS];
|
||||
uint8_t cpl_band_sizes[AC3_MAX_CPL_BANDS]; ///< number of coeffs in each coupling band
|
||||
int firstchincpl; ///< first channel in coupling
|
||||
int first_cpl_coords[AC3_MAX_CHANNELS]; ///< first coupling coordinates states (firstcplcos)
|
||||
@@ -142,6 +143,7 @@ typedef struct AC3DecodeContext {
|
||||
int spx_dst_start_freq; ///< spx starting frequency bin for copying (copystartmant)
|
||||
///< the copy region ends at the start of the spx region.
|
||||
int num_spx_bands; ///< number of spx bands (nspxbnds)
|
||||
uint8_t spx_band_struct[SPX_MAX_BANDS];
|
||||
uint8_t spx_band_sizes[SPX_MAX_BANDS]; ///< number of bins in each spx band
|
||||
uint8_t first_spx_coords[AC3_MAX_CHANNELS]; ///< first spx coordinates states (firstspxcos)
|
||||
INTFLOAT spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor (nblendfact)
|
||||
|
||||
@@ -81,7 +81,7 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset,
|
||||
s2 = prev->s2;
|
||||
for (i = 0; i < BLOCK_SAMPLES; i++) {
|
||||
d = get_sbits(&gb, 4);
|
||||
s0 = ((d << COEFF_BITS) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;
|
||||
s0 = ((d * (1 << COEFF_BITS)) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;
|
||||
s2 = s1;
|
||||
s1 = av_clip_int16(s0);
|
||||
*out++ = s1;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -265,7 +265,7 @@ static void decode_pitch_lag_high(int *lag_int, int *lag_frac, int pitch_index,
|
||||
*lag_frac = pitch_index - (*lag_int << 2) + 136;
|
||||
} else if (pitch_index < 440) {
|
||||
*lag_int = (pitch_index + 257 - 376) >> 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) * 2;
|
||||
/* the actual resolution is 1/2 but expressed as 1/4 */
|
||||
} else {
|
||||
*lag_int = pitch_index - 280;
|
||||
@@ -295,7 +295,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
|
||||
if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) {
|
||||
if (pitch_index < 116) {
|
||||
*lag_int = (pitch_index + 69) >> 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1) + 68) << 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1) + 68) * 2;
|
||||
} else {
|
||||
*lag_int = pitch_index - 24;
|
||||
*lag_frac = 0;
|
||||
@@ -305,7 +305,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
|
||||
AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);
|
||||
} else {
|
||||
*lag_int = (pitch_index + 1) >> 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1)) << 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1)) * 2;
|
||||
*lag_int += *base_lag_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1372,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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1403,6 +1403,16 @@ enum AVPacketSideDataType {
|
||||
* side data includes updated metadata which appeared in the stream.
|
||||
*/
|
||||
AV_PKT_DATA_METADATA_UPDATE,
|
||||
|
||||
/**
|
||||
* The number of side data elements (in fact a bit more than it).
|
||||
* This is not part of the public API/ABI in the sense that it may
|
||||
* change when new side data types are added.
|
||||
* This must stay the last enum value.
|
||||
* If its value becomes huge, some code using it
|
||||
* needs to be updated as it assumes it to be smaller than other limits.
|
||||
*/
|
||||
AV_PKT_DATA_NB
|
||||
};
|
||||
|
||||
#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
|
||||
|
||||
@@ -184,6 +184,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)
|
||||
@@ -193,9 +194,11 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
|
||||
} else {
|
||||
DUP_DATA(pkt->data, src->data, pkt->size, 1, ALLOC_BUF);
|
||||
}
|
||||
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;
|
||||
@@ -277,16 +280,17 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
uint8_t *data, size_t size)
|
||||
{
|
||||
AVPacketSideData *tmp;
|
||||
int elems = pkt->side_data_elems;
|
||||
|
||||
if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
|
||||
if ((unsigned)elems + 1 > AV_PKT_DATA_NB)
|
||||
return AVERROR(ERANGE);
|
||||
|
||||
pkt->side_data = av_realloc(pkt->side_data,
|
||||
(elems + 1) * sizeof(*pkt->side_data));
|
||||
if (!pkt->side_data)
|
||||
tmp = av_realloc(pkt->side_data, (elems + 1) * sizeof(*tmp));
|
||||
if (!tmp)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
pkt->side_data = tmp;
|
||||
pkt->side_data[elems].data = data;
|
||||
pkt->side_data[elems].size = size;
|
||||
pkt->side_data[elems].type = type;
|
||||
@@ -329,6 +333,8 @@ uint8_t *av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
return pkt->side_data[i].data;
|
||||
}
|
||||
}
|
||||
if (size)
|
||||
*size = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -401,13 +407,18 @@ 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;
|
||||
}
|
||||
|
||||
if (i > AV_PKT_DATA_NB)
|
||||
return AVERROR(ERANGE);
|
||||
|
||||
pkt->side_data = av_malloc_array(i, sizeof(*pkt->side_data));
|
||||
if (!pkt->side_data)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -415,7 +426,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -107,7 +107,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
|
||||
if (src < source || src >= source_end)
|
||||
return AVERROR_INVALIDDATA;
|
||||
shift += 2;
|
||||
val |= *src << shift;
|
||||
val |= (unsigned)*src << shift;
|
||||
if (*src & 0xC)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -614,8 +614,15 @@ void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
|
||||
mv_pred_median(h, mvP, mvA, mvB, mvC);
|
||||
|
||||
if (mode < MV_PRED_PSKIP) {
|
||||
mvP->x += get_se_golomb(&h->gb);
|
||||
mvP->y += get_se_golomb(&h->gb);
|
||||
int mx = get_se_golomb(&h->gb) + (unsigned)mvP->x;
|
||||
int my = get_se_golomb(&h->gb) + (unsigned)mvP->y;
|
||||
|
||||
if (mx != (int16_t)mx || my != (int16_t)my) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "MV %d %d out of supported range\n", mx, my);
|
||||
} else {
|
||||
mvP->x = mx;
|
||||
mvP->y = my;
|
||||
}
|
||||
}
|
||||
set_mvs(mvP, size);
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ static inline void mv_pred_direct(AVSContext *h, cavs_vector *pmv_fw,
|
||||
cavs_vector *col_mv)
|
||||
{
|
||||
cavs_vector *pmv_bw = pmv_fw + MV_BWD_OFFS;
|
||||
int den = h->direct_den[col_mv->ref];
|
||||
unsigned den = h->direct_den[col_mv->ref];
|
||||
int m = FF_SIGNBIT(col_mv->x);
|
||||
|
||||
pmv_fw->dist = h->dist[1];
|
||||
@@ -1031,6 +1031,10 @@ static int decode_pic(AVSContext *h)
|
||||
h->scale_den[1] = h->dist[1] ? 512/h->dist[1] : 0;
|
||||
if (h->cur.f->pict_type == AV_PICTURE_TYPE_B) {
|
||||
h->sym_factor = h->dist[0] * h->scale_den[1];
|
||||
if (FFABS(h->sym_factor) > 32768) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "sym_factor %d too large\n", h->sym_factor);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
} else {
|
||||
h->direct_den[0] = h->dist[0] ? 16384 / h->dist[0] : 0;
|
||||
h->direct_den[1] = h->dist[1] ? 16384 / h->dist[1] : 0;
|
||||
@@ -1217,6 +1221,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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,8 @@ typedef struct CCaptionSubContext {
|
||||
int64_t last_real_time;
|
||||
char prev_cmd[2];
|
||||
/* buffer to store pkt data */
|
||||
AVBufferRef *pktbuf;
|
||||
uint8_t *pktbuf;
|
||||
int pktbuf_size;
|
||||
} CCaptionSubContext;
|
||||
|
||||
|
||||
@@ -160,11 +161,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;
|
||||
}
|
||||
|
||||
@@ -172,7 +169,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;
|
||||
}
|
||||
|
||||
@@ -578,16 +576,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) {
|
||||
uint8_t cc_type = *(bptr + i) & 3;
|
||||
|
||||
@@ -252,11 +252,11 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
aligned_width = FFALIGN(c->avctx->width, 16);
|
||||
c->padded_bits = aligned_width - c->avctx->width;
|
||||
if (c->video_size < aligned_width * avctx->height * c->bpp / 8)
|
||||
if (c->video_size < aligned_width * avctx->height * (int64_t)c->bpp / 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (!encoding && c->palette_size && c->bpp <= 8) {
|
||||
if (!encoding && c->palette_size && c->bpp <= 8 && c->format != CHUNKY) {
|
||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||
} else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) {
|
||||
} else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8) && c->format != CHUNKY) {
|
||||
if (c->palette_size != (1 << (c->bpp - 1)))
|
||||
return AVERROR_INVALIDDATA;
|
||||
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
||||
|
||||
@@ -312,7 +312,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
s->plane[s->channel_num].band[0][0].width = data;
|
||||
s->plane[s->channel_num].band[0][0].stride = data;
|
||||
av_log(avctx, AV_LOG_DEBUG, "Lowpass width %"PRIu16"\n", data);
|
||||
if (data < 2 || data > s->plane[s->channel_num].band[0][0].a_width) {
|
||||
if (data < 3 || data > s->plane[s->channel_num].band[0][0].a_width) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid lowpass width\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -320,7 +320,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
} else if (tag == 28) {
|
||||
s->plane[s->channel_num].band[0][0].height = data;
|
||||
av_log(avctx, AV_LOG_DEBUG, "Lowpass height %"PRIu16"\n", data);
|
||||
if (data < 2 || data > s->plane[s->channel_num].band[0][0].height) {
|
||||
if (data < 3 || data > s->plane[s->channel_num].band[0][0].height) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid lowpass height\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -358,7 +358,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].width = data;
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].stride = FFALIGN(data, 8);
|
||||
av_log(avctx, AV_LOG_DEBUG, "Highpass width %i channel %i level %i subband %i\n", data, s->channel_num, s->level, s->subband_num);
|
||||
if (data < 2) {
|
||||
if (data < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid highpass width\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -366,7 +366,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
} else if (tag == 42) {
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].height = data;
|
||||
av_log(avctx, AV_LOG_DEBUG, "Highpass height %i\n", data);
|
||||
if (data < 2) {
|
||||
if (data < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid highpass height\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -375,7 +375,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].width = data;
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].stride = FFALIGN(data, 8);
|
||||
av_log(avctx, AV_LOG_DEBUG, "Highpass width2 %i\n", data);
|
||||
if (data < 2) {
|
||||
if (data < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid highpass width2\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -383,7 +383,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
} else if (tag == 50) {
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].height = data;
|
||||
av_log(avctx, AV_LOG_DEBUG, "Highpass height2 %i\n", data);
|
||||
if (data < 2) {
|
||||
if (data < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid highpass height2\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -425,6 +425,11 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
frame.f->width =
|
||||
frame.f->height = 0;
|
||||
|
||||
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
|
||||
return ret;
|
||||
@@ -756,6 +761,6 @@ AVCodec ff_cfhd_decoder = {
|
||||
.init = cfhd_decode_init,
|
||||
.close = cfhd_close_decoder,
|
||||
.decode = cfhd_decode,
|
||||
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
|
||||
.capabilities = AV_CODEC_CAP_DR1,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define VLC_BITS 7
|
||||
#define VLC_DEPTH 2
|
||||
|
||||
|
||||
typedef struct CLLCContext {
|
||||
AVCodecContext *avctx;
|
||||
BswapDSPContext bdsp;
|
||||
@@ -51,6 +55,13 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
|
||||
|
||||
num_lens = get_bits(gb, 5);
|
||||
|
||||
if (num_lens > VLC_BITS * VLC_DEPTH) {
|
||||
vlc->table = NULL;
|
||||
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "To long VLCs %d\n", num_lens);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_lens; i++) {
|
||||
num_codes = get_bits(gb, 9);
|
||||
num_codes_sum += num_codes;
|
||||
@@ -70,11 +81,15 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
|
||||
|
||||
count++;
|
||||
}
|
||||
if (prefix > (65535 - 256)/2) {
|
||||
vlc->table = NULL;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
prefix <<= 1;
|
||||
}
|
||||
|
||||
return ff_init_vlc_sparse(vlc, 7, count, bits, 1, 1,
|
||||
return ff_init_vlc_sparse(vlc, VLC_BITS, count, bits, 1, 1,
|
||||
codes, 2, 2, symbols, 1, 1, 0);
|
||||
}
|
||||
|
||||
@@ -101,7 +116,7 @@ static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left,
|
||||
for (i = 0; i < ctx->avctx->width; i++) {
|
||||
/* Always get the alpha component */
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc[0].table, 7, 2);
|
||||
GET_VLC(code, bits, gb, vlc[0].table, VLC_BITS, VLC_DEPTH);
|
||||
|
||||
pred[0] += code;
|
||||
dst[0] = pred[0];
|
||||
@@ -110,21 +125,21 @@ static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left,
|
||||
if (dst[0]) {
|
||||
/* Red */
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc[1].table, 7, 2);
|
||||
GET_VLC(code, bits, gb, vlc[1].table, VLC_BITS, VLC_DEPTH);
|
||||
|
||||
pred[1] += code;
|
||||
dst[1] = pred[1];
|
||||
|
||||
/* Green */
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc[2].table, 7, 2);
|
||||
GET_VLC(code, bits, gb, vlc[2].table, VLC_BITS, VLC_DEPTH);
|
||||
|
||||
pred[2] += code;
|
||||
dst[2] = pred[2];
|
||||
|
||||
/* Blue */
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc[3].table, 7, 2);
|
||||
GET_VLC(code, bits, gb, vlc[3].table, VLC_BITS, VLC_DEPTH);
|
||||
|
||||
pred[3] += code;
|
||||
dst[3] = pred[3];
|
||||
@@ -166,7 +181,7 @@ static int read_rgb24_component_line(CLLCContext *ctx, GetBitContext *gb,
|
||||
/* Simultaneously read and restore the line */
|
||||
for (i = 0; i < ctx->avctx->width; i++) {
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc->table, 7, 2);
|
||||
GET_VLC(code, bits, gb, vlc->table, VLC_BITS, VLC_DEPTH);
|
||||
|
||||
pred += code;
|
||||
dst[0] = pred;
|
||||
@@ -195,7 +210,7 @@ static int read_yuv_component_line(CLLCContext *ctx, GetBitContext *gb,
|
||||
/* Simultaneously read and restore the line */
|
||||
for (i = 0; i < ctx->avctx->width >> is_chroma; i++) {
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc->table, 7, 2);
|
||||
GET_VLC(code, bits, gb, vlc->table, VLC_BITS, VLC_DEPTH);
|
||||
|
||||
pred += code;
|
||||
outbuf[i] = pred;
|
||||
|
||||
@@ -1760,6 +1760,7 @@ static int parse_x96_frame_exss(DCACoreDecoder *s)
|
||||
return ret;
|
||||
|
||||
// Channel set data
|
||||
s->x96_nchannels = 0;
|
||||
for (i = 0, x96_base_ch = 0; i < x96_nchsets; i++) {
|
||||
header_pos = get_bits_count(&s->gb);
|
||||
|
||||
@@ -1899,9 +1900,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->xch_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "XCH sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1921,9 +1923,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->x96_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "X96 sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1946,9 +1949,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->xxch_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "XXCH sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ static void dmix_sub_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t le
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
dst[i] -= mul15(src[i], coeff);
|
||||
dst[i] -= (unsigned)mul15(src[i], coeff);
|
||||
}
|
||||
|
||||
static void dmix_add_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#define DDPF_FOURCC (1 << 2)
|
||||
#define DDPF_PALETTE (1 << 5)
|
||||
#define DDPF_NORMALMAP (1 << 31)
|
||||
#define DDPF_NORMALMAP (1U << 31)
|
||||
|
||||
enum DDSPostProc {
|
||||
DDS_NONE = 0,
|
||||
@@ -676,7 +676,7 @@ static int dds_decode(AVCodecContext *avctx, void *data,
|
||||
(frame->data[1][2+i*4]<<0)+
|
||||
(frame->data[1][1+i*4]<<8)+
|
||||
(frame->data[1][0+i*4]<<16)+
|
||||
(frame->data[1][3+i*4]<<24)
|
||||
((unsigned)frame->data[1][3+i*4]<<24)
|
||||
);
|
||||
|
||||
frame->palette_has_changed = 1;
|
||||
|
||||
@@ -67,7 +67,8 @@ static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height
|
||||
const uint8_t *frame_start = frame;
|
||||
const uint8_t *frame_end = frame + width * height;
|
||||
int mask = 0x10000, bitbuf = 0;
|
||||
int v, count, segments;
|
||||
int v, count;
|
||||
unsigned segments;
|
||||
unsigned offset;
|
||||
|
||||
segments = bytestream2_get_le32(gb);
|
||||
@@ -175,7 +176,7 @@ static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame += v;
|
||||
} else {
|
||||
if (frame_end - frame < width + 3)
|
||||
if (frame_end - frame < width + 4)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame[0] = frame[1] =
|
||||
frame[width] = frame[width + 1] = bytestream2_get_byte(gb);
|
||||
@@ -249,7 +250,7 @@ static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height
|
||||
segments = bytestream2_get_le16u(gb);
|
||||
while ((segments & 0xC000) == 0xC000) {
|
||||
unsigned skip_lines = -(int16_t)segments;
|
||||
unsigned delta = -((int16_t)segments * width);
|
||||
int64_t delta = -((int16_t)segments * (int64_t)width);
|
||||
if (frame_end - frame <= delta || y + lines + skip_lines > height)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame += delta;
|
||||
|
||||
@@ -173,7 +173,7 @@ typedef struct DiracContext {
|
||||
|
||||
struct {
|
||||
unsigned prefix_bytes;
|
||||
unsigned size_scaler;
|
||||
uint64_t size_scaler;
|
||||
} highquality;
|
||||
|
||||
struct {
|
||||
@@ -826,9 +826,15 @@ static int decode_hq_slice(AVCodecContext *avctx, void *arg)
|
||||
|
||||
/* Luma + 2 Chroma planes */
|
||||
for (i = 0; i < 3; i++) {
|
||||
int length = s->highquality.size_scaler * get_bits(gb, 8);
|
||||
int bits_left = 8 * length;
|
||||
int bits_end = get_bits_count(gb) + bits_left;
|
||||
int64_t length = s->highquality.size_scaler * get_bits(gb, 8);
|
||||
int64_t bits_left = 8 * length;
|
||||
int64_t bits_end = get_bits_count(gb) + bits_left;
|
||||
|
||||
if (bits_end >= INT_MAX) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "end too far away\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (level = 0; level < s->wavelet_depth; level++) {
|
||||
for (orientation = !!level; orientation < 4; orientation++) {
|
||||
decode_subband(s, gb, quants[level][orientation], slice->slice_x, slice->slice_y, bits_end,
|
||||
@@ -848,7 +854,8 @@ static int decode_hq_slice(AVCodecContext *avctx, void *arg)
|
||||
static int decode_lowdelay(DiracContext *s)
|
||||
{
|
||||
AVCodecContext *avctx = s->avctx;
|
||||
int slice_x, slice_y, bytes = 0, bufsize;
|
||||
int slice_x, slice_y, bufsize;
|
||||
int64_t bytes = 0;
|
||||
const uint8_t *buf;
|
||||
DiracSlice *slices;
|
||||
int slice_num = 0;
|
||||
@@ -872,6 +879,11 @@ static int decode_lowdelay(DiracContext *s)
|
||||
if (bytes <= bufsize/8)
|
||||
bytes += buf[bytes] * s->highquality.size_scaler + 1;
|
||||
}
|
||||
if (bytes >= INT_MAX) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "too many bytes\n");
|
||||
av_free(slices);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
slices[slice_num].bytes = bytes;
|
||||
slices[slice_num].slice_x = slice_x;
|
||||
@@ -891,8 +903,8 @@ static int decode_lowdelay(DiracContext *s)
|
||||
} else {
|
||||
for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) {
|
||||
for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) {
|
||||
bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||
- slice_num * s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||
bytes = (slice_num+1) * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||
- slice_num * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||
slices[slice_num].bytes = bytes;
|
||||
slices[slice_num].slice_x = slice_x;
|
||||
slices[slice_num].slice_y = slice_y;
|
||||
@@ -1141,6 +1153,11 @@ static int dirac_unpack_idwt_params(DiracContext *s)
|
||||
else {
|
||||
s->num_x = svq3_get_ue_golomb(gb);
|
||||
s->num_y = svq3_get_ue_golomb(gb);
|
||||
if (s->num_x * s->num_y == 0 || s->num_x * (uint64_t)s->num_y > INT_MAX) {
|
||||
av_log(s->avctx,AV_LOG_ERROR,"Invalid numx/y\n");
|
||||
s->num_x = s->num_y = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->ld_picture) {
|
||||
s->lowdelay.bytes.num = svq3_get_ue_golomb(gb);
|
||||
s->lowdelay.bytes.den = svq3_get_ue_golomb(gb);
|
||||
@@ -1151,6 +1168,10 @@ static int dirac_unpack_idwt_params(DiracContext *s)
|
||||
} else if (s->hq_picture) {
|
||||
s->highquality.prefix_bytes = svq3_get_ue_golomb(gb);
|
||||
s->highquality.size_scaler = svq3_get_ue_golomb(gb);
|
||||
if (s->highquality.prefix_bytes >= INT_MAX / 8) {
|
||||
av_log(s->avctx,AV_LOG_ERROR,"too many prefix bytes\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
/* [DIRAC_STD] 11.3.5 Quantisation matrices (low-delay syntax). quant_matrix() */
|
||||
@@ -1879,7 +1900,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;
|
||||
}
|
||||
|
||||
@@ -1943,9 +1966,9 @@ static int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame)
|
||||
|
||||
if (out) {
|
||||
out->reference ^= DELAYED_PIC_REF;
|
||||
*got_frame = 1;
|
||||
if((ret = av_frame_ref(picture, out->avframe)) < 0)
|
||||
return ret;
|
||||
*got_frame = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#define DSS_SP_FRAME_SIZE 42
|
||||
#define DSS_SP_SAMPLE_COUNT (66 * SUBFRAMES)
|
||||
#define DSS_SP_FORMULA(a, b, c) (((((a) << 15) + (b) * (c)) + 0x4000) >> 15)
|
||||
#define DSS_SP_FORMULA(a, b, c) ((int)((((a) * (1 << 15)) + (b) * (unsigned)(c)) + 0x4000) >> 15)
|
||||
|
||||
typedef struct DssSpSubframe {
|
||||
int16_t gain;
|
||||
@@ -499,7 +499,7 @@ static void dss_sp_scale_vector(int32_t *vec, int bits, int size)
|
||||
vec[i] = vec[i] >> -bits;
|
||||
else
|
||||
for (i = 0; i < size; i++)
|
||||
vec[i] = vec[i] << bits;
|
||||
vec[i] = vec[i] * (1 << bits);
|
||||
}
|
||||
|
||||
static void dss_sp_update_buf(int32_t *hist, int32_t *vector)
|
||||
@@ -524,12 +524,12 @@ static void dss_sp_shift_sq_sub(const int32_t *filter_buf,
|
||||
tmp = dst[a] * filter_buf[0];
|
||||
|
||||
for (i = 14; i > 0; i--)
|
||||
tmp -= error_buf[i] * filter_buf[i];
|
||||
tmp -= error_buf[i] * (unsigned)filter_buf[i];
|
||||
|
||||
for (i = 14; i > 0; i--)
|
||||
error_buf[i] = error_buf[i - 1];
|
||||
|
||||
tmp = (tmp + 4096) >> 13;
|
||||
tmp = (int)(tmp + 4096U) >> 13;
|
||||
|
||||
error_buf[1] = tmp;
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "bytestream.h"
|
||||
#include "internal.h"
|
||||
#include "libavutil/colorspace.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
#define DVBSUB_PAGE_SEGMENT 0x10
|
||||
@@ -810,7 +811,7 @@ static void compute_default_clut(AVSubtitleRect *rect, 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(rect->data[1] + 4*list_inv[i], RGBA(v/2,v,v/2,v));
|
||||
@@ -1214,9 +1215,9 @@ static int dvbsub_parse_clut_segment(AVCodecContext *avctx,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (depth & 0x80)
|
||||
if (depth & 0x80 && entry_id < 4)
|
||||
clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
|
||||
else if (depth & 0x40)
|
||||
else if (depth & 0x40 && entry_id < 16)
|
||||
clut->clut16[entry_id] = RGBA(r,g,b,255 - alpha);
|
||||
else if (depth & 0x20)
|
||||
clut->clut256[entry_id] = RGBA(r,g,b,255 - alpha);
|
||||
@@ -1239,6 +1240,7 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx,
|
||||
DVBSubObject *object;
|
||||
DVBSubObjectDisplay *display;
|
||||
int fill;
|
||||
int ret;
|
||||
|
||||
if (buf_size < 10)
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -1267,6 +1269,12 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx,
|
||||
region->height = AV_RB16(buf);
|
||||
buf += 2;
|
||||
|
||||
ret = av_image_check_size(region->width, region->height, 0, avctx);
|
||||
if (ret < 0) {
|
||||
region->width= region->height= 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (region->width * region->height != region->buf_size) {
|
||||
av_free(region->pbuf);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *
|
||||
cb = *ycbcr++;
|
||||
YUV_TO_RGB1_CCIR(cb, cr);
|
||||
YUV_TO_RGB2_CCIR(r, g, b, y);
|
||||
*rgba++ = (*alpha++ << 24) | (r << 16) | (g << 8) | b;
|
||||
*rgba++ = ((unsigned)*alpha++ << 24) | (r << 16) | (g << 8) | b;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,16 +185,16 @@ 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;
|
||||
rgba_palette[i] = b | (g << 8) | (r << 16) | ((alpha[i] * 17) << 24);
|
||||
rgba_palette[i] = b | (g << 8) | (r << 16) | ((alpha[i] * 17U) << 24);
|
||||
color_used[colormap[i]] = (i + 1);
|
||||
j++;
|
||||
} else {
|
||||
rgba_palette[i] = (rgba_palette[color_used[colormap[i]] - 1] & 0x00ffffff) |
|
||||
((alpha[i] * 17) << 24);
|
||||
((alpha[i] * 17U) << 24);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -548,7 +548,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;
|
||||
|
||||
@@ -252,7 +252,7 @@ static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
|
||||
/* Vector Quantization */
|
||||
int v = get_bits(gbc, bits);
|
||||
for (blk = 0; blk < 6; blk++) {
|
||||
s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] << 8;
|
||||
s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] * (1 << 8);
|
||||
}
|
||||
} else {
|
||||
/* Gain Adaptive Quantization */
|
||||
@@ -271,16 +271,16 @@ static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
|
||||
int b;
|
||||
int mbits = bits - (2 - log_gain);
|
||||
mant = get_sbits(gbc, mbits);
|
||||
mant <<= (23 - (mbits - 1));
|
||||
mant = ((unsigned)mant) << (23 - (mbits - 1));
|
||||
/* remap mantissa value to correct for asymmetric quantization */
|
||||
if (mant >= 0)
|
||||
b = 1 << (23 - log_gain);
|
||||
else
|
||||
b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] << 8;
|
||||
b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] * (1 << 8);
|
||||
mant += ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) + b;
|
||||
} else {
|
||||
/* small mantissa, no GAQ, or Gk=1 */
|
||||
mant <<= 24 - bits;
|
||||
mant *= (1 << 24 - bits);
|
||||
if (!log_gain) {
|
||||
/* remap mantissa value for no GAQ or Gk=1 */
|
||||
mant += (ff_eac3_gaq_remap_1[hebap-8] * (int64_t)mant) >> 15;
|
||||
|
||||
@@ -284,7 +284,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
|
||||
if (avctx->width != width || avctx->height != height) {
|
||||
av_frame_unref(s->last_frame);
|
||||
if((width * height)/2048*7 > bytestream2_get_bytes_left(&gb))
|
||||
if((width * (int64_t)height)/2048*7 > bytestream2_get_bytes_left(&gb))
|
||||
return AVERROR_INVALIDDATA;
|
||||
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -93,7 +93,7 @@ static inline void tqi_idct_put(TqiContext *t, AVFrame *frame, int16_t (*block)[
|
||||
|
||||
static void tqi_calculate_qtable(MpegEncContext *s, int quant)
|
||||
{
|
||||
const int qscale = (215 - 2*quant)*5;
|
||||
const int64_t qscale = (215 - 2*quant)*5;
|
||||
int i;
|
||||
s->intra_matrix[0] = (ff_inv_aanscales[0]*ff_mpeg1_default_intra_matrix[0])>>11;
|
||||
for(i=1; i<64; i++)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -186,9 +186,9 @@ static union av_intfloat32 exr_half2float(uint16_t hf)
|
||||
*
|
||||
* @return normalized 16-bit unsigned int
|
||||
*/
|
||||
static inline uint16_t exr_flt2uint(uint32_t v)
|
||||
static inline uint16_t exr_flt2uint(int32_t v)
|
||||
{
|
||||
unsigned int exp = v >> 23;
|
||||
int32_t exp = v >> 23;
|
||||
// "HACK": negative values result in exp< 0, so clipping them to 0
|
||||
// is also handled by this condition, avoids explicit check for sign bit.
|
||||
if (exp <= 127 + 7 - 24) // we would shift out all bits anyway
|
||||
|
||||
@@ -45,7 +45,8 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
|
||||
if (get_rac(c, state + 0))
|
||||
return 0;
|
||||
else {
|
||||
int i, e, a;
|
||||
int i, e;
|
||||
unsigned a;
|
||||
e = 0;
|
||||
while (get_rac(c, state + 1 + FFMIN(e, 9))) { // 1..10
|
||||
e++;
|
||||
@@ -1002,7 +1003,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
const uint8_t *src[4];
|
||||
uint8_t *dst[4];
|
||||
ff_thread_await_progress(&f->last_picture, INT_MAX, 0);
|
||||
for (j = 0; j < 4; j++) {
|
||||
for (j = 0; j < desc->nb_components; j++) {
|
||||
int pixshift = desc->comp[j].depth > 8;
|
||||
int sh = (j == 1 || j == 2) ? f->chroma_h_shift : 0;
|
||||
int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0;
|
||||
@@ -1010,6 +1011,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
(fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift);
|
||||
src[j] = f->last_picture.f->data[j] + f->last_picture.f->linesize[j] *
|
||||
(fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift);
|
||||
|
||||
}
|
||||
if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
|
||||
desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
|
||||
dst[1] = p->data[1];
|
||||
src[1] = f->last_picture.f->data[1];
|
||||
}
|
||||
av_image_copy(dst, p->linesize, src,
|
||||
f->last_picture.f->linesize,
|
||||
|
||||
@@ -780,14 +780,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
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)
|
||||
@@ -1224,7 +1222,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;
|
||||
@@ -1280,6 +1277,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;
|
||||
|
||||
@@ -1309,11 +1311,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 *));
|
||||
|
||||
@@ -94,8 +94,8 @@ static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd
|
||||
const int t7 = t3 - t1;
|
||||
const int t8 = 17734 * blk[2 * step] - 42813 * blk[6 * step];
|
||||
const int t9 = 17734 * blk[6 * step] + 42814 * blk[2 * step];
|
||||
const int tA = (blk[0 * step] - blk[4 * step] << 15) + rnd;
|
||||
const int tB = (blk[0 * step] + blk[4 * step] << 15) + rnd;
|
||||
const int tA = (blk[0 * step] - blk[4 * step]) * 32768 + rnd;
|
||||
const int tB = (blk[0 * step] + blk[4 * step]) * 32768 + rnd;
|
||||
blk[0 * step] = ( t4 + t9 + tB) >> shift;
|
||||
blk[1 * step] = ( t6 + t7 + t8 + tA) >> shift;
|
||||
blk[2 * step] = ( t6 - t7 - t8 + tA) >> shift;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -201,12 +201,12 @@ static int get_metadata_size(const uint8_t *buf, int buf_size)
|
||||
buf += 4;
|
||||
do {
|
||||
if (buf_end - buf < 4)
|
||||
return 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
flac_parse_block_header(buf, &metadata_last, NULL, &metadata_size);
|
||||
buf += 4;
|
||||
if (buf_end - buf < metadata_size) {
|
||||
/* need more data in order to read the complete header */
|
||||
return 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
buf += metadata_size;
|
||||
} while (!metadata_last);
|
||||
@@ -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,
|
||||
|
||||
@@ -202,6 +202,9 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
|
||||
num_chunks = bytestream2_get_le16(&g2);
|
||||
bytestream2_skip(&g2, 8); /* skip padding */
|
||||
|
||||
if (frame_size < 16)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
frame_size -= 16;
|
||||
|
||||
/* iterate through the chunks */
|
||||
@@ -520,6 +523,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
|
||||
if (frame_size > buf_size)
|
||||
frame_size = buf_size;
|
||||
|
||||
if (frame_size < 16)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame_size -= 16;
|
||||
|
||||
/* iterate through the chunks */
|
||||
|
||||
@@ -88,14 +88,14 @@ static inline void s_zero(int cur_diff, struct G722Band *band)
|
||||
ACCUM(3, band->diff_mem[2], 1);
|
||||
ACCUM(2, band->diff_mem[1], 1);
|
||||
ACCUM(1, band->diff_mem[0], 1);
|
||||
ACCUM(0, cur_diff << 1, 1);
|
||||
ACCUM(0, cur_diff * 2, 1);
|
||||
} else {
|
||||
ACCUM(5, band->diff_mem[4], 0);
|
||||
ACCUM(4, band->diff_mem[3], 0);
|
||||
ACCUM(3, band->diff_mem[2], 0);
|
||||
ACCUM(2, band->diff_mem[1], 0);
|
||||
ACCUM(1, band->diff_mem[0], 0);
|
||||
ACCUM(0, cur_diff << 1, 0);
|
||||
ACCUM(0, cur_diff * 2, 0);
|
||||
}
|
||||
#undef ACCUM
|
||||
band->s_zero = s_zero;
|
||||
@@ -119,14 +119,14 @@ static void do_adaptive_prediction(struct G722Band *band, const int cur_diff)
|
||||
band->part_reconst_mem[0] = cur_part_reconst;
|
||||
|
||||
band->pole_mem[1] = av_clip((sg[0] * av_clip(band->pole_mem[0], -8191, 8191) >> 5) +
|
||||
(sg[1] << 7) + (band->pole_mem[1] * 127 >> 7), -12288, 12288);
|
||||
(sg[1] * 128) + (band->pole_mem[1] * 127 >> 7), -12288, 12288);
|
||||
|
||||
limit = 15360 - band->pole_mem[1];
|
||||
band->pole_mem[0] = av_clip(-192 * sg[0] + (band->pole_mem[0] * 255 >> 8), -limit, limit);
|
||||
|
||||
s_zero(cur_diff, band);
|
||||
|
||||
cur_qtzd_reconst = av_clip_int16((band->s_predictor + cur_diff) << 1);
|
||||
cur_qtzd_reconst = av_clip_int16((band->s_predictor + cur_diff) * 2);
|
||||
band->s_predictor = av_clip_int16(band->s_zero +
|
||||
(band->pole_mem[0] * cur_qtzd_reconst >> 15) +
|
||||
(band->pole_mem[1] * band->prev_qtzd_reconst >> 15));
|
||||
|
||||
@@ -41,7 +41,7 @@ int ff_g723_1_scale_vector(int16_t *dst, const int16_t *vector, int length)
|
||||
bits= FFMAX(bits, 0);
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
dst[i] = vector[i] << bits >> 3;
|
||||
dst[i] = (vector[i] * (1 << bits)) >> 3;
|
||||
|
||||
return bits - 3;
|
||||
}
|
||||
@@ -125,9 +125,9 @@ static void lsp2lpc(int16_t *lpc)
|
||||
for (j = 0; j < LPC_ORDER; j++) {
|
||||
int index = (lpc[j] >> 7) & 0x1FF;
|
||||
int offset = lpc[j] & 0x7f;
|
||||
int temp1 = cos_tab[index] << 16;
|
||||
int temp1 = cos_tab[index] * (1 << 16);
|
||||
int temp2 = (cos_tab[index + 1] - cos_tab[index]) *
|
||||
((offset << 8) + 0x80) << 1;
|
||||
(((offset << 8) + 0x80) << 1);
|
||||
|
||||
lpc[j] = -(av_sat_dadd32(1 << 15, temp1 + temp2) >> 16);
|
||||
}
|
||||
@@ -138,11 +138,11 @@ static void lsp2lpc(int16_t *lpc)
|
||||
*/
|
||||
/* Initialize with values in Q28 */
|
||||
f1[0] = 1 << 28;
|
||||
f1[1] = (lpc[0] << 14) + (lpc[2] << 14);
|
||||
f1[1] = (lpc[0] + lpc[2]) * (1 << 14);
|
||||
f1[2] = lpc[0] * lpc[2] + (2 << 28);
|
||||
|
||||
f2[0] = 1 << 28;
|
||||
f2[1] = (lpc[1] << 14) + (lpc[3] << 14);
|
||||
f2[1] = (lpc[1] + lpc[3]) * (1 << 14);
|
||||
f2[2] = lpc[1] * lpc[3] + (2 << 28);
|
||||
|
||||
/*
|
||||
@@ -162,8 +162,8 @@ static void lsp2lpc(int16_t *lpc)
|
||||
|
||||
f1[0] >>= 1;
|
||||
f2[0] >>= 1;
|
||||
f1[1] = ((lpc[2 * i] << 16 >> i) + f1[1]) >> 1;
|
||||
f2[1] = ((lpc[2 * i + 1] << 16 >> i) + f2[1]) >> 1;
|
||||
f1[1] = ((lpc[2 * i] * 65536 >> i) + f1[1]) >> 1;
|
||||
f2[1] = ((lpc[2 * i + 1] * 65536 >> i) + f2[1]) >> 1;
|
||||
}
|
||||
|
||||
/* Convert polynomial coefficients to LPC coefficients */
|
||||
@@ -171,8 +171,8 @@ static void lsp2lpc(int16_t *lpc)
|
||||
int64_t ff1 = f1[i + 1] + f1[i];
|
||||
int64_t ff2 = f2[i + 1] - f2[i];
|
||||
|
||||
lpc[i] = av_clipl_int32(((ff1 + ff2) << 3) + (1 << 15)) >> 16;
|
||||
lpc[LPC_ORDER - i - 1] = av_clipl_int32(((ff1 - ff2) << 3) +
|
||||
lpc[i] = av_clipl_int32(((ff1 + ff2) * 8) + (1 << 15)) >> 16;
|
||||
lpc[LPC_ORDER - i - 1] = av_clipl_int32(((ff1 - ff2) * 8) +
|
||||
(1 << 15)) >> 16;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
* @param b 16 bit multiplier
|
||||
*/
|
||||
#define MULL2(a, b) \
|
||||
((((a) >> 16) * (b) << 1) + (((a) & 0xffff) * (b) >> 15))
|
||||
((((a) >> 16) * (b) * 2) + (((a) & 0xffff) * (b) >> 15))
|
||||
|
||||
/**
|
||||
* G723.1 frame types
|
||||
|
||||
@@ -487,7 +487,7 @@ static void residual_interp(int16_t *buf, int16_t *out, int lag,
|
||||
(FRAME_LEN - lag) * sizeof(*out));
|
||||
} else { /* Unvoiced */
|
||||
for (i = 0; i < FRAME_LEN; i++) {
|
||||
*rseed = *rseed * 521 + 259;
|
||||
*rseed = (int16_t)(*rseed * 521 + 259);
|
||||
out[i] = gain * *rseed >> 15;
|
||||
}
|
||||
memset(buf, 0, (FRAME_LEN + PITCH_MAX) * sizeof(*buf));
|
||||
@@ -516,7 +516,7 @@ static void residual_interp(int16_t *buf, int16_t *out, int lag,
|
||||
(iir_coef)[n - 1] * ((dest)[m - n] >> in_shift);\
|
||||
}\
|
||||
\
|
||||
(dest)[m] = av_clipl_int32(((src)[m] << 16) + (filter << 3) +\
|
||||
(dest)[m] = av_clipl_int32(((src)[m] * 65536) + (filter * 8) +\
|
||||
(1 << 15)) >> res_shift;\
|
||||
}\
|
||||
}
|
||||
@@ -663,7 +663,7 @@ static int estimate_sid_gain(G723_1_Context *p)
|
||||
t = p->sid_gain << shift;
|
||||
else
|
||||
t = p->sid_gain >> -shift;
|
||||
x = t * cng_filt[0] >> 16;
|
||||
x = av_clipl_int32(t * (int64_t)cng_filt[0] >> 16);
|
||||
|
||||
if (x >= cng_bseg[2])
|
||||
return 0x3F;
|
||||
@@ -694,13 +694,13 @@ static int estimate_sid_gain(G723_1_Context *p)
|
||||
if (y <= 0) {
|
||||
t = seg * 32 + (val + 1 << seg2);
|
||||
t = t * t - x;
|
||||
val = (seg2 - 1 << 4) + val;
|
||||
val = (seg2 - 1) * 16 + val;
|
||||
if (t >= y)
|
||||
val++;
|
||||
} else {
|
||||
t = seg * 32 + (val - 1 << seg2);
|
||||
t = t * t - x;
|
||||
val = (seg2 - 1 << 4) + val;
|
||||
val = (seg2 - 1) * 16 + val;
|
||||
if (t >= y)
|
||||
val--;
|
||||
}
|
||||
@@ -732,7 +732,7 @@ static void generate_noise(G723_1_Context *p)
|
||||
off[i * 2 + 1] = ((t >> 1) & 1) + SUBFRAME_LEN;
|
||||
t >>= 2;
|
||||
for (j = 0; j < 11; j++) {
|
||||
signs[i * 11 + j] = (t & 1) * 2 - 1 << 14;
|
||||
signs[i * 11 + j] = ((t & 1) * 2 - 1) * (1 << 14);
|
||||
t >>= 1;
|
||||
}
|
||||
}
|
||||
@@ -776,7 +776,7 @@ static void generate_noise(G723_1_Context *p)
|
||||
sum = 0;
|
||||
if (shift < 0) {
|
||||
for (j = 0; j < SUBFRAME_LEN * 2; j++) {
|
||||
t = vector_ptr[j] << -shift;
|
||||
t = vector_ptr[j] * (1 << -shift);
|
||||
sum += t * t;
|
||||
tmp[j] = t;
|
||||
}
|
||||
@@ -814,7 +814,7 @@ static void generate_noise(G723_1_Context *p)
|
||||
if (shift < 0)
|
||||
x >>= -shift;
|
||||
else
|
||||
x <<= shift;
|
||||
x *= 1 << shift;
|
||||
x = av_clip(x, -10000, 10000);
|
||||
|
||||
for (j = 0; j < 11; j++) {
|
||||
@@ -903,7 +903,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
|
||||
&p->subframe[i], p->cur_rate);
|
||||
/* Get the total excitation */
|
||||
for (j = 0; j < SUBFRAME_LEN; j++) {
|
||||
int v = av_clip_int16(vector_ptr[j] << 1);
|
||||
int v = av_clip_int16(vector_ptr[j] * 2);
|
||||
vector_ptr[j] = av_clip_int16(v + acb_vector[j]);
|
||||
}
|
||||
vector_ptr += SUBFRAME_LEN;
|
||||
|
||||
@@ -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;
|
||||
@@ -269,7 +269,7 @@ static int16_t g726_decode(G726Context* c, int I)
|
||||
c->se += mult(i2f(c->a[i] >> 2, &f), &c->sr[i]);
|
||||
c->se >>= 1;
|
||||
|
||||
return av_clip(re_signal << 2, -0xffff, 0xffff);
|
||||
return av_clip(re_signal * 4, -0xffff, 0xffff);
|
||||
}
|
||||
|
||||
static av_cold int g726_reset(G726Context *c)
|
||||
|
||||
@@ -382,6 +382,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1591,7 +1591,9 @@ again:
|
||||
#endif
|
||||
} else
|
||||
context_count++;
|
||||
}
|
||||
} else
|
||||
sl->ref_count[0] = sl->ref_count[1] = 0;
|
||||
break;
|
||||
break;
|
||||
case NAL_DPA:
|
||||
case NAL_DPB:
|
||||
@@ -1656,8 +1658,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;
|
||||
@@ -1678,6 +1680,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,
|
||||
@@ -1740,7 +1783,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;
|
||||
}
|
||||
@@ -1749,7 +1792,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;
|
||||
}
|
||||
|
||||
@@ -1744,7 +1744,7 @@ decode_cabac_residual_internal(const H264Context *h, H264SliceContext *sl,
|
||||
while( j-- ) { \
|
||||
coeff_abs += coeff_abs + get_cabac_bypass( CC ); \
|
||||
} \
|
||||
coeff_abs+= 14; \
|
||||
coeff_abs+= 14U; \
|
||||
} \
|
||||
\
|
||||
if( is_dc ) { \
|
||||
|
||||
@@ -1114,7 +1114,7 @@ decode_intra_mb:
|
||||
|
||||
dquant= get_se_golomb(&sl->gb);
|
||||
|
||||
sl->qscale += dquant;
|
||||
sl->qscale += (unsigned)dquant;
|
||||
|
||||
if (((unsigned)sl->qscale) > max_qp){
|
||||
if (sl->qscale < 0) sl->qscale += max_qp + 1;
|
||||
|
||||
@@ -613,7 +613,7 @@ single_col:
|
||||
|
||||
{
|
||||
const int16_t *mv_col = l1mv[x8 * 3 + y8 * b4_stride];
|
||||
int my_col = (mv_col[1] << y_shift) / 2;
|
||||
int my_col = (mv_col[1] * (1 << y_shift)) / 2;
|
||||
int mx = (scale * mv_col[0] + 128) >> 8;
|
||||
int my = (scale * my_col + 128) >> 8;
|
||||
fill_rectangle(&sl->mv_cache[0][scan8[i8 * 4]], 2, 2, 8,
|
||||
|
||||
@@ -68,7 +68,7 @@ static av_always_inline int fetch_diagonal_mv(const H264Context *h, H264SliceCon
|
||||
}
|
||||
if (MB_FIELD(sl) && !IS_INTERLACED(sl->left_type[0])) {
|
||||
// left shift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's OK.
|
||||
SET_DIAG_MV(/ 2, << 1, sl->left_mb_xy[i >= 36], ((i >> 2)) & 3);
|
||||
SET_DIAG_MV(/ 2, *2, sl->left_mb_xy[i >= 36], ((i >> 2)) & 3);
|
||||
}
|
||||
}
|
||||
#undef SET_DIAG_MV
|
||||
@@ -248,7 +248,7 @@ static av_always_inline void pred_8x16_motion(const H264Context *const h,
|
||||
if (IS_INTERLACED(type)) { \
|
||||
refn >>= 1; \
|
||||
AV_COPY32(mvbuf[idx], mvn); \
|
||||
mvbuf[idx][1] <<= 1; \
|
||||
mvbuf[idx][1] *= 2; \
|
||||
mvn = mvbuf[idx]; \
|
||||
} \
|
||||
} \
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1282,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 ||
|
||||
|
||||
@@ -3149,6 +3149,8 @@ static av_cold int hevc_init_context(AVCodecContext *avctx)
|
||||
s->context_initialized = 1;
|
||||
s->eos = 0;
|
||||
|
||||
ff_hevc_reset_sei(s);
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
||||
@@ -1092,6 +1092,15 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
|
||||
int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
|
||||
uint8_t *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* Reset SEI values that are stored on the Context.
|
||||
* e.g. Caption data that was extracted during NAL
|
||||
* parsing.
|
||||
*
|
||||
* @param s HEVCContext.
|
||||
*/
|
||||
void ff_hevc_reset_sei(HEVCContext *s);
|
||||
|
||||
extern const uint8_t ff_hevc_qpel_extra_before[4];
|
||||
extern const uint8_t ff_hevc_qpel_extra_after[4];
|
||||
extern const uint8_t ff_hevc_qpel_extra[4];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -209,6 +209,8 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
|
||||
|
||||
h->avctx = avctx;
|
||||
|
||||
ff_hevc_reset_sei(h);
|
||||
|
||||
if (!buf_size)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ static int decode_nal_sei_display_orientation(HEVCContext *s)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_pic_timing(HEVCContext *s)
|
||||
static int decode_pic_timing(HEVCContext *s, int size)
|
||||
{
|
||||
GetBitContext *gb = &s->HEVClc->gb;
|
||||
HEVCSPS *sps;
|
||||
@@ -166,8 +166,12 @@ static int decode_pic_timing(HEVCContext *s)
|
||||
}
|
||||
get_bits(gb, 2); // source_scan_type
|
||||
get_bits(gb, 1); // duplicate_flag
|
||||
skip_bits1(gb);
|
||||
size--;
|
||||
}
|
||||
return 1;
|
||||
skip_bits_long(gb, 8 * size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_registered_user_data_closed_caption(HEVCContext *s, int size)
|
||||
@@ -297,9 +301,8 @@ static int decode_nal_sei_prefix(HEVCContext *s, int type, int size)
|
||||
return decode_nal_sei_display_orientation(s);
|
||||
case SEI_TYPE_PICTURE_TIMING:
|
||||
{
|
||||
int ret = decode_pic_timing(s);
|
||||
int ret = decode_pic_timing(s, size);
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", type);
|
||||
skip_bits(gb, 8 * size);
|
||||
return ret;
|
||||
}
|
||||
case SEI_TYPE_MASTERING_DISPLAY_INFO:
|
||||
@@ -373,3 +376,9 @@ int ff_hevc_decode_nal_sei(HEVCContext *s)
|
||||
} while (more_rbsp_data(&s->HEVClc->gb));
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ff_hevc_reset_sei(HEVCContext *s)
|
||||
{
|
||||
s->a53_caption_size = 0;
|
||||
av_freep(&s->a53_caption);
|
||||
}
|
||||
|
||||
@@ -67,11 +67,11 @@ static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
|
||||
memset(block, 0, 64 * sizeof(*block));
|
||||
|
||||
if (!is_hqa) {
|
||||
block[0] = get_sbits(gb, 9) << 6;
|
||||
block[0] = get_sbits(gb, 9) * 64;
|
||||
q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)];
|
||||
} else {
|
||||
q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)];
|
||||
block[0] = get_sbits(gb, 9) << 6;
|
||||
block[0] = get_sbits(gb, 9) * 64;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
@@ -82,7 +82,7 @@ static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
|
||||
pos += ff_hq_ac_skips[val];
|
||||
if (pos >= 64)
|
||||
break;
|
||||
block[ff_zigzag_direct[pos]] = (ff_hq_ac_syms[val] * q[pos]) >> 12;
|
||||
block[ff_zigzag_direct[pos]] = (int)(ff_hq_ac_syms[val] * (unsigned)q[pos]) >> 12;
|
||||
pos++;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,18 +39,18 @@ static inline void idct_col(int16_t *blk, const uint8_t *quant)
|
||||
s6 = (int) blk[6 * 8] * quant[6 * 8];
|
||||
s7 = (int) blk[7 * 8] * quant[7 * 8];
|
||||
|
||||
t0 = (s3 * 19266 + s5 * 12873) >> 15;
|
||||
t1 = (s5 * 19266 - s3 * 12873) >> 15;
|
||||
t2 = ((s7 * 4520 + s1 * 22725) >> 15) - t0;
|
||||
t3 = ((s1 * 4520 - s7 * 22725) >> 15) - t1;
|
||||
t0 = (int)(s3 * 19266U + s5 * 12873U) >> 15;
|
||||
t1 = (int)(s5 * 19266U - s3 * 12873U) >> 15;
|
||||
t2 = ((int)(s7 * 4520U + s1 * 22725U) >> 15) - t0;
|
||||
t3 = ((int)(s1 * 4520U - s7 * 22725U) >> 15) - t1;
|
||||
t4 = t0 * 2 + t2;
|
||||
t5 = t1 * 2 + t3;
|
||||
t6 = t2 - t3;
|
||||
t7 = t3 * 2 + t6;
|
||||
t8 = (t6 * 11585) >> 14;
|
||||
t9 = (t7 * 11585) >> 14;
|
||||
tA = (s2 * 8867 - s6 * 21407) >> 14;
|
||||
tB = (s6 * 8867 + s2 * 21407) >> 14;
|
||||
t8 = (int)(t6 * 11585U) >> 14;
|
||||
t9 = (int)(t7 * 11585U) >> 14;
|
||||
tA = (int)(s2 * 8867U - s6 * 21407U) >> 14;
|
||||
tB = (int)(s6 * 8867U + s2 * 21407U) >> 14;
|
||||
tC = (s0 >> 1) - (s4 >> 1);
|
||||
tD = (s4 >> 1) * 2 + tC;
|
||||
tE = tC - (tA >> 1);
|
||||
|
||||
@@ -46,11 +46,12 @@ typedef struct SrtStack {
|
||||
|
||||
static void rstrip_spaces_buf(AVBPrint *buf)
|
||||
{
|
||||
while (buf->len > 0 && buf->str[buf->len - 1] == ' ')
|
||||
buf->str[--buf->len] = 0;
|
||||
if (av_bprint_is_complete(buf))
|
||||
while (buf->len > 0 && buf->str[buf->len - 1] == ' ')
|
||||
buf->str[--buf->len] = 0;
|
||||
}
|
||||
|
||||
void ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
|
||||
int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
|
||||
{
|
||||
char *param, buffer[128], tmp[128];
|
||||
int len, tag_close, sptr = 1, line_start = 1, an = 0, end = 0;
|
||||
@@ -146,7 +147,7 @@ void ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
|
||||
if (stack[sptr].param[i][0])
|
||||
av_bprintf(dst, "%s", stack[sptr].param[i]);
|
||||
}
|
||||
} else if (!tagname[1] && strspn(tagname, "bisu") == 1) {
|
||||
} else if (tagname[0] && !tagname[1] && strspn(tagname, "bisu") == 1) {
|
||||
av_bprintf(dst, "{\\%c%d}", tagname[0], !tag_close);
|
||||
} else {
|
||||
unknown = 1;
|
||||
@@ -171,8 +172,13 @@ void ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
|
||||
line_start = 0;
|
||||
}
|
||||
|
||||
if (!av_bprint_is_complete(dst))
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
while (dst->len >= 2 && !strncmp(&dst->str[dst->len - 2], "\\N", 2))
|
||||
dst->len -= 2;
|
||||
dst->str[dst->len] = 0;
|
||||
rstrip_spaces_buf(dst);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
|
||||
#include "libavutil/bprint.h"
|
||||
|
||||
void ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in);
|
||||
int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in);
|
||||
|
||||
#endif /* AVCODEC_HTMLSUBTITLES_H */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -68,6 +68,8 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
|
||||
for (i = 0; i < c * 2; i++)
|
||||
dst[out++] = 0x80;
|
||||
} else { /* copy two values from table */
|
||||
if (c <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
dst[out++] = table[c * 2];
|
||||
dst[out++] = table[(c * 2) + 1];
|
||||
}
|
||||
@@ -76,6 +78,8 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
|
||||
|
||||
for (j = 1; j < height; j++) {
|
||||
out = 0;
|
||||
if (get_bits_left(&ctx->gb) <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
while (out < width) {
|
||||
int c = ir2_get_code(&ctx->gb);
|
||||
if (c >= 0x80) { /* we have a skip */
|
||||
@@ -87,7 +91,10 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
|
||||
out++;
|
||||
}
|
||||
} else { /* add two deltas from table */
|
||||
int t = dst[out - pitch] + (table[c * 2] - 128);
|
||||
int t;
|
||||
if (c <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
t = dst[out - pitch] + (table[c * 2] - 128);
|
||||
t = av_clip_uint8(t);
|
||||
dst[out] = t;
|
||||
out++;
|
||||
@@ -115,12 +122,16 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_
|
||||
|
||||
for (j = 0; j < height; j++) {
|
||||
out = 0;
|
||||
if (get_bits_left(&ctx->gb) <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
while (out < width) {
|
||||
c = ir2_get_code(&ctx->gb);
|
||||
if (c >= 0x80) { /* we have a skip */
|
||||
c -= 0x7F;
|
||||
out += c * 2;
|
||||
} else { /* add two deltas from table */
|
||||
if (c <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
t = dst[out] + (((table[c * 2] - 128)*3) >> 2);
|
||||
t = av_clip_uint8(t);
|
||||
dst[out] = t;
|
||||
@@ -146,6 +157,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;
|
||||
@@ -168,34 +180,42 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
if ((ret = init_get_bits8(&s->gb, buf + start, buf_size - start)) < 0)
|
||||
return ret;
|
||||
|
||||
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 */
|
||||
|
||||
@@ -293,6 +293,8 @@ const uint8_t *avpriv_find_start_code(const uint8_t *p,
|
||||
const uint8_t *end,
|
||||
uint32_t *state);
|
||||
|
||||
int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec);
|
||||
|
||||
/**
|
||||
* Check that the provided frame dimensions are valid and set them on the codec
|
||||
* context.
|
||||
|
||||
@@ -61,6 +61,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
if (avctx->extradata_size < 14)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (avctx->channels <= 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid number of channels: %d\n", avctx->channels);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->level = AV_RL16(avctx->extradata + 12) & 0xf;
|
||||
s->rows = AV_RL16(avctx->extradata + 12) >> 4;
|
||||
s->cols = 1 << s->level;
|
||||
@@ -71,7 +76,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
s->block = av_calloc(s->block_len, sizeof(int));
|
||||
s->wrapbuf = av_calloc(s->wrapbuf_len, sizeof(int));
|
||||
s->ampbuf = av_calloc(0x10000, sizeof(int));
|
||||
s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream));
|
||||
s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE / sizeof(*s->bitstream) + 1, sizeof(*s->bitstream));
|
||||
if (!s->block || !s->wrapbuf || !s->ampbuf || !s->bitstream)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -325,6 +330,10 @@ static int t15(InterplayACMContext *s, unsigned ind, unsigned col)
|
||||
for (i = 0; i < s->rows; i++) {
|
||||
/* b = (x1) + (x2 * 3) + (x3 * 9) */
|
||||
b = get_bits(gb, 5);
|
||||
if (b > 26) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 26\n", b);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
n1 = (mul_3x3[b] & 0x0F) - 1;
|
||||
n2 = ((mul_3x3[b] >> 4) & 0x0F) - 1;
|
||||
@@ -350,6 +359,10 @@ static int t27(InterplayACMContext *s, unsigned ind, unsigned col)
|
||||
for (i = 0; i < s->rows; i++) {
|
||||
/* b = (x1) + (x2 * 5) + (x3 * 25) */
|
||||
b = get_bits(gb, 7);
|
||||
if (b > 124) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 124\n", b);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
n1 = (mul_3x5[b] & 0x0F) - 2;
|
||||
n2 = ((mul_3x5[b] >> 4) & 0x0F) - 2;
|
||||
@@ -374,6 +387,10 @@ static int t37(InterplayACMContext *s, unsigned ind, unsigned col)
|
||||
for (i = 0; i < s->rows; i++) {
|
||||
/* b = (x1) + (x2 * 11) */
|
||||
b = get_bits(gb, 7);
|
||||
if (b > 120) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 120\n", b);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
n1 = (mul_2x11[b] & 0x0F) - 5;
|
||||
n2 = ((mul_2x11[b] >> 4) & 0x0F) - 5;
|
||||
|
||||
@@ -988,6 +988,11 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
AVFrame *frame = data;
|
||||
int ret;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (buf_size < 2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
@@ -999,10 +1004,6 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
if (buf_size < s->decoding_map_size + 2)
|
||||
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 + 2;
|
||||
bytestream2_init(&s->stream_ptr, buf + 2 + s->decoding_map_size,
|
||||
@@ -1012,10 +1013,13 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
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 */
|
||||
@@ -523,7 +524,7 @@ retry:
|
||||
}else{
|
||||
level = SHOW_UBITS(re, &s->gb, 5);
|
||||
SKIP_CACHE(re, &s->gb, 5);
|
||||
level |= SHOW_SBITS(re, &s->gb, 6)<<5;
|
||||
level |= SHOW_SBITS(re, &s->gb, 6) * (1<<5);
|
||||
SKIP_COUNTER(re, &s->gb, 5 + 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
|
||||
#define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8,\
|
||||
d1, d2, d3, d4, d5, d6, d7, d8,\
|
||||
t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
|
||||
t1 = (s1) << 1; t5 = (s5) << 1;\
|
||||
t1 = (s1) * 2; t5 = (s5) * 2;\
|
||||
IVI_HAAR_BFLY(t1, t5, t1, t5, t0); IVI_HAAR_BFLY(t1, s3, t1, t3, t0);\
|
||||
IVI_HAAR_BFLY(t5, s7, t5, t7, t0); IVI_HAAR_BFLY(t1, s2, t1, t2, t0);\
|
||||
IVI_HAAR_BFLY(t3, s4, t3, t4, t0); IVI_HAAR_BFLY(t5, s6, t5, t6, t0);\
|
||||
@@ -284,10 +284,10 @@ void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
|
||||
if (flags[i]) {
|
||||
/* pre-scaling */
|
||||
shift = !(i & 4);
|
||||
sp1 = src[ 0] << shift;
|
||||
sp2 = src[ 8] << shift;
|
||||
sp3 = src[16] << shift;
|
||||
sp4 = src[24] << shift;
|
||||
sp1 = src[ 0] * (1 << shift);
|
||||
sp2 = src[ 8] * (1 << shift);
|
||||
sp3 = src[16] * (1 << shift);
|
||||
sp4 = src[24] * (1 << shift);
|
||||
INV_HAAR8( sp1, sp2, sp3, sp4,
|
||||
src[32], src[40], src[48], src[56],
|
||||
dst[ 0], dst[ 8], dst[16], dst[24],
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user