@woosh/meep-engine 3.79.0 → 3.80.0

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 (309) hide show
  1. package/CHANGELOG.md +62 -3
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts +45 -0
  5. package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts.map +1 -0
  6. package/src/format/image/webp/vp8/VP8BoolDecoder.js +137 -0
  7. package/src/format/image/webp/vp8/vp8_decode.d.ts +21 -0
  8. package/src/format/image/webp/vp8/vp8_decode.d.ts.map +1 -0
  9. package/src/format/image/webp/vp8/vp8_decode.js +756 -0
  10. package/src/format/image/webp/vp8/vp8_loop_filter.d.ts +31 -0
  11. package/src/format/image/webp/vp8/vp8_loop_filter.d.ts.map +1 -0
  12. package/src/format/image/webp/vp8/vp8_loop_filter.js +189 -0
  13. package/src/format/image/webp/vp8/vp8_predict.d.ts +48 -0
  14. package/src/format/image/webp/vp8/vp8_predict.d.ts.map +1 -0
  15. package/src/format/image/webp/vp8/vp8_predict.js +290 -0
  16. package/src/format/image/webp/vp8/vp8_tables.d.ts +34 -0
  17. package/src/format/image/webp/vp8/vp8_tables.d.ts.map +1 -0
  18. package/src/format/image/webp/vp8/vp8_tables.js +350 -0
  19. package/src/format/image/webp/vp8/vp8_transform.d.ts +22 -0
  20. package/src/format/image/webp/vp8/vp8_transform.d.ts.map +1 -0
  21. package/src/format/image/webp/vp8/vp8_transform.js +114 -0
  22. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts +23 -0
  23. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts.map +1 -0
  24. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.js +133 -0
  25. package/src/format/image/webp/vp8l/VP8LBitReader.d.ts +47 -0
  26. package/src/format/image/webp/vp8l/VP8LBitReader.d.ts.map +1 -0
  27. package/src/format/image/webp/vp8l/VP8LBitReader.js +84 -0
  28. package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts +27 -0
  29. package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts.map +1 -0
  30. package/src/format/image/webp/vp8l/VP8LPrefixCode.js +184 -0
  31. package/src/format/image/webp/vp8l/vp8l_decode.d.ts +28 -0
  32. package/src/format/image/webp/vp8l/vp8l_decode.d.ts.map +1 -0
  33. package/src/format/image/webp/vp8l/vp8l_decode.js +261 -0
  34. package/src/format/image/webp/vp8l/vp8l_distance.d.ts +22 -0
  35. package/src/format/image/webp/vp8l/vp8l_distance.d.ts.map +1 -0
  36. package/src/format/image/webp/vp8l/vp8l_distance.js +62 -0
  37. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts +50 -0
  38. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts.map +1 -0
  39. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.js +267 -0
  40. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts +14 -0
  41. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts.map +1 -0
  42. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.js +99 -0
  43. package/src/format/image/webp/webp_decode.d.ts +23 -0
  44. package/src/format/image/webp/webp_decode.d.ts.map +1 -0
  45. package/src/format/image/webp/webp_decode.js +179 -0
  46. package/src/format/image/webp/webp_decode_alpha.d.ts +18 -0
  47. package/src/format/image/webp/webp_decode_alpha.d.ts.map +1 -0
  48. package/src/format/image/webp/webp_decode_alpha.js +84 -0
  49. package/src/format/texture/{basis → astc}/astc_block.d.ts +41 -0
  50. package/src/format/texture/astc/astc_block.d.ts.map +1 -0
  51. package/src/format/texture/{basis → astc}/astc_block.js +284 -164
  52. package/src/format/texture/astc/astc_decode_block.d.ts +68 -0
  53. package/src/format/texture/astc/astc_decode_block.d.ts.map +1 -0
  54. package/src/format/texture/astc/astc_decode_block.js +1119 -0
  55. package/src/format/texture/astc/astc_encode_block_4x4.d.ts +32 -0
  56. package/src/format/texture/astc/astc_encode_block_4x4.d.ts.map +1 -0
  57. package/src/format/texture/astc/astc_encode_block_4x4.js +181 -0
  58. package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts +32 -0
  59. package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts.map +1 -0
  60. package/src/format/texture/astc/astc_encode_block_4x4_rgba.js +337 -0
  61. package/src/format/texture/astc/astc_integer_sequence.d.ts.map +1 -0
  62. package/src/format/texture/{basis → astc}/astc_integer_sequence.js +251 -251
  63. package/src/format/texture/astc/astc_partition.d.ts.map +1 -0
  64. package/src/format/texture/{basis → astc}/astc_partition.js +199 -199
  65. package/src/format/texture/basis/transcode/etc1s_to_astc.js +329 -329
  66. package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -1
  67. package/src/format/texture/basis/transcode/etc1s_to_etc2.js +305 -332
  68. package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -1
  69. package/src/format/texture/basis/transcode/fit_endpoints.js +14 -27
  70. package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts +66 -0
  71. package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts.map +1 -0
  72. package/src/format/texture/basis/uastc/uastc_bc7_tables.js +148 -0
  73. package/src/format/texture/basis/uastc/uastc_decode_block.js +463 -463
  74. package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -421
  75. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +1 -6
  76. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -1
  77. package/src/format/texture/basis/uastc/uastc_to_bc5.js +48 -115
  78. package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -1
  79. package/src/format/texture/basis/uastc/uastc_to_bc7.js +604 -602
  80. package/src/format/texture/bc/bc1_decode_block.d.ts +19 -0
  81. package/src/format/texture/bc/bc1_decode_block.d.ts.map +1 -0
  82. package/src/format/texture/bc/bc1_decode_block.js +22 -0
  83. package/src/format/texture/bc/bc1_decode_colors.d.ts +27 -0
  84. package/src/format/texture/bc/bc1_decode_colors.d.ts.map +1 -0
  85. package/src/format/texture/bc/bc1_decode_colors.js +100 -0
  86. package/src/format/texture/bc/bc2_decode_block.d.ts +18 -0
  87. package/src/format/texture/bc/bc2_decode_block.d.ts.map +1 -0
  88. package/src/format/texture/bc/bc2_decode_block.js +28 -0
  89. package/src/format/texture/bc/bc3_decode_block.d.ts +18 -0
  90. package/src/format/texture/bc/bc3_decode_block.d.ts.map +1 -0
  91. package/src/format/texture/bc/bc3_decode_block.js +23 -0
  92. package/src/format/texture/bc/bc4_decode_channel.d.ts +56 -0
  93. package/src/format/texture/bc/bc4_decode_channel.d.ts.map +1 -0
  94. package/src/format/texture/bc/bc4_decode_channel.js +138 -0
  95. package/src/format/texture/bc/bc4_encode_block.d.ts +43 -0
  96. package/src/format/texture/bc/bc4_encode_block.d.ts.map +1 -0
  97. package/src/format/texture/bc/bc4_encode_block.js +324 -0
  98. package/src/format/texture/bc/bc4_snorm_decode_block.d.ts +18 -0
  99. package/src/format/texture/bc/bc4_snorm_decode_block.d.ts.map +1 -0
  100. package/src/format/texture/bc/bc4_snorm_decode_block.js +27 -0
  101. package/src/format/texture/bc/bc4_unorm_decode_block.d.ts +17 -0
  102. package/src/format/texture/bc/bc4_unorm_decode_block.d.ts.map +1 -0
  103. package/src/format/texture/bc/bc4_unorm_decode_block.js +26 -0
  104. package/src/format/texture/bc/bc5_encode_block.d.ts +25 -0
  105. package/src/format/texture/bc/bc5_encode_block.d.ts.map +1 -0
  106. package/src/format/texture/bc/bc5_encode_block.js +34 -0
  107. package/src/format/texture/bc/bc5_snorm_decode_block.d.ts +18 -0
  108. package/src/format/texture/bc/bc5_snorm_decode_block.d.ts.map +1 -0
  109. package/src/format/texture/bc/bc5_snorm_decode_block.js +27 -0
  110. package/src/format/texture/bc/bc5_unorm_decode_block.d.ts +17 -0
  111. package/src/format/texture/bc/bc5_unorm_decode_block.d.ts.map +1 -0
  112. package/src/format/texture/bc/bc5_unorm_decode_block.js +26 -0
  113. package/src/format/texture/bc/bc6h_decode_texels.d.ts +30 -0
  114. package/src/format/texture/bc/bc6h_decode_texels.d.ts.map +1 -0
  115. package/src/format/texture/bc/bc6h_decode_texels.js +430 -0
  116. package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts +20 -0
  117. package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts.map +1 -0
  118. package/src/format/texture/bc/bc6h_sfloat_decode_block.js +23 -0
  119. package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts +18 -0
  120. package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts.map +1 -0
  121. package/src/format/texture/bc/bc6h_ufloat_decode_block.js +21 -0
  122. package/src/format/texture/bc/bc7_decode_block.d.ts +30 -0
  123. package/src/format/texture/bc/bc7_decode_block.d.ts.map +1 -0
  124. package/src/format/texture/bc/bc7_decode_block.js +232 -0
  125. package/src/format/texture/bc/bc7_encode_block.d.ts +39 -0
  126. package/src/format/texture/bc/bc7_encode_block.d.ts.map +1 -0
  127. package/src/format/texture/bc/bc7_encode_block.js +423 -0
  128. package/src/format/texture/bc/bc7_tables.d.ts +126 -0
  129. package/src/format/texture/bc/bc7_tables.d.ts.map +1 -0
  130. package/src/format/texture/{basis/uastc → bc}/bc7_tables.js +225 -276
  131. package/src/format/texture/bc/bc7_write_block.d.ts +65 -0
  132. package/src/format/texture/bc/bc7_write_block.d.ts.map +1 -0
  133. package/src/format/texture/{basis/uastc → bc}/bc7_write_block.js +185 -227
  134. package/src/format/texture/etc/eac_decode_channel.d.ts +50 -0
  135. package/src/format/texture/etc/eac_decode_channel.d.ts.map +1 -0
  136. package/src/format/texture/etc/eac_decode_channel.js +142 -0
  137. package/src/format/texture/etc/eac_modifiers.d.ts +15 -0
  138. package/src/format/texture/etc/eac_modifiers.d.ts.map +1 -0
  139. package/src/format/texture/etc/eac_modifiers.js +31 -0
  140. package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts +21 -0
  141. package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts.map +1 -0
  142. package/src/format/texture/etc/eac_r11_snorm_decode_block.js +30 -0
  143. package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts +20 -0
  144. package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts.map +1 -0
  145. package/src/format/texture/etc/eac_r11_unorm_decode_block.js +29 -0
  146. package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts +19 -0
  147. package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts.map +1 -0
  148. package/src/format/texture/etc/eac_rg11_snorm_decode_block.js +28 -0
  149. package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts +19 -0
  150. package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts.map +1 -0
  151. package/src/format/texture/etc/eac_rg11_unorm_decode_block.js +28 -0
  152. package/src/format/texture/etc/etc2_decode_color.d.ts +25 -0
  153. package/src/format/texture/etc/etc2_decode_color.d.ts.map +1 -0
  154. package/src/format/texture/etc/etc2_decode_color.js +370 -0
  155. package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts +18 -0
  156. package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts.map +1 -0
  157. package/src/format/texture/etc/etc2_rgb8_decode_block.js +21 -0
  158. package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts +21 -0
  159. package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts.map +1 -0
  160. package/src/format/texture/etc/etc2_rgb8a1_decode_block.js +24 -0
  161. package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts +18 -0
  162. package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts.map +1 -0
  163. package/src/format/texture/etc/etc2_rgba8_decode_block.js +24 -0
  164. package/src/format/texture/fit/fit_line.d.ts +23 -0
  165. package/src/format/texture/fit/fit_line.d.ts.map +1 -0
  166. package/src/format/texture/fit/fit_line.js +123 -0
  167. package/src/format/texture/fit/fit_line_refine.d.ts +21 -0
  168. package/src/format/texture/fit/fit_line_refine.d.ts.map +1 -0
  169. package/src/format/texture/fit/fit_line_refine.js +69 -0
  170. package/src/format/texture/fit/fit_line_solve.d.ts +23 -0
  171. package/src/format/texture/fit/fit_line_solve.d.ts.map +1 -0
  172. package/src/format/texture/fit/fit_line_solve.js +71 -0
  173. package/src/format/texture/texel_decode_image.d.ts +44 -0
  174. package/src/format/texture/texel_decode_image.d.ts.map +1 -0
  175. package/src/format/texture/texel_decode_image.js +251 -0
  176. package/src/format/texture/texel_encode_image.d.ts +77 -0
  177. package/src/format/texture/texel_encode_image.d.ts.map +1 -0
  178. package/src/format/texture/texel_encode_image.js +187 -0
  179. package/src/shade/renderer/ShadeIndirectLightingMode.js +2 -0
  180. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  181. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  182. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +1 -0
  183. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -1
  184. package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +102 -28
  185. package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts +19 -0
  186. package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts.map +1 -0
  187. package/src/shade/renderer/loader/mtf/mtf_replace_textures.js +60 -0
  188. package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -1
  189. package/src/shade/renderer/loader/mtf/mtf_write.js +7 -31
  190. package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts +23 -0
  191. package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts.map +1 -0
  192. package/src/shade/renderer/loader/mtf/mtf_write_collection.js +36 -0
  193. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts +13 -0
  194. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts.map +1 -0
  195. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.js +39 -0
  196. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +3 -2
  197. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  198. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +6 -21
  199. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts +42 -0
  200. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts.map +1 -0
  201. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.js +612 -0
  202. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +5 -4
  203. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  204. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +8 -25
  205. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  206. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +3 -19
  207. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +14 -4
  208. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -1
  209. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +65 -54
  210. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +2 -2
  211. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  212. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +5 -22
  213. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +1 -1
  214. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts +27 -0
  215. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts.map +1 -0
  216. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.js +147 -0
  217. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +3 -4
  218. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -1
  219. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +6 -13
  220. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts +13 -0
  221. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts.map +1 -0
  222. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.js +66 -0
  223. package/src/shade/renderer/texture/encode/texture_encode.d.ts +28 -1
  224. package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -1
  225. package/src/shade/renderer/texture/encode/texture_encode.js +202 -168
  226. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +13 -1
  227. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -1
  228. package/src/shade/renderer/texture/encode/texture_encode_shader.js +146 -108
  229. package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts +20 -0
  230. package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts.map +1 -0
  231. package/src/shade/renderer/texture/format/texture_formats_to_build.js +98 -0
  232. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.d.ts.map +1 -1
  233. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +4 -23
  234. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts +53 -0
  235. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts.map +1 -0
  236. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.js +76 -0
  237. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts +40 -0
  238. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts.map +1 -0
  239. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.js +43 -0
  240. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts +17 -0
  241. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts.map +1 -0
  242. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.js +29 -0
  243. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts +21 -0
  244. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts.map +1 -0
  245. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.js +91 -0
  246. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts +32 -0
  247. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts.map +1 -0
  248. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.js +216 -0
  249. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts +30 -0
  250. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts.map +1 -0
  251. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.js +134 -0
  252. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts +16 -0
  253. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts.map +1 -0
  254. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.js +33 -0
  255. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts +18 -0
  256. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts.map +1 -0
  257. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.js +71 -0
  258. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts +20 -0
  259. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts.map +1 -0
  260. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.js +57 -0
  261. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts +18 -0
  262. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts.map +1 -0
  263. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.js +111 -0
  264. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts +16 -0
  265. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts.map +1 -0
  266. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.js +33 -0
  267. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts +18 -0
  268. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts.map +1 -0
  269. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.js +128 -0
  270. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts +21 -0
  271. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts.map +1 -0
  272. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.js +169 -0
  273. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts +21 -0
  274. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts.map +1 -0
  275. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.js +119 -0
  276. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts +16 -0
  277. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts.map +1 -0
  278. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.js +19 -0
  279. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts +24 -0
  280. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts.map +1 -0
  281. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.js +41 -0
  282. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts +24 -0
  283. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts.map +1 -0
  284. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.js +140 -0
  285. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts +21 -0
  286. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts.map +1 -0
  287. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.js +35 -0
  288. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts +19 -0
  289. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts.map +1 -0
  290. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.js +27 -0
  291. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_catmull_rom.js +4 -4
  292. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts +13 -0
  293. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts.map +1 -1
  294. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js +54 -4
  295. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mitchell.js +4 -4
  296. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.d.ts.map +1 -1
  297. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js +9 -13
  298. package/src/shade/renderer/texture/texture_block_encodings.d.ts +33 -0
  299. package/src/shade/renderer/texture/texture_block_encodings.d.ts.map +1 -0
  300. package/src/shade/renderer/texture/texture_block_encodings.js +89 -0
  301. package/src/format/texture/basis/astc_block.d.ts.map +0 -1
  302. package/src/format/texture/basis/astc_integer_sequence.d.ts.map +0 -1
  303. package/src/format/texture/basis/astc_partition.d.ts.map +0 -1
  304. package/src/format/texture/basis/uastc/bc7_tables.d.ts +0 -111
  305. package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +0 -1
  306. package/src/format/texture/basis/uastc/bc7_write_block.d.ts +0 -124
  307. package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +0 -1
  308. /package/src/format/texture/{basis → astc}/astc_integer_sequence.d.ts +0 -0
  309. /package/src/format/texture/{basis → astc}/astc_partition.d.ts +0 -0
