Compare commits
599 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 435ae0581d | |||
| 4b61400a1a | |||
| 17657647f4 | |||
| 4d7d8c601c | |||
| 61aa5c0f4f | |||
| 28b3418d04 | |||
| 64e65197ae | |||
| 12fe7e4b6c | |||
| 6c1bf05827 | |||
| 5371cc70e0 | |||
| 708b1e8767 | |||
| ce87d29184 | |||
| b445273608 | |||
| 71d3a69f26 | |||
| 5c570640fa | |||
| 6c184597b2 | |||
| bce55bc471 | |||
| b336642315 | |||
| c70afe5709 | |||
| b8280af7fe | |||
| 0ea1ebfaba | |||
| 6fd1970325 | |||
| 51eec5d7a6 | |||
| 6757824801 | |||
| 96cfa53add | |||
| ae53385561 | |||
| d96723953a | |||
| 8ae0b34901 | |||
| 5aa8c15203 | |||
| 7386406b10 | |||
| 55da57f723 | |||
| 9fc5ed2c67 | |||
| f3392efc28 | |||
| 79cc97bf7d | |||
| 3479a23d74 | |||
| 618368016f | |||
| db8b450ebb | |||
| 11b24e9b93 | |||
| 8f4ab7f088 | |||
| 42a9d5d0de | |||
| 15032633ec | |||
| 6299a0a5e2 | |||
| 246d6b3dfd | |||
| 120e53d4ee | |||
| 395b300177 | |||
| 676b509641 | |||
| c3cb4eda5b | |||
| 64538ca0c4 | |||
| 71823ab4ab | |||
| b5f3245da5 | |||
| a084446fca | |||
| 1100769bf6 | |||
| 84f6907fb1 | |||
| ea825c0363 | |||
| 9790e888a8 | |||
| 1c0f990099 | |||
| 30e6623a3f | |||
| 6d5546392d | |||
| c2ae65997b | |||
| e1d3b33a80 | |||
| 73c6b20548 | |||
| f1da79ba70 | |||
| 1c479fdf64 | |||
| d981b2ba53 | |||
| f955c25e68 | |||
| c8d3eb40f9 | |||
| 8fae91a6ab | |||
| 9a1394353e | |||
| c011e4190e | |||
| 57ba79b218 | |||
| 01c828bac1 | |||
| 82f8e69d52 | |||
| ddda5286e2 | |||
| 9c560486fc | |||
| 13937e950a | |||
| 3904fa56ed | |||
| 8d58dc8485 | |||
| ecb65b1094 | |||
| e22bdd9e04 | |||
| 178a340820 | |||
| 5fb7b6fc45 | |||
| d0f2a5ec7f | |||
| f22e319489 | |||
| 127baed127 | |||
| eab148d446 | |||
| 9295a16f8b | |||
| e8c041f9a1 | |||
| be36f1f33e | |||
| ae37cf59db | |||
| d19470e720 | |||
| 5ed93579e7 | |||
| 942f897e8a | |||
| ef25a582df | |||
| cfdd236016 | |||
| a6aa754cde | |||
| 1e470e5cc9 | |||
| 52c79e334f | |||
| f6e2b7db43 | |||
| 7db8e1df28 | |||
| 1b3eab8e9c | |||
| 226934bcc5 | |||
| 4ea23ed898 | |||
| 115afc0ed7 | |||
| 4b2884eb3d | |||
| 7da24bc271 | |||
| 1c8c974e46 | |||
| d0126671f7 | |||
| 4e5bdc1068 | |||
| 5aa76c151d | |||
| 425b858266 | |||
| 2812961c5d | |||
| f00857e32e | |||
| 9094f760e6 | |||
| 56572699eb | |||
| d6ef560c9b | |||
| 6c5dad52b2 | |||
| afdbf03027 | |||
| d73a74c2b7 | |||
| 0c02153486 | |||
| c606ea5307 | |||
| bd7e35853c | |||
| d7b12b918a | |||
| f10d87bf82 | |||
| 06f7ab2c0a | |||
| 7b280ef5e1 | |||
| 8bcce7e1e3 | |||
| 2d0bdf26af | |||
| d86d43a5e7 | |||
| 31c9c550ef | |||
| 24b452cd9f | |||
| 3e8f3537f9 | |||
| b9f97a8e40 | |||
| 96b6ef6e0e | |||
| 9e87941afc | |||
| f9028f77bb | |||
| 35afbad649 | |||
| 8e6784b564 | |||
| 7c50ce2326 | |||
| 2cb5c0b27f | |||
| 36a9b6c064 | |||
| bf35dc5d2a | |||
| a8cd89512d | |||
| d28d6565a4 | |||
| e27d91ca71 | |||
| 2e5a1e26b4 | |||
| e6ef0b3a90 | |||
| bde377c864 | |||
| aa1f4ed774 | |||
| b5d5f49390 | |||
| 5c8a8750de | |||
| 5bef4dd635 | |||
| 4496e91abb | |||
| 0568bbdb9a | |||
| 2dc975eb89 | |||
| c60fb8a30c | |||
| f325ef73b7 | |||
| 1d44c4e359 | |||
| 1e4ea2ec97 | |||
| 8e4147264d | |||
| 12f179dc66 | |||
| bebde678bf | |||
| efbe9c5301 | |||
| a3dcc6e2ce | |||
| a9c4fdd329 | |||
| ca89d79689 | |||
| db659e464a | |||
| 69dc8e2a9e | |||
| 4dc102b1f9 | |||
| 1c28c14f77 | |||
| 3c4ca300f4 | |||
| c0fb38d908 | |||
| 03e24b148e | |||
| f161ebe349 | |||
| aa73e96249 | |||
| 3b74ac0f09 | |||
| 2a510ef208 | |||
| cc9db3610a | |||
| 8e9e227c67 | |||
| 733f828268 | |||
| 0c602b9689 | |||
| da8a5e77c3 | |||
| e85eded615 | |||
| f70eb1cb0b | |||
| d76eab5dab | |||
| 4931ed7ebf | |||
| 39748cded2 | |||
| 461a203e95 | |||
| cce3b5bea8 | |||
| c9bb2a9f01 | |||
| 8d3a13f838 | |||
| 3ec2b5f55d | |||
| 4c503ffbfa | |||
| 73d0665b8b | |||
| 9eaba19f10 | |||
| 92944604f1 | |||
| 83ebed243b | |||
| bf3bbf184a | |||
| ff43ef5219 | |||
| d18354f8d4 | |||
| ebff1abbad | |||
| 000d658a47 | |||
| edb3159d1e | |||
| 09ea2ed02c | |||
| 8b700a1d22 | |||
| c94aa37c50 | |||
| 3c35a480d5 | |||
| 33970b5e63 | |||
| 91f59d12f0 | |||
| a063787d11 | |||
| 07fd14911e | |||
| 1d55351856 | |||
| 379871a134 | |||
| d6e59e1c4c | |||
| bdc40e57dd | |||
| fd2d0aa1c5 | |||
| ef8b19b3f3 | |||
| 7ea3eaea7c | |||
| 8c1515f699 | |||
| 2c547a28a2 | |||
| 1c3d2c6785 | |||
| 1fb75ed29a | |||
| 5913923fa7 | |||
| cc600ff627 | |||
| 431fc9c96b | |||
| 5e37ecfebb | |||
| a07a71e7ff | |||
| 6425c0aa0f | |||
| df113c9f1d | |||
| b91ac0b1ce | |||
| 5c3c0fa3f6 | |||
| 5bd958b8b5 | |||
| 341098fa11 | |||
| 54ff4bdbf4 | |||
| 1182428dc0 | |||
| d5dfd6094b | |||
| 4955c18f6e | |||
| 2c41325dbb | |||
| 5531008893 | |||
| 24800bf039 | |||
| bac325adb8 | |||
| ec77c1dbf3 | |||
| cfbee81f36 | |||
| d6701b99eb | |||
| ce09ba4fd1 | |||
| bdaee31e48 | |||
| 76d1257470 | |||
| 83c1bf8770 | |||
| 3a3e6e734e | |||
| 1cbd2224cc | |||
| a136619223 | |||
| 1ce3a6c6c3 | |||
| 6420ea3f9b | |||
| 6309d5206e | |||
| 345738b1fa | |||
| 9909d4e88c | |||
| ed9d8dd74b | |||
| 81cf48b619 | |||
| 4fd05b6aee | |||
| 6642e0949f | |||
| 41516cf626 | |||
| 56e58754cb | |||
| 12367a6ac8 | |||
| fc6dcb4aaf | |||
| 7c5c45ec12 | |||
| ebc1d9d63b | |||
| 37f04282cd | |||
| 0f60dbac49 | |||
| 0cd6441b96 | |||
| 7de95befa7 | |||
| f9aa8729bc | |||
| d9fb549a89 | |||
| 66e3368149 | |||
| 80e6143ad0 | |||
| 4fa2aea05f | |||
| 2b14ba1266 | |||
| 09659ce0de | |||
| 7ee007fc02 | |||
| 6cd11ecd29 | |||
| 4e2b638ae4 | |||
| 118de306e3 | |||
| 26c3331716 | |||
| b6443fd97e | |||
| 81f584b777 | |||
| a558e19cca | |||
| a265b1e5c7 | |||
| 54d10f30e9 | |||
| d1e507dc11 | |||
| 1ed5fed729 | |||
| 369cb89794 | |||
| bf313c2d45 | |||
| 645833571b | |||
| 597f183dfc | |||
| 1443b7bf8e | |||
| 5ff3a1d730 | |||
| fb70572bfe | |||
| 7669fbe043 | |||
| b5c165df28 | |||
| 27bba208eb | |||
| ae390f95dd | |||
| 2d17c4ec9a | |||
| c8358db269 | |||
| 98c69e607f | |||
| dc40fcf249 | |||
| fa4f27bba2 | |||
| 80e5f621ce | |||
| b103704b76 | |||
| e8ddafe72d | |||
| 22655aa1b2 | |||
| 1f9889d0cf | |||
| 51a08cb728 | |||
| 2c479db532 | |||
| 1f69126ebb | |||
| e903237666 | |||
| 465f1c4a5e | |||
| 1231db8097 | |||
| cac7efdfaa | |||
| 9f327326e5 | |||
| b3a9dc150d | |||
| ea279fd209 | |||
| 0cefd4eed8 | |||
| cb3dde3488 | |||
| 0b63700f84 | |||
| 93726c655b | |||
| 44f8db956d | |||
| 540a1177e3 | |||
| 5fee52fe5f | |||
| a4dd125a93 | |||
| 7d8e4f7382 | |||
| eacb47ec20 | |||
| fa4f6f7526 | |||
| e69d189467 | |||
| fa848c5730 | |||
| d79f06d505 | |||
| 0f27dc4d16 | |||
| 24aff962a0 | |||
| c65d5994a5 | |||
| 03fde0d4de | |||
| 0ddd43e074 | |||
| f8a8528d1d | |||
| 5596a4cd9c | |||
| 04848bb2ff | |||
| 91146cb57a | |||
| 55558aaf8b | |||
| 1fd88e27de | |||
| b8145cff74 | |||
| e4bad481f0 | |||
| f9ad7df474 | |||
| cfa8e3ecfd | |||
| be5d31af5f | |||
| 7b85b3bad6 | |||
| b7839c94d8 | |||
| e3668e169d | |||
| b99ccb7c03 | |||
| 0e5054f91a | |||
| a15094ef28 | |||
| 9d48fca4f0 | |||
| 4cdc14bde7 | |||
| 41c3bda6a1 | |||
| 90684cdd9c | |||
| 7df2d81cf9 | |||
| 2e6422e916 | |||
| 68ff515b6b | |||
| cb2f157180 | |||
| ed4660a3ac | |||
| 909d417b6b | |||
| 59dfbe8375 | |||
| f4201dc6a0 | |||
| e69e8b6ac5 | |||
| 9eab48cc1d | |||
| 3f90d4fb2e | |||
| bc7ab1a1bc | |||
| 10dea0cdb1 | |||
| 9e211b89ae | |||
| 246c55de06 | |||
| 5b3ca5240c | |||
| f7221b8485 | |||
| 93d94e7ca8 | |||
| 60a34e5a19 | |||
| 1b8cd397cb | |||
| e5fce087b3 | |||
| 2ae93fb13b | |||
| 955277020f | |||
| 7c6a06fe1b | |||
| 17f8db1538 | |||
| 2c4c6bc5b1 | |||
| 449453a971 | |||
| 61c93d0bfc | |||
| fa4ee7ab3c | |||
| 26fdd2258b | |||
| 343938f182 | |||
| 0ef3600643 | |||
| f9b61216ae | |||
| 6a756fbb21 | |||
| 7399d533ac | |||
| 85a32c764b | |||
| 19df26bc82 | |||
| 5acd4d17cc | |||
| 27b8d1a017 | |||
| 415c801ab5 | |||
| 15504610b0 | |||
| 0f43795c24 | |||
| c853beb7c3 | |||
| 185d07ede1 | |||
| 2096bb7466 | |||
| 342747ac7d | |||
| 6350cd623b | |||
| 65a58c5bd7 | |||
| 3201cd40a4 | |||
| 59384ce6b6 | |||
| d597aa985c | |||
| 8a0fd0f9f3 | |||
| eef9672b02 | |||
| 450bbb7960 | |||
| 43d3951d64 | |||
| 2f547c4022 | |||
| 0592be14ff | |||
| 8a825fe415 | |||
| c9f97fcabf | |||
| 3db8e93a20 | |||
| c92c2bc863 | |||
| 050da957c3 | |||
| a635df770f | |||
| 02e30de043 | |||
| abb609bb58 | |||
| 4771d217bd | |||
| 61ac8e7d29 | |||
| d204dacf2c | |||
| ec78e95627 | |||
| a6a220ed33 | |||
| bfa334de42 | |||
| 06fcee2e26 | |||
| af60dd8419 | |||
| e36046790a | |||
| 0a73316166 | |||
| ca7896c48f | |||
| 9c93070155 | |||
| 485b823b84 | |||
| 571be3dc16 | |||
| 047538e7e0 | |||
| 0cc8bfa50f | |||
| f9a3e1b776 | |||
| dc8af5879d | |||
| 2b061b58f9 | |||
| 0fc28b271c | |||
| bd4660ed92 | |||
| 92c8e0c201 | |||
| 27a297f186 | |||
| a32b797f64 | |||
| 29c046c37a | |||
| fe72a8781b | |||
| b5996929df | |||
| 371d717601 | |||
| 1447aac2eb | |||
| af737ace1e | |||
| 565d14e4ff | |||
| 45455e1315 | |||
| 75e27d0ae9 | |||
| e527f227aa | |||
| 2e1d5b1415 | |||
| 6e147cb8a6 | |||
| 39b3763f55 | |||
| 3390bab500 | |||
| f87f355e36 | |||
| 894da5ca7d | |||
| 4c788cb200 | |||
| 9c4d3a7add | |||
| b5fb8749b9 | |||
| 946407193a | |||
| 27def36203 | |||
| 6777ab8e88 | |||
| 0831f98933 | |||
| 719171a375 | |||
| 6157fafd8a | |||
| 6a1bb9c09f | |||
| 58efabb076 | |||
| b833558b76 | |||
| c1b57e2102 | |||
| cfc6fe6400 | |||
| 915272f5c7 | |||
| 5a6e2b0ab1 | |||
| a048a80554 | |||
| 68e61becf9 | |||
| bc680e230c | |||
| 89c5d8bdab | |||
| bb680a9d53 | |||
| dd062bfaf3 | |||
| a130ed479b | |||
| 8b42ed314a | |||
| 67ed7fddac | |||
| 71ecb3d626 | |||
| dcf7f9b70c | |||
| 716cf25eb8 | |||
| aad0a7d8f6 | |||
| 1cac745f2d | |||
| ac0a59de51 | |||
| 9f6c98a32e | |||
| a7f9caa662 | |||
| 8674f8c3cd | |||
| bb0e3e7a7c | |||
| 277384f039 | |||
| 4a73c79ad5 | |||
| 7d741cc3b4 | |||
| 520570dbeb | |||
| 8e8c1f498d | |||
| 5630394ebf | |||
| cb570f824d | |||
| 2790dd608c | |||
| 22d0f10943 | |||
| 44bfe0da61 | |||
| b660192fb8 | |||
| 71007e6c12 | |||
| 24205bc657 | |||
| 7cbc26267b | |||
| d8049e01d7 | |||
| adc819773b | |||
| b784c3eb6d | |||
| bb65f51fce | |||
| d1f31a829d | |||
| 1e56c51d3b | |||
| 45fcd5567a | |||
| 558994b051 | |||
| dd00a614e1 | |||
| 046a8293e1 | |||
| d961a634fb | |||
| d8605a6b55 | |||
| c9b8e5999b | |||
| b9adbf0fcc | |||
| e322e2e5d9 | |||
| 61c50407fd | |||
| b9dd25b80a | |||
| 0ca188e0d6 | |||
| d3265e15ee | |||
| a2179be5e9 | |||
| 4f8b3891ee | |||
| e0a971a8fa | |||
| 7cc24cee16 | |||
| e4e57bef31 | |||
| 08a81b090b | |||
| 1c9d70c4af | |||
| e219c8f77b | |||
| 140fd653ae | |||
| 09f15530e5 | |||
| af310e68db | |||
| c3747e011e | |||
| f258c9a8e5 | |||
| a6c578ef65 | |||
| efa64c2acc | |||
| 9c5f654e44 | |||
| 5494973d28 | |||
| 15cb74fc68 | |||
| 9ddd245b09 | |||
| c1a7f4040a | |||
| 17f4cc0992 | |||
| eeff85f15d | |||
| bc88c1d62e | |||
| 3b8fe34a30 | |||
| ac8cbf2ad7 | |||
| 30b308f7a8 | |||
| afc8c20946 | |||
| debbeb006b | |||
| 8c117d7fec | |||
| 5f8cb575e8 | |||
| abf123b744 | |||
| e97babf6bc | |||
| 9bc89a2605 | |||
| ac5ff0ae89 | |||
| a2e445918e | |||
| 34c39367aa | |||
| 3cab009519 | |||
| 3e05b89590 | |||
| 4a3e5ea8d2 | |||
| 263e819aa4 | |||
| 23655160ea | |||
| f2507dba3b | |||
| da3f5273fc | |||
| 6049800a10 | |||
| e726f7af17 | |||
| de76fb27a6 | |||
| 995d329cf9 | |||
| 81dcb67813 | |||
| bde02336a4 | |||
| 6b1f994e43 | |||
| 5051753833 | |||
| a676267a2c | |||
| bd55bf8300 | |||
| 64c71cbe4e | |||
| 2feaad5cb9 | |||
| 048f6f4bd5 | |||
| 4558ad6a77 | |||
| 937d9ed849 | |||
| 13b161cd24 | |||
| 7c92f740ee | |||
| 057b94649f | |||
| 26da3d0069 | |||
| a8fdfddedb | |||
| 89849ca92a | |||
| 370cff8b33 | |||
| 9fd3869212 | |||
| 0a167141d0 |
+7
-152
@@ -12,168 +12,45 @@
|
||||
# =======
|
||||
libavcodec/.*aac.* @lynne
|
||||
libavcodec/.*ac3.* @lynne
|
||||
libavcodec/.*adpcm.* @zane @pross
|
||||
libavcodec/anm.* @pross
|
||||
libavcodec/amf.* @OvchinnikovDmitrii @ArazIusubov
|
||||
libavcodec/ansi.* @pross
|
||||
libavcodec/aom_film_grain.* @haasn
|
||||
libavcodec/.*atrac9.* @lynne
|
||||
libavcodec/bink.* @pross
|
||||
libavcodec/bintext.* @pross
|
||||
libavcodec/.*bitpacked.* @lynne
|
||||
libavcodec/.*d3d12va.* @jianhuaw @tong1wu @younengxiao
|
||||
libavcodec/.*d3d12va.* @jianhuaw
|
||||
libavcodec/.*dirac.* @lynne
|
||||
libavcodec/.*dovi_rpu.* @haasn
|
||||
libavcodec/dpx.* @pross
|
||||
libavcodec/dsd.* @pross
|
||||
libavcodec/eacmv.* @pross
|
||||
libavcodec/eaidct.* @pross
|
||||
libavcodec/eamad.* @pross
|
||||
libavcodec/eat.* @pross
|
||||
libavcodec/.*exif.* @Traneptora
|
||||
libavcodec/.*ffv1.* @lynne @michaelni
|
||||
libavcodec/g728.* @pross
|
||||
libavcodec/gem.* @pross
|
||||
libavcodec/golomb.* @michaelni
|
||||
libavcodec/.*h266.* @frankplow @NuoMi @jianhuaw
|
||||
libavcodec/h26x/.* @frankplow @NuoMi @jianhuaw
|
||||
libavcodec/.*h274.* @haasn
|
||||
libavcodec/iff.* @pross
|
||||
libavcodec/.*jpegxl.* @lynne @Traneptora
|
||||
libavcodec/jpeg2000htdec.* @cae
|
||||
libavcodec/jv.* @pross
|
||||
libavcodec/.*jxl.* @lynne @Traneptora
|
||||
libavcodec/.*lcms2.* @haasn
|
||||
libavcodec/lead.* @pross
|
||||
libavcodec/mediacodec* @quink
|
||||
libavcodec/mjpeg* @michaelni
|
||||
libavcodec/mmvideo.* @pross
|
||||
libavcodec/msp2.* @pross
|
||||
libavcodec/mvc.* @pross
|
||||
libavcodec/oh* @quink
|
||||
libavcodec/.*jpegxl.* @lynne
|
||||
libavcodec/.*jxl.* @lynne
|
||||
libavcodec/.*opus.* @lynne
|
||||
libavcodec/pictor.* @pross
|
||||
libavcodec/.*png.* @Traneptora
|
||||
libavcodec/.*prores.* @lynne
|
||||
libavcodec/rangecoder.* @michaelni
|
||||
libavcodec/ratecontrol.* @michaelni
|
||||
libavcodec/rv60.* @pross
|
||||
libavcodec/sgirle.* @pross
|
||||
libavcodec/.*siren.* @lynne
|
||||
libavcodec/smpte_436m.* @programmerjake
|
||||
libavcodec/svq1.* @pross
|
||||
libavcodec/svq3.* @pross
|
||||
libavcodec/.*vc2.* @lynne
|
||||
libavcodec/videotoolbox.* @ePirat
|
||||
libavcodec/vp3.* @pross
|
||||
libavcodec/vp4.* @pross
|
||||
libavcodec/vp5.* @pross
|
||||
libavcodec/vp6.* @pross
|
||||
libavcodec/vp8.* @rbultje @pross
|
||||
libavcodec/vp9.* @rbultje
|
||||
libavcodec/vpx.* @rbultje @pross
|
||||
libavcodec/vqc.* @pross
|
||||
libavcodec/.*vvc.* @frankplow @NuoMi @jianhuaw
|
||||
libavcodec/wmavoice.* @rbultje
|
||||
libavcodec/wbmp.* @pross
|
||||
|
||||
# bitstream filters
|
||||
libavcodec/bsf/eia608_to_smpte436m.* @programmerjake
|
||||
libavcodec/bsf/smpte436m_to_eia608.* @programmerjake
|
||||
|
||||
# architecture-specific
|
||||
libavcodec/aarch64/.* @lynne @mstorsjo
|
||||
libavcodec/arm/.* @mstorsjo
|
||||
libavcodec/ppc/.* @sean_mcg
|
||||
libavcodec/riscv/.* @Courmisch
|
||||
libavcodec/wasm/hevc/.* @quink
|
||||
libavcodec/x86/.* @lynne
|
||||
libavcodec/x86/vp8.* @rbultje
|
||||
libavcodec/x86/vp9.* @rbultje
|
||||
libavcodec/x86/vpx.* @rbultje
|
||||
|
||||
# avfilter
|
||||
# =======
|
||||
libavfilter/af_loudnorm.* @kylophone
|
||||
libavfilter/aarch64/.* @mstorsjo
|
||||
libavfilter/af_whisper.* @vpalmisano
|
||||
libavfilter/.*_amf* @OvchinnikovDmitrii @ArazIusubov
|
||||
libavfilter/avfiltergraph.* @haasn
|
||||
libavfilter/colorspace.* @rbultje
|
||||
libavfilter/formats.* @haasn
|
||||
libavfilter/.*f_ebur128.* @haasn
|
||||
libavfilter/vf_blackdetect.* @haasn
|
||||
libavfilter/vf_colordetect.* @haasn
|
||||
libavfilter/vf_colorspace.* @rbultje
|
||||
libavfilter/.*drawvg.* @ayosec
|
||||
libavfilter/vf_find_rect.* @michaelni
|
||||
libavfilter/vf_icc.* @haasn
|
||||
libavfilter/vf_libplacebo.* @haasn
|
||||
libavfilter/vf_libvmaf.* @kylophone
|
||||
libavfilter/vf_premultiply.* @haasn
|
||||
libavfilter/vf_scale.* @haasn
|
||||
libavfilter/vf_scale_vt.* @quink
|
||||
libavfilter/vf_thumbnail.* @haasn
|
||||
libavfilter/vf_transpose_vt.* @quink
|
||||
libavfilter/vf_yadif.* @michaelni
|
||||
libavfilter/vsrc_mandelbrot.* @michaelni
|
||||
|
||||
libavfilter/aarch64/.* @mstorsjo
|
||||
libavfilter/riscv/.* @Courmisch
|
||||
libavfilter/x86/colorspace.* @rbultje
|
||||
libavfilter/x86/scene_sad.* @haasn
|
||||
|
||||
# avformat
|
||||
# =======
|
||||
libavformat/alp.* @zane
|
||||
libavformat/amv.* @zane
|
||||
libavformat/anm.* @pross
|
||||
libavformat/apm.* @zane
|
||||
libavformat/argo_.* @zane
|
||||
libavformat/bink.* @pross
|
||||
libavformat/bintext.* @pross
|
||||
libavformat/caf.* @pross
|
||||
libavformat/cine.* @pross
|
||||
libavformat/dsf.* @pross
|
||||
libavformat/eacdata.* @pross
|
||||
libavformat/electronicarts.* @pross
|
||||
libavformat/.*exif.* @Traneptora
|
||||
libavformat/filmstrip.* @pross
|
||||
libavformat/frm.* @pross
|
||||
libavformat/iamf.* @jamrial
|
||||
libavformat/icecast.c @ePirat
|
||||
libavformat/ico.* @pross
|
||||
libavformat/iff.* @pross
|
||||
libavformat/.*jpegxl.* @Traneptora
|
||||
libavformat/jv.* @pross
|
||||
libavformat/.*jxl.* @Traneptora
|
||||
libavformat/kvag.* @zane
|
||||
libavformat/mccdec.* @programmerjake
|
||||
libavformat/mccenc.* @programmerjake
|
||||
libavformat/mlv.* @pross
|
||||
libavformat/mm.* @pross
|
||||
libavformat/msp.* @pross
|
||||
libavformat/mv.* @pross
|
||||
libavformat/pp_bnk.* @zane
|
||||
libavformat/rm.* @pross
|
||||
libavformat/sauce.* @pross
|
||||
libavformat/scd.* @zane
|
||||
libavformat/tty.* @pross
|
||||
libavformat/whip.c @JackLau
|
||||
libavformat/wsd.* @pross
|
||||
libavformat/wtv.* @pross
|
||||
|
||||
# avutil
|
||||
# ======
|
||||
libavutil/.*_amf* @OvchinnikovDmitrii @ArazIusubov
|
||||
libavutil/.*crc.* @lynne @michaelni
|
||||
libavutil/.*d3d12va.* @jianhuaw @tong1wu @younengxiao
|
||||
libavutil/csp.* @rbultje @haasn
|
||||
libavutil/.*d3d12va.* @jianhuaw
|
||||
libavutil/eval.* @michaelni
|
||||
libavutil/film_grain.* @haasn
|
||||
libavutil/dovi_meta.* @haasn
|
||||
libavutil/hwcontext_oh.* @quink
|
||||
libavutil/hwcontext_mediacodec.* @quink
|
||||
libavutil/hwcontext_videotoolbox.* @ePirat
|
||||
libavutil/iamf.* @jamrial
|
||||
libavutil/integer.* @michaelni
|
||||
libavutil/lfg.* @michaelni
|
||||
@@ -192,7 +69,6 @@ libavutil/tx.* @lynne
|
||||
libavutil/aarch64/.* @lynne @mstorsjo
|
||||
libavutil/arm/.* @mstorsjo
|
||||
libavutil/ppc/.* @sean_mcg
|
||||
libavutil/riscv/.* @Courmisch
|
||||
libavutil/x86/.* @lynne
|
||||
|
||||
# swresample
|
||||
@@ -206,13 +82,6 @@ libswresample/.* @michaelni
|
||||
libswscale/aarch64/.* @mstorsjo
|
||||
libswscale/arm/.* @mstorsjo
|
||||
libswscale/ppc/.* @sean_mcg
|
||||
libswscale/riscv/.* @Courmisch
|
||||
libswscale/.* @haasn
|
||||
|
||||
# tools
|
||||
# =====
|
||||
fftools/ffplay_renderer.* @haasn
|
||||
tools/target_dec_fuzzer.c @michaelni
|
||||
|
||||
# doc
|
||||
# ===
|
||||
@@ -220,19 +89,5 @@ doc/.* @GyanD
|
||||
|
||||
# Frameworks
|
||||
# ==========
|
||||
.*d3d12va.* @jianhuaw @tong1wu @younengxiao
|
||||
.*vulkan.* @lynne @haasn
|
||||
|
||||
# tests
|
||||
# =====
|
||||
tests/checkasm/riscv/.* @Courmisch
|
||||
tests/ref/.*drawvg.* @ayosec
|
||||
tests/ref/fate/sub-mcc.* @programmerjake
|
||||
|
||||
# Forgejo
|
||||
# =======
|
||||
.forgejo/CODEOWNERS @michaelni
|
||||
|
||||
# /
|
||||
# =
|
||||
MAINTAINERS @michaelni
|
||||
.*d3d12va.* @jianhuaw
|
||||
.*vulkan.* @lynne
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module.exports = async ({github, context}) => {
|
||||
const title = (context.payload.pull_request?.title || context.payload.issue?.title || '').toLowerCase();
|
||||
const labels = [];
|
||||
const issueNumber = context.payload.pull_request?.number || context.payload.issue?.number;
|
||||
|
||||
const kwmap = {
|
||||
'avcodec': 'avcodec',
|
||||
@@ -11,55 +10,18 @@ module.exports = async ({github, context}) => {
|
||||
'avutil': 'avutil',
|
||||
'swresample': 'swresample',
|
||||
'swscale': 'swscale',
|
||||
'fftools': 'CLI',
|
||||
'vulkan': 'vulkan'
|
||||
'fftools': 'CLI'
|
||||
};
|
||||
|
||||
async function isOrgMember(username) {
|
||||
try {
|
||||
const response = await github.rest.orgs.checkMembershipForUser({
|
||||
org: context.repo.owner,
|
||||
username: username
|
||||
});
|
||||
return response.status === 204;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.payload.action === 'closed' ||
|
||||
(context.payload.action !== 'opened' && (
|
||||
context.payload.action === 'assigned' ||
|
||||
context.payload.action === 'label_updated' ||
|
||||
context.payload.action === 'labeled' ||
|
||||
context.payload.comment) &&
|
||||
await isOrgMember(context.payload.sender.login))
|
||||
) {
|
||||
try {
|
||||
await github.rest.issues.removeLabel({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
// this should say 'new', but forgejo deviates from GitHub API here and expects the ID
|
||||
name: '41'
|
||||
});
|
||||
console.log('Removed "new" label');
|
||||
} catch (error) {
|
||||
if (error.status !== 404 && error.status !== 410) {
|
||||
console.log('Could not remove "new" label');
|
||||
}
|
||||
}
|
||||
} else if (context.payload.action === 'opened') {
|
||||
if (context.payload.action === 'opened') {
|
||||
labels.push('new');
|
||||
console.log('Detected label: new');
|
||||
}
|
||||
|
||||
if ((context.payload.action === 'opened' || context.payload.action === 'edited') && context.eventName !== 'issue_comment') {
|
||||
for (const [kw, label] of Object.entries(kwmap)) {
|
||||
if (title.includes(kw)) {
|
||||
labels.push(label);
|
||||
console.log('Detected label: ' + label);
|
||||
}
|
||||
for (const [kw, label] of Object.entries(kwmap)) {
|
||||
if (title.includes(kw)) {
|
||||
labels.push(label);
|
||||
console.log('Detected label: ' + label);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +29,7 @@ module.exports = async ({github, context}) => {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
issue_number: context.payload.pull_request?.number || context.payload.issue?.number,
|
||||
labels: labels,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,35 +1,31 @@
|
||||
avcodec:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'libavcodec/**'
|
||||
- any-glob-to-any-file: libavcodec/**
|
||||
|
||||
avdevice:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'libavdevice/**'
|
||||
- any-glob-to-any-file: libavdevice/**
|
||||
|
||||
avfilter:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'libavfilter/**'
|
||||
- any-glob-to-any-file: libavfilter/**
|
||||
|
||||
avformat:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'libavformat/**'
|
||||
- any-glob-to-any-file: libavformat/**
|
||||
|
||||
avutil:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'libavutil/**'
|
||||
- any-glob-to-any-file: libavutil/**
|
||||
|
||||
swresample:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'libswresample/**'
|
||||
- any-glob-to-any-file: libswresample/**
|
||||
|
||||
swscale:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'libswscale/**'
|
||||
- any-glob-to-any-file: libswscale/**
|
||||
|
||||
CLI:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'fftools/**'
|
||||
|
||||
vulkan:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: '**/*vulkan*'
|
||||
- any-glob-to-any-file: fftools/**
|
||||
|
||||
@@ -2,28 +2,25 @@ name: Autolabel
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, edited, synchronize, closed, assigned, labeled, unlabeled]
|
||||
types: [opened, edited, synchronize]
|
||||
issues:
|
||||
types: [opened, edited, closed, assigned, labeled, unlabeled]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
types: [opened, edited]
|
||||
|
||||
jobs:
|
||||
pr_labeler:
|
||||
name: Labeler
|
||||
runs-on: utilities
|
||||
if: ${{ github.event.sender.login != 'ffmpeg-devel' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v4
|
||||
- name: Label by file-changes
|
||||
uses: actions/labeler@v6
|
||||
uses: https://github.com/actions/labeler@v5
|
||||
if: ${{ forge.event_name == 'pull_request_target' }}
|
||||
with:
|
||||
configuration-path: .forgejo/labeler/labeler.yml
|
||||
repo-token: ${{ secrets.AUTOLABELER_TOKEN }}
|
||||
- name: Label by title-match
|
||||
uses: actions/github-script@v8
|
||||
uses: https://github.com/actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const script = require('.forgejo/labeler/labeler.js')
|
||||
|
||||
@@ -3,19 +3,16 @@ name: Lint
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release/8.0
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
cancel-in-progress: ${{ forge.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Pre-Commit
|
||||
runs-on: utilities
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v4
|
||||
- name: Install pre-commit CI
|
||||
id: install
|
||||
run: |
|
||||
@@ -24,7 +21,7 @@ jobs:
|
||||
~/pre-commit/bin/pip install pre-commit
|
||||
echo "envhash=$({ python3 --version && cat .forgejo/pre-commit/config.yaml; } | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
|
||||
- name: Cache
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: pre-commit-${{ steps.install.outputs.envhash }}
|
||||
|
||||
+13
-51
@@ -3,12 +3,9 @@ name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release/8.0
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
cancel-in-progress: ${{ forge.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
run_fate:
|
||||
name: Fate (${{ matrix.runner }}, ${{ matrix.shared }}, ${{ matrix.bits }} bit)
|
||||
@@ -28,20 +25,20 @@ jobs:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v4
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --enable-gpl --enable-nonfree --enable-memory-poisoning --assert-level=2 \
|
||||
$([ "${{ matrix.bits }}" != "32" ] || echo --arch=x86_32 --extra-cflags=-m32 --extra-cxxflags=-m32 --extra-ldflags=-m32) \
|
||||
$([ "${{ matrix.shared }}" != "shared" ] || echo --enable-shared --disable-static) \
|
||||
|| CFGRES=$?
|
||||
|| CFGRES=$? && CFGRES=$?
|
||||
cat ffbuild/config.log
|
||||
exit ${CFGRES:-0}
|
||||
exit $CFGRES
|
||||
- name: Build
|
||||
run: make -j$(nproc)
|
||||
- name: Restore Cached Fate-Suite
|
||||
id: cache
|
||||
uses: actions/cache/restore@v5
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: fate-suite
|
||||
key: fate-suite
|
||||
@@ -53,66 +50,31 @@ jobs:
|
||||
make fate-rsync SAMPLES=$PWD/fate-suite
|
||||
echo "hash=$(find fate-suite -type f -printf "%P %s %T@\n" | sort | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
|
||||
- name: Cache Fate-Suite
|
||||
uses: actions/cache/save@v5
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ format('fate-suite-{0}', steps.fate.outputs.hash) != steps.cache.outputs.cache-matched-key }}
|
||||
with:
|
||||
path: fate-suite
|
||||
key: fate-suite-${{ steps.fate.outputs.hash }}
|
||||
- name: Run Fate
|
||||
run: |
|
||||
LD_LIBRARY_PATH="$(printf "%s:" "$PWD"/lib*)$PWD" make fate fate-build SAMPLES="$PWD/fate-suite" -j$(nproc) || FATERES=$?
|
||||
find . -name "*.err" -exec printf '::group::%s\n' {} \; -exec cat {} \; -exec printf '::endgroup::\n' \;
|
||||
exit ${FATERES:-0}
|
||||
run_fate_full:
|
||||
name: Fate (Full, ${{ matrix.target_exec }})
|
||||
run: LD_LIBRARY_PATH="$(printf "%s:" "$PWD"/lib*)$PWD" make fate fate-build SAMPLES=$PWD/fate-suite -j$(nproc)
|
||||
compile_only:
|
||||
name: Fate (Win64, Build-Only)
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: ['ghcr.io/btbn/ffmpeg-builds/win64-gpl:latest']
|
||||
target_exec: ['wine']
|
||||
image: ["ghcr.io/btbn/ffmpeg-builds/win64-gpl-8.0:latest"]
|
||||
runs-on: linux-amd64
|
||||
container: ${{ matrix.image }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v4
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --pkg-config-flags="--static" $FFBUILD_TARGET_FLAGS $FF_CONFIGURE \
|
||||
--cc="$CC" --cxx="$CXX" --ar="$AR" --ranlib="$RANLIB" --nm="$NM" \
|
||||
--extra-cflags="$FF_CFLAGS" --extra-cxxflags="$FF_CXXFLAGS" \
|
||||
--extra-libs="$FF_LIBS" --extra-ldflags="$FF_LDFLAGS" --extra-ldexeflags="$FF_LDEXEFLAGS" \
|
||||
--enable-memory-poisoning --assert-level=2 --target-exec="${{ matrix.target_exec }}" \
|
||||
--enable-hardcoded-tables \
|
||||
|| CFGRES=$?
|
||||
cat ffbuild/config.log
|
||||
exit ${CFGRES:-0}
|
||||
--extra-libs="$FF_LIBS" --extra-ldflags="$FF_LDFLAGS" --extra-ldexeflags="$FF_LDEXEFLAGS"
|
||||
- name: Build
|
||||
run: make -j$(nproc)
|
||||
- name: Restore Cached Fate-Suite
|
||||
id: cache
|
||||
uses: actions/cache/restore@v5
|
||||
with:
|
||||
path: fate-suite
|
||||
key: fate-suite
|
||||
restore-keys: |
|
||||
fate-suite-
|
||||
- name: Sync Fate-Suite
|
||||
id: fate
|
||||
run: |
|
||||
make fate-rsync SAMPLES=$PWD/fate-suite
|
||||
echo "hash=$(find fate-suite -type f -printf "%P %s %T@\n" | sort | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
|
||||
- name: Cache Fate-Suite
|
||||
uses: actions/cache/save@v5
|
||||
if: ${{ format('fate-suite-{0}', steps.fate.outputs.hash) != steps.cache.outputs.cache-matched-key }}
|
||||
with:
|
||||
path: fate-suite
|
||||
key: fate-suite-${{ steps.fate.outputs.hash }}
|
||||
- name: Run Fate
|
||||
run: |
|
||||
if [[ "${{ matrix.target_exec }}" == "wine" ]]; then
|
||||
export WINEDEBUG=-all
|
||||
export FREI0R_PATH="$(winepath -w "$FREI0R_PATH")"
|
||||
fi
|
||||
LD_LIBRARY_PATH="$(printf "%s:" "$PWD"/lib*)$PWD" make fate fate-build SAMPLES="$PWD/fate-suite" -j$(nproc) || FATERES=$?
|
||||
find . -name "*.err" -exec printf '::group::%s\n' {} \; -exec cat {} \; -exec printf '::endgroup::\n' \;
|
||||
exit ${FATERES:-0}
|
||||
run: make -j$(nproc) fate-build
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
*.metal.air
|
||||
*.metallib
|
||||
*.metallib.c
|
||||
*.spv
|
||||
*.spv.c
|
||||
*.spv.gz
|
||||
*.ptx
|
||||
*.ptx.c
|
||||
*.ptx.gz
|
||||
@@ -39,7 +36,6 @@
|
||||
/ffprobe
|
||||
/config.asm
|
||||
/config.h
|
||||
/config_components.asm
|
||||
/config_components.h
|
||||
/coverage.info
|
||||
/lcov/
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Note to Github users
|
||||
Patches should be submitted to [Forgejo](https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls) or the [ffmpeg-devel mailing list](https://ffmpeg.org/mailman/listinfo/ffmpeg-devel) using `git format-patch` or `git send-email`. Github pull requests should be avoided because they are not part of our review process and **will be ignored**.
|
||||
Patches should be submitted to the [ffmpeg-devel mailing list](https://ffmpeg.org/mailman/listinfo/ffmpeg-devel) using `git format-patch` or `git send-email`. Github pull requests should be avoided because they are not part of our review process and **will be ignored**.
|
||||
|
||||
See [https://ffmpeg.org/developer.html#Contributing](https://ffmpeg.org/developer.html#Contributing) for more information.
|
||||
|
||||
@@ -1,40 +1,520 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
version 8.0.3:
|
||||
Bump for 8.0.3
|
||||
fix missing padding for AV1 extradata
|
||||
fix crash when stsz_sample_size is zero and sample_sizes is null
|
||||
Fix out-of-bounds write errors in yuv2rgb_lasx.c file.
|
||||
bound manifest reloads and fragment-open retries
|
||||
Fail with any inner stream count being 0
|
||||
swscale/x86/rgb_2_rgb: fix uyvytoyuv422 overwrite on odd width
|
||||
swscale/aarch64: fix uyvy/yuyv to yuv420p/yuv422p on odd width
|
||||
avcodec/snowenc: fix SIGFPE in get_dc() when a block lies outside the plane
|
||||
avcodec/snowenc: fix out-of-bounds OBMC read in get_dc() for narrow planes
|
||||
avcodec/snowenc: fix out-of-bounds memcpy in get_block_rd() for narrow planes
|
||||
libavdevice/alsa.c: fix NULL pointer dereference
|
||||
avformat/icecast: reject CR/LF in metadata header values
|
||||
avfilter/avf_showspectrum: Fix allocation check
|
||||
avformat/sctp: add size check in sctp_read() matching sctp_write()
|
||||
avcodec/jpeg2000: Fix undefined behavior on ROI shift-up
|
||||
avcodec/cbs_av1_syntax_template: reset seen_frame_header on sequence headers
|
||||
avfilter/convolution: compute user matrix products in unsigned
|
||||
avformat/mpegts: use av_fast_realloc() for prg
|
||||
avfilter/avf_showcwt: fix DIRECTION_DU EOF fill clearing the wrong rows
|
||||
avfilter/avf_showcwt: fix DIRECTION_RL EOF fill clearing the wrong columns
|
||||
avfilter/avf_showcwt: avoid undefined float to int conversion of nb_consumed_samples
|
||||
avfilter/avf_showcwt: fix out of array read in compute_kernel
|
||||
avfilter/v360: compute remap table offsets in 64bit
|
||||
avfilter/v360: reject out-of-range dimensions
|
||||
swresample/x86/resample: write only int16 in the int16 resampler
|
||||
avformat/rtpenc_amr: Check input size
|
||||
swscale/ppc: fix ASAN stack-buffer-overflow in yuv2planeX
|
||||
swscale/ppc: fix LOAD_FILTER overread in VSX path
|
||||
avfilter: use ff_slice_pos() for per-slice boundary computation
|
||||
avfilter: add ff_slice_pos() helper for slice boundaries
|
||||
(origin/release/8.0, fforge/release/8.0) avformat/iamf_writer: reject muxing PCM streams
|
||||
avfilter/estdif: avoid signed overflow in slice boundary calculation
|
||||
swscale: support sliced input with cascaded scaling contexts
|
||||
avformat/rtspdec: bound Content-Length in the ANNOUNCE handler to SDP_MAX_SIZE
|
||||
avcodec/cbs_h266_syntax_template: reject subpic info with res_change_in_clvs
|
||||
avcodec/misc4: Check nb channels
|
||||
avcodec/rv10, rv34: check init_get_bits8() before RealVideo bit access
|
||||
avformat/http: reject request-line tokens not terminated by whitespace
|
||||
avformat/mov: reject out of range ispe dimensions, avoid overflow summing HEIF tile dimensions
|
||||
avcodec/agm: validate actual src_y against prev plane in decode_inter_plane
|
||||
avformat/dhav: Fix second integer overflow in get_duration()
|
||||
fftools/ffmpeg_dec: deep-copy subtitle_header to fix use-after-free
|
||||
avcodec/hevc/ps: Check window parameters
|
||||
avcodec/hevc/ps: Factor window reading out
|
||||
avcodec/truespeech: reject iterations count whose * 240 product overflows 32-bit
|
||||
libavcodec/options_table: gamma22 and gamma28 aliases
|
||||
avcodec/on2avc: reject subframe count whose * SUBFRAME_SIZE product overflows 32-bit
|
||||
avfilter/zmq: initialize send_buf before shared cleanup on parse failure
|
||||
avcodec/adpcm: fix signed integer overflow in get_nb_samples()
|
||||
avformat/matroskadec: avoid signed overflow in DASH cue time differences
|
||||
avcodec/fastaudio: reject subframes count whose * 256 product overflows 32-bit
|
||||
avcodec/vc2enc_dwt: avoid signed overflow in the 9/7 DWT lifting
|
||||
avcodec/vc2enc_dwt: avoid signed overflow in the 5/3 and Haar DWT
|
||||
avcodec/mwsc: do not dereference a missing reference frame
|
||||
avcodec/misc4: reject invalid sample rate
|
||||
swscale/output: avoid signed overflow in yuv2rgba64_1 alpha
|
||||
swscale/output: avoid signed overflow in yuv2rgba64_full_1 alpha
|
||||
tools/target_dem_fuzzer: do not exit on io_buffer allocation failure
|
||||
avformat/gxfenc: Check timecode and propagate error
|
||||
swscale/rgb2rgb_template: use unsigned for <<24
|
||||
avformat/iamf_parse: bound substream count by remaining OBU size
|
||||
avformat/matroskadec: bound TRACKENTRY parsing by max_streams
|
||||
avcodec/diracdec: fix heap buffer overflow in edge_emu_buffer
|
||||
avformat/rtmppkt: Check recursion depth
|
||||
avcodec/tdsc: propagate max_pixels to the JPEG tile decoder
|
||||
avcodec/imm5: propagate max_pixels to the H264/HEVC sub-decoders
|
||||
avcodec/cri: propagate max_pixels to the JPEG tile decoder
|
||||
avcodec/jpeglsdec: only apply color transform to decoded rows
|
||||
avfilter/avf_showcwt: fix out-of-bounds read in du scroll
|
||||
avfilter/f_ebur128: avoid signed-int wrap when sizing per-channel cache
|
||||
avformat/mov: cap HEIF ICC profile copies via c*max_streams to bound CPU and memory
|
||||
avcodec/aac/aacdec_usac: reject explicit usacSamplingFrequency of 0
|
||||
avcodec/aac/aacdec: reject decoded frame without a valid sample rate
|
||||
avformat/iff: check av_get_packet() result in ANIM branch
|
||||
avcodec/cbs_h266_syntax_template: Fix pps_exp_slice_height_in_ctus_minus1 range
|
||||
avfilter/vf_scale: split rational multiply
|
||||
avfilter/vf_drawtext: Avoid double free in glyph_enu_border_free()
|
||||
avfilter/vf_drawtext: plug error-path leaks in measure_text/draw_text
|
||||
avfilter/vf_drawtext: shape_text_hb() free allocated things on error
|
||||
avfilter/vf_drawtext: avoid double-free of aliased FT_Glyph in glyph_enu_free
|
||||
avfilter/vf_drawtext: don't double-free glyph that has been cached in tree
|
||||
avfilter/vf_drawtext: always check pixel_mode == FT_PIXEL_MODE_MONO
|
||||
avcodec/cook: bound subpacket channel sum against channel count
|
||||
avcodec/apv_decode: avoid using apv_cbc
|
||||
avformat/mxfdec: Remove unneeded check
|
||||
avformat/ftp: Check string used for RNTO
|
||||
avformat/ftp: Check for Telnet IAC characters and other non printable ASCII chars
|
||||
avformat/ftp: reject CR/LF in the URL path to prevent FTP command injection
|
||||
avcodec/jpeg2000dec: Clear header derived variables
|
||||
avcodec/bsf/smpte436m_to_eia608: properly frees stuff on errors in ff_smpte436m_to_eia608_filter()
|
||||
avformat/avc: Adjust get_ue_golomb() to handle 32 bit
|
||||
avformat/whip: require remote DTLS fingerprint in SDP answer
|
||||
avcodec/x86/vorbisdsp: change cmpleps to cmpltps in inverse coupling
|
||||
avcodec/liboapvenc: derive and validate APV profile from pixel format
|
||||
avfilter/af_join: fix wrong loop bound in buffer dedup (use-after-free)
|
||||
avcodec/nvenc: fix compatibility with Video Codec SDK 13.1
|
||||
avformat/mov: validate APV access unit length before passing to decoder
|
||||
avcodec/h264_slice: guard color_frame() against chroma-width underflow
|
||||
avcodec/magicyuv: reject slice_height misaligned with chroma vshift
|
||||
avcodec/magicyuv: Expand the s->interlaced slice-height sanity check
|
||||
avcodec/magicyuv: Fix 1 line MEDIAN slices
|
||||
avformat/mxfdec: zero-init Sony MPEG-4 extradata and add padding
|
||||
avformat/soxdec: Check sample_rate for nan
|
||||
tests/tiny_ssim: fixed mistake in ssim_c1 calculation
|
||||
avformat/hls: Check TIME-OFFSET value
|
||||
avformat/hls: Check url_offset and size
|
||||
avcodec/prores_raw: reject invalid tile alignment values
|
||||
avformat/ty: check rec_size
|
||||
avformat/rtpenc_xiph: bail out when the max payload size underflows
|
||||
avformat/rtpenc_aac: reject packets smaller than the ADTS header
|
||||
avcodec/jpeg2000dec: compute mask in decode_clnpass() like in decode_sigpass()
|
||||
avformat/flvdec: Check size at the top of the main loop
|
||||
avformat/vividas: fix misaligned access
|
||||
avformat/mccdec: dont pass NULL to bytestream2_put_buffer()
|
||||
avcodec/g2meet: The stack is EPIC_PIX_STACK_SIZE
|
||||
avcodec/h2645_sei: Initialize side data before deallocation
|
||||
avfilter/boxblur: Fix off by one errors
|
||||
avformat/assenc: Add the missing parentheses
|
||||
avcodec/diracdec: Enlarge `mctmp` to cover the worst-case `blheight·ybsep + yblen` rows, and break the MC loop when no output rows remain
|
||||
tools/zmqsend: free the AVBprint buffer after using it
|
||||
[Wave] Fix issues with unaligned metadata chunks.
|
||||
fftools/graph: Add missing include "libavutil/mem.h" for fftools/graph/graphprint.c
|
||||
avcodec/cbs_h266_syntax_template: tighten sh_num_tiles_in_slice_minus1 upper bound
|
||||
avcodec/hevc: limit missing-ref fill to coded planes
|
||||
avformat/mov: Fix negative index given to can_seek_to_key_sample()
|
||||
avcodec/hdrdec: fix pixel count decrement in RLE decompress loop
|
||||
configure: bump CONFIG_THIS_YEAR to 2026
|
||||
(fforge/pr/23304) avformat/mov: don't abort on unsupported or invalid chnl boxes
|
||||
avformat/mov_chan: keep the layout untouched on chan/chnl box failure
|
||||
(fforge/pr/23239) avformat/oggparsevorbis.c: Prevent integer overflow when summing header lengths; add bounds check.
|
||||
(fforge/pr/23186) avformat/oggparsecelt: bound extra_headers to avoid an effectively infinite loop
|
||||
(fforge/pr/23112) avformat/demux: use correct close function for custom io
|
||||
avformat/hlsenc: use correct close function for custom io
|
||||
avformat/hlsenc: respect io_open set in AVFormatContext
|
||||
avformat/dashenc: respect io_open set in AVFormatContext
|
||||
avformat/dashdec: respect io_open set in AVFormatContext
|
||||
(fforge/pr/23170) Changelog: fix typos
|
||||
avformat/rtpdec_av1: fix buffer overflow due to variable confusion
|
||||
|
||||
|
||||
version 8.1:
|
||||
- ffprobe -codec option
|
||||
- EXIF Metadata Parsing
|
||||
- gfxcapture: Windows.Graphics.Capture based window/monitor capture
|
||||
- hxvs demuxer for HXVS/HXVT IP camera format
|
||||
- MPEG-H 3D Audio decoding via mpeghdec
|
||||
- D3D12 H.264 encoder
|
||||
- drawvg filter via libcairo
|
||||
- ffmpeg CLI tiled HEIF support
|
||||
- D3D12 AV1 encoder
|
||||
- ProRes Vulkan hwaccel
|
||||
- DPX Vulkan hwaccel
|
||||
- Rockchip H.264/HEVC hardware encoder
|
||||
- Add vf_scale_d3d12 filter
|
||||
- JPEG-XS parser
|
||||
- JPEG-XS decoder and encoder through libsvtjpegxs
|
||||
- JPEG-XS raw bitstream muxer and demuxer
|
||||
- IAMF Projection mode Ambisonic Audio Elements muxing and demuxing
|
||||
- Add vf_mestimate_d3d12 filter
|
||||
- xHE-AAC Mps212 decoding support (experimental)
|
||||
- Remove the old HLS protocol handler
|
||||
- Vulkan compute codec optimizations
|
||||
- swscale Vulkan support
|
||||
- LCEVC metadata bitstream filter
|
||||
- Add vf_deinterlace_d3d12 filter
|
||||
- ffprobe: only show refs field in stream section when reading frames
|
||||
- ProRes Vulkan encoder
|
||||
- LCEVC parser
|
||||
- LCEVC enhancement layer exporting in MPEG-TS
|
||||
version 8.0.2:
|
||||
avcodec/dfpwmdec: Check nb_samples
|
||||
avcodec/alsdec: do not set nbits invalidly
|
||||
swscale/swscale_unscaled: adjust last line copy
|
||||
swscale/swscale: Check srcSliceY and srcSliceH
|
||||
avformat/avidec: check LIST size in avi_load_index()
|
||||
avformat/avidec: validate INFO list size before parsing
|
||||
avformat/matroskadec: Check audio.sub_packet_h * audio.frame_size
|
||||
libavformat/xwma: fix overflow in seek position
|
||||
avformat/pcm: Use 64bit for byte_rate
|
||||
avcodec/hevc/ps: validate rep_format dimensions in multi-layer SPS
|
||||
avfilter/vf_kerndeint: Check for minimum height
|
||||
avcodec/ralf: Add the missing return statement after the error log
|
||||
avfilter/vf_codecview: Clamp block to the visible frame region
|
||||
avcodec/zmbv: reject XOR data that overruns the decompression buffer
|
||||
avcodec/rasc: fix heap use-after-free in decode_move()
|
||||
avformat/rtpdec_mpeg4: reject zero-length AU header sections
|
||||
avcodec/hevc/refs: Check multiplication in alloc_frame()
|
||||
fftools/ffmpeg_opt: validate stream index in negative map handling
|
||||
avformat/rtmpproto: prevent integer overflow accumulating FLV buffer size
|
||||
avformat/rtmpproto: validate compressed SWF header length
|
||||
avformat/rtsp: Fix out-of-bounds read in SDP parser when control_url is empty
|
||||
avformat/rtpdec_latm: avoid integer overflow in LATM length parsing
|
||||
avcodec/h264: recompute per-slice direct mode state for every slice
|
||||
avcodec/h264_refs: Clear stale pointers from ref_list
|
||||
avcodec/pdvdec: Check input space before buffer allocation
|
||||
avformat/concat: guard total_size overflow
|
||||
avformat/iamf_parse.c: Fix potential integer overflow in opus_decoder_config()
|
||||
avcodec/wmaenc: Fix missing padding in extradata
|
||||
avformat: Fix various extradata padding issues
|
||||
avcodec/tdsc: remove double stride adjustment
|
||||
avformat/cafdec: fix negative index use in read_seek
|
||||
avcodec/notchlc: Check 255 loops
|
||||
avformat/rtpdec_jpeg: check qtable_len
|
||||
avformat/vividas: use-of-uninitialized-value in keybuffer
|
||||
avcodec/tdsc: Check jpeg size
|
||||
avcodec/tdsc: Better input size check
|
||||
avcodec/tdsc: Check tile_size
|
||||
avcodec/decode: Better documentation for ff_set_dimensions()
|
||||
avformat/mov: Limit maximum box size for mov_read_lhvc()
|
||||
avformat/mov: reject dimg references with zero entries
|
||||
avformat/mov: check extradata in mov_read_dops()
|
||||
avformat/mov: Check read size for opus extradata
|
||||
avformat/rtspdec: reject non-positive ANNOUNCE Content-Length
|
||||
avformat/wavdec: Fix use-of-uninitialized-value in find_guid()
|
||||
lavfi: vf_drawtext: check memory allocation
|
||||
avcodec/svq1dec: Check input space for minimum
|
||||
avcodec/vp9: Rollback dimensions when format is rejected
|
||||
avformat/rtpdec_qdm2: Check block_size
|
||||
avfilter/vf_ssim360: fix integer overflow in tape_length allocation
|
||||
avcodec/escape130: Initialize old_y_avg
|
||||
avutil/samplefmt: Dont claim that av_get_sample_fmt_string checks sample_fmt
|
||||
swscale: fix signed integer overflow in color conversion arithmetic
|
||||
avformat: check avio_read() return values in dss/dtshd/mlv
|
||||
avcodec/aac/aacdec_usac: Implement missing bits of otts_bands_phase and residual_bands computation
|
||||
avcodec/alsdec: preserve full float value in zero-truncated samples
|
||||
avcodec/alsdec: propagate read_diff_float_data() errors in read_frame_data()
|
||||
avcodec/alsdec: fix mantissa unpacking in compressed Part A path
|
||||
avfilter/vf_drawtext: fix newline rendered as .notdef glyph
|
||||
avcodec/vp9: fix cbs fragment leak on error
|
||||
libavfilter/vf_v360: fix operator precedence in stereo loop condition
|
||||
avcodec/alsdec: fix abs(INT_MIN) UB in read_diff_float_data()
|
||||
avformat/rsd: reject short ADPCM_THP extradata reads
|
||||
avformat/mov: Handle integer overflow in MOV parser
|
||||
avcodec/dvdsub_parser: Fix buf_size check
|
||||
avfilter/af_pan: fix sscanf() return value checks in parse_channel_name
|
||||
avutil/bswap: fix implicit conversion warning in av_bswap64
|
||||
avcodec/h2645_sei: don't use provider_code uninitialized
|
||||
avformat/mpegts: fix descriptor accounting across multiple IOD descriptors
|
||||
avcodec/xxan: zero-initialize y_buffer
|
||||
avcodec/exr: Check input space before reverse_lut()
|
||||
avcodec/cbs_h266_syntax_template: Check tile_y
|
||||
avcodec/h264_slice: reject slice_num >= 0xFFFF
|
||||
lavfi/bwdif: fix heap-buffer-overflow with small height videos
|
||||
avcodec/wmv2dec: More Checks about reading skip bits
|
||||
avcodec/cbs_h266_syntax_template: Fix w/h typo
|
||||
aacdec_usac: skip FD-specific decoding for LPD channels
|
||||
avformat/dhav: Fix handling or slightly larger files
|
||||
avutil/timecode: Check for integer overflow in av_timecode_init_from_components()
|
||||
avcodec/cbs_h266_syntax_template: Fix rows vs columns
|
||||
avformat/mov: do not allocate out-of-range buffers
|
||||
avfilter/af_lv2: call lilv_instance_activate before lilv_instance_run
|
||||
avformat/rtmpproto: fix listen_timeout conversion for special negative values
|
||||
avcodec/aom_film_grain: Remove impossible check
|
||||
avcodec/aom_film_grain: avoid duplicate indexes in ff_aom_parse_film_grain_sets()
|
||||
swscale/output: fix integer overflows in chroma in yuv2rgba64_X_c_template()
|
||||
avcodec/lcldec: Fixes uqvq overflow
|
||||
fftools/ffmpeg_demux: Check metadata provided filename
|
||||
avcodec/av1dec: sync frame header and tile group behavior with CBS
|
||||
avformat/mlvdec: avoid uninitialized read in read_string()
|
||||
avcodec/magicyuv: fix small median images
|
||||
swscale/output: Fix integer overflow in alpha in yuv2rgba64_1_c_template()
|
||||
swscale/utils: Check *Inc
|
||||
avfilter/vf_scale: Fix integer overflow in config_props()
|
||||
swscale/output: Fixes integer overflow in yuv2planeX_8_c
|
||||
swscale/utils: initialize chroma when luma switched to cascade
|
||||
avcodec/utils: fix duration computation based on frame_bytes
|
||||
avcodec/cbs_h266_syntax_template: bound slice width/height by remaining tiles
|
||||
avformat/rtsp: Pass blacklist
|
||||
avformat/rtsp: Explicitly check protocol
|
||||
avfilter/vf_convolution: Use avpriv_mirror
|
||||
avfilter/vf_convolution: Handle corner cases with small frames
|
||||
avcodec/pnmdec: Check input size against width*height assuming at least 1bit per pixel
|
||||
avcodec/snowenc: avoid NULL ptr arithmetic
|
||||
avformat/mov: use 64bit in CENC subsample bounds checks
|
||||
avutil/eval: Check depth of AVExpr
|
||||
avformat/vividas: Reset n_audio_subpackets on error
|
||||
avformat/matroskadec: Check that end_time_ns >= start_time_ns
|
||||
avcodec/vp3: Sanity check cropping
|
||||
avformat/dhav: Check avio_seek() return
|
||||
avformat/segafilm: dont read uninitialized value
|
||||
avcodec/mpegvideo_enc: Restructure ff_h263_encode_gob_header() relation to update_mb_info()
|
||||
avcodec/exr: check tile_attr.x/ySize
|
||||
avcodec/jpeg2000dec: fix integer overflow in dequantization_int_97()
|
||||
avformat/demux: Fix integer overflows in select_from_pts_buffer()
|
||||
avcodec/golomb: Fix get_ur_golomb_jpegls() with esclen = 0
|
||||
avcodec/jpeg2000dec: Handle M_b = -1
|
||||
swresample/resample_template: add casts to avoid undefined overflows
|
||||
avcodec/h264_parser: Check pts for overflow
|
||||
avformat/rtpenc: use unsigned type for ssrc option
|
||||
swscale/output: Fix some integer overflows in yuv2rgba64_full*()
|
||||
avformat/wtvdec: Check that language is fully read
|
||||
avcodec/imm5: Dont pass EAGAIN on as is
|
||||
avcodec/interplayacm: Check input for fill_block()
|
||||
avcodec/hdrdec: Check input size before buffer allocation
|
||||
avcodec/tmv: Move space check before buffer allocation
|
||||
avcodec/flashsv: Check for input space before (re)allocating frame
|
||||
avcodec/mdec: Check input space vs minimal block size
|
||||
avcodec/h264_parser: Check remaining input length in loop in scan_mmco_reset()
|
||||
avcodec/exr: fix AVERROR typo
|
||||
avcodec/jpeg2000htdec: Check Lcup and Lref
|
||||
avcodec/libtheoraenc: make keyframe mask unsigned and handle its larger range
|
||||
avcodec/rv60dec: check last_size
|
||||
avcodec/cfhd: Check transform type before continuing
|
||||
avcodec/cfhd: Add CFHDSegment enum and named identifiers
|
||||
avcodec/hevc/ps: Check bit_depth_cm in/out relation
|
||||
avformat/icodec: Check size
|
||||
avformat/lrcdec: Check ss for finiteness
|
||||
avformat/http: Also count redirects from the cache
|
||||
avformat/http: allow adjusting the redirect limit
|
||||
fftools/ffmpeg_opt: limit recursion of presets
|
||||
swscale/rgb2rgb_template: fix signed shift into sign bit
|
||||
swresample: Check ch layouts in swr_alloc_set_opts2()
|
||||
swresample: Check user chlayout in swr_set_matrix()
|
||||
avcodec/bmp: fix indentation
|
||||
avcodec/exr: Handle axmax like bxmin in 04d7a6d3db56ea1a93908ff2d3d312e3fc40a58c
|
||||
avformat/flvdec: Check *size in cts parsing
|
||||
avcodec/prores_raw: Tiles of width less than 16 result in undefined behavior
|
||||
avformat/cafdec: Check nb_entries in read_info_chunk()
|
||||
avcodec/vp9: Reallocate on resolution change which does not change tile_cols
|
||||
avformat/img2dec: Check avio_size() for failure
|
||||
avformat/mpegtsenc: Check remaining space in SDT
|
||||
avformat/img2enc: Check split planes packet size
|
||||
avformat/yuv4mpegen: Sanity check input packet frame dimensions
|
||||
avformat/iff: Error out with 0 channel loudspeaker configuration
|
||||
Fix overflow in STSD parser
|
||||
avcodec/adpcm: Check input buffer size
|
||||
avformat/scd: Use ffio_read_size()
|
||||
avcodec/hevc/sei: Use get_bits64() in decode_nal_sei_3d_reference_displays_info()
|
||||
avformat/hls: Check for integer overflow with #EXTINF:
|
||||
avcodec/dca_xll: Clear padding in ff_dca_xll_parse()
|
||||
avformat/flvdec: Check need_context_update when audio codec changes
|
||||
vfilter/vf_find_rect: Clamp x/y min/max to valid values
|
||||
avcodec/lzf: Remove size messing from ff_lzf_uncompress()
|
||||
avcodec/dxv: Clear tex_data padding on reallocation
|
||||
avcodec/ffv1enc: refine end condition
|
||||
avcodec/dca_xll: Check get_rice_array()
|
||||
libavformat/argo_brp: fix incorrect ASF chunk header read
|
||||
avutil/dovi_meta: Document valid range for index of av_dovi_get_ext()
|
||||
avformat/mpegts: Check program_info_length
|
||||
avformat/mpegts: Check IOD_DESCRIPTOR len
|
||||
avcodec/qdm2: fix heap-use-after-free in qdm2_decode_frame
|
||||
avcodec/jpeg2000dec: allow bpno of -1
|
||||
avcodec/jpeg2000dec: Print bpno level when erroring out
|
||||
avcodec/jpeg2000dec: allow M_b == 31
|
||||
avcodec/jpeg2000dec: Print M_b value when asking for a sample
|
||||
avformat/hlsenc: fix format string vulnerability in parse_playlist
|
||||
lavc/vvc: Fix unchecked error codes from set_qp_y
|
||||
avformat/dashdec: check value valid after read value from mpd xml
|
||||
swscale/utils: zero init filter memory as before
|
||||
libavfilter/showcwt: fix OOB write for DU/RL position init
|
||||
lavc/j2kdec: Do not ignore colour association for packed formats
|
||||
swscale/utils: Sanity check sizeFactor
|
||||
swscale/utils: Avoid FF_ALLOC_TYPED_ARRAY() and use av_malloc_array() directly
|
||||
avcodec/mjpegdec: fix segfault on extern_huff and no extradata
|
||||
avformat/iamf_parse: stop trying to parse files that report an unknown layout
|
||||
avcodec/exr: use av_realloc_array()
|
||||
avcodec/omx: Check extradata size and nFilledLen
|
||||
lavc/aacdec_usac: fix CPE channel index in ff_aac_usac_reset_state()
|
||||
avfilter/scale_eval: Use 64bit for factor_w/h
|
||||
avfilter/scale_eval: Avoid undefined behavior with double to int cast
|
||||
avformat/http: Check that the protocol of redirects is http or https
|
||||
doc/mailing-list-faq.texi: Fix typo in link anchor
|
||||
avfilter/vf_find_rect: Fix handling odd sized images
|
||||
avcodec/notchlc: zero-initialize history buffer
|
||||
avfilter/vf_stack: add checks for the final canvas dimensions
|
||||
avcodec/mjpegdec: only test the size bound in sequential mjpeg
|
||||
avcodec/jpeg2000htdec: Check pLSB
|
||||
avformat/hls: fix double space
|
||||
avformat/hls: Check seg size and offset for overflow
|
||||
avcodec/jpeg2000dec: Make M_b check broader
|
||||
swscale/output: Use 64bit in addition in yuv2gbrp16_full_X_c() for RGB + Y
|
||||
avformat/flac_picture: Correct check
|
||||
avformat/demux: ensure avformat_find_stream_info updates internal stream contexts
|
||||
avformat/iamf_parse: fix parsing of Scalable layouts with Mono and Stereo layers
|
||||
avfilter/vf_neighbor_opencl: add error condition when filter name doesn't match
|
||||
avfilter/vf_libopencv: make sure there is space for null-terminator in shape_str
|
||||
avcodec/aacdec: Fix heap-use-after-free in USAC decoding
|
||||
avdevice/gdigrab: suppress int to pointer cast warning
|
||||
libavcodec/prores_raw: Fix heap-buffer-overflow in decode_frame
|
||||
avutil/hwcontext_d3d12va: use hwdev context for logging
|
||||
avfilter/x86/f_ebur128: only use filter_channels_avx for >= 2 channels
|
||||
fate: add missing options in config template
|
||||
avformat/hls_sample_encryption: add missing padding for audio setup buffer
|
||||
(fforge/pr/22931) avformat/mov: Merge tts after building index for old-style uncompressed PCM
|
||||
(fforge/pr/22825) lavc/videotoolbox_vp9: fix vpcC flags offset
|
||||
lavc/videotoolboxenc: return SEI parse errors
|
||||
(fforge-npc/release/8.0) aarch64/hpeldsp_neon: fix out-of-bounds read
|
||||
(fforge/pr/22415) avformat/mov: check return value of mov_read_iref_thmb()
|
||||
avformat/mov: Fix multiple issues related to mov_read_iref_dimg()
|
||||
avformat/mov: free item_name on infe entry parsing failure
|
||||
avformat/mov: check for EOF in more loops
|
||||
avformat/mov: abort if the queried item doesn't exist instead of overwriting it
|
||||
avformat/mov: add overflow checks to item offset values
|
||||
avformat/mov: reindent after the previous change
|
||||
avformat/mov: don't parse reserved ISOBMFF fields as if they were QT
|
||||
avformat/mov: make items referencing items generic
|
||||
(fforge/pr/22312) avformat/mov: fix cases where we discard iamf packets from enabled streams
|
||||
avformat/mov: fix setting iamf stream id offsets
|
||||
(fforge/pr/20965) avformat/whip: remove the confused option buffer_size
|
||||
avformat/whip: add new option ts_buffer_size to deprecate buffer_size
|
||||
avformat/whip: remind user increase -buffer_size
|
||||
avformat/whip: pass through buffer_size option to udp
|
||||
avformat/whip: fix potential 8bit overflow for profile_idc
|
||||
avformat/whip: fix 8 bits overflow and map constraint_set bits for H264
|
||||
avformat/whip: fix SDP ICE candidates parsing
|
||||
avformat/whip: fix ssrc might be same
|
||||
(fforge/pr/21699) avcodec/tableprint_vlc: Unbreak hardcoded tables
|
||||
tests: Fix fate-run.sh to handle busybox-w32 absolute paths
|
||||
configure: Recognize uname "Windows_NT" as using an .exe suffix
|
||||
avformat/tests/movenc: Make objects static
|
||||
(fforge/pr/21638) checkasm/hevc_pel: rename loop variable 'size' to 'idx' to avoid confusion
|
||||
checkasm/hevc_pel: fix typo size[sizes] -> sizes[size]
|
||||
(fforge/pr/21625) avcodec/libsvtav1: rename aq_mode for v4.0.0
|
||||
(fforge/pr/21624) vulkan_vp9: fix subsampling source and show_frame flag
|
||||
(fforge/pr/21433) avfilter/vf_lcevc: attach a reference to the source frame to each passed in base picture
|
||||
avcodec/lcevc: attach a reference to the source frame to each passed in base picture
|
||||
avcodec/lcevcdec: free pictures on error
|
||||
avcodec/lcevcdec: fix input dimensions for the base picture
|
||||
avcodec/lcevcdec: avoid copying the input frame
|
||||
avcodec/decode: Optimize lcevc away if disabled
|
||||
avcodec/decode: Put lcevc fields into structure of their own
|
||||
avcodec/decode: Don't allocate LCEVC context for non-video
|
||||
hwcontext_vulkan: add support for implicit DRM sync for export
|
||||
(fforge/pr/21329) lavc/vvc: Prevent OOB write to slice_top_left_ctu_x in PPS CBS
|
||||
lavc/vvc: Error on inter slice with no reference pics
|
||||
forgejo: backport CI job names
|
||||
avformat/img2dec: reject input images too big to fit into a single packet
|
||||
(fforge/pr/21350) cbs_vp9: Always update loop filter and segmentation from current frame
|
||||
(fforge/pr/21330) avformat/iamf_writer: check that stream count is consistent for ambisonic Audio Elements
|
||||
avformat/iamf_writer: fix writing some ambisonics fields in Audio Elements
|
||||
avformat/iamf_parse: fix setting denominator in AVIAMFLayer.demixing_matrix
|
||||
tests/fate/filter-video: add two feedback tests
|
||||
avfilter/vf_feedback: fix feedback block
|
||||
(fforge/pr/21218) fate/ffmpeg: remove comparison against ref from fix_sub_duration_heartbeat
|
||||
configure: Lower libdvdnav and libdvdread minimum versions for EL9
|
||||
(fforge/pr/21158) avcodec/aac_ac3_parser: do not override the profile set by the decoder
|
||||
avcodec/aac_ac3_parser: simplify
|
||||
avcodec/aac_ac3_parser: remove unused USAC/ADTS code
|
||||
avfilter/af_amerge: fix possible crash with custom layouts
|
||||
(fforge/pr/21091) avcodec/vp3: Sync VLCs once during init, fix crash
|
||||
(fforge/pr/21066) avcodec/prores_raw: add missing includes
|
||||
avfilter/stack_internal: fix checkheaders test
|
||||
forgejo: apply needed CI changes for 8.0
|
||||
forgejo/workflows: run tests on correct release branch
|
||||
forgejo: backport CI changes to release/8.0
|
||||
configure: replace openssl header check with 1.1.1 API
|
||||
configure: require at least OpenSSL 1.1.1 (LTS)
|
||||
configure: remove openssl version check for whip
|
||||
avformat/iamf_parse: ensure the stream count in a scalable channel representation is equal to the audio element's stream count
|
||||
avformat/iamf_parse: ensure each layout in an scalable channel representation has an increasing number of channels
|
||||
avfilter/vf_scale: don't attempt to rescale AV_NOPTS_VALUE
|
||||
avfilter/framesync: don't attempt to rescale AV_NOPTS_VALUE
|
||||
avutil/hwcontext_d3d12va: fix buf size when call av_buffer_create
|
||||
avfilter/f_select: Added activate for aselect
|
||||
avcodec/videotoolboxenc: fix crash with negative linesize
|
||||
avcodec/videotoolboxenc: improve Lock/Unlock BaseAddress error handling
|
||||
doc/filters: add section for VideoToolbox filter
|
||||
avformat/mov: fix missing video size when some decoders are disabled
|
||||
avformat/mov: relax check on proj box size
|
||||
(fforge/pr/20976) tests/fate/hevc: add a mv-hevc sample using long term ref
|
||||
avcodec/hevc: reset long_term_rps.nb_refs for IDR
|
||||
(fforge/pr/20987) Changelog: fix spell and remove redundant descriptions
|
||||
|
||||
|
||||
version 8.0.1:
|
||||
avutil/common: cast GET_BYTE/GET_16BIT returned value
|
||||
avfilter/vf_drawtext: fix call GET_UTF8 with invalid argument
|
||||
avfilter/vf_drawtext: fix incorrect text length
|
||||
avfilter/vf_drawtext: Account for bbox text separator
|
||||
avcodec/mediacodecdec_common: Check that the input to mediacodec_wrap_sw_audio_buffer() contains channel * sample_size
|
||||
avcodec/rv60dec: Clear blk_info
|
||||
avformat/whip: Fix rtp_ctx->streams access
|
||||
avcodec/utvideodec: Set B for the width= 1 case in restore_median_planar_il()
|
||||
avcodec/osq: Fix 32bit sample overflow
|
||||
avformat/rtpdec_rfc4175: Only change PayloadContext on success
|
||||
avformat/rtpdec_rfc4175: Check dimensions
|
||||
avformat/rtpdec_rfc4175: Fix memleak of sampling
|
||||
avformat/http: Fix off by 1 error
|
||||
avcodec/exr: spelling
|
||||
avcodec/rv60dec: add upper bound check for qp
|
||||
avcodec/exr: use tile dimensions in pxr24 UINT case
|
||||
avcodec/exr: Simple check for available channels
|
||||
avformat/sctp: Check size in sctp_write()
|
||||
avformat/rtmpproto: consider command line argument lengths
|
||||
avformat/rtmpproto_ Check tcurl and flashver length
|
||||
avcodec/g723_1enc: Make min_err 64bit
|
||||
avcodec/vlc: Clear val8/16 in vlc_multi_gen() by av_mallocz()
|
||||
avformat/rtpenc_h264_hevc: Check space for nal_length_size in ff_rtp_send_h264_hevc()
|
||||
avcodec/ffv1enc: Consider variation in slice sizes
|
||||
libavcodec/cbs_apv_syntax_template: limit tile to 2gb
|
||||
swscale/output: Fix unsigned cast position in yuv2*
|
||||
swscale/output: Fix integer overflow in yuv2ya16_X_c_template()
|
||||
avcodec/exr: Check that DWA has 3 channels
|
||||
avcodec/exr: check ac_size
|
||||
avcodec/exr: Round dc_w/h up
|
||||
avcodec/mjpegdec: Explain buf_size/width/height check
|
||||
configure: strip non numeric trailer from gcc version
|
||||
avformat/dhav: Fix off by length of read element error
|
||||
avformat/aviobuf: Keep checksum_ptr consistent in avio_seek()
|
||||
doc/examples/vaapi_encode: fix invalid check on fwrite
|
||||
avcodec/librsvgdec: fix compilation with librsvg 2.50.3
|
||||
avcodec/mfenc: fix memory leak with D3D11 input surfaces
|
||||
swscale/graph: fix double-free when legacy pass fails initializing
|
||||
libavformat/udp: Fix call to recvfrom(2)
|
||||
avfilter/f_ebur128: Fix incorrect ebur128 peak calculation.
|
||||
avformat/udp: fix warning about unused variable
|
||||
avdevice/lavfi: stop setting deprecated buffersink options
|
||||
configure: unbreak glslang build
|
||||
swscale/range_convert: fix truncation bias in range conversion
|
||||
lavc/aarch64: Fix addp overflow in ff_pred16x16_plane_neon_10
|
||||
avcodec/mlpdec: don't depend on context channel layout when setting substream masks
|
||||
avformat/demux: pass new extradata to the parser
|
||||
avfilter/af_whisper: fix srt index
|
||||
avfilter/af_whisper: fix int64 printf format
|
||||
avfilter/af_whisper: fix srt file format
|
||||
avfilter/whisper: correct option formatting
|
||||
avfilter/af_whisper: fix broken output for multibyte character
|
||||
avformat/rtsp: fix leading space in RTSP reason
|
||||
avformat/rtsp: do not log invalid values
|
||||
avformat/http: Handle IPv6 Zone ID in hostname
|
||||
avformat/dump: fix log level passed to av_log when printing stream group side data
|
||||
avcodec/hevc/sei: don't attempt to use stale values in HEVCSEITDRDI
|
||||
avcodec/hevc/sei: prevent storing a potentially bogus num_ref_displays value in HEVCSEITDRDI
|
||||
avcodec/hevc/refs: don't unconditionally discard non-IRAP frames if no IRAP frame was seen before
|
||||
libavutil/arm: Rename the HWCAP defines
|
||||
libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
|
||||
fftools/ffmpeg: fix gracefully shutdown
|
||||
avcodec/decode: sync initial_pict_type and intra_only_flag with thread worker's avctx
|
||||
avcodec/x86/pngdsp: add missing emms at the end of add_png_paeth_prediction
|
||||
avcodec/videotoolboxenc: ensure bitrate is set in low_delay mode
|
||||
avcodec/videotoolboxenc: allow low latency RC with HEVC
|
||||
avcodec/videotoolboxenc: support global_quality without qscale
|
||||
avcodec/videotoolboxenc: fix the loss of precision when calculating quality
|
||||
fftools/ffmpeg_demux: ensure the display_rotation option is honored
|
||||
avcodec/mjpegdec: use ff_frame_new_side_data() to export display matrix
|
||||
avutil/tests/aes_ctr: extend the test to cover payloads smaller than a block
|
||||
avutil/aes_ctr: reintroduce the block offset state
|
||||
avfilter/vf_lcevc: support LCEVCdec version 4
|
||||
avcodec/lcevcdec: support LCEVCdec version 4
|
||||
movenc: ensure chapters track extradata is not null and populated
|
||||
|
||||
version 8.0:
|
||||
- Whisper filter
|
||||
- Drop support for OpenSSL < 1.1.0
|
||||
@@ -68,8 +548,6 @@ version 8.0:
|
||||
- AV1 Vulkan encoder
|
||||
- ProRes RAW decoder
|
||||
- ProRes RAW Vulkan hwaccel
|
||||
- ffprobe -codec option
|
||||
- HDR10+ metadata passthrough when decoding/encoding with libaom-av1
|
||||
|
||||
|
||||
version 7.1:
|
||||
|
||||
+3
-6
@@ -152,7 +152,7 @@ Codecs:
|
||||
adpcm.c Zane van Iperen
|
||||
alacenc.c Jaikrishnan Menon
|
||||
alsdec.c Thilo Borgmann, Umair Khan
|
||||
amfdec*,amfenc* [2] Dmitrii Ovchinnikov, Araz Iusubov
|
||||
amfenc* Dmitrii Ovchinnikov
|
||||
aptx.c Aurelien Jacobs
|
||||
ass* Aurelien Jacobs
|
||||
asv* Michael Niedermayer
|
||||
@@ -211,7 +211,7 @@ Codecs:
|
||||
libkvazaar.c Arttu Ylä-Outinen
|
||||
libopenh264enc.c Martin Storsjo, Linjie Fu
|
||||
libopenjpegenc.c Michael Bradshaw
|
||||
libtheoraenc.c [0]
|
||||
libtheoraenc.c David Conrad
|
||||
libvorbis.c David Conrad
|
||||
libvpx* James Zern
|
||||
libxavs.c Stefan Gehrer
|
||||
@@ -278,7 +278,6 @@ Codecs:
|
||||
xface Stefano Sabatini
|
||||
|
||||
Hardware acceleration:
|
||||
amf* [2] Dmitrii Ovchinnikov, Araz Iusubov
|
||||
dxva2* Hendrik Leppkes, Laurent Aimar, Steve Lhomme
|
||||
d3d11va* Steve Lhomme
|
||||
d3d12va* Wu Jianhua
|
||||
@@ -483,7 +482,6 @@ Muxers/Demuxers:
|
||||
webm dash (matroskaenc.c) Vignesh Venkatasubramanian
|
||||
webvtt* Matthew J Heaney
|
||||
westwood.c Mike Melanson
|
||||
whip.c [2] Jack Lau
|
||||
wtv.c Peter Ross
|
||||
|
||||
Protocols:
|
||||
@@ -523,7 +521,7 @@ LoongArch [2] Shiyou Yin
|
||||
Darwin (macOS, iOS) [2] Marvin Scholz
|
||||
Mac OS X / PowerPC [0]
|
||||
Amiga / PowerPC Colin Ward
|
||||
Linux / PowerPC [2] Sean McGovern (CC <gseanmcg@gmail.com>), Lauri Kasanen
|
||||
Linux / PowerPC [1] Lauri Kasanen
|
||||
RISC-V [2] Rémi Denis-Courmont
|
||||
Windows MinGW Alex Beregszaszi, Ramiro Polla
|
||||
Windows Cygwin Victor Paesa
|
||||
@@ -619,7 +617,6 @@ Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
|
||||
Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A
|
||||
Robert Swain EE7A 56EA 4A81 A7B5 2001 A521 67FA 362D A2FC 3E71
|
||||
Sascha Sommer 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C
|
||||
Sean McGovern (Sean_McG) 6D03 BC60 3A33 E615 6E2E 06AD 8C06 8175 6F59 8684
|
||||
Stefano Sabatini 0D0B AD6B 5330 BBAD D3D6 6A0C 719C 2839 FC43 2D5F
|
||||
Steinar H. Gunderson C2E9 004F F028 C18E 4EAD DB83 7F61 7561 7797 8F76
|
||||
Stephan Hilb 4F38 0B3A 5F39 B99B F505 E562 8D5C 5554 4E17 8863
|
||||
|
||||
@@ -11,8 +11,6 @@ vpath %.asm $(SRC_PATH)
|
||||
vpath %.rc $(SRC_PATH)
|
||||
vpath %.v $(SRC_PATH)
|
||||
vpath %.texi $(SRC_PATH)
|
||||
vpath %.glsl $(SRC_PATH)
|
||||
vpath %.spv $(SRC_PATH)
|
||||
vpath %.cu $(SRC_PATH)
|
||||
vpath %.ptx $(SRC_PATH)
|
||||
vpath %.metal $(SRC_PATH)
|
||||
@@ -55,31 +53,31 @@ FF_DEP_LIBS := $(DEP_LIBS)
|
||||
FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
|
||||
|
||||
$(TOOLS): %$(EXESUF): %.o
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(filter-out $(FF_DEP_LIBS), $^) $(EXTRALIBS-$(*F)) $(EXTRALIBS) $(ELIBS))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(filter-out $(FF_DEP_LIBS), $^) $(EXTRALIBS-$(*F)) $(EXTRALIBS) $(ELIBS)
|
||||
|
||||
target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
target_enc_%_fuzzer$(EXESUF): target_enc_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_bsf_%_fuzzer$(EXESUF): tools/target_bsf_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
target_dem_%_fuzzer$(EXESUF): target_dem_%_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_dem_fuzzer$(EXESUF): tools/target_dem_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_sws_fuzzer$(EXESUF): tools/target_sws_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/target_swr_fuzzer$(EXESUF): tools/target_swr_fuzzer.o $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
|
||||
|
||||
tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS)
|
||||
tools/enum_options$(EXESUF): $(FF_DEP_LIBS)
|
||||
@@ -109,11 +107,10 @@ ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
|
||||
SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
|
||||
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
|
||||
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
|
||||
ALTIVEC-OBJS VSX-OBJS X86ASM-OBJS \
|
||||
ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
|
||||
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
|
||||
MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS RVVB-OBJS \
|
||||
OBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS SIMD128-OBJS \
|
||||
SVE-OBJS SVE2-OBJS SME-OBJS SME2-OBJS
|
||||
OBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS SIMD128-OBJS
|
||||
|
||||
define RESET
|
||||
$(1) :=
|
||||
@@ -147,7 +144,7 @@ else
|
||||
endif
|
||||
|
||||
%$(PROGSSUF)_g$(EXESUF): $(FF_DEP_LIBS)
|
||||
$(call LINK,$(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS))
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
|
||||
|
||||
VERSION_SH = $(SRC_PATH)/ffbuild/version.sh
|
||||
ifeq ($(VERSION_TRACKING),yes)
|
||||
@@ -187,7 +184,7 @@ clean::
|
||||
$(RM) -rf coverage.info coverage.info.in lcov
|
||||
|
||||
distclean:: clean
|
||||
$(RM) .version config.asm config.h config_components.* mapfile \
|
||||
$(RM) .version config.asm config.h config_components.h mapfile \
|
||||
ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
|
||||
version.h libavutil/ffversion.h libavcodec/codec_names.h \
|
||||
libavcodec/bsf_list.c libavformat/protocol_list.c \
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
┌────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 8.0 "Huffman" │
|
||||
└────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 8.0 "Huffman", about 11
|
||||
months after the release of FFmpeg 7.1.
|
||||
|
||||
A complete Changelog is available at the root of the project, and the
|
||||
complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git
|
||||
|
||||
We hope you will like this release as much as we enjoyed working on it, and
|
||||
as usual, if you have any questions about it, or any FFmpeg related topic,
|
||||
feel free to join us on the #ffmpeg IRC channel (on irc.libera.chat) or ask
|
||||
on the mailing-lists.
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Android Binder handler
|
||||
*
|
||||
* Copyright (c) 2025 Dmitrii Okunev
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libavutil/log.h"
|
||||
#include "binder.h"
|
||||
|
||||
#define THREAD_POOL_SIZE 1
|
||||
|
||||
static void *dlopen_libbinder_ndk(void)
|
||||
{
|
||||
/*
|
||||
* libbinder_ndk.so often does not contain the functions we need, so making
|
||||
* this dependency optional, thus using dlopen/dlsym instead of linking.
|
||||
*
|
||||
* See also: https://source.android.com/docs/core/architecture/aidl/aidl-backends
|
||||
*/
|
||||
|
||||
void *h = dlopen("libbinder_ndk.so", RTLD_NOW | RTLD_LOCAL);
|
||||
if (h != NULL)
|
||||
return h;
|
||||
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"android/binder: unable to load libbinder_ndk.so: '%s'; skipping binder threadpool init (MediaCodec likely won't work)\n",
|
||||
dlerror());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void android_binder_threadpool_init(void)
|
||||
{
|
||||
typedef int (*set_thread_pool_max_fn)(uint32_t);
|
||||
typedef void (*start_thread_pool_fn)(void);
|
||||
|
||||
set_thread_pool_max_fn set_thread_pool_max = NULL;
|
||||
start_thread_pool_fn start_thread_pool = NULL;
|
||||
|
||||
void *h = dlopen_libbinder_ndk();
|
||||
if (h == NULL)
|
||||
return;
|
||||
|
||||
unsigned thead_pool_size = THREAD_POOL_SIZE;
|
||||
|
||||
set_thread_pool_max =
|
||||
(set_thread_pool_max_fn) dlsym(h,
|
||||
"ABinderProcess_setThreadPoolMaxThreadCount");
|
||||
start_thread_pool =
|
||||
(start_thread_pool_fn) dlsym(h, "ABinderProcess_startThreadPool");
|
||||
|
||||
if (start_thread_pool == NULL) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"android/binder: ABinderProcess_startThreadPool not found; skipping threadpool init (MediaCodec likely won't work)\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (set_thread_pool_max != NULL) {
|
||||
int ok = set_thread_pool_max(thead_pool_size);
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"android/binder: ABinderProcess_setThreadPoolMaxThreadCount(%u) => %s\n",
|
||||
thead_pool_size, ok ? "ok" : "fail");
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"android/binder: ABinderProcess_setThreadPoolMaxThreadCount is unavailable; using the library default\n");
|
||||
}
|
||||
|
||||
start_thread_pool();
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"android/binder: ABinderProcess_startThreadPool() called\n");
|
||||
}
|
||||
|
||||
void android_binder_threadpool_init_if_required(void)
|
||||
{
|
||||
#if __ANDROID_API__ >= 24
|
||||
if (android_get_device_api_level() < 35) {
|
||||
// the issue with the thread pool was introduced in Android 15 (API 35)
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"android/binder: API<35, thus no need to initialize a thread pool\n");
|
||||
return;
|
||||
}
|
||||
android_binder_threadpool_init();
|
||||
#else
|
||||
// android_get_device_api_level was introduced in API 24, so we cannot use it
|
||||
// to detect the API level in API<24. For simplicity we just assume
|
||||
// libbinder_ndk.so on the system running this code would have API level < 35;
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"android/binder: is built with API<24, assuming this is not Android 15+\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* __ANDROID__ */
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Android Binder handler
|
||||
*
|
||||
* Copyright (c) 2025 Dmitrii Okunev
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_ANDROID_BINDER_H
|
||||
#define COMPAT_ANDROID_BINDER_H
|
||||
|
||||
/**
|
||||
* Initialize Android Binder thread pool.
|
||||
*/
|
||||
void android_binder_threadpool_init_if_required(void);
|
||||
|
||||
#endif // COMPAT_ANDROID_BINDER_H
|
||||
+1
-1
@@ -38,7 +38,7 @@ static int optind = 1;
|
||||
static int optopt;
|
||||
static char *optarg;
|
||||
|
||||
static int getopt(int argc, char *argv[], const char *opts)
|
||||
static int getopt(int argc, char *argv[], char *opts)
|
||||
{
|
||||
static int sp = 1;
|
||||
int c;
|
||||
|
||||
+6
-41
@@ -44,9 +44,8 @@
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/wchar_filename.h"
|
||||
|
||||
typedef struct w32pthread_t {
|
||||
typedef struct pthread_t {
|
||||
void *handle;
|
||||
void *(*func)(void* arg);
|
||||
void *arg;
|
||||
@@ -72,7 +71,7 @@ typedef CONDITION_VARIABLE pthread_cond_t;
|
||||
#define THREADFUNC_RETTYPE unsigned
|
||||
#endif
|
||||
|
||||
av_unused static THREADFUNC_RETTYPE
|
||||
static av_unused THREADFUNC_RETTYPE
|
||||
__stdcall attribute_align_arg win32thread_worker(void *arg)
|
||||
{
|
||||
pthread_t h = (pthread_t)arg;
|
||||
@@ -80,12 +79,12 @@ __stdcall attribute_align_arg win32thread_worker(void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
av_unused static int pthread_create(pthread_t *thread, const void *unused_attr,
|
||||
static av_unused int pthread_create(pthread_t *thread, const void *unused_attr,
|
||||
void *(*start_routine)(void*), void *arg)
|
||||
{
|
||||
pthread_t ret;
|
||||
|
||||
ret = (pthread_t)av_mallocz(sizeof(*ret));
|
||||
ret = av_mallocz(sizeof(*ret));
|
||||
if (!ret)
|
||||
return EAGAIN;
|
||||
|
||||
@@ -109,7 +108,7 @@ av_unused static int pthread_create(pthread_t *thread, const void *unused_attr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
av_unused static int pthread_join(pthread_t thread, void **value_ptr)
|
||||
static av_unused int pthread_join(pthread_t thread, void **value_ptr)
|
||||
{
|
||||
DWORD ret = WaitForSingleObject(thread->handle, INFINITE);
|
||||
if (ret != WAIT_OBJECT_0) {
|
||||
@@ -149,7 +148,7 @@ static inline int pthread_mutex_unlock(pthread_mutex_t *m)
|
||||
typedef INIT_ONCE pthread_once_t;
|
||||
#define PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT
|
||||
|
||||
av_unused static int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
|
||||
static av_unused int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
|
||||
{
|
||||
BOOL pending = FALSE;
|
||||
InitOnceBeginInitialize(once_control, 0, &pending, NULL);
|
||||
@@ -210,38 +209,4 @@ static inline int pthread_setcancelstate(int state, int *oldstate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int win32_thread_setname(const char *name)
|
||||
{
|
||||
#if !HAVE_UWP
|
||||
typedef HRESULT (WINAPI *SetThreadDescriptionFn)(HANDLE, PCWSTR);
|
||||
|
||||
// Although SetThreadDescription lives in kernel32.dll, on Windows Server 2016,
|
||||
// Windows 10 LTSB 2016 and Windows 10 version 1607, it was only available in
|
||||
// kernelbase.dll. So, load it from there for maximum coverage.
|
||||
HMODULE kernelbase = GetModuleHandleW(L"kernelbase.dll");
|
||||
if (!kernelbase)
|
||||
return AVERROR(ENOSYS);
|
||||
|
||||
SetThreadDescriptionFn pSetThreadDescription =
|
||||
(SetThreadDescriptionFn)GetProcAddress(kernelbase, "SetThreadDescription");
|
||||
if (!pSetThreadDescription)
|
||||
return AVERROR(ENOSYS);
|
||||
|
||||
wchar_t *wname;
|
||||
if (utf8towchar(name, &wname) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
HRESULT hr = pSetThreadDescription(GetCurrentThread(), wname);
|
||||
av_free(wname);
|
||||
return SUCCEEDED(hr) ? 0 : AVERROR(EINVAL);
|
||||
#else
|
||||
// UWP is not supported because we cannot use LoadLibrary/GetProcAddress to
|
||||
// detect the availability of the SetThreadDescription API. There is a small
|
||||
// gap in Windows builds 1507-1607 where it was not available. UWP allows
|
||||
// querying the availability of APIs with QueryOptionalDelayLoadedAPI, but it
|
||||
// requires /DELAYLOAD:kernel32.dll during linking, and we cannot enforce that.
|
||||
return AVERROR(ENOSYS);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* COMPAT_W32PTHREADS_H */
|
||||
|
||||
+5
-20
@@ -48,13 +48,7 @@ trap 'rm -f -- $libname' EXIT
|
||||
if [ -n "$AR" ]; then
|
||||
$AR rcs ${libname} $@ >/dev/null
|
||||
else
|
||||
machine_flag=""
|
||||
case "$LDFLAGS" in
|
||||
*"machine:arm64ec"*)
|
||||
machine_flag="-machine:arm64ec"
|
||||
;;
|
||||
esac
|
||||
lib.exe ${machine_flag} -out:${libname} $@ >/dev/null
|
||||
lib.exe -out:${libname} $@ >/dev/null
|
||||
fi
|
||||
if [ $? != 0 ]; then
|
||||
echo "Could not create temporary library." >&2
|
||||
@@ -112,21 +106,12 @@ if [ -n "$NM" ]; then
|
||||
grep -v : |
|
||||
grep -v ^$ |
|
||||
cut -d' ' -f3 |
|
||||
sed -e "s/^${prefix}//" -e "s/^#//" |
|
||||
grep -v '\$entry_thunk' |
|
||||
grep -v '\$exit_thunk')
|
||||
sed -e "s/^${prefix}//")
|
||||
else
|
||||
member=1
|
||||
case "$LDFLAGS" in
|
||||
*"machine:arm64ec"*)
|
||||
member=32
|
||||
;;
|
||||
esac
|
||||
dump=$(dumpbin.exe -linkermember:${member} ${libname} |
|
||||
sed -e '/public symbols/,$!d' -e '/^ \{1,\}Summary/,$d' -e 's/^[[:space:]]*[0-9A-Fa-f]\{1,\}[[:space:]]\{1,\}//' -e "s/^${prefix}//" -e 's/^#//' |
|
||||
dump=$(dumpbin.exe -linkermember:1 ${libname} |
|
||||
sed -e '/public symbols/,$!d' -e '/^ \{1,\}Summary/,$d' -e "s/ \{1,\}${prefix}/ /" -e 's/ \{1,\}/ /g' |
|
||||
tail -n +2 |
|
||||
grep -v '\$entry_thunk' |
|
||||
grep -v '\$exit_thunk')
|
||||
cut -d' ' -f3)
|
||||
fi
|
||||
|
||||
rm ${libname}
|
||||
|
||||
-136
@@ -2,142 +2,6 @@ The last version increases of all libraries were on 2025-03-28
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2026-03-07 - c23d56b173a - lavc 62.26.100 - codec_desc.h
|
||||
Add AV_CODEC_PROP_ENHANCEMENT.
|
||||
|
||||
2026-03-07 - f37cfb370f8 - lavc 62.25.100 - avcodec.h
|
||||
Deprecate AVCodecContext.intra_dc_precision.
|
||||
|
||||
2026-02-26 - 26d6ac56c10 - lsws 9.4.100 - swscale.h
|
||||
Add sws_test_hw_format().
|
||||
|
||||
2026-02-19 - ca011ee7547 - lavf 62.10.100 - avformat.h
|
||||
Add demuxer command API consisting of:
|
||||
- Add avformat_send_command().
|
||||
- Add avformat_receive_command_reply().
|
||||
- Add enum AVFormatCommandID.
|
||||
|
||||
2026-02-13 - 66766bb1c76 - lavu 60.25.100 - avassert.h
|
||||
Deprecate av_assert0_fpu() and av_assert2_fpu() without replacement.
|
||||
|
||||
2026-02-09 - f2b13f783ac - lavf 62.9.100 - avformat.h
|
||||
Add AVFormatContext.name.
|
||||
|
||||
2026-01-26 - 714152dd9a0 - lavu 60.24.100 - hwcontext_d3d11va.h
|
||||
Add BindFlags and MiscFlags to AVD3D11VADeviceContext
|
||||
|
||||
2026-01-04 - 0645c484537 - lavu 60.23.100 - cpu.h
|
||||
Add AV_CPU_FLAG_ARM_CRC.
|
||||
|
||||
2026-01-04 - e382772e4a1 - lavu 60.22.100 - cpu.h
|
||||
Add AV_CPU_FLAG_CLMUL.
|
||||
|
||||
2025-12-29 - a6e5fa3fbb5 - lavu 60.21.100 - iamf.h
|
||||
Add nb_demixing_matrix to AVIAMFLayer
|
||||
|
||||
2025-12-13 - b8ee68cffe - lavc 62.23.100 - codec_id.h
|
||||
Add AV_CODEC_ID_JPEGXS.
|
||||
|
||||
2025-12-12 - c9b5e145b71 - lavf 62.7.100 - avformat.h
|
||||
Add av_mime_codec_str
|
||||
|
||||
2025-12-08 - 212eb8413a6 - lavu 60.20.100 - hwcontext_vulkan.h
|
||||
Add av_vk_get_optional_instance_extensions().
|
||||
Add av_vk_get_optional_device_extensions().
|
||||
|
||||
2025-12-07 - 00caeba050d - lavc 62.22.101 - avcodec.h
|
||||
Add avcodec_receive_frame_flags().
|
||||
Add AV_CODEC_RECEIVE_FRAME_FLAG_SYNCHRONOUS.
|
||||
|
||||
2025-11-26 - 623669a02cd - lavfi 11.10.100 - buffersrc.h
|
||||
Add av_buffersrc_get_status().
|
||||
|
||||
2025-11-18 - 140b4f28c30 - lavu 60.19.100 - hwcontext_amf.h
|
||||
avutil/hwcontext_amf: add lock and unlock for AVAMFDeviceContext.
|
||||
|
||||
2025-11-16 - 643e2e10f98 - lavu 60.18.100 - cpu.h
|
||||
Deprecate AV_CPU_FLAG_FORCE without replacement.
|
||||
|
||||
2025-11-01 - 8a322c956f3 - lavc 62.19.100 - avcodec.h
|
||||
Schedule AVCodecParser and av_parser_init() to use enum AVCodecID
|
||||
for codec ids on the next major version bump.
|
||||
|
||||
2025-11-01 - e0b0ca81112 - lavc 62.18.100 - avcodec.h
|
||||
Deprecate AVCodecParser fields priv_data_size, parser_init,
|
||||
parser_parse, parser_close, and split with no replacement.
|
||||
|
||||
2025-10-30 - 6879c8ee5dd - lavc 62.17.100 - packet.h
|
||||
Add av_packet_side_data_from_frame() and av_packet_side_data_to_frame().
|
||||
|
||||
2025-10-28 - 71c7b9156bd - lavu 60.16.100 - pixfmt.h
|
||||
Add AVCOL_TRC_EXT_BASE, AVCOL_TRC_V_LOG,
|
||||
AVCOL_PRI_EXT_BASE and AVCOL_PRI_V_GAMUT.
|
||||
|
||||
2025-10-24 - 00e43619cd3 - lavu 60.14.100 - csp.h
|
||||
Add av_csp_approximate_eotf_gamma().
|
||||
|
||||
2025-08-xx - xxxxxxxxxx - lavf 62.6.100 - oggparsevorbis.h oggparseopus.h oggparseflac.h
|
||||
Drop header packets from secondary chained ogg/{flac, opus, vorbis} streams
|
||||
from demuxer output.
|
||||
|
||||
2025-09-08 - 1b97966199f - lavu 60.13.100 - hwcontext_d3d12va.h
|
||||
Add resource_flags and heap_flags to AVD3D12VADeviceContext
|
||||
Add heap_flags to AVD3D12VAFramesContext
|
||||
|
||||
2025-09-05 - 9458a6f8ec2 - lavf 62.5.100 - avformat.h
|
||||
Add AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION
|
||||
|
||||
2025-09-03 - c2ce3873859 - lavu 60.12.100 - hwcontext_d3d12va.h
|
||||
Add support for texture array mode AVD3D12VAFrame.subresource_index,
|
||||
AVD3D12VAFramesContext.texture_array
|
||||
Add enum AVD3D12VAFrameFlags to define the behaviours of frame allocation.
|
||||
Renanme AVD3D12VAFramesContext.flags to AVD3D12VAFramesContext.resource_flags.
|
||||
Add flags to AVD3D12VAFramesContext
|
||||
Add flags to AVD3D12VAFrame
|
||||
|
||||
2025-09-02 - de297ae2fca - lavfi 11.8.100 - buffersrc.h
|
||||
Add AVBufferSrcParameters.alpha_mode.
|
||||
|
||||
2025-09-02 - 0fbd90d78f8 - lavfi 11.7.100 - buffersink.h
|
||||
Add av_buffersink_get_alpha_mode().
|
||||
|
||||
2025-09-02 - ecebf9c6935 - lavc 62.15.100 - avcodec.h codec_par.h
|
||||
Add AVCodecContext.alpha_mode, AVCodecParameters.alpha_mode, and
|
||||
AV_CODEC_CONFIG_ALPHA_MODE.
|
||||
|
||||
2025-09-02 - eea99a77eda - lavfi 11.6.100 - avfilter.h
|
||||
Add AVFilterLink.alpha_mode.
|
||||
|
||||
2025-09-02 - 22929bd044c - lavu 60.11.100 - frame.h pixfmt.h
|
||||
Add AVAlphaMode, AVFrame.alpha_mode, av_alpha_mode_name() and
|
||||
av_alpha_mode_from_name().
|
||||
|
||||
2025-09-01 - ce0938da8cd - lsws 9.3.100 - swscale.h
|
||||
Add SWS_UNSTABLE flag.
|
||||
|
||||
2025-09-01 - 4ffd621523e - lavc 62.14.100 - packet.h
|
||||
Add AV_PKT_DATA_EXIF
|
||||
|
||||
2025-08-24 - 368b5e0ffc2 - lavc 62.13.101 - exif.h
|
||||
Add AV_EXIF_FLAG_RECURSIVE
|
||||
|
||||
2025-08-19 - ad77345a5d1..fe496b0308f - lavc 62.13.100 - exif.h
|
||||
Add:
|
||||
- enum AVTiffDataType, enum AVExifHeaderMode
|
||||
- struct AVExifMetadata, struct AVExifEntry
|
||||
- av_exif_get_tag_name, av_exif_get_tag_id,
|
||||
av_exif_set_entry, av_exif_get_entry,
|
||||
av_exif_remove_entry, av_exif_parse_buffer,
|
||||
av_exif_write, av_exif_free,
|
||||
av_exif_ifd_to_dict, av_exif_clone_ifd,
|
||||
av_exif_matrix_to_orientation,
|
||||
av_exif_orientation_to_matrix,
|
||||
|
||||
2025-08-19 - bb90b262d6d - lavu 60.10.100 - frame.h
|
||||
Add AV_FRAME_DATA_EXIF.
|
||||
|
||||
-------- 8< --------- FFmpeg 8.0 was cut here -------- 8< ---------
|
||||
|
||||
2025-07-29 - 1c85a3832af - lavc 62.10.100 - smpte_436m.h
|
||||
Add a new public header smpte_436m.h with API for
|
||||
manipulating AV_CODEC_ID_SMPTE_436M_ANC data.
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = 8.0.3
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -295,7 +295,7 @@ MARKDOWN_SUPPORT = YES
|
||||
|
||||
# When enabled doxygen tries to link words that correspond to documented
|
||||
# classes, or namespaces to their corresponding documentation. Such a link can
|
||||
# be prevented in individual cases by putting a % sign in front of the word
|
||||
# be prevented in individual cases by by putting a % sign in front of the word
|
||||
# or globally by setting AUTOLINK_SUPPORT to NO.
|
||||
# The default value is: YES.
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ HTMLPAGES = $(AVPROGS-yes:%=doc/%.html) $(AVPROGS-yes:%=doc/%-all.html) $(COMP
|
||||
doc/mailing-list-faq.html \
|
||||
doc/nut.html \
|
||||
doc/platform.html \
|
||||
doc/drawvg-reference.html \
|
||||
$(SRC_PATH)/doc/bootstrap.min.css \
|
||||
$(SRC_PATH)/doc/style.min.css \
|
||||
$(SRC_PATH)/doc/default.css \
|
||||
|
||||
@@ -913,8 +913,6 @@ Set expressions for PTS, DTS or both.
|
||||
Set expression for duration.
|
||||
@item time_base
|
||||
Set output time base.
|
||||
@item prescale
|
||||
Set whether to convert time fields to user-set output time base before evaluation of expressions. Defaults to 0.
|
||||
@end table
|
||||
|
||||
The expressions are evaluated through the eval API and can contain the following
|
||||
@@ -975,7 +973,7 @@ The next input PTS.
|
||||
The next input duration.
|
||||
|
||||
@item TB
|
||||
The timebase in which time fields are denominated. The user-set output timebase if prescale is enabled, else the input timebase.
|
||||
The timebase of stream packet belongs.
|
||||
|
||||
@item TB_OUT
|
||||
The output timebase.
|
||||
|
||||
@@ -913,14 +913,6 @@ Possible values:
|
||||
|
||||
@end table
|
||||
|
||||
@item alpha_mode @var{integer} (@emph{decoding/encoding,video})
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item premultiplied
|
||||
@item straight
|
||||
@end table
|
||||
|
||||
|
||||
@item log_level_offset @var{integer}
|
||||
Set the log level offset.
|
||||
|
||||
|
||||
+10
-9
@@ -119,6 +119,16 @@ The following options are supported by the libdav1d wrapper.
|
||||
|
||||
@table @option
|
||||
|
||||
@item framethreads
|
||||
Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
|
||||
This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the
|
||||
option @code{max_frame_delay} and the global option @code{threads} instead.
|
||||
|
||||
@item tilethreads
|
||||
Set amount of tile threads to use during decoding. The default value is 0 (autodetect).
|
||||
This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the
|
||||
global option @code{threads} instead.
|
||||
|
||||
@item max_frame_delay
|
||||
Set max amount of frames the decoder may buffer internally. The default value is 0
|
||||
(autodetect).
|
||||
@@ -346,15 +356,6 @@ value is 0 (disabled).
|
||||
|
||||
@end table
|
||||
|
||||
@section libmpeghdec
|
||||
|
||||
libmpeghdec decoder wrapper.
|
||||
|
||||
libmpeghdec allows libmpeghdec to decode the MPEG-H 3D audio codec.
|
||||
Requires the presence of the libmpeghdec headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libmpeghdec --enable-nonfree}.
|
||||
|
||||
@section libopencore-amrnb
|
||||
|
||||
libopencore-amrnb decoder wrapper.
|
||||
|
||||
+24
-23
@@ -281,11 +281,7 @@ This demuxer accepts the following option:
|
||||
@table @option
|
||||
|
||||
@item cenc_decryption_key
|
||||
Default 16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
|
||||
|
||||
@item cenc_decryption_keys
|
||||
Dictionary of 16-byte key ID => 16-byte key, both in hex, to decrypt files encrypted using ISO Common Encryption
|
||||
(CENC/AES-128 CTR; ISO/IEC 23001-7).
|
||||
16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
|
||||
|
||||
@end table
|
||||
|
||||
@@ -668,9 +664,30 @@ Select a glob wildcard pattern type.
|
||||
|
||||
The pattern is interpreted like a @code{glob()} pattern. This is only
|
||||
selectable if libavformat was compiled with globbing support.
|
||||
|
||||
@item glob_sequence @emph{(deprecated, will be removed)}
|
||||
Select a mixed glob wildcard/sequence pattern.
|
||||
|
||||
If your version of libavformat was compiled with globbing support, and
|
||||
the provided pattern contains at least one glob meta character among
|
||||
@code{%*?[]@{@}} that is preceded by an unescaped "%", the pattern is
|
||||
interpreted like a @code{glob()} pattern, otherwise it is interpreted
|
||||
like a sequence pattern.
|
||||
|
||||
All glob special characters @code{%*?[]@{@}} must be prefixed
|
||||
with "%". To escape a literal "%" you shall use "%%".
|
||||
|
||||
For example the pattern @code{foo-%*.jpeg} will match all the
|
||||
filenames prefixed by "foo-" and terminating with ".jpeg", and
|
||||
@code{foo-%?%?%?.jpeg} will match all the filenames prefixed with
|
||||
"foo-", followed by a sequence of three characters, and terminating
|
||||
with ".jpeg".
|
||||
|
||||
This pattern type is deprecated in favor of @var{glob} and
|
||||
@var{sequence}.
|
||||
@end table
|
||||
|
||||
Default value is @var{sequence}.
|
||||
Default value is @var{glob_sequence}.
|
||||
@item pixel_format
|
||||
Set the pixel format of the images to read. If not specified the pixel
|
||||
format is guessed from the first image file in the sequence.
|
||||
@@ -944,11 +961,7 @@ Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so shoul
|
||||
specify.
|
||||
|
||||
@item decryption_key
|
||||
Default 16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
|
||||
|
||||
@item decryption_keys
|
||||
Dictionary of 16-byte key ID => 16-byte key, both in hex, to decrypt files encrypted using ISO Common Encryption
|
||||
(CENC/AES-128 CTR; ISO/IEC 23001-7).
|
||||
16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
|
||||
|
||||
@item max_stts_delta
|
||||
Very high sample deltas written in a trak's stts box may occasionally be intended but usually they are written in
|
||||
@@ -1043,11 +1056,6 @@ Set input video frame rate. Default value is 25.
|
||||
@item pixel_format
|
||||
Set the input video pixel format. Default value is @code{yuv420p}.
|
||||
|
||||
@item stride
|
||||
Set frame line size in bytes, only required if there are extra padding.
|
||||
For multiplane formats, @option{stride} is a list of line size for each
|
||||
plane.
|
||||
|
||||
@item video_size
|
||||
Set the input video size. This value must be specified explicitly.
|
||||
@end table
|
||||
@@ -1060,13 +1068,6 @@ the command:
|
||||
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
|
||||
@end example
|
||||
|
||||
Read a rawvideo with @command{ffplay}, assuming a pixel format of @code{yuv420p},
|
||||
a video size of @code{1080x1920}, has 8 bytes of padding in each line of Y plane,
|
||||
and 4 bytes of padding with UV plane,
|
||||
@example
|
||||
ffplay -f rawvideo -pixel_format yuv420p -video_size 1080x1920 -stride 1088,544,544 input.raw
|
||||
@end example
|
||||
|
||||
@anchor{rcwtdec}
|
||||
@section rcwt
|
||||
|
||||
|
||||
+1
-6
@@ -45,7 +45,6 @@ maintained and developed.
|
||||
@end itemize
|
||||
|
||||
All proposed code changes should be submitted for review to
|
||||
@url{https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls, Forgejo} or
|
||||
@url{mailto:ffmpeg-devel@@ffmpeg.org, the development mailing list}, as
|
||||
described in more detail in the @ref{Submitting patches} chapter. The code
|
||||
should comply with the @ref{Development Policy} and follow the @ref{Coding Rules}.
|
||||
@@ -367,9 +366,6 @@ symbols. If in doubt, just avoid names starting with @code{_} altogether.
|
||||
@item
|
||||
Casts should be used only when necessary. Unneeded parentheses
|
||||
should also be avoided if they don't make the code easier to understand.
|
||||
@item
|
||||
Where applicable, SI units shall be used. For example timeouts should use seconds as the fundamental unit not micro seconds.
|
||||
That means a bare value like @samp{1.0} must mean 1 second, @samp{50m} means 50 milliseconds. For weight, gram shall be used.
|
||||
@end itemize
|
||||
|
||||
@anchor{Development Policy}
|
||||
@@ -726,8 +722,7 @@ and has no lrint()')
|
||||
Also please if you send several patches, send each patch as a separate mail,
|
||||
do not attach several unrelated patches to the same mail.
|
||||
|
||||
Patches should be posted to
|
||||
@uref{https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls, Forgejo} or the
|
||||
Patches should be posted to the
|
||||
@uref{https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel, ffmpeg-devel}
|
||||
mailing list. Use @code{git send-email} when possible since it will properly
|
||||
send patches without requiring extra care. If you cannot, then send patches
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+2
-134
@@ -1996,49 +1996,6 @@ by ":". See the SVT-AV1 encoder user guide for a list of accepted parameters.
|
||||
|
||||
@end table
|
||||
|
||||
@section libsvtjpegxs
|
||||
|
||||
SVT-JPEG-XS encoder wrapper.
|
||||
|
||||
Requires the presence of the SVT-JPEG-XS headers and library during configuration.
|
||||
You need to explicitly configure the build with @code{--enable-libsvtjpegxs}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item decomp_v
|
||||
Set vertical decomposition level
|
||||
@item decomp_h
|
||||
Set horizontal decomposition level
|
||||
|
||||
@item quantization
|
||||
Set the quantization algorithm.
|
||||
@table @samp
|
||||
@item deadzone
|
||||
@item uniform
|
||||
@end table
|
||||
|
||||
@item coding-signs
|
||||
Enable Signs handling strategy
|
||||
@table @samp
|
||||
@item disable
|
||||
@item fast
|
||||
@item full
|
||||
@end table
|
||||
|
||||
@item coding-sigf
|
||||
Enable Significance coding
|
||||
|
||||
@item coding-vpred
|
||||
Enable Vertical Prediction coding
|
||||
@table @samp
|
||||
@item disable
|
||||
@item no_residuals
|
||||
@item no_coeffs
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@section libjxl
|
||||
|
||||
libjxl JPEG XL encoder wrapper.
|
||||
@@ -3083,10 +3040,6 @@ Quantizer curve compression factor
|
||||
Normally, when forcing a I-frame type, the encoder can select any type
|
||||
of I-frame. This option forces it to choose an IDR-frame.
|
||||
|
||||
@item x265-stats
|
||||
Specify the file name for 2-pass stats. This is set automatically when using
|
||||
the @option{-passlogfile} option.
|
||||
|
||||
@item udu_sei @var{boolean}
|
||||
Import user data unregistered SEI if available into output. Default is 0 (off).
|
||||
|
||||
@@ -3460,97 +3413,12 @@ Maximum quantization parameter for B frame.
|
||||
|
||||
@section MediaFoundation
|
||||
|
||||
The following wrappers for encoders in the MediaFoundation framework are
|
||||
available:
|
||||
|
||||
@itemize
|
||||
@item h264_mf
|
||||
@item hevc_mf
|
||||
@item av1_mf
|
||||
@end itemize
|
||||
|
||||
These support both software and hardware encoding.
|
||||
|
||||
This provides wrappers to encoders (both audio and video) in the
|
||||
MediaFoundation framework. It can access both SW and HW encoders.
|
||||
Video encoders can take input in either of nv12 or yuv420p form
|
||||
(some encoders support both, some support only either - in practice,
|
||||
nv12 is the safer choice, especially among HW encoders).
|
||||
|
||||
Hardware-accelerated encoding requires D3D11, including hardware
|
||||
scaling capabilities through the scale_d3d11 filter.
|
||||
|
||||
To list all available options for the MediaFoundation encoders, use:
|
||||
@command{ffmpeg -h encoder=<encoder>} e.g. @command{ffmpeg -h encoder=h264_mf}
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item rate_control
|
||||
Select rate control mode. Available modes:
|
||||
|
||||
@table @samp
|
||||
@item default
|
||||
Default mode
|
||||
@item cbr
|
||||
CBR mode
|
||||
@item pc_vbr
|
||||
Peak constrained VBR mode
|
||||
@item u_vbr
|
||||
Unconstrained VBR mode
|
||||
@item quality
|
||||
Quality mode
|
||||
@item ld_vbr
|
||||
Low delay VBR mode (requires Windows 8+)
|
||||
@item g_vbr
|
||||
Global VBR mode (requires Windows 8+)
|
||||
@item gld_vbr
|
||||
Global low delay VBR mode (requires Windows 8+)
|
||||
@end table
|
||||
|
||||
@item scenario
|
||||
Select usage scenario. Available scenarios:
|
||||
|
||||
@table @samp
|
||||
@item default
|
||||
Default scenario
|
||||
@item display_remoting
|
||||
Display remoting scenario
|
||||
@item video_conference
|
||||
Video conference scenario
|
||||
@item archive
|
||||
Archive scenario
|
||||
@item live_streaming
|
||||
Live streaming scenario
|
||||
@item camera_record
|
||||
Camera record scenario
|
||||
@item display_remoting_with_feature_map
|
||||
Display remoting with feature map scenario
|
||||
@end table
|
||||
|
||||
@item quality
|
||||
Set encoding quality (0-100). -1 means default quality.
|
||||
|
||||
@item hw_encoding
|
||||
Force hardware encoding (0-1). Default is 0 (disabled).
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
Hardware encoding:
|
||||
@example
|
||||
ffmpeg -i input.mp4 -c:v h264_mf -hw_encoding 1 output.mp4
|
||||
@end example
|
||||
|
||||
Hardware-accelerated decoding with hardware encoding:
|
||||
@example
|
||||
ffmpeg -hwaccel d3d11va -i input.mp4 -c:v h264_mf -hw_encoding 1 output.mp4
|
||||
@end example
|
||||
|
||||
Hardware-accelerated decoding, HW scaling and encoding with quality setting:
|
||||
@example
|
||||
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -i input.mp4 -vf scale_d3d11=1920:1080 -c:v hevc_mf -hw_encoding 1 -quality 80 output.mp4
|
||||
@end example
|
||||
|
||||
@section Microsoft RLE
|
||||
|
||||
Microsoft RLE aka MSRLE encoder.
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
* file to be played with ffplay.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
* @example decode_filter_video.c
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 600 /* for usleep */
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -36,7 +38,6 @@
|
||||
#include <libavfilter/buffersrc.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/opt.h>
|
||||
#include <libavutil/time.h>
|
||||
|
||||
const char *filter_descr = "scale=78:24,transpose=cclock";
|
||||
/* other way:
|
||||
@@ -194,7 +195,7 @@ static void display_frame(const AVFrame *frame, AVRational time_base)
|
||||
delay = av_rescale_q(frame->pts - last_pts,
|
||||
time_base, AV_TIME_BASE_Q);
|
||||
if (delay > 0 && delay < 1000000)
|
||||
av_usleep(delay);
|
||||
usleep(delay);
|
||||
}
|
||||
last_pts = frame->pts;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ static int open_codec_context(AVFormatContext *fmt_ctx, enum AVMediaType type)
|
||||
ret = avcodec_parameters_to_context(dec_ctx, st->codecpar);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Failed to copy codec parameters to codec context\n");
|
||||
avcodec_free_context(&dec_ctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -215,10 +215,8 @@ int main(int argc, char *argv[])
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
video = input_ctx->streams[video_stream];
|
||||
if (avcodec_parameters_to_context(decoder_ctx, video->codecpar) < 0) {
|
||||
avcodec_free_context(&decoder_ctx);
|
||||
if (avcodec_parameters_to_context(decoder_ctx, video->codecpar) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
decoder_ctx->get_format = get_hw_format;
|
||||
|
||||
|
||||
@@ -351,10 +351,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
setting_number = (argc - 5) / 2;
|
||||
dynamic_setting = av_malloc(setting_number * sizeof(*dynamic_setting));
|
||||
if (!dynamic_setting) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
current_setting_number = 0;
|
||||
for (int i = 0; i < setting_number; i++) {
|
||||
dynamic_setting[i].frame_number = atoi(argv[i*2 + 5]);
|
||||
|
||||
+18
-38
@@ -42,60 +42,41 @@ targets and variables.
|
||||
|
||||
@chapter Using FATE from your FFmpeg source directory
|
||||
|
||||
If you want to run FATE on your machine, FFmpeg needs to be configured first.
|
||||
You may specify the location of samples during configuration by adding the
|
||||
argument @code{--samples=/path/to/fate-suite}.
|
||||
If you want to run FATE on your machine you need to have the samples
|
||||
in place. You can get the samples via the build target fate-rsync.
|
||||
Use this command from the top-level source directory:
|
||||
|
||||
@example
|
||||
./configure --enable-somelib --samples=/path/to/fate-suite
|
||||
make fate-rsync SAMPLES=fate-suite/
|
||||
make fate SAMPLES=fate-suite/
|
||||
@end example
|
||||
|
||||
After successful configuration, you need to add and/or update the samples in place:
|
||||
The above commands set the samples location by passing a makefile
|
||||
variable via command line. It is also possible to set the samples
|
||||
location at source configuration time by invoking configure with
|
||||
@option{--samples=<path to the samples directory>}. Afterwards you can
|
||||
invoke the makefile targets without setting the @var{SAMPLES} makefile
|
||||
variable. This is illustrated by the following commands:
|
||||
|
||||
@example
|
||||
make fate-rsync
|
||||
@end example
|
||||
|
||||
Now you are ready to run FATE:
|
||||
|
||||
@example
|
||||
make fate
|
||||
@end example
|
||||
|
||||
See @ref{makefile variables} for a list of arguments that can be added.
|
||||
|
||||
If you did not set the samples path during configuration, or if you wish to
|
||||
override it just before starting FATE, you can do so in one of three ways.
|
||||
|
||||
Either by setting a make variable:
|
||||
|
||||
@example
|
||||
make fate-rsync SAMPLES=/path/to/fate-suite
|
||||
make fate SAMPLES=/path/to/fate-suite
|
||||
@end example
|
||||
|
||||
or by setting an environment variable for the current session:
|
||||
|
||||
@example
|
||||
export FATE_SAMPLES=/path/to/fate-suite
|
||||
./configure --samples=fate-suite/
|
||||
make fate-rsync
|
||||
make fate
|
||||
@end example
|
||||
|
||||
or in isolation for a single command by prepending it:
|
||||
Yet another way to tell FATE about the location of the sample
|
||||
directory is by making sure the environment variable FATE_SAMPLES
|
||||
contains the path to your samples directory. This can be achieved
|
||||
by e.g. putting that variable in your shell profile or by setting
|
||||
it in your interactive session.
|
||||
|
||||
@example
|
||||
FATE_SAMPLES=/path/to/fate-suite make fate-rsync
|
||||
FATE_SAMPLES=/path/to/fate-suite make fate
|
||||
FATE_SAMPLES=fate-suite/ make fate
|
||||
@end example
|
||||
|
||||
This variable can also be set in your shell profile to make it permanent.
|
||||
|
||||
@float NOTE
|
||||
Do not put a '~' character in the samples path to indicate a home
|
||||
directory. Because of shell nuances, this will cause FATE to fail.
|
||||
Also, on Windows the path has to be relative to the build path
|
||||
which in this case is the FFmpeg source directory.
|
||||
@end float
|
||||
|
||||
Beware that some assertions are disabled by default, so mind setting
|
||||
@@ -239,7 +220,6 @@ Run the FATE test suite (requires the fate-suite dataset).
|
||||
@end table
|
||||
|
||||
@section Makefile variables
|
||||
@anchor{makefile variables}
|
||||
|
||||
@table @env
|
||||
@item V
|
||||
|
||||
@@ -6,7 +6,6 @@ workdir= # directory in which to do all the work
|
||||
#fate_recv="ssh -T fate@fate.ffmpeg.org" # command to submit report
|
||||
comment= # optional description
|
||||
build_only= # set to "yes" for a compile-only instance that skips tests
|
||||
skip_clean= # set to "yes" to preserve build/install directories
|
||||
ignore_tests=
|
||||
|
||||
# the following are optional and map to configure options
|
||||
@@ -14,7 +13,6 @@ arch=
|
||||
cpu=
|
||||
toolchain=
|
||||
cross_prefix=
|
||||
ar=
|
||||
as=
|
||||
cc=
|
||||
cxx=
|
||||
|
||||
@@ -1665,7 +1665,6 @@ Force video tag/fourcc. This is an alias for @code{-tag:v}.
|
||||
@item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
|
||||
@item -force_key_frames[:@var{stream_specifier}] expr:@var{expr} (@emph{output,per-stream})
|
||||
@item -force_key_frames[:@var{stream_specifier}] source (@emph{output,per-stream})
|
||||
@item -force_key_frames[:@var{stream_specifier}] scd_metadata (@emph{output,per-stream})
|
||||
|
||||
@var{force_key_frames} can take arguments of the following form:
|
||||
|
||||
@@ -1729,14 +1728,6 @@ the current frame being encoded is marked as a key frame in its source.
|
||||
In cases where this particular source frame has to be dropped,
|
||||
enforce the next available frame to become a key frame instead.
|
||||
|
||||
@item scd_metadata
|
||||
If the argument is @code{scd_metadata}, ffmpeg will force a key frame if
|
||||
the current frame contains a metadata entry with the key @code{lavfi.scd.time}.
|
||||
The metadata can be added by filters like @code{scdet} and @code{scdet_vulkan}.
|
||||
Avoid inserting filters that duplicate frames after @code{scdet}, as this can
|
||||
cause duplicate metadata for multiple frames and repeated insertion of key
|
||||
frames.
|
||||
|
||||
@end table
|
||||
|
||||
Note that forcing too many keyframes is very harmful for the lookahead
|
||||
|
||||
+4
-10
@@ -208,14 +208,6 @@ Vulkan configuration using a list of @var{key}=@var{value} pairs separated by
|
||||
Use HW accelerated decoding. Enable this option will enable vulkan renderer
|
||||
automatically.
|
||||
|
||||
@item -video_bg @var{pattern}
|
||||
Set the video background pattern used for transparent videos. For solid color
|
||||
patterns you can use the color name or color code as specified in the
|
||||
@ref{color syntax,,Color section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
You can also use the special @code{tiles} keyword for a checker board style
|
||||
pattern. This is also the default. The @code{none} pattern does rendering
|
||||
without alpha blending effectively ignoring alpha channel.
|
||||
|
||||
@end table
|
||||
|
||||
@section While playing
|
||||
@@ -259,13 +251,15 @@ Pause if the stream is not already paused, step to the next video
|
||||
frame, and pause.
|
||||
|
||||
@item left/right
|
||||
Seek backward/forward by 10 seconds or a custom interval if -seek_interval is set.
|
||||
Seek backward/forward 10 seconds.
|
||||
|
||||
@item down/up
|
||||
Seek backward/forward 1 minute.
|
||||
|
||||
@item page down/page up
|
||||
Seek to previous/next chapter or backward/forward 10 minutes if no chapters.
|
||||
Seek to the previous/next chapter.
|
||||
or if there are no chapters
|
||||
Seek backward/forward 10 minutes.
|
||||
|
||||
@item right mouse click
|
||||
Seek to percentage in file corresponding to fraction of width.
|
||||
|
||||
+1
-13
@@ -117,8 +117,7 @@ ffprobe -show_packets -select_streams v:1 INPUT
|
||||
@end example
|
||||
|
||||
@item -show_data
|
||||
Show payload data, as a hexadecimal and ASCII dump (other formats can be
|
||||
selected using @option{-data_dump_format}). Coupled with
|
||||
Show payload data, as a hexadecimal and ASCII dump. Coupled with
|
||||
@option{-show_packets}, it will dump the packets' data. Coupled with
|
||||
@option{-show_streams}, it will dump the codec extradata.
|
||||
|
||||
@@ -128,11 +127,6 @@ The dump is printed as the "data" field. It may contain newlines.
|
||||
Show a hash of payload data, for packets with @option{-show_packets} and for
|
||||
codec extradata with @option{-show_streams}.
|
||||
|
||||
@item -data_dump_format @var{format}
|
||||
Select a format used for the data dumps enabled with the @option{-show_data}
|
||||
option. The default is @code{xxd} which is a hexdump format compatible with the
|
||||
well-known @command{xxd} program. @code{base64} is also supported.
|
||||
|
||||
@item -show_error
|
||||
Show information about the error found when trying to probe the input.
|
||||
|
||||
@@ -374,12 +368,6 @@ Read @var{input_url}.
|
||||
Write output to @var{output_url}. If not specified, the output is sent
|
||||
to stdout.
|
||||
|
||||
@item -c:@var{media_specifier} @var{codec_name}
|
||||
@itemx -codec:@var{media_specifier} @var{codec_name}
|
||||
Force a specific decoder implementation for the stream identified by
|
||||
@var{media_specifier}, which can assume the values @code{a} (audio),
|
||||
@code{v} (video), @code{s} (subtitle), and @code{d} (data).
|
||||
|
||||
@end table
|
||||
@c man end
|
||||
|
||||
|
||||
@@ -276,7 +276,6 @@
|
||||
<xsd:attribute name="extradata" type="xsd:string" />
|
||||
<xsd:attribute name="extradata_size" type="xsd:int" />
|
||||
<xsd:attribute name="extradata_hash" type="xsd:string" />
|
||||
<xsd:attribute name="mime_codec_string" type="xsd:string" />
|
||||
|
||||
<!-- video attributes -->
|
||||
<xsd:attribute name="width" type="xsd:int"/>
|
||||
|
||||
@@ -98,7 +98,7 @@ These options are shared amongst the ff* tools.
|
||||
|
||||
@table @option
|
||||
|
||||
@item -L, -license
|
||||
@item -L
|
||||
Show license.
|
||||
|
||||
@item -h, -?, -help, --help [@var{arg}]
|
||||
|
||||
+40
-654
@@ -577,11 +577,6 @@ The cross fade is applied for specified duration near the end of first stream.
|
||||
The filter accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item inputs, n
|
||||
Specify the number of inputs to crossfade. When crossfading multiple inputs,
|
||||
each input will be concatenated and crossfaded in sequence, similar to the
|
||||
@ref{concat filter}. Default is 2.
|
||||
|
||||
@item nb_samples, ns
|
||||
Specify the number of samples for which the cross fade effect has to last.
|
||||
At the end of the cross fade effect the first input audio will be completely
|
||||
@@ -620,11 +615,6 @@ Cross fade from one input to another but without overlapping:
|
||||
@example
|
||||
ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
|
||||
@end example
|
||||
|
||||
Concatenate multiple inputs with cross fade between each:
|
||||
@example
|
||||
ffmpeg -i first.flac -i second.flac -i third.flac -filter_complex acrossfade=n=3 output.flac
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section acrossover
|
||||
@@ -2436,11 +2426,6 @@ Only used if option named @var{start} is set to @code{-1}.
|
||||
|
||||
Merge two or more audio streams into a single multi-channel stream.
|
||||
|
||||
All inputs must have the same sample rate, and format.
|
||||
|
||||
If inputs do not have the same duration, the output will stop with the
|
||||
shortest.
|
||||
|
||||
The filter accepts the following options:
|
||||
|
||||
@table @option
|
||||
@@ -2448,25 +2433,15 @@ The filter accepts the following options:
|
||||
@item inputs
|
||||
Set the number of inputs. Default is 2.
|
||||
|
||||
@item layout_mode
|
||||
@end table
|
||||
|
||||
This option controls how the output channel layout is determined and if the
|
||||
audio channels are reordered during merge.
|
||||
|
||||
@table @option
|
||||
|
||||
@item legacy
|
||||
|
||||
This is the mode how the filter behaved historically so it is the default.
|
||||
|
||||
If the channel layouts of the inputs are known and disjoint, and therefore
|
||||
compatible, the channel layout of the output will be set accordingly and the
|
||||
channels will be reordered as necessary. If the channel layouts of the inputs
|
||||
are not disjoint, some of them are unknown, or they are using special channel
|
||||
layouts, such as ambisonics, the output will have all the channels of the first
|
||||
input then all the channels of the second input, in that order, and the channel
|
||||
layout of the output will be the default value corresponding to the total
|
||||
number of channels.
|
||||
If the channel layouts of the inputs are disjoint, and therefore compatible,
|
||||
the channel layout of the output will be set accordingly and the channels
|
||||
will be reordered as necessary. If the channel layouts of the inputs are not
|
||||
disjoint, the output will have all the channels of the first input then all
|
||||
the channels of the second input, in that order, and the channel layout of
|
||||
the output will be the default value corresponding to the total number of
|
||||
channels.
|
||||
|
||||
For example, if the first input is in 2.1 (FL+FR+LF) and the second input
|
||||
is FC+BL+BR, then the output will be in 5.1, with the channels in the
|
||||
@@ -2477,22 +2452,10 @@ On the other hand, if both input are in stereo, the output channels will be
|
||||
in the default order: a1, a2, b1, b2, and the channel layout will be
|
||||
arbitrarily set to 4.0, which may or may not be the expected value.
|
||||
|
||||
@item reset
|
||||
This mode ignores the input channel layouts and does no channel reordering.
|
||||
The output will have all the channels of the first input, then all the channels
|
||||
of the second input, in that order, and so on.
|
||||
All inputs must have the same sample rate, and format.
|
||||
|
||||
The output channel layout will only specify the total channel count.
|
||||
|
||||
@item normal
|
||||
This mode keeps channel name and designation information from the input
|
||||
channels and does no channel reordering. The output will have all the channels
|
||||
of the first input, then all the channels of the second input, in that order,
|
||||
and so on.
|
||||
|
||||
@end table
|
||||
|
||||
@end table
|
||||
If inputs do not have the same duration, the output will stop with the
|
||||
shortest.
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@@ -4413,7 +4376,7 @@ Add a chorus effect to the audio.
|
||||
Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
|
||||
|
||||
Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
|
||||
constant, with chorus, it is varied using sinusoidal or triangular modulation.
|
||||
constant, with chorus, it is varied using using sinusoidal or triangular modulation.
|
||||
The modulation depth defines the range the modulated delay is played before or after
|
||||
the delay. Hence the delayed sound will sound slower or faster, that is the delayed
|
||||
sound tuned around the original one, like in a chorus where some vocals are slightly
|
||||
@@ -5914,11 +5877,6 @@ Options are true or false. Default is false.
|
||||
@item print_format
|
||||
Set print format for stats. Options are summary, json, or none.
|
||||
Default value is none.
|
||||
|
||||
@item stats_file
|
||||
Write stats to specified file. Format is controlled by @option{print_format},
|
||||
which must be set. Specify @code{-} to write to standard output.
|
||||
Default is unset.
|
||||
@end table
|
||||
|
||||
@section lowpass
|
||||
@@ -7773,12 +7731,6 @@ The destination format string; it could be "text" (only the transcribed text
|
||||
will be sent to the destination), "srt" (subtitle format) or "json".
|
||||
Default value: @code{"text"}
|
||||
|
||||
@item max_len
|
||||
Maximum segment length in characters. When set to a value greater than 0,
|
||||
transcription segments will be split to not exceed this length. This is useful
|
||||
for generating subtitles with shorter lines.
|
||||
Default value: @code{"0"}
|
||||
|
||||
@item vad_model
|
||||
Path to the VAD model file. If set, the filter will load an additional voice
|
||||
activity detection module (https://github.com/snakers4/silero-vad) that will be
|
||||
@@ -9928,7 +9880,7 @@ which indicates that this is a full range YUV source.
|
||||
@item alpha_mode
|
||||
Detect if the source contains color values above the alpha channel, which
|
||||
indicates that the alpha channel is independent (straight), rather than
|
||||
premultiplied. Also detects if the alpha plane is fully opaque or not.
|
||||
premultiplied.
|
||||
@item all
|
||||
Enable detection of all of the above properties. This is the default.
|
||||
@end table
|
||||
@@ -10451,18 +10403,6 @@ von Kries whitepoint adaptation
|
||||
identity whitepoint adaptation (i.e. no whitepoint adaptation)
|
||||
@end table
|
||||
|
||||
@item clipgamut
|
||||
Controls how to clip out-of-gamut colors that arise as a result of colorspace conversion.
|
||||
|
||||
The accepted values are:
|
||||
@table @samp
|
||||
@item none
|
||||
No clipping of out of gamut colors.
|
||||
|
||||
@item rgb
|
||||
Clips the RGB values to the [0, 1] range when building the gamma transfer LUTs.
|
||||
@end table
|
||||
|
||||
@item iall
|
||||
Override all input properties at once. Same accepted values as @ref{all}.
|
||||
|
||||
@@ -11652,105 +11592,6 @@ Median
|
||||
Do not actually modify frame. Useful when one only wants metadata.
|
||||
@end table
|
||||
|
||||
@section deinterlace_d3d12
|
||||
|
||||
Deinterlace the input video using D3D12 hardware-accelerated video processing.
|
||||
|
||||
This filter uses the DirectX 12 Video Processor to perform deinterlacing on
|
||||
GPU, supporting both simple bob and driver-defined advanced (motion-adaptive)
|
||||
algorithms. It requires the input to be in @code{d3d12} hardware pixel format.
|
||||
|
||||
The filter automatically queries the hardware for the required number of
|
||||
temporal reference frames (if needed) and manages a frame queue to supply them.
|
||||
|
||||
It accepts the following options:
|
||||
|
||||
@table @option
|
||||
|
||||
@item method
|
||||
The deinterlacing method. It accepts one of the following values:
|
||||
|
||||
@table @samp
|
||||
@item default
|
||||
Select the best deinterlacing method available on the hardware.
|
||||
If the driver supports @code{custom}, that method is used; otherwise
|
||||
falls back to @code{bob}. This is the default.
|
||||
|
||||
@item bob
|
||||
Bob deinterlacing. Each field is independently scaled to full
|
||||
frame height. Simple and fast, but may produce visible bob artifacts
|
||||
on moving content.
|
||||
|
||||
@item custom
|
||||
Driver-defined advanced deinterlacing. The exact algorithm is
|
||||
hardware-specific and typically employs motion-adaptive techniques
|
||||
with temporal reference frames for higher quality.
|
||||
@end table
|
||||
|
||||
The default value is @code{default}.
|
||||
|
||||
@item mode
|
||||
Specify the interlacing mode. It accepts one of the following values:
|
||||
|
||||
@table @samp
|
||||
@item frame
|
||||
Send one frame for each frame. The output frame rate equals the input
|
||||
frame rate. This is the default.
|
||||
|
||||
@item field
|
||||
Send one frame for each field. The output frame rate is double the
|
||||
input frame rate.
|
||||
@end table
|
||||
|
||||
The default value is @code{frame}.
|
||||
|
||||
@item deint
|
||||
Specify which frames to deinterlace. It accepts one of the following values:
|
||||
|
||||
@table @samp
|
||||
@item all
|
||||
Deinterlace all frames. This is the default.
|
||||
|
||||
@item interlaced
|
||||
Only deinterlace frames marked as interlaced; progressive frames are
|
||||
passed through unchanged.
|
||||
@end table
|
||||
|
||||
The default value is @code{all}.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
|
||||
@item
|
||||
Deinterlace an interlaced video using software decoding and the best
|
||||
available hardware deinterlacing method:
|
||||
@example
|
||||
ffmpeg -init_hw_device d3d12va=d3d12 -filter_hw_device d3d12 -i input.ts \
|
||||
-vf "format=nv12,hwupload,deinterlace_d3d12=method=default,hwdownload,format=nv12" \
|
||||
-c:v libx264 -crf 18 output.mp4
|
||||
@end example
|
||||
|
||||
@item
|
||||
Deinterlace at field rate (double the frame rate) using bob method with
|
||||
hardware decoding (full d3d12 pipeline):
|
||||
@example
|
||||
ffmpeg -hwaccel d3d12va -hwaccel_output_format d3d12 -i input.ts \
|
||||
-vf "deinterlace_d3d12=method=bob:mode=field" \
|
||||
-c:v h264_d3d12va output.mp4
|
||||
@end example
|
||||
|
||||
@item
|
||||
Deinterlace only interlaced frames, passing progressive frames through:
|
||||
@example
|
||||
ffmpeg -init_hw_device d3d12va=d3d12 -filter_hw_device d3d12 -i input.ts \
|
||||
-vf "format=nv12,hwupload,deinterlace_d3d12=deint=interlaced,hwdownload,format=nv12" \
|
||||
-c:v libx264 -crf 18 output.mp4
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
@section dejudder
|
||||
|
||||
Remove judder produced by partially interlaced telecined content.
|
||||
@@ -13186,80 +13027,6 @@ For more information about libfribidi, check:
|
||||
For more information about libharfbuzz, check:
|
||||
@url{https://github.com/harfbuzz/harfbuzz}.
|
||||
|
||||
@anchor{drawvg}
|
||||
@section drawvg
|
||||
|
||||
Draw vector graphics on top of video frames, by executing a script written in
|
||||
a custom language called VGS (@emph{Vector Graphics Script}).
|
||||
|
||||
The documentation for the language can be found in
|
||||
@ref{,,drawvg - Language Reference,drawvg-reference}. A version of this reference
|
||||
with rendered examples can be found at the
|
||||
@uref{https://ayosec.github.io/ffmpeg-drawvg/playground/docs/langref.html, author's site}.
|
||||
|
||||
Graphics are rendered using the @uref{https://cairographics.org/,cario 2D
|
||||
graphics library}.
|
||||
|
||||
To enable compilation of this filter, you need to configure FFmpeg with
|
||||
@code{--enable-cairo}.
|
||||
|
||||
@subsection Parameters
|
||||
|
||||
Either @code{script} or @code{file} must be set.
|
||||
|
||||
@table @option
|
||||
|
||||
@item s, script
|
||||
Script source to draw the graphics.
|
||||
|
||||
@item file
|
||||
Path of the file to load the script source.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Pixel Formats
|
||||
|
||||
Since Cairo only supports RGB images, if the input video is something else (like
|
||||
YUV 4:2:0), before executing the script the video is converted to a format
|
||||
compatible with Cairo. Then, you have to use either the @ref{format} filter,
|
||||
or the @code{-pix_fmt} option, to convert it to the expected format in the
|
||||
output.
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Draw the outline of an ellipse.
|
||||
|
||||
@example
|
||||
ffmpeg -i input.webm \
|
||||
-vf 'drawvg=ellipse (w/2) (h/2) (w/3) (h/3) stroke' \
|
||||
-pix_fmt yuv420p \
|
||||
output.webm
|
||||
@end example
|
||||
|
||||
@item
|
||||
|
||||
Draw a square rotating in the middle of the frame.
|
||||
|
||||
The script for drawvg is in a file @code{draw.vgs}:
|
||||
|
||||
@example
|
||||
translate (w/2) (h/2)
|
||||
rotate t
|
||||
rect -100 -100 200 200
|
||||
setcolor red@@0.5
|
||||
fill
|
||||
@end example
|
||||
|
||||
Then:
|
||||
|
||||
@example
|
||||
ffmpeg -i input.webm -vf 'drawvg=file=draw.vgs,format=yuv420p' output.webm
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
@section edgedetect
|
||||
|
||||
Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
|
||||
@@ -14540,10 +14307,6 @@ A '|'-separated list of color space names, such as
|
||||
A '|'-separated list of color range names, such as
|
||||
"color_ranges=tv|pc".
|
||||
|
||||
@item alpha_modes
|
||||
A '|'-separated list of color range names, such as
|
||||
"alpha_modes=straight|premultiplied".
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -16660,8 +16423,7 @@ will be performed.
|
||||
|
||||
@item force_original_aspect_ratio
|
||||
@item force_divisible_by
|
||||
Work the same as the identical @ref{scale} filter options. Note that
|
||||
@option{force_divisible_by} also works with @code{fit_sense=constraint}.
|
||||
Work the same as the identical @ref{scale} filter options.
|
||||
|
||||
@item reset_sar
|
||||
If enabled, output frames will always have a pixel aspect ratio of 1:1. If
|
||||
@@ -16671,7 +16433,7 @@ e.g. anamorphic video sources, are forwarded to the output pixel aspect ratio.
|
||||
@item normalize_sar
|
||||
Like @option{reset_sar}, but instead of stretching the video content to fill
|
||||
the new output aspect ratio, the content is instead padded or cropped as
|
||||
necessary. Mutually exclusive with @option{fit_mode}. Disabled by default.
|
||||
necessary.
|
||||
|
||||
@item pad_crop_ratio
|
||||
Specifies a ratio (between @code{0.0} and @code{1.0}) between padding and
|
||||
@@ -16681,56 +16443,6 @@ content with black borders, while a value of @code{1.0} always crops off parts
|
||||
of the content. Intermediate values are possible, leading to a mix of the two
|
||||
approaches.
|
||||
|
||||
@item fit_mode
|
||||
Specify the content fit strategy according to a list of predefined modes.
|
||||
Determines how the input image is to be placed inside the destination crop
|
||||
rectangle (as defined by @code{pos_x/y} and @code{pos_w/h}). The names and
|
||||
their implementations are taken from the CSS 'object-fit' property. Note that
|
||||
this option is mutually exclusive with @option{normalize_sar}. Defaults to
|
||||
@code{fill}. Valid values are:
|
||||
|
||||
@table @samp
|
||||
@item fill
|
||||
Stretch the input to the output rectangle, ignoring aspect ratio mismatches.
|
||||
Note that unless @option{reset_sar} is also enabled, the output will still
|
||||
have the correct pixel aspect ratio tagged.
|
||||
|
||||
@item contain
|
||||
Scale the input to fit inside the output, preserving aspect ratio by padding.
|
||||
Equivalent to @option{normalize_sar} with @option{pad_crop_ratio} set to
|
||||
@code{0.0}.
|
||||
|
||||
@item cover
|
||||
Scale the input to fill the output, preserving aspect ratio by cropping.
|
||||
Equivalent to @option{normalize_sar} with @option{pad_crop_ratio} set to
|
||||
@code{1.0}.
|
||||
|
||||
@item none, place
|
||||
Don't scale the input. The input will be placed inside the output rectangle at
|
||||
its natural size; which may result in additional padding or cropping.
|
||||
|
||||
@item scale_down
|
||||
Scale the input down as much as needed to fit inside the output. Equivalent
|
||||
to either @code{contain} or @code{none}, depending on whether the input is
|
||||
larger than the output or not.
|
||||
@end table
|
||||
|
||||
@item fit_sense
|
||||
When @option{fit_mode} is in use, this option controls how the fit strategy
|
||||
is applied against the specified output resolution. Mutually exclusive with
|
||||
@option{force_original_aspect_ratio}. Valid values are:
|
||||
|
||||
@table @samp
|
||||
@item target
|
||||
The computed output resolution is taken as the exact size of the output frame.
|
||||
This is the default behavior.
|
||||
|
||||
@item constraint
|
||||
The computed output resolution is a size reference against which the fit mode
|
||||
is applied, enlarging or decreasing the true frame size as needed to fit the
|
||||
content.
|
||||
@end table
|
||||
|
||||
@item fillcolor
|
||||
Set the color used to fill the output area not covered by the output image, for
|
||||
example as a result of @option{normalize_sar}. For the general syntax of this
|
||||
@@ -16799,17 +16511,12 @@ exist.
|
||||
@item color_primaries
|
||||
@item color_trc
|
||||
@item range
|
||||
@item chroma_location
|
||||
Configure the colorspace that output frames will be delivered in. The default
|
||||
value of @code{auto} outputs frames in the same format as the input frames,
|
||||
leading to no change. For any other value, conversion will be performed.
|
||||
|
||||
See the @ref{setparams} filter for a list of possible values.
|
||||
|
||||
@item alpha_mode
|
||||
Choose the desired output alpha mode, when the output format has an alpha
|
||||
channel. See the @ref{setparams} filter for a list of possible values.
|
||||
|
||||
@item apply_filmgrain
|
||||
Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip
|
||||
it from the output. Enabled by default.
|
||||
@@ -16947,8 +16654,6 @@ No deinterlacing, weave fields together into a single frame. This is the default
|
||||
Naive bob deinterlacing, simply repeat each field line twice.
|
||||
@item yadif
|
||||
Yet another deinterlacing filter. See the @ref{yadif} filter for more details.
|
||||
@item bwdif
|
||||
Bob weaver deinterlacing filter. See the @ref{bwdif} filter for more details.
|
||||
@end table
|
||||
|
||||
@item skip_spatial_check
|
||||
@@ -17007,11 +16712,6 @@ coefficients for RGB inputs.
|
||||
@item gamma
|
||||
Gamma adjustment, between @code{0.0} and @code{16.0}. Defaults to @code{1.0}.
|
||||
|
||||
@item temperature
|
||||
Color temperature adjustment. Lower values make the output warmer/redder,
|
||||
down to @code{1667}, while higher values make the output cooler/bluer, up to
|
||||
@code{25000}. Defaults to @code{6500} (neutral white).
|
||||
|
||||
@item cones
|
||||
Cone model to use for color blindness simulation. Accepts any combination of
|
||||
@code{l}, @code{m} and @code{s}. Here are some examples:
|
||||
@@ -17050,13 +16750,13 @@ process. Enabled by default.
|
||||
@item smoothing_period
|
||||
Peak detection smoothing period, between @code{0.0} and @code{1000.0}. Higher
|
||||
values result in peak detection becoming less responsive to changes in the
|
||||
input. Defaults to @code{20.0}.
|
||||
input. Defaults to @code{100.0}.
|
||||
|
||||
@item scene_threshold_low
|
||||
@item scene_threshold_high
|
||||
Lower and upper thresholds for scene change detection. Expressed in a
|
||||
logarithmic scale between @code{0.0} and @code{100.0}. Default to @code{1.0}
|
||||
and @code{3.0}, respectively. Setting either to a negative value disables
|
||||
logarithmic scale between @code{0.0} and @code{100.0}. Default to @code{5.5}
|
||||
and @code{10.0}, respectively. Setting either to a negative value disables
|
||||
this functionality.
|
||||
|
||||
@item percentile
|
||||
@@ -18206,35 +17906,6 @@ Macroblock size. Default @code{16}.
|
||||
Search parameter. Default @code{7}.
|
||||
@end table
|
||||
|
||||
@section mestimate_d3d12
|
||||
|
||||
Estimate and export motion vectors using D3D12 hardware-accelerated motion estimation.
|
||||
This filter uses GPU hardware motion estimation capabilities available in
|
||||
DirectX 12 Video APIs to achieve significant performance improvements
|
||||
over the software-based @code{mestimate} filter.
|
||||
|
||||
Motion vectors are stored in frame side data to be used by other filters.
|
||||
|
||||
This filter requires the input to be in @code{d3d12} hardware pixel format.
|
||||
The filter uses quarter-pixel precision for motion vector estimation.
|
||||
|
||||
This filter accepts the following options:
|
||||
@table @option
|
||||
@item mb_size
|
||||
Macroblock size. Only @code{8} and @code{16} are supported.
|
||||
Default @code{16}.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
Estimate motion vectors using D3D12 hardware acceleration with 16x16 blocks,
|
||||
and visualize them:
|
||||
@example
|
||||
ffmpeg -hwaccel d3d12va -hwaccel_output_format d3d12 -i input.mp4 \
|
||||
-vf mestimate_d3d12=mb_size=16,hwdownload,format=nv12,codecview=mv=pf \
|
||||
-c:v libx264 -preset fast -b:v 5M output.mp4
|
||||
@end example
|
||||
|
||||
@section midequalizer
|
||||
|
||||
Apply Midway Image Equalization effect using two video streams.
|
||||
@@ -18897,69 +18568,6 @@ normalize=blackpt=red:whitept=cyan
|
||||
|
||||
Pass the video source unchanged to the output.
|
||||
|
||||
@section ocio
|
||||
OpenColorIO library filter
|
||||
|
||||
This filter allows you to do color management using the OpenColorIO library.
|
||||
See https://opencolorio.org/ for more details. To Enable
|
||||
compilation of this filter, you need to configure FFmpeg with @code{--enable-libopencolorio}.
|
||||
|
||||
It accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item config
|
||||
By default the filter will use the OCIO config defined by the OCIO environment variable, but this parameter allows you to explicitly specify its location.
|
||||
If you are getting started, you can use config=ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1 which specifies one of the built in defaults.
|
||||
|
||||
@item input
|
||||
Set the input colorspace.
|
||||
|
||||
@item output
|
||||
Set the output colorspace.
|
||||
|
||||
@item display
|
||||
Set the display colorspace, used in combination with view.
|
||||
|
||||
@item view
|
||||
Set the view colorspace, used in combination with display.
|
||||
|
||||
@item inverse
|
||||
When used in combination with display and view, this inverts the transform, so going from a display/view to the "input colorspace".
|
||||
|
||||
@item filetransform
|
||||
Allows you to specify an external file-transform to use instead of the OCIO config file. This is useful for applying a single transform without needing a full OCIO config file.
|
||||
|
||||
@item format
|
||||
Allow you to specify the output pix_fmt of the OCIO filter. This *has* to be a RGB colorspace, so you really are limited to rgb24, rgba, rgb48, rgba48, gbrp10, gbrp12, gbrpf32le, gbrapf32le, for most encoding we would recommend rgb48
|
||||
|
||||
@item context_params
|
||||
Allow you to specify additional context parameters for the OCIO filter. This is a list of key=value pairs, separated by colons.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
Map from ACEScg to ACEScct, this assumes the OCIO file is defined with the OCIO environment variable.
|
||||
@example
|
||||
input=ACEScg:output=ACEScct:format=rgb48
|
||||
@end example
|
||||
|
||||
Map from ACEScg to a sRGB display using the "ACES 1.0 - SDR Video" view transform, this assumes the OCIO file is defined with the OCIO environment variable. Note you will need to wrap the argument in quotes to ensure that the spaces are interpreted correctly.
|
||||
@example
|
||||
input=ACEScg:display=sRGB - Display:view=ACES 1.0 - SDR Video:format=rgb48
|
||||
@end example
|
||||
|
||||
|
||||
As above but using the OCIO file studio-config-v1.0.0_aces-v1.3_ocio-v2.1_ns.ocio rather than the OCIO environment variable.
|
||||
@example
|
||||
config=studio-config-v1.0.0_aces-v1.3_ocio-v2.1_ns.ocio:input=ACEScg:display=sRGB - Display:view=ACES 1.0 - SDR Video:format=rgb48
|
||||
@end example
|
||||
|
||||
If you are converting to YCrCb you still will want to set the color matrix for the conversion. This is a good example of combining the two.
|
||||
@example
|
||||
ffmpeg -y -i SOURCEFRAMES.%05d.exr -c:v libx265 -vf "ocio=input=ACEScg:output=ACEScct:format=rgb48,scale=in_color_matrix=bt709:out_color_matrix=bt709,format=yuv444p10" OUTPUTFILE.mov
|
||||
@end example
|
||||
|
||||
@section ocr
|
||||
Optical Character Recognition
|
||||
|
||||
@@ -19257,8 +18865,7 @@ See @ref{framesync}.
|
||||
|
||||
@item alpha
|
||||
Set format of alpha of the overlaid video, it can be @var{straight} or
|
||||
@var{premultiplied}, or @var{auto} to choose the alpha mode automatically.
|
||||
Default is @var{auto}.
|
||||
@var{premultiplied}. Default is @var{straight}.
|
||||
@end table
|
||||
|
||||
The @option{x}, and @option{y} expressions can contain the following
|
||||
@@ -20019,20 +19626,6 @@ By default value 0xf, all planes will be processed.
|
||||
Do not require 2nd input for processing, instead use alpha plane from input stream.
|
||||
@end table
|
||||
|
||||
@section premultiply_dynamic
|
||||
Dynamically premultiply or unpremultiply the input video stream as needed,
|
||||
to match the requirements of the downstream filter graph. This is roughly
|
||||
equivalent to either @code{premultiply:inplace=yes} or
|
||||
@code{unpremultiply:inplace=yes}, or otherwise a noop.
|
||||
|
||||
The filter accepts the following option:
|
||||
|
||||
@table @option
|
||||
@item planes
|
||||
Set which planes will be processed, unprocessed planes will be copied.
|
||||
By default value 0xf, all planes will be processed.
|
||||
@end table
|
||||
|
||||
@section prewitt
|
||||
Apply prewitt operator to input video stream.
|
||||
|
||||
@@ -20186,7 +19779,7 @@ Specifies which version of the stats file format to use. Details of
|
||||
each format are written below.
|
||||
Default value is 1.
|
||||
|
||||
@item output_max
|
||||
@item stats_add_max
|
||||
Determines whether the max value is output to the stats log.
|
||||
Default value is 0.
|
||||
Requires stats_version >= 2. If this is set and stats_version < 2,
|
||||
@@ -22124,19 +21717,6 @@ Keep the same chroma location (default).
|
||||
@item bottomleft
|
||||
@item bottom
|
||||
@end table
|
||||
|
||||
@item alpha_mode
|
||||
Set the alpha moda.
|
||||
Available values are:
|
||||
|
||||
@table @samp
|
||||
@item auto
|
||||
Keep the same alpha mode (default).
|
||||
|
||||
@item unspecified, unknown
|
||||
@item premultiplied
|
||||
@item straight
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@section shear
|
||||
@@ -26734,7 +26314,6 @@ Possible values are:
|
||||
@item bicubic
|
||||
@item spline16
|
||||
@item spline36
|
||||
@item spline64
|
||||
@item lanczos
|
||||
@end table
|
||||
|
||||
@@ -27324,6 +26903,12 @@ frame-consumer that exhausts the limited decoder frame pool.
|
||||
If set to 1, frames are passed through as-is if they match the desired output
|
||||
parameters. This is the default behaviour.
|
||||
|
||||
@item use_filters
|
||||
If set to 1, filter with a generic weight LUT instead of using fixed-function
|
||||
shader kernels. May be faster or slower depending on the hardware. A value
|
||||
of @code{auto} (the default) enables this automatically when required for
|
||||
correct anti-aliasing when downscaling.
|
||||
|
||||
@item param
|
||||
Algorithm-Specific parameter.
|
||||
|
||||
@@ -29255,10 +28840,6 @@ Allocates linear images. Does not apply to decoding.
|
||||
|
||||
@item disable_multiplane
|
||||
Disables multiplane images. Does not apply to decoding.
|
||||
|
||||
@item avoid_host_import
|
||||
Avoids the use of dynamic host memory imports, in favor of a regular memcpy()
|
||||
into a previously mapped buffer.
|
||||
@end table
|
||||
|
||||
@item -filter_hw_device @var{name}
|
||||
@@ -29485,7 +29066,7 @@ The filter accepts the following options.
|
||||
|
||||
@table @option
|
||||
@item s
|
||||
Set denoising strength for all components. Default is 1.0. Must be in range [0.0, 100.0].
|
||||
Set denoising strength for all components. Default is 1.0. Must be in range [1.0, 100.0].
|
||||
|
||||
@item p
|
||||
Set patch size for all planes. Default is 7. Must be odd number in range [0, 99].
|
||||
@@ -29494,16 +29075,17 @@ Set patch size for all planes. Default is 7. Must be odd number in range [0, 99]
|
||||
Set research size. Default is 15. Must be odd number in range [0, 99].
|
||||
|
||||
@item t
|
||||
Set parallelism. Default is 8. Must be a number in the range [1, 64].
|
||||
Larger values will use more VRAM but may not result in greater speed.
|
||||
The optimal value is hardware and input dependent.
|
||||
Set parallelism. Default is 36. Must be a number in the range [1, 168].
|
||||
Larger values may speed up processing, at the cost of more VRAM.
|
||||
Lower values will slow it down, reducing VRAM usage.
|
||||
Only supported on GPUs with atomic float operations (RDNA3+, Ampere+).
|
||||
|
||||
@item s0
|
||||
@item s1
|
||||
@item s2
|
||||
@item s3
|
||||
Set denoising strength for a specific component. Default is @var{1.0}, equal to @option{s}.
|
||||
Must be in range [0.0, 100.0]. 0.0 disables denoising in that component.
|
||||
Set denoising strength for a specific component. Default is @var{1}, equal to @option{s}.
|
||||
Must be odd number in range [1, 100].
|
||||
|
||||
@item p0
|
||||
@item p1
|
||||
@@ -29713,11 +29295,6 @@ A string representing the color range of the buffered video frames.
|
||||
It may be a number corresponding to a color range, or a color range
|
||||
name.
|
||||
|
||||
@item alpha_mode
|
||||
A string representing the alpha mode of the buffered video frames.
|
||||
It may be a number corresponding to an alpha mode, or an alpha mode
|
||||
name.
|
||||
|
||||
@item pixel_aspect, sar
|
||||
The sample (pixel) aspect ratio of the input video.
|
||||
|
||||
@@ -30017,165 +29594,6 @@ ddagrab=video_size=800x600:offset_x=100:offset_y=100
|
||||
@end example
|
||||
|
||||
|
||||
@section gfxcapture
|
||||
|
||||
Capture windows or monitors using Windows.Graphics.Capture API.
|
||||
|
||||
This source provides low overhead capture of application windows or entire monitors.
|
||||
The filter outputs hardware frames in @code{d3d11} format; use @code{hwdownload,format=}
|
||||
if system memory frames are required.
|
||||
|
||||
The window to be captured can be selected via regular expressions on its title,
|
||||
class name or backing executable name, by explicit native handles, or by monitor
|
||||
index or explicit native handle. A window must match all provided expressions to be
|
||||
selected. The first matching window will be picked, in whatever order Windows
|
||||
returns them.
|
||||
|
||||
Explicit handles (@option{hwnd}, @option{hmonitor}) override pattern or index
|
||||
based selection. If neither handles nor a monitor index are given, the first
|
||||
window matching the provided regular expressions is captured.
|
||||
|
||||
This source does NOT hold a stable FPS. It returns frames at whatever rate the compositor
|
||||
provides them, only capped by the @option{max_framerate}.
|
||||
If you need a stable rate, you need to add an fps filter to drop/duplicate frames as needed.
|
||||
|
||||
If the capture source disappears mid-capture (window closed, monitor disconnected), the filter will return EOF.
|
||||
|
||||
This source accepts the following options:
|
||||
@table @option
|
||||
@item window_title
|
||||
ECMAScript regular expression matched against the window title. Supports a
|
||||
PCRE style @code{(?i)} prefix for case-insensitive matching.
|
||||
|
||||
@item window_class
|
||||
As @option{window_title}, but matched against the window class name.
|
||||
|
||||
@item window_exe
|
||||
As @option{window_title}, but matched against the executable file name of the
|
||||
window's process.
|
||||
|
||||
@item monitor_idx
|
||||
Zero-based index of the monitor to capture.
|
||||
|
||||
Can also be set to @code{window} to capture the monitor the selected window
|
||||
is displayed on at filter initialization time.
|
||||
|
||||
@item hwnd
|
||||
Explicit native window handle (HWND).
|
||||
|
||||
@item hmonitor
|
||||
Explicit native monitor handle (HMONITOR).
|
||||
|
||||
@item capture_cursor
|
||||
Capture the mouse cursor. Enabled by default.
|
||||
|
||||
@item capture_border
|
||||
Capture the full area of the window, including its window decorarions/border.
|
||||
Disabled by default.
|
||||
|
||||
@item display_border
|
||||
Draw a yellow highlight border around the captured window. Disabled by default.
|
||||
|
||||
@item max_framerate
|
||||
Maximum capture frame rate. Accepts a video rate (e.g. @code{30}, @code{60/1},
|
||||
@code{24000/1001}). The default is @code{60} FPS.
|
||||
The actual rate is the rate at which the compositor renders the window/monitor,
|
||||
capped by this option.
|
||||
|
||||
@item width
|
||||
Force the output canvas width. If zero (default) the initial captured source
|
||||
width is used. If a negative number is provided, the width will be rounded
|
||||
down to the next multiple of that number.
|
||||
|
||||
See @option{resize_mode}.
|
||||
|
||||
@item height
|
||||
Force the output canvas height. If zero (default) the initial captured source
|
||||
height is used. If a negative number is provided, the height will be rounded
|
||||
down to the next multiple of that number.
|
||||
|
||||
See @option{resize_mode}.
|
||||
|
||||
@item crop_left
|
||||
Crop this many pixels from the left side of the captured frames.
|
||||
|
||||
@item crop_top
|
||||
Crop this many pixels from the left side of the captured frames.
|
||||
|
||||
@item crop_right
|
||||
Crop this many pixels from the left side of the captured frames.
|
||||
|
||||
@item crop_bottom
|
||||
Crop this many pixels from the left side of the captured frames.
|
||||
|
||||
@item premultiplied
|
||||
If set to 1, return frames with premultiplied alpha. Default is 0 (straight
|
||||
alpha).
|
||||
|
||||
@item resize_mode
|
||||
Defines how the captured content is fitted into the output canvas size.
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item crop
|
||||
Crop (or pad with black) to the canvas size. (default)
|
||||
@item scale
|
||||
Scale the source to fill the canvas, potentially altering aspect ratio.
|
||||
@item scale_aspect
|
||||
Scale the source to fit inside the canvas while preserving aspect ratio.
|
||||
Remaining area is filled with black.
|
||||
@end table
|
||||
|
||||
@item scale_mode
|
||||
Scaling algorithm used when resizing is required.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item point
|
||||
Nearest neighbour (pixelated) scaling.
|
||||
@item bilinear
|
||||
Bilinear filtering. (default)
|
||||
@item bicubic
|
||||
Bicubic filtering. Potentially more blurry, but fewer scaling artifacts depending on contents.
|
||||
@end table
|
||||
|
||||
@item output_fmt
|
||||
Desired output pixel format inside the D3D11 hardware frames.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item bgra
|
||||
@item 8bit
|
||||
8 bit BGRA output (default)
|
||||
@item x2bgr10
|
||||
@item 10bit
|
||||
10 bit BGR output
|
||||
@item rgbaf16
|
||||
@item 16bit
|
||||
16bit float RGBA output
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@itemize
|
||||
@item Capture a window by title (case-insensitive) at a maximum of 60 fps:
|
||||
@example
|
||||
ffmpeg -filter_complex gfxcapture=window_title='(?i)My Application':max_framerate=60,hwdownload,format=bgra,format=yuv420p -c:v libx264 -crf 15 capture.mp4
|
||||
@end example
|
||||
|
||||
@item Capture monitor 1 at native refresh, 10bit color depth, scale to 1920x1080 preserving aspect:
|
||||
@example
|
||||
ffmpeg -filter_complex gfxcapture=monitor_idx=1:width=1920:height=1080:resize_mode=scale_aspect:output_fmt=10bit -c:v hevc_nvenc -cq 15 capture.mp4
|
||||
@end example
|
||||
|
||||
@item Capture a window by executable name, draw border, force point scaling, fixed 60 fps:
|
||||
@example
|
||||
ffmpeg -filter_complex gfxcapture=window_exe='^firefox.exe$':display_border=1:scale_mode=point,fps=60 -rc qvbr -qvbr_quality_level 15 -c:v h264_amf capture.mp4
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
@section gradients
|
||||
Generate several gradients.
|
||||
|
||||
@@ -31580,7 +30998,6 @@ bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@anchor{concat filter}
|
||||
@section concat
|
||||
|
||||
Concatenate audio and video streams, joining them together one after the
|
||||
@@ -32527,9 +31944,9 @@ This filter accepts the following options:
|
||||
The expression which is evaluated for each frame to construct its timestamp.
|
||||
|
||||
@item strip_fps (@emph{video only})
|
||||
Boolean option which determines if the original framerate and frame duration
|
||||
metadata is unset. If set to true, be advised that a sane frame rate should be
|
||||
explicitly specified if output is sent to a constant frame rate muxer.
|
||||
Boolean option which determines if the original framerate metadata is unset.
|
||||
If set to true, be advised that a sane frame rate should be explicitly
|
||||
specified if output is sent to a constant frame rate muxer.
|
||||
Default is @code{false}.
|
||||
|
||||
@end table
|
||||
@@ -34021,41 +33438,10 @@ data in the frame.
|
||||
@end table
|
||||
|
||||
@item type
|
||||
Set side data type used with all modes. Must be set for @code{select} mode.
|
||||
|
||||
Possible values are:
|
||||
|
||||
@table @samp
|
||||
@item PANSCAN
|
||||
@item A53_CC
|
||||
@item STEREO3D
|
||||
@item MATRIXENCODING
|
||||
@item DOWNMIX_INFO
|
||||
@item REPLAYGAIN
|
||||
@item DISPLAYMATRIX
|
||||
@item AFD
|
||||
@item MOTION_VECTORS
|
||||
@item SKIP_SAMPLES
|
||||
@item AUDIO_SERVICE_TYPE
|
||||
@item MASTERING_DISPLAY_METADATA
|
||||
@item GOP_TIMECODE
|
||||
@item SPHERICAL
|
||||
@item CONTENT_LIGHT_LEVEL
|
||||
@item ICC_PROFILE
|
||||
@item S12M_TIMECODE
|
||||
@item DYNAMIC_HDR_PLUS
|
||||
@item REGIONS_OF_INTEREST
|
||||
@item VIDEO_ENC_PARAMS
|
||||
@item SEI_UNREGISTERED
|
||||
@item FILM_GRAIN_PARAMS
|
||||
@item DETECTION_BOUNDING_BOXES
|
||||
@item DETECTION_BBOXES
|
||||
@item DOVI_RPU_BUFFER
|
||||
@item DOVI_METADATA
|
||||
@item DYNAMIC_HDR_VIVID
|
||||
@item AMBIENT_VIEWING_ENVIRONMENT
|
||||
@item VIDEO_HINT
|
||||
@end table
|
||||
Set side data type used with all modes. Must be set for @code{select} mode. For
|
||||
the list of frame side data types, refer to the @code{AVFrameSideDataType} enum
|
||||
in @file{libavutil/frame.h}. For example, to choose
|
||||
@code{AV_FRAME_DATA_PANSCAN} side data, you must specify @code{PANSCAN}.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@@ -250,14 +250,6 @@ Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
|
||||
instructions for installing the library.
|
||||
Then pass @code{--enable-libfdk-aac} to configure to enable it.
|
||||
|
||||
@subsection Fraunhofer MPEG-H 3D Audio decoder library
|
||||
|
||||
FFmpeg can make use of the Fraunhofer MPEG-H decoder library for MPEG-H 3DA decoding.
|
||||
|
||||
Go to @url{https://github.com/Fraunhofer-IIS/mpeghdec} and follow the
|
||||
instructions for installing the library.
|
||||
Then pass @code{--enable-libmpeghdec --enable-nonfree} to configure to enable it.
|
||||
|
||||
@subsection LC3 library
|
||||
|
||||
FFmpeg can make use of the Google LC3 library for LC3 decoding & encoding.
|
||||
@@ -303,15 +295,6 @@ Go to @url{https://gitlab.com/AOMediaCodec/SVT-AV1/} and follow the instructions
|
||||
for installing the library. Then pass @code{--enable-libsvtav1} to configure to
|
||||
enable it.
|
||||
|
||||
@section SVT-JPEG-XS
|
||||
|
||||
FFmpeg can make use of the Scalable Video Technology for JPEG-XS library for JPEG-XS
|
||||
decoding and encoding.
|
||||
|
||||
Go to @url{https://github.com/OpenVisualCloud/SVT-JPEG-XS} and follow the instructions
|
||||
for installing the library. Then pass @code{--enable-libsvtjpegxs} to configure to
|
||||
enable it.
|
||||
|
||||
@section TwoLAME
|
||||
|
||||
FFmpeg can make use of the TwoLAME library for MP2 encoding.
|
||||
@@ -828,8 +811,6 @@ following image formats are supported:
|
||||
@tab Progressive JPEG is not supported.
|
||||
@item JPEG 2000 @tab X @tab X
|
||||
@item JPEG-LS @tab X @tab X
|
||||
@item JPEG-XS @tab E @tab E
|
||||
@tab Supported through external library libsvtjpegxs
|
||||
@item LJPEG @tab X @tab
|
||||
@tab Lossless JPEG
|
||||
@item Media 100 @tab @tab X
|
||||
@@ -1363,8 +1344,6 @@ following image formats are supported:
|
||||
@item MP3 (MPEG audio layer 3) @tab E @tab IX
|
||||
@tab encoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
|
||||
@item MPEG-4 Audio Lossless Coding (ALS) @tab @tab X
|
||||
@item MPEG-H 3D Audio @tab @tab E
|
||||
@tab decoding supported through external library libmpeghdec
|
||||
@item MobiClip FastAudio @tab @tab X
|
||||
@item Musepack SV7 @tab @tab X
|
||||
@item Musepack SV8 @tab @tab X
|
||||
|
||||
@@ -4,4 +4,3 @@ ffmpeg-formats mono ./ffmpeg-formats.html
|
||||
ffmpeg-resampler mono ./ffmpeg-resampler.html
|
||||
ffmpeg-scaler mono ./ffmpeg-scaler.html
|
||||
ffmpeg-utils mono ./ffmpeg-utils.html
|
||||
drawvg-reference mono ./drawvg-reference.html
|
||||
|
||||
@@ -24,26 +24,6 @@ Our Main server is hosted at telepoint.bg
|
||||
for more details see: https://www.ffmpeg.org/#thanks_sponsor_0001
|
||||
Nothing runs on our main server directly, instead several VMs run on it.
|
||||
|
||||
Main server security:
|
||||
---------------------
|
||||
Telepoint is one of the largest Bulgarian DC providers with multiple sibling companies offering
|
||||
Internet, SDH, DWDM, peering exchange and hosting. They have multiple DC buildings in Sofia and
|
||||
FFmpeg is hosted in XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. The building is locked down and accessible
|
||||
only with personal key cards that are registered. People who are granted access to a rack have
|
||||
to go through the access center with their ID to get logged and receive a one-time access card
|
||||
that can open the service elevator and only the hall where the destination rack is. All racks are
|
||||
locked, once access is granted to someone they will get a key for the rack for the duration of
|
||||
their visit. There are security cameras everywhere and personnel in the access center 24/7. As for
|
||||
software security, our BIOS and IPMI are protected by password and encrypted connection, and
|
||||
the machines can be accessed only by root administrators with their SSH keys. They're using
|
||||
a Ubuntu LTS release and get regular security updates as they are released. We also get
|
||||
notified by email for various security related events (e.g. failed sudo).
|
||||
|
||||
Side note - Telepoint provides the rack and physical infrastructure, their sibling company called
|
||||
Telehouse which is an ISP provides the connectivity, they are directly connected with
|
||||
over 15 tier-1 service providers and have over 100 PoPs (points of presence)
|
||||
in various cities. You can see more on www.telehouse.bg
|
||||
|
||||
|
||||
ffmpeg.org VM:
|
||||
--------------
|
||||
|
||||
+1
-13
@@ -3953,24 +3953,12 @@ Default value is 5000.
|
||||
|
||||
@item pkt_size @var{integer}
|
||||
Set the maximum size, in bytes, of RTP packets that send out.
|
||||
Default value is 1200.
|
||||
Default value is 1500.
|
||||
|
||||
@item ts_buffer_size @var{integer}
|
||||
Set the buffer size, in bytes, of underlying protocol.
|
||||
Default value is -1(auto). The UDP auto selects a reasonable value.
|
||||
|
||||
@item whip_flags @var{flags}
|
||||
Possible values:
|
||||
|
||||
@table @samp
|
||||
@item dtls_active
|
||||
The muxer will try to set dtls active role and send the first client hello.
|
||||
@end table
|
||||
|
||||
@item rtp_history @var{integer}
|
||||
Set the number of RTP history items to store.
|
||||
Default value is 512.
|
||||
|
||||
@item authorization @var{string}
|
||||
The optional Bearer token for WHIP Authorization.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ What to optimize:
|
||||
-----------------
|
||||
If you plan to do non-x86 architecture specific optimizations (SIMD normally),
|
||||
then take a look in the x86/ directory, as most important functions are
|
||||
already optimized for x86.
|
||||
already optimized for MMX.
|
||||
|
||||
If you want to do x86 optimizations then you can either try to fine-tune the
|
||||
stuff in the x86 directory or find some other functions in the C source to
|
||||
|
||||
@@ -330,20 +330,4 @@ and for a build with shared libraries
|
||||
./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||
@end example
|
||||
|
||||
@section ARM64EC
|
||||
|
||||
FFmpeg does not intend to support the Windows ARM64EC build configuration;
|
||||
patches for changing the individual libraries for the purposes of ARM64EC will
|
||||
not be accepted.
|
||||
|
||||
It may still be possible to build FFmpeg in this build configuration;
|
||||
such a build may seem to work to some extent. Such a build may have some
|
||||
amounts of ABI inconsistencies though - which we are not willing to fix.
|
||||
|
||||
(Changing aarch64 assembly code to strictly support ARM64EC would require
|
||||
ifdeffing/changing essentially all such assembly code, and would be a
|
||||
huge maintenance burden. Additionally, changing the library ABI
|
||||
surfaces to fix ABI inconsistencies could require extensive and intrusive
|
||||
changes.)
|
||||
|
||||
@bye
|
||||
|
||||
+46
-184
@@ -352,17 +352,6 @@ means auto (seekable for normal files, non-seekable for named pipes).
|
||||
Many demuxers handle seekable and non-seekable resources differently,
|
||||
overriding this might speed up opening certain files at the cost of losing some
|
||||
features (e.g. accurate seeking).
|
||||
|
||||
@item pkt_size
|
||||
Set the maximum packet size used for file I/O. A smaller value may reduce
|
||||
memory usage. A higher value may increase throughput especially with networked
|
||||
filesystems.
|
||||
|
||||
For reading, if explicitly set, it overrides the default internal buffer size
|
||||
(32 KB) and limits the maximum amount of data read per operation.
|
||||
|
||||
For writing, this sets the size of each write operation. The default is 256 KB
|
||||
for regular files, 32 KB otherwise.
|
||||
@end table
|
||||
|
||||
@section ftp
|
||||
@@ -417,6 +406,26 @@ Gophers protocol.
|
||||
|
||||
The Gopher protocol with TLS encapsulation.
|
||||
|
||||
@section hls
|
||||
|
||||
Read Apple HTTP Live Streaming compliant segmented stream as
|
||||
a uniform one. The M3U8 playlists describing the segments can be
|
||||
remote HTTP resources or local files, accessed using the standard
|
||||
file protocol.
|
||||
The nested protocol is declared by specifying
|
||||
"+@var{proto}" after the hls URI scheme name, where @var{proto}
|
||||
is either "file" or "http".
|
||||
|
||||
@example
|
||||
hls+http://host/path/to/remote/resource.m3u8
|
||||
hls+file://path/to/local/resource.m3u8
|
||||
@end example
|
||||
|
||||
Using this protocol is discouraged - the hls demuxer should work
|
||||
just as well (if not, please report the issues) and is more complete.
|
||||
To use the hls demuxer instead, simply use the direct URLs to the
|
||||
m3u8 files.
|
||||
|
||||
@section http
|
||||
|
||||
HTTP (Hyper Text Transfer Protocol).
|
||||
@@ -453,28 +462,6 @@ Set the Referer header. Include 'Referer: URL' header in HTTP request.
|
||||
@item multiple_requests
|
||||
Use persistent connections if set to 1, default is 0.
|
||||
|
||||
@item request_size
|
||||
Limit the size of requests made. This is useful for some pathological servers
|
||||
that throttle unbounded range requests, as well as when expecting to seek
|
||||
frequently. Disabled (set to 0) by default.
|
||||
|
||||
Note that if enabling this option, it's strongly recommended to also enable
|
||||
the @option{multiple_requests} option, as well as setting
|
||||
@option{short_seek_size} to the same value or higher. Doing so allows FFmpeg
|
||||
to reuse a single HTTP connection wherever possible.
|
||||
|
||||
@item initial_request_size
|
||||
Limit the size of initial requests. Similar to @code{request_size}, but only
|
||||
used during initial format parsing. Useful for formats like MXF or MOV that
|
||||
require frequent seeks during header parsing. Lasts until the demuxer makes a
|
||||
read request larger than this size (without a seek in between), after which
|
||||
the implementation will continue using requests as usual. Disabled (set to 0)
|
||||
by default.
|
||||
|
||||
Note that if enabling this option, it's strongly recommended to also enable
|
||||
the @option{multiple_requests} option, as well as setting
|
||||
@option{short_seek_size} to the same value or higher.
|
||||
|
||||
@item post_data
|
||||
Set custom HTTP post data.
|
||||
|
||||
@@ -999,11 +986,6 @@ Set TCP_NODELAY to disable Nagle's algorithm. Default value is 0.
|
||||
|
||||
@emph{Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY.}
|
||||
|
||||
@item tcp_keepalive=@var{1|0}
|
||||
Enable the TCP keepalive mechanism to detect dead peers and help maintain long-lived idle connections. Default value is 0.
|
||||
|
||||
Only the basic keepalive option (SO_KEEPALIVE) can be enabled or disabled. Platform-specific tuning parameters such as TCP_KEEPIDLE, TCP_KEEPINTVL, or TCP_KEEPCNT are not configurable and will use the operating system's default values.
|
||||
|
||||
@end table
|
||||
|
||||
For example to read with @command{ffplay} a multimedia resource named
|
||||
@@ -1175,13 +1157,9 @@ rtp://@var{hostname}[:@var{port}][?@var{options}]
|
||||
@var{port} specifies the RTP port to use.
|
||||
|
||||
@var{options} contains a list of &-separated options of the form
|
||||
@var{key}=@var{val}. Standard percent-encoding (and using the plus sign for
|
||||
space) can be used to escape keys and values.
|
||||
@var{key}=@var{val}.
|
||||
|
||||
Options can also can be specified via command line options (or in code via
|
||||
@code{AVOption}s).
|
||||
|
||||
The list of supported options follows.
|
||||
The following URL options are supported:
|
||||
|
||||
@table @option
|
||||
|
||||
@@ -1191,12 +1169,10 @@ Set the TTL (Time-To-Live) value (for multicast only).
|
||||
@item rtcpport=@var{n}
|
||||
Set the remote RTCP port to @var{n}.
|
||||
|
||||
@item localport, local_rtpport, localrtpport=@var{n}
|
||||
@item localrtpport=@var{n}
|
||||
Set the local RTP port to @var{n}.
|
||||
|
||||
Using the localport option name is deprecated and should not be used.
|
||||
|
||||
@item local_rtcpport, localrtcpport=@var{n}'
|
||||
@item localrtcpport=@var{n}'
|
||||
Set the local RTCP port to @var{n}.
|
||||
|
||||
@item pkt_size=@var{n}
|
||||
@@ -1219,6 +1195,12 @@ List disallowed (blocked) source IP addresses.
|
||||
Send packets to the source address of the latest received packet (if
|
||||
set to 1) or to a default remote address (if set to 0).
|
||||
|
||||
@item localport=@var{n}
|
||||
Set the local RTP port to @var{n}.
|
||||
|
||||
This is a deprecated option. Instead, @option{localrtpport} should be
|
||||
used.
|
||||
|
||||
@item localaddr=@var{addr}
|
||||
Local IP address of a network interface used for sending packets or joining
|
||||
multicast groups.
|
||||
@@ -1552,15 +1534,7 @@ The accepted URL syntax is:
|
||||
sctp://@var{host}:@var{port}[?@var{options}]
|
||||
@end example
|
||||
|
||||
@var{options} contains a list of &-separated options of the form
|
||||
@var{key}=@var{val}. Standard percent-encoding (and using the plus sign for
|
||||
space) can be used to escape keys and values.
|
||||
|
||||
Options can also can be specified via command line options (or in code via
|
||||
@code{AVOption}s).
|
||||
|
||||
The list of supported options follows.
|
||||
|
||||
The protocol accepts the following options:
|
||||
@table @option
|
||||
@item listen
|
||||
If set to any value, listen for an incoming connection. Outgoing connection is done by default.
|
||||
@@ -1579,13 +1553,18 @@ srt://@var{hostname}:@var{port}[?@var{options}]
|
||||
@end example
|
||||
|
||||
@var{options} contains a list of &-separated options of the form
|
||||
@var{key}=@var{val}. Standard percent-encoding (and using the plus sign for
|
||||
space) can be used to escape keys and values.
|
||||
@var{key}=@var{val}.
|
||||
|
||||
Options can also can be specified via command line options (or in code via
|
||||
@code{AVOption}s).
|
||||
or
|
||||
|
||||
The list of supported options follows.
|
||||
@example
|
||||
@var{options} srt://@var{hostname}:@var{port}
|
||||
@end example
|
||||
|
||||
@var{options} contains a list of '-@var{key} @var{val}'
|
||||
options.
|
||||
|
||||
This protocol accepts the following options.
|
||||
|
||||
@table @option
|
||||
@item connect_timeout=@var{milliseconds}
|
||||
@@ -1938,11 +1917,7 @@ tcp://@var{hostname}:@var{port}[?@var{options}]
|
||||
@end example
|
||||
|
||||
@var{options} contains a list of &-separated options of the form
|
||||
@var{key}=@var{val}. Standard percent-encoding (and using the plus sign for
|
||||
space) can be used to escape keys and values.
|
||||
|
||||
Options can also can be specified via command line options (or in code via
|
||||
@code{AVOption}s).
|
||||
@var{key}=@var{val}.
|
||||
|
||||
The list of supported options follows.
|
||||
|
||||
@@ -1997,14 +1972,8 @@ The required syntax for a TLS/SSL url is:
|
||||
tls://@var{hostname}:@var{port}[?@var{options}]
|
||||
@end example
|
||||
|
||||
@var{options} contains a list of &-separated options of the form
|
||||
@var{key}=@var{val}. Standard percent-encoding (and using the plus sign for
|
||||
space) can be used to escape keys and values.
|
||||
|
||||
Options can also can be specified via command line options (or in code via
|
||||
@code{AVOption}s).
|
||||
|
||||
The list of supported options follows.
|
||||
The following parameters can be set via command line options
|
||||
(or in code via @code{AVOption}s):
|
||||
|
||||
@table @option
|
||||
|
||||
@@ -2015,7 +1984,7 @@ need to be specified for verification to work, but not all libraries and
|
||||
setups have defaults built in.
|
||||
The file must be in OpenSSL PEM format.
|
||||
|
||||
@item tls_verify, verify=@var{1|0}
|
||||
@item tls_verify=@var{1|0}
|
||||
If enabled, try to verify the peer that we are communicating with.
|
||||
Note, if using OpenSSL, this currently only makes sure that the
|
||||
peer certificate is signed by one of the root certificates in the CA
|
||||
@@ -2059,94 +2028,6 @@ To play back a stream from the TLS/SSL server using @command{ffplay}:
|
||||
ffplay tls://@var{hostname}:@var{port}
|
||||
@end example
|
||||
|
||||
@section dtls
|
||||
|
||||
Datagram Transport Layer Security (DTLS)
|
||||
|
||||
The required syntax for a DTLS URL is:
|
||||
@example
|
||||
dtls://@var{hostname}:@var{port}[?@var{options}]
|
||||
@end example
|
||||
|
||||
@var{options} contains a list of &-separated options of the form
|
||||
@var{key}=@var{val}. Standard percent-encoding (and using the plus sign for
|
||||
space) can be used to escape keys and values.
|
||||
|
||||
Options can also can be specified via command line options (or in code via
|
||||
@code{AVOption}s).
|
||||
|
||||
DTLS shares most options with TLS, but operates over UDP instead of TCP.
|
||||
|
||||
The list of supported options follows.
|
||||
|
||||
@table @option
|
||||
|
||||
@item ca_file, cafile=@var{filename}
|
||||
A file containing certificate authority (CA) root certificates to treat
|
||||
as trusted. If the linked TLS library contains a default this might not
|
||||
need to be specified for verification to work, but not all libraries and
|
||||
setups have defaults built in.
|
||||
The file must be in OpenSSL PEM format.
|
||||
|
||||
@item tls_verify, verify=@var{1|0}
|
||||
If enabled, try to verify the peer that we are communicating with.
|
||||
Note, if using OpenSSL, this currently only makes sure that the
|
||||
peer certificate is signed by one of the root certificates in the CA
|
||||
database, but it does not validate that the certificate actually
|
||||
matches the host name we are trying to connect to.
|
||||
|
||||
This is disabled by default since it requires a CA database to be
|
||||
provided by the caller in many cases.
|
||||
|
||||
@item cert_file, cert=@var{filename}
|
||||
A file containing a certificate to use in the handshake with the peer.
|
||||
(When operating as server, in listen mode, this is more often required
|
||||
by the peer, while client certificates only are mandated in certain
|
||||
setups.)
|
||||
|
||||
@item key_file, key=@var{filename}
|
||||
A file containing the private key for the certificate.
|
||||
|
||||
@item cert_pem=@var{string}
|
||||
Certificate PEM string
|
||||
|
||||
@item key_pem=@var{string}
|
||||
Private key PEM string
|
||||
|
||||
@item listen=@var{1|0}
|
||||
If enabled, listen for connections on the provided port, and assume
|
||||
the server role in the handshake instead of the client role.
|
||||
|
||||
@item mtu=@var{size}
|
||||
Set the Maximum Transmission Unit (MTU) for DTLS packets.
|
||||
|
||||
@item use_srtp=@var{1|0}
|
||||
Enable the use_srtp DTLS extension.
|
||||
This is used in WebRTC applications to establish SRTP encryption keys
|
||||
through the DTLS handshake. Default is disabled.
|
||||
|
||||
@item external_sock=@var{1|0}
|
||||
Use an external socket instead of creating a new one.
|
||||
This option only makes sense to pass when interacting with the code via
|
||||
API, enabling this from CLI will cause immediate failure.
|
||||
Default is disabled.
|
||||
|
||||
@end table
|
||||
|
||||
Example command lines:
|
||||
|
||||
To create a DTLS server:
|
||||
|
||||
@example
|
||||
ffmpeg -listen 1 -i dtls://@var{hostname}:@var{port} @var{output}
|
||||
@end example
|
||||
|
||||
To create a DTLS client and send data to server:
|
||||
|
||||
@example
|
||||
ffmpeg -i @var{input} -f @var{format} dtls://@var{hostname}:@var{port}
|
||||
@end example
|
||||
|
||||
@section udp
|
||||
|
||||
User Datagram Protocol.
|
||||
@@ -2156,12 +2037,7 @@ The required syntax for an UDP URL is:
|
||||
udp://@var{hostname}:@var{port}[?@var{options}]
|
||||
@end example
|
||||
|
||||
@var{options} contains a list of &-separated options of the form
|
||||
@var{key}=@var{val}. Standard percent-encoding (and using the plus sign for
|
||||
space) can be used to escape keys and values.
|
||||
|
||||
Options can also can be specified via command line options (or in code via
|
||||
@code{AVOption}s).
|
||||
@var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
|
||||
|
||||
In case threading is enabled on the system, a circular buffer is used
|
||||
to store the incoming data, which allows one to reduce loss of data due to
|
||||
@@ -2200,9 +2076,6 @@ Explicitly allow or disallow reusing UDP sockets.
|
||||
@item ttl=@var{ttl}
|
||||
Set the time to live value (for multicast only).
|
||||
|
||||
@item dscp=@var{dscp}
|
||||
Set the 6-bit DSCP field for outgoing packets.
|
||||
|
||||
@item connect=@var{1|0}
|
||||
Initialize the UDP socket with @code{connect()}. In this case, the
|
||||
destination address can't be changed with ff_udp_set_remote_url later.
|
||||
@@ -2284,17 +2157,6 @@ The following parameters can be set via command line options
|
||||
Timeout in ms.
|
||||
@item listen
|
||||
Create the Unix socket in listening mode.
|
||||
@item type
|
||||
Select socket type.
|
||||
@table @samp
|
||||
@item stream Corresponds to SOCK_STREAM (reliable stream-oriented)
|
||||
@item datagram Corresponds to SOCK_DGRAM (unreliable packet-oriented)
|
||||
@item seqpacket Corresponds to SOCK_SEQPACKET (reliable packet-oriented)
|
||||
@end table
|
||||
@item pkt_size
|
||||
Maximum packet size for packet-oriented sockets (SOCK_DGRAM and
|
||||
SOCK_SEQPACKET). If greater than zero, this value is used as
|
||||
@code{max_packet_size}. Ignored for SOCK_STREAM. Default is @code{0}.
|
||||
@end table
|
||||
|
||||
@section zmq
|
||||
|
||||
@@ -68,10 +68,6 @@ Select full chroma input.
|
||||
|
||||
@item bitexact
|
||||
Enable bitexact output.
|
||||
|
||||
@item unstable
|
||||
Allow the use of experimental new code. May subtly affect the output or even
|
||||
produce wrong results. For testing only.
|
||||
@end table
|
||||
|
||||
@item srcw @var{(API only)}
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ This overall approach has a considerable number of benefits:
|
||||
multiple levels of complicated, interwoven format handling code that is
|
||||
legacy swscale.
|
||||
|
||||
2. Because most of the brains lives inside the powerful optimizer, we get
|
||||
2. Because most of the brains lives inside the the powerful optimizer, we get
|
||||
fast paths "for free" for any suitable format conversion, rather than having
|
||||
to enumerate them one by one. SIMD code itself can be written in a very
|
||||
general way and does need to be tied to specific pixel formats - subsequent
|
||||
|
||||
+1
-2
@@ -5,8 +5,6 @@ OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
|
||||
OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes)
|
||||
OBJS-$(HAVE_SVE) += $(SVE-OBJS) $(SVE-OBJS-yes)
|
||||
OBJS-$(HAVE_SVE2) += $(SVE2-OBJS) $(SVE2-OBJS-yes)
|
||||
OBJS-$(HAVE_SME) += $(SME-OBJS) $(SME-OBJS-yes)
|
||||
OBJS-$(HAVE_SME2) += $(SME2-OBJS) $(SME2-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes)
|
||||
OBJS-$(HAVE_MIPSDSP) += $(MIPSDSP-OBJS) $(MIPSDSP-OBJS-yes)
|
||||
@@ -25,4 +23,5 @@ OBJS-$(HAVE_RV_ZVBB) += $(RVVB-OBJS) $(RVVB-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_SIMD128) += $(SIMD128-OBJS) $(SIMD128-OBJS-yes)
|
||||
|
||||
OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
|
||||
OBJS-$(HAVE_X86ASM) += $(X86ASM-OBJS) $(X86ASM-OBJS-yes)
|
||||
|
||||
+35
-49
@@ -12,23 +12,14 @@ endif
|
||||
|
||||
ifndef SUBDIR
|
||||
|
||||
LINK = $(LD) $(1)
|
||||
|
||||
ifeq ($(LD),$(CC))
|
||||
ifneq ($(CXX),)
|
||||
LDXX := $(CXX)
|
||||
LINK = $(if $(filter -lstdc++,$(1)),$(LDXX) $(filter-out -lstdc++,$(1)),$(LD) $(1))
|
||||
endif
|
||||
endif
|
||||
|
||||
BIN2CEXE = ffbuild/bin2c$(HOSTEXESUF)
|
||||
BIN2C = $(BIN2CEXE)
|
||||
|
||||
ifndef V
|
||||
Q = @
|
||||
ECHO = printf "$(1)\t%s\n" $(2)
|
||||
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD LDXX STRIP CP WINDRES GLSLC NVCC BIN2C METALCC METALLIB
|
||||
SILENT = DEPCC DEPCXX DEPHOSTCC DEPAS DEPX86ASM RANLIB RM
|
||||
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD STRIP CP WINDRES NVCC BIN2C METALCC METALLIB
|
||||
SILENT = DEPCC DEPHOSTCC DEPAS DEPX86ASM RANLIB RM
|
||||
|
||||
MSG = $@
|
||||
M = @$(call ECHO,$(TAG),$@);
|
||||
@@ -51,7 +42,7 @@ OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
|
||||
ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
|
||||
# Use PREPEND here so that later (target-dependent) additions to CPPFLAGS
|
||||
# end up in CXXFLAGS.
|
||||
$(call PREPEND,CXXFLAGS, CPPFLAGS)
|
||||
$(call PREPEND,CXXFLAGS, CPPFLAGS CFLAGS)
|
||||
X86ASMFLAGS += $(IFLAGS:%=%/) -I$(<D)/ -Pconfig.asm
|
||||
|
||||
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
|
||||
@@ -68,7 +59,6 @@ COMPILE_S = $(call COMPILE,AS)
|
||||
COMPILE_M = $(call COMPILE,OBJCC)
|
||||
COMPILE_X86ASM = $(call COMPILE,X86ASM)
|
||||
COMPILE_HOSTC = $(call COMPILE,HOSTCC)
|
||||
COMPILE_GLSLC = $(call COMPILE,GLSLC)
|
||||
COMPILE_NVCC = $(call COMPILE,NVCC)
|
||||
COMPILE_MMI = $(call COMPILE,CC,MMIFLAGS)
|
||||
COMPILE_MSA = $(call COMPILE,CC,MSAFLAGS)
|
||||
@@ -125,26 +115,6 @@ COMPILE_LASX = $(call COMPILE,CC,LASXFLAGS)
|
||||
$(BIN2CEXE): ffbuild/bin2c_host.o
|
||||
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
|
||||
|
||||
RUN_BIN2C = $(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
RUN_GZIP = $(M)gzip -nc9 $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) >$@
|
||||
RUN_MINIFY = $(M)sed 's!/\\*.*\\*/!!g' $< | tr '\n' ' ' | tr -s ' ' | sed 's/^ //; s/ $$//' > $@
|
||||
%.gz: TAG = GZIP
|
||||
%.min: TAG = MINIFY
|
||||
|
||||
%.spv: %.glsl
|
||||
$(COMPILE_GLSLC)
|
||||
|
||||
ifdef CONFIG_SHADER_COMPRESSION
|
||||
%.spv.gz: %.spv
|
||||
$(RUN_GZIP)
|
||||
|
||||
%.spv.c: %.spv.gz $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
else
|
||||
%.spv.c: %.spv $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
endif
|
||||
|
||||
%.metal.air: %.metal
|
||||
$(METALCC) $< -o $@
|
||||
|
||||
@@ -152,46 +122,61 @@ endif
|
||||
$(METALLIB) --split-module-without-linking $< -o $@
|
||||
|
||||
%.metallib.c: %.metallib $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
|
||||
%.ptx: %.cu $(SRC_PATH)/compat/cuda/cuda_runtime.h
|
||||
$(COMPILE_NVCC)
|
||||
|
||||
ifdef CONFIG_SHADER_COMPRESSION
|
||||
ifdef CONFIG_PTX_COMPRESSION
|
||||
%.ptx.gz: TAG = GZIP
|
||||
%.ptx.gz: %.ptx
|
||||
$(RUN_GZIP)
|
||||
$(M)gzip -nc9 $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) >$@
|
||||
|
||||
%.ptx.c: %.ptx.gz $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
else
|
||||
%.ptx.c: %.ptx $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
endif
|
||||
|
||||
# 1) Preprocess CSS to a minified version
|
||||
%.css.min: TAG = SED
|
||||
%.css.min: %.css
|
||||
$(RUN_MINIFY)
|
||||
$(M)sed 's!/\\*.*\\*/!!g' $< \
|
||||
| tr '\n' ' ' \
|
||||
| tr -s ' ' \
|
||||
| sed 's/^ //; s/ $$//' \
|
||||
> $@
|
||||
|
||||
ifdef CONFIG_RESOURCE_COMPRESSION
|
||||
|
||||
# 2) Gzip the minified CSS
|
||||
%.css.min.gz: TAG = GZIP
|
||||
%.css.min.gz: %.css.min
|
||||
$(RUN_GZIP)
|
||||
$(M)gzip -nc9 $< > $@
|
||||
|
||||
# 3) Convert the gzipped CSS to a .c array
|
||||
%.css.c: %.css.min.gz $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
|
||||
# 4) Gzip the HTML file (no minification needed)
|
||||
%.html.gz: TAG = GZIP
|
||||
%.html.gz: %.html
|
||||
$(RUN_GZIP)
|
||||
$(M)gzip -nc9 $< > $@
|
||||
|
||||
# 5) Convert the gzipped HTML to a .c array
|
||||
%.html.c: %.html.gz $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
|
||||
else # NO COMPRESSION
|
||||
|
||||
# 2) Convert the minified CSS to a .c array
|
||||
%.css.c: %.css.min $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
|
||||
# 3) Convert the plain HTML to a .c array
|
||||
%.html.c: %.html $(BIN2CEXE)
|
||||
$(RUN_BIN2C)
|
||||
$(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
|
||||
endif
|
||||
|
||||
clean::
|
||||
@@ -243,11 +228,12 @@ ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)
|
||||
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
|
||||
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
|
||||
HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
|
||||
SPVOBJS = $(filter %.spv.o,$(OBJS))
|
||||
PTXOBJS = $(filter %.ptx.o,$(OBJS))
|
||||
RESOURCEOBJS = $(filter %.css.o %.html.o,$(OBJS))
|
||||
$(HOBJS): CCFLAGS += $(CFLAGS_HEADERS)
|
||||
checkheaders: $(HOBJS)
|
||||
.SECONDARY: $(HOBJS:.o=.c) $(SPVOBJS:.o=.c) $(SPVOBJS:.o=.gz) $(SPVOBJS:.o=) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=)
|
||||
.SECONDARY: $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=) $(RESOURCEOBJS:.o=.c) $(RESOURCEOBJS:%.css.o=%.css.min) $(RESOURCEOBJS:%.css.o=%.css.min.gz) $(RESOURCEOBJS:%.html.o=%.html.gz) $(RESOURCEOBJS:.o=)
|
||||
|
||||
alltools: $(TOOLS)
|
||||
|
||||
$(HOSTOBJS): %.o: %.c
|
||||
@@ -266,7 +252,7 @@ $(TOOLOBJS): | tools
|
||||
|
||||
OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS))
|
||||
|
||||
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.objs *.pc *.ptx *.ptx.gz *.ptx.c *.spv *.spv.gz *.spv.c *.ver *.version *.html.gz *.html.c *.css.min.gz *.css.min *.css.c *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
|
||||
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.objs *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *.html.gz *.html.c *.css.gz *.css.c *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
|
||||
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
|
||||
|
||||
define RULES
|
||||
@@ -276,4 +262,4 @@ endef
|
||||
|
||||
$(eval $(RULES))
|
||||
|
||||
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SHLIBOBJS:.o=.d) $(STLIBOBJS:.o=.d) $(SPVOBJS:.spv.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d)
|
||||
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SHLIBOBJS:.o=.d) $(STLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d)
|
||||
|
||||
+3
-7
@@ -55,12 +55,8 @@ $(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
|
||||
|
||||
$(LIBOBJS): CPPFLAGS += -DBUILDING_$(NAME)
|
||||
|
||||
$(NAME)LINK_EXE_ARGS = $(LDFLAGS) $(LDEXEFLAGS)
|
||||
$(NAME)LINK_SO_ARGS = $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS)
|
||||
$(NAME)LINK_EXTRA = $(FFEXTRALIBS)
|
||||
|
||||
$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
|
||||
$$(call LINK,$$(call $(NAME)LINK_EXE_ARGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $$(call $(NAME)LINK_EXTRA) $$(EXTRALIBS-$$(*F)) $$(ELIBS))
|
||||
$$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(EXTRALIBS-$$(*F)) $$(ELIBS)
|
||||
|
||||
$(SUBDIR)lib$(NAME).version: $(SUBDIR)version.h $(SUBDIR)version_major.h | $(SUBDIR)
|
||||
$$(M) $$(SRC_PATH)/ffbuild/libversion.sh $(NAME) $$^ > $$@
|
||||
@@ -78,9 +74,9 @@ $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SUBDIR)lib$(NAME).ver
|
||||
$(SLIB_CREATE_DEF_CMD)
|
||||
ifeq ($(RESPONSE_FILES),yes)
|
||||
$(Q)echo $$(filter %.o,$$^) > $$@.objs
|
||||
$$(call LINK,$$(call $(NAME)LINK_SO_ARGS) $$(LD_O) @$$@.objs $$(call $(NAME)LINK_EXTRA))
|
||||
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) @$$@.objs $(FFEXTRALIBS)
|
||||
else
|
||||
$$(call LINK,$$(call $(NAME)LINK_SO_ARGS) $$(LD_O) $$(filter %.o,$$^) $$(call $(NAME)LINK_EXTRA))
|
||||
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
|
||||
endif
|
||||
$(SLIB_EXTRA_CMD)
|
||||
-$(RM) $$@.objs
|
||||
|
||||
@@ -36,7 +36,6 @@ OBJS-ffmpeg += \
|
||||
fftools/textformat/tw_buffer.o \
|
||||
fftools/textformat/tw_stdout.o \
|
||||
$(OBJS-resman) \
|
||||
$(RESOBJS) \
|
||||
|
||||
OBJS-ffprobe += \
|
||||
fftools/textformat/avtextformat.o \
|
||||
@@ -51,7 +50,6 @@ OBJS-ffprobe += \
|
||||
fftools/textformat/tw_buffer.o \
|
||||
fftools/textformat/tw_stdout.o \
|
||||
|
||||
OBJS-ffmpeg += $(COMPAT_OBJS:%=compat/%)
|
||||
OBJS-ffplay += fftools/ffplay_renderer.o
|
||||
|
||||
define DOFFTOOL
|
||||
|
||||
+5
-100
@@ -263,7 +263,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
arg_allocated = read_file_to_string(arg);
|
||||
arg_allocated = file_read(arg);
|
||||
if (!arg_allocated) {
|
||||
av_log(NULL, AV_LOG_FATAL,
|
||||
"Error reading the value for option '%s' from file: %s\n",
|
||||
@@ -275,7 +275,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
||||
}
|
||||
|
||||
if (po->flags & OPT_FLAG_SPEC) {
|
||||
const char *p = strchr(opt, ':');
|
||||
char *p = strchr(opt, ':');
|
||||
char *str;
|
||||
|
||||
sol = dst;
|
||||
@@ -962,7 +962,8 @@ FILE *get_preset_file(char *filename, size_t filename_size,
|
||||
datadir, desired_size, sizeof *datadir);
|
||||
if (new_datadir) {
|
||||
datadir = new_datadir;
|
||||
strcpy(datadir + datadir_len, "/ffpresets");
|
||||
datadir[datadir_len] = 0;
|
||||
strncat(datadir, "/ffpresets", desired_size - 1 - datadir_len);
|
||||
base[2] = datadir;
|
||||
}
|
||||
}
|
||||
@@ -1349,77 +1350,6 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned stream_group_specifier_match(const StreamSpecifier *ss,
|
||||
const AVFormatContext *s, const AVStreamGroup *stg,
|
||||
void *logctx)
|
||||
{
|
||||
int start_stream_group = 0, nb_stream_groups;
|
||||
int nb_matched = 0;
|
||||
|
||||
if (ss->idx >= 0)
|
||||
return 0;
|
||||
|
||||
switch (ss->stream_list) {
|
||||
case STREAM_LIST_STREAM_ID:
|
||||
case STREAM_LIST_ALL:
|
||||
case STREAM_LIST_PROGRAM:
|
||||
return 0;
|
||||
case STREAM_LIST_GROUP_ID:
|
||||
// <n-th> stream with given ID makes no sense and should be impossible to request
|
||||
av_assert0(ss->idx < 0);
|
||||
// return early if we know for sure the stream does not match
|
||||
if (stg->id != ss->list_id)
|
||||
return 0;
|
||||
start_stream_group = stg->index;
|
||||
nb_stream_groups = stg->index + 1;
|
||||
break;
|
||||
case STREAM_LIST_GROUP_IDX:
|
||||
start_stream_group = ss->list_id >= 0 ? 0 : stg->index;
|
||||
nb_stream_groups = stg->index + 1;
|
||||
break;
|
||||
default: av_assert0(0);
|
||||
}
|
||||
|
||||
for (int i = start_stream_group; i < nb_stream_groups; i++) {
|
||||
const AVStreamGroup *candidate = s->stream_groups[i];
|
||||
|
||||
if (ss->meta_key) {
|
||||
const AVDictionaryEntry *tag = av_dict_get(candidate->metadata,
|
||||
ss->meta_key, NULL, 0);
|
||||
|
||||
if (!tag)
|
||||
continue;
|
||||
if (ss->meta_val && strcmp(tag->value, ss->meta_val))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ss->usable_only) {
|
||||
switch (candidate->type) {
|
||||
case AV_STREAM_GROUP_PARAMS_TILE_GRID: {
|
||||
const AVStreamGroupTileGrid *tg = candidate->params.tile_grid;
|
||||
if (!tg->coded_width || !tg->coded_height || !tg->nb_tiles ||
|
||||
!tg->width || !tg->height || !tg->nb_tiles)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ss->disposition &&
|
||||
(candidate->disposition & ss->disposition) != ss->disposition)
|
||||
continue;
|
||||
|
||||
if (stg == candidate)
|
||||
return ss->list_id < 0 || ss->list_id == nb_matched;
|
||||
|
||||
nb_matched++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id,
|
||||
AVFormatContext *s, AVStream *st, const AVCodec *codec,
|
||||
AVDictionary **dst, AVDictionary **opts_used)
|
||||
@@ -1568,7 +1498,7 @@ double get_rotation(const int32_t *displaymatrix)
|
||||
}
|
||||
|
||||
/* read file contents into a string */
|
||||
char *read_file_to_string(const char *filename)
|
||||
char *file_read(const char *filename)
|
||||
{
|
||||
AVIOContext *pb = NULL;
|
||||
int ret = avio_open(&pb, filename, AVIO_FLAG_READ);
|
||||
@@ -1612,28 +1542,3 @@ int check_avoptions(AVDictionary *m)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dump_dictionary(void *ctx, const AVDictionary *m,
|
||||
const char *name, const char *indent,
|
||||
int log_level)
|
||||
{
|
||||
const AVDictionaryEntry *tag = NULL;
|
||||
|
||||
if (!m)
|
||||
return;
|
||||
|
||||
av_log(ctx, log_level, "%s%s:\n", indent, name);
|
||||
while ((tag = av_dict_iterate(m, tag))) {
|
||||
const char *p = tag->value;
|
||||
av_log(ctx, log_level, "%s %-16s: ", indent, tag->key);
|
||||
while (*p) {
|
||||
size_t len = strcspn(p, "\x8\xa\xb\xc\xd");
|
||||
av_log(ctx, log_level, "%.*s", (int)(FFMIN(255, len)), p);
|
||||
p += len;
|
||||
if (*p == 0xd) av_log(ctx, log_level, " ");
|
||||
if (*p == 0xa) av_log(ctx, log_level, "\n%s %-16s: ", indent, "");
|
||||
if (*p) p++;
|
||||
}
|
||||
av_log(ctx, log_level, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-13
@@ -158,10 +158,6 @@ unsigned stream_specifier_match(const StreamSpecifier *ss,
|
||||
const AVFormatContext *s, const AVStream *st,
|
||||
void *logctx);
|
||||
|
||||
unsigned stream_group_specifier_match(const StreamSpecifier *ss,
|
||||
const AVFormatContext *s, const AVStreamGroup *stg,
|
||||
void *logctx);
|
||||
|
||||
void stream_specifier_uninit(StreamSpecifier *ss);
|
||||
|
||||
typedef struct SpecifierOpt {
|
||||
@@ -539,7 +535,7 @@ void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems);
|
||||
double get_rotation(const int32_t *displaymatrix);
|
||||
|
||||
/* read file contents into a string */
|
||||
char *read_file_to_string(const char *filename);
|
||||
char *file_read(const char *filename);
|
||||
|
||||
/* Remove keys in dictionary b from dictionary a */
|
||||
void remove_avoptions(AVDictionary **a, AVDictionary *b);
|
||||
@@ -549,12 +545,4 @@ int check_avoptions(AVDictionary *m);
|
||||
|
||||
int cmdutils_isalnum(char c);
|
||||
|
||||
/**
|
||||
* This does the same as libavformat/dump.c corresponding function
|
||||
* and should probably be kept in sync when the other one changes.
|
||||
*/
|
||||
void dump_dictionary(void *ctx, const AVDictionary *m,
|
||||
const char *name, const char *indent,
|
||||
int log_level);
|
||||
|
||||
#endif /* FFTOOLS_CMDUTILS_H */
|
||||
|
||||
+2
-22
@@ -78,9 +78,6 @@
|
||||
#include "libavdevice/avdevice.h"
|
||||
|
||||
#include "cmdutils.h"
|
||||
#if CONFIG_MEDIACODEC
|
||||
#include "compat/android/binder.h"
|
||||
#endif
|
||||
#include "ffmpeg.h"
|
||||
#include "ffmpeg_sched.h"
|
||||
#include "ffmpeg_utils.h"
|
||||
@@ -253,7 +250,7 @@ void term_init(void)
|
||||
/* read a key without blocking */
|
||||
static int read_key(void)
|
||||
{
|
||||
unsigned char ch = -1;
|
||||
unsigned char ch;
|
||||
#if HAVE_TERMIOS_H
|
||||
int n = 1;
|
||||
struct timeval tv;
|
||||
@@ -300,7 +297,7 @@ static int read_key(void)
|
||||
if(kbhit())
|
||||
return(getch());
|
||||
#endif
|
||||
return ch;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int decode_interrupt_cb(void *ctx)
|
||||
@@ -403,7 +400,6 @@ static void frame_data_free(void *opaque, uint8_t *data)
|
||||
{
|
||||
FrameData *fd = (FrameData *)data;
|
||||
|
||||
av_frame_side_data_free(&fd->side_data, &fd->nb_side_data);
|
||||
avcodec_parameters_free(&fd->par_enc);
|
||||
|
||||
av_free(data);
|
||||
@@ -433,8 +429,6 @@ static int frame_data_ensure(AVBufferRef **dst, int writable)
|
||||
|
||||
memcpy(fd, fd_src, sizeof(*fd));
|
||||
fd->par_enc = NULL;
|
||||
fd->side_data = NULL;
|
||||
fd->nb_side_data = 0;
|
||||
|
||||
if (fd_src->par_enc) {
|
||||
int ret = 0;
|
||||
@@ -450,16 +444,6 @@ static int frame_data_ensure(AVBufferRef **dst, int writable)
|
||||
}
|
||||
}
|
||||
|
||||
if (fd_src->nb_side_data) {
|
||||
int ret = clone_side_data(&fd->side_data, &fd->nb_side_data,
|
||||
fd_src->side_data, fd_src->nb_side_data, 0);
|
||||
if (ret < 0) {
|
||||
av_buffer_unref(dst);
|
||||
av_buffer_unref(&src);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
av_buffer_unref(&src);
|
||||
} else {
|
||||
fd->dec.frame_num = UINT64_MAX;
|
||||
@@ -1022,10 +1006,6 @@ int main(int argc, char **argv)
|
||||
goto finish;
|
||||
}
|
||||
|
||||
#if CONFIG_MEDIACODEC
|
||||
android_binder_threadpool_init_if_required();
|
||||
#endif
|
||||
|
||||
current_time = ti = get_benchmark_time_stamps();
|
||||
ret = transcode(sch);
|
||||
if (ret >= 0 && do_benchmark) {
|
||||
|
||||
+6
-58
@@ -136,7 +136,6 @@ typedef struct StreamMap {
|
||||
int disabled; /* 1 is this mapping is disabled by a negative map */
|
||||
int file_index;
|
||||
int stream_index;
|
||||
int group_index;
|
||||
char *linklabel; /* name of an output link, for mapping lavfi outputs */
|
||||
|
||||
ViewSpecifier vs;
|
||||
@@ -302,8 +301,6 @@ enum OFilterFlags {
|
||||
// produce 24-bit audio
|
||||
OFILTER_FLAG_AUDIO_24BIT = (1 << 1),
|
||||
OFILTER_FLAG_AUTOSCALE = (1 << 2),
|
||||
OFILTER_FLAG_AUTOROTATE = (1 << 3),
|
||||
OFILTER_FLAG_CROP = (1 << 4),
|
||||
};
|
||||
|
||||
typedef struct OutputFilterOptions {
|
||||
@@ -335,12 +332,6 @@ typedef struct OutputFilterOptions {
|
||||
int height;
|
||||
enum AVColorSpace color_space;
|
||||
enum AVColorRange color_range;
|
||||
enum AVAlphaMode alpha_mode;
|
||||
|
||||
unsigned crop_top;
|
||||
unsigned crop_bottom;
|
||||
unsigned crop_left;
|
||||
unsigned crop_right;
|
||||
|
||||
enum VideoSyncMethod vsync_method;
|
||||
AVRational frame_rate;
|
||||
@@ -349,19 +340,12 @@ typedef struct OutputFilterOptions {
|
||||
int sample_rate;
|
||||
AVChannelLayout ch_layout;
|
||||
|
||||
union {
|
||||
const enum AVPixelFormat *pix_fmts;
|
||||
const enum AVSampleFormat *sample_fmts;
|
||||
};
|
||||
const int *formats;
|
||||
const int *sample_rates;
|
||||
const AVChannelLayout *ch_layouts;
|
||||
const AVRational *frame_rates;
|
||||
const enum AVColorSpace *color_spaces;
|
||||
const enum AVColorRange *color_ranges;
|
||||
const enum AVAlphaMode *alpha_modes;
|
||||
|
||||
AVFrameSideData **side_data;
|
||||
int nb_side_data;
|
||||
|
||||
// for simple filtergraphs only, view specifier passed
|
||||
// along to the decoder
|
||||
@@ -418,11 +402,6 @@ typedef struct FilterGraph {
|
||||
OutputFilter **outputs;
|
||||
int nb_outputs;
|
||||
|
||||
// true when the filtergraph is created internally for
|
||||
// purposes like stream group merging. Meant to be freed
|
||||
// if unbound.
|
||||
int is_internal;
|
||||
|
||||
const char *graph_desc;
|
||||
struct AVBPrint graph_print_buf;
|
||||
} FilterGraph;
|
||||
@@ -469,7 +448,7 @@ typedef struct Decoder {
|
||||
|
||||
enum AVMediaType type;
|
||||
|
||||
const uint8_t *subtitle_header;
|
||||
uint8_t *subtitle_header;
|
||||
int subtitle_header_size;
|
||||
|
||||
// number of frames/samples retrieved from the decoder
|
||||
@@ -512,18 +491,6 @@ typedef struct InputStream {
|
||||
int nb_filters;
|
||||
} InputStream;
|
||||
|
||||
typedef struct InputStreamGroup {
|
||||
const AVClass *class;
|
||||
|
||||
/* parent source */
|
||||
struct InputFile *file;
|
||||
|
||||
int index;
|
||||
|
||||
FilterGraph *fg;
|
||||
AVStreamGroup *stg;
|
||||
} InputStreamGroup;
|
||||
|
||||
typedef struct InputFile {
|
||||
const AVClass *class;
|
||||
|
||||
@@ -545,10 +512,6 @@ typedef struct InputFile {
|
||||
* if new streams appear dynamically during demuxing */
|
||||
InputStream **streams;
|
||||
int nb_streams;
|
||||
|
||||
/* stream groups that ffmpeg is aware of; */
|
||||
InputStreamGroup **stream_groups;
|
||||
int nb_stream_groups;
|
||||
} InputFile;
|
||||
|
||||
enum forced_keyframes_const {
|
||||
@@ -607,8 +570,6 @@ enum {
|
||||
#if FFMPEG_OPT_FORCE_KF_SOURCE_NO_DROP
|
||||
KF_FORCE_SOURCE_NO_DROP = 2,
|
||||
#endif
|
||||
// force keyframe if lavfi.scd.time metadata is set
|
||||
KF_FORCE_SCD_METADATA = 3,
|
||||
};
|
||||
|
||||
typedef struct KeyframeForceCtx {
|
||||
@@ -737,9 +698,6 @@ typedef struct FrameData {
|
||||
int64_t wallclock[LATENCY_PROBE_NB];
|
||||
|
||||
AVCodecParameters *par_enc;
|
||||
|
||||
AVFrameSideData **side_data;
|
||||
int nb_side_data;
|
||||
} FrameData;
|
||||
|
||||
extern InputFile **input_files;
|
||||
@@ -813,12 +771,12 @@ int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used
|
||||
int assert_file_overwrite(const char *filename);
|
||||
int find_codec(void *logctx, const char *name,
|
||||
enum AVMediaType type, int encoder, const AVCodec **codec);
|
||||
int parse_and_set_vsync(const char *arg, enum VideoSyncMethod *vsync_var, int file_idx, int st_idx, int is_global);
|
||||
int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global);
|
||||
|
||||
int filtergraph_is_simple(const FilterGraph *fg);
|
||||
int fg_create_simple(FilterGraph **pfg,
|
||||
InputStream *ist,
|
||||
char **graph_desc,
|
||||
char *graph_desc,
|
||||
Scheduler *sch, unsigned sched_idx_enc,
|
||||
const OutputFilterOptions *opts);
|
||||
int fg_finalise_bindings(void);
|
||||
@@ -841,11 +799,10 @@ int ofilter_bind_enc(OutputFilter *ofilter,
|
||||
/**
|
||||
* Create a new filtergraph in the global filtergraph list.
|
||||
*
|
||||
* @param graph_desc Pointer to graph description; an av_malloc()ed string, filtergraph
|
||||
* @param graph_desc Graph description; an av_malloc()ed string, filtergraph
|
||||
* takes ownership of it.
|
||||
*/
|
||||
int fg_create(FilterGraph **pfg, char **graph_desc, Scheduler *sch,
|
||||
const OutputFilterOptions *opts);
|
||||
int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch);
|
||||
|
||||
void fg_free(FilterGraph **pfg);
|
||||
|
||||
@@ -972,15 +929,6 @@ void opt_match_per_stream_int64(void *logctx, const SpecifierOptList *sol,
|
||||
void opt_match_per_stream_dbl(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStream *st, double *out);
|
||||
|
||||
void opt_match_per_stream_group_str(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStreamGroup *stg, const char **out);
|
||||
void opt_match_per_stream_group_int(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStreamGroup *stg, int *out);
|
||||
void opt_match_per_stream_group_int64(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStreamGroup *stg, int64_t *out);
|
||||
void opt_match_per_stream_group_dbl(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStreamGroup *stg, double *out);
|
||||
|
||||
int view_specifier_parse(const char **pspec, ViewSpecifier *vs);
|
||||
|
||||
int muxer_thread(void *arg);
|
||||
|
||||
+13
-9
@@ -136,6 +136,8 @@ void dec_free(Decoder **pdec)
|
||||
av_frame_free(&dp->sub_prev[i]);
|
||||
av_frame_free(&dp->sub_heartbeat);
|
||||
|
||||
av_freep(&dp->dec.subtitle_header);
|
||||
|
||||
av_freep(&dp->parent_name);
|
||||
|
||||
av_freep(&dp->views_requested);
|
||||
@@ -744,14 +746,11 @@ static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
|
||||
while (1) {
|
||||
FrameData *fd;
|
||||
unsigned outputs_mask = 1;
|
||||
unsigned flags = 0;
|
||||
if (!dp->dec.frames_decoded)
|
||||
flags |= AV_CODEC_RECEIVE_FRAME_FLAG_SYNCHRONOUS;
|
||||
|
||||
av_frame_unref(frame);
|
||||
|
||||
update_benchmark(NULL);
|
||||
ret = avcodec_receive_frame_flags(dec, frame, flags);
|
||||
ret = avcodec_receive_frame(dec, frame);
|
||||
update_benchmark("decode_%s %s", type_desc, dp->parent_name);
|
||||
|
||||
if (ret == AVERROR(EAGAIN)) {
|
||||
@@ -1010,7 +1009,7 @@ static int decoder_thread(void *arg)
|
||||
ret = 0;
|
||||
|
||||
err_rate = (dp->dec.frames_decoded || dp->dec.decode_errors) ?
|
||||
(float)dp->dec.decode_errors / (dp->dec.frames_decoded + dp->dec.decode_errors) : 0.f;
|
||||
dp->dec.decode_errors / (dp->dec.frames_decoded + dp->dec.decode_errors) : 0.f;
|
||||
if (err_rate > max_error_rate) {
|
||||
av_log(dp, AV_LOG_FATAL, "Decode error rate %g exceeds maximum %g\n",
|
||||
err_rate, max_error_rate);
|
||||
@@ -1021,7 +1020,6 @@ static int decoder_thread(void *arg)
|
||||
|
||||
finish:
|
||||
dec_thread_uninit(&dt);
|
||||
avcodec_free_context(&dp->dec_ctx);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1621,8 +1619,15 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
|
||||
dp->dec_ctx->extra_hw_frames = extra_frames;
|
||||
}
|
||||
|
||||
dp->dec.subtitle_header = dp->dec_ctx->subtitle_header;
|
||||
dp->dec.subtitle_header_size = dp->dec_ctx->subtitle_header_size;
|
||||
if (dp->dec_ctx->subtitle_header) {
|
||||
/* ASS code assumes this buffer is null terminated so add extra byte. */
|
||||
dp->dec.subtitle_header = av_mallocz(dp->dec_ctx->subtitle_header_size + 1);
|
||||
if (!dp->dec.subtitle_header)
|
||||
return AVERROR(ENOMEM);
|
||||
memcpy(dp->dec.subtitle_header, dp->dec_ctx->subtitle_header,
|
||||
dp->dec_ctx->subtitle_header_size);
|
||||
dp->dec.subtitle_header_size = dp->dec_ctx->subtitle_header_size;
|
||||
}
|
||||
|
||||
if (param_out) {
|
||||
if (dp->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
@@ -1639,7 +1644,6 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
|
||||
param_out->sample_aspect_ratio = dp->dec_ctx->sample_aspect_ratio;
|
||||
param_out->colorspace = dp->dec_ctx->colorspace;
|
||||
param_out->color_range = dp->dec_ctx->color_range;
|
||||
param_out->alpha_mode = dp->dec_ctx->alpha_mode;
|
||||
}
|
||||
|
||||
av_frame_side_data_free(¶m_out->side_data, ¶m_out->nb_side_data);
|
||||
|
||||
+49
-205
@@ -96,21 +96,8 @@ typedef struct DemuxStream {
|
||||
uint64_t nb_packets;
|
||||
// combined size of all the packets read
|
||||
uint64_t data_size;
|
||||
// latest wallclock time at which packet reading resumed after a stall - used for readrate
|
||||
int64_t resume_wc;
|
||||
// timestamp of first packet sent after the latest stall - used for readrate
|
||||
int64_t resume_pts;
|
||||
// measure of how far behind packet reading is against spceified readrate
|
||||
int64_t lag;
|
||||
} DemuxStream;
|
||||
|
||||
typedef struct DemuxStreamGroup {
|
||||
InputStreamGroup istg;
|
||||
|
||||
// name used for logging
|
||||
char log_name[32];
|
||||
} DemuxStreamGroup;
|
||||
|
||||
typedef struct Demuxer {
|
||||
InputFile f;
|
||||
|
||||
@@ -144,6 +131,13 @@ typedef struct Demuxer {
|
||||
double readrate_initial_burst;
|
||||
float readrate_catchup;
|
||||
|
||||
// latest wallclock time at which packet reading resumed after a stall - used for readrate
|
||||
int64_t resume_wc;
|
||||
// relative timestamp of first packet sent after the latest stall - used for readrate
|
||||
int64_t resume_progress;
|
||||
// measure of how far behind packet reading is against spceified readrate
|
||||
int64_t lag;
|
||||
|
||||
Scheduler *sch;
|
||||
|
||||
AVPacket *pkt_heartbeat;
|
||||
@@ -514,43 +508,55 @@ static void readrate_sleep(Demuxer *d)
|
||||
int64_t initial_burst = AV_TIME_BASE * d->readrate_initial_burst;
|
||||
int resume_warn = 0;
|
||||
|
||||
DemuxStream *slowest = NULL;
|
||||
int64_t progress = INT64_MAX;
|
||||
|
||||
for (int i = 0; i < f->nb_streams; i++) {
|
||||
InputStream *ist = f->streams[i];
|
||||
DemuxStream *ds = ds_from_ist(ist);
|
||||
int64_t stream_ts_offset, pts, now, wc_elapsed, elapsed, lag, max_pts, limit_pts;
|
||||
int64_t stream_ts_offset, pts, pts_diff;
|
||||
if (ds->discard || ds->finished || ds->first_dts == AV_NOPTS_VALUE)
|
||||
continue;
|
||||
|
||||
if (ds->discard) continue;
|
||||
|
||||
stream_ts_offset = FFMAX(ds->first_dts != AV_NOPTS_VALUE ? ds->first_dts : 0, file_start);
|
||||
stream_ts_offset = FFMAX(ds->first_dts, file_start);
|
||||
pts = av_rescale(ds->dts, 1000000, AV_TIME_BASE);
|
||||
now = av_gettime_relative();
|
||||
wc_elapsed = now - d->wallclock_start;
|
||||
|
||||
if (pts <= stream_ts_offset + initial_burst) continue;
|
||||
|
||||
max_pts = stream_ts_offset + initial_burst + (int64_t)(wc_elapsed * d->readrate);
|
||||
lag = FFMAX(max_pts - pts, 0);
|
||||
if ( (!ds->lag && lag > 0.3 * AV_TIME_BASE) || ( lag > ds->lag + 0.3 * AV_TIME_BASE) ) {
|
||||
ds->lag = lag;
|
||||
ds->resume_wc = now;
|
||||
ds->resume_pts = pts;
|
||||
av_log_once(ds, AV_LOG_WARNING, AV_LOG_DEBUG, &resume_warn,
|
||||
"Resumed reading at pts %0.3f with rate %0.3f after a lag of %0.3fs\n",
|
||||
(float)pts/AV_TIME_BASE, d->readrate_catchup, (float)lag/AV_TIME_BASE);
|
||||
pts_diff = pts - stream_ts_offset;
|
||||
if (pts_diff < progress) {
|
||||
progress = pts_diff;
|
||||
slowest = ds;
|
||||
}
|
||||
if (ds->lag && !lag)
|
||||
ds->lag = ds->resume_wc = ds->resume_pts = 0;
|
||||
if (ds->resume_wc) {
|
||||
elapsed = now - ds->resume_wc;
|
||||
limit_pts = ds->resume_pts + (int64_t)(elapsed * d->readrate_catchup);
|
||||
} else {
|
||||
elapsed = wc_elapsed;
|
||||
limit_pts = max_pts;
|
||||
}
|
||||
|
||||
if (pts > limit_pts)
|
||||
av_usleep(pts - limit_pts);
|
||||
}
|
||||
|
||||
if (!slowest || progress <= initial_burst)
|
||||
return;
|
||||
|
||||
int64_t now = av_gettime_relative();
|
||||
int64_t wc_elapsed = now - d->wallclock_start;
|
||||
int64_t max_prog = initial_burst + (int64_t)(wc_elapsed * d->readrate);
|
||||
int64_t lag = FFMAX(max_prog - progress, 0);
|
||||
int64_t limit;
|
||||
|
||||
if ( (!d->lag && lag > 0.3 * AV_TIME_BASE) || ( lag > d->lag + 0.3 * AV_TIME_BASE) ) {
|
||||
d->lag = lag;
|
||||
d->resume_wc = now;
|
||||
d->resume_progress = progress;
|
||||
|
||||
int64_t pts = FFMAX(slowest->first_dts, file_start) + progress;
|
||||
av_log_once(slowest, AV_LOG_WARNING, AV_LOG_DEBUG, &resume_warn,
|
||||
"Resumed reading at pts %0.3f with rate %0.3f after a lag of %0.3fs\n",
|
||||
(float)pts/AV_TIME_BASE, d->readrate_catchup, (float)lag/AV_TIME_BASE);
|
||||
}
|
||||
if (d->lag && !lag)
|
||||
d->lag = d->resume_wc = d->resume_progress = 0;
|
||||
if (d->resume_wc) {
|
||||
int64_t elapsed = now - d->resume_wc;
|
||||
limit = d->resume_progress + (int64_t)(elapsed * d->readrate_catchup);
|
||||
} else {
|
||||
limit = max_prog;
|
||||
}
|
||||
|
||||
if (progress > limit)
|
||||
av_usleep(progress - limit);
|
||||
}
|
||||
|
||||
static int do_send(Demuxer *d, DemuxStream *ds, AVPacket *pkt, unsigned flags,
|
||||
@@ -896,16 +902,6 @@ static void ist_free(InputStream **pist)
|
||||
av_freep(pist);
|
||||
}
|
||||
|
||||
static void istg_free(InputStreamGroup **pistg)
|
||||
{
|
||||
InputStreamGroup *istg = *pistg;
|
||||
|
||||
if (!istg)
|
||||
return;
|
||||
|
||||
av_freep(pistg);
|
||||
}
|
||||
|
||||
void ifile_close(InputFile **pf)
|
||||
{
|
||||
InputFile *f = *pf;
|
||||
@@ -921,10 +917,6 @@ void ifile_close(InputFile **pf)
|
||||
ist_free(&f->streams[i]);
|
||||
av_freep(&f->streams);
|
||||
|
||||
for (int i = 0; i < f->nb_stream_groups; i++)
|
||||
istg_free(&f->stream_groups[i]);
|
||||
av_freep(&f->stream_groups);
|
||||
|
||||
avformat_close_input(&f->ctx);
|
||||
|
||||
av_packet_free(&d->pkt_heartbeat);
|
||||
@@ -1610,144 +1602,6 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char *input_stream_group_item_name(void *obj)
|
||||
{
|
||||
const DemuxStreamGroup *dsg = obj;
|
||||
|
||||
return dsg->log_name;
|
||||
}
|
||||
|
||||
static const AVClass input_stream_group_class = {
|
||||
.class_name = "InputStreamGroup",
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.item_name = input_stream_group_item_name,
|
||||
.category = AV_CLASS_CATEGORY_DEMUXER,
|
||||
};
|
||||
|
||||
static DemuxStreamGroup *demux_stream_group_alloc(Demuxer *d, AVStreamGroup *stg)
|
||||
{
|
||||
InputFile *f = &d->f;
|
||||
DemuxStreamGroup *dsg;
|
||||
|
||||
dsg = allocate_array_elem(&f->stream_groups, sizeof(*dsg), &f->nb_stream_groups);
|
||||
if (!dsg)
|
||||
return NULL;
|
||||
|
||||
dsg->istg.stg = stg;
|
||||
dsg->istg.file = f;
|
||||
dsg->istg.index = stg->index;
|
||||
dsg->istg.class = &input_stream_group_class;
|
||||
|
||||
snprintf(dsg->log_name, sizeof(dsg->log_name), "istg#%d:%d/%s",
|
||||
d->f.index, stg->index, avformat_stream_group_name(stg->type));
|
||||
|
||||
return dsg;
|
||||
}
|
||||
|
||||
static int istg_parse_tile_grid(const OptionsContext *o, Demuxer *d, InputStreamGroup *istg)
|
||||
{
|
||||
InputFile *f = &d->f;
|
||||
AVFormatContext *ic = d->f.ctx;
|
||||
AVStreamGroup *stg = istg->stg;
|
||||
const AVStreamGroupTileGrid *tg = stg->params.tile_grid;
|
||||
OutputFilterOptions opts;
|
||||
AVBPrint bp;
|
||||
char *graph_str;
|
||||
int autorotate = 1;
|
||||
const char *apply_cropping = NULL;
|
||||
int ret;
|
||||
|
||||
if (tg->nb_tiles == 1)
|
||||
return 0;
|
||||
|
||||
memset(&opts, 0, sizeof(opts));
|
||||
|
||||
opt_match_per_stream_group_int(istg, &o->autorotate, ic, stg, &autorotate);
|
||||
if (autorotate)
|
||||
opts.flags |= OFILTER_FLAG_AUTOROTATE;
|
||||
|
||||
opts.flags |= OFILTER_FLAG_CROP;
|
||||
opt_match_per_stream_group_str(istg, &o->apply_cropping, ic, stg, &apply_cropping);
|
||||
if (apply_cropping) {
|
||||
char *p;
|
||||
int crop = strtol(apply_cropping, &p, 0);
|
||||
if (*p)
|
||||
return AVERROR(EINVAL);
|
||||
if (!crop)
|
||||
opts.flags &= ~OFILTER_FLAG_CROP;
|
||||
}
|
||||
|
||||
av_bprint_init(&bp, 0, AV_BPRINT_SIZE_UNLIMITED);
|
||||
for (int i = 0; i < tg->nb_tiles; i++)
|
||||
av_bprintf(&bp, "[%d:g:%d:%d]", f->index, stg->index, tg->offsets[i].idx);
|
||||
av_bprintf(&bp, "xstack=inputs=%d:layout=", tg->nb_tiles);
|
||||
for (int i = 0; i < tg->nb_tiles - 1; i++)
|
||||
av_bprintf(&bp, "%d_%d|", tg->offsets[i].horizontal,
|
||||
tg->offsets[i].vertical);
|
||||
av_bprintf(&bp, "%d_%d:fill=0x%02X%02X%02X@0x%02X", tg->offsets[tg->nb_tiles - 1].horizontal,
|
||||
tg->offsets[tg->nb_tiles - 1].vertical,
|
||||
tg->background[0], tg->background[1],
|
||||
tg->background[2], tg->background[3]);
|
||||
av_bprintf(&bp, "[%d:g:%d]", f->index, stg->index);
|
||||
ret = av_bprint_finalize(&bp, &graph_str);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (tg->coded_width != tg->width || tg->coded_height != tg->height) {
|
||||
opts.crop_top = tg->vertical_offset;
|
||||
opts.crop_bottom = tg->coded_height - tg->height - tg->vertical_offset;
|
||||
opts.crop_left = tg->horizontal_offset;
|
||||
opts.crop_right = tg->coded_width - tg->width - tg->horizontal_offset;
|
||||
}
|
||||
|
||||
for (int i = 0; i < tg->nb_coded_side_data; i++) {
|
||||
const AVPacketSideData *sd = &tg->coded_side_data[i];
|
||||
|
||||
ret = av_packet_side_data_to_frame(&opts.side_data, &opts.nb_side_data, sd, 0);
|
||||
if (ret < 0 && ret != AVERROR(EINVAL))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = fg_create(NULL, &graph_str, d->sch, &opts);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
istg->fg = filtergraphs[nb_filtergraphs-1];
|
||||
istg->fg->is_internal = 1;
|
||||
|
||||
ret = 0;
|
||||
fail:
|
||||
if (ret < 0)
|
||||
av_freep(&graph_str);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int istg_add(const OptionsContext *o, Demuxer *d, AVStreamGroup *stg)
|
||||
{
|
||||
DemuxStreamGroup *dsg;
|
||||
InputStreamGroup *istg;
|
||||
int ret;
|
||||
|
||||
dsg = demux_stream_group_alloc(d, stg);
|
||||
if (!dsg)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
istg = &dsg->istg;
|
||||
|
||||
switch (stg->type) {
|
||||
case AV_STREAM_GROUP_PARAMS_TILE_GRID:
|
||||
ret = istg_parse_tile_grid(o, d, istg);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int is_windows_reserved_device_name(const char *f)
|
||||
{
|
||||
#if HAVE_DOS_PATHS
|
||||
@@ -1934,7 +1788,6 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
||||
ic = avformat_alloc_context();
|
||||
if (!ic)
|
||||
return AVERROR(ENOMEM);
|
||||
ic->name = av_strdup(d->log_name);
|
||||
if (o->audio_sample_rate.nb_opt) {
|
||||
av_dict_set_int(&o->g->format_opts, "sample_rate", o->audio_sample_rate.opt[o->audio_sample_rate.nb_opt - 1].u.i, 0);
|
||||
}
|
||||
@@ -2023,8 +1876,6 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
||||
|
||||
av_strlcat(d->log_name, "/", sizeof(d->log_name));
|
||||
av_strlcat(d->log_name, ic->iformat->name, sizeof(d->log_name));
|
||||
av_freep(&ic->name);
|
||||
ic->name = av_strdup(d->log_name);
|
||||
|
||||
if (scan_all_pmts_set)
|
||||
av_dict_set(&o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
|
||||
@@ -2174,13 +2025,6 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
||||
}
|
||||
}
|
||||
|
||||
/* Add all the stream groups from the given input file to the demuxer */
|
||||
for (int i = 0; i < ic->nb_stream_groups; i++) {
|
||||
ret = istg_add(o, d, ic->stream_groups[i]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* dump the file content */
|
||||
av_dump_format(ic, f->index, filename, 0);
|
||||
|
||||
|
||||
+15
-25
@@ -205,10 +205,19 @@ int enc_open(void *opaque, const AVFrame *frame)
|
||||
av_assert0(frame->opaque_ref);
|
||||
fd = (FrameData*)frame->opaque_ref->data;
|
||||
|
||||
ret = clone_side_data(&enc_ctx->decoded_side_data, &enc_ctx->nb_decoded_side_data,
|
||||
fd->side_data, fd->nb_side_data, AV_FRAME_SIDE_DATA_FLAG_UNIQUE);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
for (int i = 0; i < frame->nb_side_data; i++) {
|
||||
const AVSideDataDescriptor *desc = av_frame_side_data_desc(frame->side_data[i]->type);
|
||||
|
||||
if (!(desc->props & AV_SIDE_DATA_PROP_GLOBAL))
|
||||
continue;
|
||||
|
||||
ret = av_frame_side_data_clone(&enc_ctx->decoded_side_data,
|
||||
&enc_ctx->nb_decoded_side_data,
|
||||
frame->side_data[i],
|
||||
AV_FRAME_SIDE_DATA_FLAG_UNIQUE);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (ist)
|
||||
@@ -257,27 +266,11 @@ int enc_open(void *opaque, const AVFrame *frame)
|
||||
enc_ctx->bits_per_raw_sample = FFMIN(fd->bits_per_raw_sample,
|
||||
av_pix_fmt_desc_get(enc_ctx->pix_fmt)->comp[0].depth);
|
||||
|
||||
/**
|
||||
* The video color properties should always be in sync with the user-
|
||||
* requested values, since we forward them to the filter graph.
|
||||
*/
|
||||
enc_ctx->color_range = frame->color_range;
|
||||
enc_ctx->color_primaries = frame->color_primaries;
|
||||
enc_ctx->color_trc = frame->color_trc;
|
||||
enc_ctx->colorspace = frame->colorspace;
|
||||
enc_ctx->alpha_mode = frame->alpha_mode;
|
||||
|
||||
/* Video properties which are not part of filter graph negotiation */
|
||||
if (enc_ctx->chroma_sample_location == AVCHROMA_LOC_UNSPECIFIED) {
|
||||
enc_ctx->chroma_sample_location = frame->chroma_location;
|
||||
} else if (enc_ctx->chroma_sample_location != frame->chroma_location &&
|
||||
frame->chroma_location != AVCHROMA_LOC_UNSPECIFIED) {
|
||||
av_log(e, AV_LOG_WARNING,
|
||||
"Requested chroma sample location '%s' does not match the "
|
||||
"frame tagged sample location '%s'; result may be incorrect.\n",
|
||||
av_chroma_location_name(enc_ctx->chroma_sample_location),
|
||||
av_chroma_location_name(frame->chroma_location));
|
||||
}
|
||||
enc_ctx->chroma_sample_location = frame->chroma_location;
|
||||
|
||||
if (enc_ctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) ||
|
||||
(frame->flags & AV_FRAME_FLAG_INTERLACED)
|
||||
@@ -728,7 +721,7 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame,
|
||||
}
|
||||
}
|
||||
|
||||
av_unreachable("encode_frame() loop should return");
|
||||
av_assert0(0);
|
||||
}
|
||||
|
||||
static enum AVPictureType forced_kf_apply(void *logctx, KeyframeForceCtx *kf,
|
||||
@@ -768,9 +761,6 @@ static enum AVPictureType forced_kf_apply(void *logctx, KeyframeForceCtx *kf,
|
||||
}
|
||||
} else if (kf->type == KF_FORCE_SOURCE && (frame->flags & AV_FRAME_FLAG_KEY)) {
|
||||
goto force_keyframe;
|
||||
} else if (kf->type == KF_FORCE_SCD_METADATA &&
|
||||
av_dict_get(frame->metadata, "lavfi.scd.time", NULL, 0)) {
|
||||
goto force_keyframe;
|
||||
}
|
||||
|
||||
return AV_PICTURE_TYPE_NONE;
|
||||
|
||||
+64
-307
@@ -40,6 +40,9 @@
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/timestamp.h"
|
||||
|
||||
// FIXME private header, used for mid_pred()
|
||||
#include "libavcodec/mathops.h"
|
||||
|
||||
typedef struct FilterGraphPriv {
|
||||
FilterGraph fg;
|
||||
|
||||
@@ -106,9 +109,6 @@ typedef struct InputFilterPriv {
|
||||
// used to hold submitted input
|
||||
AVFrame *frame;
|
||||
|
||||
// For inputs bound to a filtergraph output
|
||||
OutputFilter *ofilter_src;
|
||||
|
||||
// source data type: AVMEDIA_TYPE_SUBTITLE for sub2video,
|
||||
// same as type otherwise
|
||||
enum AVMediaType type_src;
|
||||
@@ -125,7 +125,6 @@ typedef struct InputFilterPriv {
|
||||
AVRational sample_aspect_ratio;
|
||||
enum AVColorSpace color_space;
|
||||
enum AVColorRange color_range;
|
||||
enum AVAlphaMode alpha_mode;
|
||||
|
||||
int sample_rate;
|
||||
AVChannelLayout ch_layout;
|
||||
@@ -190,8 +189,6 @@ typedef struct OutputFilterPriv {
|
||||
void *log_parent;
|
||||
char log_name[32];
|
||||
|
||||
int needed;
|
||||
|
||||
/* desired output stream properties */
|
||||
int format;
|
||||
int width, height;
|
||||
@@ -199,12 +196,6 @@ typedef struct OutputFilterPriv {
|
||||
AVChannelLayout ch_layout;
|
||||
enum AVColorSpace color_space;
|
||||
enum AVColorRange color_range;
|
||||
enum AVAlphaMode alpha_mode;
|
||||
|
||||
unsigned crop_top;
|
||||
unsigned crop_bottom;
|
||||
unsigned crop_left;
|
||||
unsigned crop_right;
|
||||
|
||||
AVFrameSideData **side_data;
|
||||
int nb_side_data;
|
||||
@@ -223,17 +214,11 @@ typedef struct OutputFilterPriv {
|
||||
|
||||
// those are only set if no format is specified and the encoder gives us multiple options
|
||||
// They point directly to the relevant lists of the encoder.
|
||||
union {
|
||||
const enum AVPixelFormat *pix_fmts;
|
||||
const enum AVSampleFormat *sample_fmts;
|
||||
};
|
||||
const int *formats;
|
||||
const AVChannelLayout *ch_layouts;
|
||||
const int *sample_rates;
|
||||
const enum AVColorSpace *color_spaces;
|
||||
const enum AVColorRange *color_ranges;
|
||||
const enum AVAlphaMode *alpha_modes;
|
||||
|
||||
int32_t displaymatrix[9];
|
||||
|
||||
AVRational enc_timebase;
|
||||
int64_t trim_start_us;
|
||||
@@ -283,7 +268,6 @@ static int sub2video_get_blank_frame(InputFilterPriv *ifp)
|
||||
frame->format = ifp->format;
|
||||
frame->colorspace = ifp->color_space;
|
||||
frame->color_range = ifp->color_range;
|
||||
frame->alpha_mode = ifp->alpha_mode;
|
||||
|
||||
ret = av_frame_get_buffer(frame, 0);
|
||||
if (ret < 0)
|
||||
@@ -402,10 +386,10 @@ static void choose_ ## name (OutputFilterPriv *ofp, AVBPrint *bprint) \
|
||||
av_bprint_chars(bprint, ':', 1); \
|
||||
}
|
||||
|
||||
DEF_CHOOSE_FORMAT(pix_fmts, enum AVPixelFormat, format, pix_fmts,
|
||||
DEF_CHOOSE_FORMAT(pix_fmts, enum AVPixelFormat, format, formats,
|
||||
AV_PIX_FMT_NONE, "%s", av_get_pix_fmt_name)
|
||||
|
||||
DEF_CHOOSE_FORMAT(sample_fmts, enum AVSampleFormat, format, sample_fmts,
|
||||
DEF_CHOOSE_FORMAT(sample_fmts, enum AVSampleFormat, format, formats,
|
||||
AV_SAMPLE_FMT_NONE, "%s", av_get_sample_fmt_name)
|
||||
|
||||
DEF_CHOOSE_FORMAT(sample_rates, int, sample_rate, sample_rates, 0,
|
||||
@@ -417,9 +401,6 @@ DEF_CHOOSE_FORMAT(color_spaces, enum AVColorSpace, color_space, color_spaces,
|
||||
DEF_CHOOSE_FORMAT(color_ranges, enum AVColorRange, color_range, color_ranges,
|
||||
AVCOL_RANGE_UNSPECIFIED, "%s", av_color_range_name);
|
||||
|
||||
DEF_CHOOSE_FORMAT(alpha_modes, enum AVAlphaMode, alpha_mode, alpha_modes,
|
||||
AVALPHA_MODE_UNSPECIFIED, "%s", av_alpha_mode_name);
|
||||
|
||||
static void choose_channel_layouts(OutputFilterPriv *ofp, AVBPrint *bprint)
|
||||
{
|
||||
if (av_channel_layout_check(&ofp->ch_layout)) {
|
||||
@@ -519,7 +500,7 @@ static int filter_opt_apply(void *logctx, AVFilterContext *f,
|
||||
ret = av_opt_set_bin(f, key, data, len, AV_OPT_SEARCH_CHILDREN);
|
||||
av_freep(&data);
|
||||
} else {
|
||||
char *data = read_file_to_string(val);
|
||||
char *data = file_read(val);
|
||||
if (!data) {
|
||||
ret = AVERROR(EIO);
|
||||
goto err_load;
|
||||
@@ -669,7 +650,6 @@ static OutputFilter *ofilter_alloc(FilterGraph *fg, enum AVMediaType type)
|
||||
ofp->format = -1;
|
||||
ofp->color_space = AVCOL_SPC_UNSPECIFIED;
|
||||
ofp->color_range = AVCOL_RANGE_UNSPECIFIED;
|
||||
ofp->alpha_mode = AVALPHA_MODE_UNSPECIFIED;
|
||||
ofilter->index = fg->nb_outputs - 1;
|
||||
|
||||
snprintf(ofp->log_name, sizeof(ofp->log_name), "%co%d",
|
||||
@@ -822,10 +802,10 @@ int ofilter_bind_enc(OutputFilter *ofilter, unsigned sched_idx_enc,
|
||||
av_assert0(!opts->enc ||
|
||||
ofilter->type == opts->enc->type);
|
||||
|
||||
ofp->needed = ofilter->bound = 1;
|
||||
ofilter->bound = 1;
|
||||
av_freep(&ofilter->linklabel);
|
||||
|
||||
ofp->flags |= opts->flags;
|
||||
ofp->flags = opts->flags;
|
||||
ofp->ts_offset = opts->ts_offset;
|
||||
ofp->enc_timebase = opts->output_tb;
|
||||
|
||||
@@ -862,7 +842,7 @@ int ofilter_bind_enc(OutputFilter *ofilter, unsigned sched_idx_enc,
|
||||
if (opts->format != AV_PIX_FMT_NONE) {
|
||||
ofp->format = opts->format;
|
||||
} else
|
||||
ofp->pix_fmts = opts->pix_fmts;
|
||||
ofp->formats = opts->formats;
|
||||
|
||||
if (opts->color_space != AVCOL_SPC_UNSPECIFIED)
|
||||
ofp->color_space = opts->color_space;
|
||||
@@ -874,11 +854,6 @@ int ofilter_bind_enc(OutputFilter *ofilter, unsigned sched_idx_enc,
|
||||
else
|
||||
ofp->color_ranges = opts->color_ranges;
|
||||
|
||||
if (opts->alpha_mode != AVALPHA_MODE_UNSPECIFIED)
|
||||
ofp->alpha_mode = opts->alpha_mode;
|
||||
else
|
||||
ofp->alpha_modes = opts->alpha_modes;
|
||||
|
||||
fgp->disable_conversions |= !!(ofp->flags & OFILTER_FLAG_DISABLE_CONVERT);
|
||||
|
||||
ofp->fps.last_frame = av_frame_alloc();
|
||||
@@ -901,7 +876,7 @@ int ofilter_bind_enc(OutputFilter *ofilter, unsigned sched_idx_enc,
|
||||
if (opts->format != AV_SAMPLE_FMT_NONE) {
|
||||
ofp->format = opts->format;
|
||||
} else {
|
||||
ofp->sample_fmts = opts->sample_fmts;
|
||||
ofp->formats = opts->formats;
|
||||
}
|
||||
if (opts->sample_rate) {
|
||||
ofp->sample_rate = opts->sample_rate;
|
||||
@@ -933,15 +908,13 @@ static int ofilter_bind_ifilter(OutputFilter *ofilter, InputFilterPriv *ifp,
|
||||
av_assert0(!ofilter->bound);
|
||||
av_assert0(ofilter->type == ifp->ifilter.type);
|
||||
|
||||
ofp->needed = ofilter->bound = 1;
|
||||
ofilter->bound = 1;
|
||||
av_freep(&ofilter->linklabel);
|
||||
|
||||
ofilter->output_name = av_strdup(opts->name);
|
||||
if (!ofilter->output_name)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
ifp->ofilter_src = ofilter;
|
||||
|
||||
av_strlcatf(ofp->log_name, sizeof(ofp->log_name), "->%s", ofilter->output_name);
|
||||
|
||||
return 0;
|
||||
@@ -1004,7 +977,6 @@ static InputFilter *ifilter_alloc(FilterGraph *fg)
|
||||
ifp->format = -1;
|
||||
ifp->color_space = AVCOL_SPC_UNSPECIFIED;
|
||||
ifp->color_range = AVCOL_RANGE_UNSPECIFIED;
|
||||
ifp->alpha_mode = AVALPHA_MODE_UNSPECIFIED;
|
||||
|
||||
ifp->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW);
|
||||
if (!ifp->frame_queue)
|
||||
@@ -1085,8 +1057,7 @@ static const AVClass fg_class = {
|
||||
.category = AV_CLASS_CATEGORY_FILTER,
|
||||
};
|
||||
|
||||
int fg_create(FilterGraph **pfg, char **graph_desc, Scheduler *sch,
|
||||
const OutputFilterOptions *opts)
|
||||
int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch)
|
||||
{
|
||||
FilterGraphPriv *fgp;
|
||||
FilterGraph *fg;
|
||||
@@ -1097,7 +1068,7 @@ int fg_create(FilterGraph **pfg, char **graph_desc, Scheduler *sch,
|
||||
|
||||
fgp = av_mallocz(sizeof(*fgp));
|
||||
if (!fgp) {
|
||||
av_freep(graph_desc);
|
||||
av_freep(&graph_desc);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
fg = &fgp->fg;
|
||||
@@ -1108,7 +1079,7 @@ int fg_create(FilterGraph **pfg, char **graph_desc, Scheduler *sch,
|
||||
} else {
|
||||
ret = av_dynarray_add_nofree(&filtergraphs, &nb_filtergraphs, fgp);
|
||||
if (ret < 0) {
|
||||
av_freep(graph_desc);
|
||||
av_freep(&graph_desc);
|
||||
av_freep(&fgp);
|
||||
return ret;
|
||||
}
|
||||
@@ -1117,13 +1088,11 @@ int fg_create(FilterGraph **pfg, char **graph_desc, Scheduler *sch,
|
||||
}
|
||||
|
||||
fg->class = &fg_class;
|
||||
fg->graph_desc = *graph_desc;
|
||||
fg->graph_desc = graph_desc;
|
||||
fgp->disable_conversions = !auto_conversion_filters;
|
||||
fgp->nb_threads = -1;
|
||||
fgp->sch = sch;
|
||||
|
||||
*graph_desc = NULL;
|
||||
|
||||
snprintf(fgp->log_name, sizeof(fgp->log_name), "fc#%d", fg->index);
|
||||
|
||||
fgp->frame = av_frame_alloc();
|
||||
@@ -1185,13 +1154,11 @@ int fg_create(FilterGraph **pfg, char **graph_desc, Scheduler *sch,
|
||||
const enum AVMediaType type = avfilter_pad_get_type(cur->filter_ctx->output_pads,
|
||||
cur->pad_idx);
|
||||
OutputFilter *const ofilter = ofilter_alloc(fg, type);
|
||||
OutputFilterPriv *ofp;
|
||||
|
||||
if (!ofilter) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
ofp = ofp_from_ofilter(ofilter);
|
||||
|
||||
ofilter->linklabel = cur->name;
|
||||
cur->name = NULL;
|
||||
@@ -1201,25 +1168,6 @@ int fg_create(FilterGraph **pfg, char **graph_desc, Scheduler *sch,
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
// opts should only be needed in this function to fill fields from filtergraphs
|
||||
// whose output is meant to be treated as if it was stream, e.g. merged HEIF
|
||||
// tile groups.
|
||||
if (opts) {
|
||||
ofp->flags = opts->flags;
|
||||
ofp->side_data = opts->side_data;
|
||||
ofp->nb_side_data = opts->nb_side_data;
|
||||
|
||||
ofp->crop_top = opts->crop_top;
|
||||
ofp->crop_bottom = opts->crop_bottom;
|
||||
ofp->crop_left = opts->crop_left;
|
||||
ofp->crop_right = opts->crop_right;
|
||||
|
||||
const AVFrameSideData *sd = av_frame_side_data_get(ofp->side_data, ofp->nb_side_data,
|
||||
AV_FRAME_DATA_DISPLAYMATRIX);
|
||||
if (sd)
|
||||
memcpy(ofp->displaymatrix, sd->data, sizeof(ofp->displaymatrix));
|
||||
}
|
||||
}
|
||||
|
||||
if (!fg->nb_outputs) {
|
||||
@@ -1247,7 +1195,7 @@ fail:
|
||||
|
||||
int fg_create_simple(FilterGraph **pfg,
|
||||
InputStream *ist,
|
||||
char **graph_desc,
|
||||
char *graph_desc,
|
||||
Scheduler *sch, unsigned sched_idx_enc,
|
||||
const OutputFilterOptions *opts)
|
||||
{
|
||||
@@ -1256,7 +1204,7 @@ int fg_create_simple(FilterGraph **pfg,
|
||||
FilterGraphPriv *fgp;
|
||||
int ret;
|
||||
|
||||
ret = fg_create(pfg, graph_desc, sch, NULL);
|
||||
ret = fg_create(pfg, graph_desc, sch);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
fg = *pfg;
|
||||
@@ -1272,7 +1220,7 @@ int fg_create_simple(FilterGraph **pfg,
|
||||
"to have exactly 1 input and 1 output. "
|
||||
"However, it had %d input(s) and %d output(s). Please adjust, "
|
||||
"or use a complex filtergraph (-filter_complex) instead.\n",
|
||||
*graph_desc, fg->nb_inputs, fg->nb_outputs);
|
||||
graph_desc, fg->nb_inputs, fg->nb_outputs);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (fg->outputs[0]->type != type) {
|
||||
@@ -1297,7 +1245,7 @@ int fg_create_simple(FilterGraph **pfg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fg_complex_bind_input(FilterGraph *fg, InputFilter *ifilter, int commit)
|
||||
static int fg_complex_bind_input(FilterGraph *fg, InputFilter *ifilter)
|
||||
{
|
||||
InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
|
||||
InputStream *ist = NULL;
|
||||
@@ -1348,20 +1296,15 @@ static int fg_complex_bind_input(FilterGraph *fg, InputFilter *ifilter, int comm
|
||||
|
||||
if (!ofilter->bound && ofilter->linklabel &&
|
||||
!strcmp(ofilter->linklabel, ifilter->linklabel)) {
|
||||
if (commit) {
|
||||
av_log(fg, AV_LOG_VERBOSE,
|
||||
"Binding input with label '%s' to filtergraph output %d:%d\n",
|
||||
ifilter->linklabel, i, j);
|
||||
av_log(fg, AV_LOG_VERBOSE,
|
||||
"Binding input with label '%s' to filtergraph output %d:%d\n",
|
||||
ifilter->linklabel, i, j);
|
||||
|
||||
ret = ifilter_bind_fg(ifp, fg_src, j);
|
||||
if (ret < 0) {
|
||||
av_log(fg, AV_LOG_ERROR, "Error binding filtergraph input %s\n",
|
||||
ifilter->linklabel);
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
ofp_from_ofilter(ofilter)->needed = 1;
|
||||
return 0;
|
||||
ret = ifilter_bind_fg(ifp, fg_src, j);
|
||||
if (ret < 0)
|
||||
av_log(fg, AV_LOG_ERROR, "Error binding filtergraph input %s\n",
|
||||
ifilter->linklabel);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1409,38 +1352,10 @@ static int fg_complex_bind_input(FilterGraph *fg, InputFilter *ifilter, int comm
|
||||
}
|
||||
ist = input_files[file_idx]->streams[st->index];
|
||||
|
||||
if (commit)
|
||||
av_log(fg, AV_LOG_VERBOSE,
|
||||
"Binding input with label '%s' to input stream %d:%d\n",
|
||||
ifilter->linklabel, ist->file->index, ist->index);
|
||||
av_log(fg, AV_LOG_VERBOSE,
|
||||
"Binding input with label '%s' to input stream %d:%d\n",
|
||||
ifilter->linklabel, ist->file->index, ist->index);
|
||||
} else {
|
||||
// try finding an unbound filtergraph output
|
||||
for (int i = 0; i < nb_filtergraphs; i++) {
|
||||
FilterGraph *fg_src = filtergraphs[i];
|
||||
|
||||
if (fg == fg_src)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < fg_src->nb_outputs; j++) {
|
||||
OutputFilter *ofilter = fg_src->outputs[j];
|
||||
|
||||
if (!ofilter->bound) {
|
||||
if (commit) {
|
||||
av_log(fg, AV_LOG_VERBOSE,
|
||||
"Binding unlabeled filtergraph input to filtergraph output %d:%d\n", i, j);
|
||||
|
||||
ret = ifilter_bind_fg(ifp, fg_src, j);
|
||||
if (ret < 0) {
|
||||
av_log(fg, AV_LOG_ERROR, "Error binding filtergraph input %d:%d\n", i, j);
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
ofp_from_ofilter(ofilter)->needed = 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ist = ist_find_unused(type);
|
||||
if (!ist) {
|
||||
av_log(fg, AV_LOG_FATAL,
|
||||
@@ -1450,27 +1365,24 @@ static int fg_complex_bind_input(FilterGraph *fg, InputFilter *ifilter, int comm
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (commit)
|
||||
av_log(fg, AV_LOG_VERBOSE,
|
||||
"Binding unlabeled input %d to input stream %d:%d\n",
|
||||
ifilter->index, ist->file->index, ist->index);
|
||||
av_log(fg, AV_LOG_VERBOSE,
|
||||
"Binding unlabeled input %d to input stream %d:%d\n",
|
||||
ifilter->index, ist->file->index, ist->index);
|
||||
}
|
||||
av_assert0(ist);
|
||||
|
||||
if (commit) {
|
||||
ret = ifilter_bind_ist(ifilter, ist, &vs);
|
||||
if (ret < 0) {
|
||||
av_log(fg, AV_LOG_ERROR,
|
||||
"Error binding an input stream to complex filtergraph input %s.\n",
|
||||
ifilter->name);
|
||||
return ret;
|
||||
}
|
||||
ret = ifilter_bind_ist(ifilter, ist, &vs);
|
||||
if (ret < 0) {
|
||||
av_log(fg, AV_LOG_ERROR,
|
||||
"Error binding an input stream to complex filtergraph input %s.\n",
|
||||
ifilter->name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bind_inputs(FilterGraph *fg, int commit)
|
||||
static int bind_inputs(FilterGraph *fg)
|
||||
{
|
||||
// bind filtergraph inputs to input streams or other filtergraphs
|
||||
for (int i = 0; i < fg->nb_inputs; i++) {
|
||||
@@ -1480,7 +1392,7 @@ static int bind_inputs(FilterGraph *fg, int commit)
|
||||
if (ifp->bound)
|
||||
continue;
|
||||
|
||||
ret = fg_complex_bind_input(fg, &ifp->ifilter, commit);
|
||||
ret = fg_complex_bind_input(fg, &ifp->ifilter);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
@@ -1493,49 +1405,27 @@ int fg_finalise_bindings(void)
|
||||
int ret;
|
||||
|
||||
for (int i = 0; i < nb_filtergraphs; i++) {
|
||||
ret = bind_inputs(filtergraphs[i], 0);
|
||||
ret = bind_inputs(filtergraphs[i]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// check that all outputs were bound
|
||||
for (int i = nb_filtergraphs - 1; i >= 0; i--) {
|
||||
for (int i = 0; i < nb_filtergraphs; i++) {
|
||||
FilterGraph *fg = filtergraphs[i];
|
||||
FilterGraphPriv *fgp = fgp_from_fg(filtergraphs[i]);
|
||||
|
||||
for (int j = 0; j < fg->nb_outputs; j++) {
|
||||
OutputFilter *output = fg->outputs[j];
|
||||
if (!ofp_from_ofilter(output)->needed) {
|
||||
if (!fg->is_internal) {
|
||||
av_log(fg, AV_LOG_FATAL,
|
||||
"Filter '%s' has output %d (%s) unconnected\n",
|
||||
output->name, j,
|
||||
output->linklabel ? (const char *)output->linklabel : "unlabeled");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
av_log(fg, AV_LOG_DEBUG,
|
||||
"Internal filter '%s' has output %d (%s) unconnected. Removing graph\n",
|
||||
if (!output->bound) {
|
||||
av_log(fg, AV_LOG_FATAL,
|
||||
"Filter '%s' has output %d (%s) unconnected\n",
|
||||
output->name, j,
|
||||
output->linklabel ? (const char *)output->linklabel : "unlabeled");
|
||||
sch_remove_filtergraph(fgp->sch, fgp->sch_idx);
|
||||
fg_free(&filtergraphs[i]);
|
||||
nb_filtergraphs--;
|
||||
if (nb_filtergraphs > 0)
|
||||
memmove(&filtergraphs[i],
|
||||
&filtergraphs[i + 1],
|
||||
(nb_filtergraphs - i) * sizeof(*filtergraphs));
|
||||
break;
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < nb_filtergraphs; i++) {
|
||||
ret = bind_inputs(filtergraphs[i], 1);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1634,53 +1524,6 @@ static int configure_output_video_filter(FilterGraphPriv *fgp, AVFilterGraph *gr
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (ofp->flags & OFILTER_FLAG_CROP) {
|
||||
char crop_buf[64];
|
||||
snprintf(crop_buf, sizeof(crop_buf), "w=iw-%u-%u:h=ih-%u-%u:x=%u:y=%u",
|
||||
ofp->crop_left, ofp->crop_right,
|
||||
ofp->crop_top, ofp->crop_bottom,
|
||||
ofp->crop_left, ofp->crop_top);
|
||||
ret = insert_filter(&last_filter, &pad_idx, "crop", crop_buf);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ofp->flags & OFILTER_FLAG_AUTOROTATE) {
|
||||
int32_t *displaymatrix = ofp->displaymatrix;
|
||||
double theta;
|
||||
|
||||
theta = get_rotation(displaymatrix);
|
||||
|
||||
if (fabs(theta - 90) < 1.0) {
|
||||
ret = insert_filter(&last_filter, &pad_idx, "transpose",
|
||||
displaymatrix[3] > 0 ? "cclock_flip" : "clock");
|
||||
} else if (fabs(theta - 180) < 1.0) {
|
||||
if (displaymatrix[0] < 0) {
|
||||
ret = insert_filter(&last_filter, &pad_idx, "hflip", NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
if (displaymatrix[4] < 0) {
|
||||
ret = insert_filter(&last_filter, &pad_idx, "vflip", NULL);
|
||||
}
|
||||
} else if (fabs(theta - 270) < 1.0) {
|
||||
ret = insert_filter(&last_filter, &pad_idx, "transpose",
|
||||
displaymatrix[3] < 0 ? "clock_flip" : "cclock");
|
||||
} else if (fabs(theta) > 1.0) {
|
||||
char rotate_buf[64];
|
||||
snprintf(rotate_buf, sizeof(rotate_buf), "%f*PI/180", theta);
|
||||
ret = insert_filter(&last_filter, &pad_idx, "rotate", rotate_buf);
|
||||
} else if (fabs(theta) < 1.0) {
|
||||
if (displaymatrix && displaymatrix[4] < 0) {
|
||||
ret = insert_filter(&last_filter, &pad_idx, "vflip", NULL);
|
||||
}
|
||||
}
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
av_frame_side_data_remove(&ofp->side_data, &ofp->nb_side_data, AV_FRAME_DATA_DISPLAYMATRIX);
|
||||
}
|
||||
|
||||
if ((ofp->width || ofp->height) && (ofp->flags & OFILTER_FLAG_AUTOSCALE)) {
|
||||
char args[255];
|
||||
AVFilterContext *filter;
|
||||
@@ -1705,12 +1548,11 @@ static int configure_output_video_filter(FilterGraphPriv *fgp, AVFilterGraph *gr
|
||||
}
|
||||
|
||||
av_assert0(!(ofp->flags & OFILTER_FLAG_DISABLE_CONVERT) ||
|
||||
ofp->format != AV_PIX_FMT_NONE || !ofp->pix_fmts);
|
||||
ofp->format != AV_PIX_FMT_NONE || !ofp->formats);
|
||||
av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED);
|
||||
choose_pix_fmts(ofp, &bprint);
|
||||
choose_color_spaces(ofp, &bprint);
|
||||
choose_color_ranges(ofp, &bprint);
|
||||
choose_alpha_modes(ofp, &bprint);
|
||||
if (!av_bprint_is_complete(&bprint))
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -1881,7 +1723,6 @@ static int configure_input_video_filter(FilterGraph *fg, AVFilterGraph *graph,
|
||||
ifp->sample_aspect_ratio : (AVRational){ 0, 1 };
|
||||
par->color_space = ifp->color_space;
|
||||
par->color_range = ifp->color_range;
|
||||
par->alpha_mode = ifp->alpha_mode;
|
||||
par->hw_frames_ctx = ifp->hw_frames_ctx;
|
||||
par->side_data = ifp->side_data;
|
||||
par->nb_side_data = ifp->nb_side_data;
|
||||
@@ -2159,7 +2000,6 @@ static int configure_filtergraph(FilterGraph *fg, FilterGraphThread *fgt)
|
||||
ofp->height = av_buffersink_get_h(sink);
|
||||
ofp->color_space = av_buffersink_get_colorspace(sink);
|
||||
ofp->color_range = av_buffersink_get_color_range(sink);
|
||||
ofp->alpha_mode = av_buffersink_get_alpha_mode(sink);
|
||||
|
||||
// If the timing parameters are not locked yet, get the tentative values
|
||||
// here but don't lock them. They will only be used if no output frames
|
||||
@@ -2178,11 +2018,12 @@ static int configure_filtergraph(FilterGraph *fg, FilterGraphThread *fgt)
|
||||
ret = av_buffersink_get_ch_layout(sink, &ofp->ch_layout);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
av_frame_side_data_free(&ofp->side_data, &ofp->nb_side_data);
|
||||
sd = av_buffersink_get_side_data(sink, &nb_sd);
|
||||
if (nb_sd)
|
||||
for (int j = 0; j < nb_sd; j++) {
|
||||
ret = av_frame_side_data_clone(&ofp->side_data, &ofp->nb_side_data,
|
||||
sd[j], AV_FRAME_SIDE_DATA_FLAG_REPLACE);
|
||||
sd[j], 0);
|
||||
if (ret < 0) {
|
||||
av_frame_side_data_free(&ofp->side_data, &ofp->nb_side_data);
|
||||
goto fail;
|
||||
@@ -2255,7 +2096,6 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr
|
||||
ifp->sample_aspect_ratio = frame->sample_aspect_ratio;
|
||||
ifp->color_space = frame->colorspace;
|
||||
ifp->color_range = frame->color_range;
|
||||
ifp->alpha_mode = frame->alpha_mode;
|
||||
|
||||
ifp->sample_rate = frame->sample_rate;
|
||||
ret = av_channel_layout_copy(&ifp->ch_layout, &frame->ch_layout);
|
||||
@@ -2266,8 +2106,7 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr
|
||||
for (int i = 0; i < frame->nb_side_data; i++) {
|
||||
const AVSideDataDescriptor *desc = av_frame_side_data_desc(frame->side_data[i]->type);
|
||||
|
||||
if (!(desc->props & AV_SIDE_DATA_PROP_GLOBAL) ||
|
||||
frame->side_data[i]->type == AV_FRAME_DATA_DISPLAYMATRIX)
|
||||
if (!(desc->props & AV_SIDE_DATA_PROP_GLOBAL))
|
||||
continue;
|
||||
|
||||
ret = av_frame_side_data_clone(&ifp->side_data,
|
||||
@@ -2298,27 +2137,6 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ifilter_parameters_from_ofilter(InputFilter *ifilter, OutputFilter *ofilter)
|
||||
{
|
||||
const OutputFilterPriv *ofp = ofp_from_ofilter(ofilter);
|
||||
InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
|
||||
|
||||
if (!ifp->opts.framerate.num) {
|
||||
ifp->opts.framerate = ofp->fps.framerate;
|
||||
if (ifp->opts.framerate.num > 0 && ifp->opts.framerate.den > 0)
|
||||
ifp->opts.flags |= IFILTER_FLAG_CFR;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ofp->nb_side_data; i++) {
|
||||
int ret = av_frame_side_data_clone(&ifp->side_data, &ifp->nb_side_data,
|
||||
ofp->side_data[i], AV_FRAME_SIDE_DATA_FLAG_REPLACE);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int filtergraph_is_simple(const FilterGraph *fg)
|
||||
{
|
||||
const FilterGraphPriv *fgp = cfgp_from_cfg(fg);
|
||||
@@ -2489,23 +2307,6 @@ early_exit:
|
||||
return float_pts;
|
||||
}
|
||||
|
||||
static int64_t median3(int64_t a, int64_t b, int64_t c)
|
||||
{
|
||||
int64_t max2, min2, m;
|
||||
|
||||
if (a >= b) {
|
||||
max2 = a;
|
||||
min2 = b;
|
||||
} else {
|
||||
max2 = b;
|
||||
min2 = a;
|
||||
}
|
||||
m = (c >= max2) ? max2 : c;
|
||||
|
||||
return (m >= min2) ? m : min2;
|
||||
}
|
||||
|
||||
|
||||
/* Convert frame timestamps to the encoder timebase and decide how many times
|
||||
* should this (and possibly previous) frame be repeated in order to conform to
|
||||
* desired target framerate (if any).
|
||||
@@ -2518,9 +2319,9 @@ static void video_sync_process(OutputFilterPriv *ofp, AVFrame *frame,
|
||||
double delta0, delta, sync_ipts, duration;
|
||||
|
||||
if (!frame) {
|
||||
*nb_frames_prev = *nb_frames = median3(fps->frames_prev_hist[0],
|
||||
fps->frames_prev_hist[1],
|
||||
fps->frames_prev_hist[2]);
|
||||
*nb_frames_prev = *nb_frames = mid_pred(fps->frames_prev_hist[0],
|
||||
fps->frames_prev_hist[1],
|
||||
fps->frames_prev_hist[2]);
|
||||
|
||||
if (!*nb_frames && fps->last_dropped) {
|
||||
atomic_fetch_add(&ofilter->nb_frames_drop, 1);
|
||||
@@ -2633,16 +2434,6 @@ finish:
|
||||
fps->dropped_keyframe |= fps->last_dropped && (frame->flags & AV_FRAME_FLAG_KEY);
|
||||
}
|
||||
|
||||
static void close_input(InputFilterPriv *ifp)
|
||||
{
|
||||
FilterGraphPriv *fgp = fgp_from_fg(ifp->ifilter.graph);
|
||||
|
||||
if (!ifp->eof) {
|
||||
sch_filter_receive_finish(fgp->sch, fgp->sch_idx, ifp->ifilter.index);
|
||||
ifp->eof = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static int close_output(OutputFilterPriv *ofp, FilterGraphThread *fgt)
|
||||
{
|
||||
FilterGraphPriv *fgp = fgp_from_fg(ofp->ofilter.graph);
|
||||
@@ -2667,17 +2458,16 @@ static int close_output(OutputFilterPriv *ofp, FilterGraphThread *fgt)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
av_frame_side_data_free(&frame->side_data, &frame->nb_side_data);
|
||||
ret = clone_side_data(&frame->side_data, &frame->nb_side_data,
|
||||
ofp->side_data, ofp->nb_side_data, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
fd = frame_data(frame);
|
||||
if (!fd)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
av_frame_side_data_free(&fd->side_data, &fd->nb_side_data);
|
||||
ret = clone_side_data(&fd->side_data, &fd->nb_side_data,
|
||||
ofp->side_data, ofp->nb_side_data, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
fd->frame_rate_filter = ofp->fps.framerate;
|
||||
|
||||
av_assert0(!frame->buf[0]);
|
||||
@@ -2832,14 +2622,6 @@ static int fg_output_step(OutputFilterPriv *ofp, FilterGraphThread *fgt,
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
av_frame_side_data_free(&fd->side_data, &fd->nb_side_data);
|
||||
if (!fgt->got_frame) {
|
||||
ret = clone_side_data(&fd->side_data, &fd->nb_side_data,
|
||||
ofp->side_data, ofp->nb_side_data, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
fd->wallclock[LATENCY_PROBE_FILTER_POST] = av_gettime_relative();
|
||||
|
||||
// only use bits_per_raw_sample passed through from the decoder
|
||||
@@ -3027,7 +2809,6 @@ static int send_eof(FilterGraphThread *fgt, InputFilter *ifilter,
|
||||
ifp->sample_aspect_ratio = ifp->opts.fallback->sample_aspect_ratio;
|
||||
ifp->color_space = ifp->opts.fallback->colorspace;
|
||||
ifp->color_range = ifp->opts.fallback->color_range;
|
||||
ifp->alpha_mode = ifp->opts.fallback->alpha_mode;
|
||||
ifp->time_base = ifp->opts.fallback->time_base;
|
||||
|
||||
ret = av_channel_layout_copy(&ifp->ch_layout,
|
||||
@@ -3078,7 +2859,6 @@ static const char *unknown_if_null(const char *str)
|
||||
static int send_frame(FilterGraph *fg, FilterGraphThread *fgt,
|
||||
InputFilter *ifilter, AVFrame *frame)
|
||||
{
|
||||
FilterGraphPriv *fgp = fgp_from_fg(fg);
|
||||
InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
|
||||
FrameData *fd;
|
||||
AVFrameSideData *sd;
|
||||
@@ -3097,8 +2877,7 @@ static int send_frame(FilterGraph *fg, FilterGraphThread *fgt,
|
||||
ifp->width != frame->width ||
|
||||
ifp->height != frame->height ||
|
||||
ifp->color_space != frame->colorspace ||
|
||||
ifp->color_range != frame->color_range ||
|
||||
ifp->alpha_mode != frame->alpha_mode)
|
||||
ifp->color_range != frame->color_range)
|
||||
need_reinit |= VIDEO_CHANGED;
|
||||
break;
|
||||
}
|
||||
@@ -3135,14 +2914,6 @@ static int send_frame(FilterGraph *fg, FilterGraphThread *fgt,
|
||||
ret = ifilter_parameters_from_frame(ifilter, frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Inputs bound to a filtergraph output will have some fields unset.
|
||||
* Handle them here */
|
||||
if (ifp->ofilter_src) {
|
||||
ret = ifilter_parameters_from_ofilter(ifilter, ifp->ofilter_src);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* (re)init the graph if possible, otherwise buffer the frame and return */
|
||||
@@ -3180,11 +2951,9 @@ static int send_frame(FilterGraph *fg, FilterGraphThread *fgt,
|
||||
const char *pixel_format_name = av_get_pix_fmt_name(frame->format);
|
||||
const char *color_space_name = av_color_space_name(frame->colorspace);
|
||||
const char *color_range_name = av_color_range_name(frame->color_range);
|
||||
const char *alpha_mode = av_alpha_mode_name(frame->alpha_mode);
|
||||
av_bprintf(&reason, "video parameters changed to %s(%s, %s), %dx%d, %s alpha,",
|
||||
av_bprintf(&reason, "video parameters changed to %s(%s, %s), %dx%d, ",
|
||||
unknown_if_null(pixel_format_name), unknown_if_null(color_range_name),
|
||||
unknown_if_null(color_space_name), frame->width, frame->height,
|
||||
unknown_if_null(alpha_mode));
|
||||
unknown_if_null(color_space_name), frame->width, frame->height);
|
||||
}
|
||||
if (need_reinit & MATRIX_CHANGED)
|
||||
av_bprintf(&reason, "display matrix changed, ");
|
||||
@@ -3195,11 +2964,6 @@ static int send_frame(FilterGraph *fg, FilterGraphThread *fgt,
|
||||
if (reason.len > 1)
|
||||
reason.str[reason.len - 2] = '\0'; // remove last comma
|
||||
av_log(fg, AV_LOG_INFO, "Reconfiguring filter graph%s%s\n", reason.len ? " because " : "", reason.str);
|
||||
} else {
|
||||
/* Choke all input to avoid buffering excessive frames while the
|
||||
* initial filter graph is being configured, and before we have a
|
||||
* preferred input */
|
||||
sch_filter_choke_inputs(fgp->sch, fgp->sch_idx);
|
||||
}
|
||||
|
||||
ret = configure_filtergraph(fg, fgt);
|
||||
@@ -3370,7 +3134,7 @@ static int filter_thread(void *arg)
|
||||
if (ret == AVERROR_EOF) {
|
||||
av_log(fg, AV_LOG_VERBOSE, "Input %u no longer accepts new data\n",
|
||||
input_idx);
|
||||
close_input(ifp);
|
||||
sch_filter_receive_finish(fgp->sch, fgp->sch_idx, input_idx);
|
||||
continue;
|
||||
}
|
||||
if (ret < 0)
|
||||
@@ -3389,13 +3153,6 @@ read_frames:
|
||||
av_err2str(ret));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
// ensure all inputs no longer accepting data are closed
|
||||
for (int i = 0; fgt.graph && i < fg->nb_inputs; i++) {
|
||||
InputFilterPriv *ifp = ifp_from_ifilter(fg->inputs[i]);
|
||||
if (av_buffersrc_get_status(ifp->ifilter.filter))
|
||||
close_input(ifp);
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < fg->nb_outputs; i++) {
|
||||
|
||||
+11
-79
@@ -453,7 +453,7 @@ static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc,
|
||||
}
|
||||
|
||||
if (filters_script)
|
||||
*dst = read_file_to_string(filters_script);
|
||||
*dst = file_read(filters_script);
|
||||
else
|
||||
#endif
|
||||
if (filters)
|
||||
@@ -482,9 +482,9 @@ static int parse_matrix_coeffs(void *logctx, uint16_t *dest, const char *str)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pixfmt_in_list(const enum AVPixelFormat *formats, enum AVPixelFormat format)
|
||||
static int fmt_in_list(const int *formats, int format)
|
||||
{
|
||||
for (; *formats != AV_PIX_FMT_NONE; formats++)
|
||||
for (; *formats != -1; formats++)
|
||||
if (*formats == format)
|
||||
return 1;
|
||||
return 0;
|
||||
@@ -544,7 +544,7 @@ static enum AVPixelFormat pix_fmt_parse(OutputStream *ost, const char *name)
|
||||
* endianness by av_get_pix_fmt();
|
||||
* the following code handles the case when the native endianness is not
|
||||
* supported by the encoder, but the other one is */
|
||||
if (fmts && !pixfmt_in_list(fmts, fmt)) {
|
||||
if (fmts && !fmt_in_list(fmts, fmt)) {
|
||||
const char *name_canonical = av_get_pix_fmt_name(fmt);
|
||||
int len = strlen(name_canonical);
|
||||
|
||||
@@ -557,7 +557,7 @@ static enum AVPixelFormat pix_fmt_parse(OutputStream *ost, const char *name)
|
||||
snprintf(name_other, sizeof(name_other), "%s%ce",
|
||||
name, name_canonical[len - 2] == 'l' ? 'b' : 'l');
|
||||
fmt_other = av_get_pix_fmt(name_other);
|
||||
if (fmt_other != AV_PIX_FMT_NONE && pixfmt_in_list(fmts, fmt_other)) {
|
||||
if (fmt_other != AV_PIX_FMT_NONE && fmt_in_list(fmts, fmt_other)) {
|
||||
av_log(ost, AV_LOG_VERBOSE, "Mapping pixel format %s->%s\n",
|
||||
name, name_other);
|
||||
fmt = fmt_other;
|
||||
@@ -565,7 +565,7 @@ static enum AVPixelFormat pix_fmt_parse(OutputStream *ost, const char *name)
|
||||
}
|
||||
}
|
||||
|
||||
if (fmts && !pixfmt_in_list(fmts, fmt))
|
||||
if (fmts && !fmt_in_list(fmts, fmt))
|
||||
fmt = choose_pixel_fmt(ost->enc->enc_ctx, fmt);
|
||||
|
||||
return fmt;
|
||||
@@ -730,14 +730,9 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o,
|
||||
AV_OPT_SEARCH_CHILDREN) > 0)
|
||||
av_opt_set(video_enc, "stats", logfilename,
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
} else if (!strcmp(video_enc->codec->name, "libx265")) {
|
||||
if (av_opt_is_set_to_default_by_name(video_enc, "x265-stats",
|
||||
AV_OPT_SEARCH_CHILDREN) > 0)
|
||||
av_opt_set(video_enc, "x265-stats", logfilename,
|
||||
AV_OPT_SEARCH_CHILDREN);
|
||||
} else {
|
||||
if (video_enc->flags & AV_CODEC_FLAG_PASS2) {
|
||||
char *logbuffer = read_file_to_string(logfilename);
|
||||
char *logbuffer = file_read(logfilename);
|
||||
|
||||
if (!logbuffer) {
|
||||
av_log(ost, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
|
||||
@@ -922,7 +917,6 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter,
|
||||
.height = enc_ctx->height,
|
||||
.color_space = enc_ctx->colorspace,
|
||||
.color_range = enc_ctx->color_range,
|
||||
.alpha_mode = enc_ctx->alpha_mode,
|
||||
.vsync_method = vsync_method,
|
||||
.frame_rate = ms->frame_rate,
|
||||
.max_frame_rate = ms->max_frame_rate,
|
||||
@@ -949,7 +943,7 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter,
|
||||
if (!keep_pix_fmt) {
|
||||
ret = avcodec_get_supported_config(enc_ctx, NULL,
|
||||
AV_CODEC_CONFIG_PIX_FORMAT, 0,
|
||||
(const void **) &opts.pix_fmts, NULL);
|
||||
(const void **) &opts.formats, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
@@ -970,15 +964,10 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter,
|
||||
(const void **) &opts.color_ranges, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = avcodec_get_supported_config(enc_ctx, NULL,
|
||||
AV_CODEC_CONFIG_ALPHA_MODE, 0,
|
||||
(const void **) &opts.alpha_modes, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else {
|
||||
ret = avcodec_get_supported_config(enc_ctx, NULL,
|
||||
AV_CODEC_CONFIG_SAMPLE_FORMAT, 0,
|
||||
(const void **) &opts.sample_fmts, NULL);
|
||||
(const void **) &opts.formats, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = avcodec_get_supported_config(enc_ctx, NULL,
|
||||
@@ -1008,7 +997,7 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter,
|
||||
ost->filter = ofilter;
|
||||
ret = ofilter_bind_enc(ofilter, ms->sch_idx_enc, &opts);
|
||||
} else {
|
||||
ret = fg_create_simple(&ost->fg_simple, ost->ist, &filters,
|
||||
ret = fg_create_simple(&ost->fg_simple, ost->ist, filters,
|
||||
mux->sch, ms->sch_idx_enc, &opts);
|
||||
if (ret >= 0)
|
||||
ost->filter = ost->fg_simple->outputs[0];
|
||||
@@ -1603,7 +1592,6 @@ fail:
|
||||
static int map_auto_video(Muxer *mux, const OptionsContext *o)
|
||||
{
|
||||
AVFormatContext *oc = mux->fc;
|
||||
InputStreamGroup *best_istg = NULL;
|
||||
InputStream *best_ist = NULL;
|
||||
int64_t best_score = 0;
|
||||
int qcr;
|
||||
@@ -1615,49 +1603,14 @@ static int map_auto_video(Muxer *mux, const OptionsContext *o)
|
||||
qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
|
||||
for (int j = 0; j < nb_input_files; j++) {
|
||||
InputFile *ifile = input_files[j];
|
||||
InputStreamGroup *file_best_istg = NULL;
|
||||
InputStream *file_best_ist = NULL;
|
||||
int64_t file_best_score = 0;
|
||||
for (int i = 0; i < ifile->nb_stream_groups; i++) {
|
||||
InputStreamGroup *istg = ifile->stream_groups[i];
|
||||
int64_t score = 0;
|
||||
|
||||
if (!istg->fg)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < istg->stg->nb_streams; j++) {
|
||||
AVStream *st = istg->stg->streams[j];
|
||||
|
||||
if (st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS) {
|
||||
score = 100000000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (istg->stg->type) {
|
||||
case AV_STREAM_GROUP_PARAMS_TILE_GRID: {
|
||||
const AVStreamGroupTileGrid *tg = istg->stg->params.tile_grid;
|
||||
score += tg->width * (int64_t)tg->height
|
||||
+ 5000000*!!(istg->stg->disposition & AV_DISPOSITION_DEFAULT);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (score > file_best_score) {
|
||||
file_best_score = score;
|
||||
file_best_istg = istg;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < ifile->nb_streams; i++) {
|
||||
InputStream *ist = ifile->streams[i];
|
||||
const AVCodecDescriptor *desc = avcodec_descriptor_get(ist->st->codecpar->codec_id);
|
||||
int64_t score;
|
||||
|
||||
if (ist->user_set_discard == AVDISCARD_ALL ||
|
||||
ist->st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO ||
|
||||
(desc && (desc->props & AV_CODEC_PROP_ENHANCEMENT)))
|
||||
ist->st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
|
||||
continue;
|
||||
|
||||
score = ist->st->codecpar->width * (int64_t)ist->st->codecpar->height
|
||||
@@ -1671,15 +1624,6 @@ static int map_auto_video(Muxer *mux, const OptionsContext *o)
|
||||
continue;
|
||||
file_best_score = score;
|
||||
file_best_ist = ist;
|
||||
file_best_istg = NULL;
|
||||
}
|
||||
}
|
||||
if (file_best_istg) {
|
||||
file_best_score -= 5000000*!!(file_best_istg->stg->disposition & AV_DISPOSITION_DEFAULT);
|
||||
if (file_best_score > best_score) {
|
||||
best_score = file_best_score;
|
||||
best_istg = file_best_istg;
|
||||
best_ist = NULL;
|
||||
}
|
||||
}
|
||||
if (file_best_ist) {
|
||||
@@ -1689,19 +1633,9 @@ static int map_auto_video(Muxer *mux, const OptionsContext *o)
|
||||
if (file_best_score > best_score) {
|
||||
best_score = file_best_score;
|
||||
best_ist = file_best_ist;
|
||||
best_istg = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (best_istg) {
|
||||
FilterGraph *fg = best_istg->fg;
|
||||
OutputFilter *ofilter = fg->outputs[0];
|
||||
|
||||
av_assert0(fg->nb_outputs == 1);
|
||||
av_log(mux, AV_LOG_VERBOSE, "Creating output stream from stream group derived complex filtergraph %d.\n", fg->index);
|
||||
|
||||
return ost_add(mux, o, AVMEDIA_TYPE_VIDEO, NULL, ofilter, NULL, NULL);
|
||||
}
|
||||
if (best_ist)
|
||||
return ost_add(mux, o, AVMEDIA_TYPE_VIDEO, best_ist, NULL, NULL, NULL);
|
||||
|
||||
@@ -3286,8 +3220,6 @@ static int process_forced_keyframes(Muxer *mux, const OptionsContext *o)
|
||||
"-force_key_frames is deprecated, use just 'source'\n");
|
||||
ost->kf.type = KF_FORCE_SOURCE;
|
||||
#endif
|
||||
} else if (!strcmp(forced_keyframes, "scd_metadata")) {
|
||||
ost->kf.type = KF_FORCE_SCD_METADATA;
|
||||
} else {
|
||||
int ret = parse_forced_key_frames(ost, &ost->kf, mux, forced_keyframes);
|
||||
if (ret < 0)
|
||||
|
||||
+6
-94
@@ -242,70 +242,6 @@ OPT_MATCH_PER_STREAM(int, int, OPT_TYPE_INT, i);
|
||||
OPT_MATCH_PER_STREAM(int64, int64_t, OPT_TYPE_INT64, i64);
|
||||
OPT_MATCH_PER_STREAM(dbl, double, OPT_TYPE_DOUBLE, dbl);
|
||||
|
||||
static unsigned opt_match_per_stream_group(void *logctx, enum OptionType type,
|
||||
const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStreamGroup *stg)
|
||||
{
|
||||
int matches = 0, match_idx = -1;
|
||||
|
||||
av_assert0((type == sol->type) || !sol->nb_opt);
|
||||
|
||||
for (int i = 0; i < sol->nb_opt; i++) {
|
||||
const StreamSpecifier *ss = &sol->opt[i].stream_spec;
|
||||
|
||||
if (stream_group_specifier_match(ss, fc, stg, logctx)) {
|
||||
match_idx = i;
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
||||
if (matches > 1 && sol->opt_canon) {
|
||||
const SpecifierOpt *so = &sol->opt[match_idx];
|
||||
const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";
|
||||
|
||||
char namestr[128] = "";
|
||||
char optval_buf[32];
|
||||
const char *optval = optval_buf;
|
||||
|
||||
snprintf(namestr, sizeof(namestr), "-%s", sol->opt_canon->name);
|
||||
if (sol->opt_canon->flags & OPT_HAS_ALT) {
|
||||
const char * const *names_alt = sol->opt_canon->u1.names_alt;
|
||||
for (int i = 0; names_alt[i]; i++)
|
||||
av_strlcatf(namestr, sizeof(namestr), "/-%s", names_alt[i]);
|
||||
}
|
||||
|
||||
switch (sol->type) {
|
||||
case OPT_TYPE_STRING: optval = so->u.str; break;
|
||||
case OPT_TYPE_INT: snprintf(optval_buf, sizeof(optval_buf), "%d", so->u.i); break;
|
||||
case OPT_TYPE_INT64: snprintf(optval_buf, sizeof(optval_buf), "%"PRId64, so->u.i64); break;
|
||||
case OPT_TYPE_FLOAT: snprintf(optval_buf, sizeof(optval_buf), "%f", so->u.f); break;
|
||||
case OPT_TYPE_DOUBLE: snprintf(optval_buf, sizeof(optval_buf), "%f", so->u.dbl); break;
|
||||
default: av_assert0(0);
|
||||
}
|
||||
|
||||
av_log(logctx, AV_LOG_WARNING, "Multiple %s options specified for "
|
||||
"stream group %d, only the last option '-%s%s%s %s' will be used.\n",
|
||||
namestr, stg->index, sol->opt_canon->name, spec[0] ? ":" : "",
|
||||
spec, optval);
|
||||
}
|
||||
|
||||
return match_idx + 1;
|
||||
}
|
||||
|
||||
#define OPT_MATCH_PER_STREAM_GROUP(name, type, opt_type, m) \
|
||||
void opt_match_per_stream_group_ ## name(void *logctx, const SpecifierOptList *sol, \
|
||||
AVFormatContext *fc, AVStreamGroup *stg, type *out) \
|
||||
{ \
|
||||
unsigned ret = opt_match_per_stream_group(logctx, opt_type, sol, fc, stg); \
|
||||
if (ret > 0) \
|
||||
*out = sol->opt[ret - 1].u.m; \
|
||||
}
|
||||
|
||||
OPT_MATCH_PER_STREAM_GROUP(str, const char *, OPT_TYPE_STRING, str);
|
||||
OPT_MATCH_PER_STREAM_GROUP(int, int, OPT_TYPE_INT, i);
|
||||
OPT_MATCH_PER_STREAM_GROUP(int64, int64_t, OPT_TYPE_INT64, i64);
|
||||
OPT_MATCH_PER_STREAM_GROUP(dbl, double, OPT_TYPE_DOUBLE, dbl);
|
||||
|
||||
int view_specifier_parse(const char **pspec, ViewSpecifier *vs)
|
||||
{
|
||||
const char *spec = *pspec;
|
||||
@@ -359,7 +295,7 @@ int view_specifier_parse(const char **pspec, ViewSpecifier *vs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_and_set_vsync(const char *arg, enum VideoSyncMethod *vsync_var, int file_idx, int st_idx, int is_global)
|
||||
int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global)
|
||||
{
|
||||
if (!av_strcasecmp(arg, "cfr")) *vsync_var = VSYNC_CFR;
|
||||
else if (!av_strcasecmp(arg, "vfr")) *vsync_var = VSYNC_VFR;
|
||||
@@ -568,10 +504,8 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
}
|
||||
|
||||
if (arg[0] == '[') {
|
||||
ViewSpecifier vs;
|
||||
/* this mapping refers to lavfi output */
|
||||
const char *c = arg + 1;
|
||||
char *endptr;
|
||||
|
||||
ret = GROW_ARRAY(o->stream_maps, o->nb_stream_maps);
|
||||
if (ret < 0)
|
||||
@@ -584,27 +518,6 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
arg++;
|
||||
|
||||
m->group_index = -1;
|
||||
file_idx = strtol(arg, &endptr, 0);
|
||||
if (file_idx >= nb_input_files || file_idx < 0)
|
||||
goto end;
|
||||
|
||||
arg = endptr;
|
||||
ret = stream_specifier_parse(&ss, *arg == ':' ? arg + 1 : arg, 1, NULL);
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
|
||||
arg = ss.remainder ? ss.remainder : "";
|
||||
ret = view_specifier_parse(&arg, &vs);
|
||||
if (ret < 0 || (*arg && strcmp(arg, "]")))
|
||||
goto end;
|
||||
|
||||
m->file_index = file_idx;
|
||||
m->stream_index = ss.idx;
|
||||
m->group_index = ss.stream_list == STREAM_LIST_GROUP_IDX ? ss.list_id : -1;
|
||||
} else {
|
||||
ViewSpecifier vs;
|
||||
char *endptr;
|
||||
@@ -645,6 +558,8 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
for (i = 0; i < o->nb_stream_maps; i++) {
|
||||
m = &o->stream_maps[i];
|
||||
if (file_idx == m->file_index &&
|
||||
m->stream_index >= 0 &&
|
||||
m->stream_index < input_files[m->file_index]->nb_streams &&
|
||||
stream_specifier_match(&ss,
|
||||
input_files[m->file_index]->ctx,
|
||||
input_files[m->file_index]->ctx->streams[m->stream_index],
|
||||
@@ -670,7 +585,6 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
|
||||
m->file_index = file_idx;
|
||||
m->stream_index = i;
|
||||
m->group_index = ss.stream_list == STREAM_LIST_GROUP_IDX ? ss.list_id : -1;
|
||||
m->vs = vs;
|
||||
}
|
||||
}
|
||||
@@ -690,7 +604,6 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
end:
|
||||
ret = 0;
|
||||
fail:
|
||||
stream_specifier_uninit(&ss);
|
||||
@@ -1146,8 +1059,7 @@ static int opt_preset(void *optctx, const char *opt, const char *arg)
|
||||
else if (!strcmp(key, "vcodec")) opt_video_codec (o, key, value);
|
||||
else if (!strcmp(key, "scodec")) opt_subtitle_codec(o, key, value);
|
||||
else if (!strcmp(key, "dcodec")) opt_data_codec (o, key, value);
|
||||
else if ((parse_option(o, key, value, options) < 0) &&
|
||||
(opt_default_new(o, key, value) < 0)) {
|
||||
else if (opt_default_new(o, key, value) < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n",
|
||||
filename, line, key, value);
|
||||
ret = AVERROR(EINVAL);
|
||||
@@ -1286,7 +1198,7 @@ static int opt_filter_complex_script(void *optctx, const char *opt, const char *
|
||||
char *graph_desc;
|
||||
int ret;
|
||||
|
||||
graph_desc = read_file_to_string(arg);
|
||||
graph_desc = file_read(arg);
|
||||
if (!graph_desc)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
@@ -1504,7 +1416,7 @@ int ffmpeg_parse_options(int argc, char **argv, Scheduler *sch)
|
||||
|
||||
/* create complex filtergraphs */
|
||||
for (int i = 0; i < go.nb_filtergraphs; i++) {
|
||||
ret = fg_create(NULL, &go.filtergraphs[i], sch, NULL);
|
||||
ret = fg_create(NULL, go.filtergraphs[i], sch);
|
||||
go.filtergraphs[i] = NULL;
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
+60
-205
@@ -189,6 +189,7 @@ typedef struct PreMuxQueue {
|
||||
|
||||
typedef struct SchMuxStream {
|
||||
SchedulerNode src;
|
||||
SchedulerNode src_sched;
|
||||
|
||||
unsigned *sub_heartbeat_dst;
|
||||
unsigned nb_sub_heartbeat_dst;
|
||||
@@ -234,6 +235,7 @@ typedef struct SchMux {
|
||||
|
||||
typedef struct SchFilterIn {
|
||||
SchedulerNode src;
|
||||
SchedulerNode src_sched;
|
||||
int send_finished;
|
||||
int receive_finished;
|
||||
} SchFilterIn;
|
||||
@@ -247,7 +249,7 @@ typedef struct SchFilterGraph {
|
||||
|
||||
SchFilterIn *inputs;
|
||||
unsigned nb_inputs;
|
||||
unsigned nb_inputs_finished_send;
|
||||
atomic_uint nb_inputs_finished_send;
|
||||
unsigned nb_inputs_finished_receive;
|
||||
|
||||
SchFilterOut *outputs;
|
||||
@@ -387,7 +389,7 @@ static int queue_alloc(ThreadQueue **ptq, unsigned nb_streams, unsigned queue_si
|
||||
// for frames held in queues inside the ffmpeg utility. If this
|
||||
// can ever dynamically change then the corresponding decode
|
||||
// code needs to be updated as well.
|
||||
av_assert0(queue_size <= DEFAULT_FRAME_THREAD_QUEUE_SIZE);
|
||||
av_assert0(queue_size == DEFAULT_FRAME_THREAD_QUEUE_SIZE);
|
||||
}
|
||||
|
||||
tq = tq_alloc(nb_streams, queue_size,
|
||||
@@ -405,9 +407,6 @@ static int task_start(SchTask *task)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!task->parent)
|
||||
return 0;
|
||||
|
||||
av_log(task->func_arg, AV_LOG_VERBOSE, "Starting thread...\n");
|
||||
|
||||
av_assert0(!task->thread_running);
|
||||
@@ -457,23 +456,6 @@ static int64_t trailing_dts(const Scheduler *sch, int count_finished)
|
||||
return min_dts == INT64_MAX ? AV_NOPTS_VALUE : min_dts;
|
||||
}
|
||||
|
||||
void sch_remove_filtergraph(Scheduler *sch, int idx)
|
||||
{
|
||||
SchFilterGraph *fg = &sch->filters[idx];
|
||||
|
||||
av_assert0(!fg->task.thread_running);
|
||||
memset(&fg->task, 0, sizeof(fg->task));
|
||||
|
||||
tq_free(&fg->queue);
|
||||
|
||||
av_freep(&fg->inputs);
|
||||
fg->nb_inputs = 0;
|
||||
av_freep(&fg->outputs);
|
||||
fg->nb_outputs = 0;
|
||||
|
||||
fg->task_exited = 1;
|
||||
}
|
||||
|
||||
void sch_free(Scheduler **psch)
|
||||
{
|
||||
Scheduler *sch = *psch;
|
||||
@@ -1282,110 +1264,28 @@ int sch_mux_sub_heartbeat_add(Scheduler *sch, unsigned mux_idx, unsigned stream_
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void unchoke_for_stream(Scheduler *sch, SchedulerNode src);
|
||||
|
||||
// Unchoke any filter graphs that are downstream of this node, to prevent it
|
||||
// from getting stuck trying to push data to a full queue
|
||||
static void unchoke_downstream(Scheduler *sch, SchedulerNode *dst)
|
||||
{
|
||||
SchFilterGraph *fg;
|
||||
SchDec *dec;
|
||||
SchEnc *enc;
|
||||
switch (dst->type) {
|
||||
case SCH_NODE_TYPE_DEC:
|
||||
dec = &sch->dec[dst->idx];
|
||||
for (int i = 0; i < dec->nb_outputs; i++)
|
||||
unchoke_downstream(sch, dec->outputs[i].dst);
|
||||
break;
|
||||
case SCH_NODE_TYPE_ENC:
|
||||
enc = &sch->enc[dst->idx];
|
||||
for (int i = 0; i < enc->nb_dst; i++)
|
||||
unchoke_downstream(sch, &enc->dst[i]);
|
||||
break;
|
||||
case SCH_NODE_TYPE_MUX:
|
||||
// muxers are never choked
|
||||
break;
|
||||
case SCH_NODE_TYPE_FILTER_IN:
|
||||
fg = &sch->filters[dst->idx];
|
||||
if (fg->best_input == fg->nb_inputs) {
|
||||
fg->waiter.choked_next = 0;
|
||||
} else {
|
||||
// ensure that this filter graph is not stuck waiting for
|
||||
// input from a different upstream demuxer
|
||||
unchoke_for_stream(sch, fg->inputs[fg->best_input].src);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
av_unreachable("Invalid destination node type?");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void unchoke_for_stream(Scheduler *sch, SchedulerNode src)
|
||||
{
|
||||
while (1) {
|
||||
SchFilterGraph *fg;
|
||||
SchDemux *demux;
|
||||
switch (src.type) {
|
||||
case SCH_NODE_TYPE_DEMUX:
|
||||
// fed directly by a demuxer (i.e. not through a filtergraph)
|
||||
demux = &sch->demux[src.idx];
|
||||
if (demux->waiter.choked_next == 0)
|
||||
return; // prevent infinite loop
|
||||
demux->waiter.choked_next = 0;
|
||||
for (int i = 0; i < demux->nb_streams; i++)
|
||||
unchoke_downstream(sch, demux->streams[i].dst);
|
||||
return;
|
||||
case SCH_NODE_TYPE_DEC:
|
||||
src = sch->dec[src.idx].src;
|
||||
continue;
|
||||
case SCH_NODE_TYPE_ENC:
|
||||
src = sch->enc[src.idx].src;
|
||||
continue;
|
||||
case SCH_NODE_TYPE_FILTER_OUT:
|
||||
fg = &sch->filters[src.idx];
|
||||
// the filtergraph contains internal sources and
|
||||
// requested to be scheduled directly
|
||||
if (fg->best_input == fg->nb_inputs) {
|
||||
fg->waiter.choked_next = 0;
|
||||
return;
|
||||
}
|
||||
src = fg->inputs[fg->best_input].src;
|
||||
continue;
|
||||
default:
|
||||
av_unreachable("Invalid source node type?");
|
||||
|
||||
// fed directly by a demuxer (i.e. not through a filtergraph)
|
||||
if (src.type == SCH_NODE_TYPE_DEMUX) {
|
||||
sch->demux[src.idx].waiter.choked_next = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void choke_demux(const Scheduler *sch, int demux_id, int choked)
|
||||
{
|
||||
av_assert1(demux_id < sch->nb_demux);
|
||||
SchDemux *demux = &sch->demux[demux_id];
|
||||
av_assert0(src.type == SCH_NODE_TYPE_FILTER_OUT);
|
||||
fg = &sch->filters[src.idx];
|
||||
|
||||
for (int i = 0; i < demux->nb_streams; i++) {
|
||||
SchedulerNode *dst = demux->streams[i].dst;
|
||||
SchFilterGraph *fg;
|
||||
|
||||
switch (dst->type) {
|
||||
case SCH_NODE_TYPE_DEC:
|
||||
tq_choke(sch->dec[dst->idx].queue, choked);
|
||||
break;
|
||||
case SCH_NODE_TYPE_ENC:
|
||||
tq_choke(sch->enc[dst->idx].queue, choked);
|
||||
break;
|
||||
case SCH_NODE_TYPE_MUX:
|
||||
break;
|
||||
case SCH_NODE_TYPE_FILTER_IN:
|
||||
fg = &sch->filters[dst->idx];
|
||||
if (fg->nb_inputs == 1)
|
||||
tq_choke(fg->queue, choked);
|
||||
break;
|
||||
default:
|
||||
av_unreachable("Invalid destination node type?");
|
||||
break;
|
||||
// the filtergraph contains internal sources and
|
||||
// requested to be scheduled directly
|
||||
if (fg->best_input == fg->nb_inputs) {
|
||||
fg->waiter.choked_next = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
src = fg->inputs[fg->best_input].src_sched;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1428,23 +1328,11 @@ static void schedule_update_locked(Scheduler *sch)
|
||||
continue;
|
||||
|
||||
// resolve the source to unchoke
|
||||
unchoke_for_stream(sch, ms->src);
|
||||
unchoke_for_stream(sch, ms->src_sched);
|
||||
have_unchoked = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// also unchoke any sources feeding into closed filter graph inputs, so
|
||||
// that they can observe the downstream EOF
|
||||
for (unsigned i = 0; i < sch->nb_filters; i++) {
|
||||
SchFilterGraph *fg = &sch->filters[i];
|
||||
|
||||
for (unsigned j = 0; j < fg->nb_inputs; j++) {
|
||||
SchFilterIn *fi = &fg->inputs[j];
|
||||
if (fi->receive_finished && !fi->send_finished)
|
||||
unchoke_for_stream(sch, fi->src);
|
||||
}
|
||||
}
|
||||
|
||||
// make sure to unchoke at least one source, if still available
|
||||
for (unsigned type = 0; !have_unchoked && type < 2; type++)
|
||||
for (unsigned i = 0; i < (type ? sch->nb_filters : sch->nb_demux); i++) {
|
||||
@@ -1457,16 +1345,13 @@ static void schedule_update_locked(Scheduler *sch)
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned type = 0; type < 2; type++) {
|
||||
|
||||
for (unsigned type = 0; type < 2; type++)
|
||||
for (unsigned i = 0; i < (type ? sch->nb_filters : sch->nb_demux); i++) {
|
||||
SchWaiter *w = type ? &sch->filters[i].waiter : &sch->demux[i].waiter;
|
||||
if (w->choked_prev != w->choked_next) {
|
||||
if (w->choked_prev != w->choked_next)
|
||||
waiter_set(w, w->choked_next);
|
||||
if (!type)
|
||||
choke_demux(sch, i, w->choked_next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1476,27 +1361,6 @@ enum {
|
||||
CYCLE_NODE_DONE,
|
||||
};
|
||||
|
||||
// Finds the filtergraph or muxer upstream of a scheduler node
|
||||
static SchedulerNode src_filtergraph(const Scheduler *sch, SchedulerNode src)
|
||||
{
|
||||
while (1) {
|
||||
switch (src.type) {
|
||||
case SCH_NODE_TYPE_DEMUX:
|
||||
case SCH_NODE_TYPE_FILTER_OUT:
|
||||
return src;
|
||||
case SCH_NODE_TYPE_DEC:
|
||||
src = sch->dec[src.idx].src;
|
||||
continue;
|
||||
case SCH_NODE_TYPE_ENC:
|
||||
src = sch->enc[src.idx].src;
|
||||
continue;
|
||||
default:
|
||||
av_unreachable("Invalid source node type?");
|
||||
return (SchedulerNode) {0};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
check_acyclic_for_output(const Scheduler *sch, SchedulerNode src,
|
||||
uint8_t *filters_visited, SchedulerNode *filters_stack)
|
||||
@@ -1513,23 +1377,22 @@ check_acyclic_for_output(const Scheduler *sch, SchedulerNode src,
|
||||
// descend into every input, depth first
|
||||
if (src.idx_stream < fg->nb_inputs) {
|
||||
const SchFilterIn *fi = &fg->inputs[src.idx_stream++];
|
||||
SchedulerNode node = src_filtergraph(sch, fi->src);
|
||||
|
||||
// connected to demuxer, no cycles possible
|
||||
if (node.type == SCH_NODE_TYPE_DEMUX)
|
||||
if (fi->src_sched.type == SCH_NODE_TYPE_DEMUX)
|
||||
continue;
|
||||
|
||||
// otherwise connected to another filtergraph
|
||||
av_assert0(node.type == SCH_NODE_TYPE_FILTER_OUT);
|
||||
av_assert0(fi->src_sched.type == SCH_NODE_TYPE_FILTER_OUT);
|
||||
|
||||
// found a cycle
|
||||
if (filters_visited[node.idx] == CYCLE_NODE_STARTED)
|
||||
if (filters_visited[fi->src_sched.idx] == CYCLE_NODE_STARTED)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
// place current position on stack and descend
|
||||
av_assert0(nb_filters_stack < sch->nb_filters);
|
||||
filters_stack[nb_filters_stack++] = src;
|
||||
src = (SchedulerNode){ .idx = node.idx, .idx_stream = 0 };
|
||||
src = (SchedulerNode){ .idx = fi->src_sched.idx, .idx_stream = 0 };
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1651,7 +1514,22 @@ static int start_prepare(Scheduler *sch)
|
||||
for (unsigned j = 0; j < mux->nb_streams; j++) {
|
||||
SchMuxStream *ms = &mux->streams[j];
|
||||
|
||||
if (!ms->src.type) {
|
||||
switch (ms->src.type) {
|
||||
case SCH_NODE_TYPE_ENC: {
|
||||
SchEnc *enc = &sch->enc[ms->src.idx];
|
||||
if (enc->src.type == SCH_NODE_TYPE_DEC) {
|
||||
ms->src_sched = sch->dec[enc->src.idx].src;
|
||||
av_assert0(ms->src_sched.type == SCH_NODE_TYPE_DEMUX);
|
||||
} else {
|
||||
ms->src_sched = enc->src;
|
||||
av_assert0(ms->src_sched.type == SCH_NODE_TYPE_FILTER_OUT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SCH_NODE_TYPE_DEMUX:
|
||||
ms->src_sched = ms->src;
|
||||
break;
|
||||
default:
|
||||
av_log(mux, AV_LOG_ERROR,
|
||||
"Muxer stream #%u not connected to a source\n", j);
|
||||
return AVERROR(EINVAL);
|
||||
@@ -1669,12 +1547,26 @@ static int start_prepare(Scheduler *sch)
|
||||
|
||||
for (unsigned j = 0; j < fg->nb_inputs; j++) {
|
||||
SchFilterIn *fi = &fg->inputs[j];
|
||||
SchDec *dec;
|
||||
|
||||
if (!fi->src.type) {
|
||||
av_log(fg, AV_LOG_ERROR,
|
||||
"Filtergraph input %u not connected to a source\n", j);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (fi->src.type == SCH_NODE_TYPE_FILTER_OUT)
|
||||
fi->src_sched = fi->src;
|
||||
else {
|
||||
av_assert0(fi->src.type == SCH_NODE_TYPE_DEC);
|
||||
dec = &sch->dec[fi->src.idx];
|
||||
|
||||
switch (dec->src.type) {
|
||||
case SCH_NODE_TYPE_DEMUX: fi->src_sched = dec->src; break;
|
||||
case SCH_NODE_TYPE_ENC: fi->src_sched = sch->enc[dec->src.idx].src; break;
|
||||
default: av_assert0(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned j = 0; j < fg->nb_outputs; j++) {
|
||||
@@ -2297,20 +2189,14 @@ static int send_to_filter(Scheduler *sch, SchFilterGraph *fg,
|
||||
if (frame)
|
||||
return tq_send(fg->queue, in_idx, frame);
|
||||
|
||||
pthread_mutex_lock(&sch->schedule_lock);
|
||||
|
||||
if (!fg->inputs[in_idx].send_finished) {
|
||||
fg->inputs[in_idx].send_finished = 1;
|
||||
tq_send_finish(fg->queue, in_idx);
|
||||
|
||||
// close the control stream when all actual inputs are done
|
||||
if (++fg->nb_inputs_finished_send == fg->nb_inputs)
|
||||
if (atomic_fetch_add(&fg->nb_inputs_finished_send, 1) == fg->nb_inputs - 1)
|
||||
tq_send_finish(fg->queue, fg->nb_inputs);
|
||||
|
||||
schedule_update_locked(sch);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&sch->schedule_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2561,8 +2447,6 @@ void sch_filter_receive_finish(Scheduler *sch, unsigned fg_idx, unsigned in_idx)
|
||||
av_assert0(in_idx < fg->nb_inputs);
|
||||
fi = &fg->inputs[in_idx];
|
||||
|
||||
pthread_mutex_lock(&sch->schedule_lock);
|
||||
|
||||
if (!fi->receive_finished) {
|
||||
fi->receive_finished = 1;
|
||||
tq_receive_finish(fg->queue, in_idx);
|
||||
@@ -2570,18 +2454,13 @@ void sch_filter_receive_finish(Scheduler *sch, unsigned fg_idx, unsigned in_idx)
|
||||
// close the control stream when all actual inputs are done
|
||||
if (++fg->nb_inputs_finished_receive == fg->nb_inputs)
|
||||
tq_receive_finish(fg->queue, fg->nb_inputs);
|
||||
|
||||
schedule_update_locked(sch);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&sch->schedule_lock);
|
||||
}
|
||||
|
||||
int sch_filter_send(Scheduler *sch, unsigned fg_idx, unsigned out_idx, AVFrame *frame)
|
||||
{
|
||||
SchFilterGraph *fg;
|
||||
SchedulerNode dst;
|
||||
int ret;
|
||||
|
||||
av_assert0(fg_idx < sch->nb_filters);
|
||||
fg = &sch->filters[fg_idx];
|
||||
@@ -2589,16 +2468,9 @@ int sch_filter_send(Scheduler *sch, unsigned fg_idx, unsigned out_idx, AVFrame *
|
||||
av_assert0(out_idx < fg->nb_outputs);
|
||||
dst = fg->outputs[out_idx].dst;
|
||||
|
||||
if (dst.type == SCH_NODE_TYPE_ENC) {
|
||||
ret = send_to_enc(sch, &sch->enc[dst.idx], frame);
|
||||
if (ret == AVERROR_EOF)
|
||||
send_to_enc(sch, &sch->enc[dst.idx], NULL);
|
||||
} else {
|
||||
ret = send_to_filter(sch, &sch->filters[dst.idx], dst.idx_stream, frame);
|
||||
if (ret == AVERROR_EOF)
|
||||
send_to_filter(sch, &sch->filters[dst.idx], dst.idx_stream, NULL);
|
||||
}
|
||||
return ret;
|
||||
return (dst.type == SCH_NODE_TYPE_ENC) ?
|
||||
send_to_enc (sch, &sch->enc[dst.idx], frame) :
|
||||
send_to_filter(sch, &sch->filters[dst.idx], dst.idx_stream, frame);
|
||||
}
|
||||
|
||||
static int filter_done(Scheduler *sch, unsigned fg_idx)
|
||||
@@ -2640,18 +2512,6 @@ int sch_filter_command(Scheduler *sch, unsigned fg_idx, AVFrame *frame)
|
||||
return send_to_filter(sch, fg, fg->nb_inputs, frame);
|
||||
}
|
||||
|
||||
void sch_filter_choke_inputs(Scheduler *sch, unsigned fg_idx)
|
||||
{
|
||||
SchFilterGraph *fg;
|
||||
av_assert0(fg_idx < sch->nb_filters);
|
||||
fg = &sch->filters[fg_idx];
|
||||
|
||||
pthread_mutex_lock(&sch->schedule_lock);
|
||||
fg->best_input = fg->nb_inputs;
|
||||
schedule_update_locked(sch);
|
||||
pthread_mutex_unlock(&sch->schedule_lock);
|
||||
}
|
||||
|
||||
static int task_cleanup(Scheduler *sch, SchedulerNode node)
|
||||
{
|
||||
switch (node.type) {
|
||||
@@ -2660,7 +2520,7 @@ static int task_cleanup(Scheduler *sch, SchedulerNode node)
|
||||
case SCH_NODE_TYPE_DEC: return dec_done (sch, node.idx);
|
||||
case SCH_NODE_TYPE_ENC: return enc_done (sch, node.idx);
|
||||
case SCH_NODE_TYPE_FILTER_IN: return filter_done(sch, node.idx);
|
||||
default: av_unreachable("Invalid node type?");
|
||||
default: av_assert0(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2701,9 +2561,6 @@ static int task_stop(Scheduler *sch, SchTask *task)
|
||||
int ret;
|
||||
void *thread_ret;
|
||||
|
||||
if (!task->parent)
|
||||
return 0;
|
||||
|
||||
if (!task->thread_running)
|
||||
return task_cleanup(sch, task->node);
|
||||
|
||||
@@ -2728,8 +2585,6 @@ int sch_stop(Scheduler *sch, int64_t *finish_ts)
|
||||
for (unsigned i = 0; i < (type ? sch->nb_demux : sch->nb_filters); i++) {
|
||||
SchWaiter *w = type ? &sch->demux[i].waiter : &sch->filters[i].waiter;
|
||||
waiter_set(w, 1);
|
||||
if (type)
|
||||
choke_demux(sch, i, 0); // unfreeze to allow draining
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < sch->nb_demux; i++) {
|
||||
|
||||
+1
-10
@@ -205,8 +205,6 @@ int sch_add_dec_output(Scheduler *sch, unsigned dec_idx);
|
||||
int sch_add_filtergraph(Scheduler *sch, unsigned nb_inputs, unsigned nb_outputs,
|
||||
SchThreadFunc func, void *ctx);
|
||||
|
||||
void sch_remove_filtergraph(Scheduler *sch, int idx);
|
||||
|
||||
/**
|
||||
* Add a muxer to the scheduler.
|
||||
*
|
||||
@@ -259,7 +257,7 @@ int sch_add_mux(Scheduler *sch, SchThreadFunc func, int (*init)(void *),
|
||||
/**
|
||||
* Default size of a frame thread queue.
|
||||
*/
|
||||
#define DEFAULT_FRAME_THREAD_QUEUE_SIZE 2
|
||||
#define DEFAULT_FRAME_THREAD_QUEUE_SIZE 8
|
||||
|
||||
/**
|
||||
* Add a muxed stream for a previously added muxer.
|
||||
@@ -445,13 +443,6 @@ int sch_filter_send(Scheduler *sch, unsigned fg_idx, unsigned out_idx,
|
||||
|
||||
int sch_filter_command(Scheduler *sch, unsigned fg_idx, struct AVFrame *frame);
|
||||
|
||||
/**
|
||||
* Called by filtergraph tasks to choke all filter inputs, preventing them from
|
||||
* receiving more frames until woken up again by the scheduler. Used during
|
||||
* initial graph configuration to avoid unnecessary buffering.
|
||||
*/
|
||||
void sch_filter_choke_inputs(Scheduler *sch, unsigned fg_idx);
|
||||
|
||||
/**
|
||||
* Called by encoder tasks to obtain frames for encoding. Will wait for a frame
|
||||
* to become available and return it in frame.
|
||||
|
||||
+10
-91
@@ -37,7 +37,6 @@
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/fifo.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/bprint.h"
|
||||
@@ -268,7 +267,6 @@ typedef struct VideoState {
|
||||
AVComplexFloat *rdft_data;
|
||||
int xpos;
|
||||
double last_vis_time;
|
||||
RenderParams render_params;
|
||||
SDL_Texture *vis_texture;
|
||||
SDL_Texture *sub_texture;
|
||||
SDL_Texture *vid_texture;
|
||||
@@ -352,7 +350,6 @@ static int find_stream_info = 1;
|
||||
static int filter_nbthreads = 0;
|
||||
static int enable_vulkan = 0;
|
||||
static char *vulkan_params = NULL;
|
||||
static char *video_background = NULL;
|
||||
static const char *hwaccel = NULL;
|
||||
|
||||
/* current context */
|
||||
@@ -945,11 +942,6 @@ static enum AVColorSpace sdl_supported_color_spaces[] = {
|
||||
AVCOL_SPC_SMPTE170M,
|
||||
};
|
||||
|
||||
static enum AVAlphaMode sdl_supported_alpha_modes[] = {
|
||||
AVALPHA_MODE_UNSPECIFIED,
|
||||
AVALPHA_MODE_STRAIGHT,
|
||||
};
|
||||
|
||||
static void set_sdl_yuv_conversion_mode(AVFrame *frame)
|
||||
{
|
||||
#if SDL_VERSION_ATLEAST(2,0,8)
|
||||
@@ -966,52 +958,15 @@ static void set_sdl_yuv_conversion_mode(AVFrame *frame)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void draw_video_background(VideoState *is)
|
||||
{
|
||||
const int tile_size = VIDEO_BACKGROUND_TILE_SIZE;
|
||||
SDL_Rect *rect = &is->render_params.target_rect;
|
||||
SDL_BlendMode blendMode;
|
||||
|
||||
if (!SDL_GetTextureBlendMode(is->vid_texture, &blendMode) && blendMode == SDL_BLENDMODE_BLEND) {
|
||||
switch (is->render_params.video_background_type) {
|
||||
case VIDEO_BACKGROUND_TILES:
|
||||
SDL_SetRenderDrawColor(renderer, 237, 237, 237, 255);
|
||||
fill_rectangle(rect->x, rect->y, rect->w, rect->h);
|
||||
SDL_SetRenderDrawColor(renderer, 222, 222, 222, 255);
|
||||
for (int x = 0; x < rect->w; x += tile_size * 2)
|
||||
fill_rectangle(rect->x + x, rect->y, FFMIN(tile_size, rect->w - x), rect->h);
|
||||
for (int y = 0; y < rect->h; y += tile_size * 2)
|
||||
fill_rectangle(rect->x, rect->y + y, rect->w, FFMIN(tile_size, rect->h - y));
|
||||
SDL_SetRenderDrawColor(renderer, 237, 237, 237, 255);
|
||||
for (int y = 0; y < rect->h; y += tile_size * 2) {
|
||||
int h = FFMIN(tile_size, rect->h - y);
|
||||
for (int x = 0; x < rect->w; x += tile_size * 2)
|
||||
fill_rectangle(x + rect->x, y + rect->y, FFMIN(tile_size, rect->w - x), h);
|
||||
}
|
||||
break;
|
||||
case VIDEO_BACKGROUND_COLOR: {
|
||||
const uint8_t *c = is->render_params.video_background_color;
|
||||
SDL_SetRenderDrawColor(renderer, c[0], c[1], c[2], c[3]);
|
||||
fill_rectangle(rect->x, rect->y, rect->w, rect->h);
|
||||
break;
|
||||
}
|
||||
case VIDEO_BACKGROUND_NONE:
|
||||
SDL_SetTextureBlendMode(is->vid_texture, SDL_BLENDMODE_NONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void video_image_display(VideoState *is)
|
||||
{
|
||||
Frame *vp;
|
||||
Frame *sp = NULL;
|
||||
SDL_Rect *rect = &is->render_params.target_rect;
|
||||
SDL_Rect rect;
|
||||
|
||||
vp = frame_queue_peek_last(&is->pictq);
|
||||
calculate_display_rect(rect, is->xleft, is->ytop, is->width, is->height, vp->width, vp->height, vp->sar);
|
||||
if (vk_renderer) {
|
||||
vk_renderer_display(vk_renderer, vp->frame, &is->render_params);
|
||||
vk_renderer_display(vk_renderer, vp->frame);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1060,6 +1015,7 @@ static void video_image_display(VideoState *is)
|
||||
}
|
||||
}
|
||||
|
||||
calculate_display_rect(&rect, is->xleft, is->ytop, is->width, is->height, vp->width, vp->height, vp->sar);
|
||||
set_sdl_yuv_conversion_mode(vp->frame);
|
||||
|
||||
if (!vp->uploaded) {
|
||||
@@ -1071,16 +1027,15 @@ static void video_image_display(VideoState *is)
|
||||
vp->flip_v = vp->frame->linesize[0] < 0;
|
||||
}
|
||||
|
||||
draw_video_background(is);
|
||||
SDL_RenderCopyEx(renderer, is->vid_texture, NULL, rect, 0, NULL, vp->flip_v ? SDL_FLIP_VERTICAL : 0);
|
||||
SDL_RenderCopyEx(renderer, is->vid_texture, NULL, &rect, 0, NULL, vp->flip_v ? SDL_FLIP_VERTICAL : 0);
|
||||
set_sdl_yuv_conversion_mode(NULL);
|
||||
if (sp) {
|
||||
#if USE_ONEPASS_SUBTITLE_RENDER
|
||||
SDL_RenderCopy(renderer, is->sub_texture, NULL, rect);
|
||||
SDL_RenderCopy(renderer, is->sub_texture, NULL, &rect);
|
||||
#else
|
||||
int i;
|
||||
double xratio = (double)rect->w / (double)sp->width;
|
||||
double yratio = (double)rect->h / (double)sp->height;
|
||||
double xratio = (double)rect.w / (double)sp->width;
|
||||
double yratio = (double)rect.h / (double)sp->height;
|
||||
for (i = 0; i < sp->sub.num_rects; i++) {
|
||||
SDL_Rect *sub_rect = (SDL_Rect*)sp->sub.rects[i];
|
||||
SDL_Rect target = {.x = rect.x + sub_rect->x * xratio,
|
||||
@@ -1951,7 +1906,6 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
|
||||
par->sample_aspect_ratio = codecpar->sample_aspect_ratio;
|
||||
par->color_space = frame->colorspace;
|
||||
par->color_range = frame->color_range;
|
||||
par->alpha_mode = frame->alpha_mode;
|
||||
par->frame_rate = fr;
|
||||
par->hw_frames_ctx = frame->hw_frames_ctx;
|
||||
ret = av_buffersrc_parameters_set(filt_src, par);
|
||||
@@ -1978,11 +1932,6 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
|
||||
AV_OPT_TYPE_INT, sdl_supported_color_spaces)) < 0)
|
||||
goto fail;
|
||||
|
||||
if ((ret = av_opt_set_array(filt_out, "alphamodes", AV_OPT_SEARCH_CHILDREN,
|
||||
0, FF_ARRAY_ELEMS(sdl_supported_alpha_modes),
|
||||
AV_OPT_TYPE_INT, sdl_supported_alpha_modes)) < 0)
|
||||
goto fail;
|
||||
|
||||
ret = avfilter_init_dict(filt_out, NULL);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
@@ -2883,7 +2832,6 @@ static int read_thread(void *arg)
|
||||
int st_index[AVMEDIA_TYPE_NB];
|
||||
AVPacket *pkt = NULL;
|
||||
int64_t stream_start_time;
|
||||
char metadata_description[96];
|
||||
int pkt_in_play_range = 0;
|
||||
const AVDictionaryEntry *t;
|
||||
SDL_mutex *wait_mutex = SDL_CreateMutex();
|
||||
@@ -2991,10 +2939,8 @@ static int read_thread(void *arg)
|
||||
|
||||
is->realtime = is_realtime(ic);
|
||||
|
||||
if (show_status) {
|
||||
fprintf(stderr, "\x1b[2K\r");
|
||||
if (show_status)
|
||||
av_dump_format(ic, 0, is->filename, 0);
|
||||
}
|
||||
|
||||
for (i = 0; i < ic->nb_streams; i++) {
|
||||
AVStream *st = ic->streams[i];
|
||||
@@ -3003,9 +2949,6 @@ static int read_thread(void *arg)
|
||||
if (type >= 0 && wanted_stream_spec[type] && st_index[type] == -1)
|
||||
if (avformat_match_stream_specifier(ic, st, wanted_stream_spec[type]) > 0)
|
||||
st_index[type] = i;
|
||||
// Clear all pre-existing metadata update flags to avoid printing
|
||||
// initial metadata as update.
|
||||
st->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
|
||||
}
|
||||
for (i = 0; i < AVMEDIA_TYPE_NB; i++) {
|
||||
if (wanted_stream_spec[i] && st_index[i] == -1) {
|
||||
@@ -3174,19 +3117,6 @@ static int read_thread(void *arg)
|
||||
} else {
|
||||
is->eof = 0;
|
||||
}
|
||||
|
||||
if (show_status && ic->streams[pkt->stream_index]->event_flags &
|
||||
AVSTREAM_EVENT_FLAG_METADATA_UPDATED) {
|
||||
fprintf(stderr, "\x1b[2K\r");
|
||||
snprintf(metadata_description,
|
||||
sizeof(metadata_description),
|
||||
"\r New metadata for stream %d",
|
||||
pkt->stream_index);
|
||||
dump_dictionary(NULL, ic->streams[pkt->stream_index]->metadata,
|
||||
metadata_description, " ", AV_LOG_INFO);
|
||||
}
|
||||
ic->streams[pkt->stream_index]->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
|
||||
|
||||
/* check if packet is in play range specified by user, then queue, otherwise discard */
|
||||
stream_start_time = ic->streams[pkt->stream_index]->start_time;
|
||||
pkt_ts = pkt->pts == AV_NOPTS_VALUE ? pkt->dts : pkt->pts;
|
||||
@@ -3268,16 +3198,6 @@ static VideoState *stream_open(const char *filename,
|
||||
av_log(NULL, AV_LOG_WARNING, "-volume=%d < 0, setting to 0\n", startup_volume);
|
||||
if (startup_volume > 100)
|
||||
av_log(NULL, AV_LOG_WARNING, "-volume=%d > 100, setting to 100\n", startup_volume);
|
||||
if (video_background) {
|
||||
if (!strcmp(video_background, "none")) {
|
||||
is->render_params.video_background_type = VIDEO_BACKGROUND_NONE;
|
||||
} else if (strcmp(video_background, "tiles")) {
|
||||
if (av_parse_color(is->render_params.video_background_color, video_background, -1, NULL) >= 0)
|
||||
is->render_params.video_background_type = VIDEO_BACKGROUND_COLOR;
|
||||
else
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
startup_volume = av_clip(startup_volume, 0, 100);
|
||||
startup_volume = av_clip(SDL_MIX_MAXVOLUME * startup_volume / 100, 0, SDL_MIX_MAXVOLUME);
|
||||
is->audio_volume = startup_volume;
|
||||
@@ -3791,7 +3711,6 @@ static const OptionDef options[] = {
|
||||
{ "filter_threads", OPT_TYPE_INT, OPT_EXPERT, { &filter_nbthreads }, "number of filter threads per graph" },
|
||||
{ "enable_vulkan", OPT_TYPE_BOOL, 0, { &enable_vulkan }, "enable vulkan renderer" },
|
||||
{ "vulkan_params", OPT_TYPE_STRING, OPT_EXPERT, { &vulkan_params }, "vulkan configuration using a list of key=value pairs separated by ':'" },
|
||||
{ "video_bg", OPT_TYPE_STRING, OPT_EXPERT, { &video_background }, "set video background for transparent videos" },
|
||||
{ "hwaccel", OPT_TYPE_STRING, OPT_EXPERT, { &hwaccel }, "use HW accelerated decoding" },
|
||||
{ NULL, },
|
||||
};
|
||||
@@ -3826,9 +3745,9 @@ void show_help_default(const char *opt, const char *arg)
|
||||
"c cycle program\n"
|
||||
"w cycle video filters or show modes\n"
|
||||
"s activate frame-step mode\n"
|
||||
"left/right seek backward/forward by 10 seconds or a custom interval if -seek_interval is set\n"
|
||||
"left/right seek backward/forward 10 seconds or to custom interval if -seek_interval is set\n"
|
||||
"down/up seek backward/forward 1 minute\n"
|
||||
"page down/page up seek to previous/next chapter or backward/forward 10 minutes if no chapters\n"
|
||||
"page down/page up seek backward/forward 10 minutes\n"
|
||||
"right mouse click seek to percentage in file corresponding to fraction of width\n"
|
||||
"left double-click toggle full screen\n"
|
||||
);
|
||||
|
||||
+38
-35
@@ -53,7 +53,7 @@ struct VkRenderer {
|
||||
|
||||
int (*get_hw_dev)(VkRenderer *renderer, AVBufferRef **dev);
|
||||
|
||||
int (*display)(VkRenderer *renderer, AVFrame *frame, RenderParams *params);
|
||||
int (*display)(VkRenderer *renderer, AVFrame *frame);
|
||||
|
||||
int (*resize)(VkRenderer *renderer, int width, int height);
|
||||
|
||||
@@ -104,6 +104,36 @@ static void vk_log_cb(void *log_priv, enum pl_log_level level,
|
||||
av_log(log_priv, level_map[level], "%s\n", msg);
|
||||
}
|
||||
|
||||
// Should keep sync with optional_device_exts inside hwcontext_vulkan.c
|
||||
static const char *optional_device_exts[] = {
|
||||
/* Misc or required by other extensions */
|
||||
VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME,
|
||||
VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME,
|
||||
VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME,
|
||||
VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME,
|
||||
VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME,
|
||||
VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME,
|
||||
VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME,
|
||||
|
||||
/* Imports/exports */
|
||||
VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME,
|
||||
VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME,
|
||||
VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME,
|
||||
VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME,
|
||||
VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME,
|
||||
#ifdef _WIN32
|
||||
VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME,
|
||||
VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME,
|
||||
#endif
|
||||
|
||||
/* Video encoding/decoding */
|
||||
VK_KHR_VIDEO_QUEUE_EXTENSION_NAME,
|
||||
VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME,
|
||||
VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME,
|
||||
VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME,
|
||||
"VK_MESA_video_decode_av1",
|
||||
};
|
||||
|
||||
static inline int enable_debug(const AVDictionary *opt)
|
||||
{
|
||||
AVDictionaryEntry *entry = av_dict_get(opt, "debug", NULL, 0);
|
||||
@@ -344,8 +374,6 @@ static int create_vk_by_placebo(VkRenderer *renderer,
|
||||
int decode_index;
|
||||
int decode_count;
|
||||
int ret;
|
||||
const char **dev_exts;
|
||||
int num_dev_exts;
|
||||
|
||||
ctx->get_proc_addr = SDL_Vulkan_GetVkGetInstanceProcAddr();
|
||||
|
||||
@@ -360,21 +388,16 @@ static int create_vk_by_placebo(VkRenderer *renderer,
|
||||
}
|
||||
ctx->inst = ctx->placebo_instance->instance;
|
||||
|
||||
dev_exts = av_vk_get_optional_device_extensions(&num_dev_exts);
|
||||
if (!dev_exts)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
ctx->placebo_vulkan = pl_vulkan_create(ctx->vk_log, pl_vulkan_params(
|
||||
.instance = ctx->placebo_instance->instance,
|
||||
.get_proc_addr = ctx->placebo_instance->get_proc_addr,
|
||||
.surface = ctx->vk_surface,
|
||||
.allow_software = false,
|
||||
.opt_extensions = dev_exts,
|
||||
.num_opt_extensions = num_dev_exts,
|
||||
.opt_extensions = optional_device_exts,
|
||||
.num_opt_extensions = FF_ARRAY_ELEMS(optional_device_exts),
|
||||
.extra_queues = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
|
||||
.device_name = select_device(opt),
|
||||
));
|
||||
av_free(dev_exts);
|
||||
if (!ctx->placebo_vulkan)
|
||||
return AVERROR_EXTERNAL;
|
||||
ctx->hw_device_ref = av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_VULKAN);
|
||||
@@ -702,13 +725,11 @@ static int convert_frame(VkRenderer *renderer, AVFrame *frame)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int display(VkRenderer *renderer, AVFrame *frame, RenderParams *params)
|
||||
static int display(VkRenderer *renderer, AVFrame *frame)
|
||||
{
|
||||
SDL_Rect *rect = ¶ms->target_rect;
|
||||
struct pl_swapchain_frame swap_frame = {0};
|
||||
struct pl_frame pl_frame = {0};
|
||||
struct pl_frame target = {0};
|
||||
struct pl_render_params pl_params = pl_render_default_params;
|
||||
RendererContext *ctx = (RendererContext *) renderer;
|
||||
int ret = 0;
|
||||
struct pl_color_space hint = {0};
|
||||
@@ -733,26 +754,8 @@ static int display(VkRenderer *renderer, AVFrame *frame, RenderParams *params)
|
||||
}
|
||||
|
||||
pl_frame_from_swapchain(&target, &swap_frame);
|
||||
|
||||
target.crop = (pl_rect2df){.x0 = rect->x, .x1 = rect->x + rect->w,
|
||||
.y0 = rect->y, .y1 = rect->y + rect->h};
|
||||
switch (params->video_background_type) {
|
||||
case VIDEO_BACKGROUND_TILES:
|
||||
pl_params.background = PL_CLEAR_TILES;
|
||||
pl_params.tile_size = VIDEO_BACKGROUND_TILE_SIZE * 2;
|
||||
break;
|
||||
case VIDEO_BACKGROUND_COLOR:
|
||||
pl_params.background = PL_CLEAR_COLOR;
|
||||
for (int i = 0; i < 3; i++)
|
||||
pl_params.background_color[i] = params->video_background_color[i] / 255.0;
|
||||
pl_params.background_transparency = (255 - params->video_background_color[3]) / 255.0;
|
||||
break;
|
||||
case VIDEO_BACKGROUND_NONE:
|
||||
pl_frame.repr.alpha = PL_ALPHA_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!pl_render_image(ctx->renderer, &pl_frame, &target, &pl_params)) {
|
||||
if (!pl_render_image(ctx->renderer, &pl_frame, &target,
|
||||
&pl_render_default_params)) {
|
||||
av_log(NULL, AV_LOG_ERROR, "pl_render_image failed\n");
|
||||
ret = AVERROR_EXTERNAL;
|
||||
goto out;
|
||||
@@ -855,9 +858,9 @@ int vk_renderer_get_hw_dev(VkRenderer *renderer, AVBufferRef **dev)
|
||||
return renderer->get_hw_dev(renderer, dev);
|
||||
}
|
||||
|
||||
int vk_renderer_display(VkRenderer *renderer, AVFrame *frame, RenderParams *render_params)
|
||||
int vk_renderer_display(VkRenderer *renderer, AVFrame *frame)
|
||||
{
|
||||
return renderer->display(renderer, frame, render_params);
|
||||
return renderer->display(renderer, frame);
|
||||
}
|
||||
|
||||
int vk_renderer_resize(VkRenderer *renderer, int width, int height)
|
||||
|
||||
@@ -25,20 +25,6 @@
|
||||
|
||||
typedef struct VkRenderer VkRenderer;
|
||||
|
||||
#define VIDEO_BACKGROUND_TILE_SIZE 64
|
||||
|
||||
enum VideoBackgroundType {
|
||||
VIDEO_BACKGROUND_TILES,
|
||||
VIDEO_BACKGROUND_COLOR,
|
||||
VIDEO_BACKGROUND_NONE,
|
||||
};
|
||||
|
||||
typedef struct RenderParams {
|
||||
SDL_Rect target_rect;
|
||||
uint8_t video_background_color[4];
|
||||
enum VideoBackgroundType video_background_type;
|
||||
} RenderParams;
|
||||
|
||||
VkRenderer *vk_get_renderer(void);
|
||||
|
||||
int vk_renderer_create(VkRenderer *renderer, SDL_Window *window,
|
||||
@@ -46,7 +32,7 @@ int vk_renderer_create(VkRenderer *renderer, SDL_Window *window,
|
||||
|
||||
int vk_renderer_get_hw_dev(VkRenderer *renderer, AVBufferRef **dev);
|
||||
|
||||
int vk_renderer_display(VkRenderer *renderer, AVFrame *frame, RenderParams *params);
|
||||
int vk_renderer_display(VkRenderer *renderer, AVFrame *frame);
|
||||
|
||||
int vk_renderer_resize(VkRenderer *renderer, int width, int height);
|
||||
|
||||
|
||||
+24
-211
@@ -36,7 +36,6 @@
|
||||
#include "libavutil/ambient_viewing_environment.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/display.h"
|
||||
@@ -131,11 +130,6 @@ static int use_byte_value_binary_prefix = 0;
|
||||
static int use_value_sexagesimal_format = 0;
|
||||
static int show_private_data = 1;
|
||||
|
||||
static const char *audio_codec_name = NULL;
|
||||
static const char *data_codec_name = NULL;
|
||||
static const char *subtitle_codec_name = NULL;
|
||||
static const char *video_codec_name = NULL;
|
||||
|
||||
#define SHOW_OPTIONAL_FIELDS_AUTO -1
|
||||
#define SHOW_OPTIONAL_FIELDS_NEVER 0
|
||||
#define SHOW_OPTIONAL_FIELDS_ALWAYS 1
|
||||
@@ -144,7 +138,6 @@ static int show_optional_fields = SHOW_OPTIONAL_FIELDS_AUTO;
|
||||
static char *output_format;
|
||||
static char *stream_specifier;
|
||||
static char *show_data_hash;
|
||||
static char *data_dump_format;
|
||||
|
||||
typedef struct ReadInterval {
|
||||
int id; ///< identifier
|
||||
@@ -253,7 +246,7 @@ static const char *get_stream_group_type(const void *data)
|
||||
return av_x_if_null(avformat_stream_group_name(stg->type), "unknown");
|
||||
}
|
||||
|
||||
static const AVTextFormatSection sections[] = {
|
||||
static struct AVTextFormatSection sections[] = {
|
||||
[SECTION_ID_CHAPTERS] = { SECTION_ID_CHAPTERS, "chapters", AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY, { SECTION_ID_CHAPTER, -1 } },
|
||||
[SECTION_ID_CHAPTER] = { SECTION_ID_CHAPTER, "chapter", 0, { SECTION_ID_CHAPTER_TAGS, -1 } },
|
||||
[SECTION_ID_CHAPTER_TAGS] = { SECTION_ID_CHAPTER_TAGS, "tags", AV_TEXTFORMAT_SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "chapter_tags" },
|
||||
@@ -325,13 +318,6 @@ static const AVTextFormatSection sections[] = {
|
||||
[SECTION_ID_SUBTITLE] = { SECTION_ID_SUBTITLE, "subtitle", 0, { -1 } },
|
||||
};
|
||||
|
||||
typedef struct EntrySelection {
|
||||
int show_all_entries;
|
||||
AVDictionary *entries_to_show;
|
||||
} EntrySelection;
|
||||
|
||||
static EntrySelection selected_entries[FF_ARRAY_ELEMS(sections)] = { 0 };
|
||||
|
||||
static const OptionDef *options;
|
||||
|
||||
/* FFprobe context */
|
||||
@@ -366,14 +352,6 @@ typedef struct LogBuffer {
|
||||
static LogBuffer *log_buffer;
|
||||
static int log_buffer_size;
|
||||
|
||||
static int is_key_selected_callback(AVTextFormatContext *tctx, const char *key)
|
||||
{
|
||||
const AVTextFormatSection *section = tctx->section[tctx->level];
|
||||
const EntrySelection *selection = &selected_entries[section - sections];
|
||||
|
||||
return selection->show_all_entries || av_dict_get(selection->entries_to_show, key, NULL, 0);
|
||||
}
|
||||
|
||||
static void log_callback(void *ptr, int level, const char *fmt, va_list vl)
|
||||
{
|
||||
AVClass* avc = ptr ? *(AVClass **) ptr : NULL;
|
||||
@@ -453,30 +431,6 @@ static void log_callback(void *ptr, int level, const char *fmt, va_list vl)
|
||||
#define print_duration_ts(k, v) avtext_print_ts(tfc, k, v, 1)
|
||||
#define print_val(k, v, u) avtext_print_unit_integer(tfc, k, v, u)
|
||||
|
||||
static void print_integers(AVTextFormatContext *tfc, const char *key,
|
||||
const void *data, int size, const char *format,
|
||||
int columns, int bytes, int offset_add)
|
||||
{
|
||||
AVBPrint bp;
|
||||
unsigned offset = 0;
|
||||
|
||||
av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
|
||||
av_bprint_chars(&bp, '\n', 1);
|
||||
while (size) {
|
||||
av_bprintf(&bp, "%08x: ", offset);
|
||||
for (int i = 0, l = FFMIN(size, columns); i < l; i++) {
|
||||
if (bytes == 1) av_bprintf(&bp, format, *(const uint8_t*)data);
|
||||
else if (bytes == 2) av_bprintf(&bp, format, AV_RN16(data));
|
||||
else if (bytes == 4) av_bprintf(&bp, format, AV_RN32(data));
|
||||
data = (const char*)data + bytes;
|
||||
size--;
|
||||
}
|
||||
av_bprint_chars(&bp, '\n', 1);
|
||||
offset += offset_add;
|
||||
}
|
||||
avtext_print_string(tfc, key, bp.str, 0);
|
||||
}
|
||||
|
||||
#define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n) \
|
||||
{ \
|
||||
ret = av_reallocp_array(&(ptr), (new_n), sizeof(*(ptr))); \
|
||||
@@ -508,7 +462,7 @@ static void print_displaymatrix(AVTextFormatContext *tfc, const int32_t matrix[9
|
||||
double rotation = av_display_rotation_get(matrix);
|
||||
if (isnan(rotation))
|
||||
rotation = 0;
|
||||
print_integers(tfc, "displaymatrix", matrix, 9, " %11d", 3, 4, 1);
|
||||
avtext_print_integers(tfc, "displaymatrix", (void*)matrix, 9, " %11d", 3, 4, 1);
|
||||
print_int("rotation", rotation);
|
||||
}
|
||||
|
||||
@@ -1103,12 +1057,6 @@ static void print_pkt_side_data(AVTextFormatContext *tfc,
|
||||
print_int("crop_right", AV_RL32(sd->data + 12));
|
||||
} else if (sd->type == AV_PKT_DATA_AFD && sd->size > 0) {
|
||||
print_int("active_format", *sd->data);
|
||||
} else if (sd->type == AV_PKT_DATA_EXIF) {
|
||||
print_int("size", sd->size);
|
||||
} else if (sd->type == AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL && sd->size >= 8) {
|
||||
print_int("block_additional_id", AV_RB64(sd->data));
|
||||
if (do_show_data)
|
||||
avtext_print_data(tfc, "block_additional_data", sd->data + 8, sd->size - 8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1200,16 +1148,6 @@ static void print_chroma_location(AVTextFormatContext *tfc, enum AVChromaLocatio
|
||||
}
|
||||
}
|
||||
|
||||
static void print_alpha_mode(AVTextFormatContext *tfc, enum AVAlphaMode alpha_mode)
|
||||
{
|
||||
const char *val = av_alpha_mode_name(alpha_mode);
|
||||
if (!val || alpha_mode == AVALPHA_MODE_UNSPECIFIED) {
|
||||
print_str_opt("alpha_mode", "unspecified");
|
||||
} else {
|
||||
print_str("alpha_mode", val);
|
||||
}
|
||||
}
|
||||
|
||||
static void clear_log(int need_lock)
|
||||
{
|
||||
int i;
|
||||
@@ -1398,8 +1336,6 @@ static void print_frame_side_data(AVTextFormatContext *tfc,
|
||||
print_film_grain_params(tfc, fgp);
|
||||
} else if (sd->type == AV_FRAME_DATA_VIEW_ID) {
|
||||
print_int("view_id", *(int*)sd->data);
|
||||
} else if (sd->type == AV_FRAME_DATA_EXIF) {
|
||||
print_int("size", sd->size);
|
||||
}
|
||||
avtext_print_section_footer(tfc);
|
||||
}
|
||||
@@ -1464,7 +1400,6 @@ static void show_frame(AVTextFormatContext *tfc, AVFrame *frame, AVStream *strea
|
||||
print_primaries(tfc, frame->color_primaries);
|
||||
print_color_trc(tfc, frame->color_trc);
|
||||
print_chroma_location(tfc, frame->chroma_location);
|
||||
print_alpha_mode(tfc, frame->alpha_mode);
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
@@ -1820,10 +1755,6 @@ static int show_stream(AVTextFormatContext *tfc, AVFormatContext *fmt_ctx, int s
|
||||
print_str("codec_tag_string", av_fourcc2str(par->codec_tag));
|
||||
print_fmt("codec_tag", "0x%04"PRIx32, par->codec_tag);
|
||||
|
||||
av_bprint_clear(&pbuf);
|
||||
if (!av_mime_codec_str(par, stream->avg_frame_rate, &pbuf))
|
||||
print_str("mime_codec_string", pbuf.str);
|
||||
|
||||
switch (par->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
print_int("width", par->width);
|
||||
@@ -1872,7 +1803,7 @@ static int show_stream(AVTextFormatContext *tfc, AVFormatContext *fmt_ctx, int s
|
||||
else
|
||||
print_str_opt("field_order", "unknown");
|
||||
|
||||
if (dec_ctx && do_read_frames)
|
||||
if (dec_ctx)
|
||||
print_int("refs", dec_ctx->refs);
|
||||
break;
|
||||
|
||||
@@ -2122,10 +2053,6 @@ static void print_iamf_param_definition(AVTextFormatContext *tfc, const char *na
|
||||
static void print_iamf_audio_element_params(AVTextFormatContext *tfc, const AVStreamGroup *stg,
|
||||
const AVIAMFAudioElement *audio_element)
|
||||
{
|
||||
AVBPrint pbuf;
|
||||
|
||||
av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
|
||||
|
||||
avtext_print_section_header(tfc, stg, SECTION_ID_STREAM_GROUP_COMPONENT);
|
||||
print_int("nb_layers", audio_element->nb_layers);
|
||||
print_int("audio_element_type", audio_element->audio_element_type);
|
||||
@@ -2140,12 +2067,8 @@ static void print_iamf_audio_element_params(AVTextFormatContext *tfc, const AVSt
|
||||
if (audio_element->audio_element_type == AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL) {
|
||||
print_int("output_gain_flags", layer->output_gain_flags);
|
||||
print_q("output_gain", layer->output_gain, '/');
|
||||
} else if (audio_element->audio_element_type == AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE) {
|
||||
} else if (audio_element->audio_element_type == AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE)
|
||||
print_int("ambisonics_mode", layer->ambisonics_mode);
|
||||
if (layer->ambisonics_mode == AV_IAMF_AMBISONICS_MODE_PROJECTION)
|
||||
print_list_fmt("demixing_matrix", "%d/%d", layer->nb_demixing_matrix, 1, layer->demixing_matrix[idx].num,
|
||||
layer->demixing_matrix[idx].den);
|
||||
}
|
||||
avtext_print_section_footer(tfc); // SECTION_ID_STREAM_GROUP_SUBCOMPONENT
|
||||
}
|
||||
if (audio_element->demixing_info)
|
||||
@@ -2156,8 +2079,6 @@ static void print_iamf_audio_element_params(AVTextFormatContext *tfc, const AVSt
|
||||
SECTION_ID_STREAM_GROUP_SUBCOMPONENT);
|
||||
avtext_print_section_footer(tfc); // SECTION_ID_STREAM_GROUP_SUBCOMPONENTS
|
||||
avtext_print_section_footer(tfc); // SECTION_ID_STREAM_GROUP_COMPONENT
|
||||
|
||||
av_bprint_finalize(&pbuf, NULL);
|
||||
}
|
||||
|
||||
static void print_iamf_submix_params(AVTextFormatContext *tfc, const AVIAMFSubmix *submix)
|
||||
@@ -2363,65 +2284,6 @@ static void show_error(AVTextFormatContext *tfc, int err)
|
||||
avtext_print_section_footer(tfc);
|
||||
}
|
||||
|
||||
static int get_decoder_by_name(const char *codec_name, const AVCodec **codec)
|
||||
{
|
||||
if (codec_name == NULL)
|
||||
return 0;
|
||||
|
||||
*codec = avcodec_find_decoder_by_name(codec_name);
|
||||
if (*codec == NULL) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"No codec could be found with name '%s'\n", codec_name);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_decoders(AVFormatContext *fmt_ctx)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#define GET_DECODER(type_) \
|
||||
ret = get_decoder_by_name(type_##_codec_name, &fmt_ctx->type_##_codec); \
|
||||
if (ret < 0) return ret;
|
||||
|
||||
GET_DECODER(audio);
|
||||
GET_DECODER(data);
|
||||
GET_DECODER(subtitle);
|
||||
GET_DECODER(video);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const AVCodec *get_decoder_for_stream(AVFormatContext *fmt_ctx, AVStream *stream)
|
||||
{
|
||||
const AVCodec *codec = NULL;
|
||||
switch (stream->codecpar->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO: codec = fmt_ctx->video_codec; break;
|
||||
case AVMEDIA_TYPE_AUDIO: codec = fmt_ctx->audio_codec; break;
|
||||
case AVMEDIA_TYPE_SUBTITLE: codec = fmt_ctx->subtitle_codec; break;
|
||||
case AVMEDIA_TYPE_DATA: codec = fmt_ctx->data_codec; break;
|
||||
}
|
||||
|
||||
if (codec != NULL)
|
||||
return codec;
|
||||
|
||||
if (stream->codecpar->codec_id == AV_CODEC_ID_PROBE) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"Failed to probe codec for input stream %d\n", stream->index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
codec = avcodec_find_decoder(stream->codecpar->codec_id);
|
||||
if (codec == NULL) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"Unsupported codec with id %d for input stream %d\n",
|
||||
stream->codecpar->codec_id, stream->index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return codec;
|
||||
}
|
||||
|
||||
static int open_input_file(InputFile *ifile, const char *filename,
|
||||
const char *print_filename)
|
||||
{
|
||||
@@ -2434,9 +2296,6 @@ static int open_input_file(InputFile *ifile, const char *filename,
|
||||
if (!fmt_ctx)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
err = set_decoders(fmt_ctx);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (!av_dict_get(format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) {
|
||||
av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
|
||||
scan_all_pmts_set = 1;
|
||||
@@ -2491,10 +2350,20 @@ static int open_input_file(InputFile *ifile, const char *filename,
|
||||
|
||||
ist->st = stream;
|
||||
|
||||
codec = get_decoder_for_stream(fmt_ctx, stream);
|
||||
if (!codec)
|
||||
if (stream->codecpar->codec_id == AV_CODEC_ID_PROBE) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"Failed to probe codec for input stream %d\n",
|
||||
stream->index);
|
||||
continue;
|
||||
}
|
||||
|
||||
codec = avcodec_find_decoder(stream->codecpar->codec_id);
|
||||
if (!codec) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"Unsupported codec with id %d for input stream %d\n",
|
||||
stream->codecpar->codec_id, stream->index);
|
||||
continue;
|
||||
}
|
||||
{
|
||||
AVDictionary *opts;
|
||||
|
||||
@@ -2641,10 +2510,6 @@ end:
|
||||
av_freep(&selected_streams);
|
||||
av_freep(&streams_with_closed_captions);
|
||||
av_freep(&streams_with_film_grain);
|
||||
av_freep(&audio_codec_name);
|
||||
av_freep(&data_codec_name);
|
||||
av_freep(&subtitle_codec_name);
|
||||
av_freep(&video_codec_name);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2781,15 +2646,14 @@ static int opt_format(void *optctx, const char *opt, const char *arg)
|
||||
static inline void mark_section_show_entries(SectionID section_id,
|
||||
int show_all_entries, AVDictionary *entries)
|
||||
{
|
||||
EntrySelection *selection = &selected_entries[section_id];
|
||||
struct AVTextFormatSection *section = §ions[section_id];
|
||||
|
||||
selection->show_all_entries = show_all_entries;
|
||||
section->show_all_entries = show_all_entries;
|
||||
if (show_all_entries) {
|
||||
const AVTextFormatSection *section = §ions[section_id];
|
||||
for (const int *id = section->children_ids; *id != -1; id++)
|
||||
mark_section_show_entries(*id, show_all_entries, entries);
|
||||
} else {
|
||||
av_dict_copy(&selection->entries_to_show, entries, 0);
|
||||
av_dict_copy(§ion->entries_to_show, entries, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3100,36 +2964,6 @@ static int opt_sections(void *optctx, const char *opt, const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opt_codec(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
const char *spec = strchr(opt, ':');
|
||||
const char **name;
|
||||
if (!spec) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"No media specifier was specified for '%s' in option '%s'. Use -%s:<media_spec> "
|
||||
"where <media_spec> can be one of: 'a' (audio), 'v' (video), 's' (subtitle), 'd' (data)\n",
|
||||
arg, opt, opt);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
spec++;
|
||||
|
||||
switch (spec[0]) {
|
||||
case 'a' : name = &audio_codec_name; break;
|
||||
case 'd' : name = &data_codec_name; break;
|
||||
case 's' : name = &subtitle_codec_name; break;
|
||||
case 'v' : name = &video_codec_name; break;
|
||||
default:
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Invalid media specifier '%s' in option '%s'. "
|
||||
"Must be one of: 'a' (audio), 'v' (video), 's' (subtitle), 'd' (data)\n", spec, opt);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
av_freep(name);
|
||||
*name = av_strdup(arg);
|
||||
return *name ? 0 : AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
static int opt_show_versions(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
mark_section_show_entries(SECTION_ID_PROGRAM_VERSION, 1, NULL);
|
||||
@@ -3173,7 +3007,6 @@ static const OptionDef real_options[] = {
|
||||
{ "of", OPT_TYPE_STRING, 0, { &output_format }, "alias for -output_format", "format" },
|
||||
{ "select_streams", OPT_TYPE_STRING, 0, { &stream_specifier }, "select the specified streams", "stream_specifier" },
|
||||
{ "sections", OPT_TYPE_FUNC, OPT_EXIT, {.func_arg = opt_sections}, "print sections structure and section information, and exit" },
|
||||
{ "data_dump_format", OPT_TYPE_STRING, 0, { &data_dump_format }, "set data dump format (available formats are: xxd, base64)" },
|
||||
{ "show_data", OPT_TYPE_BOOL, 0, { &do_show_data }, "show packets data" },
|
||||
{ "show_data_hash", OPT_TYPE_STRING, 0, { &show_data_hash }, "show packets data hash" },
|
||||
{ "show_error", OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_error }, "show probing error" },
|
||||
@@ -3206,19 +3039,14 @@ static const OptionDef real_options[] = {
|
||||
{ "print_filename", OPT_TYPE_FUNC, OPT_FUNC_ARG, {.func_arg = opt_print_filename}, "override the printed input filename", "print_file"},
|
||||
{ "find_stream_info", OPT_TYPE_BOOL, OPT_INPUT | OPT_EXPERT, { &find_stream_info },
|
||||
"read and decode the streams to fill missing information with heuristics" },
|
||||
{ "c", OPT_TYPE_FUNC, OPT_FUNC_ARG, { .func_arg = opt_codec}, "force decoder", "decoder_name" },
|
||||
{ "codec", OPT_TYPE_FUNC, OPT_FUNC_ARG, { .func_arg = opt_codec}, "alias for -c (force decoder)", "decoder_name" },
|
||||
{ NULL, },
|
||||
};
|
||||
|
||||
static inline int check_section_show_entries(int section_id)
|
||||
{
|
||||
const EntrySelection *selection = &selected_entries[section_id];
|
||||
|
||||
if (selection->show_all_entries || selection->entries_to_show)
|
||||
struct AVTextFormatSection *section = §ions[section_id];
|
||||
if (sections[section_id].show_all_entries || sections[section_id].entries_to_show)
|
||||
return 1;
|
||||
|
||||
const AVTextFormatSection *section = §ions[section_id];
|
||||
for (const int *id = section->children_ids; *id != -1; id++)
|
||||
if (check_section_show_entries(*id))
|
||||
return 1;
|
||||
@@ -3237,8 +3065,7 @@ int main(int argc, char **argv)
|
||||
AVTextWriterContext *wctx;
|
||||
char *buf;
|
||||
char *f_name = NULL, *f_args = NULL;
|
||||
int ret, input_ret;
|
||||
AVTextFormatDataDump data_dump_format_id;
|
||||
int ret, input_ret, i;
|
||||
|
||||
init_dynload();
|
||||
|
||||
@@ -3323,18 +3150,6 @@ int main(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (data_dump_format) {
|
||||
if (!strcmp(data_dump_format, "xxd")) {
|
||||
data_dump_format_id = AV_TEXTFORMAT_DATADUMP_XXD;
|
||||
} else if (!strcmp(data_dump_format, "base64")) {
|
||||
data_dump_format_id = AV_TEXTFORMAT_DATADUMP_BASE64;
|
||||
} else {
|
||||
av_log(NULL, AV_LOG_ERROR, "Unknown data dump format with name '%s'\n", data_dump_format);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (output_filename) {
|
||||
ret = avtextwriter_create_file(&wctx, output_filename);
|
||||
} else
|
||||
@@ -3344,13 +3159,11 @@ int main(int argc, char **argv)
|
||||
goto end;
|
||||
|
||||
AVTextFormatOptions tf_options = {
|
||||
.is_key_selected = is_key_selected_callback,
|
||||
.show_optional_fields = show_optional_fields,
|
||||
.show_value_unit = show_value_unit,
|
||||
.use_value_prefix = use_value_prefix,
|
||||
.use_byte_value_binary_prefix = use_byte_value_binary_prefix,
|
||||
.use_value_sexagesimal_format = use_value_sexagesimal_format,
|
||||
.data_dump_format = data_dump_format_id,
|
||||
};
|
||||
|
||||
if ((ret = avtext_context_open(&tctx, f, wctx, f_args, sections, FF_ARRAY_ELEMS(sections), tf_options, show_data_hash)) >= 0) {
|
||||
@@ -3402,8 +3215,8 @@ end:
|
||||
av_freep(&read_intervals);
|
||||
|
||||
uninit_opts();
|
||||
for (size_t i = 0; i < FF_ARRAY_ELEMS(selected_entries); ++i)
|
||||
av_dict_free(&selected_entries[i].entries_to_show);
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(sections); i++)
|
||||
av_dict_free(&(sections[i].entries_to_show));
|
||||
|
||||
avformat_network_deinit();
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/common.h"
|
||||
@@ -74,7 +75,7 @@ typedef enum {
|
||||
SECTION_ID_ENCODER,
|
||||
} SectionID;
|
||||
|
||||
static const AVTextFormatSection sections[] = {
|
||||
static struct AVTextFormatSection sections[] = {
|
||||
[SECTION_ID_ROOT] = { SECTION_ID_ROOT, "root", AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER, { SECTION_ID_FILTERGRAPHS, SECTION_ID_INPUTFILES, SECTION_ID_OUTPUTFILES, SECTION_ID_DECODERS, SECTION_ID_ENCODERS, SECTION_ID_STREAMLINKS, -1 } },
|
||||
|
||||
[SECTION_ID_FILTERGRAPHS] = { SECTION_ID_FILTERGRAPHS, "graphs", AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY, { SECTION_ID_FILTERGRAPH, -1 } },
|
||||
@@ -271,7 +272,7 @@ static void print_link(GraphPrintContext *gpc, AVFilterLink *link)
|
||||
}
|
||||
|
||||
if (link->w && link->h) {
|
||||
if (tfc->opts.show_value_unit) {
|
||||
if (tfc->show_value_unit) {
|
||||
print_fmt("size", "%dx%d", link->w, link->h);
|
||||
} else {
|
||||
print_int("width", link->w);
|
||||
@@ -292,7 +293,7 @@ static void print_link(GraphPrintContext *gpc, AVFilterLink *link)
|
||||
////print_str("format", av_x_if_null(av_get_subtitle_fmt_name(link->format), "?"));
|
||||
|
||||
if (link->w && link->h) {
|
||||
if (tfc->opts.show_value_unit) {
|
||||
if (tfc->show_value_unit) {
|
||||
print_fmt("size", "%dx%d", link->w, link->h);
|
||||
} else {
|
||||
print_int("width", link->w);
|
||||
@@ -306,7 +307,7 @@ static void print_link(GraphPrintContext *gpc, AVFilterLink *link)
|
||||
av_channel_layout_describe(&link->ch_layout, layout_string, sizeof(layout_string));
|
||||
print_str("channel_layout", layout_string);
|
||||
print_val("channels", link->ch_layout.nb_channels, "ch");
|
||||
if (tfc->opts.show_value_unit)
|
||||
if (tfc->show_value_unit)
|
||||
print_fmt("sample_rate", "%d.1 kHz", link->sample_rate / 1000);
|
||||
else
|
||||
print_val("sample_rate", link->sample_rate, "Hz");
|
||||
@@ -470,6 +471,12 @@ static void print_filter(GraphPrintContext *gpc, const AVFilterContext *filter,
|
||||
avtext_print_section_footer(tfc); // SECTION_ID_FILTER
|
||||
}
|
||||
|
||||
static void init_sections(void)
|
||||
{
|
||||
for (unsigned i = 0; i < FF_ARRAY_ELEMS(sections); i++)
|
||||
sections[i].show_all_entries = 1;
|
||||
}
|
||||
|
||||
static void print_filtergraph_single(GraphPrintContext *gpc, FilterGraph *fg, AVFilterGraph *graph)
|
||||
{
|
||||
AVTextFormatContext *tfc = gpc->tfc;
|
||||
@@ -870,6 +877,7 @@ static int init_graphprint(GraphPrintContext **pgpc, AVBPrint *target_buf)
|
||||
GraphPrintContext *gpc = NULL;
|
||||
int ret;
|
||||
|
||||
init_sections();
|
||||
*pgpc = NULL;
|
||||
|
||||
av_bprint_init(target_buf, 0, AV_BPRINT_SIZE_UNLIMITED);
|
||||
@@ -912,8 +920,8 @@ static int init_graphprint(GraphPrintContext **pgpc, AVBPrint *target_buf)
|
||||
gpc->id_prefix_num = atomic_fetch_add(&prefix_num, 1);
|
||||
gpc->is_diagram = !!(tfc->formatter->flags & AV_TEXTFORMAT_FLAG_IS_DIAGRAM_FORMATTER);
|
||||
if (gpc->is_diagram) {
|
||||
tfc->opts.show_value_unit = 1;
|
||||
tfc->opts.show_optional_fields = -1;
|
||||
tfc->show_value_unit = 1;
|
||||
tfc->show_optional_fields = -1;
|
||||
gpc->opt_flags = AV_TEXTFORMAT_PRINT_STRING_OPTIONAL;
|
||||
gpc->skip_buffer_filters = 1;
|
||||
////} else {
|
||||
@@ -946,13 +954,16 @@ fail:
|
||||
|
||||
int print_filtergraph(FilterGraph *fg, AVFilterGraph *graph)
|
||||
{
|
||||
av_assert2(fg);
|
||||
|
||||
GraphPrintContext *gpc = NULL;
|
||||
AVTextFormatContext *tfc;
|
||||
AVBPrint *target_buf = &fg->graph_print_buf;
|
||||
int ret;
|
||||
|
||||
if (!fg) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Invalid filter graph provided\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (target_buf->len)
|
||||
av_bprint_finalize(target_buf, NULL);
|
||||
|
||||
@@ -960,6 +971,11 @@ int print_filtergraph(FilterGraph *fg, AVFilterGraph *graph)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!gpc) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Failed to initialize graph print context\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
tfc = gpc->tfc;
|
||||
|
||||
// Due to the threading model each graph needs to print itself into a buffer
|
||||
@@ -996,6 +1012,11 @@ static int print_filtergraphs_priv(FilterGraph **graphs, int nb_graphs, InputFil
|
||||
if (ret)
|
||||
goto cleanup;
|
||||
|
||||
if (!gpc) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
tfc = gpc->tfc;
|
||||
|
||||
avtext_print_section_header(tfc, NULL, SECTION_ID_ROOT);
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cmdutils.h"
|
||||
#include "fopen_utf8.h"
|
||||
#include "opt_common.h"
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
@@ -809,8 +808,7 @@ int show_filters(void *optctx, const char *opt, const char *arg)
|
||||
" A = Audio input/output\n"
|
||||
" V = Video input/output\n"
|
||||
" N = Dynamic number and/or type of input/output\n"
|
||||
" | = Source or sink filter\n"
|
||||
" ------\n");
|
||||
" | = Source or sink filter\n");
|
||||
while ((filter = av_filter_iterate(&opaque))) {
|
||||
descr_cur = descr;
|
||||
for (i = 0; i < 2; i++) {
|
||||
@@ -992,7 +990,7 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg)
|
||||
#endif
|
||||
|
||||
while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
|
||||
av_unused enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
|
||||
enum AVPixelFormat av_unused pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
|
||||
printf("%c%c%c%c%c %-16s %d %3d %d",
|
||||
sws_isSupportedInput (pix_fmt) ? 'I' : '.',
|
||||
sws_isSupportedOutput(pix_fmt) ? 'O' : '.',
|
||||
@@ -1206,7 +1204,7 @@ int init_report(const char *env, FILE **file)
|
||||
if (!envlevel)
|
||||
report_file_level = FFMAX(report_file_level, prog_loglevel);
|
||||
|
||||
report_file = fopen_utf8(filename.str, "w");
|
||||
report_file = fopen(filename.str, "w");
|
||||
if (!report_file) {
|
||||
int ret = AVERROR(errno);
|
||||
av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n",
|
||||
|
||||
@@ -41,9 +41,9 @@ int show_sources(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
#if CONFIG_AVDEVICE
|
||||
#define CMDUTILS_COMMON_OPTIONS_AVDEVICE \
|
||||
{ "sources" , OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_sources }, \
|
||||
{ "sources" , OPT_TYPE_FUNC, OPT_EXIT | OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = show_sources }, \
|
||||
"list sources of the input device", "device" }, \
|
||||
{ "sinks" , OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_sinks }, \
|
||||
{ "sinks" , OPT_TYPE_FUNC, OPT_EXIT | OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = show_sinks }, \
|
||||
"list sinks of the output device", "device" }, \
|
||||
|
||||
#else
|
||||
@@ -198,7 +198,6 @@ int opt_cpucount(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
#define CMDUTILS_COMMON_OPTIONS \
|
||||
{ "L", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_license }, "show license" }, \
|
||||
{ "license", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_license }, "show license" }, \
|
||||
{ "h", OPT_TYPE_FUNC, OPT_EXIT, { .func_arg = show_help }, "show help", "topic" }, \
|
||||
{ "?", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_help }, "show help", "topic" }, \
|
||||
{ "help", OPT_TYPE_FUNC, OPT_EXIT | OPT_EXPERT, { .func_arg = show_help }, "show help", "topic" }, \
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
*.html.c
|
||||
*.css.c
|
||||
*.html.gz
|
||||
*.css.min
|
||||
*.css.min.gz
|
||||
*.css.gz
|
||||
*.min
|
||||
*.min.gz
|
||||
|
||||
@@ -4,16 +4,10 @@ clean::
|
||||
vpath %.html $(SRC_PATH)
|
||||
vpath %.css $(SRC_PATH)
|
||||
|
||||
# Uncomment to prevent deletion during build
|
||||
#.PRECIOUS: %.css.c %.css.min %.css.gz %.css.min.gz %.html.gz %.html.c
|
||||
|
||||
OBJS-resman += \
|
||||
fftools/resources/resman.o \
|
||||
|
||||
|
||||
RESOBJS += \
|
||||
fftools/resources/graph.html.o \
|
||||
fftools/resources/graph.css.o \
|
||||
|
||||
|
||||
$(RESOBJS): CCDEP =
|
||||
$(RESOBJS): CC_DEPFLAGS =
|
||||
|
||||
.SECONDARY: $(RESOBJS:.o=.gz) $(RESOBJS:.o=.c) $(RESOBJS:%.css.o=%.css.min) $(RESOBJS:%.css.o=%.css.min.gz) $(RESOBJS:%.html.o=%.html.gz) $(RESOBJS:.o=)
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/base64.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/error.h"
|
||||
#include "libavutil/hash.h"
|
||||
@@ -148,7 +147,11 @@ int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form
|
||||
goto fail;
|
||||
}
|
||||
|
||||
tctx->opts = options;
|
||||
tctx->show_value_unit = options.show_value_unit;
|
||||
tctx->use_value_prefix = options.use_value_prefix;
|
||||
tctx->use_byte_value_binary_prefix = options.use_byte_value_binary_prefix;
|
||||
tctx->use_value_sexagesimal_format = options.use_value_sexagesimal_format;
|
||||
tctx->show_optional_fields = options.show_optional_fields;
|
||||
|
||||
if (nb_sections > SECTION_MAX_NB_SECTIONS) {
|
||||
av_log(tctx, AV_LOG_ERROR, "The number of section definitions (%d) is larger than the maximum allowed (%d)\n", nb_sections, SECTION_MAX_NB_SECTIONS);
|
||||
@@ -286,19 +289,23 @@ void avtext_print_section_footer(AVTextFormatContext *tctx)
|
||||
|
||||
void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t val, int flags)
|
||||
{
|
||||
const AVTextFormatSection *section;
|
||||
|
||||
av_assert0(tctx);
|
||||
|
||||
if (tctx->opts.show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER)
|
||||
if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER)
|
||||
return;
|
||||
|
||||
if (tctx->opts.show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO
|
||||
if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO
|
||||
&& (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL)
|
||||
&& !(tctx->formatter->flags & AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS))
|
||||
return;
|
||||
|
||||
av_assert0(key && tctx->level >= 0 && tctx->level < SECTION_MAX_NB_LEVELS);
|
||||
|
||||
if (!tctx->opts.is_key_selected || tctx->opts.is_key_selected(tctx, key)) {
|
||||
section = tctx->section[tctx->level];
|
||||
|
||||
if (section->show_all_entries || av_dict_get(section->entries_to_show, key, NULL, 0)) {
|
||||
tctx->formatter->print_integer(tctx, key, val);
|
||||
tctx->nb_item[tctx->level]++;
|
||||
}
|
||||
@@ -384,7 +391,7 @@ static char *value_string(const AVTextFormatContext *tctx, char *buf, int buf_si
|
||||
vali = uv.val.i;
|
||||
}
|
||||
|
||||
if (uv.unit == unit_second_str && tctx->opts.use_value_sexagesimal_format) {
|
||||
if (uv.unit == unit_second_str && tctx->use_value_sexagesimal_format) {
|
||||
double secs;
|
||||
int hours, mins;
|
||||
secs = vald;
|
||||
@@ -396,10 +403,10 @@ static char *value_string(const AVTextFormatContext *tctx, char *buf, int buf_si
|
||||
} else {
|
||||
const char *prefix_string = "";
|
||||
|
||||
if (tctx->opts.use_value_prefix && vald > 1) {
|
||||
if (tctx->use_value_prefix && vald > 1) {
|
||||
int64_t index;
|
||||
|
||||
if (uv.unit == unit_byte_str && tctx->opts.use_byte_value_binary_prefix) {
|
||||
if (uv.unit == unit_byte_str && tctx->use_byte_value_binary_prefix) {
|
||||
index = (int64_t)(log2(vald) / 10);
|
||||
index = av_clip64(index, 0, FF_ARRAY_ELEMS(si_prefixes) - 1);
|
||||
vald /= si_prefixes[index].bin_val;
|
||||
@@ -413,13 +420,13 @@ static char *value_string(const AVTextFormatContext *tctx, char *buf, int buf_si
|
||||
vali = (int64_t)vald;
|
||||
}
|
||||
|
||||
if (show_float || (tctx->opts.use_value_prefix && vald != (int64_t)vald))
|
||||
if (show_float || (tctx->use_value_prefix && vald != (int64_t)vald))
|
||||
snprintf(buf, buf_size, "%f", vald);
|
||||
else
|
||||
snprintf(buf, buf_size, "%"PRId64, vali);
|
||||
|
||||
av_strlcatf(buf, buf_size, "%s%s%s", *prefix_string || tctx->opts.show_value_unit ? " " : "",
|
||||
prefix_string, tctx->opts.show_value_unit ? uv.unit : "");
|
||||
av_strlcatf(buf, buf_size, "%s%s%s", *prefix_string || tctx->show_value_unit ? " " : "",
|
||||
prefix_string, tctx->show_value_unit ? uv.unit : "");
|
||||
}
|
||||
|
||||
return buf;
|
||||
@@ -445,15 +452,15 @@ int avtext_print_string(AVTextFormatContext *tctx, const char *key, const char *
|
||||
|
||||
section = tctx->section[tctx->level];
|
||||
|
||||
if (tctx->opts.show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER)
|
||||
if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER)
|
||||
return 0;
|
||||
|
||||
if (tctx->opts.show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO
|
||||
if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO
|
||||
&& (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL)
|
||||
&& !(tctx->formatter->flags & AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS))
|
||||
return 0;
|
||||
|
||||
if (!tctx->opts.is_key_selected || tctx->opts.is_key_selected(tctx, key)) {
|
||||
if (section->show_all_entries || av_dict_get(section->entries_to_show, key, NULL, 0)) {
|
||||
if (flags & AV_TEXTFORMAT_PRINT_STRING_VALIDATE) {
|
||||
char *key1 = NULL, *val1 = NULL;
|
||||
ret = validate_string(tctx, &key1, key);
|
||||
@@ -509,57 +516,30 @@ void avtext_print_ts(AVTextFormatContext *tctx, const char *key, int64_t ts, int
|
||||
avtext_print_integer(tctx, key, ts, 0);
|
||||
}
|
||||
|
||||
static void print_data_xxd(AVBPrint *bp, const uint8_t *data, int size)
|
||||
{
|
||||
unsigned offset = 0;
|
||||
int i;
|
||||
|
||||
av_bprintf(bp, "\n");
|
||||
while (size) {
|
||||
av_bprintf(bp, "%08x: ", offset);
|
||||
int l = FFMIN(size, 16);
|
||||
for (i = 0; i < l; i++) {
|
||||
av_bprintf(bp, "%02x", data[i]);
|
||||
if (i & 1)
|
||||
av_bprintf(bp, " ");
|
||||
}
|
||||
av_bprint_chars(bp, ' ', 41 - 2 * i - i / 2);
|
||||
for (i = 0; i < l; i++)
|
||||
av_bprint_chars(bp, data[i] - 32U < 95 ? data[i] : '.', 1);
|
||||
av_bprintf(bp, "\n");
|
||||
offset += l;
|
||||
data += l;
|
||||
size -= l;
|
||||
}
|
||||
}
|
||||
|
||||
static void print_data_base64(AVBPrint *bp, const uint8_t *data, int size)
|
||||
{
|
||||
char buf[AV_BASE64_SIZE(60)];
|
||||
|
||||
av_bprintf(bp, "\n");
|
||||
while (size) {
|
||||
int l = FFMIN(size, 60);
|
||||
av_base64_encode(buf, sizeof(buf), data, l);
|
||||
av_bprintf(bp, "%s\n", buf);
|
||||
data += l;
|
||||
size -= l;
|
||||
}
|
||||
}
|
||||
void avtext_print_data(AVTextFormatContext *tctx, const char *key,
|
||||
const uint8_t *data, int size)
|
||||
{
|
||||
AVBPrint bp;
|
||||
unsigned offset = 0;
|
||||
int i;
|
||||
|
||||
av_bprint_init(&bp, 0, AV_BPRINT_SIZE_UNLIMITED);
|
||||
switch (tctx->opts.data_dump_format) {
|
||||
case AV_TEXTFORMAT_DATADUMP_XXD:
|
||||
print_data_xxd(&bp, data, size);
|
||||
break;
|
||||
case AV_TEXTFORMAT_DATADUMP_BASE64:
|
||||
print_data_base64(&bp, data, size);
|
||||
break;
|
||||
default:
|
||||
av_unreachable("Invalid data dump type");
|
||||
av_bprintf(&bp, "\n");
|
||||
while (size) {
|
||||
av_bprintf(&bp, "%08x: ", offset);
|
||||
int l = FFMIN(size, 16);
|
||||
for (i = 0; i < l; i++) {
|
||||
av_bprintf(&bp, "%02x", data[i]);
|
||||
if (i & 1)
|
||||
av_bprintf(&bp, " ");
|
||||
}
|
||||
av_bprint_chars(&bp, ' ', 41 - 2 * i - i / 2);
|
||||
for (i = 0; i < l; i++)
|
||||
av_bprint_chars(&bp, data[i] - 32U < 95 ? data[i] : '.', 1);
|
||||
av_bprintf(&bp, "\n");
|
||||
offset += l;
|
||||
data += l;
|
||||
size -= l;
|
||||
}
|
||||
avtext_print_string(tctx, key, bp.str, 0);
|
||||
av_bprint_finalize(&bp, NULL);
|
||||
@@ -581,6 +561,34 @@ void avtext_print_data_hash(AVTextFormatContext *tctx, const char *key,
|
||||
avtext_print_string(tctx, key, buf, 0);
|
||||
}
|
||||
|
||||
void avtext_print_integers(AVTextFormatContext *tctx, const char *key,
|
||||
uint8_t *data, int size, const char *format,
|
||||
int columns, int bytes, int offset_add)
|
||||
{
|
||||
AVBPrint bp;
|
||||
unsigned offset = 0;
|
||||
|
||||
if (!key || !data || !format || columns <= 0 || bytes <= 0)
|
||||
return;
|
||||
|
||||
av_bprint_init(&bp, 0, AV_BPRINT_SIZE_UNLIMITED);
|
||||
av_bprintf(&bp, "\n");
|
||||
while (size) {
|
||||
av_bprintf(&bp, "%08x: ", offset);
|
||||
for (int i = 0, l = FFMIN(size, columns); i < l; i++) {
|
||||
if (bytes == 1) av_bprintf(&bp, format, *data);
|
||||
else if (bytes == 2) av_bprintf(&bp, format, AV_RN16(data));
|
||||
else if (bytes == 4) av_bprintf(&bp, format, AV_RN32(data));
|
||||
data += bytes;
|
||||
size--;
|
||||
}
|
||||
av_bprintf(&bp, "\n");
|
||||
offset += offset_add;
|
||||
}
|
||||
avtext_print_string(tctx, key, bp.str, 0);
|
||||
av_bprint_finalize(&bp, NULL);
|
||||
}
|
||||
|
||||
static const char *writercontext_get_writer_name(void *p)
|
||||
{
|
||||
AVTextWriterContext *wctx = p;
|
||||
|
||||
@@ -57,7 +57,9 @@ typedef struct AVTextFormatSection {
|
||||
const int children_ids[SECTION_MAX_NB_CHILDREN + 1]; ///< list of children section IDS, terminated by -1
|
||||
const char *element_name; ///< name of the contained element, if provided
|
||||
const char *unique_name; ///< unique section name, in case the name is ambiguous
|
||||
AVDictionary *entries_to_show;
|
||||
const char *(*get_type)(const void *data); ///< function returning a type if defined, must be defined when SECTION_FLAG_HAS_TYPE is defined
|
||||
int show_all_entries;
|
||||
const char *id_key; ///< name of the key to be used as the id
|
||||
const char *src_id_key; ///< name of the key to be used as the source id for diagram connections
|
||||
const char *dest_id_key; ///< name of the key to be used as the target id for diagram connections
|
||||
@@ -89,11 +91,6 @@ typedef enum {
|
||||
AV_TEXTFORMAT_LINKTYPE_MANYTOMANY = AV_TEXTFORMAT_LINKTYPE_NONDIR,
|
||||
} AVTextFormatLinkType;
|
||||
|
||||
typedef enum {
|
||||
AV_TEXTFORMAT_DATADUMP_XXD,
|
||||
AV_TEXTFORMAT_DATADUMP_BASE64,
|
||||
} AVTextFormatDataDump;
|
||||
|
||||
typedef struct AVTextFormatter {
|
||||
const AVClass *priv_class; ///< private class of the formatter, if any
|
||||
int priv_size; ///< private size for the formatter context
|
||||
@@ -112,24 +109,6 @@ typedef struct AVTextFormatter {
|
||||
#define SECTION_MAX_NB_LEVELS 12
|
||||
#define SECTION_MAX_NB_SECTIONS 100
|
||||
|
||||
typedef struct AVTextFormatOptions {
|
||||
/**
|
||||
* Callback to discard certain elements based upon the key used.
|
||||
* It is called before any element with a key is printed.
|
||||
* If this callback is unset, all elements are printed.
|
||||
*
|
||||
* @retval 1 if the element is supposed to be printed
|
||||
* @retval 0 if the element is supposed to be discarded
|
||||
*/
|
||||
int (*is_key_selected)(struct AVTextFormatContext *tctx, const char *key);
|
||||
int show_optional_fields;
|
||||
int show_value_unit;
|
||||
int use_value_prefix;
|
||||
int use_byte_value_binary_prefix;
|
||||
int use_value_sexagesimal_format;
|
||||
AVTextFormatDataDump data_dump_format;
|
||||
} AVTextFormatOptions;
|
||||
|
||||
struct AVTextFormatContext {
|
||||
const AVClass *class; ///< class of the formatter
|
||||
const AVTextFormatter *formatter; ///< the AVTextFormatter of which this is an instance
|
||||
@@ -152,7 +131,11 @@ struct AVTextFormatContext {
|
||||
AVBPrint section_pbuf[SECTION_MAX_NB_LEVELS]; ///< generic print buffer dedicated to each section,
|
||||
/// used by various formatters
|
||||
|
||||
AVTextFormatOptions opts;
|
||||
int show_optional_fields;
|
||||
int show_value_unit;
|
||||
int use_value_prefix;
|
||||
int use_byte_value_binary_prefix;
|
||||
int use_value_sexagesimal_format;
|
||||
|
||||
struct AVHashContext *hash;
|
||||
|
||||
@@ -161,6 +144,14 @@ struct AVTextFormatContext {
|
||||
unsigned int string_validation_utf8_flags;
|
||||
};
|
||||
|
||||
typedef struct AVTextFormatOptions {
|
||||
int show_optional_fields;
|
||||
int show_value_unit;
|
||||
int use_value_prefix;
|
||||
int use_byte_value_binary_prefix;
|
||||
int use_value_sexagesimal_format;
|
||||
} AVTextFormatOptions;
|
||||
|
||||
#define AV_TEXTFORMAT_PRINT_STRING_OPTIONAL 1
|
||||
#define AV_TEXTFORMAT_PRINT_STRING_VALIDATE 2
|
||||
|
||||
@@ -190,6 +181,9 @@ void avtext_print_data(AVTextFormatContext *tctx, const char *key, const uint8_t
|
||||
|
||||
void avtext_print_data_hash(AVTextFormatContext *tctx, const char *key, const uint8_t *data, int size);
|
||||
|
||||
void avtext_print_integers(AVTextFormatContext *tctx, const char *key, uint8_t *data, int size,
|
||||
const char *format, int columns, int bytes, int offset_add);
|
||||
|
||||
const AVTextFormatter *avtext_get_formatter_by_name(const char *name);
|
||||
|
||||
extern const AVTextFormatter avtextformatter_default;
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
#include "avtextformat.h"
|
||||
#include "tf_internal.h"
|
||||
#include "tf_mermaid.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/avassert.h>
|
||||
#include <libavutil/bprint.h>
|
||||
#include <libavutil/opt.h>
|
||||
|
||||
|
||||
static const char *init_directive = ""
|
||||
@@ -240,20 +241,6 @@ static void set_str(const char **dst, const char *src)
|
||||
*dst = av_strdup(src);
|
||||
}
|
||||
|
||||
static void mermaid_subgraph_complete_start(MermaidContext *mmc, AVTextFormatContext *tfc, int level) {
|
||||
struct section_data parent_sec_data = mmc->section_data[level];
|
||||
AVBPrint *parent_buf = &tfc->section_pbuf[level];
|
||||
|
||||
if (parent_sec_data.subgraph_start_incomplete) {
|
||||
if (parent_buf->len > 0)
|
||||
writer_printf(tfc, "%s", parent_buf->str);
|
||||
|
||||
writer_put_str(tfc, "</div>\"]\n");
|
||||
|
||||
mmc->section_data[level].subgraph_start_incomplete = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#define MM_INDENT() writer_printf(tfc, "%*c", mmc->indent_level * 2, ' ')
|
||||
|
||||
static void mermaid_print_section_header(AVTextFormatContext *tfc, const void *data)
|
||||
@@ -310,7 +297,19 @@ static void mermaid_print_section_header(AVTextFormatContext *tfc, const void *d
|
||||
}
|
||||
|
||||
if (parent_section && parent_section->flags & AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH) {
|
||||
mermaid_subgraph_complete_start(mmc, tfc, tfc->level - 1);
|
||||
|
||||
struct section_data parent_sec_data = mmc->section_data[tfc->level - 1];
|
||||
AVBPrint *parent_buf = &tfc->section_pbuf[tfc->level - 1];
|
||||
|
||||
if (parent_sec_data.subgraph_start_incomplete) {
|
||||
|
||||
if (parent_buf->len > 0)
|
||||
writer_printf(tfc, "%s", parent_buf->str);
|
||||
|
||||
writer_put_str(tfc, "</div>\"]\n");
|
||||
|
||||
mmc->section_data[tfc->level - 1].subgraph_start_incomplete = 0;
|
||||
}
|
||||
}
|
||||
|
||||
av_freep(&mmc->section_data[tfc->level].section_id);
|
||||
@@ -456,8 +455,6 @@ static void mermaid_print_section_footer(AVTextFormatContext *tfc)
|
||||
|
||||
} else if ((section->flags & AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH)) {
|
||||
|
||||
mermaid_subgraph_complete_start(mmc, tfc, tfc->level);
|
||||
|
||||
MM_INDENT();
|
||||
writer_put_str(tfc, "end\n");
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ static av_cold int xml_init(AVTextFormatContext *wctx)
|
||||
return AVERROR(EINVAL); \
|
||||
}
|
||||
////CHECK_COMPLIANCE(show_private_data, "private");
|
||||
CHECK_COMPLIANCE(wctx->opts.show_value_unit, "unit");
|
||||
CHECK_COMPLIANCE(wctx->opts.use_value_prefix, "prefix");
|
||||
CHECK_COMPLIANCE(wctx->show_value_unit, "unit");
|
||||
CHECK_COMPLIANCE(wctx->use_value_prefix, "prefix");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -38,7 +38,6 @@ enum {
|
||||
};
|
||||
|
||||
struct ThreadQueue {
|
||||
int choked;
|
||||
int *finished;
|
||||
unsigned int nb_streams;
|
||||
|
||||
@@ -158,9 +157,6 @@ static int receive_locked(ThreadQueue *tq, int *stream_idx,
|
||||
{
|
||||
unsigned int nb_finished = 0;
|
||||
|
||||
if (tq->choked)
|
||||
return AVERROR(EAGAIN);
|
||||
|
||||
while (av_container_fifo_read(tq->fifo, data, 0) >= 0) {
|
||||
unsigned idx;
|
||||
int ret;
|
||||
@@ -234,7 +230,6 @@ void tq_send_finish(ThreadQueue *tq, unsigned int stream_idx)
|
||||
* next time the consumer thread tries to read this stream it will get
|
||||
* an EOF and recv-finished flag will be set */
|
||||
tq->finished[stream_idx] |= FINISHED_SEND;
|
||||
tq->choked = 0;
|
||||
pthread_cond_broadcast(&tq->cond);
|
||||
|
||||
pthread_mutex_unlock(&tq->lock);
|
||||
@@ -254,15 +249,3 @@ void tq_receive_finish(ThreadQueue *tq, unsigned int stream_idx)
|
||||
|
||||
pthread_mutex_unlock(&tq->lock);
|
||||
}
|
||||
|
||||
void tq_choke(ThreadQueue *tq, int choked)
|
||||
{
|
||||
pthread_mutex_lock(&tq->lock);
|
||||
|
||||
int prev_choked = tq->choked;
|
||||
tq->choked = choked;
|
||||
if (choked != prev_choked)
|
||||
pthread_cond_broadcast(&tq->cond);
|
||||
|
||||
pthread_mutex_unlock(&tq->lock);
|
||||
}
|
||||
|
||||
@@ -58,15 +58,6 @@ int tq_send(ThreadQueue *tq, unsigned int stream_idx, void *data);
|
||||
*/
|
||||
void tq_send_finish(ThreadQueue *tq, unsigned int stream_idx);
|
||||
|
||||
/**
|
||||
* Prevent further reads from the thread queue until it is unchoked. Threads
|
||||
* attempting to read from the queue will block, similar to when the queue is
|
||||
* empty.
|
||||
*
|
||||
* @param choked 1 to choke, 0 to unchoke
|
||||
*/
|
||||
void tq_choke(ThreadQueue *tq, int choked);
|
||||
|
||||
/**
|
||||
* Read the next item from the queue.
|
||||
*
|
||||
|
||||
@@ -198,6 +198,7 @@ const FFCodec ff_eightsvx_fib_decoder = {
|
||||
FF_CODEC_DECODE_CB(eightsvx_decode_frame),
|
||||
.close = eightsvx_decode_close,
|
||||
.p.capabilities = AV_CODEC_CAP_DR1,
|
||||
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P),
|
||||
};
|
||||
#endif
|
||||
#if CONFIG_EIGHTSVX_EXP_DECODER
|
||||
@@ -211,5 +212,6 @@ const FFCodec ff_eightsvx_exp_decoder = {
|
||||
FF_CODEC_DECODE_CB(eightsvx_decode_frame),
|
||||
.close = eightsvx_decode_close,
|
||||
.p.capabilities = AV_CODEC_CAP_DR1,
|
||||
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P),
|
||||
};
|
||||
#endif
|
||||
|
||||
+24
-49
@@ -15,7 +15,6 @@ HEADERS = ac3_parser.h \
|
||||
dirac.h \
|
||||
dv_profile.h \
|
||||
dxva2.h \
|
||||
exif.h \
|
||||
jni.h \
|
||||
mediacodec.h \
|
||||
packet.h \
|
||||
@@ -43,7 +42,6 @@ OBJS = ac3_parser.o \
|
||||
dirac.o \
|
||||
dv_profile.o \
|
||||
encode.o \
|
||||
exif.o \
|
||||
get_buffer.o \
|
||||
imgconvert.o \
|
||||
jni.o \
|
||||
@@ -57,7 +55,6 @@ OBJS = ac3_parser.o \
|
||||
qsv_api.o \
|
||||
raw.o \
|
||||
threadprogress.o \
|
||||
tiff_common.o \
|
||||
utils.o \
|
||||
version.o \
|
||||
vlc.o \
|
||||
@@ -88,10 +85,9 @@ OBJS-$(CONFIG_CABAC) += cabac.o
|
||||
OBJS-$(CONFIG_CBS) += cbs.o cbs_bsf.o
|
||||
OBJS-$(CONFIG_CBS_APV) += cbs_apv.o
|
||||
OBJS-$(CONFIG_CBS_AV1) += cbs_av1.o
|
||||
OBJS-$(CONFIG_CBS_H264) += cbs_h264.o cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_H265) += cbs_h265.o cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_H266) += cbs_h266.o cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_LCEVC) += cbs_lcevc.o cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_H264) += cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_H265) += cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_H266) += cbs_h2645.o cbs_sei.o h2645_parse.o
|
||||
OBJS-$(CONFIG_CBS_JPEG) += cbs_jpeg.o
|
||||
OBJS-$(CONFIG_CBS_MPEG2) += cbs_mpeg2.o
|
||||
OBJS-$(CONFIG_CBS_VP8) += cbs_vp8.o vp8data.o
|
||||
@@ -103,6 +99,7 @@ OBJS-$(CONFIG_DOVI_RPUDEC) += dovi_rpu.o dovi_rpudec.o
|
||||
OBJS-$(CONFIG_DOVI_RPUENC) += dovi_rpu.o dovi_rpuenc.o
|
||||
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
|
||||
OBJS-$(CONFIG_EVCPARSE) += evc_parse.o evc_ps.o
|
||||
OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o
|
||||
OBJS-$(CONFIG_FAANDCT) += faandct.o
|
||||
OBJS-$(CONFIG_FAANIDCT) += faanidct.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o
|
||||
@@ -159,7 +156,7 @@ OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
|
||||
motion_est.o ratecontrol.o
|
||||
OBJS-$(CONFIG_MPEGVIDEOENCDSP) += mpegvideoencdsp.o
|
||||
OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4dec.o msmpeg4.o msmpeg4data.o \
|
||||
msmpeg4_vc1_data.o mpeg4videodec.o
|
||||
msmpeg4_vc1_data.o
|
||||
OBJS-$(CONFIG_MSMPEG4ENC) += msmpeg4enc.o msmpeg4.o msmpeg4data.o \
|
||||
msmpeg4_vc1_data.o
|
||||
OBJS-$(CONFIG_MSS34DSP) += mss34dsp.o jpegquanttables.o
|
||||
@@ -183,6 +180,7 @@ OBJS-$(CONFIG_AV1_AMF_DECODER) += amfdec.o
|
||||
OBJS-$(CONFIG_VC1DSP) += vc1dsp.o
|
||||
OBJS-$(CONFIG_VIDEODSP) += videodsp.o
|
||||
OBJS-$(CONFIG_VP3DSP) += vp3dsp.o
|
||||
OBJS-$(CONFIG_VP56DSP) += vp56dsp.o
|
||||
OBJS-$(CONFIG_VP8DSP) += vp8dsp.o
|
||||
OBJS-$(CONFIG_V4L2_M2M) += v4l2_m2m.o v4l2_context.o v4l2_buffers.o v4l2_fmt.o
|
||||
OBJS-$(CONFIG_WMA_FREQS) += wma_freqs.o
|
||||
@@ -195,13 +193,11 @@ OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o
|
||||
OBJS-$(CONFIG_AAC_DECODER) += aactab.o \
|
||||
aacsbr.o aacps_common.o aacps_float.o \
|
||||
kbdwin.o \
|
||||
sbrdsp.o aacpsdsp_float.o cbrt_data.o \
|
||||
$(if $(!CONFIG_HARDCODED_TABLES), cbrt_tablegen_common.o)
|
||||
sbrdsp.o aacpsdsp_float.o cbrt_data.o
|
||||
OBJS-$(CONFIG_AAC_FIXED_DECODER) += aactab.o \
|
||||
aacsbr_fixed.o aacps_common.o aacps_fixed.o \
|
||||
kbdwin.o \
|
||||
sbrdsp_fixed.o aacpsdsp_fixed.o cbrt_data_fixed.o \
|
||||
$(if $(!CONFIG_HARDCODED_TABLES), cbrt_tablegen_common.o)
|
||||
sbrdsp_fixed.o aacpsdsp_fixed.o cbrt_data_fixed.o
|
||||
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacenctab.o \
|
||||
aacpsy.o aactab.o \
|
||||
aacenc_is.o \
|
||||
@@ -221,7 +217,6 @@ OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o
|
||||
OBJS-$(CONFIG_AC3_MF_ENCODER) += mfenc.o mf_utils.o
|
||||
OBJS-$(CONFIG_ACELP_KELVIN_DECODER) += g729dec.o lsp.o celp_filters.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o
|
||||
OBJS-$(CONFIG_AGM_DECODER) += agm.o jpegquanttables.o
|
||||
OBJS-$(CONFIG_AHX_DECODER) += mpegaudiodec_float.o
|
||||
OBJS-$(CONFIG_AIC_DECODER) += aic.o
|
||||
OBJS-$(CONFIG_ALAC_DECODER) += alac.o alac_data.o alacdsp.o
|
||||
OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o alac_data.o
|
||||
@@ -274,7 +269,6 @@ OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
|
||||
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
|
||||
OBJS-$(CONFIG_AV1_DECODER) += av1dec.o av1_parse.o
|
||||
OBJS-$(CONFIG_AV1_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_AV1_D3D12VA_ENCODER) += d3d12va_encode_av1.o av1_levels.o
|
||||
OBJS-$(CONFIG_AV1_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_AV1_MEDIACODEC_ENCODER) += mediacodecenc.o
|
||||
OBJS-$(CONFIG_AV1_NVENC_ENCODER) += nvenc_av1.o nvenc.o
|
||||
@@ -433,8 +427,6 @@ OBJS-$(CONFIG_H264_DECODER) += h264dec.o h264_cabac.o h264_cavlc.o \
|
||||
OBJS-$(CONFIG_H264_AMF_ENCODER) += amfenc_h264.o
|
||||
OBJS-$(CONFIG_H264_AMF_DECODER) += amfdec.o
|
||||
OBJS-$(CONFIG_H264_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_H264_D3D12VA_ENCODER) += d3d12va_encode_h264.o h264_levels.o \
|
||||
h2645data.o hw_base_encode_h264.o
|
||||
OBJS-$(CONFIG_H264_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_H264_MEDIACODEC_ENCODER) += mediacodecenc.o
|
||||
OBJS-$(CONFIG_H264_MF_ENCODER) += mfenc.o mf_utils.o
|
||||
@@ -446,7 +438,6 @@ OBJS-$(CONFIG_H264_OMX_ENCODER) += omx.o
|
||||
OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_H264_QSV_ENCODER) += qsvenc_h264.o
|
||||
OBJS-$(CONFIG_H264_RKMPP_DECODER) += rkmppdec.o
|
||||
OBJS-$(CONFIG_H264_RKMPP_ENCODER) += rkmppenc.o
|
||||
OBJS-$(CONFIG_H264_VAAPI_ENCODER) += vaapi_encode_h264.o h264_levels.o \
|
||||
h2645data.o hw_base_encode_h264.o
|
||||
OBJS-$(CONFIG_H264_VULKAN_ENCODER) += vulkan_encode.o vulkan_encode_h264.o \
|
||||
@@ -476,7 +467,6 @@ OBJS-$(CONFIG_HEVC_OH_ENCODER) += ohcodec.o ohenc.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_HEVC_QSV_ENCODER) += qsvenc_hevc.o hevc/ps_enc.o
|
||||
OBJS-$(CONFIG_HEVC_RKMPP_DECODER) += rkmppdec.o
|
||||
OBJS-$(CONFIG_HEVC_RKMPP_ENCODER) += rkmppenc.o
|
||||
OBJS-$(CONFIG_HEVC_VAAPI_ENCODER) += vaapi_encode_h265.o h265_profile_level.o \
|
||||
h2645data.o hw_base_encode_h265.o
|
||||
OBJS-$(CONFIG_HEVC_VULKAN_ENCODER) += vulkan_encode.o vulkan_encode_h265.o \
|
||||
@@ -569,20 +559,19 @@ OBJS-$(CONFIG_MPC7_DECODER) += mpc7.o mpc.o
|
||||
OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG1_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_MPEG1_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
OBJS-$(CONFIG_MPEG2_MMAL_DECODER) += mmaldec.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_DECODER) += qsvdec.o
|
||||
OBJS-$(CONFIG_MPEG2_QSV_ENCODER) += qsvenc_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_MPEG2_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_ENCODER) += vaapi_encode_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_V4L2M2M_DECODER) += v4l2_m2m_dec.o
|
||||
OBJS-$(CONFIG_MPEG4_DECODER) += mpeg4videodec.o mpeg4videodsp.o \
|
||||
xvididct.o
|
||||
OBJS-$(CONFIG_MPEG4_DECODER) += mpeg4videodsp.o xvididct.o
|
||||
OBJS-$(CONFIG_MPEG4_ENCODER) += mpeg4videoenc.o
|
||||
OBJS-$(CONFIG_MPEG4_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
@@ -647,8 +636,7 @@ OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o
|
||||
OBJS-$(CONFIG_PRORES_DECODER) += proresdec.o proresdsp.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_AW_ENCODER) += proresenc_anatoliy.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o proresenc_kostya_common.o
|
||||
OBJS-$(CONFIG_PRORES_KS_VULKAN_ENCODER) += proresenc_kostya_vulkan.o proresdata.o proresenc_kostya_common.o
|
||||
OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_RAW_DECODER) += prores_raw.o proresdsp.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_VIDEOTOOLBOX_ENCODER) += videotoolboxenc.o
|
||||
OBJS-$(CONFIG_PROSUMER_DECODER) += prosumer.o
|
||||
@@ -807,8 +795,7 @@ OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbisdsp.o vorbis.o \
|
||||
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_VP3_DECODER) += vp3.o jpegquanttables.o
|
||||
OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o \
|
||||
vp5dsp.o vpx_rac.o
|
||||
OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vpx_rac.o
|
||||
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o \
|
||||
vp6dsp.o vpx_rac.o
|
||||
OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp8data.o vpx_rac.o
|
||||
@@ -856,8 +843,8 @@ OBJS-$(CONFIG_WMAV2_ENCODER) += wmaenc.o wma.o wma_common.o aactab.o
|
||||
OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
|
||||
celp_filters.o \
|
||||
acelp_vectors.o acelp_filters.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2data.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2data.o
|
||||
OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2data.o
|
||||
OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2data.o
|
||||
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
|
||||
OBJS-$(CONFIG_WRAPPED_AVFRAME_DECODER) += wrapped_avframe.o
|
||||
OBJS-$(CONFIG_WRAPPED_AVFRAME_ENCODER) += wrapped_avframe.o
|
||||
@@ -966,7 +953,6 @@ OBJS-$(CONFIG_ADPCM_AGM_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_AICA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_ARGO_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_ARGO_ENCODER) += adpcm.o adpcm_data.o adpcmenc.o
|
||||
OBJS-$(CONFIG_ADPCM_CIRCUS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_DTK_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o
|
||||
@@ -995,14 +981,9 @@ OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_ESCAPE_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_HVQM2_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_HVQM4_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_MAGIX_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_MOFLEX_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_MTF_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_PDA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_OKI_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
@@ -1018,9 +999,7 @@ OBJS-$(CONFIG_ADPCM_IMA_XBOX_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_MS_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_MS_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_MTAF_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_N64_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_PSX_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_PSXC_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_SANYO_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER) += adpcm.o adpcm_data.o
|
||||
@@ -1029,7 +1008,7 @@ OBJS-$(CONFIG_ADPCM_SWF_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_SWF_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_THP_LE_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_VIMA_DECODER) += vima.o adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_VIMA_DECODER) += vima.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_XMD_DECODER) += adpcm.o adpcm_data.o
|
||||
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o
|
||||
@@ -1054,7 +1033,6 @@ OBJS-$(CONFIG_AV1_VAAPI_HWACCEL) += vaapi_av1.o
|
||||
OBJS-$(CONFIG_AV1_VDPAU_HWACCEL) += vdpau_av1.o
|
||||
OBJS-$(CONFIG_AV1_VIDEOTOOLBOX_HWACCEL) += videotoolbox_av1.o
|
||||
OBJS-$(CONFIG_AV1_VULKAN_HWACCEL) += vulkan_decode.o vulkan_av1.o
|
||||
OBJS-$(CONFIG_DPX_VULKAN_HWACCEL) += vulkan_decode.o vulkan_dpx.o
|
||||
OBJS-$(CONFIG_FFV1_VULKAN_HWACCEL) += vulkan_decode.o ffv1_vulkan.o vulkan_ffv1.o
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_H263_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||
@@ -1112,7 +1090,6 @@ OBJS-$(CONFIG_VP9_VULKAN_HWACCEL) += vulkan_decode.o vulkan_vp9.o
|
||||
OBJS-$(CONFIG_VP8_QSV_HWACCEL) += qsvdec.o
|
||||
OBJS-$(CONFIG_VVC_VAAPI_HWACCEL) += vaapi_vvc.o
|
||||
OBJS-$(CONFIG_PRORES_RAW_VULKAN_HWACCEL) += vulkan_decode.o vulkan_prores_raw.o
|
||||
OBJS-$(CONFIG_PRORES_VULKAN_HWACCEL) += vulkan_decode.o vulkan_prores.o
|
||||
|
||||
# Objects duplicated from other libraries for shared builds
|
||||
SHLIBOBJS += log2_tab.o reverse.o
|
||||
@@ -1190,7 +1167,6 @@ OBJS-$(CONFIG_LIBKVAZAAR_ENCODER) += libkvazaar.o
|
||||
OBJS-$(CONFIG_LIBLC3_ENCODER) += liblc3enc.o
|
||||
OBJS-$(CONFIG_LIBLC3_DECODER) += liblc3dec.o
|
||||
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o
|
||||
OBJS-$(CONFIG_LIBMPEGHDEC_DECODER) += libmpeghdec.o
|
||||
OBJS-$(CONFIG_LIBOAPV_ENCODER) += liboapvenc.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
|
||||
@@ -1208,8 +1184,6 @@ OBJS-$(CONFIG_LIBSHINE_ENCODER) += libshine.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
||||
OBJS-$(CONFIG_LIBSVTAV1_ENCODER) += libsvtav1.o
|
||||
OBJS-$(CONFIG_LIBSVTJPEGXS_DECODER) += libsvtjpegxsdec.o
|
||||
OBJS-$(CONFIG_LIBSVTJPEGXS_ENCODER) += libsvtjpegxsenc.o
|
||||
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
||||
OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
|
||||
OBJS-$(CONFIG_LIBUAVS3D_DECODER) += libuavs3d.o
|
||||
@@ -1240,7 +1214,6 @@ OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o
|
||||
OBJS-$(CONFIG_AC3_PARSER) += aac_ac3_parser.o ac3tab.o \
|
||||
ac3_channel_layout_tab.o
|
||||
OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o
|
||||
OBJS-$(CONFIG_AHX_PARSER) += ahx_parser.o
|
||||
OBJS-$(CONFIG_AMR_PARSER) += amr_parser.o
|
||||
OBJS-$(CONFIG_APV_PARSER) += apv_parser.o
|
||||
OBJS-$(CONFIG_AV1_PARSER) += av1_parser.o av1_parse.o
|
||||
@@ -1276,22 +1249,20 @@ OBJS-$(CONFIG_HDR_PARSER) += hdr_parser.o
|
||||
OBJS-$(CONFIG_IPU_PARSER) += ipu_parser.o
|
||||
OBJS-$(CONFIG_JPEG2000_PARSER) += jpeg2000_parser.o
|
||||
OBJS-$(CONFIG_JPEGXL_PARSER) += jpegxl_parser.o jpegxl_parse.o
|
||||
OBJS-$(CONFIG_JPEGXS_PARSER) += jpegxs_parser.o
|
||||
OBJS-$(CONFIG_LCEVC_PARSER) += lcevc_parser.o
|
||||
OBJS-$(CONFIG_MISC4_PARSER) += misc4_parser.o
|
||||
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
|
||||
OBJS-$(CONFIG_MLP_PARSER) += mlp_parse.o mlp_parser.o mlp.o
|
||||
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
|
||||
mpeg4videodec.o mpeg4video.o \
|
||||
ituh263dec.o h263data.o
|
||||
ituh263dec.o h263dec.o h263data.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
|
||||
mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_OPUS_PARSER) += vorbis_data.o
|
||||
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
|
||||
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
|
||||
OBJS-$(CONFIG_PRORES_RAW_PARSER) += prores_raw_parser.o
|
||||
OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o
|
||||
OBJS-$(CONFIG_PRORES_PARSER) += prores_parser.o
|
||||
OBJS-$(CONFIG_RV34_PARSER) += rv34_parser.o
|
||||
OBJS-$(CONFIG_SBC_PARSER) += sbc_parser.o
|
||||
OBJS-$(CONFIG_SIPR_PARSER) += sipr_parser.o
|
||||
@@ -1323,6 +1294,10 @@ OBJS-$(HAVE_THREADS) += pthread.o pthread_slice.o pthread_fram
|
||||
|
||||
OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o
|
||||
|
||||
# vulkan libs
|
||||
OBJS-$(CONFIG_LIBGLSLANG) += vulkan_glslang.o
|
||||
OBJS-$(CONFIG_LIBSHADERC) += vulkan_shaderc.o
|
||||
|
||||
# Windows resource file
|
||||
SHLIBOBJS-$(HAVE_GNU_WINDRES) += avcodecres.o
|
||||
|
||||
@@ -1357,7 +1332,7 @@ SKIPHEADERS-$(CONFIG_QSVENC) += qsvenc.h
|
||||
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_decode.h vaapi_hevc.h vaapi_encode.h
|
||||
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VULKAN) += ffv1_vulkan.h prores_vulkan.h vulkan_video.h \
|
||||
SKIPHEADERS-$(CONFIG_VULKAN) += ffv1_vulkan.h vulkan_video.h \
|
||||
vulkan_encode.h vulkan_decode.h
|
||||
SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h
|
||||
SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h
|
||||
|
||||
@@ -36,10 +36,6 @@
|
||||
#define TNS_MAX_ORDER 20
|
||||
#define MAX_LTP_LONG_SFB 40
|
||||
|
||||
#define MPS_MAX_PARAM_SETS 9
|
||||
#define MPS_MAX_PARAM_BANDS 28
|
||||
#define MPS_MAX_TIME_SLOTS 16 /* 64 in non-AAC MPEG Surround */
|
||||
|
||||
enum RawDataBlockType {
|
||||
TYPE_SCE,
|
||||
TYPE_CPE,
|
||||
|
||||
@@ -3,7 +3,6 @@ clean::
|
||||
|
||||
OBJS-$(CONFIG_AAC_DECODER) += aac/aacdec.o aac/aacdec_tab.o \
|
||||
aac/aacdec_float.o aac/aacdec_usac.o \
|
||||
aac/aacdec_ac.o aac/aacdec_lpd.o \
|
||||
aac/aacdec_usac_mps212.o
|
||||
aac/aacdec_ac.o aac/aacdec_lpd.o
|
||||
OBJS-$(CONFIG_AAC_FIXED_DECODER) += aac/aacdec.o aac/aacdec_tab.o \
|
||||
aac/aacdec_fixed.o
|
||||
|
||||
@@ -2383,6 +2383,12 @@ static int decode_frame_ga(AVCodecContext *avctx, AACDecContext *ac,
|
||||
ac->oc[1].status = OC_LOCKED;
|
||||
}
|
||||
|
||||
if (samples && avctx->sample_rate <= 0) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Cannot output a frame without a valid sample rate\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (!ac->frame->data[0] && samples) {
|
||||
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "libavcodec/mpeg4audio.h"
|
||||
|
||||
#include "aacdec_ac.h"
|
||||
#include "aacdec_usac_mps212.h"
|
||||
|
||||
typedef struct AACDecContext AACDecContext;
|
||||
|
||||
@@ -230,33 +229,6 @@ typedef struct SingleChannelElement {
|
||||
};
|
||||
} SingleChannelElement;
|
||||
|
||||
typedef struct AACUsacMPSData {
|
||||
/* Framing */
|
||||
int framing_type;
|
||||
int nb_param_sets;
|
||||
int param_sets[MPS_MAX_PARAM_SETS];
|
||||
|
||||
/* OTT */
|
||||
AACMPSLosslessData ott[MPS_ELE_NB];
|
||||
int ott_idx[MPS_ELE_NB][MPS_MAX_PARAM_SETS][MPS_MAX_PARAM_BANDS];
|
||||
bool opd_smoothing_mode;
|
||||
|
||||
/* SMG */
|
||||
int smooth_mode[MPS_MAX_PARAM_SETS];
|
||||
int smooth_time[MPS_MAX_PARAM_SETS];
|
||||
int freq_res_stride_smg[MPS_MAX_PARAM_SETS];
|
||||
bool smg_data[MPS_MAX_PARAM_SETS][MPS_MAX_PARAM_BANDS];
|
||||
|
||||
/* TSD */
|
||||
bool tsd_enable;
|
||||
bool temp_shape_enable;
|
||||
bool temp_shape_enable_ch[2];
|
||||
int16_t temp_shape_data[MPS_MAX_TIME_SLOTS];
|
||||
|
||||
int tsd_num_tr_slots;
|
||||
int tsd_phase_data[64];
|
||||
} AACUsacMPSData;
|
||||
|
||||
typedef struct AACUsacStereo {
|
||||
uint8_t common_window;
|
||||
uint8_t common_tw;
|
||||
@@ -272,8 +244,6 @@ typedef struct AACUsacStereo {
|
||||
|
||||
uint8_t pred_used[128];
|
||||
|
||||
AACUsacMPSData mps;
|
||||
|
||||
INTFLOAT_ALIGNED_UNION(32, alpha_q_re, 1024);
|
||||
INTFLOAT_ALIGNED_UNION(32, alpha_q_im, 1024);
|
||||
INTFLOAT_ALIGNED_UNION(32, prev_alpha_q_re, 1024);
|
||||
@@ -362,7 +332,6 @@ typedef struct AACUsacElemConfig {
|
||||
uint8_t high_rate_mode : 1; /* bsHighRateMode */
|
||||
uint8_t phase_coding : 1; /* bsPhaseCoding */
|
||||
|
||||
uint8_t otts_bands_phase_present; /* bsOttBandsPhasePresent */
|
||||
uint8_t otts_bands_phase; /* bsOttBandsPhase */
|
||||
uint8_t residual_coding; /* bsResidualCoding */
|
||||
uint8_t residual_bands; /* bsResidualBands */
|
||||
|
||||
+14
-491
@@ -258,499 +258,17 @@ static const int8_t sbr_vlc_offsets[10] = {
|
||||
-60, -60, -24, -24, -31, -31, -12, -12, -31, -12
|
||||
};
|
||||
|
||||
|
||||
const VLCElem *ff_aac_sbr_vlc[10];
|
||||
|
||||
static av_cold void init_sbr_tables(void)
|
||||
static av_cold void aacdec_common_init(void)
|
||||
{
|
||||
static VLCElem vlc_buf[(1098 + 1092 + 768 + 1026 + 1058 +
|
||||
static VLCElem vlc_buf[(304 + 270 + 550 + 300 + 328 +
|
||||
294 + 306 + 268 + 510 + 366 + 462) +
|
||||
(1098 + 1092 + 768 + 1026 + 1058 +
|
||||
1052 + 544 + 544 + 592 + 512)];
|
||||
VLCInitState state = VLC_INIT_STATE(vlc_buf);
|
||||
const uint8_t (*tab)[2] = sbr_huffman_tab;
|
||||
|
||||
// SBR VLC table initialization
|
||||
for (int i = 0; i < FF_ARRAY_ELEMS(ff_aac_sbr_vlc); i++) {
|
||||
ff_aac_sbr_vlc[i] =
|
||||
ff_vlc_init_tables_from_lengths(&state, 9, sbr_huffman_nb_codes[i],
|
||||
&tab[0][1], 2,
|
||||
&tab[0][0], 2, 1,
|
||||
sbr_vlc_offsets[i], 0);
|
||||
tab += sbr_huffman_nb_codes[i];
|
||||
}
|
||||
}
|
||||
|
||||
const int16_t ff_aac_hcod_firstband_CLD[30][2] = {
|
||||
{ 2, 1 }, { 4, 3 }, { 6, 5 }, { 8, 7 }, { 10, 9 },
|
||||
{ 12, 11 }, { 14, 13 }, { -8, 15 }, { -9, 16 }, { -10, 17 },
|
||||
{ -18, 18 }, { -17, -19 }, { -16, 19 }, { -11, -20 }, { -15, -21 },
|
||||
{ -7, 20 }, { -22, 21 }, { -12, -14 }, { -13, -23 }, { 23, 22 },
|
||||
{ -24, -31 }, { -6, 24 }, { -25, -26 }, { 26, 25 }, { -5, -27 },
|
||||
{ -28, 27 }, { -4, 28 }, { -29, 29 }, { -1, -30 }, { -2, -3 },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod1D_CLD[2 /* DT/DF */][30][2] = {
|
||||
{ { -1, 1 }, { -2, 2 }, { -3, 3 }, { -4, 4 }, { -5, 5 },
|
||||
{ -6, 6 }, { -7, 7 }, { 9, 8 }, { -8, 10 }, { -9, 11 },
|
||||
{ -10, 12 }, { -11, 13 }, { -12, 14 }, { -13, 15 }, { -14, 16 },
|
||||
{ -15, 17 }, { -16, 18 }, { -17, 19 }, { -18, 20 }, { -19, -20 },
|
||||
{ -21, 21 }, { -22, 22 }, { -23, 23 }, { 25, 24 }, { -24, 26 },
|
||||
{ -25, 27 }, { 29, 28 }, { -26, -31 }, { -29, -30 }, { -27, -28 }, },
|
||||
{ { -1, 1 }, { -2, 2 }, { -3, 3 }, { -4, 4 }, { -5, 5 },
|
||||
{ -6, 6 }, { -7, 7 }, { -8, 8 }, { -9, 9 }, { -10, 10 },
|
||||
{ -11, 11 }, { -12, 12 }, { -13, 13 }, { 15, 14 }, { -14, 16 },
|
||||
{ -15, 17 }, { -16, 18 }, { -17, 19 }, { -18, 20 }, { -19, 21 },
|
||||
{ -20, -21 }, { -23, 22 }, { -22, 23 }, { -24, 24 }, { -25, 25 },
|
||||
{ 27, 26 }, { 29, 28 }, { -30, -31 }, { -28, -29 }, { -26, -27 }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_CLD_03[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][15][2] = {
|
||||
{ { { -1, 1 }, { -52, 2 }, { 4, 3 }, { -2, 5 }, { -17, 6 },
|
||||
{ -18, 7 }, { -36, -51 }, { 9, 8 }, { -35, 10 }, { -34, 11 },
|
||||
{ -19, -33 }, { -3, 12 }, { -20, 13 }, { -50, 14 }, { -4, -49 }, },
|
||||
{ { -1, 1 }, { -52, 2 }, { -17, 3 }, { 5, 4 }, { -36, 6 },
|
||||
{ -33, 7 }, { -2, -18 }, { -20, 8 }, { 10, 9 }, { -34, -49 },
|
||||
{ -51, 11 }, { -35, 12 }, { -19, 13 }, { -3, 14 }, { -4, -50 }, }, },
|
||||
{ { { -1, 1 }, { -52, 2 }, { -17, 3 }, { 5, 4 }, { -2, -36 },
|
||||
{ -18, 6 }, { 8, 7 }, { -51, 9 }, { -33, 10 }, { -34, 11 },
|
||||
{ -20, -35 }, { -19, 12 }, { -3, 13 }, { -49, 14 }, { -4, -50 }, },
|
||||
{ { 2, 1 }, { -1, -52 }, { 4, 3 }, { -2, 5 }, { -51, 6 },
|
||||
{ -17, -18 }, { 8, 7 }, { 10, 9 }, { -3, -36 }, { -19, 11 },
|
||||
{ -35, -50 }, { -34, 12 }, { -4, 13 }, { -33, 14 }, { -20, -49 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_CLD_05[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][35][2] = {
|
||||
{ { { 2, 1 }, { -86, 3 }, { 5, 4 }, { -1, 6 }, { 8, 7 },
|
||||
{ -17, -18 }, { -2, 9 }, { -70, 10 }, { -85, 11 }, { 13, 12 },
|
||||
{ -69, 14 }, { -34, 15 }, { 17, 16 }, { -19, 18 }, { -33, -35 },
|
||||
{ -54, 19 }, { -53, 20 }, { -3, 21 }, { -68, 22 }, { -84, 23 },
|
||||
{ -50, 24 }, { -52, 25 }, { -51, 26 }, { -20, -36 }, { -49, 27 },
|
||||
{ -38, 28 }, { -37, 29 }, { -4, -83 }, { -67, 30 }, { -66, 31 },
|
||||
{ -21, 32 }, { -22, -65 }, { -5, 33 }, { -82, 34 }, { -6, -81 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { -86, 5 }, { -1, 6 }, { -17, 7 },
|
||||
{ -70, 8 }, { 10, 9 }, { -18, 11 }, { -33, 12 }, { -54, 13 },
|
||||
{ -2, 14 }, { -34, 15 }, { -38, 16 }, { -49, 17 }, { -85, 18 },
|
||||
{ -50, 19 }, { -69, 20 }, { -53, -65 }, { -22, 21 }, { -66, 22 },
|
||||
{ -19, 23 }, { -37, 24 }, { -35, -81 }, { -3, 25 }, { -51, 26 },
|
||||
{ -68, -84 }, { -52, 27 }, { 29, 28 }, { -20, 30 }, { -4, -36 },
|
||||
{ -83, 31 }, { -67, 32 }, { -21, 33 }, { -5, 34 }, { -6, -82 }, }, },
|
||||
{ { { 2, 1 }, { -86, 3 }, { -1, 4 }, { -17, 5 }, { 7, 6 },
|
||||
{ -70, 8 }, { -2, -18 }, { 10, 9 }, { 12, 11 }, { -85, 13 },
|
||||
{ -33, 14 }, { -34, -54 }, { 16, 15 }, { -69, 17 }, { 19, 18 },
|
||||
{ -50, -53 }, { -19, 20 }, { -38, 21 }, { -35, -49 }, { -3, 22 },
|
||||
{ 24, 23 }, { -68, 25 }, { -84, 26 }, { -65, 27 }, { -51, -66 },
|
||||
{ -22, -37 }, { -52, 28 }, { -20, 29 }, { -36, 30 }, { -81, 31 },
|
||||
{ -4, -83 }, { -67, 32 }, { -21, 33 }, { -5, 34 }, { -6, -82 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { -86, 5 }, { 7, 6 }, { 9, 8 },
|
||||
{ -1, -2 }, { -85, 10 }, { -18, 11 }, { -17, 12 }, { 14, 13 },
|
||||
{ -70, 15 }, { 17, 16 }, { -19, -69 }, { -84, 18 }, { -3, 19 },
|
||||
{ 21, 20 }, { -34, -68 }, { -20, 22 }, { -35, 23 }, { -83, 24 },
|
||||
{ -33, 25 }, { -4, 26 }, { -53, 27 }, { -54, -67 }, { -36, 28 },
|
||||
{ -21, -52 }, { -82, 29 }, { -5, -50 }, { -51, 30 }, { -38, 31 },
|
||||
{ -37, -49 }, { -6, 32 }, { -66, 33 }, { -65, 34 }, { -22, -81 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_CLD_07[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][63][2] = {
|
||||
{ { { 2, 1 }, { 4, 3 }, {-120, 5 }, { 7, 6 }, { 9, 8 },
|
||||
{ -1, 10 }, { -18, 11 }, { -17, 12 }, { -2,-104 }, {-119, 13 },
|
||||
{ 15, 14 }, {-103, 16 }, { 18, 17 }, { -34, 19 }, { -19, 20 },
|
||||
{ 22, 21 }, { -35, 23 }, { -33, 24 }, { -88, 25 }, { -87, 26 },
|
||||
{ 28, 27 }, { -3,-102 }, { -86, 29 }, { -52,-118 }, { 31, 30 },
|
||||
{ -50, 32 }, { -51, 33 }, { -70, 34 }, { -36, 35 }, { -85, 36 },
|
||||
{ -20, 37 }, { 39, 38 }, { -69, -71 }, { -72, 40 }, { -49, -67 },
|
||||
{ 42, 41 }, { -68, 43 }, { -4,-101 }, { -53,-117 }, { -37, 44 },
|
||||
{ -66, 45 }, { -55, 46 }, { 48, 47 }, { -54, 49 }, { -21, 50 },
|
||||
{ -84,-100 }, { -56, -65 }, { 52, 51 }, { -82, -83 }, { 54, 53 },
|
||||
{ -5,-116 }, { -22, 55 }, { -38, 56 }, { -39, -40 }, { 58, 57 },
|
||||
{ -81,-115 }, { -98, -99 }, { -6, 59 }, { -23, 60 }, { -24, 61 },
|
||||
{ -7, -97 }, {-114, 62 }, { -8,-113 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { 6, 5 }, {-120, 7 }, { -17, 8 },
|
||||
{ -1,-104 }, { 10, 9 }, { 12, 11 }, { -18, 13 }, { -33, -88 },
|
||||
{ 15, 14 }, { 17, 16 }, { -2, 18 }, { -34, 19 }, { -72, 20 },
|
||||
{ -49, 21 }, {-119, 22 }, { -50, 23 }, {-103, 24 }, { -56, 25 },
|
||||
{ -65, 26 }, { 28, 27 }, { -40, -87 }, { -66, 29 }, { -82, 30 },
|
||||
{ 32, 31 }, { -19, -81 }, { -71, 33 }, { -97, 34 }, { -35, -55 },
|
||||
{ -24, 35 }, { 37, 36 }, { -3, -98 }, { -51, 38 }, { -67, 39 },
|
||||
{ -39,-118 }, {-113, 40 }, {-102, 41 }, { -86, 42 }, { -70, -83 },
|
||||
{ 44, 43 }, { -20, -54 }, { -52, 45 }, { -36, 46 }, { -4, 47 },
|
||||
{ -68, 48 }, { -85, 49 }, {-101,-117 }, { -69, 50 }, { 52, 51 },
|
||||
{ -21, -37 }, { -53, 53 }, { 55, 54 }, { -5,-100 }, {-116, 56 },
|
||||
{ -84, 57 }, { -38, 58 }, { -22, -99 }, {-115, 59 }, { -6, 60 },
|
||||
{ -23, 61 }, { -7, 62 }, {-114, 0 }, }, },
|
||||
{ { { 2, 1 }, {-120, 3 }, { -1, 4 }, { 6, 5 }, { -17, 7 },
|
||||
{-104, 8 }, { -18, 9 }, { -2, 10 }, { 12, 11 }, { 14, 13 },
|
||||
{-119, 15 }, { -33, 16 }, { -34, -88 }, {-103, 17 }, { 19, 18 },
|
||||
{ 21, 20 }, { 23, 22 }, { 25, 24 }, { -19, -72 }, { -50, 26 },
|
||||
{ -49, 27 }, { -87, 28 }, { 30, 29 }, { 32, 31 }, { -3, -35 },
|
||||
{ 34, 33 }, { -56, 35 }, { -65, -66 }, { -40, 36 }, { -82,-118 },
|
||||
{ -71, 37 }, { -55, 38 }, { -67,-102 }, { -51, 39 }, { -70, 40 },
|
||||
{ 42, 41 }, { -81, 43 }, { -86, 44 }, { -52, -97 }, { -98, 45 },
|
||||
{ -24, -39 }, { -20, 46 }, { -54, -83 }, { -36, 47 }, { -85, 48 },
|
||||
{ -68, 49 }, { -4, 50 }, { -69,-113 }, {-117, 51 }, { -37,-101 },
|
||||
{ -53, 52 }, { -21, 53 }, { 55, 54 }, { -84,-100 }, { -5, 56 },
|
||||
{-116, 57 }, { -22, 58 }, { -38,-115 }, { 60, 59 }, { -6, -99 },
|
||||
{ -23, 61 }, {-114, 62 }, { -7, -8 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, {-120, 5 }, { 7, 6 }, { 9, 8 },
|
||||
{ 11, 10 }, { -1, 12 }, { -18,-119 }, { -2, 13 }, { 15, 14 },
|
||||
{ -17, 16 }, {-104, 17 }, { 19, 18 }, { -19, 20 }, {-103, 21 },
|
||||
{-118, 22 }, { 24, 23 }, { -3, 25 }, { 27, 26 }, { -34, 28 },
|
||||
{-102, 29 }, { -20, 30 }, { -35, 31 }, { 33, 32 }, {-117, 34 },
|
||||
{ -33, 35 }, { -88, 36 }, { -4, 37 }, { -87, 38 }, { 40, 39 },
|
||||
{ -36,-101 }, { -86, 41 }, { -21, -37 }, { -85,-100 }, { -52, 42 },
|
||||
{ -22, 43 }, {-116, 44 }, { -50 , 45 }, { 47, 46 }, { -5, -51 },
|
||||
{-115, 48 }, { -70, 49 }, { -84, 50 }, { -38, -49 }, { -72, -99 },
|
||||
{ -53, 51 }, { -69, -71 }, { -23, 52 }, { -6, -67 }, {-114, 53 },
|
||||
{ -7, 54 }, { -66, -68 }, { -55, 55 }, { 57, 56 }, { -54, -65 },
|
||||
{ -8, -56 }, { -82, -83 }, { 59, 58 }, { -39, -40 }, { -81, 60 },
|
||||
{ -98, 61 }, { -97, 62 }, { -24,-113 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_CLD_09[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][99][2] = {
|
||||
{ { { 2, 1 }, { 4, 3 }, {-154, 5 }, { 7, 6 }, { 9, 8 },
|
||||
{ 11, 10 }, { -1, 12 }, { -18, 13 }, { -17, 14 }, { -2,-138 },
|
||||
{ 16, 15 }, {-153, 17 }, {-137, 18 }, { 20, 19 }, { 22, 21 },
|
||||
{ -34, 23 }, { -19, 24 }, { -35, 25 }, { 27, 26 }, { 29, 28 },
|
||||
{-121, 30 }, {-120, 31 }, {-136, 32 }, { -33,-122 }, { 34, 33 },
|
||||
{-152, 35 }, { -3, 36 }, { -51, 37 }, { -52, 38 }, { -69, 39 },
|
||||
{ -36, 40 }, { -50, 41 }, { 43, 42 }, { -20, 44 }, {-104, 45 },
|
||||
{-103, 46 }, { -87, 47 }, {-119, 48 }, {-105, 49 }, { -86, 50 },
|
||||
{-102, 51 }, {-106, 52 }, { -49,-135 }, { -68, 53 }, { 55, 54 },
|
||||
{ -53, 56 }, { -67,-151 }, { -4, 57 }, { -84, 58 }, { -85, 59 },
|
||||
{ -66, 60 }, { -37, 61 }, { -70, 62 }, { -54, -88 }, { -21, 63 },
|
||||
{ 65, 64 }, { -89, 66 }, {-118, 67 }, { -72, 68 }, { -90, 69 },
|
||||
{ -71, 70 }, { -65,-134 }, {-150, 71 }, { -83, 72 }, { -5, 73 },
|
||||
{-101,-117 }, { -82, 74 }, { 76, 75 }, { -99, 77 }, { -38, 78 },
|
||||
{-100, 79 }, { -22, 80 }, { -73, 81 }, { -39, -74 }, { 83, 82 },
|
||||
{ -55, -81 }, { -57, 84 }, {-133,-149 }, { -56, 85 }, { -6, 86 },
|
||||
{ -98, 87 }, {-132, 88 }, { -23, 89 }, {-114, 90 }, {-116, 91 },
|
||||
{ -58,-115 }, { -24, 92 }, { -97,-148 }, { -40, -41 }, { -7, -42 },
|
||||
{-147, 93 }, { 95, 94 }, {-131, 96 }, { -8,-130 }, { -25,-113 },
|
||||
{ -9, 97 }, { -26,-129 }, {-146, 98 }, { -10,-145 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { 6, 5 }, {-154, 7 }, { 9, 8 },
|
||||
{ -17, 10 }, {-138, 11 }, { -1, 12 }, { 14, 13 }, { 16, 15 },
|
||||
{ -33,-122 }, { -18, 17 }, { 19, 18 }, { -34, 20 }, { -2, 21 },
|
||||
{-106, 22 }, { -49, 23 }, { 25, 24 }, { -50, 26 }, {-153, 27 },
|
||||
{ -90, 28 }, {-137, 29 }, { -65, 30 }, { 32, 31 }, { -66, 33 },
|
||||
{-121, 34 }, { -74, 35 }, { -81, 36 }, { 38, 37 }, { -42, 39 },
|
||||
{ -82, 40 }, {-105, 41 }, { -19,-114 }, { -58, 42 }, { -35, 43 },
|
||||
{ -97, 44 }, { 46, 45 }, {-129, 47 }, { -26, -89 }, { -57, -98 },
|
||||
{ -51, 48 }, { -3, 49 }, {-113, 50 }, {-130, 51 }, {-152, 52 },
|
||||
{ -67, -73 }, { -99,-136 }, {-145, 53 }, {-120, 54 }, { -41, 55 },
|
||||
{ -83, 56 }, { -72, 57 }, {-104, 58 }, {-115, 59 }, { -20, 60 },
|
||||
{ 62, 61 }, { -36, -88 }, { -84, 63 }, { -52, -56 }, { 65, 64 },
|
||||
{ -4, -87 }, { -68, 66 }, {-151, 67 }, {-100,-135 }, { 69, 68 },
|
||||
{ -69,-119 }, {-103, 70 }, { -71, 71 }, { 73, 72 }, { -21, 74 },
|
||||
{ -85, 75 }, { -37, -53 }, { -86, 76 }, { 78, 77 }, {-102,-150 },
|
||||
{ -5, 79 }, {-134, 80 }, {-118, 81 }, { -54,-117 }, { 83, 82 },
|
||||
{ -38, -70 }, { -22, 84 }, { -6, 85 }, { 87, 86 }, { -55, 88 },
|
||||
{-101, 89 }, {-133,-149 }, { -24, -39 }, { 91, 90 }, {-132, 92 },
|
||||
{ -23, 93 }, { -7, 94 }, {-147,-148 }, {-116,-131 }, { -25, 95 },
|
||||
{ -40, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
{ { { 2, 1 }, {-154, 3 }, { 5, 4 }, { -1, 6 }, { 8, 7 },
|
||||
{ -17, 9 }, {-138, 10 }, { -18, 11 }, { -2, 12 }, { 14, 13 },
|
||||
{ 16, 15 }, {-153, 17 }, { -34, 18 }, { -33,-122 }, { 20, 19 },
|
||||
{ 22, 21 }, {-137, 23 }, { 25, 24 }, { 27, 26 }, {-106, 28 },
|
||||
{ 30, 29 }, { -50, 31 }, { -19, 32 }, { -49,-121 }, { 34, 33 },
|
||||
{ 36, 35 }, { -35, 37 }, { -90, 38 }, { -66, 39 }, { -3, 40 },
|
||||
{ 42, 41 }, { -65, 43 }, {-105, 44 }, { 46, 45 }, { -74, 47 },
|
||||
{ -51, 48 }, { -82,-152 }, {-136, 49 }, { -81, 50 }, { -42, -89 },
|
||||
{-114, 51 }, { 53, 52 }, { -57, -58 }, {-120, 54 }, { -98, 55 },
|
||||
{ -67, 56 }, { -97, 57 }, { 59, 58 }, { -99, 60 }, { -73,-104 },
|
||||
{ -72, 61 }, {-113, 62 }, { -20, -83 }, { -84,-130 }, { -36, 63 },
|
||||
{ -26, 64 }, { -41, 65 }, { -52,-129 }, { -87, -88 }, { 67, 66 },
|
||||
{-115, 68 }, { -68, 69 }, { -56, -69 }, { -4,-100 }, {-151, 70 },
|
||||
{-135, 71 }, {-103,-119 }, { 73, 72 }, { -71,-145 }, {-102, 74 },
|
||||
{ 76, 75 }, { -53, -85 }, { -37, 77 }, { -21, -86 }, { 79, 78 },
|
||||
{ -5, 80 }, { -54,-134 }, {-150, 81 }, {-118, 82 }, { -70, 83 },
|
||||
{-117, 84 }, { -22, -38 }, {-101, 85 }, { -55, 86 }, {-149, 87 },
|
||||
{ -39, 88 }, {-133, 89 }, { -6, 90 }, {-116, 91 }, { -24, 92 },
|
||||
{ -7,-132 }, { -23, 93 }, { -40, 94 }, {-131,-148 }, { -25, 95 },
|
||||
{-147, 96 }, {-146, 97 }, { -8, 0 }, { 0, 0 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { 6, 5 }, {-154, 7 }, { 9, 8 },
|
||||
{ 11, 10 }, { 13, 12 }, { 15, 14 }, { -18, 16 }, {-153, 17 },
|
||||
{ -1, -2 }, { 19, 18 }, {-138, 20 }, { -17, 21 }, { 23, 22 },
|
||||
{ 25, 24 }, { -19,-137 }, { 27, 26 }, {-152, 28 }, { 30, 29 },
|
||||
{ -3, -34 }, { 32, 31 }, { 34, 33 }, { 36, 35 }, {-136, 37 },
|
||||
{ -35, 38 }, { -20, 39 }, {-122, 40 }, {-151, 41 }, { -33, 42 },
|
||||
{-121, 43 }, { 45, 44 }, { 47, 46 }, { -4, 48 }, { -36,-120 },
|
||||
{-135, 49 }, { 51, 50 }, { -21, 52 }, { 54, 53 }, { 56, 55 },
|
||||
{ -50,-150 }, { 58, 57 }, { -51, 59 }, { 61, 60 }, {-119, 62 },
|
||||
{ -52, 63 }, { -5, 64 }, { -37, 65 }, {-117,-134 }, { -39, -54 },
|
||||
{ -22, 66 }, {-106, 67 }, { -69,-102 }, {-132, 68 }, {-105, 69 },
|
||||
{ -49, 70 }, {-149, 71 }, { -24,-104 }, { 73, 72 }, { -53, 74 },
|
||||
{ -38,-118 }, {-103, 75 }, { -6, 76 }, { -66, -87 }, {-133,-147 },
|
||||
{ -23, 77 }, { -67, 78 }, { -68, -86 }, { -70,-101 }, { -40,-148 },
|
||||
{-116, 79 }, { -55, 80 }, { -84,-131 }, { 82, 81 }, { -89, -90 },
|
||||
{ -7, -25 }, { -85, -88 }, { -65, 83 }, { -72,-146 }, { 85, 84 },
|
||||
{ -9, -71 }, { -83, 86 }, { -82, 87 }, { -8, 88 }, {-100, 89 },
|
||||
{ -74, -99 }, { -73, 90 }, { -10, -81 }, { -56, 91 }, { -57, -98 },
|
||||
{ 93, 92 }, { -58,-114 }, { -97,-115 }, { 95, 94 }, { -41, 96 },
|
||||
{ -42, 97 }, { -26,-129 }, {-113, 98 }, {-130,-145 }, },
|
||||
},
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod_firstband_ICC[7][2] = {
|
||||
{ 2, 1 }, { -5, 3 }, { -4, -6 }, { -3, 4 }, { -2, 5 },
|
||||
{ -1, 6 }, { -7, -8 },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod1D_ICC[7][2] = {
|
||||
{ -1, 1 }, { -2, 2 }, { -3, 3 }, { -4, 4 }, { -5, 5 },
|
||||
{ -6, 6 }, { -7, -8 },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_ICC_01[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][3][2] = {
|
||||
{ { { -1, 1 }, { -18, 2 }, { -2, -17 }, },
|
||||
{ { -1, 1 }, { -18, 2 }, { -2, -17 }, }, },
|
||||
{ { { -1, 1 }, { -18, 2 }, { -2, -17 }, },
|
||||
{ { -1, 1 }, { -18, 2 }, { -2, -17 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_ICC_03[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][15][2] = {
|
||||
{ { { -52, 1 }, { -1, 2 }, { 4, 3 }, { -2, 5 }, { -17, -18 },
|
||||
{ -51, 6 }, { -36, 7 }, { 9, 8 }, { -35, 10 }, { -3, 11 },
|
||||
{ -19, -34 }, { -33, 12 }, { -50, 13 }, { -20, 14 }, { -4, -49 }, },
|
||||
{ { 2, 1 }, { -1, -52 }, { -17, 3 }, { 5, 4 }, { -36, 6 },
|
||||
{ -2, 7 }, { -18, -33 }, { 9, 8 }, { -20, 10 }, { -34, -51 },
|
||||
{ -49, 11 }, { -35, 12 }, { -19, 13 }, { -3, 14 }, { -4, -50 }, }, },
|
||||
{ { { -52, 1 }, { -1, 2 }, { 4, 3 }, { -2, -17 }, { -18, 5 },
|
||||
{ -36, 6 }, { -51, 7 }, { 9, 8 }, { -33, 10 }, { -34, 11 },
|
||||
{ -35, 12 }, { -19, -20 }, { -3, 13 }, { -49, 14 }, { -4, -50 }, },
|
||||
{ { 2, 1 }, { -1, -52 }, { -2, 3 }, { 5, 4 }, { -51, 6 },
|
||||
{ -18, 7 }, { -17, 8 }, { -3, 9 }, { -36, 10 }, { -19, -50 },
|
||||
{ -35, 11 }, { -4, 12 }, { -34, 13 }, { -33, 14 }, { -20, -49 }, },},
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_ICC_05[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][35][2] = {
|
||||
{ { { 2, 1 }, { -86, 3 }, { -1, 4 }, { 6, 5 }, { -18, 7 },
|
||||
{ -2, -17 }, { 9, 8 }, { -70, 10 }, { -69, -85 }, { -35, 11 },
|
||||
{ 13, 12 }, { -34, 14 }, { -19, 15 }, { -53, 16 }, { -68, 17 },
|
||||
{ -33, 18 }, { -3, -52 }, { 20, 19 }, { -54, 21 }, { -84, 22 },
|
||||
{ -50, 23 }, { -20, -51 }, { -36, 24 }, { 26, 25 }, { -83, 27 },
|
||||
{ -4, -38 }, { -49, 28 }, { -37, 29 }, { -67, 30 }, { -5, 31 },
|
||||
{ -21, 32 }, { -65, -66 }, { -82, 33 }, { -22, 34 }, { -6, -81 }, },
|
||||
{ { 2, 1 }, { -86, 3 }, { -1, 4 }, { -17, 5 }, { 7, 6 },
|
||||
{ -70, 8 }, { -33, 9 }, { -18, 10 }, { -2, 11 }, { -54, 12 },
|
||||
{ -49, 13 }, { -38, 14 }, { -34, -65 }, { -85, 15 }, { -50, 16 },
|
||||
{ -69, 17 }, { -22, 18 }, { -53, 19 }, { 21, 20 }, { -19, -81 },
|
||||
{ -66, 22 }, { -3, -35 }, { 24, 23 }, { -37, 25 }, { -68, -84 },
|
||||
{ -51, 26 }, { 28, 27 }, { -20, -52 }, { 30, 29 }, { -4, -36 },
|
||||
{ -83, 31 }, { -67, 32 }, { -82, 33 }, { -21, 34 }, { -5, -6 }, }, },
|
||||
{ { { -1, 1 }, { -86, 2 }, { 4, 3 }, { -17, 5 }, { -2, 6 },
|
||||
{ -18, 7 }, { -70, 8 }, { -85, 9 }, { 11, 10 }, { 13, 12 },
|
||||
{ -33, 14 }, { 16, 15 }, { -34, -54 }, { -69, 17 }, { -38, 18 },
|
||||
{ -50, 19 }, { -35, -53 }, { -49, 20 }, { -19, 21 }, { -3, 22 },
|
||||
{ -65, 23 }, { -68, 24 }, { -22, 25 }, { -81, -84 }, { -66, 26 },
|
||||
{ -37, 27 }, { -20, -51 }, { 29, 28 }, { -52, 30 }, { -4, -83 },
|
||||
{ -36, 31 }, { -67, 32 }, { -5, 33 }, { -82, 34 }, { -21, 0 }, },
|
||||
{ { 2, 1 }, { -86, 3 }, { -1, 4 }, { 6, 5 }, { -2, 7 },
|
||||
{ -85, 8 }, { -18, 9 }, { 11, 10 }, { -17, 12 }, { 14, 13 },
|
||||
{ -70, 15 }, { -3, -19 }, { -69, 16 }, { -84, 17 }, { -68, 18 },
|
||||
{ -20, -35 }, { -34, -83 }, { 20, 19 }, { -4, 21 }, { -33, 22 },
|
||||
{ -5, 23 }, { -53, 24 }, { -36, -52 }, { -67, 25 }, { -21, -82 },
|
||||
{ -54, 26 }, { -6, 27 }, { -51, 28 }, { -50, 29 }, { -49, 30 },
|
||||
{ -37, 31 }, { -38, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_ICC_07[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][63][2] = {
|
||||
{ { { 2, 1 }, { -1,-120 }, { 4, 3 }, { 6, 5 }, { -18, 7 },
|
||||
{ 9, 8 }, { -17, 10 }, { -2, 11 }, {-103, 12 }, { -52, 13 },
|
||||
{ -35,-104 }, {-119, 14 }, { 16, 15 }, { -69, -86 }, { 18, 17 },
|
||||
{ -34, 19 }, { -19, 20 }, { 22, 21 }, { -70, 23 }, { -87, 24 },
|
||||
{-102, 25 }, { -85, 26 }, { -33, 27 }, { -36, 28 }, { -3, 29 },
|
||||
{ -88, 30 }, { -51, 31 }, {-118, 32 }, { 34, 33 }, { -68, 35 },
|
||||
{ -53, 36 }, { -67, 37 }, { -20, 38 }, {-101, 39 }, { -50, 40 },
|
||||
{ 42, 41 }, { -37, 43 }, {-116, 44 }, {-117, 45 }, { -49, 46 },
|
||||
{ -21,-100 }, { 48, 47 }, { -55, -71 }, { -4, 49 }, { -22, -84 },
|
||||
{-115, 50 }, { -66, -82 }, { -72, 51 }, { -5, -6 }, { -54, 52 },
|
||||
{ -38, 53 }, { -83, 54 }, { -40, 55 }, { -39, 56 }, { -99, 57 },
|
||||
{ -23, -56 }, { -7, 58 }, { -65, -97 }, { -8, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { -1,-120 }, { 6, 5 }, { 8, 7 },
|
||||
{ -18, 9 }, { -2, 10 }, { 12, 11 }, { 14, 13 }, { -17,-119 },
|
||||
{ 16, 15 }, {-103, 17 }, {-104, 18 }, { -52, 19 }, { 21, 20 },
|
||||
{ -69, 22 }, { 24, 23 }, { -3, -35 }, { -19, 25 }, { -34, -85 },
|
||||
{ 27, 26 }, { -86, 28 }, {-118, 29 }, { -37, 30 }, { 32, 31 },
|
||||
{-102, 33 }, { -20, -22 }, { -4,-117 }, { -87, 34 }, {-100, 35 },
|
||||
{ -33, -36 }, { 37, 36 }, { -70, -88 }, {-101, 38 }, { -5, 39 },
|
||||
{ -51, -53 }, { -50, 40 }, {-115, 41 }, { -21, 42 }, {-116, 43 },
|
||||
{ -38, 44 }, { -23, -84 }, { -49, -99 }, { 46, 45 }, { -6,-114 },
|
||||
{ -7, -72 }, { -71, 47 }, { -8, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
{ { { -1, 1 }, {-120, 2 }, { 4, 3 }, { -17, 5 }, { -2, 6 },
|
||||
{ 8, 7 }, { -18, 9 }, {-104, 10 }, { 12, 11 }, { 14, 13 },
|
||||
{ 16, 15 }, {-119, 17 }, { -81, 18 }, { 20, 19 }, { -33, 21 },
|
||||
{ -88, 22 }, {-103, 23 }, { -34, 24 }, { -56, 25 }, { -72, 26 },
|
||||
{ -49, 27 }, { -82, 28 }, { -50, 29 }, { -65, 30 }, { -55, -87 },
|
||||
{ -19, 31 }, { -67, 32 }, { -35, -40 }, { 34, 33 }, { -52, -71 },
|
||||
{ -66, 35 }, { -70, 36 }, { 38, 37 }, { -51, -97 }, { -86,-102 },
|
||||
{ -3, 39 }, {-118, 40 }, { 42, 41 }, { -24, -85 }, { -54, 43 },
|
||||
{ -39, 44 }, { -98,-113 }, { -36, -37 }, { -20, -69 }, { -4, 45 },
|
||||
{ -5, 46 }, { -21, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { -1,-120 }, { 6, 5 }, { 8, 7 },
|
||||
{ -18, 9 }, { -2, 10 }, { 12, 11 }, { 14, 13 }, { -17,-119 },
|
||||
{ 16, 15 }, {-103, 17 }, {-104, 18 }, { -52, 19 }, { 21, 20 },
|
||||
{ -69, 22 }, { 24, 23 }, { -3, -35 }, { -19, 25 }, { -34, -85 },
|
||||
{ 27, 26 }, { -86, 28 }, {-118, 29 }, { -37, 30 }, { 32, 31 },
|
||||
{-102, 33 }, { -20, -22 }, { -4,-117 }, { -87, 34 }, {-100, 35 },
|
||||
{ -33, -36 }, { 37, 36 }, { -70, -88 }, {-101, 38 }, { -5, 39 },
|
||||
{ -51, -53 }, { -50, 40 }, {-115, 41 }, { -21, 42 }, {-116, 43 },
|
||||
{ -38, 44 }, { -23, -84 }, { -49, -99 }, { 46, 45 }, { -6,-114 },
|
||||
{ -7, -72 }, { -71, 47 }, { -8, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod_firstband_IPD[7][2] = {
|
||||
{ -1, 1 }, { -8, 2 }, { -2, 3 }, { 5, 4 }, { -7, 6 },
|
||||
{ -3, -5 }, { -4, -6 },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod1D_IPD[2 /* DT, DF */ ][7][2] = {
|
||||
{ { -1, 1 }, { -2, 2 }, { -8, 3 }, { -3, 4 }, { -7, 5 },
|
||||
{ -4, 6 }, { -5, -6 }, }, /* DT */
|
||||
{ { -1, 1 }, { -8, 2 }, { -2, 3 }, { 5, 4 }, { -3, -7 },
|
||||
{ -6, 6 }, { -4, -5 }, }, /* DF */
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_IPD_01[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][3][2] = {
|
||||
{ { { -1, 1 }, { -18, 2 }, { -17, 0 }, },
|
||||
{ { -1, 1 }, { -18, 2 }, { -17, 0 }, }, },
|
||||
{ { { -1, 1 }, { -18, 2 }, { -17, 0 }, },
|
||||
{ { -1, 1 }, { -18, 2 }, { -17, 0 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_IPD_03[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][15][2] = {
|
||||
{ { { -1, 1 }, { 3, 2 }, { -18, 4 }, { -52, 5 }, { -34, -36 },
|
||||
{ -35, 6 }, { -17, 7 }, { -33, 8 }, { -20, 9 }, { -49, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, },
|
||||
{ { -1, 1 }, { -36, 2 }, { -18, 3 }, { -35, 4 }, { -52, 5 },
|
||||
{ 7, 6 }, { -34, 8 }, { -33, -49 }, { -20, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
{ { { -1, 1 }, { 3, 2 }, { -18, 4 }, { -52, 5 }, { -34, -36 },
|
||||
{ -35, 6 }, { -17, 7 }, { -33, 8 }, { -20, 9 }, { -49, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, },
|
||||
{ { -1, 1 }, { -36, 2 }, { -18, 3 }, { -35, 4 }, { -52, 5 },
|
||||
{ 7, 6 }, { -34, 8 }, { -33, -49 }, { -20, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_IPD_05[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][35][2] = {
|
||||
{ { { -1, 1 }, { 3, 2 }, { -52, 4 }, { -86, 5 }, { -35, 6 },
|
||||
{ -53, 7 }, { -70, 8 }, { -17, 9 }, { -37, 10 }, { 12, 11 },
|
||||
{ -38, -66 }, { -18, 13 }, { -51, 14 }, { 16, 15 }, { -34, -69 },
|
||||
{ 18, 17 }, { -54, -65 }, { -50, 19 }, { -33, -49 }, { -22, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, },
|
||||
{ { -1, 1 }, { 3, 2 }, { 5, 4 }, { -86, 6 }, { -66, 7 },
|
||||
{ 9, 8 }, { 11, 10 }, { -18, 12 }, { -51, 13 }, { -37, -52 },
|
||||
{ -69, 14 }, { -38, 15 }, { -53, 16 }, { -35, 17 }, { -50, -70 },
|
||||
{ -22, -49 }, { -33, 18 }, { -17, 19 }, { -34, -65 }, { -81, 20 },
|
||||
{ -54, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
{ { { -1, 1 }, { 3, 2 }, { -52, 4 }, { -86, 5 }, { -35, 6 },
|
||||
{ -53, 7 }, { -70, 8 }, { -17, 9 }, { -37, 10 }, { 12, 11 },
|
||||
{ -38, -66 }, { -18, 13 }, { -51, 14 }, { 16, 15 }, { -34, -69 },
|
||||
{ 18, 17 }, { -54, -65 }, { -50, 19 }, { -33, -49 }, { -22, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, },
|
||||
{ { -1, 1 }, { 3, 2 }, { 5, 4 }, { -86, 6 }, { -66, 7 },
|
||||
{ 9, 8 }, { 11, 10 }, { -18, 12 }, { -51, 13 }, { -37, -52 },
|
||||
{ -69, 14 }, { -38, 15 }, { -53, 16 }, { -35, 17 }, { -50, -70 },
|
||||
{ -22, -49 }, { -33, 18 }, { -17, 19 }, { -34, -65 }, { -81, 20 },
|
||||
{ -54, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_IPD_07[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][63][2] = {
|
||||
{ { { -1, 1 }, { -69, 2 }, { 4, 3 }, {-120, 5 }, { 7, 6 },
|
||||
{-113, 8 }, { -68, 9 }, { 11, 10 }, { -17, 12 }, { -52, 13 },
|
||||
{ -24, 14 }, { -18, 15 }, { 17, 16 }, {-104, 18 }, { 20, 19 },
|
||||
{ -54, -70 }, { 22, 21 }, { 24, 23 }, { -86, -97 }, {-103, 25 },
|
||||
{ -83, 26 }, { -35, 27 }, { -34, -98 }, { -40, 28 }, { -39, -67 },
|
||||
{ 30, 29 }, { -33, -51 }, { -87, 31 }, { -88, 32 }, { -82, 33 },
|
||||
{ -55, -81 }, { -56, -71 }, { -72, 34 }, { -50, -66 }, { -65, 35 },
|
||||
{ -49, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { -1, 5 }, { -69, 6 }, {-120, 7 },
|
||||
{ -68, 8 }, { 10, 9 }, { 12, 11 }, { 14, 13 }, { -52, -54 },
|
||||
{ -18, 15 }, { -70, 16 }, { -67, 17 }, { 19, 18 }, { -17, 20 },
|
||||
{-113, 21 }, { 23, 22 }, { -83, 24 }, { -24, 25 }, {-103,-104 },
|
||||
{ -51, -55 }, { 27, 26 }, { -71, 28 }, { -86, 29 }, { -35, 30 },
|
||||
{ -66, 31 }, { -39, -50 }, { -82, -98 }, { -72, 32 }, { -56, -87 },
|
||||
{ -34, 33 }, { -33, -88 }, { -40, -97 }, { -65, 34 }, { -49, 35 },
|
||||
{ -81, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
{ { { -1, 1 }, { -69, 2 }, { 4, 3 }, {-120, 5 }, { 7, 6 },
|
||||
{-113, 8 }, { -68, 9 }, { 11, 10 }, { -17, 12 }, { -52, 13 },
|
||||
{ -24, 14 }, { -18, 15 }, { 17, 16 }, {-104, 18 }, { 20, 19 },
|
||||
{ -54, -70 }, { 22, 21 }, { 24, 23 }, { -86, -97 }, {-103, 25 },
|
||||
{ -83, 26 }, { -35, 27 }, { -34, -98 }, { -40, 28 }, { -39, -67 },
|
||||
{ 30, 29 }, { -33, -51 }, { -87, 31 }, { -88, 32 }, { -82, 33 },
|
||||
{ -55, -81 }, { -56, -71 }, { -72, 34 }, { -50, -66 }, { -65, 35 },
|
||||
{ -49, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, },
|
||||
{ { 2, 1 }, { 4, 3 }, { -1, 5 }, { -69, 6 }, {-120, 7 },
|
||||
{ -68, 8 }, { 10, 9 }, { 12, 11 }, { 14, 13 }, { -52, -54 },
|
||||
{ -18, 15 }, { -70, 16 }, { -67, 17 }, { 19, 18 }, { -17, 20 },
|
||||
{-113, 21 }, { 23, 22 }, { -83, 24 }, { -24, 25 }, {-103,-104 },
|
||||
{ -51, -55 }, { 27, 26 }, { -71, 28 }, { -86, 29 }, { -35, 30 },
|
||||
{ -66, 31 }, { -39, -50 }, { -82, -98 }, { -72, 32 }, { -56, -87 },
|
||||
{ -34, 33 }, { -33, -88 }, { -40, -97 }, { -65, 34 }, { -49, 35 },
|
||||
{ -81, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod_lav_idx[3][2] = {
|
||||
{ -1, 1 }, { -2, 2 }, { -3, -4 },
|
||||
};
|
||||
|
||||
const int16_t ff_aac_hcod2D_reshape[39][2] = {
|
||||
{ 2, 1 }, { 4, 3 }, { 6, 5 }, { -33, 7 }, { -17, 8 },
|
||||
{ -49, 9 }, { -34, 10 }, { 12, 11 }, { -18, -35 }, { -50, 13 },
|
||||
{ 15, 14 }, { -40, 16 }, { -36, 17 }, { -19, 18 }, { -1, -37 },
|
||||
{ -51, 19 }, { 21, 20 }, { -38, -65 }, { -2, -39 }, { -20, 22 },
|
||||
{ -52, 23 }, { 25, 24 }, { -21, 26 }, { -66, 27 }, { -53, 28 },
|
||||
{ -3, 29 }, { 31, 30 }, { -22, 32 }, { -54, 33 }, { -4, 34 },
|
||||
{ -56, 35 }, { -24, -67 }, { -23, -55 }, { -8, -72 }, { -5, 36 },
|
||||
{ -68, 37 }, { -6, 38 }, { -7, -69 }, { -70, -71 },
|
||||
};
|
||||
|
||||
const uint8_t ff_aac_lav_tab_XXX[3][4] = {
|
||||
{ 3, 5, 7, 9 }, { 1, 3, 5, 7 }, { 7, 1, 3, 5 }
|
||||
};
|
||||
|
||||
static av_cold void init_base_tables(void)
|
||||
{
|
||||
static VLCElem vlc_buf[(304 + 270 + 550 + 300 + 328 +
|
||||
294 + 306 + 268 + 510 + 366 + 462)];
|
||||
VLCInitState state = VLC_INIT_STATE(vlc_buf);
|
||||
|
||||
for (unsigned i = 0; i < 11; i++) {
|
||||
#define TAB_WRAP_SIZE(name) name[i], sizeof(name[i][0]), sizeof(name[i][0])
|
||||
ff_vlc_spectral[i] =
|
||||
@@ -769,12 +287,17 @@ static av_cold void init_base_tables(void)
|
||||
ff_aac_scalefactor_code,
|
||||
sizeof(ff_aac_scalefactor_code[0]),
|
||||
sizeof(ff_aac_scalefactor_code[0]), 0);
|
||||
}
|
||||
|
||||
static av_cold void aacdec_common_init(void)
|
||||
{
|
||||
init_base_tables();
|
||||
init_sbr_tables();
|
||||
// SBR VLC table initialization
|
||||
for (int i = 0; i < FF_ARRAY_ELEMS(ff_aac_sbr_vlc); i++) {
|
||||
ff_aac_sbr_vlc[i] =
|
||||
ff_vlc_init_tables_from_lengths(&state, 9, sbr_huffman_nb_codes[i],
|
||||
&tab[0][1], 2,
|
||||
&tab[0][0], 2, 1,
|
||||
sbr_vlc_offsets[i], 0);
|
||||
tab += sbr_huffman_nb_codes[i];
|
||||
}
|
||||
|
||||
ff_ps_init_common();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,33 +50,6 @@ extern const uint8_t ff_aac_channel_layout_map[16][16][3];
|
||||
extern const int16_t ff_aac_channel_map[3][4][6];
|
||||
|
||||
extern const AVChannelLayout ff_aac_ch_layout[];
|
||||
|
||||
extern const int16_t ff_aac_hcod_firstband_CLD[30][2];
|
||||
extern const int16_t ff_aac_hcod1D_CLD[2 /* DT_/DF_ */][30][2];
|
||||
extern const int16_t ff_aac_hcod2D_CLD_03[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][15][2];
|
||||
extern const int16_t ff_aac_hcod2D_CLD_05[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][35][2];
|
||||
extern const int16_t ff_aac_hcod2D_CLD_07[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][63][2];
|
||||
extern const int16_t ff_aac_hcod2D_CLD_09[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][99][2];
|
||||
|
||||
extern const int16_t ff_aac_hcod_firstband_ICC[7][2];
|
||||
extern const int16_t ff_aac_hcod1D_ICC[7][2];
|
||||
extern const int16_t ff_aac_hcod2D_ICC_01[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][3][2];
|
||||
extern const int16_t ff_aac_hcod2D_ICC_03[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][15][2];
|
||||
extern const int16_t ff_aac_hcod2D_ICC_05[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][35][2];
|
||||
extern const int16_t ff_aac_hcod2D_ICC_07[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][63][2];
|
||||
|
||||
extern const int16_t ff_aac_hcod_firstband_IPD[7][2];
|
||||
extern const int16_t ff_aac_hcod1D_IPD[2 /* DF, DT */ ][7][2];
|
||||
extern const int16_t ff_aac_hcod2D_IPD_01[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][3][2];
|
||||
extern const int16_t ff_aac_hcod2D_IPD_03[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][15][2];
|
||||
extern const int16_t ff_aac_hcod2D_IPD_05[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][35][2];
|
||||
extern const int16_t ff_aac_hcod2D_IPD_07[2 /* _TP/_FP */ ][2 /* DT_/DF_ */ ][63][2];
|
||||
|
||||
extern const int16_t ff_aac_hcod_lav_idx[3][2];
|
||||
|
||||
extern const int16_t ff_aac_hcod2D_reshape[39][2];
|
||||
|
||||
extern const uint8_t ff_aac_lav_tab_XXX[3][4];
|
||||
FF_VISIBILITY_POP_HIDDEN
|
||||
|
||||
#endif /* AVCODEC_AAC_AACDEC_TAB_H */
|
||||
|
||||
+26
-172
@@ -31,8 +31,6 @@
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/refstruct.h"
|
||||
|
||||
#include "aacdec_usac_mps212.h"
|
||||
|
||||
/* Number of scalefactor bands per complex prediction band, equal to 2. */
|
||||
#define SFB_PER_PRED_BAND 2
|
||||
|
||||
@@ -215,19 +213,31 @@ static int decode_usac_element_pair(AACDecContext *ac,
|
||||
|
||||
if (e->stereo_config_index) {
|
||||
e->mps.freq_res = get_bits(gb, 3); /* bsFreqRes */
|
||||
if (!e->mps.freq_res)
|
||||
return AVERROR_INVALIDDATA; /* value 0 is reserved */
|
||||
int numBands = ((int[]){0,28,20,14,10,7,5,4})[e->mps.freq_res]; // ISO/IEC 23003-1:2007, 5.2, Table 39
|
||||
|
||||
e->mps.fixed_gain = get_bits(gb, 3); /* bsFixedGainDMX */
|
||||
e->mps.temp_shape_config = get_bits(gb, 2); /* bsTempShapeConfig */
|
||||
e->mps.decorr_config = get_bits(gb, 2); /* bsDecorrConfig */
|
||||
e->mps.high_rate_mode = get_bits1(gb); /* bsHighRateMode */
|
||||
e->mps.phase_coding = get_bits1(gb); /* bsPhaseCoding */
|
||||
|
||||
e->mps.otts_bands_phase_present = get_bits1(gb);
|
||||
if (e->mps.otts_bands_phase_present) /* bsOttBandsPhasePresent */
|
||||
e->mps.otts_bands_phase = get_bits(gb, 5); /* bsOttBandsPhase */
|
||||
int otts_bands_phase = ((int[]){0,10,10,7,5,3,2,2})[e->mps.freq_res]; // Table 109 — Default value of bsOttBandsPhase
|
||||
if (get_bits1(gb)) { /* bsOttBandsPhasePresent */
|
||||
otts_bands_phase = get_bits(gb, 5); /* bsOttBandsPhase */
|
||||
if (otts_bands_phase > numBands)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
e->mps.otts_bands_phase = otts_bands_phase;
|
||||
|
||||
e->mps.residual_coding = e->stereo_config_index >= 2; /* bsResidualCoding */
|
||||
if (e->mps.residual_coding) {
|
||||
e->mps.residual_bands = get_bits(gb, 5); /* bsResidualBands */
|
||||
int residual_bands = get_bits(gb, 5); /* bsResidualBands */
|
||||
if (residual_bands > numBands)
|
||||
return AVERROR_INVALIDDATA;
|
||||
e->mps.residual_bands = residual_bands;
|
||||
|
||||
e->mps.otts_bands_phase = FFMAX(e->mps.otts_bands_phase,
|
||||
e->mps.residual_bands);
|
||||
e->mps.pseudo_lr = get_bits1(gb); /* bsPseudoLr */
|
||||
@@ -363,6 +373,8 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx,
|
||||
freq_idx = get_bits(gb, 5); /* usacSamplingFrequencyIndex */
|
||||
if (freq_idx == 0x1f) {
|
||||
samplerate = get_bits(gb, 24); /* usacSamplingFrequency */
|
||||
if (samplerate == 0)
|
||||
return AVERROR(EINVAL);
|
||||
} else {
|
||||
samplerate = ff_aac_usac_samplerate[freq_idx];
|
||||
if (samplerate < 0)
|
||||
@@ -1293,7 +1305,8 @@ static void spectrum_decode(AACDecContext *ac, AACUSACConfig *usac,
|
||||
SingleChannelElement *sce = &cpe->ch[ch];
|
||||
AACUsacElemData *ue = &sce->ue;
|
||||
|
||||
spectrum_scale(ac, sce, ue);
|
||||
if (!ue->core_mode)
|
||||
spectrum_scale(ac, sce, ue);
|
||||
}
|
||||
|
||||
if (nb_channels > 1 && us->common_window) {
|
||||
@@ -1343,169 +1356,12 @@ static void spectrum_decode(AACDecContext *ac, AACUSACConfig *usac,
|
||||
if (sce->tns.present && ((nb_channels == 1) || (us->tns_on_lr)))
|
||||
ac->dsp.apply_tns(sce->coeffs, &sce->tns, &sce->ics, 1);
|
||||
|
||||
ac->oc[1].m4ac.frame_length_short ? ac->dsp.imdct_and_windowing_768(ac, sce) :
|
||||
ac->dsp.imdct_and_windowing(ac, sce);
|
||||
if (!sce->ue.core_mode)
|
||||
ac->oc[1].m4ac.frame_length_short ? ac->dsp.imdct_and_windowing_768(ac, sce) :
|
||||
ac->dsp.imdct_and_windowing(ac, sce);
|
||||
}
|
||||
}
|
||||
|
||||
static const uint8_t mps_fr_nb_bands[8] = {
|
||||
255 /* Reserved */, 28, 20, 14, 10, 7, 5, 4,
|
||||
};
|
||||
|
||||
static const uint8_t mps_fr_stride_smg[4] = {
|
||||
1, 2, 5, 28,
|
||||
};
|
||||
|
||||
static void decode_tsd(GetBitContext *gb, int *data,
|
||||
int nb_tr_slots, int nb_slots)
|
||||
{
|
||||
int nb_bits = av_log2(nb_slots / (nb_tr_slots + 1));
|
||||
int s = get_bits(gb, nb_bits);
|
||||
for (int k = 0; k < nb_slots; k++)
|
||||
data[k]=0;
|
||||
|
||||
int p = nb_tr_slots + 1;
|
||||
for (int k = nb_slots - 1; k >= 0; k--) {
|
||||
if (p > k) {
|
||||
for (; k >= 0; k--)
|
||||
data[k] = 1;
|
||||
break;
|
||||
}
|
||||
int64_t c = k - p + 1;
|
||||
for (int h = 2; h <= p; h++) {
|
||||
c *= k - p + h;
|
||||
c /= h;
|
||||
}
|
||||
if (s >= (int)c) { /* c is long long for up to 32 slots */
|
||||
s -= c;
|
||||
data[k] = 1;
|
||||
p--;
|
||||
if (!p)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int parse_mps212(AACDecContext *ac, AACUSACConfig *usac,
|
||||
AACUsacMPSData *mps, AACUsacElemConfig *ec,
|
||||
GetBitContext *gb, int frame_indep_flag)
|
||||
{
|
||||
int err;
|
||||
int nb_bands = mps_fr_nb_bands[ec->mps.freq_res];
|
||||
|
||||
/* Framing info */
|
||||
mps->framing_type = 0;
|
||||
mps->nb_param_sets = 2;
|
||||
if (ec->mps.high_rate_mode) {
|
||||
mps->framing_type = get_bits1(gb);
|
||||
mps->nb_param_sets = get_bits(gb, 3) + 1;
|
||||
}
|
||||
int param_slot_bits = usac->core_sbr_frame_len_idx == 4 ? 6 : 5;
|
||||
int nb_time_slots = usac->core_sbr_frame_len_idx == 4 ? 64 : 32;
|
||||
|
||||
if (mps->framing_type)
|
||||
for (int i = 0; i < mps->nb_param_sets; i++)
|
||||
mps->param_sets[i] = get_bits(gb, param_slot_bits);
|
||||
|
||||
int indep = frame_indep_flag;
|
||||
if (!frame_indep_flag)
|
||||
indep = get_bits1(gb);
|
||||
|
||||
int extend_frame = mps->param_sets[mps->nb_param_sets - 1] !=
|
||||
(nb_time_slots - 1);
|
||||
|
||||
/* CLD */
|
||||
err = ff_aac_ec_data_dec(gb, &mps->ott[MPS_CLD], MPS_CLD,
|
||||
0, 0, nb_bands,
|
||||
indep, indep, mps->nb_param_sets);
|
||||
if (err < 0) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Error parsing OTT CLD data!\n");
|
||||
return err;
|
||||
}
|
||||
ff_aac_map_index_data(&mps->ott[MPS_CLD], MPS_CLD, mps->ott_idx[MPS_CLD],
|
||||
0, 0, nb_bands, mps->nb_param_sets,
|
||||
mps->param_sets, extend_frame);
|
||||
|
||||
/* ICC */
|
||||
err = ff_aac_ec_data_dec(gb, &mps->ott[MPS_ICC], MPS_ICC, 0, 0, nb_bands,
|
||||
indep, indep, mps->nb_param_sets);
|
||||
if (err < 0) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Error parsing OTT ICC data!\n");
|
||||
return err;
|
||||
}
|
||||
ff_aac_map_index_data(&mps->ott[MPS_ICC], MPS_ICC, mps->ott_idx[MPS_ICC],
|
||||
0, 0, nb_bands, mps->nb_param_sets,
|
||||
mps->param_sets, extend_frame);
|
||||
|
||||
/* IPD */
|
||||
if (ec->mps.phase_coding) {
|
||||
if (get_bits1(gb)) {
|
||||
mps->opd_smoothing_mode = get_bits1(gb);
|
||||
err = ff_aac_ec_data_dec(gb, &mps->ott[MPS_IPD], MPS_IPD, 0, 0,
|
||||
ec->mps.otts_bands_phase,
|
||||
indep, indep, mps->nb_param_sets);
|
||||
ff_aac_map_index_data(&mps->ott[MPS_IPD], MPS_IPD, mps->ott_idx[MPS_IPD],
|
||||
0, 0, nb_bands, mps->nb_param_sets,
|
||||
mps->param_sets, extend_frame);
|
||||
if (err < 0) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Error parsing OTT IPD data!\n");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* SMG data */
|
||||
memset(mps->smooth_mode, 0, sizeof(mps->smooth_mode));
|
||||
if (ec->mps.high_rate_mode) {
|
||||
for (int i = 0; i < mps->nb_param_sets; i++) {
|
||||
mps->smooth_mode[i] = get_bits(gb, 2);
|
||||
if (mps->smooth_mode[i] >= 2)
|
||||
mps->smooth_time[i] = get_bits(gb, 2);
|
||||
if (mps->smooth_mode[i] >= 3) {
|
||||
mps->freq_res_stride_smg[i] = get_bits(gb, 2);
|
||||
int nb_data_bands = (nb_bands - 1);
|
||||
nb_data_bands /= (mps_fr_stride_smg[mps->freq_res_stride_smg[i]] + 1);
|
||||
for (int j = 0; j < nb_data_bands; j++)
|
||||
mps->smg_data[i][j] = get_bits1(gb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Temp shape data */
|
||||
mps->tsd_enable = 0;
|
||||
if (ec->mps.temp_shape_config == 3) {
|
||||
mps->tsd_enable = get_bits1(gb);
|
||||
} else if (ec->mps.temp_shape_config) {
|
||||
mps->temp_shape_enable = get_bits1(gb);
|
||||
if (mps->temp_shape_enable) {
|
||||
for (int i = 0; i < 2; i++)
|
||||
mps->temp_shape_enable_ch[i] = get_bits1(gb);
|
||||
if (ec->mps.temp_shape_config == 2) {
|
||||
err = ff_aac_huff_dec_reshape(gb, mps->temp_shape_data, 16);
|
||||
if (err < 0) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Error parsing TSD reshape data!\n");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TSD data */
|
||||
if (mps->tsd_enable) {
|
||||
mps->tsd_num_tr_slots = get_bits(gb, param_slot_bits - 1);
|
||||
int tsd_pos[64];
|
||||
decode_tsd(gb, tsd_pos, mps->tsd_num_tr_slots, nb_time_slots);
|
||||
for (int i = 0; i < nb_time_slots; i++) {
|
||||
mps->tsd_phase_data[i] = 0;
|
||||
if (tsd_pos[i])
|
||||
mps->tsd_phase_data[i] = get_bits(gb, 3);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac,
|
||||
AACUsacElemConfig *ec, ChannelElement *che,
|
||||
GetBitContext *gb, int indep_flag, int nb_channels)
|
||||
@@ -1627,8 +1483,7 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac,
|
||||
if (get_bits1(gb)) { /* fac_data_present */
|
||||
const uint16_t len_8 = usac->core_frame_len / 8;
|
||||
const uint16_t len_16 = usac->core_frame_len / 16;
|
||||
const uint16_t fac_len = ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE ?
|
||||
len_16 : len_8;
|
||||
const uint16_t fac_len = ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE ? len_16 : len_8;
|
||||
ret = ff_aac_parse_fac_data(ue, gb, 1, fac_len);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -1647,9 +1502,8 @@ static int decode_usac_core_coder(AACDecContext *ac, AACUSACConfig *usac,
|
||||
}
|
||||
|
||||
if (ec->stereo_config_index) {
|
||||
ret = parse_mps212(ac, usac, &us->mps, ec, gb, indep_flag);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
avpriv_report_missing_feature(ac->avctx, "AAC USAC Mps212");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
spectrum_decode(ac, usac, che, core_nb_channels);
|
||||
|
||||
@@ -1,919 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2025 Lynne <dev@lynne.ee>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "aacdec_tab.h"
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "libavutil/macros.h"
|
||||
#include "libavutil/avassert.h"
|
||||
|
||||
#include "aacdec_usac_mps212.h"
|
||||
|
||||
static int huff_dec_1D(GetBitContext *gb, const int16_t (*tab)[2])
|
||||
{
|
||||
int idx = 0;
|
||||
do {
|
||||
/* Overreads are not possible here, the array forms a closed set */
|
||||
idx = tab[idx][get_bits1(gb)];
|
||||
} while (idx > 0);
|
||||
return idx;
|
||||
}
|
||||
|
||||
static int huff_dec_2D(GetBitContext *gb, const int16_t (*tab)[2], int16_t ret[2])
|
||||
{
|
||||
int idx = huff_dec_1D(gb, tab);
|
||||
if (!idx) { /* Escape */
|
||||
ret[0] = 0;
|
||||
ret[1] = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
idx = -(idx + 1);
|
||||
ret[0] = idx >> 4;
|
||||
ret[1] = idx & 0xf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int huff_data_1d(GetBitContext *gb, int16_t *data, int data_bands,
|
||||
enum AACMPSDataType data_type, int diff_freq, int p0_flag)
|
||||
{
|
||||
const int16_t (*hcod_first_band)[2];
|
||||
const int16_t (*hcod1D)[2];
|
||||
|
||||
switch (data_type) {
|
||||
case MPS_CLD:
|
||||
hcod_first_band = ff_aac_hcod_firstband_CLD;
|
||||
hcod1D = ff_aac_hcod1D_CLD[diff_freq];
|
||||
break;
|
||||
case MPS_ICC:
|
||||
hcod_first_band = ff_aac_hcod_firstband_ICC;
|
||||
hcod1D = ff_aac_hcod1D_ICC;
|
||||
break;
|
||||
case MPS_IPD:
|
||||
hcod_first_band = ff_aac_hcod_firstband_IPD;
|
||||
hcod1D = ff_aac_hcod1D_IPD[diff_freq];
|
||||
if (data_bands == 1)
|
||||
hcod1D = ff_aac_hcod1D_IPD[!diff_freq];
|
||||
break;
|
||||
default:
|
||||
av_unreachable("Invalid data type");
|
||||
}
|
||||
|
||||
if (p0_flag)
|
||||
data[0] = -(huff_dec_1D(gb, hcod_first_band) + 1);
|
||||
|
||||
for (int off = diff_freq; off < data_bands; off++) {
|
||||
int16_t val = -(huff_dec_1D(gb, hcod1D) + 1);
|
||||
if (val && data_type != MPS_IPD)
|
||||
val = get_bits1(gb) ? -val : val;
|
||||
data[off] = val;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void symmetry_data(GetBitContext *gb, int16_t data[2],
|
||||
uint8_t lav, enum AACMPSDataType data_type)
|
||||
{
|
||||
int16_t sum = data[0] + data[1];
|
||||
int16_t diff = data[0] - data[1];
|
||||
|
||||
if (sum > lav) {
|
||||
data[0] = -sum + (2*lav + 1);
|
||||
data[1] = -diff;
|
||||
} else {
|
||||
data[0] = sum;
|
||||
data[1] = diff;
|
||||
}
|
||||
|
||||
if ((data_type != MPS_IPD) && (data[0] + data[1])) {
|
||||
int sym = get_bits1(gb) ? -1 : 1;
|
||||
data[0] *= sym;
|
||||
data[1] *= sym;
|
||||
}
|
||||
|
||||
if (data[0] - data[1]) {
|
||||
if (get_bits1(gb))
|
||||
FFSWAP(int16_t, data[0], data[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/* NB: NOT a standard integer log2! */
|
||||
static int mps_log2(int s) {
|
||||
if (s)
|
||||
s--;
|
||||
int v = 0;
|
||||
while (s) {
|
||||
s >>= 1;
|
||||
v++;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
static void pcm_decode(GetBitContext *gb, int16_t *data0, int16_t *data1,
|
||||
int16_t offset, int nb_pcm_data_bands,
|
||||
int nb_quant_steps, int nb_levels)
|
||||
{
|
||||
int max_group_len;
|
||||
switch (nb_levels) {
|
||||
case 3: max_group_len = 5; break;
|
||||
case 7: max_group_len = 6; break;
|
||||
case 11: max_group_len = 2; break;
|
||||
case 13: max_group_len = 4; break;
|
||||
case 19: max_group_len = 4; break;
|
||||
case 25: max_group_len = 3; break;
|
||||
case 51: max_group_len = 4; break;
|
||||
case 4: case 8: case 15: case 16: case 26: case 31:
|
||||
max_group_len = 1;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
};
|
||||
|
||||
av_assert1(data0 || data1);
|
||||
|
||||
int pcm_chunk_size[7] = { 0 };
|
||||
|
||||
int tmp = 1;
|
||||
for (int i = 1; i <= max_group_len; i++) {
|
||||
tmp *= nb_levels;
|
||||
pcm_chunk_size[i] = mps_log2(tmp);
|
||||
}
|
||||
|
||||
for (int i = 0; i < nb_pcm_data_bands; i+= max_group_len) {
|
||||
int group_len = FFMIN(max_group_len, nb_pcm_data_bands - i);
|
||||
|
||||
int pcm = get_bits(gb, pcm_chunk_size[group_len]);
|
||||
for (int j = 0; j < group_len; j++) {
|
||||
int idx = i + (group_len - 1) - j;
|
||||
int val = pcm % nb_levels;
|
||||
if (data0 && data1) {
|
||||
if (idx % 2)
|
||||
data1[idx / 2] = val - offset;
|
||||
else
|
||||
data0[idx / 2] = val - offset;
|
||||
} else if (!data1) {
|
||||
data0[idx] = val - offset;
|
||||
} else if (!data0) {
|
||||
data1[idx] = val - offset;
|
||||
}
|
||||
pcm = (pcm - val) / nb_levels;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void huff_data_2d(GetBitContext *gb, int16_t *part0_data[2], int16_t (*data)[2],
|
||||
int data_bands, int stride, enum AACMPSDataType data_type,
|
||||
int diff_freq, int freq_pair)
|
||||
{
|
||||
int16_t lav_idx = huff_dec_1D(gb, ff_aac_hcod_lav_idx);
|
||||
uint8_t lav = ff_aac_lav_tab_XXX[data_type][-(lav_idx + 1)];
|
||||
|
||||
const int16_t (*hcod1D)[2];
|
||||
const int16_t (*hcod2D)[2];
|
||||
switch (data_type) {
|
||||
case MPS_CLD:
|
||||
hcod1D = ff_aac_hcod_firstband_CLD;
|
||||
switch (lav) {
|
||||
case 3: hcod2D = ff_aac_hcod2D_CLD_03[freq_pair][diff_freq]; break;
|
||||
case 5: hcod2D = ff_aac_hcod2D_CLD_05[freq_pair][diff_freq]; break;
|
||||
case 7: hcod2D = ff_aac_hcod2D_CLD_07[freq_pair][diff_freq]; break;
|
||||
case 9: hcod2D = ff_aac_hcod2D_CLD_09[freq_pair][diff_freq]; break;
|
||||
}
|
||||
break;
|
||||
case MPS_ICC:
|
||||
hcod1D = ff_aac_hcod_firstband_ICC;
|
||||
switch (lav) {
|
||||
case 1: hcod2D = ff_aac_hcod2D_ICC_01[freq_pair][diff_freq]; break;
|
||||
case 3: hcod2D = ff_aac_hcod2D_ICC_03[freq_pair][diff_freq]; break;
|
||||
case 5: hcod2D = ff_aac_hcod2D_ICC_05[freq_pair][diff_freq]; break;
|
||||
case 7: hcod2D = ff_aac_hcod2D_ICC_07[freq_pair][diff_freq]; break;
|
||||
}
|
||||
break;
|
||||
case MPS_IPD:
|
||||
hcod1D = ff_aac_hcod_firstband_IPD;
|
||||
switch (lav) {
|
||||
case 1: hcod2D = ff_aac_hcod2D_IPD_01[freq_pair][diff_freq]; break;
|
||||
case 3: hcod2D = ff_aac_hcod2D_IPD_03[freq_pair][diff_freq]; break;
|
||||
case 5: hcod2D = ff_aac_hcod2D_IPD_05[freq_pair][diff_freq]; break;
|
||||
case 7: hcod2D = ff_aac_hcod2D_IPD_07[freq_pair][diff_freq]; break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
av_unreachable("Invalid data type");
|
||||
}
|
||||
|
||||
if (part0_data[0])
|
||||
part0_data[0][0] = -(huff_dec_1D(gb, hcod1D) + 1);
|
||||
if (part0_data[1])
|
||||
part0_data[1][0] = -(huff_dec_1D(gb, hcod1D) + 1);
|
||||
|
||||
int i = 0;
|
||||
int esc_cnt = 0;
|
||||
int16_t esc_data[2][28];
|
||||
int esc_idx[28];
|
||||
for (; i < data_bands; i += stride) {
|
||||
if (huff_dec_2D(gb, hcod2D, data[i]))
|
||||
esc_idx[esc_cnt++] = i; /* Escape */
|
||||
else
|
||||
symmetry_data(gb, data[i], lav, data_type);
|
||||
}
|
||||
|
||||
if (esc_cnt) {
|
||||
pcm_decode(gb, esc_data[0], esc_data[1],
|
||||
0, 2*esc_cnt, 0, (2*lav + 1));
|
||||
for (i = 0; i < esc_cnt; i++) {
|
||||
data[esc_idx[i]][0] = esc_data[0][i] - lav;
|
||||
data[esc_idx[i]][0] = esc_data[0][i] - lav;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int huff_decode(GetBitContext *gb, int16_t *data[2],
|
||||
enum AACMPSDataType data_type, int diff_freq[2],
|
||||
int num_val, int *time_pair)
|
||||
{
|
||||
int16_t pair_vec[28][2];
|
||||
int num_val_ch[2] = { num_val, num_val };
|
||||
int16_t *p0_data[2][2] = { 0 };
|
||||
int df_rest_flag[2] = { 0, 0 };
|
||||
|
||||
/* Coding scheme */
|
||||
int dim = get_bits1(gb);
|
||||
if (dim) { /* 2D */
|
||||
*time_pair = 0;
|
||||
if (data[0] && data[1])
|
||||
*time_pair = get_bits1(gb);
|
||||
|
||||
if (*time_pair) {
|
||||
if (diff_freq[0] || diff_freq[1]) {
|
||||
p0_data[0][0] = data[0];
|
||||
p0_data[0][1] = data[1];
|
||||
|
||||
data[0] += 1;
|
||||
data[1] += 1;
|
||||
|
||||
num_val_ch[0] -= 1;
|
||||
}
|
||||
|
||||
int diff_mode = 1;
|
||||
if (!diff_freq[0] || !diff_freq[1])
|
||||
diff_mode = 0; // time
|
||||
|
||||
huff_data_2d(gb, p0_data[0], pair_vec, num_val_ch[0], 1, data_type,
|
||||
diff_mode, 0);
|
||||
|
||||
for (int i = 0; i < num_val_ch[0]; i++) {
|
||||
data[0][i] = pair_vec[i][0];
|
||||
data[1][i] = pair_vec[i][1];
|
||||
}
|
||||
} else {
|
||||
if (data[0]) {
|
||||
if (diff_freq[0]) {
|
||||
p0_data[0][0] = data[0];
|
||||
p0_data[0][1] = NULL;
|
||||
|
||||
num_val_ch[0] -= 1;
|
||||
data[0]++;
|
||||
}
|
||||
df_rest_flag[0] = num_val_ch[0] % 2;
|
||||
if (df_rest_flag[0])
|
||||
num_val_ch[0] -= 1;
|
||||
if (num_val_ch[0] < 0)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (data[1]) {
|
||||
if (diff_freq[1]) {
|
||||
p0_data[1][0] = NULL;
|
||||
p0_data[1][1] = data[1];
|
||||
|
||||
num_val_ch[1] -= 1;
|
||||
data[1]++;
|
||||
}
|
||||
df_rest_flag[1] = num_val_ch[1] % 2;
|
||||
if (df_rest_flag[1])
|
||||
num_val_ch[1] -= 1;
|
||||
if (num_val_ch[1] < 0)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (data[0]) {
|
||||
huff_data_2d(gb, p0_data[0], pair_vec, num_val_ch[0], 2, data_type,
|
||||
diff_freq[0], 1);
|
||||
if (df_rest_flag[0])
|
||||
huff_data_1d(gb, data[0] + num_val_ch[0], 1,
|
||||
data_type, !diff_freq[0], 0);
|
||||
}
|
||||
if (data[1]) {
|
||||
huff_data_2d(gb, p0_data[1], pair_vec + 1, num_val_ch[1], 2, data_type,
|
||||
diff_freq[1], 1);
|
||||
if (df_rest_flag[1])
|
||||
huff_data_1d(gb, data[1] + num_val_ch[1], 1,
|
||||
data_type, !diff_freq[1], 0);
|
||||
}
|
||||
}
|
||||
} else { /* 1D */
|
||||
if (data[0])
|
||||
huff_data_1d(gb, data[0], num_val, data_type, diff_freq[0], diff_freq[0]);
|
||||
if (data[1])
|
||||
huff_data_1d(gb, data[1], num_val, data_type, diff_freq[1], diff_freq[1]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void diff_freq_decode(const int16_t *diff, int16_t *out, int nb_val)
|
||||
{
|
||||
int i = 0;
|
||||
out[0] = diff[0];
|
||||
for (i = 1; i < nb_val; i++)
|
||||
out[i] = out[i - 1] + diff[i];
|
||||
}
|
||||
|
||||
static void diff_time_decode_backwards(const int16_t *prev, const int16_t *diff,
|
||||
int16_t *out, const int mixed_diff_type,
|
||||
const int nb_val)
|
||||
{
|
||||
if (mixed_diff_type)
|
||||
out[0] = diff[0];
|
||||
for (int i = mixed_diff_type; i < nb_val; i++)
|
||||
out[i] = prev[i] + diff[i];
|
||||
}
|
||||
|
||||
static void diff_time_decode_forwards(const int16_t *prev, const int16_t *diff,
|
||||
int16_t *out, const int mixed_diff_type,
|
||||
const int nb_val)
|
||||
{
|
||||
if (mixed_diff_type)
|
||||
out[0] = diff[0];
|
||||
for (int i = mixed_diff_type; i < nb_val; i++)
|
||||
out[i] = prev[i] - diff[i];
|
||||
}
|
||||
|
||||
static void attach_lsb(GetBitContext *gb, int16_t *data_msb,
|
||||
int offset, int nb_lsb, int nb_val,
|
||||
int16_t *data)
|
||||
{
|
||||
for (int i = 0; i < nb_val; i++) {
|
||||
int msb = data_msb[i];
|
||||
if (nb_lsb > 0) {
|
||||
uint32_t lsb = get_bits(gb, nb_lsb);
|
||||
data[i] = ((msb << nb_lsb) | lsb) - offset;
|
||||
} else {
|
||||
data[i] = msb - offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int ec_pair_dec(GetBitContext *gb,
|
||||
int16_t set1[MPS_MAX_PARAM_BANDS],
|
||||
int16_t set2[MPS_MAX_PARAM_BANDS], int16_t *last,
|
||||
enum AACMPSDataType data_type, int start_band, int nb_bands,
|
||||
int pair, int coarse,
|
||||
int diff_time_back)
|
||||
{
|
||||
int attach_lsb_flag = 0;
|
||||
int quant_levels = 0;
|
||||
int quant_offset = 0;
|
||||
|
||||
switch (data_type) {
|
||||
case MPS_CLD:
|
||||
if (coarse) {
|
||||
attach_lsb_flag = 0;
|
||||
quant_levels = 15;
|
||||
quant_offset = 7;
|
||||
} else {
|
||||
attach_lsb_flag = 0;
|
||||
quant_levels = 31;
|
||||
quant_offset = 15;
|
||||
}
|
||||
break;
|
||||
case MPS_ICC:
|
||||
if (coarse) {
|
||||
attach_lsb_flag = 0;
|
||||
quant_levels = 4;
|
||||
quant_offset = 0;
|
||||
} else {
|
||||
attach_lsb_flag = 0;
|
||||
quant_levels = 8;
|
||||
quant_offset = 0;
|
||||
}
|
||||
break;
|
||||
case MPS_IPD:
|
||||
if (!coarse) {
|
||||
attach_lsb_flag = 1;
|
||||
quant_levels = 16;
|
||||
quant_offset = 0;
|
||||
} else {
|
||||
attach_lsb_flag = 0;
|
||||
quant_levels = 8;
|
||||
quant_offset = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
int16_t last_msb[28] = { 0 };
|
||||
int16_t data_pair[2][28] = { 0 };
|
||||
int16_t data_diff[2][28] = { 0 };
|
||||
int16_t *p_data[2];
|
||||
|
||||
int pcm_coding = get_bits1(gb);
|
||||
if (pcm_coding) { /* bsPcmCoding */
|
||||
int nb_pcm_vals;
|
||||
if (pair) {
|
||||
p_data[0] = data_pair[0];
|
||||
p_data[1] = data_pair[1];
|
||||
nb_pcm_vals = 2 * nb_bands;
|
||||
} else {
|
||||
p_data[0] = data_pair[0];
|
||||
p_data[1] = NULL;
|
||||
nb_pcm_vals = nb_bands;
|
||||
}
|
||||
|
||||
int nb_quant_steps;
|
||||
switch (data_type) {
|
||||
case MPS_CLD: nb_quant_steps = coarse ? 15 : 31; break;
|
||||
case MPS_ICC: nb_quant_steps = coarse ? 4 : 8; break;
|
||||
case MPS_IPD: nb_quant_steps = coarse ? 8 : 16; break;
|
||||
}
|
||||
pcm_decode(gb, p_data[0], p_data[1], quant_offset, nb_pcm_vals,
|
||||
nb_quant_steps, quant_levels);
|
||||
|
||||
memcpy(&set1[start_band], data_pair[0], 2*nb_bands);
|
||||
if (pair)
|
||||
memcpy(&set2[start_band], data_pair[1], 2*nb_bands);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pair) {
|
||||
p_data[0] = data_pair[0];
|
||||
p_data[1] = data_pair[1];
|
||||
} else {
|
||||
p_data[0] = data_pair[0];
|
||||
p_data[1] = NULL;
|
||||
}
|
||||
|
||||
int diff_freq[2] = { 1, 1 };
|
||||
int backwards = 1;
|
||||
|
||||
if (pair || diff_time_back)
|
||||
diff_freq[0] = !get_bits1(gb);
|
||||
|
||||
if (pair && (diff_freq[0] || diff_time_back))
|
||||
diff_freq[1] = !get_bits1(gb);
|
||||
|
||||
int time_pair;
|
||||
huff_decode(gb, p_data, data_type, diff_freq,
|
||||
nb_bands, &time_pair);
|
||||
|
||||
/* Differential decoding */
|
||||
if (!diff_freq[0] || !diff_freq[1]) {
|
||||
if (0 /* 1 if SAOC */) {
|
||||
backwards = 1;
|
||||
} else {
|
||||
if (pair) {
|
||||
if (!diff_freq[0] && !diff_time_back)
|
||||
backwards = 0;
|
||||
else if (!diff_freq[1])
|
||||
backwards = 1;
|
||||
else
|
||||
backwards = !get_bits1(gb);
|
||||
} else {
|
||||
backwards = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int mixed_time_pair = (diff_freq[0] != diff_freq[1]) && time_pair;
|
||||
|
||||
if (backwards) {
|
||||
if (diff_freq[0]) {
|
||||
diff_freq_decode(data_diff[0], data_pair[0], nb_bands);
|
||||
} else {
|
||||
for (int i = 0; i < nb_bands; i++) {
|
||||
last_msb[i] = last[i + start_band] + quant_offset;
|
||||
if (attach_lsb_flag) {
|
||||
last_msb[i] >>= 1;
|
||||
}
|
||||
}
|
||||
diff_time_decode_backwards(last_msb, data_diff[0], data_pair[0],
|
||||
mixed_time_pair, nb_bands);
|
||||
}
|
||||
|
||||
if (diff_freq[1])
|
||||
diff_freq_decode(data_diff[1], data_pair[1], nb_bands);
|
||||
else
|
||||
diff_time_decode_backwards(data_pair[0], data_diff[1],
|
||||
data_pair[1], mixed_time_pair, nb_bands);
|
||||
} else {
|
||||
diff_freq_decode(data_diff[1], data_pair[1], nb_bands);
|
||||
|
||||
if (diff_freq[0])
|
||||
diff_freq_decode(data_diff[0], data_pair[0], nb_bands);
|
||||
else
|
||||
diff_time_decode_forwards(data_pair[1], data_diff[0], data_pair[0],
|
||||
mixed_time_pair, nb_bands);
|
||||
}
|
||||
|
||||
/* Decode LSBs */
|
||||
attach_lsb(gb, p_data[0], quant_offset, attach_lsb_flag,
|
||||
nb_bands, p_data[0]);
|
||||
if (pair)
|
||||
attach_lsb(gb, p_data[1], quant_offset, attach_lsb_flag,
|
||||
nb_bands, p_data[1]);
|
||||
|
||||
memcpy(&set1[start_band], data_pair[0], 2*nb_bands);
|
||||
if (pair)
|
||||
memcpy(&set2[start_band], data_pair[1], 2*nb_bands);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void coarse_to_fine(int16_t *data, enum AACMPSDataType data_type,
|
||||
int start_band, int end_band)
|
||||
{
|
||||
for (int i = start_band; i < end_band; i++)
|
||||
data[i] *= 2;
|
||||
if (data_type == MPS_CLD) {
|
||||
for (int i = start_band; i < end_band; i++) {
|
||||
if (data[i] == -14)
|
||||
data[i] = -15;
|
||||
else if (data[i] == 14)
|
||||
data[i] = 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void fine_to_coarse(int16_t *data, enum AACMPSDataType data_type,
|
||||
int start_band, int end_band)
|
||||
{
|
||||
for (int i = start_band; i < end_band; i++) {
|
||||
if (data_type == MPS_CLD)
|
||||
data[i] /= 2;
|
||||
else
|
||||
data[i] >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
static int get_freq_strides(int16_t *freq_strides, int band_stride,
|
||||
int start_band, int end_band)
|
||||
{
|
||||
int data_bands = (end_band - start_band - 1) / band_stride + 1;
|
||||
|
||||
freq_strides[0] = start_band;
|
||||
for (int i = 1; i <= data_bands; i++)
|
||||
freq_strides[i] = freq_strides[i - 1] + band_stride;
|
||||
|
||||
int offs = 0;
|
||||
while (freq_strides[data_bands] > end_band) {
|
||||
if (offs < data_bands)
|
||||
offs++;
|
||||
for (int i = offs; i <= data_bands; i++) {
|
||||
freq_strides[i]--;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i <= data_bands; i++)
|
||||
freq_strides[i] = av_clip_uintp2(freq_strides[i], 2);
|
||||
|
||||
return data_bands;
|
||||
}
|
||||
|
||||
static const int stride_table[4] = { 1, 2, 5, 28 };
|
||||
|
||||
int ff_aac_ec_data_dec(GetBitContext *gb, AACMPSLosslessData *ld,
|
||||
enum AACMPSDataType data_type,
|
||||
int default_val,
|
||||
int start_band, int end_band, int frame_indep_flag,
|
||||
int indep_flag, int nb_param_sets)
|
||||
{
|
||||
for (int i = 0; i < nb_param_sets; i++) {
|
||||
ld->data_mode[i] = get_bits(gb, 2);
|
||||
/* Error checking */
|
||||
if ((indep_flag && !i && (ld->data_mode[i] == 1 || ld->data_mode[i] == 2)) ||
|
||||
((i == (nb_param_sets - 1) && (ld->data_mode[i] == 2)))) {
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
int set_idx = 0;
|
||||
int data_pair = 0;
|
||||
bool old_coarse = ld->quant_coarse_prev;
|
||||
|
||||
for (int i = 0; i < nb_param_sets; i++) {
|
||||
if (!ld->data_mode[i]) {
|
||||
for (int j = start_band; j < end_band; j++)
|
||||
ld->last_data[j] = default_val;
|
||||
old_coarse = 0;
|
||||
}
|
||||
|
||||
if (ld->data_mode[i] != 3) {
|
||||
continue;
|
||||
} else if (data_pair) {
|
||||
data_pair = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
data_pair = get_bits1(gb);
|
||||
ld->coarse_quant[set_idx] = get_bits1(gb);
|
||||
ld->freq_res[set_idx] = get_bits(gb, 2);
|
||||
|
||||
if (ld->coarse_quant[set_idx] != old_coarse) {
|
||||
if (old_coarse)
|
||||
coarse_to_fine(ld->last_data, data_type, start_band, end_band);
|
||||
else
|
||||
fine_to_coarse(ld->last_data, data_type, start_band, end_band);
|
||||
}
|
||||
|
||||
int data_bands = get_freq_strides(ld->freq_res,
|
||||
stride_table[ld->freq_res[set_idx]],
|
||||
start_band, end_band);
|
||||
|
||||
if (set_idx + data_pair > MPS_MAX_PARAM_SETS)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
for (int j = 0; j < data_bands; j++)
|
||||
ld->last_data[start_band + j] = ld->last_data[ld->freq_res[j]];
|
||||
|
||||
int err = ec_pair_dec(gb,
|
||||
ld->data[set_idx + 0], ld->data[set_idx + 1],
|
||||
ld->last_data, data_type, start_band, end_band - start_band,
|
||||
data_pair, ld->coarse_quant[set_idx],
|
||||
!(indep_flag && (i == 0)) || (set_idx > 0));
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
if (data_type == MPS_IPD) {
|
||||
const int mask = ld->coarse_quant[set_idx] ? 0x7 : 0xF;
|
||||
for (int j = 0; j < data_bands; j++)
|
||||
for (int k = ld->freq_res[j + 0]; k < ld->freq_res[j + 1]; k++)
|
||||
ld->last_data[k] = ld->data[set_idx + data_pair][start_band + j] & mask;
|
||||
} else {
|
||||
for (int j = 0; j < data_bands; j++)
|
||||
for (int k = ld->freq_res[j + 0]; k < ld->freq_res[j + 1]; k++)
|
||||
ld->last_data[k] = ld->data[set_idx + data_pair][start_band + j];
|
||||
}
|
||||
|
||||
old_coarse = ld->coarse_quant[set_idx];
|
||||
if (data_pair) {
|
||||
ld->coarse_quant[set_idx + 1] = ld->coarse_quant[set_idx];
|
||||
ld->freq_res[set_idx + 1] = ld->freq_res[set_idx];
|
||||
}
|
||||
set_idx += data_pair + 1;
|
||||
}
|
||||
|
||||
ld->quant_coarse_prev = old_coarse;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_aac_huff_dec_reshape(GetBitContext *gb, int16_t *out_data,
|
||||
int nb_val)
|
||||
{
|
||||
int val, len;
|
||||
int val_received = 0;
|
||||
int16_t rl_data[2] = { 0 };
|
||||
|
||||
while (val_received < nb_val) {
|
||||
huff_dec_2D(gb, ff_aac_hcod2D_reshape, rl_data);
|
||||
val = rl_data[0];
|
||||
len = rl_data[1] + 1;
|
||||
if (val_received + len > nb_val)
|
||||
return AVERROR(EINVAL);
|
||||
for (int i = val_received; i < val_received + len; i++)
|
||||
out_data[i] = val;
|
||||
val_received += len;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void create_mapping(int map[MPS_MAX_PARAM_BANDS + 1],
|
||||
int start_band, int stop_band, int stride)
|
||||
{
|
||||
int diff[MPS_MAX_PARAM_BANDS + 1];
|
||||
int src_bands = stop_band - start_band;
|
||||
int dst_bands = (src_bands - 1) / stride + 1;
|
||||
|
||||
if (dst_bands < 1)
|
||||
dst_bands = 1;
|
||||
|
||||
int bands_achived = dst_bands * stride;
|
||||
int bands_diff = src_bands - bands_achived;
|
||||
for (int i = 0; i < dst_bands; i++)
|
||||
diff[i] = stride;
|
||||
|
||||
int incr, k;
|
||||
if (bands_diff > 0) {
|
||||
incr = -1;
|
||||
k = dst_bands - 1;
|
||||
} else {
|
||||
incr = 1;
|
||||
k = 0;
|
||||
}
|
||||
|
||||
while (bands_diff != 0) {
|
||||
diff[k] = diff[k] - incr;
|
||||
k = k + incr;
|
||||
bands_diff = bands_diff + incr;
|
||||
if (k >= dst_bands) {
|
||||
if (bands_diff > 0) {
|
||||
k = dst_bands - 1;
|
||||
} else if (bands_diff < 0) {
|
||||
k = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
map[0] = start_band;
|
||||
for (int i = 0; i < dst_bands; i++)
|
||||
map[i + 1] = map[i] + diff[i];
|
||||
}
|
||||
|
||||
static void map_freq(int16_t *dst, const int16_t *src,
|
||||
int *map, int nb_bands)
|
||||
{
|
||||
for (int i = 0; i < nb_bands; i++) {
|
||||
int value = src[i + map[0]];
|
||||
int start_band = map[i];
|
||||
int stop_band = map[i + 1];
|
||||
for (int j = start_band; j < stop_band; j++) {
|
||||
dst[j] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int deq_idx(int value, enum AACMPSDataType data_type)
|
||||
{
|
||||
int idx = -1;
|
||||
|
||||
switch (data_type) {
|
||||
case MPS_CLD:
|
||||
if (((value + 15) >= 0) && ((value + 15) < 31))
|
||||
idx = (value + 15);
|
||||
break;
|
||||
case MPS_ICC:
|
||||
if ((value >= 0) && (value < 8))
|
||||
idx = value;
|
||||
break;
|
||||
case MPS_IPD:
|
||||
/* (+/-)15 * MAX_PARAMETER_BANDS for differential coding in frequency
|
||||
* domain (according to rbl) */
|
||||
if ((value >= -420) && (value <= 420))
|
||||
idx = (value & 0xf);
|
||||
break;
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
int ff_aac_map_index_data(AACMPSLosslessData *ld,
|
||||
enum AACMPSDataType data_type,
|
||||
int dst_idx[MPS_MAX_PARAM_SETS][MPS_MAX_PARAM_BANDS],
|
||||
int default_value, int start_band, int stop_band,
|
||||
int nb_param_sets, const int *param_set_idx,
|
||||
int extend_frame)
|
||||
{
|
||||
if (nb_param_sets > MPS_MAX_PARAM_SETS)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
int data_mode_3_idx[MPS_MAX_PARAM_SETS] = { 0 };
|
||||
int nb_data_mode_3 = 0;
|
||||
for (int i = 0; i < nb_param_sets; i++) {
|
||||
if (ld->data_mode[i] == 3) {
|
||||
data_mode_3_idx[nb_data_mode_3] = i;
|
||||
nb_data_mode_3++;
|
||||
}
|
||||
}
|
||||
|
||||
int set_idx = 0;
|
||||
|
||||
/* Prepare data */
|
||||
int interpolate[MPS_MAX_PARAM_SETS] = { 0 };
|
||||
int16_t tmp_idx_data[MPS_MAX_PARAM_SETS][MPS_MAX_PARAM_BANDS] = { 0 };
|
||||
for (int i = 0; i < nb_param_sets; i++) {
|
||||
if (ld->data_mode[i] == 0) {
|
||||
ld->coarse_quant_no[i] = 0;
|
||||
for (int band = start_band; band < stop_band; band++)
|
||||
tmp_idx_data[i][band] = default_value;
|
||||
for (int band = start_band; band < stop_band; band++)
|
||||
ld->last_data[band] = tmp_idx_data[i][band];
|
||||
ld->quant_coarse_prev = 0;
|
||||
}
|
||||
|
||||
if (ld->data_mode[i] == 1) {
|
||||
for (int band = start_band; band < stop_band; band++)
|
||||
tmp_idx_data[i][band] = ld->last_data[band];
|
||||
ld->coarse_quant_no[i] = ld->quant_coarse_prev;
|
||||
}
|
||||
|
||||
if (ld->data_mode[i] == 2) {
|
||||
for (int band = start_band; band < stop_band; band++)
|
||||
tmp_idx_data[i][band] = ld->last_data[band];
|
||||
ld->coarse_quant_no[i] = ld->quant_coarse_prev;
|
||||
interpolate[i] = 1;
|
||||
} else {
|
||||
interpolate[i] = 0;
|
||||
}
|
||||
|
||||
if (ld->data_mode[i] == 3) {
|
||||
int stride;
|
||||
|
||||
int parmSlot = data_mode_3_idx[set_idx];
|
||||
stride = stride_table[ld->freq_res[set_idx]];
|
||||
int dataBands = (stop_band - start_band - 1) / stride + 1;
|
||||
|
||||
int tmp[MPS_MAX_PARAM_BANDS + 1];
|
||||
create_mapping(tmp, start_band, stop_band, stride);
|
||||
map_freq(tmp_idx_data[parmSlot], ld->data[set_idx],
|
||||
tmp, dataBands);
|
||||
|
||||
for (int band = start_band; band < stop_band; band++)
|
||||
ld->last_data[band] = tmp_idx_data[parmSlot][band];
|
||||
|
||||
ld->quant_coarse_prev = ld->coarse_quant[set_idx];
|
||||
ld->coarse_quant_no[i] = ld->coarse_quant[set_idx];
|
||||
|
||||
set_idx++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Map all coarse data to fine */
|
||||
for (int i = 0; i < nb_param_sets; i++) {
|
||||
if (ld->coarse_quant_no[i] == 1) {
|
||||
coarse_to_fine(tmp_idx_data[i], data_type, start_band,
|
||||
stop_band - start_band);
|
||||
ld->coarse_quant_no[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Interpolate */
|
||||
int i1 = 0;
|
||||
for (int i = 0; i < nb_param_sets; i++) {
|
||||
if (interpolate[i] != 1) {
|
||||
i1 = i;
|
||||
} else {
|
||||
int xi, i2, x1, x2;
|
||||
|
||||
for (i2 = i; i2 < nb_param_sets; i2++)
|
||||
if (interpolate[i2] != 1)
|
||||
break;
|
||||
if (i2 >= nb_param_sets)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
x1 = param_set_idx[i1];
|
||||
xi = param_set_idx[i];
|
||||
x2 = param_set_idx[i2];
|
||||
|
||||
for (int band = start_band; band < stop_band; band++) {
|
||||
int yi, y1, y2;
|
||||
y1 = tmp_idx_data[i1][band];
|
||||
y2 = tmp_idx_data[i2][band];
|
||||
if (x1 != x2) {
|
||||
yi = y1 + (xi - x1) * (y2 - y1) / (x2 - x1);
|
||||
} else {
|
||||
yi = y1 /*+ (xi-x1)*(y2-y1)/1e-12*/;
|
||||
}
|
||||
tmp_idx_data[i][band] = yi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Dequantize data and apply factorCLD if necessary */
|
||||
for (int ps = 0; ps < nb_param_sets; ps++) {
|
||||
/* Dequantize data */
|
||||
for (int band = start_band; band < stop_band; band++) {
|
||||
dst_idx[ps][band] = deq_idx(tmp_idx_data[ps][band],
|
||||
data_type);
|
||||
if (dst_idx[ps][band] == -1)
|
||||
dst_idx[ps][band] = default_value;
|
||||
}
|
||||
}
|
||||
|
||||
if (extend_frame) {
|
||||
if (data_type == MPS_IPD)
|
||||
ld->coarse_quant[nb_param_sets] = ld->coarse_quant[nb_param_sets - 1];
|
||||
for (int band = start_band; band < stop_band; band++)
|
||||
dst_idx[nb_param_sets][band] = dst_idx[nb_param_sets - 1][band];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2025 Lynne <dev@lynne.ee>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AAC_AACDEC_USAC_MPS212_H
|
||||
#define AVCODEC_AAC_AACDEC_USAC_MPS212_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "libavcodec/aac.h"
|
||||
|
||||
enum AACMPSDataType {
|
||||
MPS_CLD = 0,
|
||||
MPS_ICC,
|
||||
MPS_IPD,
|
||||
|
||||
MPS_ELE_NB,
|
||||
};
|
||||
|
||||
typedef struct AACMPSLosslessData {
|
||||
int16_t data[MPS_MAX_PARAM_SETS][MPS_MAX_PARAM_BANDS];
|
||||
int16_t last_data[MPS_MAX_PARAM_BANDS];
|
||||
|
||||
int16_t data_mode[MPS_MAX_PARAM_SETS];
|
||||
bool coarse_quant[MPS_MAX_PARAM_SETS];
|
||||
int16_t freq_res[MPS_MAX_PARAM_SETS];
|
||||
int16_t coarse_quant_no[MPS_MAX_PARAM_SETS];
|
||||
|
||||
bool quant_coarse_prev;
|
||||
} AACMPSLosslessData;
|
||||
|
||||
int ff_aac_ec_data_dec(GetBitContext *gb, AACMPSLosslessData *ld,
|
||||
enum AACMPSDataType data_type,
|
||||
int default_val,
|
||||
int start_band, int end_band, int frame_indep_flag,
|
||||
int indep_flag, int nb_param_sets);
|
||||
|
||||
int ff_aac_map_index_data(AACMPSLosslessData *ld,
|
||||
enum AACMPSDataType data_type,
|
||||
int dst_idx[MPS_MAX_PARAM_SETS][MPS_MAX_PARAM_BANDS],
|
||||
int default_value, int start_band, int stop_band,
|
||||
int nb_param_sets, const int *param_set_idx,
|
||||
int extend_frame);
|
||||
|
||||
int ff_aac_huff_dec_reshape(GetBitContext *gb, int16_t *out_data,
|
||||
int nb_val);
|
||||
|
||||
#endif /* AVCODEC_AAC_AACDEC_USAC_MPS212_H */
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "aac_ac3_parser.h"
|
||||
#include "adts_header.h"
|
||||
#include "adts_parser.h"
|
||||
#include "parser_internal.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
|
||||
static int aac_sync(uint64_t state, int *need_next_header, int *new_frame_start)
|
||||
@@ -52,10 +51,10 @@ static av_cold int aac_parse_init(AVCodecParserContext *s1)
|
||||
}
|
||||
|
||||
|
||||
const FFCodecParser ff_aac_parser = {
|
||||
PARSER_CODEC_LIST(AV_CODEC_ID_AAC),
|
||||
const AVCodecParser ff_aac_parser = {
|
||||
.codec_ids = { AV_CODEC_ID_AAC },
|
||||
.priv_data_size = sizeof(AACAC3ParseContext),
|
||||
.init = aac_parse_init,
|
||||
.parse = ff_aac_ac3_parse,
|
||||
.close = ff_parse_close,
|
||||
.parser_init = aac_parse_init,
|
||||
.parser_parse = ff_aac_ac3_parse,
|
||||
.parser_close = ff_parse_close,
|
||||
};
|
||||
|
||||
@@ -173,7 +173,7 @@ static av_always_inline float quantize_and_encode_band_cost_template(
|
||||
if (BT_ESC) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) {
|
||||
int coef = av_clip(quant(fabsf(in[i+j]), Q, ROUNDING), 16, (1 << 13) - 1);
|
||||
int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, ROUNDING), 13);
|
||||
int len = av_log2(coef);
|
||||
|
||||
put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
|
||||
|
||||
@@ -65,7 +65,7 @@ static inline void ff_aacenc_dsp_init(AACEncDSPContext *s)
|
||||
|
||||
#if ARCH_RISCV
|
||||
ff_aacenc_dsp_init_riscv(s);
|
||||
#elif ARCH_X86 && HAVE_X86ASM
|
||||
#elif ARCH_X86
|
||||
ff_aacenc_dsp_init_x86(s);
|
||||
#elif ARCH_AARCH64
|
||||
ff_aacenc_dsp_init_aarch64(s);
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <stdlib.h>
|
||||
#define BUILD_TABLES
|
||||
#include "config.h"
|
||||
#undef ASSERT_LEVEL
|
||||
#undef CONFIG_HARDCODED_TABLES
|
||||
#define CONFIG_HARDCODED_TABLES 0
|
||||
#include "aac_defines.h"
|
||||
|
||||
@@ -30,15 +30,15 @@
|
||||
#define PS_MAX_AP_DELAY 5
|
||||
|
||||
typedef struct PSDSPContext {
|
||||
void (*add_squares)(INTFLOAT *restrict dst, const INTFLOAT (*src)[2], int n);
|
||||
void (*mul_pair_single)(INTFLOAT (*restrict dst)[2], INTFLOAT (*src0)[2], INTFLOAT *src1,
|
||||
void (*add_squares)(INTFLOAT *dst, const INTFLOAT (*src)[2], int n);
|
||||
void (*mul_pair_single)(INTFLOAT (*dst)[2], INTFLOAT (*src0)[2], INTFLOAT *src1,
|
||||
int n);
|
||||
void (*hybrid_analysis)(INTFLOAT (*restrict out)[2], INTFLOAT (*in)[2],
|
||||
void (*hybrid_analysis)(INTFLOAT (*out)[2], INTFLOAT (*in)[2],
|
||||
const INTFLOAT (*filter)[8][2],
|
||||
ptrdiff_t stride, int n);
|
||||
void (*hybrid_analysis_ileave)(INTFLOAT (*restrict out)[32][2], INTFLOAT L[2][38][64],
|
||||
void (*hybrid_analysis_ileave)(INTFLOAT (*out)[32][2], INTFLOAT L[2][38][64],
|
||||
int i, int len);
|
||||
void (*hybrid_synthesis_deint)(INTFLOAT out[2][38][64], INTFLOAT (*restrict in)[32][2],
|
||||
void (*hybrid_synthesis_deint)(INTFLOAT out[2][38][64], INTFLOAT (*in)[32][2],
|
||||
int i, int len);
|
||||
void (*decorrelate)(INTFLOAT (*out)[2], INTFLOAT (*delay)[2],
|
||||
INTFLOAT (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2],
|
||||
|
||||
@@ -228,7 +228,7 @@ av_cold void AAC_RENAME(ff_psdsp_init)(PSDSPContext *s)
|
||||
ff_psdsp_init_aarch64(s);
|
||||
#elif ARCH_RISCV
|
||||
ff_psdsp_init_riscv(s);
|
||||
#elif ARCH_X86 && HAVE_X86ASM
|
||||
#elif ARCH_X86
|
||||
ff_psdsp_init_x86(s);
|
||||
#endif
|
||||
#endif /* !USE_FIXED */
|
||||
|
||||
+32
-35
@@ -97,7 +97,7 @@ enum {
|
||||
#define AAC_BLOCK_SIZE_LONG 1024 ///< long block size
|
||||
#define AAC_BLOCK_SIZE_SHORT 128 ///< short block size
|
||||
#define AAC_NUM_BLOCKS_SHORT 8 ///< number of blocks in a short sequence
|
||||
#define PSY_LAME_NUM_SUBBLOCKS 2 ///< Number of sub-blocks in each short block
|
||||
#define PSY_LAME_NUM_SUBBLOCKS 3 ///< Number of sub-blocks in each short block
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -133,7 +133,6 @@ typedef struct AacPsyChannel{
|
||||
float attack_threshold; ///< attack threshold for this channel
|
||||
float prev_energy_subshort[AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS];
|
||||
int prev_attack; ///< attack value for the last short block in the previous sequence
|
||||
int next_attack0_zero; ///< whether attack[0] of the next frame is zero
|
||||
}AacPsyChannel;
|
||||
|
||||
/**
|
||||
@@ -182,19 +181,19 @@ typedef struct PsyLamePreset {
|
||||
static const PsyLamePreset psy_abr_map[] = {
|
||||
/* TODO: Tuning. These were taken from LAME. */
|
||||
/* kbps/ch st_lrm */
|
||||
{ 8, 7.60},
|
||||
{ 16, 7.60},
|
||||
{ 24, 7.60},
|
||||
{ 32, 7.60},
|
||||
{ 40, 7.60},
|
||||
{ 48, 7.60},
|
||||
{ 56, 7.60},
|
||||
{ 64, 7.40},
|
||||
{ 80, 7.00},
|
||||
{ 96, 6.60},
|
||||
{112, 6.20},
|
||||
{128, 6.20},
|
||||
{160, 6.20}
|
||||
{ 8, 6.60},
|
||||
{ 16, 6.60},
|
||||
{ 24, 6.60},
|
||||
{ 32, 6.60},
|
||||
{ 40, 6.60},
|
||||
{ 48, 6.60},
|
||||
{ 56, 6.60},
|
||||
{ 64, 6.40},
|
||||
{ 80, 6.00},
|
||||
{ 96, 5.60},
|
||||
{112, 5.20},
|
||||
{128, 5.20},
|
||||
{160, 5.20}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -403,7 +402,7 @@ static const uint8_t window_grouping[9] = {
|
||||
* Tell encoder which window types to use.
|
||||
* @see 3GPP TS26.403 5.4.1 "Blockswitching"
|
||||
*/
|
||||
av_unused static FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
|
||||
static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
|
||||
const int16_t *audio,
|
||||
const int16_t *la,
|
||||
int channel, int prev_type)
|
||||
@@ -901,8 +900,8 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
|
||||
/* Calculate the energies of each sub-shortblock */
|
||||
for (i = 0; i < PSY_LAME_NUM_SUBBLOCKS; i++) {
|
||||
energy_subshort[i] = pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 1) * PSY_LAME_NUM_SUBBLOCKS)];
|
||||
assert(pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 1) * PSY_LAME_NUM_SUBBLOCKS - 2)] > 0);
|
||||
attack_intensity[i] = energy_subshort[i] / pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 1) * PSY_LAME_NUM_SUBBLOCKS - 2)];
|
||||
assert(pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 2) * PSY_LAME_NUM_SUBBLOCKS + 1)] > 0);
|
||||
attack_intensity[i] = energy_subshort[i] / pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 2) * PSY_LAME_NUM_SUBBLOCKS + 1)];
|
||||
energy_short[0] += energy_subshort[i];
|
||||
}
|
||||
|
||||
@@ -913,15 +912,19 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
|
||||
p = FFMAX(p, fabsf(*pf));
|
||||
pch->prev_energy_subshort[i] = energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS] = p;
|
||||
energy_short[1 + i / PSY_LAME_NUM_SUBBLOCKS] += p;
|
||||
|
||||
/* NOTE: The indexes below are [i + 3 - 2] in the LAME source. Compare each sub-block to sub-block - 2 */
|
||||
if (p > energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS - 2])
|
||||
p = p / energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS - 2];
|
||||
else if (energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS - 2] > p * 10.0f)
|
||||
p = energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS - 2] / (p * 10.0f);
|
||||
/* NOTE: The indexes below are [i + 3 - 2] in the LAME source.
|
||||
* Obviously the 3 and 2 have some significance, or this would be just [i + 1]
|
||||
* (which is what we use here). What the 3 stands for is ambiguous, as it is both
|
||||
* number of short blocks, and the number of sub-short blocks.
|
||||
* It seems that LAME is comparing each sub-block to sub-block + 1 in the
|
||||
* previous block.
|
||||
*/
|
||||
if (p > energy_subshort[i + 1])
|
||||
p = p / energy_subshort[i + 1];
|
||||
else if (energy_subshort[i + 1] > p * 10.0f)
|
||||
p = energy_subshort[i + 1] / (p * 10.0f);
|
||||
else
|
||||
p = 0.0;
|
||||
|
||||
attack_intensity[i + PSY_LAME_NUM_SUBBLOCKS] = p;
|
||||
}
|
||||
|
||||
@@ -940,7 +943,7 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
|
||||
const float v = energy_short[i];
|
||||
const float m = FFMAX(u, v);
|
||||
if (m < 40000) { /* (2) */
|
||||
if (u < 2.3f * v && v < 2.3f * u) { /* (1) */
|
||||
if (u < 1.7f * v && v < 1.7f * u) { /* (1) */
|
||||
if (i == 1 && attacks[0] < attacks[i])
|
||||
attacks[0] = 0;
|
||||
attacks[i] = 0;
|
||||
@@ -949,18 +952,12 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
|
||||
att_sum += attacks[i];
|
||||
}
|
||||
|
||||
if (pch->next_attack0_zero)
|
||||
attacks[0] = 0;
|
||||
pch->next_attack0_zero = !attacks[AAC_NUM_BLOCKS_SHORT];
|
||||
|
||||
if (attacks[0] <= pch->prev_attack)
|
||||
attacks[0] = 0;
|
||||
|
||||
att_sum += attacks[0];
|
||||
|
||||
/* If the previous attack happened in the last sub-block of the previous sequence,
|
||||
* or if there's a new attack, use short window */
|
||||
if (pch->prev_attack == PSY_LAME_NUM_SUBBLOCKS || att_sum) {
|
||||
/* 3 below indicates the previous attack happened in the last sub-block of the previous sequence */
|
||||
if (pch->prev_attack == 3 || att_sum) {
|
||||
uselongblock = 0;
|
||||
|
||||
for (i = 1; i < AAC_NUM_BLOCKS_SHORT + 1; i++)
|
||||
@@ -1010,7 +1007,7 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
|
||||
}
|
||||
pch->next_grouping = window_grouping[grouping];
|
||||
|
||||
pch->prev_attack = attacks[AAC_NUM_BLOCKS_SHORT - 1];
|
||||
pch->prev_attack = attacks[8];
|
||||
|
||||
return wi;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user