Compare commits
850 Commits
openh264v1
...
v1.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4adf9cd6dd | ||
|
|
343c7f2923 | ||
|
|
bdb850d29e | ||
|
|
d3ff712c15 | ||
|
|
52cb8c1135 | ||
|
|
440689458a | ||
|
|
dc8471894b | ||
|
|
3cbcc043f9 | ||
|
|
f0732c2c76 | ||
|
|
f3005bbe37 | ||
|
|
56fc515b02 | ||
|
|
51a38ab17a | ||
|
|
e8db09fb56 | ||
|
|
366b012d68 | ||
|
|
26aeb3494c | ||
|
|
0bc453423c | ||
|
|
3a75956fb2 | ||
|
|
d086f28a30 | ||
|
|
18b202df0a | ||
|
|
46de229fee | ||
|
|
0ef69e55e2 | ||
|
|
5921e5e7d3 | ||
|
|
2c44dbae5c | ||
|
|
4048b9791a | ||
|
|
3022d4f655 | ||
|
|
b304687197 | ||
|
|
06b8e1abb7 | ||
|
|
5b12578960 | ||
|
|
9ef0c74fdd | ||
|
|
94d1976a4e | ||
|
|
5a1aedb622 | ||
|
|
153dd0d3f5 | ||
|
|
63926a3d10 | ||
|
|
303bf77e42 | ||
|
|
d28970d625 | ||
|
|
2da0ce6451 | ||
|
|
afbb499c77 | ||
|
|
7c9597c36d | ||
|
|
bf3cc1ed63 | ||
|
|
cea83438bf | ||
|
|
e8cdbd2ea7 | ||
|
|
67664f4dc0 | ||
|
|
c301db696e | ||
|
|
2294b786cf | ||
|
|
9ea4d5bd73 | ||
|
|
497b38e341 | ||
|
|
861f54887d | ||
|
|
7208ed14b1 | ||
|
|
e29ceca392 | ||
|
|
15723e1204 | ||
|
|
1641ce9ee5 | ||
|
|
f9080ac090 | ||
|
|
a73c1e6814 | ||
|
|
7d6d86b63a | ||
|
|
4e9e5f5c36 | ||
|
|
5683393f38 | ||
|
|
ab3b55ae9c | ||
|
|
943981abc4 | ||
|
|
bea361a1f0 | ||
|
|
9391c1586d | ||
|
|
58d9efb582 | ||
|
|
9008b15d94 | ||
|
|
8fc2af760f | ||
|
|
296ab4d490 | ||
|
|
431bcee310 | ||
|
|
7d055cae94 | ||
|
|
8246225eed | ||
|
|
3f19534dd6 | ||
|
|
0a2cd1e59a | ||
|
|
bc1b28b5dd | ||
|
|
09518da545 | ||
|
|
6c1aa29431 | ||
|
|
dc067286b3 | ||
|
|
0a8a4f2284 | ||
|
|
d3b2be5ec2 | ||
|
|
442230a91d | ||
|
|
2211324e2b | ||
|
|
87b73257cb | ||
|
|
fba745f04e | ||
|
|
1734133012 | ||
|
|
e4a278620b | ||
|
|
4f237b51ef | ||
|
|
713beb7df7 | ||
|
|
5fdd01ec0c | ||
|
|
e7a7a35611 | ||
|
|
a3063531c4 | ||
|
|
ee515e8b35 | ||
|
|
fb5c60b6fc | ||
|
|
7629543e3e | ||
|
|
79b38f55ff | ||
|
|
16ca41cada | ||
|
|
0f1737e035 | ||
|
|
5a78735802 | ||
|
|
8d539600bb | ||
|
|
84b3216d7c | ||
|
|
3243a78959 | ||
|
|
195df08bb9 | ||
|
|
4394d22b70 | ||
|
|
2356eb1ff6 | ||
|
|
078d96bef7 | ||
|
|
869870e670 | ||
|
|
3c085aec79 | ||
|
|
9b442b3d44 | ||
|
|
e48cf9f471 | ||
|
|
28469ab3dc | ||
|
|
76b0f8c17a | ||
|
|
02365371e8 | ||
|
|
9ea6603071 | ||
|
|
30d7352d03 | ||
|
|
a4f09f4d76 | ||
|
|
4f4adcec49 | ||
|
|
59b3b428a2 | ||
|
|
8a84d14617 | ||
|
|
7ab0386436 | ||
|
|
605f2fb858 | ||
|
|
f03edd79c2 | ||
|
|
9a0663620a | ||
|
|
1a7d0ab831 | ||
|
|
909a508749 | ||
|
|
5d67df4adb | ||
|
|
151dfe04d5 | ||
|
|
9a9fc4c489 | ||
|
|
1127aa7761 | ||
|
|
8b6bf0499f | ||
|
|
bb21b62cbd | ||
|
|
1cf68cad13 | ||
|
|
a8262dd9e6 | ||
|
|
c245cd2d68 | ||
|
|
095bb83e77 | ||
|
|
b6e28495dd | ||
|
|
1be2cd14c0 | ||
|
|
e4260f6e97 | ||
|
|
b444f8d9d0 | ||
|
|
853d2922db | ||
|
|
7354a8cbae | ||
|
|
c4c73ee5d6 | ||
|
|
051a16e02e | ||
|
|
5752888c81 | ||
|
|
a00dd56f1c | ||
|
|
e5c2f333be | ||
|
|
d9ee702031 | ||
|
|
23b20fb14c | ||
|
|
279e14b34e | ||
|
|
10e2f90b7e | ||
|
|
ca97f78ae8 | ||
|
|
8084a2c797 | ||
|
|
4df4c1d757 | ||
|
|
49af2b592d | ||
|
|
cf3e7b5dec | ||
|
|
478af8f00c | ||
|
|
8ecb8b4200 | ||
|
|
420a81afe4 | ||
|
|
9fc9acfd14 | ||
|
|
7d9fc35235 | ||
|
|
5b27407993 | ||
|
|
1b48e6c88c | ||
|
|
d557578be3 | ||
|
|
f404ce2e56 | ||
|
|
e64e2bb620 | ||
|
|
4192165ec9 | ||
|
|
faf62464a8 | ||
|
|
4ca8ad2612 | ||
|
|
deccd1eadb | ||
|
|
1ae06eab91 | ||
|
|
e2fb48d404 | ||
|
|
8d5ec6759d | ||
|
|
89159ab25f | ||
|
|
f13624316e | ||
|
|
45e3424364 | ||
|
|
4b52d99d97 | ||
|
|
de68ec6f45 | ||
|
|
51f1ea3839 | ||
|
|
acafbb442d | ||
|
|
6afdf36ecc | ||
|
|
7f967f6fc4 | ||
|
|
dfd24a987d | ||
|
|
a45c661525 | ||
|
|
6dcaf2f890 | ||
|
|
e7fff10d91 | ||
|
|
17030193e6 | ||
|
|
d74234d975 | ||
|
|
6664593ef7 | ||
|
|
4b231c8fe6 | ||
|
|
96b1183574 | ||
|
|
5b10c1ff8d | ||
|
|
bd7fabd892 | ||
|
|
8cc53b0231 | ||
|
|
489d121549 | ||
|
|
ee40ba6392 | ||
|
|
8bef6bc942 | ||
|
|
2df0185252 | ||
|
|
d6f7a07b14 | ||
|
|
c1aa2a1edb | ||
|
|
fcae7fd300 | ||
|
|
58f1fef520 | ||
|
|
01fd220ef9 | ||
|
|
eb7b149fcc | ||
|
|
4930111ad3 | ||
|
|
d9502aa71d | ||
|
|
50ce93e31c | ||
|
|
7d1d2d658f | ||
|
|
5702e7c0ca | ||
|
|
c69d628a82 | ||
|
|
4df6f9420f | ||
|
|
3cf2be2590 | ||
|
|
9e00bf89aa | ||
|
|
4f33b38ac1 | ||
|
|
b83b19254d | ||
|
|
96384bd578 | ||
|
|
af938a640f | ||
|
|
ef82e18d74 | ||
|
|
1646f86b37 | ||
|
|
a1b8ffc9df | ||
|
|
a852ac99ed | ||
|
|
93cb617932 | ||
|
|
99925984b3 | ||
|
|
cd55201600 | ||
|
|
a44643aeda | ||
|
|
aea1017562 | ||
|
|
9ba316caf4 | ||
|
|
d6b4b5365d | ||
|
|
75bbc286e1 | ||
|
|
c8972f1c32 | ||
|
|
98ed302990 | ||
|
|
e9ec603fd7 | ||
|
|
dbcbe180e6 | ||
|
|
b603844126 | ||
|
|
0250acc665 | ||
|
|
d7304bbaf4 | ||
|
|
264cf57616 | ||
|
|
5b5cc8434e | ||
|
|
ea533e6405 | ||
|
|
993caea18c | ||
|
|
cb49f8ecbd | ||
|
|
fc6ea7e5a8 | ||
|
|
9a55a8609e | ||
|
|
560a33a373 | ||
|
|
c02d9b0865 | ||
|
|
4f826f2e94 | ||
|
|
a39c46601d | ||
|
|
f594d96a51 | ||
|
|
34661f1d86 | ||
|
|
cdd072e1d4 | ||
|
|
47dd4de412 | ||
|
|
1518b5da58 | ||
|
|
8e35224134 | ||
|
|
ea06cbe06b | ||
|
|
04cb9f3477 | ||
|
|
958c60d041 | ||
|
|
44bce08d60 | ||
|
|
a4ae5e3747 | ||
|
|
76ef30dc82 | ||
|
|
a5cb0ea22c | ||
|
|
900a908929 | ||
|
|
3a91abf28c | ||
|
|
e48585236e | ||
|
|
d92853c88e | ||
|
|
fb33b359d5 | ||
|
|
17a87e8081 | ||
|
|
71123f29ef | ||
|
|
178a18b30e | ||
|
|
735172d387 | ||
|
|
5c3c2a569c | ||
|
|
aa1ec23ecd | ||
|
|
62c6a1e099 | ||
|
|
207082e237 | ||
|
|
68ff8468af | ||
|
|
61cd77d487 | ||
|
|
e8b68d2460 | ||
|
|
ac08cc4b2f | ||
|
|
9a89ee72b0 | ||
|
|
c72d3ad51a | ||
|
|
ce14a0e4f9 | ||
|
|
3244f11cfe | ||
|
|
b719c3b0d5 | ||
|
|
3422d3b976 | ||
|
|
01b74ea7c1 | ||
|
|
7d5e88ffda | ||
|
|
2ef9a8aee9 | ||
|
|
65e73d969a | ||
|
|
50dc4757e4 | ||
|
|
1a995cc991 | ||
|
|
93621d6d9a | ||
|
|
a24bac34bd | ||
|
|
3901045318 | ||
|
|
ba314d16e7 | ||
|
|
bdd02db04a | ||
|
|
e3e5208509 | ||
|
|
47d8a840c0 | ||
|
|
ad8ba85136 | ||
|
|
81805ab23d | ||
|
|
22cabd39ca | ||
|
|
a53dc467f6 | ||
|
|
d2d4ab8c67 | ||
|
|
65dcd57c1b | ||
|
|
dc86cfe5d8 | ||
|
|
b12b39a47b | ||
|
|
7ee00b0618 | ||
|
|
6050bf89f6 | ||
|
|
26ccd837f1 | ||
|
|
4ebeb4bb70 | ||
|
|
586893ca4b | ||
|
|
b455c035f7 | ||
|
|
00a2dc290c | ||
|
|
bac135ae81 | ||
|
|
1fb6b91b72 | ||
|
|
9c0bbeb4da | ||
|
|
0babd8d7ab | ||
|
|
13f6ff59cc | ||
|
|
bd50f64152 | ||
|
|
8b7be9f3bc | ||
|
|
8de54078d7 | ||
|
|
328094acfd | ||
|
|
cf6450b269 | ||
|
|
59aee6052a | ||
|
|
2e4fd4248a | ||
|
|
9cc395fc4e | ||
|
|
2c99f5810e | ||
|
|
1c7d3d4b47 | ||
|
|
bdbda13929 | ||
|
|
63375de8d7 | ||
|
|
09f6eeb940 | ||
|
|
692614b057 | ||
|
|
ca36fe5128 | ||
|
|
eb8e25a038 | ||
|
|
e3bf63db59 | ||
|
|
83b502b3f6 | ||
|
|
1699775cbb | ||
|
|
9a602cac1b | ||
|
|
c1752e2818 | ||
|
|
397c7caa56 | ||
|
|
887b4f47fc | ||
|
|
7411469e1d | ||
|
|
ef5f1c46b9 | ||
|
|
7d8bb6f290 | ||
|
|
809adc4129 | ||
|
|
f0934c7bf3 | ||
|
|
c3de0f99c5 | ||
|
|
3ae2507c99 | ||
|
|
afd82b2cfa | ||
|
|
0dc461541a | ||
|
|
8bfeae27a4 | ||
|
|
4fb442a983 | ||
|
|
91574afca4 | ||
|
|
b8ce2eb40e | ||
|
|
e6134b5972 | ||
|
|
5b2469c0b5 | ||
|
|
4db34bdf43 | ||
|
|
b208cac1c5 | ||
|
|
916d24d99e | ||
|
|
7f27198c68 | ||
|
|
208400eeb4 | ||
|
|
ab480fe387 | ||
|
|
58e868c074 | ||
|
|
8dbdb418ca | ||
|
|
1b26bd4b88 | ||
|
|
3c08f04993 | ||
|
|
030d320e43 | ||
|
|
182ae421a1 | ||
|
|
9f0ed3fc4b | ||
|
|
ac992acaa9 | ||
|
|
490a3e5562 | ||
|
|
590eef6059 | ||
|
|
affa753d5d | ||
|
|
f89780ddd8 | ||
|
|
6f876d79a6 | ||
|
|
ee5896e4a1 | ||
|
|
4746ce8fd4 | ||
|
|
f90cd367d2 | ||
|
|
47df411b1a | ||
|
|
9692f6cb20 | ||
|
|
f4b3724976 | ||
|
|
59fefbe7c7 | ||
|
|
a9c2e1b431 | ||
|
|
a4370b8ca8 | ||
|
|
0612b07a6f | ||
|
|
6a10553dce | ||
|
|
f132745882 | ||
|
|
89f78e9211 | ||
|
|
fdb938a2c2 | ||
|
|
b932547fe8 | ||
|
|
d387ebc358 | ||
|
|
026ce4030a | ||
|
|
2c69638773 | ||
|
|
812b57c704 | ||
|
|
173ec608ff | ||
|
|
ca2436bb5e | ||
|
|
827c7b2aef | ||
|
|
d87663b913 | ||
|
|
c0633a147e | ||
|
|
91736e85e8 | ||
|
|
54cc3daaa7 | ||
|
|
8a2237751a | ||
|
|
3aac5e0fae | ||
|
|
8fb4048241 | ||
|
|
57043d16ad | ||
|
|
d422ee59ad | ||
|
|
ac061fe635 | ||
|
|
091e5cba0a | ||
|
|
eeee1a2e95 | ||
|
|
c20e1c6795 | ||
|
|
509727e225 | ||
|
|
5ab5fe155b | ||
|
|
7dcaaf5328 | ||
|
|
ad38cfe46c | ||
|
|
cc1f3ade3a | ||
|
|
984497cc09 | ||
|
|
06c251fa48 | ||
|
|
93265d7a44 | ||
|
|
1bdf00ddf4 | ||
|
|
41339f3023 | ||
|
|
0ff1eb482f | ||
|
|
ec99819ce8 | ||
|
|
3be8ae7a4e | ||
|
|
2e85e3c7d9 | ||
|
|
f1a7a1a966 | ||
|
|
3e57fdc448 | ||
|
|
5ff55a6ec2 | ||
|
|
44e4531897 | ||
|
|
44bd61683a | ||
|
|
d20a3bdb28 | ||
|
|
32d6193f97 | ||
|
|
5ba9e409ba | ||
|
|
2c468b96a9 | ||
|
|
ecc8ae6ebb | ||
|
|
065c3a7769 | ||
|
|
7da17b5abd | ||
|
|
af97f2d4bb | ||
|
|
4e88de1755 | ||
|
|
87c83c0d36 | ||
|
|
44017193ed | ||
|
|
b65410ebdb | ||
|
|
354eee3e2b | ||
|
|
155a91406c | ||
|
|
e47a3638af | ||
|
|
944a041066 | ||
|
|
14eeaf2278 | ||
|
|
e041bc6938 | ||
|
|
901a599b36 | ||
|
|
cc5978b252 | ||
|
|
c2d585761a | ||
|
|
317ac1ca85 | ||
|
|
56c895ffb4 | ||
|
|
c01606c28a | ||
|
|
ea93f3943e | ||
|
|
a8159c89d1 | ||
|
|
befd5bdd56 | ||
|
|
fc895c13ce | ||
|
|
054b8eeb3a | ||
|
|
60b6ce1454 | ||
|
|
928a7eac2a | ||
|
|
a5cabf0be4 | ||
|
|
91ae2dab7a | ||
|
|
dd24edc8ff | ||
|
|
5d4eb63d52 | ||
|
|
f4af5d2fda | ||
|
|
6981aec743 | ||
|
|
8b9be2b3dc | ||
|
|
f668e1be98 | ||
|
|
607d814e0f | ||
|
|
3d263d1087 | ||
|
|
9b59e50292 | ||
|
|
a48b632aed | ||
|
|
e132658346 | ||
|
|
59c30f8952 | ||
|
|
575b6fb570 | ||
|
|
2c9b5b98c0 | ||
|
|
8e419e41d3 | ||
|
|
80beaed5c6 | ||
|
|
8f7e10ab12 | ||
|
|
a7d8142a44 | ||
|
|
397e20b0f3 | ||
|
|
852ed8a2d0 | ||
|
|
2e15351d6d | ||
|
|
b1dccaa627 | ||
|
|
8c7aaa8421 | ||
|
|
9a08b7f97c | ||
|
|
a100fb8031 | ||
|
|
8e39cb3a3a | ||
|
|
d58f90947c | ||
|
|
8028fe7130 | ||
|
|
c592d18dfd | ||
|
|
30820fd8b5 | ||
|
|
7cea82bdf8 | ||
|
|
e7debe7351 | ||
|
|
59e782a8a5 | ||
|
|
1526de3ae5 | ||
|
|
0bae0f869a | ||
|
|
24cd934ba9 | ||
|
|
90eee67eb7 | ||
|
|
b9dc310857 | ||
|
|
504cabf106 | ||
|
|
c44d4a7f07 | ||
|
|
917d41bd47 | ||
|
|
7c0369da23 | ||
|
|
82b70b34fe | ||
|
|
3a73179cab | ||
|
|
69f6db1b90 | ||
|
|
c2c861f199 | ||
|
|
3f69873c99 | ||
|
|
92bc88eacb | ||
|
|
80ce939d7a | ||
|
|
a43fa3aec2 | ||
|
|
e1262a9ac9 | ||
|
|
fe7faf768a | ||
|
|
aa5e7f7927 | ||
|
|
9da19758cf | ||
|
|
f131b4540b | ||
|
|
2e5243e5fc | ||
|
|
4a6de5bb13 | ||
|
|
347e4893a9 | ||
|
|
94dde141fa | ||
|
|
f48b2e55ba | ||
|
|
7be8d200d5 | ||
|
|
1ff9de36ce | ||
|
|
22cc0a88c6 | ||
|
|
0d426b826d | ||
|
|
d543ae89db | ||
|
|
29da6a600a | ||
|
|
cef85118b5 | ||
|
|
305a2421be | ||
|
|
f1fb0d6b69 | ||
|
|
9425c2ab10 | ||
|
|
3be7e90221 | ||
|
|
48e79d51b5 | ||
|
|
336b2d1537 | ||
|
|
b231e3f000 | ||
|
|
53c14dccf0 | ||
|
|
3025c58a67 | ||
|
|
a0b0866597 | ||
|
|
1359583c55 | ||
|
|
7175d3c90e | ||
|
|
cdd410ca66 | ||
|
|
24fb213d6e | ||
|
|
0b2c82d92b | ||
|
|
810b9770fc | ||
|
|
b18e905946 | ||
|
|
c13bfe6407 | ||
|
|
0252f3f346 | ||
|
|
b05a52be7a | ||
|
|
7e24efc620 | ||
|
|
02853a9a96 | ||
|
|
cbb6e993cf | ||
|
|
bfee07dde4 | ||
|
|
deefdcee10 | ||
|
|
45c322a8ae | ||
|
|
606da1a97d | ||
|
|
9ec743c156 | ||
|
|
0d16fd61b2 | ||
|
|
703bbef128 | ||
|
|
b56b8725fc | ||
|
|
aed7b2316c | ||
|
|
2453676960 | ||
|
|
7a2e536e44 | ||
|
|
66165a65d5 | ||
|
|
b3922b1d3a | ||
|
|
e4f114e006 | ||
|
|
429ccb38a8 | ||
|
|
9ba0a1d977 | ||
|
|
2527cf5d0b | ||
|
|
cd5928d397 | ||
|
|
f42c9fae42 | ||
|
|
a37f1abe5e | ||
|
|
128546b992 | ||
|
|
560fcf17fd | ||
|
|
fd45e7ff15 | ||
|
|
9512515a41 | ||
|
|
24823621e1 | ||
|
|
c31511257b | ||
|
|
1c44c43b8a | ||
|
|
0aa77d2985 | ||
|
|
8b49f98475 | ||
|
|
fc811a80fb | ||
|
|
843955bc06 | ||
|
|
a7b22795bf | ||
|
|
3c753c42b8 | ||
|
|
067fa09781 | ||
|
|
c8afd15681 | ||
|
|
80bfc43df5 | ||
|
|
50e2eb5e3c | ||
|
|
2b9f4f6607 | ||
|
|
08c07e4b8f | ||
|
|
ac404ce69d | ||
|
|
44013d4cd5 | ||
|
|
789603a8b1 | ||
|
|
7fa6c576e3 | ||
|
|
0fa667ac5f | ||
|
|
1a7826c6eb | ||
|
|
5cb5c28331 | ||
|
|
45ef803e4d | ||
|
|
3d21825901 | ||
|
|
ba0351f569 | ||
|
|
63180b9b36 | ||
|
|
8ed4e83e93 | ||
|
|
32697b046b | ||
|
|
b896faa47c | ||
|
|
103fa5bbed | ||
|
|
fe55d5a208 | ||
|
|
18ed25fbb3 | ||
|
|
783daf3d8a | ||
|
|
54c677cdd7 | ||
|
|
08baf65251 | ||
|
|
ca1c357058 | ||
|
|
8ffacf0918 | ||
|
|
0e9541247a | ||
|
|
c1b48640fb | ||
|
|
c5029ef275 | ||
|
|
e061bb3fc9 | ||
|
|
2951a7f3a3 | ||
|
|
7478714ac9 | ||
|
|
9ac2d2ad85 | ||
|
|
dbd4330508 | ||
|
|
938f441751 | ||
|
|
880e0fff06 | ||
|
|
c19db25043 | ||
|
|
cf85745752 | ||
|
|
c7b5051738 | ||
|
|
07bf80ba39 | ||
|
|
53e2f67e80 | ||
|
|
3abd54ca73 | ||
|
|
8e49898243 | ||
|
|
66b1610114 | ||
|
|
24192cc235 | ||
|
|
655f3b43b6 | ||
|
|
a291470072 | ||
|
|
ec0d151879 | ||
|
|
3b5448cbbc | ||
|
|
055915d720 | ||
|
|
100de97b49 | ||
|
|
3a1f0a3d95 | ||
|
|
41ed734674 | ||
|
|
b8e0a3fa38 | ||
|
|
7ce4da8a41 | ||
|
|
1c2940479d | ||
|
|
2907cb2875 | ||
|
|
a625dc836d | ||
|
|
9be23c7821 | ||
|
|
7f645bf2f7 | ||
|
|
54c24dfd60 | ||
|
|
c83ab3bca1 | ||
|
|
58cc29225e | ||
|
|
d3a971e32c | ||
|
|
329ccd7d6f | ||
|
|
f10f6a788f | ||
|
|
f84560474c | ||
|
|
f2c1395ab6 | ||
|
|
9a9f92bcfe | ||
|
|
26615fffd0 | ||
|
|
a2d5254bc3 | ||
|
|
4fab8c2ee7 | ||
|
|
292d2511e2 | ||
|
|
4292f91ae5 | ||
|
|
5cefad2d3f | ||
|
|
fcb84f5fb6 | ||
|
|
fe621b92bf | ||
|
|
1ad797a81e | ||
|
|
9a72378c34 | ||
|
|
ec901a14d6 | ||
|
|
abc01e6b81 | ||
|
|
d3c8ade8d0 | ||
|
|
46d30cd33c | ||
|
|
2dbb757d30 | ||
|
|
34cb0d60aa | ||
|
|
6a2a4efef6 | ||
|
|
ea9b80adb3 | ||
|
|
468fce0887 | ||
|
|
f0c6891627 | ||
|
|
50fd617e86 | ||
|
|
ac290d65c7 | ||
|
|
3cce92ea19 | ||
|
|
dcdcc7f3b8 | ||
|
|
273e1227a5 | ||
|
|
43c62d06eb | ||
|
|
5d6b20119a | ||
|
|
a594ddf3e7 | ||
|
|
0a3d4c4ebc | ||
|
|
57aae73d4c | ||
|
|
94a1d4426e | ||
|
|
23b5a61153 | ||
|
|
33e67427ab | ||
|
|
4e89e71e8f | ||
|
|
8d5863a170 | ||
|
|
97298de90a | ||
|
|
3c4279cdd8 | ||
|
|
452fb868c7 | ||
|
|
41720f8df5 | ||
|
|
769c38d4c4 | ||
|
|
195d13612c | ||
|
|
6c4f0d7d85 | ||
|
|
e415c3fe70 | ||
|
|
b17e9bb320 | ||
|
|
7720f2cc5d | ||
|
|
88b7a62f98 | ||
|
|
a765197b73 | ||
|
|
d720122a37 | ||
|
|
cbe7891300 | ||
|
|
5762cbb8fc | ||
|
|
1a78f69f2f | ||
|
|
d1a3bd3d33 | ||
|
|
89454f0cf9 | ||
|
|
9a0d56da97 | ||
|
|
d74c0f6ae6 | ||
|
|
9d182ee515 | ||
|
|
2479abf5c0 | ||
|
|
869c567f04 | ||
|
|
cdb7e5da61 | ||
|
|
46ee46c186 | ||
|
|
d9e0f2b023 | ||
|
|
39d725c113 | ||
|
|
cab92a3e36 | ||
|
|
ba535bda4d | ||
|
|
2ff61475d6 | ||
|
|
1e62aafcde | ||
|
|
4fc27714bd | ||
|
|
3ad4d9070e | ||
|
|
024ac63f15 | ||
|
|
614e898b67 | ||
|
|
3885bd8f0e | ||
|
|
b425450bc1 | ||
|
|
ad247a9a4a | ||
|
|
f9bab05b3a | ||
|
|
52419bd13e | ||
|
|
8c8cd50c96 | ||
|
|
68fed53687 | ||
|
|
b7c54242a9 | ||
|
|
04c2a7ac5c | ||
|
|
27a21edcc9 | ||
|
|
3593f2e3e7 | ||
|
|
007fb47004 | ||
|
|
0affe66f93 | ||
|
|
311272d341 | ||
|
|
efdefdba28 | ||
|
|
a3a0effc88 | ||
|
|
d875d923f8 | ||
|
|
6b1630cc90 | ||
|
|
3904c025cb | ||
|
|
72df20000b | ||
|
|
fd8d41dbb9 | ||
|
|
07fa3d1898 | ||
|
|
6673a5f71e | ||
|
|
e4b373a800 | ||
|
|
cf2cf9efd9 | ||
|
|
6ae38da3ab | ||
|
|
19c02bdfa8 | ||
|
|
bab0bf18f8 | ||
|
|
8945348c87 | ||
|
|
ed341048de | ||
|
|
73d27e9776 | ||
|
|
bef3d87f34 | ||
|
|
9f20c727d1 | ||
|
|
810d20a59d | ||
|
|
d0f9b218f4 | ||
|
|
ffebbdb9b2 | ||
|
|
4e57a46ca5 | ||
|
|
c618cb1eaf | ||
|
|
a3bdf4ffc9 | ||
|
|
147c9052b8 | ||
|
|
cfbf32b3fb | ||
|
|
f8d2ae42ef | ||
|
|
a59a989d9b | ||
|
|
06e56ecdd8 | ||
|
|
f6fb459a7f | ||
|
|
fd8db0451e | ||
|
|
ee2f87dbbc | ||
|
|
17df23c2eb | ||
|
|
480ff5acc2 | ||
|
|
66e38cc9ed | ||
|
|
c480ffdad5 | ||
|
|
84ca659f06 | ||
|
|
25cad576b3 | ||
|
|
f5b9d920ff | ||
|
|
64fa8a6b60 | ||
|
|
ac2de4cbab | ||
|
|
3ba0a9956a | ||
|
|
c4a446b43a | ||
|
|
880bf2d621 | ||
|
|
1d37250301 | ||
|
|
7e71714863 | ||
|
|
05684744c9 | ||
|
|
3ff145e839 | ||
|
|
25b723c413 | ||
|
|
ca96def4ff | ||
|
|
c213c6ba30 | ||
|
|
8538b22f23 | ||
|
|
399ca33284 | ||
|
|
4e54fd191b | ||
|
|
19dcff8616 | ||
|
|
68e92f9eb6 | ||
|
|
5c67f368c3 | ||
|
|
a6cc71208e | ||
|
|
58eba54e8c | ||
|
|
9d9c609aab | ||
|
|
958113073f | ||
|
|
37ae6505d4 | ||
|
|
c5091e73be | ||
|
|
8eafdfa598 | ||
|
|
e7cd53e81b | ||
|
|
f8d5f93b16 | ||
|
|
48f203929e | ||
|
|
b85a09163f | ||
|
|
49ce86c78a | ||
|
|
72862118f9 | ||
|
|
631ca210a8 | ||
|
|
b51ff51387 | ||
|
|
4001551027 | ||
|
|
458cc6b4fd | ||
|
|
522aa4457a | ||
|
|
311f7006fd | ||
|
|
9913b73cb1 | ||
|
|
9e7a19291c | ||
|
|
0fe477625c | ||
|
|
6b64efbf92 | ||
|
|
235f6e3474 | ||
|
|
77552551f7 | ||
|
|
679cc4ac6c | ||
|
|
c6a136c742 | ||
|
|
1a394d1432 | ||
|
|
bffbde9f45 | ||
|
|
84848bb7d3 | ||
|
|
bb43c1c9a9 | ||
|
|
f003fa1fe6 | ||
|
|
1df4cd43cc | ||
|
|
6f553c9742 | ||
|
|
79157ce632 | ||
|
|
a6df69c305 | ||
|
|
a1dbf6ab13 | ||
|
|
ef590de0dc | ||
|
|
684c42536d | ||
|
|
881667a533 | ||
|
|
4fc144b698 | ||
|
|
1b1ea2b9ef | ||
|
|
d63172db9b | ||
|
|
2f041c7a4b | ||
|
|
43dc6f01e1 | ||
|
|
61926f208c | ||
|
|
199d19a785 | ||
|
|
7c95ccc6a7 | ||
|
|
f2437f24b9 | ||
|
|
c287a9109f | ||
|
|
3735cfc1bd | ||
|
|
315d9315c4 | ||
|
|
7e8cde055f | ||
|
|
d98fd57252 | ||
|
|
4ece8efaed | ||
|
|
cef43e30fe | ||
|
|
15124b1258 | ||
|
|
b5a01efa96 | ||
|
|
aa7eb5fd09 | ||
|
|
849a730608 | ||
|
|
24bd0b74ae |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -44,3 +44,6 @@ testbin/test_vd_rc.264
|
|||||||
testbin/test_vd_rc.yuv
|
testbin/test_vd_rc.yuv
|
||||||
testbin/test.264
|
testbin/test.264
|
||||||
testbin/test.yuv
|
testbin/test.yuv
|
||||||
|
|
||||||
|
# pkg-config file
|
||||||
|
*.pc
|
||||||
|
|||||||
99
Makefile
99
Makefile
@@ -22,10 +22,14 @@ V=Yes
|
|||||||
PREFIX=/usr/local
|
PREFIX=/usr/local
|
||||||
SHARED=-shared
|
SHARED=-shared
|
||||||
OBJ=o
|
OBJ=o
|
||||||
|
DESTDIR=
|
||||||
|
SHAREDLIB_DIR=$(PREFIX)/lib
|
||||||
PROJECT_NAME=openh264
|
PROJECT_NAME=openh264
|
||||||
MODULE_NAME=gmpopenh264
|
MODULE_NAME=gmpopenh264
|
||||||
GMP_API_BRANCH=master
|
GMP_API_BRANCH=Firefox38
|
||||||
CCASFLAGS=$(CFLAGS)
|
CCASFLAGS=$(CFLAGS)
|
||||||
|
VERSION=1.4
|
||||||
|
STATIC_LDFLAGS=-lstdc++
|
||||||
|
|
||||||
ifeq (,$(wildcard $(SRC_PATH)gmp-api))
|
ifeq (,$(wildcard $(SRC_PATH)gmp-api))
|
||||||
HAVE_GMP_API=No
|
HAVE_GMP_API=No
|
||||||
@@ -44,7 +48,7 @@ ifeq ($(BUILDTYPE), Release)
|
|||||||
CFLAGS += $(CFLAGS_OPT)
|
CFLAGS += $(CFLAGS_OPT)
|
||||||
USE_ASM = Yes
|
USE_ASM = Yes
|
||||||
else
|
else
|
||||||
CFLAGS = $(CFLAGS_DEBUG)
|
CFLAGS += $(CFLAGS_DEBUG)
|
||||||
USE_ASM = No
|
USE_ASM = No
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -53,10 +57,11 @@ CFLAGS += -fsanitize=address
|
|||||||
LDFLAGS += -fsanitize=address
|
LDFLAGS += -fsanitize=address
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
SHAREDLIBVERSION=0
|
||||||
include $(SRC_PATH)build/platform-$(OS).mk
|
include $(SRC_PATH)build/platform-$(OS).mk
|
||||||
|
|
||||||
|
|
||||||
CFLAGS +=
|
CFLAGS += -DGENERATED_VERSION_HEADER
|
||||||
LDFLAGS +=
|
LDFLAGS +=
|
||||||
|
|
||||||
ifeq (Yes, $(GCOV))
|
ifeq (Yes, $(GCOV))
|
||||||
@@ -101,6 +106,7 @@ GTEST_INCLUDES += \
|
|||||||
CODEC_UNITTEST_INCLUDES += \
|
CODEC_UNITTEST_INCLUDES += \
|
||||||
-I$(SRC_PATH)gtest/include \
|
-I$(SRC_PATH)gtest/include \
|
||||||
-I$(SRC_PATH)codec/common/inc \
|
-I$(SRC_PATH)codec/common/inc \
|
||||||
|
-I$(SRC_PATH)test
|
||||||
|
|
||||||
CONSOLE_COMMON_INCLUDES += \
|
CONSOLE_COMMON_INCLUDES += \
|
||||||
-I$(SRC_PATH)codec/console/common/inc
|
-I$(SRC_PATH)codec/console/common/inc
|
||||||
@@ -115,14 +121,20 @@ H264ENC_DEPS = $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFF
|
|||||||
|
|
||||||
CODEC_UNITTEST_LDFLAGS = $(LINK_LOCAL_DIR) $(call LINK_LIB,gtest) $(call LINK_LIB,decoder) $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common) $(CODEC_UNITTEST_LDFLAGS_SUFFIX)
|
CODEC_UNITTEST_LDFLAGS = $(LINK_LOCAL_DIR) $(call LINK_LIB,gtest) $(call LINK_LIB,decoder) $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common) $(CODEC_UNITTEST_LDFLAGS_SUFFIX)
|
||||||
CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
|
CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
|
||||||
DECODER_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(DECODER_INCLUDES) -I$(SRC_PATH)test -I$(SRC_PATH)test/decoder
|
DECODER_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(DECODER_INCLUDES)
|
||||||
ENCODER_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(ENCODER_INCLUDES) -I$(SRC_PATH)test -I$(SRC_PATH)test/encoder
|
ENCODER_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(ENCODER_INCLUDES)
|
||||||
PROCESSING_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(PROCESSING_INCLUDES) -I$(SRC_PATH)test -I$(SRC_PATH)test/processing
|
PROCESSING_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(PROCESSING_INCLUDES)
|
||||||
API_TEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) -I$(SRC_PATH)test -I$(SRC_PATH)test/api
|
API_TEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES)
|
||||||
COMMON_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(DECODER_INCLUDES) -I$(SRC_PATH)test -I$(SRC_PATH)test/common
|
COMMON_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES)
|
||||||
MODULE_INCLUDES += -I$(SRC_PATH)gmp-api
|
MODULE_INCLUDES += -I$(SRC_PATH)gmp-api
|
||||||
|
|
||||||
.PHONY: test gtest-bootstrap clean
|
DECODER_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
||||||
|
ENCODER_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
||||||
|
PROCESSING_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
||||||
|
API_TEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
||||||
|
COMMON_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS)
|
||||||
|
|
||||||
|
.PHONY: test gtest-bootstrap clean $(PROJECT_NAME).pc $(PROJECT_NAME)-static.pc
|
||||||
|
|
||||||
all: libraries binaries
|
all: libraries binaries
|
||||||
|
|
||||||
@@ -136,7 +148,7 @@ clean:
|
|||||||
ifeq (android,$(OS))
|
ifeq (android,$(OS))
|
||||||
clean: clean_Android
|
clean: clean_Android
|
||||||
endif
|
endif
|
||||||
$(QUIET)rm -f $(OBJS) $(OBJS:.$(OBJ)=.d) $(LIBRARIES) $(BINARIES)
|
$(QUIET)rm -f $(OBJS) $(OBJS:.$(OBJ)=.d) $(OBJS:.$(OBJ)=.obj) $(LIBRARIES) $(BINARIES) *.lib *.a *.dylib *.dll *.so *.exe *.pdb *.exp *.pc
|
||||||
|
|
||||||
gmp-bootstrap:
|
gmp-bootstrap:
|
||||||
if [ ! -d gmp-api ] ; then git clone https://github.com/mozilla/gmp-api gmp-api ; fi
|
if [ ! -d gmp-api ] ; then git clone https://github.com/mozilla/gmp-api gmp-api ; fi
|
||||||
@@ -183,45 +195,70 @@ else
|
|||||||
libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX)
|
libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBRARIES += $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX)
|
LIBRARIES += $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
|
||||||
|
|
||||||
$(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
$(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
||||||
$(QUIET)rm -f $@
|
$(QUIET)rm -f $@
|
||||||
$(QUIET_AR)$(AR) $(AR_OPTS) $+
|
$(QUIET_AR)$(AR) $(AR_OPTS) $+
|
||||||
|
|
||||||
$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
||||||
$(QUIET)rm -f $@
|
$(QUIET)rm -f $@
|
||||||
$(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+ $(SHLDFLAGS)
|
$(QUIET_CXX)$(CXX) $(SHARED) $(CXX_LINK_O) $+ $(LDFLAGS) $(SHLDFLAGS)
|
||||||
|
|
||||||
|
ifneq ($(SHAREDLIBSUFFIXVER),$(SHAREDLIBSUFFIX))
|
||||||
|
$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX): $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
|
||||||
|
$(QUIET)ln -sfn $+ $@
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_GMP_API),Yes)
|
ifeq ($(HAVE_GMP_API),Yes)
|
||||||
plugin: $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX)
|
plugin: $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX)
|
||||||
LIBRARIES += $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX)
|
LIBRARIES += $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER)
|
||||||
else
|
else
|
||||||
plugin:
|
plugin:
|
||||||
@echo "./gmp-api : No such file or directory."
|
@echo "./gmp-api : No such file or directory."
|
||||||
@echo "You do not have gmp-api. Run make gmp-bootstrap to get the gmp-api headers."
|
@echo "You do not have gmp-api. Run make gmp-bootstrap to get the gmp-api headers."
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX): $(MODULE_OBJS) $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
$(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER): $(MODULE_OBJS) $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
|
||||||
$(QUIET)rm -f $@
|
$(QUIET)rm -f $@
|
||||||
$(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+ $(SHLDFLAGS) $(MODULE_LDFLAGS)
|
$(QUIET_CXX)$(CXX) $(SHARED) $(CXX_LINK_O) $+ $(LDFLAGS) $(SHLDFLAGS) $(MODULE_LDFLAGS)
|
||||||
|
|
||||||
install-headers:
|
ifneq ($(SHAREDLIBSUFFIXVER),$(SHAREDLIBSUFFIX))
|
||||||
mkdir -p $(PREFIX)/include/wels
|
$(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX): $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIXVER)
|
||||||
install -m 644 codec/api/svc/codec*.h $(PREFIX)/include/wels
|
$(QUIET)ln -sfn $+ $@
|
||||||
|
|
||||||
install-static: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) install-headers
|
|
||||||
mkdir -p $(PREFIX)/lib
|
|
||||||
install -m 644 $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(PREFIX)/lib
|
|
||||||
|
|
||||||
install-shared: $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) install-headers
|
|
||||||
mkdir -p $(PREFIX)/lib
|
|
||||||
install -m 755 $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) $(PREFIX)/lib
|
|
||||||
ifneq ($(EXTRA_LIBRARY),)
|
|
||||||
install -m 644 $(EXTRA_LIBRARY) $(PREFIX)/lib
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install: install-static install-shared
|
$(PROJECT_NAME).pc: $(PROJECT_NAME).pc.in
|
||||||
|
@sed -e 's;@prefix@;$(PREFIX);' -e 's;@VERSION@;$(VERSION);' -e 's;@LIBS@;;' -e 's;@LIBS_PRIVATE@;$(STATIC_LDFLAGS);' < $(PROJECT_NAME).pc.in > $@
|
||||||
|
|
||||||
|
$(PROJECT_NAME)-static.pc: $(PROJECT_NAME).pc.in
|
||||||
|
@sed -e 's;@prefix@;$(PREFIX);' -e 's;@VERSION@;$(VERSION);' -e 's;@LIBS@;$(STATIC_LDFLAGS);' -e 's;@LIBS_PRIVATE@;;' < $(PROJECT_NAME).pc.in > $@
|
||||||
|
|
||||||
|
install-headers:
|
||||||
|
mkdir -p $(DESTDIR)/$(PREFIX)/include/wels
|
||||||
|
install -m 644 codec/api/svc/codec*.h $(DESTDIR)/$(PREFIX)/include/wels
|
||||||
|
|
||||||
|
install-static-lib: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) install-headers
|
||||||
|
mkdir -p $(DESTDIR)/$(PREFIX)/lib
|
||||||
|
install -m 644 $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(DESTDIR)/$(PREFIX)/lib
|
||||||
|
|
||||||
|
install-static: install-static-lib $(PROJECT_NAME)-static.pc
|
||||||
|
mkdir -p $(DESTDIR)/$(PREFIX)/lib/pkgconfig
|
||||||
|
install -m 644 $(PROJECT_NAME)-static.pc $(DESTDIR)/$(PREFIX)/lib/pkgconfig/$(PROJECT_NAME).pc
|
||||||
|
|
||||||
|
install-shared: $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) install-headers $(PROJECT_NAME).pc
|
||||||
|
mkdir -p $(DESTDIR)/$(SHAREDLIB_DIR)
|
||||||
|
install -m 755 $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER) $(DESTDIR)/$(SHAREDLIB_DIR)
|
||||||
|
if [ "$(SHAREDLIBSUFFIXVER)" != "$(SHAREDLIBSUFFIX)" ]; then \
|
||||||
|
cp -a $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX) $(DESTDIR)/$(SHAREDLIB_DIR); \
|
||||||
|
fi
|
||||||
|
mkdir -p $(DESTDIR)/$(PREFIX)/lib/pkgconfig
|
||||||
|
install -m 644 $(PROJECT_NAME).pc $(DESTDIR)/$(PREFIX)/lib/pkgconfig
|
||||||
|
ifneq ($(EXTRA_LIBRARY),)
|
||||||
|
install -m 644 $(EXTRA_LIBRARY) $(DESTDIR)/$(PREFIX)/lib
|
||||||
|
endif
|
||||||
|
|
||||||
|
install: install-static-lib install-shared
|
||||||
@:
|
@:
|
||||||
|
|
||||||
ifeq ($(HAVE_GTEST),Yes)
|
ifeq ($(HAVE_GTEST),Yes)
|
||||||
@@ -241,7 +278,7 @@ $(LIBPREFIX)ut.$(LIBSUFFIX): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $
|
|||||||
LIBRARIES +=$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX)
|
LIBRARIES +=$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX)
|
||||||
$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) $(COMMON_UNITTEST_OBJS) $(CODEC_UNITTEST_DEPS)
|
$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) $(COMMON_UNITTEST_OBJS) $(CODEC_UNITTEST_DEPS)
|
||||||
$(QUIET)rm -f $@
|
$(QUIET)rm -f $@
|
||||||
$(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+ $(CODEC_UNITTEST_LDFLAGS)
|
$(QUIET_CXX)$(CXX) $(SHARED) $(CXX_LINK_O) $+ $(LDFLAGS) $(CODEC_UNITTEST_LDFLAGS)
|
||||||
|
|
||||||
binaries: codec_unittest$(EXEEXT)
|
binaries: codec_unittest$(EXEEXT)
|
||||||
BINARIES += codec_unittest$(EXEEXT)
|
BINARIES += codec_unittest$(EXEEXT)
|
||||||
|
|||||||
@@ -38,13 +38,13 @@ OS Support
|
|||||||
- Windows 64-bit and 32-bit
|
- Windows 64-bit and 32-bit
|
||||||
- Mac OS X 64-bit and 32-bit
|
- Mac OS X 64-bit and 32-bit
|
||||||
- Linux 64-bit and 32-bit
|
- Linux 64-bit and 32-bit
|
||||||
- Android 32-bit
|
- Android 64-bit and 32-bit
|
||||||
- iOS 64-bit and 32-bit
|
- iOS 64-bit and 32-bit
|
||||||
|
|
||||||
Processor Support
|
Processor Support
|
||||||
-----------------
|
-----------------
|
||||||
- Intel x86 optionally with MMX/SSE (no AVX yet, help is welcome)
|
- Intel x86 optionally with MMX/SSE (no AVX yet, help is welcome)
|
||||||
- ARMv7 optionally with NEON
|
- ARMv7 optionally with NEON, AArch64 optionally with NEON
|
||||||
- Any architecture using C/C++ fallback functions
|
- Any architecture using C/C++ fallback functions
|
||||||
|
|
||||||
Building the Library
|
Building the Library
|
||||||
|
|||||||
85
RELEASES
85
RELEASES
@@ -1,19 +1,56 @@
|
|||||||
|
|
||||||
Releases
|
Releases
|
||||||
-----------
|
-----------
|
||||||
v1.1.1
|
v1.4.0
|
||||||
- Modify some APIs
|
------
|
||||||
- Add WelsGetDecoderCapability for SDP negotiation usage
|
- Decoder new interface of DecodeFrameNoDelay
|
||||||
- Add RC_BUFFERBASED_MODE for screen content RC
|
- Added new encoder and decoder statistics
|
||||||
- Add SLTRConfig for SetOption in encoder
|
- Added option for generating pdb in windows builds
|
||||||
- Add ENCODER_OPTION_COMPLEXITY/ECOMPLEXITY_MODE in TagEncParamExt
|
- Added new rate control mode (RC_TIMESTAMP_MODE) for inconstant frame rate input
|
||||||
- Remove uiFrameToBeCoded in TagEncParamExt
|
- Added new Sps/Pps strategies for real-time video
|
||||||
- Remove iInputCsp in TagEncParamBase/TagEncParamExt
|
— Added support for simulcast avc
|
||||||
- Modify iOutputColorFormat as eOutputColorFormat
|
- Improvements in code structure, assembly, input parameter checking, logging, UT and comments
|
||||||
- Modify uiEcActiveFlag as eEcActiveIdc
|
- In gmp-openh264, return decoder error correctly and other fixes
|
||||||
- Rename ENCOCER_LTR_MARKING_PERIOD to ENCODER_LTR_MARKING_PERIOD
|
- Decoder bug fixes when for Error Concealment disabled
|
||||||
- Improve the encoding speed of screen content encoding including ARM and X86
|
- Bug fixes for ParseOnly functions
|
||||||
- fix some bugs
|
- Bug fixes for encoding large frame size (>32767MBs)
|
||||||
|
- Fixes to avoid valgrind warnings, potential crash and calculation overflow
|
||||||
|
|
||||||
|
-----------
|
||||||
|
v1.3.1
|
||||||
|
------
|
||||||
|
- Fixed and enhanced protection to avoid crash when reading lossy bitstreams
|
||||||
|
- Adjust the default mode of Error Concealment used by gmp-openh264
|
||||||
|
|
||||||
|
-----------
|
||||||
|
v1.3.0
|
||||||
|
------
|
||||||
|
- Removed manual API document, now using wiki: https://github.com/cisco/openh264/wiki (0af48e5 for v1.3.0)
|
||||||
|
- Added API version in API header files
|
||||||
|
- Added pkg-config file
|
||||||
|
- Added decoder support of parsing only (bParseOnly) for only parsing bit stream but not decoding
|
||||||
|
- Added timestamp and max nal size in gmp-openh264.cpp when calling encoding
|
||||||
|
- Added timestamp info in decoder input and return structure
|
||||||
|
- Added support of level 9 in decoder
|
||||||
|
- Added total length of the encoded frame in encoder return structure
|
||||||
|
- Added SetOption(ENCODER_OPTION_SVC_ENCODE_PARAM_BASE,&base) for encoder
|
||||||
|
- Set constraint set 0 and 1 flags for non-scalable
|
||||||
|
- Improved error concealment algorithms and provide more modes of error-concealment
|
||||||
|
- Improved rate control algorithms and reference selection algorithms for screen content encoding
|
||||||
|
- Added encoder and decoder statistics interface
|
||||||
|
- Improved input parameter checking and logging
|
||||||
|
- Bug fixes, warning reductions, and test improvements
|
||||||
|
|
||||||
|
-----------
|
||||||
|
v1.2.0
|
||||||
|
------
|
||||||
|
- Add and modify encoder APIs related to rate control and screen content encoding
|
||||||
|
- Remove PauseFrame in encoder APIs
|
||||||
|
- Improve rate control and compression ratio for screen content encoding
|
||||||
|
- Improve error concealment algorithm
|
||||||
|
- Improve validation of input parameters
|
||||||
|
- Add ARM64 assembly
|
||||||
|
- bug fixes
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
v1.1.0
|
v1.1.0
|
||||||
@@ -30,11 +67,29 @@ Binaries
|
|||||||
These binary releases are distributed under this license:
|
These binary releases are distributed under this license:
|
||||||
http://www.openh264.org/BINARY_LICENSE.txt
|
http://www.openh264.org/BINARY_LICENSE.txt
|
||||||
|
|
||||||
|
v1.3.0
|
||||||
|
------
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.3.0-android19.so.bz2
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.3.0-linux32.so.bz2
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.3.0-linux64.so.bz2
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.3.0-osx32.dylib.bz2
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.3.0-osx64.dylib.bz2
|
||||||
|
http://ciscobinary.openh264.org/openh264-1.3.0-win32msvc.dll.bz2
|
||||||
|
http://ciscobinary.openh264.org/openh264-1.3.0-win64msvc.dll.bz2
|
||||||
|
|
||||||
|
v1.2.0
|
||||||
|
------
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.2.0-android19.so.bz2
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.2.0-linux32.so.bz2
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.2.0-linux64.so.bz2
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.2.0-osx32.dylib.bz2
|
||||||
|
http://ciscobinary.openh264.org/libopenh264-1.2.0-osx64.dylib.bz2
|
||||||
|
http://ciscobinary.openh264.org/openh264-1.2.0-win32msvc.dll.bz2
|
||||||
|
http://ciscobinary.openh264.org/openh264-1.2.0-win64msvc.dll.bz2
|
||||||
|
|
||||||
v1.1.0
|
v1.1.0
|
||||||
------
|
------
|
||||||
http://ciscobinary.openh264.org/libopenh264-1.1.0-android19.so.bz2
|
http://ciscobinary.openh264.org/libopenh264-1.1.0-android19.so.bz2
|
||||||
http://ciscobinary.openh264.org/libopenh264-1.1.0-ios32.a.bz2
|
|
||||||
http://ciscobinary.openh264.org/libopenh264-1.1.0-ios64.a.bz2
|
|
||||||
http://ciscobinary.openh264.org/libopenh264-1.1.0-linux32.so.bz2
|
http://ciscobinary.openh264.org/libopenh264-1.1.0-linux32.so.bz2
|
||||||
http://ciscobinary.openh264.org/libopenh264-1.1.0-linux64.so.bz2
|
http://ciscobinary.openh264.org/libopenh264-1.1.0-linux64.so.bz2
|
||||||
http://ciscobinary.openh264.org/libopenh264-1.1.0-osx32.dylib.bz2
|
http://ciscobinary.openh264.org/libopenh264-1.1.0-osx32.dylib.bz2
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
ifneq ($(filter %86 x86_64, $(ARCH)),)
|
ifneq ($(filter %86 x86_64, $(ARCH)),)
|
||||||
include $(SRC_PATH)build/platform-x86-common.mk
|
include $(SRC_PATH)build/x86-common.mk
|
||||||
endif
|
endif
|
||||||
ifneq ($(filter-out arm64, $(filter arm%, $(ARCH))),)
|
ifneq ($(filter-out arm64, $(filter arm%, $(ARCH))),)
|
||||||
ifeq ($(USE_ASM), Yes)
|
ifeq ($(USE_ASM), Yes)
|
||||||
@@ -5,6 +5,7 @@ GTEST_CPP_SRCS=\
|
|||||||
GTEST_OBJS += $(GTEST_CPP_SRCS:.cc=.$(OBJ))
|
GTEST_OBJS += $(GTEST_CPP_SRCS:.cc=.$(OBJ))
|
||||||
|
|
||||||
OBJS += $(GTEST_OBJS)
|
OBJS += $(GTEST_OBJS)
|
||||||
|
|
||||||
$(GTEST_SRCDIR)/%.$(OBJ): $(GTEST_SRCDIR)/%.cc
|
$(GTEST_SRCDIR)/%.$(OBJ): $(GTEST_SRCDIR)/%.cc
|
||||||
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(GTEST_CFLAGS) $(GTEST_INCLUDES) -c $(CXX_O) $<
|
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(GTEST_CFLAGS) $(GTEST_INCLUDES) -c $(CXX_O) $<
|
||||||
|
|
||||||
|
|||||||
@@ -134,37 +134,42 @@ if len(cfiles) > 0:
|
|||||||
for cfile in cfiles:
|
for cfile in cfiles:
|
||||||
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, cfile))
|
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, cfile))
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write("%s_OBJS += $(%s_C_SRCS:.c=.$(OBJ))\n\n"%(PREFIX, PREFIX))
|
f.write("%s_OBJS += $(%s_C_SRCS:.c=.$(OBJ))\n"%(PREFIX, PREFIX))
|
||||||
|
|
||||||
if len(asm) > 0:
|
if len(asm) > 0:
|
||||||
f.write("ifeq ($(ASM_ARCH), x86)\n")
|
|
||||||
f.write("%s_ASM_SRCS=\\\n"%(PREFIX))
|
f.write("%s_ASM_SRCS=\\\n"%(PREFIX))
|
||||||
for c in asm:
|
for c in asm:
|
||||||
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
|
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write("%s_OBJS += $(%s_ASM_SRCS:.asm=.$(OBJ))\n"%(PREFIX, PREFIX))
|
f.write("%s_OBJSASM += $(%s_ASM_SRCS:.asm=.$(OBJ))\n"%(PREFIX, PREFIX))
|
||||||
f.write("endif\n\n")
|
f.write("ifeq ($(ASM_ARCH), x86)\n")
|
||||||
|
f.write("%s_OBJS += $(%s_OBJSASM)\n"%(PREFIX,PREFIX))
|
||||||
|
f.write("endif\n")
|
||||||
|
f.write("OBJS += $(%s_OBJSASM)\n\n"%(PREFIX))
|
||||||
|
|
||||||
if len(armfiles) > 0:
|
if len(armfiles) > 0:
|
||||||
f.write("ifeq ($(ASM_ARCH), arm)\n")
|
|
||||||
f.write("%s_ASM_ARM_SRCS=\\\n"%(PREFIX))
|
f.write("%s_ASM_ARM_SRCS=\\\n"%(PREFIX))
|
||||||
for c in armfiles:
|
for c in armfiles:
|
||||||
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
|
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write("%s_OBJS += $(%s_ASM_ARM_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
|
f.write("%s_OBJSARM += $(%s_ASM_ARM_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
|
||||||
f.write("endif\n\n")
|
f.write("ifeq ($(ASM_ARCH), arm)\n")
|
||||||
|
f.write("%s_OBJS += $(%s_OBJSARM)\n"%(PREFIX,PREFIX))
|
||||||
|
f.write("endif\n")
|
||||||
|
f.write("OBJS += $(%s_OBJSARM)\n\n"%(PREFIX))
|
||||||
|
|
||||||
if len(arm64files) > 0:
|
if len(arm64files) > 0:
|
||||||
f.write("ifeq ($(ASM_ARCH), arm64)\n")
|
|
||||||
f.write("%s_ASM_ARM64_SRCS=\\\n"%(PREFIX))
|
f.write("%s_ASM_ARM64_SRCS=\\\n"%(PREFIX))
|
||||||
for c in arm64files:
|
for c in arm64files:
|
||||||
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
|
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write("%s_OBJS += $(%s_ASM_ARM64_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
|
f.write("%s_OBJSARM64 += $(%s_ASM_ARM64_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
|
||||||
f.write("endif\n\n")
|
f.write("ifeq ($(ASM_ARCH), arm64)\n")
|
||||||
|
f.write("%s_OBJS += $(%s_OBJSARM64)\n"%(PREFIX,PREFIX))
|
||||||
f.write("OBJS += $(%s_OBJS)\n"%PREFIX)
|
f.write("endif\n")
|
||||||
|
f.write("OBJS += $(%s_OBJSARM64)\n\n"%(PREFIX))
|
||||||
|
|
||||||
|
f.write("OBJS += $(%s_OBJS)\n\n"%(PREFIX))
|
||||||
write_cpp_rule_pattern(f)
|
write_cpp_rule_pattern(f)
|
||||||
|
|
||||||
if len(cfiles) > 0:
|
if len(cfiles) > 0:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
include $(SRC_PATH)build/platform-arch.mk
|
include $(SRC_PATH)build/arch.mk
|
||||||
ifeq ($(ASM_ARCH), x86)
|
ifeq ($(ASM_ARCH), x86)
|
||||||
ifeq ($(ENABLE64BIT), Yes)
|
ifeq ($(ENABLE64BIT), Yes)
|
||||||
ASMFLAGS += -f win64
|
ASMFLAGS += -f win64
|
||||||
@@ -10,7 +10,7 @@ else
|
|||||||
endif
|
endif
|
||||||
ifeq ($(ASM_ARCH), arm)
|
ifeq ($(ASM_ARCH), arm)
|
||||||
CCAS = gas-preprocessor.pl -as-type armasm -force-thumb -- armasm
|
CCAS = gas-preprocessor.pl -as-type armasm -force-thumb -- armasm
|
||||||
CCASFLAGS = -nologo -DHAVE_NEON
|
CCASFLAGS = -nologo -DHAVE_NEON -ignore 4509
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CC=cl
|
CC=cl
|
||||||
@@ -22,7 +22,7 @@ CXX_O=-Fo$@
|
|||||||
# it unconditionally. The same issue can also be worked around by adding
|
# it unconditionally. The same issue can also be worked around by adding
|
||||||
# -DGTEST_HAS_TR1_TUPLE=0 instead, but we prefer this version since it
|
# -DGTEST_HAS_TR1_TUPLE=0 instead, but we prefer this version since it
|
||||||
# matches what gtest itself does.
|
# matches what gtest itself does.
|
||||||
CFLAGS += -nologo -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope -D_VARIADIC_MAX=10
|
CFLAGS += -nologo -Fd$(PROJECT_NAME).pdb -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope -D_VARIADIC_MAX=10
|
||||||
CXX_LINK_O=-nologo -Fe$@
|
CXX_LINK_O=-nologo -Fe$@
|
||||||
AR_OPTS=-nologo -out:$@
|
AR_OPTS=-nologo -out:$@
|
||||||
CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -GF -Gm- -GS -Gy -DNDEBUG
|
CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -GF -Gm- -GS -Gy -DNDEBUG
|
||||||
@@ -35,7 +35,11 @@ LIBSUFFIX=lib
|
|||||||
LIBPREFIX=
|
LIBPREFIX=
|
||||||
EXEEXT=.exe
|
EXEEXT=.exe
|
||||||
OBJ=obj
|
OBJ=obj
|
||||||
|
SHAREDLIB_DIR = $(PREFIX)/bin
|
||||||
SHAREDLIBSUFFIX=dll
|
SHAREDLIBSUFFIX=dll
|
||||||
|
SHAREDLIBSUFFIXVER=$(SHAREDLIBSUFFIX)
|
||||||
SHARED=-LD
|
SHARED=-LD
|
||||||
SHLDFLAGS=-link -def:openh264.def -implib:$(PROJECT_NAME)_dll.lib
|
|
||||||
EXTRA_LIBRARY=$(PROJECT_NAME)_dll.lib
|
EXTRA_LIBRARY=$(PROJECT_NAME)_dll.lib
|
||||||
|
SHLDFLAGS=-Fd$(PROJECT_NAME).pdb -link -def:openh264.def -implib:$(EXTRA_LIBRARY)
|
||||||
|
STATIC_LDFLAGS=
|
||||||
|
CODEC_UNITTEST_CFLAGS=-D_CRT_SECURE_NO_WARNINGS
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
ARCH = arm
|
ARCH = arm
|
||||||
include $(SRC_PATH)build/platform-arch.mk
|
include $(SRC_PATH)build/arch.mk
|
||||||
SHAREDLIBSUFFIX = so
|
SHAREDLIBSUFFIX = so
|
||||||
|
# Android APK/JARs expect libraries to be unversioned
|
||||||
|
SHAREDLIBSUFFIXVER=$(SHAREDLIBSUFFIX)
|
||||||
|
SHLDFLAGS =
|
||||||
NDKLEVEL = 12
|
NDKLEVEL = 12
|
||||||
ifeq ($(ARCH), arm)
|
ifeq ($(ARCH), arm)
|
||||||
ifneq ($(APP_ABI), armeabi)
|
ifneq ($(APP_ABI), armeabi)
|
||||||
@@ -9,9 +12,6 @@ ifeq ($(ARCH), arm)
|
|||||||
LDFLAGS += -march=armv7-a -Wl,--fix-cortex-a8
|
LDFLAGS += -march=armv7-a -Wl,--fix-cortex-a8
|
||||||
APP_ABI = armeabi-v7a
|
APP_ABI = armeabi-v7a
|
||||||
endif
|
endif
|
||||||
ifeq (Yes, $(USE_ASM))
|
|
||||||
ASMFLAGS += -march=armv7-a -mfpu=neon
|
|
||||||
endif
|
|
||||||
else ifeq ($(ARCH), arm64)
|
else ifeq ($(ARCH), arm64)
|
||||||
APP_ABI = arm64-v8a
|
APP_ABI = arm64-v8a
|
||||||
else ifeq ($(ARCH), x86)
|
else ifeq ($(ARCH), x86)
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
include $(SRC_PATH)build/platform-arch.mk
|
include $(SRC_PATH)build/arch.mk
|
||||||
|
SHAREDLIB_DIR = $(PREFIX)/lib
|
||||||
SHAREDLIBSUFFIX = dylib
|
SHAREDLIBSUFFIX = dylib
|
||||||
|
SHAREDLIBSUFFIXVER=$(SHAREDLIBVERSION).$(SHAREDLIBSUFFIX)
|
||||||
|
SHLDFLAGS = -dynamiclib -twolevel_namespace -undefined dynamic_lookup \
|
||||||
|
-fno-common -headerpad_max_install_names -install_name \
|
||||||
|
$(SHAREDLIB_DIR)/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
|
||||||
SHARED = -dynamiclib
|
SHARED = -dynamiclib
|
||||||
CFLAGS += -Wall -fPIC -MMD -MP
|
CFLAGS += -Wall -fPIC -MMD -MP
|
||||||
LDFLAGS += -lpthread
|
LDFLAGS += -lpthread
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
include $(SRC_PATH)build/platform-arch.mk
|
include $(SRC_PATH)build/arch.mk
|
||||||
SHAREDLIBSUFFIX = so
|
SHAREDLIBSUFFIX = so
|
||||||
|
SHAREDLIBSUFFIXVER=$(SHAREDLIBSUFFIX).$(SHAREDLIBVERSION)
|
||||||
|
SHLDFLAGS = -Wl,-soname,$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
|
||||||
CFLAGS += -fPIC
|
CFLAGS += -fPIC
|
||||||
LDFLAGS += -lpthread
|
LDFLAGS += -lpthread
|
||||||
ifeq ($(ASM_ARCH), x86)
|
ifeq ($(ASM_ARCH), x86)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
include $(SRC_PATH)build/platform-arch.mk
|
include $(SRC_PATH)build/arch.mk
|
||||||
SHAREDLIBSUFFIX = so
|
SHAREDLIBSUFFIX = so
|
||||||
|
SHAREDLIBSUFFIXVER=$(SHAREDLIBSUFFIX).$(SHAREDLIBVERSION)
|
||||||
|
SHLDFLAGS = -Wl,-soname,$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXVER)
|
||||||
CFLAGS += -Wall -fno-strict-aliasing -fPIC -MMD -MP
|
CFLAGS += -Wall -fno-strict-aliasing -fPIC -MMD -MP
|
||||||
LDFLAGS += -lpthread
|
LDFLAGS += -lpthread
|
||||||
ifeq ($(ASM_ARCH), x86)
|
ifeq ($(ASM_ARCH), x86)
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
include $(SRC_PATH)build/platform-x86-common.mk
|
include $(SRC_PATH)build/x86-common.mk
|
||||||
|
SHAREDLIB_DIR = $(PREFIX)/bin
|
||||||
SHAREDLIBSUFFIX = dll
|
SHAREDLIBSUFFIX = dll
|
||||||
|
SHAREDLIBSUFFIXVER=$(SHAREDLIBSUFFIX)
|
||||||
|
EXTRA_LIBRARY=$(LIBPREFIX)$(PROJECT_NAME).dll.a
|
||||||
|
SHLDFLAGS = -Wl,--out-implib,$(EXTRA_LIBRARY)
|
||||||
CFLAGS += -MMD -MP
|
CFLAGS += -MMD -MP
|
||||||
LDFLAGS +=
|
LDFLAGS +=
|
||||||
ifeq ($(ENABLE64BIT), Yes)
|
ifeq ($(ENABLE64BIT), Yes)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
ARCH = arm
|
ARCH = arm
|
||||||
include $(SRC_PATH)build/platform-msvc-common.mk
|
include $(SRC_PATH)build/msvc-common.mk
|
||||||
CFLAGS_OPT += -MD
|
CFLAGS_OPT += -MD
|
||||||
CFLAGS_DEBUG += -MDd
|
CFLAGS_DEBUG += -MDd
|
||||||
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
|
CFLAGS += -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
include $(SRC_PATH)build/platform-msvc-common.mk
|
include $(SRC_PATH)build/msvc-common.mk
|
||||||
LDFLAGS += user32.lib
|
LDFLAGS += user32.lib
|
||||||
CFLAGS_OPT += -MT
|
CFLAGS_OPT += -MT
|
||||||
CFLAGS_DEBUG += -MTd -Gm
|
CFLAGS_DEBUG += -MTd -Gm
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
|
*@page License
|
||||||
|
*
|
||||||
* \copy
|
* \copy
|
||||||
* Copyright (c) 2013, Cisco Systems
|
* Copyright (c) 2013, Cisco Systems
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@@ -50,65 +52,383 @@ typedef unsigned char bool;
|
|||||||
#define EXTAPI
|
#define EXTAPI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file codec_api.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @page Overview
|
||||||
|
* * This page is for openh264 codec API usage.
|
||||||
|
* * For how to use the encoder,please refer to page UsageExampleForEncoder
|
||||||
|
* * For how to use the decoder,please refer to page UsageExampleForDecoder
|
||||||
|
* * For more detail about ISVEncoder,please refer to page ISVCEnoder
|
||||||
|
* * For more detail about ISVDecoder,please refer to page ISVCDecoder
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @page DecoderUsageExample
|
||||||
|
*
|
||||||
|
* @brief
|
||||||
|
* * An example for using the decoder for Decoding only or Parsing only
|
||||||
|
*
|
||||||
|
* Step 1:decoder declaration
|
||||||
|
* @code
|
||||||
|
*
|
||||||
|
* //decoder declaration
|
||||||
|
* ISVCDecoder *pSvcDecoder;
|
||||||
|
* //input: encoded bitstream start position; should include start code prefix
|
||||||
|
* unsigned char *pBuf =...;
|
||||||
|
* //input: encoded bit stream length; should include the size of start code prefix
|
||||||
|
* int iSize =...;
|
||||||
|
* //output: [0~2] for Y,U,V buffer for Decoding only
|
||||||
|
* unsigned char *pData[3] =...;
|
||||||
|
* //in-out: for Decoding only: declare and initialize the output buffer info, this should never co-exist with Parsing only
|
||||||
|
* SBufferInfo sDstBufInfo;
|
||||||
|
* memset(&sDstBufInfo, 0, sizeof(SBufferInfo));
|
||||||
|
* //in-out: for Parsing only: declare and initialize the output bitstream buffer info for parse only, this should never co-exist with Decoding only
|
||||||
|
* SParserBsInfo sDstParseInfo;
|
||||||
|
* memset(&sDstParseInfo, 0, sizeof(SParserBsInfo));
|
||||||
|
* sDstParseInfo.pDstBuff = new unsigned char[PARSE_SIZE]; //In Parsing only, allocate enough buffer to save transcoded bitstream for a frame
|
||||||
|
*
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step 2:decoder creation
|
||||||
|
* @code
|
||||||
|
* CreateDecoder(pSvcDecoder);
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step 3:declare required parameter, used to differentiate Decoding only and Parsing only
|
||||||
|
* @code
|
||||||
|
* SDecodingParam sDecParam = {0};
|
||||||
|
* sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC;
|
||||||
|
* //for Parsing only, the assignment is mandatory
|
||||||
|
* sDecParam.bParseOnly = true;
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step 4:initialize the parameter and decoder context, allocate memory
|
||||||
|
* @code
|
||||||
|
* Initialize(&sDecParam);
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step 5:do actual decoding process in slice level;
|
||||||
|
* this can be done in a loop until data ends
|
||||||
|
* @code
|
||||||
|
* //for Decoding only
|
||||||
|
* iRet = DecodeFrameNoDelay(pBuf, iSize, pData, &sDstBufInfo);
|
||||||
|
* //or
|
||||||
|
* iRet = DecodeFrame2(pBuf, iSize, pData, &sDstBufInfo);
|
||||||
|
* //for Parsing only
|
||||||
|
* iRet = DecodeParser(pBuf, iSize, &sDstParseInfo);
|
||||||
|
* //decode failed
|
||||||
|
* If (iRet != 0){
|
||||||
|
* RequestIDR or something like that.
|
||||||
|
* }
|
||||||
|
* //for Decoding only, pData can be used for render.
|
||||||
|
* if (sDstBufInfo.iBufferStatus==1){
|
||||||
|
* output pData[0], pData[1], pData[2];
|
||||||
|
* }
|
||||||
|
* //for Parsing only, sDstParseInfo can be used for, e.g., HW decoding
|
||||||
|
* if (sDstBufInfo.iNalNum > 0){
|
||||||
|
* Hardware decoding sDstParseInfo;
|
||||||
|
* }
|
||||||
|
* //no-delay decoding can be realized by directly calling DecodeFrameNoDelay(), which is the recommended usage.
|
||||||
|
* //no-delay decoding can also be realized by directly calling DecodeFrame2() again with NULL input, as in the following. In this case, decoder would immediately reconstruct the input data. This can also be used similarly for Parsing only. Consequent decoding error and output indication should also be considered as above.
|
||||||
|
* iRet = DecodeFrame2(NULL, 0, pData, &sDstBufInfo);
|
||||||
|
* judge iRet, sDstBufInfo.iBufferStatus ...
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step 6:uninitialize the decoder and memory free
|
||||||
|
* @code
|
||||||
|
* Uninitialize();
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step 7:destroy the decoder
|
||||||
|
* @code
|
||||||
|
* DestroyDecoder();
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @page EncoderUsageExample1
|
||||||
|
*
|
||||||
|
* @brief
|
||||||
|
* * An example for using encoder with basic parameter
|
||||||
|
*
|
||||||
|
* Step1:setup encoder
|
||||||
|
* @code
|
||||||
|
* int rv = WelsCreateSVCEncoder (&encoder_);
|
||||||
|
* ASSERT_EQ (0, rv);
|
||||||
|
* ASSERT_TRUE (encoder_ != NULL);
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step2:initilize with basic parameter
|
||||||
|
* @code
|
||||||
|
* SEncParamBase param;
|
||||||
|
* memset (¶m, 0, sizeof (SEncParamBase));
|
||||||
|
* param.iUsageType = usageType;
|
||||||
|
* param.fMaxFrameRate = frameRate;
|
||||||
|
* param.iPicWidth = width;
|
||||||
|
* param.iPicHeight = height;
|
||||||
|
* param.iTargetBitrate = 5000000;
|
||||||
|
* encoder_->Initialize (¶m);
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step3:set option, set option during encoding process
|
||||||
|
* @code
|
||||||
|
* encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &g_LevelSetting);
|
||||||
|
* int videoFormat = videoFormatI420;
|
||||||
|
* encoder_->SetOption (ENCODER_OPTION_DATAFORMAT, &videoFormat);
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step4: encode and store ouput bistream
|
||||||
|
* @code
|
||||||
|
* int frameSize = width * height * 3 / 2;
|
||||||
|
* BufferedData buf;
|
||||||
|
* buf.SetLength (frameSize);
|
||||||
|
* ASSERT_TRUE (buf.Length() == (size_t)frameSize);
|
||||||
|
* SFrameBSInfo info;
|
||||||
|
* memset (&info, 0, sizeof (SFrameBSInfo));
|
||||||
|
* SSourcePicture pic;
|
||||||
|
* memset (&pic, 0, sizeof (SsourcePicture));
|
||||||
|
* pic.iPicWidth = width;
|
||||||
|
* pic.iPicHeight = height;
|
||||||
|
* pic.iColorFormat = videoFormatI420;
|
||||||
|
* pic.iStride[0] = pic.iPicWidth;
|
||||||
|
* pic.iStride[1] = pic.iStride[2] = pic.iPicWidth >> 1;
|
||||||
|
* pic.pData[0] = buf.data();
|
||||||
|
* pic.pData[1] = pic.pData[0] + width * height;
|
||||||
|
* pic.pData[2] = pic.pData[1] + (width * height >> 2);
|
||||||
|
* for(int num = 0;num<total_num;num++) {
|
||||||
|
* //prepare input data
|
||||||
|
* rv = encoder_->EncodeFrame (&pic, &info);
|
||||||
|
* ASSERT_TRUE (rv == cmResultSuccess);
|
||||||
|
* if (info.eFrameType != videoFrameTypeSkip && cbk != NULL) {
|
||||||
|
* //output bitstream
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
* Step5:teardown encoder
|
||||||
|
* @code
|
||||||
|
* if (encoder_) {
|
||||||
|
* encoder_->Uninitialize();
|
||||||
|
* WelsDestroySVCEncoder (encoder_);
|
||||||
|
* }
|
||||||
|
* @endcode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @page EncoderUsageExample2
|
||||||
|
*
|
||||||
|
* @brief
|
||||||
|
* * An example for using the encoder with extension parameter.
|
||||||
|
* * The same operation on Step 1,3,4,5 with Example-1
|
||||||
|
*
|
||||||
|
* Step 2:initialize with extension parameter
|
||||||
|
* @code
|
||||||
|
* SEncParamExt param;
|
||||||
|
* encoder->GetDefaultParams (¶m);
|
||||||
|
* param.iUsageType = usageType;
|
||||||
|
* param.fMaxFrameRate = frameRate;
|
||||||
|
* param.iPicWidth = width;
|
||||||
|
* param.iPicHeight = height;
|
||||||
|
* param.iTargetBitrate = 5000000;
|
||||||
|
* param.bEnableDenoise = denoise;
|
||||||
|
* param.iSpatialLayerNum = layers;
|
||||||
|
* //SM_DYN_SLICE don't support multi-thread now
|
||||||
|
* if (sliceMode != SM_SINGLE_SLICE && sliceMode != SM_DYN_SLICE)
|
||||||
|
* param.iMultipleThreadIdc = 2;
|
||||||
|
*
|
||||||
|
* for (int i = 0; i < param.iSpatialLayerNum; i++) {
|
||||||
|
* param.sSpatialLayers[i].iVideoWidth = width >> (param.iSpatialLayerNum - 1 - i);
|
||||||
|
* param.sSpatialLayers[i].iVideoHeight = height >> (param.iSpatialLayerNum - 1 - i);
|
||||||
|
* param.sSpatialLayers[i].fFrameRate = frameRate;
|
||||||
|
* param.sSpatialLayers[i].iSpatialBitrate = param.iTargetBitrate;
|
||||||
|
*
|
||||||
|
* param.sSpatialLayers[i].sSliceCfg.uiSliceMode = sliceMode;
|
||||||
|
* if (sliceMode == SM_DYN_SLICE) {
|
||||||
|
* param.sSpatialLayers[i].sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 600;
|
||||||
|
* param.uiMaxNalSize = 1500;
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* param.iTargetBitrate *= param.iSpatialLayerNum;
|
||||||
|
* encoder_->InitializeExt (¶m);
|
||||||
|
* int videoFormat = videoFormatI420;
|
||||||
|
* encoder_->SetOption (ENCODER_OPTION_DATAFORMAT, &videoFormat);
|
||||||
|
*
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
/**
|
||||||
|
* @brief Endocder definition
|
||||||
|
*/
|
||||||
class ISVCEncoder {
|
class ISVCEncoder {
|
||||||
public:
|
public:
|
||||||
/*
|
/**
|
||||||
* return: CM_RETURN: 0 - success; otherwise - failed;
|
* @brief Initialize the encoder
|
||||||
*/
|
* @param pParam basic encoder parameter
|
||||||
|
* @return CM_RETURN: 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
virtual int EXTAPI Initialize (const SEncParamBase* pParam) = 0;
|
virtual int EXTAPI Initialize (const SEncParamBase* pParam) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initilaize encoder by using extension parameters.
|
||||||
|
* @param pParam extension parameter for encoder
|
||||||
|
* @return CM_RETURN: 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
virtual int EXTAPI InitializeExt (const SEncParamExt* pParam) = 0;
|
virtual int EXTAPI InitializeExt (const SEncParamExt* pParam) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the default extension parameters.
|
||||||
|
* If you want to change some parameters of encoder, firstly you need to get the default encoding parameters,
|
||||||
|
* after that you can change part of parameters you want to.
|
||||||
|
* @param pParam extension parameter for encoder
|
||||||
|
* @return CM_RETURN: 0 - success; otherwise - failed;
|
||||||
|
* */
|
||||||
virtual int EXTAPI GetDefaultParams (SEncParamExt* pParam) = 0;
|
virtual int EXTAPI GetDefaultParams (SEncParamExt* pParam) = 0;
|
||||||
|
/// uninitialize the encoder
|
||||||
virtual int EXTAPI Uninitialize() = 0;
|
virtual int EXTAPI Uninitialize() = 0;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* return: 0 - success; otherwise -failed;
|
* @brief Encode one frame
|
||||||
*/
|
* @param kpSrcPic the pointer to the source luminance plane
|
||||||
|
* chrominance data:
|
||||||
|
* CbData = kpSrc + m_iMaxPicWidth * m_iMaxPicHeight;
|
||||||
|
* CrData = CbData + (m_iMaxPicWidth * m_iMaxPicHeight)/4;
|
||||||
|
* the application calling this interface needs to ensure the data validation between the location
|
||||||
|
* @param pBsInfo output bit stream
|
||||||
|
* @return 0 - success; otherwise -failed;
|
||||||
|
*/
|
||||||
virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
|
virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
|
||||||
/*
|
|
||||||
* return: 0 - success; otherwise - failed;
|
/**
|
||||||
*/
|
* @brief Encode the parameters from output bit stream
|
||||||
|
* @param pBsInfo output bit stream
|
||||||
|
* @return 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
virtual int EXTAPI EncodeParameterSets (SFrameBSInfo* pBsInfo) = 0;
|
virtual int EXTAPI EncodeParameterSets (SFrameBSInfo* pBsInfo) = 0;
|
||||||
/*
|
|
||||||
* return: 0 - success; otherwise - failed;
|
/**
|
||||||
*/
|
* @brief Force encoder to encoder frame as IDR if bIDR set as true
|
||||||
|
* @param bIDR true: force encoder to encode frame as IDR frame;false, return 1 and nothing to do
|
||||||
|
* @return 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
virtual int EXTAPI ForceIntraFrame (bool bIDR) = 0;
|
virtual int EXTAPI ForceIntraFrame (bool bIDR) = 0;
|
||||||
|
|
||||||
/************************************************************************
|
/**
|
||||||
* InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,..
|
* @brief Set option for encoder, detail option type, please refer to enumurate ENCODER_OPTION.
|
||||||
************************************************************************/
|
* @param pOption option for encoder such as InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,...
|
||||||
/*
|
* @return CM_RETURN: 0 - success; otherwise - failed;
|
||||||
* return: CM_RETURN: 0 - success; otherwise - failed;
|
*/
|
||||||
*/
|
|
||||||
virtual int EXTAPI SetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
|
virtual int EXTAPI SetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set option for encoder, detail option type, please refer to enumurate ENCODER_OPTION.
|
||||||
|
* @param pOption option for encoder such as InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,...
|
||||||
|
* @return CM_RETURN: 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
virtual int EXTAPI GetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
|
virtual int EXTAPI GetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
|
||||||
virtual ~ISVCEncoder() {}
|
virtual ~ISVCEncoder() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Decoder definition
|
||||||
|
*/
|
||||||
class ISVCDecoder {
|
class ISVCDecoder {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initilaize decoder
|
||||||
|
* @param pParam parameter for decoder
|
||||||
|
* @return 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
virtual long EXTAPI Initialize (const SDecodingParam* pParam) = 0;
|
virtual long EXTAPI Initialize (const SDecodingParam* pParam) = 0;
|
||||||
|
|
||||||
|
/// Uninitialize the decoder
|
||||||
virtual long EXTAPI Uninitialize() = 0;
|
virtual long EXTAPI Uninitialize() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Decode one frame
|
||||||
|
* @param pSrc the h264 stream to be decoded
|
||||||
|
* @param iSrcLen the length of h264 stream
|
||||||
|
* @param ppDst buffer pointer of decoded data (YUV)
|
||||||
|
* @param pStride output stride
|
||||||
|
* @param iWidth output width
|
||||||
|
* @param iHeight output height
|
||||||
|
* @return 0 - success; otherwise -failed;
|
||||||
|
*/
|
||||||
virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* pSrc,
|
virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* pSrc,
|
||||||
const int iSrcLen,
|
const int iSrcLen,
|
||||||
unsigned char** ppDst,
|
unsigned char** ppDst,
|
||||||
int* pStride,
|
int* pStride,
|
||||||
int& iWidth,
|
int& iWidth,
|
||||||
int& iHeight) = 0;
|
int& iHeight) = 0;
|
||||||
/*
|
|
||||||
* return: 0 - success; otherwise -failed;
|
/**
|
||||||
*/
|
* @brief For slice level DecodeFrameNoDelay() (4 parameters input),
|
||||||
|
* whatever the function return value is, the output data
|
||||||
|
* of I420 format will only be available when pDstInfo->iBufferStatus == 1,.
|
||||||
|
* This function will parse and reconstruct the input frame immediately if it is complete
|
||||||
|
* It is recommended as the main decoding function for H.264/AVC format input
|
||||||
|
* @param pSrc the h264 stream to be decoded
|
||||||
|
* @param iSrcLen the length of h264 stream
|
||||||
|
* @param ppDst buffer pointer of decoded data (YUV)
|
||||||
|
* @param pDstInfo information provided to API(width, height, etc.)
|
||||||
|
* @return 0 - success; otherwise -failed;
|
||||||
|
*/
|
||||||
|
virtual DECODING_STATE EXTAPI DecodeFrameNoDelay (const unsigned char* pSrc,
|
||||||
|
const int iSrcLen,
|
||||||
|
unsigned char** ppDst,
|
||||||
|
SBufferInfo* pDstInfo) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief For slice level DecodeFrame2() (4 parameters input),
|
||||||
|
* whatever the function return value is, the output data
|
||||||
|
* of I420 format will only be available when pDstInfo->iBufferStatus == 1,.
|
||||||
|
* (e.g., in multi-slice cases, only when the whole picture
|
||||||
|
* is completely reconstructed, this variable would be set equal to 1.)
|
||||||
|
* @param pSrc the h264 stream to be decoded
|
||||||
|
* @param iSrcLen the length of h264 stream
|
||||||
|
* @param ppDst buffer pointer of decoded data (YUV)
|
||||||
|
* @param pDstInfo information provided to API(width, height, etc.)
|
||||||
|
* @return 0 - success; otherwise -failed;
|
||||||
|
*/
|
||||||
virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* pSrc,
|
virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* pSrc,
|
||||||
const int iSrcLen,
|
const int iSrcLen,
|
||||||
unsigned char** ppDst,
|
unsigned char** ppDst,
|
||||||
SBufferInfo* pDstInfo) = 0;
|
SBufferInfo* pDstInfo) = 0;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* this API does not work for now!! This is for future use to support non-I420 color format output.
|
* @brief This function parse input bitstream only, and rewrite possible SVC syntax to AVC syntax
|
||||||
*/
|
* @param pSrc the h264 stream to be decoded
|
||||||
|
* @param iSrcLen the length of h264 stream
|
||||||
|
* @param pDstInfo bit stream info
|
||||||
|
* @return 0 - success; otherwise -failed;
|
||||||
|
*/
|
||||||
|
virtual DECODING_STATE EXTAPI DecodeParser (const unsigned char* pSrc,
|
||||||
|
const int iSrcLen,
|
||||||
|
SParserBsInfo* pDstInfo) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This API does not work for now!! This is for future use to support non-I420 color format output.
|
||||||
|
* @param pSrc the h264 stream to be decoded
|
||||||
|
* @param iSrcLen the length of h264 stream
|
||||||
|
* @param pDst buffer pointer of decoded data (YUV)
|
||||||
|
* @param iDstStride output stride
|
||||||
|
* @param iDstLen bit stream info
|
||||||
|
* @param iWidth output width
|
||||||
|
* @param iHeight output height
|
||||||
|
* @param iColorFormat output color format
|
||||||
|
* @return to do ...
|
||||||
|
*/
|
||||||
virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* pSrc,
|
virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* pSrc,
|
||||||
const int iSrcLen,
|
const int iSrcLen,
|
||||||
unsigned char* pDst,
|
unsigned char* pDst,
|
||||||
@@ -118,10 +438,18 @@ class ISVCDecoder {
|
|||||||
int& iHeight,
|
int& iHeight,
|
||||||
int& iColorFormat) = 0;
|
int& iColorFormat) = 0;
|
||||||
|
|
||||||
/*************************************************************************
|
/**
|
||||||
* OutDataFormat, Eos Flag, EC method, ...
|
* @brief Set option for decoder, detail option type, please refer to enumurate DECODER_OPTION.
|
||||||
*************************************************************************/
|
* @param pOption option for decoder such as OutDataFormat, Eos Flag, EC method, ...
|
||||||
|
* @return CM_RETURN: 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
virtual long EXTAPI SetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
|
virtual long EXTAPI SetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get option for decoder, detail option type, please refer to enumurate DECODER_OPTION.
|
||||||
|
* @param pOption option for decoder such as OutDataFormat, Eos Flag, EC method, ...
|
||||||
|
* @return CM_RETURN: 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
virtual long EXTAPI GetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
|
virtual long EXTAPI GetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
|
||||||
virtual ~ISVCDecoder() {}
|
virtual ~ISVCDecoder() {}
|
||||||
};
|
};
|
||||||
@@ -164,11 +492,20 @@ DECODING_STATE (*DecodeFrame) (ISVCDecoder*, const unsigned char* pSrc,
|
|||||||
int* iWidth,
|
int* iWidth,
|
||||||
int* iHeight);
|
int* iHeight);
|
||||||
|
|
||||||
|
DECODING_STATE (*DecodeFrameNoDelay) (ISVCDecoder*, const unsigned char* pSrc,
|
||||||
|
const int iSrcLen,
|
||||||
|
unsigned char** ppDst,
|
||||||
|
SBufferInfo* pDstInfo);
|
||||||
|
|
||||||
DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc,
|
DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc,
|
||||||
const int iSrcLen,
|
const int iSrcLen,
|
||||||
unsigned char** ppDst,
|
unsigned char** ppDst,
|
||||||
SBufferInfo* pDstInfo);
|
SBufferInfo* pDstInfo);
|
||||||
|
|
||||||
|
DECODING_STATE (*DecodeParser) (ISVCDecoder*, const unsigned char* pSrc,
|
||||||
|
const int iSrcLen,
|
||||||
|
SParserBsInfo* pDstInfo);
|
||||||
|
|
||||||
DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc,
|
DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc,
|
||||||
const int iSrcLen,
|
const int iSrcLen,
|
||||||
unsigned char* pDst,
|
unsigned char* pDst,
|
||||||
@@ -185,13 +522,53 @@ long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
|
|||||||
|
|
||||||
typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
|
typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
|
||||||
|
|
||||||
|
/** @brief Create encoder
|
||||||
|
* @param ppEncoder encoder
|
||||||
|
* @return 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
|
int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
|
||||||
|
|
||||||
|
|
||||||
|
/** @brief Destroy encoder
|
||||||
|
* @param pEncoder encoder
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);
|
void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);
|
||||||
|
|
||||||
|
|
||||||
|
/** @brief Get the capability of decoder
|
||||||
|
* @param pDecCapability decoder capability
|
||||||
|
* @return 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
int WelsGetDecoderCapability (SDecoderCapability* pDecCapability);
|
int WelsGetDecoderCapability (SDecoderCapability* pDecCapability);
|
||||||
|
|
||||||
|
|
||||||
|
/** @brief Create decoder
|
||||||
|
* @param ppDecoder decoder
|
||||||
|
* @return 0 - success; otherwise - failed;
|
||||||
|
*/
|
||||||
long WelsCreateDecoder (ISVCDecoder** ppDecoder);
|
long WelsCreateDecoder (ISVCDecoder** ppDecoder);
|
||||||
|
|
||||||
|
|
||||||
|
/** @brief Destroy decoder
|
||||||
|
* @param pDecoder decoder
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
void WelsDestroyDecoder (ISVCDecoder* pDecoder);
|
void WelsDestroyDecoder (ISVCDecoder* pDecoder);
|
||||||
|
|
||||||
|
/** @brief Get codec version
|
||||||
|
* Note, old versions of Mingw (GCC < 4.7) are buggy and use an
|
||||||
|
* incorrect/different ABI for calling this function, making it
|
||||||
|
* incompatible with MSVC builds.
|
||||||
|
* @return The linked codec version
|
||||||
|
*/
|
||||||
|
OpenH264Version WelsGetCodecVersion (void);
|
||||||
|
|
||||||
|
/** @brief Get codec version
|
||||||
|
* @param pVersion struct to fill in with the version
|
||||||
|
*/
|
||||||
|
void WelsGetCodecVersionEx (OpenH264Version *pVersion);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -30,9 +30,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
|
#ifndef WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
|
||||||
#define WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
|
#define WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
|
||||||
////////////////Data and /or structures introduced in Cisco OpenH264 application////////////////
|
/**
|
||||||
|
* @file codec_app_def.h
|
||||||
|
* @brief Data and /or structures introduced in Cisco OpenH264 application
|
||||||
|
*/
|
||||||
|
|
||||||
#include "codec_def.h"
|
#include "codec_def.h"
|
||||||
/* Constants */
|
/* Constants */
|
||||||
#define MAX_TEMPORAL_LAYER_NUM 4
|
#define MAX_TEMPORAL_LAYER_NUM 4
|
||||||
@@ -40,187 +46,268 @@
|
|||||||
#define MAX_QUALITY_LAYER_NUM 4
|
#define MAX_QUALITY_LAYER_NUM 4
|
||||||
|
|
||||||
#define MAX_LAYER_NUM_OF_FRAME 128
|
#define MAX_LAYER_NUM_OF_FRAME 128
|
||||||
#define MAX_NAL_UNITS_IN_LAYER 128 // predetermined here, adjust it later if need
|
#define MAX_NAL_UNITS_IN_LAYER 128 ///< predetermined here, adjust it later if need
|
||||||
|
|
||||||
#define MAX_RTP_PAYLOAD_LEN 1000
|
#define MAX_RTP_PAYLOAD_LEN 1000
|
||||||
#define AVERAGE_RTP_PAYLOAD_LEN 800
|
#define AVERAGE_RTP_PAYLOAD_LEN 800
|
||||||
|
|
||||||
|
|
||||||
#define SAVED_NALUNIT_NUM_TMP ( (MAX_SPATIAL_LAYER_NUM*MAX_QUALITY_LAYER_NUM) + 1 + MAX_SPATIAL_LAYER_NUM ) //SPS/PPS + SEI/SSEI + PADDING_NAL
|
#define SAVED_NALUNIT_NUM_TMP ( (MAX_SPATIAL_LAYER_NUM*MAX_QUALITY_LAYER_NUM) + 1 + MAX_SPATIAL_LAYER_NUM ) ///< SPS/PPS + SEI/SSEI + PADDING_NAL
|
||||||
#define MAX_SLICES_NUM_TMP ( ( MAX_NAL_UNITS_IN_LAYER - SAVED_NALUNIT_NUM_TMP ) / 3 )
|
#define MAX_SLICES_NUM_TMP ( ( MAX_NAL_UNITS_IN_LAYER - SAVED_NALUNIT_NUM_TMP ) / 3 )
|
||||||
|
|
||||||
#define AUTO_REF_PIC_COUNT -1 // encoder selects the number of reference frame automatically
|
|
||||||
typedef enum {
|
|
||||||
/* Errors derived from bitstream parsing */
|
|
||||||
dsErrorFree = 0x00, /* Bitstream error-free */
|
|
||||||
dsFramePending = 0x01, /* Need more throughput to generate a frame output, */
|
|
||||||
dsRefLost = 0x02, /* layer lost at reference frame with temporal id 0 */
|
|
||||||
dsBitstreamError = 0x04, /* Error bitstreams(maybe broken internal frame) the decoder cared */
|
|
||||||
dsDepLayerLost = 0x08, /* Dependented layer is ever lost */
|
|
||||||
dsNoParamSets = 0x10, /* No parameter set NALs involved */
|
|
||||||
dsDataErrorConcealed = 0x20, /* current data Error concealed specified */
|
|
||||||
|
|
||||||
/* Errors derived from logic level */
|
#define AUTO_REF_PIC_COUNT -1 ///< encoder selects the number of reference frame automatically
|
||||||
dsInvalidArgument = 0x1000, /* Invalid argument specified */
|
#define UNSPECIFIED_BIT_RATE 0 ///< to do: add detail comment
|
||||||
dsInitialOptExpected = 0x2000, /* Initializing operation is expected */
|
|
||||||
dsOutOfMemory = 0x4000, /* Out of memory due to new request */
|
/**
|
||||||
/* ANY OTHERS? */
|
* @brief Struct of OpenH264 version
|
||||||
dsDstBufNeedExpand = 0x8000 /* Actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size */
|
*/
|
||||||
|
///
|
||||||
|
/// E.g. SDK version is 1.2.0.0, major version number is 1, minor version number is 2, and revision number is 0.
|
||||||
|
typedef struct _tagVersion {
|
||||||
|
unsigned int uMajor; ///< The major version number
|
||||||
|
unsigned int uMinor; ///< The minor version number
|
||||||
|
unsigned int uRevision; ///< The revision number
|
||||||
|
unsigned int uReserved; ///< The reserved number, it should be 0.
|
||||||
|
} OpenH264Version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Decoding status
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
/**
|
||||||
|
* Errors derived from bitstream parsing
|
||||||
|
*/
|
||||||
|
dsErrorFree = 0x00, ///< bit stream error-free
|
||||||
|
dsFramePending = 0x01, ///< need more throughput to generate a frame output,
|
||||||
|
dsRefLost = 0x02, ///< layer lost at reference frame with temporal id 0
|
||||||
|
dsBitstreamError = 0x04, ///< error bitstreams(maybe broken internal frame) the decoder cared
|
||||||
|
dsDepLayerLost = 0x08, ///< dependented layer is ever lost
|
||||||
|
dsNoParamSets = 0x10, ///< no parameter set NALs involved
|
||||||
|
dsDataErrorConcealed = 0x20, ///< current data error concealed specified
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Errors derived from logic level
|
||||||
|
*/
|
||||||
|
dsInvalidArgument = 0x1000, ///< invalid argument specified
|
||||||
|
dsInitialOptExpected = 0x2000, ///< initializing operation is expected
|
||||||
|
dsOutOfMemory = 0x4000, ///< out of memory due to new request
|
||||||
|
/**
|
||||||
|
* ANY OTHERS?
|
||||||
|
*/
|
||||||
|
dsDstBufNeedExpan = 0x8000 ///< actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size
|
||||||
|
|
||||||
} DECODING_STATE;
|
} DECODING_STATE;
|
||||||
|
|
||||||
/* Option types introduced in SVC encoder application */
|
/**
|
||||||
|
* @brief Option types introduced in SVC encoder application
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ENCODER_OPTION_DATAFORMAT = 0,
|
ENCODER_OPTION_DATAFORMAT = 0,
|
||||||
ENCODER_OPTION_IDR_INTERVAL,
|
ENCODER_OPTION_IDR_INTERVAL, ///< IDR period,0/-1 means no Intra period (only the first frame); lager than 0 means the desired IDR period, must be multiple of (2^temporal_layer)
|
||||||
ENCODER_OPTION_SVC_ENCODE_PARAM_BASE,
|
ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, ///< structure of Base Param
|
||||||
ENCODER_OPTION_SVC_ENCODE_PARAM_EXT,
|
ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, ///< structure of Extension Param
|
||||||
ENCODER_OPTION_FRAME_RATE,
|
ENCODER_OPTION_FRAME_RATE, ///< maximal input frame rate, current supported range: MAX_FRAME_RATE = 30,MIN_FRAME_RATE = 1
|
||||||
ENCODER_OPTION_BITRATE,
|
ENCODER_OPTION_BITRATE,
|
||||||
ENCODER_OPTION_MAX_BITRATE,
|
ENCODER_OPTION_MAX_BITRATE,
|
||||||
ENCODER_OPTION_INTER_SPATIAL_PRED,
|
ENCODER_OPTION_INTER_SPATIAL_PRED,
|
||||||
ENCODER_OPTION_RC_MODE,
|
ENCODER_OPTION_RC_MODE,
|
||||||
ENCODER_PADDING_PADDING,
|
ENCODER_PADDING_PADDING, ///< 0:disable padding;1:padding
|
||||||
|
|
||||||
ENCODER_OPTION_PROFILE,
|
ENCODER_OPTION_PROFILE, ///< assgin the profile for each layer
|
||||||
ENCODER_OPTION_LEVEL,
|
ENCODER_OPTION_LEVEL, ///< assgin the level for each layer
|
||||||
ENCODER_OPTION_NUMBER_REF,
|
ENCODER_OPTION_NUMBER_REF, ///< the number of refererence frame
|
||||||
ENCODER_OPTION_DELIVERY_STATUS,
|
ENCODER_OPTION_DELIVERY_STATUS, ///< the delivery info which is a feedback from app level
|
||||||
|
|
||||||
ENCODER_LTR_RECOVERY_REQUEST,
|
ENCODER_LTR_RECOVERY_REQUEST,
|
||||||
ENCODER_LTR_MARKING_FEEDBACK,
|
ENCODER_LTR_MARKING_FEEDBACK,
|
||||||
ENCODER_LTR_MARKING_PERIOD,
|
ENCODER_LTR_MARKING_PERIOD,
|
||||||
ENCODER_OPTION_LTR,
|
ENCODER_OPTION_LTR, ///< 0:disable LTR;larger than 0 enable LTR; LTR number is fixed to be 2 in current encoder
|
||||||
ENCODER_OPTION_COMPLEXITY,
|
ENCODER_OPTION_COMPLEXITY,
|
||||||
|
|
||||||
ENCODER_OPTION_ENABLE_SSEI, //enable SSEI: true--enable ssei; false--disable ssei
|
ENCODER_OPTION_ENABLE_SSEI, ///< enable SSEI: true--enable ssei; false--disable ssei
|
||||||
ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, //enable prefix: true--enable prefix; false--disable prefix
|
ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, ///< enable prefix: true--enable prefix; false--disable prefix
|
||||||
ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, //enable pSps/pPps id addition: true--enable pSps/pPps id; false--disable pSps/pPps id addistion
|
ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, ///< enable pSps/pPps id addition: true--enable pSps/pPps id; false--disable pSps/pPps id addistion
|
||||||
|
|
||||||
ENCODER_OPTION_CURRENT_PATH,
|
ENCODER_OPTION_CURRENT_PATH,
|
||||||
ENCODER_OPTION_DUMP_FILE,
|
ENCODER_OPTION_DUMP_FILE, ///< dump layer reconstruct frame to a specified file
|
||||||
ENCODER_OPTION_TRACE_LEVEL,
|
ENCODER_OPTION_TRACE_LEVEL, ///< trace info based on the trace level
|
||||||
ENCODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
|
ENCODER_OPTION_TRACE_CALLBACK, ///< a void (*)(void* context, int level, const char* message) function which receives log messages
|
||||||
ENCODER_OPTION_TRACE_CALLBACK_CONTEXT,
|
ENCODER_OPTION_TRACE_CALLBACK_CONTEXT, ///< context info of trace callback
|
||||||
|
|
||||||
|
ENCODER_OPTION_GET_STATISTICS, ///< read only
|
||||||
|
ENCODER_OPTION_STATISTICS_LOG_INTERVAL, ///< log interval in millisecond
|
||||||
|
|
||||||
|
ENCODER_OPTION_IS_LOSSLESS_LINK, ///< advanced algorithmetic settings
|
||||||
|
|
||||||
|
ENCODER_OPTION_BITS_VARY_PERCENTAGE ///< bit vary percentage
|
||||||
} ENCODER_OPTION;
|
} ENCODER_OPTION;
|
||||||
|
|
||||||
/* Option types introduced in decoder application */
|
/**
|
||||||
|
* @brief Option types introduced in decoder application
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DECODER_OPTION_DATAFORMAT = 0, /* Set color space of decoding output frame */
|
DECODER_OPTION_DATAFORMAT = 0, ///< color format, now supports 23 only (I420)
|
||||||
DECODER_OPTION_END_OF_STREAM, /* Indicate bitstream of the final frame to be decoded */
|
DECODER_OPTION_END_OF_STREAM, ///< end of stream flag
|
||||||
DECODER_OPTION_VCL_NAL, //feedback whether or not have VCL NAL in current AU for application layer
|
DECODER_OPTION_VCL_NAL, ///< feedback whether or not have VCL NAL in current AU for application layer
|
||||||
DECODER_OPTION_TEMPORAL_ID, //feedback temporal id for application layer
|
DECODER_OPTION_TEMPORAL_ID, ///< feedback temporal id for application layer
|
||||||
DECODER_OPTION_FRAME_NUM, //feedback current decoded frame number
|
DECODER_OPTION_FRAME_NUM, ///< feedback current decoded frame number
|
||||||
DECODER_OPTION_IDR_PIC_ID, // feedback current frame belong to which IDR period
|
DECODER_OPTION_IDR_PIC_ID, ///< feedback current frame belong to which IDR period
|
||||||
DECODER_OPTION_LTR_MARKING_FLAG, // feedback wether current frame mark a LTR
|
DECODER_OPTION_LTR_MARKING_FLAG, ///< feedback wether current frame mark a LTR
|
||||||
DECODER_OPTION_LTR_MARKED_FRAME_NUM, // feedback frame num marked by current Frame
|
DECODER_OPTION_LTR_MARKED_FRAME_NUM, ///< feedback frame num marked by current Frame
|
||||||
DECODER_OPTION_ERROR_CON_IDC, //not finished yet, indicate decoder error concealment status, in progress
|
DECODER_OPTION_ERROR_CON_IDC, ///< not finished yet, indicate decoder error concealment status, in progress
|
||||||
DECODER_OPTION_TRACE_LEVEL,
|
DECODER_OPTION_TRACE_LEVEL,
|
||||||
DECODER_OPTION_TRACE_CALLBACK, // a void (*)(void* context, int level, const char* message) function which receives log messages
|
DECODER_OPTION_TRACE_CALLBACK, ///< a void (*)(void* context, int level, const char* message) function which receives log messages
|
||||||
DECODER_OPTION_TRACE_CALLBACK_CONTEXT,
|
DECODER_OPTION_TRACE_CALLBACK_CONTEXT,///< context info of trace callbac
|
||||||
|
|
||||||
|
DECODER_OPTION_GET_STATISTICS
|
||||||
|
|
||||||
} DECODER_OPTION;
|
} DECODER_OPTION;
|
||||||
|
|
||||||
//enuerate the types of error concealment methods
|
/**
|
||||||
|
* @brief Enumerate the type of error concealment methods
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ERROR_CON_DISABLE = 0,
|
ERROR_CON_DISABLE = 0,
|
||||||
ERROR_CON_FRAME_COPY,
|
ERROR_CON_FRAME_COPY,
|
||||||
ERROR_CON_SLICE_COPY,
|
ERROR_CON_SLICE_COPY,
|
||||||
|
ERROR_CON_FRAME_COPY_CROSS_IDR,
|
||||||
|
ERROR_CON_SLICE_COPY_CROSS_IDR,
|
||||||
|
ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE,
|
||||||
|
ERROR_CON_SLICE_MV_COPY_CROSS_IDR,
|
||||||
|
ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE
|
||||||
} ERROR_CON_IDC;
|
} ERROR_CON_IDC;
|
||||||
|
/**
|
||||||
typedef enum { //feedback that whether or not have VCL NAL in current AU
|
* @brief Feedback that whether or not have VCL NAL in current AU
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
FEEDBACK_NON_VCL_NAL = 0,
|
FEEDBACK_NON_VCL_NAL = 0,
|
||||||
FEEDBACK_VCL_NAL,
|
FEEDBACK_VCL_NAL,
|
||||||
FEEDBACK_UNKNOWN_NAL
|
FEEDBACK_UNKNOWN_NAL
|
||||||
} FEEDBACK_VCL_NAL_IN_AU;
|
} FEEDBACK_VCL_NAL_IN_AU;
|
||||||
|
|
||||||
/* Type of layer being encoded */
|
/**
|
||||||
|
* @brief Type of layer being encoded
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NON_VIDEO_CODING_LAYER = 0,
|
NON_VIDEO_CODING_LAYER = 0,
|
||||||
VIDEO_CODING_LAYER = 1
|
VIDEO_CODING_LAYER = 1
|
||||||
} LAYER_TYPE;
|
} LAYER_TYPE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Spatial layer num
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SPATIAL_LAYER_0 = 0,
|
SPATIAL_LAYER_0 = 0,
|
||||||
SPATIAL_LAYER_1 = 1,
|
SPATIAL_LAYER_1 = 1,
|
||||||
SPATIAL_LAYER_2 = 2,
|
SPATIAL_LAYER_2 = 2,
|
||||||
SPATIAL_LAYER_3 = 3,
|
SPATIAL_LAYER_3 = 3,
|
||||||
SPATIAL_LAYER_ALL = 4,
|
SPATIAL_LAYER_ALL = 4
|
||||||
} LAYER_NUM;
|
} LAYER_NUM;
|
||||||
|
|
||||||
//enumerate the type of video bitstream which is provided to decoder
|
/**
|
||||||
|
* @brief Enumerate the type of video bitstream which is provided to decoder
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIDEO_BITSTREAM_AVC = 0,
|
VIDEO_BITSTREAM_AVC = 0,
|
||||||
VIDEO_BITSTREAM_SVC = 1,
|
VIDEO_BITSTREAM_SVC = 1,
|
||||||
VIDEO_BITSTREAM_DEFAULT = VIDEO_BITSTREAM_SVC,
|
VIDEO_BITSTREAM_DEFAULT = VIDEO_BITSTREAM_SVC
|
||||||
} VIDEO_BITSTREAM_TYPE;
|
} VIDEO_BITSTREAM_TYPE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate the type of key frame request
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NO_RECOVERY_REQUSET = 0,
|
NO_RECOVERY_REQUSET = 0,
|
||||||
LTR_RECOVERY_REQUEST = 1,
|
LTR_RECOVERY_REQUEST = 1,
|
||||||
IDR_RECOVERY_REQUEST = 2,
|
IDR_RECOVERY_REQUEST = 2,
|
||||||
NO_LTR_MARKING_FEEDBACK = 3,
|
NO_LTR_MARKING_FEEDBACK = 3,
|
||||||
LTR_MARKING_SUCCESS = 4,
|
LTR_MARKING_SUCCESS = 4,
|
||||||
LTR_MARKING_FAILED = 5,
|
LTR_MARKING_FAILED = 5
|
||||||
} KEY_FRAME_REQUEST_TYPE;
|
} KEY_FRAME_REQUEST_TYPE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for LTR recover request
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int uiFeedbackType; //IDR request or LTR recovery request
|
unsigned int uiFeedbackType; ///< IDR request or LTR recovery request
|
||||||
unsigned int uiIDRPicId; // distinguish request from different IDR
|
unsigned int uiIDRPicId; ///< distinguish request from different IDR
|
||||||
int iLastCorrectFrameNum;
|
int iLastCorrectFrameNum;
|
||||||
int iCurrentFrameNum; //specify current decoder frame_num.
|
int iCurrentFrameNum; ///< specify current decoder frame_num.
|
||||||
} SLTRRecoverRequest;
|
} SLTRRecoverRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for LTR marking feedback
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int uiFeedbackType; //mark failed or successful
|
unsigned int uiFeedbackType; ///< mark failed or successful
|
||||||
unsigned int uiIDRPicId; // distinguish request from different IDR
|
unsigned int uiIDRPicId; ///< distinguish request from different IDR
|
||||||
int iLTRFrameNum; //specify current decoder frame_num
|
int iLTRFrameNum; ///< specify current decoder frame_num
|
||||||
} SLTRMarkingFeedback;
|
} SLTRMarkingFeedback;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for LTR configuration
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool bEnableLongTermReference; // 1: on, 0: off
|
bool bEnableLongTermReference; ///< 1: on, 0: off
|
||||||
int iLTRRefNum;
|
int iLTRRefNum; ///< TODO: not supported to set it arbitrary yet
|
||||||
}SLTRConfig;
|
} SLTRConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for slice argument
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int
|
unsigned int
|
||||||
uiSliceMbNum[MAX_SLICES_NUM_TMP]; //here we use a tmp fixed value since MAX_SLICES_NUM is not defined here and its definition may be changed;
|
uiSliceMbNum[MAX_SLICES_NUM_TMP]; ///< only used when uiSliceMode=2;here we use a tmp fixed value since MAX_SLICES_NUM is not defined here and its definition may be changed;
|
||||||
unsigned int uiSliceNum;
|
unsigned int uiSliceNum; ///< only used when uiSliceMode=1
|
||||||
unsigned int uiSliceSizeConstraint;
|
unsigned int uiSliceSizeConstraint; ///< only used when uiSliceMode=4
|
||||||
} SSliceArgument;//not all the elements in this argument will be used, how it will be used depends on uiSliceMode; see below
|
} SSliceArgument; ///< not all the elements in this argument will be used, how it will be used depends on uiSliceMode; please refer to SliceModeEnum
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate the type of slice mode
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SM_SINGLE_SLICE = 0, // | SliceNum==1
|
SM_SINGLE_SLICE = 0, ///< | SliceNum==1
|
||||||
SM_FIXEDSLCNUM_SLICE = 1, // | according to SliceNum | Enabled dynamic slicing for multi-thread
|
SM_FIXEDSLCNUM_SLICE = 1, ///< | according to SliceNum | enabled dynamic slicing for multi-thread
|
||||||
SM_RASTER_SLICE = 2, // | according to SlicesAssign | Need input of MB numbers each slice. In addition, if other constraint in SSliceArgument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
|
SM_RASTER_SLICE = 2, ///< | according to SlicesAssign | need input of MB numbers each slice. In addition, if other constraint in SSliceArgument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
|
||||||
SM_ROWMB_SLICE = 3, // | according to PictureMBHeight | Typical of single row of mbs each slice?+ slice size constraint which including re-encoding
|
SM_ROWMB_SLICE = 3, ///< | according to PictureMBHeight | typical of single row of mbs each slice + slice size constraint which including re-encoding
|
||||||
SM_DYN_SLICE = 4, // | according to SliceSize | Dynamic slicing (have no idea about slice_nums until encoding current frame)
|
SM_DYN_SLICE = 4, ///< | according to SliceSize | dynamic slicing (have no idea about slice_nums until encoding current frame)
|
||||||
SM_AUTO_SLICE = 5, // | according to thread number
|
SM_AUTO_SLICE = 5, ///< | according to thread number
|
||||||
SM_RESERVED = 6
|
SM_RESERVED = 6
|
||||||
} SliceModeEnum;
|
} SliceModeEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate the type of rate control mode
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
RC_QUALITY_MODE = 0, //Quality mode
|
RC_QUALITY_MODE = 0, ///< quality mode
|
||||||
RC_BITRATE_MODE = 1, //Bitrate mode
|
RC_BITRATE_MODE = 1, ///< bitrate mode
|
||||||
RC_LOW_BW_MODE = 2, //bitrate limited mode
|
RC_BUFFERBASED_MODE = 2, ///< no bitrate control,only using buffer status,adjust the video quality
|
||||||
RC_BUFFERBASED_MODE = 3,//no bitrate control,only using buffer status,adjust the video quality
|
RC_TIMESTAMP_MODE = 3, //rate control based timestamp
|
||||||
RC_OFF_MODE = -1, // rate control off mode
|
RC_OFF_MODE = -1 ///< rate control off mode
|
||||||
} RC_MODES;
|
} RC_MODES;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate the type of profile id
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PRO_UNKNOWN = 0,
|
PRO_UNKNOWN = 0,
|
||||||
PRO_BASELINE = 66,
|
PRO_BASELINE = 66,
|
||||||
PRO_MAIN = 77,
|
PRO_MAIN = 77,
|
||||||
PRO_EXTENDED = 88,
|
PRO_EXTENDED = 88,
|
||||||
PRO_HIGH = 100,
|
PRO_HIGH = 100,
|
||||||
PRO_HIGH10 = 110,
|
PRO_HIGH10 = 110,
|
||||||
PRO_HIGH422 = 122,
|
PRO_HIGH422 = 122,
|
||||||
PRO_HIGH444 = 144,
|
PRO_HIGH444 = 144,
|
||||||
PRO_CAVLC444 = 244,
|
PRO_CAVLC444 = 244,
|
||||||
|
|
||||||
PRO_SCALABLE_BASELINE = 83,
|
PRO_SCALABLE_BASELINE = 83,
|
||||||
PRO_SCALABLE_HIGH = 86,
|
PRO_SCALABLE_HIGH = 86
|
||||||
} EProfileIdc;
|
} EProfileIdc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate the type of level id
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LEVEL_UNKNOWN,
|
LEVEL_UNKNOWN,
|
||||||
LEVEL_1_0,
|
LEVEL_1_0,
|
||||||
@@ -242,133 +329,173 @@ typedef enum {
|
|||||||
LEVEL_5_2
|
LEVEL_5_2
|
||||||
} ELevelIdc;
|
} ELevelIdc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate the type of wels log
|
||||||
|
*/
|
||||||
enum {
|
enum {
|
||||||
WELS_LOG_QUIET = 0x00, // Quiet mode
|
WELS_LOG_QUIET = 0x00, ///< quiet mode
|
||||||
WELS_LOG_ERROR = 1 << 0, // Error log iLevel
|
WELS_LOG_ERROR = 1 << 0, ///< error log iLevel
|
||||||
WELS_LOG_WARNING = 1 << 1, // Warning log iLevel
|
WELS_LOG_WARNING = 1 << 1, ///< Warning log iLevel
|
||||||
WELS_LOG_INFO = 1 << 2, // Information log iLevel
|
WELS_LOG_INFO = 1 << 2, ///< information log iLevel
|
||||||
WELS_LOG_DEBUG = 1 << 3, // Debug log, critical algo log
|
WELS_LOG_DEBUG = 1 << 3, ///< debug log, critical algo log
|
||||||
WELS_LOG_DETAIL = 1 << 4, // per packet/frame log
|
WELS_LOG_DETAIL = 1 << 4, ///< per packet/frame log
|
||||||
WELS_LOG_RESV = 1 << 5, // Resversed log iLevel
|
WELS_LOG_RESV = 1 << 5, ///< resversed log iLevel
|
||||||
WELS_LOG_LEVEL_COUNT = 6,
|
WELS_LOG_LEVEL_COUNT = 6,
|
||||||
WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
|
WELS_LOG_DEFAULT = WELS_LOG_WARNING ///< default log iLevel in Wels codec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for slice configuration
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE
|
SliceModeEnum uiSliceMode; ///< by default, uiSliceMode will be SM_SINGLE_SLICE
|
||||||
SSliceArgument sSliceArgument;
|
SSliceArgument sSliceArgument;
|
||||||
} SSliceConfig;
|
} SSliceConfig;
|
||||||
|
/**
|
||||||
|
* @brief Structure for spatial layer configuration
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int iVideoWidth; // video size in cx specified for a layer
|
int iVideoWidth; ///< width of picture in luminance samples of a layer
|
||||||
int iVideoHeight; // video size in cy specified for a layer
|
int iVideoHeight; ///< height of picture in luminance samples of a layer
|
||||||
float fFrameRate; // frame rate specified for a layer
|
float fFrameRate; ///< frame rate specified for a layer
|
||||||
int iSpatialBitrate; // target bitrate for a spatial layer
|
int iSpatialBitrate; ///< target bitrate for a spatial layer
|
||||||
int iMaxSpatialBitrate;
|
int iMaxSpatialBitrate; ///< maximum bitrate for a spatial layer
|
||||||
EProfileIdc uiProfileIdc; // value of profile IDC (PRO_UNKNOWN for auto-detection)
|
EProfileIdc uiProfileIdc; ///< value of profile IDC (PRO_UNKNOWN for auto-detection)
|
||||||
ELevelIdc uiLevelIdc;
|
ELevelIdc uiLevelIdc; ///< value of profile IDC (0 for auto-detection)
|
||||||
int iDLayerQp;
|
int iDLayerQp; ///< value of level IDC (0 for auto-detection)
|
||||||
|
|
||||||
SSliceConfig sSliceCfg;
|
SSliceConfig sSliceCfg; ///< slice configuration for a layer
|
||||||
} SSpatialLayerConfig;
|
} SSpatialLayerConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Encoder usage type
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CAMERA_VIDEO_REAL_TIME, //camera video signal
|
CAMERA_VIDEO_REAL_TIME, ///< camera video for real-time communication
|
||||||
SCREEN_CONTENT_REAL_TIME,//screen content signal
|
SCREEN_CONTENT_REAL_TIME, ///< screen content signal
|
||||||
|
CAMERA_VIDEO_NON_REAL_TIME
|
||||||
} EUsageType;
|
} EUsageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumulate the complexity mode
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LOW_COMPLEXITY, //the lowest compleixty,the fastest speed,
|
LOW_COMPLEXITY, ///< the lowest compleixty,the fastest speed,
|
||||||
MEDIUM_COMPLEXITY, //medium complexity, medium speed,medium quality
|
MEDIUM_COMPLEXITY, ///< medium complexity, medium speed,medium quality
|
||||||
HIGH_COMPLEXITY, //high complexity, lowest speed, high quality
|
HIGH_COMPLEXITY ///< high complexity, lowest speed, high quality
|
||||||
} ECOMPLEXITY_MODE;
|
} ECOMPLEXITY_MODE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumulate for the stategy of SPS/PPS strategy
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
CONSTANT_ID = 0, ///< constant id in SPS/PPS
|
||||||
|
INCREASING_ID = 0x01, ///< SPS/PPS id increases at each IDR
|
||||||
|
SPS_LISTING = 0x02, ///< using SPS in the existing list if possible
|
||||||
|
SPS_LISTING_AND_PPS_INCREASING = 0x03,
|
||||||
|
SPS_PPS_LISTING = 0x06,
|
||||||
|
} EParameterSetStrategy;
|
||||||
|
|
||||||
// TODO: Refine the parameters definition.
|
// TODO: Refine the parameters definition.
|
||||||
// SVC Encoding Parameters
|
/**
|
||||||
|
* @brief SVC Encoding Parameters
|
||||||
|
*/
|
||||||
typedef struct TagEncParamBase {
|
typedef struct TagEncParamBase {
|
||||||
EUsageType
|
EUsageType
|
||||||
iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
|
iUsageType; ///< application type;1.CAMERA_VIDEO_REAL_TIME:camera video signal; 2.SCREEN_CONTENT_REAL_TIME:screen content signal;
|
||||||
|
|
||||||
int iPicWidth; // width of picture in samples
|
int iPicWidth; ///< width of picture in luminance samples (the maximum of all layers if multiple spatial layers presents)
|
||||||
int iPicHeight; // height of picture in samples
|
int iPicHeight; ///< height of picture in luminance samples((the maximum of all layers if multiple spatial layers presents)
|
||||||
int iTargetBitrate; // target bitrate desired
|
int iTargetBitrate; ///< target bitrate desired
|
||||||
RC_MODES iRCMode; // RC mode
|
RC_MODES iRCMode; ///< rate control mode
|
||||||
float fMaxFrameRate; // input maximal frame rate
|
float fMaxFrameRate; ///< maximal input frame rate
|
||||||
|
|
||||||
} SEncParamBase, *PEncParamBase;
|
} SEncParamBase, *PEncParamBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief SVC Encoding Parameters extention
|
||||||
|
*/
|
||||||
typedef struct TagEncParamExt {
|
typedef struct TagEncParamExt {
|
||||||
EUsageType
|
EUsageType
|
||||||
iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
|
iUsageType; ///< application type;1.CAMERA_VIDEO_REAL_TIME:camera video signal;2.SCREEN_CONTENT_REAL_TIME:screen content signal;
|
||||||
|
|
||||||
int iPicWidth; // width of picture in samples
|
int iPicWidth; ///< width of picture in luminance samples (the maximum of all layers if multiple spatial layers presents)
|
||||||
int iPicHeight; // height of picture in samples
|
int iPicHeight; ///< height of picture in luminance samples((the maximum of all layers if multiple spatial layers presents)
|
||||||
int iTargetBitrate; // target bitrate desired
|
int iTargetBitrate; ///< target bitrate desired
|
||||||
RC_MODES iRCMode; // RC mode
|
RC_MODES iRCMode; ///< rate control mode
|
||||||
float fMaxFrameRate; // input maximal frame rate
|
float fMaxFrameRate; ///< maximal input frame rate
|
||||||
|
|
||||||
int iTemporalLayerNum; // layer number at temporal level
|
int iTemporalLayerNum; ///< temporal layer number, max temporal layer = 4
|
||||||
int iSpatialLayerNum; // layer number at spatial level
|
int iSpatialLayerNum; ///< spatial layer number,1<= iSpatialLayerNum <= MAX_SPATIAL_LAYER_NUM, MAX_SPATIAL_LAYER_NUM = 4
|
||||||
SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
|
SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
|
||||||
|
|
||||||
ECOMPLEXITY_MODE iComplexityMode;
|
ECOMPLEXITY_MODE iComplexityMode;
|
||||||
unsigned int uiIntraPeriod; // period of Intra frame
|
unsigned int uiIntraPeriod; ///< period of Intra frame
|
||||||
int iNumRefFrame; // number of reference frame used
|
int iNumRefFrame; ///< number of reference frame used
|
||||||
bool bEnableSpsPpsIdAddition;
|
EParameterSetStrategy
|
||||||
bool bPrefixNalAddingCtrl;
|
eSpsPpsIdStrategy; ///< different stategy in adjust ID in SPS/PPS: 0- constant ID, 1-additional ID, 6-mapping and additional
|
||||||
bool bEnableSSEI;
|
bool bPrefixNalAddingCtrl; ///< false:not use Prefix NAL; true: use Prefix NAL
|
||||||
int iPaddingFlag; // 0:disable padding;1:padding
|
bool bEnableSSEI; ///< false:not use SSEI; true: use SSEI -- TODO: planning to remove the interface of SSEI
|
||||||
int iEntropyCodingModeFlag;
|
bool bSimulcastAVC; ///< (when encoding more than 1 spatial layer) false: use SVC syntax for higher layers; true: use Simulcast AVC -- coming soon
|
||||||
|
int iPaddingFlag; ///< 0:disable padding;1:padding
|
||||||
|
int iEntropyCodingModeFlag; ///< 0:CAVLC 1:CABAC.
|
||||||
|
|
||||||
/* rc control */
|
/* rc control */
|
||||||
bool bEnableFrameSkip; // allow skipping frames to keep the bitrate within limits
|
bool bEnableFrameSkip; ///< False: don't skip frame even if VBV buffer overflow.True: allow skipping frames to keep the bitrate within limits
|
||||||
int iMaxBitrate; // max bitrate desired
|
int iMaxBitrate; ///< the maximum bitrate
|
||||||
int iMaxQp;
|
int iMaxQp; ///< the maximum QP encoder supports
|
||||||
int iMinQp;
|
int iMinQp; ///< the minmum QP encoder supports
|
||||||
unsigned int uiMaxNalSize;
|
unsigned int uiMaxNalSize; ///< the maximum NAL size. This value should be not 0 for dynamic slice mode
|
||||||
|
|
||||||
/*LTR settings*/
|
/*LTR settings*/
|
||||||
bool bEnableLongTermReference; // 1: on, 0: off
|
bool bEnableLongTermReference; ///< 1: on, 0: off
|
||||||
int iLTRRefNum;
|
int iLTRRefNum; ///< the number of LTR(long term reference),TODO: not supported to set it arbitrary yet
|
||||||
unsigned int iLtrMarkPeriod;
|
unsigned int iLtrMarkPeriod; ///< the LTR marked period that is used in feedback.
|
||||||
|
|
||||||
/* multi-thread settings*/
|
/* multi-thread settings*/
|
||||||
unsigned short
|
unsigned short
|
||||||
iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
|
iMultipleThreadIdc; ///< 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; lager than 1: count number of threads;
|
||||||
|
|
||||||
/* Deblocking loop filter */
|
/* Deblocking loop filter */
|
||||||
int iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries
|
int iLoopFilterDisableIdc; ///< 0: on, 1: off, 2: on except for slice boundaries
|
||||||
int iLoopFilterAlphaC0Offset;// AlphaOffset: valid range [-6, 6], default 0
|
int iLoopFilterAlphaC0Offset; ///< AlphaOffset: valid range [-6, 6], default 0
|
||||||
int iLoopFilterBetaOffset; // BetaOffset: valid range [-6, 6], default 0
|
int iLoopFilterBetaOffset; ///< BetaOffset: valid range [-6, 6], default 0
|
||||||
/*pre-processing feature*/
|
/*pre-processing feature*/
|
||||||
bool bEnableDenoise; // denoise control
|
bool bEnableDenoise; ///< denoise control
|
||||||
bool bEnableBackgroundDetection;// background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
|
bool bEnableBackgroundDetection; ///< background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
|
||||||
bool bEnableAdaptiveQuant; // adaptive quantization control
|
bool bEnableAdaptiveQuant; ///< adaptive quantization control
|
||||||
bool bEnableFrameCroppingFlag;// enable frame cropping flag: TRUE always in application
|
bool bEnableFrameCroppingFlag; ///< enable frame cropping flag: TRUE always in application
|
||||||
bool bEnableSceneChangeDetect;
|
bool bEnableSceneChangeDetect;
|
||||||
|
|
||||||
|
bool bIsLosslessLink; ///< LTR advanced setting
|
||||||
} SEncParamExt;
|
} SEncParamExt;
|
||||||
|
|
||||||
//Define a new struct to show the property of video bitstream.
|
/**
|
||||||
|
* @brief Define a new struct to show the property of video bitstream.
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int size; //size of the struct
|
unsigned int size; ///< size of the struct
|
||||||
VIDEO_BITSTREAM_TYPE eVideoBsType;
|
VIDEO_BITSTREAM_TYPE eVideoBsType; ///< video stream type (AVC/SVC)
|
||||||
} SVideoProperty;
|
} SVideoProperty;
|
||||||
|
|
||||||
/* SVC Decoding Parameters, reserved here and potential applicable in the future */
|
/**
|
||||||
|
* @brief SVC Decoding Parameters, reserved here and potential applicable in the future
|
||||||
|
*/
|
||||||
typedef struct TagSVCDecodingParam {
|
typedef struct TagSVCDecodingParam {
|
||||||
char* pFileNameRestructed; // File name of restructed frame used for PSNR calculation based debug
|
char* pFileNameRestructed; ///< file name of reconstructed frame used for PSNR calculation based debug
|
||||||
|
|
||||||
EVideoFormatType eOutputColorFormat; // color space format to be outputed, EVideoFormatType specified in codec_def.h
|
EVideoFormatType eOutputColorFormat; ///< color space format to be outputed, EVideoFormatType specified in codec_def.h
|
||||||
unsigned int uiCpuLoad; // CPU load
|
unsigned int uiCpuLoad; ///< CPU load
|
||||||
unsigned char uiTargetDqLayer; // Setting target dq layer id
|
unsigned char uiTargetDqLayer; ///< setting target dq layer id
|
||||||
|
|
||||||
ERROR_CON_IDC eEcActiveIdc; // Whether active error concealment feature in decoder
|
ERROR_CON_IDC eEcActiveIdc; ///< whether active error concealment feature in decoder
|
||||||
|
bool bParseOnly; ///< decoder for parse only, no reconstruction. When it is true, SPS/PPS size should not exceed SPS_PPS_BS_SIZE (128). Otherwise, it will return error info
|
||||||
|
|
||||||
SVideoProperty sVideoProperty;
|
SVideoProperty sVideoProperty; ///< video stream property
|
||||||
} SDecodingParam, *PDecodingParam;
|
} SDecodingParam, *PDecodingParam;
|
||||||
|
|
||||||
/* Bitstream inforamtion of a layer being encoded */
|
/**
|
||||||
|
* @brief Bitstream inforamtion of a layer being encoded
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned char uiTemporalId;
|
unsigned char uiTemporalId;
|
||||||
unsigned char uiSpatialId;
|
unsigned char uiSpatialId;
|
||||||
@@ -376,70 +503,168 @@ typedef struct {
|
|||||||
|
|
||||||
unsigned char uiLayerType;
|
unsigned char uiLayerType;
|
||||||
|
|
||||||
int iNalCount; // Count number of NAL coded already
|
int iNalCount; ///< count number of NAL coded already
|
||||||
int* pNalLengthInByte; // Length of NAL size in byte from 0 to iNalCount-1
|
int* pNalLengthInByte; ///< length of NAL size in byte from 0 to iNalCount-1
|
||||||
unsigned char* pBsBuf; // Buffer of bitstream contained
|
unsigned char* pBsBuf; ///< buffer of bitstream contained
|
||||||
} SLayerBSInfo, *PLayerBSInfo;
|
} SLayerBSInfo, *PLayerBSInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Frame bit stream info
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int iTemporalId; // Temporal ID
|
int iTemporalId; ///< temporal ID
|
||||||
//The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
|
|
||||||
//predicted from any picture on any higher layer.
|
/**
|
||||||
int iSubSeqId; //refer to D.2.11 Sub-sequence information SEI message semantics
|
* The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
|
||||||
|
* predicted from any picture on any higher layer.
|
||||||
|
*/
|
||||||
|
int iSubSeqId; ///< refer to D.2.11 Sub-sequence information SEI message semantics
|
||||||
|
|
||||||
int iLayerNum;
|
int iLayerNum;
|
||||||
SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
|
SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
|
||||||
|
|
||||||
EVideoFrameType eFrameType;
|
EVideoFrameType eFrameType;
|
||||||
|
int iFrameSizeInBytes;
|
||||||
long long uiTimeStamp;
|
long long uiTimeStamp;
|
||||||
} SFrameBSInfo, *PFrameBSInfo;
|
} SFrameBSInfo, *PFrameBSInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for source picture
|
||||||
|
*/
|
||||||
typedef struct Source_Picture_s {
|
typedef struct Source_Picture_s {
|
||||||
int iColorFormat; // color space type
|
int iColorFormat; ///< color space type
|
||||||
int iStride[4]; // stride for each plane pData
|
int iStride[4]; ///< stride for each plane pData
|
||||||
unsigned char* pData[4]; // plane pData
|
unsigned char* pData[4]; ///< plane pData
|
||||||
int iPicWidth; // luma picture width in x coordinate
|
int iPicWidth; ///< luma picture width in x coordinate
|
||||||
int iPicHeight; // luma picture height in y coordinate
|
int iPicHeight; ///< luma picture height in y coordinate
|
||||||
long long uiTimeStamp;
|
long long uiTimeStamp;
|
||||||
} SSourcePicture;
|
} SSourcePicture;
|
||||||
|
/**
|
||||||
|
* @brief Structure for bit rate info
|
||||||
|
*/
|
||||||
typedef struct TagBitrateInfo {
|
typedef struct TagBitrateInfo {
|
||||||
LAYER_NUM iLayer;
|
LAYER_NUM iLayer;
|
||||||
int iBitrate; //the maximum bitrate
|
int iBitrate; ///< the maximum bitrate
|
||||||
} SBitrateInfo;
|
} SBitrateInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for dump layer info
|
||||||
|
*/
|
||||||
typedef struct TagDumpLayer {
|
typedef struct TagDumpLayer {
|
||||||
int iLayer;
|
int iLayer;
|
||||||
char* pFileName;
|
char* pFileName;
|
||||||
} SDumpLayer;
|
} SDumpLayer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for profile info in layer
|
||||||
|
*
|
||||||
|
*/
|
||||||
typedef struct TagProfileInfo {
|
typedef struct TagProfileInfo {
|
||||||
int iLayer;
|
int iLayer;
|
||||||
EProfileIdc uiProfileIdc; //the profile info
|
EProfileIdc uiProfileIdc; ///< the profile info
|
||||||
} SProfileInfo;
|
} SProfileInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for level info in layer
|
||||||
|
*
|
||||||
|
*/
|
||||||
typedef struct TagLevelInfo {
|
typedef struct TagLevelInfo {
|
||||||
int iLayer;
|
int iLayer;
|
||||||
ELevelIdc uiLevelIdc; //the level info
|
ELevelIdc uiLevelIdc; ///< the level info
|
||||||
} SLevelInfo;
|
} SLevelInfo;
|
||||||
|
/**
|
||||||
|
* @brief Structure for dilivery status
|
||||||
|
*
|
||||||
|
*/
|
||||||
typedef struct TagDeliveryStatus {
|
typedef struct TagDeliveryStatus {
|
||||||
int iDropNum; //the number of video frames that are dropped continuously before delivery to encoder, which is used by screen content.
|
bool bDeliveryFlag; ///< 0: the previous frame isn't delivered,1: the previous frame is delivered
|
||||||
int iDropFrameType; // the frame type that is dropped
|
int iDropFrameType; ///< the frame type that is dropped; reserved
|
||||||
int iDropFrameSize; // the frame size that is dropped
|
int iDropFrameSize; ///< the frame size that is dropped; reserved
|
||||||
} SDeliveryStatus;
|
} SDeliveryStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The capability of decoder, for SDP negotiation
|
||||||
|
*/
|
||||||
typedef struct TagDecoderCapability {
|
typedef struct TagDecoderCapability {
|
||||||
int iProfileIdc;
|
int iProfileIdc; ///< profile_idc
|
||||||
int iProfileIop;
|
int iProfileIop; ///< profile-iop
|
||||||
int iLevelIdc;
|
int iLevelIdc; ///< level_idc
|
||||||
int iMaxMbps;
|
int iMaxMbps; ///< max-mbps
|
||||||
int iMaxFs;
|
int iMaxFs; ///< max-fs
|
||||||
int iMaxCpb;
|
int iMaxCpb; ///< max-cpb
|
||||||
int iMaxDpb;
|
int iMaxDpb; ///< max-dpb
|
||||||
int iMaxBr;
|
int iMaxBr; ///< max-br
|
||||||
bool bRedPicCap;
|
bool bRedPicCap; ///< redundant-pic-cap
|
||||||
} SDecoderCapability;
|
} SDecoderCapability;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief to do
|
||||||
|
*/
|
||||||
|
typedef struct TagParserBsInfo {
|
||||||
|
int iNalNum; ///< total NAL number in current AU
|
||||||
|
int iNalLenInByte [MAX_NAL_UNITS_IN_LAYER]; ///< each nal length
|
||||||
|
unsigned char* pDstBuff; ///< outputted dst buffer for parsed bitstream
|
||||||
|
int iSpsWidthInPixel; ///< required SPS width info
|
||||||
|
int iSpsHeightInPixel; ///< required SPS height info
|
||||||
|
unsigned long long uiInBsTimeStamp; ///< input BS timestamp
|
||||||
|
unsigned long long uiOutBsTimeStamp; ///< output BS timestamp
|
||||||
|
} SParserBsInfo, *PParserBsInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for encoder statistics
|
||||||
|
*/
|
||||||
|
typedef struct TagVideoEncoderStatistics {
|
||||||
|
unsigned int uiWidth; ///< the width of encoded frame
|
||||||
|
unsigned int uiHeight; ///< the height of encoded frame
|
||||||
|
//following standard, will be 16x aligned, if there are multiple spatial, this is of the highest
|
||||||
|
float fAverageFrameSpeedInMs; ///< average_Encoding_Time
|
||||||
|
|
||||||
|
// rate control related
|
||||||
|
float fAverageFrameRate; ///< the average frame rate in, calculate since encoding starts, supposed that the input timestamp is in unit of ms
|
||||||
|
float fLatestFrameRate; ///< the frame rate in, in the last second, supposed that the input timestamp is in unit of ms (? useful for checking BR, but is it easy to calculate?
|
||||||
|
unsigned int uiBitRate; ///< sendrate in Bits per second, calculated within the set time-window
|
||||||
|
unsigned int uiAverageFrameQP; ///< the average QP of last encoded frame
|
||||||
|
|
||||||
|
unsigned int uiInputFrameCount; ///< number of frames
|
||||||
|
unsigned int uiSkippedFrameCount; ///< number of frames
|
||||||
|
|
||||||
|
unsigned int uiResolutionChangeTimes; ///< uiResolutionChangeTimes
|
||||||
|
unsigned int uiIDRReqNum; ///< number of IDR requests
|
||||||
|
unsigned int uiIDRSentNum; ///< number of actual IDRs sent
|
||||||
|
unsigned int uiLTRSentNum; ///< number of LTR sent/marked
|
||||||
|
|
||||||
|
long long iStatisticsTs; ///< Timestamp of updating the statistics
|
||||||
|
} SEncoderStatistics; // in building, coming soon
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for decoder statistics
|
||||||
|
*/
|
||||||
|
typedef struct TagVideoDecoderStatistics {
|
||||||
|
unsigned int uiWidth; ///< the width of encode/decode frame
|
||||||
|
unsigned int uiHeight; ///< the height of encode/decode frame
|
||||||
|
float fAverageFrameSpeedInMs; ///< average_Decoding_Time
|
||||||
|
float fActualAverageFrameSpeedInMs; ///< actual average_Decoding_Time, including freezing pictures
|
||||||
|
unsigned int uiDecodedFrameCount; ///< number of frames
|
||||||
|
unsigned int uiResolutionChangeTimes; ///< uiResolutionChangeTimes
|
||||||
|
unsigned int uiIDRCorrectNum; ///< number of correct IDR received
|
||||||
|
//EC on related
|
||||||
|
unsigned int
|
||||||
|
uiAvgEcRatio; ///< when EC is on, the average ratio of total EC areas, can be an indicator of reconstruction quality
|
||||||
|
unsigned int
|
||||||
|
uiAvgEcPropRatio; ///< when EC is on, the rough average ratio of propogate EC areas, can be an indicator of reconstruction quality
|
||||||
|
unsigned int uiEcIDRNum; ///< number of actual unintegrity IDR or not received but eced
|
||||||
|
unsigned int uiEcFrameNum; ///<
|
||||||
|
unsigned int uiIDRLostNum; ///< number of whole lost IDR
|
||||||
|
unsigned int
|
||||||
|
uiFreezingIDRNum; ///< number of freezing IDR with error (partly received), under resolution change
|
||||||
|
unsigned int uiFreezingNonIDRNum; ///< number of freezing non-IDR with error
|
||||||
|
int iAvgLumaQp; ///< average luma QP. default: -1, no correct frame outputted
|
||||||
|
int iSpsReportErrorNum; ///< number of Sps Invalid report
|
||||||
|
int iSubSpsReportErrorNum; ///< number of SubSps Invalid report
|
||||||
|
int iPpsReportErrorNum; ///< number of Pps Invalid report
|
||||||
|
int iSpsNoExistNalNum; ///< number of Sps NoExist Nal
|
||||||
|
int iSubSpsNoExistNalNum; ///< number of SubSps NoExist Nal
|
||||||
|
int iPpsNoExistNalNum; ///< number of Pps NoExist Nal
|
||||||
|
} SDecoderStatistics; // in building, coming soon
|
||||||
|
|
||||||
#endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
|
#endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
|
||||||
|
|||||||
@@ -33,9 +33,15 @@
|
|||||||
#ifndef WELS_VIDEO_CODEC_DEFINITION_H__
|
#ifndef WELS_VIDEO_CODEC_DEFINITION_H__
|
||||||
#define WELS_VIDEO_CODEC_DEFINITION_H__
|
#define WELS_VIDEO_CODEC_DEFINITION_H__
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file codec_def.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate the type of video format
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/*rgb color formats*/
|
videoFormatRGB = 1, ///< rgb color formats
|
||||||
videoFormatRGB = 1,
|
|
||||||
videoFormatRGBA = 2,
|
videoFormatRGBA = 2,
|
||||||
videoFormatRGB555 = 3,
|
videoFormatRGB555 = 3,
|
||||||
videoFormatRGB565 = 4,
|
videoFormatRGB565 = 4,
|
||||||
@@ -44,56 +50,66 @@ typedef enum {
|
|||||||
videoFormatABGR = 7,
|
videoFormatABGR = 7,
|
||||||
videoFormatARGB = 8,
|
videoFormatARGB = 8,
|
||||||
|
|
||||||
/*yuv color formats*/
|
videoFormatYUY2 = 20, ///< yuv color formats
|
||||||
videoFormatYUY2 = 20,
|
|
||||||
videoFormatYVYU = 21,
|
videoFormatYVYU = 21,
|
||||||
videoFormatUYVY = 22,
|
videoFormatUYVY = 22,
|
||||||
videoFormatI420 = 23, //same as IYUV
|
videoFormatI420 = 23, ///< the same as IYUV
|
||||||
videoFormatYV12 = 24,
|
videoFormatYV12 = 24,
|
||||||
videoFormatInternal = 25, // Only Used for SVC decoder testbed
|
videoFormatInternal = 25, ///< only used in SVC decoder testbed
|
||||||
|
|
||||||
videoFormatNV12 = 26, // new format for output by DXVA decoding
|
videoFormatNV12 = 26, ///< new format for output by DXVA decoding
|
||||||
|
|
||||||
videoFormatVFlip = 0x80000000
|
videoFormatVFlip = 0x80000000
|
||||||
} EVideoFormatType;
|
} EVideoFormatType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate video frame type
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
videoFrameTypeInvalid, /* Encoder not ready or parameters are invalidate */
|
videoFrameTypeInvalid, ///< encoder not ready or parameters are invalidate
|
||||||
videoFrameTypeIDR, /* This type is only available for H264 if this frame is key frame, then return this type */
|
videoFrameTypeIDR, ///< IDR frame in H.264
|
||||||
videoFrameTypeI, /* I frame type */
|
videoFrameTypeI, ///< I frame type
|
||||||
videoFrameTypeP, /* P frame type */
|
videoFrameTypeP, ///< P frame type
|
||||||
videoFrameTypeSkip, /* Skip the frame based encoder kernel */
|
videoFrameTypeSkip, ///< skip the frame based encoder kernel
|
||||||
videoFrameTypeIPMixed, /* Frame type introduced I and P slices are mixing */
|
videoFrameTypeIPMixed ///< a frame where I and P slices are mixing, not supported yet
|
||||||
} EVideoFrameType;
|
} EVideoFrameType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enumerate return type
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
cmResultSuccess,
|
cmResultSuccess, ///< successful
|
||||||
cmInitParaError, /*Parameters are invalid */
|
cmInitParaError, ///< parameters are invalid
|
||||||
cmUnkonwReason,
|
cmUnkonwReason,
|
||||||
cmMallocMemeError, /*Malloc a memory error*/
|
cmMallocMemeError, ///< malloc a memory error
|
||||||
cmInitExpected, /*Initial action is expected*/
|
cmInitExpected, ///< initial action is expected
|
||||||
cmUnsupportedData,
|
cmUnsupportedData
|
||||||
} CM_RETURN;
|
} CM_RETURN;
|
||||||
|
|
||||||
/* nal unit type */
|
/**
|
||||||
|
* @brief Enumulate the nal unit type
|
||||||
|
*/
|
||||||
enum ENalUnitType {
|
enum ENalUnitType {
|
||||||
NAL_UNKNOWN = 0,
|
NAL_UNKNOWN = 0,
|
||||||
NAL_SLICE = 1,
|
NAL_SLICE = 1,
|
||||||
NAL_SLICE_DPA = 2,
|
NAL_SLICE_DPA = 2,
|
||||||
NAL_SLICE_DPB = 3,
|
NAL_SLICE_DPB = 3,
|
||||||
NAL_SLICE_DPC = 4,
|
NAL_SLICE_DPC = 4,
|
||||||
NAL_SLICE_IDR = 5, /* ref_idc != 0 */
|
NAL_SLICE_IDR = 5, ///< ref_idc != 0
|
||||||
NAL_SEI = 6, /* ref_idc == 0 */
|
NAL_SEI = 6, ///< ref_idc == 0
|
||||||
NAL_SPS = 7,
|
NAL_SPS = 7,
|
||||||
NAL_PPS = 8
|
NAL_PPS = 8
|
||||||
/* ref_idc == 0 for 6,9,10,11,12 */
|
///< ref_idc == 0 for 6,9,10,11,12
|
||||||
};
|
};
|
||||||
/* NRI: eNalRefIdc */
|
|
||||||
|
/**
|
||||||
|
* @brief NRI: eNalRefIdc
|
||||||
|
*/
|
||||||
enum ENalPriority {
|
enum ENalPriority {
|
||||||
NAL_PRIORITY_DISPOSABLE = 0,
|
NAL_PRIORITY_DISPOSABLE = 0,
|
||||||
NAL_PRIORITY_LOW = 1,
|
NAL_PRIORITY_LOW = 1,
|
||||||
NAL_PRIORITY_HIGH = 2,
|
NAL_PRIORITY_HIGH = 2,
|
||||||
NAL_PRIORITY_HIGHEST = 3,
|
NAL_PRIORITY_HIGHEST = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IS_PARAMETER_SET_NAL(eNalRefIdc, eNalType) \
|
#define IS_PARAMETER_SET_NAL(eNalRefIdc, eNalType) \
|
||||||
@@ -105,84 +121,93 @@ enum ENalPriority {
|
|||||||
#define FRAME_NUM_PARAM_SET (-1)
|
#define FRAME_NUM_PARAM_SET (-1)
|
||||||
#define FRAME_NUM_IDR 0
|
#define FRAME_NUM_IDR 0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief eDeblockingIdc
|
||||||
|
*/
|
||||||
|
enum {
|
||||||
|
DEBLOCKING_IDC_0 = 0,
|
||||||
|
DEBLOCKING_IDC_1 = 1,
|
||||||
|
DEBLOCKING_IDC_2 = 2
|
||||||
|
};
|
||||||
|
#define DEBLOCKING_OFFSET (6)
|
||||||
|
#define DEBLOCKING_OFFSET_MINUS (-6)
|
||||||
|
|
||||||
/* Error Tools definition */
|
/* Error Tools definition */
|
||||||
typedef unsigned short ERR_TOOL;
|
typedef unsigned short ERR_TOOL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief to do
|
||||||
|
*/
|
||||||
enum {
|
enum {
|
||||||
ET_NONE = 0x00, // NONE Error Tools
|
ET_NONE = 0x00, ///< NONE Error Tools
|
||||||
ET_IP_SCALE = 0x01, // IP Scalable
|
ET_IP_SCALE = 0x01, ///< IP Scalable
|
||||||
ET_FMO = 0x02, // Flexible Macroblock Ordering
|
ET_FMO = 0x02, ///< Flexible Macroblock Ordering
|
||||||
ET_IR_R1 = 0x04, // Intra Refresh in predifined 2% MB
|
ET_IR_R1 = 0x04, ///< Intra Refresh in predifined 2% MB
|
||||||
ET_IR_R2 = 0x08, // Intra Refresh in predifined 5% MB
|
ET_IR_R2 = 0x08, ///< Intra Refresh in predifined 5% MB
|
||||||
ET_IR_R3 = 0x10, // Intra Refresh in predifined 10% MB
|
ET_IR_R3 = 0x10, ///< Intra Refresh in predifined 10% MB
|
||||||
ET_FEC_HALF = 0x20, // Forward Error Correction in 50% redundency mode
|
ET_FEC_HALF = 0x20, ///< Forward Error Correction in 50% redundency mode
|
||||||
ET_FEC_FULL = 0x40, // Forward Error Correction in 100% redundency mode
|
ET_FEC_FULL = 0x40, ///< Forward Error Correction in 100% redundency mode
|
||||||
ET_RFS = 0x80, // Reference Frame Selection
|
ET_RFS = 0x80 ///< Reference Frame Selection
|
||||||
};
|
};
|
||||||
|
|
||||||
/* information of coded Slice(=NAL)(s) */
|
/**
|
||||||
|
* @brief Information of coded Slice(=NAL)(s)
|
||||||
|
*/
|
||||||
typedef struct SliceInformation {
|
typedef struct SliceInformation {
|
||||||
unsigned char* pBufferOfSlices; // base buffer of coded slice(s)
|
unsigned char* pBufferOfSlices; ///< base buffer of coded slice(s)
|
||||||
int iCodedSliceCount; // number of coded slices
|
int iCodedSliceCount; ///< number of coded slices
|
||||||
unsigned int* pLengthOfSlices; // array of slices length accordingly by number of slice
|
unsigned int* pLengthOfSlices; ///< array of slices length accordingly by number of slice
|
||||||
int iFecType; // FEC type[0, 50%FEC, 100%FEC]
|
int iFecType; ///< FEC type[0, 50%FEC, 100%FEC]
|
||||||
unsigned char uiSliceIdx; // index of slice in frame [FMO: 0,..,uiSliceCount-1; No FMO: 0]
|
unsigned char uiSliceIdx; ///< index of slice in frame [FMO: 0,..,uiSliceCount-1; No FMO: 0]
|
||||||
unsigned char uiSliceCount; // count number of slice in frame [FMO: 2-8; No FMO: 1]
|
unsigned char uiSliceCount; ///< count number of slice in frame [FMO: 2-8; No FMO: 1]
|
||||||
char iFrameIndex; // index of frame[-1, .., idr_interval-1]
|
char iFrameIndex; ///< index of frame[-1, .., idr_interval-1]
|
||||||
unsigned char uiNalRefIdc; // NRI, priority level of slice(NAL)
|
unsigned char uiNalRefIdc; ///< NRI, priority level of slice(NAL)
|
||||||
unsigned char uiNalType; // NAL type
|
unsigned char uiNalType; ///< NAL type
|
||||||
unsigned char
|
unsigned char
|
||||||
uiContainingFinalNal; // whether final NAL is involved in buffer of coded slices, flag used in Pause feature in T27
|
uiContainingFinalNal; ///< whether final NAL is involved in buffer of coded slices, flag used in Pause feature in T27
|
||||||
} SliceInfo, *PSliceInfo;
|
} SliceInfo, *PSliceInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief thresholds of the initial, maximal and minimal rate
|
||||||
#define CIF_WIDTH 352
|
*/
|
||||||
#define CIF_HEIGHT 288
|
|
||||||
#define QVGA_WIDTH 320
|
|
||||||
#define QVGA_HEIGHT 240
|
|
||||||
#define QCIF_WIDTH 176
|
|
||||||
#define QCIF_HEIGHT 144
|
|
||||||
#define SQCIF_WIDTH 128
|
|
||||||
#define SQCIF_HEIGHT 96
|
|
||||||
|
|
||||||
/* thresholds of the initial, maximal and minimal rate */
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int iWidth; // frame width
|
int iWidth; ///< frame width
|
||||||
int iHeight; // frame height
|
int iHeight; ///< frame height
|
||||||
int iThresholdOfInitRate; // threshold of initial rate
|
int iThresholdOfInitRate; ///< threshold of initial rate
|
||||||
int iThresholdOfMaxRate; // threshold of maximal rate
|
int iThresholdOfMaxRate; ///< threshold of maximal rate
|
||||||
int iThresholdOfMinRate; // threshold of minimal rate
|
int iThresholdOfMinRate; ///< threshold of minimal rate
|
||||||
int iMinThresholdFrameRate; //min frame rate min
|
int iMinThresholdFrameRate; ///< min frame rate min
|
||||||
int iSkipFrameRate; //skip to frame rate min
|
int iSkipFrameRate; ///< skip to frame rate min
|
||||||
int iSkipFrameStep; //how many frames to skip
|
int iSkipFrameStep; ///< how many frames to skip
|
||||||
} SRateThresholds, *PRateThresholds;
|
} SRateThresholds, *PRateThresholds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure for decoder memery
|
||||||
|
*/
|
||||||
typedef struct TagSysMemBuffer {
|
typedef struct TagSysMemBuffer {
|
||||||
int iWidth; //width of decoded pic for display
|
int iWidth; ///< width of decoded pic for display
|
||||||
int iHeight; //height of decoded pic for display
|
int iHeight; ///< height of decoded pic for display
|
||||||
int iFormat; // type is "EVideoFormatType"
|
int iFormat; ///< type is "EVideoFormatType"
|
||||||
int iStride[2]; //stride of 2 component
|
int iStride[2]; ///< stride of 2 component
|
||||||
} SSysMEMBuffer;
|
} SSysMEMBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Buffer info
|
||||||
|
*/
|
||||||
typedef struct TagBufferInfo {
|
typedef struct TagBufferInfo {
|
||||||
int iBufferStatus; // 0: one frame data is not ready; 1: one frame data is ready
|
int iBufferStatus; ///< 0: one frame data is not ready; 1: one frame data is ready
|
||||||
|
unsigned long long uiInBsTimeStamp; ///< input BS timestamp
|
||||||
|
unsigned long long uiOutYuvTimeStamp; ///< output YUV timestamp, when bufferstatus is 1
|
||||||
union {
|
union {
|
||||||
SSysMEMBuffer sSystemBuffer;
|
SSysMEMBuffer sSystemBuffer; ///< memory info for one picture
|
||||||
} UsrData;
|
} UsrData; ///< output buffer info
|
||||||
} SBufferInfo;
|
} SBufferInfo;
|
||||||
|
|
||||||
/* Constants related to transmission rate at various resolutions */
|
|
||||||
static const SRateThresholds ksRateThrMap[4] = {
|
|
||||||
// initial-maximal-minimal
|
|
||||||
{CIF_WIDTH, CIF_HEIGHT, 225000, 384000, 96000, 3, 1, 1}, // CIF
|
|
||||||
{QVGA_WIDTH, QVGA_HEIGHT, 192000, 320000, 80000, -1, -1, -1}, // QVGA
|
|
||||||
{QCIF_WIDTH, QCIF_HEIGHT, 150000, 256000, 64000, 8, 4, 2}, // QCIF
|
|
||||||
{SQCIF_WIDTH, SQCIF_HEIGHT, 120000, 192000, 48000, 5, 3, 1} // SQCIF
|
|
||||||
};
|
|
||||||
|
|
||||||
|
/**
|
||||||
// In a GOP, multiple of the key frame number, derived from
|
* @brief In a GOP, multiple of the key frame number, derived from
|
||||||
// the number of layers(index or array below)
|
* the number of layers(index or array below)
|
||||||
|
*/
|
||||||
static const char kiKeyNumMultiple[] = {
|
static const char kiKeyNumMultiple[] = {
|
||||||
1, 1, 2, 4, 8, 16,
|
1, 1, 2, 4, 8, 16,
|
||||||
};
|
};
|
||||||
|
|||||||
15
codec/api/svc/codec_ver.h
Normal file
15
codec/api/svc/codec_ver.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//The current file is auto-generated by script: generate_codec_ver.sh
|
||||||
|
#ifndef CODEC_VER_H
|
||||||
|
#define CODEC_VER_H
|
||||||
|
|
||||||
|
#include "codec_app_def.h"
|
||||||
|
|
||||||
|
static const OpenH264Version g_stCodecVersion = {1,4,0,0};
|
||||||
|
static const char* const g_strCodecVer = "OpenH264 version:1.4.0.0";
|
||||||
|
|
||||||
|
#define OPENH264_MAJOR (1)
|
||||||
|
#define OPENH264_MINOR (4)
|
||||||
|
#define OPENH264_REVISION (0)
|
||||||
|
#define OPENH264_RESERVED (0)
|
||||||
|
|
||||||
|
#endif // CODEC_VER_H
|
||||||
@@ -34,7 +34,7 @@ JNIEXPORT void JNICALL Java_com_wels_enc_WelsEncTest_DoEncoderTest
|
|||||||
/**************** Add the native codes/API *****************/
|
/**************** Add the native codes/API *****************/
|
||||||
char* argv[2];
|
char* argv[2];
|
||||||
int argc = 2;
|
int argc = 2;
|
||||||
argv[0] = (char*) ("decConsole.exe");
|
argv[0] = (char*) ("encConsole.exe");
|
||||||
argv[1] = (char*) ((*env).GetStringUTFChars (jsFileNameIn, NULL));
|
argv[1] = (char*) ((*env).GetStringUTFChars (jsFileNameIn, NULL));
|
||||||
LOGI ("Start to run JNI module!+++");
|
LOGI ("Start to run JNI module!+++");
|
||||||
EncMain (argc, argv);
|
EncMain (argc, argv);
|
||||||
|
|||||||
54
codec/build/generate_codec_ver.sh
Executable file
54
codec/build/generate_codec_ver.sh
Executable file
@@ -0,0 +1,54 @@
|
|||||||
|
# Run this to update the codec_ver.h at changes of api
|
||||||
|
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ "$1"x = ""x ]; then
|
||||||
|
echo "Please input the version number as : major_ver.minor_ver.patch.reserve"
|
||||||
|
exit 127
|
||||||
|
fi
|
||||||
|
|
||||||
|
codec_ver=`echo "$1" | egrep "^([0-9]+[.]){3}[0-9]+$"`
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Please input the version number as : major_ver.minor_ver.patch.reserve"
|
||||||
|
exit 127
|
||||||
|
fi
|
||||||
|
|
||||||
|
revision=`git show | head -n 1`
|
||||||
|
revision=`echo $revision|cut -d' ' -f2|sed -e 's#[ ]*\(.*\)[ ]*#\1#'`
|
||||||
|
revision=${revision:0:7}
|
||||||
|
|
||||||
|
echo "//The current file is auto-generated by script: generate_codec_ver.sh" >>codec_ver.h
|
||||||
|
echo "#ifndef CODEC_VER_H" >>codec_ver.h
|
||||||
|
echo "#define CODEC_VER_H" >>codec_ver.h
|
||||||
|
echo "" >>codec_ver.h
|
||||||
|
|
||||||
|
echo "#include \"codec_app_def.h\"" >>codec_ver.h
|
||||||
|
echo "" >>codec_ver.h
|
||||||
|
|
||||||
|
echo "static const OpenH264Version g_stCodecVersion = {$1};"|tr '.' ',' >>codec_ver.h
|
||||||
|
echo "static const char* const g_strCodecVer = \"OpenH264 version:$1\";" >>codec_ver.h
|
||||||
|
#if [ "$2"x = ""x ]; then
|
||||||
|
#echo "static const char* const g_strCodecBuildNum = \"OpenH264 revision:$revision\";" >> codec_ver.h
|
||||||
|
#else
|
||||||
|
#echo "static const char* const g_strCodecBuildNum = \"OpenH264 build:$2, OpenH264 revision:$revision\";" >> codec_ver.h
|
||||||
|
#fi
|
||||||
|
echo "" >>codec_ver.h
|
||||||
|
|
||||||
|
#define OPENH264_MAJOR 1, #define OPENH264_MINOR 2 #define OPENH264_REVISION 3 #define OPENH264_RESERVED 0
|
||||||
|
echo "#define OPENH264_MAJOR (${1%%.*})" >>codec_ver.h
|
||||||
|
|
||||||
|
tmp=${1#*.}
|
||||||
|
echo "#define OPENH264_MINOR (${tmp%%.*})" >>codec_ver.h
|
||||||
|
|
||||||
|
tmp=${tmp#*.}
|
||||||
|
echo "#define OPENH264_REVISION (${tmp%%.*})" >>codec_ver.h
|
||||||
|
|
||||||
|
tmp=${tmp#*.}
|
||||||
|
echo "#define OPENH264_RESERVED (${tmp%%.*})" >>codec_ver.h
|
||||||
|
echo "" >>codec_ver.h
|
||||||
|
|
||||||
|
echo "#endif // CODEC_VER_H" >>codec_ver.h
|
||||||
|
|
||||||
|
mv -f codec_ver.h ../api/svc/codec_ver.h
|
||||||
@@ -19,12 +19,17 @@
|
|||||||
4CE443D918B722CD0017DF25 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CE443D818B722CD0017DF25 /* Foundation.framework */; };
|
4CE443D918B722CD0017DF25 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CE443D818B722CD0017DF25 /* Foundation.framework */; };
|
||||||
53C1C9BC193F0FB000404D8F /* expand_pic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53C1C9BB193F0FB000404D8F /* expand_pic.cpp */; };
|
53C1C9BC193F0FB000404D8F /* expand_pic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53C1C9BB193F0FB000404D8F /* expand_pic.cpp */; };
|
||||||
5BA8F2C019603F5F00011CE4 /* common_tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5BA8F2BF19603F5F00011CE4 /* common_tables.cpp */; };
|
5BA8F2C019603F5F00011CE4 /* common_tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5BA8F2BF19603F5F00011CE4 /* common_tables.cpp */; };
|
||||||
|
5BD896BA1A7B839B00D32B7D /* memory_align.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5BD896B91A7B839B00D32B7D /* memory_align.cpp */; };
|
||||||
|
5BDD15ED1A79027600B6CA2E /* mc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5BDD15EC1A79027600B6CA2E /* mc.cpp */; };
|
||||||
F0B204F918FD23BF005DA23F /* copy_mb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F0B204F818FD23BF005DA23F /* copy_mb.cpp */; };
|
F0B204F918FD23BF005DA23F /* copy_mb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F0B204F818FD23BF005DA23F /* copy_mb.cpp */; };
|
||||||
F556A8241906673900E156A8 /* arm_arch64_common_macro.S in Sources */ = {isa = PBXBuildFile; fileRef = F556A8221906673900E156A8 /* arm_arch64_common_macro.S */; };
|
F556A8241906673900E156A8 /* arm_arch64_common_macro.S in Sources */ = {isa = PBXBuildFile; fileRef = F556A8221906673900E156A8 /* arm_arch64_common_macro.S */; };
|
||||||
F556A8251906673900E156A8 /* expand_picture_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F556A8231906673900E156A8 /* expand_picture_aarch64_neon.S */; };
|
F556A8251906673900E156A8 /* expand_picture_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F556A8231906673900E156A8 /* expand_picture_aarch64_neon.S */; };
|
||||||
F5AC94FF193EB7D800F58154 /* deblocking_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5AC94FE193EB7D800F58154 /* deblocking_aarch64_neon.S */; };
|
F5AC94FF193EB7D800F58154 /* deblocking_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5AC94FE193EB7D800F58154 /* deblocking_aarch64_neon.S */; };
|
||||||
F5B8D82D190757290037849A /* mc_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5B8D82C190757290037849A /* mc_aarch64_neon.S */; };
|
F5B8D82D190757290037849A /* mc_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5B8D82C190757290037849A /* mc_aarch64_neon.S */; };
|
||||||
F5BB0BB8196BB5960072D50D /* copy_mb_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5BB0BB7196BB5960072D50D /* copy_mb_aarch64_neon.S */; };
|
F5BB0BB8196BB5960072D50D /* copy_mb_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5BB0BB7196BB5960072D50D /* copy_mb_aarch64_neon.S */; };
|
||||||
|
F791965419D3B89D00F60C6B /* intra_pred_common_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F791965319D3B89D00F60C6B /* intra_pred_common_aarch64_neon.S */; };
|
||||||
|
F791965619D3B8A600F60C6B /* intra_pred_common_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F791965519D3B8A600F60C6B /* intra_pred_common_neon.S */; };
|
||||||
|
F791965919D3BE2200F60C6B /* intra_pred_common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F791965819D3BE2200F60C6B /* intra_pred_common.cpp */; };
|
||||||
FAABAA1818E9354A00D4186F /* sad_common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAABAA1718E9354A00D4186F /* sad_common.cpp */; };
|
FAABAA1818E9354A00D4186F /* sad_common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAABAA1718E9354A00D4186F /* sad_common.cpp */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
@@ -51,7 +56,6 @@
|
|||||||
4C3406BA18D96EA600DFA14A /* deblocking_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deblocking_common.h; sourceTree = "<group>"; };
|
4C3406BA18D96EA600DFA14A /* deblocking_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deblocking_common.h; sourceTree = "<group>"; };
|
||||||
4C3406BD18D96EA600DFA14A /* ls_defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ls_defines.h; sourceTree = "<group>"; };
|
4C3406BD18D96EA600DFA14A /* ls_defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ls_defines.h; sourceTree = "<group>"; };
|
||||||
4C3406BE18D96EA600DFA14A /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macros.h; sourceTree = "<group>"; };
|
4C3406BE18D96EA600DFA14A /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macros.h; sourceTree = "<group>"; };
|
||||||
4C3406BF18D96EA600DFA14A /* mc_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mc_common.h; sourceTree = "<group>"; };
|
|
||||||
4C3406C018D96EA600DFA14A /* measure_time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = measure_time.h; sourceTree = "<group>"; };
|
4C3406C018D96EA600DFA14A /* measure_time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = measure_time.h; sourceTree = "<group>"; };
|
||||||
4C3406C118D96EA600DFA14A /* typedefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = typedefs.h; sourceTree = "<group>"; };
|
4C3406C118D96EA600DFA14A /* typedefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = typedefs.h; sourceTree = "<group>"; };
|
||||||
4C3406C218D96EA600DFA14A /* WelsThreadLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WelsThreadLib.h; sourceTree = "<group>"; };
|
4C3406C218D96EA600DFA14A /* WelsThreadLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WelsThreadLib.h; sourceTree = "<group>"; };
|
||||||
@@ -65,8 +69,13 @@
|
|||||||
4CE443E918B722CD0017DF25 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
|
4CE443E918B722CD0017DF25 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
53C1C9BA193F0F9E00404D8F /* expand_pic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = expand_pic.h; sourceTree = "<group>"; };
|
53C1C9BA193F0F9E00404D8F /* expand_pic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = expand_pic.h; sourceTree = "<group>"; };
|
||||||
53C1C9BB193F0FB000404D8F /* expand_pic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = expand_pic.cpp; sourceTree = "<group>"; };
|
53C1C9BB193F0FB000404D8F /* expand_pic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = expand_pic.cpp; sourceTree = "<group>"; };
|
||||||
|
5B9196F91A7F8BA40075D641 /* wels_const_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wels_const_common.h; sourceTree = "<group>"; };
|
||||||
5BA8F2BE19603F3500011CE4 /* wels_common_defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wels_common_defs.h; sourceTree = "<group>"; };
|
5BA8F2BE19603F3500011CE4 /* wels_common_defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wels_common_defs.h; sourceTree = "<group>"; };
|
||||||
5BA8F2BF19603F5F00011CE4 /* common_tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = common_tables.cpp; sourceTree = "<group>"; };
|
5BA8F2BF19603F5F00011CE4 /* common_tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = common_tables.cpp; sourceTree = "<group>"; };
|
||||||
|
5BD896B81A7B837700D32B7D /* memory_align.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory_align.h; sourceTree = "<group>"; };
|
||||||
|
5BD896B91A7B839B00D32B7D /* memory_align.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memory_align.cpp; sourceTree = "<group>"; };
|
||||||
|
5BDD15EB1A79026A00B6CA2E /* mc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mc.h; sourceTree = "<group>"; };
|
||||||
|
5BDD15EC1A79027600B6CA2E /* mc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mc.cpp; sourceTree = "<group>"; };
|
||||||
F0B204F718FD23B6005DA23F /* copy_mb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = copy_mb.h; sourceTree = "<group>"; };
|
F0B204F718FD23B6005DA23F /* copy_mb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = copy_mb.h; sourceTree = "<group>"; };
|
||||||
F0B204F818FD23BF005DA23F /* copy_mb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = copy_mb.cpp; sourceTree = "<group>"; };
|
F0B204F818FD23BF005DA23F /* copy_mb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = copy_mb.cpp; sourceTree = "<group>"; };
|
||||||
F556A8221906673900E156A8 /* arm_arch64_common_macro.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = arm_arch64_common_macro.S; path = arm64/arm_arch64_common_macro.S; sourceTree = "<group>"; };
|
F556A8221906673900E156A8 /* arm_arch64_common_macro.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = arm_arch64_common_macro.S; path = arm64/arm_arch64_common_macro.S; sourceTree = "<group>"; };
|
||||||
@@ -74,6 +83,10 @@
|
|||||||
F5AC94FE193EB7D800F58154 /* deblocking_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = deblocking_aarch64_neon.S; path = arm64/deblocking_aarch64_neon.S; sourceTree = "<group>"; };
|
F5AC94FE193EB7D800F58154 /* deblocking_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = deblocking_aarch64_neon.S; path = arm64/deblocking_aarch64_neon.S; sourceTree = "<group>"; };
|
||||||
F5B8D82C190757290037849A /* mc_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = mc_aarch64_neon.S; path = arm64/mc_aarch64_neon.S; sourceTree = "<group>"; };
|
F5B8D82C190757290037849A /* mc_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = mc_aarch64_neon.S; path = arm64/mc_aarch64_neon.S; sourceTree = "<group>"; };
|
||||||
F5BB0BB7196BB5960072D50D /* copy_mb_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = copy_mb_aarch64_neon.S; path = arm64/copy_mb_aarch64_neon.S; sourceTree = "<group>"; };
|
F5BB0BB7196BB5960072D50D /* copy_mb_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = copy_mb_aarch64_neon.S; path = arm64/copy_mb_aarch64_neon.S; sourceTree = "<group>"; };
|
||||||
|
F791965319D3B89D00F60C6B /* intra_pred_common_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = intra_pred_common_aarch64_neon.S; path = arm64/intra_pred_common_aarch64_neon.S; sourceTree = "<group>"; };
|
||||||
|
F791965519D3B8A600F60C6B /* intra_pred_common_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = intra_pred_common_neon.S; sourceTree = "<group>"; };
|
||||||
|
F791965719D3BA9300F60C6B /* intra_pred_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intra_pred_common.h; sourceTree = "<group>"; };
|
||||||
|
F791965819D3BE2200F60C6B /* intra_pred_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = intra_pred_common.cpp; sourceTree = "<group>"; };
|
||||||
FAABAA1618E9353F00D4186F /* sad_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sad_common.h; sourceTree = "<group>"; };
|
FAABAA1618E9353F00D4186F /* sad_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sad_common.h; sourceTree = "<group>"; };
|
||||||
FAABAA1718E9354A00D4186F /* sad_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sad_common.cpp; sourceTree = "<group>"; };
|
FAABAA1718E9354A00D4186F /* sad_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sad_common.cpp; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
@@ -93,6 +106,7 @@
|
|||||||
4C3406B118D96EA600DFA14A /* arm */ = {
|
4C3406B118D96EA600DFA14A /* arm */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
F791965519D3B8A600F60C6B /* intra_pred_common_neon.S */,
|
||||||
4CC61F0818FF6B4B00E56EAB /* copy_mb_neon.S */,
|
4CC61F0818FF6B4B00E56EAB /* copy_mb_neon.S */,
|
||||||
4C3406B218D96EA600DFA14A /* arm_arch_common_macro.S */,
|
4C3406B218D96EA600DFA14A /* arm_arch_common_macro.S */,
|
||||||
4C3406B318D96EA600DFA14A /* deblocking_neon.S */,
|
4C3406B318D96EA600DFA14A /* deblocking_neon.S */,
|
||||||
@@ -105,6 +119,7 @@
|
|||||||
4C3406B618D96EA600DFA14A /* inc */ = {
|
4C3406B618D96EA600DFA14A /* inc */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
F791965719D3BA9300F60C6B /* intra_pred_common.h */,
|
||||||
F0B204F718FD23B6005DA23F /* copy_mb.h */,
|
F0B204F718FD23B6005DA23F /* copy_mb.h */,
|
||||||
FAABAA1618E9353F00D4186F /* sad_common.h */,
|
FAABAA1618E9353F00D4186F /* sad_common.h */,
|
||||||
4C3406B718D96EA600DFA14A /* cpu.h */,
|
4C3406B718D96EA600DFA14A /* cpu.h */,
|
||||||
@@ -114,10 +129,12 @@
|
|||||||
4C3406BA18D96EA600DFA14A /* deblocking_common.h */,
|
4C3406BA18D96EA600DFA14A /* deblocking_common.h */,
|
||||||
4C3406BD18D96EA600DFA14A /* ls_defines.h */,
|
4C3406BD18D96EA600DFA14A /* ls_defines.h */,
|
||||||
4C3406BE18D96EA600DFA14A /* macros.h */,
|
4C3406BE18D96EA600DFA14A /* macros.h */,
|
||||||
4C3406BF18D96EA600DFA14A /* mc_common.h */,
|
5BDD15EB1A79026A00B6CA2E /* mc.h */,
|
||||||
4C3406C018D96EA600DFA14A /* measure_time.h */,
|
4C3406C018D96EA600DFA14A /* measure_time.h */,
|
||||||
|
5BD896B81A7B837700D32B7D /* memory_align.h */,
|
||||||
4C3406C118D96EA600DFA14A /* typedefs.h */,
|
4C3406C118D96EA600DFA14A /* typedefs.h */,
|
||||||
5BA8F2BE19603F3500011CE4 /* wels_common_defs.h */,
|
5BA8F2BE19603F3500011CE4 /* wels_common_defs.h */,
|
||||||
|
5B9196F91A7F8BA40075D641 /* wels_const_common.h */,
|
||||||
4C3406C218D96EA600DFA14A /* WelsThreadLib.h */,
|
4C3406C218D96EA600DFA14A /* WelsThreadLib.h */,
|
||||||
);
|
);
|
||||||
path = inc;
|
path = inc;
|
||||||
@@ -126,6 +143,7 @@
|
|||||||
4C3406C318D96EA600DFA14A /* src */ = {
|
4C3406C318D96EA600DFA14A /* src */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
F791965819D3BE2200F60C6B /* intra_pred_common.cpp */,
|
||||||
5BA8F2BF19603F5F00011CE4 /* common_tables.cpp */,
|
5BA8F2BF19603F5F00011CE4 /* common_tables.cpp */,
|
||||||
F0B204F818FD23BF005DA23F /* copy_mb.cpp */,
|
F0B204F818FD23BF005DA23F /* copy_mb.cpp */,
|
||||||
FAABAA1718E9354A00D4186F /* sad_common.cpp */,
|
FAABAA1718E9354A00D4186F /* sad_common.cpp */,
|
||||||
@@ -133,6 +151,8 @@
|
|||||||
4C3406C518D96EA600DFA14A /* crt_util_safe_x.cpp */,
|
4C3406C518D96EA600DFA14A /* crt_util_safe_x.cpp */,
|
||||||
53C1C9BB193F0FB000404D8F /* expand_pic.cpp */,
|
53C1C9BB193F0FB000404D8F /* expand_pic.cpp */,
|
||||||
4C3406C618D96EA600DFA14A /* deblocking_common.cpp */,
|
4C3406C618D96EA600DFA14A /* deblocking_common.cpp */,
|
||||||
|
5BDD15EC1A79027600B6CA2E /* mc.cpp */,
|
||||||
|
5BD896B91A7B839B00D32B7D /* memory_align.cpp */,
|
||||||
4C3406C818D96EA600DFA14A /* WelsThreadLib.cpp */,
|
4C3406C818D96EA600DFA14A /* WelsThreadLib.cpp */,
|
||||||
);
|
);
|
||||||
path = src;
|
path = src;
|
||||||
@@ -179,6 +199,7 @@
|
|||||||
F556A81D1906669F00E156A8 /* arm64 */ = {
|
F556A81D1906669F00E156A8 /* arm64 */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
F791965319D3B89D00F60C6B /* intra_pred_common_aarch64_neon.S */,
|
||||||
F5BB0BB7196BB5960072D50D /* copy_mb_aarch64_neon.S */,
|
F5BB0BB7196BB5960072D50D /* copy_mb_aarch64_neon.S */,
|
||||||
F5AC94FE193EB7D800F58154 /* deblocking_aarch64_neon.S */,
|
F5AC94FE193EB7D800F58154 /* deblocking_aarch64_neon.S */,
|
||||||
F5B8D82C190757290037849A /* mc_aarch64_neon.S */,
|
F5B8D82C190757290037849A /* mc_aarch64_neon.S */,
|
||||||
@@ -242,14 +263,19 @@
|
|||||||
F5B8D82D190757290037849A /* mc_aarch64_neon.S in Sources */,
|
F5B8D82D190757290037849A /* mc_aarch64_neon.S in Sources */,
|
||||||
4C3406C918D96EA600DFA14A /* arm_arch_common_macro.S in Sources */,
|
4C3406C918D96EA600DFA14A /* arm_arch_common_macro.S in Sources */,
|
||||||
F556A8241906673900E156A8 /* arm_arch64_common_macro.S in Sources */,
|
F556A8241906673900E156A8 /* arm_arch64_common_macro.S in Sources */,
|
||||||
|
5BDD15ED1A79027600B6CA2E /* mc.cpp in Sources */,
|
||||||
F5AC94FF193EB7D800F58154 /* deblocking_aarch64_neon.S in Sources */,
|
F5AC94FF193EB7D800F58154 /* deblocking_aarch64_neon.S in Sources */,
|
||||||
4C3406CE18D96EA600DFA14A /* crt_util_safe_x.cpp in Sources */,
|
4C3406CE18D96EA600DFA14A /* crt_util_safe_x.cpp in Sources */,
|
||||||
|
F791965919D3BE2200F60C6B /* intra_pred_common.cpp in Sources */,
|
||||||
|
5BD896BA1A7B839B00D32B7D /* memory_align.cpp in Sources */,
|
||||||
4C3406CF18D96EA600DFA14A /* deblocking_common.cpp in Sources */,
|
4C3406CF18D96EA600DFA14A /* deblocking_common.cpp in Sources */,
|
||||||
5BA8F2C019603F5F00011CE4 /* common_tables.cpp in Sources */,
|
5BA8F2C019603F5F00011CE4 /* common_tables.cpp in Sources */,
|
||||||
|
F791965419D3B89D00F60C6B /* intra_pred_common_aarch64_neon.S in Sources */,
|
||||||
4C3406D118D96EA600DFA14A /* WelsThreadLib.cpp in Sources */,
|
4C3406D118D96EA600DFA14A /* WelsThreadLib.cpp in Sources */,
|
||||||
4C3406CC18D96EA600DFA14A /* mc_neon.S in Sources */,
|
4C3406CC18D96EA600DFA14A /* mc_neon.S in Sources */,
|
||||||
F5BB0BB8196BB5960072D50D /* copy_mb_aarch64_neon.S in Sources */,
|
F5BB0BB8196BB5960072D50D /* copy_mb_aarch64_neon.S in Sources */,
|
||||||
4C3406CB18D96EA600DFA14A /* expand_picture_neon.S in Sources */,
|
4C3406CB18D96EA600DFA14A /* expand_picture_neon.S in Sources */,
|
||||||
|
F791965619D3B8A600F60C6B /* intra_pred_common_neon.S in Sources */,
|
||||||
4CC61F0918FF6B4B00E56EAB /* copy_mb_neon.S in Sources */,
|
4CC61F0918FF6B4B00E56EAB /* copy_mb_neon.S in Sources */,
|
||||||
53C1C9BC193F0FB000404D8F /* expand_pic.cpp in Sources */,
|
53C1C9BC193F0FB000404D8F /* expand_pic.cpp in Sources */,
|
||||||
4C3406CD18D96EA600DFA14A /* cpu.cpp in Sources */,
|
4C3406CD18D96EA600DFA14A /* cpu.cpp in Sources */,
|
||||||
@@ -354,6 +380,11 @@
|
|||||||
HAVE_NEON,
|
HAVE_NEON,
|
||||||
);
|
);
|
||||||
"GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*]" = APPLE_IOS;
|
"GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*]" = APPLE_IOS;
|
||||||
|
HEADER_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||||
|
"$(SRCROOT)/../../../api/svc",
|
||||||
|
);
|
||||||
OTHER_LDFLAGS = "-ObjC";
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
@@ -381,6 +412,11 @@
|
|||||||
HAVE_NEON,
|
HAVE_NEON,
|
||||||
);
|
);
|
||||||
"GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*]" = APPLE_IOS;
|
"GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*]" = APPLE_IOS;
|
||||||
|
HEADER_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||||
|
"$(SRCROOT)/../../../api/svc",
|
||||||
|
);
|
||||||
OTHER_LDFLAGS = "-ObjC";
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
|
|||||||
@@ -20,8 +20,6 @@
|
|||||||
4CE4469318BC5EAB0017DF25 /* fmo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467018BC5EAA0017DF25 /* fmo.cpp */; };
|
4CE4469318BC5EAB0017DF25 /* fmo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467018BC5EAA0017DF25 /* fmo.cpp */; };
|
||||||
4CE4469418BC5EAB0017DF25 /* get_intra_predictor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467118BC5EAA0017DF25 /* get_intra_predictor.cpp */; };
|
4CE4469418BC5EAB0017DF25 /* get_intra_predictor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467118BC5EAA0017DF25 /* get_intra_predictor.cpp */; };
|
||||||
4CE4469518BC5EAB0017DF25 /* manage_dec_ref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467218BC5EAA0017DF25 /* manage_dec_ref.cpp */; };
|
4CE4469518BC5EAB0017DF25 /* manage_dec_ref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467218BC5EAA0017DF25 /* manage_dec_ref.cpp */; };
|
||||||
4CE4469618BC5EAB0017DF25 /* mc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467318BC5EAA0017DF25 /* mc.cpp */; };
|
|
||||||
4CE4469718BC5EAB0017DF25 /* mem_align.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467418BC5EAA0017DF25 /* mem_align.cpp */; };
|
|
||||||
4CE4469818BC5EAB0017DF25 /* memmgr_nal_unit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467518BC5EAA0017DF25 /* memmgr_nal_unit.cpp */; };
|
4CE4469818BC5EAB0017DF25 /* memmgr_nal_unit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467518BC5EAA0017DF25 /* memmgr_nal_unit.cpp */; };
|
||||||
4CE4469918BC5EAB0017DF25 /* mv_pred.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467618BC5EAA0017DF25 /* mv_pred.cpp */; };
|
4CE4469918BC5EAB0017DF25 /* mv_pred.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467618BC5EAA0017DF25 /* mv_pred.cpp */; };
|
||||||
4CE4469A18BC5EAB0017DF25 /* parse_mb_syn_cavlc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467718BC5EAA0017DF25 /* parse_mb_syn_cavlc.cpp */; };
|
4CE4469A18BC5EAB0017DF25 /* parse_mb_syn_cavlc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4467718BC5EAA0017DF25 /* parse_mb_syn_cavlc.cpp */; };
|
||||||
@@ -30,8 +28,9 @@
|
|||||||
4CE4469F18BC5EAB0017DF25 /* welsDecoderExt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4468518BC5EAB0017DF25 /* welsDecoderExt.cpp */; };
|
4CE4469F18BC5EAB0017DF25 /* welsDecoderExt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4468518BC5EAB0017DF25 /* welsDecoderExt.cpp */; };
|
||||||
4CE447AC18BC6BE90017DF25 /* block_add_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 4CE447A718BC6BE90017DF25 /* block_add_neon.S */; };
|
4CE447AC18BC6BE90017DF25 /* block_add_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 4CE447A718BC6BE90017DF25 /* block_add_neon.S */; };
|
||||||
4CE447AE18BC6BE90017DF25 /* intra_pred_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 4CE447A918BC6BE90017DF25 /* intra_pred_neon.S */; };
|
4CE447AE18BC6BE90017DF25 /* intra_pred_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 4CE447A918BC6BE90017DF25 /* intra_pred_neon.S */; };
|
||||||
|
6A3E814219D79AE900C19C1F /* cabac_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A3E814119D79AE900C19C1F /* cabac_decoder.cpp */; };
|
||||||
|
6A3E814419D7A40600C19C1F /* parse_mb_syn_cabac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A3E814319D7A40600C19C1F /* parse_mb_syn_cabac.cpp */; };
|
||||||
6C749B6A197CC6E600A111F9 /* block_add_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C749B69197CC6E600A111F9 /* block_add_aarch64_neon.S */; };
|
6C749B6A197CC6E600A111F9 /* block_add_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C749B69197CC6E600A111F9 /* block_add_aarch64_neon.S */; };
|
||||||
9ABF4382193EB60900A6BD61 /* expand_pic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9ABF4381193EB60900A6BD61 /* expand_pic.cpp */; };
|
|
||||||
9AED66561946A1DE009A3567 /* welsCodecTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AED66551946A1DE009A3567 /* welsCodecTrace.cpp */; };
|
9AED66561946A1DE009A3567 /* welsCodecTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AED66551946A1DE009A3567 /* welsCodecTrace.cpp */; };
|
||||||
9AED66591946A203009A3567 /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AED66581946A203009A3567 /* utils.cpp */; };
|
9AED66591946A203009A3567 /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AED66581946A203009A3567 /* utils.cpp */; };
|
||||||
F0B204FC18FD23D8005DA23F /* error_concealment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F0B204FB18FD23D8005DA23F /* error_concealment.cpp */; };
|
F0B204FC18FD23D8005DA23F /* error_concealment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F0B204FB18FD23D8005DA23F /* error_concealment.cpp */; };
|
||||||
@@ -71,8 +70,6 @@
|
|||||||
4CE4465318BC5EAA0017DF25 /* get_intra_predictor.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = get_intra_predictor.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
|
4CE4465318BC5EAA0017DF25 /* get_intra_predictor.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = get_intra_predictor.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
|
||||||
4CE4465418BC5EAA0017DF25 /* manage_dec_ref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = manage_dec_ref.h; sourceTree = "<group>"; };
|
4CE4465418BC5EAA0017DF25 /* manage_dec_ref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = manage_dec_ref.h; sourceTree = "<group>"; };
|
||||||
4CE4465518BC5EAA0017DF25 /* mb_cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mb_cache.h; sourceTree = "<group>"; };
|
4CE4465518BC5EAA0017DF25 /* mb_cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mb_cache.h; sourceTree = "<group>"; };
|
||||||
4CE4465618BC5EAA0017DF25 /* mc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mc.h; sourceTree = "<group>"; };
|
|
||||||
4CE4465718BC5EAA0017DF25 /* mem_align.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mem_align.h; sourceTree = "<group>"; };
|
|
||||||
4CE4465818BC5EAA0017DF25 /* memmgr_nal_unit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memmgr_nal_unit.h; sourceTree = "<group>"; };
|
4CE4465818BC5EAA0017DF25 /* memmgr_nal_unit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memmgr_nal_unit.h; sourceTree = "<group>"; };
|
||||||
4CE4465918BC5EAA0017DF25 /* mv_pred.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mv_pred.h; sourceTree = "<group>"; };
|
4CE4465918BC5EAA0017DF25 /* mv_pred.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mv_pred.h; sourceTree = "<group>"; };
|
||||||
4CE4465A18BC5EAA0017DF25 /* nal_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nal_prefix.h; sourceTree = "<group>"; };
|
4CE4465A18BC5EAA0017DF25 /* nal_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nal_prefix.h; sourceTree = "<group>"; };
|
||||||
@@ -97,8 +94,6 @@
|
|||||||
4CE4467018BC5EAA0017DF25 /* fmo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fmo.cpp; sourceTree = "<group>"; };
|
4CE4467018BC5EAA0017DF25 /* fmo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fmo.cpp; sourceTree = "<group>"; };
|
||||||
4CE4467118BC5EAA0017DF25 /* get_intra_predictor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = get_intra_predictor.cpp; sourceTree = "<group>"; };
|
4CE4467118BC5EAA0017DF25 /* get_intra_predictor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = get_intra_predictor.cpp; sourceTree = "<group>"; };
|
||||||
4CE4467218BC5EAA0017DF25 /* manage_dec_ref.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = manage_dec_ref.cpp; sourceTree = "<group>"; };
|
4CE4467218BC5EAA0017DF25 /* manage_dec_ref.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = manage_dec_ref.cpp; sourceTree = "<group>"; };
|
||||||
4CE4467318BC5EAA0017DF25 /* mc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mc.cpp; sourceTree = "<group>"; tabWidth = 1; usesTabs = 0; wrapsLines = 1; };
|
|
||||||
4CE4467418BC5EAA0017DF25 /* mem_align.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mem_align.cpp; sourceTree = "<group>"; };
|
|
||||||
4CE4467518BC5EAA0017DF25 /* memmgr_nal_unit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memmgr_nal_unit.cpp; sourceTree = "<group>"; };
|
4CE4467518BC5EAA0017DF25 /* memmgr_nal_unit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memmgr_nal_unit.cpp; sourceTree = "<group>"; };
|
||||||
4CE4467618BC5EAA0017DF25 /* mv_pred.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mv_pred.cpp; sourceTree = "<group>"; };
|
4CE4467618BC5EAA0017DF25 /* mv_pred.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mv_pred.cpp; sourceTree = "<group>"; };
|
||||||
4CE4467718BC5EAA0017DF25 /* parse_mb_syn_cavlc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parse_mb_syn_cavlc.cpp; sourceTree = "<group>"; };
|
4CE4467718BC5EAA0017DF25 /* parse_mb_syn_cavlc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parse_mb_syn_cavlc.cpp; sourceTree = "<group>"; };
|
||||||
@@ -109,9 +104,11 @@
|
|||||||
4CE4468518BC5EAB0017DF25 /* welsDecoderExt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = welsDecoderExt.cpp; sourceTree = "<group>"; };
|
4CE4468518BC5EAB0017DF25 /* welsDecoderExt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = welsDecoderExt.cpp; sourceTree = "<group>"; };
|
||||||
4CE447A718BC6BE90017DF25 /* block_add_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = block_add_neon.S; sourceTree = "<group>"; };
|
4CE447A718BC6BE90017DF25 /* block_add_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = block_add_neon.S; sourceTree = "<group>"; };
|
||||||
4CE447A918BC6BE90017DF25 /* intra_pred_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = intra_pred_neon.S; sourceTree = "<group>"; };
|
4CE447A918BC6BE90017DF25 /* intra_pred_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = intra_pred_neon.S; sourceTree = "<group>"; };
|
||||||
|
6A3E814019D79AD900C19C1F /* cabac_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cabac_decoder.h; sourceTree = "<group>"; };
|
||||||
|
6A3E814119D79AE900C19C1F /* cabac_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cabac_decoder.cpp; sourceTree = "<group>"; };
|
||||||
|
6A3E814319D7A40600C19C1F /* parse_mb_syn_cabac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parse_mb_syn_cabac.cpp; sourceTree = "<group>"; };
|
||||||
|
6A3E814519D7A40D00C19C1F /* parse_mb_syn_cabac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse_mb_syn_cabac.h; sourceTree = "<group>"; };
|
||||||
6C749B69197CC6E600A111F9 /* block_add_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = block_add_aarch64_neon.S; path = arm64/block_add_aarch64_neon.S; sourceTree = "<group>"; };
|
6C749B69197CC6E600A111F9 /* block_add_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = block_add_aarch64_neon.S; path = arm64/block_add_aarch64_neon.S; sourceTree = "<group>"; };
|
||||||
9ABF4380193EB5F700A6BD61 /* expand_pic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = expand_pic.h; path = ../../../common/inc/expand_pic.h; sourceTree = "<group>"; };
|
|
||||||
9ABF4381193EB60900A6BD61 /* expand_pic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = expand_pic.cpp; path = ../../../common/src/expand_pic.cpp; sourceTree = "<group>"; };
|
|
||||||
9AED66551946A1DE009A3567 /* welsCodecTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = welsCodecTrace.cpp; path = ../../../common/src/welsCodecTrace.cpp; sourceTree = "<group>"; };
|
9AED66551946A1DE009A3567 /* welsCodecTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = welsCodecTrace.cpp; path = ../../../common/src/welsCodecTrace.cpp; sourceTree = "<group>"; };
|
||||||
9AED66571946A1EB009A3567 /* welsCodecTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = welsCodecTrace.h; path = ../../../common/inc/welsCodecTrace.h; sourceTree = "<group>"; };
|
9AED66571946A1EB009A3567 /* welsCodecTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = welsCodecTrace.h; path = ../../../common/inc/welsCodecTrace.h; sourceTree = "<group>"; };
|
||||||
9AED66581946A203009A3567 /* utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = utils.cpp; path = ../../../common/src/utils.cpp; sourceTree = "<group>"; };
|
9AED66581946A203009A3567 /* utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = utils.cpp; path = ../../../common/src/utils.cpp; sourceTree = "<group>"; };
|
||||||
@@ -191,8 +188,9 @@
|
|||||||
4CE4464418BC5EAA0017DF25 /* inc */ = {
|
4CE4464418BC5EAA0017DF25 /* inc */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
6A3E814519D7A40D00C19C1F /* parse_mb_syn_cabac.h */,
|
||||||
|
6A3E814019D79AD900C19C1F /* cabac_decoder.h */,
|
||||||
9AED665A1946A21D009A3567 /* utils.h */,
|
9AED665A1946A21D009A3567 /* utils.h */,
|
||||||
9ABF4380193EB5F700A6BD61 /* expand_pic.h */,
|
|
||||||
F0B204FA18FD23CF005DA23F /* error_concealment.h */,
|
F0B204FA18FD23CF005DA23F /* error_concealment.h */,
|
||||||
4CE4464518BC5EAA0017DF25 /* as264_common.h */,
|
4CE4464518BC5EAA0017DF25 /* as264_common.h */,
|
||||||
4CE4464618BC5EAA0017DF25 /* au_parser.h */,
|
4CE4464618BC5EAA0017DF25 /* au_parser.h */,
|
||||||
@@ -210,8 +208,6 @@
|
|||||||
4CE4465318BC5EAA0017DF25 /* get_intra_predictor.h */,
|
4CE4465318BC5EAA0017DF25 /* get_intra_predictor.h */,
|
||||||
4CE4465418BC5EAA0017DF25 /* manage_dec_ref.h */,
|
4CE4465418BC5EAA0017DF25 /* manage_dec_ref.h */,
|
||||||
4CE4465518BC5EAA0017DF25 /* mb_cache.h */,
|
4CE4465518BC5EAA0017DF25 /* mb_cache.h */,
|
||||||
4CE4465618BC5EAA0017DF25 /* mc.h */,
|
|
||||||
4CE4465718BC5EAA0017DF25 /* mem_align.h */,
|
|
||||||
4CE4465818BC5EAA0017DF25 /* memmgr_nal_unit.h */,
|
4CE4465818BC5EAA0017DF25 /* memmgr_nal_unit.h */,
|
||||||
4CE4465918BC5EAA0017DF25 /* mv_pred.h */,
|
4CE4465918BC5EAA0017DF25 /* mv_pred.h */,
|
||||||
4CE4465A18BC5EAA0017DF25 /* nal_prefix.h */,
|
4CE4465A18BC5EAA0017DF25 /* nal_prefix.h */,
|
||||||
@@ -232,8 +228,9 @@
|
|||||||
4CE4466618BC5EAA0017DF25 /* src */ = {
|
4CE4466618BC5EAA0017DF25 /* src */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
6A3E814319D7A40600C19C1F /* parse_mb_syn_cabac.cpp */,
|
||||||
|
6A3E814119D79AE900C19C1F /* cabac_decoder.cpp */,
|
||||||
9AED66581946A203009A3567 /* utils.cpp */,
|
9AED66581946A203009A3567 /* utils.cpp */,
|
||||||
9ABF4381193EB60900A6BD61 /* expand_pic.cpp */,
|
|
||||||
F0B204FB18FD23D8005DA23F /* error_concealment.cpp */,
|
F0B204FB18FD23D8005DA23F /* error_concealment.cpp */,
|
||||||
4CE4466718BC5EAA0017DF25 /* au_parser.cpp */,
|
4CE4466718BC5EAA0017DF25 /* au_parser.cpp */,
|
||||||
4CE4466818BC5EAA0017DF25 /* bit_stream.cpp */,
|
4CE4466818BC5EAA0017DF25 /* bit_stream.cpp */,
|
||||||
@@ -246,8 +243,6 @@
|
|||||||
4CE4467018BC5EAA0017DF25 /* fmo.cpp */,
|
4CE4467018BC5EAA0017DF25 /* fmo.cpp */,
|
||||||
4CE4467118BC5EAA0017DF25 /* get_intra_predictor.cpp */,
|
4CE4467118BC5EAA0017DF25 /* get_intra_predictor.cpp */,
|
||||||
4CE4467218BC5EAA0017DF25 /* manage_dec_ref.cpp */,
|
4CE4467218BC5EAA0017DF25 /* manage_dec_ref.cpp */,
|
||||||
4CE4467318BC5EAA0017DF25 /* mc.cpp */,
|
|
||||||
4CE4467418BC5EAA0017DF25 /* mem_align.cpp */,
|
|
||||||
4CE4467518BC5EAA0017DF25 /* memmgr_nal_unit.cpp */,
|
4CE4467518BC5EAA0017DF25 /* memmgr_nal_unit.cpp */,
|
||||||
4CE4467618BC5EAA0017DF25 /* mv_pred.cpp */,
|
4CE4467618BC5EAA0017DF25 /* mv_pred.cpp */,
|
||||||
4CE4467718BC5EAA0017DF25 /* parse_mb_syn_cavlc.cpp */,
|
4CE4467718BC5EAA0017DF25 /* parse_mb_syn_cavlc.cpp */,
|
||||||
@@ -346,15 +341,15 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
6A3E814419D7A40600C19C1F /* parse_mb_syn_cabac.cpp in Sources */,
|
||||||
4CE4469B18BC5EAB0017DF25 /* pic_queue.cpp in Sources */,
|
4CE4469B18BC5EAB0017DF25 /* pic_queue.cpp in Sources */,
|
||||||
4CE4469F18BC5EAB0017DF25 /* welsDecoderExt.cpp in Sources */,
|
4CE4469F18BC5EAB0017DF25 /* welsDecoderExt.cpp in Sources */,
|
||||||
4CE4469318BC5EAB0017DF25 /* fmo.cpp in Sources */,
|
4CE4469318BC5EAB0017DF25 /* fmo.cpp in Sources */,
|
||||||
4CE4469118BC5EAB0017DF25 /* decoder_data_tables.cpp in Sources */,
|
4CE4469118BC5EAB0017DF25 /* decoder_data_tables.cpp in Sources */,
|
||||||
4CE4469718BC5EAB0017DF25 /* mem_align.cpp in Sources */,
|
|
||||||
9ABF4382193EB60900A6BD61 /* expand_pic.cpp in Sources */,
|
|
||||||
4CE4469518BC5EAB0017DF25 /* manage_dec_ref.cpp in Sources */,
|
4CE4469518BC5EAB0017DF25 /* manage_dec_ref.cpp in Sources */,
|
||||||
4CE4468A18BC5EAB0017DF25 /* au_parser.cpp in Sources */,
|
4CE4468A18BC5EAB0017DF25 /* au_parser.cpp in Sources */,
|
||||||
4CE4469918BC5EAB0017DF25 /* mv_pred.cpp in Sources */,
|
4CE4469918BC5EAB0017DF25 /* mv_pred.cpp in Sources */,
|
||||||
|
6A3E814219D79AE900C19C1F /* cabac_decoder.cpp in Sources */,
|
||||||
4CE447AC18BC6BE90017DF25 /* block_add_neon.S in Sources */,
|
4CE447AC18BC6BE90017DF25 /* block_add_neon.S in Sources */,
|
||||||
6C749B6A197CC6E600A111F9 /* block_add_aarch64_neon.S in Sources */,
|
6C749B6A197CC6E600A111F9 /* block_add_aarch64_neon.S in Sources */,
|
||||||
4CE4469418BC5EAB0017DF25 /* get_intra_predictor.cpp in Sources */,
|
4CE4469418BC5EAB0017DF25 /* get_intra_predictor.cpp in Sources */,
|
||||||
@@ -363,7 +358,6 @@
|
|||||||
4CBC1B81194AC4E100214D9E /* intra_pred_aarch64_neon.S in Sources */,
|
4CBC1B81194AC4E100214D9E /* intra_pred_aarch64_neon.S in Sources */,
|
||||||
4CE4469018BC5EAB0017DF25 /* decoder_core.cpp in Sources */,
|
4CE4469018BC5EAB0017DF25 /* decoder_core.cpp in Sources */,
|
||||||
4CE447AE18BC6BE90017DF25 /* intra_pred_neon.S in Sources */,
|
4CE447AE18BC6BE90017DF25 /* intra_pred_neon.S in Sources */,
|
||||||
4CE4469618BC5EAB0017DF25 /* mc.cpp in Sources */,
|
|
||||||
4CE4469C18BC5EAB0017DF25 /* rec_mb.cpp in Sources */,
|
4CE4469C18BC5EAB0017DF25 /* rec_mb.cpp in Sources */,
|
||||||
4CE4468B18BC5EAB0017DF25 /* bit_stream.cpp in Sources */,
|
4CE4468B18BC5EAB0017DF25 /* bit_stream.cpp in Sources */,
|
||||||
4CE4468D18BC5EAB0017DF25 /* decode_mb_aux.cpp in Sources */,
|
4CE4468D18BC5EAB0017DF25 /* decode_mb_aux.cpp in Sources */,
|
||||||
|
|||||||
@@ -24,9 +24,7 @@
|
|||||||
4CE4471318BC605C0017DF25 /* encoder_data_tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E218BC605C0017DF25 /* encoder_data_tables.cpp */; };
|
4CE4471318BC605C0017DF25 /* encoder_data_tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E218BC605C0017DF25 /* encoder_data_tables.cpp */; };
|
||||||
4CE4471418BC605C0017DF25 /* encoder_ext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E318BC605C0017DF25 /* encoder_ext.cpp */; };
|
4CE4471418BC605C0017DF25 /* encoder_ext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E318BC605C0017DF25 /* encoder_ext.cpp */; };
|
||||||
4CE4471618BC605C0017DF25 /* get_intra_predictor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E518BC605C0017DF25 /* get_intra_predictor.cpp */; };
|
4CE4471618BC605C0017DF25 /* get_intra_predictor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E518BC605C0017DF25 /* get_intra_predictor.cpp */; };
|
||||||
4CE4471718BC605C0017DF25 /* mc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E618BC605C0017DF25 /* mc.cpp */; };
|
|
||||||
4CE4471818BC605C0017DF25 /* md.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E718BC605C0017DF25 /* md.cpp */; };
|
4CE4471818BC605C0017DF25 /* md.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E718BC605C0017DF25 /* md.cpp */; };
|
||||||
4CE4471918BC605C0017DF25 /* memory_align.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E818BC605C0017DF25 /* memory_align.cpp */; };
|
|
||||||
4CE4471A18BC605C0017DF25 /* mv_pred.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E918BC605C0017DF25 /* mv_pred.cpp */; };
|
4CE4471A18BC605C0017DF25 /* mv_pred.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446E918BC605C0017DF25 /* mv_pred.cpp */; };
|
||||||
4CE4471B18BC605C0017DF25 /* nal_encap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446EA18BC605C0017DF25 /* nal_encap.cpp */; };
|
4CE4471B18BC605C0017DF25 /* nal_encap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446EA18BC605C0017DF25 /* nal_encap.cpp */; };
|
||||||
4CE4471C18BC605C0017DF25 /* picture_handle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446EB18BC605C0017DF25 /* picture_handle.cpp */; };
|
4CE4471C18BC605C0017DF25 /* picture_handle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE446EB18BC605C0017DF25 /* picture_handle.cpp */; };
|
||||||
@@ -51,6 +49,8 @@
|
|||||||
9AED66661946A2B3009A3567 /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AED66651946A2B3009A3567 /* utils.cpp */; };
|
9AED66661946A2B3009A3567 /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AED66651946A2B3009A3567 /* utils.cpp */; };
|
||||||
F5617A50196A833A006E2B20 /* reconstruct_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5617A4F196A833A006E2B20 /* reconstruct_aarch64_neon.S */; };
|
F5617A50196A833A006E2B20 /* reconstruct_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5617A4F196A833A006E2B20 /* reconstruct_aarch64_neon.S */; };
|
||||||
F5BE8005196B913200ED02ED /* memory_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5BE8004196B913200ED02ED /* memory_aarch64_neon.S */; };
|
F5BE8005196B913200ED02ED /* memory_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = F5BE8004196B913200ED02ED /* memory_aarch64_neon.S */; };
|
||||||
|
F7E9994519EBD1E9009B1021 /* svc_set_mb_syn_cabac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7E9994419EBD1E9009B1021 /* svc_set_mb_syn_cabac.cpp */; };
|
||||||
|
F7E9994919EBD1F8009B1021 /* set_mb_syn_cabac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7E9994819EBD1F8009B1021 /* set_mb_syn_cabac.cpp */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
@@ -91,9 +91,7 @@
|
|||||||
4CE446B518BC605C0017DF25 /* extern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extern.h; sourceTree = "<group>"; };
|
4CE446B518BC605C0017DF25 /* extern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extern.h; sourceTree = "<group>"; };
|
||||||
4CE446B618BC605C0017DF25 /* get_intra_predictor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = get_intra_predictor.h; sourceTree = "<group>"; };
|
4CE446B618BC605C0017DF25 /* get_intra_predictor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = get_intra_predictor.h; sourceTree = "<group>"; };
|
||||||
4CE446B718BC605C0017DF25 /* mb_cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mb_cache.h; sourceTree = "<group>"; };
|
4CE446B718BC605C0017DF25 /* mb_cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mb_cache.h; sourceTree = "<group>"; };
|
||||||
4CE446B818BC605C0017DF25 /* mc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mc.h; sourceTree = "<group>"; };
|
|
||||||
4CE446B918BC605C0017DF25 /* md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md.h; sourceTree = "<group>"; };
|
4CE446B918BC605C0017DF25 /* md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md.h; sourceTree = "<group>"; };
|
||||||
4CE446BA18BC605C0017DF25 /* memory_align.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory_align.h; sourceTree = "<group>"; };
|
|
||||||
4CE446BB18BC605C0017DF25 /* mt_defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mt_defs.h; sourceTree = "<group>"; };
|
4CE446BB18BC605C0017DF25 /* mt_defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mt_defs.h; sourceTree = "<group>"; };
|
||||||
4CE446BC18BC605C0017DF25 /* mv_pred.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mv_pred.h; sourceTree = "<group>"; };
|
4CE446BC18BC605C0017DF25 /* mv_pred.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mv_pred.h; sourceTree = "<group>"; };
|
||||||
4CE446BD18BC605C0017DF25 /* nal_encap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nal_encap.h; sourceTree = "<group>"; };
|
4CE446BD18BC605C0017DF25 /* nal_encap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nal_encap.h; sourceTree = "<group>"; };
|
||||||
@@ -133,9 +131,7 @@
|
|||||||
4CE446E218BC605C0017DF25 /* encoder_data_tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = encoder_data_tables.cpp; sourceTree = "<group>"; };
|
4CE446E218BC605C0017DF25 /* encoder_data_tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = encoder_data_tables.cpp; sourceTree = "<group>"; };
|
||||||
4CE446E318BC605C0017DF25 /* encoder_ext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = encoder_ext.cpp; sourceTree = "<group>"; };
|
4CE446E318BC605C0017DF25 /* encoder_ext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = encoder_ext.cpp; sourceTree = "<group>"; };
|
||||||
4CE446E518BC605C0017DF25 /* get_intra_predictor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = get_intra_predictor.cpp; sourceTree = "<group>"; };
|
4CE446E518BC605C0017DF25 /* get_intra_predictor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = get_intra_predictor.cpp; sourceTree = "<group>"; };
|
||||||
4CE446E618BC605C0017DF25 /* mc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mc.cpp; sourceTree = "<group>"; };
|
|
||||||
4CE446E718BC605C0017DF25 /* md.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = md.cpp; sourceTree = "<group>"; };
|
4CE446E718BC605C0017DF25 /* md.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = md.cpp; sourceTree = "<group>"; };
|
||||||
4CE446E818BC605C0017DF25 /* memory_align.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memory_align.cpp; sourceTree = "<group>"; };
|
|
||||||
4CE446E918BC605C0017DF25 /* mv_pred.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mv_pred.cpp; sourceTree = "<group>"; };
|
4CE446E918BC605C0017DF25 /* mv_pred.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mv_pred.cpp; sourceTree = "<group>"; };
|
||||||
4CE446EA18BC605C0017DF25 /* nal_encap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nal_encap.cpp; sourceTree = "<group>"; };
|
4CE446EA18BC605C0017DF25 /* nal_encap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nal_encap.cpp; sourceTree = "<group>"; };
|
||||||
4CE446EB18BC605C0017DF25 /* picture_handle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = picture_handle.cpp; sourceTree = "<group>"; };
|
4CE446EB18BC605C0017DF25 /* picture_handle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = picture_handle.cpp; sourceTree = "<group>"; };
|
||||||
@@ -164,6 +160,10 @@
|
|||||||
9AED66671946A2C4009A3567 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = ../../../common/inc/utils.h; sourceTree = "<group>"; };
|
9AED66671946A2C4009A3567 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = ../../../common/inc/utils.h; sourceTree = "<group>"; };
|
||||||
F5617A4F196A833A006E2B20 /* reconstruct_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = reconstruct_aarch64_neon.S; path = arm64/reconstruct_aarch64_neon.S; sourceTree = "<group>"; };
|
F5617A4F196A833A006E2B20 /* reconstruct_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = reconstruct_aarch64_neon.S; path = arm64/reconstruct_aarch64_neon.S; sourceTree = "<group>"; };
|
||||||
F5BE8004196B913200ED02ED /* memory_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = memory_aarch64_neon.S; path = arm64/memory_aarch64_neon.S; sourceTree = "<group>"; };
|
F5BE8004196B913200ED02ED /* memory_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = memory_aarch64_neon.S; path = arm64/memory_aarch64_neon.S; sourceTree = "<group>"; };
|
||||||
|
F7E9994419EBD1E9009B1021 /* svc_set_mb_syn_cabac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = svc_set_mb_syn_cabac.cpp; sourceTree = "<group>"; };
|
||||||
|
F7E9994819EBD1F8009B1021 /* set_mb_syn_cabac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = set_mb_syn_cabac.cpp; sourceTree = "<group>"; };
|
||||||
|
F7E9997E19EBD3C6009B1021 /* set_mb_syn_cabac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = set_mb_syn_cabac.h; sourceTree = "<group>"; };
|
||||||
|
F7E9997F19EBD3CE009B1021 /* svc_set_mb_syn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = svc_set_mb_syn.h; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -254,6 +254,8 @@
|
|||||||
4CE446A918BC605C0017DF25 /* inc */ = {
|
4CE446A918BC605C0017DF25 /* inc */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
F7E9997F19EBD3CE009B1021 /* svc_set_mb_syn.h */,
|
||||||
|
F7E9997E19EBD3C6009B1021 /* set_mb_syn_cabac.h */,
|
||||||
9AED66671946A2C4009A3567 /* utils.h */,
|
9AED66671946A2C4009A3567 /* utils.h */,
|
||||||
4CDBFB9D18E5068D0025A767 /* wels_transpose_matrix.h */,
|
4CDBFB9D18E5068D0025A767 /* wels_transpose_matrix.h */,
|
||||||
4CE446AA18BC605C0017DF25 /* as264_common.h */,
|
4CE446AA18BC605C0017DF25 /* as264_common.h */,
|
||||||
@@ -268,9 +270,7 @@
|
|||||||
4CE446B518BC605C0017DF25 /* extern.h */,
|
4CE446B518BC605C0017DF25 /* extern.h */,
|
||||||
4CE446B618BC605C0017DF25 /* get_intra_predictor.h */,
|
4CE446B618BC605C0017DF25 /* get_intra_predictor.h */,
|
||||||
4CE446B718BC605C0017DF25 /* mb_cache.h */,
|
4CE446B718BC605C0017DF25 /* mb_cache.h */,
|
||||||
4CE446B818BC605C0017DF25 /* mc.h */,
|
|
||||||
4CE446B918BC605C0017DF25 /* md.h */,
|
4CE446B918BC605C0017DF25 /* md.h */,
|
||||||
4CE446BA18BC605C0017DF25 /* memory_align.h */,
|
|
||||||
4CE446BB18BC605C0017DF25 /* mt_defs.h */,
|
4CE446BB18BC605C0017DF25 /* mt_defs.h */,
|
||||||
4CE446BC18BC605C0017DF25 /* mv_pred.h */,
|
4CE446BC18BC605C0017DF25 /* mv_pred.h */,
|
||||||
4CE446BD18BC605C0017DF25 /* nal_encap.h */,
|
4CE446BD18BC605C0017DF25 /* nal_encap.h */,
|
||||||
@@ -309,6 +309,8 @@
|
|||||||
4CE446DC18BC605C0017DF25 /* src */ = {
|
4CE446DC18BC605C0017DF25 /* src */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
F7E9994819EBD1F8009B1021 /* set_mb_syn_cabac.cpp */,
|
||||||
|
F7E9994419EBD1E9009B1021 /* svc_set_mb_syn_cabac.cpp */,
|
||||||
9AED66651946A2B3009A3567 /* utils.cpp */,
|
9AED66651946A2B3009A3567 /* utils.cpp */,
|
||||||
4CE446DD18BC605C0017DF25 /* au_set.cpp */,
|
4CE446DD18BC605C0017DF25 /* au_set.cpp */,
|
||||||
4CE446DE18BC605C0017DF25 /* deblocking.cpp */,
|
4CE446DE18BC605C0017DF25 /* deblocking.cpp */,
|
||||||
@@ -318,9 +320,7 @@
|
|||||||
4CE446E218BC605C0017DF25 /* encoder_data_tables.cpp */,
|
4CE446E218BC605C0017DF25 /* encoder_data_tables.cpp */,
|
||||||
4CE446E318BC605C0017DF25 /* encoder_ext.cpp */,
|
4CE446E318BC605C0017DF25 /* encoder_ext.cpp */,
|
||||||
4CE446E518BC605C0017DF25 /* get_intra_predictor.cpp */,
|
4CE446E518BC605C0017DF25 /* get_intra_predictor.cpp */,
|
||||||
4CE446E618BC605C0017DF25 /* mc.cpp */,
|
|
||||||
4CE446E718BC605C0017DF25 /* md.cpp */,
|
4CE446E718BC605C0017DF25 /* md.cpp */,
|
||||||
4CE446E818BC605C0017DF25 /* memory_align.cpp */,
|
|
||||||
4CE446E918BC605C0017DF25 /* mv_pred.cpp */,
|
4CE446E918BC605C0017DF25 /* mv_pred.cpp */,
|
||||||
4CE446EA18BC605C0017DF25 /* nal_encap.cpp */,
|
4CE446EA18BC605C0017DF25 /* nal_encap.cpp */,
|
||||||
4CE446EB18BC605C0017DF25 /* picture_handle.cpp */,
|
4CE446EB18BC605C0017DF25 /* picture_handle.cpp */,
|
||||||
@@ -445,12 +445,11 @@
|
|||||||
4CE4470E18BC605C0017DF25 /* au_set.cpp in Sources */,
|
4CE4470E18BC605C0017DF25 /* au_set.cpp in Sources */,
|
||||||
F5BE8005196B913200ED02ED /* memory_aarch64_neon.S in Sources */,
|
F5BE8005196B913200ED02ED /* memory_aarch64_neon.S in Sources */,
|
||||||
4CBC1B83194ACBB400214D9E /* intra_pred_aarch64_neon.S in Sources */,
|
4CBC1B83194ACBB400214D9E /* intra_pred_aarch64_neon.S in Sources */,
|
||||||
4CE4471718BC605C0017DF25 /* mc.cpp in Sources */,
|
F7E9994519EBD1E9009B1021 /* svc_set_mb_syn_cabac.cpp in Sources */,
|
||||||
F5617A50196A833A006E2B20 /* reconstruct_aarch64_neon.S in Sources */,
|
F5617A50196A833A006E2B20 /* reconstruct_aarch64_neon.S in Sources */,
|
||||||
4CE4472918BC605C0017DF25 /* svc_set_mb_syn_cavlc.cpp in Sources */,
|
4CE4472918BC605C0017DF25 /* svc_set_mb_syn_cavlc.cpp in Sources */,
|
||||||
4CE4471818BC605C0017DF25 /* md.cpp in Sources */,
|
4CE4471818BC605C0017DF25 /* md.cpp in Sources */,
|
||||||
4CE4471B18BC605C0017DF25 /* nal_encap.cpp in Sources */,
|
4CE4471B18BC605C0017DF25 /* nal_encap.cpp in Sources */,
|
||||||
4CE4471918BC605C0017DF25 /* memory_align.cpp in Sources */,
|
|
||||||
4CE4472418BC605C0017DF25 /* svc_enc_slice_segment.cpp in Sources */,
|
4CE4472418BC605C0017DF25 /* svc_enc_slice_segment.cpp in Sources */,
|
||||||
4CE4472318BC605C0017DF25 /* svc_base_layer_md.cpp in Sources */,
|
4CE4472318BC605C0017DF25 /* svc_base_layer_md.cpp in Sources */,
|
||||||
4CB8F2B419235FC5005D6386 /* pixel_aarch64_neon.S in Sources */,
|
4CB8F2B419235FC5005D6386 /* pixel_aarch64_neon.S in Sources */,
|
||||||
@@ -465,6 +464,7 @@
|
|||||||
6CA38DA51991D31A003EAAE0 /* svc_motion_estimation_aarch64_neon.S in Sources */,
|
6CA38DA51991D31A003EAAE0 /* svc_motion_estimation_aarch64_neon.S in Sources */,
|
||||||
4CE4471418BC605C0017DF25 /* encoder_ext.cpp in Sources */,
|
4CE4471418BC605C0017DF25 /* encoder_ext.cpp in Sources */,
|
||||||
4C34067218C57D0400DFA14A /* reconstruct_neon.S in Sources */,
|
4C34067218C57D0400DFA14A /* reconstruct_neon.S in Sources */,
|
||||||
|
F7E9994919EBD1F8009B1021 /* set_mb_syn_cabac.cpp in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
549947E2196A3FB400BA3D87 /* pixel_sad_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 549947AE196A3FB400BA3D87 /* pixel_sad_neon.S */; };
|
549947E2196A3FB400BA3D87 /* pixel_sad_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 549947AE196A3FB400BA3D87 /* pixel_sad_neon.S */; };
|
||||||
549947E3196A3FB400BA3D87 /* vaa_calc_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 549947AF196A3FB400BA3D87 /* vaa_calc_neon.S */; };
|
549947E3196A3FB400BA3D87 /* vaa_calc_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 549947AF196A3FB400BA3D87 /* vaa_calc_neon.S */; };
|
||||||
549947E4196A3FB400BA3D87 /* BackgroundDetection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947B1196A3FB400BA3D87 /* BackgroundDetection.cpp */; };
|
549947E4196A3FB400BA3D87 /* BackgroundDetection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947B1196A3FB400BA3D87 /* BackgroundDetection.cpp */; };
|
||||||
549947E5196A3FB400BA3D87 /* common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947B4196A3FB400BA3D87 /* common.cpp */; };
|
|
||||||
549947E6196A3FB400BA3D87 /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947B6196A3FB400BA3D87 /* memory.cpp */; };
|
549947E6196A3FB400BA3D87 /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947B6196A3FB400BA3D87 /* memory.cpp */; };
|
||||||
549947E7196A3FB400BA3D87 /* WelsFrameWork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947BB196A3FB400BA3D87 /* WelsFrameWork.cpp */; };
|
549947E7196A3FB400BA3D87 /* WelsFrameWork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947BB196A3FB400BA3D87 /* WelsFrameWork.cpp */; };
|
||||||
549947E8196A3FB400BA3D87 /* WelsFrameWorkEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947BD196A3FB400BA3D87 /* WelsFrameWorkEx.cpp */; };
|
549947E8196A3FB400BA3D87 /* WelsFrameWorkEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947BD196A3FB400BA3D87 /* WelsFrameWorkEx.cpp */; };
|
||||||
@@ -34,6 +33,7 @@
|
|||||||
549947F3196A3FB400BA3D87 /* vaacalcfuncs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947D8196A3FB400BA3D87 /* vaacalcfuncs.cpp */; };
|
549947F3196A3FB400BA3D87 /* vaacalcfuncs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947D8196A3FB400BA3D87 /* vaacalcfuncs.cpp */; };
|
||||||
549947F4196A3FB400BA3D87 /* vaacalculation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947D9196A3FB400BA3D87 /* vaacalculation.cpp */; };
|
549947F4196A3FB400BA3D87 /* vaacalculation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 549947D9196A3FB400BA3D87 /* vaacalculation.cpp */; };
|
||||||
6C749B78197E2A2000A111F9 /* adaptive_quantization_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C749B77197E2A2000A111F9 /* adaptive_quantization_aarch64_neon.S */; };
|
6C749B78197E2A2000A111F9 /* adaptive_quantization_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C749B77197E2A2000A111F9 /* adaptive_quantization_aarch64_neon.S */; };
|
||||||
|
F791965B19D3BF6B00F60C6B /* intra_pred_common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F791965A19D3BF6B00F60C6B /* intra_pred_common.cpp */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
@@ -64,7 +64,6 @@
|
|||||||
549947AF196A3FB400BA3D87 /* vaa_calc_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = vaa_calc_neon.S; sourceTree = "<group>"; };
|
549947AF196A3FB400BA3D87 /* vaa_calc_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = vaa_calc_neon.S; sourceTree = "<group>"; };
|
||||||
549947B1196A3FB400BA3D87 /* BackgroundDetection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackgroundDetection.cpp; sourceTree = "<group>"; };
|
549947B1196A3FB400BA3D87 /* BackgroundDetection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackgroundDetection.cpp; sourceTree = "<group>"; };
|
||||||
549947B2196A3FB400BA3D87 /* BackgroundDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackgroundDetection.h; sourceTree = "<group>"; };
|
549947B2196A3FB400BA3D87 /* BackgroundDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackgroundDetection.h; sourceTree = "<group>"; };
|
||||||
549947B4196A3FB400BA3D87 /* common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = common.cpp; sourceTree = "<group>"; };
|
|
||||||
549947B5196A3FB400BA3D87 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
|
549947B5196A3FB400BA3D87 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
|
||||||
549947B6196A3FB400BA3D87 /* memory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memory.cpp; sourceTree = "<group>"; };
|
549947B6196A3FB400BA3D87 /* memory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memory.cpp; sourceTree = "<group>"; };
|
||||||
549947B7196A3FB400BA3D87 /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = "<group>"; };
|
549947B7196A3FB400BA3D87 /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = "<group>"; };
|
||||||
@@ -97,6 +96,7 @@
|
|||||||
549947D9196A3FB400BA3D87 /* vaacalculation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vaacalculation.cpp; sourceTree = "<group>"; };
|
549947D9196A3FB400BA3D87 /* vaacalculation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vaacalculation.cpp; sourceTree = "<group>"; };
|
||||||
549947DA196A3FB400BA3D87 /* vaacalculation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vaacalculation.h; sourceTree = "<group>"; };
|
549947DA196A3FB400BA3D87 /* vaacalculation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vaacalculation.h; sourceTree = "<group>"; };
|
||||||
6C749B77197E2A2000A111F9 /* adaptive_quantization_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = adaptive_quantization_aarch64_neon.S; path = arm64/adaptive_quantization_aarch64_neon.S; sourceTree = "<group>"; };
|
6C749B77197E2A2000A111F9 /* adaptive_quantization_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = adaptive_quantization_aarch64_neon.S; path = arm64/adaptive_quantization_aarch64_neon.S; sourceTree = "<group>"; };
|
||||||
|
F791965A19D3BF6B00F60C6B /* intra_pred_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = intra_pred_common.cpp; path = ../../../common/src/intra_pred_common.cpp; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
549947B3196A3FB400BA3D87 /* common */ = {
|
549947B3196A3FB400BA3D87 /* common */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
549947B4196A3FB400BA3D87 /* common.cpp */,
|
F791965A19D3BF6B00F60C6B /* intra_pred_common.cpp */,
|
||||||
549947B5196A3FB400BA3D87 /* common.h */,
|
549947B5196A3FB400BA3D87 /* common.h */,
|
||||||
549947B6196A3FB400BA3D87 /* memory.cpp */,
|
549947B6196A3FB400BA3D87 /* memory.cpp */,
|
||||||
549947B7196A3FB400BA3D87 /* memory.h */,
|
549947B7196A3FB400BA3D87 /* memory.h */,
|
||||||
@@ -351,7 +351,6 @@
|
|||||||
549947E9196A3FB400BA3D87 /* ComplexityAnalysis.cpp in Sources */,
|
549947E9196A3FB400BA3D87 /* ComplexityAnalysis.cpp in Sources */,
|
||||||
549947E3196A3FB400BA3D87 /* vaa_calc_neon.S in Sources */,
|
549947E3196A3FB400BA3D87 /* vaa_calc_neon.S in Sources */,
|
||||||
549947EE196A3FB400BA3D87 /* imagerotate.cpp in Sources */,
|
549947EE196A3FB400BA3D87 /* imagerotate.cpp in Sources */,
|
||||||
549947E5196A3FB400BA3D87 /* common.cpp in Sources */,
|
|
||||||
549947EA196A3FB400BA3D87 /* denoise.cpp in Sources */,
|
549947EA196A3FB400BA3D87 /* denoise.cpp in Sources */,
|
||||||
549947E7196A3FB400BA3D87 /* WelsFrameWork.cpp in Sources */,
|
549947E7196A3FB400BA3D87 /* WelsFrameWork.cpp in Sources */,
|
||||||
549947F1196A3FB400BA3D87 /* ScrollDetection.cpp in Sources */,
|
549947F1196A3FB400BA3D87 /* ScrollDetection.cpp in Sources */,
|
||||||
@@ -367,6 +366,7 @@
|
|||||||
4CC6094F197E009D00BE8B8B /* down_sample_aarch64_neon.S in Sources */,
|
4CC6094F197E009D00BE8B8B /* down_sample_aarch64_neon.S in Sources */,
|
||||||
4CC6095A1980F34F00BE8B8B /* vaa_calc_aarch64_neon.S in Sources */,
|
4CC6095A1980F34F00BE8B8B /* vaa_calc_aarch64_neon.S in Sources */,
|
||||||
549947F2196A3FB400BA3D87 /* ScrollDetectionFuncs.cpp in Sources */,
|
549947F2196A3FB400BA3D87 /* ScrollDetectionFuncs.cpp in Sources */,
|
||||||
|
F791965B19D3BF6B00F60C6B /* intra_pred_common.cpp in Sources */,
|
||||||
549947EF196A3FB400BA3D87 /* imagerotatefuncs.cpp in Sources */,
|
549947EF196A3FB400BA3D87 /* imagerotatefuncs.cpp in Sources */,
|
||||||
549947DF196A3FB400BA3D87 /* AdaptiveQuantization.cpp in Sources */,
|
549947DF196A3FB400BA3D87 /* AdaptiveQuantization.cpp in Sources */,
|
||||||
549947EC196A3FB400BA3D87 /* downsample.cpp in Sources */,
|
549947EC196A3FB400BA3D87 /* downsample.cpp in Sources */,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -351,51 +351,47 @@
|
|||||||
</References>
|
</References>
|
||||||
<Files>
|
<Files>
|
||||||
<Filter
|
<Filter
|
||||||
Name="SW"
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl"
|
||||||
>
|
>
|
||||||
<Filter
|
<File
|
||||||
Name="Resource Files"
|
RelativePath="..\..\..\common\inc\mem_align.h"
|
||||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
|
||||||
>
|
>
|
||||||
<File
|
</File>
|
||||||
RelativePath="..\..\..\decoder\plus\res\welsdec.rc"
|
<File
|
||||||
>
|
RelativePath="..\..\..\common\inc\welsCodecTrace.h"
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="Source Files"
|
|
||||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
|
||||||
>
|
>
|
||||||
<File
|
</File>
|
||||||
RelativePath="..\..\..\decoder\plus\src\wels_dec_export.def"
|
<File
|
||||||
>
|
RelativePath="..\..\..\decoder\plus\inc\welsDecoderExt.h"
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\..\common\src\welsCodecTrace.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\..\decoder\plus\src\welsDecoderExt.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="Header Files"
|
|
||||||
Filter="h;hpp;hxx;hm;inl"
|
|
||||||
>
|
>
|
||||||
<File
|
</File>
|
||||||
RelativePath="..\..\..\decoder\core\inc\mem_align.h"
|
</Filter>
|
||||||
>
|
<Filter
|
||||||
</File>
|
Name="Resource Files"
|
||||||
<File
|
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||||
RelativePath="..\..\..\common\inc\welsCodecTrace.h"
|
>
|
||||||
>
|
<File
|
||||||
</File>
|
RelativePath="..\..\..\decoder\plus\res\welsdec.rc"
|
||||||
<File
|
>
|
||||||
RelativePath="..\..\..\decoder\plus\inc\welsDecoderExt.h"
|
</File>
|
||||||
>
|
</Filter>
|
||||||
</File>
|
<Filter
|
||||||
</Filter>
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\decoder\plus\src\wels_dec_export.def"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\common\src\welsCodecTrace.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\decoder\plus\src\welsDecoderExt.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
|
|||||||
@@ -382,7 +382,11 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\src\mc.cpp"
|
RelativePath="..\..\..\common\src\intra_pred_common.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\common\src\mc.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
@@ -390,7 +394,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\src\memory_align.cpp"
|
RelativePath="..\..\..\common\src\memory_align.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
@@ -425,6 +429,10 @@
|
|||||||
RelativePath="..\..\..\encoder\core\src\sample.cpp"
|
RelativePath="..\..\..\encoder\core\src\sample.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\encoder\core\src\set_mb_syn_cabac.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\src\set_mb_syn_cavlc.cpp"
|
RelativePath="..\..\..\encoder\core\src\set_mb_syn_cavlc.cpp"
|
||||||
>
|
>
|
||||||
@@ -457,6 +465,10 @@
|
|||||||
RelativePath="..\..\..\encoder\core\src\svc_motion_estimate.cpp"
|
RelativePath="..\..\..\encoder\core\src\svc_motion_estimate.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\encoder\core\src\svc_set_mb_syn_cabac.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\src\svc_set_mb_syn_cavlc.cpp"
|
RelativePath="..\..\..\encoder\core\src\svc_set_mb_syn_cavlc.cpp"
|
||||||
>
|
>
|
||||||
@@ -551,11 +563,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\inc\mc.h"
|
RelativePath="..\..\..\common\inc\mc.h"
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\..\common\inc\mc_common.h"
|
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
@@ -567,7 +575,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\inc\memory_align.h"
|
RelativePath="..\..\..\common\inc\memory_align.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
@@ -622,6 +630,10 @@
|
|||||||
RelativePath="..\..\..\encoder\core\inc\sample.h"
|
RelativePath="..\..\..\encoder\core\inc\sample.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\encoder\core\inc\set_mb_syn_cabac.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\inc\set_mb_syn_cavlc.h"
|
RelativePath="..\..\..\encoder\core\inc\set_mb_syn_cavlc.h"
|
||||||
>
|
>
|
||||||
@@ -674,6 +686,10 @@
|
|||||||
RelativePath="..\..\..\encoder\core\inc\svc_motion_estimate.h"
|
RelativePath="..\..\..\encoder\core\inc\svc_motion_estimate.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\encoder\core\inc\svc_set_mb_syn.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\inc\svc_set_mb_syn_cavlc.h"
|
RelativePath="..\..\..\encoder\core\inc\svc_set_mb_syn_cavlc.h"
|
||||||
>
|
>
|
||||||
@@ -706,6 +722,10 @@
|
|||||||
RelativePath="..\..\..\encoder\core\inc\wels_const.h"
|
RelativePath="..\..\..\encoder\core\inc\wels_const.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\common\inc\wels_const_common.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\inc\wels_func_ptr_def.h"
|
RelativePath="..\..\..\encoder\core\inc\wels_func_ptr_def.h"
|
||||||
>
|
>
|
||||||
@@ -727,7 +747,7 @@
|
|||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
Outputs="$(IntDir)\$(InputName).obj"
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
@@ -745,7 +765,7 @@
|
|||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
Outputs="$(IntDir)\$(InputName).obj"
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
@@ -767,7 +787,7 @@
|
|||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="nasm -I$(InputDir) -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
Outputs="$(IntDir)\$(InputName).obj"
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
@@ -959,6 +979,46 @@
|
|||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\common\x86\intra_pred_com.asm"
|
||||||
|
>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|x64"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win64 -DWIN64 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|x64"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win64 -DWIN64 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\encoder\core\x86\matrix_transpose.asm"
|
RelativePath="..\..\..\encoder\core\x86\matrix_transpose.asm"
|
||||||
>
|
>
|
||||||
@@ -1327,7 +1387,7 @@
|
|||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
Outputs="$(IntDir)\$(InputName).obj"
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
@@ -1345,7 +1405,7 @@
|
|||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
CommandLine="nasm -I$(InputDir) -I$(InputDir)/../../../common/x86/ -f win32 -DPREFIX -DX86_32 -o $(IntDir)\$(InputName).obj $(InputPath)
"
|
||||||
Outputs="$(IntDir)\$(InputName).obj"
|
Outputs="$(IntDir)\$(InputName).obj"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ mov pc, lr
|
|||||||
|
|
||||||
.section .note.GNU-stack,"",%progbits // Mark stack as non-executable
|
.section .note.GNU-stack,"",%progbits // Mark stack as non-executable
|
||||||
.text
|
.text
|
||||||
|
.arch armv7-a
|
||||||
|
.fpu neon
|
||||||
|
|
||||||
.macro WELS_ASM_FUNC_BEGIN funcName
|
.macro WELS_ASM_FUNC_BEGIN funcName
|
||||||
.align 2
|
.align 2
|
||||||
|
|||||||
@@ -834,17 +834,12 @@ WELS_ASM_FUNC_END
|
|||||||
|
|
||||||
|
|
||||||
WELS_ASM_FUNC_BEGIN WelsNonZeroCount_neon
|
WELS_ASM_FUNC_BEGIN WelsNonZeroCount_neon
|
||||||
|
mov r1, #1
|
||||||
vld1.64 {d0-d2}, [r0]
|
vdup.8 q2, r1
|
||||||
|
vld1.64 {d0,d1,d2}, [r0]
|
||||||
vceq.s8 q0, q0, #0
|
vmin.s8 q0, q0, q2
|
||||||
vceq.s8 d2, d2, #0
|
vmin.s8 d2, d2, d4
|
||||||
vmvn q0, q0
|
vst1.64 {d0,d1,d2}, [r0]
|
||||||
vmvn d2, d2
|
|
||||||
vabs.s8 q0, q0
|
|
||||||
vabs.s8 d2, d2
|
|
||||||
|
|
||||||
vst1.64 {d0-d2}, [r0]
|
|
||||||
WELS_ASM_FUNC_END
|
WELS_ASM_FUNC_END
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|||||||
83
codec/common/arm/intra_pred_common_neon.S
Normal file
83
codec/common/arm/intra_pred_common_neon.S
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/*!
|
||||||
|
* \copy
|
||||||
|
* Copyright (c) 2013, Cisco Systems
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_NEON
|
||||||
|
.text
|
||||||
|
#include "arm_arch_common_macro.S"
|
||||||
|
|
||||||
|
WELS_ASM_FUNC_BEGIN WelsI16x16LumaPredV_neon
|
||||||
|
//Get the top line data to 'q0'
|
||||||
|
sub r3, r1, r2
|
||||||
|
vldm r3, {d0, d1}
|
||||||
|
|
||||||
|
//mov r2, #16
|
||||||
|
mov r3, #4
|
||||||
|
//Set the top line to the each line of MB(16*16)
|
||||||
|
loop_0_get_i16x16_luma_pred_v:
|
||||||
|
vst1.8 {d0,d1}, [r0]!
|
||||||
|
vst1.8 {d0,d1}, [r0]!
|
||||||
|
vst1.8 {d0,d1}, [r0]!
|
||||||
|
vst1.8 {d0,d1}, [r0]!
|
||||||
|
subs r3, #1
|
||||||
|
bne loop_0_get_i16x16_luma_pred_v
|
||||||
|
WELS_ASM_FUNC_END
|
||||||
|
|
||||||
|
|
||||||
|
WELS_ASM_FUNC_BEGIN WelsI16x16LumaPredH_neon
|
||||||
|
//stmdb sp!, {r4, lr}
|
||||||
|
sub r1, r1, #1
|
||||||
|
mov r3, #4
|
||||||
|
loop_0_get_i16x16_luma_pred_h:
|
||||||
|
//Get one byte data from left side
|
||||||
|
vld1.8 {d0[],d1[]}, [r1], r2
|
||||||
|
vld1.8 {d2[],d3[]}, [r1], r2
|
||||||
|
vld1.8 {d4[],d5[]}, [r1], r2
|
||||||
|
vld1.8 {d6[],d7[]}, [r1], r2
|
||||||
|
|
||||||
|
//Set the line of MB using the left side byte data
|
||||||
|
vst1.8 {d0,d1}, [r0]!
|
||||||
|
//add r0, #16
|
||||||
|
vst1.8 {d2,d3}, [r0]!
|
||||||
|
//add r0, #16
|
||||||
|
vst1.8 {d4,d5}, [r0]!
|
||||||
|
//add r0, #16
|
||||||
|
vst1.8 {d6,d7}, [r0]!
|
||||||
|
//add r0, #16
|
||||||
|
|
||||||
|
subs r3, #1
|
||||||
|
bne loop_0_get_i16x16_luma_pred_h
|
||||||
|
|
||||||
|
WELS_ASM_FUNC_END
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -553,16 +553,12 @@ bs_mv_check_jump1:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
WELS_ASM_AARCH64_FUNC_BEGIN WelsNonZeroCount_AArch64_neon
|
WELS_ASM_AARCH64_FUNC_BEGIN WelsNonZeroCount_AArch64_neon
|
||||||
|
mov w1, #1
|
||||||
|
dup v3.8b, w1
|
||||||
ld1 {v0.8b, v1.8b, v2.8b}, [x0]
|
ld1 {v0.8b, v1.8b, v2.8b}, [x0]
|
||||||
ins v0.d[1], v1.d[0]
|
umin v0.8b, v0.8b, v3.8b
|
||||||
uzp1 v0.2d, v0.2d, v1.2d
|
umin v1.8b, v1.8b, v3.8b
|
||||||
cmeq v0.16b, v0.16b, #0
|
umin v2.8b, v2.8b, v3.8b
|
||||||
cmeq v2.8b, v2.8b, #0
|
|
||||||
mvn v0.16b, v0.16b
|
|
||||||
mvn v2.8b, v2.8b
|
|
||||||
abs v0.16b, v0.16b
|
|
||||||
abs v2.8b, v2.8b
|
|
||||||
ins v1.d[0], v0.d[1]
|
|
||||||
st1 {v0.8b, v1.8b, v2.8b}, [x0]
|
st1 {v0.8b, v1.8b, v2.8b}, [x0]
|
||||||
WELS_ASM_AARCH64_FUNC_END
|
WELS_ASM_AARCH64_FUNC_END
|
||||||
|
|
||||||
|
|||||||
@@ -30,21 +30,26 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef WELS_MC_H__
|
#ifdef HAVE_NEON_AARCH64
|
||||||
#define WELS_MC_H__
|
.text
|
||||||
|
#include "arm_arch64_common_macro.S"
|
||||||
|
|
||||||
#include "wels_const.h"
|
//for Luma 16x16
|
||||||
#include "macros.h"
|
WELS_ASM_AARCH64_FUNC_BEGIN WelsI16x16LumaPredV_AArch64_neon
|
||||||
#include "decoder_context.h"
|
sub x3, x1, x2
|
||||||
#include "mc_common.h"
|
ld1 {v0.16b}, [x3]
|
||||||
|
.rept 16
|
||||||
|
st1 {v0.16b}, [x0], 16
|
||||||
|
.endr
|
||||||
|
WELS_ASM_AARCH64_FUNC_END
|
||||||
|
|
||||||
namespace WelsDec {
|
WELS_ASM_AARCH64_FUNC_BEGIN WelsI16x16LumaPredH_AArch64_neon
|
||||||
|
sub x3, x1, #1
|
||||||
|
.rept 16
|
||||||
|
ld1r {v0.16b}, [x3], x2
|
||||||
|
st1 {v0.16b}, [x0], 16
|
||||||
|
.endr
|
||||||
|
WELS_ASM_AARCH64_FUNC_END
|
||||||
|
|
||||||
typedef void (*PMcChromaWidthExtFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
#endif
|
||||||
const uint8_t* kpABCD, int32_t iHeight);
|
|
||||||
|
|
||||||
void InitMcFunc (SMcFunc* pMcFunc, int32_t iCpu);
|
|
||||||
|
|
||||||
} // namespace WelsDec
|
|
||||||
|
|
||||||
#endif//WELS_MC_H__
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
rm -f codec/common/inc/version.h
|
|
||||||
git rev-list HEAD | sort > config.git-hash
|
git rev-list HEAD | sort > config.git-hash
|
||||||
LOCALVER=`wc -l config.git-hash | awk '{print $1}'`
|
LOCALVER=`wc -l config.git-hash | awk '{print $1}'`
|
||||||
if [ $LOCALVER \> 1 ] ; then
|
if [ $LOCALVER \> 1 ] ; then
|
||||||
@@ -15,6 +14,13 @@ fi
|
|||||||
GIT_VERSION='"'$GIT_VERSION'"'
|
GIT_VERSION='"'$GIT_VERSION'"'
|
||||||
rm -f config.git-hash
|
rm -f config.git-hash
|
||||||
|
|
||||||
cat codec/common/inc/version.h.template | sed "s/\$FULL_VERSION/$GIT_VERSION/g" > codec/common/inc/version.h
|
cat codec/common/inc/version_gen.h.template | sed "s/\$FULL_VERSION/$GIT_VERSION/g" > codec/common/inc/version_gen.h.new
|
||||||
|
if cmp codec/common/inc/version_gen.h.new codec/common/inc/version_gen.h > /dev/null 2>&1; then
|
||||||
|
# Identical to old version, don't touch it (to avoid unnecessary rebuilds)
|
||||||
|
rm codec/common/inc/version_gen.h.new
|
||||||
|
echo "Keeping existing codec/common/inc/version_gen.h"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
mv codec/common/inc/version_gen.h.new codec/common/inc/version_gen.h
|
||||||
|
|
||||||
echo "Generated codec/common/inc/version.h"
|
echo "Generated codec/common/inc/version_gen.h"
|
||||||
|
|||||||
1
codec/common/inc/.gitignore
vendored
Normal file
1
codec/common/inc/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
version_gen.h
|
||||||
@@ -117,6 +117,8 @@ WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitAllBlocking (uint32_t nCount, WE
|
|||||||
WELS_THREAD_ERROR_CODE WelsThreadCreate (WELS_THREAD_HANDLE* thread, LPWELS_THREAD_ROUTINE routine,
|
WELS_THREAD_ERROR_CODE WelsThreadCreate (WELS_THREAD_HANDLE* thread, LPWELS_THREAD_ROUTINE routine,
|
||||||
void* arg, WELS_THREAD_ATTR attr);
|
void* arg, WELS_THREAD_ATTR attr);
|
||||||
|
|
||||||
|
WELS_THREAD_ERROR_CODE WelsThreadSetName (const char* thread_name);
|
||||||
|
|
||||||
WELS_THREAD_ERROR_CODE WelsThreadJoin (WELS_THREAD_HANDLE thread);
|
WELS_THREAD_ERROR_CODE WelsThreadJoin (WELS_THREAD_HANDLE thread);
|
||||||
|
|
||||||
WELS_THREAD_HANDLE WelsThreadSelf();
|
WELS_THREAD_HANDLE WelsThreadSelf();
|
||||||
|
|||||||
@@ -15,6 +15,16 @@ void DeblockChromaLt4H_c (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int
|
|||||||
int8_t* pTc);
|
int8_t* pTc);
|
||||||
void DeblockChromaEq4H_c (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
void DeblockChromaEq4H_c (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
|
|
||||||
|
void DeblockChromaLt4V2_c (uint8_t* pPixCbCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
|
int8_t* pTc);
|
||||||
|
void DeblockChromaEq4V2_c (uint8_t* pPixCbCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
|
|
||||||
|
void DeblockChromaLt4H2_c (uint8_t* pPixCbCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
|
int8_t* pTc);
|
||||||
|
void DeblockChromaEq4H2_c (uint8_t* pPixCbCr,int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
|
|
||||||
|
void WelsNonZeroCount_c (int8_t* pNonZeroCount);
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
@@ -32,6 +42,7 @@ void DeblockChromaLt4V_ssse3 (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride,
|
|||||||
void DeblockChromaEq4H_ssse3 (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
void DeblockChromaEq4H_ssse3 (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
void DeblockChromaLt4H_ssse3 (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
void DeblockChromaLt4H_ssse3 (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
int8_t* pTC);
|
int8_t* pTC);
|
||||||
|
void WelsNonZeroCount_sse2 (int8_t* pNonZeroCount);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NEON)
|
#if defined(HAVE_NEON)
|
||||||
@@ -48,6 +59,7 @@ void DeblockChromaEq4V_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride,
|
|||||||
void DeblockChromaLt4H_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
void DeblockChromaLt4H_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
int8_t* pTC);
|
int8_t* pTC);
|
||||||
void DeblockChromaEq4H_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
void DeblockChromaEq4H_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
|
void WelsNonZeroCount_neon (int8_t* pNonZeroCount);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NEON_AARCH64)
|
#if defined(HAVE_NEON_AARCH64)
|
||||||
@@ -61,6 +73,7 @@ void DeblockChromaEq4V_AArch64_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t i
|
|||||||
void DeblockChromaLt4H_AArch64_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
void DeblockChromaLt4H_AArch64_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
int8_t* pTC);
|
int8_t* pTC);
|
||||||
void DeblockChromaEq4H_AArch64_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
void DeblockChromaEq4H_AArch64_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
|
void WelsNonZeroCount_AArch64_neon (int8_t* pNonZeroCount);
|
||||||
#endif
|
#endif
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* \copy
|
* \copy
|
||||||
* Copyright (c) 2013, Cisco Systems
|
* Copyright (c) 2009-2013, Cisco Systems
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -28,63 +28,49 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* memory alignment utilization
|
*
|
||||||
|
* \file intra_pred_common.h
|
||||||
|
*
|
||||||
|
* \brief interfaces for intra predictor about 16x16.
|
||||||
|
*
|
||||||
|
* \date 4/2/2014 Created
|
||||||
|
*
|
||||||
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef WELS_MEM_ALIGN_H__
|
#ifndef INTRA_PRED_COMMON_H
|
||||||
#define WELS_MEM_ALIGN_H__
|
#define INTRA_PRED_COMMON_H
|
||||||
|
|
||||||
|
#include "typedefs.h"
|
||||||
|
|
||||||
|
|
||||||
|
void WelsI16x16LumaPredV_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
|
||||||
|
void WelsI16x16LumaPredH_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
namespace WelsDec {
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
|
|
||||||
|
#if defined(X86_ASM)
|
||||||
|
//for intra-prediction ASM functions
|
||||||
|
void WelsI16x16LumaPredV_sse2 (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
|
||||||
|
void WelsI16x16LumaPredH_sse2 (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
|
||||||
|
#endif//X86_ASM
|
||||||
|
|
||||||
|
#if defined(HAVE_NEON)
|
||||||
|
void WelsI16x16LumaPredV_neon (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
|
||||||
|
void WelsI16x16LumaPredH_neon (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
|
||||||
|
#endif//HAVE_NEON
|
||||||
|
|
||||||
/*!
|
#if defined(HAVE_NEON_AARCH64)
|
||||||
*************************************************************************************
|
void WelsI16x16LumaPredV_AArch64_neon (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
|
||||||
* \brief malloc with zero filled utilization in Wels
|
void WelsI16x16LumaPredH_AArch64_neon (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
|
||||||
*
|
#endif//HAVE_NEON_AARCH64
|
||||||
* \param kuiSize size of memory block required
|
#if defined(__cplusplus)
|
||||||
*
|
|
||||||
* \return allocated memory pointer exactly, failed in case of NULL return
|
|
||||||
*
|
|
||||||
* \note N/A
|
|
||||||
*************************************************************************************
|
|
||||||
*/
|
|
||||||
void* WelsMalloc (const uint32_t kuiSize, const char* kpTag);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
*************************************************************************************
|
|
||||||
* \brief free utilization in Wels
|
|
||||||
*
|
|
||||||
* \param pPtr data pointer to be free.
|
|
||||||
* i.e, uint8_t *pPtr = actual data to be free, argv = &pPtr.
|
|
||||||
*
|
|
||||||
* \return NONE
|
|
||||||
*
|
|
||||||
* \note N/A
|
|
||||||
*************************************************************************************
|
|
||||||
*/
|
|
||||||
void WelsFree (void* pPtr, const char* kpTag);
|
|
||||||
|
|
||||||
#define WELS_SAFE_FREE(pPtr, pTag) if (pPtr) { WelsFree(pPtr, pTag); pPtr = NULL; }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* memory operation routines
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
}
|
||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
|
#endif//
|
||||||
|
|
||||||
|
|
||||||
} // namespace WelsDec
|
|
||||||
|
|
||||||
#endif //WELS_MEM_ALIGN_H__
|
|
||||||
@@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <string.h>
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -116,6 +117,10 @@
|
|||||||
#define WELS_ROUND(x) ((int32_t)(0.5+(x)))
|
#define WELS_ROUND(x) ((int32_t)(0.5+(x)))
|
||||||
#endif//WELS_ROUND
|
#endif//WELS_ROUND
|
||||||
|
|
||||||
|
#ifndef WELS_ROUND64
|
||||||
|
#define WELS_ROUND64(x) ((int64_t)(0.5+(x)))
|
||||||
|
#endif//WELS_ROUND
|
||||||
|
|
||||||
#ifndef WELS_DIV_ROUND
|
#ifndef WELS_DIV_ROUND
|
||||||
#define WELS_DIV_ROUND(x,y) ((int32_t)((y)==0?((x)/((y)+1)):(((y)/2+(x))/(y))))
|
#define WELS_DIV_ROUND(x,y) ((int32_t)((y)==0?((x)/((y)+1)):(((y)/2+(x))/(y))))
|
||||||
#endif//WELS_DIV_ROUND
|
#endif//WELS_DIV_ROUND
|
||||||
@@ -192,6 +197,14 @@ static inline uint8_t WelsClip1 (int32_t iX) {
|
|||||||
#define WELS_CLIP3(iX, iY, iZ) ((iX) < (iY) ? (iY) : ((iX) > (iZ) ? (iZ) : (iX)))
|
#define WELS_CLIP3(iX, iY, iZ) ((iX) < (iY) ? (iY) : ((iX) > (iZ) ? (iZ) : (iX)))
|
||||||
#endif //WELS_CLIP3
|
#endif //WELS_CLIP3
|
||||||
|
|
||||||
|
template<typename T> T WelsClip3(T iX, T iY, T iZ) {
|
||||||
|
if (iX < iY)
|
||||||
|
return iY;
|
||||||
|
if (iX > iZ)
|
||||||
|
return iZ;
|
||||||
|
return iX;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description: to check variable validation and return the specified result
|
* Description: to check variable validation and return the specified result
|
||||||
* iResult: value to be checked
|
* iResult: value to be checked
|
||||||
@@ -268,6 +281,37 @@ static inline bool WELS_POWER2_IF (uint32_t v) {
|
|||||||
#define WELS_GCC_UNUSED
|
#define WELS_GCC_UNUSED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
inline bool CheckInRangeCloseOpen (const int16_t kiCurrent, const int16_t kiMin, const int16_t kiMax) {
|
||||||
|
return ((kiCurrent >= kiMin) && (kiCurrent < kiMax));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void WelsSetMemUint32_c (uint32_t* pDst, uint32_t iValue, int32_t iSizeOfData) {
|
||||||
|
for (int i = 0; i < iSizeOfData; i++) {
|
||||||
|
pDst[i] = iValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void WelsSetMemUint16_c (uint16_t* pDst, uint16_t iValue, int32_t iSizeOfData) {
|
||||||
|
for (int i = 0; i < iSizeOfData; i++) {
|
||||||
|
pDst[i] = iValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void WelsSetMemMultiplebytes_c (void* pDst, uint32_t iValue, int32_t iSizeOfData, int32_t iDataLengthOfData) {
|
||||||
|
assert (4 == iDataLengthOfData || 2 == iDataLengthOfData || 1 == iDataLengthOfData);
|
||||||
|
|
||||||
|
// TODO: consider add assembly for these functions
|
||||||
|
if (0 != iValue) {
|
||||||
|
if (4 == iDataLengthOfData) {
|
||||||
|
WelsSetMemUint32_c (static_cast<uint32_t*> (pDst), static_cast<uint32_t> (iValue), iSizeOfData);
|
||||||
|
} else if (2 == iDataLengthOfData) {
|
||||||
|
WelsSetMemUint16_c (static_cast<uint16_t*> (pDst), static_cast<uint16_t> (iValue), iSizeOfData);
|
||||||
|
} else {
|
||||||
|
memset (static_cast<uint8_t*> (pDst), static_cast<uint8_t> (iValue), iSizeOfData);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
memset (static_cast<uint8_t*> (pDst), 0, iSizeOfData * iDataLengthOfData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif//WELS_MACRO_UTILIZATIONS_H__
|
#endif//WELS_MACRO_UTILIZATIONS_H__
|
||||||
|
|||||||
@@ -30,11 +30,36 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MC_COMMON_H
|
#ifndef MC_H
|
||||||
#define MC_COMMON_H
|
#define MC_H
|
||||||
|
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
|
|
||||||
|
typedef void (*PWelsMcFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight);
|
||||||
|
|
||||||
|
typedef void (*PWelsLumaHalfpelMcFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight);
|
||||||
|
typedef void (*PWelsSampleAveragingFunc) (uint8_t*, int32_t, const uint8_t*, int32_t, const uint8_t*, int32_t,
|
||||||
|
int32_t, int32_t);
|
||||||
|
|
||||||
|
typedef struct TagMcFunc {
|
||||||
|
PWelsLumaHalfpelMcFunc pfLumaHalfpelHor;
|
||||||
|
PWelsLumaHalfpelMcFunc pfLumaHalfpelVer;
|
||||||
|
PWelsLumaHalfpelMcFunc pfLumaHalfpelCen;
|
||||||
|
PWelsMcFunc pMcChromaFunc;
|
||||||
|
|
||||||
|
PWelsMcFunc pMcLumaFunc;
|
||||||
|
PWelsSampleAveragingFunc pfSampleAveraging;
|
||||||
|
} SMcFunc;
|
||||||
|
|
||||||
|
namespace WelsCommon {
|
||||||
|
|
||||||
|
void InitMcFunc (SMcFunc* pMcFunc, uint32_t iCpu);
|
||||||
|
|
||||||
|
} // namespace WelsCommon
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
@@ -272,4 +297,4 @@ void McChromaWidthEq8_ssse3 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* p
|
|||||||
}
|
}
|
||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
|
|
||||||
#endif//MC_COMMON_H
|
#endif//MC_H
|
||||||
@@ -30,16 +30,26 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(WELS_ENCODER_MEMORY_ALIGN_H__)
|
#if !defined(WELS_COMMON_MEMORY_ALIGN_H__)
|
||||||
#define WELS_ENCODER_MEMORY_ALIGN_H__
|
#define WELS_COMMON_MEMORY_ALIGN_H__
|
||||||
|
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
#include "as264_common.h"
|
|
||||||
|
// NOTE: please do not clean below lines even comment, turn on for potential memory leak verify and memory usage monitor etc.
|
||||||
|
//#define MEMORY_CHECK
|
||||||
|
#define MEMORY_MONITOR
|
||||||
|
#ifdef MEMORY_CHECK
|
||||||
|
#ifndef MEMORY_MONITOR
|
||||||
|
#define MEMORY_MONITOR
|
||||||
|
#endif//MEMORY_MONITOR
|
||||||
|
#endif//MEMORY_CHECK
|
||||||
|
|
||||||
|
|
||||||
#ifdef MEMORY_CHECK
|
#ifdef MEMORY_CHECK
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif//MEMORY_CHECK
|
#endif//MEMORY_CHECK
|
||||||
|
|
||||||
namespace WelsEnc {
|
namespace WelsCommon {
|
||||||
|
|
||||||
class CMemoryAlign {
|
class CMemoryAlign {
|
||||||
public:
|
public:
|
||||||
@@ -63,13 +73,38 @@ uint32_t m_nCacheLineSize;
|
|||||||
#ifdef MEMORY_MONITOR
|
#ifdef MEMORY_MONITOR
|
||||||
uint32_t m_nMemoryUsageInBytes;
|
uint32_t m_nMemoryUsageInBytes;
|
||||||
#endif//MEMORY_MONITOR
|
#endif//MEMORY_MONITOR
|
||||||
|
|
||||||
#ifdef MEMORY_CHECK
|
|
||||||
FILE* m_fpMemChkPoint;
|
|
||||||
uint32_t m_nCountRequestNum;
|
|
||||||
#endif//MEMORY_CHECK
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*************************************************************************************
|
||||||
|
* \brief malloc with zero filled utilization in Wels
|
||||||
|
*
|
||||||
|
* \param kuiSize size of memory block required
|
||||||
|
*
|
||||||
|
* \return allocated memory pointer exactly, failed in case of NULL return
|
||||||
|
*
|
||||||
|
* \note N/A
|
||||||
|
*************************************************************************************
|
||||||
|
*/
|
||||||
|
void* WelsMallocz (const uint32_t kuiSize, const char* kpTag);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*************************************************************************************
|
||||||
|
* \brief free utilization in Wels
|
||||||
|
*
|
||||||
|
* \param pPtr data pointer to be free.
|
||||||
|
* i.e, uint8_t *pPtr = actual data to be free, argv = &pPtr.
|
||||||
|
*
|
||||||
|
* \return NONE
|
||||||
|
*
|
||||||
|
* \note N/A
|
||||||
|
*************************************************************************************
|
||||||
|
*/
|
||||||
|
void WelsFree (void* pPtr, const char* kpTag);
|
||||||
|
|
||||||
|
#define WELS_SAFE_FREE(pPtr, pTag) if (pPtr) { WelsFree(pPtr, pTag); pPtr = NULL; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif//WELS_ENCODER_MEMORY_ALIGN_H__
|
#endif//WELS_COMMON_MEMORY_ALIGN_H__
|
||||||
@@ -54,6 +54,7 @@ typedef void (*PWelsLogCallbackFunc) (void* pCtx, const int32_t iLevel, const ch
|
|||||||
typedef struct TagLogContext {
|
typedef struct TagLogContext {
|
||||||
PWelsLogCallbackFunc pfLog;
|
PWelsLogCallbackFunc pfLog;
|
||||||
void* pLogCtx;
|
void* pLogCtx;
|
||||||
|
void* pCodecInstance;
|
||||||
} SLogContext;
|
} SLogContext;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#ifndef VERSION_H
|
#ifndef VERSION_H
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
#define VERSION_NUMBER "openh264 default: 1.1"
|
#ifdef GENERATED_VERSION_HEADER
|
||||||
|
#include "version_gen.h"
|
||||||
|
#else
|
||||||
|
#define VERSION_NUMBER "openh264 default: 1.4"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // VERSION_H
|
#endif // VERSION_H
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#ifndef VERSION_H
|
|
||||||
#define VERSION_H
|
|
||||||
|
|
||||||
#define VERSION_NUMBER $FULL_VERSION
|
|
||||||
|
|
||||||
#endif // VERSION_H
|
|
||||||
6
codec/common/inc/version_gen.h.template
Normal file
6
codec/common/inc/version_gen.h.template
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef VERSION_GEN_H
|
||||||
|
#define VERSION_GEN_H
|
||||||
|
|
||||||
|
#define VERSION_NUMBER $FULL_VERSION
|
||||||
|
|
||||||
|
#endif // VERSION_GEN_H
|
||||||
@@ -44,6 +44,7 @@ class welsCodecTrace {
|
|||||||
welsCodecTrace();
|
welsCodecTrace();
|
||||||
~welsCodecTrace();
|
~welsCodecTrace();
|
||||||
|
|
||||||
|
void SetCodecInstance (void* pCodecInstance);
|
||||||
void SetTraceLevel (const int32_t kiLevel);
|
void SetTraceLevel (const int32_t kiLevel);
|
||||||
void SetTraceCallback (WelsTraceCallback func);
|
void SetTraceCallback (WelsTraceCallback func);
|
||||||
void SetTraceCallbackContext (void* pCtx);
|
void SetTraceCallbackContext (void* pCtx);
|
||||||
|
|||||||
@@ -36,15 +36,17 @@
|
|||||||
|
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
#include "codec_app_def.h"
|
||||||
|
|
||||||
|
|
||||||
namespace WelsCommon {
|
namespace WelsCommon {
|
||||||
/*common use table*/
|
/*common use table*/
|
||||||
|
|
||||||
|
#define CTX_NA 0
|
||||||
|
#define WELS_CONTEXT_COUNT 460
|
||||||
#define LEVEL_NUMBER 17
|
#define LEVEL_NUMBER 17
|
||||||
typedef struct TagLevelLimits {
|
typedef struct TagLevelLimits {
|
||||||
uint8_t uiLevelIdc; // level idc
|
ELevelIdc uiLevelIdc; // level idc
|
||||||
uint32_t uiMaxMBPS; // Max macroblock processing rate(MB/s)
|
uint32_t uiMaxMBPS; // Max macroblock processing rate(MB/s)
|
||||||
uint32_t uiMaxFS; // Max frame sizea(MBs)
|
uint32_t uiMaxFS; // Max frame sizea(MBs)
|
||||||
uint32_t uiMaxDPBMbs;// Max decoded picture buffer size(MBs)
|
uint32_t uiMaxDPBMbs;// Max decoded picture buffer size(MBs)
|
||||||
@@ -56,14 +58,21 @@ typedef struct TagLevelLimits {
|
|||||||
int16_t iMaxMvsPer2Mb; // Max number of motion vectors per two consecutive MBs
|
int16_t iMaxMvsPer2Mb; // Max number of motion vectors per two consecutive MBs
|
||||||
} SLevelLimits;
|
} SLevelLimits;
|
||||||
|
|
||||||
|
#define CpbBrNalFactor 1200 //baseline,main,and extended profiles.
|
||||||
extern const SLevelLimits g_ksLevelLimits[LEVEL_NUMBER];
|
extern const SLevelLimits g_ksLevelLimits[LEVEL_NUMBER];
|
||||||
|
extern const uint32_t g_kuiLevelMaps[LEVEL_NUMBER];
|
||||||
extern const uint8_t g_kuiMbCountScan4Idx[24];
|
extern const uint8_t g_kuiMbCountScan4Idx[24];
|
||||||
extern const uint8_t g_kuiCache30ScanIdx[16];
|
extern const uint8_t g_kuiCache30ScanIdx[16];
|
||||||
extern const uint8_t g_kuiCache48CountScan4Idx[24];
|
extern const uint8_t g_kuiCache48CountScan4Idx[24];
|
||||||
|
|
||||||
|
extern const uint8_t g_kuiDequantScaling4x4Default[2][16];
|
||||||
|
extern const uint8_t g_kuiDequantScaling8x8Default[2][64];
|
||||||
extern const ALIGNED_DECLARE (uint16_t, g_kuiDequantCoeff[52][8], 16);
|
extern const ALIGNED_DECLARE (uint16_t, g_kuiDequantCoeff[52][8], 16);
|
||||||
extern const uint8_t g_kuiChromaQpTable[52];
|
extern const uint8_t g_kuiChromaQpTable[52];
|
||||||
|
|
||||||
|
extern const uint8_t g_kuiCabacRangeLps[64][4];
|
||||||
|
extern const int8_t g_kiCabacGlobalContextIdx[WELS_CONTEXT_COUNT][4][2];
|
||||||
|
extern const uint8_t g_kuiStateTransTable[64][2];
|
||||||
/*
|
/*
|
||||||
* NAL Unit Type (5 Bits)
|
* NAL Unit Type (5 Bits)
|
||||||
*/
|
*/
|
||||||
@@ -155,7 +164,7 @@ enum EWelsSliceType {
|
|||||||
UNKNOWN_SLICE = 5
|
UNKNOWN_SLICE = 5
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SSlice Types in scalable extension */ ;
|
/* SSlice Types in scalable extension */
|
||||||
enum ESliceTypeExt {
|
enum ESliceTypeExt {
|
||||||
EP_SLICE = 0, // EP_SLICE: 0, 5
|
EP_SLICE = 0, // EP_SLICE: 0, 5
|
||||||
EB_SLICE = 1, // EB_SLICE: 1, 6
|
EB_SLICE = 1, // EB_SLICE: 1, 6
|
||||||
|
|||||||
@@ -30,22 +30,27 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//macroblock.h
|
#ifndef WELS_CONST_COMMON_H__
|
||||||
#ifndef WELS_MC_H__
|
#define WELS_CONST_COMMON_H__
|
||||||
#define WELS_MC_H__
|
|
||||||
|
|
||||||
#include <string.h>
|
// Miscellaneous sizing infos
|
||||||
#include "typedefs.h"
|
#ifndef MAX_FNAME_LEN
|
||||||
#include "wels_const.h"
|
#define MAX_FNAME_LEN 256 // maximal length of file name in char size
|
||||||
#include "macros.h"
|
#endif//MAX_FNAME_LEN
|
||||||
#include "wels_func_ptr_def.h"
|
|
||||||
#include "mc_common.h"
|
|
||||||
|
|
||||||
/////////////////////luma MC//////////////////////////
|
#ifndef WELS_LOG_BUF_SIZE
|
||||||
//x y means dx(mv[0] & 3) and dy(mv[1] & 3)
|
#define WELS_LOG_BUF_SIZE 4096
|
||||||
|
#endif//WELS_LOG_BUF_SIZE
|
||||||
|
|
||||||
namespace WelsEnc {
|
#ifndef MAX_TRACE_LOG_SIZE
|
||||||
void WelsInitMcFuncs (SWelsFuncPtrList* pFuncList, uint32_t uiCpuFlag);
|
#define MAX_TRACE_LOG_SIZE (50 * (1<<20)) // max trace log size: 50 MB, overwrite occur if log file size exceeds this size
|
||||||
|
#endif//MAX_TRACE_LOG_SIZE
|
||||||
|
|
||||||
}
|
/* MB width in pixels for specified colorspace I420 usually used in codec */
|
||||||
#endif//WELS_MC_H__
|
#define MB_WIDTH_LUMA 16
|
||||||
|
#define MB_WIDTH_CHROMA (MB_WIDTH_LUMA>>1)
|
||||||
|
/* MB height in pixels for specified colorspace I420 usually used in codec */
|
||||||
|
#define MB_HEIGHT_LUMA 16
|
||||||
|
#define MB_HEIGHT_CHROMA (MB_HEIGHT_LUMA>>1)
|
||||||
|
|
||||||
|
#endif//WELS_CONST_COMMON_H__
|
||||||
@@ -58,6 +58,9 @@
|
|||||||
#ifdef ANDROID_NDK
|
#ifdef ANDROID_NDK
|
||||||
#include <cpu-features.h>
|
#include <cpu-features.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
#include <android/api-level.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "WelsThreadLib.h"
|
#include "WelsThreadLib.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -195,6 +198,12 @@ WELS_THREAD_ERROR_CODE WelsThreadCreate (WELS_THREAD_HANDLE* thread, LPWELS_
|
|||||||
return WELS_THREAD_ERROR_OK;
|
return WELS_THREAD_ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WELS_THREAD_ERROR_CODE WelsThreadSetName (const char* thread_name) {
|
||||||
|
// do nothing
|
||||||
|
return WELS_THREAD_ERROR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
WELS_THREAD_ERROR_CODE WelsThreadJoin (WELS_THREAD_HANDLE thread) {
|
WELS_THREAD_ERROR_CODE WelsThreadJoin (WELS_THREAD_HANDLE thread) {
|
||||||
WaitForSingleObject (thread, INFINITE);
|
WaitForSingleObject (thread, INFINITE);
|
||||||
CloseHandle (thread);
|
CloseHandle (thread);
|
||||||
@@ -242,6 +251,17 @@ WELS_THREAD_ERROR_CODE WelsThreadCreate (WELS_THREAD_HANDLE* thread, LPWELS_
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WELS_THREAD_ERROR_CODE WelsThreadSetName (const char* thread_name) {
|
||||||
|
#ifdef APPLE_IOS
|
||||||
|
pthread_setname_np(thread_name);
|
||||||
|
#endif
|
||||||
|
#if defined(__ANDROID__) && __ANDROID_API__ >= 9
|
||||||
|
pthread_setname_np(pthread_self(), thread_name);
|
||||||
|
#endif
|
||||||
|
// do nothing
|
||||||
|
return WELS_THREAD_ERROR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
WELS_THREAD_ERROR_CODE WelsThreadJoin (WELS_THREAD_HANDLE thread) {
|
WELS_THREAD_ERROR_CODE WelsThreadJoin (WELS_THREAD_HANDLE thread) {
|
||||||
return pthread_join (thread, NULL);
|
return pthread_join (thread, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ const uint8_t g_kuiCache30ScanIdx[16] = { //mv or uiRefIndex cache scan index, 4
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
// extern at wels_common_defs.h
|
// extern at wels_common_defs.h
|
||||||
const uint8_t g_kuiChromaQpTable[52] = {
|
const uint8_t g_kuiChromaQpTable[52] = {
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
||||||
@@ -119,7 +120,29 @@ const EVclType g_keTypeMap[32][2] = {
|
|||||||
{ NON_VCL, NON_VCL }, // 30: NAL_UNIT_UNSPEC_30
|
{ NON_VCL, NON_VCL }, // 30: NAL_UNIT_UNSPEC_30
|
||||||
{ NON_VCL, NON_VCL } // 31: NAL_UNIT_UNSPEC_31
|
{ NON_VCL, NON_VCL } // 31: NAL_UNIT_UNSPEC_31
|
||||||
};
|
};
|
||||||
|
//default scaling list matrix value of 4x4
|
||||||
|
const uint8_t g_kuiDequantScaling4x4Default[2][16]={
|
||||||
|
{ 6, 13, 20, 28, 13, 20, 28, 32, 20, 28, 32, 37, 28, 32, 37, 42 },
|
||||||
|
{ 10, 14, 20, 24, 14, 20, 24, 27, 20, 24, 27, 30, 24, 27, 30, 34 }
|
||||||
|
};
|
||||||
|
//default scaling list matrix value of 8x8
|
||||||
|
const uint8_t g_kuiDequantScaling8x8Default[2][64]={
|
||||||
|
{ 6, 10, 13, 16, 18, 23, 25, 27, 10, 11, 16, 18, 23, 25, 27, 29,
|
||||||
|
13, 16, 18, 23, 25, 27, 29, 31,
|
||||||
|
16, 18, 23, 25, 27, 29, 31, 33,
|
||||||
|
18, 23, 25, 27, 29, 31, 33, 36,
|
||||||
|
23, 25, 27, 29, 31, 33, 36, 38,
|
||||||
|
25, 27, 29, 31, 33, 36, 38, 40,
|
||||||
|
27, 29, 31, 33, 36, 38, 40, 42 },
|
||||||
|
{ 9, 13, 15, 17, 19, 21, 22, 24,
|
||||||
|
13, 13, 17, 19, 21, 22, 24, 25,
|
||||||
|
15, 17, 19, 21, 22, 24, 25, 27,
|
||||||
|
17, 19, 21, 22, 24, 25, 27, 28,
|
||||||
|
19, 21, 22, 24, 25, 27, 28, 30,
|
||||||
|
21, 22, 24, 25, 27, 28, 30, 32,
|
||||||
|
22, 24, 25, 27, 28, 30, 32, 33,
|
||||||
|
24, 25, 27, 28, 30, 32, 33, 35 }
|
||||||
|
};
|
||||||
ALIGNED_DECLARE (const uint16_t, g_kuiDequantCoeff[52][8], 16) = {
|
ALIGNED_DECLARE (const uint16_t, g_kuiDequantCoeff[52][8], 16) = {
|
||||||
/* 0*/{ 10, 13, 10, 13, 13, 16, 13, 16 }, /* 1*/{ 11, 14, 11, 14, 14, 18, 14, 18 },
|
/* 0*/{ 10, 13, 10, 13, 13, 16, 13, 16 }, /* 1*/{ 11, 14, 11, 14, 14, 18, 14, 18 },
|
||||||
/* 2*/{ 13, 16, 13, 16, 16, 20, 16, 20 }, /* 3*/{ 14, 18, 14, 18, 18, 23, 18, 23 },
|
/* 2*/{ 13, 16, 13, 16, 16, 20, 16, 20 }, /* 3*/{ 14, 18, 14, 18, 18, 23, 18, 23 },
|
||||||
@@ -151,27 +174,543 @@ ALIGNED_DECLARE (const uint16_t, g_kuiDequantCoeff[52][8], 16) = {
|
|||||||
|
|
||||||
// table A-1 - Level limits
|
// table A-1 - Level limits
|
||||||
const SLevelLimits g_ksLevelLimits[LEVEL_NUMBER] = {
|
const SLevelLimits g_ksLevelLimits[LEVEL_NUMBER] = {
|
||||||
{10, 1485, 99, 396, 64, 175, -256, 255, 2, 0x7fff}, /* level 1 */
|
{LEVEL_1_0, 1485, 99, 396, 64, 175, -256, 255, 2, 0x7fff}, /* level 1 */
|
||||||
{9, 1485, 99, 396, 128, 350, -256, 255, 2, 0x7fff}, /* level 1.b */
|
{LEVEL_1_B, 1485, 99, 396, 128, 350, -256, 255, 2, 0x7fff}, /* level 1.b */
|
||||||
{11, 3000, 396, 900, 192, 500, -512, 511, 2, 0x7fff}, /* level 1.1 */
|
{LEVEL_1_1, 3000, 396, 900, 192, 500, -512, 511, 2, 0x7fff}, /* level 1.1 */
|
||||||
{12, 6000, 396, 2376, 384, 1000, -512, 511, 2, 0x7fff}, /* level 1.2 */
|
{LEVEL_1_2, 6000, 396, 2376, 384, 1000, -512, 511, 2, 0x7fff}, /* level 1.2 */
|
||||||
{13, 11880, 396, 2376, 768, 2000, -512, 511, 2, 0x7fff}, /* level 1.3 */
|
{LEVEL_1_3, 11880, 396, 2376, 768, 2000, -512, 511, 2, 0x7fff}, /* level 1.3 */
|
||||||
|
|
||||||
{20, 11880, 396, 2376, 2000, 2000, -512, 511, 2, 0x7fff}, /* level 2 */
|
{LEVEL_2_0, 11880, 396, 2376, 2000, 2000, -512, 511, 2, 0x7fff}, /* level 2 */
|
||||||
{21, 19800, 792, 4752, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.1 */
|
{LEVEL_2_1, 19800, 792, 4752, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.1 */
|
||||||
{22, 20250, 1620, 8100, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.2 */
|
{LEVEL_2_2, 20250, 1620, 8100, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.2 */
|
||||||
|
|
||||||
{30, 40500, 1620, 8100, 10000, 10000, -1024, 1023, 2, 32 }, /* level 3 */
|
{LEVEL_3_0, 40500, 1620, 8100, 10000, 10000, -1024, 1023, 2, 32 }, /* level 3 */
|
||||||
{31, 108000, 3600, 18000, 14000, 14000, -2048, 2047, 4, 16}, /* level 3.1 */
|
{LEVEL_3_1, 108000, 3600, 18000, 14000, 14000, -2048, 2047, 4, 16}, /* level 3.1 */
|
||||||
{32, 216000, 5120, 20480, 20000, 20000, -2048, 2047, 4, 16}, /* level 3.2 */
|
{LEVEL_3_2, 216000, 5120, 20480, 20000, 20000, -2048, 2047, 4, 16}, /* level 3.2 */
|
||||||
|
|
||||||
{40, 245760, 8192, 32768, 20000, 25000, -2048, 2047, 4, 16}, /* level 4 */
|
{LEVEL_4_0, 245760, 8192, 32768, 20000, 25000, -2048, 2047, 4, 16}, /* level 4 */
|
||||||
{41, 245760, 8192, 32768, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.1 */
|
{LEVEL_4_1, 245760, 8192, 32768, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.1 */
|
||||||
{42, 522240, 8704, 34816, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.2 */
|
{LEVEL_4_2, 522240, 8704, 34816, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.2 */
|
||||||
|
|
||||||
{50, 589824, 22080, 110400, 135000, 135000, -2048, 2047, 2, 16}, /* level 5 */
|
{LEVEL_5_0, 589824, 22080, 110400, 135000, 135000, -2048, 2047, 2, 16}, /* level 5 */
|
||||||
{51, 983040, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16}, /* level 5.1 */
|
{LEVEL_5_1, 983040, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16}, /* level 5.1 */
|
||||||
{52, 2073600, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16} /* level 5.2 */
|
{LEVEL_5_2, 2073600, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16} /* level 5.2 */
|
||||||
};
|
};
|
||||||
|
const uint32_t g_kuiLevelMaps[LEVEL_NUMBER] = {
|
||||||
|
10, 9, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51, 52
|
||||||
|
};
|
||||||
|
//for cabac
|
||||||
|
/* this table is from Table9-12 to Table 9-24 */
|
||||||
|
|
||||||
|
const int8_t g_kiCabacGlobalContextIdx[WELS_CONTEXT_COUNT][4][2] = {
|
||||||
|
//0-10 Table 9-12
|
||||||
|
{{20, -15}, {20, -15}, {20, -15}, {20, -15}},
|
||||||
|
{{2, 54}, {2, 54}, {2, 54}, {2, 54}},
|
||||||
|
{{3, 74}, {3, 74}, {3, 74}, {3, 74}},
|
||||||
|
{{20, -15}, {20, -15}, {20, -15}, {20, -15}},
|
||||||
|
{{2, 54}, {2, 54}, {2, 54}, {2, 54}},
|
||||||
|
{{3, 74}, {3, 74}, {3, 74}, {3, 74}},
|
||||||
|
{{ -28, 127}, { -28, 127}, { -28, 127}, { -28, 127}},
|
||||||
|
{{ -23, 104}, { -23, 104}, { -23, 104}, { -23, 104}},
|
||||||
|
{{ -6, 53}, { -6, 53}, { -6, 53}, { -6, 53}},
|
||||||
|
{{ -1, 54}, { -1, 54}, { -1, 54}, { -1, 54}},
|
||||||
|
{{7, 51}, {7, 51}, {7, 51}, {7, 51}},
|
||||||
|
//11-23 Table 9-13
|
||||||
|
{{CTX_NA, CTX_NA}, {23, 33}, {22, 25}, {29, 16}},
|
||||||
|
{{CTX_NA, CTX_NA}, {23, 2}, {34, 0}, {25, 0}},
|
||||||
|
{{CTX_NA, CTX_NA}, {21, 0}, {16, 0}, {14, 0}},
|
||||||
|
{{CTX_NA, CTX_NA}, {1, 9}, { -2, 9}, { -10, 51}},
|
||||||
|
{{CTX_NA, CTX_NA}, {0, 49}, {4, 41}, { -3, 62}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -37, 118}, { -29, 118}, { -27, 99}},
|
||||||
|
{{CTX_NA, CTX_NA}, {5, 57}, {2, 65}, {26, 16}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -13, 78}, { -6, 71}, { -4, 85}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -11, 65}, { -13, 79}, { -24, 102}},
|
||||||
|
{{CTX_NA, CTX_NA}, {1, 62}, {5, 52}, {5, 57}},
|
||||||
|
{{CTX_NA, CTX_NA}, {12, 49}, {9, 50}, {6, 57}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -4, 73}, { -3, 70}, { -17, 73}},
|
||||||
|
{{CTX_NA, CTX_NA}, {17, 50}, {10, 54}, {14, 57}},
|
||||||
|
//24-39 Table9-14
|
||||||
|
{{CTX_NA, CTX_NA}, {18, 64}, {26, 34}, {20, 40}},
|
||||||
|
{{CTX_NA, CTX_NA}, {9, 43}, {19, 22}, {20, 10}},
|
||||||
|
{{CTX_NA, CTX_NA}, {29, 0}, {40, 0}, {29, 0}},
|
||||||
|
{{CTX_NA, CTX_NA}, {26, 67}, {57, 2}, {54, 0}},
|
||||||
|
{{CTX_NA, CTX_NA}, {16, 90}, {41, 36}, {37, 42}},
|
||||||
|
{{CTX_NA, CTX_NA}, {9, 104}, {26, 69}, {12, 97}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -46, 127}, { -45, 127}, { -32, 127}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -20, 104}, { -15, 101}, { -22, 117}},
|
||||||
|
{{CTX_NA, CTX_NA}, {1, 67}, { -4, 76}, { -2, 74}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -13, 78}, { -6, 71}, { -4, 85}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -11, 65}, { -13, 79}, { -24, 102}},
|
||||||
|
{{CTX_NA, CTX_NA}, {1, 62}, {5, 52}, {5, 57}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -6, 86}, {6, 69}, { -6, 93}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -17, 95}, { -13, 90}, { -14, 88}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -6, 61}, {0, 52}, { -6, 44}},
|
||||||
|
{{CTX_NA, CTX_NA}, {9, 45}, {8, 43}, {4, 55}},
|
||||||
|
//40-53 Table 9-15
|
||||||
|
{{CTX_NA, CTX_NA}, { -3, 69}, { -2, 69}, { -11, 89}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -6, 81}, { -5, 82}, { -15, 103}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -11, 96}, { -10, 96}, { -21, 116}},
|
||||||
|
{{CTX_NA, CTX_NA}, {6, 55}, {2, 59}, {19, 57}},
|
||||||
|
{{CTX_NA, CTX_NA}, {7, 67}, {2, 75}, {20, 58}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -5, 86}, { -3, 87}, {4, 84}},
|
||||||
|
{{CTX_NA, CTX_NA}, {2, 88}, { -3, 100}, {6, 96}},
|
||||||
|
{{CTX_NA, CTX_NA}, {0, 58}, {1, 56}, {1, 63}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -3, 76}, { -3, 74}, { -5, 85}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -10, 94}, { -6, 85}, { -13, 106}},
|
||||||
|
{{CTX_NA, CTX_NA}, {5, 54}, {0, 59}, {5, 63}},
|
||||||
|
{{CTX_NA, CTX_NA}, {4, 69}, { -3, 81}, {6, 75}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -3, 81}, { -7, 86}, { -3, 90}},
|
||||||
|
{{CTX_NA, CTX_NA}, {0, 88}, { -5, 95}, { -1, 101}},
|
||||||
|
//54-59 Table 9-16
|
||||||
|
{{CTX_NA, CTX_NA}, { -7, 67}, { -1, 66}, {3, 55}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -5, 74}, { -1, 77}, { -4, 79}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -4, 74}, {1, 70}, { -2, 75}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -5, 80}, { -2, 86}, { -12, 97}},
|
||||||
|
{{CTX_NA, CTX_NA}, { -7, 72}, { -5, 72}, { -7, 50}},
|
||||||
|
{{CTX_NA, CTX_NA}, {1, 58}, {0, 61}, {1, 60}},
|
||||||
|
//60-69 Table 9-17
|
||||||
|
{{0, 41}, {0, 41}, {0, 41}, {0, 41}},
|
||||||
|
{{0, 63}, {0, 63}, {0, 63}, {0, 63}},
|
||||||
|
{{0, 63}, {0, 63}, {0, 63}, {0, 63}},
|
||||||
|
{{0, 63}, {0, 63}, {0, 63}, {0, 63}},
|
||||||
|
{{ -9, 83}, { -9, 83}, { -9, 83}, { -9, 83}},
|
||||||
|
{{4, 86}, {4, 86}, {4, 86}, {4, 86}},
|
||||||
|
{{0, 97}, {0, 97}, {0, 97}, {0, 97}},
|
||||||
|
{{ -7, 72}, { -7, 72}, { -7, 72}, { -7, 72}},
|
||||||
|
{{13, 41}, {13, 41}, {13, 41}, {13, 41}},
|
||||||
|
{{3, 62}, {3, 62}, {3, 62}, {3, 62}},
|
||||||
|
//70-104 Table 9-18
|
||||||
|
{{0, 11}, {0, 45}, {13, 15}, {7, 34}},
|
||||||
|
{{1, 55}, { -4, 78}, {7, 51}, { -9, 88}},
|
||||||
|
{{0, 69}, { -3, 96}, {2, 80}, { -20, 127}},
|
||||||
|
{{ -17, 127}, { -27, 126}, { -39, 127}, { -36, 127}},
|
||||||
|
{{ -13, 102}, { -28, 98}, { -18, 91}, { -17, 91}},
|
||||||
|
{{0, 82}, { -25, 101}, { -17, 96}, { -14, 95}},
|
||||||
|
{{ -7, 74}, { -23, 67}, { -26, 81}, { -25, 84}},
|
||||||
|
{{ -21, 107}, { -28, 82}, { -35, 98}, { -25, 86}},
|
||||||
|
{{ -27, 127}, { -20, 94}, { -24, 102}, { -12, 89}},
|
||||||
|
{{ -31, 127}, { -16, 83}, { -23, 97}, { -17, 91}},
|
||||||
|
{{ -24, 127}, { -22, 110}, { -27, 119}, { -31, 127}},
|
||||||
|
{{ -18, 95}, { -21, 91}, { -24, 99}, { -14, 76}},
|
||||||
|
{{ -27, 127}, { -18, 102}, { -21, 110}, { -18, 103}},
|
||||||
|
{{ -21, 114}, { -13, 93}, { -18, 102}, { -13, 90}},
|
||||||
|
{{ -30, 127}, { -29, 127}, { -36, 127}, { -37, 127}},
|
||||||
|
{{ -17, 123}, { -7, 92}, {0, 80}, {11, 80}},
|
||||||
|
{{ -12, 115}, { -5, 89}, { -5, 89}, {5, 76}},
|
||||||
|
{{ -16, 122}, { -7, 96}, { -7, 94}, {2, 84}},
|
||||||
|
{{ -11, 115}, { -13, 108}, { -4, 92}, {5, 78}},
|
||||||
|
{{ -12, 63}, { -3, 46}, {0, 39}, { -6, 55}},
|
||||||
|
{{ -2, 68}, { -1, 65}, {0, 65}, {4, 61}},
|
||||||
|
{{ -15, 84}, { -1, 57}, { -15, 84}, { -14, 83}},
|
||||||
|
{{ -13, 104}, { -9, 93}, { -35, 127}, { -37, 127}},
|
||||||
|
{{ -3, 70}, { -3, 74}, { -2, 73}, { -5, 79}},
|
||||||
|
{{ -8, 93}, { -9, 92}, { -12, 104}, { -11, 104}},
|
||||||
|
{{ -10, 90}, { -8, 87}, { -9, 91}, { -11, 91}},
|
||||||
|
{{ -30, 127}, { -23, 126}, { -31, 127}, { -30, 127}},
|
||||||
|
{{ -1, 74}, {5, 54}, {3, 55}, {0, 65}},
|
||||||
|
{{ -6, 97}, {6, 60}, {7, 56}, { -2, 79}},
|
||||||
|
{{ -7, 91}, {6, 59}, {7, 55}, {0, 72}},
|
||||||
|
{{ -20, 127}, {6, 69}, {8, 61}, { -4, 92}},
|
||||||
|
{{ -4, 56}, { -1, 48}, { -3, 53}, { -6, 56}},
|
||||||
|
{{ -5, 82}, {0, 68}, {0, 68}, {3, 68}},
|
||||||
|
{{ -7, 76}, { -4, 69}, { -7, 74}, { -8, 71}},
|
||||||
|
{{ -22, 125}, { -8, 88}, { -9, 88}, { -13, 98}},
|
||||||
|
//105-165 Table 9-19
|
||||||
|
{{ -7, 93}, { -2, 85}, { -13, 103}, { -4, 86}},
|
||||||
|
{{ -11, 87}, { -6, 78}, { -13, 91}, { -12, 88}},
|
||||||
|
{{ -3, 77}, { -1, 75}, { -9, 89}, { -5, 82}},
|
||||||
|
{{ -5, 71}, { -7, 77}, { -14, 92}, { -3, 72}},
|
||||||
|
{{ -4, 63}, {2, 54}, { -8, 76}, { -4, 67}},
|
||||||
|
{{ -4, 68}, {5, 50}, { -12, 87}, { -8, 72}},
|
||||||
|
{{ -12, 84}, { -3, 68}, { -23, 110}, { -16, 89}},
|
||||||
|
{{ -7, 62}, {1, 50}, { -24, 105}, { -9, 69}},
|
||||||
|
{{ -7, 65}, {6, 42}, { -10, 78}, { -1, 59}},
|
||||||
|
{{8, 61}, { -4, 81}, { -20, 112}, {5, 66}},
|
||||||
|
{{5, 56}, {1, 63}, { -17, 99}, {4, 57}},
|
||||||
|
{{ -2, 66}, { -4, 70}, { -78, 127}, { -4, 71}},
|
||||||
|
{{1, 64}, {0, 67}, { -70, 127}, { -2, 71}},
|
||||||
|
{{0, 61}, {2, 57}, { -50, 127}, {2, 58}},
|
||||||
|
{{ -2, 78}, { -2, 76}, { -46, 127}, { -1, 74}},
|
||||||
|
{{1, 50}, {11, 35}, { -4, 66}, { -4, 44}},
|
||||||
|
{{7, 52}, {4, 64}, { -5, 78}, { -1, 69}},
|
||||||
|
{{10, 35}, {1, 61}, { -4, 71}, {0, 62}},
|
||||||
|
{{0, 44}, {11, 35}, { -8, 72}, { -7, 51}},
|
||||||
|
{{11, 38}, {18, 25}, {2, 59}, { -4, 47}},
|
||||||
|
{{1, 45}, {12, 24}, { -1, 55}, { -6, 42}},
|
||||||
|
{{0, 46}, {13, 29}, { -7, 70}, { -3, 41}},
|
||||||
|
{{5, 44}, {13, 36}, { -6, 75}, { -6, 53}},
|
||||||
|
{{31, 17}, { -10, 93}, { -8, 89}, {8, 76}},
|
||||||
|
{{1, 51}, { -7, 73}, { -34, 119}, { -9, 78}},
|
||||||
|
{{7, 50}, { -2, 73}, { -3, 75}, { -11, 83}},
|
||||||
|
{{28, 19}, {13, 46}, {32, 20}, {9, 52}},
|
||||||
|
{{16, 33}, {9, 49}, {30, 22}, {0, 67}},
|
||||||
|
{{14, 62}, { -7, 100}, { -44, 127}, { -5, 90}},
|
||||||
|
{{ -13, 108}, {9, 53}, {0, 54}, {1, 67}},
|
||||||
|
{{ -15, 100}, {2, 53}, { -5, 61}, { -15, 72}},
|
||||||
|
{{ -13, 101}, {5, 53}, {0, 58}, { -5, 75}},
|
||||||
|
{{ -13, 91}, { -2, 61}, { -1, 60}, { -8, 80}},
|
||||||
|
{{ -12, 94}, {0, 56}, { -3, 61}, { -21, 83}},
|
||||||
|
{{ -10, 88}, {0, 56}, { -8, 67}, { -21, 64}},
|
||||||
|
{{ -16, 84}, { -13, 63}, { -25, 84}, { -13, 31}},
|
||||||
|
{{ -10, 86}, { -5, 60}, { -14, 74}, { -25, 64}},
|
||||||
|
{{ -7, 83}, { -1, 62}, { -5, 65}, { -29, 94}},
|
||||||
|
{{ -13, 87}, {4, 57}, {5, 52}, {9, 75}},
|
||||||
|
{{ -19, 94}, { -6, 69}, {2, 57}, {17, 63}},
|
||||||
|
{{1, 70}, {4, 57}, {0, 61}, { -8, 74}},
|
||||||
|
{{0, 72}, {14, 39}, { -9, 69}, { -5, 35}},
|
||||||
|
{{ -5, 74}, {4, 51}, { -11, 70}, { -2, 27}},
|
||||||
|
{{18, 59}, {13, 68}, {18, 55}, {13, 91}},
|
||||||
|
{{ -8, 102}, {3, 64}, { -4, 71}, {3, 65}},
|
||||||
|
{{ -15, 100}, {1, 61}, {0, 58}, { -7, 69}},
|
||||||
|
{{0, 95}, {9, 63}, {7, 61}, {8, 77}},
|
||||||
|
{{ -4, 75}, {7, 50}, {9, 41}, { -10, 66}},
|
||||||
|
{{2, 72}, {16, 39}, {18, 25}, {3, 62}},
|
||||||
|
{{ -11, 75}, {5, 44}, {9, 32}, { -3, 68}},
|
||||||
|
{{ -3, 71}, {4, 52}, {5, 43}, { -20, 81}},
|
||||||
|
{{15, 46}, {11, 48}, {9, 47}, {0, 30}},
|
||||||
|
{{ -13, 69}, { -5, 60}, {0, 44}, {1, 7}},
|
||||||
|
{{0, 62}, { -1, 59}, {0, 51}, { -3, 23}},
|
||||||
|
{{0, 65}, {0, 59}, {2, 46}, { -21, 74}},
|
||||||
|
{{21, 37}, {22, 33}, {19, 38}, {16, 66}},
|
||||||
|
{{ -15, 72}, {5, 44}, { -4, 66}, { -23, 124}},
|
||||||
|
{{9, 57}, {14, 43}, {15, 38}, {17, 37}},
|
||||||
|
{{16, 54}, { -1, 78}, {12, 42}, {44, -18}},
|
||||||
|
{{0, 62}, {0, 60}, {9, 34}, {50, -34}},
|
||||||
|
{{12, 72}, {9, 69}, {0, 89}, { -22, 127}},
|
||||||
|
//166-226 Table 9-20
|
||||||
|
{{24, 0}, {11, 28}, {4, 45}, {4, 39}},
|
||||||
|
{{15, 9}, {2, 40}, {10, 28}, {0, 42}},
|
||||||
|
{{8, 25}, {3, 44}, {10, 31}, {7, 34}},
|
||||||
|
{{13, 18}, {0, 49}, {33, -11}, {11, 29}},
|
||||||
|
{{15, 9}, {0, 46}, {52, -43}, {8, 31}},
|
||||||
|
{{13, 19}, {2, 44}, {18, 15}, {6, 37}},
|
||||||
|
{{10, 37}, {2, 51}, {28, 0}, {7, 42}},
|
||||||
|
{{12, 18}, {0, 47}, {35, -22}, {3, 40}},
|
||||||
|
{{6, 29}, {4, 39}, {38, -25}, {8, 33}},
|
||||||
|
{{20, 33}, {2, 62}, {34, 0}, {13, 43}},
|
||||||
|
{{15, 30}, {6, 46}, {39, -18}, {13, 36}},
|
||||||
|
{{4, 45}, {0, 54}, {32, -12}, {4, 47}},
|
||||||
|
{{1, 58}, {3, 54}, {102, -94}, {3, 55}},
|
||||||
|
{{0, 62}, {2, 58}, {0, 0}, {2, 58}},
|
||||||
|
{{7, 61}, {4, 63}, {56, -15}, {6, 60}},
|
||||||
|
{{12, 38}, {6, 51}, {33, -4}, {8, 44}},
|
||||||
|
{{11, 45}, {6, 57}, {29, 10}, {11, 44}},
|
||||||
|
{{15, 39}, {7, 53}, {37, -5}, {14, 42}},
|
||||||
|
{{11, 42}, {6, 52}, {51, -29}, {7, 48}},
|
||||||
|
{{13, 44}, {6, 55}, {39, -9}, {4, 56}},
|
||||||
|
{{16, 45}, {11, 45}, {52, -34}, {4, 52}},
|
||||||
|
{{12, 41}, {14, 36}, {69, -58}, {13, 37}},
|
||||||
|
{{10, 49}, {8, 53}, {67, -63}, {9, 49}},
|
||||||
|
{{30, 34}, { -1, 82}, {44, -5}, {19, 58}},
|
||||||
|
{{18, 42}, {7, 55}, {32, 7}, {10, 48}},
|
||||||
|
{{10, 55}, { -3, 78}, {55, -29}, {12, 45}},
|
||||||
|
{{17, 51}, {15, 46}, {32, 1}, {0, 69}},
|
||||||
|
{{17, 46}, {22, 31}, {0, 0}, {20, 33}},
|
||||||
|
{{0, 89}, { -1, 84}, {27, 36}, {8, 63}},
|
||||||
|
{{26, -19}, {25, 7}, {33, -25}, {35, -18}},
|
||||||
|
{{22, -17}, {30, -7}, {34, -30}, {33, -25}},
|
||||||
|
{{26, -17}, {28, 3}, {36, -28}, {28, -3}},
|
||||||
|
{{30, -25}, {28, 4}, {38, -28}, {24, 10}},
|
||||||
|
{{28, -20}, {32, 0}, {38, -27}, {27, 0}},
|
||||||
|
{{33, -23}, {34, -1}, {34, -18}, {34, -14}},
|
||||||
|
{{37, -27}, {30, 6}, {35, -16}, {52, -44}},
|
||||||
|
{{33, -23}, {30, 6}, {34, -14}, {39, -24}},
|
||||||
|
{{40, -28}, {32, 9}, {32, -8}, {19, 17}},
|
||||||
|
{{38, -17}, {31, 19}, {37, -6}, {31, 25}},
|
||||||
|
{{33, -11}, {26, 27}, {35, 0}, {36, 29}},
|
||||||
|
{{40, -15}, {26, 30}, {30, 10}, {24, 33}},
|
||||||
|
{{41, -6}, {37, 20}, {28, 18}, {34, 15}},
|
||||||
|
{{38, 1}, {28, 34}, {26, 25}, {30, 20}},
|
||||||
|
{{41, 17}, {17, 70}, {29, 41}, {22, 73}},
|
||||||
|
{{30, -6}, {1, 67}, {0, 75}, {20, 34}},
|
||||||
|
{{27, 3}, {5, 59}, {2, 72}, {19, 31}},
|
||||||
|
{{26, 22}, {9, 67}, {8, 77}, {27, 44}},
|
||||||
|
{{37, -16}, {16, 30}, {14, 35}, {19, 16}},
|
||||||
|
{{35, -4}, {18, 32}, {18, 31}, {15, 36}},
|
||||||
|
{{38, -8}, {18, 35}, {17, 35}, {15, 36}},
|
||||||
|
{{38, -3}, {22, 29}, {21, 30}, {21, 28}},
|
||||||
|
{{37, 3}, {24, 31}, {17, 45}, {25, 21}},
|
||||||
|
{{38, 5}, {23, 38}, {20, 42}, {30, 20}},
|
||||||
|
{{42, 0}, {18, 43}, {18, 45}, {31, 12}},
|
||||||
|
{{35, 16}, {20, 41}, {27, 26}, {27, 16}},
|
||||||
|
{{39, 22}, {11, 63}, {16, 54}, {24, 42}},
|
||||||
|
{{14, 48}, {9, 59}, {7, 66}, {0, 93}},
|
||||||
|
{{27, 37}, {9, 64}, {16, 56}, {14, 56}},
|
||||||
|
{{21, 60}, { -1, 94}, {11, 73}, {15, 57}},
|
||||||
|
{{12, 68}, { -2, 89}, {10, 67}, {26, 38}},
|
||||||
|
{{2, 97}, { -9, 108}, { -10, 116}, { -24, 127}},
|
||||||
|
//227-275 Table 9-21
|
||||||
|
{{ -3, 71}, { -6, 76}, { -23, 112}, { -24, 115}},
|
||||||
|
{{ -6, 42}, { -2, 44}, { -15, 71}, { -22, 82}},
|
||||||
|
{{ -5, 50}, {0, 45}, { -7, 61}, { -9, 62}},
|
||||||
|
{{ -3, 54}, {0, 52}, {0, 53}, {0, 53}},
|
||||||
|
{{ -2, 62}, { -3, 64}, { -5, 66}, {0, 59}},
|
||||||
|
{{0, 58}, { -2, 59}, { -11, 77}, { -14, 85}},
|
||||||
|
{{1, 63}, { -4, 70}, { -9, 80}, { -13, 89}},
|
||||||
|
{{ -2, 72}, { -4, 75}, { -9, 84}, { -13, 94}},
|
||||||
|
{{ -1, 74}, { -8, 82}, { -10, 87}, { -11, 92}},
|
||||||
|
{{ -9, 91}, { -17, 102}, { -34, 127}, { -29, 127}},
|
||||||
|
{{ -5, 67}, { -9, 77}, { -21, 101}, { -21, 100}},
|
||||||
|
{{ -5, 27}, {3, 24}, { -3, 39}, { -14, 57}},
|
||||||
|
{{ -3, 39}, {0, 42}, { -5, 53}, { -12, 67}},
|
||||||
|
{{ -2, 44}, {0, 48}, { -7, 61}, { -11, 71}},
|
||||||
|
{{0, 46}, {0, 55}, { -11, 75}, { -10, 77}},
|
||||||
|
{{ -16, 64}, { -6, 59}, { -15, 77}, { -21, 85}},
|
||||||
|
{{ -8, 68}, { -7, 71}, { -17, 91}, { -16, 88}},
|
||||||
|
{{ -10, 78}, { -12, 83}, { -25, 107}, { -23, 104}},
|
||||||
|
{{ -6, 77}, { -11, 87}, { -25, 111}, { -15, 98}},
|
||||||
|
{{ -10, 86}, { -30, 119}, { -28, 122}, { -37, 127}},
|
||||||
|
{{ -12, 92}, {1, 58}, { -11, 76}, { -10, 82}},
|
||||||
|
{{ -15, 55}, { -3, 29}, { -10, 44}, { -8, 48}},
|
||||||
|
{{ -10, 60}, { -1, 36}, { -10, 52}, { -8, 61}},
|
||||||
|
{{ -6, 62}, {1, 38}, { -10, 57}, { -8, 66}},
|
||||||
|
{{ -4, 65}, {2, 43}, { -9, 58}, { -7, 70}},
|
||||||
|
{{ -12, 73}, { -6, 55}, { -16, 72}, { -14, 75}},
|
||||||
|
{{ -8, 76}, {0, 58}, { -7, 69}, { -10, 79}},
|
||||||
|
{{ -7, 80}, {0, 64}, { -4, 69}, { -9, 83}},
|
||||||
|
{{ -9, 88}, { -3, 74}, { -5, 74}, { -12, 92}},
|
||||||
|
{{ -17, 110}, { -10, 90}, { -9, 86}, { -18, 108}},
|
||||||
|
{{ -11, 97}, {0, 70}, {2, 66}, { -4, 79}},
|
||||||
|
{{ -20, 84}, { -4, 29}, { -9, 34}, { -22, 69}},
|
||||||
|
{{ -11, 79}, {5, 31}, {1, 32}, { -16, 75}},
|
||||||
|
{{ -6, 73}, {7, 42}, {11, 31}, { -2, 58}},
|
||||||
|
{{ -4, 74}, {1, 59}, {5, 52}, {1, 58}},
|
||||||
|
{{ -13, 86}, { -2, 58}, { -2, 55}, { -13, 78}},
|
||||||
|
{{ -13, 96}, { -3, 72}, { -2, 67}, { -9, 83}},
|
||||||
|
{{ -11, 97}, { -3, 81}, {0, 73}, { -4, 81}},
|
||||||
|
{{ -19, 117}, { -11, 97}, { -8, 89}, { -13, 99}},
|
||||||
|
{{ -8, 78}, {0, 58}, {3, 52}, { -13, 81}},
|
||||||
|
{{ -5, 33}, {8, 5}, {7, 4}, { -6, 38}},
|
||||||
|
{{ -4, 48}, {10, 14}, {10, 8}, { -13, 62}},
|
||||||
|
{{ -2, 53}, {14, 18}, {17, 8}, { -6, 58}},
|
||||||
|
{{ -3, 62}, {13, 27}, {16, 19}, { -2, 59}},
|
||||||
|
{{ -13, 71}, {2, 40}, {3, 37}, { -16, 73}},
|
||||||
|
{{ -10, 79}, {0, 58}, { -1, 61}, { -10, 76}},
|
||||||
|
{{ -12, 86}, { -3, 70}, { -5, 73}, { -13, 86}},
|
||||||
|
{{ -13, 90}, { -6, 79}, { -1, 70}, { -9, 83}},
|
||||||
|
{{ -14, 97}, { -8, 85}, { -4, 78}, { -10, 87}},
|
||||||
|
//276 no use
|
||||||
|
{{CTX_NA, CTX_NA}, {CTX_NA, CTX_NA}, {CTX_NA, CTX_NA}, {CTX_NA, CTX_NA}},
|
||||||
|
//277-337 Table 9-22
|
||||||
|
{{ -6, 93}, { -13, 106}, { -21, 126}, { -22, 127}},
|
||||||
|
{{ -6, 84}, { -16, 106}, { -23, 124}, { -25, 127}},
|
||||||
|
{{ -8, 79}, { -10, 87}, { -20, 110}, { -25, 120}},
|
||||||
|
{{0, 66}, { -21, 114}, { -26, 126}, { -27, 127}},
|
||||||
|
{{ -1, 71}, { -18, 110}, { -25, 124}, { -19, 114}},
|
||||||
|
{{0, 62}, { -14, 98}, { -17, 105}, { -23, 117}},
|
||||||
|
{{ -2, 60}, { -22, 110}, { -27, 121}, { -25, 118}},
|
||||||
|
{{ -2, 59}, { -21, 106}, { -27, 117}, { -26, 117}},
|
||||||
|
{{ -5, 75}, { -18, 103}, { -17, 102}, { -24, 113}},
|
||||||
|
{{ -3, 62}, { -21, 107}, { -26, 117}, { -28, 118}},
|
||||||
|
{{ -4, 58}, { -23, 108}, { -27, 116}, { -31, 120}},
|
||||||
|
{{ -9, 66}, { -26, 112}, { -33, 122}, { -37, 124}},
|
||||||
|
{{ -1, 79}, { -10, 96}, { -10, 95}, { -10, 94}},
|
||||||
|
{{0, 71}, { -12, 95}, { -14, 100}, { -15, 102}},
|
||||||
|
{{3, 68}, { -5, 91}, { -8, 95}, { -10, 99}},
|
||||||
|
{{10, 44}, { -9, 93}, { -17, 111}, { -13, 106}},
|
||||||
|
{{ -7, 62}, { -22, 94}, { -28, 114}, { -50, 127}},
|
||||||
|
{{15, 36}, { -5, 86}, { -6, 89}, { -5, 92}},
|
||||||
|
{{14, 40}, {9, 67}, { -2, 80}, {17, 57}},
|
||||||
|
{{16, 27}, { -4, 80}, { -4, 82}, { -5, 86}},
|
||||||
|
{{12, 29}, { -10, 85}, { -9, 85}, { -13, 94}},
|
||||||
|
{{1, 44}, { -1, 70}, { -8, 81}, { -12, 91}},
|
||||||
|
{{20, 36}, {7, 60}, { -1, 72}, { -2, 77}},
|
||||||
|
{{18, 32}, {9, 58}, {5, 64}, {0, 71}},
|
||||||
|
{{5, 42}, {5, 61}, {1, 67}, { -1, 73}},
|
||||||
|
{{1, 48}, {12, 50}, {9, 56}, {4, 64}},
|
||||||
|
{{10, 62}, {15, 50}, {0, 69}, { -7, 81}},
|
||||||
|
{{17, 46}, {18, 49}, {1, 69}, {5, 64}},
|
||||||
|
{{9, 64}, {17, 54}, {7, 69}, {15, 57}},
|
||||||
|
{{ -12, 104}, {10, 41}, { -7, 69}, {1, 67}},
|
||||||
|
{{ -11, 97}, {7, 46}, { -6, 67}, {0, 68}},
|
||||||
|
{{ -16, 96}, { -1, 51}, { -16, 77}, { -10, 67}},
|
||||||
|
{{ -7, 88}, {7, 49}, { -2, 64}, {1, 68}},
|
||||||
|
{{ -8, 85}, {8, 52}, {2, 61}, {0, 77}},
|
||||||
|
{{ -7, 85}, {9, 41}, { -6, 67}, {2, 64}},
|
||||||
|
{{ -9, 85}, {6, 47}, { -3, 64}, {0, 68}},
|
||||||
|
{{ -13, 88}, {2, 55}, {2, 57}, { -5, 78}},
|
||||||
|
{{4, 66}, {13, 41}, { -3, 65}, {7, 55}},
|
||||||
|
{{ -3, 77}, {10, 44}, { -3, 66}, {5, 59}},
|
||||||
|
{{ -3, 76}, {6, 50}, {0, 62}, {2, 65}},
|
||||||
|
{{ -6, 76}, {5, 53}, {9, 51}, {14, 54}},
|
||||||
|
{{10, 58}, {13, 49}, { -1, 66}, {15, 44}},
|
||||||
|
{{ -1, 76}, {4, 63}, { -2, 71}, {5, 60}},
|
||||||
|
{{ -1, 83}, {6, 64}, { -2, 75}, {2, 70}},
|
||||||
|
{{ -7, 99}, { -2, 69}, { -1, 70}, { -2, 76}},
|
||||||
|
{{ -14, 95}, { -2, 59}, { -9, 72}, { -18, 86}},
|
||||||
|
{{2, 95}, {6, 70}, {14, 60}, {12, 70}},
|
||||||
|
{{0, 76}, {10, 44}, {16, 37}, {5, 64}},
|
||||||
|
{{ -5, 74}, {9, 31}, {0, 47}, { -12, 70}},
|
||||||
|
{{0, 70}, {12, 43}, {18, 35}, {11, 55}},
|
||||||
|
{{ -11, 75}, {3, 53}, {11, 37}, {5, 56}},
|
||||||
|
{{1, 68}, {14, 34}, {12, 41}, {0, 69}},
|
||||||
|
{{0, 65}, {10, 38}, {10, 41}, {2, 65}},
|
||||||
|
{{ -14, 73}, { -3, 52}, {2, 48}, { -6, 74}},
|
||||||
|
{{3, 62}, {13, 40}, {12, 41}, {5, 54}},
|
||||||
|
{{4, 62}, {17, 32}, {13, 41}, {7, 54}},
|
||||||
|
{{ -1, 68}, {7, 44}, {0, 59}, { -6, 76}},
|
||||||
|
{{ -13, 75}, {7, 38}, {3, 50}, { -11, 82}},
|
||||||
|
{{11, 55}, {13, 50}, {19, 40}, { -2, 77}},
|
||||||
|
{{5, 64}, {10, 57}, {3, 66}, { -2, 77}},
|
||||||
|
{{12, 70}, {26, 43}, {18, 50}, {25, 42}},
|
||||||
|
//338-398 Table9-23
|
||||||
|
{{15, 6}, {14, 11}, {19, -6}, {17, -13}},
|
||||||
|
{{6, 19}, {11, 14}, {18, -6}, {16, -9}},
|
||||||
|
{{7, 16}, {9, 11}, {14, 0}, {17, -12}},
|
||||||
|
{{12, 14}, {18, 11}, {26, -12}, {27, -21}},
|
||||||
|
{{18, 13}, {21, 9}, {31, -16}, {37, -30}},
|
||||||
|
{{13, 11}, {23, -2}, {33, -25}, {41, -40}},
|
||||||
|
{{13, 15}, {32, -15}, {33, -22}, {42, -41}},
|
||||||
|
{{15, 16}, {32, -15}, {37, -28}, {48, -47}},
|
||||||
|
{{12, 23}, {34, -21}, {39, -30}, {39, -32}},
|
||||||
|
{{13, 23}, {39, -23}, {42, -30}, {46, -40}},
|
||||||
|
{{15, 20}, {42, -33}, {47, -42}, {52, -51}},
|
||||||
|
{{14, 26}, {41, -31}, {45, -36}, {46, -41}},
|
||||||
|
{{14, 44}, {46, -28}, {49, -34}, {52, -39}},
|
||||||
|
{{17, 40}, {38, -12}, {41, -17}, {43, -19}},
|
||||||
|
{{17, 47}, {21, 29}, {32, 9}, {32, 11}},
|
||||||
|
{{24, 17}, {45, -24}, {69, -71}, {61, -55}},
|
||||||
|
{{21, 21}, {53, -45}, {63, -63}, {56, -46}},
|
||||||
|
{{25, 22}, {48, -26}, {66, -64}, {62, -50}},
|
||||||
|
{{31, 27}, {65, -43}, {77, -74}, {81, -67}},
|
||||||
|
{{22, 29}, {43, -19}, {54, -39}, {45, -20}},
|
||||||
|
{{19, 35}, {39, -10}, {52, -35}, {35, -2}},
|
||||||
|
{{14, 50}, {30, 9}, {41, -10}, {28, 15}},
|
||||||
|
{{10, 57}, {18, 26}, {36, 0}, {34, 1}},
|
||||||
|
{{7, 63}, {20, 27}, {40, -1}, {39, 1}},
|
||||||
|
{{ -2, 77}, {0, 57}, {30, 14}, {30, 17}},
|
||||||
|
{{ -4, 82}, { -14, 82}, {28, 26}, {20, 38}},
|
||||||
|
{{ -3, 94}, { -5, 75}, {23, 37}, {18, 45}},
|
||||||
|
{{9, 69}, { -19, 97}, {12, 55}, {15, 54}},
|
||||||
|
{{ -12, 109}, { -35, 125}, {11, 65}, {0, 79}},
|
||||||
|
{{36, -35}, {27, 0}, {37, -33}, {36, -16}},
|
||||||
|
{{36, -34}, {28, 0}, {39, -36}, {37, -14}},
|
||||||
|
{{32, -26}, {31, -4}, {40, -37}, {37, -17}},
|
||||||
|
{{37, -30}, {27, 6}, {38, -30}, {32, 1}},
|
||||||
|
{{44, -32}, {34, 8}, {46, -33}, {34, 15}},
|
||||||
|
{{34, -18}, {30, 10}, {42, -30}, {29, 15}},
|
||||||
|
{{34, -15}, {24, 22}, {40, -24}, {24, 25}},
|
||||||
|
{{40, -15}, {33, 19}, {49, -29}, {34, 22}},
|
||||||
|
{{33, -7}, {22, 32}, {38, -12}, {31, 16}},
|
||||||
|
{{35, -5}, {26, 31}, {40, -10}, {35, 18}},
|
||||||
|
{{33, 0}, {21, 41}, {38, -3}, {31, 28}},
|
||||||
|
{{38, 2}, {26, 44}, {46, -5}, {33, 41}},
|
||||||
|
{{33, 13}, {23, 47}, {31, 20}, {36, 28}},
|
||||||
|
{{23, 35}, {16, 65}, {29, 30}, {27, 47}},
|
||||||
|
{{13, 58}, {14, 71}, {25, 44}, {21, 62}},
|
||||||
|
{{29, -3}, {8, 60}, {12, 48}, {18, 31}},
|
||||||
|
{{26, 0}, {6, 63}, {11, 49}, {19, 26}},
|
||||||
|
{{22, 30}, {17, 65}, {26, 45}, {36, 24}},
|
||||||
|
{{31, -7}, {21, 24}, {22, 22}, {24, 23}},
|
||||||
|
{{35, -15}, {23, 20}, {23, 22}, {27, 16}},
|
||||||
|
{{34, -3}, {26, 23}, {27, 21}, {24, 30}},
|
||||||
|
{{34, 3}, {27, 32}, {33, 20}, {31, 29}},
|
||||||
|
{{36, -1}, {28, 23}, {26, 28}, {22, 41}},
|
||||||
|
{{34, 5}, {28, 24}, {30, 24}, {22, 42}},
|
||||||
|
{{32, 11}, {23, 40}, {27, 34}, {16, 60}},
|
||||||
|
{{35, 5}, {24, 32}, {18, 42}, {15, 52}},
|
||||||
|
{{34, 12}, {28, 29}, {25, 39}, {14, 60}},
|
||||||
|
{{39, 11}, {23, 42}, {18, 50}, {3, 78}},
|
||||||
|
{{30, 29}, {19, 57}, {12, 70}, { -16, 123}},
|
||||||
|
{{34, 26}, {22, 53}, {21, 54}, {21, 53}},
|
||||||
|
{{29, 39}, {22, 61}, {14, 71}, {22, 56}},
|
||||||
|
{{19, 66}, {11, 86}, {11, 83}, {25, 61}},
|
||||||
|
{{31, 21}, {12, 40}, {25, 32}, {21, 33}},
|
||||||
|
{{31, 31}, {11, 51}, {21, 49}, {19, 50}},
|
||||||
|
{{25, 50}, {14, 59}, {21, 54}, {17, 61}},
|
||||||
|
//402-459 Table 9-24
|
||||||
|
{{ -17, 120}, { -4, 79}, { -5, 85}, { -3, 78}},
|
||||||
|
{{ -20, 112}, { -7, 71}, { -6, 81}, { -8, 74}},
|
||||||
|
{{ -18, 114}, { -5, 69}, { -10, 77}, { -9, 72}},
|
||||||
|
{{ -11, 85}, { -9, 70}, { -7, 81}, { -10, 72}},
|
||||||
|
{{ -15, 92}, { -8, 66}, { -17, 80}, { -18, 75}},
|
||||||
|
{{ -14, 89}, { -10, 68}, { -18, 73}, { -12, 71}},
|
||||||
|
{{ -26, 71}, { -19, 73}, { -4, 74}, { -11, 63}},
|
||||||
|
{{ -15, 81}, { -12, 69}, { -10, 83}, { -5, 70}},
|
||||||
|
{{ -14, 80}, { -16, 70}, { -9, 71}, { -17, 75}},
|
||||||
|
{{0, 68}, { -15, 67}, { -9, 67}, { -14, 72}},
|
||||||
|
{{ -14, 70}, { -20, 62}, { -1, 61}, { -16, 67}},
|
||||||
|
{{ -24, 56}, { -19, 70}, { -8, 66}, { -8, 53}},
|
||||||
|
{{ -23, 68}, { -16, 66}, { -14, 66}, { -14, 59}},
|
||||||
|
{{ -24, 50}, { -22, 65}, {0, 59}, { -9, 52}},
|
||||||
|
{{ -11, 74}, { -20, 63}, {2, 59}, { -11, 68}},
|
||||||
|
{{23, -13}, {9, -2}, {17, -10}, {9, -2}},
|
||||||
|
{{26, -13}, {26, -9}, {32, -13}, {30, -10}},
|
||||||
|
{{40, -15}, {33, -9}, {42, -9}, {31, -4}},
|
||||||
|
{{49, -14}, {39, -7}, {49, -5}, {33, -1}},
|
||||||
|
{{44, 3}, {41, -2}, {53, 0}, {33, 7}},
|
||||||
|
{{45, 6}, {45, 3}, {64, 3}, {31, 12}},
|
||||||
|
{{44, 34}, {49, 9}, {68, 10}, {37, 23}},
|
||||||
|
{{33, 54}, {45, 27}, {66, 27}, {31, 38}},
|
||||||
|
{{19, 82}, {36, 59}, {47, 57}, {20, 64}},
|
||||||
|
{{ -3, 75}, { -6, 66}, { -5, 71}, { -9, 71}},
|
||||||
|
{{ -1, 23}, { -7, 35}, {0, 24}, { -7, 37}},
|
||||||
|
{{1, 34}, { -7, 42}, { -1, 36}, { -8, 44}},
|
||||||
|
{{1, 43}, { -8, 45}, { -2, 42}, { -11, 49}},
|
||||||
|
{{0, 54}, { -5, 48}, { -2, 52}, { -10, 56}},
|
||||||
|
{{ -2, 55}, { -12, 56}, { -9, 57}, { -12, 59}},
|
||||||
|
{{0, 61}, { -6, 60}, { -6, 63}, { -8, 63}},
|
||||||
|
{{1, 64}, { -5, 62}, { -4, 65}, { -9, 67}},
|
||||||
|
{{0, 68}, { -8, 66}, { -4, 67}, { -6, 68}},
|
||||||
|
{{ -9, 92}, { -8, 76}, { -7, 82}, { -10, 79}},
|
||||||
|
{{ -14, 106}, { -5, 85}, { -3, 81}, { -3, 78}},
|
||||||
|
{{ -13, 97}, { -6, 81}, { -3, 76}, { -8, 74}},
|
||||||
|
{{ -15, 90}, { -10, 77}, { -7, 72}, { -9, 72}},
|
||||||
|
{{ -12, 90}, { -7, 81}, { -6, 78}, { -10, 72}},
|
||||||
|
{{ -18, 88}, { -17, 80}, { -12, 72}, { -18, 75}},
|
||||||
|
{{ -10, 73}, { -18, 73}, { -14, 68}, { -12, 71}},
|
||||||
|
{{ -9, 79}, { -4, 74}, { -3, 70}, { -11, 63}},
|
||||||
|
{{ -14, 86}, { -10, 83}, { -6, 76}, { -5, 70}},
|
||||||
|
{{ -10, 73}, { -9, 71}, { -5, 66}, { -17, 75}},
|
||||||
|
{{ -10, 70}, { -9, 67}, { -5, 62}, { -14, 72}},
|
||||||
|
{{ -10, 69}, { -1, 61}, {0, 57}, { -16, 67}},
|
||||||
|
{{ -5, 66}, { -8, 66}, { -4, 61}, { -8, 53}},
|
||||||
|
{{ -9, 64}, { -14, 66}, { -9, 60}, { -14, 59}},
|
||||||
|
{{ -5, 58}, {0, 59}, {1, 54}, { -9, 52}},
|
||||||
|
{{2, 59}, {2, 59}, {2, 58}, { -11, 68}},
|
||||||
|
{{21, -10}, {21, -13}, {17, -10}, {9, -2}},
|
||||||
|
{{24, -11}, {33, -14}, {32, -13}, {30, -10}},
|
||||||
|
{{28, -8}, {39, -7}, {42, -9}, {31, -4}},
|
||||||
|
{{28, -1}, {46, -2}, {49, -5}, {33, -1}},
|
||||||
|
{{29, 3}, {51, 2}, {53, 0}, {33, 7}},
|
||||||
|
{{29, 9}, {60, 6}, {64, 3}, {31, 12}},
|
||||||
|
{{35, 20}, {61, 17}, {68, 10}, {37, 23}},
|
||||||
|
{{29, 36}, {55, 34}, {66, 27}, {31, 38}},
|
||||||
|
{{14, 67}, {42, 62}, {47, 57}, {20, 64}},
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Table 9-44 – Specification of rangeTabLPS depending on pStateIdx and qCodIRangeIdx */
|
||||||
|
|
||||||
|
const uint8_t g_kuiCabacRangeLps[64][4] = {
|
||||||
|
{ 128, 176, 208, 240}, { 128, 167, 197, 227}, { 128, 158, 187, 216}, { 123, 150, 178, 205}, { 116, 142, 169, 195}, { 111, 135, 160, 185}, { 105, 128, 152, 175}, { 100, 122, 144, 166},
|
||||||
|
{ 95, 116, 137, 158}, { 90, 110, 130, 150}, { 85, 104, 123, 142}, { 81, 99, 117, 135}, { 77, 94, 111, 128}, { 73, 89, 105, 122}, { 69, 85, 100, 116}, { 66, 80, 95, 110},
|
||||||
|
{ 62, 76, 90, 104}, { 59, 72, 86, 99}, { 56, 69, 81, 94}, { 53, 65, 77, 89}, { 51, 62, 73, 85}, { 48, 59, 69, 80}, { 46, 56, 66, 76}, { 43, 53, 63, 72},
|
||||||
|
{ 41, 50, 59, 69}, { 39, 48, 56, 65}, { 37, 45, 54, 62}, { 35, 43, 51, 59}, { 33, 41, 48, 56}, { 32, 39, 46, 53}, { 30, 37, 43, 50}, { 29, 35, 41, 48},
|
||||||
|
{ 27, 33, 39, 45}, { 26, 31, 37, 43}, { 24, 30, 35, 41}, { 23, 28, 33, 39}, { 22, 27, 32, 37}, { 21, 26, 30, 35}, { 20, 24, 29, 33}, { 19, 23, 27, 31},
|
||||||
|
{ 18, 22, 26, 30}, { 17, 21, 25, 28}, { 16, 20, 23, 27}, { 15, 19, 22, 25}, { 14, 18, 21, 24}, { 14, 17, 20, 23}, { 13, 16, 19, 22}, { 12, 15, 18, 21},
|
||||||
|
{ 12, 14, 17, 20}, { 11, 14, 16, 19}, { 11, 13, 15, 18}, { 10, 12, 15, 17}, { 10, 12, 14, 16}, { 9, 11, 13, 15}, { 9, 11, 12, 14}, { 8, 10, 12, 14},
|
||||||
|
{ 8, 9, 11, 13}, { 7, 9, 11, 12}, { 7, 9, 10, 12}, { 7, 8, 10, 11}, { 6, 8, 9, 11}, { 6, 7, 9, 10}, { 6, 7, 8, 9}, { 2, 2, 2, 2}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Table 9-45 – State transition table*/
|
||||||
|
|
||||||
|
const uint8_t g_kuiStateTransTable[64][2] = {
|
||||||
|
|
||||||
|
{0, 1}, {0, 2}, {1, 3}, {2, 4}, {2, 5}, {4, 6}, {4, 7}, {5, 8}, {6, 9}, {7, 10},
|
||||||
|
|
||||||
|
{8, 11}, {9, 12}, {9, 13}, {11, 14}, {11, 15}, {12, 16}, {13, 17}, {13, 18}, {15, 19}, {15, 20},
|
||||||
|
|
||||||
|
{16, 21}, {16, 22}, {18, 23}, {18, 24}, {19, 25}, {19, 26}, {21, 27}, {21, 28}, {22, 29}, {22, 30},
|
||||||
|
|
||||||
|
{23, 31}, {24, 32}, {24, 33}, {25, 34}, {26, 35}, {26, 36}, {27, 37}, {27, 38}, {28, 39}, {29, 40},
|
||||||
|
|
||||||
|
{29, 41}, {30, 42}, {30, 43}, {30, 44}, {31, 45}, {32, 46}, {32, 47}, {33, 48}, {33, 49}, {33, 50},
|
||||||
|
|
||||||
|
{34, 51}, {34, 52}, {35, 53}, {35, 54}, {35, 55}, {36, 56}, {36, 57}, {36, 58}, {37, 59}, {37, 60},
|
||||||
|
|
||||||
|
{37, 61}, {38, 62}, {38, 62}, {63, 63}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "deblocking_common.h"
|
#include "deblocking_common.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
// C code only
|
// C code only
|
||||||
void DeblockLumaLt4_c (uint8_t* pPix, int32_t iStrideX, int32_t iStrideY, int32_t iAlpha, int32_t iBeta,
|
void DeblockLumaLt4_c (uint8_t* pPix, int32_t iStrideX, int32_t iStrideY, int32_t iAlpha, int32_t iBeta,
|
||||||
int8_t* pTc) {
|
int8_t* pTc) {
|
||||||
@@ -180,6 +181,77 @@ void DeblockChromaEq4H_c (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int
|
|||||||
DeblockChromaEq4_c (pPixCb, pPixCr, 1, iStride, iAlpha, iBeta);
|
DeblockChromaEq4_c (pPixCb, pPixCr, 1, iStride, iAlpha, iBeta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeblockChromaLt42_c (uint8_t* pPixCbCr, int32_t iStrideX, int32_t iStrideY, int32_t iAlpha,
|
||||||
|
int32_t iBeta, int8_t* pTc) {
|
||||||
|
int32_t p0, p1, q0, q1, iDeta;
|
||||||
|
bool bDetaP0Q0, bDetaP1P0, bDetaQ1Q0;
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < 8; i++) {
|
||||||
|
int32_t iTc0 = pTc[i >> 1];
|
||||||
|
if (iTc0 > 0) {
|
||||||
|
p0 = pPixCbCr[-iStrideX];
|
||||||
|
p1 = pPixCbCr[-2 * iStrideX];
|
||||||
|
q0 = pPixCbCr[0];
|
||||||
|
q1 = pPixCbCr[iStrideX];
|
||||||
|
|
||||||
|
bDetaP0Q0 = WELS_ABS (p0 - q0) < iAlpha;
|
||||||
|
bDetaP1P0 = WELS_ABS (p1 - p0) < iBeta;
|
||||||
|
bDetaQ1Q0 = WELS_ABS (q1 - q0) < iBeta;
|
||||||
|
if (bDetaP0Q0 && bDetaP1P0 && bDetaQ1Q0) {
|
||||||
|
iDeta = WELS_CLIP3 ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3, -iTc0, iTc0);
|
||||||
|
pPixCbCr[-iStrideX] = WelsClip1 (p0 + iDeta); /* p0' */
|
||||||
|
pPixCbCr[0] = WelsClip1 (q0 - iDeta); /* q0' */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
pPixCbCr += iStrideY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void DeblockChromaEq42_c (uint8_t* pPixCbCr, int32_t iStrideX, int32_t iStrideY, int32_t iAlpha,
|
||||||
|
int32_t iBeta) {
|
||||||
|
int32_t p0, p1, q0, q1;
|
||||||
|
bool bDetaP0Q0, bDetaP1P0, bDetaQ1Q0;
|
||||||
|
for (int32_t i = 0; i < 8; i++) {
|
||||||
|
p0 = pPixCbCr[-iStrideX];
|
||||||
|
p1 = pPixCbCr[-2 * iStrideX];
|
||||||
|
q0 = pPixCbCr[0];
|
||||||
|
q1 = pPixCbCr[iStrideX];
|
||||||
|
bDetaP0Q0 = WELS_ABS (p0 - q0) < iAlpha;
|
||||||
|
bDetaP1P0 = WELS_ABS (p1 - p0) < iBeta;
|
||||||
|
bDetaQ1Q0 = WELS_ABS (q1 - q0) < iBeta;
|
||||||
|
if (bDetaP0Q0 && bDetaP1P0 && bDetaQ1Q0) {
|
||||||
|
pPixCbCr[-iStrideX] = ((p1 << 1) + p0 + q1 + 2) >> 2; /* p0' */
|
||||||
|
pPixCbCr[0] = ((q1 << 1) + q0 + p1 + 2) >> 2; /* q0' */
|
||||||
|
}
|
||||||
|
|
||||||
|
pPixCbCr += iStrideY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeblockChromaLt4V2_c (uint8_t* pPixCbCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
|
int8_t* tc) {
|
||||||
|
DeblockChromaLt42_c (pPixCbCr, iStride, 1, iAlpha, iBeta, tc);
|
||||||
|
}
|
||||||
|
void DeblockChromaLt4H2_c (uint8_t* pPixCbCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
|
int8_t* tc) {
|
||||||
|
|
||||||
|
DeblockChromaLt42_c (pPixCbCr, 1, iStride, iAlpha, iBeta, tc);
|
||||||
|
}
|
||||||
|
void DeblockChromaEq4V2_c (uint8_t* pPixCbCr, int32_t iStride, int32_t iAlpha, int32_t iBeta) {
|
||||||
|
DeblockChromaEq42_c (pPixCbCr, iStride, 1, iAlpha, iBeta);
|
||||||
|
}
|
||||||
|
void DeblockChromaEq4H2_c (uint8_t* pPixCbCr, int32_t iStride, int32_t iAlpha, int32_t iBeta) {
|
||||||
|
DeblockChromaEq42_c (pPixCbCr, 1, iStride, iAlpha, iBeta);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WelsNonZeroCount_c (int8_t* pNonZeroCount) {
|
||||||
|
int32_t i;
|
||||||
|
for (i = 0; i < 24; i++) {
|
||||||
|
pNonZeroCount[i] = !!pNonZeroCount[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef X86_ASM
|
#ifdef X86_ASM
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void DeblockLumaLt4H_ssse3 (uint8_t* pPixY, int32_t iStride, int32_t iAlpha, int32_t iBeta, int8_t* pTc) {
|
void DeblockLumaLt4H_ssse3 (uint8_t* pPixY, int32_t iStride, int32_t iAlpha, int32_t iBeta, int8_t* pTc) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* \copy
|
* \copy
|
||||||
* Copyright (c) 2013, Cisco Systems
|
* Copyright (c) 2009-2013, Cisco Systems
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -28,12 +28,21 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
*
|
||||||
|
* \file get_intra_predictor.c
|
||||||
|
*
|
||||||
|
* \brief implementation for get intra predictor about 16x16, 4x4, chroma.
|
||||||
|
*
|
||||||
|
* \date 4/2/2009 Created
|
||||||
|
* 9/14/2009 C level based optimization with high performance gained.
|
||||||
|
* [const, using ST32/ST64 to replace memset, memcpy and memmove etc.]
|
||||||
|
*
|
||||||
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "ls_defines.h"
|
#include "ls_defines.h"
|
||||||
|
#include "cpu_core.h"
|
||||||
|
#include "intra_pred_common.h"
|
||||||
|
|
||||||
WELSVP_NAMESPACE_BEGIN
|
|
||||||
|
|
||||||
void WelsI16x16LumaPredV_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) {
|
void WelsI16x16LumaPredV_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) {
|
||||||
uint8_t i = 15;
|
uint8_t i = 15;
|
||||||
@@ -66,4 +75,3 @@ void WelsI16x16LumaPredH_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStrid
|
|||||||
} while (i-- > 0);
|
} while (i-- > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WELSVP_NAMESPACE_END
|
|
||||||
@@ -41,8 +41,17 @@
|
|||||||
#include "mc.h"
|
#include "mc.h"
|
||||||
|
|
||||||
#include "cpu_core.h"
|
#include "cpu_core.h"
|
||||||
|
#include "ls_defines.h"
|
||||||
|
#include "macros.h"
|
||||||
|
|
||||||
namespace WelsDec {
|
typedef void (*PMcChromaWidthExtFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
const uint8_t* kpABCD, int32_t iHeight);
|
||||||
|
typedef void (*PWelsSampleWidthAveragingFunc) (uint8_t*, int32_t, const uint8_t*, int32_t, const uint8_t*,
|
||||||
|
int32_t, int32_t);
|
||||||
|
typedef void (*PWelsMcWidthHeightFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight);
|
||||||
|
|
||||||
|
namespace WelsCommon {
|
||||||
|
|
||||||
/*------------------weight for chroma fraction pixel interpolation------------------*/
|
/*------------------weight for chroma fraction pixel interpolation------------------*/
|
||||||
//iA = (8 - dx) * (8 - dy);
|
//iA = (8 - dx) * (8 - dy);
|
||||||
@@ -84,9 +93,6 @@ static const uint8_t g_kuiABCD[8][8][4] = { //g_kA[dy][dx], g_kB[dy][dx], g_kC[d
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*PWelsMcWidthHeightFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
|
||||||
int32_t iWidth, int32_t iHeight);
|
|
||||||
|
|
||||||
//***************************************************************************//
|
//***************************************************************************//
|
||||||
// C code implementation //
|
// C code implementation //
|
||||||
//***************************************************************************//
|
//***************************************************************************//
|
||||||
@@ -133,10 +139,10 @@ static inline void McCopyWidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, u
|
|||||||
|
|
||||||
//--------------------Luma sample MC------------------//
|
//--------------------Luma sample MC------------------//
|
||||||
|
|
||||||
static inline int32_t HorFilterInput16bit_c (int16_t* pSrc) {
|
static inline int32_t HorFilterInput16bit_c (const int16_t* pSrc) {
|
||||||
int32_t iPix05 = pSrc[-2] + pSrc[3];
|
int32_t iPix05 = pSrc[0] + pSrc[5];
|
||||||
int32_t iPix14 = pSrc[-1] + pSrc[2];
|
int32_t iPix14 = pSrc[1] + pSrc[4];
|
||||||
int32_t iPix23 = pSrc[ 0] + pSrc[1];
|
int32_t iPix23 = pSrc[2] + pSrc[3];
|
||||||
|
|
||||||
return (iPix05 - (iPix14 * 5) + (iPix23 * 20));
|
return (iPix05 - (iPix14 * 5) + (iPix23 * 20));
|
||||||
}
|
}
|
||||||
@@ -176,6 +182,7 @@ static inline void McCopy_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* p
|
|||||||
McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//horizontal filter to gain half sample, that is (2, 0) location in quarter sample
|
||||||
static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
int32_t iWidth,
|
int32_t iWidth,
|
||||||
int32_t iHeight) {
|
int32_t iHeight) {
|
||||||
@@ -189,6 +196,7 @@ static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//vertical filter to gain half sample, that is (0, 2) location in quarter sample
|
||||||
static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
int32_t iWidth,
|
int32_t iWidth,
|
||||||
int32_t iHeight) {
|
int32_t iHeight) {
|
||||||
@@ -202,10 +210,11 @@ static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//horizontal and vertical filter to gain half sample, that is (2, 2) location in quarter sample
|
||||||
static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
int32_t iWidth,
|
int32_t iWidth,
|
||||||
int32_t iHeight) {
|
int32_t iHeight) {
|
||||||
int16_t iTmp[16 + 5]; //16
|
int16_t iTmp[17 + 5];
|
||||||
int32_t i, j, k;
|
int32_t i, j, k;
|
||||||
|
|
||||||
for (i = 0; i < iHeight; i++) {
|
for (i = 0; i < iHeight; i++) {
|
||||||
@@ -213,7 +222,7 @@ static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_
|
|||||||
iTmp[j] = FilterInput8bitWithStride_c (pSrc - 2 + j, iSrcStride);
|
iTmp[j] = FilterInput8bitWithStride_c (pSrc - 2 + j, iSrcStride);
|
||||||
}
|
}
|
||||||
for (k = 0; k < iWidth; k++) {
|
for (k = 0; k < iWidth; k++) {
|
||||||
pDst[k] = WelsClip1 ((HorFilterInput16bit_c (&iTmp[2 + k]) + 512) >> 10);
|
pDst[k] = WelsClip1 ((HorFilterInput16bit_c (&iTmp[k]) + 512) >> 10);
|
||||||
}
|
}
|
||||||
pSrc += iSrcStride;
|
pSrc += iSrcStride;
|
||||||
pDst += iDstStride;
|
pDst += iDstStride;
|
||||||
@@ -390,6 +399,14 @@ static inline void McHorVer22WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt
|
|||||||
McHorVer22WidthEq8_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
McHorVer22WidthEq8_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
McHorVer22WidthEq8_sse2 (&pSrc[8], iSrcStride, &pDst[8], iDstStride, iHeight);
|
McHorVer22WidthEq8_sse2 (&pSrc[8], iSrcStride, &pDst[8], iDstStride, iHeight);
|
||||||
}
|
}
|
||||||
|
void McHorVer22Width9Or17Height9Or17_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight) {
|
||||||
|
ENFORCE_STACK_ALIGN_2D (int16_t, pTap, 22, 24, 16)
|
||||||
|
int32_t tmp1 = 2 * (iWidth - 8);
|
||||||
|
McHorVer22HorFirst_sse2 (pSrc - 2, iSrcStride, (uint8_t*)pTap, 48, iWidth, iHeight + 5);
|
||||||
|
McHorVer22Width8VerLastAlign_sse2 ((uint8_t*)pTap, 48, pDst, iDstStride, iWidth - 1, iHeight);
|
||||||
|
McHorVer22Width8VerLastUnAlign_sse2 ((uint8_t*)pTap + tmp1, 48, pDst + iWidth - 8, iDstStride, 8, iHeight);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void McCopy_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
static inline void McCopy_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
int32_t iWidth,
|
int32_t iWidth,
|
||||||
@@ -667,19 +684,69 @@ void McChroma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int3
|
|||||||
McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
|
McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void McChroma_ssse3 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
|
||||||
|
static const PMcChromaWidthExtFunc kpMcChromaWidthFuncs[2] = {
|
||||||
|
McChromaWidthEq4_mmx,
|
||||||
|
McChromaWidthEq8_ssse3
|
||||||
|
};
|
||||||
|
const int32_t kiD8x = iMvX & 0x07;
|
||||||
|
const int32_t kiD8y = iMvY & 0x07;
|
||||||
|
if (kiD8x == 0 && kiD8y == 0) {
|
||||||
|
McCopy_sse2 (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (iWidth != 2) {
|
||||||
|
kpMcChromaWidthFuncs[iWidth >> 3] (pSrc, iSrcStride, pDst, iDstStride, g_kuiABCD[kiD8y][kiD8x], iHeight);
|
||||||
|
} else
|
||||||
|
McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PixelAvg_sse2 (uint8_t* pDst, int32_t iDstStride, const uint8_t* pSrcA, int32_t iSrcAStride,
|
||||||
|
const uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) {
|
||||||
|
static const PWelsSampleWidthAveragingFunc kpfFuncs[2] = {
|
||||||
|
PixelAvgWidthEq8_mmx,
|
||||||
|
PixelAvgWidthEq16_sse2
|
||||||
|
};
|
||||||
|
kpfFuncs[iWidth >> 4] (pDst, iDstStride, pSrcA, iSrcAStride, pSrcB, iSrcBStride, iHeight);
|
||||||
|
}
|
||||||
|
|
||||||
#endif //X86_ASM
|
#endif //X86_ASM
|
||||||
//***************************************************************************//
|
//***************************************************************************//
|
||||||
// NEON implementation //
|
// NEON implementation //
|
||||||
//***************************************************************************//
|
//***************************************************************************//
|
||||||
#if defined(HAVE_NEON)
|
#if defined(HAVE_NEON)
|
||||||
|
void McHorVer20Width9Or17_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight) {
|
||||||
|
if (iWidth == 17)
|
||||||
|
McHorVer20Width17_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
else //if (iWidth == 9)
|
||||||
|
McHorVer20Width9_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
}
|
||||||
|
void McHorVer02Height9Or17_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight) {
|
||||||
|
if (iWidth == 16)
|
||||||
|
McHorVer02Height17_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
else //if (iWidth == 8)
|
||||||
|
McHorVer02Height9_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
}
|
||||||
|
void McHorVer22Width9Or17Height9Or17_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight) {
|
||||||
|
if (iWidth == 17)
|
||||||
|
McHorVer22Width17_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
else //if (iWidth == 9)
|
||||||
|
McHorVer22Width9_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
}
|
||||||
void McCopy_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
void McCopy_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
int32_t iWidth, int32_t iHeight) {
|
int32_t iWidth, int32_t iHeight) {
|
||||||
if (16 == iWidth)
|
if (16 == iWidth)
|
||||||
McCopyWidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
McCopyWidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
else if (8 == iWidth)
|
else if (8 == iWidth)
|
||||||
McCopyWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
McCopyWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
else
|
else if (4 == iWidth)
|
||||||
McCopyWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
McCopyWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
else
|
||||||
|
McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
}
|
}
|
||||||
void McHorVer20_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
void McHorVer20_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
int32_t iWidth, int32_t iHeight) {
|
int32_t iWidth, int32_t iHeight) {
|
||||||
@@ -921,16 +988,48 @@ void McChroma_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int3
|
|||||||
McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
|
McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void PixelAvg_neon (uint8_t* pDst, int32_t iDstStride, const uint8_t* pSrcA, int32_t iSrcAStride,
|
||||||
|
const uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) {
|
||||||
|
static const PWelsSampleWidthAveragingFunc kpfFuncs[2] = {
|
||||||
|
PixStrideAvgWidthEq8_neon,
|
||||||
|
PixStrideAvgWidthEq16_neon
|
||||||
|
};
|
||||||
|
kpfFuncs[iWidth >> 4] (pDst, iDstStride, pSrcA, iSrcAStride, pSrcB, iSrcBStride, iHeight);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_NEON_AARCH64)
|
#if defined(HAVE_NEON_AARCH64)
|
||||||
|
void McHorVer20Width9Or17_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight) {
|
||||||
|
if (iWidth == 17)
|
||||||
|
McHorVer20Width17_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
else //if (iWidth == 9)
|
||||||
|
McHorVer20Width9_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
}
|
||||||
|
void McHorVer02Height9Or17_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight) {
|
||||||
|
if (iWidth == 16)
|
||||||
|
McHorVer02Height17_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
else //if (iWidth == 8)
|
||||||
|
McHorVer02Height9_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
}
|
||||||
|
void McHorVer22Width9Or17Height9Or17_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst,
|
||||||
|
int32_t iDstStride,
|
||||||
|
int32_t iWidth, int32_t iHeight) {
|
||||||
|
if (iWidth == 17)
|
||||||
|
McHorVer22Width17_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
else //if (iWidth == 9)
|
||||||
|
McHorVer22Width9_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
}
|
||||||
void McCopy_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
void McCopy_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
int32_t iWidth, int32_t iHeight) {
|
int32_t iWidth, int32_t iHeight) {
|
||||||
if (16 == iWidth)
|
if (16 == iWidth)
|
||||||
McCopyWidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
McCopyWidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
else if (8 == iWidth)
|
else if (8 == iWidth)
|
||||||
McCopyWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
McCopyWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
else
|
else if (4 == iWidth)
|
||||||
McCopyWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
McCopyWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
|
else
|
||||||
|
McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight);
|
||||||
}
|
}
|
||||||
void McHorVer20_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
void McHorVer20_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
||||||
int32_t iWidth, int32_t iHeight) {
|
int32_t iWidth, int32_t iHeight) {
|
||||||
@@ -1172,30 +1271,58 @@ void McChroma_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pD
|
|||||||
McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
|
McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void PixelAvg_AArch64_neon (uint8_t* pDst, int32_t iDstStride, const uint8_t* pSrcA, int32_t iSrcAStride,
|
||||||
|
const uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) {
|
||||||
|
static const PWelsSampleWidthAveragingFunc kpfFuncs[2] = {
|
||||||
|
PixStrideAvgWidthEq8_AArch64_neon,
|
||||||
|
PixStrideAvgWidthEq16_AArch64_neon
|
||||||
|
};
|
||||||
|
kpfFuncs[iWidth >> 4] (pDst, iDstStride, pSrcA, iSrcAStride, pSrcB, iSrcBStride, iHeight);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void InitMcFunc (SMcFunc* pMcFunc, int32_t iCpu) {
|
void InitMcFunc (SMcFunc* pMcFuncs, uint32_t uiCpuFlag) {
|
||||||
pMcFunc->pMcLumaFunc = McLuma_c;
|
pMcFuncs->pfLumaHalfpelHor = McHorVer20_c;
|
||||||
pMcFunc->pMcChromaFunc = McChroma_c;
|
pMcFuncs->pfLumaHalfpelVer = McHorVer02_c;
|
||||||
|
pMcFuncs->pfLumaHalfpelCen = McHorVer22_c;
|
||||||
|
pMcFuncs->pfSampleAveraging = PixelAvg_c;
|
||||||
|
pMcFuncs->pMcChromaFunc = McChroma_c;
|
||||||
|
pMcFuncs->pMcLumaFunc = McLuma_c;
|
||||||
|
|
||||||
#ifdef HAVE_NEON
|
|
||||||
if (iCpu & WELS_CPU_NEON) {
|
|
||||||
pMcFunc->pMcLumaFunc = McLuma_neon;
|
|
||||||
pMcFunc->pMcChromaFunc = McChroma_neon;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_NEON_AARCH64
|
|
||||||
if (iCpu & WELS_CPU_NEON) {
|
|
||||||
pMcFunc->pMcLumaFunc = McLuma_AArch64_neon;
|
|
||||||
pMcFunc->pMcChromaFunc = McChroma_AArch64_neon;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if defined (X86_ASM)
|
#if defined (X86_ASM)
|
||||||
if (iCpu & WELS_CPU_SSE2) {
|
if (uiCpuFlag & WELS_CPU_SSE2) {
|
||||||
pMcFunc->pMcLumaFunc = McLuma_sse2;
|
pMcFuncs->pfLumaHalfpelHor = McHorVer20Width9Or17_sse2;
|
||||||
pMcFunc->pMcChromaFunc = McChroma_sse2;
|
pMcFuncs->pfLumaHalfpelVer = McHorVer02Height9Or17_sse2;
|
||||||
|
pMcFuncs->pfLumaHalfpelCen = McHorVer22Width9Or17Height9Or17_sse2;
|
||||||
|
pMcFuncs->pfSampleAveraging = PixelAvg_sse2;
|
||||||
|
pMcFuncs->pMcChromaFunc = McChroma_sse2;
|
||||||
|
pMcFuncs->pMcLumaFunc = McLuma_sse2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uiCpuFlag & WELS_CPU_SSSE3) {
|
||||||
|
pMcFuncs->pMcChromaFunc = McChroma_ssse3;
|
||||||
}
|
}
|
||||||
#endif //(X86_ASM)
|
#endif //(X86_ASM)
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace WelsDec
|
#if defined(HAVE_NEON)
|
||||||
|
if (uiCpuFlag & WELS_CPU_NEON) {
|
||||||
|
pMcFuncs->pMcLumaFunc = McLuma_neon;
|
||||||
|
pMcFuncs->pMcChromaFunc = McChroma_neon;
|
||||||
|
pMcFuncs->pfSampleAveraging = PixelAvg_neon;
|
||||||
|
pMcFuncs->pfLumaHalfpelHor = McHorVer20Width9Or17_neon;//iWidth+1:8/16
|
||||||
|
pMcFuncs->pfLumaHalfpelVer = McHorVer02Height9Or17_neon;//heigh+1:8/16
|
||||||
|
pMcFuncs->pfLumaHalfpelCen = McHorVer22Width9Or17Height9Or17_neon;//iWidth+1/heigh+1
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_NEON_AARCH64)
|
||||||
|
if (uiCpuFlag & WELS_CPU_NEON) {
|
||||||
|
pMcFuncs->pMcLumaFunc = McLuma_AArch64_neon;
|
||||||
|
pMcFuncs->pMcChromaFunc = McChroma_AArch64_neon;
|
||||||
|
pMcFuncs->pfSampleAveraging = PixelAvg_AArch64_neon;
|
||||||
|
pMcFuncs->pfLumaHalfpelHor = McHorVer20Width9Or17_AArch64_neon;//iWidth+1:8/16
|
||||||
|
pMcFuncs->pfLumaHalfpelVer = McHorVer02Height9Or17_AArch64_neon;//heigh+1:8/16
|
||||||
|
pMcFuncs->pfLumaHalfpelCen = McHorVer22Width9Or17Height9Or17_AArch64_neon;//iWidth+1/heigh+1
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
} // namespace WelsCommon
|
||||||
@@ -35,7 +35,13 @@
|
|||||||
#include "memory_align.h"
|
#include "memory_align.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
namespace WelsEnc {
|
namespace WelsCommon {
|
||||||
|
|
||||||
|
#ifdef MEMORY_CHECK
|
||||||
|
static FILE* fpMemChkPoint;
|
||||||
|
static uint32_t nCountRequestNum;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
CMemoryAlign::CMemoryAlign (const uint32_t kuiCacheLineSize)
|
CMemoryAlign::CMemoryAlign (const uint32_t kuiCacheLineSize)
|
||||||
#ifdef MEMORY_MONITOR
|
#ifdef MEMORY_MONITOR
|
||||||
@@ -46,24 +52,66 @@ CMemoryAlign::CMemoryAlign (const uint32_t kuiCacheLineSize)
|
|||||||
m_nCacheLineSize = 0x10;
|
m_nCacheLineSize = 0x10;
|
||||||
else
|
else
|
||||||
m_nCacheLineSize = kuiCacheLineSize;
|
m_nCacheLineSize = kuiCacheLineSize;
|
||||||
|
|
||||||
#ifdef MEMORY_CHECK
|
|
||||||
m_fpMemChkPoint = fopen ("./enc_mem_check_point.txt", "wt+");
|
|
||||||
m_nCountRequestNum = 0;
|
|
||||||
#endif//MEMORY_CHECK
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CMemoryAlign::~CMemoryAlign() {
|
CMemoryAlign::~CMemoryAlign() {
|
||||||
#ifdef MEMORY_MONITOR
|
#ifdef MEMORY_MONITOR
|
||||||
assert (m_nMemoryUsageInBytes == 0);
|
assert (m_nMemoryUsageInBytes == 0);
|
||||||
#endif//MEMORY_MONITOR
|
#endif//MEMORY_MONITOR
|
||||||
|
}
|
||||||
|
|
||||||
|
void* WelsMalloc (const uint32_t kuiSize, const char* kpTag, const uint32_t kiAlign) {
|
||||||
|
const int32_t kiSizeOfVoidPointer = sizeof (void**);
|
||||||
|
const int32_t kiSizeOfInt = sizeof (int32_t);
|
||||||
|
const int32_t kiAlignedBytes = kiAlign - 1;
|
||||||
|
const int32_t kiTrialRequestedSize = kuiSize + kiAlignedBytes + kiSizeOfVoidPointer + kiSizeOfInt;
|
||||||
|
const int32_t kiActualRequestedSize = kiTrialRequestedSize;
|
||||||
|
const uint32_t kiPayloadSize = kuiSize;
|
||||||
|
|
||||||
|
uint8_t* pBuf = (uint8_t*) malloc (kiActualRequestedSize);
|
||||||
#ifdef MEMORY_CHECK
|
#ifdef MEMORY_CHECK
|
||||||
fclose (m_fpMemChkPoint);
|
if (fpMemChkPoint == NULL) {
|
||||||
m_fpMemChkPoint = NULL;
|
m_fpMemChkPoint = fopen ("./enc_mem_check_point.txt", "at+");
|
||||||
|
m_nCountRequestNum = 0;
|
||||||
|
}
|
||||||
|
|
||||||
m_nCountRequestNum = 0;
|
if (fpMemChkPoint != NULL) {
|
||||||
#endif//MEMORY_CHECK
|
if (kpTag != NULL)
|
||||||
|
fprintf (fpMemChkPoint, "WelsMalloc(), 0x%x : actual uiSize:\t%d\tbytes, input uiSize: %d bytes, %d - %s\n",
|
||||||
|
(void*)pBuf, kiActualRequestedSize, kuiSize, nCountRequestNum++, kpTag);
|
||||||
|
else
|
||||||
|
fprintf (fpMemChkPoint, "WelsMalloc(), 0x%x : actual uiSize:\t%d\tbytes, input uiSize: %d bytes, %d \n", (void*)pBuf,
|
||||||
|
kiActualRequestedSize, kuiSize, nCountRequestNum++);
|
||||||
|
fflush (fpMemChkPoint);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
uint8_t* pAlignedBuffer;
|
||||||
|
|
||||||
|
if (NULL == pBuf)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
pAlignedBuffer = pBuf + kiAlignedBytes + kiSizeOfVoidPointer + kiSizeOfInt;
|
||||||
|
pAlignedBuffer -= ((uintptr_t) pAlignedBuffer & kiAlignedBytes);
|
||||||
|
* ((void**) (pAlignedBuffer - kiSizeOfVoidPointer)) = pBuf;
|
||||||
|
* ((int32_t*) (pAlignedBuffer - (kiSizeOfVoidPointer + kiSizeOfInt))) = kiPayloadSize;
|
||||||
|
|
||||||
|
return pAlignedBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WelsFree (void* pPointer, const char* kpTag) {
|
||||||
|
if (pPointer) {
|
||||||
|
#ifdef MEMORY_CHECK
|
||||||
|
if (m_fpMemChkPoint != NULL) {
|
||||||
|
if (kpTag != NULL)
|
||||||
|
fprintf (fpMemChkPoint, "WelsFree(), 0x%x - %s: \t%d\t bytes \n", (void*) (* (((void**) pPointer) - 1)), kpTag,
|
||||||
|
kiMemoryLength);
|
||||||
|
else
|
||||||
|
fprintf (fpMemChkPoint, "WelsFree(), 0x%x \n", (void*) (* (((void**) pPointer) - 1)));
|
||||||
|
fflush (fpMemChkPoint);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
free (* (((void**) pPointer) - 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void* CMemoryAlign::WelsMallocz (const uint32_t kuiSize, const char* kpTag) {
|
void* CMemoryAlign::WelsMallocz (const uint32_t kuiSize, const char* kpTag) {
|
||||||
@@ -78,40 +126,15 @@ void* CMemoryAlign::WelsMallocz (const uint32_t kuiSize, const char* kpTag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void* CMemoryAlign::WelsMalloc (const uint32_t kuiSize, const char* kpTag) {
|
void* CMemoryAlign::WelsMalloc (const uint32_t kuiSize, const char* kpTag) {
|
||||||
const int32_t kiSizeOfVoidPointer = sizeof (void**);
|
void* pPointer = WelsCommon::WelsMalloc (kuiSize, kpTag, m_nCacheLineSize);
|
||||||
const int32_t kiSizeOfInt = sizeof (int32_t);
|
|
||||||
const int32_t kiAlignedBytes = m_nCacheLineSize - 1;
|
|
||||||
const int32_t kiTrialRequestedSize = kuiSize + kiAlignedBytes + kiSizeOfVoidPointer + kiSizeOfInt;
|
|
||||||
const int32_t kiActualRequestedSize = kiTrialRequestedSize;
|
|
||||||
const uint32_t kiPayloadSize = kuiSize;
|
|
||||||
|
|
||||||
uint8_t* pBuf = (uint8_t*) malloc (kiActualRequestedSize);
|
|
||||||
#ifdef MEMORY_CHECK
|
|
||||||
if (m_fpMemChkPoint != NULL) {
|
|
||||||
if (kpTag != NULL)
|
|
||||||
fprintf (m_fpMemChkPoint, "WelsMalloc(), 0x%x : actual uiSize:\t%d\tbytes, input uiSize: %d bytes, %d - %s\n",
|
|
||||||
(void*)pBuf, kiActualRequestedSize, kuiSize, m_nCountRequestNum++, kpTag);
|
|
||||||
else
|
|
||||||
fprintf (m_fpMemChkPoint, "WelsMalloc(), 0x%x : actual uiSize:\t%d\tbytes, input uiSize: %d bytes, %d \n", (void*)pBuf,
|
|
||||||
kiActualRequestedSize, kuiSize, m_nCountRequestNum++);
|
|
||||||
fflush (m_fpMemChkPoint);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
uint8_t* pAlignedBuffer;
|
|
||||||
|
|
||||||
if (NULL == pBuf)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
pAlignedBuffer = pBuf + kiAlignedBytes + kiSizeOfVoidPointer + kiSizeOfInt;
|
|
||||||
pAlignedBuffer -= ((uintptr_t) pAlignedBuffer & kiAlignedBytes);
|
|
||||||
* ((void**) (pAlignedBuffer - kiSizeOfVoidPointer)) = pBuf;
|
|
||||||
* ((int32_t*) (pAlignedBuffer - (kiSizeOfVoidPointer + kiSizeOfInt))) = kiPayloadSize;
|
|
||||||
|
|
||||||
#ifdef MEMORY_MONITOR
|
#ifdef MEMORY_MONITOR
|
||||||
m_nMemoryUsageInBytes += kiActualRequestedSize;
|
if (pPointer != NULL) {
|
||||||
|
const int32_t kiMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
|
||||||
|
int32_t))) + m_nCacheLineSize - 1 + sizeof (void**) + sizeof (int32_t);
|
||||||
|
m_nMemoryUsageInBytes += kiMemoryLength;
|
||||||
|
}
|
||||||
#endif//MEMORY_MONITOR
|
#endif//MEMORY_MONITOR
|
||||||
|
return pPointer;
|
||||||
return pAlignedBuffer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMemoryAlign::WelsFree (void* pPointer, const char* kpTag) {
|
void CMemoryAlign::WelsFree (void* pPointer, const char* kpTag) {
|
||||||
@@ -121,18 +144,17 @@ void CMemoryAlign::WelsFree (void* pPointer, const char* kpTag) {
|
|||||||
int32_t))) + m_nCacheLineSize - 1 + sizeof (void**) + sizeof (int32_t);
|
int32_t))) + m_nCacheLineSize - 1 + sizeof (void**) + sizeof (int32_t);
|
||||||
m_nMemoryUsageInBytes -= kiMemoryLength;
|
m_nMemoryUsageInBytes -= kiMemoryLength;
|
||||||
#endif//MEMORY_MONITOR
|
#endif//MEMORY_MONITOR
|
||||||
#ifdef MEMORY_CHECK
|
|
||||||
if (m_fpMemChkPoint != NULL) {
|
|
||||||
if (kpTag != NULL)
|
|
||||||
fprintf (m_fpMemChkPoint, "WelsFree(), 0x%x - %s: \t%d\t bytes \n", (void*) (* (((void**) pPointer) - 1)), kpTag,
|
|
||||||
kiMemoryLength);
|
|
||||||
else
|
|
||||||
fprintf (m_fpMemChkPoint, "WelsFree(), 0x%x \n", (void*) (* (((void**) pPointer) - 1)));
|
|
||||||
fflush (m_fpMemChkPoint);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
free (* (((void**) pPointer) - 1));
|
|
||||||
}
|
}
|
||||||
|
WelsCommon::WelsFree (pPointer, kpTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* WelsMallocz (const uint32_t kuiSize, const char* kpTag) {
|
||||||
|
void* pPointer = WelsMalloc (kuiSize, kpTag, 16);
|
||||||
|
if (NULL == pPointer) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
memset (pPointer, 0, kuiSize);
|
||||||
|
return pPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t CMemoryAlign::WelsGetCacheLineSize() const {
|
const uint32_t CMemoryAlign::WelsGetCacheLineSize() const {
|
||||||
@@ -143,4 +165,4 @@ const uint32_t CMemoryAlign::WelsGetMemoryUsage() const {
|
|||||||
return m_nMemoryUsageInBytes;
|
return m_nMemoryUsageInBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace WelsEnc
|
} // end of namespace WelsCommon
|
||||||
@@ -136,4 +136,4 @@ void WelsSampleSadFour4x4_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSamp
|
|||||||
* (pSad + 1) = WelsSampleSad4x4_c (iSample1, iStride1, (iSample2 + iStride2), iStride2);
|
* (pSad + 1) = WelsSampleSad4x4_c (iSample1, iStride1, (iSample2 + iStride2), iStride2);
|
||||||
* (pSad + 2) = WelsSampleSad4x4_c (iSample1, iStride1, (iSample2 - 1), iStride2);
|
* (pSad + 2) = WelsSampleSad4x4_c (iSample1, iStride1, (iSample2 - 1), iStride2);
|
||||||
* (pSad + 3) = WelsSampleSad4x4_c (iSample1, iStride1, (iSample2 + 1), iStride2);
|
* (pSad + 3) = WelsSampleSad4x4_c (iSample1, iStride1, (iSample2 + 1), iStride2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,22 +53,22 @@ void WelsLog (SLogContext* logCtx, int32_t iLevel, const char* kpFmt, ...) {
|
|||||||
char pTraceTag[MAX_LOG_SIZE];
|
char pTraceTag[MAX_LOG_SIZE];
|
||||||
switch (iLevel) {
|
switch (iLevel) {
|
||||||
case WELS_LOG_ERROR:
|
case WELS_LOG_ERROR:
|
||||||
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Error:");
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] this = 0x%p, Error:", logCtx->pCodecInstance);
|
||||||
break;
|
break;
|
||||||
case WELS_LOG_WARNING:
|
case WELS_LOG_WARNING:
|
||||||
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Warning:");
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] this = 0x%p, Warning:", logCtx->pCodecInstance);
|
||||||
break;
|
break;
|
||||||
case WELS_LOG_INFO:
|
case WELS_LOG_INFO:
|
||||||
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Info:");
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] this = 0x%p, Info:", logCtx->pCodecInstance);
|
||||||
break;
|
break;
|
||||||
case WELS_LOG_DEBUG:
|
case WELS_LOG_DEBUG:
|
||||||
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Debug:");
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] this = 0x%p, Debug:", logCtx->pCodecInstance);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Detail:");
|
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] this = 0x%p, Detail:", logCtx->pCodecInstance);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
WelsStrcat(pTraceTag,MAX_LOG_SIZE,kpFmt);
|
WelsStrcat (pTraceTag, MAX_LOG_SIZE, kpFmt);
|
||||||
va_start (vl, kpFmt);
|
va_start (vl, kpFmt);
|
||||||
logCtx->pfLog (logCtx->pLogCtx, iLevel, pTraceTag, vl);
|
logCtx->pfLog (logCtx->pLogCtx, iLevel, pTraceTag, vl);
|
||||||
va_end (vl);
|
va_end (vl);
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ welsCodecTrace::welsCodecTrace() {
|
|||||||
|
|
||||||
m_sLogCtx.pLogCtx = this;
|
m_sLogCtx.pLogCtx = this;
|
||||||
m_sLogCtx.pfLog = StaticCodecTrace;
|
m_sLogCtx.pfLog = StaticCodecTrace;
|
||||||
|
m_sLogCtx.pCodecInstance = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
welsCodecTrace::~welsCodecTrace() {
|
welsCodecTrace::~welsCodecTrace() {
|
||||||
@@ -78,8 +79,13 @@ void welsCodecTrace::CodecTrace (const int32_t iLevel, const char* Str_Format, v
|
|||||||
|
|
||||||
char pBuf[MAX_LOG_SIZE] = {0};
|
char pBuf[MAX_LOG_SIZE] = {0};
|
||||||
WelsVsnprintf (pBuf, MAX_LOG_SIZE, Str_Format, vl); // confirmed_safe_unsafe_usage
|
WelsVsnprintf (pBuf, MAX_LOG_SIZE, Str_Format, vl); // confirmed_safe_unsafe_usage
|
||||||
|
if (m_fpTrace) {
|
||||||
|
m_fpTrace (m_pTraceCtx, iLevel, pBuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_fpTrace (m_pTraceCtx, iLevel, pBuf);
|
void welsCodecTrace::SetCodecInstance (void* pCodecInstance) {
|
||||||
|
m_sLogCtx.pCodecInstance = pCodecInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void welsCodecTrace::SetTraceLevel (const int32_t iLevel) {
|
void welsCodecTrace::SetTraceLevel (const int32_t iLevel) {
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ COMMON_CPP_SRCS=\
|
|||||||
$(COMMON_SRCDIR)/src/crt_util_safe_x.cpp\
|
$(COMMON_SRCDIR)/src/crt_util_safe_x.cpp\
|
||||||
$(COMMON_SRCDIR)/src/deblocking_common.cpp\
|
$(COMMON_SRCDIR)/src/deblocking_common.cpp\
|
||||||
$(COMMON_SRCDIR)/src/expand_pic.cpp\
|
$(COMMON_SRCDIR)/src/expand_pic.cpp\
|
||||||
|
$(COMMON_SRCDIR)/src/intra_pred_common.cpp\
|
||||||
|
$(COMMON_SRCDIR)/src/mc.cpp\
|
||||||
|
$(COMMON_SRCDIR)/src/memory_align.cpp\
|
||||||
$(COMMON_SRCDIR)/src/sad_common.cpp\
|
$(COMMON_SRCDIR)/src/sad_common.cpp\
|
||||||
$(COMMON_SRCDIR)/src/utils.cpp\
|
$(COMMON_SRCDIR)/src/utils.cpp\
|
||||||
$(COMMON_SRCDIR)/src/welsCodecTrace.cpp\
|
$(COMMON_SRCDIR)/src/welsCodecTrace.cpp\
|
||||||
@@ -13,41 +16,51 @@ COMMON_CPP_SRCS=\
|
|||||||
|
|
||||||
COMMON_OBJS += $(COMMON_CPP_SRCS:.cpp=.$(OBJ))
|
COMMON_OBJS += $(COMMON_CPP_SRCS:.cpp=.$(OBJ))
|
||||||
|
|
||||||
ifeq ($(ASM_ARCH), x86)
|
|
||||||
COMMON_ASM_SRCS=\
|
COMMON_ASM_SRCS=\
|
||||||
$(COMMON_SRCDIR)/x86/cpuid.asm\
|
$(COMMON_SRCDIR)/x86/cpuid.asm\
|
||||||
$(COMMON_SRCDIR)/x86/deblock.asm\
|
$(COMMON_SRCDIR)/x86/deblock.asm\
|
||||||
$(COMMON_SRCDIR)/x86/expand_picture.asm\
|
$(COMMON_SRCDIR)/x86/expand_picture.asm\
|
||||||
|
$(COMMON_SRCDIR)/x86/intra_pred_com.asm\
|
||||||
$(COMMON_SRCDIR)/x86/mb_copy.asm\
|
$(COMMON_SRCDIR)/x86/mb_copy.asm\
|
||||||
$(COMMON_SRCDIR)/x86/mc_chroma.asm\
|
$(COMMON_SRCDIR)/x86/mc_chroma.asm\
|
||||||
$(COMMON_SRCDIR)/x86/mc_luma.asm\
|
$(COMMON_SRCDIR)/x86/mc_luma.asm\
|
||||||
$(COMMON_SRCDIR)/x86/satd_sad.asm\
|
$(COMMON_SRCDIR)/x86/satd_sad.asm\
|
||||||
$(COMMON_SRCDIR)/x86/vaa.asm\
|
$(COMMON_SRCDIR)/x86/vaa.asm\
|
||||||
|
|
||||||
COMMON_OBJS += $(COMMON_ASM_SRCS:.asm=.$(OBJ))
|
COMMON_OBJSASM += $(COMMON_ASM_SRCS:.asm=.$(OBJ))
|
||||||
|
ifeq ($(ASM_ARCH), x86)
|
||||||
|
COMMON_OBJS += $(COMMON_OBJSASM)
|
||||||
endif
|
endif
|
||||||
|
OBJS += $(COMMON_OBJSASM)
|
||||||
|
|
||||||
ifeq ($(ASM_ARCH), arm)
|
|
||||||
COMMON_ASM_ARM_SRCS=\
|
COMMON_ASM_ARM_SRCS=\
|
||||||
$(COMMON_SRCDIR)/arm/copy_mb_neon.S\
|
$(COMMON_SRCDIR)/arm/copy_mb_neon.S\
|
||||||
$(COMMON_SRCDIR)/arm/deblocking_neon.S\
|
$(COMMON_SRCDIR)/arm/deblocking_neon.S\
|
||||||
$(COMMON_SRCDIR)/arm/expand_picture_neon.S\
|
$(COMMON_SRCDIR)/arm/expand_picture_neon.S\
|
||||||
|
$(COMMON_SRCDIR)/arm/intra_pred_common_neon.S\
|
||||||
$(COMMON_SRCDIR)/arm/mc_neon.S\
|
$(COMMON_SRCDIR)/arm/mc_neon.S\
|
||||||
|
|
||||||
COMMON_OBJS += $(COMMON_ASM_ARM_SRCS:.S=.$(OBJ))
|
COMMON_OBJSARM += $(COMMON_ASM_ARM_SRCS:.S=.$(OBJ))
|
||||||
|
ifeq ($(ASM_ARCH), arm)
|
||||||
|
COMMON_OBJS += $(COMMON_OBJSARM)
|
||||||
endif
|
endif
|
||||||
|
OBJS += $(COMMON_OBJSARM)
|
||||||
|
|
||||||
ifeq ($(ASM_ARCH), arm64)
|
|
||||||
COMMON_ASM_ARM64_SRCS=\
|
COMMON_ASM_ARM64_SRCS=\
|
||||||
$(COMMON_SRCDIR)/arm64/copy_mb_aarch64_neon.S\
|
$(COMMON_SRCDIR)/arm64/copy_mb_aarch64_neon.S\
|
||||||
$(COMMON_SRCDIR)/arm64/deblocking_aarch64_neon.S\
|
$(COMMON_SRCDIR)/arm64/deblocking_aarch64_neon.S\
|
||||||
$(COMMON_SRCDIR)/arm64/expand_picture_aarch64_neon.S\
|
$(COMMON_SRCDIR)/arm64/expand_picture_aarch64_neon.S\
|
||||||
|
$(COMMON_SRCDIR)/arm64/intra_pred_common_aarch64_neon.S\
|
||||||
$(COMMON_SRCDIR)/arm64/mc_aarch64_neon.S\
|
$(COMMON_SRCDIR)/arm64/mc_aarch64_neon.S\
|
||||||
|
|
||||||
COMMON_OBJS += $(COMMON_ASM_ARM64_SRCS:.S=.$(OBJ))
|
COMMON_OBJSARM64 += $(COMMON_ASM_ARM64_SRCS:.S=.$(OBJ))
|
||||||
|
ifeq ($(ASM_ARCH), arm64)
|
||||||
|
COMMON_OBJS += $(COMMON_OBJSARM64)
|
||||||
endif
|
endif
|
||||||
|
OBJS += $(COMMON_OBJSARM64)
|
||||||
|
|
||||||
OBJS += $(COMMON_OBJS)
|
OBJS += $(COMMON_OBJS)
|
||||||
|
|
||||||
$(COMMON_SRCDIR)/%.$(OBJ): $(COMMON_SRCDIR)/%.cpp
|
$(COMMON_SRCDIR)/%.$(OBJ): $(COMMON_SRCDIR)/%.cpp
|
||||||
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
|
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
|
||||||
|
|
||||||
|
|||||||
@@ -60,10 +60,10 @@
|
|||||||
; Macros
|
; Macros
|
||||||
;***********************************************************************
|
;***********************************************************************
|
||||||
|
|
||||||
DEFAULT REL
|
|
||||||
|
|
||||||
%ifdef WIN64 ; Windows x64 ;************************************
|
%ifdef WIN64 ; Windows x64 ;************************************
|
||||||
|
|
||||||
|
DEFAULT REL
|
||||||
|
|
||||||
BITS 64
|
BITS 64
|
||||||
|
|
||||||
%define arg1 rcx
|
%define arg1 rcx
|
||||||
@@ -114,6 +114,8 @@ BITS 64
|
|||||||
|
|
||||||
%elifdef UNIX64 ; Unix x64 ;************************************
|
%elifdef UNIX64 ; Unix x64 ;************************************
|
||||||
|
|
||||||
|
DEFAULT REL
|
||||||
|
|
||||||
BITS 64
|
BITS 64
|
||||||
|
|
||||||
%ifidn __OUTPUT_FORMAT__,elf64
|
%ifidn __OUTPUT_FORMAT__,elf64
|
||||||
|
|||||||
@@ -5276,3 +5276,14 @@ WELS_EXTERN DeblockLumaTransposeV2H_sse2
|
|||||||
pop r3
|
pop r3
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
WELS_EXTERN WelsNonZeroCount_sse2
|
||||||
|
%assign push_num 0
|
||||||
|
LOAD_1_PARA
|
||||||
|
movdqu xmm0, [r0]
|
||||||
|
movq xmm1, [r0+16]
|
||||||
|
WELS_DB1 xmm2
|
||||||
|
pminub xmm0, xmm2
|
||||||
|
pminub xmm1, xmm2
|
||||||
|
movdqu [r0], xmm0
|
||||||
|
movq [r0+16], xmm1
|
||||||
|
ret
|
||||||
|
|||||||
117
codec/common/x86/intra_pred_com.asm
Normal file
117
codec/common/x86/intra_pred_com.asm
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
;*!
|
||||||
|
;* \copy
|
||||||
|
;* Copyright (c) 2009-2013, Cisco Systems
|
||||||
|
;* All rights reserved.
|
||||||
|
;*
|
||||||
|
;* Redistribution and use in source and binary forms, with or without
|
||||||
|
;* modification, are permitted provided that the following conditions
|
||||||
|
;* are met:
|
||||||
|
;*
|
||||||
|
;* * Redistributions of source code must retain the above copyright
|
||||||
|
;* notice, this list of conditions and the following disclaimer.
|
||||||
|
;*
|
||||||
|
;* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
;* notice, this list of conditions and the following disclaimer in
|
||||||
|
;* the documentation and/or other materials provided with the
|
||||||
|
;* distribution.
|
||||||
|
;*
|
||||||
|
;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
;* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
;* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
;* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
;* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
;* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
;* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
;* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
;* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
;* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
;* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
;*
|
||||||
|
;*
|
||||||
|
;* intra_pred_common.asm
|
||||||
|
;*
|
||||||
|
;* Abstract
|
||||||
|
;* sse2 function for intra predict operations
|
||||||
|
;*
|
||||||
|
;* History
|
||||||
|
;* 18/09/2009 Created
|
||||||
|
;*
|
||||||
|
;*
|
||||||
|
;*************************************************************************/
|
||||||
|
%include "asm_inc.asm"
|
||||||
|
|
||||||
|
;***********************************************************************
|
||||||
|
; Code
|
||||||
|
;***********************************************************************
|
||||||
|
|
||||||
|
SECTION .text
|
||||||
|
|
||||||
|
;***********************************************************************
|
||||||
|
; void WelsI16x16LumaPredH_sse2(uint8_t *pred, uint8_t *pRef, int32_t stride);
|
||||||
|
;***********************************************************************
|
||||||
|
|
||||||
|
%macro SSE2_PRED_H_16X16_ONE_LINE 0
|
||||||
|
add r0, 16
|
||||||
|
add r1, r2
|
||||||
|
movzx r3, byte [r1]
|
||||||
|
SSE2_Copy16Times xmm0, r3d
|
||||||
|
movdqa [r0], xmm0
|
||||||
|
%endmacro
|
||||||
|
|
||||||
|
WELS_EXTERN WelsI16x16LumaPredH_sse2
|
||||||
|
push r3
|
||||||
|
%assign push_num 1
|
||||||
|
LOAD_3_PARA
|
||||||
|
SIGN_EXTENSION r2, r2d
|
||||||
|
dec r1
|
||||||
|
movzx r3, byte [r1]
|
||||||
|
SSE2_Copy16Times xmm0, r3d
|
||||||
|
movdqa [r0], xmm0
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
SSE2_PRED_H_16X16_ONE_LINE
|
||||||
|
pop r3
|
||||||
|
ret
|
||||||
|
|
||||||
|
;***********************************************************************
|
||||||
|
; void WelsI16x16LumaPredV_sse2(uint8_t *pred, uint8_t *pRef, int32_t stride);
|
||||||
|
;***********************************************************************
|
||||||
|
WELS_EXTERN WelsI16x16LumaPredV_sse2
|
||||||
|
%assign push_num 0
|
||||||
|
LOAD_3_PARA
|
||||||
|
SIGN_EXTENSION r2, r2d
|
||||||
|
sub r1, r2
|
||||||
|
movdqa xmm0, [r1]
|
||||||
|
|
||||||
|
movdqa [r0], xmm0
|
||||||
|
movdqa [r0+10h], xmm0
|
||||||
|
movdqa [r0+20h], xmm0
|
||||||
|
movdqa [r0+30h], xmm0
|
||||||
|
movdqa [r0+40h], xmm0
|
||||||
|
movdqa [r0+50h], xmm0
|
||||||
|
movdqa [r0+60h], xmm0
|
||||||
|
movdqa [r0+70h], xmm0
|
||||||
|
movdqa [r0+80h], xmm0
|
||||||
|
movdqa [r0+90h], xmm0
|
||||||
|
movdqa [r0+160], xmm0
|
||||||
|
movdqa [r0+176], xmm0
|
||||||
|
movdqa [r0+192], xmm0
|
||||||
|
movdqa [r0+208], xmm0
|
||||||
|
movdqa [r0+224], xmm0
|
||||||
|
movdqa [r0+240], xmm0
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
@@ -42,26 +42,25 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
|
||||||
class CReadConfig {
|
class CReadConfig {
|
||||||
public:
|
public:
|
||||||
CReadConfig();
|
CReadConfig();
|
||||||
CReadConfig (const char* pConfigFileName);
|
CReadConfig (const char* pConfigFileName);
|
||||||
CReadConfig (const string& pConfigFileName);
|
CReadConfig (const std::string& pConfigFileName);
|
||||||
virtual ~CReadConfig();
|
virtual ~CReadConfig();
|
||||||
|
|
||||||
void Openf (const char* strFile);
|
void Openf (const char* strFile);
|
||||||
long ReadLine (string* strVal, const int iValSize = 4);
|
long ReadLine (std::string* strVal, const int iValSize = 4);
|
||||||
const bool EndOfFile();
|
const bool EndOfFile();
|
||||||
const int GetLines();
|
const int GetLines();
|
||||||
const bool ExistFile();
|
const bool ExistFile();
|
||||||
const string& GetFileName();
|
const std::string& GetFileName();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FILE* m_pCfgFile;
|
FILE* m_pCfgFile;
|
||||||
string m_strCfgFileName;
|
std::string m_strCfgFileName;
|
||||||
unsigned int m_iLines;
|
unsigned int m_iLines;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ CReadConfig::CReadConfig (const char* kpConfigFileName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CReadConfig::CReadConfig (const string& kpConfigFileName)
|
CReadConfig::CReadConfig (const std::string& kpConfigFileName)
|
||||||
: m_pCfgFile (0)
|
: m_pCfgFile (0)
|
||||||
, m_strCfgFileName (kpConfigFileName)
|
, m_strCfgFileName (kpConfigFileName)
|
||||||
, m_iLines (0) {
|
, m_iLines (0) {
|
||||||
@@ -81,11 +81,11 @@ void CReadConfig::Openf (const char* kpStrFile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
long CReadConfig::ReadLine (string* pVal, const int kiValSize/* = 4*/) {
|
long CReadConfig::ReadLine (std::string* pVal, const int kiValSize/* = 4*/) {
|
||||||
if (m_pCfgFile == NULL || pVal == NULL || kiValSize <= 1)
|
if (m_pCfgFile == NULL || pVal == NULL || kiValSize <= 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
string* strTags = &pVal[0];
|
std::string* strTags = &pVal[0];
|
||||||
int nTagNum = 0, n = 0;
|
int nTagNum = 0, n = 0;
|
||||||
bool bCommentFlag = false;
|
bool bCommentFlag = false;
|
||||||
|
|
||||||
@@ -134,6 +134,6 @@ const bool CReadConfig::ExistFile() {
|
|||||||
return (m_pCfgFile != NULL);
|
return (m_pCfgFile != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const string& CReadConfig::GetFileName() {
|
const std::string& CReadConfig::GetFileName() {
|
||||||
return m_strCfgFileName;
|
return m_strCfgFileName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ CONSOLE_COMMON_CPP_SRCS=\
|
|||||||
CONSOLE_COMMON_OBJS += $(CONSOLE_COMMON_CPP_SRCS:.cpp=.$(OBJ))
|
CONSOLE_COMMON_OBJS += $(CONSOLE_COMMON_CPP_SRCS:.cpp=.$(OBJ))
|
||||||
|
|
||||||
OBJS += $(CONSOLE_COMMON_OBJS)
|
OBJS += $(CONSOLE_COMMON_OBJS)
|
||||||
|
|
||||||
$(CONSOLE_COMMON_SRCDIR)/%.$(OBJ): $(CONSOLE_COMMON_SRCDIR)/%.cpp
|
$(CONSOLE_COMMON_SRCDIR)/%.$(OBJ): $(CONSOLE_COMMON_SRCDIR)/%.cpp
|
||||||
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(CONSOLE_COMMON_CFLAGS) $(CONSOLE_COMMON_INCLUDES) -c $(CXX_O) $<
|
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(CONSOLE_COMMON_CFLAGS) $(CONSOLE_COMMON_INCLUDES) -c $(CXX_O) $<
|
||||||
|
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ HRESULT CD3D9ExUtils::Render (void* pDst[3], SBufferInfo* pInfo) {
|
|||||||
|| m_nHeight != pInfo->UsrData.sSystemBuffer.iHeight) {
|
|| m_nHeight != pInfo->UsrData.sSystemBuffer.iHeight) {
|
||||||
m_nWidth = pInfo->UsrData.sSystemBuffer.iWidth;
|
m_nWidth = pInfo->UsrData.sSystemBuffer.iWidth;
|
||||||
m_nHeight = pInfo->UsrData.sSystemBuffer.iHeight;
|
m_nHeight = pInfo->UsrData.sSystemBuffer.iHeight;
|
||||||
|
MoveWindow(m_hWnd,0,0,pInfo->UsrData.sSystemBuffer.iWidth,pInfo->UsrData.sSystemBuffer.iHeight,true);
|
||||||
SAFE_RELEASE (m_lpD3D9RawSurfaceShare);
|
SAFE_RELEASE (m_lpD3D9RawSurfaceShare);
|
||||||
SAFE_RELEASE (m_lpD3D9Device);
|
SAFE_RELEASE (m_lpD3D9Device);
|
||||||
}
|
}
|
||||||
@@ -604,23 +605,17 @@ int CUtils::CheckOS() {
|
|||||||
OSVERSIONINFOEX osvi;
|
OSVERSIONINFOEX osvi;
|
||||||
ZeroMemory (&osvi, sizeof (OSVERSIONINFOEX));
|
ZeroMemory (&osvi, sizeof (OSVERSIONINFOEX));
|
||||||
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
|
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
|
||||||
|
osvi.dwPlatformId = VER_PLATFORM_WIN32_NT;
|
||||||
|
osvi.dwMajorVersion = 6; // Vista
|
||||||
|
DWORDLONG condmask = VerSetConditionMask (VerSetConditionMask (0, VER_MAJORVERSION, VER_GREATER_EQUAL),
|
||||||
|
VER_PLATFORMID, VER_EQUAL);
|
||||||
|
|
||||||
if (!GetVersionEx ((OSVERSIONINFO*) &osvi)) {
|
if (VerifyVersionInfo (&osvi, VER_MAJORVERSION | VER_PLATFORMID, condmask)) {
|
||||||
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
|
iType = OS_VISTA_UPPER;
|
||||||
if (! GetVersionEx ((OSVERSIONINFO*) &osvi))
|
} else {
|
||||||
return iType;
|
osvi.dwMajorVersion = 5; // XP/2000
|
||||||
}
|
if (VerifyVersionInfo (&osvi, VER_MAJORVERSION | VER_PLATFORMID, condmask))
|
||||||
|
|
||||||
switch (osvi.dwPlatformId) {
|
|
||||||
case VER_PLATFORM_WIN32_NT:
|
|
||||||
if (osvi.dwMajorVersion >= 6)
|
|
||||||
iType = OS_VISTA_UPPER;
|
|
||||||
else if (osvi.dwMajorVersion == 5)
|
|
||||||
iType = OS_XP;
|
iType = OS_XP;
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -62,13 +62,23 @@ using namespace std;
|
|||||||
#endif
|
#endif
|
||||||
//using namespace WelsDec;
|
//using namespace WelsDec;
|
||||||
|
|
||||||
//#define STICK_STREAM_SIZE // For Demo interfaces test with track file of integrated frames
|
//#define NO_DELAY_DECODING // For Demo interfaces test with no delay decoding
|
||||||
|
|
||||||
void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, const char* kpOuputFileName,
|
void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, const char* kpOuputFileName,
|
||||||
int32_t& iWidth, int32_t& iHeight, const char* pOptionFileName) {
|
int32_t& iWidth, int32_t& iHeight, const char* pOptionFileName, const char* pLengthFileName) {
|
||||||
FILE* pH264File = NULL;
|
FILE* pH264File = NULL;
|
||||||
FILE* pYuvFile = NULL;
|
FILE* pYuvFile = NULL;
|
||||||
FILE* pOptionFile = NULL;
|
FILE* pOptionFile = NULL;
|
||||||
|
// Lenght input mode support
|
||||||
|
FILE* fpTrack = NULL;
|
||||||
|
if (pLengthFileName != NULL) {
|
||||||
|
fpTrack = fopen (pLengthFileName, "rb");
|
||||||
|
if (fpTrack == NULL)
|
||||||
|
printf ("Length file open ERROR!\n");
|
||||||
|
}
|
||||||
|
int32_t pInfo[4];
|
||||||
|
|
||||||
|
unsigned long long uiTimeStamp = 0;
|
||||||
int64_t iStart = 0, iEnd = 0, iTotal = 0;
|
int64_t iStart = 0, iEnd = 0, iTotal = 0;
|
||||||
int32_t iSliceSize;
|
int32_t iSliceSize;
|
||||||
int32_t iSliceIndex = 0;
|
int32_t iSliceIndex = 0;
|
||||||
@@ -86,7 +96,10 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
|
|||||||
int32_t iFrameCount = 0;
|
int32_t iFrameCount = 0;
|
||||||
int32_t iEndOfStreamFlag = 0;
|
int32_t iEndOfStreamFlag = 0;
|
||||||
int32_t iColorFormat = videoFormatInternal;
|
int32_t iColorFormat = videoFormatInternal;
|
||||||
|
//for coverage test purpose
|
||||||
|
int32_t iErrorConMethod = (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE;
|
||||||
|
pDecoder->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iErrorConMethod);
|
||||||
|
//~end for
|
||||||
CUtils cOutputModule;
|
CUtils cOutputModule;
|
||||||
double dElapsed = 0;
|
double dElapsed = 0;
|
||||||
|
|
||||||
@@ -153,12 +166,6 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
|
|||||||
goto label_exit;
|
goto label_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined ( STICK_STREAM_SIZE )
|
|
||||||
FILE* fpTrack = fopen ("3.len", "rb");
|
|
||||||
|
|
||||||
#endif// STICK_STREAM_SIZE
|
|
||||||
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
if (iBufPos >= iFileSize) {
|
if (iBufPos >= iFileSize) {
|
||||||
@@ -167,19 +174,24 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
|
|||||||
pDecoder->SetOption (DECODER_OPTION_END_OF_STREAM, (void*)&iEndOfStreamFlag);
|
pDecoder->SetOption (DECODER_OPTION_END_OF_STREAM, (void*)&iEndOfStreamFlag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// Read length from file if needed
|
||||||
#if defined ( STICK_STREAM_SIZE )
|
if (fpTrack) {
|
||||||
if (fpTrack)
|
if (fread (pInfo, 4, sizeof (int32_t), fpTrack) < 4)
|
||||||
fread (&iSliceSize, 1, sizeof (int32_t), fpTrack);
|
return;
|
||||||
#else
|
iSliceSize = static_cast<int32_t> (pInfo[2]);
|
||||||
for (i = 0; i < iFileSize; i++) {
|
} else {
|
||||||
if ((pBuf[iBufPos + i] == 0 && pBuf[iBufPos + i + 1] == 0 && pBuf[iBufPos + i + 2] == 0 && pBuf[iBufPos + i + 3] == 1
|
for (i = 0; i < iFileSize; i++) {
|
||||||
&& i > 0) || (pBuf[iBufPos + i] == 0 && pBuf[iBufPos + i + 1] == 0 && pBuf[iBufPos + i + 2] == 1 && i > 0)) {
|
if ((pBuf[iBufPos + i] == 0 && pBuf[iBufPos + i + 1] == 0 && pBuf[iBufPos + i + 2] == 0 && pBuf[iBufPos + i + 3] == 1
|
||||||
break;
|
&& i > 0) || (pBuf[iBufPos + i] == 0 && pBuf[iBufPos + i + 1] == 0 && pBuf[iBufPos + i + 2] == 1 && i > 0)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
iSliceSize = i;
|
||||||
|
}
|
||||||
|
if (iSliceSize < 4) { //too small size, no effective data, ignore
|
||||||
|
iBufPos += iSliceSize;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
iSliceSize = i;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//for coverage test purpose
|
//for coverage test purpose
|
||||||
int32_t iOutputColorFormat;
|
int32_t iOutputColorFormat;
|
||||||
@@ -198,17 +210,20 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
|
|||||||
pDecoder->GetOption (DECODER_OPTION_VCL_NAL, &iFeedbackVclNalInAu);
|
pDecoder->GetOption (DECODER_OPTION_VCL_NAL, &iFeedbackVclNalInAu);
|
||||||
int32_t iFeedbackTidInAu;
|
int32_t iFeedbackTidInAu;
|
||||||
pDecoder->GetOption (DECODER_OPTION_TEMPORAL_ID, &iFeedbackTidInAu);
|
pDecoder->GetOption (DECODER_OPTION_TEMPORAL_ID, &iFeedbackTidInAu);
|
||||||
int32_t iErrorConMethod = (int32_t) ERROR_CON_SLICE_COPY;
|
|
||||||
pDecoder->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iErrorConMethod);
|
|
||||||
//~end for
|
//~end for
|
||||||
|
|
||||||
iStart = WelsTime();
|
iStart = WelsTime();
|
||||||
pData[0] = NULL;
|
pData[0] = NULL;
|
||||||
pData[1] = NULL;
|
pData[1] = NULL;
|
||||||
pData[2] = NULL;
|
pData[2] = NULL;
|
||||||
|
uiTimeStamp ++;
|
||||||
memset (&sDstBufInfo, 0, sizeof (SBufferInfo));
|
memset (&sDstBufInfo, 0, sizeof (SBufferInfo));
|
||||||
|
sDstBufInfo.uiInBsTimeStamp = uiTimeStamp;
|
||||||
|
#ifndef NO_DELAY_DECODING
|
||||||
|
pDecoder->DecodeFrameNoDelay (pBuf + iBufPos, iSliceSize, pData, &sDstBufInfo);
|
||||||
|
#else
|
||||||
pDecoder->DecodeFrame2 (pBuf + iBufPos, iSliceSize, pData, &sDstBufInfo);
|
pDecoder->DecodeFrame2 (pBuf + iBufPos, iSliceSize, pData, &sDstBufInfo);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sDstBufInfo.iBufferStatus == 1) {
|
if (sDstBufInfo.iBufferStatus == 1) {
|
||||||
pDst[0] = pData[0];
|
pDst[0] = pData[0];
|
||||||
@@ -234,46 +249,46 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
|
|||||||
++ iFrameCount;
|
++ iFrameCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef NO_DELAY_DECODING
|
||||||
|
iStart = WelsTime();
|
||||||
|
pData[0] = NULL;
|
||||||
|
pData[1] = NULL;
|
||||||
|
pData[2] = NULL;
|
||||||
|
memset (&sDstBufInfo, 0, sizeof (SBufferInfo));
|
||||||
|
sDstBufInfo.uiInBsTimeStamp = uiTimeStamp;
|
||||||
|
pDecoder->DecodeFrame2 (NULL, 0, pData, &sDstBufInfo);
|
||||||
|
if (sDstBufInfo.iBufferStatus == 1) {
|
||||||
|
pDst[0] = pData[0];
|
||||||
|
pDst[1] = pData[1];
|
||||||
|
pDst[2] = pData[2];
|
||||||
|
}
|
||||||
|
iEnd = WelsTime();
|
||||||
|
iTotal += iEnd - iStart;
|
||||||
|
if (sDstBufInfo.iBufferStatus == 1) {
|
||||||
|
cOutputModule.Process ((void**)pDst, &sDstBufInfo, pYuvFile);
|
||||||
|
iWidth = sDstBufInfo.UsrData.sSystemBuffer.iWidth;
|
||||||
|
iHeight = sDstBufInfo.UsrData.sSystemBuffer.iHeight;
|
||||||
|
|
||||||
|
if (pOptionFile != NULL) {
|
||||||
|
if (iWidth != iLastWidth && iHeight != iLastHeight) {
|
||||||
|
fwrite (&iFrameCount, sizeof (iFrameCount), 1, pOptionFile);
|
||||||
|
fwrite (&iWidth , sizeof (iWidth) , 1, pOptionFile);
|
||||||
|
fwrite (&iHeight, sizeof (iHeight), 1, pOptionFile);
|
||||||
|
iLastWidth = iWidth;
|
||||||
|
iLastHeight = iHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
++ iFrameCount;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
iBufPos += iSliceSize;
|
iBufPos += iSliceSize;
|
||||||
++ iSliceIndex;
|
++ iSliceIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get pending last frame
|
|
||||||
pData[0] = NULL;
|
|
||||||
pData[1] = NULL;
|
|
||||||
pData[2] = NULL;
|
|
||||||
memset (&sDstBufInfo, 0, sizeof (SBufferInfo));
|
|
||||||
|
|
||||||
pDecoder->DecodeFrame2 (NULL, 0, pData, &sDstBufInfo);
|
|
||||||
if (sDstBufInfo.iBufferStatus == 1) {
|
|
||||||
pDst[0] = pData[0];
|
|
||||||
pDst[1] = pData[1];
|
|
||||||
pDst[2] = pData[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sDstBufInfo.iBufferStatus == 1) {
|
|
||||||
cOutputModule.Process ((void**)pDst, &sDstBufInfo, pYuvFile);
|
|
||||||
iWidth = sDstBufInfo.UsrData.sSystemBuffer.iWidth;
|
|
||||||
iHeight = sDstBufInfo.UsrData.sSystemBuffer.iHeight;
|
|
||||||
|
|
||||||
if (pOptionFile != NULL) {
|
|
||||||
/* Anyway, we need write in case of final frame decoding */
|
|
||||||
fwrite (&iFrameCount, sizeof (iFrameCount), 1, pOptionFile);
|
|
||||||
fwrite (&iWidth , sizeof (iWidth) , 1, pOptionFile);
|
|
||||||
fwrite (&iHeight, sizeof (iHeight), 1, pOptionFile);
|
|
||||||
iLastWidth = iWidth;
|
|
||||||
iLastHeight = iHeight;
|
|
||||||
}
|
|
||||||
++ iFrameCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if defined ( STICK_STREAM_SIZE )
|
|
||||||
if (fpTrack) {
|
if (fpTrack) {
|
||||||
fclose (fpTrack);
|
fclose (fpTrack);
|
||||||
fpTrack = NULL;
|
fpTrack = NULL;
|
||||||
}
|
}
|
||||||
#endif// STICK_STREAM_SIZE
|
|
||||||
|
|
||||||
dElapsed = iTotal / 1e6;
|
dElapsed = iTotal / 1e6;
|
||||||
fprintf (stderr, "-------------------------------------------------------\n");
|
fprintf (stderr, "-------------------------------------------------------\n");
|
||||||
@@ -309,8 +324,8 @@ int32_t main (int32_t iArgC, char* pArgV[]) {
|
|||||||
ISVCDecoder* pDecoder = NULL;
|
ISVCDecoder* pDecoder = NULL;
|
||||||
|
|
||||||
SDecodingParam sDecParam = {0};
|
SDecodingParam sDecParam = {0};
|
||||||
string strInputFile (""), strOutputFile (""), strOptionFile ("");
|
string strInputFile (""), strOutputFile (""), strOptionFile (""), strLengthFile ("");
|
||||||
int iLevelSetting = -1;
|
int iLevelSetting = (int) WELS_LOG_WARNING;
|
||||||
|
|
||||||
sDecParam.sVideoProperty.size = sizeof (sDecParam.sVideoProperty);
|
sDecParam.sVideoProperty.size = sizeof (sDecParam.sVideoProperty);
|
||||||
|
|
||||||
@@ -396,6 +411,13 @@ int32_t main (int32_t iArgC, char* pArgV[]) {
|
|||||||
printf ("trace level not specified.\n");
|
printf ("trace level not specified.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
} else if (!strcmp (cmd, "-length")) {
|
||||||
|
if (i + 1 < iArgC)
|
||||||
|
strLengthFile = pArgV[++i];
|
||||||
|
else {
|
||||||
|
printf ("lenght file not specified.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -434,7 +456,7 @@ int32_t main (int32_t iArgC, char* pArgV[]) {
|
|||||||
|
|
||||||
H264DecodeInstance (pDecoder, strInputFile.c_str(), !strOutputFile.empty() ? strOutputFile.c_str() : NULL, iWidth,
|
H264DecodeInstance (pDecoder, strInputFile.c_str(), !strOutputFile.empty() ? strOutputFile.c_str() : NULL, iWidth,
|
||||||
iHeight,
|
iHeight,
|
||||||
(!strOptionFile.empty() ? strOptionFile.c_str() : NULL));
|
(!strOptionFile.empty() ? strOptionFile.c_str() : NULL), (!strLengthFile.empty() ? strLengthFile.c_str() : NULL));
|
||||||
|
|
||||||
if (sDecParam.pFileNameRestructed != NULL) {
|
if (sDecParam.pFileNameRestructed != NULL) {
|
||||||
delete []sDecParam.pFileNameRestructed;
|
delete []sDecParam.pFileNameRestructed;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ H264DEC_CPP_SRCS=\
|
|||||||
H264DEC_OBJS += $(H264DEC_CPP_SRCS:.cpp=.$(OBJ))
|
H264DEC_OBJS += $(H264DEC_CPP_SRCS:.cpp=.$(OBJ))
|
||||||
|
|
||||||
OBJS += $(H264DEC_OBJS)
|
OBJS += $(H264DEC_OBJS)
|
||||||
|
|
||||||
$(H264DEC_SRCDIR)/%.$(OBJ): $(H264DEC_SRCDIR)/%.cpp
|
$(H264DEC_SRCDIR)/%.$(OBJ): $(H264DEC_SRCDIR)/%.cpp
|
||||||
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c $(CXX_O) $<
|
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c $(CXX_O) $<
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ static int g_iCtrlC = 0;
|
|||||||
static void SigIntHandler (int a) {
|
static void SigIntHandler (int a) {
|
||||||
g_iCtrlC = 1;
|
g_iCtrlC = 1;
|
||||||
}
|
}
|
||||||
static int g_LevelSetting = -1;
|
static int g_LevelSetting = WELS_LOG_ERROR;
|
||||||
|
|
||||||
int ParseLayerConfig (CReadConfig& cRdLayerCfg, const int iLayer, SEncParamExt& pSvcParam, SFilesSet& sFileSet) {
|
int ParseLayerConfig (CReadConfig& cRdLayerCfg, const int iLayer, SEncParamExt& pSvcParam, SFilesSet& sFileSet) {
|
||||||
if (!cRdLayerCfg.ExistFile()) {
|
if (!cRdLayerCfg.ExistFile()) {
|
||||||
@@ -232,12 +232,34 @@ int ParseConfig (CReadConfig& cRdCfg, SSourcePicture* pSrcPic, SEncParamExt& pSv
|
|||||||
pSvcParam.uiIntraPeriod = atoi (strTag[1].c_str());
|
pSvcParam.uiIntraPeriod = atoi (strTag[1].c_str());
|
||||||
} else if (strTag[0].compare ("MaxNalSize") == 0) {
|
} else if (strTag[0].compare ("MaxNalSize") == 0) {
|
||||||
pSvcParam.uiMaxNalSize = atoi (strTag[1].c_str());
|
pSvcParam.uiMaxNalSize = atoi (strTag[1].c_str());
|
||||||
} else if (strTag[0].compare ("EnableSpsPpsIDAddition") == 0) {
|
} else if (strTag[0].compare ("SpsPpsIDStrategy") == 0) {
|
||||||
pSvcParam.bEnableSpsPpsIdAddition = atoi (strTag[1].c_str()) ? true : false;
|
int32_t iValue = atoi (strTag[1].c_str());
|
||||||
|
switch (iValue) {
|
||||||
|
case 0:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = CONSTANT_ID;
|
||||||
|
break;
|
||||||
|
case 0x01:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = INCREASING_ID;
|
||||||
|
break;
|
||||||
|
case 0x02:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = SPS_LISTING;
|
||||||
|
break;
|
||||||
|
case 0x03:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
|
||||||
|
break;
|
||||||
|
case 0x06:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = SPS_PPS_LISTING;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = CONSTANT_ID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else if (strTag[0].compare ("EnableScalableSEI") == 0) {
|
} else if (strTag[0].compare ("EnableScalableSEI") == 0) {
|
||||||
pSvcParam.bEnableSSEI = atoi (strTag[1].c_str()) ? true : false;
|
pSvcParam.bEnableSSEI = atoi (strTag[1].c_str()) ? true : false;
|
||||||
} else if (strTag[0].compare ("EnableFrameCropping") == 0) {
|
} else if (strTag[0].compare ("EnableFrameCropping") == 0) {
|
||||||
pSvcParam.bEnableFrameCroppingFlag = (atoi (strTag[1].c_str()) != 0);
|
pSvcParam.bEnableFrameCroppingFlag = (atoi (strTag[1].c_str()) != 0);
|
||||||
|
} else if (strTag[0].compare ("EntropyCodingModeFlag") == 0) {
|
||||||
|
pSvcParam.iEntropyCodingModeFlag = (atoi (strTag[1].c_str()) != 0);
|
||||||
} else if (strTag[0].compare ("LoopFilterDisableIDC") == 0) {
|
} else if (strTag[0].compare ("LoopFilterDisableIDC") == 0) {
|
||||||
pSvcParam.iLoopFilterDisableIdc = (int8_t)atoi (strTag[1].c_str());
|
pSvcParam.iLoopFilterDisableIdc = (int8_t)atoi (strTag[1].c_str());
|
||||||
if (pSvcParam.iLoopFilterDisableIdc > 6 || pSvcParam.iLoopFilterDisableIdc < 0) {
|
if (pSvcParam.iLoopFilterDisableIdc > 6 || pSvcParam.iLoopFilterDisableIdc < 0) {
|
||||||
@@ -294,6 +316,8 @@ int ParseConfig (CReadConfig& cRdCfg, SSourcePicture* pSrcPic, SEncParamExt& pSv
|
|||||||
pSvcParam.iLTRRefNum = atoi (strTag[1].c_str());
|
pSvcParam.iLTRRefNum = atoi (strTag[1].c_str());
|
||||||
} else if (strTag[0].compare ("LtrMarkPeriod") == 0) {
|
} else if (strTag[0].compare ("LtrMarkPeriod") == 0) {
|
||||||
pSvcParam.iLtrMarkPeriod = (uint32_t)atoi (strTag[1].c_str());
|
pSvcParam.iLtrMarkPeriod = (uint32_t)atoi (strTag[1].c_str());
|
||||||
|
} else if (strTag[0].compare ("LosslessLink") == 0) {
|
||||||
|
pSvcParam.bIsLosslessLink = atoi (strTag[1].c_str()) ? true : false;
|
||||||
} else if (strTag[0].compare ("NumLayers") == 0) {
|
} else if (strTag[0].compare ("NumLayers") == 0) {
|
||||||
pSvcParam.iSpatialLayerNum = (int8_t)atoi (strTag[1].c_str());
|
pSvcParam.iSpatialLayerNum = (int8_t)atoi (strTag[1].c_str());
|
||||||
if (pSvcParam.iSpatialLayerNum > MAX_DEPENDENCY_LAYER || pSvcParam.iSpatialLayerNum <= 0) {
|
if (pSvcParam.iSpatialLayerNum > MAX_DEPENDENCY_LAYER || pSvcParam.iSpatialLayerNum <= 0) {
|
||||||
@@ -352,6 +376,7 @@ void PrintHelp() {
|
|||||||
printf (" -iper Intra period (default: -1) : must be a power of 2 of GOP size (or -1)\n");
|
printf (" -iper Intra period (default: -1) : must be a power of 2 of GOP size (or -1)\n");
|
||||||
printf (" -nalsize the Maximum NAL size. which should be larger than the each layer slicesize when slice mode equals to SM_DYN_SLICE\n");
|
printf (" -nalsize the Maximum NAL size. which should be larger than the each layer slicesize when slice mode equals to SM_DYN_SLICE\n");
|
||||||
printf (" -spsid Enable id adding in SPS/PPS per IDR \n");
|
printf (" -spsid Enable id adding in SPS/PPS per IDR \n");
|
||||||
|
printf (" -cabac Entropy coding mode(0:cavlc 1:cabac \n");
|
||||||
printf (" -denois Control denoising (default: 0)\n");
|
printf (" -denois Control denoising (default: 0)\n");
|
||||||
printf (" -scene Control scene change detection (default: 0)\n");
|
printf (" -scene Control scene change detection (default: 0)\n");
|
||||||
printf (" -bgd Control background detection (default: 0)\n");
|
printf (" -bgd Control background detection (default: 0)\n");
|
||||||
@@ -382,7 +407,7 @@ void PrintHelp() {
|
|||||||
|
|
||||||
int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamExt& pSvcParam, SFilesSet& sFileSet) {
|
int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamExt& pSvcParam, SFilesSet& sFileSet) {
|
||||||
char* pCommand = NULL;
|
char* pCommand = NULL;
|
||||||
SLayerPEncCtx sLayerCtx[3];
|
SLayerPEncCtx sLayerCtx[MAX_SPATIAL_LAYER_NUM];
|
||||||
int n = 0;
|
int n = 0;
|
||||||
string str_ ("SlicesAssign");
|
string str_ ("SlicesAssign");
|
||||||
|
|
||||||
@@ -415,8 +440,31 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE
|
|||||||
else if (!strcmp (pCommand, "-nalsize") && (n < argc))
|
else if (!strcmp (pCommand, "-nalsize") && (n < argc))
|
||||||
pSvcParam.uiMaxNalSize = atoi (argv[n++]);
|
pSvcParam.uiMaxNalSize = atoi (argv[n++]);
|
||||||
|
|
||||||
else if (!strcmp (pCommand, "-spsid") && (n < argc))
|
else if (!strcmp (pCommand, "-spsid") && (n < argc)) {
|
||||||
pSvcParam.bEnableSpsPpsIdAddition = atoi (argv[n++]) ? true : false;
|
int32_t iValue = atoi (argv[n++]);
|
||||||
|
switch (iValue) {
|
||||||
|
case 0:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = CONSTANT_ID;
|
||||||
|
break;
|
||||||
|
case 0x01:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = INCREASING_ID;
|
||||||
|
break;
|
||||||
|
case 0x02:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = SPS_LISTING;
|
||||||
|
break;
|
||||||
|
case 0x03:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
|
||||||
|
break;
|
||||||
|
case 0x06:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = SPS_PPS_LISTING;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pSvcParam.eSpsPpsIdStrategy = CONSTANT_ID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!strcmp (pCommand, "-cabac") && (n < argc))
|
||||||
|
pSvcParam.iEntropyCodingModeFlag = atoi (argv[n++]);
|
||||||
|
|
||||||
else if (!strcmp (pCommand, "-denois") && (n < argc))
|
else if (!strcmp (pCommand, "-denois") && (n < argc))
|
||||||
pSvcParam.bEnableDenoise = atoi (argv[n++]) ? true : false;
|
pSvcParam.bEnableDenoise = atoi (argv[n++]) ? true : false;
|
||||||
@@ -572,7 +620,7 @@ int FillSpecificParameters (SEncParamExt& sParam) {
|
|||||||
sParam.iPicWidth = 1280; // width of picture in samples
|
sParam.iPicWidth = 1280; // width of picture in samples
|
||||||
sParam.iPicHeight = 720; // height of picture in samples
|
sParam.iPicHeight = 720; // height of picture in samples
|
||||||
sParam.iTargetBitrate = 2500000; // target bitrate desired
|
sParam.iTargetBitrate = 2500000; // target bitrate desired
|
||||||
sParam.iMaxBitrate = MAX_BIT_RATE;
|
sParam.iMaxBitrate = UNSPECIFIED_BIT_RATE;
|
||||||
sParam.iRCMode = RC_QUALITY_MODE; // rc mode control
|
sParam.iRCMode = RC_QUALITY_MODE; // rc mode control
|
||||||
sParam.iTemporalLayerNum = 3; // layer number at temporal level
|
sParam.iTemporalLayerNum = 3; // layer number at temporal level
|
||||||
sParam.iSpatialLayerNum = 4; // layer number at spatial level
|
sParam.iSpatialLayerNum = 4; // layer number at spatial level
|
||||||
@@ -583,7 +631,7 @@ int FillSpecificParameters (SEncParamExt& sParam) {
|
|||||||
sParam.bEnableLongTermReference = 0; // long term reference control
|
sParam.bEnableLongTermReference = 0; // long term reference control
|
||||||
sParam.iLtrMarkPeriod = 30;
|
sParam.iLtrMarkPeriod = 30;
|
||||||
sParam.uiIntraPeriod = 320; // period of Intra frame
|
sParam.uiIntraPeriod = 320; // period of Intra frame
|
||||||
sParam.bEnableSpsPpsIdAddition = 1;
|
sParam.eSpsPpsIdStrategy = INCREASING_ID;
|
||||||
sParam.bPrefixNalAddingCtrl = 0;
|
sParam.bPrefixNalAddingCtrl = 0;
|
||||||
sParam.iComplexityMode = MEDIUM_COMPLEXITY;
|
sParam.iComplexityMode = MEDIUM_COMPLEXITY;
|
||||||
int iIndexLayer = 0;
|
int iIndexLayer = 0;
|
||||||
@@ -592,7 +640,7 @@ int FillSpecificParameters (SEncParamExt& sParam) {
|
|||||||
sParam.sSpatialLayers[iIndexLayer].iVideoHeight = 90;
|
sParam.sSpatialLayers[iIndexLayer].iVideoHeight = 90;
|
||||||
sParam.sSpatialLayers[iIndexLayer].fFrameRate = 7.5f;
|
sParam.sSpatialLayers[iIndexLayer].fFrameRate = 7.5f;
|
||||||
sParam.sSpatialLayers[iIndexLayer].iSpatialBitrate = 64000;
|
sParam.sSpatialLayers[iIndexLayer].iSpatialBitrate = 64000;
|
||||||
sParam.sSpatialLayers[iIndexLayer].iMaxSpatialBitrate = MAX_BIT_RATE;
|
sParam.sSpatialLayers[iIndexLayer].iMaxSpatialBitrate = UNSPECIFIED_BIT_RATE;
|
||||||
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
|
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
|
||||||
|
|
||||||
++ iIndexLayer;
|
++ iIndexLayer;
|
||||||
@@ -601,7 +649,7 @@ int FillSpecificParameters (SEncParamExt& sParam) {
|
|||||||
sParam.sSpatialLayers[iIndexLayer].iVideoHeight = 180;
|
sParam.sSpatialLayers[iIndexLayer].iVideoHeight = 180;
|
||||||
sParam.sSpatialLayers[iIndexLayer].fFrameRate = 15.0f;
|
sParam.sSpatialLayers[iIndexLayer].fFrameRate = 15.0f;
|
||||||
sParam.sSpatialLayers[iIndexLayer].iSpatialBitrate = 160000;
|
sParam.sSpatialLayers[iIndexLayer].iSpatialBitrate = 160000;
|
||||||
sParam.sSpatialLayers[iIndexLayer].iMaxSpatialBitrate = MAX_BIT_RATE;
|
sParam.sSpatialLayers[iIndexLayer].iMaxSpatialBitrate = UNSPECIFIED_BIT_RATE;
|
||||||
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
|
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
|
||||||
|
|
||||||
++ iIndexLayer;
|
++ iIndexLayer;
|
||||||
@@ -610,7 +658,7 @@ int FillSpecificParameters (SEncParamExt& sParam) {
|
|||||||
sParam.sSpatialLayers[iIndexLayer].iVideoHeight = 360;
|
sParam.sSpatialLayers[iIndexLayer].iVideoHeight = 360;
|
||||||
sParam.sSpatialLayers[iIndexLayer].fFrameRate = 30.0f;
|
sParam.sSpatialLayers[iIndexLayer].fFrameRate = 30.0f;
|
||||||
sParam.sSpatialLayers[iIndexLayer].iSpatialBitrate = 512000;
|
sParam.sSpatialLayers[iIndexLayer].iSpatialBitrate = 512000;
|
||||||
sParam.sSpatialLayers[iIndexLayer].iMaxSpatialBitrate = MAX_BIT_RATE;
|
sParam.sSpatialLayers[iIndexLayer].iMaxSpatialBitrate = UNSPECIFIED_BIT_RATE;
|
||||||
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
|
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
|
||||||
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.sSliceArgument.uiSliceNum = 1;
|
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.sSliceArgument.uiSliceNum = 1;
|
||||||
|
|
||||||
@@ -620,7 +668,7 @@ int FillSpecificParameters (SEncParamExt& sParam) {
|
|||||||
sParam.sSpatialLayers[iIndexLayer].iVideoHeight = 720;
|
sParam.sSpatialLayers[iIndexLayer].iVideoHeight = 720;
|
||||||
sParam.sSpatialLayers[iIndexLayer].fFrameRate = 30.0f;
|
sParam.sSpatialLayers[iIndexLayer].fFrameRate = 30.0f;
|
||||||
sParam.sSpatialLayers[iIndexLayer].iSpatialBitrate = 1500000;
|
sParam.sSpatialLayers[iIndexLayer].iSpatialBitrate = 1500000;
|
||||||
sParam.sSpatialLayers[iIndexLayer].iMaxSpatialBitrate = MAX_BIT_RATE;
|
sParam.sSpatialLayers[iIndexLayer].iMaxSpatialBitrate = UNSPECIFIED_BIT_RATE;
|
||||||
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
|
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
|
||||||
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.sSliceArgument.uiSliceNum = 1;
|
sParam.sSpatialLayers[iIndexLayer].sSliceCfg.sSliceArgument.uiSliceNum = 1;
|
||||||
|
|
||||||
@@ -659,7 +707,7 @@ int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFi
|
|||||||
FILE* fpGolden = NULL;
|
FILE* fpGolden = NULL;
|
||||||
#endif
|
#endif
|
||||||
#if defined ( STICK_STREAM_SIZE )
|
#if defined ( STICK_STREAM_SIZE )
|
||||||
FILE* fTrackStream = fopen ("coding_size.stream", "wb");;
|
FILE* fTrackStream = fopen ("coding_size.stream", "wb");
|
||||||
#endif
|
#endif
|
||||||
SFilesSet fs;
|
SFilesSet fs;
|
||||||
// for configuration file
|
// for configuration file
|
||||||
@@ -702,9 +750,7 @@ int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFi
|
|||||||
iRet = 1;
|
iRet = 1;
|
||||||
goto INSIDE_MEM_FREE;
|
goto INSIDE_MEM_FREE;
|
||||||
}
|
}
|
||||||
if (g_LevelSetting >= 0) {
|
pPtrEnc->SetOption (ENCODER_OPTION_TRACE_LEVEL, &g_LevelSetting);
|
||||||
pPtrEnc->SetOption (ENCODER_OPTION_TRACE_LEVEL, &g_LevelSetting);
|
|
||||||
}
|
|
||||||
//finish reading the configurations
|
//finish reading the configurations
|
||||||
iSourceWidth = pSrcPic->iPicWidth;
|
iSourceWidth = pSrcPic->iPicWidth;
|
||||||
iSourceHeight = pSrcPic->iPicHeight;
|
iSourceHeight = pSrcPic->iPicHeight;
|
||||||
@@ -805,10 +851,10 @@ int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFi
|
|||||||
break;
|
break;
|
||||||
// To encoder this frame
|
// To encoder this frame
|
||||||
iStart = WelsTime();
|
iStart = WelsTime();
|
||||||
|
pSrcPic->uiTimeStamp = WELS_ROUND (iFrameIdx * (1000 / sSvcParam.fMaxFrameRate));
|
||||||
int iEncFrames = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
|
int iEncFrames = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
|
||||||
iTotal += WelsTime() - iStart;
|
iTotal += WelsTime() - iStart;
|
||||||
|
++ iFrameIdx;
|
||||||
// fixed issue in case dismatch source picture introduced by frame skipped, 1/12/2010
|
|
||||||
if (videoFrameTypeSkip == sFbi.eFrameType) {
|
if (videoFrameTypeSkip == sFbi.eFrameType) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -859,7 +905,6 @@ int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFi
|
|||||||
fprintf (stderr, "EncodeFrame(), ret: %d, frame index: %d.\n", iEncFrames, iFrameIdx);
|
fprintf (stderr, "EncodeFrame(), ret: %d, frame index: %d.\n", iEncFrames, iFrameIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
++ iFrameIdx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iActualFrameEncodedCount > 0) {
|
if (iActualFrameEncodedCount > 0) {
|
||||||
@@ -891,7 +936,7 @@ INSIDE_MEM_FREE:
|
|||||||
pFileYUV = NULL;
|
pFileYUV = NULL;
|
||||||
}
|
}
|
||||||
if (pYUV) {
|
if (pYUV) {
|
||||||
delete pYUV;
|
delete[] pYUV;
|
||||||
pYUV = NULL;
|
pYUV = NULL;
|
||||||
}
|
}
|
||||||
if (pSrcPic) {
|
if (pSrcPic) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ H264ENC_CPP_SRCS=\
|
|||||||
H264ENC_OBJS += $(H264ENC_CPP_SRCS:.cpp=.$(OBJ))
|
H264ENC_OBJS += $(H264ENC_CPP_SRCS:.cpp=.$(OBJ))
|
||||||
|
|
||||||
OBJS += $(H264ENC_OBJS)
|
OBJS += $(H264ENC_OBJS)
|
||||||
|
|
||||||
$(H264ENC_SRCDIR)/%.$(OBJ): $(H264ENC_SRCDIR)/%.cpp
|
$(H264ENC_SRCDIR)/%.$(OBJ): $(H264ENC_SRCDIR)/%.cpp
|
||||||
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c $(CXX_O) $<
|
$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c $(CXX_O) $<
|
||||||
|
|
||||||
|
|||||||
@@ -99,18 +99,6 @@
|
|||||||
// }
|
// }
|
||||||
.endm
|
.endm
|
||||||
#endif
|
#endif
|
||||||
// r0 int8_t* non_zero_count,
|
|
||||||
WELS_ASM_FUNC_BEGIN SetNonZeroCount_neon
|
|
||||||
vld1.64 {d0-d2}, [r0]
|
|
||||||
vceq.s8 q0, q0, #0
|
|
||||||
vceq.s8 d2, d2, #0
|
|
||||||
vmvn q0, q0
|
|
||||||
vmvn d2, d2
|
|
||||||
vabs.s8 q0, q0
|
|
||||||
vabs.s8 d2, d2
|
|
||||||
vst1.64 {d0-d2}, [r0]
|
|
||||||
WELS_ASM_FUNC_END
|
|
||||||
|
|
||||||
|
|
||||||
// uint8_t *pred, const int32_t stride, int16_t *rs
|
// uint8_t *pred, const int32_t stride, int16_t *rs
|
||||||
WELS_ASM_FUNC_BEGIN IdctResAddPred_neon
|
WELS_ASM_FUNC_BEGIN IdctResAddPred_neon
|
||||||
@@ -156,4 +144,22 @@ WELS_ASM_FUNC_BEGIN IdctResAddPred_neon
|
|||||||
vst1.32 {d22[0]},[r2],r1
|
vst1.32 {d22[0]},[r2],r1
|
||||||
vst1.32 {d22[1]},[r2]
|
vst1.32 {d22[1]},[r2]
|
||||||
WELS_ASM_FUNC_END
|
WELS_ASM_FUNC_END
|
||||||
|
|
||||||
|
|
||||||
|
WELS_ASM_FUNC_BEGIN WelsBlockZero16x16_neon
|
||||||
|
veor q0, q0
|
||||||
|
veor q1, q1
|
||||||
|
lsl r1, r1, 1
|
||||||
|
.rept 16
|
||||||
|
vst1.64 {q0, q1}, [r0], r1
|
||||||
|
.endr
|
||||||
|
WELS_ASM_FUNC_END
|
||||||
|
|
||||||
|
WELS_ASM_FUNC_BEGIN WelsBlockZero8x8_neon
|
||||||
|
veor q0, q0
|
||||||
|
lsl r1, r1, 1
|
||||||
|
.rept 8
|
||||||
|
vst1.64 {q0}, [r0], r1
|
||||||
|
.endr
|
||||||
|
WELS_ASM_FUNC_END
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -100,20 +100,6 @@
|
|||||||
// }
|
// }
|
||||||
.endm
|
.endm
|
||||||
#endif
|
#endif
|
||||||
// x0 int8_t* non_zero_count,
|
|
||||||
WELS_ASM_AARCH64_FUNC_BEGIN SetNonZeroCount_AArch64_neon
|
|
||||||
mov x1, x0
|
|
||||||
ld1 {v0.16b}, [x1], #16
|
|
||||||
ld1 {v1.8b}, [x1]
|
|
||||||
cmeq v0.16b, v0.16b, #0
|
|
||||||
cmeq v1.8b, v1.8b, #0
|
|
||||||
mvn v0.16b, v0.16b
|
|
||||||
mvn v1.8b, v1.8b
|
|
||||||
abs v0.16b, v0.16b
|
|
||||||
abs v1.8b, v1.8b
|
|
||||||
st1 {v0.16b}, [x0], #16
|
|
||||||
st1 {v1.8b}, [x0]
|
|
||||||
WELS_ASM_AARCH64_FUNC_END
|
|
||||||
|
|
||||||
// uint8_t *pred, const int32_t stride, int16_t *rs
|
// uint8_t *pred, const int32_t stride, int16_t *rs
|
||||||
WELS_ASM_AARCH64_FUNC_BEGIN IdctResAddPred_AArch64_neon
|
WELS_ASM_AARCH64_FUNC_BEGIN IdctResAddPred_AArch64_neon
|
||||||
@@ -158,4 +144,21 @@ WELS_ASM_AARCH64_FUNC_BEGIN IdctResAddPred_AArch64_neon
|
|||||||
st1 {v1.s}[0],[x2],x1
|
st1 {v1.s}[0],[x2],x1
|
||||||
st1 {v1.s}[1],[x2]
|
st1 {v1.s}[1],[x2]
|
||||||
WELS_ASM_AARCH64_FUNC_END
|
WELS_ASM_AARCH64_FUNC_END
|
||||||
|
|
||||||
|
WELS_ASM_AARCH64_FUNC_BEGIN WelsBlockZero16x16_AArch64_neon
|
||||||
|
eor v0.16b, v0.16b, v0.16b
|
||||||
|
eor v1.16b, v1.16b, v1.16b
|
||||||
|
lsl x1, x1, 1
|
||||||
|
.rept 16
|
||||||
|
st1 {v0.16b, v1.16b}, [x0], x1
|
||||||
|
.endr
|
||||||
|
WELS_ASM_AARCH64_FUNC_END
|
||||||
|
|
||||||
|
WELS_ASM_AARCH64_FUNC_BEGIN WelsBlockZero8x8_AArch64_neon
|
||||||
|
eor v0.16b, v0.16b, v0.16b
|
||||||
|
lsl x1, x1, 1
|
||||||
|
.rept 8
|
||||||
|
st1 {v0.16b}, [x0], x1
|
||||||
|
.endr
|
||||||
|
WELS_ASM_AARCH64_FUNC_END
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include "parameter_sets.h"
|
#include "parameter_sets.h"
|
||||||
#include "decoder_context.h"
|
#include "decoder_context.h"
|
||||||
|
|
||||||
|
#define DISABLE_HP_BRANCH_1_4
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -86,7 +87,7 @@ uint8_t* DetectStartCodePrefix (const uint8_t* kpBuf, int32_t* pOffset, int32_t
|
|||||||
uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeader, uint8_t* pSrcRbsp,
|
uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeader, uint8_t* pSrcRbsp,
|
||||||
int32_t iSrcRbspLen, uint8_t* pSrcNal, int32_t iSrcNalLen, int32_t* pConsumedBytes);
|
int32_t iSrcRbspLen, uint8_t* pSrcNal, int32_t iSrcNalLen, int32_t* pConsumedBytes);
|
||||||
|
|
||||||
int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t kiSrcLen);
|
int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t kiSrcLen, uint8_t* pSrcNal, const int32_t kSrcNalLen);
|
||||||
|
|
||||||
int32_t ParseRefBasePicMarking (PBitStringAux pBs, PRefBasePicMarking pRefBasePicMarking);
|
int32_t ParseRefBasePicMarking (PBitStringAux pBs, PRefBasePicMarking pRefBasePicMarking);
|
||||||
|
|
||||||
@@ -113,7 +114,7 @@ bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const
|
|||||||
* \note Call it in case eNalUnitType is SPS.
|
* \note Call it in case eNalUnitType is SPS.
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicWidth, int32_t* pPicHeight);
|
int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicWidth, int32_t* pPicHeight, uint8_t* pSrcNal, const int32_t kSrcNalLen);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
@@ -129,13 +130,28 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
* \note Call it in case eNalUnitType is PPS.
|
* \note Call it in case eNalUnitType is PPS.
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux);
|
int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, uint8_t* pSrcNal, const int32_t kSrcNalLen);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*************************************************************************************
|
||||||
|
* \brief to parse scaling list message payload
|
||||||
|
*
|
||||||
|
* \param PPS SPS scaling list matrix message to be parsed output
|
||||||
|
* \param pBsAux bitstream reader auxiliary
|
||||||
|
*
|
||||||
|
* \return 0 - successed
|
||||||
|
* 1 - failed
|
||||||
|
*
|
||||||
|
* \note Call it in case scaling matrix present at sps or pps
|
||||||
|
*************************************************************************************
|
||||||
|
*/
|
||||||
|
int32_t SetScalingListValue (uint8_t *pScalingList,int iScalingListNum,bool* bUseDefaultScalingMatrixFlag,PBitStringAux pBsAux);
|
||||||
|
int32_t ParseScalingList(PSps pSps,PBitStringAux pBs,bool bPPS,bool *bScalingListPresentFlag,uint8_t(*iScalingList4x4)[16],uint8_t(*iScalingList8x8)[64]);
|
||||||
/*!
|
/*!
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
* \brief to parse SEI message payload
|
* \brief to parse SEI message payload
|
||||||
*
|
*
|
||||||
* \param pSei sei message to be parsed output
|
* \param pSei sei message to be parsed output
|
||||||
* \param pBsAux bitstream reader auxiliary
|
* \param pBsAux bitstream reader auxiliary
|
||||||
*
|
*
|
||||||
* \return 0 - successed
|
* \return 0 - successed
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
#define WELS_BIT_STREAM_H__
|
#define WELS_BIT_STREAM_H__
|
||||||
|
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -64,9 +63,17 @@ typedef struct TagBitStringAux {
|
|||||||
*/
|
*/
|
||||||
int32_t InitBits (PBitStringAux pBitString, const uint8_t* kpBuf, const int32_t kiSize);
|
int32_t InitBits (PBitStringAux pBitString, const uint8_t* kpBuf, const int32_t kiSize);
|
||||||
|
|
||||||
void InitReadBits (PBitStringAux pBitString);
|
int32_t InitReadBits (PBitStringAux pBitString, intX_t iEndOffset);
|
||||||
|
|
||||||
|
|
||||||
|
//The following for writing bs in decoder for Parse Only purpose
|
||||||
|
void DecInitBitsForEncoding (PBitStringAux pBitString, uint8_t* kpBuf, const int32_t kiSize);
|
||||||
|
int32_t DecBsWriteBits (PBitStringAux pBitString, int32_t iLen, const uint32_t kuiValue);
|
||||||
|
int32_t DecBsWriteOneBit (PBitStringAux pBitString, const uint32_t kuiValue);
|
||||||
|
int32_t DecBsFlush (PBitStringAux pBitString);
|
||||||
|
int32_t DecBsWriteUe (PBitStringAux pBitString, const uint32_t kuiValue);
|
||||||
|
int32_t DecBsWriteSe (PBitStringAux pBitString, const int32_t kiValue);
|
||||||
|
int32_t DecBsRbspTrailingBits (PBitStringAux pBitString);
|
||||||
|
void RBSP2EBSP (uint8_t* pDstBuf, uint8_t* pSrcBuf, const int32_t kiSize);
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|
||||||
|
|||||||
111
codec/decoder/core/inc/cabac_decoder.h
Normal file
111
codec/decoder/core/inc/cabac_decoder.h
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*!
|
||||||
|
* \copy
|
||||||
|
* Copyright (c) 2009-2013, Cisco Systems
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* \file cabac_decoder.h
|
||||||
|
*
|
||||||
|
* \brief Interfaces introduced for cabac decoder
|
||||||
|
*
|
||||||
|
* \date 10/10/2014 Created
|
||||||
|
*
|
||||||
|
*************************************************************************************
|
||||||
|
*/
|
||||||
|
#ifndef WELS_CABAC_DECODER_H__
|
||||||
|
#define WELS_CABAC_DECODER_H__
|
||||||
|
|
||||||
|
#include "decoder_context.h"
|
||||||
|
#include "error_code.h"
|
||||||
|
#include "wels_common_defs.h"
|
||||||
|
namespace WelsDec {
|
||||||
|
static const uint8_t g_kRenormTable256[256] = {
|
||||||
|
6, 6, 6, 6, 6, 6, 6, 6,
|
||||||
|
5, 5, 5, 5, 5, 5, 5, 5,
|
||||||
|
4, 4, 4, 4, 4, 4, 4, 4,
|
||||||
|
4, 4, 4, 4, 4, 4, 4, 4,
|
||||||
|
3, 3, 3, 3, 3, 3, 3, 3,
|
||||||
|
3, 3, 3, 3, 3, 3, 3, 3,
|
||||||
|
3, 3, 3, 3, 3, 3, 3, 3,
|
||||||
|
3, 3, 3, 3, 3, 3, 3, 3,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//1. CABAC context initialization
|
||||||
|
void WelsCabacGlobalInit(PWelsDecoderContext pCabacCtx);
|
||||||
|
void WelsCabacContextInit (PWelsDecoderContext pCtx, uint8_t eSliceType, int32_t iCabacInitIdc, int32_t iQp);
|
||||||
|
|
||||||
|
//2. decoding Engine initialization
|
||||||
|
int32_t InitCabacDecEngineFromBS (PWelsCabacDecEngine pDecEngine, SBitStringAux* pBsAux);
|
||||||
|
void RestoreCabacDecEngineToBS (PWelsCabacDecEngine pDecEngine, SBitStringAux* pBsAux);
|
||||||
|
//3. actual decoding
|
||||||
|
int32_t Read32BitsCabac (PWelsCabacDecEngine pDecEngine, uint32_t& uiValue, int32_t& iNumBitsRead);
|
||||||
|
int32_t DecodeBinCabac (PWelsCabacDecEngine pDecEngine, PWelsCabacCtx pBinCtx, uint32_t& uiBit);
|
||||||
|
int32_t DecodeBypassCabac (PWelsCabacDecEngine pDecEngine, uint32_t& uiBinVal);
|
||||||
|
int32_t DecodeTerminateCabac (PWelsCabacDecEngine pDecEngine, uint32_t& uiBinVal);
|
||||||
|
|
||||||
|
//4. unary parsing
|
||||||
|
int32_t DecodeUnaryBinCabac (PWelsCabacDecEngine pDecEngine, PWelsCabacCtx pBinCtx, int32_t iCtxOffset,
|
||||||
|
uint32_t& uiSymVal);
|
||||||
|
|
||||||
|
//5. EXGk parsing
|
||||||
|
int32_t DecodeExpBypassCabac (PWelsCabacDecEngine pDecEngine, int32_t iCount, uint32_t& uiSymVal);
|
||||||
|
uint32_t DecodeUEGLevelCabac (PWelsCabacDecEngine pDecEngine, PWelsCabacCtx pBinCtx, uint32_t& uiBinVal);
|
||||||
|
int32_t DecodeUEGMvCabac (PWelsCabacDecEngine pDecEngine, PWelsCabacCtx pBinCtx, uint32_t iMaxC, uint32_t& uiCode);
|
||||||
|
|
||||||
|
#define WELS_CABAC_HALF 0x01FE
|
||||||
|
#define WELS_CABAC_QUARTER 0x0100
|
||||||
|
#define WELS_CABAC_FALSE_RETURN(iErrorInfo) \
|
||||||
|
if(iErrorInfo) { \
|
||||||
|
return iErrorInfo; \
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -66,15 +66,18 @@ struct TagDqLayer {
|
|||||||
int8_t* pMbType;
|
int8_t* pMbType;
|
||||||
int32_t* pSliceIdc; // using int32_t for slice_idc
|
int32_t* pSliceIdc; // using int32_t for slice_idc
|
||||||
int16_t (*pMv[LIST_A])[MB_BLOCK4x4_NUM][MV_A];
|
int16_t (*pMv[LIST_A])[MB_BLOCK4x4_NUM][MV_A];
|
||||||
|
int16_t (*pMvd[LIST_A])[MB_BLOCK4x4_NUM][MV_A];
|
||||||
int8_t (*pRefIndex[LIST_A])[MB_BLOCK4x4_NUM];
|
int8_t (*pRefIndex[LIST_A])[MB_BLOCK4x4_NUM];
|
||||||
int8_t* pLumaQp;
|
int8_t* pLumaQp;
|
||||||
int8_t* pChromaQp;
|
int8_t (*pChromaQp)[2];
|
||||||
int8_t* pCbp;
|
int8_t* pCbp;
|
||||||
|
uint8_t *pCbfDc;
|
||||||
int8_t (*pNzc)[24];
|
int8_t (*pNzc)[24];
|
||||||
int8_t (*pNzcRs)[24];
|
int8_t (*pNzcRs)[24];
|
||||||
int8_t* pResidualPredFlag;
|
int8_t* pResidualPredFlag;
|
||||||
int8_t* pInterPredictionDoneFlag;
|
int8_t* pInterPredictionDoneFlag;
|
||||||
bool* pMbCorrectlyDecodedFlag;
|
bool* pMbCorrectlyDecodedFlag;
|
||||||
|
bool* pMbRefConcealedFlag;
|
||||||
int16_t (*pScaledTCoeff)[MB_COEFF_LIST_SIZE];
|
int16_t (*pScaledTCoeff)[MB_COEFF_LIST_SIZE];
|
||||||
int8_t (*pIntraPredMode)[8]; //0~3 top4x4 ; 4~6 left 4x4; 7 intra16x16
|
int8_t (*pIntraPredMode)[8]; //0~3 top4x4 ; 4~6 left 4x4; 7 intra16x16
|
||||||
int8_t (*pIntra4x4FinalMode)[MB_BLOCK4x4_NUM];
|
int8_t (*pIntra4x4FinalMode)[MB_BLOCK4x4_NUM];
|
||||||
@@ -99,13 +102,16 @@ struct TagDqLayer {
|
|||||||
int32_t iInterLayerSliceBetaOffset;
|
int32_t iInterLayerSliceBetaOffset;
|
||||||
//SPosOffset sScaledRefLayer;
|
//SPosOffset sScaledRefLayer;
|
||||||
int32_t iSliceGroupChangeCycle;
|
int32_t iSliceGroupChangeCycle;
|
||||||
|
|
||||||
PRefPicListReorderSyn pRefPicListReordering;
|
PRefPicListReorderSyn pRefPicListReordering;
|
||||||
|
PPredWeightTabSyn pPredWeightTable;
|
||||||
PRefPicMarking pRefPicMarking; // Decoded reference picture marking syntaxs
|
PRefPicMarking pRefPicMarking; // Decoded reference picture marking syntaxs
|
||||||
PRefBasePicMarking pRefPicBaseMarking;
|
PRefBasePicMarking pRefPicBaseMarking;
|
||||||
|
|
||||||
PPicture pRef; // reference picture pointer
|
PPicture pRef; // reference picture pointer
|
||||||
PPicture pDec; // reconstruction picture pointer for layer
|
PPicture pDec; // reconstruction picture pointer for layer
|
||||||
|
|
||||||
|
bool bUseWeightPredictionFlag;
|
||||||
bool bStoreRefBasePicFlag; // iCurTid == 0 && iCurQid = 0 && bEncodeKeyPic = 1
|
bool bStoreRefBasePicFlag; // iCurTid == 0 && iCurQid = 0 && bEncodeKeyPic = 1
|
||||||
bool bTCoeffLevelPredFlag;
|
bool bTCoeffLevelPredFlag;
|
||||||
bool bConstrainedIntraResamplingFlag;
|
bool bConstrainedIntraResamplingFlag;
|
||||||
|
|||||||
@@ -89,7 +89,9 @@ static inline int32_t BsGetBits (PBitStringAux pBs, int32_t iNumBits, uint32_t*
|
|||||||
|
|
||||||
// for data sharing cross modules and try to reduce size of binary generated, 12/10/2009
|
// for data sharing cross modules and try to reduce size of binary generated, 12/10/2009
|
||||||
extern const uint8_t g_kuiIntra4x4CbpTable[48];
|
extern const uint8_t g_kuiIntra4x4CbpTable[48];
|
||||||
|
extern const uint8_t g_kuiIntra4x4CbpTable400[16];
|
||||||
extern const uint8_t g_kuiInterCbpTable[48];
|
extern const uint8_t g_kuiInterCbpTable[48];
|
||||||
|
extern const uint8_t g_kuiInterCbpTable400[16];
|
||||||
|
|
||||||
extern const uint8_t g_kuiLeadingZeroTable[256];
|
extern const uint8_t g_kuiLeadingZeroTable[256];
|
||||||
|
|
||||||
@@ -219,7 +221,7 @@ static inline int32_t BsGetTe0 (PBitStringAux pBs, int32_t iRange, uint32_t* pCo
|
|||||||
static inline int32_t BsGetTrailingBits (uint8_t* pBuf) {
|
static inline int32_t BsGetTrailingBits (uint8_t* pBuf) {
|
||||||
// TODO
|
// TODO
|
||||||
uint32_t uiValue = *pBuf;
|
uint32_t uiValue = *pBuf;
|
||||||
int32_t iRetNum = 1;
|
int32_t iRetNum = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (uiValue & 1)
|
if (uiValue & 1)
|
||||||
|
|||||||
@@ -38,24 +38,28 @@
|
|||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
|
||||||
int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx);
|
int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx);
|
||||||
int32_t WelsDecodeMbCavlcISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur);
|
int32_t WelsDecodeMbCavlcISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
|
||||||
|
|
||||||
int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx);
|
int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx);
|
||||||
int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur);
|
int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
|
||||||
typedef int32_t (*PWelsDecMbCavlcFunc) (PWelsDecoderContext pCtx, PNalUnit pNalCur);
|
typedef int32_t (*PWelsDecMbFunc) (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
|
||||||
|
|
||||||
|
int32_t WelsDecodeMbCabacISlice(PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
|
||||||
|
int32_t WelsDecodeMbCabacPSlice(PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
|
||||||
|
int32_t WelsDecodeMbCabacISliceBaseMode0(PWelsDecoderContext pCtx, uint32_t& uiEosFlag);
|
||||||
|
int32_t WelsDecodeMbCabacPSliceBaseMode0(PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiEosFlag);
|
||||||
|
|
||||||
int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx); //construction based on slice
|
int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx); //construction based on slice
|
||||||
|
|
||||||
int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNalUnit pNalCur);
|
int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNalUnit pNalCur);
|
||||||
|
|
||||||
|
|
||||||
int32_t WelsTargetMbConstruction (PWelsDecoderContext pCtx);
|
int32_t WelsTargetMbConstruction (PWelsDecoderContext pCtx);
|
||||||
|
|
||||||
int32_t WelsMbIntraPredictionConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer, bool bOutput);
|
int32_t WelsMbIntraPredictionConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer, bool bOutput);
|
||||||
int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer,
|
int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer,
|
||||||
uint8_t* pDstY, uint8_t* pDstU, uint8_t* pDstV, int32_t iStrideL, int32_t iStrideC);
|
uint8_t* pDstY, uint8_t* pDstU, uint8_t* pDstV, int32_t iStrideL, int32_t iStrideC);
|
||||||
int32_t WelsMbInterConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer);
|
int32_t WelsMbInterConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer);
|
||||||
void WelsLumaDcDequantIdct (int16_t* pBlock, int32_t iQp);
|
void WelsLumaDcDequantIdct (int16_t* pBlock, int32_t iQp,PWelsDecoderContext pCtx);
|
||||||
int32_t WelsMbInterPrediction (PWelsDecoderContext pCtx, PDqLayer pCurLayer);
|
int32_t WelsMbInterPrediction (PWelsDecoderContext pCtx, PDqLayer pCurLayer);
|
||||||
void WelsChromaDcIdct (int16_t* pBlock);
|
void WelsChromaDcIdct (int16_t* pBlock);
|
||||||
|
|
||||||
@@ -63,20 +67,27 @@ void WelsChromaDcIdct (int16_t* pBlock);
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
|
|
||||||
|
#if defined(X86_ASM)
|
||||||
|
void WelsBlockZero16x16_sse2(int16_t * block, int32_t stride);
|
||||||
|
void WelsBlockZero8x8_sse2(int16_t * block, int32_t stride);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NEON)
|
#if defined(HAVE_NEON)
|
||||||
void SetNonZeroCount_neon (int8_t* pNonZeroCount);
|
void WelsBlockZero16x16_neon(int16_t * block, int32_t stride);
|
||||||
|
void WelsBlockZero8x8_neon(int16_t * block, int32_t stride);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NEON_AARCH64)
|
#if defined(HAVE_NEON_AARCH64)
|
||||||
void SetNonZeroCount_AArch64_neon (int8_t* pNonZeroCount);
|
void WelsBlockZero16x16_AArch64_neon(int16_t * block, int32_t stride);
|
||||||
|
void WelsBlockZero8x8_AArch64_neon(int16_t * block, int32_t stride);
|
||||||
#endif
|
#endif
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
|
|
||||||
void SetNonZeroCount_c (int8_t* pNonZeroCount);
|
|
||||||
|
|
||||||
void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu);
|
void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu);
|
||||||
|
void WelsBlockZero16x16_c(int16_t * block, int32_t stride);
|
||||||
|
void WelsBlockZero8x8_c(int16_t * block, int32_t stride);
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa
|
|||||||
* \note N/A
|
* \note N/A
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
int32_t WelsInitDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx);
|
int32_t WelsInitDecoder (PWelsDecoderContext pCtx, const bool bParseOnly, SLogContext* pLogCtx);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
@@ -101,7 +101,7 @@ void WelsEndDecoder (PWelsDecoderContext pCtx);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const int32_t kiBsLen,
|
int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const int32_t kiBsLen,
|
||||||
uint8_t** ppDst, SBufferInfo* pDstBufInfo);
|
uint8_t** ppDst, SBufferInfo* pDstBufInfo, SParserBsInfo* pDstBsInfo);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* request memory blocks for decoder avc part
|
* request memory blocks for decoder avc part
|
||||||
@@ -132,11 +132,19 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi
|
|||||||
|
|
||||||
void AssignFuncPointerForRec (PWelsDecoderContext pCtx);
|
void AssignFuncPointerForRec (PWelsDecoderContext pCtx);
|
||||||
|
|
||||||
void ResetParameterSetsState (PWelsDecoderContext pCtx);
|
|
||||||
|
|
||||||
void GetVclNalTemporalId (PWelsDecoderContext pCtx); //get the info that whether or not have VCL NAL in current AU,
|
void GetVclNalTemporalId (PWelsDecoderContext pCtx); //get the info that whether or not have VCL NAL in current AU,
|
||||||
//and if YES, get the temporal ID
|
//and if YES, get the temporal ID
|
||||||
|
|
||||||
|
//reset decoder number related statistics info
|
||||||
|
void ResetDecStatNums (SDecoderStatistics* pDecStat);
|
||||||
|
//update information when freezing occurs, including IDR/non-IDR number
|
||||||
|
void UpdateDecStatFreezingInfo (const bool kbIdrFlag, SDecoderStatistics* pDecStat);
|
||||||
|
//update information when no freezing occurs, including QP, correct IDR number, ECed IDR number
|
||||||
|
void UpdateDecStatNoFreezingInfo (PWelsDecoderContext pCtx);
|
||||||
|
//update decoder statistics information
|
||||||
|
void UpdateDecStat (PWelsDecoderContext pCtx, const bool kbOutput);
|
||||||
|
//Destroy picutre buffer
|
||||||
|
void DestroyPicBuff (PPicBuff* ppPicBuf);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "wels_const.h"
|
#include "wels_const.h"
|
||||||
#include "wels_common_basis.h"
|
#include "wels_common_basis.h"
|
||||||
|
#include "wels_common_defs.h"
|
||||||
#include "codec_app_def.h"
|
#include "codec_app_def.h"
|
||||||
#include "parameter_sets.h"
|
#include "parameter_sets.h"
|
||||||
#include "nalu.h"
|
#include "nalu.h"
|
||||||
@@ -54,17 +55,66 @@
|
|||||||
#include "crt_util_safe_x.h"
|
#include "crt_util_safe_x.h"
|
||||||
#include "mb_cache.h"
|
#include "mb_cache.h"
|
||||||
#include "expand_pic.h"
|
#include "expand_pic.h"
|
||||||
|
#include "mc.h"
|
||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
#define MAX_PRED_MODE_ID_I16x16 3
|
||||||
|
#define MAX_PRED_MODE_ID_CHROMA 3
|
||||||
|
#define MAX_PRED_MODE_ID_I4x4 8
|
||||||
|
#define WELS_QP_MAX 51
|
||||||
|
|
||||||
|
typedef struct SWels_Cabac_Element {
|
||||||
|
uint8_t uiState;
|
||||||
|
uint8_t uiMPS;
|
||||||
|
} SWelsCabacCtx, *PWelsCabacCtx;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint64_t uiRange;
|
||||||
|
uint64_t uiOffset;
|
||||||
|
int32_t iBitsLeft;
|
||||||
|
uint8_t* pBuffStart;
|
||||||
|
uint8_t* pBuffCurr;
|
||||||
|
uint8_t* pBuffEnd;
|
||||||
|
} SWelsCabacDecEngine, *PWelsCabacDecEngine;
|
||||||
|
|
||||||
|
#define NEW_CTX_OFFSET_MB_TYPE_I 3
|
||||||
|
#define NEW_CTX_OFFSET_SKIP 11
|
||||||
|
#define NEW_CTX_OFFSET_SUBMB_TYPE 21
|
||||||
|
#define NEW_CTX_OFFSET_MVD 40
|
||||||
|
#define NEW_CTX_OFFSET_REF_NO 54
|
||||||
|
#define NEW_CTX_OFFSET_DELTA_QP 60
|
||||||
|
#define NEW_CTX_OFFSET_IPR 68
|
||||||
|
#define NEW_CTX_OFFSET_CIPR 64
|
||||||
|
#define NEW_CTX_OFFSET_CBP 73
|
||||||
|
#define NEW_CTX_OFFSET_CBF 85
|
||||||
|
#define NEW_CTX_OFFSET_MAP 105
|
||||||
|
#define NEW_CTX_OFFSET_LAST 166
|
||||||
|
#define NEW_CTX_OFFSET_ONE 227
|
||||||
|
#define NEW_CTX_OFFSET_ABS 232
|
||||||
|
#define CTX_NUM_MVD 7
|
||||||
|
#define CTX_NUM_CBP 4
|
||||||
|
|
||||||
typedef struct TagDataBuffer {
|
typedef struct TagDataBuffer {
|
||||||
uint8_t* pHead;
|
uint8_t* pHead;
|
||||||
uint8_t* pEnd;
|
uint8_t* pEnd;
|
||||||
|
|
||||||
uint8_t* pStartPos;
|
uint8_t* pStartPos;
|
||||||
uint8_t* pCurPos;
|
uint8_t* pCurPos;
|
||||||
} SDataBuffer;
|
} SDataBuffer;
|
||||||
|
|
||||||
|
//limit size for SPS PPS total permitted size for parse_only
|
||||||
|
#define SPS_PPS_BS_SIZE 128
|
||||||
|
typedef struct TagSpsBsInfo {
|
||||||
|
uint8_t pSpsBsBuf [SPS_PPS_BS_SIZE];
|
||||||
|
int32_t iSpsId;
|
||||||
|
uint16_t uiSpsBsLen;
|
||||||
|
} SSpsBsInfo;
|
||||||
|
|
||||||
|
typedef struct TagPpsBsInfo {
|
||||||
|
uint8_t pPpsBsBuf [SPS_PPS_BS_SIZE];
|
||||||
|
int32_t iPpsId;
|
||||||
|
uint16_t uiPpsBsLen;
|
||||||
|
} SPpsBsInfo;
|
||||||
//#ifdef __cplusplus
|
//#ifdef __cplusplus
|
||||||
//extern "C" {
|
//extern "C" {
|
||||||
//#endif//__cplusplus
|
//#endif//__cplusplus
|
||||||
@@ -83,40 +133,33 @@ typedef void (*PExpandPictureFunc) (uint8_t* pDst, const int32_t kiStride, const
|
|||||||
|
|
||||||
/**/
|
/**/
|
||||||
typedef struct TagRefPic {
|
typedef struct TagRefPic {
|
||||||
PPicture pRefList[LIST_A][MAX_REF_PIC_COUNT]; // reference picture marking plus FIFO scheme
|
PPicture pRefList[LIST_A][MAX_REF_PIC_COUNT]; // reference picture marking plus FIFO scheme
|
||||||
PPicture pShortRefList[LIST_A][MAX_SHORT_REF_COUNT];
|
PPicture pShortRefList[LIST_A][MAX_SHORT_REF_COUNT];
|
||||||
PPicture pLongRefList[LIST_A][MAX_LONG_REF_COUNT];
|
PPicture pLongRefList[LIST_A][MAX_LONG_REF_COUNT];
|
||||||
uint8_t uiRefCount[LIST_A];
|
uint8_t uiRefCount[LIST_A];
|
||||||
uint8_t uiShortRefCount[LIST_A];
|
uint8_t uiShortRefCount[LIST_A];
|
||||||
uint8_t uiLongRefCount[LIST_A]; // dependend on ref pic module
|
uint8_t uiLongRefCount[LIST_A]; // dependend on ref pic module
|
||||||
int32_t iMaxLongTermFrameIdx;
|
int32_t iMaxLongTermFrameIdx;
|
||||||
} SRefPic, *PRefPic;
|
} SRefPic, *PRefPic;
|
||||||
|
|
||||||
typedef void (*PWelsMcFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
|
|
||||||
int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight);
|
|
||||||
typedef struct TagMcFunc {
|
|
||||||
PWelsMcFunc pMcLumaFunc;
|
|
||||||
PWelsMcFunc pMcChromaFunc;
|
|
||||||
} SMcFunc;
|
|
||||||
|
|
||||||
typedef void (*PCopyFunc) (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
typedef void (*PCopyFunc) (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||||
typedef struct TagCopyFunc {
|
typedef struct TagCopyFunc {
|
||||||
PCopyFunc pCopyLumaFunc;
|
PCopyFunc pCopyLumaFunc;
|
||||||
PCopyFunc pCopyChromaFunc;
|
PCopyFunc pCopyChromaFunc;
|
||||||
} SCopyFunc;
|
} SCopyFunc;
|
||||||
|
|
||||||
//deblock module defination
|
//deblock module defination
|
||||||
struct TagDeblockingFunc;
|
struct TagDeblockingFunc;
|
||||||
|
|
||||||
typedef struct tagDeblockingFilter {
|
typedef struct tagDeblockingFilter {
|
||||||
uint8_t* pCsData[3]; // pointer to reconstructed picture data
|
uint8_t* pCsData[3]; // pointer to reconstructed picture data
|
||||||
int32_t iCsStride[2]; // Cs stride
|
int32_t iCsStride[2]; // Cs stride
|
||||||
EWelsSliceType eSliceType;
|
EWelsSliceType eSliceType;
|
||||||
int8_t iSliceAlphaC0Offset;
|
int8_t iSliceAlphaC0Offset;
|
||||||
int8_t iSliceBetaOffset;
|
int8_t iSliceBetaOffset;
|
||||||
int8_t iChromaQP;
|
int8_t iChromaQP[2];
|
||||||
int8_t iLumaQP;
|
int8_t iLumaQP;
|
||||||
struct TagDeblockingFunc* pLoopf;
|
struct TagDeblockingFunc* pLoopf;
|
||||||
} SDeblockingFilter, *PDeblockingFilter;
|
} SDeblockingFilter, *PDeblockingFilter;
|
||||||
|
|
||||||
typedef void (*PDeblockingFilterMbFunc) (PDqLayer pCurDqLayer, PDeblockingFilter filter, int32_t boundry_flag);
|
typedef void (*PDeblockingFilterMbFunc) (PDqLayer pCurDqLayer, PDeblockingFilter filter, int32_t boundry_flag);
|
||||||
@@ -127,36 +170,50 @@ typedef void (*PChromaDeblockingLT4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr
|
|||||||
int32_t iBeta, int8_t* iTc);
|
int32_t iBeta, int8_t* iTc);
|
||||||
typedef void (*PChromaDeblockingEQ4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr, int32_t iStride, int32_t iAlpha,
|
typedef void (*PChromaDeblockingEQ4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr, int32_t iStride, int32_t iAlpha,
|
||||||
int32_t iBeta);
|
int32_t iBeta);
|
||||||
|
typedef void (*PChromaDeblockingLT4Func2) (uint8_t* iSampleCbr, int32_t iStride, int32_t iAlpha,
|
||||||
|
int32_t iBeta, int8_t* iTc);
|
||||||
|
typedef void (*PChromaDeblockingEQ4Func2) (uint8_t* iSampleCbr, int32_t iStride, int32_t iAlpha,
|
||||||
|
int32_t iBeta);
|
||||||
|
|
||||||
typedef struct TagDeblockingFunc {
|
typedef struct TagDeblockingFunc {
|
||||||
PLumaDeblockingLT4Func pfLumaDeblockingLT4Ver;
|
PLumaDeblockingLT4Func pfLumaDeblockingLT4Ver;
|
||||||
PLumaDeblockingEQ4Func pfLumaDeblockingEQ4Ver;
|
PLumaDeblockingEQ4Func pfLumaDeblockingEQ4Ver;
|
||||||
PLumaDeblockingLT4Func pfLumaDeblockingLT4Hor;
|
PLumaDeblockingLT4Func pfLumaDeblockingLT4Hor;
|
||||||
PLumaDeblockingEQ4Func pfLumaDeblockingEQ4Hor;
|
PLumaDeblockingEQ4Func pfLumaDeblockingEQ4Hor;
|
||||||
|
|
||||||
|
PChromaDeblockingLT4Func pfChromaDeblockingLT4Ver;
|
||||||
|
PChromaDeblockingEQ4Func pfChromaDeblockingEQ4Ver;
|
||||||
|
PChromaDeblockingLT4Func pfChromaDeblockingLT4Hor;
|
||||||
|
PChromaDeblockingEQ4Func pfChromaDeblockingEQ4Hor;
|
||||||
|
|
||||||
|
PChromaDeblockingLT4Func2 pfChromaDeblockingLT4Ver2;
|
||||||
|
PChromaDeblockingEQ4Func2 pfChromaDeblockingEQ4Ver2;
|
||||||
|
PChromaDeblockingLT4Func2 pfChromaDeblockingLT4Hor2;
|
||||||
|
PChromaDeblockingEQ4Func2 pfChromaDeblockingEQ4Hor2;
|
||||||
|
|
||||||
PChromaDeblockingLT4Func pfChromaDeblockingLT4Ver;
|
|
||||||
PChromaDeblockingEQ4Func pfChromaDeblockingEQ4Ver;
|
|
||||||
PChromaDeblockingLT4Func pfChromaDeblockingLT4Hor;
|
|
||||||
PChromaDeblockingEQ4Func pfChromaDeblockingEQ4Hor;
|
|
||||||
} SDeblockingFunc, *PDeblockingFunc;
|
} SDeblockingFunc, *PDeblockingFunc;
|
||||||
|
|
||||||
typedef void (*PWelsNonZeroCountFunc) (int8_t* pNonZeroCount);
|
typedef void (*PWelsNonZeroCountFunc) (int8_t* pNonZeroCount);
|
||||||
|
typedef void (*PWelsBlockZeroFunc) (int16_t* block, int32_t stride);
|
||||||
typedef struct TagBlockFunc {
|
typedef struct TagBlockFunc {
|
||||||
PWelsNonZeroCountFunc pWelsSetNonZeroCountFunc;
|
PWelsNonZeroCountFunc pWelsSetNonZeroCountFunc;
|
||||||
|
PWelsBlockZeroFunc pWelsBlockZero16x16Func;
|
||||||
|
PWelsBlockZeroFunc pWelsBlockZero8x8Func;
|
||||||
} SBlockFunc;
|
} SBlockFunc;
|
||||||
|
|
||||||
typedef void (*PWelsFillNeighborMbInfoIntra4x4Func) (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
typedef void (*PWelsFillNeighborMbInfoIntra4x4Func) (PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
||||||
int8_t* pIntraPredMode, PDqLayer pCurLayer);
|
int8_t* pIntraPredMode, PDqLayer pCurLayer);
|
||||||
typedef int32_t (*PWelsParseIntra4x4ModeFunc) (PNeighAvail pNeighAvail, int8_t* pIntraPredMode, PBitStringAux pBs,
|
typedef void (*PWelsMapNeighToSample) (PWelsNeighAvail pNeighAvail, int32_t* pSampleAvail);
|
||||||
|
typedef void (*PWelsMap16NeighToSample) (PWelsNeighAvail pNeighAvail, uint8_t* pSampleAvail);
|
||||||
|
typedef int32_t (*PWelsParseIntra4x4ModeFunc) (PWelsNeighAvail pNeighAvail, int8_t* pIntraPredMode, PBitStringAux pBs,
|
||||||
PDqLayer pCurDqLayer);
|
PDqLayer pCurDqLayer);
|
||||||
typedef int32_t (*PWelsParseIntra16x16ModeFunc) (PNeighAvail pNeighAvail, PBitStringAux pBs, PDqLayer pCurDqLayer);
|
typedef int32_t (*PWelsParseIntra16x16ModeFunc) (PWelsNeighAvail pNeighAvail, PBitStringAux pBs, PDqLayer pCurDqLayer);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
OVERWRITE_NONE = 0,
|
OVERWRITE_NONE = 0,
|
||||||
OVERWRITE_PPS = 1,
|
OVERWRITE_PPS = 1,
|
||||||
OVERWRITE_SPS = 1 << 1,
|
OVERWRITE_SPS = 1 << 1,
|
||||||
OVERWRITE_SUBSETSPS = 1 << 2
|
OVERWRITE_SUBSETSPS = 1 << 2
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -164,180 +221,234 @@ OVERWRITE_SUBSETSPS = 1 << 2
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct TagWelsDecoderContext {
|
typedef struct TagWelsDecoderContext {
|
||||||
SLogContext sLogCtx;
|
SLogContext sLogCtx;
|
||||||
// Input
|
// Input
|
||||||
void* pArgDec; // structured arguments for decoder, reserved here for extension in the future
|
void* pArgDec; // structured arguments for decoder, reserved here for extension in the future
|
||||||
|
|
||||||
SDataBuffer sRawData;
|
SDataBuffer sRawData;
|
||||||
|
SDataBuffer sSavedData; //for parse only purpose
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
SDecodingParam* pParam;
|
SDecodingParam* pParam;
|
||||||
uint32_t uiCpuFlag; // CPU compatibility detected
|
uint32_t uiCpuFlag; // CPU compatibility detected
|
||||||
|
|
||||||
EVideoFormatType eOutputColorFormat; // color space format to be outputed
|
EVideoFormatType eOutputColorFormat; // color space format to be outputed
|
||||||
VIDEO_BITSTREAM_TYPE eVideoType; //indicate the type of video to decide whether or not to do qp_delta error detection.
|
VIDEO_BITSTREAM_TYPE eVideoType; //indicate the type of video to decide whether or not to do qp_delta error detection.
|
||||||
bool bHaveGotMemory; // global memory for decoder context related ever requested?
|
bool bHaveGotMemory; // global memory for decoder context related ever requested?
|
||||||
|
|
||||||
|
int32_t iImgWidthInPixel; // width of image in pixel reconstruction picture to be output
|
||||||
|
int32_t iImgHeightInPixel;// height of image in pixel reconstruction picture to be output
|
||||||
|
int32_t iLastImgWidthInPixel; // width of image in last successful pixel reconstruction picture to be output
|
||||||
|
int32_t iLastImgHeightInPixel;// height of image in last successful pixel reconstruction picture to be output
|
||||||
|
bool bFreezeOutput; // indicating current frame freezing. Default: true
|
||||||
|
|
||||||
int32_t iImgWidthInPixel; // width of image in pixel reconstruction picture to be output
|
|
||||||
int32_t iImgHeightInPixel;// height of image in pixel reconstruction picture to be output
|
|
||||||
|
|
||||||
// Derived common elements
|
// Derived common elements
|
||||||
SNalUnitHeader sCurNalHead;
|
SNalUnitHeader sCurNalHead;
|
||||||
EWelsSliceType eSliceType; // Slice type
|
EWelsSliceType eSliceType; // Slice type
|
||||||
int32_t iFrameNum;
|
int32_t iFrameNum;
|
||||||
int32_t iPrevFrameNum; // frame number of previous frame well decoded for non-truncated mode yet
|
int32_t iPrevFrameNum; // frame number of previous frame well decoded for non-truncated mode yet
|
||||||
bool bLastHasMmco5; //
|
bool bLastHasMmco5; //
|
||||||
int32_t iErrorCode; // error code return while decoding in case packets lost
|
int32_t iErrorCode; // error code return while decoding in case packets lost
|
||||||
SFmo sFmoList[MAX_PPS_COUNT]; // list for FMO storage
|
SFmo sFmoList[MAX_PPS_COUNT]; // list for FMO storage
|
||||||
PFmo pFmo; // current fmo context after parsed slice_header
|
PFmo pFmo; // current fmo context after parsed slice_header
|
||||||
int32_t iActiveFmoNum; // active count number of fmo context in list
|
int32_t iActiveFmoNum; // active count number of fmo context in list
|
||||||
|
|
||||||
/*needed info by decode slice level and mb level*/
|
/*needed info by decode slice level and mb level*/
|
||||||
int32_t
|
int32_t
|
||||||
iDecBlockOffsetArray[24]; // address talbe for sub 4x4 block in intra4x4_mb, so no need to caculta the address every time.
|
iDecBlockOffsetArray[24]; // address talbe for sub 4x4 block in intra4x4_mb, so no need to caculta the address every time.
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int8_t* pMbType[LAYER_NUM_EXCHANGEABLE]; /* mb type */
|
int8_t* pMbType[LAYER_NUM_EXCHANGEABLE]; /* mb type */
|
||||||
int16_t (*pMv[LAYER_NUM_EXCHANGEABLE][LIST_A])[MB_BLOCK4x4_NUM][MV_A]; //[LAYER_NUM_EXCHANGEABLE MB_BLOCK4x4_NUM*]
|
int16_t (*pMv[LAYER_NUM_EXCHANGEABLE][LIST_A])[MB_BLOCK4x4_NUM][MV_A]; //[LAYER_NUM_EXCHANGEABLE MB_BLOCK4x4_NUM*]
|
||||||
int8_t (*pRefIndex[LAYER_NUM_EXCHANGEABLE][LIST_A])[MB_BLOCK4x4_NUM];
|
int8_t (*pRefIndex[LAYER_NUM_EXCHANGEABLE][LIST_A])[MB_BLOCK4x4_NUM];
|
||||||
int8_t* pLumaQp[LAYER_NUM_EXCHANGEABLE]; /*mb luma_qp*/
|
int8_t* pLumaQp[LAYER_NUM_EXCHANGEABLE]; /*mb luma_qp*/
|
||||||
int8_t* pChromaQp[LAYER_NUM_EXCHANGEABLE]; /*mb chroma_qp*/
|
int8_t (*pChromaQp[LAYER_NUM_EXCHANGEABLE])[2]; /*mb chroma_qp*/
|
||||||
int8_t (*pNzc[LAYER_NUM_EXCHANGEABLE])[24];
|
int16_t (*pMvd[LAYER_NUM_EXCHANGEABLE][LIST_A])[MB_BLOCK4x4_NUM][MV_A]; //[LAYER_NUM_EXCHANGEABLE MB_BLOCK4x4_NUM*]
|
||||||
int8_t (*pNzcRs[LAYER_NUM_EXCHANGEABLE])[24];
|
uint8_t* pCbfDc[LAYER_NUM_EXCHANGEABLE];
|
||||||
int16_t (*pScaledTCoeff[LAYER_NUM_EXCHANGEABLE])[MB_COEFF_LIST_SIZE]; /*need be aligned*/
|
int8_t (*pNzc[LAYER_NUM_EXCHANGEABLE])[24];
|
||||||
int8_t (*pIntraPredMode[LAYER_NUM_EXCHANGEABLE])[8]; //0~3 top4x4 ; 4~6 left 4x4; 7 intra16x16
|
int8_t (*pNzcRs[LAYER_NUM_EXCHANGEABLE])[24];
|
||||||
int8_t (*pIntra4x4FinalMode[LAYER_NUM_EXCHANGEABLE])[MB_BLOCK4x4_NUM];
|
int16_t (*pScaledTCoeff[LAYER_NUM_EXCHANGEABLE])[MB_COEFF_LIST_SIZE]; /*need be aligned*/
|
||||||
int8_t* pChromaPredMode[LAYER_NUM_EXCHANGEABLE];
|
int8_t (*pIntraPredMode[LAYER_NUM_EXCHANGEABLE])[8]; //0~3 top4x4 ; 4~6 left 4x4; 7 intra16x16
|
||||||
int8_t* pCbp[LAYER_NUM_EXCHANGEABLE];
|
int8_t (*pIntra4x4FinalMode[LAYER_NUM_EXCHANGEABLE])[MB_BLOCK4x4_NUM];
|
||||||
uint8_t (*pMotionPredFlag[LAYER_NUM_EXCHANGEABLE][LIST_A])[MB_PARTITION_SIZE]; // 8x8
|
int8_t* pChromaPredMode[LAYER_NUM_EXCHANGEABLE];
|
||||||
int8_t (*pSubMbType[LAYER_NUM_EXCHANGEABLE])[MB_SUB_PARTITION_SIZE];
|
int8_t* pCbp[LAYER_NUM_EXCHANGEABLE];
|
||||||
int32_t* pSliceIdc[LAYER_NUM_EXCHANGEABLE]; // using int32_t for slice_idc
|
uint8_t (*pMotionPredFlag[LAYER_NUM_EXCHANGEABLE][LIST_A])[MB_PARTITION_SIZE]; // 8x8
|
||||||
int8_t* pResidualPredFlag[LAYER_NUM_EXCHANGEABLE];
|
int8_t (*pSubMbType[LAYER_NUM_EXCHANGEABLE])[MB_SUB_PARTITION_SIZE];
|
||||||
int8_t* pInterPredictionDoneFlag[LAYER_NUM_EXCHANGEABLE];
|
int32_t* pSliceIdc[LAYER_NUM_EXCHANGEABLE]; // using int32_t for slice_idc
|
||||||
bool* pMbCorrectlyDecodedFlag[LAYER_NUM_EXCHANGEABLE];
|
int8_t* pResidualPredFlag[LAYER_NUM_EXCHANGEABLE];
|
||||||
uint32_t iMbWidth;
|
int8_t* pInterPredictionDoneFlag[LAYER_NUM_EXCHANGEABLE];
|
||||||
uint32_t iMbHeight;
|
bool* pMbCorrectlyDecodedFlag[LAYER_NUM_EXCHANGEABLE];
|
||||||
} sMb;
|
bool* pMbRefConcealedFlag[LAYER_NUM_EXCHANGEABLE];
|
||||||
|
uint32_t iMbWidth;
|
||||||
|
uint32_t iMbHeight;
|
||||||
|
} sMb;
|
||||||
|
|
||||||
|
|
||||||
// reconstruction picture
|
// reconstruction picture
|
||||||
PPicture pDec; //pointer to current picture being reconstructed
|
PPicture pDec; //pointer to current picture being reconstructed
|
||||||
|
|
||||||
// reference pictures
|
// reference pictures
|
||||||
SRefPic sRefPic;
|
SRefPic sRefPic;
|
||||||
|
|
||||||
SVlcTable sVlcTable; // vlc table
|
SVlcTable sVlcTable; // vlc table
|
||||||
|
|
||||||
SBitStringAux sBs;
|
SBitStringAux sBs;
|
||||||
int32_t iMaxBsBufferSizeInByte; //actual memory size for BS buffer
|
int32_t iMaxBsBufferSizeInByte; //actual memory size for BS buffer
|
||||||
|
|
||||||
/* Global memory external */
|
/* Global memory external */
|
||||||
|
|
||||||
SPosOffset sFrameCrop;
|
SPosOffset sFrameCrop;
|
||||||
|
|
||||||
SSps sSpsBuffer[MAX_SPS_COUNT + 1];
|
SSps sSpsBuffer[MAX_SPS_COUNT + 1];
|
||||||
SPps sPpsBuffer[MAX_PPS_COUNT + 1];
|
SPps sPpsBuffer[MAX_PPS_COUNT + 1];
|
||||||
PSliceHeader pSliceHeader;
|
PSliceHeader pSliceHeader;
|
||||||
|
|
||||||
PPicBuff pPicBuff[LIST_A]; // Initially allocated memory for pictures which are used in decoding.
|
PPicBuff pPicBuff[LIST_A]; // Initially allocated memory for pictures which are used in decoding.
|
||||||
int32_t iPicQueueNumber;
|
int32_t iPicQueueNumber;
|
||||||
|
|
||||||
SSubsetSps sSubsetSpsBuffer[MAX_SPS_COUNT + 1];
|
SSubsetSps sSubsetSpsBuffer[MAX_SPS_COUNT + 1];
|
||||||
SNalUnit sPrefixNal;
|
SNalUnit sPrefixNal;
|
||||||
|
|
||||||
PAccessUnit pAccessUnitList; // current access unit list to be performed
|
PAccessUnit pAccessUnitList; // current access unit list to be performed
|
||||||
PSps pActiveLayerSps[MAX_LAYER_NUM];
|
PSps pActiveLayerSps[MAX_LAYER_NUM];
|
||||||
PSps pSps; // used by current AU
|
PSps pSps; // used by current AU
|
||||||
PPps pPps; // used by current AU
|
PPps pPps; // used by current AU
|
||||||
// Memory for pAccessUnitList is dynamically held till decoder destruction.
|
// Memory for pAccessUnitList is dynamically held till decoder destruction.
|
||||||
PDqLayer pCurDqLayer; // current DQ layer representation, also carry reference base layer if applicable
|
PDqLayer pCurDqLayer; // current DQ layer representation, also carry reference base layer if applicable
|
||||||
PDqLayer pDqLayersList[LAYER_NUM_EXCHANGEABLE]; // DQ layers list with memory allocated
|
PDqLayer pDqLayersList[LAYER_NUM_EXCHANGEABLE]; // DQ layers list with memory allocated
|
||||||
|
|
||||||
int32_t iPicWidthReq; // picture width have requested the memory
|
int32_t iPicWidthReq; // picture width have requested the memory
|
||||||
int32_t iPicHeightReq; // picture height have requested the memory
|
int32_t iPicHeightReq; // picture height have requested the memory
|
||||||
|
|
||||||
uint8_t uiTargetDqId; // maximal DQ ID in current access unit, meaning target layer ID
|
uint8_t uiTargetDqId; // maximal DQ ID in current access unit, meaning target layer ID
|
||||||
bool bAvcBasedFlag; // For decoding bitstream:
|
bool bAvcBasedFlag; // For decoding bitstream:
|
||||||
bool bEndOfStreamFlag; // Flag on end of stream requested by external application layer
|
bool bEndOfStreamFlag; // Flag on end of stream requested by external application layer
|
||||||
bool bInstantDecFlag; // Flag for no-delay decoding
|
bool bInstantDecFlag; // Flag for no-delay decoding
|
||||||
bool bInitialDqLayersMem; // dq layers related memory is available?
|
bool bInitialDqLayersMem; // dq layers related memory is available?
|
||||||
|
|
||||||
bool bOnlyOneLayerInCurAuFlag; //only one layer in current AU: 1
|
bool bOnlyOneLayerInCurAuFlag; //only one layer in current AU: 1
|
||||||
|
|
||||||
// for EC parameter sets
|
// for EC parameter sets
|
||||||
bool bSpsExistAheadFlag; // whether does SPS NAL exist ahead of sequence?
|
bool bSpsExistAheadFlag; // whether does SPS NAL exist ahead of sequence?
|
||||||
bool bSubspsExistAheadFlag;// whether does Subset SPS NAL exist ahead of sequence?
|
bool bSubspsExistAheadFlag;// whether does Subset SPS NAL exist ahead of sequence?
|
||||||
bool bPpsExistAheadFlag; // whether does PPS NAL exist ahead of sequence?
|
bool bPpsExistAheadFlag; // whether does PPS NAL exist ahead of sequence?
|
||||||
|
|
||||||
bool bSpsAvailFlags[MAX_SPS_COUNT];
|
int32_t iSpsErrorIgnored;
|
||||||
bool bSubspsAvailFlags[MAX_SPS_COUNT];
|
int32_t iSubSpsErrorIgnored;
|
||||||
bool bPpsAvailFlags[MAX_PPS_COUNT];
|
int32_t iPpsErrorIgnored;
|
||||||
bool bReferenceLostAtT0Flag;
|
|
||||||
int32_t iTotalNumMbRec; //record current number of decoded MB
|
bool bSpsAvailFlags[MAX_SPS_COUNT];
|
||||||
|
bool bSubspsAvailFlags[MAX_SPS_COUNT];
|
||||||
|
bool bPpsAvailFlags[MAX_PPS_COUNT];
|
||||||
|
int32_t iPPSLastInvalidId;
|
||||||
|
int32_t iPPSInvalidNum;
|
||||||
|
int32_t iSPSLastInvalidId;
|
||||||
|
int32_t iSPSInvalidNum;
|
||||||
|
int32_t iSubSPSLastInvalidId;
|
||||||
|
int32_t iSubSPSInvalidNum;
|
||||||
|
|
||||||
|
bool bReferenceLostAtT0Flag;
|
||||||
|
int32_t iTotalNumMbRec; //record current number of decoded MB
|
||||||
#ifdef LONG_TERM_REF
|
#ifdef LONG_TERM_REF
|
||||||
bool bParamSetsLostFlag; //sps or pps do not exist or not correct
|
bool bParamSetsLostFlag; //sps or pps do not exist or not correct
|
||||||
|
|
||||||
bool
|
bool
|
||||||
bCurAuContainLtrMarkSeFlag; //current AU has the LTR marking syntax element, mark the previous frame or self
|
bCurAuContainLtrMarkSeFlag; //current AU has the LTR marking syntax element, mark the previous frame or self
|
||||||
int32_t iFrameNumOfAuMarkedLtr; //if bCurAuContainLtrMarkSeFlag==true, SHOULD set this variable
|
int32_t iFrameNumOfAuMarkedLtr; //if bCurAuContainLtrMarkSeFlag==true, SHOULD set this variable
|
||||||
|
|
||||||
uint16_t uiCurIdrPicId;
|
uint16_t uiCurIdrPicId;
|
||||||
#endif
|
#endif
|
||||||
bool bNewSeqBegin;
|
bool bNewSeqBegin;
|
||||||
bool bNextNewSeqBegin;
|
bool bNextNewSeqBegin;
|
||||||
int iOverwriteFlags;
|
int iOverwriteFlags;
|
||||||
ERROR_CON_IDC eErrorConMethod; //
|
ERROR_CON_IDC eErrorConMethod; //
|
||||||
PPicture pPreviousDecodedPictureInDpb; //pointer to previously decoded picture in DPB for error concealment
|
|
||||||
PGetIntraPredFunc pGetI16x16LumaPredFunc[7]; //h264_predict_copy_16x16;
|
//for Parse only
|
||||||
PGetIntraPredFunc pGetI4x4LumaPredFunc[14]; // h264_predict_4x4_t
|
bool bParseOnly;
|
||||||
PGetIntraPredFunc pGetIChromaPredFunc[7]; // h264_predict_8x8_t
|
bool bFramePending;
|
||||||
PIdctResAddPredFunc pIdctResAddPredFunc;
|
int32_t iNalNum;
|
||||||
SMcFunc sMcFunc;
|
int32_t iNalLenInByte[MAX_NAL_UNITS_IN_LAYER];
|
||||||
|
SSpsBsInfo sSpsBsInfo [MAX_SPS_COUNT];
|
||||||
|
SSpsBsInfo sSubsetSpsBsInfo [MAX_PPS_COUNT];
|
||||||
|
SPpsBsInfo sPpsBsInfo [MAX_PPS_COUNT];
|
||||||
|
SParserBsInfo* pParserBsInfo;
|
||||||
|
|
||||||
|
PPicture pPreviousDecodedPictureInDpb; //pointer to previously decoded picture in DPB for error concealment
|
||||||
|
PGetIntraPredFunc pGetI16x16LumaPredFunc[7]; //h264_predict_copy_16x16;
|
||||||
|
PGetIntraPredFunc pGetI4x4LumaPredFunc[14]; // h264_predict_4x4_t
|
||||||
|
PGetIntraPredFunc pGetIChromaPredFunc[7]; // h264_predict_8x8_t
|
||||||
|
PIdctResAddPredFunc pIdctResAddPredFunc;
|
||||||
|
SMcFunc sMcFunc;
|
||||||
|
|
||||||
//For error concealment
|
//For error concealment
|
||||||
SCopyFunc sCopyFunc;
|
SCopyFunc sCopyFunc;
|
||||||
/* For Deblocking */
|
/* For Deblocking */
|
||||||
SDeblockingFunc sDeblockingFunc;
|
SDeblockingFunc sDeblockingFunc;
|
||||||
SExpandPicFunc sExpandPicFunc;
|
SExpandPicFunc sExpandPicFunc;
|
||||||
|
|
||||||
/* For Block */
|
/* For Block */
|
||||||
SBlockFunc sBlockFunc;
|
SBlockFunc sBlockFunc;
|
||||||
|
|
||||||
int32_t iCurSeqIntervalTargetDependId;
|
int32_t iCurSeqIntervalTargetDependId;
|
||||||
int32_t iCurSeqIntervalMaxPicWidth;
|
int32_t iCurSeqIntervalMaxPicWidth;
|
||||||
int32_t iCurSeqIntervalMaxPicHeight;
|
int32_t iCurSeqIntervalMaxPicHeight;
|
||||||
|
|
||||||
PWelsFillNeighborMbInfoIntra4x4Func pFillInfoCacheIntra4x4Func;
|
PWelsFillNeighborMbInfoIntra4x4Func pFillInfoCacheIntra4x4Func;
|
||||||
PWelsParseIntra4x4ModeFunc pParseIntra4x4ModeFunc;
|
PWelsMapNeighToSample pMap4x4NeighToSampleFunc;
|
||||||
PWelsParseIntra16x16ModeFunc pParseIntra16x16ModeFunc;
|
PWelsMap16NeighToSample pMap16x16NeighToSampleFunc;
|
||||||
|
|
||||||
//feedback whether or not have VCL in current AU, and the temporal ID
|
//feedback whether or not have VCL in current AU, and the temporal ID
|
||||||
int32_t iFeedbackVclNalInAu;
|
int32_t iFeedbackVclNalInAu;
|
||||||
int32_t iFeedbackTidInAu;
|
int32_t iFeedbackTidInAu;
|
||||||
|
|
||||||
bool bAuReadyFlag; // true: one au is ready for decoding; false: default value
|
bool bAuReadyFlag; // true: one au is ready for decoding; false: default value
|
||||||
bool bDecErrorConedFlag; //true: current decoder is error coned
|
|
||||||
|
|
||||||
bool bPrintFrameErrorTraceFlag; //true: can print info for upper layer
|
bool bPrintFrameErrorTraceFlag; //true: can print info for upper layer
|
||||||
int32_t iIgnoredErrorInfoPacketCount; //store the packet number with error decoding info
|
int32_t iIgnoredErrorInfoPacketCount; //store the packet number with error decoding info
|
||||||
//trace handle
|
//trace handle
|
||||||
void* pTraceHandle;
|
void* pTraceHandle;
|
||||||
|
|
||||||
//Save the last nal header info
|
//Save the last nal header info
|
||||||
SNalUnitHeaderExt sLastNalHdrExt;
|
SNalUnitHeaderExt sLastNalHdrExt;
|
||||||
SSliceHeader sLastSliceHeader;
|
SSliceHeader sLastSliceHeader;
|
||||||
|
SWelsCabacCtx sWelsCabacContexts[4][WELS_QP_MAX + 1][WELS_CONTEXT_COUNT];
|
||||||
|
bool bCabacInited;
|
||||||
|
SWelsCabacCtx pCabacCtx[WELS_CONTEXT_COUNT];
|
||||||
|
PWelsCabacDecEngine pCabacDecEngine;
|
||||||
|
double dDecTime;
|
||||||
|
SDecoderStatistics sDecoderStatistics;// For real time debugging
|
||||||
|
int32_t iMbEcedNum;
|
||||||
|
int32_t iMbEcedPropNum;
|
||||||
|
int32_t iMbNum;
|
||||||
|
bool bMbRefConcealed;
|
||||||
|
bool bRPLRError;
|
||||||
|
int32_t iECMVs[16][2];
|
||||||
|
PPicture pECRefPic[16];
|
||||||
|
unsigned long long uiTimeStamp;
|
||||||
|
// To support scaling list HP
|
||||||
|
uint16_t pDequant_coeff_buffer4x4[6][52][16];
|
||||||
|
uint16_t pDequant_coeff_buffer8x8[6][52][64];
|
||||||
|
uint16_t (*pDequant_coeff4x4[6])[16];// 4x4 sclaing list value pointer
|
||||||
|
uint16_t (*pDequant_coeff8x8[6])[64];//64 residual coeff ,with 6 kinds of residual type, 52 qp level
|
||||||
|
int iDequantCoeffPpsid;//When a new pps actived, reinitialised the scaling list value
|
||||||
|
bool bDequantCoeff4x4Init;
|
||||||
|
bool bSpsLatePps;
|
||||||
|
bool bUseScalingList;
|
||||||
} SWelsDecoderContext, *PWelsDecoderContext;
|
} SWelsDecoderContext, *PWelsDecoderContext;
|
||||||
|
|
||||||
static inline void ResetActiveSPSForEachLayer (PWelsDecoderContext pCtx) {
|
static inline void ResetActiveSPSForEachLayer (PWelsDecoderContext pCtx) {
|
||||||
for (int i = 0; i < MAX_LAYER_NUM; i++) {
|
if (pCtx->iTotalNumMbRec == 0) {
|
||||||
pCtx->pActiveLayerSps[i] = NULL;
|
for (int i = 0; i < MAX_LAYER_NUM; i++) {
|
||||||
}
|
pCtx->pActiveLayerSps[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//#ifdef __cplusplus
|
//#ifdef __cplusplus
|
||||||
//}
|
//}
|
||||||
//#endif//__cplusplus
|
//#endif//__cplusplus
|
||||||
|
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|
||||||
#endif//WELS_DECODER_FRAMEWORK_H__
|
#endif//WELS_DECODER_FRAMEWORK_H__
|
||||||
|
|||||||
@@ -144,8 +144,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf
|
|||||||
/*
|
/*
|
||||||
* Check if frame is completed and EC is required
|
* Check if frame is completed and EC is required
|
||||||
*/
|
*/
|
||||||
bool CheckAndDoEC (PWelsDecoderContext pCtx, uint8_t** pDst, SBufferInfo* pDstInfo);
|
bool CheckAndFinishLastPic (PWelsDecoderContext pCtx, uint8_t** pDst, SBufferInfo* pDstInfo);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prepare current dq layer context initialization.
|
* Prepare current dq layer context initialization.
|
||||||
*/
|
*/
|
||||||
@@ -154,10 +153,14 @@ void WelsDqLayerDecodeStart (PWelsDecoderContext pCtx, PNalUnit pCurNal, PSps pS
|
|||||||
|
|
||||||
int32_t WelsDecodeAccessUnitStart (PWelsDecoderContext pCtx);
|
int32_t WelsDecodeAccessUnitStart (PWelsDecoderContext pCtx);
|
||||||
void WelsDecodeAccessUnitEnd (PWelsDecoderContext pCtx);
|
void WelsDecodeAccessUnitEnd (PWelsDecoderContext pCtx);
|
||||||
|
void DecodeFinishUpdate (PWelsDecoderContext pCtx);
|
||||||
|
|
||||||
void ForceResetCurrentAccessUnit (PAccessUnit pAu);
|
void ForceResetCurrentAccessUnit (PAccessUnit pAu);
|
||||||
void ForceClearCurrentNal (PAccessUnit pAu);
|
void ForceClearCurrentNal (PAccessUnit pAu);
|
||||||
|
|
||||||
|
bool CheckRefPicturesComplete (PWelsDecoderContext pCtx); // Check whether all ref pictures are complete
|
||||||
|
|
||||||
|
void ForceResetParaSetStatusAndAUList(PWelsDecoderContext pCtx);
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|
||||||
#endif//WELS_DECODER_CORE_H__
|
#endif//WELS_DECODER_CORE_H__
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ ERR_INVALID_PARAMETERS = 1,
|
|||||||
ERR_MALLOC_FAILED = 2,
|
ERR_MALLOC_FAILED = 2,
|
||||||
ERR_API_FAILED = 3,
|
ERR_API_FAILED = 3,
|
||||||
|
|
||||||
ERR_BOUND = 31,
|
ERR_BOUND = 31
|
||||||
} EWelsErr;
|
} EWelsErr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -68,7 +68,7 @@ ERR_LEVEL_PREFIX_NAL,
|
|||||||
ERR_LEVEL_PARAM_SETS,
|
ERR_LEVEL_PARAM_SETS,
|
||||||
ERR_LEVEL_SLICE_HEADER,
|
ERR_LEVEL_SLICE_HEADER,
|
||||||
ERR_LEVEL_SLICE_DATA,
|
ERR_LEVEL_SLICE_DATA,
|
||||||
ERR_LEVEL_MB_DATA,
|
ERR_LEVEL_MB_DATA
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------------
|
||||||
@@ -104,6 +104,7 @@ ERR_INFO_INVALID_POC_TYPE,
|
|||||||
ERR_INFO_INVALID_MB_SIZE_INFO,
|
ERR_INFO_INVALID_MB_SIZE_INFO,
|
||||||
ERR_INFO_REF_COUNT_OVERFLOW,
|
ERR_INFO_REF_COUNT_OVERFLOW,
|
||||||
ERR_INFO_CROPPING_NO_SUPPORTED,
|
ERR_INFO_CROPPING_NO_SUPPORTED,
|
||||||
|
ERR_INFO_INVALID_CROPPING_DATA,
|
||||||
ERR_INFO_INVALID_SLICEGROUP,
|
ERR_INFO_INVALID_SLICEGROUP,
|
||||||
ERR_INFO_INVALID_SLICEGROUP_MAP_TYPE,
|
ERR_INFO_INVALID_SLICEGROUP_MAP_TYPE,
|
||||||
ERR_INFO_INVALID_FRAME_NUM,
|
ERR_INFO_INVALID_FRAME_NUM,
|
||||||
@@ -117,6 +118,7 @@ ERR_INFO_INVALID_SLICE_ALPHA_C0_OFFSET_DIV2,
|
|||||||
ERR_INFO_INVALID_SLICE_BETA_OFFSET_DIV2,
|
ERR_INFO_INVALID_SLICE_BETA_OFFSET_DIV2,
|
||||||
ERR_INFO_FMO_INIT_FAIL,
|
ERR_INFO_FMO_INIT_FAIL,
|
||||||
ERR_INFO_SLICE_TYPE_OVERFLOW,
|
ERR_INFO_SLICE_TYPE_OVERFLOW,
|
||||||
|
ERR_INFO_INVALID_CABAC_INIT_IDC,
|
||||||
ERR_INFO_INVALID_QP,
|
ERR_INFO_INVALID_QP,
|
||||||
ERR_INFO_INVALID_PIC_INIT_QS,
|
ERR_INFO_INVALID_PIC_INIT_QS,
|
||||||
ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET,
|
ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET,
|
||||||
@@ -145,6 +147,13 @@ ERR_INFO_INVALID_I4x4_PRED_MODE,
|
|||||||
ERR_INFO_INVALID_I16x16_PRED_MODE,
|
ERR_INFO_INVALID_I16x16_PRED_MODE,
|
||||||
ERR_INFO_INVALID_I_CHROMA_PRED_MODE,
|
ERR_INFO_INVALID_I_CHROMA_PRED_MODE,
|
||||||
|
|
||||||
|
ERR_INFO_INVALID_LUMA_LOG2_WEIGHT_DENOM,
|
||||||
|
ERR_INFO_INVALID_CHROMA_LOG2_WEIGHT_DENOM,
|
||||||
|
ERR_INFO_INVALID_LUMA_WEIGHT,
|
||||||
|
ERR_INFO_INVALID_CHROMA_WEIGHT,
|
||||||
|
ERR_INFO_INVALID_LUMA_OFFSET,
|
||||||
|
ERR_INFO_INVALID_CHROMA_OFFSET,
|
||||||
|
|
||||||
ERR_INFO_UNSUPPORTED_NON_BASELINE,
|
ERR_INFO_UNSUPPORTED_NON_BASELINE,
|
||||||
ERR_INFO_UNSUPPORTED_FMOTYPE,
|
ERR_INFO_UNSUPPORTED_FMOTYPE,
|
||||||
ERR_INFO_UNSUPPORTED_MBAFF,
|
ERR_INFO_UNSUPPORTED_MBAFF,
|
||||||
@@ -154,6 +163,7 @@ ERR_INFO_UNSUPPORTED_SPSI,
|
|||||||
ERR_INFO_UNSUPPORTED_MGS,
|
ERR_INFO_UNSUPPORTED_MGS,
|
||||||
ERR_INFO_UNSUPPORTED_BIPRED,
|
ERR_INFO_UNSUPPORTED_BIPRED,
|
||||||
ERR_INFO_UNSUPPORTED_WP,
|
ERR_INFO_UNSUPPORTED_WP,
|
||||||
|
ERR_INFO_UNSUPPORTED_SLICESKIP,
|
||||||
|
|
||||||
ERR_INFO_FRAMES_LOST,
|
ERR_INFO_FRAMES_LOST,
|
||||||
ERR_INFO_DEPENDENCY_SPATIAL_LAYER_LOST,
|
ERR_INFO_DEPENDENCY_SPATIAL_LAYER_LOST,
|
||||||
@@ -181,6 +191,10 @@ ERR_INFO_INVALID_MMCO_SHOART2LONG,
|
|||||||
ERR_INFO_INVALID_MMCO_REF_NUM_OVERFLOW,
|
ERR_INFO_INVALID_MMCO_REF_NUM_OVERFLOW,
|
||||||
ERR_INFO_INVALID_MMCO_REF_NUM_NOT_ENOUGH,
|
ERR_INFO_INVALID_MMCO_REF_NUM_NOT_ENOUGH,
|
||||||
ERR_INFO_INVALID_MMCO_LONG_TERM_IDX_EXCEED_MAX,
|
ERR_INFO_INVALID_MMCO_LONG_TERM_IDX_EXCEED_MAX,
|
||||||
|
//for CABAC
|
||||||
|
ERR_CABAC_NO_BS_TO_READ,
|
||||||
|
//for scaling list
|
||||||
|
ERR_SCALING_LIST_DELTA_SCALE,
|
||||||
};
|
};
|
||||||
//-----------------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#ifndef WELS_ERROR_CONCEALMENT_H__
|
#ifndef WELS_ERROR_CONCEALMENT_H__
|
||||||
#define WELS_ERROR_CONCEALMENT_H__
|
#define WELS_ERROR_CONCEALMENT_H__
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
|
#include "rec_mb.h"
|
||||||
#include "decoder_context.h"
|
#include "decoder_context.h"
|
||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
@@ -48,6 +49,10 @@ void InitErrorCon (PWelsDecoderContext pCtx);
|
|||||||
void DoErrorConFrameCopy (PWelsDecoderContext pCtx);
|
void DoErrorConFrameCopy (PWelsDecoderContext pCtx);
|
||||||
//Do error concealment using slice copy method
|
//Do error concealment using slice copy method
|
||||||
void DoErrorConSliceCopy (PWelsDecoderContext pCtx);
|
void DoErrorConSliceCopy (PWelsDecoderContext pCtx);
|
||||||
|
//Do error concealment using slice MV copy method
|
||||||
|
void DoMbECMvCopy (PWelsDecoderContext pCtx, PPicture pDec, PPicture pRef, int32_t iMbXy, int32_t iMbX, int32_t iMbY, sMCRefMember* pMCRefMem, int32_t iCurrPoc);
|
||||||
|
void GetAvilInfoFromCorrectMb (PWelsDecoderContext pCtx);
|
||||||
|
void DoErrorConSliceMVCopy (PWelsDecoderContext pCtx);
|
||||||
//Mark erroneous frame as Ref Pic into DPB
|
//Mark erroneous frame as Ref Pic into DPB
|
||||||
int32_t MarkECFrameAsRef (PWelsDecoderContext pCtx);
|
int32_t MarkECFrameAsRef (PWelsDecoderContext pCtx);
|
||||||
//Judge if EC is needed to current frame
|
//Judge if EC is needed to current frame
|
||||||
|
|||||||
@@ -69,7 +69,11 @@ int32_t iLeftType;
|
|||||||
int32_t iTopType;
|
int32_t iTopType;
|
||||||
int32_t iLeftTopType;
|
int32_t iLeftTopType;
|
||||||
int32_t iRightTopType;
|
int32_t iRightTopType;
|
||||||
} SNeighAvail, *PNeighAvail;
|
|
||||||
|
int8_t iTopCbp;
|
||||||
|
int8_t iLeftCbp;
|
||||||
|
int8_t iDummy[2]; //for align
|
||||||
|
} SWelsNeighAvail, *PWelsNeighAvail;
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ union {
|
|||||||
} sVclNal;
|
} sVclNal;
|
||||||
SPrefixNalUnit sPrefixNal;
|
SPrefixNalUnit sPrefixNal;
|
||||||
} sNalData;
|
} sNalData;
|
||||||
|
unsigned long long uiTimeStamp;
|
||||||
} SNalUnit, *PNalUnit;
|
} SNalUnit, *PNalUnit;
|
||||||
|
|
||||||
///////////////////////////////////ACCESS Unit level///////////////////////////////////
|
///////////////////////////////////ACCESS Unit level///////////////////////////////////
|
||||||
|
|||||||
@@ -88,7 +88,11 @@ typedef struct TagSps {
|
|||||||
bool bQpPrimeYZeroTransfBypassFlag;
|
bool bQpPrimeYZeroTransfBypassFlag;
|
||||||
bool bSeqScalingMatrixPresentFlag;
|
bool bSeqScalingMatrixPresentFlag;
|
||||||
bool bSeqScalingListPresentFlag[12];
|
bool bSeqScalingListPresentFlag[12];
|
||||||
const SLevelLimits* pSLevelLimits;
|
//Add scaling list supporting
|
||||||
|
uint8_t iScalingList4x4[6][16];
|
||||||
|
uint8_t iScalingList8x8[6][64];
|
||||||
|
|
||||||
|
const SLevelLimits* pSLevelLimits;
|
||||||
} SSps, *PSps;
|
} SSps, *PSps;
|
||||||
|
|
||||||
|
|
||||||
@@ -151,7 +155,7 @@ typedef struct TagPps {
|
|||||||
|
|
||||||
int32_t iPicInitQp;
|
int32_t iPicInitQp;
|
||||||
int32_t iPicInitQs;
|
int32_t iPicInitQs;
|
||||||
int32_t iChromaQpIndexOffset;
|
int32_t iChromaQpIndexOffset[2];//cb,cr
|
||||||
|
|
||||||
bool bEntropyCodingModeFlag;
|
bool bEntropyCodingModeFlag;
|
||||||
bool bPicOrderPresentFlag;
|
bool bPicOrderPresentFlag;
|
||||||
@@ -163,7 +167,12 @@ typedef struct TagPps {
|
|||||||
bool bRedundantPicCntPresentFlag;
|
bool bRedundantPicCntPresentFlag;
|
||||||
bool bWeightedPredFlag;
|
bool bWeightedPredFlag;
|
||||||
uint8_t uiWeightedBipredIdc;
|
uint8_t uiWeightedBipredIdc;
|
||||||
|
bool bTransform_8x8_mode_flag;
|
||||||
|
//Add for scalinglist support
|
||||||
|
bool bPicScalingMatrixPresentFlag;
|
||||||
|
bool bPicScalingListPresentFlag[12];
|
||||||
|
uint8_t iScalingList4x4[6][16];
|
||||||
|
uint8_t iScalingList8x8[6][64];
|
||||||
} SPps, *PPps;
|
} SPps, *PPps;
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|||||||
72
codec/decoder/core/inc/parse_mb_syn_cabac.h
Normal file
72
codec/decoder/core/inc/parse_mb_syn_cabac.h
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/*!
|
||||||
|
* \copy
|
||||||
|
* Copyright (c) 2009-2013, Cisco Systems
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* \file parse_mb_syn_cabac.h
|
||||||
|
*
|
||||||
|
* \brief cabac parse for syntax elements
|
||||||
|
*
|
||||||
|
* \date 10/10/2014 Created
|
||||||
|
*
|
||||||
|
*************************************************************************************
|
||||||
|
*/
|
||||||
|
#ifndef WELS_PARSE_MB_SYN_CABAC_H__
|
||||||
|
#define WELS_PARSE_MB_SYN_CABAC_H__
|
||||||
|
|
||||||
|
#include "decoder_context.h"
|
||||||
|
#include "cabac_decoder.h"
|
||||||
|
namespace WelsDec {
|
||||||
|
int32_t ParseEndOfSliceCabac (PWelsDecoderContext pCtx, uint32_t& uiBinVal);
|
||||||
|
int32_t ParseSkipFlagCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiSkip);
|
||||||
|
int32_t ParseMBTypeISliceCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiBinVal);
|
||||||
|
int32_t ParseMBTypePSliceCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiBinVal);
|
||||||
|
int32_t ParseSubMBTypeCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiSubMbType);
|
||||||
|
int32_t ParseIntraPredModeLumaCabac (PWelsDecoderContext pCtx, int32_t& iBinVal);
|
||||||
|
int32_t ParseIntraPredModeChromaCabac (PWelsDecoderContext pCtx, uint8_t uiNeighAvail, int32_t& iBinVal);
|
||||||
|
int32_t ParseInterMotionInfoCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
||||||
|
int16_t pMotionVector[LIST_A][30][MV_A], int16_t pMvdCache[LIST_A][30][MV_A], int8_t pRefIndex[LIST_A][30]);
|
||||||
|
int32_t ParseRefIdxCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint8_t* nzc,
|
||||||
|
int8_t ref_idx[LIST_A][30],
|
||||||
|
int32_t iListIdx, int32_t index, int32_t iActiveRefNum, int32_t b8mode, int8_t& iRefIdxVal);
|
||||||
|
int32_t ParseMvdInfoCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, int8_t pRefIndex[LIST_A][30],
|
||||||
|
int16_t pMvdCache[LIST_A][30][2], int32_t index, int8_t iListIdx, int8_t iMvComp, int16_t& iMvdVal);
|
||||||
|
int32_t ParseCbpInfoCabac (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiBinVal);
|
||||||
|
int32_t ParseDeltaQpCabac (PWelsDecoderContext pCtx, int32_t& iQpDelta);
|
||||||
|
int32_t ParseCbfInfoCabac (PWelsNeighAvail pNeighAvail, uint8_t* pNzcCache, int32_t index, int32_t iResProperty,
|
||||||
|
PWelsDecoderContext pCtx, uint32_t& uiCbpBit);
|
||||||
|
int32_t ParseSignificantMapCabac (int32_t* pSignificantMap, int32_t iResProperty, PWelsDecoderContext pCtx,
|
||||||
|
uint32_t& uiBinVal);
|
||||||
|
int32_t ParseSignificantCoeffCabac (int32_t* significant, int32_t iResProperty, PWelsDecoderContext pCtx);
|
||||||
|
int32_t ParseResidualBlockCabac (PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCountCache, SBitStringAux* pBsAux,
|
||||||
|
int32_t index, int32_t iMaxNumCoeff, const uint8_t* pScanTable, int32_t iResProperty, int16_t* sTCoeff, uint8_t uiQp,
|
||||||
|
PWelsDecoderContext pCtx);
|
||||||
|
int32_t ParseIPCMInfoCabac (PWelsDecoderContext pCtx);
|
||||||
|
}
|
||||||
|
//#pragma pack()
|
||||||
|
#endif
|
||||||
@@ -49,101 +49,19 @@
|
|||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
|
||||||
#define I16_LUMA_DC 1
|
|
||||||
#define I16_LUMA_AC 2
|
|
||||||
#define LUMA_DC_AC 3
|
|
||||||
#define CHROMA_DC 4
|
|
||||||
#define CHROMA_AC 5
|
|
||||||
|
|
||||||
typedef struct TagReadBitsCache {
|
|
||||||
uint32_t uiCache32Bit;
|
|
||||||
uint8_t uiRemainBits;
|
|
||||||
uint8_t* pBuf;
|
|
||||||
} SReadBitsCache;
|
|
||||||
|
|
||||||
#define SHIFT_BUFFER(pBitsCache) { pBitsCache->pBuf+=2; pBitsCache->uiRemainBits += 16; pBitsCache->uiCache32Bit |= (((pBitsCache->pBuf[2] << 8) | pBitsCache->pBuf[3]) << (32 - pBitsCache->uiRemainBits)); }
|
|
||||||
#define POP_BUFFER(pBitsCache, iCount) { pBitsCache->uiCache32Bit <<= iCount; pBitsCache->uiRemainBits -= iCount; }
|
|
||||||
|
|
||||||
static const uint8_t g_kuiZigzagScan[16] = { //4*4block residual zig-zag scan order
|
|
||||||
0, 1, 4, 8,
|
|
||||||
5, 2, 3, 6,
|
|
||||||
9, 12, 13, 10,
|
|
||||||
7, 11, 14, 15,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct TagI16PredInfo {
|
void GetNeighborAvailMbType (PWelsNeighAvail pNeighAvail, PDqLayer pCurLayer);
|
||||||
int8_t iPredMode;
|
void WelsFillCacheNonZeroCount (PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCount, PDqLayer pCurLayer);
|
||||||
int8_t iLeftAvail;
|
void WelsFillCacheConstrain0Intra4x4 (PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCount, int8_t* pIntraPredMode,
|
||||||
int8_t iTopAvail;
|
|
||||||
int8_t iLeftTopAvail;
|
|
||||||
} SI16PredInfo;
|
|
||||||
static const SI16PredInfo g_ksI16PredInfo[4] = {
|
|
||||||
{I16_PRED_V, 0, 1, 0},
|
|
||||||
{I16_PRED_H, 1, 0, 0},
|
|
||||||
{ 0, 0, 0, 0},
|
|
||||||
{I16_PRED_P, 1, 1, 1},
|
|
||||||
};
|
|
||||||
|
|
||||||
static const SI16PredInfo g_ksChromaPredInfo[4] = {
|
|
||||||
{ 0, 0, 0, 0},
|
|
||||||
{C_PRED_H, 1, 0, 0},
|
|
||||||
{C_PRED_V, 0, 1, 0},
|
|
||||||
{C_PRED_P, 1, 1, 1},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct TagI4PredInfo {
|
|
||||||
int8_t iPredMode;
|
|
||||||
int8_t iLeftAvail;
|
|
||||||
int8_t iTopAvail;
|
|
||||||
int8_t iLeftTopAvail;
|
|
||||||
// int8_t right_top_avail; //when right_top unavailable but top avail, we can pad the right-top with the rightmost pixel of top
|
|
||||||
} SI4PredInfo;
|
|
||||||
static const SI4PredInfo g_ksI4PredInfo[9] = {
|
|
||||||
{ I4_PRED_V, 0, 1, 0},
|
|
||||||
{ I4_PRED_H, 1, 0, 0},
|
|
||||||
{ 0, 0, 0, 0},
|
|
||||||
{I4_PRED_DDL, 0, 1, 0},
|
|
||||||
{I4_PRED_DDR, 1, 1, 1},
|
|
||||||
{ I4_PRED_VR, 1, 1, 1},
|
|
||||||
{ I4_PRED_HD, 1, 1, 1},
|
|
||||||
{ I4_PRED_VL, 0, 1, 0},
|
|
||||||
{ I4_PRED_HU, 1, 0, 0},
|
|
||||||
};
|
|
||||||
|
|
||||||
static const uint8_t g_kuiI16CbpTable[6] = {0, 16, 32, 15, 31, 47}; //reference to JM
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct TagPartMbInfo {
|
|
||||||
MbType iType;
|
|
||||||
int8_t iPartCount; //P_16*16, P_16*8, P_8*16, P_8*8 based on 8*8 block; P_8*4, P_4*8, P_4*4 based on 4*4 block
|
|
||||||
int8_t iPartWidth; //based on 4*4 block
|
|
||||||
} SPartMbInfo;
|
|
||||||
static const SPartMbInfo g_ksInterMbTypeInfo[5] = {
|
|
||||||
{MB_TYPE_16x16, 1, 4},
|
|
||||||
{MB_TYPE_16x8, 2, 4},
|
|
||||||
{MB_TYPE_8x16, 2, 2},
|
|
||||||
{MB_TYPE_8x8, 4, 4},
|
|
||||||
{MB_TYPE_8x8_REF0, 4, 4}, //ref0--ref_idx not present in bit-stream and default as 0
|
|
||||||
};
|
|
||||||
static const SPartMbInfo g_ksInterSubMbTypeInfo[4] = {
|
|
||||||
{SUB_MB_TYPE_8x8, 1, 2},
|
|
||||||
{SUB_MB_TYPE_8x4, 2, 2},
|
|
||||||
{SUB_MB_TYPE_4x8, 2, 1},
|
|
||||||
{SUB_MB_TYPE_4x4, 4, 1},
|
|
||||||
};
|
|
||||||
|
|
||||||
void GetNeighborAvailMbType (PNeighAvail pNeighAvail, PDqLayer pCurLayer);
|
|
||||||
void WelsFillCacheNonZeroCount (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount, PDqLayer pCurLayer);
|
|
||||||
void WelsFillCacheConstrain0Intra4x4 (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount, int8_t* pIntraPredMode,
|
|
||||||
PDqLayer pCurLayer);
|
PDqLayer pCurLayer);
|
||||||
void WelsFillCacheConstrain1Intra4x4 (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount, int8_t* pIntraPredMode,
|
void WelsFillCacheConstrain1Intra4x4 (PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCount, int8_t* pIntraPredMode,
|
||||||
PDqLayer pCurLayer);
|
PDqLayer pCurLayer);
|
||||||
void WelsFillCacheInter (PNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
void WelsFillCacheInterCabac (PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
||||||
|
int16_t iMvArray[LIST_A][30][MV_A], int16_t iMvdCache[LIST_A][30][MV_A], int8_t iRefIdxArray[LIST_A][30], PDqLayer pCurLayer);
|
||||||
|
void WelsFillCacheInter (PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCount,
|
||||||
int16_t iMvArray[LIST_A][30][MV_A], int8_t iRefIdxArray[LIST_A][30], PDqLayer pCurLayer);
|
int16_t iMvArray[LIST_A][30][MV_A], int8_t iRefIdxArray[LIST_A][30], PDqLayer pCurLayer);
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief check iPredMode for intra16x16 eligible or not
|
* \brief check iPredMode for intra16x16 eligible or not
|
||||||
* \param input : current iPredMode
|
* \param input : current iPredMode
|
||||||
@@ -190,19 +108,7 @@ int32_t WelsResidualBlockCavlc (SVlcTable* pVlcTable,
|
|||||||
PWelsDecoderContext pCtx);
|
PWelsDecoderContext pCtx);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief parsing intra mode
|
* \brief parsing inter info (including ref_index and pMvd)
|
||||||
* \param input : current mb, bit-stream
|
|
||||||
* \param output: 0 indicating decoding correctly; -1 means error
|
|
||||||
*/
|
|
||||||
int32_t ParseIntra4x4ModeConstrain0 (PNeighAvail pNeighAvail, int8_t* pIntraPredMode, PBitStringAux pBs,
|
|
||||||
PDqLayer pCurDqLayer);
|
|
||||||
int32_t ParseIntra4x4ModeConstrain1 (PNeighAvail pNeighAvail, int8_t* pIntraPredMode, PBitStringAux pBs,
|
|
||||||
PDqLayer pCurDqLayer);
|
|
||||||
int32_t ParseIntra16x16ModeConstrain0 (PNeighAvail pNeighAvail, PBitStringAux pBs, PDqLayer pCurDqLayer);
|
|
||||||
int32_t ParseIntra16x16ModeConstrain1 (PNeighAvail pNeighAvail, PBitStringAux pBs, PDqLayer pCurDqLayer);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief parsing inter info (including ref_index and mvd)
|
|
||||||
* \param input : decoding context, current mb, bit-stream
|
* \param input : decoding context, current mb, bit-stream
|
||||||
* \param output: 0 indicating decoding correctly; -1 means error
|
* \param output: 0 indicating decoding correctly; -1 means error
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ int32_t iLinesize[4];// linesize of picture planes respectively used currently
|
|||||||
int32_t iPlanes; // How many planes are introduced due to color space format?
|
int32_t iPlanes; // How many planes are introduced due to color space format?
|
||||||
// picture information
|
// picture information
|
||||||
|
|
||||||
|
/*******************************from EC mv copy****************************/
|
||||||
|
bool bIdrFlag;
|
||||||
|
|
||||||
/*******************************from other standard syntax****************************/
|
/*******************************from other standard syntax****************************/
|
||||||
/*from sps*/
|
/*from sps*/
|
||||||
int32_t iWidthInPixel; // picture width in pixel
|
int32_t iWidthInPixel; // picture width in pixel
|
||||||
@@ -63,6 +66,7 @@ bool bIsLongRef; // long term reference frame flag //for ref pic management
|
|||||||
uint8_t uiRefCount;
|
uint8_t uiRefCount;
|
||||||
bool bAvailableFlag; // indicate whether it is available in this picture memory block.
|
bool bAvailableFlag; // indicate whether it is available in this picture memory block.
|
||||||
|
|
||||||
|
bool bIsComplete; // indicate whether current picture is complete, not from EC
|
||||||
/*******************************for future use****************************/
|
/*******************************for future use****************************/
|
||||||
uint8_t uiTemporalId;
|
uint8_t uiTemporalId;
|
||||||
uint8_t uiSpatialId;
|
uint8_t uiSpatialId;
|
||||||
@@ -73,6 +77,11 @@ int32_t iLongTermFrameIdx; //id for long term ref pic
|
|||||||
|
|
||||||
int32_t iSpsId; //against mosaic caused by cross-IDR interval reference.
|
int32_t iSpsId; //against mosaic caused by cross-IDR interval reference.
|
||||||
int32_t iPpsId;
|
int32_t iPpsId;
|
||||||
|
unsigned long long uiTimeStamp;
|
||||||
|
bool bNewSeqBegin;
|
||||||
|
int32_t iMbEcedNum;
|
||||||
|
int32_t iMbEcedPropNum;
|
||||||
|
int32_t iMbNum;
|
||||||
} SPicture, *PPicture; // "Picture" declaration is comflict with Mac system
|
} SPicture, *PPicture; // "Picture" declaration is comflict with Mac system
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|||||||
@@ -48,6 +48,27 @@
|
|||||||
#include "decoder_context.h"
|
#include "decoder_context.h"
|
||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
typedef struct TagMCRefMember {
|
||||||
|
uint8_t* pDstY;
|
||||||
|
uint8_t* pDstU;
|
||||||
|
uint8_t* pDstV;
|
||||||
|
|
||||||
|
uint8_t* pSrcY;
|
||||||
|
uint8_t* pSrcU;
|
||||||
|
uint8_t* pSrcV;
|
||||||
|
|
||||||
|
int32_t iSrcLineLuma;
|
||||||
|
int32_t iSrcLineChroma;
|
||||||
|
|
||||||
|
int32_t iDstLineLuma;
|
||||||
|
int32_t iDstLineChroma;
|
||||||
|
|
||||||
|
int32_t iPicWidth;
|
||||||
|
int32_t iPicHeight;
|
||||||
|
} sMCRefMember;
|
||||||
|
|
||||||
|
void BaseMC (sMCRefMember* pMCRefMem, int32_t iXOffset, int32_t iYOffset, SMcFunc* pMCFunc,
|
||||||
|
int32_t iBlkWidth, int32_t iBlkHeight, int16_t iMVs[2]);
|
||||||
|
|
||||||
void WelsFillRecNeededMbInfo (PWelsDecoderContext pCtx, bool bOutput, PDqLayer pCurLayer);
|
void WelsFillRecNeededMbInfo (PWelsDecoderContext pCtx, bool bOutput, PDqLayer pCurLayer);
|
||||||
|
|
||||||
@@ -63,9 +84,6 @@ int32_t RecChroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLeve
|
|||||||
|
|
||||||
void GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWelsDecoderContext pCtx);
|
void GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWelsDecoderContext pCtx);
|
||||||
|
|
||||||
void FillBufForMc (uint8_t* pBuf, int32_t iBufStride, uint8_t* pSrc, int32_t iSrcStride, int32_t iSrcOffset,
|
|
||||||
int32_t iBlockWidth, int32_t iBlockHeight, int32_t iSrcX, int32_t iSrcY, int32_t iPicWidth, int32_t iPicHeight);
|
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|
||||||
#endif //WELS_REC_MB_H__
|
#endif //WELS_REC_MB_H__
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ struct {
|
|||||||
bool bLumaWeightFlag;
|
bool bLumaWeightFlag;
|
||||||
bool bChromaWeightFlag;
|
bool bChromaWeightFlag;
|
||||||
} sPredList[LIST_A];
|
} sPredList[LIST_A];
|
||||||
} SPredWeightTabSyn;
|
} SPredWeightTabSyn,*PPredWeightTabSyn;
|
||||||
|
|
||||||
/* Decoded reference picture marking syntax, refer to Page 66 in JVT X201wcm */
|
/* Decoded reference picture marking syntax, refer to Page 66 in JVT X201wcm */
|
||||||
typedef struct TagRefPicMarking {
|
typedef struct TagRefPicMarking {
|
||||||
@@ -120,6 +120,7 @@ PSps pSps;
|
|||||||
PPps pPps;
|
PPps pPps;
|
||||||
int32_t iSpsId;
|
int32_t iSpsId;
|
||||||
int32_t iPpsId;
|
int32_t iPpsId;
|
||||||
|
bool bIdrFlag;
|
||||||
|
|
||||||
/*********************got from other layer for efficency if possible*********************/
|
/*********************got from other layer for efficency if possible*********************/
|
||||||
SRefPicListReorderSyn pRefPicListReordering; // Reference picture list reordering syntaxs
|
SRefPicListReorderSyn pRefPicListReordering; // Reference picture list reordering syntaxs
|
||||||
@@ -145,7 +146,6 @@ typedef struct TagSliceHeaderExt {
|
|||||||
SSliceHeader sSliceHeader;
|
SSliceHeader sSliceHeader;
|
||||||
PSubsetSps pSubsetSps;
|
PSubsetSps pSubsetSps;
|
||||||
|
|
||||||
uint32_t uiNumMbsInSlice;
|
|
||||||
uint32_t uiDisableInterLayerDeblockingFilterIdc;
|
uint32_t uiDisableInterLayerDeblockingFilterIdc;
|
||||||
int32_t iInterLayerSliceAlphaC0Offset;
|
int32_t iInterLayerSliceAlphaC0Offset;
|
||||||
int32_t iInterLayerSliceBetaOffset;
|
int32_t iInterLayerSliceBetaOffset;
|
||||||
@@ -197,6 +197,7 @@ bool bSliceHeaderExtFlag; // Indicate which slice header is used, avc or ext?
|
|||||||
/*from lower layer: slice header*/
|
/*from lower layer: slice header*/
|
||||||
uint8_t eSliceType;
|
uint8_t eSliceType;
|
||||||
uint8_t uiPadding[2];
|
uint8_t uiPadding[2];
|
||||||
|
int32_t iLastDeltaQp;
|
||||||
} SSlice, *PSlice;
|
} SSlice, *PSlice;
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|||||||
@@ -47,6 +47,11 @@ namespace WelsDec {
|
|||||||
extern const uint8_t g_kuiScan8[24];
|
extern const uint8_t g_kuiScan8[24];
|
||||||
extern const uint8_t g_kuiLumaDcZigzagScan[16];
|
extern const uint8_t g_kuiLumaDcZigzagScan[16];
|
||||||
extern const uint8_t g_kuiChromaDcScan[4];
|
extern const uint8_t g_kuiChromaDcScan[4];
|
||||||
|
extern const uint8_t g_kMbNonZeroCountIdx[24];
|
||||||
|
extern const uint8_t g_kCacheNzcScanIdx[4*4+4+4+3];
|
||||||
|
extern const uint8_t g_kCache26ScanIdx[16];
|
||||||
|
extern const uint8_t g_kCache30ScanIdx[16];
|
||||||
|
extern const uint8_t g_kNonZeroScanIdxC[4];
|
||||||
/* Profile IDC */
|
/* Profile IDC */
|
||||||
typedef uint8_t ProfileIdc;
|
typedef uint8_t ProfileIdc;
|
||||||
enum {
|
enum {
|
||||||
@@ -60,7 +65,7 @@ PRO_HIGH444 = 144,
|
|||||||
PRO_CAVLC444 = 244,
|
PRO_CAVLC444 = 244,
|
||||||
|
|
||||||
PRO_SCALABLE_BASELINE = 83,
|
PRO_SCALABLE_BASELINE = 83,
|
||||||
PRO_SCALABLE_HIGH = 86,
|
PRO_SCALABLE_HIGH = 86
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Picture Size */
|
/* Picture Size */
|
||||||
@@ -83,7 +88,7 @@ MB_LEFT = 0x01, // A
|
|||||||
MB_TOP = 0x02, // B
|
MB_TOP = 0x02, // B
|
||||||
MB_TOPRIGHT = 0x04, // C
|
MB_TOPRIGHT = 0x04, // C
|
||||||
MB_TOPLEFT = 0x08, // D,
|
MB_TOPLEFT = 0x08, // D,
|
||||||
MB_PRIVATE = 0x10,
|
MB_PRIVATE = 0x10
|
||||||
};
|
};
|
||||||
/* MB Type & Sub-MB Type */
|
/* MB Type & Sub-MB Type */
|
||||||
typedef int32_t MbType;
|
typedef int32_t MbType;
|
||||||
@@ -118,7 +123,153 @@ typedef int32_t SubMbType;
|
|||||||
#define IS_I_BL(type) ( (type) == MB_TYPE_INTRA_BL )
|
#define IS_I_BL(type) ( (type) == MB_TYPE_INTRA_BL )
|
||||||
#define IS_SUB8x8(type) (MB_TYPE_8x8 == (type) || MB_TYPE_8x8_REF0 == (type))
|
#define IS_SUB8x8(type) (MB_TYPE_8x8 == (type) || MB_TYPE_8x8_REF0 == (type))
|
||||||
|
|
||||||
|
#define I16_LUMA_DC 1
|
||||||
|
#define I16_LUMA_AC 2
|
||||||
|
#define LUMA_DC_AC 3
|
||||||
|
#define CHROMA_DC 4
|
||||||
|
#define CHROMA_AC 5
|
||||||
|
#define CHROMA_DC_U 6
|
||||||
|
#define CHROMA_DC_V 7
|
||||||
|
#define CHROMA_AC_U 8
|
||||||
|
#define CHROMA_AC_V 9
|
||||||
|
#define LUMA_DC_AC_INTRA 10
|
||||||
|
#define LUMA_DC_AC_INTER 11
|
||||||
|
#define CHROMA_DC_U_INTER 12
|
||||||
|
#define CHROMA_DC_V_INTER 13
|
||||||
|
#define CHROMA_AC_U_INTER 14
|
||||||
|
#define CHROMA_AC_V_INTER 15
|
||||||
|
|
||||||
|
typedef struct TagReadBitsCache {
|
||||||
|
uint32_t uiCache32Bit;
|
||||||
|
uint8_t uiRemainBits;
|
||||||
|
uint8_t* pBuf;
|
||||||
|
} SReadBitsCache;
|
||||||
|
|
||||||
|
#define SHIFT_BUFFER(pBitsCache) { pBitsCache->pBuf+=2; pBitsCache->uiRemainBits += 16; pBitsCache->uiCache32Bit |= (((pBitsCache->pBuf[2] << 8) | pBitsCache->pBuf[3]) << (32 - pBitsCache->uiRemainBits)); }
|
||||||
|
#define POP_BUFFER(pBitsCache, iCount) { pBitsCache->uiCache32Bit <<= iCount; pBitsCache->uiRemainBits -= iCount; }
|
||||||
|
|
||||||
|
static const uint8_t g_kuiZigzagScan[16] = { //4*4block residual zig-zag scan order
|
||||||
|
0, 1, 4, 8,
|
||||||
|
5, 2, 3, 6,
|
||||||
|
9, 12, 13, 10,
|
||||||
|
7, 11, 14, 15,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static inline void GetMbResProperty(int32_t * pMBproperty,int32_t* pResidualProperty,bool bCavlc)
|
||||||
|
{
|
||||||
|
switch(*pResidualProperty)
|
||||||
|
{
|
||||||
|
case CHROMA_AC_U:
|
||||||
|
*pMBproperty = 1;
|
||||||
|
*pResidualProperty = bCavlc ? CHROMA_AC : CHROMA_AC_U;
|
||||||
|
break;
|
||||||
|
case CHROMA_AC_V:
|
||||||
|
*pMBproperty = 2;
|
||||||
|
*pResidualProperty = bCavlc ? CHROMA_AC : CHROMA_AC_V;
|
||||||
|
break;
|
||||||
|
case LUMA_DC_AC_INTRA:
|
||||||
|
*pMBproperty = 0;
|
||||||
|
*pResidualProperty = LUMA_DC_AC;
|
||||||
|
break;
|
||||||
|
case CHROMA_DC_U:
|
||||||
|
*pMBproperty = 1;
|
||||||
|
*pResidualProperty = bCavlc ? CHROMA_DC : CHROMA_DC_U;
|
||||||
|
break;
|
||||||
|
case CHROMA_DC_V:
|
||||||
|
*pMBproperty = 2;
|
||||||
|
*pResidualProperty = bCavlc ? CHROMA_DC : CHROMA_DC_V;
|
||||||
|
break;
|
||||||
|
case I16_LUMA_AC:
|
||||||
|
*pMBproperty = 0;
|
||||||
|
break;
|
||||||
|
case I16_LUMA_DC:
|
||||||
|
*pMBproperty = 0;
|
||||||
|
break;
|
||||||
|
case LUMA_DC_AC_INTER:
|
||||||
|
*pMBproperty = 3;
|
||||||
|
*pResidualProperty = LUMA_DC_AC;
|
||||||
|
break;
|
||||||
|
case CHROMA_DC_U_INTER:
|
||||||
|
*pMBproperty = 4;
|
||||||
|
*pResidualProperty = bCavlc ? CHROMA_DC : CHROMA_DC_U;
|
||||||
|
break;
|
||||||
|
case CHROMA_DC_V_INTER:
|
||||||
|
*pMBproperty = 5;
|
||||||
|
*pResidualProperty = bCavlc ? CHROMA_DC : CHROMA_DC_V;
|
||||||
|
break;
|
||||||
|
case CHROMA_AC_U_INTER:
|
||||||
|
*pMBproperty = 4;
|
||||||
|
*pResidualProperty = bCavlc ? CHROMA_AC : CHROMA_AC_U;
|
||||||
|
break;
|
||||||
|
case CHROMA_AC_V_INTER:
|
||||||
|
*pMBproperty = 5;
|
||||||
|
*pResidualProperty = bCavlc ?CHROMA_AC:CHROMA_AC_V;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct TagI16PredInfo {
|
||||||
|
int8_t iPredMode;
|
||||||
|
int8_t iLeftAvail;
|
||||||
|
int8_t iTopAvail;
|
||||||
|
int8_t iLeftTopAvail;
|
||||||
|
} SI16PredInfo;
|
||||||
|
static const SI16PredInfo g_ksI16PredInfo[4] = {
|
||||||
|
{I16_PRED_V, 0, 1, 0},
|
||||||
|
{I16_PRED_H, 1, 0, 0},
|
||||||
|
{ 0, 0, 0, 0},
|
||||||
|
{I16_PRED_P, 1, 1, 1},
|
||||||
|
};
|
||||||
|
|
||||||
|
static const SI16PredInfo g_ksChromaPredInfo[4] = {
|
||||||
|
{ 0, 0, 0, 0},
|
||||||
|
{C_PRED_H, 1, 0, 0},
|
||||||
|
{C_PRED_V, 0, 1, 0},
|
||||||
|
{C_PRED_P, 1, 1, 1},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct TagI4PredInfo {
|
||||||
|
int8_t iPredMode;
|
||||||
|
int8_t iLeftAvail;
|
||||||
|
int8_t iTopAvail;
|
||||||
|
int8_t iLeftTopAvail;
|
||||||
|
// int8_t right_top_avail; //when right_top unavailable but top avail, we can pad the right-top with the rightmost pixel of top
|
||||||
|
} SI4PredInfo;
|
||||||
|
static const SI4PredInfo g_ksI4PredInfo[9] = {
|
||||||
|
{ I4_PRED_V, 0, 1, 0},
|
||||||
|
{ I4_PRED_H, 1, 0, 0},
|
||||||
|
{ 0, 0, 0, 0},
|
||||||
|
{I4_PRED_DDL, 0, 1, 0},
|
||||||
|
{I4_PRED_DDR, 1, 1, 1},
|
||||||
|
{ I4_PRED_VR, 1, 1, 1},
|
||||||
|
{ I4_PRED_HD, 1, 1, 1},
|
||||||
|
{ I4_PRED_VL, 0, 1, 0},
|
||||||
|
{ I4_PRED_HU, 1, 0, 0},
|
||||||
|
};
|
||||||
|
|
||||||
|
static const uint8_t g_kuiI16CbpTable[6] = {0, 16, 32, 15, 31, 47};
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct TagPartMbInfo {
|
||||||
|
MbType iType;
|
||||||
|
int8_t iPartCount; //P_16*16, P_16*8, P_8*16, P_8*8 based on 8*8 block; P_8*4, P_4*8, P_4*4 based on 4*4 block
|
||||||
|
int8_t iPartWidth; //based on 4*4 block
|
||||||
|
} SPartMbInfo;
|
||||||
|
static const SPartMbInfo g_ksInterMbTypeInfo[5] = {
|
||||||
|
{MB_TYPE_16x16, 1, 4},
|
||||||
|
{MB_TYPE_16x8, 2, 4},
|
||||||
|
{MB_TYPE_8x16, 2, 2},
|
||||||
|
{MB_TYPE_8x8, 4, 4},
|
||||||
|
{MB_TYPE_8x8_REF0, 4, 4}, //ref0--ref_idx not present in bit-stream and default as 0
|
||||||
|
};
|
||||||
|
static const SPartMbInfo g_ksInterSubMbTypeInfo[4] = {
|
||||||
|
{SUB_MB_TYPE_8x8, 1, 2},
|
||||||
|
{SUB_MB_TYPE_8x4, 2, 2},
|
||||||
|
{SUB_MB_TYPE_4x8, 2, 1},
|
||||||
|
{SUB_MB_TYPE_4x4, 4, 1},
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|
||||||
|
|||||||
@@ -31,28 +31,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//wels_const.h
|
//wels_const.h
|
||||||
#ifndef WELS_CONSTANCE_H__
|
#ifndef WELS_CONST_H__
|
||||||
#define WELS_CONSTANCE_H__
|
#define WELS_CONST_H__
|
||||||
|
|
||||||
// Miscellaneous sizing infos
|
#include "wels_const_common.h"
|
||||||
#ifndef MAX_FNAME_LEN
|
|
||||||
#define MAX_FNAME_LEN 256 // maximal length of file name in char size
|
|
||||||
#endif//MAX_FNAME_LEN
|
|
||||||
|
|
||||||
#ifndef WELS_LOG_BUF_SIZE
|
|
||||||
#define WELS_LOG_BUF_SIZE 4096
|
|
||||||
#endif//WELS_LOG_BUF_SIZE
|
|
||||||
|
|
||||||
#ifndef MAX_TRACE_LOG_SIZE
|
|
||||||
#define MAX_TRACE_LOG_SIZE (50 * (1<<20)) // max trace log size: 50 MB, overwrite occur if log file size exceeds this size
|
|
||||||
#endif//MAX_TRACE_LOG_SIZE
|
|
||||||
|
|
||||||
/* MB width in pixels for specified colorspace I420 usually used in codec */
|
|
||||||
#define MB_WIDTH_LUMA 16
|
|
||||||
#define MB_WIDTH_CHROMA (MB_WIDTH_LUMA>>1)
|
|
||||||
/* MB height in pixels for specified colorspace I420 usually used in codec */
|
|
||||||
#define MB_HEIGHT_LUMA 16
|
|
||||||
#define MB_HEIGHT_CHROMA (MB_HEIGHT_LUMA>>1)
|
|
||||||
|
|
||||||
/* Some list size */
|
/* Some list size */
|
||||||
#define MB_COEFF_LIST_SIZE (256+((MB_WIDTH_CHROMA*MB_HEIGHT_CHROMA)<<1))
|
#define MB_COEFF_LIST_SIZE (256+((MB_WIDTH_CHROMA*MB_HEIGHT_CHROMA)<<1))
|
||||||
@@ -95,5 +77,10 @@
|
|||||||
#define MAX_BUFFERED_NUM 3 //mamixum stored number of AU|packet to prevent overwrite
|
#define MAX_BUFFERED_NUM 3 //mamixum stored number of AU|packet to prevent overwrite
|
||||||
#define MAX_ACCESS_UNIT_CAPACITY 7077888 //Maximum AU size in bytes for level 5.2 for single frame
|
#define MAX_ACCESS_UNIT_CAPACITY 7077888 //Maximum AU size in bytes for level 5.2 for single frame
|
||||||
#define MAX_MACROBLOCK_CAPACITY 5000 //Maximal legal MB capacity, 15000 bits is enough
|
#define MAX_MACROBLOCK_CAPACITY 5000 //Maximal legal MB capacity, 15000 bits is enough
|
||||||
|
enum {
|
||||||
|
BASE_MB = 0,
|
||||||
|
NON_AVC_REWRITE_ENHANCE_MB = 1,
|
||||||
|
AVC_REWRITE_ENHANCE_MB = 2
|
||||||
|
};
|
||||||
|
|
||||||
#endif//WELS_CONSTANCE_H__
|
#endif//WELS_CONST_H__
|
||||||
|
|||||||
@@ -43,7 +43,8 @@
|
|||||||
#include "error_code.h"
|
#include "error_code.h"
|
||||||
#include "memmgr_nal_unit.h"
|
#include "memmgr_nal_unit.h"
|
||||||
#include "decoder_core.h"
|
#include "decoder_core.h"
|
||||||
#include "decoder_core.h"
|
#include "bit_stream.h"
|
||||||
|
#include "memory_align.h"
|
||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
/*!
|
/*!
|
||||||
@@ -111,6 +112,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
bool bExtensionFlag = false;
|
bool bExtensionFlag = false;
|
||||||
int32_t iErr = ERR_NONE;
|
int32_t iErr = ERR_NONE;
|
||||||
int32_t iBitSize = 0;
|
int32_t iBitSize = 0;
|
||||||
|
SDataBuffer* pSavedData = &pCtx->sSavedData;
|
||||||
SLogContext* pLogCtx = & (pCtx->sLogCtx);
|
SLogContext* pLogCtx = & (pCtx->sLogCtx);
|
||||||
pNalUnitHeader->eNalUnitType = NAL_UNIT_UNSPEC_0;//SHOULD init it. because pCtx->sCurNalHead is common variable.
|
pNalUnitHeader->eNalUnitType = NAL_UNIT_UNSPEC_0;//SHOULD init it. because pCtx->sCurNalHead is common variable.
|
||||||
|
|
||||||
@@ -144,38 +146,50 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
|
|
||||||
if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_SPS_NAL (pNalUnitHeader->eNalUnitType)
|
if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_SPS_NAL (pNalUnitHeader->eNalUnitType)
|
||||||
|| pCtx->bSpsExistAheadFlag)) {
|
|| pCtx->bSpsExistAheadFlag)) {
|
||||||
if (pCtx->bPrintFrameErrorTraceFlag) {
|
if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iSpsErrorIgnored == 0) {
|
||||||
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
||||||
"parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).",
|
"parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).",
|
||||||
pNalUnitHeader->eNalUnitType);
|
pNalUnitHeader->eNalUnitType);
|
||||||
|
} else {
|
||||||
|
pCtx->iSpsErrorIgnored++;
|
||||||
}
|
}
|
||||||
|
pCtx->sDecoderStatistics.iSpsNoExistNalNum++;
|
||||||
pCtx->iErrorCode = dsNoParamSets;
|
pCtx->iErrorCode = dsNoParamSets;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
pCtx->iSpsErrorIgnored = 0;
|
||||||
if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_PARAM_SETS_NALS (pNalUnitHeader->eNalUnitType)
|
if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_PARAM_SETS_NALS (pNalUnitHeader->eNalUnitType)
|
||||||
|| pCtx->bPpsExistAheadFlag)) {
|
|| pCtx->bPpsExistAheadFlag)) {
|
||||||
if (pCtx->bPrintFrameErrorTraceFlag) {
|
if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iPpsErrorIgnored == 0) {
|
||||||
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
||||||
"parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).",
|
"parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).",
|
||||||
pNalUnitHeader->eNalUnitType);
|
pNalUnitHeader->eNalUnitType);
|
||||||
|
} else {
|
||||||
|
pCtx->iPpsErrorIgnored++;
|
||||||
}
|
}
|
||||||
|
pCtx->sDecoderStatistics.iPpsNoExistNalNum++;
|
||||||
pCtx->iErrorCode = dsNoParamSets;
|
pCtx->iErrorCode = dsNoParamSets;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
pCtx->iPpsErrorIgnored = 0;
|
||||||
if ((IS_VCL_NAL_AVC_BASE (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bPpsExistAheadFlag)) ||
|
if ((IS_VCL_NAL_AVC_BASE (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bPpsExistAheadFlag)) ||
|
||||||
(IS_NEW_INTRODUCED_SVC_NAL (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bSubspsExistAheadFlag
|
(IS_NEW_INTRODUCED_SVC_NAL (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bSubspsExistAheadFlag
|
||||||
|| pCtx->bPpsExistAheadFlag))) {
|
|| pCtx->bPpsExistAheadFlag))) {
|
||||||
if (pCtx->bPrintFrameErrorTraceFlag) {
|
if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iSubSpsErrorIgnored == 0) {
|
||||||
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
||||||
"ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).",
|
"ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).",
|
||||||
pNalUnitHeader->eNalUnitType);
|
pNalUnitHeader->eNalUnitType);
|
||||||
|
} else {
|
||||||
|
pCtx->iSubSpsErrorIgnored++;
|
||||||
}
|
}
|
||||||
|
pCtx->sDecoderStatistics.iSubSpsNoExistNalNum++;
|
||||||
pCtx->iErrorCode |= dsNoParamSets;
|
pCtx->iErrorCode |= dsNoParamSets;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
pCtx->iSubSpsErrorIgnored = 0;
|
||||||
|
|
||||||
switch (pNalUnitHeader->eNalUnitType) {
|
switch (pNalUnitHeader->eNalUnitType) {
|
||||||
|
case NAL_UNIT_AU_DELIMITER:
|
||||||
case NAL_UNIT_SEI:
|
case NAL_UNIT_SEI:
|
||||||
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
|
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
|
||||||
pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1;
|
pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1;
|
||||||
@@ -185,6 +199,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
|
|
||||||
case NAL_UNIT_PREFIX:
|
case NAL_UNIT_PREFIX:
|
||||||
pCurNal = &pCtx->sPrefixNal;
|
pCurNal = &pCtx->sPrefixNal;
|
||||||
|
pCurNal->uiTimeStamp = pCtx->uiTimeStamp;
|
||||||
|
|
||||||
if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) {
|
if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) {
|
||||||
PAccessUnit pCurAu = pCtx->pAccessUnitList;
|
PAccessUnit pCurAu = pCtx->pAccessUnitList;
|
||||||
@@ -227,14 +242,18 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
pCurNal->sNalHeaderExt.sNalUnitHeader.uiForbiddenZeroBit = pNalUnitHeader->uiForbiddenZeroBit;
|
pCurNal->sNalHeaderExt.sNalUnitHeader.uiForbiddenZeroBit = pNalUnitHeader->uiForbiddenZeroBit;
|
||||||
pCurNal->sNalHeaderExt.sNalUnitHeader.uiNalRefIdc = pNalUnitHeader->uiNalRefIdc;
|
pCurNal->sNalHeaderExt.sNalUnitHeader.uiNalRefIdc = pNalUnitHeader->uiNalRefIdc;
|
||||||
pCurNal->sNalHeaderExt.sNalUnitHeader.eNalUnitType = pNalUnitHeader->eNalUnitType;
|
pCurNal->sNalHeaderExt.sNalUnitHeader.eNalUnitType = pNalUnitHeader->eNalUnitType;
|
||||||
|
if (pNalUnitHeader->uiNalRefIdc != 0) {
|
||||||
|
pBs = &pCtx->sBs;
|
||||||
|
iBitSize = (iNalSize << 3) - BsGetTrailingBits (pNal + iNalSize - 1); // convert into bit
|
||||||
|
|
||||||
pBs = &pCtx->sBs;
|
iErr = InitBits (pBs, pNal, iBitSize);
|
||||||
|
if (iErr) {
|
||||||
iBitSize = (iNalSize << 3) - BsGetTrailingBits (pNal + iNalSize - 1); // convert into bit
|
WelsLog (pLogCtx, WELS_LOG_ERROR, "NAL_UNIT_PREFIX: InitBits() fail due invalid access.");
|
||||||
|
pCtx->iErrorCode |= dsBitstreamError;
|
||||||
InitBits (pBs, pNal, iBitSize);
|
return NULL;
|
||||||
|
}
|
||||||
ParsePrefixNalUnit (pCtx, pBs);
|
ParsePrefixNalUnit (pCtx, pBs);
|
||||||
|
}
|
||||||
pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = true;
|
pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -250,7 +269,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
pCtx->iErrorCode |= dsOutOfMemory;
|
pCtx->iErrorCode |= dsOutOfMemory;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
pCurNal->uiTimeStamp = pCtx->uiTimeStamp;
|
||||||
pCurNal->sNalHeaderExt.sNalUnitHeader.uiForbiddenZeroBit = pNalUnitHeader->uiForbiddenZeroBit;
|
pCurNal->sNalHeaderExt.sNalUnitHeader.uiForbiddenZeroBit = pNalUnitHeader->uiForbiddenZeroBit;
|
||||||
pCurNal->sNalHeaderExt.sNalUnitHeader.uiNalRefIdc = pNalUnitHeader->uiNalRefIdc;
|
pCurNal->sNalHeaderExt.sNalUnitHeader.uiNalRefIdc = pNalUnitHeader->uiNalRefIdc;
|
||||||
pCurNal->sNalHeaderExt.sNalUnitHeader.eNalUnitType = pNalUnitHeader->eNalUnitType;
|
pCurNal->sNalHeaderExt.sNalUnitHeader.eNalUnitType = pNalUnitHeader->eNalUnitType;
|
||||||
@@ -264,7 +283,9 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
|
|
||||||
if (uiAvailNalNum > 1) {
|
if (uiAvailNalNum > 1) {
|
||||||
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
||||||
pCtx->bAuReadyFlag = true;
|
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) {
|
||||||
|
pCtx->bAuReadyFlag = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pCtx->iErrorCode |= dsBitstreamError;
|
pCtx->iErrorCode |= dsBitstreamError;
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -284,7 +305,9 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
|
|
||||||
if (uiAvailNalNum > 1) {
|
if (uiAvailNalNum > 1) {
|
||||||
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
||||||
pCtx->bAuReadyFlag = true;
|
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) {
|
||||||
|
pCtx->bAuReadyFlag = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pCtx->iErrorCode |= dsBitstreamError;
|
pCtx->iErrorCode |= dsBitstreamError;
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -293,9 +316,52 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
iNalSize -= NAL_UNIT_HEADER_EXT_SIZE;
|
iNalSize -= NAL_UNIT_HEADER_EXT_SIZE;
|
||||||
*pConsumedBytes += NAL_UNIT_HEADER_EXT_SIZE;
|
*pConsumedBytes += NAL_UNIT_HEADER_EXT_SIZE;
|
||||||
|
|
||||||
|
if (pCtx->bParseOnly) {
|
||||||
|
pCurNal->sNalData.sVclNal.pNalPos = pSavedData->pCurPos;
|
||||||
|
int32_t iTrailingZeroByte = 0;
|
||||||
|
while (pSrcNal[iSrcNalLen - iTrailingZeroByte - 1] == 0x0) //remove final trailing 0 bytes
|
||||||
|
iTrailingZeroByte++;
|
||||||
|
int32_t iActualLen = iSrcNalLen - iTrailingZeroByte;
|
||||||
|
pCurNal->sNalData.sVclNal.iNalLength = iActualLen - NAL_UNIT_HEADER_EXT_SIZE;
|
||||||
|
//unify start code as 0x0001
|
||||||
|
int32_t iCurrStartByte = 4; //4 for 0x0001, 3 for 0x001
|
||||||
|
if (pSrcNal[0] == 0x0 && pSrcNal[1] == 0x0 && pSrcNal[2] == 0x1) { //if 0x001
|
||||||
|
iCurrStartByte = 3;
|
||||||
|
pCurNal->sNalData.sVclNal.iNalLength++;
|
||||||
|
}
|
||||||
|
if (pCurNal->sNalHeaderExt.bIdrFlag) {
|
||||||
|
* (pSrcNal + iCurrStartByte) &= 0xE0;
|
||||||
|
* (pSrcNal + iCurrStartByte) |= 0x05;
|
||||||
|
} else {
|
||||||
|
* (pSrcNal + iCurrStartByte) &= 0xE0;
|
||||||
|
* (pSrcNal + iCurrStartByte) |= 0x01;
|
||||||
|
}
|
||||||
|
pSavedData->pCurPos[0] = pSavedData->pCurPos[1] = pSavedData->pCurPos[2] = 0x0;
|
||||||
|
pSavedData->pCurPos[3] = 0x1;
|
||||||
|
pSavedData->pCurPos[4] = * (pSrcNal + iCurrStartByte);
|
||||||
|
pSavedData->pCurPos += 5;
|
||||||
|
int32_t iOffset = iCurrStartByte + 1 + NAL_UNIT_HEADER_EXT_SIZE;
|
||||||
|
memcpy (pSavedData->pCurPos, pSrcNal + iOffset, iActualLen - iOffset);
|
||||||
|
pSavedData->pCurPos += iActualLen - iOffset;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (pCtx->bParseOnly) {
|
||||||
|
pCurNal->sNalData.sVclNal.pNalPos = pSavedData->pCurPos;
|
||||||
|
int32_t iTrailingZeroByte = 0;
|
||||||
|
while (pSrcNal[iSrcNalLen - iTrailingZeroByte - 1] == 0x0) //remove final trailing 0 bytes
|
||||||
|
iTrailingZeroByte++;
|
||||||
|
int32_t iActualLen = iSrcNalLen - iTrailingZeroByte;
|
||||||
|
pCurNal->sNalData.sVclNal.iNalLength = iActualLen;
|
||||||
|
//unify start code as 0x0001
|
||||||
|
int32_t iStartDeltaByte = 0; //0 for 0x0001, 1 for 0x001
|
||||||
|
if (pSrcNal[0] == 0x0 && pSrcNal[1] == 0x0 && pSrcNal[2] == 0x1) { //if 0x001
|
||||||
|
pSavedData->pCurPos[0] = 0x0;
|
||||||
|
iStartDeltaByte = 1;
|
||||||
|
pCurNal->sNalData.sVclNal.iNalLength++;
|
||||||
|
}
|
||||||
|
memcpy (pSavedData->pCurPos + iStartDeltaByte, pSrcNal, iActualLen);
|
||||||
|
pSavedData->pCurPos += iStartDeltaByte + iActualLen;
|
||||||
|
}
|
||||||
if (NAL_UNIT_PREFIX == pCtx->sPrefixNal.sNalHeaderExt.sNalUnitHeader.eNalUnitType) {
|
if (NAL_UNIT_PREFIX == pCtx->sPrefixNal.sNalHeaderExt.sNalUnitHeader.eNalUnitType) {
|
||||||
if (pCtx->sPrefixNal.sNalData.sPrefixNal.bPrefixNalCorrectFlag) {
|
if (pCtx->sPrefixNal.sNalData.sPrefixNal.bPrefixNalCorrectFlag) {
|
||||||
PrefetchNalHeaderExtSyntax (pCtx, pCurNal, &pCtx->sPrefixNal);
|
PrefetchNalHeaderExtSyntax (pCtx, pCurNal, &pCtx->sPrefixNal);
|
||||||
@@ -309,7 +375,19 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
|
|
||||||
pBs = &pCurAu->pNalUnitsList[uiAvailNalNum - 1]->sNalData.sVclNal.sSliceBitsRead;
|
pBs = &pCurAu->pNalUnitsList[uiAvailNalNum - 1]->sNalData.sVclNal.sSliceBitsRead;
|
||||||
iBitSize = (iNalSize << 3) - BsGetTrailingBits (pNal + iNalSize - 1); // convert into bit
|
iBitSize = (iNalSize << 3) - BsGetTrailingBits (pNal + iNalSize - 1); // convert into bit
|
||||||
InitBits (pBs, pNal, iBitSize);
|
iErr = InitBits (pBs, pNal, iBitSize);
|
||||||
|
if (iErr) {
|
||||||
|
ForceClearCurrentNal (pCurAu);
|
||||||
|
if (uiAvailNalNum > 1) {
|
||||||
|
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
||||||
|
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) {
|
||||||
|
pCtx->bAuReadyFlag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WelsLog (pLogCtx, WELS_LOG_ERROR, "NAL_UNIT_CODED_SLICE: InitBits() fail due invalid access.");
|
||||||
|
pCtx->iErrorCode |= dsBitstreamError;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
iErr = ParseSliceHeaderSyntaxs (pCtx, pBs, bExtensionFlag);
|
iErr = ParseSliceHeaderSyntaxs (pCtx, pBs, bExtensionFlag);
|
||||||
if (iErr != ERR_NONE) {
|
if (iErr != ERR_NONE) {
|
||||||
if ((uiAvailNalNum == 1) && (pCurNal->sNalHeaderExt.bIdrFlag)) { //IDR parse error
|
if ((uiAvailNalNum == 1) && (pCurNal->sNalHeaderExt.bIdrFlag)) { //IDR parse error
|
||||||
@@ -321,7 +399,9 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
|||||||
|
|
||||||
if (uiAvailNalNum > 1) {
|
if (uiAvailNalNum > 1) {
|
||||||
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
||||||
pCtx->bAuReadyFlag = true;
|
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) {
|
||||||
|
pCtx->bAuReadyFlag = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pCtx->iErrorCode |= dsBitstreamError;
|
pCtx->iErrorCode |= dsBitstreamError;
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -379,6 +459,8 @@ bool CheckAccessUnitBoundaryExt (PNalUnitHeaderExt pLastNalHdrExt, PNalUnitHeade
|
|||||||
return true;
|
return true;
|
||||||
if (pLastSliceHeader->iPpsId != pCurSliceHeader->iPpsId)
|
if (pLastSliceHeader->iPpsId != pCurSliceHeader->iPpsId)
|
||||||
return true;
|
return true;
|
||||||
|
if (pLastSliceHeader->pSps->iSpsId != pCurSliceHeader->pSps->iSpsId)
|
||||||
|
return true;
|
||||||
if (pLastSliceHeader->bFieldPicFlag != pCurSliceHeader->bFieldPicFlag)
|
if (pLastSliceHeader->bFieldPicFlag != pCurSliceHeader->bFieldPicFlag)
|
||||||
return true;
|
return true;
|
||||||
if (pLastSliceHeader->bBottomFiledFlag != pCurSliceHeader->bBottomFiledFlag)
|
if (pLastSliceHeader->bBottomFiledFlag != pCurSliceHeader->bBottomFiledFlag)
|
||||||
@@ -403,7 +485,10 @@ bool CheckAccessUnitBoundaryExt (PNalUnitHeaderExt pLastNalHdrExt, PNalUnitHeade
|
|||||||
if (pLastSliceHeader->iDeltaPicOrderCnt[1] != pCurSliceHeader->iDeltaPicOrderCnt[1])
|
if (pLastSliceHeader->iDeltaPicOrderCnt[1] != pCurSliceHeader->iDeltaPicOrderCnt[1])
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (memcmp (pLastSliceHeader->pPps, pCurSliceHeader->pPps, sizeof (SPps)) != 0
|
||||||
|
|| memcmp (pLastSliceHeader->pSps, pCurSliceHeader->pSps, sizeof (SSps)) != 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,7 +573,8 @@ bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const
|
|||||||
*
|
*
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t kiSrcLen) {
|
int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t kiSrcLen, uint8_t* pSrcNal,
|
||||||
|
const int32_t kSrcNalLen) {
|
||||||
PBitStringAux pBs = NULL;
|
PBitStringAux pBs = NULL;
|
||||||
EWelsNalUnitType eNalType = NAL_UNIT_UNSPEC_0; // make initial value as unspecified
|
EWelsNalUnitType eNalType = NAL_UNIT_UNSPEC_0; // make initial value as unspecified
|
||||||
int32_t iPicWidth = 0;
|
int32_t iPicWidth = 0;
|
||||||
@@ -505,9 +591,17 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t
|
|||||||
switch (eNalType) {
|
switch (eNalType) {
|
||||||
case NAL_UNIT_SPS:
|
case NAL_UNIT_SPS:
|
||||||
case NAL_UNIT_SUBSET_SPS:
|
case NAL_UNIT_SUBSET_SPS:
|
||||||
if (iBitSize > 0)
|
if (iBitSize > 0) {
|
||||||
InitBits (pBs, pRbsp, iBitSize);
|
iErr = InitBits (pBs, pRbsp, iBitSize);
|
||||||
iErr = ParseSps (pCtx, pBs, &iPicWidth, &iPicHeight);
|
if (ERR_NONE != iErr) {
|
||||||
|
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE)
|
||||||
|
pCtx->iErrorCode |= dsNoParamSets;
|
||||||
|
else
|
||||||
|
pCtx->iErrorCode |= dsBitstreamError;
|
||||||
|
return iErr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
iErr = ParseSps (pCtx, pBs, &iPicWidth, &iPicHeight, pSrcNal, kSrcNalLen);
|
||||||
if (ERR_NONE != iErr) { // modified for pSps/pSubsetSps invalid, 12/1/2009
|
if (ERR_NONE != iErr) { // modified for pSps/pSubsetSps invalid, 12/1/2009
|
||||||
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE)
|
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE)
|
||||||
pCtx->iErrorCode |= dsNoParamSets;
|
pCtx->iErrorCode |= dsNoParamSets;
|
||||||
@@ -519,9 +613,17 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NAL_UNIT_PPS:
|
case NAL_UNIT_PPS:
|
||||||
if (iBitSize > 0)
|
if (iBitSize > 0) {
|
||||||
InitBits (pBs, pRbsp, iBitSize);
|
iErr = InitBits (pBs, pRbsp, iBitSize);
|
||||||
iErr = ParsePps (pCtx, &pCtx->sPpsBuffer[0], pBs);
|
if (ERR_NONE != iErr) {
|
||||||
|
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE)
|
||||||
|
pCtx->iErrorCode |= dsNoParamSets;
|
||||||
|
else
|
||||||
|
pCtx->iErrorCode |= dsBitstreamError;
|
||||||
|
return iErr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
iErr = ParsePps (pCtx, &pCtx->sPpsBuffer[0], pBs, pSrcNal, kSrcNalLen);
|
||||||
if (ERR_NONE != iErr) { // modified for pps invalid, 12/1/2009
|
if (ERR_NONE != iErr) { // modified for pps invalid, 12/1/2009
|
||||||
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE)
|
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE)
|
||||||
pCtx->iErrorCode |= dsNoParamSets;
|
pCtx->iErrorCode |= dsNoParamSets;
|
||||||
@@ -690,6 +792,8 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin
|
|||||||
|
|
||||||
const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) {
|
const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) {
|
||||||
switch (iLevelIdx) {
|
switch (iLevelIdx) {
|
||||||
|
case 9:
|
||||||
|
return &g_ksLevelLimits[1];
|
||||||
case 10:
|
case 10:
|
||||||
return &g_ksLevelLimits[0];
|
return &g_ksLevelLimits[0];
|
||||||
case 11:
|
case 11:
|
||||||
@@ -731,11 +835,41 @@ const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps) {
|
bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) {
|
||||||
for (int i = 0; i < MAX_LAYER_NUM; i++) {
|
for (int i = 0; i < MAX_LAYER_NUM; i++) {
|
||||||
if (pCtx->pActiveLayerSps[i] == pSps)
|
if (pCtx->pActiveLayerSps[i] == pSps)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
// Pre-active, will be used soon
|
||||||
|
if (bUseSubsetFlag) {
|
||||||
|
if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSubspsAvailFlags[pSps->iSpsId]
|
||||||
|
&& pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
|
||||||
|
int i = 0, iNum = (int32_t) pCtx->pAccessUnitList->uiAvailUnitsNum;
|
||||||
|
while (i < iNum) {
|
||||||
|
PNalUnit pNalUnit = pCtx->pAccessUnitList->pNalUnitsList[i];
|
||||||
|
if (pNalUnit->sNalData.sVclNal.bSliceHeaderExtFlag) { //ext data
|
||||||
|
PSps pNextUsedSps = pNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
|
||||||
|
if (pNextUsedSps->iSpsId == pSps->iSpsId)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSpsAvailFlags[pSps->iSpsId]
|
||||||
|
&& pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
|
||||||
|
int i = 0, iNum = (int32_t) pCtx->pAccessUnitList->uiAvailUnitsNum;
|
||||||
|
while (i < iNum) {
|
||||||
|
PNalUnit pNalUnit = pCtx->pAccessUnitList->pNalUnitsList[i];
|
||||||
|
if (!pNalUnit->sNalData.sVclNal.bSliceHeaderExtFlag) { //non-ext data
|
||||||
|
PSps pNextUsedSps = pNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
|
||||||
|
if (pNextUsedSps->iSpsId == pSps->iSpsId)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -747,6 +881,8 @@ bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps) {
|
|||||||
#define PPS_PIC_INIT_QP_QS_MAX 51
|
#define PPS_PIC_INIT_QP_QS_MAX 51
|
||||||
#define PPS_CHROMA_QP_INDEX_OFFSET_MIN -12
|
#define PPS_CHROMA_QP_INDEX_OFFSET_MIN -12
|
||||||
#define PPS_CHROMA_QP_INDEX_OFFSET_MAX 12
|
#define PPS_CHROMA_QP_INDEX_OFFSET_MAX 12
|
||||||
|
#define SCALING_LIST_DELTA_SCALE_MAX 127
|
||||||
|
#define SCALING_LIST_DELTA_SCALE_MIN -128
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
@@ -764,7 +900,8 @@ bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps) {
|
|||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicWidth, int32_t* pPicHeight) {
|
int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicWidth, int32_t* pPicHeight,
|
||||||
|
uint8_t* pSrcNal, const int32_t kSrcNalLen) {
|
||||||
PBitStringAux pBs = pBsAux;
|
PBitStringAux pBs = pBsAux;
|
||||||
SSubsetSps sTempSubsetSps;
|
SSubsetSps sTempSubsetSps;
|
||||||
PSps pSps = NULL;
|
PSps pSps = NULL;
|
||||||
@@ -823,11 +960,19 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
|
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc
|
||||||
pSps->uiChromaFormatIdc = uiCode;
|
pSps->uiChromaFormatIdc = uiCode;
|
||||||
|
#ifdef DISABLE_HP_BRANCH_1_4
|
||||||
if (pSps->uiChromaFormatIdc != 1) {
|
if (pSps->uiChromaFormatIdc != 1) {
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.",
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.",
|
||||||
pSps->uiChromaFormatIdc);
|
pSps->uiChromaFormatIdc);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
if (pSps->uiChromaFormatIdc > 1) {
|
||||||
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) <=1 supported.",
|
||||||
|
pSps->uiChromaFormatIdc);
|
||||||
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
||||||
|
|
||||||
|
}// To support 4:0:0; 4:2:0
|
||||||
pSps->uiChromaArrayType = pSps->uiChromaFormatIdc;
|
pSps->uiChromaArrayType = pSps->uiChromaFormatIdc;
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8
|
||||||
if (uiCode != 0) {
|
if (uiCode != 0) {
|
||||||
@@ -848,11 +993,17 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag
|
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag
|
||||||
pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
|
pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
|
||||||
|
|
||||||
if (pSps->bSeqScalingMatrixPresentFlag) { // For high profile, it is not used in current application. FIXME
|
if (pSps->bSeqScalingMatrixPresentFlag) {// For high profile, it is not used in current application. FIXME
|
||||||
|
#ifndef DISABLE_HP_BRANCH_1_4
|
||||||
|
WELS_READ_VERIFY (ParseScalingList (pSps, pBs, 0, pSps->bSeqScalingListPresentFlag, pSps->iScalingList4x4,
|
||||||
|
pSps->iScalingList8x8));
|
||||||
|
//if exist, to parse scalinglist matrix value
|
||||||
|
#else
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
"ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.",
|
"ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.",
|
||||||
pSps->bSeqScalingMatrixPresentFlag);
|
pSps->bSeqScalingMatrixPresentFlag);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus4
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus4
|
||||||
@@ -946,14 +1097,16 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_right_offset
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_right_offset
|
||||||
pSps->sFrameCrop.iRightOffset = uiCode;
|
pSps->sFrameCrop.iRightOffset = uiCode;
|
||||||
if ((pSps->sFrameCrop.iLeftOffset + pSps->sFrameCrop.iRightOffset) > ((int32_t)pSps->iMbWidth * 16 / 2)) {
|
if ((pSps->sFrameCrop.iLeftOffset + pSps->sFrameCrop.iRightOffset) > ((int32_t)pSps->iMbWidth * 16 / 2)) {
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!");
|
||||||
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CROPPING_DATA);
|
||||||
}
|
}
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_top_offset
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_top_offset
|
||||||
pSps->sFrameCrop.iTopOffset = uiCode;
|
pSps->sFrameCrop.iTopOffset = uiCode;
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_bottom_offset
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_bottom_offset
|
||||||
pSps->sFrameCrop.iBottomOffset = uiCode;
|
pSps->sFrameCrop.iBottomOffset = uiCode;
|
||||||
if ((pSps->sFrameCrop.iTopOffset + pSps->sFrameCrop.iBottomOffset) > ((int32_t)pSps->iMbHeight * 16 / 2)) {
|
if ((pSps->sFrameCrop.iTopOffset + pSps->sFrameCrop.iBottomOffset) > ((int32_t)pSps->iMbHeight * 16 / 2)) {
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!");
|
||||||
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CROPPING_DATA);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pSps->sFrameCrop.iLeftOffset = 0; // frame_crop_left_offset
|
pSps->sFrameCrop.iLeftOffset = 0; // frame_crop_left_offset
|
||||||
@@ -964,6 +1117,90 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //vui_parameters_present_flag
|
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //vui_parameters_present_flag
|
||||||
pSps->bVuiParamPresentFlag = !!uiCode;
|
pSps->bVuiParamPresentFlag = !!uiCode;
|
||||||
|
|
||||||
|
if (pCtx->bParseOnly) {
|
||||||
|
if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //sps bs exceeds!
|
||||||
|
pCtx->iErrorCode |= dsOutOfMemory;
|
||||||
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY);
|
||||||
|
}
|
||||||
|
if (!kbUseSubsetFlag) { //SPS
|
||||||
|
SSpsBsInfo* pSpsBs = &pCtx->sSpsBsInfo [iSpsId];
|
||||||
|
pSpsBs->iSpsId = iSpsId;
|
||||||
|
int32_t iTrailingZeroByte = 0;
|
||||||
|
while (pSrcNal[kSrcNalLen - iTrailingZeroByte - 1] == 0x0) //remove final trailing 0 bytes
|
||||||
|
iTrailingZeroByte++;
|
||||||
|
int32_t iActualLen = kSrcNalLen - iTrailingZeroByte;
|
||||||
|
pSpsBs->uiSpsBsLen = (uint16_t) iActualLen;
|
||||||
|
//unify start code as 0x0001
|
||||||
|
int32_t iStartDeltaByte = 0; //0 for 0x0001, 1 for 0x001
|
||||||
|
if (pSrcNal[0] == 0x0 && pSrcNal[1] == 0x0 && pSrcNal[2] == 0x1) { //if 0x001
|
||||||
|
pSpsBs->pSpsBsBuf[0] = 0x0; //add 0 to form 0x0001
|
||||||
|
iStartDeltaByte++;
|
||||||
|
pSpsBs->uiSpsBsLen++;
|
||||||
|
}
|
||||||
|
memcpy (pSpsBs->pSpsBsBuf + iStartDeltaByte, pSrcNal, iActualLen);
|
||||||
|
} else { //subset SPS
|
||||||
|
SSpsBsInfo* pSpsBs = &pCtx->sSubsetSpsBsInfo [iSpsId];
|
||||||
|
pSpsBs->iSpsId = iSpsId;
|
||||||
|
pSpsBs->pSpsBsBuf [0] = pSpsBs->pSpsBsBuf [1] = pSpsBs->pSpsBsBuf [2] = 0x00;
|
||||||
|
pSpsBs->pSpsBsBuf [3] = 0x01;
|
||||||
|
pSpsBs->pSpsBsBuf [4] = 0x67;
|
||||||
|
|
||||||
|
//re-write subset SPS to SPS
|
||||||
|
SBitStringAux sSubsetSpsBs;
|
||||||
|
uint8_t* pBsBuf = static_cast<uint8_t*> (WelsMallocz (SPS_PPS_BS_SIZE + 4,
|
||||||
|
"Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer
|
||||||
|
if (NULL == pBsBuf) {
|
||||||
|
pCtx->iErrorCode |= dsOutOfMemory;
|
||||||
|
return pCtx->iErrorCode;
|
||||||
|
}
|
||||||
|
DecInitBitsForEncoding (&sSubsetSpsBs, pBsBuf, (int32_t) (pBs->pEndBuf - pBs->pStartBuf));
|
||||||
|
DecBsWriteBits (&sSubsetSpsBs, 8, 77); //profile_idc, forced to Main profile
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bConstraintSet0Flag); // constraint_set0_flag
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bConstraintSet1Flag); // constraint_set1_flag
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bConstraintSet2Flag); // constraint_set2_flag
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bConstraintSet3Flag); // constraint_set3_flag
|
||||||
|
DecBsWriteBits (&sSubsetSpsBs, 4, 0); //constraint_set4_flag, constraint_set5_flag, reserved_zero_2bits
|
||||||
|
DecBsWriteBits (&sSubsetSpsBs, 8, pSps->uiLevelIdc); //level_idc
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->iSpsId); //sps_id
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->uiLog2MaxFrameNum - 4); //log2_max_frame_num_minus4
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->uiPocType); //pic_order_cnt_type
|
||||||
|
if (pSps->uiPocType == 0) {
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->iLog2MaxPocLsb - 4); //log2_max_pic_order_cnt_lsb_minus4
|
||||||
|
} else if (pSps->uiPocType == 1) {
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bDeltaPicOrderAlwaysZeroFlag); //delta_pic_order_always_zero_flag
|
||||||
|
DecBsWriteSe (&sSubsetSpsBs, pSps->iOffsetForNonRefPic); //offset_for_no_ref_pic
|
||||||
|
DecBsWriteSe (&sSubsetSpsBs, pSps->iOffsetForTopToBottomField); //offset_for_top_to_bottom_field
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->iNumRefFramesInPocCycle); //num_ref_frames_in_pic_order_cnt_cycle
|
||||||
|
for (int32_t i = 0; i < pSps->iNumRefFramesInPocCycle; ++i) {
|
||||||
|
DecBsWriteSe (&sSubsetSpsBs, pSps->iOffsetForRefFrame[i]); //offset_for_ref_frame[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->iNumRefFrames); //max_num_ref_frames
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bGapsInFrameNumValueAllowedFlag); //gaps_in_frame_num_value_allowed_flag
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->iMbWidth - 1); //pic_width_in_mbs_minus1
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->iMbHeight - 1); //pic_height_in_map_units_minus1
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bFrameMbsOnlyFlag); //frame_mbs_only_flag
|
||||||
|
if (!pSps->bFrameMbsOnlyFlag) {
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bMbaffFlag); //mb_adaptive_frame_field_flag
|
||||||
|
}
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bDirect8x8InferenceFlag); //direct_8x8_inference_flag
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, pSps->bFrameCroppingFlag); //frame_cropping_flag
|
||||||
|
if (pSps->bFrameCroppingFlag) {
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->sFrameCrop.iLeftOffset); //frame_crop_left_offset
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->sFrameCrop.iRightOffset); //frame_crop_right_offset
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->sFrameCrop.iTopOffset); //frame_crop_top_offset
|
||||||
|
DecBsWriteUe (&sSubsetSpsBs, pSps->sFrameCrop.iBottomOffset); //frame_crop_bottom_offset
|
||||||
|
}
|
||||||
|
DecBsWriteOneBit (&sSubsetSpsBs, 0); //vui_parameters_present_flag
|
||||||
|
DecBsRbspTrailingBits (&sSubsetSpsBs); //finished, rbsp trailing bit
|
||||||
|
int32_t iRbspSize = (int32_t) (sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf);
|
||||||
|
RBSP2EBSP (pSpsBs->pSpsBsBuf + 5, sSubsetSpsBs.pStartBuf, iRbspSize);
|
||||||
|
pSpsBs->uiSpsBsLen = (uint16_t) (sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf + 5);
|
||||||
|
if (pBsBuf) {
|
||||||
|
WelsFree (pBsBuf, "pBsBuf for parse only usage");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Check if SPS SVC extension applicated
|
// Check if SPS SVC extension applicated
|
||||||
if (kbUseSubsetFlag && (PRO_SCALABLE_BASELINE == uiProfileIdc || PRO_SCALABLE_HIGH == uiProfileIdc)) {
|
if (kbUseSubsetFlag && (PRO_SCALABLE_BASELINE == uiProfileIdc || PRO_SCALABLE_HIGH == uiProfileIdc)) {
|
||||||
if (DecodeSpsSvcExt (pCtx, pSubsetSps, pBs) != ERR_NONE) {
|
if (DecodeSpsSvcExt (pCtx, pSubsetSps, pBs) != ERR_NONE) {
|
||||||
@@ -979,8 +1216,6 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
|
|
||||||
if (PRO_SCALABLE_BASELINE == uiProfileIdc || PRO_SCALABLE_HIGH == uiProfileIdc)
|
if (PRO_SCALABLE_BASELINE == uiProfileIdc || PRO_SCALABLE_HIGH == uiProfileIdc)
|
||||||
pCtx->bAvcBasedFlag = false;
|
pCtx->bAvcBasedFlag = false;
|
||||||
else
|
|
||||||
pCtx->bAvcBasedFlag = true; // added for avc base pBs
|
|
||||||
|
|
||||||
*pPicWidth = pSps->iMbWidth << 4;
|
*pPicWidth = pSps->iMbWidth << 4;
|
||||||
*pPicHeight = pSps->iMbHeight << 4;
|
*pPicHeight = pSps->iMbHeight << 4;
|
||||||
@@ -990,7 +1225,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
} else {
|
} else {
|
||||||
pTmpSps = &pCtx->sSpsBuffer[iSpsId];
|
pTmpSps = &pCtx->sSpsBuffer[iSpsId];
|
||||||
}
|
}
|
||||||
if (CheckSpsActive (pCtx, pTmpSps)) {
|
if (CheckSpsActive (pCtx, pTmpSps, kbUseSubsetFlag)) {
|
||||||
// we are overwriting the active sps, copy a temp buffer
|
// we are overwriting the active sps, copy a temp buffer
|
||||||
if (kbUseSubsetFlag) {
|
if (kbUseSubsetFlag) {
|
||||||
if (memcmp (&pCtx->sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)) != 0) {
|
if (memcmp (&pCtx->sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)) != 0) {
|
||||||
@@ -1049,7 +1284,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
* \note Call it in case eNalUnitType is PPS.
|
* \note Call it in case eNalUnitType is PPS.
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) {
|
int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, uint8_t* pSrcNal,
|
||||||
|
const int32_t kSrcNalLen) {
|
||||||
|
|
||||||
PPps pPps = NULL;
|
PPps pPps = NULL;
|
||||||
SPps sTempPps;
|
SPps sTempPps;
|
||||||
@@ -1121,13 +1357,21 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux)
|
|||||||
pPps->bWeightedPredFlag = !!uiCode;
|
pPps->bWeightedPredFlag = !!uiCode;
|
||||||
WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc
|
WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc
|
||||||
pPps->uiWeightedBipredIdc = uiCode;
|
pPps->uiWeightedBipredIdc = uiCode;
|
||||||
|
#ifdef DISABLE_HP_BRANCH_1_4
|
||||||
if (pPps->bWeightedPredFlag || pPps->uiWeightedBipredIdc != 0) {
|
if (pPps->bWeightedPredFlag || pPps->uiWeightedBipredIdc != 0) {
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
"ParsePps(): weighted_pred_flag (%d) weighted_bipred_idc (%d) neither supported.\n",
|
"ParsePps(): weighted_pred_flag (%d) weighted_bipred_idc (%d) neither supported.\n",
|
||||||
pPps->bWeightedPredFlag, pPps->uiWeightedBipredIdc);
|
pPps->bWeightedPredFlag, pPps->uiWeightedBipredIdc);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (pPps->uiWeightedBipredIdc != 0) {
|
||||||
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
|
||||||
|
"ParsePps(): weighted_bipred_idc (%d) not supported.\n",
|
||||||
|
pPps->uiWeightedBipredIdc);
|
||||||
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //pic_init_qp_minus26
|
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //pic_init_qp_minus26
|
||||||
pPps->iPicInitQp = PIC_INIT_QP_OFFSET + iCode;
|
pPps->iPicInitQp = PIC_INIT_QP_OFFSET + iCode;
|
||||||
WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQp, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qp_minus26 + 26",
|
WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQp, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qp_minus26 + 26",
|
||||||
@@ -1136,16 +1380,40 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux)
|
|||||||
pPps->iPicInitQs = PIC_INIT_QS_OFFSET + iCode;
|
pPps->iPicInitQs = PIC_INIT_QS_OFFSET + iCode;
|
||||||
WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQs, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qs_minus26 + 26",
|
WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQs, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qs_minus26 + 26",
|
||||||
GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_PIC_INIT_QS));
|
GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_PIC_INIT_QS));
|
||||||
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //chroma_qp_index_offset
|
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //chroma_qp_index_offset,cb
|
||||||
pPps->iChromaQpIndexOffset = iCode;
|
pPps->iChromaQpIndexOffset[0] = iCode;
|
||||||
WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset, PPS_CHROMA_QP_INDEX_OFFSET_MIN, PPS_CHROMA_QP_INDEX_OFFSET_MAX,
|
WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset[0], PPS_CHROMA_QP_INDEX_OFFSET_MIN, PPS_CHROMA_QP_INDEX_OFFSET_MAX,
|
||||||
"chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
|
"chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
|
||||||
|
pPps->iChromaQpIndexOffset[1] = pPps->iChromaQpIndexOffset[0];//init cr qp offset
|
||||||
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //deblocking_filter_control_present_flag
|
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //deblocking_filter_control_present_flag
|
||||||
pPps->bDeblockingFilterControlPresentFlag = !!uiCode;
|
pPps->bDeblockingFilterControlPresentFlag = !!uiCode;
|
||||||
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //constrained_intra_pred_flag
|
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //constrained_intra_pred_flag
|
||||||
pPps->bConstainedIntraPredFlag = !!uiCode;
|
pPps->bConstainedIntraPredFlag = !!uiCode;
|
||||||
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag
|
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag
|
||||||
pPps->bRedundantPicCntPresentFlag = !!uiCode;
|
pPps->bRedundantPicCntPresentFlag = !!uiCode;
|
||||||
|
/*TODO: to judge whether going on to parse*/
|
||||||
|
//going on to parse high profile syntax, need fix me
|
||||||
|
#ifndef DISABLE_HP_BRANCH_1_4
|
||||||
|
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
|
||||||
|
pPps->bTransform_8x8_mode_flag = !!uiCode;
|
||||||
|
WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
|
||||||
|
pPps->bPicScalingMatrixPresentFlag = !!uiCode;
|
||||||
|
if (pPps->bPicScalingMatrixPresentFlag) {
|
||||||
|
if (pCtx->bSpsAvailFlags[pPps->iSpsId])
|
||||||
|
WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bPicScalingListPresentFlag,
|
||||||
|
pPps->iScalingList4x4, pPps->iScalingList8x8));
|
||||||
|
else {
|
||||||
|
pCtx->bSpsLatePps = true;
|
||||||
|
WELS_READ_VERIFY (ParseScalingList (NULL, pBsAux, 1, pPps->bPicScalingListPresentFlag, pPps->iScalingList4x4,
|
||||||
|
pPps->iScalingList8x8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//add second chroma qp parsing process
|
||||||
|
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //chroma_qp_index_offset,cr
|
||||||
|
pPps->iChromaQpIndexOffset[1] = iCode;
|
||||||
|
WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset[1], PPS_CHROMA_QP_INDEX_OFFSET_MIN, PPS_CHROMA_QP_INDEX_OFFSET_MAX,
|
||||||
|
"second_chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
|
||||||
|
#endif
|
||||||
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
|
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
|
||||||
PNalUnit pLastNalUnit = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1];
|
PNalUnit pLastNalUnit = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1];
|
||||||
PPps pLastPps = pLastNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps;
|
PPps pLastPps = pLastNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps;
|
||||||
@@ -1163,6 +1431,27 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux)
|
|||||||
memcpy (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof (SPps));
|
memcpy (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof (SPps));
|
||||||
pCtx->bPpsAvailFlags[uiPpsId] = true;
|
pCtx->bPpsAvailFlags[uiPpsId] = true;
|
||||||
}
|
}
|
||||||
|
if (pCtx->bParseOnly) {
|
||||||
|
if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //pps bs exceeds
|
||||||
|
pCtx->iErrorCode |= dsOutOfMemory;
|
||||||
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY);
|
||||||
|
}
|
||||||
|
SPpsBsInfo* pPpsBs = &pCtx->sPpsBsInfo [uiPpsId];
|
||||||
|
pPpsBs->iPpsId = (int32_t) uiPpsId;
|
||||||
|
int32_t iTrailingZeroByte = 0;
|
||||||
|
while (pSrcNal[kSrcNalLen - iTrailingZeroByte - 1] == 0x0) //remove final trailing 0 bytes
|
||||||
|
iTrailingZeroByte++;
|
||||||
|
int32_t iActualLen = kSrcNalLen - iTrailingZeroByte;
|
||||||
|
pPpsBs->uiPpsBsLen = (uint16_t) iActualLen;
|
||||||
|
//unify start code as 0x0001
|
||||||
|
int32_t iStartDeltaByte = 0; //0 for 0x0001, 1 for 0x001
|
||||||
|
if (pSrcNal[0] == 0x0 && pSrcNal[1] == 0x0 && pSrcNal[2] == 0x1) { //if 0x001
|
||||||
|
pPpsBs->pPpsBsBuf[0] = 0x0; //add 0 to form 0x0001
|
||||||
|
iStartDeltaByte++;
|
||||||
|
pPpsBs->uiPpsBsLen++;
|
||||||
|
}
|
||||||
|
memcpy (pPpsBs->pPpsBsBuf + iStartDeltaByte, pSrcNal, iActualLen);
|
||||||
|
}
|
||||||
return ERR_NONE;
|
return ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1184,6 +1473,113 @@ int32_t ParseSei (void* pSei, PBitStringAux pBsAux) { // reserved Sei_Msg type
|
|||||||
|
|
||||||
return ERR_NONE;
|
return ERR_NONE;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
*************************************************************************************
|
||||||
|
* \brief to parse scalinglist message payload
|
||||||
|
*
|
||||||
|
* \param pps sps scaling list matrix message to be parsed output
|
||||||
|
* \param pBsAux bitstream reader auxiliary
|
||||||
|
*
|
||||||
|
* \return 0 - successed
|
||||||
|
* 1 - failed
|
||||||
|
*
|
||||||
|
* \note Call it in case scaling list matrix present at sps or pps level
|
||||||
|
*************************************************************************************
|
||||||
|
*/
|
||||||
|
int32_t SetScalingListValue (uint8_t* pScalingList, int iScalingListNum, bool* bUseDefaultScalingMatrixFlag,
|
||||||
|
PBitStringAux pBsAux) { // reserved Sei_Msg type
|
||||||
|
int iLastScale = 8;
|
||||||
|
int iNextScale = 8;
|
||||||
|
int iDeltaScale;
|
||||||
|
int32_t iCode;
|
||||||
|
for (int j = 0; j < iScalingListNum; j++) {
|
||||||
|
if (iNextScale != 0) {
|
||||||
|
WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode));
|
||||||
|
WELS_CHECK_SE_BOTH_ERROR_NOLOG (iCode, SCALING_LIST_DELTA_SCALE_MIN, SCALING_LIST_DELTA_SCALE_MAX, "DeltaScale",
|
||||||
|
ERR_SCALING_LIST_DELTA_SCALE);
|
||||||
|
iDeltaScale = iCode;
|
||||||
|
iNextScale = (iLastScale + iDeltaScale + 256) % 256;
|
||||||
|
*bUseDefaultScalingMatrixFlag = (j == 0 && iNextScale == 0);
|
||||||
|
if (*bUseDefaultScalingMatrixFlag)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pScalingList[g_kuiZigzagScan[j]] = (iNextScale == 0) ? iLastScale : iNextScale;
|
||||||
|
iLastScale = pScalingList[g_kuiZigzagScan[j]];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t ParseScalingList (PSps pSps, PBitStringAux pBs, bool bPPS, bool* pScalingListPresentFlag,
|
||||||
|
uint8_t (*iScalingList4x4)[16], uint8_t (*iScalingList8x8)[64]) {
|
||||||
|
uint32_t uiScalingListNum;
|
||||||
|
uint32_t uiCode;
|
||||||
|
int32_t iRetTmp;
|
||||||
|
bool bUseDefaultScalingMatrixFlag4x4 = false;
|
||||||
|
bool bUseDefaultScalingMatrixFlag8x8 = false;
|
||||||
|
bool bInit = false;
|
||||||
|
const uint8_t* defaultScaling[4];
|
||||||
|
|
||||||
|
if (pSps != NULL) {
|
||||||
|
uiScalingListNum = (pSps->uiChromaFormatIdc != 3) ? 8 : 12;
|
||||||
|
bInit = bPPS && pSps->bSeqScalingMatrixPresentFlag;
|
||||||
|
} else
|
||||||
|
uiScalingListNum = 12;
|
||||||
|
|
||||||
|
//Init default_scaling_list value for sps or pps
|
||||||
|
defaultScaling[0] = bInit ? pSps->iScalingList4x4[0] : g_kuiDequantScaling4x4Default[0];
|
||||||
|
defaultScaling[1] = bInit ? pSps->iScalingList4x4[3] : g_kuiDequantScaling4x4Default[1];
|
||||||
|
defaultScaling[2] = bInit ? pSps->iScalingList8x8[0] : g_kuiDequantScaling8x8Default[0];
|
||||||
|
defaultScaling[3] = bInit ? pSps->iScalingList8x8[1] : g_kuiDequantScaling8x8Default[1];
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < uiScalingListNum; i++) {
|
||||||
|
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode));
|
||||||
|
pScalingListPresentFlag[i] = !!uiCode;
|
||||||
|
if (!!uiCode) {
|
||||||
|
if (i < 6) {
|
||||||
|
iRetTmp = SetScalingListValue (iScalingList4x4[i], 16, &bUseDefaultScalingMatrixFlag4x4, pBs);
|
||||||
|
if (iRetTmp == ERR_NONE) {
|
||||||
|
if (bUseDefaultScalingMatrixFlag4x4) {
|
||||||
|
bUseDefaultScalingMatrixFlag4x4 = false;
|
||||||
|
memcpy (iScalingList4x4[i], g_kuiDequantScaling4x4Default[i / 3], sizeof (uint8_t) * 16);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
return iRetTmp;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
SetScalingListValue (iScalingList8x8[i - 6], 64, &bUseDefaultScalingMatrixFlag8x8, pBs);
|
||||||
|
//if(iRetTmp == ERR_NONE)
|
||||||
|
//{
|
||||||
|
if (bUseDefaultScalingMatrixFlag8x8) {
|
||||||
|
bUseDefaultScalingMatrixFlag8x8 = false;
|
||||||
|
memcpy (iScalingList8x8[i - 6], g_kuiDequantScaling8x8Default[ (i - 6) & 1], sizeof (uint8_t) * 64);
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
|
||||||
|
//else
|
||||||
|
// return iRetTmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (i < 6) {
|
||||||
|
if ((i != 0) && (i != 3))
|
||||||
|
memcpy (iScalingList4x4[i], iScalingList4x4[i - 1], sizeof (uint8_t) * 16);
|
||||||
|
else
|
||||||
|
memcpy (iScalingList4x4[i], defaultScaling[i / 3], sizeof (uint8_t) * 16);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if ((i == 6) || (i == 7))
|
||||||
|
memcpy (iScalingList8x8[i - 6], defaultScaling[ (i & 1) + 2], sizeof (uint8_t) * 64);
|
||||||
|
else
|
||||||
|
memcpy (iScalingList8x8[i - 6], iScalingList8x8[ (i - 6) / 3], sizeof (uint8_t) * 64);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
#include "bit_stream.h"
|
#include "bit_stream.h"
|
||||||
|
#include "error_code.h"
|
||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
|
||||||
@@ -47,10 +48,14 @@ inline uint32_t GetValue4Bytes (uint8_t* pDstNal) {
|
|||||||
return uiValue;
|
return uiValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitReadBits (PBitStringAux pBitString) {
|
int32_t InitReadBits (PBitStringAux pBitString, intX_t iEndOffset) {
|
||||||
|
if (pBitString->pCurBuf >= (pBitString->pEndBuf - iEndOffset)) {
|
||||||
|
return ERR_INFO_INVALID_ACCESS;
|
||||||
|
}
|
||||||
pBitString->uiCurBits = GetValue4Bytes (pBitString->pCurBuf);
|
pBitString->uiCurBits = GetValue4Bytes (pBitString->pCurBuf);
|
||||||
pBitString->pCurBuf += 4;
|
pBitString->pCurBuf += 4;
|
||||||
pBitString->iLeftBits = -16;
|
pBitString->iLeftBits = -16;
|
||||||
|
return ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -60,23 +65,154 @@ void InitReadBits (PBitStringAux pBitString) {
|
|||||||
* \param kpBuf bit-stream buffer
|
* \param kpBuf bit-stream buffer
|
||||||
* \param kiSize size in bits for decoder; size in bytes for encoder
|
* \param kiSize size in bits for decoder; size in bytes for encoder
|
||||||
*
|
*
|
||||||
* \return size of buffer data in byte; failed in -1 return
|
* \return 0: success, other: fail
|
||||||
*/
|
*/
|
||||||
int32_t InitBits (PBitStringAux pBitString, const uint8_t* kpBuf, const int32_t kiSize) {
|
int32_t InitBits (PBitStringAux pBitString, const uint8_t* kpBuf, const int32_t kiSize) {
|
||||||
const int32_t kiSizeBuf = (kiSize + 7) >> 3;
|
const int32_t kiSizeBuf = (kiSize + 7) >> 3;
|
||||||
uint8_t* pTmp = (uint8_t*)kpBuf;
|
uint8_t* pTmp = (uint8_t*)kpBuf;
|
||||||
|
|
||||||
if (NULL == pTmp)
|
if (NULL == pTmp)
|
||||||
return -1;
|
return ERR_INFO_INVALID_ACCESS;
|
||||||
|
|
||||||
pBitString->pStartBuf = pTmp; // buffer to start position
|
pBitString->pStartBuf = pTmp; // buffer to start position
|
||||||
pBitString->pEndBuf = pTmp + kiSizeBuf; // buffer + length
|
pBitString->pEndBuf = pTmp + kiSizeBuf; // buffer + length
|
||||||
pBitString->iBits = kiSize; // count bits of overall bitstreaming inputindex;
|
pBitString->iBits = kiSize; // count bits of overall bitstreaming inputindex;
|
||||||
|
|
||||||
pBitString->pCurBuf = pBitString->pStartBuf;
|
pBitString->pCurBuf = pBitString->pStartBuf;
|
||||||
InitReadBits (pBitString);
|
int32_t iErr = InitReadBits (pBitString, 0);
|
||||||
|
if (iErr) {
|
||||||
|
return iErr;
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
return kiSizeBuf;
|
//Following for write bs in decoder
|
||||||
|
void DecInitBitsForEncoding (PBitStringAux pBitString, uint8_t* pBuf, const int32_t kiSize) {
|
||||||
|
uint8_t* pPtr = pBuf;
|
||||||
|
pBitString->pStartBuf = pPtr;
|
||||||
|
pBitString->pCurBuf = pPtr;
|
||||||
|
pBitString->pEndBuf = pPtr + kiSize;
|
||||||
|
pBitString->iLeftBits = 32;
|
||||||
|
pBitString->uiCurBits = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define WRITE_BE_32(ptr, val) do { \
|
||||||
|
(ptr)[0] = (val) >> 24; \
|
||||||
|
(ptr)[1] = (val) >> 16; \
|
||||||
|
(ptr)[2] = (val) >> 8; \
|
||||||
|
(ptr)[3] = (val) >> 0; \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
int32_t DecBsWriteBits (PBitStringAux pBitString, int32_t iLen, const uint32_t kuiValue) {
|
||||||
|
if (iLen < pBitString->iLeftBits) {
|
||||||
|
pBitString->uiCurBits = (pBitString->uiCurBits << iLen) | kuiValue;
|
||||||
|
pBitString->iLeftBits -= iLen;
|
||||||
|
} else {
|
||||||
|
iLen -= pBitString->iLeftBits;
|
||||||
|
pBitString->uiCurBits = (pBitString->uiCurBits << pBitString->iLeftBits) | (kuiValue >> iLen);
|
||||||
|
WRITE_BE_32 (pBitString->pCurBuf, pBitString->uiCurBits);
|
||||||
|
pBitString->pCurBuf += 4;
|
||||||
|
pBitString->uiCurBits = kuiValue & ((1 << iLen) - 1);
|
||||||
|
pBitString->iLeftBits = 32 - iLen;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecBsWriteOneBit (PBitStringAux pBitString, const uint32_t kuiValue) {
|
||||||
|
DecBsWriteBits (pBitString, 1, kuiValue);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecBsFlush (PBitStringAux pBitString) {
|
||||||
|
WRITE_BE_32 (pBitString->pCurBuf, pBitString->uiCurBits << pBitString->iLeftBits);
|
||||||
|
pBitString->pCurBuf += 4 - pBitString->iLeftBits / 8;
|
||||||
|
pBitString->iLeftBits = 32;
|
||||||
|
pBitString->uiCurBits = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint32_t g_kuiDecGolombUELength[256] = {
|
||||||
|
1, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, //14
|
||||||
|
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, //30
|
||||||
|
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,//46
|
||||||
|
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,//62
|
||||||
|
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,//
|
||||||
|
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
|
||||||
|
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
|
||||||
|
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
|
||||||
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
|
17
|
||||||
|
};
|
||||||
|
|
||||||
|
int32_t DecBsWriteUe (PBitStringAux pBitString, const uint32_t kuiValue) {
|
||||||
|
uint32_t iTmpValue = kuiValue + 1;
|
||||||
|
if (256 > kuiValue) {
|
||||||
|
DecBsWriteBits (pBitString, g_kuiDecGolombUELength[kuiValue], kuiValue + 1);
|
||||||
|
} else {
|
||||||
|
uint32_t n = 0;
|
||||||
|
if (iTmpValue & 0xffff0000) {
|
||||||
|
iTmpValue >>= 16;
|
||||||
|
n += 16;
|
||||||
|
}
|
||||||
|
if (iTmpValue & 0xff) {
|
||||||
|
iTmpValue >>= 8;
|
||||||
|
n += 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
//n += (g_kuiDecGolombUELength[iTmpValue] >> 1);
|
||||||
|
|
||||||
|
n += (g_kuiDecGolombUELength[iTmpValue - 1] >> 1);
|
||||||
|
DecBsWriteBits (pBitString, (n << 1) + 1, kuiValue + 1);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecBsWriteSe (PBitStringAux pBitString, const int32_t kiValue) {
|
||||||
|
uint32_t iTmpValue;
|
||||||
|
if (0 == kiValue) {
|
||||||
|
DecBsWriteOneBit (pBitString, 1);
|
||||||
|
} else if (0 < kiValue) {
|
||||||
|
iTmpValue = (kiValue << 1) - 1;
|
||||||
|
DecBsWriteUe (pBitString, iTmpValue);
|
||||||
|
} else {
|
||||||
|
iTmpValue = ((-kiValue) << 1);
|
||||||
|
DecBsWriteUe (pBitString, iTmpValue);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecBsRbspTrailingBits (PBitStringAux pBitString) {
|
||||||
|
DecBsWriteOneBit (pBitString, 1);
|
||||||
|
DecBsFlush (pBitString);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RBSP2EBSP (uint8_t* pDstBuf, uint8_t* pSrcBuf, const int32_t kiSize) {
|
||||||
|
uint8_t* pSrcPointer = pSrcBuf;
|
||||||
|
uint8_t* pDstPointer = pDstBuf;
|
||||||
|
uint8_t* pSrcEnd = pSrcBuf + kiSize;
|
||||||
|
int32_t iZeroCount = 0;
|
||||||
|
|
||||||
|
while (pSrcPointer < pSrcEnd) {
|
||||||
|
if (iZeroCount == 2 && *pSrcPointer <= 3) {
|
||||||
|
//add the code 0x03
|
||||||
|
*pDstPointer++ = 3;
|
||||||
|
iZeroCount = 0;
|
||||||
|
}
|
||||||
|
if (*pSrcPointer == 0) {
|
||||||
|
++ iZeroCount;
|
||||||
|
} else {
|
||||||
|
iZeroCount = 0;
|
||||||
|
}
|
||||||
|
*pDstPointer++ = *pSrcPointer++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|||||||
330
codec/decoder/core/src/cabac_decoder.cpp
Normal file
330
codec/decoder/core/src/cabac_decoder.cpp
Normal file
@@ -0,0 +1,330 @@
|
|||||||
|
/*!
|
||||||
|
* \copy
|
||||||
|
* Copyright (c) 2013, Cisco Systems
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* cabac_decoder.cpp: deals with cabac state transition and related functions
|
||||||
|
*/
|
||||||
|
#include "cabac_decoder.h"
|
||||||
|
namespace WelsDec {
|
||||||
|
static const int16_t g_kMvdBinPos2Ctx [8] = {0, 1, 2, 3, 3, 3, 3, 3};
|
||||||
|
|
||||||
|
void WelsCabacGlobalInit (PWelsDecoderContext pCtx) {
|
||||||
|
for (int32_t iModel = 0; iModel < 4; iModel++) {
|
||||||
|
for (int32_t iQp = 0; iQp <= WELS_QP_MAX; iQp++)
|
||||||
|
for (int32_t iIdx = 0; iIdx < WELS_CONTEXT_COUNT; iIdx++) {
|
||||||
|
int32_t m = g_kiCabacGlobalContextIdx[iIdx][iModel][0];
|
||||||
|
int32_t n = g_kiCabacGlobalContextIdx[iIdx][iModel][1];
|
||||||
|
int32_t iPreCtxState = WELS_CLIP3 ((((m * iQp) >> 4) + n), 1, 126);
|
||||||
|
uint8_t uiValMps = 0;
|
||||||
|
uint8_t uiStateIdx = 0;
|
||||||
|
if (iPreCtxState <= 63) {
|
||||||
|
uiStateIdx = 63 - iPreCtxState;
|
||||||
|
uiValMps = 0;
|
||||||
|
} else {
|
||||||
|
uiStateIdx = iPreCtxState - 64;
|
||||||
|
uiValMps = 1;
|
||||||
|
}
|
||||||
|
pCtx->sWelsCabacContexts[iModel][iQp][iIdx].uiState = uiStateIdx;
|
||||||
|
pCtx->sWelsCabacContexts[iModel][iQp][iIdx].uiMPS = uiValMps;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pCtx->bCabacInited = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------- 1. context initialization
|
||||||
|
void WelsCabacContextInit (PWelsDecoderContext pCtx, uint8_t eSliceType, int32_t iCabacInitIdc, int32_t iQp) {
|
||||||
|
int32_t iIdx = pCtx->eSliceType == WelsCommon::I_SLICE ? 0 : iCabacInitIdc + 1;
|
||||||
|
if (!pCtx->bCabacInited) {
|
||||||
|
WelsCabacGlobalInit (pCtx);
|
||||||
|
}
|
||||||
|
memcpy (pCtx->pCabacCtx, pCtx->sWelsCabacContexts[iIdx][iQp],
|
||||||
|
WELS_CONTEXT_COUNT * sizeof (SWelsCabacCtx));
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------- 2. decoding Engine initialization
|
||||||
|
int32_t InitCabacDecEngineFromBS (PWelsCabacDecEngine pDecEngine, PBitStringAux pBsAux) {
|
||||||
|
int32_t iRemainingBits = - pBsAux->iLeftBits; //pBsAux->iLeftBits < 0
|
||||||
|
int32_t iRemainingBytes = (iRemainingBits >> 3) + 2; //+2: indicating the pre-read 2 bytes
|
||||||
|
uint8_t* pCurr;
|
||||||
|
|
||||||
|
pCurr = pBsAux->pCurBuf - iRemainingBytes;
|
||||||
|
if(pCurr >= (pBsAux->pEndBuf - 1)) {
|
||||||
|
return ERR_INFO_INVALID_ACCESS;
|
||||||
|
}
|
||||||
|
pDecEngine->uiOffset = ((pCurr[0] << 16) | (pCurr[1] << 8) | pCurr[2]);
|
||||||
|
pDecEngine->uiOffset <<= 16;
|
||||||
|
pDecEngine->uiOffset |= (pCurr[3] << 8) | pCurr[4];
|
||||||
|
pDecEngine->iBitsLeft = 31;
|
||||||
|
pDecEngine->pBuffCurr = pCurr + 5;
|
||||||
|
|
||||||
|
pDecEngine->uiRange = WELS_CABAC_HALF;
|
||||||
|
pDecEngine->pBuffStart = pBsAux->pStartBuf;
|
||||||
|
pDecEngine->pBuffEnd = pBsAux->pEndBuf;
|
||||||
|
pBsAux->iLeftBits = 0;
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RestoreCabacDecEngineToBS (PWelsCabacDecEngine pDecEngine, PBitStringAux pBsAux) {
|
||||||
|
//CABAC decoding finished, changing to SBitStringAux
|
||||||
|
pDecEngine->pBuffCurr -= (pDecEngine->iBitsLeft >> 3);
|
||||||
|
pDecEngine->iBitsLeft = 0; //pcm_alignment_zero_bit in CABAC
|
||||||
|
pBsAux->iLeftBits = 0;
|
||||||
|
pBsAux->pStartBuf = pDecEngine->pBuffStart;
|
||||||
|
pBsAux->pCurBuf = pDecEngine->pBuffCurr;
|
||||||
|
pBsAux->uiCurBits = 0;
|
||||||
|
pBsAux->iIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------- 3. actual decoding
|
||||||
|
int32_t Read32BitsCabac (PWelsCabacDecEngine pDecEngine, uint32_t& uiValue, int32_t& iNumBitsRead) {
|
||||||
|
intX_t iLeftBytes = pDecEngine->pBuffEnd - pDecEngine->pBuffCurr;
|
||||||
|
iNumBitsRead = 0;
|
||||||
|
uiValue = 0;
|
||||||
|
if (iLeftBytes <= 0) {
|
||||||
|
return ERR_CABAC_NO_BS_TO_READ;
|
||||||
|
}
|
||||||
|
switch (iLeftBytes) {
|
||||||
|
case 3:
|
||||||
|
uiValue = ((pDecEngine->pBuffCurr[0]) << 16 | (pDecEngine->pBuffCurr[1]) << 8 | (pDecEngine->pBuffCurr[2]));
|
||||||
|
pDecEngine->pBuffCurr += 3;
|
||||||
|
iNumBitsRead = 24;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
uiValue = ((pDecEngine->pBuffCurr[0]) << 8 | (pDecEngine->pBuffCurr[1]));
|
||||||
|
pDecEngine->pBuffCurr += 2;
|
||||||
|
iNumBitsRead = 16;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
uiValue = pDecEngine->pBuffCurr[0];
|
||||||
|
pDecEngine->pBuffCurr += 1;
|
||||||
|
iNumBitsRead = 8;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
uiValue = ((pDecEngine->pBuffCurr[0] << 24) | (pDecEngine->pBuffCurr[1]) << 16 | (pDecEngine->pBuffCurr[2]) << 8 |
|
||||||
|
(pDecEngine->pBuffCurr[3]));
|
||||||
|
pDecEngine->pBuffCurr += 4;
|
||||||
|
iNumBitsRead = 32;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecodeBinCabac (PWelsCabacDecEngine pDecEngine, PWelsCabacCtx pBinCtx, uint32_t& uiBinVal) {
|
||||||
|
int32_t iErrorInfo = ERR_NONE;
|
||||||
|
uint32_t uiState = pBinCtx->uiState;
|
||||||
|
uiBinVal = pBinCtx->uiMPS;
|
||||||
|
uint64_t uiOffset = pDecEngine->uiOffset;
|
||||||
|
uint64_t uiRange = pDecEngine->uiRange;
|
||||||
|
|
||||||
|
int32_t iRenorm = 1;
|
||||||
|
uint32_t uiRangeLPS = g_kuiCabacRangeLps[uiState][ (uiRange >> 6) & 0x03];
|
||||||
|
uiRange -= uiRangeLPS;
|
||||||
|
if (uiOffset >= (uiRange << pDecEngine->iBitsLeft)) { //LPS
|
||||||
|
uiOffset -= (uiRange << pDecEngine->iBitsLeft);
|
||||||
|
uiBinVal ^= 0x0001;
|
||||||
|
if (!uiState)
|
||||||
|
pBinCtx->uiMPS ^= 0x01;
|
||||||
|
pBinCtx->uiState = g_kuiStateTransTable[uiState][0];
|
||||||
|
iRenorm = g_kRenormTable256[uiRangeLPS];
|
||||||
|
uiRange = (uiRangeLPS << iRenorm);
|
||||||
|
} else { //MPS
|
||||||
|
pBinCtx->uiState = g_kuiStateTransTable[uiState][1];
|
||||||
|
if (uiRange >= WELS_CABAC_QUARTER) {
|
||||||
|
pDecEngine->uiRange = uiRange;
|
||||||
|
return ERR_NONE;
|
||||||
|
} else {
|
||||||
|
uiRange <<= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Renorm
|
||||||
|
pDecEngine->uiRange = uiRange;
|
||||||
|
pDecEngine->iBitsLeft -= iRenorm;
|
||||||
|
if (pDecEngine->iBitsLeft > 0) {
|
||||||
|
pDecEngine->uiOffset = uiOffset;
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
uint32_t uiVal = 0;
|
||||||
|
int32_t iNumBitsRead = 0;
|
||||||
|
iErrorInfo = Read32BitsCabac (pDecEngine, uiVal, iNumBitsRead);
|
||||||
|
pDecEngine->uiOffset = (uiOffset << iNumBitsRead) | uiVal;
|
||||||
|
pDecEngine->iBitsLeft += iNumBitsRead;
|
||||||
|
if (iErrorInfo && pDecEngine->iBitsLeft < 0) {
|
||||||
|
return iErrorInfo;
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecodeBypassCabac (PWelsCabacDecEngine pDecEngine, uint32_t& uiBinVal) {
|
||||||
|
int32_t iErrorInfo = ERR_NONE;
|
||||||
|
int32_t iBitsLeft = pDecEngine->iBitsLeft;
|
||||||
|
uint64_t uiOffset = pDecEngine->uiOffset;
|
||||||
|
uint64_t uiRangeValue;
|
||||||
|
|
||||||
|
|
||||||
|
if (iBitsLeft <= 0) {
|
||||||
|
uint32_t uiVal = 0;
|
||||||
|
int32_t iNumBitsRead = 0;
|
||||||
|
iErrorInfo = Read32BitsCabac (pDecEngine, uiVal, iNumBitsRead);
|
||||||
|
uiOffset = (uiOffset << iNumBitsRead) | uiVal;
|
||||||
|
iBitsLeft = iNumBitsRead;
|
||||||
|
if (iErrorInfo && iBitsLeft == 0) {
|
||||||
|
return iErrorInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
iBitsLeft--;
|
||||||
|
uiRangeValue = (pDecEngine->uiRange << iBitsLeft);
|
||||||
|
if (uiOffset >= uiRangeValue) {
|
||||||
|
pDecEngine->iBitsLeft = iBitsLeft;
|
||||||
|
pDecEngine->uiOffset = uiOffset - uiRangeValue;
|
||||||
|
uiBinVal = 1;
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
pDecEngine->iBitsLeft = iBitsLeft;
|
||||||
|
pDecEngine->uiOffset = uiOffset;
|
||||||
|
uiBinVal = 0;
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecodeTerminateCabac (PWelsCabacDecEngine pDecEngine, uint32_t& uiBinVal) {
|
||||||
|
int32_t iErrorInfo = ERR_NONE;
|
||||||
|
uint64_t uiRange = pDecEngine->uiRange - 2;
|
||||||
|
uint64_t uiOffset = pDecEngine->uiOffset;
|
||||||
|
|
||||||
|
if (uiOffset >= (uiRange << pDecEngine->iBitsLeft)) {
|
||||||
|
uiBinVal = 1;
|
||||||
|
} else {
|
||||||
|
uiBinVal = 0;
|
||||||
|
// Renorm
|
||||||
|
if (uiRange < WELS_CABAC_QUARTER) {
|
||||||
|
int32_t iRenorm = g_kRenormTable256[uiRange];
|
||||||
|
pDecEngine->uiRange = (uiRange << iRenorm);
|
||||||
|
pDecEngine->iBitsLeft -= iRenorm;
|
||||||
|
if (pDecEngine->iBitsLeft < 0) {
|
||||||
|
uint32_t uiVal = 0;
|
||||||
|
int32_t iNumBitsRead = 0;
|
||||||
|
iErrorInfo = Read32BitsCabac (pDecEngine, uiVal, iNumBitsRead);
|
||||||
|
pDecEngine->uiOffset = (pDecEngine->uiOffset << iNumBitsRead) | uiVal;
|
||||||
|
pDecEngine->iBitsLeft += iNumBitsRead;
|
||||||
|
}
|
||||||
|
if (iErrorInfo && pDecEngine->iBitsLeft < 0) {
|
||||||
|
return iErrorInfo;
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
} else {
|
||||||
|
pDecEngine->uiRange = uiRange;
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecodeUnaryBinCabac (PWelsCabacDecEngine pDecEngine, PWelsCabacCtx pBinCtx, int32_t iCtxOffset,
|
||||||
|
uint32_t& uiSymVal) {
|
||||||
|
uiSymVal = 0;
|
||||||
|
WELS_READ_VERIFY (DecodeBinCabac (pDecEngine, pBinCtx, uiSymVal));
|
||||||
|
if (uiSymVal == 0) {
|
||||||
|
return ERR_NONE;
|
||||||
|
} else {
|
||||||
|
uint32_t uiCode;
|
||||||
|
pBinCtx += iCtxOffset;
|
||||||
|
uiSymVal = 0;
|
||||||
|
do {
|
||||||
|
WELS_READ_VERIFY (DecodeBinCabac (pDecEngine, pBinCtx, uiCode));
|
||||||
|
++uiSymVal;
|
||||||
|
} while (uiCode != 0);
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecodeExpBypassCabac (PWelsCabacDecEngine pDecEngine, int32_t iCount, uint32_t& uiSymVal) {
|
||||||
|
uint32_t uiCode;
|
||||||
|
int32_t iSymTmp = 0;
|
||||||
|
int32_t iSymTmp2 = 0;
|
||||||
|
uiSymVal = 0;
|
||||||
|
do {
|
||||||
|
WELS_READ_VERIFY (DecodeBypassCabac (pDecEngine, uiCode));
|
||||||
|
if (uiCode == 1) {
|
||||||
|
iSymTmp += (1 << iCount);
|
||||||
|
++iCount;
|
||||||
|
}
|
||||||
|
} while (uiCode != 0);
|
||||||
|
|
||||||
|
while (iCount--) {
|
||||||
|
WELS_READ_VERIFY (DecodeBypassCabac (pDecEngine, uiCode));
|
||||||
|
if (uiCode == 1) {
|
||||||
|
iSymTmp2 |= (1 << iCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uiSymVal = (uint32_t) (iSymTmp + iSymTmp2);
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t DecodeUEGLevelCabac (PWelsCabacDecEngine pDecEngine, PWelsCabacCtx pBinCtx, uint32_t& uiCode) {
|
||||||
|
uiCode = 0;
|
||||||
|
WELS_READ_VERIFY (DecodeBinCabac (pDecEngine, pBinCtx, uiCode));
|
||||||
|
if (uiCode == 0)
|
||||||
|
return ERR_NONE;
|
||||||
|
else {
|
||||||
|
uint32_t uiTmp, uiCount = 1;
|
||||||
|
uiCode = 0;
|
||||||
|
do {
|
||||||
|
WELS_READ_VERIFY (DecodeBinCabac (pDecEngine, pBinCtx, uiTmp));
|
||||||
|
++uiCode;
|
||||||
|
++uiCount;
|
||||||
|
} while (uiTmp != 0 && uiCount != 13);
|
||||||
|
|
||||||
|
if (uiTmp != 0) {
|
||||||
|
WELS_READ_VERIFY (DecodeExpBypassCabac (pDecEngine, 0, uiTmp));
|
||||||
|
uiCode += uiTmp + 1;
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t DecodeUEGMvCabac (PWelsCabacDecEngine pDecEngine, PWelsCabacCtx pBinCtx, uint32_t iMaxBin, uint32_t& uiCode) {
|
||||||
|
WELS_READ_VERIFY (DecodeBinCabac (pDecEngine, pBinCtx + g_kMvdBinPos2Ctx[0], uiCode));
|
||||||
|
if (uiCode == 0)
|
||||||
|
return ERR_NONE;
|
||||||
|
else {
|
||||||
|
uint32_t uiTmp, uiCount = 1;
|
||||||
|
uiCode = 0;
|
||||||
|
do {
|
||||||
|
WELS_READ_VERIFY (DecodeBinCabac (pDecEngine, pBinCtx + g_kMvdBinPos2Ctx[uiCount++], uiTmp));
|
||||||
|
uiCode++;
|
||||||
|
} while (uiTmp != 0 && uiCount != 8);
|
||||||
|
|
||||||
|
if (uiTmp != 0) {
|
||||||
|
WELS_READ_VERIFY (DecodeExpBypassCabac (pDecEngine, 3, uiTmp));
|
||||||
|
uiCode += (uiTmp + 1);
|
||||||
|
}
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -332,13 +332,33 @@ void FilteringEdgeChromaH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t*
|
|||||||
int32_t iAlpha;
|
int32_t iAlpha;
|
||||||
int32_t iBeta;
|
int32_t iBeta;
|
||||||
ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16);
|
ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16);
|
||||||
|
if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) {
|
||||||
|
|
||||||
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
iBeta);
|
iBeta);
|
||||||
|
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1);
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingLT4Ver (pPixCb, pPixCr, iStride, iAlpha, iBeta, tc);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
|
||||||
|
|
||||||
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
|
iBeta);
|
||||||
|
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr;
|
||||||
|
TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1);
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingLT4Ver2 (pPixCbCr, iStride, iAlpha, iBeta, tc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (iAlpha | iBeta) {
|
|
||||||
TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1);
|
|
||||||
pFilter->pLoopf->pfChromaDeblockingLT4Ver (pPixCb, pPixCr, iStride, iAlpha, iBeta, tc);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -348,13 +368,33 @@ void FilteringEdgeChromaV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t*
|
|||||||
int32_t iAlpha;
|
int32_t iAlpha;
|
||||||
int32_t iBeta;
|
int32_t iBeta;
|
||||||
ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16);
|
ENFORCE_STACK_ALIGN_1D (int8_t, tc, 4, 16);
|
||||||
|
if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) {
|
||||||
|
|
||||||
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
|
||||||
iBeta);
|
|
||||||
|
|
||||||
if (iAlpha | iBeta) {
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1);
|
iBeta);
|
||||||
pFilter->pLoopf->pfChromaDeblockingLT4Hor (pPixCb, pPixCr, iStride, iAlpha, iBeta, tc);
|
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1);
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingLT4Hor (pPixCb, pPixCr, iStride, iAlpha, iBeta, tc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
|
||||||
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
|
iBeta);
|
||||||
|
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr;
|
||||||
|
TC0_TBL_LOOKUP (tc, iIndexA, pBS, 1);
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingLT4Hor2 (pPixCbCr, iStride, iAlpha, iBeta, tc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -364,12 +404,27 @@ void FilteringEdgeChromaIntraH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uin
|
|||||||
int32_t iIndexA;
|
int32_t iIndexA;
|
||||||
int32_t iAlpha;
|
int32_t iAlpha;
|
||||||
int32_t iBeta;
|
int32_t iBeta;
|
||||||
|
if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) {
|
||||||
|
|
||||||
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
iBeta);
|
iBeta);
|
||||||
|
|
||||||
if (iAlpha | iBeta) {
|
if (iAlpha | iBeta) {
|
||||||
pFilter->pLoopf->pfChromaDeblockingEQ4Ver (pPixCb, pPixCr, iStride, iAlpha, iBeta);
|
pFilter->pLoopf->pfChromaDeblockingEQ4Ver (pPixCb, pPixCr, iStride, iAlpha, iBeta);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
|
||||||
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
|
iBeta);
|
||||||
|
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr;
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingEQ4Ver2 (pPixCbCr, iStride, iAlpha, iBeta);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -379,12 +434,29 @@ void FilteringEdgeChromaIntraV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uin
|
|||||||
int32_t iIndexA;
|
int32_t iIndexA;
|
||||||
int32_t iAlpha;
|
int32_t iAlpha;
|
||||||
int32_t iBeta;
|
int32_t iBeta;
|
||||||
|
if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) { // QP of cb and cr are the same
|
||||||
|
|
||||||
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
|
||||||
iBeta);
|
|
||||||
|
|
||||||
if (iAlpha | iBeta) {
|
|
||||||
pFilter->pLoopf->pfChromaDeblockingEQ4Hor (pPixCb, pPixCr, iStride, iAlpha, iBeta);
|
|
||||||
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
|
iBeta);
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingEQ4Hor (pPixCb, pPixCr, iStride, iAlpha, iBeta);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
|
||||||
|
|
||||||
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
|
iBeta);
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
uint8_t* pPixCbCr = (i == 0) ? pPixCb : pPixCr;
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingEQ4Hor2 (pPixCbCr, iStride, iAlpha, iBeta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -397,7 +469,8 @@ void DeblockingInterMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, uint8_
|
|||||||
int32_t iMbY = pCurDqLayer->iMbY;
|
int32_t iMbY = pCurDqLayer->iMbY;
|
||||||
|
|
||||||
int32_t iCurLumaQp = pCurDqLayer->pLumaQp[iMbXyIndex];
|
int32_t iCurLumaQp = pCurDqLayer->pLumaQp[iMbXyIndex];
|
||||||
int32_t iCurChromaQp = pCurDqLayer->pChromaQp[iMbXyIndex];
|
//int32_t* iCurChromaQp = pCurDqLayer->pChromaQp[iMbXyIndex];
|
||||||
|
int8_t* pCurChromaQp = pCurDqLayer->pChromaQp[iMbXyIndex];
|
||||||
int32_t iLineSize = pFilter->iCsStride[0];
|
int32_t iLineSize = pFilter->iCsStride[0];
|
||||||
int32_t iLineSizeUV = pFilter->iCsStride[1];
|
int32_t iLineSizeUV = pFilter->iCsStride[1];
|
||||||
|
|
||||||
@@ -406,11 +479,13 @@ void DeblockingInterMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, uint8_
|
|||||||
pDestCb = pFilter->pCsData[1] + ((iMbY * iLineSizeUV + iMbX) << 3);
|
pDestCb = pFilter->pCsData[1] + ((iMbY * iLineSizeUV + iMbX) << 3);
|
||||||
pDestCr = pFilter->pCsData[2] + ((iMbY * iLineSizeUV + iMbX) << 3);
|
pDestCr = pFilter->pCsData[2] + ((iMbY * iLineSizeUV + iMbX) << 3);
|
||||||
|
|
||||||
|
//Vertical margrin
|
||||||
if (iBoundryFlag & LEFT_FLAG_MASK) {
|
if (iBoundryFlag & LEFT_FLAG_MASK) {
|
||||||
int32_t iLeftXyIndex = iMbXyIndex - 1;
|
int32_t iLeftXyIndex = iMbXyIndex - 1;
|
||||||
pFilter->iLumaQP = (iCurLumaQp + pCurDqLayer->pLumaQp[iLeftXyIndex] + 1) >> 1;
|
pFilter->iLumaQP = (iCurLumaQp + pCurDqLayer->pLumaQp[iLeftXyIndex] + 1) >> 1;
|
||||||
pFilter->iChromaQP = (iCurChromaQp + pCurDqLayer->pChromaQp[iLeftXyIndex] + 1) >> 1;
|
for (int i = 0; i < 2; i++) {
|
||||||
|
pFilter->iChromaQP[i] = (pCurChromaQp[i] + pCurDqLayer->pChromaQp[iLeftXyIndex][i] + 1) >> 1;
|
||||||
|
}
|
||||||
if (nBS[0][0][0] == 0x04) {
|
if (nBS[0][0][0] == 0x04) {
|
||||||
FilteringEdgeLumaIntraV (pFilter, pDestY, iLineSize, NULL);
|
FilteringEdgeLumaIntraV (pFilter, pDestY, iLineSize, NULL);
|
||||||
FilteringEdgeChromaIntraV (pFilter, pDestCb, pDestCr, iLineSizeUV, NULL);
|
FilteringEdgeChromaIntraV (pFilter, pDestCb, pDestCr, iLineSizeUV, NULL);
|
||||||
@@ -423,7 +498,8 @@ void DeblockingInterMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, uint8_
|
|||||||
}
|
}
|
||||||
|
|
||||||
pFilter->iLumaQP = iCurLumaQp;
|
pFilter->iLumaQP = iCurLumaQp;
|
||||||
pFilter->iChromaQP = iCurChromaQp;
|
pFilter->iChromaQP[0] = pCurChromaQp[0];
|
||||||
|
pFilter->iChromaQP[1] = pCurChromaQp[1];
|
||||||
|
|
||||||
if (* (uint32_t*)nBS[0][1] != 0) {
|
if (* (uint32_t*)nBS[0][1] != 0) {
|
||||||
FilteringEdgeLumaV (pFilter, &pDestY[1 << 2], iLineSize, nBS[0][1]);
|
FilteringEdgeLumaV (pFilter, &pDestY[1 << 2], iLineSize, nBS[0][1]);
|
||||||
@@ -441,7 +517,9 @@ void DeblockingInterMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, uint8_
|
|||||||
if (iBoundryFlag & TOP_FLAG_MASK) {
|
if (iBoundryFlag & TOP_FLAG_MASK) {
|
||||||
int32_t iTopXyIndex = iMbXyIndex - pCurDqLayer->iMbWidth;
|
int32_t iTopXyIndex = iMbXyIndex - pCurDqLayer->iMbWidth;
|
||||||
pFilter->iLumaQP = (iCurLumaQp + pCurDqLayer->pLumaQp[iTopXyIndex] + 1) >> 1;
|
pFilter->iLumaQP = (iCurLumaQp + pCurDqLayer->pLumaQp[iTopXyIndex] + 1) >> 1;
|
||||||
pFilter->iChromaQP = (iCurChromaQp + pCurDqLayer->pChromaQp[iTopXyIndex] + 1) >> 1;
|
for (int i = 0; i < 2; i++) {
|
||||||
|
pFilter->iChromaQP[i] = (pCurChromaQp[i] + pCurDqLayer->pChromaQp[iTopXyIndex][i] + 1) >> 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (nBS[1][0][0] == 0x04) {
|
if (nBS[1][0][0] == 0x04) {
|
||||||
FilteringEdgeLumaIntraH (pFilter, pDestY, iLineSize, NULL);
|
FilteringEdgeLumaIntraH (pFilter, pDestY, iLineSize, NULL);
|
||||||
@@ -455,7 +533,8 @@ void DeblockingInterMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, uint8_
|
|||||||
}
|
}
|
||||||
|
|
||||||
pFilter->iLumaQP = iCurLumaQp;
|
pFilter->iLumaQP = iCurLumaQp;
|
||||||
pFilter->iChromaQP = iCurChromaQp;
|
pFilter->iChromaQP[0] = pCurChromaQp[0];
|
||||||
|
pFilter->iChromaQP[1] = pCurChromaQp[1];
|
||||||
|
|
||||||
if (* (uint32_t*)nBS[1][1] != 0) {
|
if (* (uint32_t*)nBS[1][1] != 0) {
|
||||||
FilteringEdgeLumaH (pFilter, &pDestY[ (1 << 2)*iLineSize], iLineSize, nBS[1][1]);
|
FilteringEdgeLumaH (pFilter, &pDestY[ (1 << 2)*iLineSize], iLineSize, nBS[1][1]);
|
||||||
@@ -527,8 +606,10 @@ void FilteringEdgeChromaHV (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, in
|
|||||||
int32_t iMbWidth = pCurDqLayer->iMbWidth;
|
int32_t iMbWidth = pCurDqLayer->iMbWidth;
|
||||||
int32_t iLineSize = pFilter->iCsStride[1];
|
int32_t iLineSize = pFilter->iCsStride[1];
|
||||||
|
|
||||||
uint8_t* pDestCb, *pDestCr;
|
uint8_t* pDestCb;
|
||||||
int32_t iCurQp;
|
uint8_t* pDestCr;
|
||||||
|
//int32_t iCurQp;
|
||||||
|
int8_t* pCurQp;
|
||||||
int32_t iIndexA, iAlpha, iBeta;
|
int32_t iIndexA, iAlpha, iBeta;
|
||||||
|
|
||||||
ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16);
|
ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16);
|
||||||
@@ -536,33 +617,76 @@ void FilteringEdgeChromaHV (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, in
|
|||||||
|
|
||||||
pDestCb = pFilter->pCsData[1] + ((iMbY * iLineSize + iMbX) << 3);
|
pDestCb = pFilter->pCsData[1] + ((iMbY * iLineSize + iMbX) << 3);
|
||||||
pDestCr = pFilter->pCsData[2] + ((iMbY * iLineSize + iMbX) << 3);
|
pDestCr = pFilter->pCsData[2] + ((iMbY * iLineSize + iMbX) << 3);
|
||||||
iCurQp = pCurDqLayer->pChromaQp[iMbXyIndex];
|
pCurQp = pCurDqLayer->pChromaQp[iMbXyIndex];
|
||||||
|
|
||||||
* (uint32_t*)uiBSx4 = 0x03030303;
|
* (uint32_t*)uiBSx4 = 0x03030303;
|
||||||
|
|
||||||
// chroma v
|
|
||||||
|
// chroma v
|
||||||
if (iBoundryFlag & LEFT_FLAG_MASK) {
|
if (iBoundryFlag & LEFT_FLAG_MASK) {
|
||||||
pFilter->iChromaQP = (iCurQp + pCurDqLayer->pChromaQp[iMbXyIndex - 1] + 1) >> 1;
|
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
pFilter->iChromaQP[i] = (pCurQp[i] + pCurDqLayer->pChromaQp[iMbXyIndex - 1][i] + 1) >> 1;
|
||||||
|
|
||||||
|
}
|
||||||
FilteringEdgeChromaIntraV (pFilter, pDestCb, pDestCr, iLineSize, NULL);
|
FilteringEdgeChromaIntraV (pFilter, pDestCb, pDestCr, iLineSize, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
pFilter->iChromaQP = iCurQp;
|
pFilter->iChromaQP[0] = pCurQp[0];
|
||||||
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP, pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
pFilter->iChromaQP[1] = pCurQp[1];
|
||||||
iBeta);
|
if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) {
|
||||||
if (iAlpha | iBeta) {
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1);
|
iBeta);
|
||||||
pFilter->pLoopf->pfChromaDeblockingLT4Hor (&pDestCb[2 << 1], &pDestCr[2 << 1], iLineSize, iAlpha, iBeta, iTc);
|
if (iAlpha | iBeta) {
|
||||||
|
TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1);
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingLT4Hor (&pDestCb[2 << 1], &pDestCr[2 << 1], iLineSize, iAlpha, iBeta, iTc);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
|
iBeta);
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
uint8_t* pDestCbCr = (i == 0) ? &pDestCb[2 << 1] : &pDestCr[2 << 1];
|
||||||
|
TC0_TBL_LOOKUP (iTc, iIndexA, uiBSx4, 1);
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingLT4Hor2 (pDestCbCr, iLineSize, iAlpha, iBeta, iTc);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// chroma h
|
// chroma h
|
||||||
|
|
||||||
if (iBoundryFlag & TOP_FLAG_MASK) {
|
if (iBoundryFlag & TOP_FLAG_MASK) {
|
||||||
pFilter->iChromaQP = (iCurQp + pCurDqLayer->pChromaQp[iMbXyIndex - iMbWidth] + 1) >> 1;
|
for (int i = 0; i < 2; i++) {
|
||||||
|
pFilter->iChromaQP[i] = (pCurQp[i] + pCurDqLayer->pChromaQp[iMbXyIndex - iMbWidth][i] + 1) >> 1;
|
||||||
|
}
|
||||||
FilteringEdgeChromaIntraH (pFilter, pDestCb, pDestCr, iLineSize, NULL);
|
FilteringEdgeChromaIntraH (pFilter, pDestCb, pDestCr, iLineSize, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
pFilter->iChromaQP = iCurQp;
|
pFilter->iChromaQP[0] = pCurQp[0];
|
||||||
if (iAlpha | iBeta) {
|
pFilter->iChromaQP[1] = pCurQp[1];
|
||||||
pFilter->pLoopf->pfChromaDeblockingLT4Ver (&pDestCb[ (2 << 1)*iLineSize], &pDestCr[ (2 << 1)*iLineSize], iLineSize,
|
|
||||||
iAlpha, iBeta, iTc);
|
if (pFilter->iChromaQP[0] == pFilter->iChromaQP[1]) {
|
||||||
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[0], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
|
iBeta);
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingLT4Ver (&pDestCb[ (2 << 1)*iLineSize], &pDestCr[ (2 << 1)*iLineSize], iLineSize,
|
||||||
|
iAlpha, iBeta, iTc);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
|
||||||
|
GET_ALPHA_BETA_FROM_QP (pFilter->iChromaQP[i], pFilter->iSliceAlphaC0Offset, pFilter->iSliceBetaOffset, iIndexA, iAlpha,
|
||||||
|
iBeta);
|
||||||
|
if (iAlpha | iBeta) {
|
||||||
|
uint8_t* pDestCbCr = (i == 0) ? &pDestCb[ (2 << 1) * iLineSize] : &pDestCr[ (2 << 1) * iLineSize];
|
||||||
|
pFilter->pLoopf->pfChromaDeblockingLT4Ver2 (pDestCbCr, iLineSize,
|
||||||
|
iAlpha, iBeta, iTc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,6 +830,11 @@ void DeblockingInit (SDeblockingFunc* pFunc, int32_t iCpu) {
|
|||||||
pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_c;
|
pFunc->pfChromaDeblockingLT4Hor = DeblockChromaLt4H_c;
|
||||||
pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_c;
|
pFunc->pfChromaDeblockingEQ4Hor = DeblockChromaEq4H_c;
|
||||||
|
|
||||||
|
pFunc->pfChromaDeblockingLT4Ver2 = DeblockChromaLt4V2_c;
|
||||||
|
pFunc->pfChromaDeblockingEQ4Ver2 = DeblockChromaEq4V2_c;
|
||||||
|
pFunc->pfChromaDeblockingLT4Hor2 = DeblockChromaLt4H2_c;
|
||||||
|
pFunc->pfChromaDeblockingEQ4Hor2 = DeblockChromaEq4H2_c;
|
||||||
|
|
||||||
#ifdef X86_ASM
|
#ifdef X86_ASM
|
||||||
if (iCpu & WELS_CPU_SSSE3) {
|
if (iCpu & WELS_CPU_SSSE3) {
|
||||||
pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_ssse3;
|
pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_ssse3;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -51,7 +51,7 @@
|
|||||||
#include "expand_pic.h"
|
#include "expand_pic.h"
|
||||||
#include "decode_slice.h"
|
#include "decode_slice.h"
|
||||||
#include "error_concealment.h"
|
#include "error_concealment.h"
|
||||||
#include "mem_align.h"
|
#include "memory_align.h"
|
||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
|
||||||
@@ -67,34 +67,177 @@ static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, cons
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPicBuf = (PPicBuff)WelsMalloc (sizeof (SPicBuff), "PPicBuff");
|
pPicBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff");
|
||||||
|
|
||||||
if (NULL == pPicBuf) {
|
if (NULL == pPicBuf) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPicBuf->ppPic = (PPicture*)WelsMalloc (kiSize * sizeof (PPicture), "PPicture*");
|
pPicBuf->ppPic = (PPicture*)WelsMallocz (kiSize * sizeof (PPicture), "PPicture*");
|
||||||
|
|
||||||
if (NULL == pPicBuf->ppPic) {
|
if (NULL == pPicBuf->ppPic) {
|
||||||
|
pPicBuf->iCapacity = 0;
|
||||||
|
DestroyPicBuff (&pPicBuf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iPicIdx = 0; iPicIdx < kiSize; ++ iPicIdx) {
|
for (iPicIdx = 0; iPicIdx < kiSize; ++ iPicIdx) {
|
||||||
PPicture pPic = AllocPicture (pCtx, kiPicWidth, kiPicHeight);
|
PPicture pPic = AllocPicture (pCtx, kiPicWidth, kiPicHeight);
|
||||||
if (NULL == pPic) {
|
if (NULL == pPic) {
|
||||||
|
// init capacity first for free memory
|
||||||
|
pPicBuf->iCapacity = iPicIdx;
|
||||||
|
DestroyPicBuff (&pPicBuf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
pPicBuf->ppPic[iPicIdx] = pPic;
|
pPicBuf->ppPic[iPicIdx] = pPic;
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize context in queue
|
// initialize context in queue
|
||||||
pPicBuf->iCapacity = kiSize;
|
pPicBuf->iCapacity = kiSize;
|
||||||
pPicBuf->iCurrentIdx = 0;
|
pPicBuf->iCurrentIdx = 0;
|
||||||
*ppPicBuf = pPicBuf;
|
* ppPicBuf = pPicBuf;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DestroyPicBuff (PPicBuff* ppPicBuf) {
|
static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiOldSize,
|
||||||
|
const int32_t kiPicWidth, const int32_t kiPicHeight, const int32_t kiNewSize) {
|
||||||
|
PPicBuff pPicOldBuf = *ppPicBuf;
|
||||||
|
PPicBuff pPicNewBuf = NULL;
|
||||||
|
int32_t iPicIdx = 0;
|
||||||
|
if (kiOldSize <= 0 || kiNewSize <= 0 || kiPicWidth <= 0 || kiPicHeight <= 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff");
|
||||||
|
|
||||||
|
if (NULL == pPicNewBuf) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pPicNewBuf->ppPic = (PPicture*)WelsMallocz (kiNewSize * sizeof (PPicture), "PPicture*");
|
||||||
|
|
||||||
|
if (NULL == pPicNewBuf->ppPic) {
|
||||||
|
pPicNewBuf->iCapacity = 0;
|
||||||
|
DestroyPicBuff (&pPicNewBuf);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// increase new PicBuf
|
||||||
|
for (iPicIdx = kiOldSize; iPicIdx < kiNewSize; ++ iPicIdx) {
|
||||||
|
PPicture pPic = AllocPicture (pCtx, kiPicWidth, kiPicHeight);
|
||||||
|
if (NULL == pPic) {
|
||||||
|
// Set maximum capacity as the new malloc memory at the tail
|
||||||
|
pPicNewBuf->iCapacity = iPicIdx;
|
||||||
|
DestroyPicBuff (&pPicNewBuf);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
pPicNewBuf->ppPic[iPicIdx] = pPic;
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy old PicBuf to new PicBuf
|
||||||
|
memcpy (pPicNewBuf->ppPic, pPicOldBuf->ppPic, kiOldSize * sizeof (PPicture));
|
||||||
|
|
||||||
|
// initialize context in queue
|
||||||
|
pPicNewBuf->iCapacity = kiNewSize;
|
||||||
|
pPicNewBuf->iCurrentIdx = pPicOldBuf->iCurrentIdx;
|
||||||
|
* ppPicBuf = pPicNewBuf;
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < pPicNewBuf->iCapacity; i++) {
|
||||||
|
pPicNewBuf->ppPic[i]->bUsedAsRef = false;
|
||||||
|
pPicNewBuf->ppPic[i]->bIsLongRef = false;
|
||||||
|
pPicNewBuf->ppPic[i]->uiRefCount = 0;
|
||||||
|
pPicNewBuf->ppPic[i]->bAvailableFlag = true;
|
||||||
|
pPicNewBuf->ppPic[i]->bIsComplete = false;
|
||||||
|
}
|
||||||
|
// remove old PicBuf
|
||||||
|
if (pPicOldBuf->ppPic != NULL) {
|
||||||
|
WelsFree (pPicOldBuf->ppPic, "pPicOldBuf->queue");
|
||||||
|
pPicOldBuf->ppPic = NULL;
|
||||||
|
}
|
||||||
|
pPicOldBuf->iCapacity = 0;
|
||||||
|
pPicOldBuf->iCurrentIdx = 0;
|
||||||
|
WelsFree (pPicOldBuf, "pPicOldBuf");
|
||||||
|
pPicOldBuf = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiOldSize,
|
||||||
|
const int32_t kiPicWidth, const int32_t kiPicHeight, const int32_t kiNewSize) {
|
||||||
|
PPicBuff pPicOldBuf = *ppPicBuf;
|
||||||
|
PPicBuff pPicNewBuf = NULL;
|
||||||
|
int32_t iPicIdx = 0;
|
||||||
|
if (kiOldSize <= 0 || kiNewSize <= 0 || kiPicWidth <= 0 || kiPicHeight <= 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff");
|
||||||
|
|
||||||
|
if (NULL == pPicNewBuf) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pPicNewBuf->ppPic = (PPicture*)WelsMallocz (kiNewSize * sizeof (PPicture), "PPicture*");
|
||||||
|
|
||||||
|
if (NULL == pPicNewBuf->ppPic) {
|
||||||
|
pPicNewBuf->iCapacity = 0;
|
||||||
|
DestroyPicBuff (&pPicNewBuf);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t iPrevPicIdx = -1;
|
||||||
|
for (iPrevPicIdx = 0; iPrevPicIdx < kiOldSize; ++iPrevPicIdx) {
|
||||||
|
if (pCtx->pPreviousDecodedPictureInDpb == pPicOldBuf->ppPic[iPrevPicIdx]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int32_t iDelIdx;
|
||||||
|
if (iPrevPicIdx < kiOldSize && iPrevPicIdx >= kiNewSize) {
|
||||||
|
// found pPreviousDecodedPictureInDpb,
|
||||||
|
pPicNewBuf->ppPic[0] = pPicOldBuf->ppPic[iPrevPicIdx];
|
||||||
|
pPicNewBuf->iCurrentIdx = 0;
|
||||||
|
memcpy (pPicNewBuf->ppPic + 1, pPicOldBuf->ppPic, (kiNewSize - 1) * sizeof (PPicture));
|
||||||
|
iDelIdx = kiNewSize - 1;
|
||||||
|
} else {
|
||||||
|
memcpy (pPicNewBuf->ppPic, pPicOldBuf->ppPic, kiNewSize * sizeof (PPicture));
|
||||||
|
pPicNewBuf->iCurrentIdx = iPrevPicIdx < kiNewSize ? iPrevPicIdx : 0;
|
||||||
|
iDelIdx = kiNewSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (iPicIdx = iDelIdx; iPicIdx < kiOldSize; iPicIdx++) {
|
||||||
|
if (iPrevPicIdx != iPicIdx) {
|
||||||
|
if (pPicOldBuf->ppPic[iPicIdx] != NULL) {
|
||||||
|
FreePicture (pPicOldBuf->ppPic[iPicIdx]);
|
||||||
|
pPicOldBuf->ppPic[iPicIdx] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// initialize context in queue
|
||||||
|
pPicNewBuf->iCapacity = kiNewSize;
|
||||||
|
*ppPicBuf = pPicNewBuf;
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < pPicNewBuf->iCapacity; i++) {
|
||||||
|
pPicNewBuf->ppPic[i]->bUsedAsRef = false;
|
||||||
|
pPicNewBuf->ppPic[i]->bIsLongRef = false;
|
||||||
|
pPicNewBuf->ppPic[i]->uiRefCount = 0;
|
||||||
|
pPicNewBuf->ppPic[i]->bAvailableFlag = true;
|
||||||
|
pPicNewBuf->ppPic[i]->bIsComplete = false;
|
||||||
|
}
|
||||||
|
// remove old PicBuf
|
||||||
|
if (pPicOldBuf->ppPic != NULL) {
|
||||||
|
WelsFree (pPicOldBuf->ppPic, "pPicOldBuf->queue");
|
||||||
|
pPicOldBuf->ppPic = NULL;
|
||||||
|
}
|
||||||
|
pPicOldBuf->iCapacity = 0;
|
||||||
|
pPicOldBuf->iCurrentIdx = 0;
|
||||||
|
WelsFree (pPicOldBuf, "pPicOldBuf");
|
||||||
|
pPicOldBuf = NULL;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DestroyPicBuff (PPicBuff* ppPicBuf) {
|
||||||
PPicBuff pPicBuf = NULL;
|
PPicBuff pPicBuf = NULL;
|
||||||
|
|
||||||
if (NULL == ppPicBuf || NULL == *ppPicBuf)
|
if (NULL == ppPicBuf || NULL == *ppPicBuf)
|
||||||
@@ -139,12 +282,15 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
|
|||||||
pCtx->uiCpuFlag = 0;
|
pCtx->uiCpuFlag = 0;
|
||||||
|
|
||||||
pCtx->bAuReadyFlag = 0; // au data is not ready
|
pCtx->bAuReadyFlag = 0; // au data is not ready
|
||||||
|
pCtx->bCabacInited = false;
|
||||||
|
|
||||||
pCtx->uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);
|
pCtx->uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);
|
||||||
|
|
||||||
pCtx->iImgWidthInPixel = 0;
|
pCtx->iImgWidthInPixel = 0;
|
||||||
pCtx->iImgHeightInPixel = 0; // alloc picture data when picture size is available
|
pCtx->iImgHeightInPixel = 0; // alloc picture data when picture size is available
|
||||||
|
pCtx->iLastImgWidthInPixel = 0;
|
||||||
|
pCtx->iLastImgHeightInPixel = 0;
|
||||||
|
pCtx->bFreezeOutput = true;
|
||||||
|
|
||||||
pCtx->iFrameNum = -1;
|
pCtx->iFrameNum = -1;
|
||||||
pCtx->iPrevFrameNum = -1;
|
pCtx->iPrevFrameNum = -1;
|
||||||
@@ -160,9 +306,20 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
|
|||||||
pCtx->pPicBuff[LIST_1] = NULL;
|
pCtx->pPicBuff[LIST_1] = NULL;
|
||||||
|
|
||||||
pCtx->bAvcBasedFlag = true;
|
pCtx->bAvcBasedFlag = true;
|
||||||
pCtx->eErrorConMethod = ERROR_CON_SLICE_COPY;
|
pCtx->eErrorConMethod = ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE;
|
||||||
pCtx->pPreviousDecodedPictureInDpb = NULL;
|
pCtx->pPreviousDecodedPictureInDpb = NULL;
|
||||||
|
pCtx->sDecoderStatistics.iAvgLumaQp = -1;
|
||||||
|
pCtx->bSpsLatePps = false;
|
||||||
|
pCtx->bUseScalingList = false;
|
||||||
|
pCtx->iSpsErrorIgnored = 0;
|
||||||
|
pCtx->iSubSpsErrorIgnored = 0;
|
||||||
|
pCtx->iPpsErrorIgnored = 0;
|
||||||
|
pCtx->iPPSInvalidNum = 0;
|
||||||
|
pCtx->iPPSLastInvalidId = -1;
|
||||||
|
pCtx->iSPSInvalidNum = 0;
|
||||||
|
pCtx->iSPSLastInvalidId = -1;
|
||||||
|
pCtx->iSubSPSInvalidNum = 0;
|
||||||
|
pCtx->iSubSPSLastInvalidId = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -175,10 +332,11 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
|
|||||||
*/
|
*/
|
||||||
static inline int32_t GetTargetRefListSize (PWelsDecoderContext pCtx) {
|
static inline int32_t GetTargetRefListSize (PWelsDecoderContext pCtx) {
|
||||||
int32_t iNumRefFrames = 0;
|
int32_t iNumRefFrames = 0;
|
||||||
|
// +2 for EC MV Copy buffer exchange
|
||||||
if ((pCtx == NULL) || (pCtx->pSps == NULL)) {
|
if ((pCtx == NULL) || (pCtx->pSps == NULL)) {
|
||||||
iNumRefFrames = MAX_REF_PIC_COUNT;
|
iNumRefFrames = MAX_REF_PIC_COUNT + 2;
|
||||||
} else {
|
} else {
|
||||||
iNumRefFrames = pCtx->pSps->iNumRefFrames + 1;
|
iNumRefFrames = pCtx->pSps->iNumRefFrames + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LONG_TERM_REF
|
#ifdef LONG_TERM_REF
|
||||||
@@ -220,18 +378,42 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const
|
|||||||
// sync update pRefList
|
// sync update pRefList
|
||||||
WelsResetRefPic (pCtx); // added to sync update ref list due to pictures are free
|
WelsResetRefPic (pCtx); // added to sync update ref list due to pictures are free
|
||||||
|
|
||||||
// for Recycled_Pic_Queue
|
if (pCtx->bHaveGotMemory && (kiPicWidth == pCtx->iImgWidthInPixel && kiPicHeight == pCtx->iImgHeightInPixel)
|
||||||
for (iListIdx = LIST_0; iListIdx < LIST_A; ++ iListIdx) {
|
&& pCtx->pPicBuff[LIST_0] != NULL && pCtx->pPicBuff[LIST_0]->iCapacity != iPicQueueSize) {
|
||||||
PPicBuff* ppPic = &pCtx->pPicBuff[iListIdx];
|
// currently only active for LIST_0 due to have no B frames
|
||||||
if (NULL != ppPic && NULL != *ppPic) {
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO,
|
||||||
DestroyPicBuff (ppPic);
|
"WelsRequestMem(): memory re-alloc for no resolution change (size = %d * %d), ref list size change from %d to %d",
|
||||||
|
kiPicWidth, kiPicHeight, pCtx->pPicBuff[LIST_0]->iCapacity, iPicQueueSize);
|
||||||
|
if (pCtx->pPicBuff[LIST_0]->iCapacity < iPicQueueSize) {
|
||||||
|
iErr = IncreasePicBuff (pCtx, &pCtx->pPicBuff[LIST_0], pCtx->pPicBuff[LIST_0]->iCapacity, kiPicWidth, kiPicHeight,
|
||||||
|
iPicQueueSize);
|
||||||
|
} else {
|
||||||
|
iErr = DecreasePicBuff (pCtx, &pCtx->pPicBuff[LIST_0], pCtx->pPicBuff[LIST_0]->iCapacity, kiPicWidth, kiPicHeight,
|
||||||
|
iPicQueueSize);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (pCtx->bHaveGotMemory)
|
||||||
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO,
|
||||||
|
"WelsRequestMem(): memory re-alloc for resolution change, size change from %d * %d to %d * %d, ref list size change from %d to %d",
|
||||||
|
pCtx->iImgWidthInPixel, pCtx->iImgHeightInPixel, kiPicWidth, kiPicHeight, pCtx->pPicBuff[LIST_0]->iCapacity,
|
||||||
|
iPicQueueSize);
|
||||||
|
else
|
||||||
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "WelsRequestMem(): memory alloc size = %d * %d, ref list size = %d",
|
||||||
|
kiPicWidth, kiPicHeight, iPicQueueSize);
|
||||||
|
// for Recycled_Pic_Queue
|
||||||
|
for (iListIdx = LIST_0; iListIdx < LIST_A; ++ iListIdx) {
|
||||||
|
PPicBuff* ppPic = &pCtx->pPicBuff[iListIdx];
|
||||||
|
if (NULL != ppPic && NULL != *ppPic) {
|
||||||
|
DestroyPicBuff (ppPic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pCtx->pPreviousDecodedPictureInDpb = NULL;
|
||||||
|
|
||||||
|
// currently only active for LIST_0 due to have no B frames
|
||||||
|
iErr = CreatePicBuff (pCtx, &pCtx->pPicBuff[LIST_0], iPicQueueSize, kiPicWidth, kiPicHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
pCtx->pPreviousDecodedPictureInDpb = NULL;
|
|
||||||
|
|
||||||
// currently only active for LIST_0 due to have no B frames
|
|
||||||
iErr = CreatePicBuff (pCtx, &pCtx->pPicBuff[LIST_0], iPicQueueSize, kiPicWidth, kiPicHeight);
|
|
||||||
if (iErr != ERR_NONE)
|
if (iErr != ERR_NONE)
|
||||||
return iErr;
|
return iErr;
|
||||||
|
|
||||||
@@ -241,6 +423,10 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const
|
|||||||
|
|
||||||
pCtx->bHaveGotMemory = true; // global memory for decoder context related is requested
|
pCtx->bHaveGotMemory = true; // global memory for decoder context related is requested
|
||||||
pCtx->pDec = NULL; // need prefetch a new pic due to spatial size changed
|
pCtx->pDec = NULL; // need prefetch a new pic due to spatial size changed
|
||||||
|
|
||||||
|
if (pCtx->pCabacDecEngine == NULL)
|
||||||
|
pCtx->pCabacDecEngine = (SWelsCabacDecEngine*) WelsMallocz (sizeof (SWelsCabacDecEngine), "pCtx->pCabacDecEngine");
|
||||||
|
WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY, (NULL == pCtx->pCabacDecEngine))
|
||||||
return ERR_NONE;
|
return ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,16 +452,20 @@ void WelsFreeMem (PWelsDecoderContext pCtx) {
|
|||||||
// added for safe memory
|
// added for safe memory
|
||||||
pCtx->iImgWidthInPixel = 0;
|
pCtx->iImgWidthInPixel = 0;
|
||||||
pCtx->iImgHeightInPixel = 0;
|
pCtx->iImgHeightInPixel = 0;
|
||||||
|
pCtx->iLastImgWidthInPixel = 0;
|
||||||
|
pCtx->iLastImgHeightInPixel = 0;
|
||||||
|
pCtx->bFreezeOutput = true;
|
||||||
pCtx->bHaveGotMemory = false;
|
pCtx->bHaveGotMemory = false;
|
||||||
|
WelsFree (pCtx->pCabacDecEngine, "pCtx->pCabacDecEngine");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Open decoder
|
* \brief Open decoder
|
||||||
*/
|
*/
|
||||||
void WelsOpenDecoder (PWelsDecoderContext pCtx) {
|
int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) {
|
||||||
// function pointers
|
// function pointers
|
||||||
//initial MC function pointer--
|
//initial MC function pointer--
|
||||||
|
int iRet = ERR_NONE;
|
||||||
InitMcFunc (& (pCtx->sMcFunc), pCtx->uiCpuFlag);
|
InitMcFunc (& (pCtx->sMcFunc), pCtx->uiCpuFlag);
|
||||||
|
|
||||||
InitExpandPictureFunc (& (pCtx->sExpandPicFunc), pCtx->uiCpuFlag);
|
InitExpandPictureFunc (& (pCtx->sExpandPicFunc), pCtx->uiCpuFlag);
|
||||||
@@ -285,8 +475,9 @@ void WelsOpenDecoder (PWelsDecoderContext pCtx) {
|
|||||||
InitVlcTable (&pCtx->sVlcTable);
|
InitVlcTable (&pCtx->sVlcTable);
|
||||||
|
|
||||||
// startup memory
|
// startup memory
|
||||||
if (ERR_NONE != WelsInitMemory (pCtx))
|
iRet = WelsInitMemory (pCtx);
|
||||||
return;
|
if (ERR_NONE != iRet)
|
||||||
|
return iRet;
|
||||||
|
|
||||||
#ifdef LONG_TERM_REF
|
#ifdef LONG_TERM_REF
|
||||||
pCtx->bParamSetsLostFlag = true;
|
pCtx->bParamSetsLostFlag = true;
|
||||||
@@ -294,9 +485,9 @@ void WelsOpenDecoder (PWelsDecoderContext pCtx) {
|
|||||||
pCtx->bReferenceLostAtT0Flag = true; // should be true to waiting IDR at incoming AU bits following, 6/4/2010
|
pCtx->bReferenceLostAtT0Flag = true; // should be true to waiting IDR at incoming AU bits following, 6/4/2010
|
||||||
#endif //LONG_TERM_REF
|
#endif //LONG_TERM_REF
|
||||||
pCtx->bNewSeqBegin = true;
|
pCtx->bNewSeqBegin = true;
|
||||||
pCtx->bDecErrorConedFlag = false; //default: decoder normal status
|
|
||||||
pCtx->bPrintFrameErrorTraceFlag = true;
|
pCtx->bPrintFrameErrorTraceFlag = true;
|
||||||
pCtx->iIgnoredErrorInfoPacketCount = 0;
|
pCtx->iIgnoredErrorInfoPacketCount = 0;
|
||||||
|
return iRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -325,15 +516,24 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa
|
|||||||
if (NULL == pCtx || NULL == kpParam)
|
if (NULL == pCtx || NULL == kpParam)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
pCtx->pParam = (SDecodingParam*)WelsMalloc (sizeof (SDecodingParam), "SDecodingParam");
|
pCtx->pParam = (SDecodingParam*)WelsMallocz (sizeof (SDecodingParam), "SDecodingParam");
|
||||||
|
|
||||||
if (NULL == pCtx->pParam)
|
if (NULL == pCtx->pParam)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam));
|
memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam));
|
||||||
pCtx->eOutputColorFormat = pCtx->pParam->eOutputColorFormat;
|
pCtx->eOutputColorFormat = pCtx->pParam->eOutputColorFormat;
|
||||||
|
if (!pCtx->bParseOnly) {
|
||||||
|
int32_t iRet = DecoderSetCsp (pCtx, pCtx->pParam->eOutputColorFormat);
|
||||||
|
if (iRet)
|
||||||
|
return iRet;
|
||||||
|
}
|
||||||
pCtx->eErrorConMethod = pCtx->pParam->eEcActiveIdc;
|
pCtx->eErrorConMethod = pCtx->pParam->eEcActiveIdc;
|
||||||
|
|
||||||
|
if (pCtx->bParseOnly) //parse only, disable EC method
|
||||||
|
pCtx->eErrorConMethod = ERROR_CON_DISABLE;
|
||||||
|
InitErrorCon (pCtx);
|
||||||
|
|
||||||
if (VIDEO_BITSTREAM_SVC == pCtx->pParam->sVideoProperty.eVideoBsType ||
|
if (VIDEO_BITSTREAM_SVC == pCtx->pParam->sVideoProperty.eVideoBsType ||
|
||||||
VIDEO_BITSTREAM_AVC == pCtx->pParam->sVideoProperty.eVideoBsType) {
|
VIDEO_BITSTREAM_AVC == pCtx->pParam->sVideoProperty.eVideoBsType) {
|
||||||
pCtx->eVideoType = pCtx->pParam->sVideoProperty.eVideoBsType;
|
pCtx->eVideoType = pCtx->pParam->sVideoProperty.eVideoBsType;
|
||||||
@@ -358,7 +558,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa
|
|||||||
* \note N/A
|
* \note N/A
|
||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
int32_t WelsInitDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
|
int32_t WelsInitDecoder (PWelsDecoderContext pCtx, const bool bParseOnly, SLogContext* pLogCtx) {
|
||||||
if (pCtx == NULL) {
|
if (pCtx == NULL) {
|
||||||
return ERR_INFO_INVALID_PTR;
|
return ERR_INFO_INVALID_PTR;
|
||||||
}
|
}
|
||||||
@@ -366,11 +566,9 @@ int32_t WelsInitDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
|
|||||||
// default
|
// default
|
||||||
WelsDecoderDefaults (pCtx, pLogCtx);
|
WelsDecoderDefaults (pCtx, pLogCtx);
|
||||||
|
|
||||||
|
pCtx->bParseOnly = bParseOnly;
|
||||||
// open decoder
|
// open decoder
|
||||||
WelsOpenDecoder (pCtx);
|
return WelsOpenDecoder (pCtx);
|
||||||
|
|
||||||
|
|
||||||
return ERR_NONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -414,9 +612,10 @@ void GetVclNalTemporalId (PWelsDecoderContext pCtx) {
|
|||||||
*************************************************************************************
|
*************************************************************************************
|
||||||
*/
|
*/
|
||||||
int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const int32_t kiBsLen,
|
int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const int32_t kiBsLen,
|
||||||
uint8_t** ppDst, SBufferInfo* pDstBufInfo) {
|
uint8_t** ppDst, SBufferInfo* pDstBufInfo, SParserBsInfo* pDstBsInfo) {
|
||||||
if (!pCtx->bEndOfStreamFlag) {
|
if (!pCtx->bEndOfStreamFlag) {
|
||||||
SDataBuffer* pRawData = &pCtx->sRawData;
|
SDataBuffer* pRawData = &pCtx->sRawData;
|
||||||
|
SDataBuffer* pSavedData = NULL;
|
||||||
|
|
||||||
int32_t iSrcIdx = 0; //the index of source bit-stream till now after parsing one or more NALs
|
int32_t iSrcIdx = 0; //the index of source bit-stream till now after parsing one or more NALs
|
||||||
int32_t iSrcConsumed = 0; // consumed bit count of source bs
|
int32_t iSrcConsumed = 0; // consumed bit count of source bs
|
||||||
@@ -444,7 +643,12 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
|||||||
pRawData->pCurPos = pRawData->pHead;
|
pRawData->pCurPos = pRawData->pHead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pCtx->bParseOnly) {
|
||||||
|
pSavedData = &pCtx->sSavedData;
|
||||||
|
if ((kiBsLen + 4) > (pSavedData->pEnd - pSavedData->pCurPos)) {
|
||||||
|
pSavedData->pCurPos = pSavedData->pHead;
|
||||||
|
}
|
||||||
|
}
|
||||||
//copy raw data from source buffer (application) to raw data buffer (codec inside)
|
//copy raw data from source buffer (application) to raw data buffer (codec inside)
|
||||||
//0x03 removal and extract all of NAL Unit from current raw data
|
//0x03 removal and extract all of NAL Unit from current raw data
|
||||||
pDstNal = pRawData->pCurPos;
|
pDstNal = pRawData->pCurPos;
|
||||||
@@ -461,28 +665,28 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
iConsumedBytes = 0;
|
iConsumedBytes = 0;
|
||||||
|
pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] =
|
||||||
|
0; // set 4 reserved bytes to zero
|
||||||
pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
|
pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
|
||||||
if ((pCtx->eErrorConMethod != ERROR_CON_DISABLE) && (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1))) {
|
if (pNalPayload) { //parse correct
|
||||||
CheckAndDoEC (pCtx, ppDst, pDstBufInfo);
|
if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) {
|
||||||
|
iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
|
||||||
|
}
|
||||||
|
CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
|
||||||
|
if (pCtx->bAuReadyFlag && pCtx->pAccessUnitList->uiAvailUnitsNum != 0) {
|
||||||
|
ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
|
DecodeFinishUpdate (pCtx);
|
||||||
iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes);
|
|
||||||
}
|
|
||||||
if (pCtx->bAuReadyFlag) {
|
|
||||||
ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
|
|
||||||
|
|
||||||
if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
|
if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
|
||||||
#ifdef LONG_TERM_REF
|
#ifdef LONG_TERM_REF
|
||||||
pCtx->bParamSetsLostFlag = true;
|
pCtx->bParamSetsLostFlag = true;
|
||||||
#else
|
#else
|
||||||
pCtx->bReferenceLostAtT0Flag = true;
|
pCtx->bReferenceLostAtT0Flag = true;
|
||||||
#endif
|
#endif
|
||||||
if ((pCtx->eErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
|
if (dsOutOfMemory & pCtx->iErrorCode) {
|
||||||
ResetParameterSetsState (pCtx);
|
return pCtx->iErrorCode;
|
||||||
|
|
||||||
if (dsOutOfMemory & pCtx->iErrorCode) {
|
|
||||||
return pCtx->iErrorCode;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (iRet) {
|
if (iRet) {
|
||||||
@@ -493,19 +697,16 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
|||||||
#else
|
#else
|
||||||
pCtx->bReferenceLostAtT0Flag = true;
|
pCtx->bReferenceLostAtT0Flag = true;
|
||||||
#endif
|
#endif
|
||||||
if ((pCtx->eErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
|
|
||||||
ResetParameterSetsState (pCtx);
|
|
||||||
}
|
}
|
||||||
return pCtx->iErrorCode;
|
return pCtx->iErrorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDstNal += iDstIdx; //update current position
|
pDstNal += (iDstIdx + 4); //init, increase 4 reserved zero bytes, used to store the next NAL
|
||||||
if ((iSrcLength - iSrcConsumed + 4) > (pRawData->pEnd - pDstNal)) {
|
if ((iSrcLength - iSrcConsumed + 4) > (pRawData->pEnd - pDstNal)) {
|
||||||
pRawData->pCurPos = pRawData->pHead;
|
pDstNal = pRawData->pCurPos = pRawData->pHead;
|
||||||
} else {
|
} else {
|
||||||
pRawData->pCurPos = pDstNal;
|
pRawData->pCurPos = pDstNal;
|
||||||
}
|
}
|
||||||
pDstNal = pRawData->pCurPos + 4; //init, 4 bytes used to store the next NAL
|
|
||||||
|
|
||||||
pSrcNal += iSrcIdx + 3;
|
pSrcNal += iSrcIdx + 3;
|
||||||
iSrcConsumed += 3;
|
iSrcConsumed += 3;
|
||||||
@@ -521,26 +722,28 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
|||||||
//last NAL decoding
|
//last NAL decoding
|
||||||
|
|
||||||
iConsumedBytes = 0;
|
iConsumedBytes = 0;
|
||||||
|
pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] =
|
||||||
|
0; // set 4 reserved bytes to zero
|
||||||
|
pRawData->pCurPos = pDstNal + iDstIdx + 4; //init, increase 4 reserved zero bytes, used to store the next NAL
|
||||||
pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
|
pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
|
||||||
if ((pCtx->eErrorConMethod != ERROR_CON_DISABLE) && (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1))) {
|
if (pNalPayload) { //parse correct
|
||||||
CheckAndDoEC (pCtx, ppDst, pDstBufInfo);
|
if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) {
|
||||||
}
|
iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
|
||||||
if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
|
|
||||||
iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes);
|
|
||||||
}
|
|
||||||
if (pCtx->bAuReadyFlag) {
|
|
||||||
ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
|
|
||||||
|
|
||||||
if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
|
|
||||||
#ifdef LONG_TERM_REF
|
|
||||||
pCtx->bParamSetsLostFlag = true;
|
|
||||||
#else
|
|
||||||
pCtx->bReferenceLostAtT0Flag = true;
|
|
||||||
#endif
|
|
||||||
if ((pCtx->eErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
|
|
||||||
ResetParameterSetsState (pCtx);
|
|
||||||
return pCtx->iErrorCode;
|
|
||||||
}
|
}
|
||||||
|
CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
|
||||||
|
if (pCtx->bAuReadyFlag && pCtx->pAccessUnitList->uiAvailUnitsNum != 0) {
|
||||||
|
ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DecodeFinishUpdate (pCtx);
|
||||||
|
|
||||||
|
if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
|
||||||
|
#ifdef LONG_TERM_REF
|
||||||
|
pCtx->bParamSetsLostFlag = true;
|
||||||
|
#else
|
||||||
|
pCtx->bReferenceLostAtT0Flag = true;
|
||||||
|
#endif
|
||||||
|
return pCtx->iErrorCode;
|
||||||
}
|
}
|
||||||
if (iRet) {
|
if (iRet) {
|
||||||
iRet = 0;
|
iRet = 0;
|
||||||
@@ -550,12 +753,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
|||||||
#else
|
#else
|
||||||
pCtx->bReferenceLostAtT0Flag = true;
|
pCtx->bReferenceLostAtT0Flag = true;
|
||||||
#endif
|
#endif
|
||||||
ResetParameterSetsState (pCtx);
|
|
||||||
}
|
}
|
||||||
return pCtx->iErrorCode;
|
return pCtx->iErrorCode;
|
||||||
}
|
}
|
||||||
pDstNal += iDstIdx;
|
|
||||||
pRawData->pCurPos = pDstNal; //init the pCurPos for next NAL(s) storage
|
|
||||||
} else { /* no supplementary picture payload input, but stored a picture */
|
} else { /* no supplementary picture payload input, but stored a picture */
|
||||||
PAccessUnit pCurAu =
|
PAccessUnit pCurAu =
|
||||||
pCtx->pAccessUnitList; // current access unit, it will never point to NULL after decode's successful initialization
|
pCtx->pAccessUnitList; // current access unit, it will never point to NULL after decode's successful initialization
|
||||||
@@ -566,17 +766,16 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
|||||||
pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1;
|
pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1;
|
||||||
|
|
||||||
ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
|
ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
|
||||||
|
}
|
||||||
|
DecodeFinishUpdate (pCtx);
|
||||||
|
|
||||||
if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
|
if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
|
||||||
#ifdef LONG_TERM_REF
|
#ifdef LONG_TERM_REF
|
||||||
pCtx->bParamSetsLostFlag = true;
|
pCtx->bParamSetsLostFlag = true;
|
||||||
#else
|
#else
|
||||||
pCtx->bReferenceLostAtT0Flag = true;
|
pCtx->bReferenceLostAtT0Flag = true;
|
||||||
#endif
|
#endif
|
||||||
if ((pCtx->eErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
|
return pCtx->iErrorCode;
|
||||||
ResetParameterSetsState (pCtx);
|
|
||||||
return pCtx->iErrorCode;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -595,9 +794,12 @@ int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//For now, support only videoFormatI420!
|
//For now, support only videoFormatI420!
|
||||||
if (kiColorFormat != (int32_t) videoFormatI420) {
|
if (kiColorFormat == (int32_t) videoFormatInternal) {
|
||||||
|
pCtx->pParam->eOutputColorFormat = pCtx->eOutputColorFormat = videoFormatI420;
|
||||||
|
} else if (kiColorFormat != (int32_t) videoFormatI420) {
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "Support I420 output only for now! Change to I420...");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "Support I420 output only for now! Change to I420...");
|
||||||
pCtx->pParam->eOutputColorFormat = pCtx->eOutputColorFormat = videoFormatI420;
|
pCtx->pParam->eOutputColorFormat = pCtx->eOutputColorFormat = videoFormatI420;
|
||||||
|
return cmUnsupportedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -759,4 +961,62 @@ void AssignFuncPointerForRec (PWelsDecoderContext pCtx) {
|
|||||||
WelsBlockFuncInit (&pCtx->sBlockFunc, pCtx->uiCpuFlag);
|
WelsBlockFuncInit (&pCtx->sBlockFunc, pCtx->uiCpuFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//reset decoder number related statistics info
|
||||||
|
void ResetDecStatNums (SDecoderStatistics* pDecStat) {
|
||||||
|
uint32_t uiWidth = pDecStat->uiWidth;
|
||||||
|
uint32_t uiHeight = pDecStat->uiHeight;
|
||||||
|
int32_t iAvgLumaQp = pDecStat->iAvgLumaQp;
|
||||||
|
memset (pDecStat, 0, sizeof (SDecoderStatistics));
|
||||||
|
pDecStat->uiWidth = uiWidth;
|
||||||
|
pDecStat->uiHeight = uiHeight;
|
||||||
|
pDecStat->iAvgLumaQp = iAvgLumaQp;
|
||||||
|
}
|
||||||
|
|
||||||
|
//update information when freezing occurs, including IDR/non-IDR number
|
||||||
|
void UpdateDecStatFreezingInfo (const bool kbIdrFlag, SDecoderStatistics* pDecStat) {
|
||||||
|
if (kbIdrFlag)
|
||||||
|
pDecStat->uiFreezingIDRNum++;
|
||||||
|
else
|
||||||
|
pDecStat->uiFreezingNonIDRNum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//update information when no freezing occurs, including QP, correct IDR number, ECed IDR number
|
||||||
|
void UpdateDecStatNoFreezingInfo (PWelsDecoderContext pCtx) {
|
||||||
|
PDqLayer pCurDq = pCtx->pCurDqLayer;
|
||||||
|
PPicture pPic = pCtx->pDec;
|
||||||
|
SDecoderStatistics* pDecStat = &pCtx->sDecoderStatistics;
|
||||||
|
|
||||||
|
if (pDecStat->iAvgLumaQp == -1) //first correct frame received
|
||||||
|
pDecStat->iAvgLumaQp = 0;
|
||||||
|
|
||||||
|
//update QP info
|
||||||
|
int32_t iTotalQp = 0;
|
||||||
|
const int32_t kiMbNum = pCurDq->iMbWidth * pCurDq->iMbHeight;
|
||||||
|
for (int32_t iMb = 0; iMb < kiMbNum; ++iMb) {
|
||||||
|
iTotalQp += pCurDq->pLumaQp[iMb] * pCurDq->pMbCorrectlyDecodedFlag[iMb];
|
||||||
|
}
|
||||||
|
iTotalQp /= kiMbNum;
|
||||||
|
if (pDecStat->uiDecodedFrameCount + 1 == 0) { //maximum uint32_t reached
|
||||||
|
ResetDecStatNums (pDecStat);
|
||||||
|
pDecStat->iAvgLumaQp = iTotalQp;
|
||||||
|
} else
|
||||||
|
pDecStat->iAvgLumaQp = (int) ((uint64_t) (pDecStat->iAvgLumaQp * pDecStat->uiDecodedFrameCount + iTotalQp) /
|
||||||
|
(pDecStat->uiDecodedFrameCount + 1));
|
||||||
|
|
||||||
|
//update IDR number
|
||||||
|
if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag) {
|
||||||
|
pDecStat->uiIDRCorrectNum += (pPic->bIsComplete);
|
||||||
|
pDecStat->uiEcIDRNum += (!pPic->bIsComplete);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update decoder statistics information
|
||||||
|
void UpdateDecStat (PWelsDecoderContext pCtx, const bool kbOutput) {
|
||||||
|
if (pCtx->bFreezeOutput)
|
||||||
|
UpdateDecStatFreezingInfo (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag, &pCtx->sDecoderStatistics);
|
||||||
|
else if (kbOutput)
|
||||||
|
UpdateDecStatNoFreezingInfo (pCtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace WelsDec
|
} // namespace WelsDec
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user