@@ -0,0 +1,350 @@
1
+ /**
2
+ * The default probabilities of the DCT token tree, before a frame updates any (RFC 6386 §13.5):
3
+ * [block type 4][coefficient band 8][context 3][tree node 11], flattened in that order.
4
+ *
5
+ * @type {Uint8Array}
6
+ */
7
+ export const VP8_COEFFICIENT_DEFAULT_PROBABILITIES = new Uint8Array([
8
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
9
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
10
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
11
+ 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128,
12
+ 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128,
13
+ 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128,
14
+ 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128,
15
+ 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128,
16
+ 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128,
17
+ 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128,
18
+ 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128,
19
+ 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128,
20
+ 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128,
21
+ 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128,
22
+ 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128,
23
+ 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128,
24
+ 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128,
25
+ 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128,
26
+ 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128,
27
+ 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128,
28
+ 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128,
29
+ 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128,
30
+ 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128,
31
+ 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
32
+ 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62,
33
+ 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1,
34
+ 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128,
35
+ 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128,
36
+ 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128,
37
+ 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128,
38
+ 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128,
39
+ 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128,
40
+ 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128,
41
+ 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128,
42
+ 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128,
43
+ 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128,
44
+ 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128,
45
+ 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128,
46
+ 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128,
47
+ 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128,
48
+ 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128,
49
+ 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128,
50
+ 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128,
51
+ 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128,
52
+ 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128,
53
+ 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128,
54
+ 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128,
55
+ 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128,
56
+ 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128,
57
+ 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128,
58
+ 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128,
59
+ 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128,
60
+ 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128,
61
+ 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128,
62
+ 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128,
63
+ 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128,
64
+ 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128,
65
+ 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128,
66
+ 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128,
67
+ 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128,
68
+ 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128,
69
+ 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128,
70
+ 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128,
71
+ 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128,
72
+ 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128,
73
+ 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128,
74
+ 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128,
75
+ 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128,
76
+ 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128,
77
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
78
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
79
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
80
+ 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255,
81
+ 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128,
82
+ 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128,
83
+ 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128,
84
+ 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128,
85
+ 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128,
86
+ 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128,
87
+ 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128,
88
+ 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128,
89
+ 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128,
90
+ 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128,
91
+ 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128,
92
+ 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128,
93
+ 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128,
94
+ 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128,
95
+ 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128,
96
+ 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128,
97
+ 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128,
98
+ 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128,
99
+ 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128,
100
+ 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128,
101
+ 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128,
102
+ 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128,
103
+ 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128
104
+ ]);
105
+
106
+ /**
107
+ * The probability that a frame header updates each of {@link VP8_COEFFICIENT_DEFAULT_PROBABILITIES} (RFC 6386 §13.4),
108
+ * in the same order.
109
+ *
110
+ * @type {Uint8Array}
111
+ */
112
+ export const VP8_COEFFICIENT_UPDATE_PROBABILITIES = new Uint8Array([
113
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
114
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
115
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
116
+ 176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255,
117
+ 223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255,
118
+ 249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255,
119
+ 255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255,
120
+ 234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255,
121
+ 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
122
+ 255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255,
123
+ 239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255,
124
+ 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255,
125
+ 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255,
126
+ 251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255,
127
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
128
+ 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255,
129
+ 251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255,
130
+ 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255,
131
+ 255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255,
132
+ 250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255,
133
+ 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
134
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
135
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
136
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
137
+ 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
138
+ 225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255,
139
+ 234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255,
140
+ 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
141
+ 223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255,
142
+ 238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255,
143
+ 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255,
144
+ 249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
145
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
146
+ 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255,
147
+ 247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
148
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
149
+ 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255,
150
+ 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
151
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
152
+ 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255,
153
+ 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
154
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
155
+ 255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255,
156
+ 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
157
+ 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
158
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
159
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
160
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
161
+ 186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255,
162
+ 234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255,
163
+ 251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255,
164
+ 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255,
165
+ 236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255,
166
+ 251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255,
167
+ 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255,
168
+ 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255,
169
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
170
+ 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
171
+ 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
172
+ 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
173
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
174
+ 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
175
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
176
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
177
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
178
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
179
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
180
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
181
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
182
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
183
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
184
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
185
+ 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
186
+ 250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255,
187
+ 248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255,
188
+ 255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255,
189
+ 246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255,
190
+ 252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255,
191
+ 255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255,
192
+ 248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255,
193
+ 253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255,
194
+ 255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255,
195
+ 245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255,
196
+ 253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255,
197
+ 255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255,
198
+ 252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255,
199
+ 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
200
+ 255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255,
201
+ 249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255,
202
+ 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255,
203
+ 255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255,
204
+ 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
205
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
206
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
207
+ 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
208
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
209
+ ]);
210
+
211
+ /**
212
+ * The probabilities of a key frame's sub-block mode tree given the modes of the sub-blocks above and to the left
213
+ * (RFC 6386 §11.5): [above 10][left 10][tree node 9], flattened, modes numbered as {@link Vp8SubblockMode}.
214
+ *
215
+ * @type {Uint8Array}
216
+ */
217
+ export const VP8_SUBBLOCK_MODE_PROBABILITIES = new Uint8Array([
218
+ 231, 120, 48, 89, 115, 113, 120, 152, 112,
219
+ 152, 179, 64, 126, 170, 118, 46, 70, 95,
220
+ 175, 69, 143, 80, 85, 82, 72, 155, 103,
221
+ 56, 58, 10, 171, 218, 189, 17, 13, 152,
222
+ 114, 26, 17, 163, 44, 195, 21, 10, 173,
223
+ 121, 24, 80, 195, 26, 62, 44, 64, 85,
224
+ 144, 71, 10, 38, 171, 213, 144, 34, 26,
225
+ 170, 46, 55, 19, 136, 160, 33, 206, 71,
226
+ 63, 20, 8, 114, 114, 208, 12, 9, 226,
227
+ 81, 40, 11, 96, 182, 84, 29, 16, 36,
228
+ 134, 183, 89, 137, 98, 101, 106, 165, 148,
229
+ 72, 187, 100, 130, 157, 111, 32, 75, 80,
230
+ 66, 102, 167, 99, 74, 62, 40, 234, 128,
231
+ 41, 53, 9, 178, 241, 141, 26, 8, 107,
232
+ 74, 43, 26, 146, 73, 166, 49, 23, 157,
233
+ 65, 38, 105, 160, 51, 52, 31, 115, 128,
234
+ 104, 79, 12, 27, 217, 255, 87, 17, 7,
235
+ 87, 68, 71, 44, 114, 51, 15, 186, 23,
236
+ 47, 41, 14, 110, 182, 183, 21, 17, 194,
237
+ 66, 45, 25, 102, 197, 189, 23, 18, 22,
238
+ 88, 88, 147, 150, 42, 46, 45, 196, 205,
239
+ 43, 97, 183, 117, 85, 38, 35, 179, 61,
240
+ 39, 53, 200, 87, 26, 21, 43, 232, 171,
241
+ 56, 34, 51, 104, 114, 102, 29, 93, 77,
242
+ 39, 28, 85, 171, 58, 165, 90, 98, 64,
243
+ 34, 22, 116, 206, 23, 34, 43, 166, 73,
244
+ 107, 54, 32, 26, 51, 1, 81, 43, 31,
245
+ 68, 25, 106, 22, 64, 171, 36, 225, 114,
246
+ 34, 19, 21, 102, 132, 188, 16, 76, 124,
247
+ 62, 18, 78, 95, 85, 57, 50, 48, 51,
248
+ 193, 101, 35, 159, 215, 111, 89, 46, 111,
249
+ 60, 148, 31, 172, 219, 228, 21, 18, 111,
250
+ 112, 113, 77, 85, 179, 255, 38, 120, 114,
251
+ 40, 42, 1, 196, 245, 209, 10, 25, 109,
252
+ 88, 43, 29, 140, 166, 213, 37, 43, 154,
253
+ 61, 63, 30, 155, 67, 45, 68, 1, 209,
254
+ 100, 80, 8, 43, 154, 1, 51, 26, 71,
255
+ 142, 78, 78, 16, 255, 128, 34, 197, 171,
256
+ 41, 40, 5, 102, 211, 183, 4, 1, 221,
257
+ 51, 50, 17, 168, 209, 192, 23, 25, 82,
258
+ 138, 31, 36, 171, 27, 166, 38, 44, 229,
259
+ 67, 87, 58, 169, 82, 115, 26, 59, 179,
260
+ 63, 59, 90, 180, 59, 166, 93, 73, 154,
261
+ 40, 40, 21, 116, 143, 209, 34, 39, 175,
262
+ 47, 15, 16, 183, 34, 223, 49, 45, 183,
263
+ 46, 17, 33, 183, 6, 98, 15, 32, 183,
264
+ 57, 46, 22, 24, 128, 1, 54, 17, 37,
265
+ 65, 32, 73, 115, 28, 128, 23, 128, 205,
266
+ 40, 3, 9, 115, 51, 192, 18, 6, 223,
267
+ 87, 37, 9, 115, 59, 77, 64, 21, 47,
268
+ 104, 55, 44, 218, 9, 54, 53, 130, 226,
269
+ 64, 90, 70, 205, 40, 41, 23, 26, 57,
270
+ 54, 57, 112, 184, 5, 41, 38, 166, 213,
271
+ 30, 34, 26, 133, 152, 116, 10, 32, 134,
272
+ 39, 19, 53, 221, 26, 114, 32, 73, 255,
273
+ 31, 9, 65, 234, 2, 15, 1, 118, 73,
274
+ 75, 32, 12, 51, 192, 255, 160, 43, 51,
275
+ 88, 31, 35, 67, 102, 85, 55, 186, 85,
276
+ 56, 21, 23, 111, 59, 205, 45, 37, 192,
277
+ 55, 38, 70, 124, 73, 102, 1, 34, 98,
278
+ 125, 98, 42, 88, 104, 85, 117, 175, 82,
279
+ 95, 84, 53, 89, 128, 100, 113, 101, 45,
280
+ 75, 79, 123, 47, 51, 128, 81, 171, 1,
281
+ 57, 17, 5, 71, 102, 57, 53, 41, 49,
282
+ 38, 33, 13, 121, 57, 73, 26, 1, 85,
283
+ 41, 10, 67, 138, 77, 110, 90, 47, 114,
284
+ 115, 21, 2, 10, 102, 255, 166, 23, 6,
285
+ 101, 29, 16, 10, 85, 128, 101, 196, 26,
286
+ 57, 18, 10, 102, 102, 213, 34, 20, 43,
287
+ 117, 20, 15, 36, 163, 128, 68, 1, 26,
288
+ 102, 61, 71, 37, 34, 53, 31, 243, 192,
289
+ 69, 60, 71, 38, 73, 119, 28, 222, 37,
290
+ 68, 45, 128, 34, 1, 47, 11, 245, 171,
291
+ 62, 17, 19, 70, 146, 85, 55, 62, 70,
292
+ 37, 43, 37, 154, 100, 163, 85, 160, 1,
293
+ 63, 9, 92, 136, 28, 64, 32, 201, 85,
294
+ 75, 15, 9, 9, 64, 255, 184, 119, 16,
295
+ 86, 6, 28, 5, 64, 255, 25, 248, 1,
296
+ 56, 8, 17, 132, 137, 255, 55, 116, 128,
297
+ 58, 15, 20, 82, 135, 57, 26, 121, 40,
298
+ 164, 50, 31, 137, 154, 133, 25, 35, 218,
299
+ 51, 103, 44, 131, 131, 123, 31, 6, 158,
300
+ 86, 40, 64, 135, 148, 224, 45, 183, 128,
301
+ 22, 26, 17, 131, 240, 154, 14, 1, 209,
302
+ 45, 16, 21, 91, 64, 222, 7, 1, 197,
303
+ 56, 21, 39, 155, 60, 138, 23, 102, 213,
304
+ 83, 12, 13, 54, 192, 255, 68, 47, 28,
305
+ 85, 26, 85, 85, 128, 128, 32, 146, 171,
306
+ 18, 11, 7, 63, 144, 171, 4, 4, 246,
307
+ 35, 27, 10, 146, 174, 171, 12, 26, 128,
308
+ 190, 80, 35, 99, 180, 80, 126, 54, 45,
309
+ 85, 126, 47, 87, 176, 51, 41, 20, 32,
310
+ 101, 75, 128, 139, 118, 146, 116, 128, 85,
311
+ 56, 41, 15, 176, 236, 85, 37, 9, 62,
312
+ 71, 30, 17, 119, 118, 255, 17, 18, 138,
313
+ 101, 38, 60, 138, 55, 70, 43, 26, 142,
314
+ 146, 36, 19, 30, 171, 255, 97, 27, 20,
315
+ 138, 45, 61, 62, 219, 1, 81, 188, 64,
316
+ 32, 41, 20, 117, 151, 142, 20, 21, 163,
317
+ 112, 19, 12, 61, 195, 128, 48, 4, 24
318
+ ]);
319
+
320
+ /**
321
+ * DC dequantization factor of each quantizer index (RFC 6386 §14.1).
322
+ *
323
+ * @type {Uint8Array}
324
+ */
325
+ export const VP8_DC_QUANTIZER = new Uint8Array([
326
+ 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17,
327
+ 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28,
328
+ 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43,
329
+ 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
330
+ 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
331
+ 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
332
+ 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118,
333
+ 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157
334
+ ]);
335
+
336
+ /**
337
+ * AC dequantization factor of each quantizer index (RFC 6386 §14.1).
338
+ *
339
+ * @type {Uint16Array}
340
+ */
341
+ export const VP8_AC_QUANTIZER = new Uint16Array([
342
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
343
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
344
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
345
+ 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76,
346
+ 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108,
347
+ 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152,
348
+ 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209,
349
+ 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284
350
+ ]);
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Adds the inverse DCT of a 4×4 block of dequantized coefficients to the prediction under it, clipping to a byte.
3
+ *
4
+ * @param {Int16Array} coefficients
5
+ * @param {number} from where the block's 16 coefficients start, in raster order
6
+ * @param {Uint8Array} plane
7
+ * @param {number} offset of the block's top-left sample
8
+ * @param {number} stride
9
+ *
10
+ * @author Alex Goldring
11
+ * @copyright Company Named Limited (c) 2026
12
+ */
13
+ export function vp8_inverse_dct_add(coefficients: Int16Array, from: number, plane: Uint8Array, offset: number, stride: number): void;
14
+ /**
15
+ * The inverse Walsh-Hadamard transform of a macroblock's second-order block: the DC coefficient of each of its 16 luma
16
+ * blocks.
17
+ *
18
+ * @param {Int16Array} input 16 dequantized coefficients in raster order
19
+ * @param {Int16Array} coefficients the macroblock's 16 luma blocks of 16, whose first coefficients this writes
20
+ */
21
+ export function vp8_inverse_wht(input: Int16Array, coefficients: Int16Array): void;
22
+ //# sourceMappingURL=vp8_transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vp8_transform.d.ts","sourceRoot":"","sources":["../../../../../../src/format/image/webp/vp8/vp8_transform.js"],"names":[],"mappings":"AA2BA;;;;;;;;;;;GAWG;AACH,kDATW,UAAU,QACV,MAAM,SACN,UAAU,UACV,MAAM,UACN,MAAM,QAqChB;AAUD;;;;;;GAMG;AACH,uCAHW,UAAU,gBACV,UAAU,QA2BpB"}
@@ -0,0 +1,114 @@
1
+ /*
2
+ The inverse transforms of VP8 (RFC 6386 §14.3 and §14.4), in the exact integer arithmetic every decoder shares.
3
+ */
4
+
5
+ /**
6
+ * @param {number} a
7
+ * @returns {number} `a × √2 cos(π/8)`, as 16.16 fixed point gives it
8
+ */
9
+ function mul1(a) {
10
+ return ((a * 20091) >> 16) + a;
11
+ }
12
+
13
+ /**
14
+ * @param {number} a
15
+ * @returns {number} `a × √2 sin(π/8)`, as 16.16 fixed point gives it
16
+ */
17
+ function mul2(a) {
18
+ return (a * 35468) >> 16;
19
+ }
20
+
21
+ /**
22
+ * Columns first, into this.
23
+ *
24
+ * @type {Int32Array}
25
+ */
26
+ const scratch = new Int32Array(16);
27
+
28
+ /**
29
+ * Adds the inverse DCT of a 4×4 block of dequantized coefficients to the prediction under it, clipping to a byte.
30
+ *
31
+ * @param {Int16Array} coefficients
32
+ * @param {number} from where the block's 16 coefficients start, in raster order
33
+ * @param {Uint8Array} plane
34
+ * @param {number} offset of the block's top-left sample
35
+ * @param {number} stride
36
+ *
37
+ * @author Alex Goldring
38
+ * @copyright Company Named Limited (c) 2026
39
+ */
40
+ export function vp8_inverse_dct_add(coefficients, from, plane, offset, stride) {
41
+ for (let i = 0; i < 4; i++) {
42
+ const c0 = coefficients[from + i];
43
+ const c4 = coefficients[from + 4 + i];
44
+ const c8 = coefficients[from + 8 + i];
45
+ const c12 = coefficients[from + 12 + i];
46
+
47
+ const a = c0 + c8;
48
+ const b = c0 - c8;
49
+ const c = mul2(c4) - mul1(c12);
50
+ const d = mul1(c4) + mul2(c12);
51
+
52
+ scratch[i * 4] = a + d;
53
+ scratch[i * 4 + 1] = b + c;
54
+ scratch[i * 4 + 2] = b - c;
55
+ scratch[i * 4 + 3] = a - d;
56
+ }
57
+
58
+ for (let i = 0; i < 4; i++) {
59
+ const dc = scratch[i] + 4;
60
+ const a = dc + scratch[8 + i];
61
+ const b = dc - scratch[8 + i];
62
+ const c = mul2(scratch[4 + i]) - mul1(scratch[12 + i]);
63
+ const d = mul1(scratch[4 + i]) + mul2(scratch[12 + i]);
64
+
65
+ const row = offset + i * stride;
66
+
67
+ plane[row] = clip(plane[row] + ((a + d) >> 3));
68
+ plane[row + 1] = clip(plane[row + 1] + ((b + c) >> 3));
69
+ plane[row + 2] = clip(plane[row + 2] + ((b - c) >> 3));
70
+ plane[row + 3] = clip(plane[row + 3] + ((a - d) >> 3));
71
+ }
72
+ }
73
+
74
+ /**
75
+ * @param {number} v
76
+ * @returns {number}
77
+ */
78
+ function clip(v) {
79
+ return v < 0 ? 0 : v > 255 ? 255 : v;
80
+ }
81
+
82
+ /**
83
+ * The inverse Walsh-Hadamard transform of a macroblock's second-order block: the DC coefficient of each of its 16 luma
84
+ * blocks.
85
+ *
86
+ * @param {Int16Array} input 16 dequantized coefficients in raster order
87
+ * @param {Int16Array} coefficients the macroblock's 16 luma blocks of 16, whose first coefficients this writes
88
+ */
89
+ export function vp8_inverse_wht(input, coefficients) {
90
+ for (let i = 0; i < 4; i++) {
91
+ const a0 = input[i] + input[12 + i];
92
+ const a1 = input[4 + i] + input[8 + i];
93
+ const a2 = input[4 + i] - input[8 + i];
94
+ const a3 = input[i] - input[12 + i];
95
+
96
+ scratch[i] = a0 + a1;
97
+ scratch[8 + i] = a0 - a1;
98
+ scratch[4 + i] = a3 + a2;
99
+ scratch[12 + i] = a3 - a2;
100
+ }
101
+
102
+ for (let i = 0; i < 4; i++) {
103
+ const dc = scratch[i * 4] + 3;
104
+ const a0 = dc + scratch[i * 4 + 3];
105
+ const a1 = scratch[i * 4 + 1] + scratch[i * 4 + 2];
106
+ const a2 = scratch[i * 4 + 1] - scratch[i * 4 + 2];
107
+ const a3 = dc - scratch[i * 4 + 3];
108
+
109
+ coefficients[(i * 4) * 16] = (a0 + a1) >> 3;
110
+ coefficients[(i * 4 + 1) * 16] = (a3 + a2) >> 3;
111
+ coefficients[(i * 4 + 2) * 16] = (a0 - a1) >> 3;
112
+ coefficients[(i * 4 + 3) * 16] = (a3 - a2) >> 3;
113
+ }
114
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A decoded VP8 picture as opaque RGBA, its chroma upsampled by interpolation as libwebp's default output does, so a
3
+ * picture decodes to what a browser shows.
4
+ *
5
+ * Luma row `r` sits between chroma rows `(r - 1) / 2` and `(r + 1) / 2`, nearer the one it shares a sample position
6
+ * with; the first row, and the last of a picture of even height, have only one chroma row and take it as both.
7
+ *
8
+ * @param {Uint8Array} y_plane
9
+ * @param {number} y_stride
10
+ * @param {number} y_origin the picture's first luma sample
11
+ * @param {Uint8Array} u_plane
12
+ * @param {Uint8Array} v_plane
13
+ * @param {number} uv_stride
14
+ * @param {number} uv_origin the picture's first chroma sample
15
+ * @param {number} width
16
+ * @param {number} height
17
+ * @returns {Uint8Array} RGBA, width × height
18
+ *
19
+ * @author Alex Goldring
20
+ * @copyright Company Named Limited (c) 2026
21
+ */
22
+ export function vp8_yuv_to_rgba(y_plane: Uint8Array, y_stride: number, y_origin: number, u_plane: Uint8Array, v_plane: Uint8Array, uv_stride: number, uv_origin: number, width: number, height: number): Uint8Array;
23
+ //# sourceMappingURL=vp8_yuv_to_rgba.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vp8_yuv_to_rgba.d.ts","sourceRoot":"","sources":["../../../../../../src/format/image/webp/vp8/vp8_yuv_to_rgba.js"],"names":[],"mappings":"AAqFA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yCAdW,UAAU,YACV,MAAM,YACN,MAAM,WACN,UAAU,WACV,UAAU,aACV,MAAM,aACN,MAAM,SACN,MAAM,UACN,MAAM,GACJ,UAAU,CA+BtB"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * @param {number} v
3
+ * @param {number} coefficient
4
+ * @returns {number}
5
+ */
6
+ function mult_hi(v, coefficient) {
7
+ return (v * coefficient) >> 8;
8
+ }
9
+
10
+ /**
11
+ * @param {number} v a channel with six fractional bits
12
+ * @returns {number} the byte it rounds down to, clamped
13
+ */
14
+ function clip8(v) {
15
+ return (v & ~16383) === 0 ? v >> 6 : v < 0 ? 0 : 255;
16
+ }
17
+
18
+ /**
19
+ * Writes one pixel's RGB from its Y'CbCr, as libwebp converts: BT.601, studio swing, in fixed point with six
20
+ * fractional bits.
21
+ *
22
+ * @param {Uint8Array} out
23
+ * @param {number} at
24
+ * @param {number} y
25
+ * @param {number} u
26
+ * @param {number} v
27
+ */
28
+ function put_rgb(out, at, y, u, v) {
29
+ const luma = mult_hi(y, 19077);
30
+
31
+ out[at] = clip8(luma + mult_hi(v, 26149) - 14234);
32
+ out[at + 1] = clip8(luma - mult_hi(u, 6419) - mult_hi(v, 13320) + 8708);
33
+ out[at + 2] = clip8(luma + mult_hi(u, 33050) - 17685);
34
+ }
35
+
36
+ /**
37
+ * One row of pixels from its luma and the two rows of chroma around it: each chroma sample is interpolated between the
38
+ * four nearest, weighted 9, 3, 3 and 1 by nearness, and a pixel at the row's ends takes 3 to 1 of the nearer row.
39
+ *
40
+ * @param {Uint8Array} out RGBA
41
+ * @param {number} out_at the row's first pixel
42
+ * @param {Uint8Array} y_plane
43
+ * @param {number} y_at the row's first luma sample
44
+ * @param {Uint8Array} u_plane
45
+ * @param {Uint8Array} v_plane
46
+ * @param {number} near_at the first chroma sample of the nearer chroma row
47
+ * @param {number} far_at the first chroma sample of the farther chroma row
48
+ * @param {number} width
49
+ */
50
+ function upsample_row(out, out_at, y_plane, y_at, u_plane, v_plane, near_at, far_at, width) {
51
+ const last_pair = (width - 1) >> 1;
52
+
53
+ put_rgb(out, out_at, y_plane[y_at],
54
+ (3 * u_plane[near_at] + u_plane[far_at] + 2) >> 2,
55
+ (3 * v_plane[near_at] + v_plane[far_at] + 2) >> 2
56
+ );
57
+
58
+ for (let i = 1; i <= last_pair; i++) {
59
+ const unl = u_plane[near_at + i - 1], unr = u_plane[near_at + i];
60
+ const ufl = u_plane[far_at + i - 1], ufr = u_plane[far_at + i];
61
+ const vnl = v_plane[near_at + i - 1], vnr = v_plane[near_at + i];
62
+ const vfl = v_plane[far_at + i - 1], vfr = v_plane[far_at + i];
63
+
64
+ const u_sum = unl + unr + ufl + ufr + 8;
65
+ const v_sum = vnl + vnr + vfl + vfr + 8;
66
+
67
+ put_rgb(out, out_at + (2 * i - 1) * 4, y_plane[y_at + 2 * i - 1],
68
+ (((u_sum + 2 * (unr + ufl)) >> 3) + unl) >> 1,
69
+ (((v_sum + 2 * (vnr + vfl)) >> 3) + vnl) >> 1
70
+ );
71
+
72
+ put_rgb(out, out_at + 2 * i * 4, y_plane[y_at + 2 * i],
73
+ (((u_sum + 2 * (unl + ufr)) >> 3) + unr) >> 1,
74
+ (((v_sum + 2 * (vnl + vfr)) >> 3) + vnr) >> 1
75
+ );
76
+ }
77
+
78
+ if ((width & 1) === 0) {
79
+ put_rgb(out, out_at + (width - 1) * 4, y_plane[y_at + width - 1],
80
+ (3 * u_plane[near_at + last_pair] + u_plane[far_at + last_pair] + 2) >> 2,
81
+ (3 * v_plane[near_at + last_pair] + v_plane[far_at + last_pair] + 2) >> 2
82
+ );
83
+ }
84
+ }
85
+
86
+ /**
87
+ * A decoded VP8 picture as opaque RGBA, its chroma upsampled by interpolation as libwebp's default output does, so a
88
+ * picture decodes to what a browser shows.
89
+ *
90
+ * Luma row `r` sits between chroma rows `(r - 1) / 2` and `(r + 1) / 2`, nearer the one it shares a sample position
91
+ * with; the first row, and the last of a picture of even height, have only one chroma row and take it as both.
92
+ *
93
+ * @param {Uint8Array} y_plane
94
+ * @param {number} y_stride
95
+ * @param {number} y_origin the picture's first luma sample
96
+ * @param {Uint8Array} u_plane
97
+ * @param {Uint8Array} v_plane
98
+ * @param {number} uv_stride
99
+ * @param {number} uv_origin the picture's first chroma sample
100
+ * @param {number} width
101
+ * @param {number} height
102
+ * @returns {Uint8Array} RGBA, width × height
103
+ *
104
+ * @author Alex Goldring
105
+ * @copyright Company Named Limited (c) 2026
106
+ */
107
+ export function vp8_yuv_to_rgba(y_plane, y_stride, y_origin, u_plane, v_plane, uv_stride, uv_origin, width, height) {
108
+ const out = new Uint8Array(width * height * 4);
109
+
110
+ for (let r = 0; r < height; r++) {
111
+ let near;
112
+ let far;
113
+
114
+ if (r === 0) {
115
+ near = far = 0;
116
+ } else if ((r & 1) === 1) {
117
+ near = (r - 1) >> 1;
118
+ far = r === height - 1 ? near : near + 1;
119
+ } else {
120
+ near = r >> 1;
121
+ far = near - 1;
122
+ }
123
+
124
+ upsample_row(out, r * width * 4, y_plane, y_origin + r * y_stride, u_plane, v_plane,
125
+ uv_origin + near * uv_stride, uv_origin + far * uv_stride, width);
126
+ }
127
+
128
+ for (let i = 3; i < out.length; i += 4) {
129
+ out[i] = 255;
130
+ }
131
+
132
+ return out;
133
+ }