@scrypted/libav 1.0.179 → 1.0.181

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/_openh264install/include/wels/codec_api.h +592 -0
  2. package/_openh264install/include/wels/codec_app_def.h +820 -0
  3. package/_openh264install/include/wels/codec_def.h +216 -0
  4. package/_openh264install/include/wels/codec_ver.h +15 -0
  5. package/_openh264install/lib/libopenh264.a +0 -0
  6. package/_openh264install/lib/pkgconfig/openh264.pc +10 -0
  7. package/binding.gyp +4 -0
  8. package/openh264/.reviewboardrc +3 -0
  9. package/openh264/.travis.yml +42 -0
  10. package/openh264/CODING_STYLE +8 -0
  11. package/openh264/CONTRIBUTORS +55 -0
  12. package/openh264/LICENSE +23 -0
  13. package/openh264/Makefile +408 -0
  14. package/openh264/README.md +197 -0
  15. package/openh264/RELEASES +467 -0
  16. package/openh264/SECURITY.md +16 -0
  17. package/openh264/autotest/codec_comparision/run_MultiCodecComparision.sh +431 -0
  18. package/openh264/autotest/performanceTest/android/run_AutoTest_android.sh +180 -0
  19. package/openh264/autotest/performanceTest/ios/fruitstrap +0 -0
  20. package/openh264/autotest/performanceTest/ios/iFileTransfer +0 -0
  21. package/openh264/autotest/performanceTest/ios/run_AutoTest_ios.sh +193 -0
  22. package/openh264/autotest/performanceTest/ios/uiascript.js +19 -0
  23. package/openh264/autotest/performanceTest/parsePerfData.sh +107 -0
  24. package/openh264/autotest/performanceTest/run_perfTest.sh +122 -0
  25. package/openh264/autotest/unitTest/android/run_AutoTest_android.sh +112 -0
  26. package/openh264/autotest/unitTest/ios/run_AutoTest_ios.sh +167 -0
  27. package/openh264/autotest/unitTest/run_ParseUTxml.sh +70 -0
  28. package/openh264/autotest/unitTest/run_unitTest.sh +98 -0
  29. package/openh264/build.gradle +30 -0
  30. package/openh264/code-coverage.sh +6 -0
  31. package/openh264/codec/api/meson.build +1 -0
  32. package/openh264/codec/api/wels/codec_api.h +592 -0
  33. package/openh264/codec/api/wels/codec_app_def.h +820 -0
  34. package/openh264/codec/api/wels/codec_def.h +216 -0
  35. package/openh264/codec/api/wels/codec_ver.h +15 -0
  36. package/openh264/codec/api/wels/meson.build +9 -0
  37. package/openh264/codec/common/arm/arm_arch_common_macro.S +83 -0
  38. package/openh264/codec/common/arm/copy_mb_neon.S +161 -0
  39. package/openh264/codec/common/arm/deblocking_neon.S +857 -0
  40. package/openh264/codec/common/arm/expand_picture_neon.S +154 -0
  41. package/openh264/codec/common/arm/intra_pred_common_neon.S +82 -0
  42. package/openh264/codec/common/arm/mc_neon.S +2283 -0
  43. package/openh264/codec/common/arm64/arm_aarch64_common.h +85 -0
  44. package/openh264/codec/common/arm64/arm_arch64_common_macro.S +79 -0
  45. package/openh264/codec/common/arm64/copy_mb_aarch64_neon.S +202 -0
  46. package/openh264/codec/common/arm64/deblocking_aarch64_neon.S +852 -0
  47. package/openh264/codec/common/arm64/expand_picture_aarch64_neon.S +150 -0
  48. package/openh264/codec/common/arm64/intra_pred_common_aarch64_neon.S +58 -0
  49. package/openh264/codec/common/arm64/mc_aarch64_neon.S +2614 -0
  50. package/openh264/codec/common/generate_version.sh +28 -0
  51. package/openh264/codec/common/inc/WelsList.h +287 -0
  52. package/openh264/codec/common/inc/WelsLock.h +97 -0
  53. package/openh264/codec/common/inc/WelsTask.h +75 -0
  54. package/openh264/codec/common/inc/WelsTaskThread.h +83 -0
  55. package/openh264/codec/common/inc/WelsThread.h +106 -0
  56. package/openh264/codec/common/inc/WelsThreadLib.h +151 -0
  57. package/openh264/codec/common/inc/WelsThreadPool.h +124 -0
  58. package/openh264/codec/common/inc/asmdefs_mmi.h +345 -0
  59. package/openh264/codec/common/inc/copy_mb.h +103 -0
  60. package/openh264/codec/common/inc/cpu.h +81 -0
  61. package/openh264/codec/common/inc/cpu_core.h +103 -0
  62. package/openh264/codec/common/inc/crt_util_safe_x.h +104 -0
  63. package/openh264/codec/common/inc/deblocking_common.h +124 -0
  64. package/openh264/codec/common/inc/expand_pic.h +107 -0
  65. package/openh264/codec/common/inc/golomb_common.h +166 -0
  66. package/openh264/codec/common/inc/intra_pred_common.h +86 -0
  67. package/openh264/codec/common/inc/loongson_intrinsics.h +1919 -0
  68. package/openh264/codec/common/inc/ls_defines.h +130 -0
  69. package/openh264/codec/common/inc/macros.h +329 -0
  70. package/openh264/codec/common/inc/mc.h +407 -0
  71. package/openh264/codec/common/inc/measure_time.h +88 -0
  72. package/openh264/codec/common/inc/memory_align.h +116 -0
  73. package/openh264/codec/common/inc/msa_macros.h +2393 -0
  74. package/openh264/codec/common/inc/sad_common.h +139 -0
  75. package/openh264/codec/common/inc/typedefs.h +86 -0
  76. package/openh264/codec/common/inc/utils.h +95 -0
  77. package/openh264/codec/common/inc/version.h +10 -0
  78. package/openh264/codec/common/inc/version_gen.h.template +6 -0
  79. package/openh264/codec/common/inc/welsCodecTrace.h +64 -0
  80. package/openh264/codec/common/inc/wels_common_defs.h +373 -0
  81. package/openh264/codec/common/inc/wels_const_common.h +63 -0
  82. package/openh264/codec/common/loongarch/copy_mb_lsx.c +194 -0
  83. package/openh264/codec/common/loongarch/deblock_lsx.c +1489 -0
  84. package/openh264/codec/common/loongarch/intra_pred_com_lasx.c +112 -0
  85. package/openh264/codec/common/loongarch/intra_pred_com_lsx.c +91 -0
  86. package/openh264/codec/common/loongarch/mc_chroma_lsx.c +192 -0
  87. package/openh264/codec/common/loongarch/mc_horver_lsx.c +654 -0
  88. package/openh264/codec/common/loongarch/satd_sad_lasx.c +568 -0
  89. package/openh264/codec/common/meson.build +84 -0
  90. package/openh264/codec/common/mips/copy_mb_mmi.c +477 -0
  91. package/openh264/codec/common/mips/copy_mb_msa.c +80 -0
  92. package/openh264/codec/common/mips/deblock_mmi.c +2826 -0
  93. package/openh264/codec/common/mips/deblock_msa.c +1024 -0
  94. package/openh264/codec/common/mips/expand_picture_mmi.c +673 -0
  95. package/openh264/codec/common/mips/intra_pred_com_mmi.c +548 -0
  96. package/openh264/codec/common/mips/satd_sad_mmi.c +2154 -0
  97. package/openh264/codec/common/targets.mk +136 -0
  98. package/openh264/codec/common/x86/asm_inc.asm +743 -0
  99. package/openh264/codec/common/x86/cpuid.asm +263 -0
  100. package/openh264/codec/common/x86/dct.asm +1036 -0
  101. package/openh264/codec/common/x86/deblock.asm +848 -0
  102. package/openh264/codec/common/x86/expand_picture.asm +728 -0
  103. package/openh264/codec/common/x86/intra_pred_com.asm +117 -0
  104. package/openh264/codec/common/x86/mb_copy.asm +615 -0
  105. package/openh264/codec/common/x86/mc_chroma.asm +313 -0
  106. package/openh264/codec/common/x86/mc_luma.asm +4490 -0
  107. package/openh264/codec/common/x86/satd_sad.asm +2734 -0
  108. package/openh264/codec/common/x86/vaa.asm +411 -0
  109. package/openh264/codec/console/common/inc/read_config.h +68 -0
  110. package/openh264/codec/console/common/meson.build +12 -0
  111. package/openh264/codec/console/common/targets.mk +20 -0
  112. package/openh264/codec/console/dec/inc/d3d9_utils.h +148 -0
  113. package/openh264/codec/console/dec/meson.build +15 -0
  114. package/openh264/codec/console/dec/targets.mk +20 -0
  115. package/openh264/codec/console/enc/meson.build +9 -0
  116. package/openh264/codec/console/enc/targets.mk +19 -0
  117. package/openh264/codec/console/meson.build +3 -0
  118. package/openh264/codec/decoder/core/arm/block_add_neon.S +129 -0
  119. package/openh264/codec/decoder/core/arm/intra_pred_neon.S +635 -0
  120. package/openh264/codec/decoder/core/arm64/block_add_aarch64_neon.S +131 -0
  121. package/openh264/codec/decoder/core/arm64/intra_pred_aarch64_neon.S +524 -0
  122. package/openh264/codec/decoder/core/inc/au_parser.h +199 -0
  123. package/openh264/codec/decoder/core/inc/bit_stream.h +62 -0
  124. package/openh264/codec/decoder/core/inc/cabac_decoder.h +111 -0
  125. package/openh264/codec/decoder/core/inc/deblocking.h +118 -0
  126. package/openh264/codec/decoder/core/inc/dec_frame.h +156 -0
  127. package/openh264/codec/decoder/core/inc/dec_golomb.h +344 -0
  128. package/openh264/codec/decoder/core/inc/decode_mb_aux.h +83 -0
  129. package/openh264/codec/decoder/core/inc/decode_slice.h +104 -0
  130. package/openh264/codec/decoder/core/inc/decoder.h +186 -0
  131. package/openh264/codec/decoder/core/inc/decoder_context.h +590 -0
  132. package/openh264/codec/decoder/core/inc/decoder_core.h +206 -0
  133. package/openh264/codec/decoder/core/inc/error_code.h +222 -0
  134. package/openh264/codec/decoder/core/inc/error_concealment.h +68 -0
  135. package/openh264/codec/decoder/core/inc/fmo.h +114 -0
  136. package/openh264/codec/decoder/core/inc/get_intra_predictor.h +191 -0
  137. package/openh264/codec/decoder/core/inc/manage_dec_ref.h +62 -0
  138. package/openh264/codec/decoder/core/inc/mb_cache.h +80 -0
  139. package/openh264/codec/decoder/core/inc/memmgr_nal_unit.h +66 -0
  140. package/openh264/codec/decoder/core/inc/mv_pred.h +195 -0
  141. package/openh264/codec/decoder/core/inc/nal_prefix.h +56 -0
  142. package/openh264/codec/decoder/core/inc/nalu.h +79 -0
  143. package/openh264/codec/decoder/core/inc/parameter_sets.h +217 -0
  144. package/openh264/codec/decoder/core/inc/parse_mb_syn_cabac.h +89 -0
  145. package/openh264/codec/decoder/core/inc/parse_mb_syn_cavlc.h +137 -0
  146. package/openh264/codec/decoder/core/inc/pic_queue.h +62 -0
  147. package/openh264/codec/decoder/core/inc/picture.h +112 -0
  148. package/openh264/codec/decoder/core/inc/rec_mb.h +104 -0
  149. package/openh264/codec/decoder/core/inc/slice.h +208 -0
  150. package/openh264/codec/decoder/core/inc/vlc_decoder.h +177 -0
  151. package/openh264/codec/decoder/core/inc/wels_common_basis.h +317 -0
  152. package/openh264/codec/decoder/core/inc/wels_const.h +65 -0
  153. package/openh264/codec/decoder/core/inc/wels_decoder_thread.h +170 -0
  154. package/openh264/codec/decoder/core/loongarch/mb_aux_lsx.c +296 -0
  155. package/openh264/codec/decoder/core/mips/dct_mmi.c +786 -0
  156. package/openh264/codec/decoder/core/x86/dct.asm +72 -0
  157. package/openh264/codec/decoder/core/x86/intra_pred.asm +1456 -0
  158. package/openh264/codec/decoder/meson.build +69 -0
  159. package/openh264/codec/decoder/plus/inc/welsDecoderExt.h +170 -0
  160. package/openh264/codec/decoder/targets.mk +115 -0
  161. package/openh264/codec/encoder/core/arm/intra_pred_neon.S +589 -0
  162. package/openh264/codec/encoder/core/arm/intra_pred_sad_3_opt_neon.S +735 -0
  163. package/openh264/codec/encoder/core/arm/memory_neon.S +62 -0
  164. package/openh264/codec/encoder/core/arm/pixel_neon.S +882 -0
  165. package/openh264/codec/encoder/core/arm/reconstruct_neon.S +903 -0
  166. package/openh264/codec/encoder/core/arm/svc_motion_estimation.S +366 -0
  167. package/openh264/codec/encoder/core/arm64/intra_pred_aarch64_neon.S +505 -0
  168. package/openh264/codec/encoder/core/arm64/intra_pred_sad_3_opt_aarch64_neon.S +611 -0
  169. package/openh264/codec/encoder/core/arm64/memory_aarch64_neon.S +63 -0
  170. package/openh264/codec/encoder/core/arm64/pixel_aarch64_neon.S +621 -0
  171. package/openh264/codec/encoder/core/arm64/reconstruct_aarch64_neon.S +717 -0
  172. package/openh264/codec/encoder/core/arm64/svc_motion_estimation_aarch64_neon.S +350 -0
  173. package/openh264/codec/encoder/core/inc/as264_common.h +138 -0
  174. package/openh264/codec/encoder/core/inc/au_set.h +152 -0
  175. package/openh264/codec/encoder/core/inc/deblocking.h +92 -0
  176. package/openh264/codec/encoder/core/inc/decode_mb_aux.h +112 -0
  177. package/openh264/codec/encoder/core/inc/dq_map.h +58 -0
  178. package/openh264/codec/encoder/core/inc/encode_mb_aux.h +199 -0
  179. package/openh264/codec/encoder/core/inc/encoder.h +148 -0
  180. package/openh264/codec/encoder/core/inc/encoder_context.h +240 -0
  181. package/openh264/codec/encoder/core/inc/extern.h +124 -0
  182. package/openh264/codec/encoder/core/inc/get_intra_predictor.h +186 -0
  183. package/openh264/codec/encoder/core/inc/mb_cache.h +141 -0
  184. package/openh264/codec/encoder/core/inc/md.h +181 -0
  185. package/openh264/codec/encoder/core/inc/mt_defs.h +91 -0
  186. package/openh264/codec/encoder/core/inc/mv_pred.h +191 -0
  187. package/openh264/codec/encoder/core/inc/nal_encap.h +143 -0
  188. package/openh264/codec/encoder/core/inc/param_svc.h +576 -0
  189. package/openh264/codec/encoder/core/inc/parameter_sets.h +181 -0
  190. package/openh264/codec/encoder/core/inc/paraset_strategy.h +310 -0
  191. package/openh264/codec/encoder/core/inc/picture.h +137 -0
  192. package/openh264/codec/encoder/core/inc/picture_handle.h +66 -0
  193. package/openh264/codec/encoder/core/inc/rc.h +284 -0
  194. package/openh264/codec/encoder/core/inc/ref_list_mgr_svc.h +148 -0
  195. package/openh264/codec/encoder/core/inc/sample.h +154 -0
  196. package/openh264/codec/encoder/core/inc/set_mb_syn_cabac.h +127 -0
  197. package/openh264/codec/encoder/core/inc/set_mb_syn_cavlc.h +92 -0
  198. package/openh264/codec/encoder/core/inc/slice.h +212 -0
  199. package/openh264/codec/encoder/core/inc/slice_multi_threading.h +97 -0
  200. package/openh264/codec/encoder/core/inc/stat.h +102 -0
  201. package/openh264/codec/encoder/core/inc/svc_base_layer_md.h +102 -0
  202. package/openh264/codec/encoder/core/inc/svc_enc_frame.h +136 -0
  203. package/openh264/codec/encoder/core/inc/svc_enc_golomb.h +123 -0
  204. package/openh264/codec/encoder/core/inc/svc_enc_macroblock.h +82 -0
  205. package/openh264/codec/encoder/core/inc/svc_enc_slice_segment.h +212 -0
  206. package/openh264/codec/encoder/core/inc/svc_encode_mb.h +63 -0
  207. package/openh264/codec/encoder/core/inc/svc_encode_slice.h +184 -0
  208. package/openh264/codec/encoder/core/inc/svc_mode_decision.h +94 -0
  209. package/openh264/codec/encoder/core/inc/svc_motion_estimate.h +369 -0
  210. package/openh264/codec/encoder/core/inc/svc_set_mb_syn.h +70 -0
  211. package/openh264/codec/encoder/core/inc/svc_set_mb_syn_cavlc.h +67 -0
  212. package/openh264/codec/encoder/core/inc/vlc_encoder.h +92 -0
  213. package/openh264/codec/encoder/core/inc/wels_common_basis.h +160 -0
  214. package/openh264/codec/encoder/core/inc/wels_const.h +174 -0
  215. package/openh264/codec/encoder/core/inc/wels_func_ptr_def.h +300 -0
  216. package/openh264/codec/encoder/core/inc/wels_preprocess.h +251 -0
  217. package/openh264/codec/encoder/core/inc/wels_task_base.h +79 -0
  218. package/openh264/codec/encoder/core/inc/wels_task_encoder.h +142 -0
  219. package/openh264/codec/encoder/core/inc/wels_task_management.h +135 -0
  220. package/openh264/codec/encoder/core/inc/wels_transpose_matrix.h +58 -0
  221. package/openh264/codec/encoder/core/loongarch/dct_lasx.c +452 -0
  222. package/openh264/codec/encoder/core/loongarch/get_intra_predictor_lsx.c +166 -0
  223. package/openh264/codec/encoder/core/loongarch/quant_lsx.c +153 -0
  224. package/openh264/codec/encoder/core/loongarch/sample_lasx.c +87 -0
  225. package/openh264/codec/encoder/core/loongarch/svc_motion_estimate_lsx.c +104 -0
  226. package/openh264/codec/encoder/core/mips/dct_mmi.c +529 -0
  227. package/openh264/codec/encoder/core/mips/quant_mmi.c +553 -0
  228. package/openh264/codec/encoder/core/mips/score_mmi.c +324 -0
  229. package/openh264/codec/encoder/core/x86/coeff.asm +695 -0
  230. package/openh264/codec/encoder/core/x86/dct.asm +108 -0
  231. package/openh264/codec/encoder/core/x86/intra_pred.asm +1129 -0
  232. package/openh264/codec/encoder/core/x86/matrix_transpose.asm +395 -0
  233. package/openh264/codec/encoder/core/x86/memzero.asm +132 -0
  234. package/openh264/codec/encoder/core/x86/quant.asm +507 -0
  235. package/openh264/codec/encoder/core/x86/sample_sc.asm +1829 -0
  236. package/openh264/codec/encoder/core/x86/score.asm +363 -0
  237. package/openh264/codec/encoder/meson.build +98 -0
  238. package/openh264/codec/encoder/plus/inc/welsEncoderExt.h +129 -0
  239. package/openh264/codec/encoder/targets.mk +146 -0
  240. package/openh264/codec/meson.build +9 -0
  241. package/openh264/codec/processing/interface/IWelsVP.h +310 -0
  242. package/openh264/codec/processing/meson.build +71 -0
  243. package/openh264/codec/processing/targets.mk +117 -0
  244. package/openh264/docs/doxygen/Doxyfile +1865 -0
  245. package/openh264/docs/doxygen/Home.rest +25 -0
  246. package/openh264/docs/doxygen/ISVCDecoder.rest +19 -0
  247. package/openh264/docs/doxygen/ISVCEncoder.rest +16 -0
  248. package/openh264/docs/doxygen/UsageExampleForDecoder.rest +10 -0
  249. package/openh264/docs/doxygen/UsageExampleForEncoder.rest +15 -0
  250. package/openh264/docs/doxygen2rst.py +619 -0
  251. package/openh264/gmpopenh264.info +4 -0
  252. package/openh264/gradlew +172 -0
  253. package/openh264/meson.build +218 -0
  254. package/openh264/meson_options.txt +1 -0
  255. package/openh264/module/RefCounted.h +141 -0
  256. package/openh264/module/gmp-openh264.cpp +1196 -0
  257. package/openh264/module/targets.mk +14 -0
  258. package/openh264/module/task_utils.h +38 -0
  259. package/openh264/module/task_utils.py +207 -0
  260. package/openh264/module/task_utils_generated.h +2087 -0
  261. package/openh264/openh264.def +7 -0
  262. package/openh264/openh264.pc.in +10 -0
  263. package/openh264/openh264.rc +61 -0
  264. package/openh264/openh264.rc.template +61 -0
  265. package/openh264/res/Adobe_PDF_sample_a_1024x768_50Frms.264 +0 -0
  266. package/openh264/res/BA1_FT_C.264 +0 -0
  267. package/openh264/res/BA1_Sony_D.jsv +0 -0
  268. package/openh264/res/BAMQ1_JVC_C.264 +0 -0
  269. package/openh264/res/BAMQ2_JVC_C.264 +0 -0
  270. package/openh264/res/BANM_MW_D.264 +0 -0
  271. package/openh264/res/BASQP1_Sony_C.jsv +0 -0
  272. package/openh264/res/BA_MW_D.264 +0 -0
  273. package/openh264/res/BA_MW_D_IDR_LOST.264 +0 -0
  274. package/openh264/res/BA_MW_D_P_LOST.264 +0 -0
  275. package/openh264/res/CI1_FT_B.264 +0 -0
  276. package/openh264/res/CI_MW_D.264 +0 -0
  277. package/openh264/res/CVFC1_Sony_C.jsv +0 -0
  278. package/openh264/res/CVPCMNL1_SVA_C.264 +0 -0
  279. package/openh264/res/CiscoVT2people_160x96_6fps.yuv +1 -0
  280. package/openh264/res/CiscoVT2people_320x192_12fps.yuv +1 -0
  281. package/openh264/res/Cisco_Absolute_Power_1280x720_30fps.yuv +3607 -0
  282. package/openh264/res/Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9.264 +0 -0
  283. package/openh264/res/Cisco_Men_whisper_640x320_CABAC_Bframe_9.264 +0 -0
  284. package/openh264/res/Cisco_Men_whisper_640x320_CAVLC_Bframe_9.264 +0 -0
  285. package/openh264/res/Error_I_P.264 +0 -0
  286. package/openh264/res/LS_SVA_D.264 +0 -0
  287. package/openh264/res/MIDR_MW_D.264 +0 -0
  288. package/openh264/res/MPS_MW_A.264 +0 -0
  289. package/openh264/res/MR1_BT_A.h264 +0 -0
  290. package/openh264/res/MR1_MW_A.264 +0 -0
  291. package/openh264/res/MR2_MW_A.264 +0 -0
  292. package/openh264/res/MR2_TANDBERG_E.264 +0 -0
  293. package/openh264/res/NL1_Sony_D.jsv +0 -0
  294. package/openh264/res/NLMQ1_JVC_C.264 +0 -0
  295. package/openh264/res/NLMQ2_JVC_C.264 +0 -0
  296. package/openh264/res/NRF_MW_E.264 +0 -0
  297. package/openh264/res/QCIF_2P_I_allIPCM.264 +0 -0
  298. package/openh264/res/SVA_BA1_B.264 +0 -0
  299. package/openh264/res/SVA_BA2_D.264 +0 -0
  300. package/openh264/res/SVA_Base_B.264 +0 -0
  301. package/openh264/res/SVA_CL1_E.264 +0 -0
  302. package/openh264/res/SVA_FM1_E.264 +0 -0
  303. package/openh264/res/SVA_NL1_B.264 +0 -0
  304. package/openh264/res/SVA_NL2_E.264 +0 -0
  305. package/openh264/res/SarVui.264 +0 -0
  306. package/openh264/res/Static.264 +0 -0
  307. package/openh264/res/Static_152_100.yuv +1 -0
  308. package/openh264/res/VID_1280x544_cabac_temporal_direct.264 +0 -0
  309. package/openh264/res/VID_1280x544_cavlc_temporal_direct.264 +0 -0
  310. package/openh264/res/VID_1280x720_cabac_temporal_direct.264 +0 -0
  311. package/openh264/res/VID_1280x720_cavlc_temporal_direct.264 +0 -0
  312. package/openh264/res/VID_1920x1080_cabac_temporal_direct.264 +0 -0
  313. package/openh264/res/VID_1920x1080_cavlc_temporal_direct.264 +0 -0
  314. package/openh264/res/Zhling_1280x720.264 +0 -0
  315. package/openh264/res/jm_1080p_allslice.264 +0 -0
  316. package/openh264/res/sps_subsetsps_bothVUI.264 +0 -0
  317. package/openh264/res/test_cif_I_CABAC_PCM.264 +0 -0
  318. package/openh264/res/test_cif_I_CABAC_slice.264 +0 -0
  319. package/openh264/res/test_cif_P_CABAC_slice.264 +0 -0
  320. package/openh264/res/test_qcif_cabac.264 +0 -0
  321. package/openh264/res/test_scalinglist_jm.264 +0 -0
  322. package/openh264/res/test_vd_1d.264 +0 -0
  323. package/openh264/res/test_vd_rc.264 +0 -0
  324. package/openh264/run_Test.sh +91 -0
  325. package/openh264/settings.gradle +4 -0
  326. package/openh264/subprojects/gtest.wrap +10 -0
  327. package/openh264/testbin/AutoBuild_Windows_VS2008.bat +59 -0
  328. package/openh264/testbin/CmdLineExample.sh +7 -0
  329. package/openh264/testbin/CmdLineReadMe +22 -0
  330. package/openh264/testbin/layer2.cfg +37 -0
  331. package/openh264/testbin/layer2_arbitrary_res.cfg +37 -0
  332. package/openh264/testbin/layer2_vd.cfg +38 -0
  333. package/openh264/testbin/layer2_vd_rc.cfg +38 -0
  334. package/openh264/testbin/welsenc.cfg +71 -0
  335. package/openh264/testbin/welsenc_arbitrary_res.cfg +70 -0
  336. package/openh264/testbin/welsenc_ios.cfg +71 -0
  337. package/openh264/testbin/welsenc_vd_1d.cfg +70 -0
  338. package/openh264/testbin/welsenc_vd_rc.cfg +69 -0
  339. package/openh264/ut.def +2 -0
  340. package/package.json +1 -1
