Compare commits
577 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
063382610f | ||
![]() |
342b6d3718 | ||
![]() |
74b8c4a60b | ||
![]() |
2ea09e56cc | ||
![]() |
c57ebf6809 | ||
![]() |
72d8ce1cf2 | ||
![]() |
19fcdd0c2f | ||
![]() |
542cc06c64 | ||
![]() |
987082ff91 | ||
![]() |
17e7cb98be | ||
![]() |
945899864a | ||
![]() |
e49d142fc0 | ||
![]() |
f3ec2a0859 | ||
![]() |
036d049fb1 | ||
![]() |
6a60de92b2 | ||
![]() |
6ec9611971 | ||
![]() |
cb7809cc4d | ||
![]() |
42fc190ab0 | ||
![]() |
f2019a0db6 | ||
![]() |
e1fb0a1dbc | ||
![]() |
b55b843cd9 | ||
![]() |
b3d36aec75 | ||
![]() |
1eb1c2fd5d | ||
![]() |
ba959ea35c | ||
![]() |
b987e8a38b | ||
![]() |
b653f7999a | ||
![]() |
d33cc39eb8 | ||
![]() |
20196b6abd | ||
![]() |
578e499864 | ||
![]() |
778ee32990 | ||
![]() |
97da8f43a4 | ||
![]() |
b6d9ecfe22 | ||
![]() |
32a453eae2 | ||
![]() |
6d36d0ade9 | ||
![]() |
e0d4decf52 | ||
![]() |
7bf84d1c2b | ||
![]() |
bd641685f4 | ||
![]() |
ff1093efe0 | ||
![]() |
53128080eb | ||
![]() |
a3a5aedc07 | ||
![]() |
d91a03d46c | ||
![]() |
684e189eb3 | ||
![]() |
361af0a47c | ||
![]() |
f71e0b798a | ||
![]() |
e4b4f9e2dc | ||
![]() |
3bb83fd033 | ||
![]() |
a967e55157 | ||
![]() |
50ca8b72d5 | ||
![]() |
517c856d7f | ||
![]() |
302a3269d6 | ||
![]() |
4950c02d44 | ||
![]() |
0d312030d2 | ||
![]() |
ee5ba0a1ad | ||
![]() |
4de7481194 | ||
![]() |
0b70b546a2 | ||
![]() |
1733981ec3 | ||
![]() |
2b7f125af7 | ||
![]() |
8394fa2696 | ||
![]() |
524ee42050 | ||
![]() |
372ea28f68 | ||
![]() |
c48296d3bf | ||
![]() |
aea2f5a6ee | ||
![]() |
78c9e1f00b | ||
![]() |
9acbe5fa84 | ||
![]() |
0f091f808a | ||
![]() |
1d8a6a46a3 | ||
![]() |
e577e712a8 | ||
![]() |
95e52303da | ||
![]() |
20d4c087ed | ||
![]() |
b244e67f9c | ||
![]() |
9dd768dc1e | ||
![]() |
eaba408421 | ||
![]() |
eadf932867 | ||
![]() |
b901d1bbc9 | ||
![]() |
3fd30f53a9 | ||
![]() |
80fc1f3399 | ||
![]() |
82db8bcffa | ||
![]() |
232c2ed4a4 | ||
![]() |
f0b6705e1a | ||
![]() |
1ba90ce49e | ||
![]() |
4bafd67795 | ||
![]() |
8b93f6676b | ||
![]() |
6d5fca34a6 | ||
![]() |
fbfef00e68 | ||
![]() |
9b8d1a183d | ||
![]() |
6d48354321 | ||
![]() |
60956a9dc8 | ||
![]() |
526b5facc5 | ||
![]() |
bb1263185b | ||
![]() |
aa5ae8b213 | ||
![]() |
c0315b74e2 | ||
![]() |
81bac54ab3 | ||
![]() |
482ca8241d | ||
![]() |
f3cf94fa47 | ||
![]() |
85732714ce | ||
![]() |
dbe194002a | ||
![]() |
9c4d8343bb | ||
![]() |
a5fb5a18e3 | ||
![]() |
bb70069e6a | ||
![]() |
b90796ab86 | ||
![]() |
d6ce1cb140 | ||
![]() |
b2cb7db14f | ||
![]() |
462afe5d00 | ||
![]() |
c51800d324 | ||
![]() |
4d2f936803 | ||
![]() |
c4b2985d9a | ||
![]() |
ea5ac146cd | ||
![]() |
350f1f4919 | ||
![]() |
564e63a033 | ||
![]() |
c1b7e9fe52 | ||
![]() |
d0d9fad2ba | ||
![]() |
3f7bbb0ded | ||
![]() |
10395b4738 | ||
![]() |
bc264004e0 | ||
![]() |
8e053f61f5 | ||
![]() |
f821441795 | ||
![]() |
3e8d9eade6 | ||
![]() |
63c50350b6 | ||
![]() |
7294d95689 | ||
![]() |
8681296bb9 | ||
![]() |
0fa22a42d6 | ||
![]() |
929fd61602 | ||
![]() |
09305dca59 | ||
![]() |
cc88d7a640 | ||
![]() |
e12f07b475 | ||
![]() |
5164067861 | ||
![]() |
354fa47018 | ||
![]() |
ad09bebe0c | ||
![]() |
e8fa0e3ec6 | ||
![]() |
2e77ab8f10 | ||
![]() |
00fde782a1 | ||
![]() |
0350f373f7 | ||
![]() |
4d8d2f1991 | ||
![]() |
100dbe1bf0 | ||
![]() |
d8a66a150a | ||
![]() |
93e168705d | ||
![]() |
a0a2bfbfd8 | ||
![]() |
80a24e88e3 | ||
![]() |
67b29888f4 | ||
![]() |
c84ec8d5c9 | ||
![]() |
4916aa2383 | ||
![]() |
40d5f570d8 | ||
![]() |
20a96b9d8c | ||
![]() |
6157938408 | ||
![]() |
1f6aea2cc4 | ||
![]() |
2da8c53386 | ||
![]() |
dd4c2fe74a | ||
![]() |
292842a0ed | ||
![]() |
43bd666fb4 | ||
![]() |
a90967013b | ||
![]() |
7db1014b31 | ||
![]() |
ff663ae464 | ||
![]() |
d8c70ebd2c | ||
![]() |
f7b4e46251 | ||
![]() |
1828abb744 | ||
![]() |
4733060ef3 | ||
![]() |
e1b38b3685 | ||
![]() |
26e98f9ae5 | ||
![]() |
45430c3753 | ||
![]() |
a1b8fa1d9a | ||
![]() |
df660d6854 | ||
![]() |
95b70b6567 | ||
![]() |
48e86b6961 | ||
![]() |
b7d1bbe139 | ||
![]() |
d5009d6b6d | ||
![]() |
4dc7e2dd82 | ||
![]() |
b91980edcf | ||
![]() |
de61d9f8a1 | ||
![]() |
9b93805245 | ||
![]() |
1d852105c2 | ||
![]() |
8aeff8a013 | ||
![]() |
cf4b0fb4d6 | ||
![]() |
48d388b033 | ||
![]() |
949f5dbcfb | ||
![]() |
89612acc81 | ||
![]() |
7c3fc6bf06 | ||
![]() |
b7d98b2fe7 | ||
![]() |
912dfe167f | ||
![]() |
f869846537 | ||
![]() |
8930b2d532 | ||
![]() |
f288389031 | ||
![]() |
cf2d26eacf | ||
![]() |
2d23cd42e3 | ||
![]() |
9bccaf7cf2 | ||
![]() |
3f4a4f174a | ||
![]() |
cb060668f1 | ||
![]() |
7ab1f5b0d4 | ||
![]() |
1c73f9d84c | ||
![]() |
c00d40095b | ||
![]() |
896c8e3891 | ||
![]() |
53869b687c | ||
![]() |
d9bff0843f | ||
![]() |
c3467bbc52 | ||
![]() |
bbeae2c690 | ||
![]() |
9f6e755272 | ||
![]() |
6a82ec8844 | ||
![]() |
a420cb8e45 | ||
![]() |
23c7dbc164 | ||
![]() |
36b65f1c50 | ||
![]() |
0b3b993bae | ||
![]() |
371970e45f | ||
![]() |
cbafd8e1a7 | ||
![]() |
139a96b6eb | ||
![]() |
dd6274d904 | ||
![]() |
4fec2df719 | ||
![]() |
e0569172d6 | ||
![]() |
d52d5553b8 | ||
![]() |
a456a5285d | ||
![]() |
f8951f4c7a | ||
![]() |
2da580a6bb | ||
![]() |
289e74d72d | ||
![]() |
873938b83f | ||
![]() |
53f11a47a3 | ||
![]() |
17bbabc141 | ||
![]() |
e77ad4b069 | ||
![]() |
b096f16095 | ||
![]() |
4ef257f702 | ||
![]() |
a2d38168fd | ||
![]() |
cb1bb8ca45 | ||
![]() |
9a90f61d99 | ||
![]() |
a2e0602157 | ||
![]() |
75d186ab6e | ||
![]() |
719f17541f | ||
![]() |
3e9ccd0019 | ||
![]() |
fb84d92079 | ||
![]() |
ca89c0afdb | ||
![]() |
3311efe2c2 | ||
![]() |
c23902b671 | ||
![]() |
ba1715f52a | ||
![]() |
2d9f536cd9 | ||
![]() |
c3ee01b9da | ||
![]() |
10870af7e4 | ||
![]() |
d405a10743 | ||
![]() |
462c1dacae | ||
![]() |
9c3d814817 | ||
![]() |
74ce026e68 | ||
![]() |
5062059c53 | ||
![]() |
dea4fd9446 | ||
![]() |
8e597b57d0 | ||
![]() |
6c32c9e1ef | ||
![]() |
dd19374ed7 | ||
![]() |
ec328dc461 | ||
![]() |
da7d36ef80 | ||
![]() |
29fde41906 | ||
![]() |
743d6a2782 | ||
![]() |
e43e282512 | ||
![]() |
4afa762511 | ||
![]() |
bd4351b5d7 | ||
![]() |
108a971cd2 | ||
![]() |
3cc3d239f2 | ||
![]() |
488041cfb0 | ||
![]() |
ef6d6f8906 | ||
![]() |
b0b37e018b | ||
![]() |
281dce1a3e | ||
![]() |
d75a5fe4b9 | ||
![]() |
6ed351c096 | ||
![]() |
be9ec446a0 | ||
![]() |
faed1deec9 | ||
![]() |
b17cec5262 | ||
![]() |
088733414a | ||
![]() |
44a9e2dbba | ||
![]() |
2d89356641 | ||
![]() |
3c96f21d6e | ||
![]() |
e812220a30 | ||
![]() |
7f84858dcf | ||
![]() |
32df1cd6ac | ||
![]() |
a0f50ddcb8 | ||
![]() |
dc85a75332 | ||
![]() |
21769e3884 | ||
![]() |
a3d3e0a6bc | ||
![]() |
fdf166c5d2 | ||
![]() |
874b3117ed | ||
![]() |
827a8bfc64 | ||
![]() |
e8ce2770b1 | ||
![]() |
e3a521d817 | ||
![]() |
0de6cf5fdd | ||
![]() |
620b3e680c | ||
![]() |
b7f1d51b9c | ||
![]() |
ed6d8e185a | ||
![]() |
fb47b6cb4b | ||
![]() |
5db095793a | ||
![]() |
7dbfeeeb94 | ||
![]() |
e604662d04 | ||
![]() |
77eddee375 | ||
![]() |
fca28d35e4 | ||
![]() |
9d0f7a8d78 | ||
![]() |
df6f2daccf | ||
![]() |
0cb600b7bf | ||
![]() |
c5c141bc69 | ||
![]() |
6c98d5e7c8 | ||
![]() |
27a88f9d45 | ||
![]() |
77f5302465 | ||
![]() |
6d6ca8b82e | ||
![]() |
1ca226989c | ||
![]() |
a4cb97067b | ||
![]() |
4fad45ad14 | ||
![]() |
1674c5beaf | ||
![]() |
11142fb83b | ||
![]() |
002bbc3687 | ||
![]() |
1ea58c6c6a | ||
![]() |
917544b2ea | ||
![]() |
873b08f411 | ||
![]() |
63ef4014c5 | ||
![]() |
0324008de6 | ||
![]() |
49ad1658b2 | ||
![]() |
3b136179a3 | ||
![]() |
48127e2ad6 | ||
![]() |
860dc1e19b | ||
![]() |
be6a569e3a | ||
![]() |
e920af2cdf | ||
![]() |
12e166dacb | ||
![]() |
80cec4e496 | ||
![]() |
f2e3d5adb3 | ||
![]() |
5019f8d10c | ||
![]() |
476cf3eb7e | ||
![]() |
47e9508485 | ||
![]() |
cd85dd1373 | ||
![]() |
a5e8ca7e73 | ||
![]() |
c049e979b6 | ||
![]() |
7b1c5fa5e5 | ||
![]() |
008229b7f9 | ||
![]() |
3ea15a4547 | ||
![]() |
31dd783631 | ||
![]() |
c10871aca8 | ||
![]() |
b477f97ab9 | ||
![]() |
c7ef69c23c | ||
![]() |
274121179f | ||
![]() |
1c5d25f2c0 | ||
![]() |
35e46e74bc | ||
![]() |
d15f4f5f22 | ||
![]() |
0afa8a6c85 | ||
![]() |
33ec70785f | ||
![]() |
3c7e41df27 | ||
![]() |
6b4c6b7ff5 | ||
![]() |
e21db6e339 | ||
![]() |
e354ec95d6 | ||
![]() |
2b31264e1a | ||
![]() |
c2595b4485 | ||
![]() |
c8377cc49b | ||
![]() |
ed5bfeca04 | ||
![]() |
7050d07562 | ||
![]() |
19cef664fe | ||
![]() |
9d749d69b2 | ||
![]() |
d6d328c294 | ||
![]() |
9591f2fe94 | ||
![]() |
b46ae71f29 | ||
![]() |
c40aa4704f | ||
![]() |
3ea2ffc284 | ||
![]() |
9e3723b848 | ||
![]() |
63716cebb7 | ||
![]() |
665b34df73 | ||
![]() |
4947158b1f | ||
![]() |
308bcf53f9 | ||
![]() |
4db46cf520 | ||
![]() |
cb921dd47f | ||
![]() |
9c3d306ba4 | ||
![]() |
d4d8c3553d | ||
![]() |
bd9313d9f8 | ||
![]() |
6270401561 | ||
![]() |
862ba8b4b4 | ||
![]() |
94a3d2e49c | ||
![]() |
4c2a1e673b | ||
![]() |
3bb17d2692 | ||
![]() |
a5e18e900f | ||
![]() |
8c5d196f50 | ||
![]() |
678a189e5d | ||
![]() |
e2054a8b55 | ||
![]() |
ecd3cce0ec | ||
![]() |
81d923f14b | ||
![]() |
a6bdfd9b46 | ||
![]() |
df408d213a | ||
![]() |
7e5a298bce | ||
![]() |
d9dd0cbe63 | ||
![]() |
1f7343c814 | ||
![]() |
af5917698b | ||
![]() |
b58cbb07bc | ||
![]() |
dd9789ab6d | ||
![]() |
aded27a30b | ||
![]() |
a1f68d9518 | ||
![]() |
2612b69d3f | ||
![]() |
88217c40b6 | ||
![]() |
001cc6d27a | ||
![]() |
ea6bd45885 | ||
![]() |
51850d9a2c | ||
![]() |
211ec9196d | ||
![]() |
e4318f6875 | ||
![]() |
008c1debb9 | ||
![]() |
f33bd39d27 | ||
![]() |
0337770352 | ||
![]() |
ab8f686bbc | ||
![]() |
b5a942685f | ||
![]() |
7e2ea1cb70 | ||
![]() |
10e1108732 | ||
![]() |
3da0395b34 | ||
![]() |
25d50ad814 | ||
![]() |
fb564cd21d | ||
![]() |
10609d8864 | ||
![]() |
dbc48ba1cd | ||
![]() |
19ffa15d2d | ||
![]() |
531ea97b89 | ||
![]() |
0a5b242422 | ||
![]() |
f43fb74ad4 | ||
![]() |
0463e9d6da | ||
![]() |
e8784ec5f5 | ||
![]() |
0a93dc83d2 | ||
![]() |
bced2ad1bd | ||
![]() |
fe22d0d7c6 | ||
![]() |
a5167b4d66 | ||
![]() |
3123cb5d0b | ||
![]() |
375a97bb70 | ||
![]() |
0fc6a95116 | ||
![]() |
f93412406f | ||
![]() |
05eddbbc05 | ||
![]() |
75b21eb8f8 | ||
![]() |
1933fa5daa | ||
![]() |
bd05ac1df8 | ||
![]() |
8d0f079c45 | ||
![]() |
889a4779eb | ||
![]() |
a9d3baff03 | ||
![]() |
f4ce752f22 | ||
![]() |
02532e1162 | ||
![]() |
b1652fbb9e | ||
![]() |
39236d5618 | ||
![]() |
38e628fd6d | ||
![]() |
cf6cbcca7e | ||
![]() |
df9eca44f8 | ||
![]() |
a563a1468f | ||
![]() |
fd17e34217 | ||
![]() |
ec17706e5c | ||
![]() |
e0f85f10c8 | ||
![]() |
9ccaeff67a | ||
![]() |
4a46a29b07 | ||
![]() |
22ef88ee30 | ||
![]() |
48e53620e0 | ||
![]() |
8a7748e1de | ||
![]() |
86a360e349 | ||
![]() |
07ad029d1b | ||
![]() |
b53b6a25e2 | ||
![]() |
83ee63e7f8 | ||
![]() |
536093824d | ||
![]() |
485f53548b | ||
![]() |
2ac7a0d999 | ||
![]() |
b35d67fa51 | ||
![]() |
b942813a41 | ||
![]() |
a75f293264 | ||
![]() |
33862c1f6d | ||
![]() |
89fbae7686 | ||
![]() |
3f9ecaf886 | ||
![]() |
50dc37f281 | ||
![]() |
6c39528a3a | ||
![]() |
9b0c9261cc | ||
![]() |
9fc45b313c | ||
![]() |
d9390b9d64 | ||
![]() |
5a8b43285b | ||
![]() |
8e94e5d339 | ||
![]() |
73cf5d9a28 | ||
![]() |
ac83399281 | ||
![]() |
9bcaf90378 | ||
![]() |
d9249b5582 | ||
![]() |
66b95ee4df | ||
![]() |
0f7e67be3a | ||
![]() |
0856eea770 | ||
![]() |
04f80ed3f8 | ||
![]() |
c6f6be93ac | ||
![]() |
c6418be043 | ||
![]() |
f78d7e6a03 | ||
![]() |
0cb8d786f2 | ||
![]() |
c74846388b | ||
![]() |
35013fa23a | ||
![]() |
33d77bc384 | ||
![]() |
e6a5023d1f | ||
![]() |
99e737a7c7 | ||
![]() |
835037506b | ||
![]() |
2f290cf881 | ||
![]() |
2523bdcd67 | ||
![]() |
9b87d15ca8 | ||
![]() |
a13a288ec8 | ||
![]() |
9f2c8734b9 | ||
![]() |
d35086d715 | ||
![]() |
be1b665dec | ||
![]() |
47f5f6b230 | ||
![]() |
01291b4e2f | ||
![]() |
787e094ed0 | ||
![]() |
2f8f4351b8 | ||
![]() |
f77cb3d4a6 | ||
![]() |
3258e12d8c | ||
![]() |
84cd276d0e | ||
![]() |
a298e13c2c | ||
![]() |
50fb69c737 | ||
![]() |
9c826d8d51 | ||
![]() |
4aa4c78dae | ||
![]() |
7b13aef5d2 | ||
![]() |
aebafed24f | ||
![]() |
4ea7ff4354 | ||
![]() |
262c678357 | ||
![]() |
763ab41f77 | ||
![]() |
76ee9fdb61 | ||
![]() |
692fd5635f | ||
![]() |
c3b1261afa | ||
![]() |
04fd0250e1 | ||
![]() |
6f236d3774 | ||
![]() |
c1c245e1a3 | ||
![]() |
369f46aae3 | ||
![]() |
05b448082a | ||
![]() |
b4bfbbfb95 | ||
![]() |
e6d9094fd3 | ||
![]() |
bcc4c360aa | ||
![]() |
8be177e048 | ||
![]() |
7d5908d5c8 | ||
![]() |
3550d239a6 | ||
![]() |
d3f96c1e3c | ||
![]() |
ac07ab7db7 | ||
![]() |
9bff35abde | ||
![]() |
9ee7fcdcd0 | ||
![]() |
f1b4a71ddf | ||
![]() |
fa538f1a8c | ||
![]() |
7689fe5cfd | ||
![]() |
f597b9f04e | ||
![]() |
037d6cf580 | ||
![]() |
8bd7bf1a3c | ||
![]() |
f90c9bbbca | ||
![]() |
f2abcdedfe | ||
![]() |
eebd161e76 | ||
![]() |
6a4d1325e2 | ||
![]() |
dfce316c12 | ||
![]() |
87e2a689a8 | ||
![]() |
e9eb9839bd | ||
![]() |
c3be71001c | ||
![]() |
f3deed98ec | ||
![]() |
7439ed2f39 | ||
![]() |
40607290c9 | ||
![]() |
a9e683bb7a | ||
![]() |
0edf9c6907 | ||
![]() |
b2c9cd36d3 | ||
![]() |
b3e6d3ee78 | ||
![]() |
f6327e5fa6 | ||
![]() |
b80c486fb3 | ||
![]() |
37469af294 | ||
![]() |
350054e8e2 | ||
![]() |
7ff46a20d5 | ||
![]() |
7edd380668 | ||
![]() |
26bed98d64 | ||
![]() |
480e18e6ff | ||
![]() |
742bc7eea8 | ||
![]() |
c58edf52f9 | ||
![]() |
ea52c0614c | ||
![]() |
5e84ab838c | ||
![]() |
3f7b89937d | ||
![]() |
39c9b47bb6 | ||
![]() |
016bf7cb81 | ||
![]() |
bb00821f62 | ||
![]() |
d9dbd2362d | ||
![]() |
ec684aa58a | ||
![]() |
a613dd627c | ||
![]() |
1903d6d2b0 | ||
![]() |
2319fddfd3 | ||
![]() |
5a6ef7d7cb | ||
![]() |
47e8d17132 | ||
![]() |
a156f86e91 | ||
![]() |
3586314147 | ||
![]() |
28e17ba220 | ||
![]() |
998173ed94 | ||
![]() |
bffed1d9d0 | ||
![]() |
52bf144ad9 | ||
![]() |
6fc8c72c7d | ||
![]() |
77621ca311 | ||
![]() |
1a89aab3c0 | ||
![]() |
c43e5faf03 | ||
![]() |
876d2d8db8 | ||
![]() |
1caad74533 | ||
![]() |
28950d1f8c | ||
![]() |
791e085634 | ||
![]() |
3dc88e1fd6 | ||
![]() |
4e2cab5a79 | ||
![]() |
1dab67b647 | ||
![]() |
0d4549c2d6 | ||
![]() |
c741eb7d88 |
508
Changelog
508
Changelog
@@ -1,6 +1,511 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 2.6.9:
|
||||
- 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
|
||||
- avcodec/ttaenc: Reallocate packet if its too small
|
||||
- pgssubdec: fix subpicture output colorspace and range
|
||||
- avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
|
||||
- avfilter/vf_drawtext: Check return code of load_glyph()
|
||||
- avcodec/takdec: add code that got somehow lost in process of REing
|
||||
- avcodec/apedec: fix decoding of stereo files with one channel full of silence
|
||||
- avcodec/avpacket: Fix off by 5 error
|
||||
- avcodec/h264: Fix for H.264 configuration parsing
|
||||
- avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
|
||||
- avfilter/src_movie: fix how we check for overflows with seek_point
|
||||
- avcodec/j2kenc: Add attribution to OpenJPEG project:
|
||||
- avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
|
||||
- avformat/rtpdec_jpeg: fix low contrast image on low quality setting
|
||||
- avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
|
||||
- avcodec/resample: Remove disabled and faulty code
|
||||
- indeo2: Fix banding artefacts
|
||||
- indeo2data: K&R formatting cosmetics
|
||||
- avcodec/imgconvert: Support non-planar colorspaces while padding
|
||||
- avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
|
||||
- avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
|
||||
- avformat/concatdec: set safe mode to enabled instead of auto
|
||||
- avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
|
||||
- avformat/cache: Fix memleak of tree entries
|
||||
- lavf/mov: fix sidx with edit lists (cherry picked from commit 3617e69d50dd9dd07b5011dfb9477a9d1a630354)
|
||||
- avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
|
||||
- avcodec/avpacket: clear priv in av_init_packet()
|
||||
- swscale/utils: Fix chrSrcHSubSample for GBRAP16
|
||||
- swscale/input: Fix GBRAP16 input
|
||||
- postproc: fix unaligned access
|
||||
- avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
|
||||
- swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
|
||||
- swscale/x86/output: Move code into yuv2planeX_mainloop
|
||||
- doc/utils: fix typo for min() description
|
||||
|
||||
|
||||
version 2.6.8:
|
||||
- MAINTAINERS: remove unmaintained releases
|
||||
- avcodec/jpeg2000dec: More completely check cdef
|
||||
- avutil/opt: check for and handle errors in av_opt_set_dict2()
|
||||
- avcodec/flacenc: fix calculation of bits required in case of custom sample rate
|
||||
- avformat: Document urls a bit
|
||||
- avformat/libquvi: Set default demuxer and protocol limitations
|
||||
- avformat/concat: Check protocol prefix
|
||||
- doc/demuxers: Document enable_drefs and use_absolute_path
|
||||
- avcodec/mjpegdec: Check for end for both bytes in unescaping
|
||||
- avcodec/mpegvideo_enc: Check for integer overflow in ff_mpv_reallocate_putbitbuffer()
|
||||
- avformat/avformat: Replace some references to filenames by urls
|
||||
- avcodec/wmaenc: Check ff_wma_init() for failure
|
||||
- avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
|
||||
- avformat/avio: Limit url option parsing to the documented cases
|
||||
- avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
|
||||
- mov: Add an option to toggle dref opening
|
||||
- avcodec/gif: Fix lzw buffer size
|
||||
- avcodec/put_bits: Assert buf_ptr in flush_put_bits()
|
||||
- avcodec/tiff: Check subsample & rps values more completely
|
||||
- swscale/swscale: Add some sanity checks for srcSlice* parameters
|
||||
- swscale/x86/rgb2rgb_template: Fix planar2x() for short width
|
||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
|
||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
|
||||
- avcodec/aacenc: Check both channels for finiteness
|
||||
- swscale/swscale-test: Fix slice height in random reference data creation.
|
||||
- dca: fix misaligned access in avpriv_dca_convert_bitstream
|
||||
- brstm: fix missing closing brace
|
||||
- brstm: also allocate b->table in read_packet
|
||||
- brstm: make sure an ADPC chunk was read for adpcm_thp
|
||||
- vorbisdec: reject rangebits 0 with non-0 partitions
|
||||
- vorbisdec: reject channel mapping with less than two channels
|
||||
- ffmdec: reset packet_end in case of failure
|
||||
- avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
|
||||
|
||||
version 2.6.7:
|
||||
- configure: bump copyright year to 2016
|
||||
- avformat/hls: Even stricter URL checks
|
||||
- avformat/hls: More strict url checks
|
||||
- swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
|
||||
- swscale/yuv2rgb: Increase YUV2RGB table headroom
|
||||
- swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
|
||||
- avformat/hls: forbid all protocols except http(s) & file
|
||||
- avformat/aviobuf: Fix end check in put_str16()
|
||||
- avformat/asfenc: Check pts
|
||||
- avcodec/mpeg4video: Check time_incr
|
||||
- avcodec/wavpackenc: Check the number of channels
|
||||
- avcodec/wavpackenc: Headers are per channel
|
||||
- avcodec/dvdec: Fix "left shift of negative value -254"
|
||||
- avcodec/mjpegdec: Fix negative shift
|
||||
- avcodec/mss2: Check for repeat overflow
|
||||
- avformat: Add integer fps from 31 to 60 to get_std_framerate()
|
||||
- avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
|
||||
- avfilter/vf_scale: set proper out frame color range
|
||||
- avcodec/motion_est: Fix mv_penalty table size
|
||||
- avcodec/h264_slice: Fix integer overflow in implicit weight computation
|
||||
- swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
|
||||
- avcodec/put_bits: Always check buffer end before writing
|
||||
- mjpegdec: extend check for incompatible values of s->rgb and s->ls
|
||||
- swscale/utils: Fix intermediate format for cascaded alpha downscaling
|
||||
- x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
|
||||
|
||||
|
||||
version 2.6.6:
|
||||
- nuv: sanitize negative fps rate
|
||||
- rawdec: only exempt BIT0 with need_copy from buffer sanity check
|
||||
- mlvdec: check that index_entries exist
|
||||
- nutdec: reject negative value_len in read_sm_data
|
||||
- xwddec: prevent overflow of lsize * avctx->height
|
||||
- nutdec: only copy the header if it exists
|
||||
- exr: fix out of bounds read in get_code
|
||||
- on2avc: limit number of bits to 30 in get_egolomb
|
||||
- avcodec/mpeg4videodec: also for empty partitioned slices
|
||||
- avcodec/h264_refs: Fix long_idx check
|
||||
- avfilter/vf_mpdecimate: Add missing emms_c()
|
||||
- avformat/mxfenc: Do not crash if there is no packet in the first stream
|
||||
- avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
|
||||
- avformat/matroskaenc: Check codecdelay before use
|
||||
- avutil/mathematics: Fix division by 0
|
||||
- avcodec/hevc: Check max ctb addresses for WPP
|
||||
- avcodec/vp3: ensure header is parsed successfully before tables
|
||||
- avcodec/jpeg2000dec: Check bpno in decode_cblk()
|
||||
- avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
|
||||
- swscale/utils: Fix for runtime error: left shift of negative value -1
|
||||
- avcodec/hevc: Fix integer overflow of entry_point_offset
|
||||
- avcodec/dirac_parser: Add basic validity checks for next_pu_offset and prev_pu_offset
|
||||
- avcodec/dirac_parser: Fix potential overflows in pointer checks
|
||||
- avcodec/wmaprodec: Check bits per sample to be within the range not causing integer overflows
|
||||
- avcodec/wmaprodec: Fix overflow of cutoff
|
||||
- avformat/smacker: fix integer overflow with pts_inc
|
||||
- avcodec/vp3: Fix "runtime error: left shift of negative value"
|
||||
- mpegencts: Fix overflow in cbr mode period calculations
|
||||
- avutil/timecode: Fix fps check
|
||||
- avutil/mathematics: return INT64_MIN (=AV_NOPTS_VALUE) from av_rescale_rnd() for overflows
|
||||
- avcodec/apedec: Check length in long_filter_high_3800()
|
||||
- avcodec/vp3: always set pix_fmt in theora_decode_header()
|
||||
- avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rnd
|
||||
- avutil/integer: Fix av_mod_i() with negative dividend
|
||||
- avformat/dump: Fix integer overflow in av_dump_format()
|
||||
- avcodec/utils: Clear dimensions in ff_get_buffer() on failure
|
||||
- avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
|
||||
- avcodec/vp3: Clear context on reinitialization failure
|
||||
- avcodec/hevc: allocate entries unconditionally
|
||||
- avcodec/hevc_cabac: Fix multiple integer overflows
|
||||
- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
|
||||
- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
|
||||
- avcodec/hevc: Check entry_point_offsets
|
||||
- avcodec/cabac: Check initial cabac decoder state
|
||||
- avcodec/cabac_functions: Fix "left shift of negative value -31767"
|
||||
- avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
|
||||
- avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
|
||||
- avcodec/mpeg4videodec: Check available data before reading custom matrix
|
||||
- mjpegdec: consider chroma subsampling in size check
|
||||
- avcodec/dirac_parser: Check that there is a previous PU before accessing it
|
||||
- sonic: make sure num_taps * channels is not larger than frame_size
|
||||
- opus_silk: fix typo causing overflow in silk_stabilize_lsf
|
||||
- ffm: reject invalid codec_id and codec_type
|
||||
- golomb: always check for invalid UE golomb codes in get_ue_golomb
|
||||
- aaccoder: prevent crash of anmr coder
|
||||
- ffmdec: reject zero-sized chunks
|
||||
- swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
|
||||
- swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
|
||||
- avcodec/ffv1dec: Clear quant_table_count if its invalid
|
||||
- avcodec/ffv1dec: Print an error if the quant table count is invalid
|
||||
- doc/filters/drawtext: fix centering example
|
||||
- mxfdec: check edit_rate also for physical_track
|
||||
- mpegvideo: clear overread in clear_context
|
||||
- dvdsubdec: validate offset2 similar to offset1
|
||||
- aacdec: don't return frames without data from aac_decode_er_frame
|
||||
- avcodec/takdec: Use memove, avoid undefined memcpy() use
|
||||
- riffdec: prevent negative bit rate
|
||||
- Merge commit 'd80811c94e068085aab797f9ba35790529126f85'
|
||||
- s302m: fix arithmetic exception
|
||||
- avcodec/s302m: Only set the sample rate when some data is output
|
||||
- vp9: add support for resolution changes in inter frames.
|
||||
|
||||
|
||||
version 2.6.5:
|
||||
- rtmpcrypt: Do the xtea decryption in little endian mode
|
||||
- avformat/matroskadec: Check subtitle stream before dereferencing
|
||||
- avformat/utils: Do not init parser if probing is unfinished
|
||||
- avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
|
||||
- avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
|
||||
- avcodec/jpeg2000: Check comp coords to be within the supported size
|
||||
- avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
|
||||
- avcodec/wmaprodec: Check for overread in decode_packet()
|
||||
- avcodec/smacker: Check that the data size is a multiple of a sample vector
|
||||
- avcodec/takdec: Skip last p2 sample (which is unused)
|
||||
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()
|
||||
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
|
||||
- avcodec/error_resilience: avoid accessing previous or next frames tables beyond height
|
||||
- avcodec/dpx: Move need_align to act per line
|
||||
- avcodec/flashsv: Check size before updating it
|
||||
- avcodec/ivi: Check image dimensions
|
||||
- avcodec/utils: Better check for channels in av_get_audio_frame_duration()
|
||||
- avcodec/jpeg2000dec: Check for duplicate SIZ marker
|
||||
- doc/ffmpeg: Clarify that the sdp_file option requires an rtp output.
|
||||
- ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format.
|
||||
- jvdec: avoid unsigned overflow in comparison
|
||||
- avcodec/jpeg2000dec: Clip all tile coordinates
|
||||
- avcodec/hevc_ps: Check chroma_format_idc
|
||||
- avcodec/microdvddec: Check for string end in 'P' case
|
||||
- avcodec/dirac_parser: Fix undefined memcpy() use
|
||||
- avformat/xmv: Discard remainder of packet on error
|
||||
- avformat/xmv: factor return check out of if/else
|
||||
- avcodec/mpeg12dec: Do not call show_bits() with invalid bits
|
||||
- libavutil/channel_layout: Check strtol*() for failure
|
||||
- avcodec/ffv1dec: Check for 0 quant tables
|
||||
- avcodec/mjpegdec: Reinitialize IDCT on BPP changes
|
||||
- avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
|
||||
- avutil/file_open: avoid file handle inheritance on Windows
|
||||
- opusdec: Don't run vector_fmul_scalar on zero length arrays
|
||||
- avcodec/ffv1: Initialize vlc_state on allocation
|
||||
- avcodec/ffv1dec: update progress in case of broken pointer chains
|
||||
- avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
|
||||
- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
|
||||
- avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
|
||||
- avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
|
||||
- avcodec/ffv1dec: Explicitly check read_quant_table() return value
|
||||
- avcodec/rangecoder: Check e
|
||||
- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
|
||||
- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
|
||||
- avfilter/af_asyncts: use llabs for int64_t
|
||||
- avcodec/g2meet: Also clear tile dimensions on header_fail
|
||||
- avcodec/g2meet: Fix potential overflow in tile dimensions check
|
||||
- avcodec/svq1dec: Check init_get_bits8() for failure
|
||||
- avcodec/tta: Check init_get_bits8() for failure
|
||||
- avcodec/vp3: Check init_get_bits8() for failure
|
||||
- swresample/swresample: Fix integer overflow in seed calculation
|
||||
- avformat/mov: Fix integer overflow in FFABS
|
||||
- avutil/common: Add FFNABS()
|
||||
- avutil/common: Document FFABS() corner case
|
||||
- avformat/dump: Fix integer overflow in aspect ratio calculation
|
||||
- avcodec/truemotion1: Check for even width
|
||||
- avcodec/mpeg12dec: Set dimensions in mpeg1_decode_sequence() only in absence of errors
|
||||
- avcodec/libopusenc: Fix infinite loop on flushing after 0 input
|
||||
- avformat/hevc: Check num_long_term_ref_pics_sps to avoid potentially long loops
|
||||
- avformat/hevc: Fix parsing errors
|
||||
- ffmpeg: Use correct codec_id for av_parser_change() check
|
||||
- ffmpeg: Check av_parser_change() for failure
|
||||
- ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
|
||||
- ffmpeg: check avpicture_fill() return value
|
||||
- avformat/mux: Update sidedata in ff_write_chained()
|
||||
- avcodec/flashsvenc: Correct max dimension in error message
|
||||
- avcodec/svq1enc: Check dimensions
|
||||
- avcodec/dcaenc: clear bitstream end
|
||||
- libavcodec/aacdec_template: Use init_get_bits8() in aac_decode_frame()
|
||||
- rawdec: fix mjpeg probing buffer size check
|
||||
- rawdec: fix mjpeg probing
|
||||
- videodsp: don't overread edges in vfix3 emu_edge.
|
||||
- lavf/matroskadec: Fully parse and repack MP3 packets
|
||||
- avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
|
||||
- avformat/oggenc: Check segments_count for headers too
|
||||
- avformat/avidec: Workaround broken initial frame
|
||||
- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
|
||||
- hevc: fix wpp threading deadlock.
|
||||
- avcodec/ffv1: separate slice_count from max_slice_count
|
||||
- lavf/img2dec: Fix memory leak
|
||||
- avcodec/mp3: fix skipping zeros
|
||||
- avformat/srtdec: make sure we probe a number
|
||||
- avformat/srtdec: more lenient first line probing
|
||||
- doc: mention libavcodec can decode Opus natively
|
||||
- MAINTAINERS: Remove myself as leader
|
||||
|
||||
|
||||
version 2.6.4:
|
||||
- imc: use correct position for flcoeffs2 calculation
|
||||
- hevc: check slice address length
|
||||
- snow: remove an obsolete av_assert2
|
||||
- webp: fix infinite loop in webp_decode_frame
|
||||
- wavpack: limit extra_bits to 32 and use get_bits_long
|
||||
- ffmpeg: only count got_output/errors in decode_error_stat
|
||||
- ffmpeg: exit_on_error if decoding a packet failed
|
||||
- pthread_frame: forward error codes when flushing
|
||||
- huffyuvdec: validate image size
|
||||
- wavpack: use get_bits_long to read up to 32 bits
|
||||
- nutdec: check maxpos in read_sm_data before returning success
|
||||
- vc1dec: use get_bits_long and limit the read bits to 32
|
||||
- mpegaudiodec: copy AVFloatDSPContext from first context to all contexts
|
||||
- avcodec/vp8: Check buffer size in vp8_decode_frame_header()
|
||||
- avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()
|
||||
- avcodec/diracdec: Check for hpel_base allocation failure
|
||||
- avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()
|
||||
- avfilter/af_aresample: Check ff_all_* for allocation failures
|
||||
- avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case
|
||||
- swscale/utils: Clear pix buffers
|
||||
- avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()
|
||||
- ffmpeg: Fix cleanup after failed allocation of output_files
|
||||
- avformat/mov: Fix deallocation when MOVStreamContext failed to allocate
|
||||
- ffmpeg: Fix crash with ost->last_frame allocation failure
|
||||
- ffmpeg: Fix cleanup with ost = NULL
|
||||
- avcodec/pthread_frame: check avctx on deallocation
|
||||
- avcodec/sanm: Reset sizes in destroy_buffers()
|
||||
- avcodec/alac: Clear pointers in allocate_buffers()
|
||||
- bytestream2: set the reader to the end when reading more than available
|
||||
- avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
|
||||
- avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()
|
||||
- oggparsedirac: check return value of init_get_bits
|
||||
- wmalosslessdec: reset frame->nb_samples on packet loss
|
||||
- wmalosslessdec: avoid reading 0 bits with get_bits
|
||||
- avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
|
||||
- avcodec/aacsbr: Assert that bs_num_env is positive
|
||||
- avcodec/aacsbr: check that the element type matches before applying SBR
|
||||
- avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
|
||||
- vp9/update_prob: prevent out of bounds table read
|
||||
- avfilter/vf_transpose: Fix rounding error
|
||||
- avcodec/pngdec: Check values before updating context in decode_fctl_chunk()
|
||||
- avcodec/pngdec: Require a IHDR chunk before fctl
|
||||
- avcodec/pngdec: Only allow one IHDR chunk
|
||||
- wmavoice: limit wmavoice_decode_packet return value to packet size
|
||||
- swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian
|
||||
- ffmpeg: Do not use the data/size of a bitstream filter after failure
|
||||
- swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}
|
||||
- swscale/x86/rgb2rgb_template: add missing xmm clobbers
|
||||
- vda: unlock the pixel buffer base address.
|
||||
- swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
|
||||
- swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE
|
||||
- swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
|
||||
- swr: Remember previously set int_sample_format from user
|
||||
- matroskadec: check audio sample rate
|
||||
- matroskadec: validate audio channels and bitdepth
|
||||
- avcodec/dpxenc: implement write16/32 as functions
|
||||
- postproc: fix unaligned access
|
||||
- ffmpeg: Free last_frame instead of just unref
|
||||
- avio: fix potential crashes when combining ffio_ensure_seekback + crc
|
||||
- examples/demuxing_decoding: use properties from frame instead of video_dec_ctx
|
||||
- h264: er: Copy from the previous reference only if compatible
|
||||
- sonic: set avctx->channels in sonic_decode_init
|
||||
- vp8: change mv_{min,max}.{x,y} type to int
|
||||
- vp9: change type of tile_size from unsigned to int64_t
|
||||
- arm: only enable setend on ARMv6
|
||||
- libopenjpegdec: check existence of image component data
|
||||
- mov: abort on EOF in ff_mov_read_chan
|
||||
- ffmpeg_opt: Check for localtime() failure
|
||||
- avformat: Fix bug in parse_rps for HEVC.
|
||||
- takdec: ensure chan2 is a valid channel index
|
||||
- avcodec/h264_slice: Use AVFrame diemensions for grayscale handling
|
||||
- avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()
|
||||
- libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing 'c'.
|
||||
- avcodec/jpeg2000dec: Check that coords match before applying ICT
|
||||
- avformat/ffmdec: Check ffio_set_buf_size() return value
|
||||
- avcodec/adpcm: Check for overreads
|
||||
- avcodec/alsdec: Check for overread
|
||||
- avcodec/atrac3plusdec: consume only as many bytes as available
|
||||
- libavutil/softfloat: Fix av_normalize1_sf bias.
|
||||
- swresample/swresample: Cleanup on init failure.
|
||||
- Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference"
|
||||
- avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec
|
||||
- swresample/dither: check memory allocation
|
||||
- libopenjpegenc: add NULL check for img before accessing it
|
||||
- swresample: Check the return value of resampler->init()
|
||||
- h264: Make sure reinit failures mark the context as not initialized
|
||||
- avfilter/x86/vf_fspp: Fix invalid combination of opcode and operands
|
||||
- ffmpeg_opt: Set the video VBV parameters only for the video stream from -target
|
||||
- avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
|
||||
- avcodec/put_bits: Assert that there is enough space left in skip_put_bytes()
|
||||
- avcodec/mpegvideo_enc: Update the buffer size as more slices are merged
|
||||
- avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size()
|
||||
- avformat/wavdec: Increase dts packet threshold to fix more misdetections
|
||||
- avformat/wavdec: Increase probe_packets limit
|
||||
- nutdec: abort if EOF is reached in decode_info_header/read_sm_data
|
||||
- nutdec: stop skipping bytes at EOF
|
||||
- nutdec: fix infinite resync loops
|
||||
- avformat/nutdec: Check X in 2nd branch of index reading
|
||||
- avformat/nutdec: Fix recovery when immedeately after seeking a failure happens
|
||||
- avformat/nutdec: Return error on EOF from get_str()
|
||||
- rtsp: Make sure we don't write too many transport entries into a fixed-size array
|
||||
- rtpenc_jpeg: handle case of picture dimensions not dividing by 8
|
||||
- avcodec/golomb: get_ur_golomb_jpegls: Fix reading huge k values
|
||||
- avformat/swfdec: Do not error out on pixel format changes
|
||||
- avformat/mov: Mark avio context of decompressed atoms as seekable
|
||||
- avcodec/mjpegenc_common: Use ff_mpv_reallocate_putbitbuffer()
|
||||
- avcodec/mpegvideo: Factor ff_mpv_reallocate_putbitbuffer() out
|
||||
- avfilter/x86/vf_hqdn3d: Fix register types
|
||||
- avcodec/exr: fix crash caused by merge
|
||||
- avcodec/x86/h264_weight: handle weight1=128
|
||||
- avcodec/dvbsubdec: Fix buf_size check in dvbsub_parse_display_definition_segment()
|
||||
- avcodec/hevc_ps: Only discard overread VPS if a previous is available
|
||||
- avcodec/flacenc: Fix Invalid Rice order
|
||||
- lavd/xcbgrab: fix comparison with screen size.
|
||||
|
||||
version 2.6.3:
|
||||
- avcodec/libtheoraenc: Check for av_malloc failure
|
||||
- ffmpeg_opt: Fix -timestamp parsing
|
||||
- hevc: make avcodec_decode_video2() fail if get_format() fails
|
||||
- avcodec/cavsdec: Use ff_set_dimensions()
|
||||
- swr: fix alignment issue caused by 8ch sse functions
|
||||
- avcodec/mjpegdec: fix len computation in ff_mjpeg_decode_dqt()
|
||||
- avcodec/jpeg2000dec: fix boolean operator
|
||||
- avcodec/hevc_ps: Explicitly check num_tile_* for negative values
|
||||
- avformat/matroskadec: Cleanup error handling for bz2 & zlib
|
||||
- avformat/nutdec: Fix use of uinitialized value
|
||||
- tools/graph2dot: use larger data types than int for array/string sizes
|
||||
- avformat/matroskaenc: Check ff_vorbiscomment_length in put_flac_codecpriv()
|
||||
- avcodec/mpeg12dec: use the correct dimensions for checking SAR
|
||||
- xcbgrab: Validate the capture area
|
||||
- xcbgrab: Do not assume the non shm image data is always available
|
||||
- avfilter/lavfutils: disable frame threads when decoding a single image
|
||||
- avformat/mov: Do not read ACLR into extradata for H.264
|
||||
- ffmpeg: remove incorrect network deinit
|
||||
- OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c
|
||||
- libvpxenc: only set noise reduction w/vp8
|
||||
- vp9: remove another optimization branch in iadst16 which causes overflows.
|
||||
- lavf: Reset global flag on deinit
|
||||
- network: Do not leave context locked on error
|
||||
- vp9: remove one optimization branch in iadst16 which causes overflows.
|
||||
- fate: Include branch information in the payload header
|
||||
- avformat/utils: Ensure that AVFMT_FLAG_CUSTOM_IO is set before use
|
||||
- avformat/img2dec: do not rewind custom io buffers
|
||||
- avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays never contain random data
|
||||
- avcodec/atrac3plusdsp: fix on stack alignment
|
||||
- swresample/swresample-test: Randomly wipe out channel counts
|
||||
- swresample: Check channel layouts and channels against each other and print human readable error messages
|
||||
- swresample: Allow reinitialization without ever setting channel layouts (cherry picked from commit 80a28c7509a11114e1aea5b208d56c6646d69c07)
|
||||
- swresample: Allow reinitialization without ever setting channel counts
|
||||
- dashenc: replace attribute id with contentType for the AdaptationSet element
|
||||
- avformat/matroskaenc: Use avoid_negative_ts_use_pts if no stream writes dts
|
||||
- avformat/mux: Add avoid_negative_ts_use_pts
|
||||
- tests/fate-run: do not attempt to parse tiny_psnrs output if it failed
|
||||
- cafdec: free extradata before allocating it
|
||||
- imgutils: initialize palette padding bytes in av_image_alloc
|
||||
- aacdec: don't return frames without data
|
||||
- id3v2: catch avio_read errors in check_tag
|
||||
- avi: Validate sample_size
|
||||
- aacsbr: break infinite loop in sbr_hf_calc_npatches
|
||||
- diracdec: avoid overflow of bytes*8 in decode_lowdelay
|
||||
- diracdec: prevent overflow in data_unit_size check
|
||||
- avformat/matroskadec: Use tracks[k]->stream instead of s->streams[k]
|
||||
- matroskadec: use uint64_t instead of int for index_scale
|
||||
- pngdec: don't use AV_PIX_FMT_MONOBLACK for apng
|
||||
- pngdec: return correct error code from decode_frame_common
|
||||
- nutdec: fix illegal count check in decode_main_header
|
||||
- nutdec: fix memleaks on error in nut_read_header
|
||||
- apedec: prevent out of array writes in decode_array_0000
|
||||
- apedec: set s->samples only when init_frame_decoder succeeded
|
||||
- swscale/ppc/swscale_altivec.c: POWER LE support in yuv2planeX_8() delete macro GET_VF() it was wrong
|
||||
- alac: reject rice_limit 0 if compression is used
|
||||
- alsdec: only adapt order for positive max_order
|
||||
- bink: check vst->index_entries before using it
|
||||
- mpeg4videodec: only allow a positive length
|
||||
- aacpsy: correct calculation of minath in psy_3gpp_init
|
||||
- alsdec: validate time diff index
|
||||
- alsdec: ensure channel reordering is reversible
|
||||
- ac3: validate end in ff_ac3_bit_alloc_calc_mask
|
||||
- aacpsy: avoid psy_band->threshold becoming NaN
|
||||
- aasc: return correct buffer size from aasc_decode_frame
|
||||
- matroskadec: export cover art correctly
|
||||
- mxfenc: don't try to write footer without header
|
||||
- mxfenc: fix memleaks in mxf_write_footer
|
||||
- rtpenc_mpegts: Set chain->rtp_ctx only after avformat_write_header succeeded
|
||||
- rtpenc_mpegts: Free the right ->pb in the error path in the init function
|
||||
|
||||
version 2.6.2:
|
||||
- avcodec/h264: Do not fail with randomly truncated VUIs
|
||||
- avcodec/h264_ps: Move truncation check from VUI to SPS
|
||||
- avcodec/h264: Be more tolerant to changing pps id between slices
|
||||
- avcodec/aacdec: Fix storing state before PCE decode
|
||||
- avcodec/h264: reset the counts in the correct context
|
||||
- avcodec/h264_slice: Do not reset mb_aff_frame per slice
|
||||
- avcodec/h264: finish previous slices before switching to single thread mode
|
||||
- avcodec/h264: Fix race between slices where one overwrites data from the next
|
||||
- avformat/utils: avoid discarded streams in av_find_default_stream_index()
|
||||
- ffmpeg: Fix extradata allocation
|
||||
- avcodec/h264_refs: Do not set reference to things which do not exist
|
||||
- avcodec/h264: Fail for invalid mixed IDR / non IDR frames in slice threading mode
|
||||
- Revert "avcodec/exr: fix memset first arg in reverse_lut()"
|
||||
- h264: avoid unnecessary calls to get_format
|
||||
- avutil/pca: Check for av_malloc* failures
|
||||
- avutil/cpu: add missing check for mmxext to av_force_cpu_flags
|
||||
- lavc/dnxhd: Fix pix_fmt change.
|
||||
- avformat/http: replace cookies with updated values instead of appending forever
|
||||
- avformat/hls: store cookies returned in HLS key response
|
||||
- avformat/rmdec: fix support for 0 sized mdpr
|
||||
- avcodec/msrledec: restructure msrle_decode_pal4() based on the line number instead of the pixel pointer
|
||||
- avcodec/hevc_ps: Check cropping parameters more correctly
|
||||
- hevc: make the crop sizes unsigned
|
||||
- avcodec/dnxhddec: Reset is_444 if format is not 444
|
||||
- avcodec/dnxhddec: Check that the frame is interlaced before using cur_field
|
||||
- mips/float_dsp: fix vector_fmul_window_mips on mips64
|
||||
- doc: Remove non-existing decklink options.
|
||||
|
||||
version 2.6.1:
|
||||
- avformat/mov: Disallow ".." in dref unless use_absolute_path is set
|
||||
- avfilter/palettegen: make sure at least one frame was sent to the filter
|
||||
- avformat/mov: Check for string truncation in mov_open_dref()
|
||||
- ac3_fixed: fix out-of-bound read
|
||||
- mips/asmdefs: use _ABI64 as defined by gcc
|
||||
- hevc: delay ff_thread_finish_setup for hwaccel
|
||||
- avcodec/012v: Check dimensions more completely
|
||||
- asfenc: fix leaking asf->index_ptr on error
|
||||
- roqvideoenc: set enc->avctx in roq_encode_init
|
||||
- avcodec/options_table: remove extradata_size from the AVOptions table
|
||||
- ffmdec: limit the backward seek to the last resync position
|
||||
- Add dependencies to configure file for vf_fftfilt
|
||||
- ffmdec: make sure the time base is valid
|
||||
- ffmdec: fix infinite loop at EOF
|
||||
- ffmdec: initialize f_cprv, f_stvi and f_stau
|
||||
- arm: Suppress tags about used cpu arch and extensions
|
||||
- mxfdec: Fix the error handling for when strftime fails
|
||||
- avcodec/opusdec: Fix delayed sample value
|
||||
- avcodec/opusdec: Clear out pointers per packet
|
||||
- avcodec/utils: Align YUV411 by as much as the other YUV variants
|
||||
- lavc/hevcdsp: Fix compilation for arm with --disable-neon.
|
||||
- vp9: fix segmentation map retention with threading enabled.
|
||||
- Revert "avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit"
|
||||
|
||||
version 2.6:
|
||||
- nvenc encoder
|
||||
- 10bit spp filter
|
||||
@@ -35,8 +540,7 @@ version 2.6:
|
||||
- Fix stsd atom corruption in DNxHD QuickTimes
|
||||
- Canopus HQX decoder
|
||||
- RTP depacketization of T.140 text (RFC 4103)
|
||||
- VP9 RTP payload format (draft 0) experimental depacketizer
|
||||
- Port MIPS opttimizations to 64-bit
|
||||
- Port MIPS optimizations to 64-bit
|
||||
|
||||
|
||||
version 2.5:
|
||||
|
@@ -14,7 +14,6 @@ patches and related discussions.
|
||||
Project Leader
|
||||
==============
|
||||
|
||||
Michael Niedermayer
|
||||
final design decisions
|
||||
|
||||
|
||||
@@ -540,14 +539,14 @@ Windows ICL Matthew Oliver
|
||||
ADI/Blackfin DSP Marc Hoffman
|
||||
Sparc Roman Shaposhnik
|
||||
x86 Michael Niedermayer
|
||||
OS/2 KO Myung-Hun
|
||||
|
||||
|
||||
Releases
|
||||
========
|
||||
|
||||
2.6 Michael Niedermayer
|
||||
2.5 Michael Niedermayer
|
||||
2.4 Michael Niedermayer
|
||||
2.2 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
|
65
RELEASE_NOTES
Normal file
65
RELEASE_NOTES
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
┌─────────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 2.6 "Grothendieck" │
|
||||
└─────────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 2.6 "Grothendieck", about 3
|
||||
months after the release of FFmpeg 2.5.
|
||||
|
||||
A lot of important work got in this time, so let's start talking about what
|
||||
we like to brag the most about: features.
|
||||
|
||||
A lot of people will probably be happy to hear that we now have support for
|
||||
NVENC — the Nvidia Video Encoder interface for H.264 encoding — thanks to
|
||||
Timo Rothenpieler, with some little help from NVIDIA and Philip Langdale.
|
||||
|
||||
People in the broadcasting industry might also be interested in the first
|
||||
steps of closed captions support with the introduction of a decoder by
|
||||
Anshul Maheswhwari.
|
||||
|
||||
Regarding filters love, we improved and added many. We could talk about the
|
||||
10-bit support in spp, but maybe it's more important to mention the addition
|
||||
of colorlevels (yet another color handling filter), tblend (allowing you
|
||||
to for example run a diff between successive frames of a video stream), or
|
||||
the dcshift audio filter.
|
||||
|
||||
There are also two other important filters landing in libavfilter: palettegen
|
||||
and paletteuse. Both submitted by the Stupeflix company. These filters will
|
||||
be very useful in case you are looking for creating high quality GIFs, a
|
||||
format that still bravely fights annihilation in 2015.
|
||||
|
||||
There are many other new features, but let's follow-up on one big cleanup
|
||||
achievement: the libmpcodecs (MPlayer filters) wrapper is finally dead. The
|
||||
last remaining filters (softpulldown/repeatfields, eq*, and various
|
||||
postprocessing filters) were ported by Arwa Arif (OPW student) and Paul B
|
||||
Mahol.
|
||||
|
||||
Concerning API changes, there are not many things to mention. Though, the
|
||||
introduction of device inputs and outputs listing by Lukasz Marek is a
|
||||
notable addition (try ffmpeg -sources or ffmpeg -sinks for an example of
|
||||
the usage). As usual, see doc/APIchanges for more information.
|
||||
|
||||
Now let's talk about optimizations. Ronald S. Bultje made the VP9 decoder
|
||||
usable on x86 32-bit systems and pre-ssse3 CPUs like Phenom (even dual core
|
||||
Athlons can play 1080p 30fps VP9 content now), so we now secretly hope for
|
||||
Google and Mozilla to use ffvp9 instead of libvpx. But VP9 is not the
|
||||
center of attention anymore, and HEVC/H.265 is also getting many
|
||||
improvements, which include C and x86 ASM optimizations, mainly from James
|
||||
Almer, Christophe Gisquet and Pierre-Edouard Lepere.
|
||||
|
||||
Even though we had many x86 contributions, it is not the only architecture
|
||||
getting some love, with Seppo Tomperi adding ARM NEON optimizations to the
|
||||
HEVC stack, and James Cowgill adding MIPS64 assembly for all kind of audio
|
||||
processing code in libavcodec.
|
||||
|
||||
And finally, Michael Niedermayer is still fixing many bugs, dealing with
|
||||
most of the boring work such as making releases, applying tons of
|
||||
contributors patches, and daily merging the changes from the Libav project.
|
||||
|
||||
A more complete Changelog is available at the root of the project, and the
|
||||
complete Git history on http://source.ffmpeg.org.
|
||||
|
||||
We hope you will like this release as much as we enjoyed working on it, and
|
||||
as usual, if you have any questions about it, or any FFmpeg related topic,
|
||||
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
|
||||
on the mailing-lists.
|
@@ -22,6 +22,7 @@
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/opencl.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "cmdutils.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -238,7 +239,8 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
|
||||
devices[count].platform_idx = i;
|
||||
devices[count].device_idx = j;
|
||||
devices[count].runtime = score;
|
||||
strcpy(devices[count].device_name, device_node->device_name);
|
||||
av_strlcpy(devices[count].device_name, device_node->device_name,
|
||||
sizeof(devices[count].device_name));
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
11
configure
vendored
11
configure
vendored
@@ -1769,6 +1769,7 @@ SYSTEM_FUNCS="
|
||||
TOOLCHAIN_FEATURES="
|
||||
as_dn_directive
|
||||
as_func
|
||||
as_object_arch
|
||||
asm_mod_q
|
||||
attribute_may_alias
|
||||
attribute_packed
|
||||
@@ -2595,6 +2596,8 @@ deshake_filter_select="pixelutils"
|
||||
drawtext_filter_deps="libfreetype"
|
||||
ebur128_filter_deps="gpl"
|
||||
eq_filter_deps="gpl"
|
||||
fftfilt_filter_deps="avcodec"
|
||||
fftfilt_filter_select="rdft"
|
||||
flite_filter_deps="libflite"
|
||||
frei0r_filter_deps="frei0r dlopen"
|
||||
frei0r_src_filter_deps="frei0r dlopen"
|
||||
@@ -4560,6 +4563,11 @@ EOF
|
||||
check_as <<EOF && enable as_dn_directive
|
||||
ra .dn d0.i16
|
||||
.unreq ra
|
||||
EOF
|
||||
|
||||
# llvm's integrated assembler supports .object_arch from llvm 3.5
|
||||
[ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
|
||||
.object_arch armv4
|
||||
EOF
|
||||
|
||||
[ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
|
||||
@@ -5451,6 +5459,7 @@ enabled asyncts_filter && prepend avfilter_deps "avresample"
|
||||
enabled atempo_filter && prepend avfilter_deps "avcodec"
|
||||
enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
|
||||
enabled elbg_filter && prepend avfilter_deps "avcodec"
|
||||
enabled fftfilt_filter && prepend avfilter_deps "avcodec"
|
||||
enabled mcdeint_filter && prepend avfilter_deps "avcodec"
|
||||
enabled movie_filter && prepend avfilter_deps "avformat avcodec"
|
||||
enabled pan_filter && prepend avfilter_deps "swresample"
|
||||
@@ -5739,7 +5748,7 @@ cat > $TMPH <<EOF
|
||||
#define FFMPEG_CONFIG_H
|
||||
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
||||
#define FFMPEG_LICENSE "$(c_escape $license)"
|
||||
#define CONFIG_THIS_YEAR 2015
|
||||
#define CONFIG_THIS_YEAR 2016
|
||||
#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 = 2.6.9
|
||||
|
||||
# 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
|
||||
|
@@ -98,7 +98,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
|
||||
@@ -145,7 +145,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
|
||||
@@ -359,6 +361,23 @@ ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section mov/mp4/3gp/Quicktme
|
||||
|
||||
Quicktime / MP4 demuxer.
|
||||
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
@item enable_drefs
|
||||
Enable loading of external tracks, disabled by default.
|
||||
Enabling this can theoretically leak information in some use cases.
|
||||
|
||||
@item use_absolute_path
|
||||
Allows loading of external tracks via absolute paths, disabled by default.
|
||||
Enabling this poses a security risk. It should only be enabled if the source
|
||||
is known to be non malicious.
|
||||
|
||||
@end table
|
||||
|
||||
@section mpegts
|
||||
|
||||
MPEG-2 transport stream demuxer.
|
||||
|
@@ -81,22 +81,24 @@ static int decode_packet(int *got_frame, int cached)
|
||||
fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
if (video_dec_ctx->width != width || video_dec_ctx->height != height ||
|
||||
video_dec_ctx->pix_fmt != pix_fmt) {
|
||||
/* To handle this change, one could call av_image_alloc again and
|
||||
* decode the following frames into another rawvideo file. */
|
||||
fprintf(stderr, "Error: Width, height and pixel format have to be "
|
||||
"constant in a rawvideo file, but the width, height or "
|
||||
"pixel format of the input video changed:\n"
|
||||
"old: width = %d, height = %d, format = %s\n"
|
||||
"new: width = %d, height = %d, format = %s\n",
|
||||
width, height, av_get_pix_fmt_name(pix_fmt),
|
||||
video_dec_ctx->width, video_dec_ctx->height,
|
||||
av_get_pix_fmt_name(video_dec_ctx->pix_fmt));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (*got_frame) {
|
||||
|
||||
if (frame->width != width || frame->height != height ||
|
||||
frame->format != pix_fmt) {
|
||||
/* To handle this change, one could call av_image_alloc again and
|
||||
* decode the following frames into another rawvideo file. */
|
||||
fprintf(stderr, "Error: Width, height and pixel format have to be "
|
||||
"constant in a rawvideo file, but the width, height or "
|
||||
"pixel format of the input video changed:\n"
|
||||
"old: width = %d, height = %d, format = %s\n"
|
||||
"new: width = %d, height = %d, format = %s\n",
|
||||
width, height, av_get_pix_fmt_name(pix_fmt),
|
||||
frame->width, frame->height,
|
||||
av_get_pix_fmt_name(frame->format));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("video_frame%s n:%d coded_n:%d pts:%s\n",
|
||||
cached ? "(cached)" : "",
|
||||
video_frame_count++, frame->coded_picture_number,
|
||||
|
@@ -349,7 +349,7 @@ FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
|
||||
@code{concat}} protocol designed specifically for that, with examples in the
|
||||
documentation.
|
||||
|
||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
|
||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate
|
||||
video by merely concatenating the files containing them.
|
||||
|
||||
Hence you may concatenate your multimedia files by first transcoding them to
|
||||
|
@@ -1175,9 +1175,9 @@ The option is intended for cases where features are needed that cannot be
|
||||
specified to @command{ffserver} but can be to @command{ffmpeg}.
|
||||
|
||||
@item -sdp_file @var{file} (@emph{global})
|
||||
Print sdp information to @var{file}.
|
||||
Print sdp information for an output stream to @var{file}.
|
||||
This allows dumping sdp information when at least one output isn't an
|
||||
rtp stream.
|
||||
rtp stream. (Requires at least one of the output formats to be rtp).
|
||||
|
||||
@item -discard (@emph{input})
|
||||
Allows discarding specific streams or frames of streams at the demuxer.
|
||||
|
@@ -72,7 +72,7 @@ the HTTP server (configured through the @option{HTTPPort} option), and
|
||||
configuration file.
|
||||
|
||||
Each feed is associated to a file which is stored on disk. This stored
|
||||
file is used to allow to send pre-recorded data to a player as fast as
|
||||
file is used to send pre-recorded data to a player as fast as
|
||||
possible when new content is added in real-time to the stream.
|
||||
|
||||
A "live-stream" or "stream" is a resource published by
|
||||
|
@@ -261,10 +261,14 @@ Possible flags for this option are:
|
||||
@item sse4.1
|
||||
@item sse4.2
|
||||
@item avx
|
||||
@item avx2
|
||||
@item xop
|
||||
@item fma3
|
||||
@item fma4
|
||||
@item 3dnow
|
||||
@item 3dnowext
|
||||
@item bmi1
|
||||
@item bmi2
|
||||
@item cmov
|
||||
@end table
|
||||
@item ARM
|
||||
@@ -275,6 +279,13 @@ Possible flags for this option are:
|
||||
@item vfp
|
||||
@item vfpv3
|
||||
@item neon
|
||||
@item setend
|
||||
@end table
|
||||
@item AArch64
|
||||
@table @samp
|
||||
@item armv8
|
||||
@item vfp
|
||||
@item neon
|
||||
@end table
|
||||
@item PowerPC
|
||||
@table @samp
|
||||
|
@@ -3486,7 +3486,7 @@ Set number overlapping pixels for each block. Since the filter can be slow, you
|
||||
may want to reduce this value, at the cost of a less effective filter and the
|
||||
risk of various artefacts.
|
||||
|
||||
If the overlapping value doesn't allow to process the whole input width or
|
||||
If the overlapping value doesn't permit processing the whole input width or
|
||||
height, a warning will be displayed and according borders won't be denoised.
|
||||
|
||||
Default value is @var{blocksize}-1, which is the best possible setting.
|
||||
@@ -4243,7 +4243,7 @@ within the parameter list.
|
||||
@item
|
||||
Show the text at the center of the video frame:
|
||||
@example
|
||||
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
|
||||
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
|
||||
@end example
|
||||
|
||||
@item
|
||||
|
@@ -23,7 +23,7 @@ Reduce buffering.
|
||||
|
||||
@item probesize @var{integer} (@emph{input})
|
||||
Set probing size in bytes, i.e. the size of the data to analyze to get
|
||||
stream information. A higher value will allow to detect more
|
||||
stream information. A higher value will enable detecting more
|
||||
information in case it is dispersed into the stream, but will increase
|
||||
latency. Must be an integer not lesser than 32. It is 5000000 by default.
|
||||
|
||||
@@ -67,7 +67,7 @@ Default is 0.
|
||||
|
||||
@item analyzeduration @var{integer} (@emph{input})
|
||||
Specify how many microseconds are analyzed to probe the input. A
|
||||
higher value will allow to detect more accurate information, but will
|
||||
higher value will enable detecting more accurate information, but will
|
||||
increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
|
||||
|
||||
@item cryptokey @var{hexadecimal string} (@emph{input})
|
||||
|
@@ -948,8 +948,8 @@ following image formats are supported:
|
||||
@item Musepack SV8 @tab @tab X
|
||||
@item Nellymoser Asao @tab X @tab X
|
||||
@item On2 AVC (Audio for Video Codec) @tab @tab X
|
||||
@item Opus @tab E @tab E
|
||||
@tab supported through external library libopus
|
||||
@item Opus @tab E @tab X
|
||||
@tab encoding supported through external library libopus
|
||||
@item PCM A-law @tab X @tab X
|
||||
@item PCM mu-law @tab X @tab X
|
||||
@item PCM signed 8-bit planar @tab X @tab X
|
||||
|
160
doc/indevs.texi
160
doc/indevs.texi
@@ -1,7 +1,7 @@
|
||||
@chapter Input Devices
|
||||
@c man begin INPUT DEVICES
|
||||
|
||||
Input devices are configured elements in FFmpeg which allow to access
|
||||
Input devices are configured elements in FFmpeg which enable accessing
|
||||
the data coming from a multimedia device attached to your system.
|
||||
|
||||
When you configure your FFmpeg build, all the supported input devices
|
||||
@@ -150,6 +150,81 @@ $ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
|
||||
|
||||
BSD video input device.
|
||||
|
||||
@section decklink
|
||||
|
||||
The decklink input device provides capture capabilities for Blackmagic
|
||||
DeckLink devices.
|
||||
|
||||
To enable this input device, you need the Blackmagic DeckLink SDK and you
|
||||
need to configure with the appropriate @code{--extra-cflags}
|
||||
and @code{--extra-ldflags}.
|
||||
On Windows, you need to run the IDL files through @command{widl}.
|
||||
|
||||
DeckLink is very picky about the formats it supports. Pixel format is
|
||||
uyvy422 or v210, framerate and video size must be determined for your device with
|
||||
@command{-list_formats 1}. Audio sample rate is always 48 kHz and the number
|
||||
of channels can be 2, 8 or 16.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item list_devices
|
||||
If set to @option{true}, print a list of devices and exit.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@item list_formats
|
||||
If set to @option{true}, print a list of supported formats and exit.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@item bm_v210
|
||||
If set to @samp{1}, video is captured in 10 bit v210 instead
|
||||
of uyvy422. Not all Blackmagic devices support this option.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
|
||||
@item
|
||||
List input devices:
|
||||
@example
|
||||
ffmpeg -f decklink -list_devices 1 -i dummy
|
||||
@end example
|
||||
|
||||
@item
|
||||
List supported formats:
|
||||
@example
|
||||
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 1080i50 (format 11):
|
||||
@example
|
||||
ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 1080i50 10 bit:
|
||||
@example
|
||||
ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 720p50 with 32bit audio:
|
||||
@example
|
||||
ffmpeg -bm_audiodepth 32 -f decklink -i 'UltraStudio Mini Recorder@@14' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 576i50 with 8 audio channels:
|
||||
@example
|
||||
ffmpeg -bm_channels 8 -f decklink -i 'UltraStudio Mini Recorder@@3' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
@section dshow
|
||||
|
||||
Windows DirectShow input device.
|
||||
@@ -1109,89 +1184,8 @@ The syntax is:
|
||||
-grab_x @var{x_offset} -grab_y @var{y_offset}
|
||||
@end example
|
||||
|
||||
Set the grabing region coordinates. The are expressed as offset from the top left
|
||||
Set the grabbing region coordinates. They are expressed as offset from the top left
|
||||
corner of the X11 window. The default value is 0.
|
||||
|
||||
@section decklink
|
||||
|
||||
The decklink input device provides capture capabilities for Blackmagic
|
||||
DeckLink devices.
|
||||
|
||||
To enable this input device, you need the Blackmagic DeckLink SDK and you
|
||||
need to configure with the appropriate @code{--extra-cflags}
|
||||
and @code{--extra-ldflags}.
|
||||
On Windows, you need to run the IDL files through @command{widl}.
|
||||
|
||||
DeckLink is very picky about the formats it supports. Pixel format is
|
||||
uyvy422 or v210, framerate and video size must be determined for your device with
|
||||
@command{-list_formats 1}. Audio sample rate is always 48 kHz and the number
|
||||
of channels can be 2, 8 or 16.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item list_devices
|
||||
If set to @option{true}, print a list of devices and exit.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@item list_formats
|
||||
If set to @option{true}, print a list of supported formats and exit.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@item bm_v210
|
||||
If set to @samp{1}, video is captured in 10 bit v210 instead
|
||||
of uyvy422. Not all Blackmagic devices support this option.
|
||||
|
||||
@item bm_channels <CHANNELS>
|
||||
Number of audio channels, can be 2, 8 or 16
|
||||
|
||||
@item bm_audiodepth <BITDEPTH>
|
||||
Audio bit depth, can be 16 or 32.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
|
||||
@item
|
||||
List input devices:
|
||||
@example
|
||||
ffmpeg -f decklink -list_devices 1 -i dummy
|
||||
@end example
|
||||
|
||||
@item
|
||||
List supported formats:
|
||||
@example
|
||||
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 1080i50 (format 11):
|
||||
@example
|
||||
ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 1080i50 10 bit:
|
||||
@example
|
||||
ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 720p50 with 32bit audio:
|
||||
@example
|
||||
ffmpeg -bm_audiodepth 32 -f decklink -i 'UltraStudio Mini Recorder@@14' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 576i50 with 8 audio channels:
|
||||
@example
|
||||
ffmpeg -bm_channels 8 -f decklink -i 'UltraStudio Mini Recorder@@3' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
@c man end INPUT DEVICES
|
||||
|
@@ -63,7 +63,7 @@ cache:@var{URL}
|
||||
|
||||
Physical concatenation protocol.
|
||||
|
||||
Allow to read and seek from many resource in sequence as if they were
|
||||
Read and seek from many resources in sequence as if they were
|
||||
a unique resource.
|
||||
|
||||
A URL accepted by this protocol has the syntax:
|
||||
@@ -117,7 +117,7 @@ ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP/////////////
|
||||
|
||||
File access protocol.
|
||||
|
||||
Allow to read from or write to a file.
|
||||
Read from or write to a file.
|
||||
|
||||
A file URL can have the form:
|
||||
@example
|
||||
@@ -155,7 +155,7 @@ time, which is valuable for files on slow medium.
|
||||
|
||||
FTP (File Transfer Protocol).
|
||||
|
||||
Allow to read from or write to remote resources using FTP protocol.
|
||||
Read from or write to remote resources using FTP protocol.
|
||||
|
||||
Following syntax is required.
|
||||
@example
|
||||
@@ -374,7 +374,7 @@ be seekable, so they will fail with the MD5 output protocol.
|
||||
|
||||
UNIX pipe access protocol.
|
||||
|
||||
Allow to read and write from UNIX pipes.
|
||||
Read and write from UNIX pipes.
|
||||
|
||||
The accepted syntax is:
|
||||
@example
|
||||
@@ -614,7 +614,7 @@ For more information see: @url{http://www.samba.org/}.
|
||||
|
||||
Secure File Transfer Protocol via libssh
|
||||
|
||||
Allow to read from or write to remote resources using SFTP protocol.
|
||||
Read from or write to remote resources using SFTP protocol.
|
||||
|
||||
Following syntax is required.
|
||||
|
||||
|
@@ -844,7 +844,7 @@ Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
|
||||
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
|
||||
|
||||
@item ld(var)
|
||||
Allow to load the value of the internal variable with number
|
||||
Load the value of the internal variable with number
|
||||
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
|
||||
The function returns the loaded value.
|
||||
|
||||
@@ -861,7 +861,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}.
|
||||
@@ -912,7 +912,7 @@ Compute the square root of @var{expr}. This is equivalent to
|
||||
Compute expression @code{1/(1 + exp(4*x))}.
|
||||
|
||||
@item st(var, expr)
|
||||
Allow to store the value of the expression @var{expr} in an internal
|
||||
Store the value of the expression @var{expr} in an internal
|
||||
variable. @var{var} specifies the number of the variable where to
|
||||
store the value, and it is a value ranging from 0 to 9. The function
|
||||
returns the value stored in the internal variable.
|
||||
|
76
ffmpeg.c
76
ffmpeg.c
@@ -351,7 +351,6 @@ void term_init(void)
|
||||
signal(SIGQUIT, sigterm_handler); /* Quit (POSIX). */
|
||||
}
|
||||
#endif
|
||||
avformat_network_deinit();
|
||||
|
||||
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
|
||||
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
|
||||
@@ -456,7 +455,10 @@ static void ffmpeg_cleanup(int ret)
|
||||
/* close files */
|
||||
for (i = 0; i < nb_output_files; i++) {
|
||||
OutputFile *of = output_files[i];
|
||||
AVFormatContext *s = of->ctx;
|
||||
AVFormatContext *s;
|
||||
if (!of)
|
||||
continue;
|
||||
s = of->ctx;
|
||||
if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE))
|
||||
avio_closep(&s->pb);
|
||||
avformat_free_context(s);
|
||||
@@ -466,7 +468,12 @@ static void ffmpeg_cleanup(int ret)
|
||||
}
|
||||
for (i = 0; i < nb_output_streams; i++) {
|
||||
OutputStream *ost = output_streams[i];
|
||||
AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
|
||||
AVBitStreamFilterContext *bsfc;
|
||||
|
||||
if (!ost)
|
||||
continue;
|
||||
|
||||
bsfc = ost->bitstream_filters;
|
||||
while (bsfc) {
|
||||
AVBitStreamFilterContext *next = bsfc->next;
|
||||
av_bitstream_filter_close(bsfc);
|
||||
@@ -650,6 +657,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
|
||||
if (!new_pkt.buf)
|
||||
exit_program(1);
|
||||
} else if (a < 0) {
|
||||
new_pkt = *pkt;
|
||||
av_log(NULL, AV_LOG_ERROR, "Failed to open bitstream filter %s for stream %d with codec %s",
|
||||
bsfc->filter->name, pkt->stream_index,
|
||||
avctx->codec ? avctx->codec->name : "copy");
|
||||
@@ -1156,7 +1164,10 @@ static void do_video_out(AVFormatContext *s,
|
||||
if (!ost->last_frame)
|
||||
ost->last_frame = av_frame_alloc();
|
||||
av_frame_unref(ost->last_frame);
|
||||
av_frame_ref(ost->last_frame, next_picture);
|
||||
if (next_picture && ost->last_frame)
|
||||
av_frame_ref(ost->last_frame, next_picture);
|
||||
else
|
||||
av_frame_free(&ost->last_frame);
|
||||
}
|
||||
|
||||
static double psnr(double d)
|
||||
@@ -1756,17 +1767,21 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
|
||||
|
||||
opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
|
||||
opkt.flags = pkt->flags;
|
||||
|
||||
// FIXME remove the following 2 lines they shall be replaced by the bitstream filters
|
||||
if ( ost->enc_ctx->codec_id != AV_CODEC_ID_H264
|
||||
&& ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG1VIDEO
|
||||
&& ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG2VIDEO
|
||||
&& ost->enc_ctx->codec_id != AV_CODEC_ID_VC1
|
||||
if ( ost->st->codec->codec_id != AV_CODEC_ID_H264
|
||||
&& ost->st->codec->codec_id != AV_CODEC_ID_MPEG1VIDEO
|
||||
&& ost->st->codec->codec_id != AV_CODEC_ID_MPEG2VIDEO
|
||||
&& ost->st->codec->codec_id != AV_CODEC_ID_VC1
|
||||
) {
|
||||
if (av_parser_change(ost->parser, ost->st->codec,
|
||||
int ret = av_parser_change(ost->parser, ost->st->codec,
|
||||
&opkt.data, &opkt.size,
|
||||
pkt->data, pkt->size,
|
||||
pkt->flags & AV_PKT_FLAG_KEY)) {
|
||||
pkt->flags & AV_PKT_FLAG_KEY);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "av_parser_change failed\n");
|
||||
exit_program(1);
|
||||
}
|
||||
if (ret) {
|
||||
opkt.buf = av_buffer_create(opkt.data, opkt.size, av_buffer_default_free, NULL, 0);
|
||||
if (!opkt.buf)
|
||||
exit_program(1);
|
||||
@@ -1777,9 +1792,15 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
|
||||
}
|
||||
av_copy_packet_side_data(&opkt, pkt);
|
||||
|
||||
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
|
||||
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
|
||||
ost->st->codec->codec_id == AV_CODEC_ID_RAWVIDEO &&
|
||||
(of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
|
||||
/* store AVPicture in AVPacket, as expected by the output format */
|
||||
avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
|
||||
int ret = avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "avpicture_fill failed\n");
|
||||
exit_program(1);
|
||||
}
|
||||
opkt.data = (uint8_t *)&pict;
|
||||
opkt.size = sizeof(AVPicture);
|
||||
opkt.flags |= AV_PKT_FLAG_KEY;
|
||||
@@ -1830,9 +1851,12 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (*got_output || ret<0 || pkt->size)
|
||||
if (*got_output || ret<0)
|
||||
decode_error_stat[ret<0] ++;
|
||||
|
||||
if (ret < 0 && exit_on_error)
|
||||
exit_program(1);
|
||||
|
||||
if (!*got_output || ret < 0) {
|
||||
if (!pkt->size) {
|
||||
for (i = 0; i < ist->nb_filters; i++)
|
||||
@@ -1975,9 +1999,12 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
);
|
||||
}
|
||||
|
||||
if (*got_output || ret<0 || pkt->size)
|
||||
if (*got_output || ret<0)
|
||||
decode_error_stat[ret<0] ++;
|
||||
|
||||
if (ret < 0 && exit_on_error)
|
||||
exit_program(1);
|
||||
|
||||
if (*got_output && ret >= 0) {
|
||||
if (ist->dec_ctx->width != decoded_frame->width ||
|
||||
ist->dec_ctx->height != decoded_frame->height ||
|
||||
@@ -2093,9 +2120,12 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
int i, ret = avcodec_decode_subtitle2(ist->dec_ctx,
|
||||
&subtitle, got_output, pkt);
|
||||
|
||||
if (*got_output || ret<0 || pkt->size)
|
||||
if (*got_output || ret<0)
|
||||
decode_error_stat[ret<0] ++;
|
||||
|
||||
if (ret < 0 && exit_on_error)
|
||||
exit_program(1);
|
||||
|
||||
if (ret < 0 || !*got_output) {
|
||||
if (!pkt->size)
|
||||
sub2video_flush(ist);
|
||||
@@ -2307,6 +2337,9 @@ static void print_sdp(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!j)
|
||||
goto fail;
|
||||
|
||||
av_sdp_create(avc, j, sdp, sizeof(sdp));
|
||||
|
||||
if (!sdp_filename) {
|
||||
@@ -2322,6 +2355,7 @@ static void print_sdp(void)
|
||||
}
|
||||
}
|
||||
|
||||
fail:
|
||||
av_freep(&avc);
|
||||
}
|
||||
|
||||
@@ -2666,11 +2700,13 @@ static int transcode_init(void)
|
||||
enc_ctx->rc_max_rate = dec_ctx->rc_max_rate;
|
||||
enc_ctx->rc_buffer_size = dec_ctx->rc_buffer_size;
|
||||
enc_ctx->field_order = dec_ctx->field_order;
|
||||
enc_ctx->extradata = av_mallocz(extra_size);
|
||||
if (!enc_ctx->extradata) {
|
||||
return AVERROR(ENOMEM);
|
||||
if (dec_ctx->extradata_size) {
|
||||
enc_ctx->extradata = av_mallocz(extra_size);
|
||||
if (!enc_ctx->extradata) {
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(enc_ctx->extradata, dec_ctx->extradata, dec_ctx->extradata_size);
|
||||
}
|
||||
memcpy(enc_ctx->extradata, dec_ctx->extradata, dec_ctx->extradata_size);
|
||||
enc_ctx->extradata_size= dec_ctx->extradata_size;
|
||||
enc_ctx->bits_per_coded_sample = dec_ctx->bits_per_coded_sample;
|
||||
|
||||
|
23
ffmpeg_opt.c
23
ffmpeg_opt.c
@@ -2282,9 +2282,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
|
||||
opt_default(NULL, "b:v", "1150000");
|
||||
opt_default(NULL, "maxrate", "1150000");
|
||||
opt_default(NULL, "minrate", "1150000");
|
||||
opt_default(NULL, "bufsize", "327680"); // 40*1024*8;
|
||||
opt_default(NULL, "maxrate:v", "1150000");
|
||||
opt_default(NULL, "minrate:v", "1150000");
|
||||
opt_default(NULL, "bufsize:v", "327680"); // 40*1024*8;
|
||||
|
||||
opt_default(NULL, "b:a", "224000");
|
||||
parse_option(o, "ar", "44100", options);
|
||||
@@ -2311,9 +2311,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
|
||||
opt_default(NULL, "b:v", "2040000");
|
||||
opt_default(NULL, "maxrate", "2516000");
|
||||
opt_default(NULL, "minrate", "0"); // 1145000;
|
||||
opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
|
||||
opt_default(NULL, "maxrate:v", "2516000");
|
||||
opt_default(NULL, "minrate:v", "0"); // 1145000;
|
||||
opt_default(NULL, "bufsize:v", "1835008"); // 224*1024*8;
|
||||
opt_default(NULL, "scan_offset", "1");
|
||||
|
||||
opt_default(NULL, "b:a", "224000");
|
||||
@@ -2333,9 +2333,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
|
||||
opt_default(NULL, "b:v", "6000000");
|
||||
opt_default(NULL, "maxrate", "9000000");
|
||||
opt_default(NULL, "minrate", "0"); // 1500000;
|
||||
opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
|
||||
opt_default(NULL, "maxrate:v", "9000000");
|
||||
opt_default(NULL, "minrate:v", "0"); // 1500000;
|
||||
opt_default(NULL, "bufsize:v", "1835008"); // 224*1024*8;
|
||||
|
||||
opt_default(NULL, "packetsize", "2048"); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
|
||||
opt_default(NULL, "muxrate", "10080000"); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
|
||||
@@ -2379,6 +2379,9 @@ static int opt_vstats(void *optctx, const char *opt, const char *arg)
|
||||
time_t today2 = time(NULL);
|
||||
struct tm *today = localtime(&today2);
|
||||
|
||||
if (!today)
|
||||
return AVERROR(errno);
|
||||
|
||||
snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
|
||||
today->tm_sec);
|
||||
return opt_vstats_file(NULL, opt, filename);
|
||||
@@ -2859,7 +2862,7 @@ const OptionDef options[] = {
|
||||
{ "itsscale", HAS_ARG | OPT_DOUBLE | OPT_SPEC |
|
||||
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(ts_scale) },
|
||||
"set the input ts scale", "scale" },
|
||||
{ "timestamp", HAS_ARG | OPT_PERFILE, { .func_arg = opt_recording_timestamp },
|
||||
{ "timestamp", HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_recording_timestamp },
|
||||
"set the recording timestamp ('now' to set the current time)", "time" },
|
||||
{ "metadata", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(metadata) },
|
||||
"add metadata", "string=string" },
|
||||
|
@@ -77,6 +77,8 @@ static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame)
|
||||
frame->width, frame->height);
|
||||
|
||||
ret = av_frame_copy_props(vda->tmp_frame, frame);
|
||||
CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@@ -38,15 +38,15 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx)
|
||||
static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame, AVPacket *avpkt)
|
||||
{
|
||||
int line = 0, ret;
|
||||
int line, ret;
|
||||
const int width = avctx->width;
|
||||
AVFrame *pic = data;
|
||||
uint16_t *y, *u, *v;
|
||||
const uint8_t *line_end, *src = avpkt->data;
|
||||
int stride = avctx->width * 8 / 3;
|
||||
|
||||
if (width == 1) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n");
|
||||
if (width <= 1 || avctx->height <= 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", width, avctx->height);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -67,45 +67,45 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
pic->pict_type = AV_PICTURE_TYPE_I;
|
||||
pic->key_frame = 1;
|
||||
|
||||
y = (uint16_t *)pic->data[0];
|
||||
u = (uint16_t *)pic->data[1];
|
||||
v = (uint16_t *)pic->data[2];
|
||||
line_end = avpkt->data + stride;
|
||||
for (line = 0; line < avctx->height; line++) {
|
||||
uint16_t y_temp[6] = {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000};
|
||||
uint16_t u_temp[3] = {0x8000, 0x8000, 0x8000};
|
||||
uint16_t v_temp[3] = {0x8000, 0x8000, 0x8000};
|
||||
int x;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
|
||||
while (line++ < avctx->height) {
|
||||
while (1) {
|
||||
uint32_t t = AV_RL32(src);
|
||||
for (x = 0; x < width; x += 6) {
|
||||
uint32_t t;
|
||||
|
||||
if (width - x < 6 || line_end - src < 16) {
|
||||
y = y_temp;
|
||||
u = u_temp;
|
||||
v = v_temp;
|
||||
}
|
||||
|
||||
if (line_end - src < 4)
|
||||
break;
|
||||
|
||||
t = AV_RL32(src);
|
||||
src += 4;
|
||||
*u++ = t << 6 & 0xFFC0;
|
||||
*y++ = t >> 4 & 0xFFC0;
|
||||
*v++ = t >> 14 & 0xFFC0;
|
||||
|
||||
if (src >= line_end - 1) {
|
||||
*y = 0x80;
|
||||
src++;
|
||||
line_end += stride;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
if (line_end - src < 4)
|
||||
break;
|
||||
}
|
||||
|
||||
t = AV_RL32(src);
|
||||
src += 4;
|
||||
*y++ = t << 6 & 0xFFC0;
|
||||
*u++ = t >> 4 & 0xFFC0;
|
||||
*y++ = t >> 14 & 0xFFC0;
|
||||
if (src >= line_end - 2) {
|
||||
if (!(width & 1)) {
|
||||
*y = 0x80;
|
||||
src += 2;
|
||||
}
|
||||
line_end += stride;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
|
||||
if (line_end - src < 4)
|
||||
break;
|
||||
}
|
||||
|
||||
t = AV_RL32(src);
|
||||
src += 4;
|
||||
@@ -113,15 +113,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
*y++ = t >> 4 & 0xFFC0;
|
||||
*u++ = t >> 14 & 0xFFC0;
|
||||
|
||||
if (src >= line_end - 1) {
|
||||
*y = 0x80;
|
||||
src++;
|
||||
line_end += stride;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
if (line_end - src < 4)
|
||||
break;
|
||||
}
|
||||
|
||||
t = AV_RL32(src);
|
||||
src += 4;
|
||||
@@ -129,18 +122,21 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
*v++ = t >> 4 & 0xFFC0;
|
||||
*y++ = t >> 14 & 0xFFC0;
|
||||
|
||||
if (src >= line_end - 2) {
|
||||
if (width & 1) {
|
||||
*y = 0x80;
|
||||
src += 2;
|
||||
}
|
||||
line_end += stride;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
if (width - x < 6)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (x < width) {
|
||||
y = x + (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = x/2 + (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = x/2 + (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
memcpy(y, y_temp, sizeof(*y) * (width - x));
|
||||
memcpy(u, u_temp, sizeof(*u) * (width - x + 1) / 2);
|
||||
memcpy(v, v_temp, sizeof(*v) * (width - x + 1) / 2);
|
||||
}
|
||||
|
||||
line_end += stride;
|
||||
src = line_end - stride;
|
||||
}
|
||||
|
||||
*got_frame = 1;
|
||||
|
@@ -217,7 +217,7 @@ OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dvenc.o dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
||||
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3_data.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3_data.o
|
||||
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o eac3_data.o
|
||||
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
|
||||
OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
|
||||
|
@@ -691,7 +691,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
|
||||
}
|
||||
while (idx) {
|
||||
sce->sf_idx[bandaddr[idx]] = minq + q0;
|
||||
minq = paths[idx][minq].prev;
|
||||
minq = FFMAX(paths[idx][minq].prev, 0);
|
||||
idx--;
|
||||
}
|
||||
//set the same quantizers inside window groups
|
||||
|
@@ -424,7 +424,7 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
* Save current output configuration if and only if it has been locked.
|
||||
*/
|
||||
static void push_output_configuration(AACContext *ac) {
|
||||
if (ac->oc[1].status == OC_LOCKED) {
|
||||
if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
|
||||
ac->oc[0] = ac->oc[1];
|
||||
}
|
||||
ac->oc[1].status = OC_NONE;
|
||||
@@ -900,7 +900,7 @@ static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
|
||||
if (len == 15 + 255)
|
||||
len += get_bits(gb, 16);
|
||||
if (get_bits_left(gb) < len * 8 + 4) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
|
||||
av_log(avctx, AV_LOG_ERROR, overread_err);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
skip_bits_long(gb, 8 * len);
|
||||
@@ -2919,6 +2919,11 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
spectral_to_sample(ac);
|
||||
|
||||
if (!ac->frame->data[0] && samples) {
|
||||
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
ac->frame->nb_samples = samples;
|
||||
ac->frame->sample_rate = avctx->sample_rate;
|
||||
*got_frame_ptr = 1;
|
||||
@@ -3073,6 +3078,12 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
AV_WL32(side, 2*AV_RL32(side));
|
||||
}
|
||||
|
||||
if (!ac->frame->data[0] && samples) {
|
||||
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
|
||||
err = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
*got_frame_ptr = !!samples;
|
||||
if (samples) {
|
||||
ac->frame->nb_samples = samples;
|
||||
@@ -3142,7 +3153,7 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (INT_MAX / 8 <= buf_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((err = init_get_bits(&gb, buf, buf_size * 8)) < 0)
|
||||
if ((err = init_get_bits8(&gb, buf, buf_size)) < 0)
|
||||
return err;
|
||||
|
||||
switch (ac->oc[1].m4ac.object_type) {
|
||||
|
@@ -578,8 +578,16 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
ics->group_len[w] = wi[ch].grouping[w];
|
||||
|
||||
apply_window_and_mdct(s, &cpe->ch[ch], overlap);
|
||||
if (isnan(cpe->ch->coeffs[0])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN\n");
|
||||
|
||||
if (isnan(cpe->ch[ch].coeffs[ 0]) || isinf(cpe->ch[ch].coeffs[ 0]) ||
|
||||
isnan(cpe->ch[ch].coeffs[ 128]) || isinf(cpe->ch[ch].coeffs[ 128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[2*128]) || isinf(cpe->ch[ch].coeffs[2*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[3*128]) || isinf(cpe->ch[ch].coeffs[3*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[4*128]) || isinf(cpe->ch[ch].coeffs[4*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[5*128]) || isinf(cpe->ch[ch].coeffs[5*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[6*128]) || isinf(cpe->ch[ch].coeffs[6*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[7*128]) || isinf(cpe->ch[ch].coeffs[7*128])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN/+-Inf\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
|
@@ -313,7 +313,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
|
||||
ctx->bitres.size = 6144 - pctx->frame_bits;
|
||||
ctx->bitres.size -= ctx->bitres.size % 8;
|
||||
pctx->fill_level = ctx->bitres.size;
|
||||
minath = ath(3410, ATH_ADD);
|
||||
minath = ath(3410 - 0.733 * ATH_ADD, ATH_ADD);
|
||||
for (j = 0; j < 2; j++) {
|
||||
AacPsyCoeffs *coeffs = pctx->psy_coef[j];
|
||||
const uint8_t *band_sizes = ctx->bands[j];
|
||||
@@ -727,7 +727,10 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
|
||||
if (active_lines > 0.0f)
|
||||
band->thr = calc_reduced_thr_3gpp(band, coeffs[g].min_snr, reduction);
|
||||
pe += calc_pe_3gpp(band);
|
||||
band->norm_fac = band->active_lines / band->thr;
|
||||
if (band->thr > 0.0f)
|
||||
band->norm_fac = band->active_lines / band->thr;
|
||||
else
|
||||
band->norm_fac = 0.0f;
|
||||
norm_fac += band->norm_fac;
|
||||
}
|
||||
}
|
||||
|
@@ -514,7 +514,7 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
|
||||
/// High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46)
|
||||
static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
|
||||
{
|
||||
int i, k, sb = 0;
|
||||
int i, k, last_k = -1, last_msb = -1, sb = 0;
|
||||
int msb = sbr->k[0];
|
||||
int usb = sbr->kx[1];
|
||||
int goal_sb = ((1000 << 11) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
|
||||
@@ -528,6 +528,12 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
|
||||
|
||||
do {
|
||||
int odd = 0;
|
||||
if (k == last_k && msb == last_msb) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "patch construction failed\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
last_k = k;
|
||||
last_msb = msb;
|
||||
for (i = k; i == k || sb > (sbr->k[0] - 1 + msb - odd); i--) {
|
||||
sb = sbr->f_master[i];
|
||||
odd = (sb + sbr->k[0]) & 1;
|
||||
@@ -1012,6 +1018,8 @@ static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
|
||||
{
|
||||
unsigned int cnt = get_bits_count(gb);
|
||||
|
||||
sbr->id_aac = id_aac;
|
||||
|
||||
if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
|
||||
if (read_sbr_single_channel_element(ac, sbr, gb)) {
|
||||
sbr_turnoff(sbr);
|
||||
@@ -1688,6 +1696,12 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
int nch = (id_aac == TYPE_CPE) ? 2 : 1;
|
||||
int err;
|
||||
|
||||
if (id_aac != sbr->id_aac) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"element type mismatch %d != %d\n", id_aac, sbr->id_aac);
|
||||
sbr_turnoff(sbr);
|
||||
}
|
||||
|
||||
if (!sbr->kx_and_m_pushed) {
|
||||
sbr->kx[0] = sbr->kx[1];
|
||||
sbr->m[0] = sbr->m[1];
|
||||
@@ -1711,6 +1725,7 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
sbr->c.sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1,
|
||||
(const float (*)[40][2]) sbr->X_low, sbr->k[0]);
|
||||
sbr_chirp(sbr, &sbr->data[ch]);
|
||||
av_assert0(sbr->data[ch].bs_num_env > 0);
|
||||
sbr_hf_gen(ac, sbr, sbr->X_high,
|
||||
(const float (*)[40][2]) sbr->X_low,
|
||||
(const float (*)[2]) sbr->alpha0,
|
||||
|
@@ -137,7 +137,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
|
||||
/* report that the buffer was completely consumed */
|
||||
return buf_size;
|
||||
return avpkt->size;
|
||||
}
|
||||
|
||||
static av_cold int aasc_decode_end(AVCodecContext *avctx)
|
||||
|
@@ -131,6 +131,9 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
|
||||
int band_start, band_end, begin, end1;
|
||||
int lowcomp, fastleak, slowleak;
|
||||
|
||||
if (end <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* excitation function */
|
||||
band_start = ff_ac3_bin_to_band_tab[start];
|
||||
band_end = ff_ac3_bin_to_band_tab[end-1] + 1;
|
||||
|
@@ -872,7 +872,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
start_subband += start_subband - 7;
|
||||
end_subband = get_bits(gbc, 3) + 5;
|
||||
#if USE_FIXED
|
||||
s->spx_dst_end_freq = end_freq_inv_tab[end_subband];
|
||||
s->spx_dst_end_freq = end_freq_inv_tab[end_subband-5];
|
||||
#endif
|
||||
if (end_subband > 7)
|
||||
end_subband += end_subband - 7;
|
||||
@@ -902,11 +902,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
ff_eac3_default_spx_band_struct,
|
||||
&s->num_spx_bands,
|
||||
s->spx_band_sizes);
|
||||
} else {
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!s->eac3 || !s->spx_in_use) {
|
||||
s->spx_in_use = 0;
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,7 +941,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
nblend = 0;
|
||||
sblend = 0x800000;
|
||||
} else if (nratio > 0x7fffff) {
|
||||
nblend = 0x800000;
|
||||
nblend = 14529495; // sqrt(3) in FP.23
|
||||
sblend = 0;
|
||||
} else {
|
||||
nblend = fixed_sqrt(nratio, 23);
|
||||
|
@@ -243,19 +243,19 @@ typedef struct AC3DecodeContext {
|
||||
* Parse the E-AC-3 frame header.
|
||||
* This parses both the bit stream info and audio frame header.
|
||||
*/
|
||||
int ff_eac3_parse_header(AC3DecodeContext *s);
|
||||
static int ff_eac3_parse_header(AC3DecodeContext *s);
|
||||
|
||||
/**
|
||||
* Decode mantissas in a single channel for the entire frame.
|
||||
* This is used when AHT mode is enabled.
|
||||
*/
|
||||
void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
|
||||
static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
|
||||
|
||||
/**
|
||||
* Apply spectral extension to each channel by copying lower frequency
|
||||
* coefficients to higher frequency bins and applying side information to
|
||||
* approximate the original high frequency signal.
|
||||
*/
|
||||
void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
|
||||
static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
|
||||
|
||||
#endif /* AVCODEC_AC3DEC_H */
|
||||
|
@@ -164,6 +164,7 @@ static void ac3_downmix_c_fixed16(int16_t **samples, int16_t (*matrix)[2],
|
||||
}
|
||||
}
|
||||
|
||||
#include "eac3dec.c"
|
||||
#include "ac3dec.c"
|
||||
|
||||
static const AVOption options[] = {
|
||||
|
@@ -28,6 +28,7 @@
|
||||
* Upmix delay samples from stereo to original channel layout.
|
||||
*/
|
||||
#include "ac3dec.h"
|
||||
#include "eac3dec.c"
|
||||
#include "ac3dec.c"
|
||||
|
||||
static const AVOption options[] = {
|
||||
|
@@ -578,6 +578,8 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
|
||||
case AV_CODEC_ID_ADPCM_IMA_DK4:
|
||||
if (avctx->block_align > 0)
|
||||
buf_size = FFMIN(buf_size, avctx->block_align);
|
||||
if (buf_size < 4 * ch)
|
||||
return AVERROR_INVALIDDATA;
|
||||
nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch;
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_IMA_RAD:
|
||||
@@ -591,13 +593,15 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
|
||||
int bsamples = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2];
|
||||
if (avctx->block_align > 0)
|
||||
buf_size = FFMIN(buf_size, avctx->block_align);
|
||||
if (buf_size < 4 * ch)
|
||||
return AVERROR_INVALIDDATA;
|
||||
nb_samples = 1 + (buf_size - 4 * ch) / (bsize * ch) * bsamples;
|
||||
break;
|
||||
}
|
||||
case AV_CODEC_ID_ADPCM_MS:
|
||||
if (avctx->block_align > 0)
|
||||
buf_size = FFMIN(buf_size, avctx->block_align);
|
||||
nb_samples = 2 + (buf_size - 7 * ch) * 2 / ch;
|
||||
nb_samples = (buf_size - 6 * ch) * 2 / ch;
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_SBPRO_2:
|
||||
case AV_CODEC_ID_ADPCM_SBPRO_3:
|
||||
@@ -610,6 +614,8 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
|
||||
case AV_CODEC_ID_ADPCM_SBPRO_4: samples_per_byte = 2; break;
|
||||
}
|
||||
if (!s->status[0].step_index) {
|
||||
if (buf_size < ch)
|
||||
return AVERROR_INVALIDDATA;
|
||||
nb_samples++;
|
||||
buf_size -= ch;
|
||||
}
|
||||
@@ -1528,6 +1534,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
if (avpkt->size < bytestream2_tell(&gb)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Overread of %d < %d\n", avpkt->size, bytestream2_tell(&gb));
|
||||
return avpkt->size;
|
||||
}
|
||||
|
||||
return bytestream2_tell(&gb);
|
||||
}
|
||||
|
||||
|
@@ -316,6 +316,11 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
int lpc_quant[2];
|
||||
int rice_history_mult[2];
|
||||
|
||||
if (!alac->rice_limit) {
|
||||
avpriv_request_sample(alac->avctx, "Compression with rice limit 0");
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
decorr_shift = get_bits(&alac->gb, 8);
|
||||
decorr_left_weight = get_bits(&alac->gb, 8);
|
||||
|
||||
@@ -528,6 +533,12 @@ static int allocate_buffers(ALACContext *alac)
|
||||
int ch;
|
||||
int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
|
||||
|
||||
for (ch = 0; ch < 2; ch++) {
|
||||
alac->predict_error_buffer[ch] = NULL;
|
||||
alac->output_samples_buffer[ch] = NULL;
|
||||
alac->extra_bits_buffer[ch] = NULL;
|
||||
}
|
||||
|
||||
for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
|
||||
FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],
|
||||
buf_size, buf_alloc_fail);
|
||||
|
@@ -357,11 +357,15 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
|
||||
|
||||
ctx->cs_switch = 1;
|
||||
|
||||
for (i = 0; i < avctx->channels; i++) {
|
||||
sconf->chan_pos[i] = -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < avctx->channels; i++) {
|
||||
int idx;
|
||||
|
||||
idx = get_bits(&gb, chan_pos_bits);
|
||||
if (idx >= avctx->channels) {
|
||||
if (idx >= avctx->channels || sconf->chan_pos[idx] != -1) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Invalid channel reordering.\n");
|
||||
ctx->cs_switch = 0;
|
||||
break;
|
||||
@@ -678,7 +682,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
|
||||
|
||||
|
||||
if (!sconf->rlslms) {
|
||||
if (sconf->adapt_order) {
|
||||
if (sconf->adapt_order && sconf->max_order) {
|
||||
int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1,
|
||||
2, sconf->max_order + 1));
|
||||
*bd->opt_order = get_bits(gb, opt_order_length);
|
||||
@@ -1242,6 +1246,7 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
|
||||
ALSChannelData *ch = cd[c];
|
||||
unsigned int dep = 0;
|
||||
unsigned int channels = ctx->avctx->channels;
|
||||
unsigned int channel_size = ctx->sconf.frame_length + ctx->sconf.max_order;
|
||||
|
||||
if (reverted[c])
|
||||
return 0;
|
||||
@@ -1272,9 +1277,9 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
|
||||
bd->raw_samples = ctx->raw_samples[c] + offset;
|
||||
|
||||
for (dep = 0; !ch[dep].stop_flag; dep++) {
|
||||
unsigned int smp;
|
||||
unsigned int begin = 1;
|
||||
unsigned int end = bd->block_length - 1;
|
||||
ptrdiff_t smp;
|
||||
ptrdiff_t begin = 1;
|
||||
ptrdiff_t end = bd->block_length - 1;
|
||||
int64_t y;
|
||||
int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset;
|
||||
|
||||
@@ -1286,11 +1291,28 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
|
||||
|
||||
if (ch[dep].time_diff_sign) {
|
||||
t = -t;
|
||||
if (begin < t) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "begin %td smaller than time diff index %d.\n", begin, t);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
begin -= t;
|
||||
} else {
|
||||
if (end < t) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "end %td smaller than time diff index %d.\n", end, t);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
end -= t;
|
||||
}
|
||||
|
||||
if (FFMIN(begin - 1, begin - 1 + t) < ctx->raw_buffer - master ||
|
||||
FFMAX(end + 1, end + 1 + t) > ctx->raw_buffer + channels * channel_size - master) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR,
|
||||
"sample pointer range [%p, %p] not contained in raw_buffer [%p, %p].\n",
|
||||
master + FFMIN(begin - 1, begin - 1 + t), master + FFMAX(end + 1, end + 1 + t),
|
||||
ctx->raw_buffer, ctx->raw_buffer + channels * channel_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (smp = begin; smp < end; smp++) {
|
||||
y = (1 << 6) +
|
||||
MUL64(ch[dep].weighting[0], master[smp - 1 ]) +
|
||||
@@ -1303,6 +1325,16 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
|
||||
bd->raw_samples[smp] += y >> 7;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (begin - 1 < ctx->raw_buffer - master ||
|
||||
end + 1 > ctx->raw_buffer + channels * channel_size - master) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR,
|
||||
"sample pointer range [%p, %p] not contained in raw_buffer [%p, %p].\n",
|
||||
master + begin - 1, master + end + 1,
|
||||
ctx->raw_buffer, ctx->raw_buffer + channels * channel_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (smp = begin; smp < end; smp++) {
|
||||
y = (1 << 6) +
|
||||
MUL64(ch[dep].weighting[0], master[smp - 1]) +
|
||||
@@ -1461,6 +1493,11 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
|
||||
|
||||
// TODO: read_diff_float_data
|
||||
|
||||
if (get_bits_left(gb) < 0) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "Overread %d\n", -get_bits_left(gb));
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1666,6 +1703,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
avctx->sample_fmt = sconf->resolution > 1
|
||||
? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
|
||||
avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8;
|
||||
if (avctx->bits_per_raw_sample > 32) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Bits per raw sample %d larger than 32.\n",
|
||||
avctx->bits_per_raw_sample);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
// set maximum Rice parameter for progressive decoding based on resolution
|
||||
@@ -1728,9 +1771,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
|
||||
// allocate and assign channel data buffer for mcc mode
|
||||
if (sconf->mc_coding) {
|
||||
ctx->chan_data_buffer = av_malloc(sizeof(*ctx->chan_data_buffer) *
|
||||
ctx->chan_data_buffer = av_mallocz(sizeof(*ctx->chan_data_buffer) *
|
||||
num_buffers * num_buffers);
|
||||
ctx->chan_data = av_malloc(sizeof(*ctx->chan_data) *
|
||||
ctx->chan_data = av_mallocz(sizeof(*ctx->chan_data) *
|
||||
num_buffers);
|
||||
ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
|
||||
num_buffers);
|
||||
|
@@ -592,14 +592,14 @@ static void decode_array_0000(APEContext *ctx, GetBitContext *gb,
|
||||
int ksummax, ksummin;
|
||||
|
||||
rice->ksum = 0;
|
||||
for (i = 0; i < 5; i++) {
|
||||
for (i = 0; i < FFMIN(blockstodecode, 5); i++) {
|
||||
out[i] = get_rice_ook(&ctx->gb, 10);
|
||||
rice->ksum += out[i];
|
||||
}
|
||||
rice->k = av_log2(rice->ksum / 10) + 1;
|
||||
if (rice->k >= 24)
|
||||
return;
|
||||
for (; i < 64; i++) {
|
||||
for (; i < FFMIN(blockstodecode, 64); i++) {
|
||||
out[i] = get_rice_ook(&ctx->gb, rice->k);
|
||||
rice->ksum += out[i];
|
||||
rice->k = av_log2(rice->ksum / ((i + 1) * 2)) + 1;
|
||||
@@ -892,6 +892,9 @@ static void long_filter_high_3800(int32_t *buffer, int order, int shift, int len
|
||||
int32_t dotprod, sign;
|
||||
int32_t coeffs[256], delay[256];
|
||||
|
||||
if (order >= length)
|
||||
return;
|
||||
|
||||
memset(coeffs, 0, order * sizeof(*coeffs));
|
||||
for (i = 0; i < order; i++)
|
||||
delay[i] = buffer[i];
|
||||
@@ -1369,7 +1372,7 @@ static void ape_unpack_stereo(APEContext *ctx, int count)
|
||||
int32_t *decoded0 = ctx->decoded[0];
|
||||
int32_t *decoded1 = ctx->decoded[1];
|
||||
|
||||
if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
|
||||
if ((ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) == APE_FRAMECODE_STEREO_SILENCE) {
|
||||
/* We are pure silence, so we're done. */
|
||||
av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence stereo\n");
|
||||
return;
|
||||
@@ -1461,13 +1464,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
|
||||
nblocks);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->samples = nblocks;
|
||||
|
||||
/* Initialize the frame decoder */
|
||||
if (init_frame_decoder(s) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error reading frame header\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->samples = nblocks;
|
||||
}
|
||||
|
||||
if (!s->data) {
|
||||
|
@@ -37,6 +37,7 @@ OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o
|
||||
OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \
|
||||
arm/flacdsp_arm.o
|
||||
OBJS-$(CONFIG_FLAC_ENCODER) += arm/flacdsp_init_arm.o
|
||||
OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o
|
||||
OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o
|
||||
OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
|
||||
|
26
libavcodec/arm/hevcdsp_arm.h
Normal file
26
libavcodec/arm/hevcdsp_arm.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_ARM_HEVCDSP_ARM_H
|
||||
#define AVCODEC_ARM_HEVCDSP_ARM_H
|
||||
|
||||
#include "libavcodec/hevcdsp.h"
|
||||
|
||||
void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth);
|
||||
|
||||
#endif /* AVCODEC_ARM_HEVCDSP_ARM_H */
|
32
libavcodec/arm/hevcdsp_init_arm.c
Normal file
32
libavcodec/arm/hevcdsp_init_arm.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Seppo Tomperi <seppo.tomperi@vtt.fi>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/hevcdsp.h"
|
||||
#include "hevcdsp_arm.h"
|
||||
|
||||
av_cold void ff_hevcdsp_init_arm(HEVCDSPContext *c, const int bit_depth)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
ff_hevcdsp_init_neon(c, bit_depth);
|
||||
}
|
@@ -21,6 +21,7 @@
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/hevcdsp.h"
|
||||
#include "hevcdsp_arm.h"
|
||||
|
||||
void ff_hevc_v_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
|
||||
void ff_hevc_h_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
|
||||
@@ -141,9 +142,8 @@ void ff_hevc_put_qpel_bi_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t
|
||||
put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE);
|
||||
}
|
||||
|
||||
static av_cold void hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)
|
||||
av_cold void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)
|
||||
{
|
||||
#if HAVE_NEON
|
||||
if (bit_depth == 8) {
|
||||
int x;
|
||||
c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_neon;
|
||||
@@ -221,13 +221,4 @@ static av_cold void hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth)
|
||||
c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_qpel_uw_pixels_w48_neon_8;
|
||||
c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_qpel_uw_pixels_w64_neon_8;
|
||||
}
|
||||
#endif // HAVE_NEON
|
||||
}
|
||||
|
||||
void ff_hevcdsp_init_arm(HEVCDSPContext *c, const int bit_depth)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
hevcdsp_init_neon(c, bit_depth);
|
||||
}
|
||||
|
@@ -523,7 +523,7 @@ ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style)
|
||||
if (!style || !*style)
|
||||
style = "Default";
|
||||
for (i=0; i<ass->styles_count; i++)
|
||||
if (!strcmp(ass->styles[i].name, style))
|
||||
if (ass->styles[i].name && !strcmp(ass->styles[i].name, style))
|
||||
return ass->styles + i;
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -381,7 +381,7 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
return avctx->block_align;
|
||||
return FFMIN(avctx->block_align, avpkt->size);
|
||||
}
|
||||
|
||||
AVCodec ff_atrac3p_decoder = {
|
||||
|
@@ -599,8 +599,8 @@ void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist,
|
||||
const float *in, float *out)
|
||||
{
|
||||
int i, s, sb, t, pos_now, pos_next;
|
||||
DECLARE_ALIGNED(32, float, idct_in)[ATRAC3P_SUBBANDS];
|
||||
DECLARE_ALIGNED(32, float, idct_out)[ATRAC3P_SUBBANDS];
|
||||
LOCAL_ALIGNED(32, float, idct_in, [ATRAC3P_SUBBANDS]);
|
||||
LOCAL_ALIGNED(32, float, idct_out, [ATRAC3P_SUBBANDS]);
|
||||
|
||||
memset(out, 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out));
|
||||
|
||||
|
@@ -58,6 +58,7 @@ void av_init_packet(AVPacket *pkt)
|
||||
#if FF_API_DESTRUCT_PACKET
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
pkt->destruct = NULL;
|
||||
pkt->priv = NULL;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
pkt->buf = NULL;
|
||||
@@ -387,10 +388,12 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p = pkt->data + pkt->size - 8 - 5;
|
||||
for (i=1; ; i++){
|
||||
size = AV_RB32(p);
|
||||
if (size>INT_MAX || p - pkt->data < size)
|
||||
if (size>INT_MAX - 5 || p - pkt->data < size)
|
||||
return 0;
|
||||
if (p[4]&128)
|
||||
break;
|
||||
if (p - pkt->data < size + 5)
|
||||
return 0;
|
||||
p-= size+5;
|
||||
}
|
||||
|
||||
@@ -401,7 +404,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 + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
pkt->side_data[i].size = size;
|
||||
pkt->side_data[i].type = p[4]&127;
|
||||
|
@@ -69,6 +69,8 @@ void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
|
||||
if (length == 0)
|
||||
return;
|
||||
|
||||
av_assert0(length <= put_bits_left(pb));
|
||||
|
||||
if (CONFIG_SMALL || words < 16 || put_bits_count(pb) & 7) {
|
||||
for (i = 0; i < words; i++)
|
||||
put_bits(pb, 16, AV_RB16(src + 2 * i));
|
||||
|
@@ -63,7 +63,7 @@ restart:
|
||||
continue;
|
||||
}
|
||||
bpc->pc.frame_start_found++;
|
||||
bpc->remaining_size = bpc->fsize + i - 17;
|
||||
bpc->remaining_size = bpc->fsize + FFMAX(i - 17, 0);
|
||||
|
||||
if (bpc->pc.index + i > 17) {
|
||||
next = i - 17;
|
||||
|
@@ -71,8 +71,10 @@ static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g) \
|
||||
} \
|
||||
static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \
|
||||
{ \
|
||||
if (g->buffer_end - g->buffer < bytes) \
|
||||
if (g->buffer_end - g->buffer < bytes) { \
|
||||
g->buffer = g->buffer_end; \
|
||||
return 0; \
|
||||
} \
|
||||
return bytestream2_get_ ## name ## u(g); \
|
||||
} \
|
||||
static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \
|
||||
|
@@ -51,7 +51,7 @@ void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size){
|
||||
*
|
||||
* @param buf_size size of buf in bits
|
||||
*/
|
||||
void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
c->bytestream_start=
|
||||
c->bytestream= buf;
|
||||
c->bytestream_end= buf + buf_size;
|
||||
@@ -64,6 +64,9 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
#endif
|
||||
c->low+= ((*c->bytestream++)<<2) + 2;
|
||||
c->range= 0x1FE;
|
||||
if ((c->range<<(CABAC_BITS+1)) < c->low)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ff_init_cabac_states(void)
|
||||
|
@@ -56,7 +56,7 @@ typedef struct CABACContext{
|
||||
}CABACContext;
|
||||
|
||||
void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size);
|
||||
void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
|
||||
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
|
||||
void ff_init_cabac_states(void);
|
||||
|
||||
#endif /* AVCODEC_CABAC_H */
|
||||
|
@@ -74,7 +74,8 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
|
||||
|
||||
#ifndef get_cabac_inline
|
||||
static void refill2(CABACContext *c){
|
||||
int i, x;
|
||||
int i;
|
||||
unsigned x;
|
||||
|
||||
x= c->low ^ (c->low-1);
|
||||
i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)];
|
||||
@@ -190,7 +191,8 @@ static av_unused const uint8_t* skip_bytes(CABACContext *c, int n) {
|
||||
#endif
|
||||
if ((int) (c->bytestream_end - ptr) < n)
|
||||
return NULL;
|
||||
ff_init_cabac_decoder(c, ptr + n, c->bytestream_end - ptr - n);
|
||||
if (ff_init_cabac_decoder(c, ptr + n, c->bytestream_end - ptr - n) < 0)
|
||||
return NULL;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
@@ -563,6 +563,11 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
esc_code = get_ue_code(gb, esc_golomb_order);
|
||||
if (esc_code < 0 || esc_code > 32767) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "esc_code invalid\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
|
||||
while (level > r->inc_limit)
|
||||
r++;
|
||||
@@ -1118,6 +1123,7 @@ static int decode_seq_header(AVSContext *h)
|
||||
{
|
||||
int frame_rate_code;
|
||||
int width, height;
|
||||
int ret;
|
||||
|
||||
h->profile = get_bits(&h->gb, 8);
|
||||
h->level = get_bits(&h->gb, 8);
|
||||
@@ -1134,9 +1140,6 @@ static int decode_seq_header(AVSContext *h)
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Dimensions invalid\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
h->width = width;
|
||||
h->height = height;
|
||||
|
||||
skip_bits(&h->gb, 2); //chroma format
|
||||
skip_bits(&h->gb, 3); //sample_precision
|
||||
h->aspect_ratio = get_bits(&h->gb, 4);
|
||||
@@ -1145,11 +1148,16 @@ static int decode_seq_header(AVSContext *h)
|
||||
skip_bits1(&h->gb); //marker_bit
|
||||
skip_bits(&h->gb, 12); //bit_rate_upper
|
||||
h->low_delay = get_bits1(&h->gb);
|
||||
|
||||
ret = ff_set_dimensions(h->avctx, width, height);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
h->width = width;
|
||||
h->height = height;
|
||||
h->mb_width = (h->width + 15) >> 4;
|
||||
h->mb_height = (h->height + 15) >> 4;
|
||||
h->avctx->framerate = ff_mpeg12_frame_rate_tab[frame_rate_code];
|
||||
h->avctx->width = h->width;
|
||||
h->avctx->height = h->height;
|
||||
if (!h->top_qp)
|
||||
return ff_cavs_init_top_lines(h);
|
||||
return 0;
|
||||
|
@@ -41,8 +41,6 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
|
||||
{
|
||||
uint32_t mrk;
|
||||
int i, tmp;
|
||||
const uint16_t *ssrc = (const uint16_t *) src;
|
||||
uint16_t *sdst = (uint16_t *) dst;
|
||||
PutBitContext pb;
|
||||
|
||||
if ((unsigned) src_size > (unsigned) max_size)
|
||||
@@ -54,8 +52,11 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
|
||||
memcpy(dst, src, src_size);
|
||||
return src_size;
|
||||
case DCA_SYNCWORD_CORE_LE:
|
||||
for (i = 0; i < (src_size + 1) >> 1; i++)
|
||||
*sdst++ = av_bswap16(*ssrc++);
|
||||
for (i = 0; i < (src_size + 1) >> 1; i++) {
|
||||
AV_WB16(dst, AV_RL16(src));
|
||||
src += 2;
|
||||
dst += 2;
|
||||
}
|
||||
return src_size;
|
||||
case DCA_SYNCWORD_CORE_14B_BE:
|
||||
case DCA_SYNCWORD_CORE_14B_LE:
|
||||
|
@@ -226,6 +226,14 @@ static int dca_parse_audio_coding_header(DCAContext *s, int base_channel,
|
||||
}
|
||||
|
||||
nchans = get_bits(&s->gb, 3) + 1;
|
||||
if (xxch && nchans >= 3) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "nchans %d is too large\n", nchans);
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else if (nchans + base_channel > DCA_PRIM_CHANNELS_MAX) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "channel sum %d + %d is too large\n", nchans, base_channel);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->total_channels = nchans + base_channel;
|
||||
s->prim_channels = s->total_channels;
|
||||
|
||||
@@ -426,6 +434,10 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
|
||||
|
||||
if (!base_channel) {
|
||||
s->subsubframes[s->current_subframe] = get_bits(&s->gb, 2) + 1;
|
||||
if (block_index + s->subsubframes[s->current_subframe] > s->sample_blocks/8) {
|
||||
s->subsubframes[s->current_subframe] = 1;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->partial_samples[s->current_subframe] = get_bits(&s->gb, 3);
|
||||
}
|
||||
|
||||
@@ -1120,8 +1132,13 @@ int ff_dca_xbr_parse_frame(DCAContext *s)
|
||||
for(i = 0; i < num_chsets; i++) {
|
||||
n_xbr_ch[i] = get_bits(&s->gb, 3) + 1;
|
||||
k = get_bits(&s->gb, 2) + 5;
|
||||
for(j = 0; j < n_xbr_ch[i]; j++)
|
||||
for(j = 0; j < n_xbr_ch[i]; j++) {
|
||||
active_bands[i][j] = get_bits(&s->gb, k) + 1;
|
||||
if (active_bands[i][j] > DCA_SUBBANDS) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "too many active subbands (%d)\n", active_bands[i][j]);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* skip to the end of the header */
|
||||
@@ -1163,23 +1180,34 @@ int ff_dca_xbr_parse_frame(DCAContext *s)
|
||||
for(i = 0; i < n_xbr_ch[chset]; i++) {
|
||||
const uint32_t *scale_table;
|
||||
int nbits;
|
||||
int scale_table_size;
|
||||
|
||||
if (s->scalefactor_huffman[chan_base+i] == 6) {
|
||||
scale_table = ff_dca_scale_factor_quant7;
|
||||
scale_table_size = FF_ARRAY_ELEMS(ff_dca_scale_factor_quant7);
|
||||
} else {
|
||||
scale_table = ff_dca_scale_factor_quant6;
|
||||
scale_table_size = FF_ARRAY_ELEMS(ff_dca_scale_factor_quant6);
|
||||
}
|
||||
|
||||
nbits = anctemp[i];
|
||||
|
||||
for(j = 0; j < active_bands[chset][i]; j++) {
|
||||
if(abits_high[i][j] > 0) {
|
||||
scale_table_high[i][j][0] =
|
||||
scale_table[get_bits(&s->gb, nbits)];
|
||||
int index = get_bits(&s->gb, nbits);
|
||||
if (index >= scale_table_size) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "scale table index %d invalid\n", index);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
scale_table_high[i][j][0] = scale_table[index];
|
||||
|
||||
if(xbr_tmode && s->transition_mode[i][j]) {
|
||||
scale_table_high[i][j][1] =
|
||||
scale_table[get_bits(&s->gb, nbits)];
|
||||
int index = get_bits(&s->gb, nbits);
|
||||
if (index >= scale_table_size) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "scale table index %d invalid\n", index);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
scale_table_high[i][j][1] = scale_table[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -939,6 +939,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
for (i = 0; i < SUBFRAMES; i++)
|
||||
put_subframe(c, i);
|
||||
|
||||
|
||||
for (i = put_bits_count(&c->pb); i < 8*c->frame_size; i++)
|
||||
put_bits(&c->pb, 1, 0);
|
||||
|
||||
flush_put_bits(&c->pb);
|
||||
|
||||
avpkt->pts = frame->pts;
|
||||
|
@@ -100,10 +100,12 @@ typedef struct DiracParseUnit {
|
||||
static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
|
||||
int offset)
|
||||
{
|
||||
uint8_t *start = pc->buffer + offset;
|
||||
uint8_t *end = pc->buffer + pc->index;
|
||||
if (start < pc->buffer || (start + 13 > end))
|
||||
int8_t *start;
|
||||
|
||||
if (offset < 0 || pc->index - 13 < offset)
|
||||
return 0;
|
||||
|
||||
start = pc->buffer + offset;
|
||||
pu->pu_type = start[4];
|
||||
|
||||
pu->next_pu_offset = AV_RB32(start + 5);
|
||||
@@ -112,6 +114,15 @@ static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
|
||||
if (pu->pu_type == 0x10 && pu->next_pu_offset == 0)
|
||||
pu->next_pu_offset = 13;
|
||||
|
||||
if (pu->next_pu_offset && pu->next_pu_offset < 13) {
|
||||
av_log(NULL, AV_LOG_ERROR, "next_pu_offset %d is invalid\n", pu->next_pu_offset);
|
||||
return 0;
|
||||
}
|
||||
if (pu->prev_pu_offset && pu->prev_pu_offset < 13) {
|
||||
av_log(NULL, AV_LOG_ERROR, "prev_pu_offset %d is invalid\n", pu->prev_pu_offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -123,7 +134,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
DiracParseContext *pc = s->priv_data;
|
||||
|
||||
if (pc->overread_index) {
|
||||
memcpy(pc->buffer, pc->buffer + pc->overread_index,
|
||||
memmove(pc->buffer, pc->buffer + pc->overread_index,
|
||||
pc->index - pc->overread_index);
|
||||
pc->index -= pc->overread_index;
|
||||
pc->overread_index = 0;
|
||||
@@ -190,7 +201,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
/* Get the picture number to set the pts and dts*/
|
||||
if (parse_timing_info) {
|
||||
if (parse_timing_info && pu1.prev_pu_offset >= 13) {
|
||||
uint8_t *cur_pu = pc->buffer +
|
||||
pc->index - 13 - pu1.prev_pu_offset;
|
||||
int pts = AV_RB32(cur_pu + 13);
|
||||
|
@@ -801,7 +801,10 @@ static int decode_lowdelay(DiracContext *s)
|
||||
slice_num++;
|
||||
|
||||
buf += bytes;
|
||||
bufsize -= bytes*8;
|
||||
if (bufsize/8 >= bytes)
|
||||
bufsize -= bytes*8;
|
||||
else
|
||||
bufsize = 0;
|
||||
}
|
||||
|
||||
avctx->execute(avctx, decode_lowdelay_slice, slices, NULL, slice_num,
|
||||
@@ -899,6 +902,14 @@ static int dirac_unpack_prediction_parameters(DiracContext *s)
|
||||
/*[DIRAC_STD] 11.2.4 motion_data_dimensions()
|
||||
Calculated in function dirac_unpack_block_motion_data */
|
||||
|
||||
if (s->plane[0].xblen % (1 << s->chroma_x_shift) != 0 ||
|
||||
s->plane[0].yblen % (1 << s->chroma_y_shift) != 0 ||
|
||||
!s->plane[0].xblen || !s->plane[0].yblen) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"invalid x/y block length (%d/%d) for x/y chroma shift (%d/%d)\n",
|
||||
s->plane[0].xblen, s->plane[0].yblen, s->chroma_x_shift, s->chroma_y_shift);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (!s->plane[0].xbsep || !s->plane[0].ybsep || s->plane[0].xbsep < s->plane[0].xblen/2 || s->plane[0].ybsep < s->plane[0].yblen/2) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Block separation too small\n");
|
||||
return -1;
|
||||
@@ -1553,7 +1564,7 @@ static void select_dsp_funcs(DiracContext *s, int width, int height, int xblen,
|
||||
}
|
||||
}
|
||||
|
||||
static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height)
|
||||
static int interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height)
|
||||
{
|
||||
/* chroma allocates an edge of 8 when subsampled
|
||||
which for 4:2:2 means an h edge of 16 and v edge of 8
|
||||
@@ -1565,11 +1576,14 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in
|
||||
|
||||
/* no need for hpel if we only have fpel vectors */
|
||||
if (!s->mv_precision)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
for (i = 1; i < 4; i++) {
|
||||
if (!ref->hpel_base[plane][i])
|
||||
ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->avframe->linesize[plane] + 32);
|
||||
if (!ref->hpel_base[plane][i]) {
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
/* we need to be 16-byte aligned even for chroma */
|
||||
ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->avframe->linesize[plane] + 16;
|
||||
}
|
||||
@@ -1583,6 +1597,8 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in
|
||||
s->mpvencdsp.draw_edges(ref->hpel[plane][3], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);
|
||||
}
|
||||
ref->interpolated[plane] = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1635,8 +1651,11 @@ static int dirac_decode_frame_internal(DiracContext *s)
|
||||
|
||||
select_dsp_funcs(s, p->width, p->height, p->xblen, p->yblen);
|
||||
|
||||
for (i = 0; i < s->num_refs; i++)
|
||||
interpolate_refplane(s, s->ref_pics[i], comp, p->width, p->height);
|
||||
for (i = 0; i < s->num_refs; i++) {
|
||||
int ret = interpolate_refplane(s, s->ref_pics[i], comp, p->width, p->height);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
memset(s->mctmp, 0, 4*p->yoffset*p->stride);
|
||||
|
||||
@@ -1742,6 +1761,12 @@ static int dirac_decode_picture_header(DiracContext *s)
|
||||
get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!s->ref_pics[i]) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Reference could not be allocated\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* retire the reference frames that are not used anymore */
|
||||
@@ -1937,8 +1962,8 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
break;
|
||||
|
||||
data_unit_size = AV_RB32(buf+buf_idx+5);
|
||||
if (buf_idx + data_unit_size > buf_size || !data_unit_size) {
|
||||
if(buf_idx + data_unit_size > buf_size)
|
||||
if (data_unit_size > buf_size - buf_idx || !data_unit_size) {
|
||||
if(data_unit_size > buf_size - buf_idx)
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"Data unit with size %d is larger than input buffer, discarding\n",
|
||||
data_unit_size);
|
||||
|
@@ -119,6 +119,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
|
||||
static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
|
||||
static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
|
||||
int i, cid, ret;
|
||||
int old_bit_depth = ctx->bit_depth;
|
||||
|
||||
if (buf_size < 0x280) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "buffer too small (%d < 640).\n",
|
||||
@@ -143,10 +144,6 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
|
||||
|
||||
av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
|
||||
|
||||
if (!ctx->bit_depth) {
|
||||
ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
|
||||
ff_idctdsp_init(&ctx->idsp, ctx->avctx);
|
||||
}
|
||||
if (buf[0x21] == 0x58) { /* 10 bit */
|
||||
ctx->bit_depth = ctx->avctx->bits_per_raw_sample = 10;
|
||||
|
||||
@@ -157,17 +154,23 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
|
||||
} else {
|
||||
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
|
||||
ctx->is_444 = 0;
|
||||
}
|
||||
} else if (buf[0x21] == 0x38) { /* 8 bit */
|
||||
ctx->bit_depth = ctx->avctx->bits_per_raw_sample = 8;
|
||||
|
||||
ctx->pix_fmt = AV_PIX_FMT_YUV422P;
|
||||
ctx->is_444 = 0;
|
||||
ctx->decode_dct_block = dnxhd_decode_dct_block_8;
|
||||
} else {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "invalid bit depth value (%d).\n",
|
||||
buf[0x21]);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (ctx->bit_depth != old_bit_depth) {
|
||||
ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
|
||||
ff_idctdsp_init(&ctx->idsp, ctx->avctx);
|
||||
}
|
||||
|
||||
cid = AV_RB32(buf + 0x28);
|
||||
av_dlog(ctx->avctx, "compression id %d\n", cid);
|
||||
@@ -373,7 +376,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
dest_u = frame->data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
|
||||
dest_v = frame->data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
|
||||
|
||||
if (ctx->cur_field) {
|
||||
if (frame->interlaced_frame && ctx->cur_field) {
|
||||
dest_y += frame->linesize[0];
|
||||
dest_u += frame->linesize[1];
|
||||
dest_v += frame->linesize[2];
|
||||
|
@@ -348,11 +348,11 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
// For 12 bit, ignore alpha
|
||||
if (elements == 4)
|
||||
buf += 2;
|
||||
// Jump to next aligned position
|
||||
buf += need_align;
|
||||
}
|
||||
for (i = 0; i < 3; i++)
|
||||
ptr[i] += p->linesize[i];
|
||||
// Jump to next aligned position
|
||||
buf += need_align;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
|
@@ -75,17 +75,20 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define write16(p, value) \
|
||||
do { \
|
||||
if (s->big_endian) AV_WB16(p, value); \
|
||||
else AV_WL16(p, value); \
|
||||
} while(0)
|
||||
static av_always_inline void write16_internal(int big_endian, void *p, int value)
|
||||
{
|
||||
if (big_endian) AV_WB16(p, value);
|
||||
else AV_WL16(p, value);
|
||||
}
|
||||
|
||||
#define write32(p, value) \
|
||||
do { \
|
||||
if (s->big_endian) AV_WB32(p, value); \
|
||||
else AV_WL32(p, value); \
|
||||
} while(0)
|
||||
static av_always_inline void write32_internal(int big_endian, void *p, int value)
|
||||
{
|
||||
if (big_endian) AV_WB32(p, value);
|
||||
else AV_WL32(p, value);
|
||||
}
|
||||
|
||||
#define write16(p, value) write16_internal(s->big_endian, p, value)
|
||||
#define write32(p, value) write32_internal(s->big_endian, p, value)
|
||||
|
||||
static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst)
|
||||
{
|
||||
|
@@ -1197,8 +1197,12 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx,
|
||||
region->buf_size = region->width * region->height;
|
||||
|
||||
region->pbuf = av_malloc(region->buf_size);
|
||||
if (!region->pbuf)
|
||||
if (!region->pbuf) {
|
||||
region->buf_size =
|
||||
region->width =
|
||||
region->height = 0;
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
fill = 1;
|
||||
region->dirty = 0;
|
||||
@@ -1417,7 +1421,7 @@ static void save_display_set(DVBSubContext *ctx)
|
||||
|
||||
pbuf = av_malloc(width * height * 4);
|
||||
if (!pbuf)
|
||||
return AVERROR(ENOMEM);
|
||||
return;
|
||||
|
||||
for (display = ctx->display_list; display; display = display->next) {
|
||||
region = get_region(ctx, display->region_id);
|
||||
@@ -1499,10 +1503,10 @@ static int dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
|
||||
avctx->height = display_def->height;
|
||||
}
|
||||
|
||||
if (buf_size < 13)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (info_byte & 1<<3) { // display_window_flag
|
||||
if (buf_size < 13)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
display_def->x = bytestream_get_be16(&buf);
|
||||
display_def->width = bytestream_get_be16(&buf) - display_def->x + 1;
|
||||
display_def->y = bytestream_get_be16(&buf);
|
||||
|
@@ -333,7 +333,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
|
||||
dct_mode * 22 * 64 +
|
||||
(quant + ff_dv_quant_offset[class1]) * 64];
|
||||
}
|
||||
dc = dc << 2;
|
||||
dc = dc * 4;
|
||||
/* convert to unsigned because 128 is not added in the
|
||||
* standard IDCT */
|
||||
dc += 1024;
|
||||
|
@@ -346,7 +346,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
||||
}
|
||||
}
|
||||
the_end:
|
||||
if (offset1 >= 0) {
|
||||
if (offset1 >= 0 && offset2 >= 0) {
|
||||
int w, h;
|
||||
uint8_t *bitmap;
|
||||
|
||||
|
@@ -65,7 +65,7 @@ static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < avctx->width * avctx->height * 9LL / 8) {
|
||||
if (src_size < FFALIGN(avctx->width, 4) * FFALIGN(avctx->height, 4) * 9LL / 8) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y1, *Y2, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < avctx->width * avctx->height * 3LL / 2) {
|
||||
if (src_size < FFALIGN(avctx->width, 2) * FFALIGN(avctx->height, 2) * 3LL / 2) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ typedef enum {
|
||||
|
||||
#define EAC3_SR_CODE_REDUCED 3
|
||||
|
||||
void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
|
||||
static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
|
||||
{
|
||||
int bin, bnd, ch, i;
|
||||
uint8_t wrapflag[SPX_MAX_BANDS]={1,0,}, num_copy_sections, copy_sizes[SPX_MAX_BANDS];
|
||||
@@ -101,7 +101,7 @@ void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
|
||||
for (i = 0; i < num_copy_sections; i++) {
|
||||
memcpy(&s->transform_coeffs[ch][bin],
|
||||
&s->transform_coeffs[ch][s->spx_dst_start_freq],
|
||||
copy_sizes[i]*sizeof(float));
|
||||
copy_sizes[i]*sizeof(INTFLOAT));
|
||||
bin += copy_sizes[i];
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
|
||||
bin = s->spx_src_start_freq - 2;
|
||||
for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
|
||||
if (wrapflag[bnd]) {
|
||||
float *coeffs = &s->transform_coeffs[ch][bin];
|
||||
INTFLOAT *coeffs = &s->transform_coeffs[ch][bin];
|
||||
coeffs[0] *= atten_tab[0];
|
||||
coeffs[1] *= atten_tab[1];
|
||||
coeffs[2] *= atten_tab[2];
|
||||
@@ -142,6 +142,11 @@ void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
|
||||
for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
|
||||
float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN);
|
||||
float sscale = s->spx_signal_blend[ch][bnd];
|
||||
#if USE_FIXED
|
||||
// spx_noise_blend and spx_signal_blend are both FP.23
|
||||
nscale *= 1.0 / (1<<23);
|
||||
sscale *= 1.0 / (1<<23);
|
||||
#endif
|
||||
for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
|
||||
float noise = nscale * (int32_t)av_lfg_get(&s->dith_state);
|
||||
s->transform_coeffs[ch][bin] *= sscale;
|
||||
@@ -195,7 +200,7 @@ static void idct6(int pre_mant[6])
|
||||
pre_mant[5] = even0 - odd0;
|
||||
}
|
||||
|
||||
void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
|
||||
static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
|
||||
{
|
||||
int bin, blk, gs;
|
||||
int end_bap, gaq_mode;
|
||||
@@ -288,7 +293,7 @@ void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
|
||||
}
|
||||
}
|
||||
|
||||
int ff_eac3_parse_header(AC3DecodeContext *s)
|
||||
static int ff_eac3_parse_header(AC3DecodeContext *s)
|
||||
{
|
||||
int i, blk, ch;
|
||||
int ac3_exponent_strategy, parse_aht_info, parse_spx_atten_data;
|
||||
|
@@ -378,14 +378,19 @@ static void guess_mv(ERContext *s)
|
||||
#define MV_UNCHANGED 1
|
||||
const int mb_stride = s->mb_stride;
|
||||
const int mb_width = s->mb_width;
|
||||
const int mb_height = s->mb_height;
|
||||
int mb_height = s->mb_height;
|
||||
int i, depth, num_avail;
|
||||
int mb_x, mb_y, mot_step, mot_stride;
|
||||
|
||||
if (s->last_pic.f && s->last_pic.f->data[0])
|
||||
mb_height = FFMIN(mb_height, (s->last_pic.f->height+15)>>4);
|
||||
if (s->next_pic.f && s->next_pic.f->data[0])
|
||||
mb_height = FFMIN(mb_height, (s->next_pic.f->height+15)>>4);
|
||||
|
||||
set_mv_strides(s, &mot_step, &mot_stride);
|
||||
|
||||
num_avail = 0;
|
||||
for (i = 0; i < s->mb_num; i++) {
|
||||
for (i = 0; i < mb_width * mb_height; i++) {
|
||||
const int mb_xy = s->mb_index2xy[i];
|
||||
int f = 0;
|
||||
int error = s->error_status_table[mb_xy];
|
||||
@@ -410,7 +415,7 @@ static void guess_mv(ERContext *s)
|
||||
|
||||
if ((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) ||
|
||||
num_avail <= mb_width / 2) {
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
const int mb_xy = mb_x + mb_y * s->mb_stride;
|
||||
int mv_dir = (s->last_pic.f && s->last_pic.f->data[0]) ? MV_DIR_FORWARD : MV_DIR_BACKWARD;
|
||||
@@ -439,7 +444,7 @@ static void guess_mv(ERContext *s)
|
||||
int score_sum = 0;
|
||||
|
||||
changed = 0;
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
const int mb_xy = mb_x + mb_y * s->mb_stride;
|
||||
int mv_predictor[8][2] = { { 0 } };
|
||||
@@ -672,7 +677,7 @@ skip_last_mv:
|
||||
if (none_left)
|
||||
return;
|
||||
|
||||
for (i = 0; i < s->mb_num; i++) {
|
||||
for (i = 0; i < mb_width * mb_height; i++) {
|
||||
int mb_xy = s->mb_index2xy[i];
|
||||
if (fixed[mb_xy])
|
||||
fixed[mb_xy] = MV_FROZEN;
|
||||
|
@@ -322,7 +322,7 @@ static uint16_t reverse_lut(const uint8_t *bitmap, uint16_t *lut)
|
||||
|
||||
i = k - 1;
|
||||
|
||||
memset(lut + k * 2, 0, (USHORT_RANGE - k) * 2);
|
||||
memset(lut + k, 0, (USHORT_RANGE - k) * 2);
|
||||
|
||||
return i;
|
||||
}
|
||||
@@ -459,7 +459,7 @@ static int huf_build_dec_table(const uint64_t *hcode, int im,
|
||||
lc += 8; \
|
||||
}
|
||||
|
||||
#define get_code(po, rlc, c, lc, gb, out, oe) \
|
||||
#define get_code(po, rlc, c, lc, gb, out, oe, outb) \
|
||||
{ \
|
||||
if (po == rlc) { \
|
||||
if (lc < 8) \
|
||||
@@ -468,7 +468,7 @@ static int huf_build_dec_table(const uint64_t *hcode, int im,
|
||||
\
|
||||
cs = c >> lc; \
|
||||
\
|
||||
if (out + cs > oe) \
|
||||
if (out + cs > oe || out == outb) \
|
||||
return AVERROR_INVALIDDATA; \
|
||||
\
|
||||
s = out[-1]; \
|
||||
@@ -501,7 +501,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
|
||||
if (pl.len) {
|
||||
lc -= pl.len;
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe);
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe, outb);
|
||||
} else {
|
||||
int j;
|
||||
|
||||
@@ -518,7 +518,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
if ((hcode[pl.p[j]] >> 6) ==
|
||||
((c >> (lc - l)) & ((1LL << l) - 1))) {
|
||||
lc -= l;
|
||||
get_code(pl.p[j], rlc, c, lc, gb, out, oe);
|
||||
get_code(pl.p[j], rlc, c, lc, gb, out, oe, outb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -539,7 +539,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
|
||||
if (pl.len) {
|
||||
lc -= pl.len;
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe);
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe, outb);
|
||||
} else {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -1010,6 +1010,22 @@ static int decode_header(EXRContext *s)
|
||||
int current_channel_offset = 0;
|
||||
int magic_number, version, flags, i;
|
||||
|
||||
s->xmin = ~0;
|
||||
s->xmax = ~0;
|
||||
s->ymin = ~0;
|
||||
s->ymax = ~0;
|
||||
s->xdelta = ~0;
|
||||
s->ydelta = ~0;
|
||||
s->channel_offsets[0] = -1;
|
||||
s->channel_offsets[1] = -1;
|
||||
s->channel_offsets[2] = -1;
|
||||
s->channel_offsets[3] = -1;
|
||||
s->pixel_type = EXR_UNKNOWN;
|
||||
s->compression = EXR_UNKN;
|
||||
s->nb_channels = 0;
|
||||
s->w = 0;
|
||||
s->h = 0;
|
||||
|
||||
if (bytestream2_get_bytes_left(&s->gb) < 10) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Header too short to parse.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -1350,21 +1366,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
float one_gamma = 1.0f / s->gamma;
|
||||
|
||||
s->avctx = avctx;
|
||||
s->xmin = ~0;
|
||||
s->xmax = ~0;
|
||||
s->ymin = ~0;
|
||||
s->ymax = ~0;
|
||||
s->xdelta = ~0;
|
||||
s->ydelta = ~0;
|
||||
s->channel_offsets[0] = -1;
|
||||
s->channel_offsets[1] = -1;
|
||||
s->channel_offsets[2] = -1;
|
||||
s->channel_offsets[3] = -1;
|
||||
s->pixel_type = EXR_UNKNOWN;
|
||||
s->compression = EXR_UNKN;
|
||||
s->nb_channels = 0;
|
||||
s->w = 0;
|
||||
s->h = 0;
|
||||
|
||||
if (one_gamma > 0.9999f && one_gamma < 1.0001f) {
|
||||
for (i = 0; i < 65536; ++i)
|
||||
|
@@ -66,7 +66,7 @@ av_cold int ffv1_common_init(AVCodecContext *avctx)
|
||||
|
||||
av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
{
|
||||
int j;
|
||||
int j, i;
|
||||
|
||||
fs->plane_count = f->plane_count;
|
||||
fs->transparency = f->transparency;
|
||||
@@ -80,10 +80,15 @@ av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
if (!p->state)
|
||||
return AVERROR(ENOMEM);
|
||||
} else {
|
||||
if (!p->vlc_state)
|
||||
p->vlc_state = av_malloc_array(p->context_count, sizeof(VlcState));
|
||||
if (!p->vlc_state)
|
||||
return AVERROR(ENOMEM);
|
||||
if (!p->vlc_state) {
|
||||
p->vlc_state = av_mallocz_array(p->context_count, sizeof(VlcState));
|
||||
if (!p->vlc_state)
|
||||
return AVERROR(ENOMEM);
|
||||
for (i = 0; i < p->context_count; i++) {
|
||||
p->vlc_state[i].error_sum = 4;
|
||||
p->vlc_state[i].count = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +106,7 @@ av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
av_cold int ffv1_init_slices_state(FFV1Context *f)
|
||||
{
|
||||
int i, ret;
|
||||
for (i = 0; i < f->slice_count; i++) {
|
||||
for (i = 0; i < f->max_slice_count; i++) {
|
||||
FFV1Context *fs = f->slice_context[i];
|
||||
if ((ret = ffv1_init_slice_state(f, fs)) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -113,10 +118,10 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f)
|
||||
{
|
||||
int i;
|
||||
|
||||
f->slice_count = f->num_h_slices * f->num_v_slices;
|
||||
av_assert0(f->slice_count > 0);
|
||||
f->max_slice_count = f->num_h_slices * f->num_v_slices;
|
||||
av_assert0(f->max_slice_count > 0);
|
||||
|
||||
for (i = 0; i < f->slice_count; i++) {
|
||||
for (i = 0; i < f->max_slice_count; i++) {
|
||||
FFV1Context *fs = av_mallocz(sizeof(*fs));
|
||||
int sx = i % f->num_h_slices;
|
||||
int sy = i / f->num_h_slices;
|
||||
@@ -201,7 +206,7 @@ av_cold int ffv1_close(AVCodecContext *avctx)
|
||||
ff_thread_release_buffer(avctx, &s->last_picture);
|
||||
av_frame_free(&s->last_picture.f);
|
||||
|
||||
for (j = 0; j < s->slice_count; j++) {
|
||||
for (j = 0; j < s->max_slice_count; j++) {
|
||||
FFV1Context *fs = s->slice_context[j];
|
||||
for (i = 0; i < s->plane_count; i++) {
|
||||
PlaneContext *p = &fs->plane[i];
|
||||
@@ -215,14 +220,14 @@ av_cold int ffv1_close(AVCodecContext *avctx)
|
||||
av_freep(&avctx->stats_out);
|
||||
for (j = 0; j < s->quant_table_count; j++) {
|
||||
av_freep(&s->initial_states[j]);
|
||||
for (i = 0; i < s->slice_count; i++) {
|
||||
for (i = 0; i < s->max_slice_count; i++) {
|
||||
FFV1Context *sf = s->slice_context[i];
|
||||
av_freep(&sf->rc_stat2[j]);
|
||||
}
|
||||
av_freep(&s->rc_stat2[j]);
|
||||
}
|
||||
|
||||
for (i = 0; i < s->slice_count; i++)
|
||||
for (i = 0; i < s->max_slice_count; i++)
|
||||
av_freep(&s->slice_context[i]);
|
||||
|
||||
return 0;
|
||||
|
@@ -117,6 +117,7 @@ typedef struct FFV1Context {
|
||||
|
||||
struct FFV1Context *slice_context[MAX_SLICES];
|
||||
int slice_count;
|
||||
int max_slice_count;
|
||||
int num_v_slices;
|
||||
int num_h_slices;
|
||||
int slice_width;
|
||||
|
@@ -47,8 +47,11 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
|
||||
else {
|
||||
int i, e, a;
|
||||
e = 0;
|
||||
while (get_rac(c, state + 1 + FFMIN(e, 9))) // 1..10
|
||||
while (get_rac(c, state + 1 + FFMIN(e, 9))) { // 1..10
|
||||
e++;
|
||||
if (e > 31)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
a = 1;
|
||||
for (i = e - 1; i >= 0; i--)
|
||||
@@ -303,7 +306,7 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
|
||||
for (i = 0; i < f->plane_count; i++) {
|
||||
PlaneContext * const p = &fs->plane[i];
|
||||
int idx = get_symbol(c, state, 0);
|
||||
if (idx > (unsigned)f->quant_table_count) {
|
||||
if (idx >= (unsigned)f->quant_table_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -406,6 +409,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
|
||||
if (ffv1_init_slice_state(f, fs) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
if (decode_slice_header(f, fs) < 0) {
|
||||
fs->slice_x = fs->slice_y = fs->slice_height = fs->slice_width = 0;
|
||||
fs->slice_damaged = 1;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -500,7 +504,10 @@ static int read_quant_tables(RangeCoder *c,
|
||||
int context_count = 1;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
context_count *= read_quant_table(c, quant_table[i], context_count);
|
||||
int ret = read_quant_table(c, quant_table[i], context_count);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
context_count *= ret;
|
||||
if (context_count > 32768U) {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -546,6 +553,12 @@ static int read_extra_header(FFV1Context *f)
|
||||
f->num_h_slices = 1 + get_symbol(c, state, 0);
|
||||
f->num_v_slices = 1 + get_symbol(c, state, 0);
|
||||
|
||||
if (f->chroma_h_shift > 4U || f->chroma_v_shift > 4U) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "chroma shift parameters %d %d are invalid\n",
|
||||
f->chroma_h_shift, f->chroma_v_shift);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (f->num_h_slices > (unsigned)f->width || !f->num_h_slices ||
|
||||
f->num_v_slices > (unsigned)f->height || !f->num_v_slices
|
||||
) {
|
||||
@@ -554,8 +567,11 @@ static int read_extra_header(FFV1Context *f)
|
||||
}
|
||||
|
||||
f->quant_table_count = get_symbol(c, state, 0);
|
||||
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES)
|
||||
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count);
|
||||
f->quant_table_count = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (i = 0; i < f->quant_table_count; i++) {
|
||||
f->context_count[i] = read_quant_tables(c, f->quant_tables[i]);
|
||||
@@ -651,6 +667,12 @@ static int read_header(FFV1Context *f)
|
||||
}
|
||||
}
|
||||
|
||||
if (chroma_h_shift > 4U || chroma_v_shift > 4U) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "chroma shift parameters %d %d are invalid\n",
|
||||
chroma_h_shift, chroma_v_shift);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
f->colorspace = colorspace;
|
||||
f->avctx->bits_per_raw_sample = bits_per_raw_sample;
|
||||
f->chroma_planes = chroma_planes;
|
||||
@@ -758,6 +780,7 @@ static int read_header(FFV1Context *f)
|
||||
av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
f->slice_count = f->max_slice_count;
|
||||
} else if (f->version < 3) {
|
||||
f->slice_count = get_symbol(c, state, 0);
|
||||
} else {
|
||||
@@ -772,8 +795,8 @@ static int read_header(FFV1Context *f)
|
||||
p -= size + trailer;
|
||||
}
|
||||
}
|
||||
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid\n", f->slice_count);
|
||||
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0 || f->slice_count > f->max_slice_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid (max=%d)\n", f->slice_count, f->max_slice_count);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -915,6 +938,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
else v = buf_p - c->bytestream_start;
|
||||
if (buf_p - c->bytestream_start < v) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice pointer chain broken\n");
|
||||
ff_thread_report_progress(&f->picture, INT_MAX, 0);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
buf_p -= v;
|
||||
@@ -996,6 +1020,7 @@ static int init_thread_copy(AVCodecContext *avctx)
|
||||
f->picture.f = NULL;
|
||||
f->last_picture.f = NULL;
|
||||
f->sample_buffer = NULL;
|
||||
f->max_slice_count = 0;
|
||||
f->slice_count = 0;
|
||||
|
||||
for (i = 0; i < f->quant_table_count; i++) {
|
||||
@@ -1071,7 +1096,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
|
||||
av_assert0(!fdst->sample_buffer);
|
||||
}
|
||||
|
||||
av_assert1(fdst->slice_count == fsrc->slice_count);
|
||||
av_assert1(fdst->max_slice_count == fsrc->max_slice_count);
|
||||
|
||||
|
||||
ff_thread_release_buffer(dst, &fdst->picture);
|
||||
|
@@ -962,6 +962,7 @@ slices_ok:
|
||||
|
||||
if ((ret = ffv1_init_slice_contexts(s)) < 0)
|
||||
return ret;
|
||||
s->slice_count = s->max_slice_count;
|
||||
if ((ret = ffv1_init_slices_state(s)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -971,7 +972,7 @@ slices_ok:
|
||||
if (!avctx->stats_out)
|
||||
return AVERROR(ENOMEM);
|
||||
for (i = 0; i < s->quant_table_count; i++)
|
||||
for (j = 0; j < s->slice_count; j++) {
|
||||
for (j = 0; j < s->max_slice_count; j++) {
|
||||
FFV1Context *sf = s->slice_context[j];
|
||||
av_assert0(!sf->rc_stat2[i]);
|
||||
sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
|
||||
@@ -1195,6 +1196,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
for (i = 0; i < f->quant_table_count; i++)
|
||||
memset(f->rc_stat2[i], 0, f->context_count[i] * sizeof(*f->rc_stat2[i]));
|
||||
|
||||
av_assert0(f->slice_count == f->max_slice_count);
|
||||
for (j = 0; j < f->slice_count; j++) {
|
||||
FFV1Context *fs = f->slice_context[j];
|
||||
for (i = 0; i < 256; i++) {
|
||||
|
@@ -663,7 +663,7 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
|
||||
bits[pmin] = UINT32_MAX;
|
||||
for (i = pmax; ; ) {
|
||||
bits[i] = calc_optimal_rice_params(&tmp_rc, i, sums, n, pred_order);
|
||||
if (bits[i] < bits[opt_porder]) {
|
||||
if (bits[i] < bits[opt_porder] || pmax == pmin) {
|
||||
opt_porder = i;
|
||||
*rc = tmp_rc;
|
||||
}
|
||||
@@ -920,7 +920,7 @@ static int count_frame_header(FlacEncodeContext *s)
|
||||
count += 16;
|
||||
|
||||
/* explicit sample rate */
|
||||
count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12)) * 8;
|
||||
count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12) * 2) * 8;
|
||||
|
||||
/* frame header CRC-8 */
|
||||
count += 8;
|
||||
|
@@ -413,6 +413,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
if (has_diff) {
|
||||
if (size < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "size too small for diff\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (!s->keyframe) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Inter frame without keyframe\n");
|
||||
@@ -440,6 +444,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int row = get_bits(&gb, 8);
|
||||
av_log(avctx, AV_LOG_DEBUG, "%dx%d zlibprime_curr %dx%d\n",
|
||||
i, j, col, row);
|
||||
if (size < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "size too small for zlibprime_curr\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
size -= 2;
|
||||
avpriv_request_sample(avctx, "zlibprime_curr");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
|
@@ -111,7 +111,7 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
|
||||
|
||||
if (avctx->width > 4095 || avctx->height > 4095) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Input dimensions too large, input must be max 4096x4096 !\n");
|
||||
"Input dimensions too large, input must be max 4095x4095 !\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
|
@@ -738,7 +738,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
|
||||
c->tile_height = bytestream2_get_be32(&bc);
|
||||
if (c->tile_width <= 0 || c->tile_height <= 0 ||
|
||||
((c->tile_width | c->tile_height) & 0xF) ||
|
||||
c->tile_width * 4LL * c->tile_height >= INT_MAX
|
||||
c->tile_width * (uint64_t)c->tile_height >= INT_MAX / 4
|
||||
) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Invalid tile dimensions %dx%d\n",
|
||||
@@ -869,6 +869,8 @@ header_fail:
|
||||
c->height = 0;
|
||||
c->tiles_x =
|
||||
c->tiles_y = 0;
|
||||
c->tile_width =
|
||||
c->tile_height = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -43,6 +43,7 @@ typedef struct GIFContext {
|
||||
const AVClass *class;
|
||||
LZWState *lzw;
|
||||
uint8_t *buf;
|
||||
int buf_size;
|
||||
AVFrame *last_frame;
|
||||
int flags;
|
||||
uint32_t palette[AVPALETTE_COUNT]; ///< local reference palette for !pal8
|
||||
@@ -174,7 +175,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
||||
|
||||
bytestream_put_byte(bytestream, 0x08);
|
||||
|
||||
ff_lzw_encode_init(s->lzw, s->buf, 2 * width * height,
|
||||
ff_lzw_encode_init(s->lzw, s->buf, s->buf_size,
|
||||
12, FF_LZW_GIF, put_bits);
|
||||
|
||||
ptr = buf + y_start*linesize + x_start;
|
||||
@@ -232,7 +233,8 @@ static av_cold int gif_encode_init(AVCodecContext *avctx)
|
||||
s->transparent_index = -1;
|
||||
|
||||
s->lzw = av_mallocz(ff_lzw_encode_state_size);
|
||||
s->buf = av_malloc(avctx->width*avctx->height*2);
|
||||
s->buf_size = avctx->width*avctx->height*2 + 1000;
|
||||
s->buf = av_malloc(s->buf_size);
|
||||
s->tmpl = av_malloc(avctx->width);
|
||||
if (!s->tmpl || !s->buf || !s->lzw)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -324,6 +326,7 @@ static int gif_encode_close(AVCodecContext *avctx)
|
||||
|
||||
av_freep(&s->lzw);
|
||||
av_freep(&s->buf);
|
||||
s->buf_size = 0;
|
||||
av_frame_free(&s->last_frame);
|
||||
av_freep(&s->tmpl);
|
||||
return 0;
|
||||
|
@@ -68,7 +68,7 @@ static inline int get_ue_golomb(GetBitContext *gb)
|
||||
int log = 2 * av_log2(buf) - 31;
|
||||
LAST_SKIP_BITS(re, gb, 32 - log);
|
||||
CLOSE_READER(re, gb);
|
||||
if (CONFIG_FTRAPV && log < 0) {
|
||||
if (log < 7) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Invalid UE golomb code\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -337,8 +337,16 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
|
||||
|
||||
if (i < limit - 1) {
|
||||
if (k) {
|
||||
buf = SHOW_UBITS(re, gb, k);
|
||||
LAST_SKIP_BITS(re, gb, k);
|
||||
if (k > MIN_CACHE_BITS - 1) {
|
||||
buf = SHOW_UBITS(re, gb, 16) << (k-16);
|
||||
LAST_SKIP_BITS(re, gb, 16);
|
||||
UPDATE_CACHE(re, gb);
|
||||
buf |= SHOW_UBITS(re, gb, k-16);
|
||||
LAST_SKIP_BITS(re, gb, k-16);
|
||||
} else {
|
||||
buf = SHOW_UBITS(re, gb, k);
|
||||
LAST_SKIP_BITS(re, gb, k);
|
||||
}
|
||||
} else {
|
||||
buf = 0;
|
||||
}
|
||||
|
@@ -1499,9 +1499,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
|
||||
continue;
|
||||
|
||||
again:
|
||||
if ( (!(avctx->active_thread_type & FF_THREAD_FRAME) || nals_needed >= nal_index)
|
||||
&& !h->current_slice)
|
||||
h->au_pps_id = -1;
|
||||
/* Ignore per frame NAL unit type during extradata
|
||||
* parsing. Decoding slices is not possible in codec init
|
||||
* with frame-mt */
|
||||
@@ -1537,8 +1534,14 @@ again:
|
||||
ret = -1;
|
||||
goto end;
|
||||
}
|
||||
if(!idr_cleared)
|
||||
if(!idr_cleared) {
|
||||
if (h->current_slice && (avctx->active_thread_type & FF_THREAD_SLICE)) {
|
||||
av_log(h, AV_LOG_ERROR, "invalid mixed IDR / non IDR frames cannot be decoded in slice multithreading mode\n");
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto end;
|
||||
}
|
||||
idr(h); // FIXME ensure we don't lose some frames if there is reordering
|
||||
}
|
||||
idr_cleared = 1;
|
||||
h->has_recovery_point = 1;
|
||||
case NAL_SLICE:
|
||||
@@ -1546,6 +1549,10 @@ again:
|
||||
hx->intra_gb_ptr =
|
||||
hx->inter_gb_ptr = &hx->gb;
|
||||
|
||||
if ( nals_needed >= nal_index
|
||||
|| (!(avctx->active_thread_type & FF_THREAD_FRAME) && !context_count))
|
||||
h->au_pps_id = -1;
|
||||
|
||||
if ((err = ff_h264_decode_slice_header(hx, h)))
|
||||
break;
|
||||
|
||||
@@ -1629,7 +1636,9 @@ again:
|
||||
break;
|
||||
case NAL_SPS:
|
||||
init_get_bits(&h->gb, ptr, bit_length);
|
||||
if (ff_h264_decode_seq_parameter_set(h) < 0 && (h->is_avc ? nalsize : 1)) {
|
||||
if (ff_h264_decode_seq_parameter_set(h, 0) >= 0)
|
||||
break;
|
||||
if (h->is_avc ? nalsize : 1) {
|
||||
av_log(h->avctx, AV_LOG_DEBUG,
|
||||
"SPS decoding failure, trying again with the complete NAL\n");
|
||||
if (h->is_avc)
|
||||
@@ -1638,8 +1647,11 @@ again:
|
||||
break;
|
||||
init_get_bits(&h->gb, &buf[buf_index + 1 - consumed],
|
||||
8*(next_avc - buf_index + consumed - 1));
|
||||
ff_h264_decode_seq_parameter_set(h);
|
||||
if (ff_h264_decode_seq_parameter_set(h, 0) >= 0)
|
||||
break;
|
||||
}
|
||||
init_get_bits(&h->gb, ptr, bit_length);
|
||||
ff_h264_decode_seq_parameter_set(h, 1);
|
||||
|
||||
break;
|
||||
case NAL_PPS:
|
||||
@@ -1672,8 +1684,14 @@ again:
|
||||
if (err < 0 || err == SLICE_SKIPED) {
|
||||
if (err < 0)
|
||||
av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
|
||||
h->ref_count[0] = h->ref_count[1] = h->list_count = 0;
|
||||
hx->ref_count[0] = hx->ref_count[1] = hx->list_count = 0;
|
||||
} else if (err == SLICE_SINGLETHREAD) {
|
||||
if (context_count > 1) {
|
||||
ret = ff_h264_execute_decode_slices(h, context_count - 1);
|
||||
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
|
||||
goto end;
|
||||
context_count = 0;
|
||||
}
|
||||
/* Slice could not be decoded in parallel mode, copy down
|
||||
* NAL unit stuff to context 0 and restart. Note that
|
||||
* rbsp_buffer is not transferred, but since we no longer
|
||||
@@ -1747,7 +1765,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;
|
||||
}
|
||||
@@ -1756,7 +1774,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;
|
||||
}
|
||||
|
@@ -536,6 +536,7 @@ typedef struct H264Context {
|
||||
int mb_x, mb_y;
|
||||
int resync_mb_x;
|
||||
int resync_mb_y;
|
||||
int mb_index_end;
|
||||
int mb_skip_run;
|
||||
int mb_height, mb_width;
|
||||
int mb_stride;
|
||||
@@ -776,7 +777,7 @@ int ff_h264_decode_sei(H264Context *h);
|
||||
/**
|
||||
* Decode SPS
|
||||
*/
|
||||
int ff_h264_decode_seq_parameter_set(H264Context *h);
|
||||
int ff_h264_decode_seq_parameter_set(H264Context *h, int ignore_truncation);
|
||||
|
||||
/**
|
||||
* compute profile from sps
|
||||
|
@@ -2000,6 +2000,7 @@ decode_intra_mb:
|
||||
const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] *
|
||||
h->sps.bit_depth_luma >> 3;
|
||||
const uint8_t *ptr;
|
||||
int ret;
|
||||
|
||||
// We assume these blocks are very rare so we do not optimize it.
|
||||
// FIXME The two following lines get the bitstream position in the cabac
|
||||
@@ -2016,7 +2017,9 @@ decode_intra_mb:
|
||||
h->intra_pcm_ptr = ptr;
|
||||
ptr += mb_size;
|
||||
|
||||
ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr);
|
||||
ret = ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
// All blocks are present
|
||||
h->cbp_table[mb_xy] = 0xf7ef;
|
||||
|
@@ -182,7 +182,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
|
||||
buf += ctx->length_size;
|
||||
unit_type = *buf & 0x1f;
|
||||
|
||||
if (buf + nal_size > buf_end || nal_size < 0)
|
||||
if (nal_size > buf_end - buf || nal_size < 0)
|
||||
goto fail;
|
||||
|
||||
if (unit_type == 7)
|
||||
|
@@ -280,7 +280,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
|
||||
init_get_bits(&h->gb, ptr, 8 * dst_length);
|
||||
switch (h->nal_unit_type) {
|
||||
case NAL_SPS:
|
||||
ff_h264_decode_seq_parameter_set(h);
|
||||
ff_h264_decode_seq_parameter_set(h, 0);
|
||||
break;
|
||||
case NAL_PPS:
|
||||
ff_h264_decode_picture_parameter_set(h, h->gb.size_in_bits);
|
||||
|
@@ -241,12 +241,6 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps)
|
||||
}
|
||||
}
|
||||
|
||||
if (get_bits_left(&h->gb) < 0) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"Overread VUI by %d bits\n", -get_bits_left(&h->gb));
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -303,7 +297,7 @@ static void decode_scaling_matrices(H264Context *h, SPS *sps,
|
||||
}
|
||||
}
|
||||
|
||||
int ff_h264_decode_seq_parameter_set(H264Context *h)
|
||||
int ff_h264_decode_seq_parameter_set(H264Context *h, int ignore_truncation)
|
||||
{
|
||||
int profile_idc, level_idc, constraint_set_flags = 0;
|
||||
unsigned int sps_id;
|
||||
@@ -523,6 +517,13 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (get_bits_left(&h->gb) < 0) {
|
||||
av_log(h->avctx, ignore_truncation ? AV_LOG_WARNING : AV_LOG_ERROR,
|
||||
"Overread %s by %d bits\n", sps->vui_parameters_present_flag ? "VUI" : "SPS", -get_bits_left(&h->gb));
|
||||
if (!ignore_truncation)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!sps->sar.den)
|
||||
sps->sar.den = 1;
|
||||
|
||||
|
@@ -276,7 +276,7 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h)
|
||||
|
||||
long_idx = pic_num_extract(h, pic_id, &pic_structure);
|
||||
|
||||
if (long_idx > 31) {
|
||||
if (long_idx > 31U) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"long_term_pic_idx overflow\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -705,7 +705,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
|
||||
*/
|
||||
if (h->short_ref_count && h->short_ref[0] == h->cur_pic_ptr) {
|
||||
/* Just mark the second field valid */
|
||||
h->cur_pic_ptr->reference = PICT_FRAME;
|
||||
h->cur_pic_ptr->reference |= h->picture_structure;
|
||||
} else if (h->cur_pic_ptr->long_ref) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "illegal short term reference "
|
||||
"assignment for second field "
|
||||
|
@@ -242,11 +242,11 @@ static int alloc_picture(H264Context *h, H264Picture *pic)
|
||||
av_pix_fmt_get_chroma_sub_sample(pic->f.format,
|
||||
&h_chroma_shift, &v_chroma_shift);
|
||||
|
||||
for(i=0; i<FF_CEIL_RSHIFT(h->avctx->height, v_chroma_shift); i++) {
|
||||
for(i=0; i<FF_CEIL_RSHIFT(pic->f.height, v_chroma_shift); i++) {
|
||||
memset(pic->f.data[1] + pic->f.linesize[1]*i,
|
||||
0x80, FF_CEIL_RSHIFT(h->avctx->width, h_chroma_shift));
|
||||
0x80, FF_CEIL_RSHIFT(pic->f.width, h_chroma_shift));
|
||||
memset(pic->f.data[2] + pic->f.linesize[2]*i,
|
||||
0x80, FF_CEIL_RSHIFT(h->avctx->width, h_chroma_shift));
|
||||
0x80, FF_CEIL_RSHIFT(pic->f.width, h_chroma_shift));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -893,7 +893,7 @@ static void implicit_weight_table(H264Context *h, int field)
|
||||
cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure - 1];
|
||||
}
|
||||
if (h->ref_count[0] == 1 && h->ref_count[1] == 1 && !FRAME_MBAFF(h) &&
|
||||
h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2 * cur_poc) {
|
||||
h->ref_list[0][0].poc + (int64_t)h->ref_list[1][0].poc == 2 * cur_poc) {
|
||||
h->use_weight = 0;
|
||||
h->use_weight_chroma = 0;
|
||||
return;
|
||||
@@ -914,7 +914,7 @@ static void implicit_weight_table(H264Context *h, int field)
|
||||
h->chroma_log2_weight_denom = 5;
|
||||
|
||||
for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
|
||||
int poc0 = h->ref_list[0][ref0].poc;
|
||||
int64_t poc0 = h->ref_list[0][ref0].poc;
|
||||
for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
|
||||
int w = 32;
|
||||
if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref) {
|
||||
@@ -1194,6 +1194,7 @@ static int h264_slice_header_init(H264Context *h, int reinit)
|
||||
nb_slices = max_slices;
|
||||
}
|
||||
h->slice_context_count = nb_slices;
|
||||
h->max_contexts = FFMIN(h->max_contexts, nb_slices);
|
||||
|
||||
if (!HAVE_THREADS || !(h->avctx->active_thread_type & FF_THREAD_SLICE)) {
|
||||
ret = ff_h264_context_init(h);
|
||||
@@ -1289,6 +1290,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
||||
int field_pic_flag, bottom_field_flag;
|
||||
int first_slice = h == h0 && !h0->current_slice;
|
||||
int frame_num, picture_structure, droppable;
|
||||
int mb_aff_frame, last_mb_aff_frame;
|
||||
PPS *pps;
|
||||
|
||||
h->qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
|
||||
@@ -1416,7 +1418,8 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
||||
|| h->mb_width != h->sps.mb_width
|
||||
|| h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
|
||||
));
|
||||
if (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0)))
|
||||
if (h0->avctx->pix_fmt == AV_PIX_FMT_NONE
|
||||
|| (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0))))
|
||||
must_reinit = 1;
|
||||
|
||||
if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))
|
||||
@@ -1452,6 +1455,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
||||
|
||||
if (h->context_initialized &&
|
||||
(must_reinit || needs_reinit)) {
|
||||
h->context_initialized = 0;
|
||||
if (h != h0) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"changing width %d -> %d / height %d -> %d on "
|
||||
@@ -1512,7 +1516,8 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
||||
}
|
||||
|
||||
h->mb_mbaff = 0;
|
||||
h->mb_aff_frame = 0;
|
||||
mb_aff_frame = 0;
|
||||
last_mb_aff_frame = h0->mb_aff_frame;
|
||||
last_pic_structure = h0->picture_structure;
|
||||
last_pic_droppable = h0->droppable;
|
||||
droppable = h->nal_ref_idc == 0;
|
||||
@@ -1530,12 +1535,13 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
||||
picture_structure = PICT_TOP_FIELD + bottom_field_flag;
|
||||
} else {
|
||||
picture_structure = PICT_FRAME;
|
||||
h->mb_aff_frame = h->sps.mb_aff;
|
||||
mb_aff_frame = h->sps.mb_aff;
|
||||
}
|
||||
}
|
||||
if (h0->current_slice) {
|
||||
if (last_pic_structure != picture_structure ||
|
||||
last_pic_droppable != droppable) {
|
||||
last_pic_droppable != droppable ||
|
||||
last_mb_aff_frame != mb_aff_frame) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"Changing field mode (%d -> %d) between slices is not allowed\n",
|
||||
last_pic_structure, h->picture_structure);
|
||||
@@ -1551,6 +1557,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
||||
h->picture_structure = picture_structure;
|
||||
h->droppable = droppable;
|
||||
h->frame_num = frame_num;
|
||||
h->mb_aff_frame = mb_aff_frame;
|
||||
h->mb_field_decoding_flag = picture_structure != PICT_FRAME;
|
||||
|
||||
if (h0->current_slice == 0) {
|
||||
@@ -1663,14 +1670,17 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
||||
* vectors. Given we are concealing a lost frame, this probably
|
||||
* is not noticeable by comparison, but it should be fixed. */
|
||||
if (h->short_ref_count) {
|
||||
if (prev) {
|
||||
if (prev &&
|
||||
h->short_ref[0]->f.width == prev->f.width &&
|
||||
h->short_ref[0]->f.height == prev->f.height &&
|
||||
h->short_ref[0]->f.format == prev->f.format) {
|
||||
av_image_copy(h->short_ref[0]->f.data,
|
||||
h->short_ref[0]->f.linesize,
|
||||
(const uint8_t **)prev->f.data,
|
||||
prev->f.linesize,
|
||||
h->avctx->pix_fmt,
|
||||
h->mb_width * 16,
|
||||
h->mb_height * 16);
|
||||
prev->f.format,
|
||||
prev->f.width,
|
||||
prev->f.height);
|
||||
h->short_ref[0]->poc = prev->poc + 2;
|
||||
}
|
||||
h->short_ref[0]->frame_num = h->prev_frame_num;
|
||||
@@ -2412,20 +2422,32 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
|
||||
}
|
||||
|
||||
if (h->pps.cabac) {
|
||||
int ret;
|
||||
/* realign */
|
||||
align_get_bits(&h->gb);
|
||||
|
||||
/* init cabac */
|
||||
ff_init_cabac_decoder(&h->cabac,
|
||||
ret = ff_init_cabac_decoder(&h->cabac,
|
||||
h->gb.buffer + get_bits_count(&h->gb) / 8,
|
||||
(get_bits_left(&h->gb) + 7) / 8);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ff_h264_init_cabac_states(h);
|
||||
|
||||
for (;;) {
|
||||
// START_TIMER
|
||||
int ret = ff_h264_decode_mb_cabac(h);
|
||||
int eos;
|
||||
int ret, eos;
|
||||
|
||||
if (h->mb_x + h->mb_y * h->mb_width >= h->mb_index_end) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Slice overlaps next at %d\n",
|
||||
h->mb_index_end);
|
||||
er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
|
||||
h->mb_y, ER_MB_ERROR);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
ret = ff_h264_decode_mb_cabac(h);
|
||||
// STOP_TIMER("decode_mb_cabac")
|
||||
|
||||
if (ret >= 0)
|
||||
@@ -2487,7 +2509,17 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
|
||||
}
|
||||
} else {
|
||||
for (;;) {
|
||||
int ret = ff_h264_decode_mb_cavlc(h);
|
||||
int ret;
|
||||
|
||||
if (h->mb_x + h->mb_y * h->mb_width >= h->mb_index_end) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Slice overlaps next at %d\n",
|
||||
h->mb_index_end);
|
||||
er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
|
||||
h->mb_y, ER_MB_ERROR);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
ret = ff_h264_decode_mb_cavlc(h);
|
||||
|
||||
if (ret >= 0)
|
||||
ff_h264_hl_decode_mb(h);
|
||||
@@ -2575,19 +2607,33 @@ int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)
|
||||
|
||||
av_assert0(h->mb_y < h->mb_height);
|
||||
|
||||
h->mb_index_end = INT_MAX;
|
||||
|
||||
if (h->avctx->hwaccel ||
|
||||
h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
|
||||
return 0;
|
||||
if (context_count == 1) {
|
||||
return decode_slice(avctx, &h);
|
||||
} else {
|
||||
int j, mb_index;
|
||||
av_assert0(context_count > 0);
|
||||
for (i = 1; i < context_count; i++) {
|
||||
for (i = 0; i < context_count; i++) {
|
||||
int mb_index_end = h->mb_width * h->mb_height;
|
||||
hx = h->thread_context[i];
|
||||
if (CONFIG_ERROR_RESILIENCE) {
|
||||
mb_index = hx->resync_mb_x + hx->resync_mb_y * h->mb_width;
|
||||
if (CONFIG_ERROR_RESILIENCE && i) {
|
||||
hx->er.error_count = 0;
|
||||
}
|
||||
hx->x264_build = h->x264_build;
|
||||
for (j = 0; j < context_count; j++) {
|
||||
H264Context *sl2 = h->thread_context[j];
|
||||
int mb_index2 = sl2->resync_mb_x + sl2->resync_mb_y * h->mb_width;
|
||||
|
||||
if (i==j || mb_index > mb_index2)
|
||||
continue;
|
||||
mb_index_end = FFMIN(mb_index_end, mb_index2);
|
||||
}
|
||||
hx->mb_index_end = mb_index_end;
|
||||
}
|
||||
|
||||
avctx->execute(avctx, decode_slice, h->thread_context,
|
||||
|
@@ -440,7 +440,7 @@ static int hls_slice_header(HEVCContext *s)
|
||||
|
||||
slice_address_length = av_ceil_log2(s->sps->ctb_width *
|
||||
s->sps->ctb_height);
|
||||
sh->slice_segment_addr = get_bits(gb, slice_address_length);
|
||||
sh->slice_segment_addr = slice_address_length ? get_bits(gb, slice_address_length) : 0;
|
||||
if (sh->slice_segment_addr >= s->sps->ctb_width * s->sps->ctb_height) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"Invalid slice segment address: %u.\n",
|
||||
@@ -694,15 +694,29 @@ static int hls_slice_header(HEVCContext *s)
|
||||
|
||||
sh->num_entry_point_offsets = 0;
|
||||
if (s->pps->tiles_enabled_flag || s->pps->entropy_coding_sync_enabled_flag) {
|
||||
sh->num_entry_point_offsets = get_ue_golomb_long(gb);
|
||||
unsigned num_entry_point_offsets = get_ue_golomb_long(gb);
|
||||
// It would be possible to bound this tighter but this here is simpler
|
||||
if (num_entry_point_offsets > get_bits_left(gb)) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "num_entry_point_offsets %d is invalid\n", num_entry_point_offsets);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
sh->num_entry_point_offsets = num_entry_point_offsets;
|
||||
if (sh->num_entry_point_offsets > 0) {
|
||||
int offset_len = get_ue_golomb_long(gb) + 1;
|
||||
int segments = offset_len >> 4;
|
||||
int rest = (offset_len & 15);
|
||||
|
||||
if (offset_len < 1 || offset_len > 32) {
|
||||
sh->num_entry_point_offsets = 0;
|
||||
av_log(s->avctx, AV_LOG_ERROR, "offset_len %d is invalid\n", offset_len);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
av_freep(&sh->entry_point_offset);
|
||||
av_freep(&sh->offset);
|
||||
av_freep(&sh->size);
|
||||
sh->entry_point_offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
|
||||
sh->entry_point_offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(unsigned));
|
||||
sh->offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
|
||||
sh->size = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
|
||||
if (!sh->entry_point_offset || !sh->offset || !sh->size) {
|
||||
@@ -775,6 +789,8 @@ static int hls_slice_header(HEVCContext *s)
|
||||
s->HEVClc->tu.cu_qp_offset_cb = 0;
|
||||
s->HEVClc->tu.cu_qp_offset_cr = 0;
|
||||
|
||||
s->no_rasl_output_flag = IS_IDR(s) || IS_BLA(s) || (s->nal_unit_type == NAL_CRA_NUT && s->last_eos);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2365,6 +2381,8 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
|
||||
|
||||
if (more_data < 0) {
|
||||
s->tab_slice_address[ctb_addr_rs] = -1;
|
||||
avpriv_atomic_int_set(&s1->wpp_err, 1);
|
||||
ff_thread_report_progress2(s->avctx, ctb_row ,thread, SHIFT_CTB_WPP);
|
||||
return more_data;
|
||||
}
|
||||
|
||||
@@ -2402,8 +2420,8 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
|
||||
HEVCLocalContext *lc = s->HEVClc;
|
||||
int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
|
||||
int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
|
||||
int offset;
|
||||
int startheader, cmpt = 0;
|
||||
int64_t offset;
|
||||
int64_t startheader, cmpt = 0;
|
||||
int i, j, res = 0;
|
||||
|
||||
if (!ret || !arg) {
|
||||
@@ -2412,11 +2430,18 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
if (s->sh.slice_ctb_addr_rs + s->sh.num_entry_point_offsets * s->sps->ctb_width >= s->sps->ctb_width * s->sps->ctb_height) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "WPP ctb addresses are wrong (%d %d %d %d)\n",
|
||||
s->sh.slice_ctb_addr_rs, s->sh.num_entry_point_offsets,
|
||||
s->sps->ctb_width, s->sps->ctb_height
|
||||
);
|
||||
res = AVERROR_INVALIDDATA;
|
||||
goto error;
|
||||
}
|
||||
|
||||
ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
|
||||
|
||||
if (!s->sList[1]) {
|
||||
ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
|
||||
|
||||
|
||||
for (i = 1; i < s->threads_number; i++) {
|
||||
s->sList[i] = av_malloc(sizeof(HEVCContext));
|
||||
memcpy(s->sList[i], s, sizeof(HEVCContext));
|
||||
@@ -2449,6 +2474,11 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
|
||||
}
|
||||
if (s->sh.num_entry_point_offsets != 0) {
|
||||
offset += s->sh.entry_point_offset[s->sh.num_entry_point_offsets - 1] - cmpt;
|
||||
if (length < offset) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "entry_point_offset table is corrupted\n");
|
||||
res = AVERROR_INVALIDDATA;
|
||||
goto error;
|
||||
}
|
||||
s->sh.size[s->sh.num_entry_point_offsets - 1] = length - offset;
|
||||
s->sh.offset[s->sh.num_entry_point_offsets - 1] = offset;
|
||||
|
||||
@@ -2475,6 +2505,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
|
||||
|
||||
for (i = 0; i <= s->sh.num_entry_point_offsets; i++)
|
||||
res += ret[i];
|
||||
error:
|
||||
av_free(ret);
|
||||
av_free(arg);
|
||||
return res;
|
||||
@@ -2600,7 +2631,8 @@ static int hevc_frame_start(HEVCContext *s)
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
ff_thread_finish_setup(s->avctx);
|
||||
if (!s->avctx->hwaccel)
|
||||
ff_thread_finish_setup(s->avctx);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -2982,7 +3014,6 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
|
||||
|
||||
/* parse the NAL units */
|
||||
for (i = 0; i < s->nb_nals; i++) {
|
||||
int ret;
|
||||
s->skipped_bytes = s->skipped_bytes_nal[i];
|
||||
s->skipped_bytes_pos = s->skipped_bytes_pos_nal[i];
|
||||
|
||||
@@ -3342,6 +3373,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
|
||||
s->pocTid0 = s0->pocTid0;
|
||||
s->max_ra = s0->max_ra;
|
||||
s->eos = s0->eos;
|
||||
s->no_rasl_output_flag = s0->no_rasl_output_flag;
|
||||
|
||||
s->is_nalff = s0->is_nalff;
|
||||
s->nal_length_size = s0->nal_length_size;
|
||||
@@ -3436,6 +3468,7 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
|
||||
|
||||
s->enable_parallel_tiles = 0;
|
||||
s->picture_struct = 0;
|
||||
s->eos = 1;
|
||||
|
||||
if(avctx->active_thread_type & FF_THREAD_SLICE)
|
||||
s->threads_number = avctx->thread_count;
|
||||
@@ -3477,6 +3510,7 @@ static void hevc_decode_flush(AVCodecContext *avctx)
|
||||
HEVCContext *s = avctx->priv_data;
|
||||
ff_hevc_flush_dpb(s);
|
||||
s->max_ra = INT_MAX;
|
||||
s->eos = 1;
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(HEVCContext, x)
|
||||
|
@@ -298,10 +298,10 @@ typedef struct RefPicListTab {
|
||||
} RefPicListTab;
|
||||
|
||||
typedef struct HEVCWindow {
|
||||
int left_offset;
|
||||
int right_offset;
|
||||
int top_offset;
|
||||
int bottom_offset;
|
||||
unsigned int left_offset;
|
||||
unsigned int right_offset;
|
||||
unsigned int top_offset;
|
||||
unsigned int bottom_offset;
|
||||
} HEVCWindow;
|
||||
|
||||
typedef struct VUI {
|
||||
@@ -609,7 +609,7 @@ typedef struct SliceHeader {
|
||||
|
||||
unsigned int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
|
||||
|
||||
int *entry_point_offset;
|
||||
unsigned *entry_point_offset;
|
||||
int * offset;
|
||||
int * size;
|
||||
int num_entry_point_offsets;
|
||||
@@ -844,6 +844,7 @@ typedef struct HEVCContext {
|
||||
int bs_height;
|
||||
|
||||
int is_decoded;
|
||||
int no_rasl_output_flag;
|
||||
|
||||
HEVCPredContext hpc;
|
||||
HEVCDSPContext hevcdsp;
|
||||
|
@@ -883,11 +883,13 @@ static av_always_inline int mvd_decode(HEVCContext *s)
|
||||
int k = 1;
|
||||
|
||||
while (k < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc)) {
|
||||
ret += 1 << k;
|
||||
ret += 1U << k;
|
||||
k++;
|
||||
}
|
||||
if (k == CABAC_MAX_BIN)
|
||||
if (k == CABAC_MAX_BIN) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k);
|
||||
return 0;
|
||||
}
|
||||
while (k--)
|
||||
ret += get_cabac_bypass(&s->HEVClc->cc) << k;
|
||||
return get_cabac_bypass_sign(&s->HEVClc->cc, -ret);
|
||||
@@ -1025,8 +1027,10 @@ static av_always_inline int coeff_abs_level_remaining_decode(HEVCContext *s, int
|
||||
|
||||
while (prefix < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc))
|
||||
prefix++;
|
||||
if (prefix == CABAC_MAX_BIN)
|
||||
if (prefix == CABAC_MAX_BIN) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", prefix);
|
||||
return 0;
|
||||
}
|
||||
if (prefix < 3) {
|
||||
for (i = 0; i < rc_rice_param; i++)
|
||||
suffix = (suffix << 1) | get_cabac_bypass(&s->HEVClc->cc);
|
||||
|
@@ -200,7 +200,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
|
||||
|
||||
slice_address_length = av_ceil_log2_c(h->sps->ctb_width *
|
||||
h->sps->ctb_height);
|
||||
sh->slice_segment_addr = get_bits(gb, slice_address_length);
|
||||
sh->slice_segment_addr = slice_address_length ? get_bits(gb, slice_address_length) : 0;
|
||||
if (sh->slice_segment_addr >= h->sps->ctb_width * h->sps->ctb_height) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Invalid slice segment address: %u.\n",
|
||||
sh->slice_segment_addr);
|
||||
|
@@ -424,7 +424,8 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
|
||||
|
||||
vps->vps_max_layer_id = get_bits(gb, 6);
|
||||
vps->vps_num_layer_sets = get_ue_golomb_long(gb) + 1;
|
||||
if ((vps->vps_num_layer_sets - 1LL) * (vps->vps_max_layer_id + 1LL) > get_bits_left(gb)) {
|
||||
if (vps->vps_num_layer_sets < 1 || vps->vps_num_layer_sets > 1024 ||
|
||||
(vps->vps_num_layer_sets - 1LL) * (vps->vps_max_layer_id + 1LL) > get_bits_left(gb)) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "too many layer_id_included_flags\n");
|
||||
goto err;
|
||||
}
|
||||
@@ -441,6 +442,11 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
|
||||
if (vps->vps_poc_proportional_to_timing_flag)
|
||||
vps->vps_num_ticks_poc_diff_one = get_ue_golomb_long(gb) + 1;
|
||||
vps->vps_num_hrd_parameters = get_ue_golomb_long(gb);
|
||||
if (vps->vps_num_hrd_parameters > (unsigned)vps->vps_num_layer_sets) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"vps_num_hrd_parameters %d is invalid\n", vps->vps_num_hrd_parameters);
|
||||
goto err;
|
||||
}
|
||||
for (i = 0; i < vps->vps_num_hrd_parameters; i++) {
|
||||
int common_inf_present = 1;
|
||||
|
||||
@@ -455,7 +461,8 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
|
||||
if (get_bits_left(gb) < 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"Overread VPS by %d bits\n", -get_bits_left(gb));
|
||||
goto err;
|
||||
if (s->vps_list[vps_id])
|
||||
goto err;
|
||||
}
|
||||
|
||||
av_buffer_unref(&s->vps_list[vps_id]);
|
||||
@@ -755,6 +762,9 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
|
||||
}
|
||||
|
||||
sps->chroma_format_idc = get_ue_golomb_long(gb);
|
||||
if (sps->chroma_format_idc > 3U) {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (sps->chroma_format_idc == 3)
|
||||
sps->separate_colour_plane_flag = get_bits1(gb);
|
||||
@@ -1039,7 +1049,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
|
||||
(sps->output_window.left_offset + sps->output_window.right_offset);
|
||||
sps->output_height = sps->height -
|
||||
(sps->output_window.top_offset + sps->output_window.bottom_offset);
|
||||
if (sps->output_width <= 0 || sps->output_height <= 0) {
|
||||
if (sps->width <= sps->output_window.left_offset + (int64_t)sps->output_window.right_offset ||
|
||||
sps->height <= sps->output_window.top_offset + (int64_t)sps->output_window.bottom_offset) {
|
||||
av_log(s->avctx, AV_LOG_WARNING, "Invalid visible frame dimensions: %dx%d.\n",
|
||||
sps->output_width, sps->output_height);
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
@@ -1315,14 +1326,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
|
||||
if (pps->tiles_enabled_flag) {
|
||||
pps->num_tile_columns = get_ue_golomb_long(gb) + 1;
|
||||
pps->num_tile_rows = get_ue_golomb_long(gb) + 1;
|
||||
if (pps->num_tile_columns == 0 ||
|
||||
if (pps->num_tile_columns <= 0 ||
|
||||
pps->num_tile_columns >= sps->width) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "num_tile_columns_minus1 out of range: %d\n",
|
||||
pps->num_tile_columns - 1);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto err;
|
||||
}
|
||||
if (pps->num_tile_rows == 0 ||
|
||||
if (pps->num_tile_rows <= 0 ||
|
||||
pps->num_tile_rows >= sps->height) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "num_tile_rows_minus1 out of range: %d\n",
|
||||
pps->num_tile_rows - 1);
|
||||
|
@@ -174,7 +174,7 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
|
||||
int min_poc = INT_MAX;
|
||||
int i, min_idx, ret;
|
||||
|
||||
if (s->sh.no_output_of_prior_pics_flag == 1) {
|
||||
if (s->sh.no_output_of_prior_pics_flag == 1 && s->no_rasl_output_flag == 1) {
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
|
||||
HEVCFrame *frame = &s->DPB[i];
|
||||
if (!(frame->flags & HEVC_FRAME_FLAG_BUMPING) && frame->poc != s->poc &&
|
||||
|
@@ -126,6 +126,11 @@ static int active_parameter_sets(HEVCContext *s)
|
||||
get_bits(gb, 1); // num_sps_ids_minus1
|
||||
num_sps_ids_minus1 = get_ue_golomb_long(gb); // num_sps_ids_minus1
|
||||
|
||||
if (num_sps_ids_minus1 < 0 || num_sps_ids_minus1 > 15) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "num_sps_ids_minus1 %d invalid\n", num_sps_ids_minus1);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
active_seq_parameter_set_id = get_ue_golomb_long(gb);
|
||||
if (active_seq_parameter_set_id >= MAX_SPS_COUNT) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "active_parameter_set_id %d invalid\n", active_seq_parameter_set_id);
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "huffyuv.h"
|
||||
#include "huffyuvdsp.h"
|
||||
#include "thread.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
|
||||
#define classic_shift_luma_table_size 42
|
||||
@@ -291,6 +292,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
HYuvContext *s = avctx->priv_data;
|
||||
int ret;
|
||||
|
||||
ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ff_huffyuvdsp_init(&s->hdsp);
|
||||
memset(s->vlc, 0, 4 * sizeof(VLC));
|
||||
|
||||
|
@@ -426,7 +426,7 @@ static void imc_decode_level_coefficients_raw(IMCContext *q, int *levlCoeffBuf,
|
||||
|
||||
pos = q->coef0_pos;
|
||||
flcoeffs1[pos] = 20000.0 / pow (2, levlCoeffBuf[0] * 0.18945); // 0.18945 = log2(10) * 0.05703125
|
||||
flcoeffs2[pos] = log2f(flcoeffs1[0]);
|
||||
flcoeffs2[pos] = log2f(flcoeffs1[pos]);
|
||||
tmp = flcoeffs1[pos];
|
||||
tmp2 = flcoeffs2[pos];
|
||||
|
||||
|
@@ -236,9 +236,41 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
|
||||
int x_shift;
|
||||
int yheight;
|
||||
int i, y;
|
||||
int max_step[4];
|
||||
|
||||
if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB ||
|
||||
!is_yuv_planar(desc)) return -1;
|
||||
if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
|
||||
return -1;
|
||||
|
||||
if (!is_yuv_planar(desc)) {
|
||||
if (src)
|
||||
return -1; //TODO: Not yet implemented
|
||||
|
||||
av_image_fill_max_pixsteps(max_step, NULL, desc);
|
||||
|
||||
if (padtop || padleft) {
|
||||
memset(dst->data[0], color[0],
|
||||
dst->linesize[0] * padtop + (padleft * max_step[0]));
|
||||
}
|
||||
|
||||
if (padleft || padright) {
|
||||
optr = dst->data[0] + dst->linesize[0] * padtop +
|
||||
(dst->linesize[0] - (padright * max_step[0]));
|
||||
yheight = height - 1 - (padtop + padbottom);
|
||||
for (y = 0; y < yheight; y++) {
|
||||
memset(optr, color[0], (padleft + padright) * max_step[0]);
|
||||
optr += dst->linesize[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (padbottom || padright) {
|
||||
optr = dst->data[0] + dst->linesize[0] * (height - padbottom) -
|
||||
(padright * max_step[0]);
|
||||
memset(optr, color[0], dst->linesize[0] * padbottom +
|
||||
(padright * max_step[0]));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
x_shift = i ? desc->log2_chroma_w : 0;
|
||||
@@ -284,6 +316,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
|
||||
(padbottom >> y_shift) + (padright >> x_shift));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -146,6 +146,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
AVFrame *picture = data;
|
||||
AVFrame * const p = s->picture;
|
||||
int start, ret;
|
||||
int ltab, ctab;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, p)) < 0)
|
||||
return ret;
|
||||
@@ -167,34 +168,36 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
|
||||
init_get_bits(&s->gb, buf + start, (buf_size - start) * 8);
|
||||
|
||||
ltab = buf[0x22] & 3;
|
||||
ctab = buf[0x22] >> 2;
|
||||
if (s->decode_delta) { /* intraframe */
|
||||
if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
|
||||
p->data[0], p->linesize[0],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ltab])) < 0)
|
||||
return ret;
|
||||
|
||||
/* swapped U and V */
|
||||
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[2], p->linesize[2],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[1], p->linesize[1],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
} else { /* interframe */
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width, avctx->height,
|
||||
p->data[0], p->linesize[0],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ltab])) < 0)
|
||||
return ret;
|
||||
/* swapped U and V */
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[2], p->linesize[2],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[1], p->linesize[1],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -27,115 +27,211 @@
|
||||
#define IR2_CODES 143
|
||||
static const uint16_t ir2_codes[IR2_CODES][2] = {
|
||||
#ifdef BITSTREAM_READER_LE
|
||||
{0x0000, 3}, {0x0004, 3}, {0x0006, 3}, {0x0001, 5},
|
||||
{0x0009, 5}, {0x0019, 5}, {0x000D, 5}, {0x001D, 5},
|
||||
{0x0023, 6}, {0x0013, 6}, {0x0033, 6}, {0x000B, 6},
|
||||
{0x002B, 6}, {0x001B, 6}, {0x0007, 8}, {0x0087, 8},
|
||||
{0x0027, 8}, {0x00A7, 8}, {0x0067, 8}, {0x00E7, 8},
|
||||
{0x0097, 8}, {0x0057, 8}, {0x0037, 8}, {0x00B7, 8},
|
||||
{0x00F7, 8}, {0x000F, 9}, {0x008F, 9}, {0x018F, 9},
|
||||
{0x014F, 9}, {0x00CF, 9}, {0x002F, 9}, {0x012F, 9},
|
||||
{0x01AF, 9}, {0x006F, 9}, {0x00EF, 9}, {0x01EF, 9},
|
||||
{0x001F, 10}, {0x021F, 10}, {0x011F, 10}, {0x031F, 10},
|
||||
{0x009F, 10}, {0x029F, 10}, {0x019F, 10}, {0x039F, 10},
|
||||
{0x005F, 10}, {0x025F, 10}, {0x015F, 10}, {0x035F, 10},
|
||||
{0x00DF, 10}, {0x02DF, 10}, {0x01DF, 10}, {0x03DF, 10},
|
||||
{0x003F, 13}, {0x103F, 13}, {0x083F, 13}, {0x183F, 13},
|
||||
{0x043F, 13}, {0x143F, 13}, {0x0C3F, 13}, {0x1C3F, 13},
|
||||
{0x023F, 13}, {0x123F, 13}, {0x0A3F, 13}, {0x1A3F, 13},
|
||||
{0x063F, 13}, {0x163F, 13}, {0x0E3F, 13}, {0x1E3F, 13},
|
||||
{0x013F, 13}, {0x113F, 13}, {0x093F, 13}, {0x193F, 13},
|
||||
{0x053F, 13}, {0x153F, 13}, {0x0D3F, 13}, {0x1D3F, 13},
|
||||
{0x033F, 13}, {0x133F, 13}, {0x0B3F, 13}, {0x1B3F, 13},
|
||||
{0x073F, 13}, {0x173F, 13}, {0x0F3F, 13}, {0x1F3F, 13},
|
||||
{0x00BF, 13}, {0x10BF, 13}, {0x08BF, 13}, {0x18BF, 13},
|
||||
{0x04BF, 13}, {0x14BF, 13}, {0x0CBF, 13}, {0x1CBF, 13},
|
||||
{0x02BF, 13}, {0x12BF, 13}, {0x0ABF, 13}, {0x1ABF, 13},
|
||||
{0x06BF, 13}, {0x16BF, 13}, {0x0EBF, 13}, {0x1EBF, 13},
|
||||
{0x01BF, 13}, {0x11BF, 13}, {0x09BF, 13}, {0x19BF, 13},
|
||||
{0x05BF, 13}, {0x15BF, 13}, {0x0DBF, 13}, {0x1DBF, 13},
|
||||
{0x03BF, 13}, {0x13BF, 13}, {0x0BBF, 13}, {0x1BBF, 13},
|
||||
{0x07BF, 13}, {0x17BF, 13}, {0x0FBF, 13}, {0x1FBF, 13},
|
||||
{0x007F, 14}, {0x207F, 14}, {0x107F, 14}, {0x307F, 14},
|
||||
{0x087F, 14}, {0x287F, 14}, {0x187F, 14}, {0x387F, 14},
|
||||
{0x047F, 14}, {0x247F, 14}, {0x147F, 14}, {0x0002, 3},
|
||||
{0x0011, 5}, {0x0005, 5}, {0x0015, 5}, {0x0003, 6},
|
||||
{0x003B, 6}, {0x0047, 8}, {0x00C7, 8}, {0x0017, 8},
|
||||
{0x00D7, 8}, {0x0077, 8}, {0x010F, 9}, {0x004F, 9},
|
||||
{0x01CF, 9}, {0x00AF, 9}, {0x016F, 9},
|
||||
{ 0x0000, 3 }, { 0x0004, 3 }, { 0x0006, 3 }, { 0x0001, 5 },
|
||||
{ 0x0009, 5 }, { 0x0019, 5 }, { 0x000D, 5 }, { 0x001D, 5 },
|
||||
{ 0x0023, 6 }, { 0x0013, 6 }, { 0x0033, 6 }, { 0x000B, 6 },
|
||||
{ 0x002B, 6 }, { 0x001B, 6 }, { 0x0007, 8 }, { 0x0087, 8 },
|
||||
{ 0x0027, 8 }, { 0x00A7, 8 }, { 0x0067, 8 }, { 0x00E7, 8 },
|
||||
{ 0x0097, 8 }, { 0x0057, 8 }, { 0x0037, 8 }, { 0x00B7, 8 },
|
||||
{ 0x00F7, 8 }, { 0x000F, 9 }, { 0x008F, 9 }, { 0x018F, 9 },
|
||||
{ 0x014F, 9 }, { 0x00CF, 9 }, { 0x002F, 9 }, { 0x012F, 9 },
|
||||
{ 0x01AF, 9 }, { 0x006F, 9 }, { 0x00EF, 9 }, { 0x01EF, 9 },
|
||||
{ 0x001F, 10 }, { 0x021F, 10 }, { 0x011F, 10 }, { 0x031F, 10 },
|
||||
{ 0x009F, 10 }, { 0x029F, 10 }, { 0x019F, 10 }, { 0x039F, 10 },
|
||||
{ 0x005F, 10 }, { 0x025F, 10 }, { 0x015F, 10 }, { 0x035F, 10 },
|
||||
{ 0x00DF, 10 }, { 0x02DF, 10 }, { 0x01DF, 10 }, { 0x03DF, 10 },
|
||||
{ 0x003F, 13 }, { 0x103F, 13 }, { 0x083F, 13 }, { 0x183F, 13 },
|
||||
{ 0x043F, 13 }, { 0x143F, 13 }, { 0x0C3F, 13 }, { 0x1C3F, 13 },
|
||||
{ 0x023F, 13 }, { 0x123F, 13 }, { 0x0A3F, 13 }, { 0x1A3F, 13 },
|
||||
{ 0x063F, 13 }, { 0x163F, 13 }, { 0x0E3F, 13 }, { 0x1E3F, 13 },
|
||||
{ 0x013F, 13 }, { 0x113F, 13 }, { 0x093F, 13 }, { 0x193F, 13 },
|
||||
{ 0x053F, 13 }, { 0x153F, 13 }, { 0x0D3F, 13 }, { 0x1D3F, 13 },
|
||||
{ 0x033F, 13 }, { 0x133F, 13 }, { 0x0B3F, 13 }, { 0x1B3F, 13 },
|
||||
{ 0x073F, 13 }, { 0x173F, 13 }, { 0x0F3F, 13 }, { 0x1F3F, 13 },
|
||||
{ 0x00BF, 13 }, { 0x10BF, 13 }, { 0x08BF, 13 }, { 0x18BF, 13 },
|
||||
{ 0x04BF, 13 }, { 0x14BF, 13 }, { 0x0CBF, 13 }, { 0x1CBF, 13 },
|
||||
{ 0x02BF, 13 }, { 0x12BF, 13 }, { 0x0ABF, 13 }, { 0x1ABF, 13 },
|
||||
{ 0x06BF, 13 }, { 0x16BF, 13 }, { 0x0EBF, 13 }, { 0x1EBF, 13 },
|
||||
{ 0x01BF, 13 }, { 0x11BF, 13 }, { 0x09BF, 13 }, { 0x19BF, 13 },
|
||||
{ 0x05BF, 13 }, { 0x15BF, 13 }, { 0x0DBF, 13 }, { 0x1DBF, 13 },
|
||||
{ 0x03BF, 13 }, { 0x13BF, 13 }, { 0x0BBF, 13 }, { 0x1BBF, 13 },
|
||||
{ 0x07BF, 13 }, { 0x17BF, 13 }, { 0x0FBF, 13 }, { 0x1FBF, 13 },
|
||||
{ 0x007F, 14 }, { 0x207F, 14 }, { 0x107F, 14 }, { 0x307F, 14 },
|
||||
{ 0x087F, 14 }, { 0x287F, 14 }, { 0x187F, 14 }, { 0x387F, 14 },
|
||||
{ 0x047F, 14 }, { 0x247F, 14 }, { 0x147F, 14 }, { 0x0002, 3 },
|
||||
{ 0x0011, 5 }, { 0x0005, 5 }, { 0x0015, 5 }, { 0x0003, 6 },
|
||||
{ 0x003B, 6 }, { 0x0047, 8 }, { 0x00C7, 8 }, { 0x0017, 8 },
|
||||
{ 0x00D7, 8 }, { 0x0077, 8 }, { 0x010F, 9 }, { 0x004F, 9 },
|
||||
{ 0x01CF, 9 }, { 0x00AF, 9 }, { 0x016F, 9 },
|
||||
#else
|
||||
{0x0000, 3}, {0x0001, 3}, {0x0003, 3}, {0x0010, 5},
|
||||
{0x0012, 5}, {0x0013, 5}, {0x0016, 5}, {0x0017, 5},
|
||||
{0x0031, 6}, {0x0032, 6}, {0x0033, 6}, {0x0034, 6},
|
||||
{0x0035, 6}, {0x0036, 6}, {0x00E0, 8}, {0x00E1, 8},
|
||||
{0x00E4, 8}, {0x00E5, 8}, {0x00E6, 8}, {0x00E7, 8},
|
||||
{0x00E9, 8}, {0x00EA, 8}, {0x00EC, 8}, {0x00ED, 8},
|
||||
{0x00EF, 8}, {0x01E0, 9}, {0x01E2, 9}, {0x01E3, 9},
|
||||
{0x01E5, 9}, {0x01E6, 9}, {0x01E8, 9}, {0x01E9, 9},
|
||||
{0x01EB, 9}, {0x01EC, 9}, {0x01EE, 9}, {0x01EF, 9},
|
||||
{0x03E0, 10}, {0x03E1, 10}, {0x03E2, 10}, {0x03E3, 10},
|
||||
{0x03E4, 10}, {0x03E5, 10}, {0x03E6, 10}, {0x03E7, 10},
|
||||
{0x03E8, 10}, {0x03E9, 10}, {0x03EA, 10}, {0x03EB, 10},
|
||||
{0x03EC, 10}, {0x03ED, 10}, {0x03EE, 10}, {0x03EF, 10},
|
||||
{0x1F80, 13}, {0x1F81, 13}, {0x1F82, 13}, {0x1F83, 13},
|
||||
{0x1F84, 13}, {0x1F85, 13}, {0x1F86, 13}, {0x1F87, 13},
|
||||
{0x1F88, 13}, {0x1F89, 13}, {0x1F8A, 13}, {0x1F8B, 13},
|
||||
{0x1F8C, 13}, {0x1F8D, 13}, {0x1F8E, 13}, {0x1F8F, 13},
|
||||
{0x1F90, 13}, {0x1F91, 13}, {0x1F92, 13}, {0x1F93, 13},
|
||||
{0x1F94, 13}, {0x1F95, 13}, {0x1F96, 13}, {0x1F97, 13},
|
||||
{0x1F98, 13}, {0x1F99, 13}, {0x1F9A, 13}, {0x1F9B, 13},
|
||||
{0x1F9C, 13}, {0x1F9D, 13}, {0x1F9E, 13}, {0x1F9F, 13},
|
||||
{0x1FA0, 13}, {0x1FA1, 13}, {0x1FA2, 13}, {0x1FA3, 13},
|
||||
{0x1FA4, 13}, {0x1FA5, 13}, {0x1FA6, 13}, {0x1FA7, 13},
|
||||
{0x1FA8, 13}, {0x1FA9, 13}, {0x1FAA, 13}, {0x1FAB, 13},
|
||||
{0x1FAC, 13}, {0x1FAD, 13}, {0x1FAE, 13}, {0x1FAF, 13},
|
||||
{0x1FB0, 13}, {0x1FB1, 13}, {0x1FB2, 13}, {0x1FB3, 13},
|
||||
{0x1FB4, 13}, {0x1FB5, 13}, {0x1FB6, 13}, {0x1FB7, 13},
|
||||
{0x1FB8, 13}, {0x1FB9, 13}, {0x1FBA, 13}, {0x1FBB, 13},
|
||||
{0x1FBC, 13}, {0x1FBD, 13}, {0x1FBE, 13}, {0x1FBF, 13},
|
||||
{0x3F80, 14}, {0x3F81, 14}, {0x3F82, 14}, {0x3F83, 14},
|
||||
{0x3F84, 14}, {0x3F85, 14}, {0x3F86, 14}, {0x3F87, 14},
|
||||
{0x3F88, 14}, {0x3F89, 14}, {0x3F8A, 14}, {0x0002, 3},
|
||||
{0x0011, 5}, {0x0014, 5}, {0x0015, 5}, {0x0030, 6},
|
||||
{0x0037, 6}, {0x00E2, 8}, {0x00E3, 8}, {0x00E8, 8},
|
||||
{0x00EB, 8}, {0x00EE, 8}, {0x01E1, 9}, {0x01E4, 9},
|
||||
{0x01E7, 9}, {0x01EA, 9}, {0x01ED, 9}
|
||||
{ 0x0000, 3 }, { 0x0001, 3 }, { 0x0003, 3 }, { 0x0010, 5 },
|
||||
{ 0x0012, 5 }, { 0x0013, 5 }, { 0x0016, 5 }, { 0x0017, 5 },
|
||||
{ 0x0031, 6 }, { 0x0032, 6 }, { 0x0033, 6 }, { 0x0034, 6 },
|
||||
{ 0x0035, 6 }, { 0x0036, 6 }, { 0x00E0, 8 }, { 0x00E1, 8 },
|
||||
{ 0x00E4, 8 }, { 0x00E5, 8 }, { 0x00E6, 8 }, { 0x00E7, 8 },
|
||||
{ 0x00E9, 8 }, { 0x00EA, 8 }, { 0x00EC, 8 }, { 0x00ED, 8 },
|
||||
{ 0x00EF, 8 }, { 0x01E0, 9 }, { 0x01E2, 9 }, { 0x01E3, 9 },
|
||||
{ 0x01E5, 9 }, { 0x01E6, 9 }, { 0x01E8, 9 }, { 0x01E9, 9 },
|
||||
{ 0x01EB, 9 }, { 0x01EC, 9 }, { 0x01EE, 9 }, { 0x01EF, 9 },
|
||||
{ 0x03E0, 10 }, { 0x03E1, 10 }, { 0x03E2, 10 }, { 0x03E3, 10 },
|
||||
{ 0x03E4, 10 }, { 0x03E5, 10 }, { 0x03E6, 10 }, { 0x03E7, 10 },
|
||||
{ 0x03E8, 10 }, { 0x03E9, 10 }, { 0x03EA, 10 }, { 0x03EB, 10 },
|
||||
{ 0x03EC, 10 }, { 0x03ED, 10 }, { 0x03EE, 10 }, { 0x03EF, 10 },
|
||||
{ 0x1F80, 13 }, { 0x1F81, 13 }, { 0x1F82, 13 }, { 0x1F83, 13 },
|
||||
{ 0x1F84, 13 }, { 0x1F85, 13 }, { 0x1F86, 13 }, { 0x1F87, 13 },
|
||||
{ 0x1F88, 13 }, { 0x1F89, 13 }, { 0x1F8A, 13 }, { 0x1F8B, 13 },
|
||||
{ 0x1F8C, 13 }, { 0x1F8D, 13 }, { 0x1F8E, 13 }, { 0x1F8F, 13 },
|
||||
{ 0x1F90, 13 }, { 0x1F91, 13 }, { 0x1F92, 13 }, { 0x1F93, 13 },
|
||||
{ 0x1F94, 13 }, { 0x1F95, 13 }, { 0x1F96, 13 }, { 0x1F97, 13 },
|
||||
{ 0x1F98, 13 }, { 0x1F99, 13 }, { 0x1F9A, 13 }, { 0x1F9B, 13 },
|
||||
{ 0x1F9C, 13 }, { 0x1F9D, 13 }, { 0x1F9E, 13 }, { 0x1F9F, 13 },
|
||||
{ 0x1FA0, 13 }, { 0x1FA1, 13 }, { 0x1FA2, 13 }, { 0x1FA3, 13 },
|
||||
{ 0x1FA4, 13 }, { 0x1FA5, 13 }, { 0x1FA6, 13 }, { 0x1FA7, 13 },
|
||||
{ 0x1FA8, 13 }, { 0x1FA9, 13 }, { 0x1FAA, 13 }, { 0x1FAB, 13 },
|
||||
{ 0x1FAC, 13 }, { 0x1FAD, 13 }, { 0x1FAE, 13 }, { 0x1FAF, 13 },
|
||||
{ 0x1FB0, 13 }, { 0x1FB1, 13 }, { 0x1FB2, 13 }, { 0x1FB3, 13 },
|
||||
{ 0x1FB4, 13 }, { 0x1FB5, 13 }, { 0x1FB6, 13 }, { 0x1FB7, 13 },
|
||||
{ 0x1FB8, 13 }, { 0x1FB9, 13 }, { 0x1FBA, 13 }, { 0x1FBB, 13 },
|
||||
{ 0x1FBC, 13 }, { 0x1FBD, 13 }, { 0x1FBE, 13 }, { 0x1FBF, 13 },
|
||||
{ 0x3F80, 14 }, { 0x3F81, 14 }, { 0x3F82, 14 }, { 0x3F83, 14 },
|
||||
{ 0x3F84, 14 }, { 0x3F85, 14 }, { 0x3F86, 14 }, { 0x3F87, 14 },
|
||||
{ 0x3F88, 14 }, { 0x3F89, 14 }, { 0x3F8A, 14 }, { 0x0002, 3 },
|
||||
{ 0x0011, 5 }, { 0x0014, 5 }, { 0x0015, 5 }, { 0x0030, 6 },
|
||||
{ 0x0037, 6 }, { 0x00E2, 8 }, { 0x00E3, 8 }, { 0x00E8, 8 },
|
||||
{ 0x00EB, 8 }, { 0x00EE, 8 }, { 0x01E1, 9 }, { 0x01E4, 9 },
|
||||
{ 0x01E7, 9 }, { 0x01EA, 9 }, { 0x01ED, 9 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static const uint8_t ir2_luma_table[256] = {
|
||||
0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
|
||||
0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
|
||||
0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
|
||||
0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
|
||||
0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
|
||||
0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
|
||||
0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
|
||||
0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
|
||||
0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
|
||||
0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
|
||||
0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
|
||||
0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
|
||||
0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
|
||||
0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
|
||||
0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
|
||||
0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
|
||||
0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
|
||||
0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
|
||||
0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
|
||||
0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
|
||||
0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
|
||||
0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
|
||||
0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
|
||||
0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
|
||||
0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
|
||||
0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
|
||||
0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
|
||||
0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
|
||||
0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
|
||||
0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
|
||||
0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
|
||||
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80
|
||||
static const uint8_t ir2_delta_table[4][256] = {
|
||||
{ 0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
|
||||
0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
|
||||
0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
|
||||
0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
|
||||
0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
|
||||
0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
|
||||
0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
|
||||
0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
|
||||
0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
|
||||
0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
|
||||
0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
|
||||
0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
|
||||
0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
|
||||
0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
|
||||
0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
|
||||
0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
|
||||
0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
|
||||
0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
|
||||
0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
|
||||
0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
|
||||
0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
|
||||
0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
|
||||
0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
|
||||
0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
|
||||
0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
|
||||
0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
|
||||
0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
|
||||
0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
|
||||
0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
|
||||
0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
|
||||
0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
|
||||
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x85, 0x85, 0x7B, 0x7B, 0x7E, 0x87,
|
||||
0x82, 0x79, 0x87, 0x7E, 0x79, 0x82, 0x8F, 0x8F,
|
||||
0x71, 0x71, 0x84, 0x8F, 0x7C, 0x71, 0x8F, 0x84,
|
||||
0x71, 0x7C, 0x75, 0x8B, 0x8B, 0x75, 0x8B, 0x75,
|
||||
0x75, 0x8B, 0x8E, 0x9A, 0x72, 0x66, 0x9A, 0x8E,
|
||||
0x66, 0x72, 0x7B, 0x93, 0x85, 0x6D, 0x93, 0x7B,
|
||||
0x6D, 0x85, 0x9B, 0x9B, 0x65, 0x65, 0x82, 0x9D,
|
||||
0x7E, 0x63, 0x9D, 0x82, 0x63, 0x7E, 0x9B, 0xA8,
|
||||
0x65, 0x58, 0xA8, 0x9B, 0x58, 0x65, 0xA9, 0xA9,
|
||||
0x57, 0x57, 0x8D, 0xAA, 0x73, 0x56, 0xAA, 0x8D,
|
||||
0x56, 0x73, 0x6E, 0x99, 0x92, 0x67, 0x99, 0x6E,
|
||||
0x67, 0x92, 0x76, 0xA2, 0x8A, 0x5E, 0xA2, 0x76,
|
||||
0x5E, 0x8A, 0x7F, 0xAF, 0x81, 0x51, 0xAF, 0x7F,
|
||||
0x51, 0x81, 0xAB, 0xBA, 0x55, 0x46, 0xBA, 0xAB,
|
||||
0x46, 0x55, 0x9A, 0xBB, 0x66, 0x45, 0xBB, 0x9A,
|
||||
0x45, 0x66, 0xBB, 0xBB, 0x45, 0x45, 0x60, 0xA0,
|
||||
0xA0, 0x60, 0xA0, 0x60, 0x60, 0xA0, 0x8B, 0xBE,
|
||||
0x75, 0x42, 0xBE, 0x8B, 0x42, 0x75, 0x66, 0xAA,
|
||||
0x9A, 0x56, 0xAA, 0x66, 0x56, 0x9A, 0x70, 0xB5,
|
||||
0x90, 0x4B, 0xB5, 0x70, 0x4B, 0x90, 0xBE, 0xCF,
|
||||
0x42, 0x31, 0xCF, 0xBE, 0x31, 0x42, 0xAB, 0xD0,
|
||||
0x55, 0x30, 0xD0, 0xAB, 0x30, 0x55, 0xD1, 0xD1,
|
||||
0x2F, 0x2F, 0x9A, 0xD3, 0x66, 0x2D, 0xD3, 0x9A,
|
||||
0x2D, 0x66, 0x7B, 0xC5, 0x85, 0x3B, 0xC5, 0x7B,
|
||||
0x3B, 0x85, 0x54, 0xB4, 0xAC, 0x4C, 0xB4, 0x54,
|
||||
0x4C, 0xAC, 0x5E, 0xBE, 0xA2, 0x42, 0xBE, 0x5E,
|
||||
0x42, 0xA2, 0x87, 0xD8, 0x79, 0x28, 0xD8, 0x87,
|
||||
0x28, 0x79, 0xC0, 0xE8, 0x40, 0x18, 0xE8, 0xC0,
|
||||
0x18, 0x40, 0xD5, 0xE8, 0x2B, 0x18, 0xE8, 0xD5,
|
||||
0x18, 0x2B, 0xAB, 0xE9, 0x55, 0x17, 0xE9, 0xAB,
|
||||
0x17, 0x55, 0x68, 0xCD, 0x98, 0x33, 0xCD, 0x68,
|
||||
0x33, 0x98, 0xEA, 0xEA, 0x16, 0x16, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x86, 0x86, 0x7A, 0x7A, 0x7E, 0x88,
|
||||
0x82, 0x78, 0x88, 0x7E, 0x78, 0x82, 0x92, 0x92,
|
||||
0x6E, 0x6E, 0x85, 0x92, 0x7B, 0x6E, 0x92, 0x85,
|
||||
0x6E, 0x7B, 0x73, 0x8D, 0x8D, 0x73, 0x8D, 0x73,
|
||||
0x73, 0x8D, 0x91, 0x9E, 0x6F, 0x62, 0x9E, 0x91,
|
||||
0x62, 0x6F, 0x79, 0x97, 0x87, 0x69, 0x97, 0x79,
|
||||
0x69, 0x87, 0xA0, 0xA0, 0x60, 0x60, 0x83, 0xA2,
|
||||
0x7D, 0x5E, 0xA2, 0x83, 0x5E, 0x7D, 0xA0, 0xB0,
|
||||
0x60, 0x50, 0xB0, 0xA0, 0x50, 0x60, 0xB1, 0xB1,
|
||||
0x4F, 0x4F, 0x8F, 0xB2, 0x71, 0x4E, 0xB2, 0x8F,
|
||||
0x4E, 0x71, 0x6B, 0x9E, 0x95, 0x62, 0x9E, 0x6B,
|
||||
0x62, 0x95, 0x74, 0xA9, 0x8C, 0x57, 0xA9, 0x74,
|
||||
0x57, 0x8C, 0x7F, 0xB8, 0x81, 0x48, 0xB8, 0x7F,
|
||||
0x48, 0x81, 0xB4, 0xC5, 0x4C, 0x3B, 0xC5, 0xB4,
|
||||
0x3B, 0x4C, 0x9F, 0xC6, 0x61, 0x3A, 0xC6, 0x9F,
|
||||
0x3A, 0x61, 0xC6, 0xC6, 0x3A, 0x3A, 0x59, 0xA7,
|
||||
0xA7, 0x59, 0xA7, 0x59, 0x59, 0xA7, 0x8D, 0xCA,
|
||||
0x73, 0x36, 0xCA, 0x8D, 0x36, 0x73, 0x61, 0xB2,
|
||||
0x9F, 0x4E, 0xB2, 0x61, 0x4E, 0x9F, 0x6D, 0xBF,
|
||||
0x93, 0x41, 0xBF, 0x6D, 0x41, 0x93, 0xCA, 0xDF,
|
||||
0x36, 0x21, 0xDF, 0xCA, 0x21, 0x36, 0xB3, 0xDF,
|
||||
0x4D, 0x21, 0xDF, 0xB3, 0x21, 0x4D, 0xE1, 0xE1,
|
||||
0x1F, 0x1F, 0x9F, 0xE3, 0x61, 0x1D, 0xE3, 0x9F,
|
||||
0x1D, 0x61, 0x7A, 0xD3, 0x86, 0x2D, 0xD3, 0x7A,
|
||||
0x2D, 0x86, 0x4C, 0xBE, 0xB4, 0x42, 0xBE, 0x4C,
|
||||
0x42, 0xB4, 0x57, 0xCA, 0xA9, 0x36, 0xCA, 0x57,
|
||||
0x36, 0xA9, 0x88, 0xE9, 0x78, 0x17, 0xE9, 0x88,
|
||||
0x17, 0x78, 0xCC, 0xFB, 0x34, 0x05, 0xFB, 0xCC,
|
||||
0x05, 0x34, 0xE6, 0xFB, 0x1A, 0x05, 0xFB, 0xE6,
|
||||
0x05, 0x1A, 0xB4, 0xFD, 0x4C, 0x03, 0xFD, 0xB4,
|
||||
0x03, 0x4C, 0x63, 0xDC, 0x9D, 0x24, 0xDC, 0x63,
|
||||
0x24, 0x9D, 0xFE, 0xFE, 0x02, 0x02, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x87, 0x87, 0x79, 0x79, 0x7E, 0x89,
|
||||
0x82, 0x77, 0x89, 0x7E, 0x77, 0x82, 0x95, 0x95,
|
||||
0x6B, 0x6B, 0x86, 0x96, 0x7A, 0x6A, 0x96, 0x86,
|
||||
0x6A, 0x7A, 0x70, 0x90, 0x90, 0x70, 0x90, 0x70,
|
||||
0x70, 0x90, 0x94, 0xA4, 0x6C, 0x5C, 0xA4, 0x94,
|
||||
0x5C, 0x6C, 0x78, 0x9B, 0x88, 0x65, 0x9B, 0x78,
|
||||
0x65, 0x88, 0xA6, 0xA6, 0x5A, 0x5A, 0x83, 0xA9,
|
||||
0x7D, 0x57, 0xA9, 0x83, 0x57, 0x7D, 0xA6, 0xB9,
|
||||
0x5A, 0x47, 0xB9, 0xA6, 0x47, 0x5A, 0xBA, 0xBA,
|
||||
0x46, 0x46, 0x92, 0xBC, 0x6E, 0x44, 0xBC, 0x92,
|
||||
0x44, 0x6E, 0x67, 0xA3, 0x99, 0x5D, 0xA3, 0x67,
|
||||
0x5D, 0x99, 0x72, 0xB0, 0x8E, 0x50, 0xB0, 0x72,
|
||||
0x50, 0x8E, 0x7F, 0xC3, 0x81, 0x3D, 0xC3, 0x7F,
|
||||
0x3D, 0x81, 0xBE, 0xD2, 0x42, 0x2E, 0xD2, 0xBE,
|
||||
0x2E, 0x42, 0xA5, 0xD4, 0x5B, 0x2C, 0xD4, 0xA5,
|
||||
0x2C, 0x5B, 0xD4, 0xD4, 0x2C, 0x2C, 0x52, 0xAE,
|
||||
0xAE, 0x52, 0xAE, 0x52, 0x52, 0xAE, 0x8F, 0xD8,
|
||||
0x71, 0x28, 0xD8, 0x8F, 0x28, 0x71, 0x5B, 0xBB,
|
||||
0xA5, 0x45, 0xBB, 0x5B, 0x45, 0xA5, 0x69, 0xCB,
|
||||
0x97, 0x35, 0xCB, 0x69, 0x35, 0x97, 0xD8, 0xF0,
|
||||
0x28, 0x10, 0xF0, 0xD8, 0x10, 0x28, 0xBD, 0xF1,
|
||||
0x43, 0x0F, 0xF1, 0xBD, 0x0F, 0x43, 0xF3, 0xF3,
|
||||
0x0D, 0x0D, 0xA5, 0xF6, 0x5B, 0x0A, 0xF6, 0xA5,
|
||||
0x0A, 0x5B, 0x78, 0xE2, 0x88, 0x1E, 0xE2, 0x78,
|
||||
0x1E, 0x88, 0x42, 0xC9, 0xBE, 0x37, 0xC9, 0x42,
|
||||
0x37, 0xBE, 0x4F, 0xD8, 0xB1, 0x28, 0xD8, 0x4F,
|
||||
0x28, 0xB1, 0x8A, 0xFD, 0x76, 0x03, 0xFD, 0x8A,
|
||||
0x03, 0x76, 0xDB, 0xFF, 0x25, 0x01, 0xFF, 0xDB,
|
||||
0x01, 0x25, 0xF9, 0xFF, 0x07, 0x01, 0xFF, 0xF9,
|
||||
0x01, 0x07, 0xBE, 0xFF, 0x42, 0x01, 0xFF, 0xBE,
|
||||
0x01, 0x42, 0x5E, 0xED, 0xA2, 0x13, 0xED, 0x5E,
|
||||
0x13, 0xA2, 0xFF, 0xFF, 0x01, 0x01, 0x80, 0x80, },
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_INDEO2DATA_H */
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avcodec.h"
|
||||
#include "bytestream.h"
|
||||
#include "hpeldsp.h"
|
||||
@@ -949,7 +950,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s, AVFrame *frame)
|
||||
}
|
||||
}
|
||||
if (bytestream2_get_bytes_left(&s->stream_ptr) > 1) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
av_log(s->avctx, AV_LOG_DEBUG,
|
||||
"decode finished with %d bytes left over\n",
|
||||
bytestream2_get_bytes_left(&s->stream_ptr));
|
||||
}
|
||||
@@ -987,12 +988,15 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
AVFrame *frame = data;
|
||||
int ret;
|
||||
|
||||
if (buf_size < 2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* decoding map contains 4 bits of information per 8x8 block */
|
||||
s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
|
||||
s->decoding_map_size = AV_RL16(avpkt->data);
|
||||
|
||||
/* compressed buffer needs to be large enough to at least hold an entire
|
||||
* decoding map */
|
||||
if (buf_size < s->decoding_map_size)
|
||||
if (buf_size < s->decoding_map_size + 2)
|
||||
return buf_size;
|
||||
|
||||
if (av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, NULL)) {
|
||||
@@ -1000,8 +1004,8 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
av_frame_unref(s->second_last_frame);
|
||||
}
|
||||
|
||||
s->decoding_map = buf;
|
||||
bytestream2_init(&s->stream_ptr, buf + s->decoding_map_size,
|
||||
s->decoding_map = buf + 2;
|
||||
bytestream2_init(&s->stream_ptr, buf + 2 + s->decoding_map_size,
|
||||
buf_size - s->decoding_map_size);
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user