@@ -0,0 +1,820 @@
1
+ /*!
2
+ * \copy
3
+ * Copyright (c) 2013, Cisco Systems
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without
7
+ * modification, are permitted provided that the following conditions
8
+ * are met:
9
+ *
10
+ * * Redistributions of source code must retain the above copyright
11
+ * notice, this list of conditions and the following disclaimer.
12
+ *
13
+ * * Redistributions in binary form must reproduce the above copyright
14
+ * notice, this list of conditions and the following disclaimer in
15
+ * the documentation and/or other materials provided with the
16
+ * distribution.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
+ * POSSIBILITY OF SUCH DAMAGE.
30
+ *
31
+ */
32
+
33
+
34
+
35
+ #ifndef WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
36
+ #define WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
37
+ /**
38
+ * @file codec_app_def.h
39
+ * @brief Data and /or structures introduced in Cisco OpenH264 application
40
+ */
41
+
42
+ #include "codec_def.h"
43
+ /* Constants */
44
+ #define MAX_TEMPORAL_LAYER_NUM 4
45
+ #define MAX_SPATIAL_LAYER_NUM 4
46
+ #define MAX_QUALITY_LAYER_NUM 4
47
+
48
+ #define MAX_LAYER_NUM_OF_FRAME 128
49
+ #define MAX_NAL_UNITS_IN_LAYER 128 ///< predetermined here, adjust it later if need
50
+
51
+ #define MAX_RTP_PAYLOAD_LEN 1000
52
+ #define AVERAGE_RTP_PAYLOAD_LEN 800
53
+
54
+
55
+ #define SAVED_NALUNIT_NUM_TMP ( (MAX_SPATIAL_LAYER_NUM*MAX_QUALITY_LAYER_NUM) + 1 + MAX_SPATIAL_LAYER_NUM ) ///< SPS/PPS + SEI/SSEI + PADDING_NAL
56
+ #define MAX_SLICES_NUM_TMP ( ( MAX_NAL_UNITS_IN_LAYER - SAVED_NALUNIT_NUM_TMP ) / 3 )
57
+
58
+
59
+ #define AUTO_REF_PIC_COUNT -1 ///< encoder selects the number of reference frame automatically
60
+ #define UNSPECIFIED_BIT_RATE 0 ///< to do: add detail comment
61
+
62
+ /**
63
+ * @brief Struct of OpenH264 version
64
+ */
65
+ ///
66
+ /// E.g. SDK version is 1.2.0.0, major version number is 1, minor version number is 2, and revision number is 0.
67
+ typedef struct _tagVersion {
68
+ unsigned int uMajor; ///< The major version number
69
+ unsigned int uMinor; ///< The minor version number
70
+ unsigned int uRevision; ///< The revision number
71
+ unsigned int uReserved; ///< The reserved number, it should be 0.
72
+ } OpenH264Version;
73
+
74
+ /**
75
+ * @brief Decoding status
76
+ */
77
+ typedef enum {
78
+ /**
79
+ * Errors derived from bitstream parsing
80
+ */
81
+ dsErrorFree = 0x00, ///< bit stream error-free
82
+ dsFramePending = 0x01, ///< need more throughput to generate a frame output,
83
+ dsRefLost = 0x02, ///< layer lost at reference frame with temporal id 0
84
+ dsBitstreamError = 0x04, ///< error bitstreams(maybe broken internal frame) the decoder cared
85
+ dsDepLayerLost = 0x08, ///< dependented layer is ever lost
86
+ dsNoParamSets = 0x10, ///< no parameter set NALs involved
87
+ dsDataErrorConcealed = 0x20, ///< current data error concealed specified
88
+ dsRefListNullPtrs = 0x40, ///<ref picure list contains null ptrs within uiRefCount range
89
+
90
+ /**
91
+ * Errors derived from logic level
92
+ */
93
+ dsInvalidArgument = 0x1000, ///< invalid argument specified
94
+ dsInitialOptExpected = 0x2000, ///< initializing operation is expected
95
+ dsOutOfMemory = 0x4000, ///< out of memory due to new request
96
+ /**
97
+ * ANY OTHERS?
98
+ */
99
+ dsDstBufNeedExpan = 0x8000 ///< actual picture size exceeds size of dst pBuffer feed in decoder, so need expand its size
100
+
101
+ } DECODING_STATE;
102
+
103
+ /**
104
+ * @brief Option types introduced in SVC encoder application
105
+ */
106
+ typedef enum {
107
+ ENCODER_OPTION_DATAFORMAT = 0,
108
+ ENCODER_OPTION_IDR_INTERVAL, ///< IDR period,0/-1 means no Intra period (only the first frame); lager than 0 means the desired IDR period, must be multiple of (2^temporal_layer)
109
+ ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, ///< structure of Base Param
110
+ ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, ///< structure of Extension Param
111
+ ENCODER_OPTION_FRAME_RATE, ///< maximal input frame rate, current supported range: MAX_FRAME_RATE = 30,MIN_FRAME_RATE = 1
112
+ ENCODER_OPTION_BITRATE,
113
+ ENCODER_OPTION_MAX_BITRATE,
114
+ ENCODER_OPTION_INTER_SPATIAL_PRED,
115
+ ENCODER_OPTION_RC_MODE,
116
+ ENCODER_OPTION_RC_FRAME_SKIP,
117
+ ENCODER_PADDING_PADDING, ///< 0:disable padding;1:padding
118
+
119
+ ENCODER_OPTION_PROFILE, ///< assgin the profile for each layer
120
+ ENCODER_OPTION_LEVEL, ///< assgin the level for each layer
121
+ ENCODER_OPTION_NUMBER_REF, ///< the number of refererence frame
122
+ ENCODER_OPTION_DELIVERY_STATUS, ///< the delivery info which is a feedback from app level
123
+
124
+ ENCODER_LTR_RECOVERY_REQUEST,
125
+ ENCODER_LTR_MARKING_FEEDBACK,
126
+ ENCODER_LTR_MARKING_PERIOD,
127
+ ENCODER_OPTION_LTR, ///< 0:disable LTR;larger than 0 enable LTR; LTR number is fixed to be 2 in current encoder
128
+ ENCODER_OPTION_COMPLEXITY,
129
+
130
+ ENCODER_OPTION_ENABLE_SSEI, ///< enable SSEI: true--enable ssei; false--disable ssei
131
+ ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, ///< enable prefix: true--enable prefix; false--disable prefix
132
+ ENCODER_OPTION_SPS_PPS_ID_STRATEGY, ///< different stategy in adjust ID in SPS/PPS: 0- constant ID, 1-additional ID, 6-mapping and additional
133
+
134
+ ENCODER_OPTION_CURRENT_PATH,
135
+ ENCODER_OPTION_DUMP_FILE, ///< dump layer reconstruct frame to a specified file
136
+ ENCODER_OPTION_TRACE_LEVEL, ///< trace info based on the trace level
137
+ ENCODER_OPTION_TRACE_CALLBACK, ///< a void (*)(void* context, int level, const char* message) function which receives log messages
138
+ ENCODER_OPTION_TRACE_CALLBACK_CONTEXT, ///< context info of trace callback
139
+
140
+ ENCODER_OPTION_GET_STATISTICS, ///< read only
141
+ ENCODER_OPTION_STATISTICS_LOG_INTERVAL, ///< log interval in millisecond
142
+
143
+ ENCODER_OPTION_IS_LOSSLESS_LINK, ///< advanced algorithmetic settings
144
+
145
+ ENCODER_OPTION_BITS_VARY_PERCENTAGE ///< bit vary percentage
146
+ } ENCODER_OPTION;
147
+
148
+ /**
149
+ * @brief Option types introduced in decoder application
150
+ */
151
+ typedef enum {
152
+ DECODER_OPTION_END_OF_STREAM = 1, ///< end of stream flag
153
+ DECODER_OPTION_VCL_NAL, ///< feedback whether or not have VCL NAL in current AU for application layer
154
+ DECODER_OPTION_TEMPORAL_ID, ///< feedback temporal id for application layer
155
+ DECODER_OPTION_FRAME_NUM, ///< feedback current decoded frame number
156
+ DECODER_OPTION_IDR_PIC_ID, ///< feedback current frame belong to which IDR period
157
+ DECODER_OPTION_LTR_MARKING_FLAG, ///< feedback wether current frame mark a LTR
158
+ DECODER_OPTION_LTR_MARKED_FRAME_NUM, ///< feedback frame num marked by current Frame
159
+ DECODER_OPTION_ERROR_CON_IDC, ///< indicate decoder error concealment method
160
+ DECODER_OPTION_TRACE_LEVEL,
161
+ DECODER_OPTION_TRACE_CALLBACK, ///< a void (*)(void* context, int level, const char* message) function which receives log messages
162
+ DECODER_OPTION_TRACE_CALLBACK_CONTEXT,///< context info of trace callbac
163
+
164
+ DECODER_OPTION_GET_STATISTICS, ///< feedback decoder statistics
165
+ DECODER_OPTION_GET_SAR_INFO, ///< feedback decoder Sample Aspect Ratio info in Vui
166
+ DECODER_OPTION_PROFILE, ///< get current AU profile info, only is used in GetOption
167
+ DECODER_OPTION_LEVEL, ///< get current AU level info,only is used in GetOption
168
+ DECODER_OPTION_STATISTICS_LOG_INTERVAL,///< set log output interval
169
+ DECODER_OPTION_IS_REF_PIC, ///< feedback current frame is ref pic or not
170
+ DECODER_OPTION_NUM_OF_FRAMES_REMAINING_IN_BUFFER, ///< number of frames remaining in decoder buffer when pictures are required to re-ordered into display-order.
171
+ DECODER_OPTION_NUM_OF_THREADS, ///< number of decoding threads. The maximum thread count is equal or less than lesser of (cpu core counts and 16).
172
+ } DECODER_OPTION;
173
+
174
+ /**
175
+ * @brief Enumerate the type of error concealment methods
176
+ */
177
+ typedef enum {
178
+ ERROR_CON_DISABLE = 0,
179
+ ERROR_CON_FRAME_COPY,
180
+ ERROR_CON_SLICE_COPY,
181
+ ERROR_CON_FRAME_COPY_CROSS_IDR,
182
+ ERROR_CON_SLICE_COPY_CROSS_IDR,
183
+ ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE,
184
+ ERROR_CON_SLICE_MV_COPY_CROSS_IDR,
185
+ ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE
186
+ } ERROR_CON_IDC;
187
+ /**
188
+ * @brief Feedback that whether or not have VCL NAL in current AU
189
+ */
190
+ typedef enum {
191
+ FEEDBACK_NON_VCL_NAL = 0,
192
+ FEEDBACK_VCL_NAL,
193
+ FEEDBACK_UNKNOWN_NAL
194
+ } FEEDBACK_VCL_NAL_IN_AU;
195
+
196
+ /**
197
+ * @brief Type of layer being encoded
198
+ */
199
+ typedef enum {
200
+ NON_VIDEO_CODING_LAYER = 0,
201
+ VIDEO_CODING_LAYER = 1
202
+ } LAYER_TYPE;
203
+
204
+ /**
205
+ * @brief Spatial layer num
206
+ */
207
+ typedef enum {
208
+ SPATIAL_LAYER_0 = 0,
209
+ SPATIAL_LAYER_1 = 1,
210
+ SPATIAL_LAYER_2 = 2,
211
+ SPATIAL_LAYER_3 = 3,
212
+ SPATIAL_LAYER_ALL = 4
213
+ } LAYER_NUM;
214
+
215
+ /**
216
+ * @brief Enumerate the type of video bitstream which is provided to decoder
217
+ */
218
+ typedef enum {
219
+ VIDEO_BITSTREAM_AVC = 0,
220
+ VIDEO_BITSTREAM_SVC = 1,
221
+ VIDEO_BITSTREAM_DEFAULT = VIDEO_BITSTREAM_SVC
222
+ } VIDEO_BITSTREAM_TYPE;
223
+
224
+ /**
225
+ * @brief Enumerate the type of key frame request
226
+ */
227
+ typedef enum {
228
+ NO_RECOVERY_REQUSET = 0,
229
+ LTR_RECOVERY_REQUEST = 1,
230
+ IDR_RECOVERY_REQUEST = 2,
231
+ NO_LTR_MARKING_FEEDBACK = 3,
232
+ LTR_MARKING_SUCCESS = 4,
233
+ LTR_MARKING_FAILED = 5
234
+ } KEY_FRAME_REQUEST_TYPE;
235
+
236
+ /**
237
+ * @brief Structure for LTR recover request
238
+ */
239
+ typedef struct {
240
+ unsigned int uiFeedbackType; ///< IDR request or LTR recovery request
241
+ unsigned int uiIDRPicId; ///< distinguish request from different IDR
242
+ int iLastCorrectFrameNum;
243
+ int iCurrentFrameNum; ///< specify current decoder frame_num.
244
+ int iLayerId; //specify the layer for recovery request
245
+ } SLTRRecoverRequest;
246
+
247
+ /**
248
+ * @brief Structure for LTR marking feedback
249
+ */
250
+ typedef struct {
251
+ unsigned int uiFeedbackType; ///< mark failed or successful
252
+ unsigned int uiIDRPicId; ///< distinguish request from different IDR
253
+ int iLTRFrameNum; ///< specify current decoder frame_num
254
+ int iLayerId; //specify the layer for LTR marking feedback
255
+ } SLTRMarkingFeedback;
256
+
257
+ /**
258
+ * @brief Structure for LTR configuration
259
+ */
260
+ typedef struct {
261
+ bool bEnableLongTermReference; ///< 1: on, 0: off
262
+ int iLTRRefNum; ///< TODO: not supported to set it arbitrary yet
263
+ } SLTRConfig;
264
+
265
+ /**
266
+ * @brief Enumerate the type of rate control mode
267
+ */
268
+ typedef enum {
269
+ RC_QUALITY_MODE = 0, ///< quality mode
270
+ RC_BITRATE_MODE = 1, ///< bitrate mode
271
+ RC_BUFFERBASED_MODE = 2, ///< no bitrate control,only using buffer status,adjust the video quality
272
+ RC_TIMESTAMP_MODE = 3, //rate control based timestamp
273
+ RC_BITRATE_MODE_POST_SKIP = 4, ///< this is in-building RC MODE, WILL BE DELETED after algorithm tuning!
274
+ RC_OFF_MODE = -1, ///< rate control off mode
275
+ } RC_MODES;
276
+
277
+ /**
278
+ * @brief Enumerate the type of profile id
279
+ */
280
+ typedef enum {
281
+ PRO_UNKNOWN = 0,
282
+ PRO_BASELINE = 66,
283
+ PRO_MAIN = 77,
284
+ PRO_EXTENDED = 88,
285
+ PRO_HIGH = 100,
286
+ PRO_HIGH10 = 110,
287
+ PRO_HIGH422 = 122,
288
+ PRO_HIGH444 = 144,
289
+ PRO_CAVLC444 = 244,
290
+
291
+ PRO_SCALABLE_BASELINE = 83,
292
+ PRO_SCALABLE_HIGH = 86
293
+ } EProfileIdc;
294
+
295
+ /**
296
+ * @brief Enumerate the type of level id
297
+ */
298
+ typedef enum {
299
+ LEVEL_UNKNOWN = 0,
300
+ LEVEL_1_0 = 10,
301
+ LEVEL_1_B = 9,
302
+ LEVEL_1_1 = 11,
303
+ LEVEL_1_2 = 12,
304
+ LEVEL_1_3 = 13,
305
+ LEVEL_2_0 = 20,
306
+ LEVEL_2_1 = 21,
307
+ LEVEL_2_2 = 22,
308
+ LEVEL_3_0 = 30,
309
+ LEVEL_3_1 = 31,
310
+ LEVEL_3_2 = 32,
311
+ LEVEL_4_0 = 40,
312
+ LEVEL_4_1 = 41,
313
+ LEVEL_4_2 = 42,
314
+ LEVEL_5_0 = 50,
315
+ LEVEL_5_1 = 51,
316
+ LEVEL_5_2 = 52
317
+ } ELevelIdc;
318
+
319
+ /**
320
+ * @brief Enumerate the type of wels log
321
+ */
322
+ enum {
323
+ WELS_LOG_QUIET = 0x00, ///< quiet mode
324
+ WELS_LOG_ERROR = 1 << 0, ///< error log iLevel
325
+ WELS_LOG_WARNING = 1 << 1, ///< Warning log iLevel
326
+ WELS_LOG_INFO = 1 << 2, ///< information log iLevel
327
+ WELS_LOG_DEBUG = 1 << 3, ///< debug log, critical algo log
328
+ WELS_LOG_DETAIL = 1 << 4, ///< per packet/frame log
329
+ WELS_LOG_RESV = 1 << 5, ///< resversed log iLevel
330
+ WELS_LOG_LEVEL_COUNT = 6,
331
+ WELS_LOG_DEFAULT = WELS_LOG_WARNING ///< default log iLevel in Wels codec
332
+ };
333
+
334
+ /**
335
+ * @brief Enumerate the type of slice mode
336
+ */
337
+ typedef enum {
338
+ SM_SINGLE_SLICE = 0, ///< | SliceNum==1
339
+ SM_FIXEDSLCNUM_SLICE = 1, ///< | according to SliceNum | enabled dynamic slicing for multi-thread
340
+ SM_RASTER_SLICE = 2, ///< | according to SlicesAssign | need input of MB numbers each slice. In addition, if other constraint in SSliceArgument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
341
+ SM_SIZELIMITED_SLICE = 3, ///< | according to SliceSize | slicing according to size, the slicing will be dynamic(have no idea about slice_nums until encoding current frame)
342
+ SM_RESERVED = 4
343
+ } SliceModeEnum;
344
+
345
+ /**
346
+ * @brief Structure for slice argument
347
+ */
348
+ typedef struct {
349
+ SliceModeEnum uiSliceMode; ///< by default, uiSliceMode will be SM_SINGLE_SLICE
350
+ unsigned int
351
+ uiSliceNum; ///< only used when uiSliceMode=1, when uiSliceNum=0 means auto design it with cpu core number
352
+ unsigned int
353
+ uiSliceMbNum[MAX_SLICES_NUM_TMP]; ///< only used when uiSliceMode=2; when =0 means setting one MB row a slice
354
+ unsigned int uiSliceSizeConstraint; ///< now only used when uiSliceMode=4
355
+ } SSliceArgument;
356
+
357
+ /**
358
+ * @brief Enumerate the type of video format
359
+ */
360
+ typedef enum {
361
+ VF_COMPONENT,
362
+ VF_PAL,
363
+ VF_NTSC,
364
+ VF_SECAM,
365
+ VF_MAC,
366
+ VF_UNDEF,
367
+ VF_NUM_ENUM
368
+ } EVideoFormatSPS; // EVideoFormat is already defined/used elsewhere!
369
+
370
+ /**
371
+ * @brief Enumerate the type of color primaries
372
+ */
373
+ typedef enum {
374
+ CP_RESERVED0,
375
+ CP_BT709,
376
+ CP_UNDEF,
377
+ CP_RESERVED3,
378
+ CP_BT470M,
379
+ CP_BT470BG,
380
+ CP_SMPTE170M,
381
+ CP_SMPTE240M,
382
+ CP_FILM,
383
+ CP_BT2020,
384
+ CP_NUM_ENUM
385
+ } EColorPrimaries;
386
+
387
+ /**
388
+ * @brief Enumerate the type of transfer characteristics
389
+ */
390
+ typedef enum {
391
+ TRC_RESERVED0,
392
+ TRC_BT709,
393
+ TRC_UNDEF,
394
+ TRC_RESERVED3,
395
+ TRC_BT470M,
396
+ TRC_BT470BG,
397
+ TRC_SMPTE170M,
398
+ TRC_SMPTE240M,
399
+ TRC_LINEAR,
400
+ TRC_LOG100,
401
+ TRC_LOG316,
402
+ TRC_IEC61966_2_4,
403
+ TRC_BT1361E,
404
+ TRC_IEC61966_2_1,
405
+ TRC_BT2020_10,
406
+ TRC_BT2020_12,
407
+ TRC_NUM_ENUM
408
+ } ETransferCharacteristics;
409
+
410
+ /**
411
+ * @brief Enumerate the type of color matrix
412
+ */
413
+ typedef enum {
414
+ CM_GBR,
415
+ CM_BT709,
416
+ CM_UNDEF,
417
+ CM_RESERVED3,
418
+ CM_FCC,
419
+ CM_BT470BG,
420
+ CM_SMPTE170M,
421
+ CM_SMPTE240M,
422
+ CM_YCGCO,
423
+ CM_BT2020NC,
424
+ CM_BT2020C,
425
+ CM_NUM_ENUM
426
+ } EColorMatrix;
427
+
428
+
429
+ /**
430
+ * @brief Enumerate the type of sample aspect ratio
431
+ */
432
+ typedef enum {
433
+ ASP_UNSPECIFIED = 0,
434
+ ASP_1x1 = 1,
435
+ ASP_12x11 = 2,
436
+ ASP_10x11 = 3,
437
+ ASP_16x11 = 4,
438
+ ASP_40x33 = 5,
439
+ ASP_24x11 = 6,
440
+ ASP_20x11 = 7,
441
+ ASP_32x11 = 8,
442
+ ASP_80x33 = 9,
443
+ ASP_18x11 = 10,
444
+ ASP_15x11 = 11,
445
+ ASP_64x33 = 12,
446
+ ASP_160x99 = 13,
447
+
448
+ ASP_EXT_SAR = 255
449
+ } ESampleAspectRatio;
450
+
451
+
452
+ /**
453
+ * @brief Structure for spatial layer configuration
454
+ */
455
+ typedef struct {
456
+ int iVideoWidth; ///< width of picture in luminance samples of a layer
457
+ int iVideoHeight; ///< height of picture in luminance samples of a layer
458
+ float fFrameRate; ///< frame rate specified for a layer
459
+ int iSpatialBitrate; ///< target bitrate for a spatial layer, in unit of bps
460
+ int iMaxSpatialBitrate; ///< maximum bitrate for a spatial layer, in unit of bps
461
+ EProfileIdc uiProfileIdc; ///< value of profile IDC (PRO_UNKNOWN for auto-detection)
462
+ ELevelIdc uiLevelIdc; ///< value of profile IDC (0 for auto-detection)
463
+ int iDLayerQp; ///< value of level IDC (0 for auto-detection)
464
+
465
+ SSliceArgument sSliceArgument;
466
+
467
+ // Note: members bVideoSignalTypePresent through uiColorMatrix below are also defined in SWelsSPS in parameter_sets.h.
468
+ bool bVideoSignalTypePresent; // false => do not write any of the following information to the header
469
+ unsigned char
470
+ uiVideoFormat; // EVideoFormatSPS; 3 bits in header; 0-5 => component, kpal, ntsc, secam, mac, undef
471
+ bool bFullRange; // false => analog video data range [16, 235]; true => full data range [0,255]
472
+ bool bColorDescriptionPresent; // false => do not write any of the following three items to the header
473
+ unsigned char
474
+ uiColorPrimaries; // EColorPrimaries; 8 bits in header; 0 - 9 => ???, bt709, undef, ???, bt470m, bt470bg,
475
+ // smpte170m, smpte240m, film, bt2020
476
+ unsigned char
477
+ uiTransferCharacteristics; // ETransferCharacteristics; 8 bits in header; 0 - 15 => ???, bt709, undef, ???, bt470m, bt470bg, smpte170m,
478
+ // smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1, bt2020-10, bt2020-12
479
+ unsigned char
480
+ uiColorMatrix; // EColorMatrix; 8 bits in header (corresponds to FFmpeg "colorspace"); 0 - 10 => GBR, bt709,
481
+ // undef, ???, fcc, bt470bg, smpte170m, smpte240m, YCgCo, bt2020nc, bt2020c
482
+
483
+ bool bAspectRatioPresent; ///< aspect ratio present in VUI
484
+ ESampleAspectRatio eAspectRatio; ///< aspect ratio idc
485
+ unsigned short sAspectRatioExtWidth; ///< use if aspect ratio idc == 255
486
+ unsigned short sAspectRatioExtHeight; ///< use if aspect ratio idc == 255
487
+
488
+ } SSpatialLayerConfig;
489
+
490
+ /**
491
+ * @brief Encoder usage type
492
+ */
493
+ typedef enum {
494
+ CAMERA_VIDEO_REAL_TIME, ///< camera video for real-time communication
495
+ SCREEN_CONTENT_REAL_TIME, ///< screen content signal
496
+ CAMERA_VIDEO_NON_REAL_TIME,
497
+ SCREEN_CONTENT_NON_REAL_TIME,
498
+ INPUT_CONTENT_TYPE_ALL,
499
+ } EUsageType;
500
+
501
+ /**
502
+ * @brief Enumulate the complexity mode
503
+ */
504
+ typedef enum {
505
+ LOW_COMPLEXITY = 0, ///< the lowest compleixty,the fastest speed,
506
+ MEDIUM_COMPLEXITY, ///< medium complexity, medium speed,medium quality
507
+ HIGH_COMPLEXITY ///< high complexity, lowest speed, high quality
508
+ } ECOMPLEXITY_MODE;
509
+
510
+ /**
511
+ * @brief Enumulate for the stategy of SPS/PPS strategy
512
+ */
513
+ typedef enum {
514
+ CONSTANT_ID = 0, ///< constant id in SPS/PPS
515
+ INCREASING_ID = 0x01, ///< SPS/PPS id increases at each IDR
516
+ SPS_LISTING = 0x02, ///< using SPS in the existing list if possible
517
+ SPS_LISTING_AND_PPS_INCREASING = 0x03,
518
+ SPS_PPS_LISTING = 0x06,
519
+ } EParameterSetStrategy;
520
+
521
+ // TODO: Refine the parameters definition.
522
+ /**
523
+ * @brief SVC Encoding Parameters
524
+ */
525
+ typedef struct TagEncParamBase {
526
+ EUsageType
527
+ iUsageType; ///< application type; please refer to the definition of EUsageType
528
+
529
+ int iPicWidth; ///< width of picture in luminance samples (the maximum of all layers if multiple spatial layers presents)
530
+ int iPicHeight; ///< height of picture in luminance samples((the maximum of all layers if multiple spatial layers presents)
531
+ int iTargetBitrate; ///< target bitrate desired, in unit of bps
532
+ RC_MODES iRCMode; ///< rate control mode
533
+ float fMaxFrameRate; ///< maximal input frame rate
534
+
535
+ } SEncParamBase, *PEncParamBase;
536
+
537
+ /**
538
+ * @brief SVC Encoding Parameters extention
539
+ */
540
+ typedef struct TagEncParamExt {
541
+ EUsageType
542
+ iUsageType; ///< same as in TagEncParamBase
543
+
544
+ int iPicWidth; ///< same as in TagEncParamBase
545
+ int iPicHeight; ///< same as in TagEncParamBase
546
+ int iTargetBitrate; ///< same as in TagEncParamBase
547
+ RC_MODES iRCMode; ///< same as in TagEncParamBase
548
+ float fMaxFrameRate; ///< same as in TagEncParamBase
549
+
550
+ int iTemporalLayerNum; ///< temporal layer number, max temporal layer = 4
551
+ int iSpatialLayerNum; ///< spatial layer number,1<= iSpatialLayerNum <= MAX_SPATIAL_LAYER_NUM, MAX_SPATIAL_LAYER_NUM = 4
552
+ SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
553
+
554
+ ECOMPLEXITY_MODE iComplexityMode;
555
+ unsigned int uiIntraPeriod; ///< period of Intra frame
556
+ int iNumRefFrame; ///< number of reference frame used
557
+ EParameterSetStrategy
558
+ eSpsPpsIdStrategy; ///< different stategy in adjust ID in SPS/PPS: 0- constant ID, 1-additional ID, 6-mapping and additional
559
+ bool bPrefixNalAddingCtrl; ///< false:not use Prefix NAL; true: use Prefix NAL
560
+ bool bEnableSSEI; ///< false:not use SSEI; true: use SSEI -- TODO: planning to remove the interface of SSEI
561
+ bool bSimulcastAVC; ///< (when encoding more than 1 spatial layer) false: use SVC syntax for higher layers; true: use Simulcast AVC
562
+ int iPaddingFlag; ///< 0:disable padding;1:padding
563
+ int iEntropyCodingModeFlag; ///< 0:CAVLC 1:CABAC.
564
+
565
+ /* rc control */
566
+ bool bEnableFrameSkip; ///< False: don't skip frame even if VBV buffer overflow.True: allow skipping frames to keep the bitrate within limits
567
+ int iMaxBitrate; ///< the maximum bitrate, in unit of bps, set it to UNSPECIFIED_BIT_RATE if not needed
568
+ int iMaxQp; ///< the maximum QP encoder supports
569
+ int iMinQp; ///< the minmum QP encoder supports
570
+ unsigned int uiMaxNalSize; ///< the maximum NAL size. This value should be not 0 for dynamic slice mode
571
+
572
+ /*LTR settings*/
573
+ bool bEnableLongTermReference; ///< 1: on, 0: off
574
+ int iLTRRefNum; ///< the number of LTR(long term reference),TODO: not supported to set it arbitrary yet
575
+ unsigned int iLtrMarkPeriod; ///< the LTR marked period that is used in feedback.
576
+ /* multi-thread settings*/
577
+ unsigned short
578
+ iMultipleThreadIdc; ///< 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; lager than 1: count number of threads;
579
+ bool bUseLoadBalancing; ///< only used when uiSliceMode=1 or 3, will change slicing of a picture during the run-time of multi-thread encoding, so the result of each run may be different
580
+
581
+ /* Deblocking loop filter */
582
+ int iLoopFilterDisableIdc; ///< 0: on, 1: off, 2: on except for slice boundaries
583
+ int iLoopFilterAlphaC0Offset; ///< AlphaOffset: valid range [-6, 6], default 0
584
+ int iLoopFilterBetaOffset; ///< BetaOffset: valid range [-6, 6], default 0
585
+ /*pre-processing feature*/
586
+ bool bEnableDenoise; ///< denoise control
587
+ bool bEnableBackgroundDetection; ///< background detection control //VAA_BACKGROUND_DETECTION //BGD cmd
588
+ bool bEnableAdaptiveQuant; ///< adaptive quantization control
589
+ bool bEnableFrameCroppingFlag; ///< enable frame cropping flag: TRUE always in application
590
+ bool bEnableSceneChangeDetect;
591
+
592
+ bool bIsLosslessLink; ///< LTR advanced setting
593
+ bool bFixRCOverShoot; ///< fix rate control overshooting
594
+ int iIdrBitrateRatio; ///< the target bits of IDR is (idr_bitrate_ratio/100) * average target bit per frame.
595
+ bool bPsnrY; ///< get Y PSNR stats for the whole video sequence
596
+ bool bPsnrU; ///< get U PSNR stats for the whole video sequence
597
+ bool bPsnrV; ///< get V PSNR stats for the whole video sequence
598
+ } SEncParamExt;
599
+
600
+ /**
601
+ * @brief Define a new struct to show the property of video bitstream.
602
+ */
603
+ typedef struct {
604
+ unsigned int size; ///< size of the struct
605
+ VIDEO_BITSTREAM_TYPE eVideoBsType; ///< video stream type (AVC/SVC)
606
+ } SVideoProperty;
607
+
608
+ /**
609
+ * @brief SVC Decoding Parameters, reserved here and potential applicable in the future
610
+ */
611
+ typedef struct TagSVCDecodingParam {
612
+ char* pFileNameRestructed; ///< file name of reconstructed frame used for PSNR calculation based debug
613
+
614
+ unsigned int uiCpuLoad; ///< CPU load
615
+ unsigned char uiTargetDqLayer; ///< setting target dq layer id
616
+
617
+ ERROR_CON_IDC eEcActiveIdc; ///< whether active error concealment feature in decoder
618
+ bool bParseOnly; ///< decoder for parse only, no reconstruction. When it is true, SPS/PPS size should not exceed SPS_PPS_BS_SIZE (128). Otherwise, it will return error info
619
+
620
+ SVideoProperty sVideoProperty; ///< video stream property
621
+ } SDecodingParam, *PDecodingParam;
622
+
623
+ /**
624
+ * @brief Bitstream inforamtion of a layer being encoded
625
+ */
626
+ typedef struct {
627
+ unsigned char uiTemporalId;
628
+ unsigned char uiSpatialId;
629
+ unsigned char uiQualityId;
630
+ EVideoFrameType eFrameType;
631
+ unsigned char uiLayerType;
632
+
633
+ /**
634
+ * The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
635
+ * predicted from any picture on any higher layer.
636
+ */
637
+ int iSubSeqId; ///< refer to D.2.11 Sub-sequence information SEI message semantics
638
+ int iNalCount; ///< count number of NAL coded already
639
+ int* pNalLengthInByte; ///< length of NAL size in byte from 0 to iNalCount-1
640
+ unsigned char* pBsBuf; ///< buffer of bitstream contained
641
+ float rPsnr[3]; ///< PSNR values for Y/U/V
642
+ } SLayerBSInfo, *PLayerBSInfo;
643
+
644
+ /**
645
+ * @brief Frame bit stream info
646
+ */
647
+ typedef struct {
648
+ int iLayerNum;
649
+ SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
650
+
651
+ EVideoFrameType eFrameType;
652
+ int iFrameSizeInBytes;
653
+ long long uiTimeStamp;
654
+ } SFrameBSInfo, *PFrameBSInfo;
655
+
656
+ /**
657
+ * @brief Structure for source picture
658
+ */
659
+ typedef struct Source_Picture_s {
660
+ int iColorFormat; ///< color space type
661
+ int iStride[4]; ///< stride for each plane pData
662
+ unsigned char* pData[4]; ///< plane pData
663
+ int iPicWidth; ///< luma picture width in x coordinate
664
+ int iPicHeight; ///< luma picture height in y coordinate
665
+ long long uiTimeStamp; ///< timestamp of the source picture, unit: millisecond
666
+ bool bPsnrY; ///< get Y PSNR for this frame
667
+ bool bPsnrU; ///< get U PSNR for this frame
668
+ bool bPsnrV; ///< get V PSNR for this frame
669
+ } SSourcePicture;
670
+
671
+ /**
672
+ * @brief Structure for bit rate info
673
+ */
674
+ typedef struct TagBitrateInfo {
675
+ LAYER_NUM iLayer;
676
+ int iBitrate; ///< the maximum bitrate
677
+ } SBitrateInfo;
678
+
679
+ /**
680
+ * @brief Structure for dump layer info
681
+ */
682
+ typedef struct TagDumpLayer {
683
+ int iLayer;
684
+ char* pFileName;
685
+ } SDumpLayer;
686
+
687
+ /**
688
+ * @brief Structure for profile info in layer
689
+ *
690
+ */
691
+ typedef struct TagProfileInfo {
692
+ int iLayer;
693
+ EProfileIdc uiProfileIdc; ///< the profile info
694
+ } SProfileInfo;
695
+
696
+ /**
697
+ * @brief Structure for level info in layer
698
+ *
699
+ */
700
+ typedef struct TagLevelInfo {
701
+ int iLayer;
702
+ ELevelIdc uiLevelIdc; ///< the level info
703
+ } SLevelInfo;
704
+ /**
705
+ * @brief Structure for dilivery status
706
+ *
707
+ */
708
+ typedef struct TagDeliveryStatus {
709
+ bool bDeliveryFlag; ///< 0: the previous frame isn't delivered,1: the previous frame is delivered
710
+ int iDropFrameType; ///< the frame type that is dropped; reserved
711
+ int iDropFrameSize; ///< the frame size that is dropped; reserved
712
+ } SDeliveryStatus;
713
+
714
+ /**
715
+ * @brief The capability of decoder, for SDP negotiation
716
+ */
717
+ typedef struct TagDecoderCapability {
718
+ int iProfileIdc; ///< profile_idc
719
+ int iProfileIop; ///< profile-iop
720
+ int iLevelIdc; ///< level_idc
721
+ int iMaxMbps; ///< max-mbps
722
+ int iMaxFs; ///< max-fs
723
+ int iMaxCpb; ///< max-cpb
724
+ int iMaxDpb; ///< max-dpb
725
+ int iMaxBr; ///< max-br
726
+ bool bRedPicCap; ///< redundant-pic-cap
727
+ } SDecoderCapability;
728
+
729
+ /**
730
+ * @brief Structure for parse only output
731
+ */
732
+ typedef struct TagParserBsInfo {
733
+ int iNalNum; ///< total NAL number in current AU
734
+ int* pNalLenInByte; ///< each nal length
735
+ unsigned char* pDstBuff; ///< outputted dst buffer for parsed bitstream
736
+ int iSpsWidthInPixel; ///< required SPS width info
737
+ int iSpsHeightInPixel; ///< required SPS height info
738
+ unsigned long long uiInBsTimeStamp; ///< input BS timestamp
739
+ unsigned long long uiOutBsTimeStamp; ///< output BS timestamp
740
+ } SParserBsInfo, *PParserBsInfo;
741
+
742
+ /**
743
+ * @brief Structure for encoder statistics
744
+ */
745
+ typedef struct TagVideoEncoderStatistics {
746
+ unsigned int uiWidth; ///< the width of encoded frame
747
+ unsigned int uiHeight; ///< the height of encoded frame
748
+ //following standard, will be 16x aligned, if there are multiple spatial, this is of the highest
749
+ float fAverageFrameSpeedInMs; ///< average_Encoding_Time
750
+
751
+ // rate control related
752
+ float fAverageFrameRate; ///< the average frame rate in, calculate since encoding starts, supposed that the input timestamp is in unit of ms
753
+ float fLatestFrameRate; ///< the frame rate in, in the last second, supposed that the input timestamp is in unit of ms (? useful for checking BR, but is it easy to calculate?
754
+ unsigned int uiBitRate; ///< sendrate in Bits per second, calculated within the set time-window
755
+ unsigned int uiAverageFrameQP; ///< the average QP of last encoded frame
756
+
757
+ unsigned int uiInputFrameCount; ///< number of frames
758
+ unsigned int uiSkippedFrameCount; ///< number of frames
759
+
760
+ unsigned int uiResolutionChangeTimes; ///< uiResolutionChangeTimes
761
+ unsigned int uiIDRReqNum; ///< number of IDR requests
762
+ unsigned int uiIDRSentNum; ///< number of actual IDRs sent
763
+ unsigned int uiLTRSentNum; ///< number of LTR sent/marked
764
+
765
+ long long iStatisticsTs; ///< Timestamp of updating the statistics
766
+
767
+ unsigned long iTotalEncodedBytes;
768
+ unsigned long iLastStatisticsBytes;
769
+ unsigned long iLastStatisticsFrameCount;
770
+ } SEncoderStatistics;
771
+
772
+ /**
773
+ * @brief Structure for decoder statistics
774
+ */
775
+ typedef struct TagVideoDecoderStatistics {
776
+ unsigned int uiWidth; ///< the width of encode/decode frame
777
+ unsigned int uiHeight; ///< the height of encode/decode frame
778
+ float fAverageFrameSpeedInMs; ///< average_Decoding_Time
779
+ float fActualAverageFrameSpeedInMs; ///< actual average_Decoding_Time, including freezing pictures
780
+ unsigned int uiDecodedFrameCount; ///< number of frames
781
+ unsigned int uiResolutionChangeTimes; ///< uiResolutionChangeTimes
782
+ unsigned int uiIDRCorrectNum; ///< number of correct IDR received
783
+ //EC on related
784
+ unsigned int
785
+ uiAvgEcRatio; ///< when EC is on, the average ratio of total EC areas, can be an indicator of reconstruction quality
786
+ unsigned int
787
+ uiAvgEcPropRatio; ///< when EC is on, the rough average ratio of propogate EC areas, can be an indicator of reconstruction quality
788
+ unsigned int uiEcIDRNum; ///< number of actual unintegrity IDR or not received but eced
789
+ unsigned int uiEcFrameNum; ///<
790
+ unsigned int uiIDRLostNum; ///< number of whole lost IDR
791
+ unsigned int
792
+ uiFreezingIDRNum; ///< number of freezing IDR with error (partly received), under resolution change
793
+ unsigned int uiFreezingNonIDRNum; ///< number of freezing non-IDR with error
794
+ int iAvgLumaQp; ///< average luma QP. default: -1, no correct frame outputted
795
+ int iSpsReportErrorNum; ///< number of Sps Invalid report
796
+ int iSubSpsReportErrorNum; ///< number of SubSps Invalid report
797
+ int iPpsReportErrorNum; ///< number of Pps Invalid report
798
+ int iSpsNoExistNalNum; ///< number of Sps NoExist Nal
799
+ int iSubSpsNoExistNalNum; ///< number of SubSps NoExist Nal
800
+ int iPpsNoExistNalNum; ///< number of Pps NoExist Nal
801
+
802
+ unsigned int uiProfile; ///< Profile idc in syntax
803
+ unsigned int uiLevel; ///< level idc according to Annex A-1
804
+
805
+ int iCurrentActiveSpsId; ///< current active SPS id
806
+ int iCurrentActivePpsId; ///< current active PPS id
807
+
808
+ unsigned int iStatisticsLogInterval; ///< frame interval of statistics log
809
+ } SDecoderStatistics; // in building, coming soon
810
+
811
+ /**
812
+ * @brief Structure for sample aspect ratio (SAR) info in VUI
813
+ */
814
+ typedef struct TagVuiSarInfo {
815
+ unsigned int uiSarWidth; ///< SAR width
816
+ unsigned int uiSarHeight; ///< SAR height
817
+ bool bOverscanAppropriateFlag; ///< SAR overscan flag
818
+ } SVuiSarInfo, *PVuiSarInfo;
819
+
820
+ #endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__