@woosh/meep-engine 3.9.0 → 3.11.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 (832) hide show
  1. package/README.md +168 -152
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/build/bundle-worker-terrain.js +1 -1
  4. package/package.json +3 -2
  5. package/src/REVIEW_2026_08_06.md +610 -610
  6. package/src/avif/encode_image_source.d.ts +70 -0
  7. package/src/avif/encode_image_source.d.ts.map +1 -0
  8. package/src/avif/encode_image_source.js +117 -0
  9. package/src/avif/encoder_worker.js +15 -126
  10. package/src/avif/index.d.ts +4 -2
  11. package/src/avif/index.js +21 -2
  12. package/src/avif/native/DECISIONS.md +537 -0
  13. package/src/avif/native/NOTICE.md +61 -0
  14. package/src/avif/native/api/AvifDecoder.d.ts +67 -0
  15. package/src/avif/native/api/AvifDecoder.d.ts.map +1 -0
  16. package/src/avif/native/api/AvifDecoder.js +121 -0
  17. package/src/avif/native/api/apply_transformations.d.ts +30 -0
  18. package/src/avif/native/api/apply_transformations.d.ts.map +1 -0
  19. package/src/avif/native/api/apply_transformations.js +120 -0
  20. package/src/avif/native/api/avif_to_sampler2d.d.ts +25 -0
  21. package/src/avif/native/api/avif_to_sampler2d.d.ts.map +1 -0
  22. package/src/avif/native/api/avif_to_sampler2d.js +42 -0
  23. package/src/avif/native/api/convert_to_rgba.d.ts +54 -0
  24. package/src/avif/native/api/convert_to_rgba.d.ts.map +1 -0
  25. package/src/avif/native/api/convert_to_rgba.js +204 -0
  26. package/src/avif/native/api/decode_avif.d.ts +24 -0
  27. package/src/avif/native/api/decode_avif.d.ts.map +1 -0
  28. package/src/avif/native/api/decode_avif.js +111 -0
  29. package/src/avif/native/api/decode_image_item.d.ts +18 -0
  30. package/src/avif/native/api/decode_image_item.d.ts.map +1 -0
  31. package/src/avif/native/api/decode_image_item.js +234 -0
  32. package/src/avif/native/api/encode_avif.d.ts +73 -0
  33. package/src/avif/native/api/encode_avif.d.ts.map +1 -0
  34. package/src/avif/native/api/encode_avif.js +488 -0
  35. package/src/avif/native/api/sampler2d_to_avif.d.ts +22 -0
  36. package/src/avif/native/api/sampler2d_to_avif.d.ts.map +1 -0
  37. package/src/avif/native/api/sampler2d_to_avif.js +108 -0
  38. package/src/avif/native/av1/decode/Av1FrameContext.d.ts +286 -0
  39. package/src/avif/native/av1/decode/Av1FrameContext.d.ts.map +1 -0
  40. package/src/avif/native/av1/decode/Av1FrameContext.js +622 -0
  41. package/src/avif/native/av1/decode/block_decoded.d.ts +27 -0
  42. package/src/avif/native/av1/decode/block_decoded.d.ts.map +1 -0
  43. package/src/avif/native/av1/decode/block_decoded.js +59 -0
  44. package/src/avif/native/av1/decode/decode_av1_still.d.ts +22 -0
  45. package/src/avif/native/av1/decode/decode_av1_still.d.ts.map +1 -0
  46. package/src/avif/native/av1/decode/decode_av1_still.js +309 -0
  47. package/src/avif/native/av1/decode/decode_coefficients.d.ts +20 -0
  48. package/src/avif/native/av1/decode/decode_coefficients.d.ts.map +1 -0
  49. package/src/avif/native/av1/decode/decode_coefficients.js +259 -0
  50. package/src/avif/native/av1/decode/decode_palette.d.ts +28 -0
  51. package/src/avif/native/av1/decode/decode_palette.d.ts.map +1 -0
  52. package/src/avif/native/av1/decode/decode_palette.js +442 -0
  53. package/src/avif/native/av1/decode/decode_tile.d.ts +14 -0
  54. package/src/avif/native/av1/decode/decode_tile.d.ts.map +1 -0
  55. package/src/avif/native/av1/decode/decode_tile.js +1213 -0
  56. package/src/avif/native/av1/decode/get_scan.d.ts +16 -0
  57. package/src/avif/native/av1/decode/get_scan.d.ts.map +1 -0
  58. package/src/avif/native/av1/decode/get_scan.js +138 -0
  59. package/src/avif/native/av1/decode/read_lr.d.ts +35 -0
  60. package/src/avif/native/av1/decode/read_lr.d.ts.map +1 -0
  61. package/src/avif/native/av1/decode/read_lr.js +277 -0
  62. package/src/avif/native/av1/decode/read_transform_type.d.ts +19 -0
  63. package/src/avif/native/av1/decode/read_transform_type.d.ts.map +1 -0
  64. package/src/avif/native/av1/decode/read_transform_type.js +92 -0
  65. package/src/avif/native/av1/decode/reconstruct.d.ts +36 -0
  66. package/src/avif/native/av1/decode/reconstruct.d.ts.map +1 -0
  67. package/src/avif/native/av1/decode/reconstruct.js +241 -0
  68. package/src/avif/native/av1/decode/transform_type.d.ts +49 -0
  69. package/src/avif/native/av1/decode/transform_type.d.ts.map +1 -0
  70. package/src/avif/native/av1/decode/transform_type.js +137 -0
  71. package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts +81 -0
  72. package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts.map +1 -0
  73. package/src/avif/native/av1/encode/Av1BlockSnapshot.js +299 -0
  74. package/src/avif/native/av1/encode/Av1EncodeContext.d.ts +384 -0
  75. package/src/avif/native/av1/encode/Av1EncodeContext.d.ts.map +1 -0
  76. package/src/avif/native/av1/encode/Av1EncodeContext.js +590 -0
  77. package/src/avif/native/av1/encode/build_headers.d.ts +50 -0
  78. package/src/avif/native/av1/encode/build_headers.d.ts.map +1 -0
  79. package/src/avif/native/av1/encode/build_headers.js +359 -0
  80. package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts +26 -0
  81. package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts.map +1 -0
  82. package/src/avif/native/av1/encode/choose_chroma_alpha.js +90 -0
  83. package/src/avif/native/av1/encode/choose_filters.d.ts +21 -0
  84. package/src/avif/native/av1/encode/choose_filters.d.ts.map +1 -0
  85. package/src/avif/native/av1/encode/choose_filters.js +318 -0
  86. package/src/avif/native/av1/encode/choose_restoration.d.ts +35 -0
  87. package/src/avif/native/av1/encode/choose_restoration.d.ts.map +1 -0
  88. package/src/avif/native/av1/encode/choose_restoration.js +616 -0
  89. package/src/avif/native/av1/encode/decode_effort.d.ts +57 -0
  90. package/src/avif/native/av1/encode/decode_effort.d.ts.map +1 -0
  91. package/src/avif/native/av1/encode/decode_effort.js +59 -0
  92. package/src/avif/native/av1/encode/encode_av1_still.d.ts +17 -0
  93. package/src/avif/native/av1/encode/encode_av1_still.d.ts.map +1 -0
  94. package/src/avif/native/av1/encode/encode_av1_still.js +194 -0
  95. package/src/avif/native/av1/encode/encode_effort.d.ts +56 -0
  96. package/src/avif/native/av1/encode/encode_effort.d.ts.map +1 -0
  97. package/src/avif/native/av1/encode/encode_effort.js +97 -0
  98. package/src/avif/native/av1/encode/encode_tile.d.ts +26 -0
  99. package/src/avif/native/av1/encode/encode_tile.d.ts.map +1 -0
  100. package/src/avif/native/av1/encode/encode_tile.js +2331 -0
  101. package/src/avif/native/av1/encode/quantise.d.ts +51 -0
  102. package/src/avif/native/av1/encode/quantise.d.ts.map +1 -0
  103. package/src/avif/native/av1/encode/quantise.js +212 -0
  104. package/src/avif/native/av1/encode/write_coefficients.d.ts +42 -0
  105. package/src/avif/native/av1/encode/write_coefficients.d.ts.map +1 -0
  106. package/src/avif/native/av1/encode/write_coefficients.js +367 -0
  107. package/src/avif/native/av1/encode/write_lr.d.ts +33 -0
  108. package/src/avif/native/av1/encode/write_lr.d.ts.map +1 -0
  109. package/src/avif/native/av1/encode/write_lr.js +174 -0
  110. package/src/avif/native/av1/encode/write_transform_type.d.ts +21 -0
  111. package/src/avif/native/av1/encode/write_transform_type.d.ts.map +1 -0
  112. package/src/avif/native/av1/encode/write_transform_type.js +70 -0
  113. package/src/avif/native/av1/entropy/CdfContext.d.ts +167 -0
  114. package/src/avif/native/av1/entropy/CdfContext.d.ts.map +1 -0
  115. package/src/avif/native/av1/entropy/CdfContext.js +433 -0
  116. package/src/avif/native/av1/entropy/SymbolReader.d.ts +103 -0
  117. package/src/avif/native/av1/entropy/SymbolReader.d.ts.map +1 -0
  118. package/src/avif/native/av1/entropy/SymbolReader.js +317 -0
  119. package/src/avif/native/av1/entropy/SymbolWriter.d.ts +107 -0
  120. package/src/avif/native/av1/entropy/SymbolWriter.d.ts.map +1 -0
  121. package/src/avif/native/av1/entropy/SymbolWriter.js +352 -0
  122. package/src/avif/native/av1/entropy/coefficient_context.d.ts +71 -0
  123. package/src/avif/native/av1/entropy/coefficient_context.d.ts.map +1 -0
  124. package/src/avif/native/av1/entropy/coefficient_context.js +325 -0
  125. package/src/avif/native/av1/entropy/partition_cdf.d.ts +54 -0
  126. package/src/avif/native/av1/entropy/partition_cdf.d.ts.map +1 -0
  127. package/src/avif/native/av1/entropy/partition_cdf.js +98 -0
  128. package/src/avif/native/av1/entropy/symbol_cost.d.ts +37 -0
  129. package/src/avif/native/av1/entropy/symbol_cost.d.ts.map +1 -0
  130. package/src/avif/native/av1/entropy/symbol_cost.js +76 -0
  131. package/src/avif/native/av1/filter/cdef.d.ts +15 -0
  132. package/src/avif/native/av1/filter/cdef.d.ts.map +1 -0
  133. package/src/avif/native/av1/filter/cdef.js +313 -0
  134. package/src/avif/native/av1/filter/loop_filter.d.ts +14 -0
  135. package/src/avif/native/av1/filter/loop_filter.d.ts.map +1 -0
  136. package/src/avif/native/av1/filter/loop_filter.js +377 -0
  137. package/src/avif/native/av1/filter/loop_restoration.d.ts +42 -0
  138. package/src/avif/native/av1/filter/loop_restoration.d.ts.map +1 -0
  139. package/src/avif/native/av1/filter/loop_restoration.js +451 -0
  140. package/src/avif/native/av1/filter/superres.d.ts +18 -0
  141. package/src/avif/native/av1/filter/superres.d.ts.map +1 -0
  142. package/src/avif/native/av1/filter/superres.js +86 -0
  143. package/src/avif/native/av1/grain/FilmGrainState.d.ts +62 -0
  144. package/src/avif/native/av1/grain/FilmGrainState.d.ts.map +1 -0
  145. package/src/avif/native/av1/grain/FilmGrainState.js +87 -0
  146. package/src/avif/native/av1/grain/film_grain.d.ts +16 -0
  147. package/src/avif/native/av1/grain/film_grain.d.ts.map +1 -0
  148. package/src/avif/native/av1/grain/film_grain.js +623 -0
  149. package/src/avif/native/av1/obu/FrameHeader.d.ts +248 -0
  150. package/src/avif/native/av1/obu/FrameHeader.d.ts.map +1 -0
  151. package/src/avif/native/av1/obu/FrameHeader.js +381 -0
  152. package/src/avif/native/av1/obu/ObuHeader.d.ts +53 -0
  153. package/src/avif/native/av1/obu/ObuHeader.d.ts.map +1 -0
  154. package/src/avif/native/av1/obu/ObuHeader.js +62 -0
  155. package/src/avif/native/av1/obu/SequenceHeader.d.ts +157 -0
  156. package/src/avif/native/av1/obu/SequenceHeader.d.ts.map +1 -0
  157. package/src/avif/native/av1/obu/SequenceHeader.js +225 -0
  158. package/src/avif/native/av1/obu/for_each_obu.d.ts +24 -0
  159. package/src/avif/native/av1/obu/for_each_obu.d.ts.map +1 -0
  160. package/src/avif/native/av1/obu/for_each_obu.js +50 -0
  161. package/src/avif/native/av1/obu/parse_frame_header.d.ts +18 -0
  162. package/src/avif/native/av1/obu/parse_frame_header.d.ts.map +1 -0
  163. package/src/avif/native/av1/obu/parse_frame_header.js +841 -0
  164. package/src/avif/native/av1/obu/parse_obu_header.d.ts +23 -0
  165. package/src/avif/native/av1/obu/parse_obu_header.d.ts.map +1 -0
  166. package/src/avif/native/av1/obu/parse_obu_header.js +69 -0
  167. package/src/avif/native/av1/obu/parse_sequence_header.d.ts +17 -0
  168. package/src/avif/native/av1/obu/parse_sequence_header.d.ts.map +1 -0
  169. package/src/avif/native/av1/obu/parse_sequence_header.js +263 -0
  170. package/src/avif/native/av1/obu/write_frame_header.d.ts +16 -0
  171. package/src/avif/native/av1/obu/write_frame_header.d.ts.map +1 -0
  172. package/src/avif/native/av1/obu/write_frame_header.js +579 -0
  173. package/src/avif/native/av1/obu/write_sequence_header.d.ts +17 -0
  174. package/src/avif/native/av1/obu/write_sequence_header.d.ts.map +1 -0
  175. package/src/avif/native/av1/obu/write_sequence_header.js +189 -0
  176. package/src/avif/native/av1/predict/IntraPredictionState.d.ts +49 -0
  177. package/src/avif/native/av1/predict/IntraPredictionState.d.ts.map +1 -0
  178. package/src/avif/native/av1/predict/IntraPredictionState.js +58 -0
  179. package/src/avif/native/av1/predict/intra_filter_type.d.ts +17 -0
  180. package/src/avif/native/av1/predict/intra_filter_type.d.ts.map +1 -0
  181. package/src/avif/native/av1/predict/intra_filter_type.js +79 -0
  182. package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts +50 -0
  183. package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts.map +1 -0
  184. package/src/avif/native/av1/predict/predict_chroma_from_luma.js +153 -0
  185. package/src/avif/native/av1/predict/predict_intra.d.ts +42 -0
  186. package/src/avif/native/av1/predict/predict_intra.d.ts.map +1 -0
  187. package/src/avif/native/av1/predict/predict_intra.js +803 -0
  188. package/src/avif/native/av1/predict/predict_palette.d.ts +23 -0
  189. package/src/avif/native/av1/predict/predict_palette.d.ts.map +1 -0
  190. package/src/avif/native/av1/predict/predict_palette.js +36 -0
  191. package/src/avif/native/av1/tables/av1_symbols.d.ts +411 -0
  192. package/src/avif/native/av1/tables/av1_symbols.d.ts.map +1 -0
  193. package/src/avif/native/av1/tables/av1_symbols.js +419 -0
  194. package/src/avif/native/av1/tables/block_tables.d.ts +181 -0
  195. package/src/avif/native/av1/tables/block_tables.d.ts.map +1 -0
  196. package/src/avif/native/av1/tables/block_tables.js +270 -0
  197. package/src/avif/native/av1/tables/cdf_tables.d.ts +961 -0
  198. package/src/avif/native/av1/tables/cdf_tables.d.ts.map +1 -0
  199. package/src/avif/native/av1/tables/cdf_tables.js +1893 -0
  200. package/src/avif/native/av1/tables/coefficient_tables.d.ts +41 -0
  201. package/src/avif/native/av1/tables/coefficient_tables.d.ts.map +1 -0
  202. package/src/avif/native/av1/tables/coefficient_tables.js +82 -0
  203. package/src/avif/native/av1/tables/derived_block_tables.d.ts +15 -0
  204. package/src/avif/native/av1/tables/derived_block_tables.d.ts.map +1 -0
  205. package/src/avif/native/av1/tables/derived_block_tables.js +23 -0
  206. package/src/avif/native/av1/tables/filter_tables.d.ts +171 -0
  207. package/src/avif/native/av1/tables/filter_tables.d.ts.map +1 -0
  208. package/src/avif/native/av1/tables/filter_tables.js +313 -0
  209. package/src/avif/native/av1/tables/grain_tables.d.ts +11 -0
  210. package/src/avif/native/av1/tables/grain_tables.d.ts.map +1 -0
  211. package/src/avif/native/av1/tables/grain_tables.js +190 -0
  212. package/src/avif/native/av1/tables/prediction_tables.d.ts +141 -0
  213. package/src/avif/native/av1/tables/prediction_tables.d.ts.map +1 -0
  214. package/src/avif/native/av1/tables/prediction_tables.js +223 -0
  215. package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts +21 -0
  216. package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts.map +1 -0
  217. package/src/avif/native/av1/tables/quantizer_matrix_tables.js +38 -0
  218. package/src/avif/native/av1/tables/quantizer_tables.d.ts +21 -0
  219. package/src/avif/native/av1/tables/quantizer_tables.d.ts.map +1 -0
  220. package/src/avif/native/av1/tables/quantizer_tables.js +160 -0
  221. package/src/avif/native/av1/tables/scan_tables.d.ts +321 -0
  222. package/src/avif/native/av1/tables/scan_tables.d.ts.map +1 -0
  223. package/src/avif/native/av1/tables/scan_tables.js +727 -0
  224. package/src/avif/native/av1/tables/segmentation_tables.d.ts +31 -0
  225. package/src/avif/native/av1/tables/segmentation_tables.d.ts.map +1 -0
  226. package/src/avif/native/av1/tables/segmentation_tables.js +48 -0
  227. package/src/avif/native/av1/tables/transform_tables.d.ts +91 -0
  228. package/src/avif/native/av1/tables/transform_tables.d.ts.map +1 -0
  229. package/src/avif/native/av1/tables/transform_tables.js +140 -0
  230. package/src/avif/native/av1/tables/unpack_table.d.ts +33 -0
  231. package/src/avif/native/av1/tables/unpack_table.d.ts.map +1 -0
  232. package/src/avif/native/av1/tables/unpack_table.js +73 -0
  233. package/src/avif/native/av1/transform/forward_transform_2d.d.ts +61 -0
  234. package/src/avif/native/av1/transform/forward_transform_2d.d.ts.map +1 -0
  235. package/src/avif/native/av1/transform/forward_transform_2d.js +574 -0
  236. package/src/avif/native/av1/transform/inverse_transform_1d.d.ts +76 -0
  237. package/src/avif/native/av1/transform/inverse_transform_1d.d.ts.map +1 -0
  238. package/src/avif/native/av1/transform/inverse_transform_1d.js +590 -0
  239. package/src/avif/native/av1/transform/inverse_transform_2d.d.ts +46 -0
  240. package/src/avif/native/av1/transform/inverse_transform_2d.d.ts.map +1 -0
  241. package/src/avif/native/av1/transform/inverse_transform_2d.js +180 -0
  242. package/src/avif/native/av1/util/ceil_log2.d.ts +13 -0
  243. package/src/avif/native/av1/util/ceil_log2.d.ts.map +1 -0
  244. package/src/avif/native/av1/util/ceil_log2.js +18 -0
  245. package/src/avif/native/av1/util/floor_log2.d.ts +20 -0
  246. package/src/avif/native/av1/util/floor_log2.d.ts.map +1 -0
  247. package/src/avif/native/av1/util/floor_log2.js +20 -0
  248. package/src/avif/native/av1/util/round2.d.ts +22 -0
  249. package/src/avif/native/av1/util/round2.d.ts.map +1 -0
  250. package/src/avif/native/av1/util/round2.js +27 -0
  251. package/src/avif/native/av1/util/round2_signed.d.ts +14 -0
  252. package/src/avif/native/av1/util/round2_signed.d.ts.map +1 -0
  253. package/src/avif/native/av1/util/round2_signed.js +17 -0
  254. package/src/avif/native/av1/util/tile_log2.d.ts +16 -0
  255. package/src/avif/native/av1/util/tile_log2.d.ts.map +1 -0
  256. package/src/avif/native/av1/util/tile_log2.js +23 -0
  257. package/src/avif/native/bitstream/BitReader.d.ts +174 -0
  258. package/src/avif/native/bitstream/BitReader.d.ts.map +1 -0
  259. package/src/avif/native/bitstream/BitReader.js +391 -0
  260. package/src/avif/native/bitstream/BitWriter.d.ts +122 -0
  261. package/src/avif/native/bitstream/BitWriter.d.ts.map +1 -0
  262. package/src/avif/native/bitstream/BitWriter.js +351 -0
  263. package/src/avif/native/color/ColourTransform.d.ts +62 -0
  264. package/src/avif/native/color/ColourTransform.d.ts.map +1 -0
  265. package/src/avif/native/color/ColourTransform.js +189 -0
  266. package/src/avif/native/color/YuvImage.d.ts +51 -0
  267. package/src/avif/native/color/YuvImage.d.ts.map +1 -0
  268. package/src/avif/native/color/YuvImage.js +66 -0
  269. package/src/avif/native/color/clamp_sample.d.ts +18 -0
  270. package/src/avif/native/color/clamp_sample.d.ts.map +1 -0
  271. package/src/avif/native/color/clamp_sample.js +25 -0
  272. package/src/avif/native/color/linear_to_transfer.d.ts +24 -0
  273. package/src/avif/native/color/linear_to_transfer.d.ts.map +1 -0
  274. package/src/avif/native/color/linear_to_transfer.js +126 -0
  275. package/src/avif/native/color/primaries.d.ts +20 -0
  276. package/src/avif/native/color/primaries.d.ts.map +1 -0
  277. package/src/avif/native/color/primaries.js +94 -0
  278. package/src/avif/native/color/rgb_row_to_ycbcr.d.ts +20 -0
  279. package/src/avif/native/color/rgb_row_to_ycbcr.d.ts.map +1 -0
  280. package/src/avif/native/color/rgb_row_to_ycbcr.js +78 -0
  281. package/src/avif/native/color/transfer_to_linear.d.ts +49 -0
  282. package/src/avif/native/color/transfer_to_linear.d.ts.map +1 -0
  283. package/src/avif/native/color/transfer_to_linear.js +171 -0
  284. package/src/avif/native/color/upsample_chroma_row.d.ts +35 -0
  285. package/src/avif/native/color/upsample_chroma_row.d.ts.map +1 -0
  286. package/src/avif/native/color/upsample_chroma_row.js +89 -0
  287. package/src/avif/native/color/ycbcr_row_to_rgb.d.ts +23 -0
  288. package/src/avif/native/color/ycbcr_row_to_rgb.d.ts.map +1 -0
  289. package/src/avif/native/color/ycbcr_row_to_rgb.js +78 -0
  290. package/src/avif/native/heif/AvifFile.d.ts +112 -0
  291. package/src/avif/native/heif/AvifFile.d.ts.map +1 -0
  292. package/src/avif/native/heif/AvifFile.js +142 -0
  293. package/src/avif/native/heif/ItemProperty.d.ts +244 -0
  294. package/src/avif/native/heif/ItemProperty.d.ts.map +1 -0
  295. package/src/avif/native/heif/ItemProperty.js +321 -0
  296. package/src/avif/native/heif/find_item_property.d.ts +17 -0
  297. package/src/avif/native/heif/find_item_property.d.ts.map +1 -0
  298. package/src/avif/native/heif/find_item_property.js +28 -0
  299. package/src/avif/native/heif/find_item_references.d.ts +16 -0
  300. package/src/avif/native/heif/find_item_references.d.ts.map +1 -0
  301. package/src/avif/native/heif/find_item_references.js +29 -0
  302. package/src/avif/native/heif/find_items_referencing.d.ts +17 -0
  303. package/src/avif/native/heif/find_items_referencing.d.ts.map +1 -0
  304. package/src/avif/native/heif/find_items_referencing.js +36 -0
  305. package/src/avif/native/heif/parse_avif_file.d.ts +15 -0
  306. package/src/avif/native/heif/parse_avif_file.d.ts.map +1 -0
  307. package/src/avif/native/heif/parse_avif_file.js +383 -0
  308. package/src/avif/native/heif/parse_image_grid.d.ts +18 -0
  309. package/src/avif/native/heif/parse_image_grid.d.ts.map +1 -0
  310. package/src/avif/native/heif/parse_image_grid.js +48 -0
  311. package/src/avif/native/heif/parse_item_property.d.ts +18 -0
  312. package/src/avif/native/heif/parse_item_property.d.ts.map +1 -0
  313. package/src/avif/native/heif/parse_item_property.js +243 -0
  314. package/src/avif/native/heif/read_item_data.d.ts +22 -0
  315. package/src/avif/native/heif/read_item_data.d.ts.map +1 -0
  316. package/src/avif/native/heif/read_item_data.js +97 -0
  317. package/src/avif/native/heif/write_avif_file.d.ts +50 -0
  318. package/src/avif/native/heif/write_avif_file.d.ts.map +1 -0
  319. package/src/avif/native/heif/write_avif_file.js +348 -0
  320. package/src/avif/native/heif/write_item_property.d.ts +16 -0
  321. package/src/avif/native/heif/write_item_property.d.ts.map +1 -0
  322. package/src/avif/native/heif/write_item_property.js +182 -0
  323. package/src/avif/native/index.d.ts +14 -0
  324. package/src/avif/native/index.d.ts.map +1 -0
  325. package/src/avif/native/index.js +56 -0
  326. package/src/avif/native/isobmff/BoxHeader.d.ts +50 -0
  327. package/src/avif/native/isobmff/BoxHeader.d.ts.map +1 -0
  328. package/src/avif/native/isobmff/BoxHeader.js +57 -0
  329. package/src/avif/native/isobmff/BoxWriter.d.ts +118 -0
  330. package/src/avif/native/isobmff/BoxWriter.d.ts.map +1 -0
  331. package/src/avif/native/isobmff/BoxWriter.js +264 -0
  332. package/src/avif/native/isobmff/ByteCursor.d.ts +125 -0
  333. package/src/avif/native/isobmff/ByteCursor.d.ts.map +1 -0
  334. package/src/avif/native/isobmff/ByteCursor.js +298 -0
  335. package/src/avif/native/isobmff/for_each_box.d.ts +23 -0
  336. package/src/avif/native/isobmff/for_each_box.d.ts.map +1 -0
  337. package/src/avif/native/isobmff/for_each_box.js +39 -0
  338. package/src/avif/native/isobmff/read_box_header.d.ts +22 -0
  339. package/src/avif/native/isobmff/read_box_header.d.ts.map +1 -0
  340. package/src/avif/native/isobmff/read_box_header.js +59 -0
  341. package/src/avif/native/isobmff/read_full_box_header.d.ts +26 -0
  342. package/src/avif/native/isobmff/read_full_box_header.d.ts.map +1 -0
  343. package/src/avif/native/isobmff/read_full_box_header.js +33 -0
  344. package/src/avif/threaded_image_encoder.d.ts +7 -2
  345. package/src/avif/threaded_image_encoder.d.ts.map +1 -1
  346. package/src/avif/threaded_image_encoder.js +107 -21
  347. package/src/core/binary/BinaryBuffer.d.ts +40 -0
  348. package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
  349. package/src/core/binary/BinaryBuffer.js +100 -0
  350. package/src/core/binary/hash/crc32.d.ts +16 -0
  351. package/src/core/binary/hash/crc32.d.ts.map +1 -0
  352. package/src/core/binary/hash/crc32.js +96 -0
  353. package/src/core/binary/utf8/utf8_decode.d.ts +21 -0
  354. package/src/core/binary/utf8/utf8_decode.d.ts.map +1 -0
  355. package/src/core/binary/utf8/utf8_decode.js +43 -0
  356. package/src/core/binary/utf8/utf8_encode_into.d.ts +20 -0
  357. package/src/core/binary/utf8/utf8_encode_into.d.ts.map +1 -0
  358. package/src/core/binary/utf8/utf8_encode_into.js +48 -0
  359. package/src/core/binary/utf8/utf8_encoded_length.d.ts +14 -0
  360. package/src/core/binary/utf8/utf8_encoded_length.d.ts.map +1 -0
  361. package/src/core/binary/utf8/utf8_encoded_length.js +36 -0
  362. package/src/core/color/COLOR_FIX_PLAN_2026_08_28.md +417 -0
  363. package/src/core/color/COLOR_REVIEW_2026_08_28.md +779 -0
  364. package/src/core/color/Color.d.ts +128 -20
  365. package/src/core/color/Color.d.ts.map +1 -1
  366. package/src/core/color/Color.js +959 -866
  367. package/src/core/color/PQ/PQ_constants.d.ts +10 -0
  368. package/src/core/color/PQ/PQ_constants.d.ts.map +1 -1
  369. package/src/core/color/PQ/PQ_constants.js +10 -0
  370. package/src/core/color/PQ/linear_to_PQ.d.ts.map +1 -1
  371. package/src/core/color/PQ/linear_to_PQ.js +6 -0
  372. package/src/core/color/REC709_PRIMARIES.d.ts +50 -0
  373. package/src/core/color/REC709_PRIMARIES.d.ts.map +1 -0
  374. package/src/core/color/REC709_PRIMARIES.js +53 -0
  375. package/src/core/color/construct/color_from_hex.d.ts +21 -0
  376. package/src/core/color/construct/color_from_hex.d.ts.map +1 -0
  377. package/src/core/color/construct/color_from_hex.js +33 -0
  378. package/src/core/color/construct/color_from_temperature.d.ts +22 -0
  379. package/src/core/color/construct/color_from_temperature.d.ts.map +1 -0
  380. package/src/core/color/construct/color_from_temperature.js +33 -0
  381. package/src/core/color/construct/color_from_uint24.d.ts +19 -0
  382. package/src/core/color/construct/color_from_uint24.d.ts.map +1 -0
  383. package/src/core/color/construct/color_from_uint24.js +26 -0
  384. package/src/core/color/construct/color_from_uint32.d.ts +20 -0
  385. package/src/core/color/construct/color_from_uint32.d.ts.map +1 -0
  386. package/src/core/color/construct/color_from_uint32.js +39 -0
  387. package/src/core/color/construct/color_gray.d.ts +17 -0
  388. package/src/core/color/construct/color_gray.d.ts.map +1 -0
  389. package/src/core/color/construct/color_gray.js +22 -0
  390. package/src/core/color/hex/hex2rgb.d.ts +1 -11
  391. package/src/core/color/hex/hex2rgb.d.ts.map +1 -1
  392. package/src/core/color/hex/hex2rgb.js +7 -24
  393. package/src/core/color/hex/hex_to_rgb.d.ts +18 -0
  394. package/src/core/color/hex/hex_to_rgb.d.ts.map +1 -0
  395. package/src/core/color/hex/hex_to_rgb.js +62 -0
  396. package/src/core/color/hex/rgb2hex.d.ts +1 -8
  397. package/src/core/color/hex/rgb2hex.d.ts.map +1 -1
  398. package/src/core/color/hex/rgb2hex.js +7 -13
  399. package/src/core/color/hex/rgb_to_hex.d.ts +9 -0
  400. package/src/core/color/hex/rgb_to_hex.d.ts.map +1 -0
  401. package/src/core/color/hex/rgb_to_hex.js +13 -0
  402. package/src/core/color/hex/rgba_to_hex.d.ts +19 -0
  403. package/src/core/color/hex/rgba_to_hex.d.ts.map +1 -0
  404. package/src/core/color/hex/rgba_to_hex.js +23 -0
  405. package/src/core/color/hsv/hsv2rgb.d.ts +1 -12
  406. package/src/core/color/hsv/hsv2rgb.d.ts.map +1 -1
  407. package/src/core/color/hsv/hsv2rgb.js +8 -21
  408. package/src/core/color/hsv/hsv2rgb_float.d.ts +1 -12
  409. package/src/core/color/hsv/hsv2rgb_float.d.ts.map +1 -1
  410. package/src/core/color/hsv/hsv2rgb_float.js +8 -56
  411. package/src/core/color/hsv/hsv_to_rgb.d.ts +13 -0
  412. package/src/core/color/hsv/hsv_to_rgb.d.ts.map +1 -0
  413. package/src/core/color/hsv/hsv_to_rgb.js +39 -0
  414. package/src/core/color/hsv/hsv_to_rgb_uint8.d.ts +13 -0
  415. package/src/core/color/hsv/hsv_to_rgb_uint8.d.ts.map +1 -0
  416. package/src/core/color/hsv/hsv_to_rgb_uint8.js +21 -0
  417. package/src/core/color/hsv/hue_to_rgb_sextant.d.ts +24 -0
  418. package/src/core/color/hsv/hue_to_rgb_sextant.d.ts.map +1 -0
  419. package/src/core/color/hsv/hue_to_rgb_sextant.js +67 -0
  420. package/src/core/color/hsv/rgb2hsv.d.ts +1 -12
  421. package/src/core/color/hsv/rgb2hsv.d.ts.map +1 -1
  422. package/src/core/color/hsv/rgb2hsv.js +7 -42
  423. package/src/core/color/hsv/rgb_to_hsv.d.ts +13 -0
  424. package/src/core/color/hsv/rgb_to_hsv.d.ts.map +1 -0
  425. package/src/core/color/hsv/rgb_to_hsv.js +42 -0
  426. package/src/core/color/hunt/hpe_to_xyz.d.ts +2 -0
  427. package/src/core/color/hunt/hpe_to_xyz.d.ts.map +1 -0
  428. package/src/core/color/hunt/hpe_to_xyz.js +4 -0
  429. package/src/core/color/hunt/xyz_to_hpe.d.ts +1 -6
  430. package/src/core/color/hunt/xyz_to_hpe.d.ts.map +1 -1
  431. package/src/core/color/hunt/xyz_to_hpe.js +12 -15
  432. package/src/core/color/illuminant/D65_spd_tabulated.d.ts.map +1 -1
  433. package/src/core/color/illuminant/D65_spd_tabulated.js +107 -104
  434. package/src/core/color/int2rgb.d.ts +1 -10
  435. package/src/core/color/int2rgb.d.ts.map +1 -1
  436. package/src/core/color/int2rgb.js +7 -12
  437. package/src/core/color/int_to_rgb.d.ts +21 -0
  438. package/src/core/color/int_to_rgb.d.ts.map +1 -0
  439. package/src/core/color/int_to_rgb.js +33 -0
  440. package/src/core/color/kelvin/kelvin_to_rgb.d.ts.map +1 -1
  441. package/src/core/color/kelvin/kelvin_to_rgb.js +22 -2
  442. package/src/core/color/kelvin/rgb_to_kelvin.d.ts +22 -2
  443. package/src/core/color/kelvin/rgb_to_kelvin.d.ts.map +1 -1
  444. package/src/core/color/kelvin/rgb_to_kelvin.js +22 -2
  445. package/src/core/color/lab/lab_to_xyz.d.ts +20 -0
  446. package/src/core/color/lab/lab_to_xyz.d.ts.map +1 -0
  447. package/src/core/color/lab/lab_to_xyz.js +69 -0
  448. package/src/core/color/oklab/gamut_clip_adaptive_l0.d.ts +34 -0
  449. package/src/core/color/oklab/gamut_clip_adaptive_l0.d.ts.map +1 -0
  450. package/src/core/color/oklab/gamut_clip_adaptive_l0.js +46 -0
  451. package/src/core/color/oklab/gamut_clip_at_l0.d.ts +33 -0
  452. package/src/core/color/oklab/gamut_clip_at_l0.d.ts.map +1 -0
  453. package/src/core/color/oklab/gamut_clip_at_l0.js +84 -0
  454. package/src/core/color/oklab/gamut_clip_preserve_chroma.d.ts +24 -0
  455. package/src/core/color/oklab/gamut_clip_preserve_chroma.d.ts.map +1 -0
  456. package/src/core/color/oklab/gamut_clip_preserve_chroma.js +37 -0
  457. package/src/core/color/oklab/gamut_clip_project_to_lcusp.d.ts +23 -0
  458. package/src/core/color/oklab/gamut_clip_project_to_lcusp.d.ts.map +1 -0
  459. package/src/core/color/oklab/gamut_clip_project_to_lcusp.js +46 -0
  460. package/src/core/color/oklab/linear_srgb_to_okhsl.d.ts +19 -0
  461. package/src/core/color/oklab/linear_srgb_to_okhsl.d.ts.map +1 -0
  462. package/src/core/color/oklab/linear_srgb_to_okhsl.js +93 -0
  463. package/src/core/color/oklab/linear_srgb_to_okhsv.d.ts +12 -4
  464. package/src/core/color/oklab/linear_srgb_to_okhsv.d.ts.map +1 -1
  465. package/src/core/color/oklab/linear_srgb_to_okhsv.js +108 -84
  466. package/src/core/color/oklab/linear_srgb_to_oklab.d.ts +13 -4
  467. package/src/core/color/oklab/linear_srgb_to_oklab.d.ts.map +1 -1
  468. package/src/core/color/oklab/linear_srgb_to_oklab.js +28 -19
  469. package/src/core/color/oklab/okhsl_chroma_bounds.d.ts +51 -0
  470. package/src/core/color/oklab/okhsl_chroma_bounds.d.ts.map +1 -0
  471. package/src/core/color/oklab/okhsl_chroma_bounds.js +128 -0
  472. package/src/core/color/oklab/okhsl_to_linear_srgb.d.ts +19 -0
  473. package/src/core/color/oklab/okhsl_to_linear_srgb.d.ts.map +1 -0
  474. package/src/core/color/oklab/okhsl_to_linear_srgb.js +85 -0
  475. package/src/core/color/oklab/oklab_to_oklch.d.ts +24 -0
  476. package/src/core/color/oklab/oklab_to_oklch.d.ts.map +1 -0
  477. package/src/core/color/oklab/oklab_to_oklch.js +35 -0
  478. package/src/core/color/oklab/oklch_to_oklab.d.ts +18 -0
  479. package/src/core/color/oklab/oklch_to_oklab.d.ts.map +1 -0
  480. package/src/core/color/oklab/oklch_to_oklab.js +26 -0
  481. package/src/core/color/oklab/toe.d.ts +12 -0
  482. package/src/core/color/oklab/toe.d.ts.map +1 -1
  483. package/src/core/color/oklab/toe.js +34 -22
  484. package/src/core/color/operations/color_add.d.ts +21 -0
  485. package/src/core/color/operations/color_add.d.ts.map +1 -0
  486. package/src/core/color/operations/color_add.js +23 -0
  487. package/src/core/color/operations/color_add_scaled.d.ts +20 -0
  488. package/src/core/color/operations/color_add_scaled.d.ts.map +1 -0
  489. package/src/core/color/operations/color_add_scaled.js +30 -0
  490. package/src/core/color/operations/color_clamp.d.ts +22 -0
  491. package/src/core/color/operations/color_clamp.d.ts.map +1 -0
  492. package/src/core/color/operations/color_clamp.js +25 -0
  493. package/src/core/color/operations/color_darken.d.ts +2 -1
  494. package/src/core/color/operations/color_darken.d.ts.map +1 -1
  495. package/src/core/color/operations/color_darken.js +25 -24
  496. package/src/core/color/operations/color_desaturate.d.ts +2 -1
  497. package/src/core/color/operations/color_desaturate.d.ts.map +1 -1
  498. package/src/core/color/operations/color_desaturate.js +25 -24
  499. package/src/core/color/operations/color_get_hsl.d.ts +18 -0
  500. package/src/core/color/operations/color_get_hsl.d.ts.map +1 -0
  501. package/src/core/color/operations/color_get_hsl.js +60 -0
  502. package/src/core/color/operations/color_is_in_gamut.d.ts +20 -0
  503. package/src/core/color/operations/color_is_in_gamut.d.ts.map +1 -0
  504. package/src/core/color/operations/color_is_in_gamut.js +30 -0
  505. package/src/core/color/operations/color_lerp.d.ts +12 -3
  506. package/src/core/color/operations/color_lerp.d.ts.map +1 -1
  507. package/src/core/color/operations/color_lerp.js +55 -46
  508. package/src/core/color/operations/color_lighten.d.ts +9 -5
  509. package/src/core/color/operations/color_lighten.d.ts.map +1 -1
  510. package/src/core/color/operations/color_lighten.js +29 -24
  511. package/src/core/color/operations/color_mix_okhsv_channel.d.ts +24 -0
  512. package/src/core/color/operations/color_mix_okhsv_channel.d.ts.map +1 -0
  513. package/src/core/color/operations/color_mix_okhsv_channel.js +48 -0
  514. package/src/core/color/operations/color_multiply_rgb.d.ts +21 -0
  515. package/src/core/color/operations/color_multiply_rgb.d.ts.map +1 -0
  516. package/src/core/color/operations/color_multiply_rgb.js +26 -0
  517. package/src/core/color/operations/color_saturate.d.ts +9 -5
  518. package/src/core/color/operations/color_saturate.d.ts.map +1 -1
  519. package/src/core/color/operations/color_saturate.js +29 -24
  520. package/src/core/color/operations/color_scale_okhsv_channel.d.ts +1 -1
  521. package/src/core/color/operations/color_scale_okhsv_channel.d.ts.map +1 -1
  522. package/src/core/color/operations/color_scale_okhsv_channel.js +58 -45
  523. package/src/core/color/operations/color_srgb_apply.d.ts +28 -0
  524. package/src/core/color/operations/color_srgb_apply.d.ts.map +1 -0
  525. package/src/core/color/operations/color_srgb_apply.js +40 -0
  526. package/src/core/color/operations/color_sub.d.ts +16 -0
  527. package/src/core/color/operations/color_sub.d.ts.map +1 -0
  528. package/src/core/color/operations/color_sub.js +18 -0
  529. package/src/core/color/parse_color.d.ts +10 -1
  530. package/src/core/color/parse_color.d.ts.map +1 -1
  531. package/src/core/color/parse_color.js +100 -84
  532. package/src/core/color/parse_color_normalized.d.ts +24 -0
  533. package/src/core/color/parse_color_normalized.d.ts.map +1 -0
  534. package/src/core/color/parse_color_normalized.js +38 -0
  535. package/src/core/color/rgb2uint24.d.ts +1 -8
  536. package/src/core/color/rgb2uint24.d.ts.map +1 -1
  537. package/src/core/color/rgb2uint24.js +7 -20
  538. package/src/core/color/rgb2uint32.d.ts +1 -9
  539. package/src/core/color/rgb2uint32.d.ts.map +1 -1
  540. package/src/core/color/rgb2uint32.js +7 -18
  541. package/src/core/color/rgb_to_luminance.d.ts +14 -5
  542. package/src/core/color/rgb_to_luminance.d.ts.map +1 -1
  543. package/src/core/color/rgb_to_luminance.js +24 -13
  544. package/src/core/color/rgb_to_uint24.d.ts +9 -0
  545. package/src/core/color/rgb_to_uint24.d.ts.map +1 -0
  546. package/src/core/color/rgb_to_uint24.js +20 -0
  547. package/src/core/color/rgb_to_uint32.d.ts +10 -0
  548. package/src/core/color/rgb_to_uint32.d.ts.map +1 -0
  549. package/src/core/color/rgb_to_uint32.js +21 -0
  550. package/src/core/color/sRGB/linear_to_sRGB.d.ts +7 -0
  551. package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
  552. package/src/core/color/sRGB/linear_to_sRGB.js +39 -32
  553. package/src/core/color/xyz/hpe_to_xyz.d.ts +24 -0
  554. package/src/core/color/xyz/hpe_to_xyz.d.ts.map +1 -0
  555. package/src/core/color/xyz/hpe_to_xyz.js +39 -0
  556. package/src/core/color/xyz/rgb_to_xyz.d.ts +17 -2
  557. package/src/core/color/xyz/rgb_to_xyz.d.ts.map +1 -1
  558. package/src/core/color/xyz/rgb_to_xyz.js +44 -18
  559. package/src/core/color/xyz/xyz_cmf_tabulated.d.ts.map +1 -1
  560. package/src/core/color/xyz/xyz_cmf_tabulated.js +217 -211
  561. package/src/core/color/xyz/xyz_cmf_wyman.d.ts +4 -0
  562. package/src/core/color/xyz/xyz_cmf_wyman.d.ts.map +1 -1
  563. package/src/core/color/xyz/xyz_cmf_wyman.js +74 -65
  564. package/src/core/color/xyz/xyz_to_hpe.d.ts +18 -0
  565. package/src/core/color/xyz/xyz_to_hpe.d.ts.map +1 -0
  566. package/src/core/color/xyz/xyz_to_hpe.js +33 -0
  567. package/src/core/color/xyz/xyz_to_rgb.d.ts +17 -2
  568. package/src/core/color/xyz/xyz_to_rgb.d.ts.map +1 -1
  569. package/src/core/color/xyz/xyz_to_rgb.js +39 -16
  570. package/src/core/color/ycxcz/xyz_to_ycxcz.d.ts +7 -2
  571. package/src/core/color/ycxcz/xyz_to_ycxcz.d.ts.map +1 -1
  572. package/src/core/color/ycxcz/xyz_to_ycxcz.js +33 -28
  573. package/src/core/events/signal/Signal.js +820 -820
  574. package/src/core/geom/3d/shape/ConvexHullShape3D.d.ts.map +1 -1
  575. package/src/core/geom/3d/shape/ConvexHullShape3D.js +28 -4
  576. package/src/core/math/clamp_index.d.ts +18 -0
  577. package/src/core/math/clamp_index.d.ts.map +1 -0
  578. package/src/core/math/clamp_index.js +23 -0
  579. package/src/engine/asset/loaders/image/IMAGE_CODEC_REVIEW_2026_08_28.md +803 -0
  580. package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts +5 -3
  581. package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts.map +1 -1
  582. package/src/engine/asset/loaders/image/jpeg/JpegFrame.js +5 -3
  583. package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts +2 -1
  584. package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts.map +1 -1
  585. package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.js +2 -1
  586. package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts +17 -0
  587. package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts.map +1 -1
  588. package/src/engine/asset/loaders/image/jpeg/JpegImage.js +197 -157
  589. package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts +0 -1
  590. package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts.map +1 -1
  591. package/src/engine/asset/loaders/image/jpeg/idct8x8_float.js +0 -1
  592. package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts +28 -0
  593. package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts.map +1 -0
  594. package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.js +31 -0
  595. package/src/engine/asset/loaders/image/png/PNG.d.ts +3 -18
  596. package/src/engine/asset/loaders/image/png/PNG.d.ts.map +1 -1
  597. package/src/engine/asset/loaders/image/png/PNG.js +3 -139
  598. package/src/engine/asset/loaders/image/png/PNGReader.d.ts +16 -16
  599. package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
  600. package/src/engine/asset/loaders/image/png/PNGReader.js +143 -160
  601. package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_iTXt.js +3 -3
  602. package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_zTXt.js +3 -3
  603. package/src/engine/asset/loaders/image/png/crc32.d.ts +1 -15
  604. package/src/engine/asset/loaders/image/png/crc32.d.ts.map +1 -1
  605. package/src/engine/asset/loaders/image/png/crc32.js +5 -89
  606. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts +12 -10
  607. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts.map +1 -1
  608. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +20 -45
  609. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts +2 -1
  610. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts.map +1 -1
  611. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.js +2 -0
  612. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts +2 -1
  613. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts.map +1 -1
  614. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.js +2 -0
  615. package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts +22 -0
  616. package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts.map +1 -0
  617. package/src/engine/asset/loaders/image/png/filter/png_unfilter.js +68 -0
  618. package/src/engine/asset/loaders/image/png/png_inflate.d.ts +20 -0
  619. package/src/engine/asset/loaders/image/png/png_inflate.d.ts.map +1 -0
  620. package/src/engine/asset/loaders/image/png/png_inflate.js +85 -0
  621. package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts +22 -0
  622. package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts.map +1 -0
  623. package/src/engine/asset/loaders/image/png/png_unpack_samples.js +38 -0
  624. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
  625. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +135 -132
  626. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +16 -3
  627. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
  628. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1157 -1149
  629. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +26 -0
  630. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
  631. package/src/engine/graphics/render/frame_graph/FrameGraph.js +947 -900
  632. package/src/engine/physics/ecs/PhysicsSystem.d.ts +69 -81
  633. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  634. package/src/engine/physics/ecs/PhysicsSystem.js +83 -77
  635. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  636. package/src/shade/device/IMMEDIATE_DATA_PLAN_2026_08_28.md +451 -0
  637. package/src/shade/device/ShadeGPUCommandContext.d.ts +21 -0
  638. package/src/shade/device/ShadeGPUCommandContext.d.ts.map +1 -1
  639. package/src/shade/device/ShadeGPUCommandContext.js +940 -749
  640. package/src/shade/device/timing/GPUTimerArray.d.ts +22 -4
  641. package/src/shade/device/timing/GPUTimerArray.d.ts.map +1 -1
  642. package/src/shade/device/timing/GPUTimerArray.js +88 -14
  643. package/src/shade/device/timing/GPU_PROFILER_PROPOSAL_2026_08_28.md +876 -0
  644. package/src/shade/device/timing/profile/GPUFrameRecorder.d.ts +93 -0
  645. package/src/shade/device/timing/profile/GPUFrameRecorder.d.ts.map +1 -0
  646. package/src/shade/device/timing/profile/GPUFrameRecorder.js +297 -0
  647. package/src/shade/device/timing/profile/GPUProfileCapture.d.ts +62 -0
  648. package/src/shade/device/timing/profile/GPUProfileCapture.d.ts.map +1 -0
  649. package/src/shade/device/timing/profile/GPUProfileCapture.js +77 -0
  650. package/src/shade/device/timing/profile/GPUProfileFrame.d.ts +73 -0
  651. package/src/shade/device/timing/profile/GPUProfileFrame.d.ts.map +1 -0
  652. package/src/shade/device/timing/profile/GPUProfileFrame.js +88 -0
  653. package/src/shade/device/timing/profile/GPUProfileLevel.d.ts +20 -0
  654. package/src/shade/device/timing/profile/GPUProfileLevel.d.ts.map +1 -0
  655. package/src/shade/device/timing/profile/GPUProfileLevel.js +50 -0
  656. package/src/shade/device/timing/profile/GPUProfileMeta.d.ts +63 -0
  657. package/src/shade/device/timing/profile/GPUProfileMeta.d.ts.map +1 -0
  658. package/src/shade/device/timing/profile/GPUProfileMeta.js +73 -0
  659. package/src/shade/device/timing/profile/GPUProfileSession.d.ts +173 -0
  660. package/src/shade/device/timing/profile/GPUProfileSession.d.ts.map +1 -0
  661. package/src/shade/device/timing/profile/GPUProfileSession.js +470 -0
  662. package/src/shade/device/timing/profile/GPUProfileSpan.d.ts +60 -0
  663. package/src/shade/device/timing/profile/GPUProfileSpan.d.ts.map +1 -0
  664. package/src/shade/device/timing/profile/GPUProfileSpan.js +65 -0
  665. package/src/shade/device/timing/profile/GPUProfileSpanKind.d.ts +19 -0
  666. package/src/shade/device/timing/profile/GPUProfileSpanKind.d.ts.map +1 -0
  667. package/src/shade/device/timing/profile/GPUProfileSpanKind.js +25 -0
  668. package/src/shade/device/timing/profile/GPUProfileTopology.d.ts +159 -0
  669. package/src/shade/device/timing/profile/GPUProfileTopology.d.ts.map +1 -0
  670. package/src/shade/device/timing/profile/GPUProfileTopology.js +202 -0
  671. package/src/shade/device/timing/profile/GPUProfileWork.d.ts +90 -0
  672. package/src/shade/device/timing/profile/GPUProfileWork.d.ts.map +1 -0
  673. package/src/shade/device/timing/profile/GPUProfileWork.js +115 -0
  674. package/src/shade/device/timing/profile/SGPTDefect.d.ts +43 -0
  675. package/src/shade/device/timing/profile/SGPTDefect.d.ts.map +1 -0
  676. package/src/shade/device/timing/profile/SGPTDefect.js +65 -0
  677. package/src/shade/device/timing/profile/SGPTHeader.d.ts +38 -0
  678. package/src/shade/device/timing/profile/SGPTHeader.d.ts.map +1 -0
  679. package/src/shade/device/timing/profile/SGPTHeader.js +46 -0
  680. package/src/shade/device/timing/profile/SGPTRecordRef.d.ts +37 -0
  681. package/src/shade/device/timing/profile/SGPTRecordRef.d.ts.map +1 -0
  682. package/src/shade/device/timing/profile/SGPTRecordRef.js +45 -0
  683. package/src/shade/device/timing/profile/SGPTWriteStream.d.ts +103 -0
  684. package/src/shade/device/timing/profile/SGPTWriteStream.d.ts.map +1 -0
  685. package/src/shade/device/timing/profile/SGPTWriteStream.js +287 -0
  686. package/src/shade/device/timing/profile/SGPT_DEFECT.d.ts +19 -0
  687. package/src/shade/device/timing/profile/SGPT_DEFECT.d.ts.map +1 -0
  688. package/src/shade/device/timing/profile/SGPT_DEFECT.js +26 -0
  689. package/src/shade/device/timing/profile/SGPT_FLAG.d.ts +8 -0
  690. package/src/shade/device/timing/profile/SGPT_FLAG.d.ts.map +1 -0
  691. package/src/shade/device/timing/profile/SGPT_FLAG.js +15 -0
  692. package/src/shade/device/timing/profile/SGPT_FORMAT.md +345 -0
  693. package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.d.ts +10 -0
  694. package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.d.ts.map +1 -0
  695. package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.js +9 -0
  696. package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.d.ts +17 -0
  697. package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.d.ts.map +1 -0
  698. package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.js +16 -0
  699. package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.d.ts +16 -0
  700. package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.d.ts.map +1 -0
  701. package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.js +15 -0
  702. package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.d.ts +15 -0
  703. package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.d.ts.map +1 -0
  704. package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.js +29 -0
  705. package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.d.ts +7 -0
  706. package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.d.ts.map +1 -0
  707. package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.js +6 -0
  708. package/src/shade/device/timing/profile/SGPT_MAGIC.d.ts +7 -0
  709. package/src/shade/device/timing/profile/SGPT_MAGIC.d.ts.map +1 -0
  710. package/src/shade/device/timing/profile/SGPT_MAGIC.js +6 -0
  711. package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.d.ts +16 -0
  712. package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.d.ts.map +1 -0
  713. package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.js +15 -0
  714. package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.d.ts +7 -0
  715. package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.d.ts.map +1 -0
  716. package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.js +6 -0
  717. package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.d.ts +13 -0
  718. package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.d.ts.map +1 -0
  719. package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.js +23 -0
  720. package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.d.ts +12 -0
  721. package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.d.ts.map +1 -0
  722. package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.js +11 -0
  723. package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.d.ts +18 -0
  724. package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.d.ts.map +1 -0
  725. package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.js +46 -0
  726. package/src/shade/device/timing/profile/frame_graph_extract_topology.d.ts +20 -0
  727. package/src/shade/device/timing/profile/frame_graph_extract_topology.d.ts.map +1 -0
  728. package/src/shade/device/timing/profile/frame_graph_extract_topology.js +174 -0
  729. package/src/shade/device/timing/profile/make_profiling_pass_encoder.d.ts +21 -0
  730. package/src/shade/device/timing/profile/make_profiling_pass_encoder.d.ts.map +1 -0
  731. package/src/shade/device/timing/profile/make_profiling_pass_encoder.js +114 -0
  732. package/src/shade/device/timing/profile/parse_workgroup_size.d.ts +20 -0
  733. package/src/shade/device/timing/profile/parse_workgroup_size.d.ts.map +1 -0
  734. package/src/shade/device/timing/profile/parse_workgroup_size.js +43 -0
  735. package/src/shade/device/timing/profile/sgpt_fourcc.d.ts +18 -0
  736. package/src/shade/device/timing/profile/sgpt_fourcc.d.ts.map +1 -0
  737. package/src/shade/device/timing/profile/sgpt_fourcc.js +34 -0
  738. package/src/shade/device/timing/profile/sgpt_frame_codec.d.ts +42 -0
  739. package/src/shade/device/timing/profile/sgpt_frame_codec.d.ts.map +1 -0
  740. package/src/shade/device/timing/profile/sgpt_frame_codec.js +172 -0
  741. package/src/shade/device/timing/profile/sgpt_meta_codec.d.ts +20 -0
  742. package/src/shade/device/timing/profile/sgpt_meta_codec.d.ts.map +1 -0
  743. package/src/shade/device/timing/profile/sgpt_meta_codec.js +65 -0
  744. package/src/shade/device/timing/profile/sgpt_read_capture.d.ts +19 -0
  745. package/src/shade/device/timing/profile/sgpt_read_capture.d.ts.map +1 -0
  746. package/src/shade/device/timing/profile/sgpt_read_capture.js +134 -0
  747. package/src/shade/device/timing/profile/sgpt_read_header.d.ts +22 -0
  748. package/src/shade/device/timing/profile/sgpt_read_header.d.ts.map +1 -0
  749. package/src/shade/device/timing/profile/sgpt_read_header.js +94 -0
  750. package/src/shade/device/timing/profile/sgpt_read_records.d.ts +27 -0
  751. package/src/shade/device/timing/profile/sgpt_read_records.d.ts.map +1 -0
  752. package/src/shade/device/timing/profile/sgpt_read_records.js +153 -0
  753. package/src/shade/device/timing/profile/sgpt_topology_codec.d.ts +54 -0
  754. package/src/shade/device/timing/profile/sgpt_topology_codec.d.ts.map +1 -0
  755. package/src/shade/device/timing/profile/sgpt_topology_codec.js +329 -0
  756. package/src/shade/device/timing/profile/sgpt_write_header.d.ts +22 -0
  757. package/src/shade/device/timing/profile/sgpt_write_header.d.ts.map +1 -0
  758. package/src/shade/device/timing/profile/sgpt_write_header.js +47 -0
  759. package/src/shade/device/timing/profile/sgpt_write_record.d.ts +23 -0
  760. package/src/shade/device/timing/profile/sgpt_write_record.d.ts.map +1 -0
  761. package/src/shade/device/timing/profile/sgpt_write_record.js +62 -0
  762. package/src/shade/renderer/Renderer.d.ts +21 -0
  763. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  764. package/src/shade/renderer/Renderer.js +2513 -2455
  765. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  766. package/src/shade/renderer/scene/serialization/decode_image_source_hdr.d.ts +14 -3
  767. package/src/shade/renderer/scene/serialization/decode_image_source_hdr.d.ts.map +1 -1
  768. package/src/shade/renderer/scene/serialization/decode_image_source_hdr.js +50 -51
  769. package/src/shade/renderer/scene/serialization/deserialize_scene.d.ts.map +1 -1
  770. package/src/shade/renderer/scene/serialization/deserialize_scene.js +531 -521
  771. package/src/shade/renderer/scene/serialization/write_image_source.d.ts.map +1 -1
  772. package/src/shade/renderer/scene/serialization/write_image_source.js +6 -4
  773. package/src/shade/renderer/shader/chunk/color/chunk_rgb_to_luminance.d.ts.map +1 -1
  774. package/src/shade/renderer/shader/chunk/color/chunk_rgb_to_luminance.js +34 -32
  775. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts +31 -0
  776. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts.map +1 -1
  777. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.js +62 -31
  778. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.d.ts +10 -0
  779. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.d.ts.map +1 -1
  780. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.js +32 -22
  781. package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferOETF.d.ts.map +1 -1
  782. package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferOETF.js +22 -21
  783. package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts +6 -0
  784. package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts.map +1 -1
  785. package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.js +110 -104
  786. package/src/shade/renderer/shader/chunk/color/xyz/chunk_rgb_to_xyz.d.ts.map +1 -1
  787. package/src/shade/renderer/shader/chunk/color/xyz/chunk_rgb_to_xyz.js +23 -21
  788. package/src/view/elements/ColorPickerView.js +296 -296
  789. package/src/avif/codec/dec/Readme.md +0 -14
  790. package/src/avif/codec/dec/avif_dec.cpp +0 -234
  791. package/src/avif/codec/dec/avif_dec.d.ts +0 -3
  792. package/src/avif/codec/dec/avif_dec.d.ts.map +0 -1
  793. package/src/avif/codec/dec/avif_dec.js +0 -16
  794. package/src/avif/codec/dec/avif_dec.wasm +0 -0
  795. package/src/avif/codec/enc/README.md +0 -37
  796. package/src/avif/codec/enc/avif_enc.cpp +0 -216
  797. package/src/avif/codec/enc/avif_enc.d.ts +0 -3
  798. package/src/avif/codec/enc/avif_enc.d.ts.map +0 -1
  799. package/src/avif/codec/enc/avif_enc.js +0 -6144
  800. package/src/avif/codec/enc/avif_enc.wasm +0 -0
  801. package/src/avif/codec/enc/avif_enc_mt.d.ts +0 -3
  802. package/src/avif/codec/enc/avif_enc_mt.d.ts.map +0 -1
  803. package/src/avif/codec/enc/avif_enc_mt.js +0 -6811
  804. package/src/avif/codec/enc/avif_enc_mt.wasm +0 -0
  805. package/src/avif/codec/enc/avif_enc_mt.worker.d.mts +0 -2
  806. package/src/avif/codec/enc/avif_enc_mt.worker.d.mts.map +0 -1
  807. package/src/avif/codec/enc/avif_enc_mt.worker.d.ts +0 -11
  808. package/src/avif/codec/enc/avif_enc_mt.worker.d.ts.map +0 -1
  809. package/src/avif/codec/enc/avif_enc_mt.worker.js +0 -171
  810. package/src/avif/codec/enc/avif_enc_mt.worker.mjs +0 -1
  811. package/src/avif/decode.d.ts +0 -3
  812. package/src/avif/decode.d.ts.map +0 -1
  813. package/src/avif/decode.js +0 -42
  814. package/src/avif/encode.d.ts +0 -3
  815. package/src/avif/encode.d.ts.map +0 -1
  816. package/src/avif/encode.js +0 -75
  817. package/src/avif/meta.d.ts +0 -24
  818. package/src/avif/meta.d.ts.map +0 -1
  819. package/src/avif/meta.js +0 -23
  820. package/src/avif/tsconfig.tsbuildinfo +0 -1
  821. package/src/avif/utils.d.ts +0 -17
  822. package/src/avif/utils.d.ts.map +0 -1
  823. package/src/avif/utils.js +0 -31
  824. package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts +0 -23
  825. package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts.map +0 -1
  826. package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.js +0 -214
  827. package/src/engine/asset/loaders/image/png/inflate.d.ts +0 -7
  828. package/src/engine/asset/loaders/image/png/inflate.d.ts.map +0 -1
  829. package/src/engine/asset/loaders/image/png/inflate.js +0 -20
  830. package/src/engine/save/GameStateLoader.d.ts +0 -49
  831. package/src/engine/save/GameStateLoader.d.ts.map +0 -1
  832. package/src/engine/save/GameStateLoader.js +0 -168
@@ -0,0 +1,299 @@
1
+ import { BLOCK_DECODED_ORIGIN, BLOCK_DECODED_STRIDE } from "../decode/Av1FrameContext.js";
2
+ import { NUM_4X4_BLOCKS_HIGH, NUM_4X4_BLOCKS_WIDE } from "../tables/block_tables.js";
3
+
4
+ /**
5
+ * Widest block a snapshot has to hold, in samples.
6
+ * @type {number}
7
+ */
8
+ const MAX_SIDE = 64;
9
+
10
+ /**
11
+ * The same in 4x4 units, and the stride of every mode-info plane a snapshot holds.
12
+ * @type {number}
13
+ */
14
+ export const SNAPSHOT_STRIDE = MAX_SIDE / 4;
15
+
16
+ /**
17
+ * @type {number}
18
+ */
19
+ const MAX_SIDE4 = SNAPSHOT_STRIDE;
20
+
21
+ /**
22
+ * Samples one plane of the largest block holds.
23
+ * @type {number}
24
+ */
25
+ const PLANE_SAMPLES = MAX_SIDE * MAX_SIDE;
26
+
27
+ /**
28
+ * Entries one mode-info plane holds, which is also how many 4x4 positions a superblock has.
29
+ * @type {number}
30
+ */
31
+ const MODE_INFO_ENTRIES = MAX_SIDE4 * MAX_SIDE4;
32
+
33
+ /**
34
+ * @type {number}
35
+ */
36
+ export const SUPERBLOCK_POSITIONS = MODE_INFO_ENTRIES;
37
+
38
+ /**
39
+ * Everything one block's coding changes that a later decision can see.
40
+ *
41
+ * A partition decision has to price both answers, and pricing one means *making* it: predicting,
42
+ * quantising, reconstructing, and advancing the contexts, because the block after this one predicts
43
+ * from the reconstruction and codes against those contexts. So the encoder does make it, measures
44
+ * it, and puts the state back.
45
+ *
46
+ * What is here is what a later decision reads: the reconstruction, the coefficient contexts either
47
+ * side, the flags saying which transform blocks have been coded, and the six mode-info planes that
48
+ * feed a neighbour's context — the modes, the block sizes, the skip flags, the transform types and
49
+ * the transform sizes. The rest of the mode-info planes are written by every block and read by
50
+ * nothing before the frame is whole.
51
+ *
52
+ * ### One allocation, not twenty
53
+ *
54
+ * All of it lives in a single `ArrayBuffer` with the typed arrays as views laid end to end. Twenty
55
+ * separately allocated arrays are twenty objects the heap may put anywhere, and a snapshot is taken
56
+ * and put back several times per block — so what is being copied wants to be one run of memory
57
+ * rather than twenty walks to find out where the next piece is. The sample planes come first
58
+ * because they are two-byte and want their alignment.
59
+ *
60
+ * @author Alex Goldring
61
+ * @copyright Company Named Limited (c) 2026
62
+ */
63
+ export class Av1BlockSnapshot {
64
+ constructor() {
65
+ const samples = PLANE_SAMPLES * 3;
66
+ const runs = MAX_SIDE4 * 3 * 4;
67
+ const flags = MODE_INFO_ENTRIES * 3;
68
+ const info = MODE_INFO_ENTRIES * 6;
69
+
70
+ const buffer = new ArrayBuffer(samples * 2 + runs + flags + info);
71
+
72
+ let at = 0;
73
+
74
+ /** @type {Uint16Array[]} the reconstruction under the block, one plane at a time */
75
+ this.planes = [];
76
+
77
+ for (let plane = 0; plane < 3; plane++) {
78
+ this.planes.push(new Uint16Array(buffer, at, PLANE_SAMPLES));
79
+
80
+ at += PLANE_SAMPLES * 2;
81
+ }
82
+
83
+ /** @type {Uint8Array[]} */
84
+ this.above_level = [];
85
+
86
+ /** @type {Uint8Array[]} */
87
+ this.above_dc = [];
88
+
89
+ /** @type {Uint8Array[]} */
90
+ this.left_level = [];
91
+
92
+ /** @type {Uint8Array[]} */
93
+ this.left_dc = [];
94
+
95
+ for (const run of [this.above_level, this.above_dc, this.left_level, this.left_dc]) {
96
+ for (let plane = 0; plane < 3; plane++) {
97
+ run.push(new Uint8Array(buffer, at, MAX_SIDE4));
98
+
99
+ at += MAX_SIDE4;
100
+ }
101
+ }
102
+
103
+ /** @type {Uint8Array[]} which of the block's own transform blocks have been coded */
104
+ this.block_decoded = [];
105
+
106
+ for (let plane = 0; plane < 3; plane++) {
107
+ this.block_decoded.push(new Uint8Array(buffer, at, MODE_INFO_ENTRIES));
108
+
109
+ at += MODE_INFO_ENTRIES;
110
+ }
111
+
112
+ /** @type {Uint8Array} */
113
+ this.y_modes = new Uint8Array(buffer, at, MODE_INFO_ENTRIES);
114
+
115
+ at += MODE_INFO_ENTRIES;
116
+
117
+ /** @type {Uint8Array} */
118
+ this.uv_modes = new Uint8Array(buffer, at, MODE_INFO_ENTRIES);
119
+
120
+ at += MODE_INFO_ENTRIES;
121
+
122
+ /** @type {Uint8Array} */
123
+ this.mi_sizes = new Uint8Array(buffer, at, MODE_INFO_ENTRIES);
124
+
125
+ at += MODE_INFO_ENTRIES;
126
+
127
+ /** @type {Uint8Array} */
128
+ this.skips = new Uint8Array(buffer, at, MODE_INFO_ENTRIES);
129
+
130
+ at += MODE_INFO_ENTRIES;
131
+
132
+ /** @type {Uint8Array} */
133
+ this.tx_types = new Uint8Array(buffer, at, MODE_INFO_ENTRIES);
134
+
135
+ at += MODE_INFO_ENTRIES;
136
+
137
+ /** @type {Uint8Array} */
138
+ this.tx_sizes = new Uint8Array(buffer, at, MODE_INFO_ENTRIES);
139
+ }
140
+ }
141
+
142
+ /**
143
+ * Copy the state a block covers into a snapshot.
144
+ *
145
+ * @param {Av1FrameContext} ctx
146
+ * @param {Av1BlockSnapshot} snapshot
147
+ * @param {number} r
148
+ * @param {number} c
149
+ * @param {number} b_size
150
+ */
151
+ export function capture_block(ctx, snapshot, r, c, b_size) {
152
+ move_block(ctx, snapshot, r, c, b_size, 1);
153
+ }
154
+
155
+ /**
156
+ * Put a snapshot back, undoing everything coding the block changed.
157
+ *
158
+ * @param {Av1FrameContext} ctx
159
+ * @param {Av1BlockSnapshot} snapshot
160
+ * @param {number} r
161
+ * @param {number} c
162
+ * @param {number} b_size
163
+ */
164
+ export function restore_block(ctx, snapshot, r, c, b_size) {
165
+ move_block(ctx, snapshot, r, c, b_size, 0);
166
+ }
167
+
168
+ /**
169
+ * @param {Av1FrameContext} ctx
170
+ * @param {Av1BlockSnapshot} snapshot
171
+ * @param {number} r
172
+ * @param {number} c
173
+ * @param {number} b_size
174
+ * @param {number} capture `1` context to snapshot, `0` snapshot to context
175
+ */
176
+ function move_block(ctx, snapshot, r, c, b_size, capture) {
177
+ const bw4 = NUM_4X4_BLOCKS_WIDE[b_size];
178
+ const bh4 = NUM_4X4_BLOCKS_HIGH[b_size];
179
+
180
+ for (let plane = 0; plane < ctx.num_planes; plane++) {
181
+ const sub_x = plane > 0 ? ctx.subsampling_x : 0;
182
+ const sub_y = plane > 0 ? ctx.subsampling_y : 0;
183
+
184
+ const x0 = (c * 4) >> sub_x;
185
+ const y0 = (r * 4) >> sub_y;
186
+ const width = (bw4 * 4) >> sub_x;
187
+ const height = (bh4 * 4) >> sub_y;
188
+
189
+ const live = ctx.planes[plane];
190
+ const stride = ctx.plane_stride[plane];
191
+ const saved = snapshot.planes[plane];
192
+
193
+ for (let i = 0; i < height; i++) {
194
+ const a = (y0 + i) * stride + x0;
195
+ const b = i * width;
196
+
197
+ if (capture === 1) {
198
+ for (let j = 0; j < width; j++) {
199
+ saved[b + j] = live[a + j];
200
+ }
201
+ } else {
202
+ for (let j = 0; j < width; j++) {
203
+ live[a + j] = saved[b + j];
204
+ }
205
+ }
206
+ }
207
+
208
+ move_run(ctx.above_level_context[plane], c >> sub_x, snapshot.above_level[plane], bw4 >> sub_x, capture);
209
+ move_run(ctx.above_dc_context[plane], c >> sub_x, snapshot.above_dc[plane], bw4 >> sub_x, capture);
210
+ move_run(ctx.left_level_context[plane], r >> sub_y, snapshot.left_level[plane], bh4 >> sub_y, capture);
211
+ move_run(ctx.left_dc_context[plane], r >> sub_y, snapshot.left_dc[plane], bh4 >> sub_y, capture);
212
+
213
+ // only the block's own square: a transform block sets the flag for the samples it covers
214
+ // and no others, so nothing outside can have changed
215
+ const flag_row = ((r & 15) >> sub_y) + BLOCK_DECODED_ORIGIN;
216
+ const flag_column = ((c & 15) >> sub_x) + BLOCK_DECODED_ORIGIN;
217
+
218
+ const flag_rows = bh4 >> sub_y;
219
+ const flag_columns = bw4 >> sub_x;
220
+
221
+ const live_flags = ctx.block_decoded[plane];
222
+ const saved_flags = snapshot.block_decoded[plane];
223
+
224
+ for (let i = 0; i < flag_rows; i++) {
225
+ const a = (flag_row + i) * BLOCK_DECODED_STRIDE + flag_column;
226
+ const b = i * MAX_SIDE4;
227
+
228
+ if (capture === 1) {
229
+ for (let j = 0; j < flag_columns; j++) {
230
+ saved_flags[b + j] = live_flags[a + j];
231
+ }
232
+ } else {
233
+ for (let j = 0; j < flag_columns; j++) {
234
+ live_flags[a + j] = saved_flags[b + j];
235
+ }
236
+ }
237
+ }
238
+ }
239
+
240
+ move_mode_info(ctx.y_modes, snapshot.y_modes, ctx, r, c, bw4, bh4, capture);
241
+ move_mode_info(ctx.uv_modes, snapshot.uv_modes, ctx, r, c, bw4, bh4, capture);
242
+ move_mode_info(ctx.mi_sizes, snapshot.mi_sizes, ctx, r, c, bw4, bh4, capture);
243
+ move_mode_info(ctx.skips, snapshot.skips, ctx, r, c, bw4, bh4, capture);
244
+ move_mode_info(ctx.tx_types, snapshot.tx_types, ctx, r, c, bw4, bh4, capture);
245
+ move_mode_info(ctx.inter_tx_sizes, snapshot.tx_sizes, ctx, r, c, bw4, bh4, capture);
246
+ }
247
+
248
+ /**
249
+ * @param {Uint8Array} live
250
+ * @param {number} start
251
+ * @param {Uint8Array} saved
252
+ * @param {number} count
253
+ * @param {number} capture
254
+ */
255
+ function move_run(live, start, saved, count, capture) {
256
+ if (capture === 1) {
257
+ for (let i = 0; i < count; i++) {
258
+ saved[i] = live[start + i];
259
+ }
260
+
261
+ return;
262
+ }
263
+
264
+ for (let i = 0; i < count; i++) {
265
+ live[start + i] = saved[i];
266
+ }
267
+ }
268
+
269
+ /**
270
+ * @param {Uint8Array} live
271
+ * @param {Uint8Array} saved
272
+ * @param {Av1FrameContext} ctx
273
+ * @param {number} r
274
+ * @param {number} c
275
+ * @param {number} bw4
276
+ * @param {number} bh4
277
+ * @param {number} capture
278
+ */
279
+ function move_mode_info(live, saved, ctx, r, c, bw4, bh4, capture) {
280
+ const stride = ctx.mi_stride;
281
+
282
+ const rows = Math.min(bh4, ctx.mi_rows - r);
283
+ const columns = Math.min(bw4, ctx.mi_cols - c);
284
+
285
+ for (let i = 0; i < rows; i++) {
286
+ const a = (r + i) * stride + c;
287
+ const b = i * MAX_SIDE4;
288
+
289
+ if (capture === 1) {
290
+ for (let j = 0; j < columns; j++) {
291
+ saved[b + j] = live[a + j];
292
+ }
293
+ } else {
294
+ for (let j = 0; j < columns; j++) {
295
+ live[a + j] = saved[b + j];
296
+ }
297
+ }
298
+ }
299
+ }
@@ -0,0 +1,384 @@
1
+ /**
2
+ * Fields of {@link Av1EncodeContext#decisions}, in the order they are laid out.
3
+ * @type {number}
4
+ */
5
+ export const DECISION_Y_MODE: number;
6
+ /** @type {number} */
7
+ export const DECISION_UV_MODE: number;
8
+ /** @type {number} */
9
+ export const DECISION_SKIP: number;
10
+ /** @type {number} */
11
+ export const DECISION_TX_TYPE: number;
12
+ /** @type {number} */
13
+ export const DECISION_TX_SIZE: number;
14
+ /**
15
+ * Everything an encode needs on top of what a decode does.
16
+ *
17
+ * The frame context is the decoder's, unchanged: an encoder has to hold the *reconstruction* — what
18
+ * the decoder will end up with — because that is what the next block predicts from. Keeping the same
19
+ * struct means the two cannot drift apart in what they think a plane or a context is.
20
+ *
21
+ * @author Alex Goldring
22
+ * @copyright Company Named Limited (c) 2026
23
+ */
24
+ export class Av1EncodeContext {
25
+ /** @type {Av1FrameContext} holds the reconstruction, the contexts and the symbol writer */
26
+ frame_context: Av1FrameContext;
27
+ /** @type {SequenceHeader} */
28
+ sequence: SequenceHeader;
29
+ /** @type {FrameHeader} */
30
+ frame: FrameHeader;
31
+ /** @type {Uint16Array[]} the picture being encoded, padded out to the mode info grid */
32
+ source: Uint16Array[];
33
+ /** @type {Int32Array} */
34
+ source_stride: Int32Array;
35
+ /** @type {Int32Array} residual, then coefficients */
36
+ residual: Int32Array;
37
+ /**
38
+ * Quantised levels of the transform block being coded, one view per plane.
39
+ *
40
+ * A plane of one block holds as many levels as it has samples however it is cut into transform
41
+ * blocks — sixty-four four by fours or one thirty-two by thirty-two come to the same thousand
42
+ * and twenty-four — so one buffer per plane covers every transform size the encoder can pick,
43
+ * with each transform block's levels laid end to end.
44
+ *
45
+ * The three are views into one allocation, laid out in the order they are used. Three separate
46
+ * typed arrays would be three separate objects on the heap with nothing keeping them near each
47
+ * other; one buffer keeps a block's whole working set inside a page.
48
+ * @type {Int32Array[]}
49
+ */
50
+ levels: Int32Array[];
51
+ /** @type {Int32Array} whether each plane's chosen levels are all zero */
52
+ chosen_empty: Int32Array;
53
+ /**
54
+ * @type {number} squared error in the coefficient domain that the last quantised transform
55
+ * block cost, which is what a trial reads instead of reconstructing to find out
56
+ */
57
+ quantised_error: number;
58
+ /**
59
+ * @type {number} `1` to measure a trial's loss by reconstructing it and subtracting the source,
60
+ * rather than by reading it off the quantiser. Slower by the price of an inverse transform per
61
+ * candidate, and here to keep the cheap answer honest
62
+ */
63
+ exact_trial_distortion: number;
64
+ /**
65
+ * @type {number} `1` while a plane is being coded only so that what comes after it can see the
66
+ * reconstruction, which is the one time a trial has to build one
67
+ */
68
+ materialising: number;
69
+ /** @type {number} the transform type the block's luma residual is coded with */
70
+ luma_tx_type: number;
71
+ /** @type {number} what the winning luma mode's plane cost, which the transform search starts from */
72
+ chosen_plane_cost: number;
73
+ /** @type {number} whether the plane the last trial priced quantised to nothing */
74
+ trial_empty: number;
75
+ /** @type {number} the same, for the U plane, which the chroma decision prices before the V */
76
+ trial_empty_u: number;
77
+ /** @type {Int32Array} candidate prediction modes, best-predicting first */
78
+ mode_order: Int32Array;
79
+ /** @type {Float64Array} the squared prediction error each entry of {@link mode_order} scored */
80
+ mode_error: Float64Array;
81
+ /**
82
+ * Writers that price rather than emit, one per level of the search that nests inside another.
83
+ *
84
+ * The same class as the one that writes the bitstream, in its costing mode: the coefficient
85
+ * writer is handed one or the other, and it is the hottest function in the encoder, so what it
86
+ * sees at that call site has to be one shape rather than two.
87
+ * @type {SymbolWriter}
88
+ */
89
+ cost_writer: SymbolWriter;
90
+ /** @type {SymbolWriter} prices a whole block, which nests around {@link cost_writer} */
91
+ block_cost_writer: SymbolWriter;
92
+ /** @type {SymbolWriter} prices a partition symbol, which nests around both */
93
+ partition_cost_writer: SymbolWriter;
94
+ /** @type {number} the dequantiser the last quantised block's DC will be multiplied back up by */
95
+ step_dc: number;
96
+ /** @type {number} and its AC */
97
+ step_ac: number;
98
+ /** @type {number} and what the dequantiser divides by afterwards */
99
+ step_denominator: number;
100
+ /** @type {number} squared error the block being priced would leave behind */
101
+ block_distortion: number;
102
+ /**
103
+ * Saved state a partition decision can be put back to.
104
+ *
105
+ * One for the superblock, whose search has to be undone in full before the winning tree is
106
+ * written, and then two for each depth that decides anything — the state before any answer was
107
+ * tried, and the state the best answer so far left, so that answer does not have to be made
108
+ * again when it turns out to have won. Blocks run 32x32 down to 8x8 and each of those three
109
+ * decides, so seven is the whole of it.
110
+ * @type {Av1BlockSnapshot[]}
111
+ */
112
+ snapshots: Av1BlockSnapshot[];
113
+ /**
114
+ * What the search settled on, for the whole frame: one entry per 4x4 position per field.
115
+ *
116
+ * Frame-wide rather than a superblock at a time because the writing pass may have to run twice.
117
+ * Loop restoration is chosen from the finished, filtered picture and coded per superblock
118
+ * *inside* the tile, so the only way to write it is to code the tile once, look at what came
119
+ * out, and then code it again from the same decisions.
120
+ * @type {Uint8Array}
121
+ */
122
+ decisions: Uint8Array;
123
+ /**
124
+ * How far apart the fields of {@link decisions} are, which is one frame of 4x4 positions.
125
+ * @type {number}
126
+ */
127
+ decision_stride: number;
128
+ /**
129
+ * Which partition the search chose at each node, by depth and corner, for the whole frame.
130
+ *
131
+ * Not in the snapshot, because a node writes only its own entry and a losing branch's children
132
+ * are never read: the writing pass descends only where the parent says it split.
133
+ * @type {Uint8Array}
134
+ */
135
+ partitions: Uint8Array;
136
+ /**
137
+ * How many of the eight uneven partitions are searched, in the order they are worth asking
138
+ * about: the two halves, then the four T-shapes, then the two quarterings.
139
+ *
140
+ * Each is another whole subtree to price and they are gated on the whole and the quartered
141
+ * answers being close, so this is a knob rather than a fact.
142
+ * @type {number}
143
+ */
144
+ uneven_partitions: number;
145
+ /** @type {Int32Array} scratch for the Walsh-Hadamard pair */
146
+ scratch: Int32Array;
147
+ /** @type {number} the quantiser step the frame's decisions are measured against */
148
+ quantiser_step: number;
149
+ /**
150
+ * Squared error the encoder will give up to save one bit.
151
+ *
152
+ * The slope of the rate-distortion curve at this quantiser: a decision is taken when
153
+ * `distortion + lambda * rate` falls, which is the Lagrangian that makes "smaller" and "better"
154
+ * one number rather than two. Set per frame by {@link encode_av1_still} from the quantiser step,
155
+ * because the trade is worth more where the quantiser is coarse.
156
+ *
157
+ * In squared error per {@link COST_ONE_BIT} of rate, so that the rate the cost writer reports
158
+ * can be used without scaling it first.
159
+ * @type {number}
160
+ */
161
+ lambda: number;
162
+ /**
163
+ * @type {Uint16Array[]} the reconstruction before any in-loop filter, so that a filter strength
164
+ * can be tried, measured and taken back
165
+ */
166
+ unfiltered: Uint16Array[];
167
+ /**
168
+ * How many deblocking levels are measured before refining around the best of them.
169
+ *
170
+ * Zero signals no deblocking at all, which is what this encoder did before it could measure.
171
+ * @type {number}
172
+ */
173
+ filter_trials: number;
174
+ /**
175
+ * How many directional filter strengths are measured.
176
+ *
177
+ * One pass over the frame measures one candidate for luma and one for chroma at once, because
178
+ * the two are independent — a strength touches only its own planes. Zero signals no directional
179
+ * filter at all.
180
+ *
181
+ * Three rather than the whole ladder: each is a pass over the frame, and because the ladder is
182
+ * ordered to spread rather than to crowd the weak end, three of them come within a percent of
183
+ * all twelve and cost a third of what they do.
184
+ * @type {number}
185
+ */
186
+ cdef_trials: number;
187
+ /**
188
+ * Size the filter scratch for a frame, allocating only what has grown.
189
+ *
190
+ * @param {Av1FrameContext} ctx
191
+ */
192
+ resize_filters(ctx: Av1FrameContext): void;
193
+ /**
194
+ * Make room for the restoration fit: one plane of intermediates, one unit index per 4x4 block,
195
+ * and the normal equations of every unit at once.
196
+ *
197
+ * @param {Av1FrameContext} ctx
198
+ */
199
+ resize_restoration(ctx: Av1FrameContext): void;
200
+ /** @type {Float32Array} one plane, with one direction's taps run over it */
201
+ restoration_middle: Float32Array;
202
+ /** @type {Int32Array} which restoration unit each 4x4 block of a plane belongs to */
203
+ restoration_map: Int32Array;
204
+ /** @type {Float64Array} the normal equations of every unit: nine of a matrix, then three of a
205
+ * right hand side */
206
+ restoration_stats: Float64Array;
207
+ /** @type {Float64Array} squared error per unit, with the filter and without it */
208
+ restoration_errors: Float64Array;
209
+ /** @type {Int32Array} three coded taps expanded into the seven of a symmetric filter */
210
+ restoration_taps: Int32Array;
211
+ /** @type {Float64Array} the three sums one sample contributes to a fit */
212
+ restoration_basis: Float64Array;
213
+ /** @type {Float64Array} the augmented matrix a unit's fit is eliminated in */
214
+ restoration_system: Float64Array;
215
+ /** @type {Float64Array} the taps it comes out with, before they are rounded and clamped */
216
+ restoration_solution: Float64Array;
217
+ /** @type {Int8Array} one plane's reference taps, put back after a unit is priced */
218
+ restoration_reference: Int8Array;
219
+ /** @type {SymbolWriter} prices a restoration unit by writing its real syntax */
220
+ restoration_writer: SymbolWriter;
221
+ /** @type {number} restoration units down the frame, for the plane being fitted */
222
+ restoration_rows: number;
223
+ /** @type {number} and across it */
224
+ restoration_columns: number;
225
+ /**
226
+ * How many times the restoration fit alternates between the two directions.
227
+ *
228
+ * The first round fits the horizontal taps against the picture as it is and the vertical ones
229
+ * against what those left; a second round refits both against each other and is where the fit
230
+ * settles. Zero asks for no restoration at all, which is what a frame gets when the filter
231
+ * would cost more than it saves everywhere.
232
+ * @type {number}
233
+ */
234
+ restoration_trials: number;
235
+ /**
236
+ * How large a restoration unit is: zero for sixty-four samples, one for a hundred and
237
+ * twenty-eight, two for two hundred and fifty-six.
238
+ *
239
+ * A unit's taps cost thirty or forty bits whatever it covers, so the smallest units are the
240
+ * most adapted and the least affordable — on a small picture sixty-four sample units would
241
+ * spend a tenth of the file describing filters. Two hundred and fifty-six is where the cost
242
+ * disappears and most of the gain is still there.
243
+ * @type {number}
244
+ */
245
+ restoration_unit_shift: number;
246
+ /** @type {number} how many planes are offered a restoration filter */
247
+ restoration_planes: number;
248
+ /**
249
+ * Which in-loop filters the file asks the reader to run: one of the `DECODE_*` constants.
250
+ *
251
+ * The other axis to effort, and an unrelated one — this one spends the *reader's* time rather
252
+ * than this machine's. See {@link decode_effort.js} for what each setting costs and buys, and
253
+ * for why a codec that exists to load textures defaults to the fast one.
254
+ * @type {number}
255
+ */
256
+ decode_effort: number;
257
+ /** @type {ColourTransform} how the caller's RGB becomes the planes this codes */
258
+ transform: ColourTransform;
259
+ /** @type {Float32Array} one row of interleaved RGB, at the padded width */
260
+ rgb_row: Float32Array;
261
+ /** @type {Float32Array} */
262
+ cb_row: Float32Array;
263
+ /** @type {Float32Array} */
264
+ cr_row: Float32Array;
265
+ /** @type {Float32Array} one chroma row being averaged into */
266
+ chroma_blue: Float32Array;
267
+ /** @type {Float32Array} */
268
+ chroma_red: Float32Array;
269
+ /** @type {Float32Array} */
270
+ chroma_weight: Float32Array;
271
+ /** @type {number} */
272
+ row_width: number;
273
+ /**
274
+ * @param {number} width the padded width, in luma samples
275
+ */
276
+ resize_rows(width: number): void;
277
+ /**
278
+ * How far a coefficient must be past a quantiser step before it is coded at all, as a fraction
279
+ * of the step.
280
+ *
281
+ * Below one half this is a dead zone: it costs a little accuracy on coefficients that were
282
+ * nearly zero anyway, and saves a great many bits, because a coefficient that quantises to zero
283
+ * costs almost nothing to code.
284
+ *
285
+ * Nine twentieths of a step, which is where it measures best. It is also, now, the *only* thing
286
+ * deciding: an encoder that also priced the last few coefficients against what coding them cost,
287
+ * and dropped the ones that did not pay, measured half a per cent *worse* than this and took
288
+ * five times as long over the coefficient syntax. See D35.
289
+ * @type {number}
290
+ */
291
+ rounding: number;
292
+ /**
293
+ * What a split costs at the very least, in bits, below which one is not looked for.
294
+ *
295
+ * Splitting a block into four writes a partition symbol and then, per quarter, a skip flag and
296
+ * a luma and a chroma mode — a dozen bits before a single coefficient. So a block already
297
+ * costing less than a dozen bits' worth of squared error cannot be improved by splitting it,
298
+ * whatever the four quarters would do, and the whole subtree under it can go unsearched.
299
+ *
300
+ * That is nearly a proof rather than a heuristic; the "nearly" is that the dozen is a count of
301
+ * symbols rather than a floor on what those symbols cost in this block's contexts. Raising it
302
+ * trades compression for speed, and it is the first knob to reach for.
303
+ * @type {number}
304
+ */
305
+ split_floor: number;
306
+ /**
307
+ * How close the whole and the quartered answers must be before the halves are searched too.
308
+ *
309
+ * A half is the answer between a whole and a quarter, so it is worth asking about exactly when
310
+ * those two are close. When one wins outright the picture has already said whether the detail
311
+ * here is worth another partition symbol, and two more subtrees will not change its mind —
312
+ * while each costs as much again as the unsplit answer did. One turns the rectangles off; a
313
+ * large number searches them always.
314
+ * @type {number}
315
+ */
316
+ rectangle_margin: number;
317
+ /**
318
+ * {@link lambda} as a multiple of the squared quantiser step.
319
+ *
320
+ * The constant in the usual relation between a quantiser and the slope of the rate-distortion
321
+ * curve, and it has to be measured rather than derived: the step it multiplies is the
322
+ * *transform-domain* dequantiser, the distortion it converts to is in samples, and the ratio
323
+ * between those depends on the transform's gain.
324
+ *
325
+ * Measured as the encoder's own slope — encode at two quantisers, divide the change in squared
326
+ * error over the coded planes by the change in coded bits — which comes out at this value to
327
+ * within a sixth across photographic and synthetic pictures and across three decades of
328
+ * quantiser. That is a property of the format's quantiser tables, not of the pictures.
329
+ * @type {number}
330
+ */
331
+ lambda_scale: number;
332
+ /**
333
+ * How many prediction modes are priced properly, out of the thirteen.
334
+ *
335
+ * Every candidate is predicted and ranked by how close its prediction lands; only this many are
336
+ * then transformed, quantised and costed. The ranking is nearly free and the pricing is not, and
337
+ * the mode that wins on rate and distortion is almost always among the two or three that
338
+ * predicted best. Raising this is the quality-for-time knob; two is a sensible floor and
339
+ * thirteen is an exhaustive search.
340
+ * @type {number}
341
+ */
342
+ mode_trials: number;
343
+ /**
344
+ * How many transforms beyond the plain DCT the block's luma residual is tried against.
345
+ *
346
+ * Zero codes every block with a DCT, which is what the format's larger transform sizes allow
347
+ * anyway. Three is the whole of what {@link forward_transform_2d} can build a matrix for.
348
+ * @type {number}
349
+ */
350
+ transform_trials: number;
351
+ /**
352
+ * How many transform sizes the block's luma is tried at, largest first.
353
+ *
354
+ * One takes the largest the block allows, which is what the format calls largest-transform mode
355
+ * and is what this encoder did before it could ask. Each step after that halves again, and the
356
+ * returns fall away quickly: the first is worth 1.7% and the second 0.6%.
357
+ * @type {number}
358
+ */
359
+ transform_depths: number;
360
+ /**
361
+ * Make room for a frame's worth of decisions.
362
+ *
363
+ * The five fields live end to end in one array rather than in five of their own, because they
364
+ * are read together, one position at a time, by the writing pass.
365
+ *
366
+ * @param {number} mi_count 4x4 positions in the frame
367
+ */
368
+ resize_decisions(mi_count: number): void;
369
+ /**
370
+ * @param {number} width
371
+ * @param {number} height
372
+ * @param {number} subsampling_x
373
+ * @param {number} subsampling_y
374
+ * @param {number} num_planes
375
+ */
376
+ resize_source(width: number, height: number, subsampling_x: number, subsampling_y: number, num_planes: number): void;
377
+ }
378
+ import { Av1FrameContext } from "../decode/Av1FrameContext.js";
379
+ import { SequenceHeader } from "../obu/SequenceHeader.js";
380
+ import { FrameHeader } from "../obu/FrameHeader.js";
381
+ import { SymbolWriter } from "../entropy/SymbolWriter.js";
382
+ import { Av1BlockSnapshot } from "./Av1BlockSnapshot.js";
383
+ import { ColourTransform } from "../../color/ColourTransform.js";
384
+ //# sourceMappingURL=Av1EncodeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Av1EncodeContext.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/encode/Av1EncodeContext.js"],"names":[],"mappings":"AAoCA;;;GAGG;AACH,8BAFU,MAAM,CAEiB;AAEjC,qBAAqB;AACrB,+BADW,MAAM,CACiB;AAElC,qBAAqB;AACrB,4BADW,MAAM,CACc;AAE/B,qBAAqB;AACrB,+BADW,MAAM,CACiB;AAElC,qBAAqB;AACrB,+BADW,MAAM,CACiB;AAYlC;;;;;;;;;GASG;AACH;IACI,2FAA2F;IAC3F,eADW,eAAe,CACY;IAEtC,6BAA6B;IAC7B,UADW,cAAc,CACO;IAEhC,0BAA0B;IAC1B,OADW,WAAW,CACI;IAE1B,wFAAwF;IACxF,QADW,WAAW,EAAE,CACI;IAE5B,yBAAyB;IACzB,eADW,UAAU,CACa;IAElC,qDAAqD;IACrD,UADW,UAAU,CACoC;IAEzD;;;;;;;;;;;;OAYG;IACH,QAFU,UAAU,EAAE,CAE0C;IAEhE,yEAAyE;IACzE,cADW,UAAU,CACY;IAEjC;;;OAGG;IACH,iBAHU,MAAM,CAGI;IAEpB;;;;OAIG;IACH,wBAJU,MAAM,CAIW;IAE3B;;;OAGG;IACH,eAHU,MAAM,CAGE;IAElB,gFAAgF;IAChF,cADW,MAAM,CACA;IAEjB,qGAAqG;IACrG,mBADW,MAAM,CACK;IAEtB,kFAAkF;IAClF,aADW,MAAM,CACD;IAEhB,8FAA8F;IAC9F,eADW,MAAM,CACC;IAElB,2EAA2E;IAC3E,YADW,UAAU,CACoB;IAEzC,gGAAgG;IAChG,YADW,YAAY,CACoB;IAE3C;;;;;;;OAOG;IACH,aAFU,YAAY,CAEW;IAEjC,wFAAwF;IACxF,mBADW,YAAY,CACgB;IAEvC,8EAA8E;IAC9E,uBADW,YAAY,CACoB;IAE3C,iGAAiG;IACjG,SADW,MAAM,CACL;IAEZ,gCAAgC;IAChC,SADW,MAAM,CACL;IAEZ,oEAAoE;IACpE,kBADW,MAAM,CACI;IAErB,6EAA6E;IAC7E,kBADW,MAAM,CACI;IAErB;;;;;;;;;OASG;IACH,WAFU,gBAAgB,EAAE,CAU1B;IAEF;;;;;;;;OAQG;IACH,WAFU,UAAU,CAEU;IAE9B;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;;;;OAMG;IACH,YAFU,UAAU,CAEW;IAE/B;;;;;;;OAOG;IACH,mBAFU,MAAM,CAEM;IAEtB,6DAA6D;IAC7D,SADW,UAAU,CACO;IAE5B,mFAAmF;IACnF,gBADW,MAAM,CACE;IAEnB;;;;;;;;;;;OAWG;IACH,QAFU,MAAM,CAEL;IAEX;;;OAGG;IACH,YAHU,WAAW,EAAE,CAGS;IAEhC;;;;;OAKG;IACH,eAFU,MAAM,CAEE;IAElB;;;;;;;;;;;OAWG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,oBAFW,eAAe,QAYzB;IAED;;;;;OAKG;IACH,wBAFW,eAAe,QA4BzB;IAED,4EAA4E;IAC5E,oBADW,YAAY,CACkB;IAEzC,qFAAqF;IACrF,iBADW,UAAU,CACe;IAEpC;yBACqB;IACrB,mBAFW,YAAY,CAEiB;IAExC,kFAAkF;IAClF,oBADW,YAAY,CACkB;IAEzC,wFAAwF;IACxF,kBADW,UAAU,CACgB;IAErC,0EAA0E;IAC1E,mBADW,YAAY,CACiB;IAExC,8EAA8E;IAC9E,oBADW,YAAY,CACmB;IAE1C,2FAA2F;IAC3F,sBADW,YAAY,CACoB;IAE3C,oFAAoF;IACpF,uBADW,SAAS,CACqB;IAEzC,gFAAgF;IAChF,oBADW,YAAY,CACiB;IAExC,kFAAkF;IAClF,kBADW,MAAM,CACI;IAErB,mCAAmC;IACnC,qBADW,MAAM,CACO;IAExB;;;;;;;;OAQG;IACH,oBAFU,MAAM,CAEO;IAEvB;;;;;;;;;OASG;IACH,wBAFU,MAAM,CAEW;IAE3B,sEAAsE;IACtE,oBADW,MAAM,CACM;IAEvB;;;;;;;OAOG;IACH,eAFU,MAAM,CAEY;IAE5B,iFAAiF;IACjF,WADW,eAAe,CACQ;IAElC,2EAA2E;IAC3E,SADW,YAAY,CACR;IAEf,2BAA2B;IAC3B,QADW,YAAY,CACT;IAEd,2BAA2B;IAC3B,QADW,YAAY,CACT;IAEd,8DAA8D;IAC9D,aADW,YAAY,CACJ;IAEnB,2BAA2B;IAC3B,YADW,YAAY,CACL;IAElB,2BAA2B;IAC3B,eADW,YAAY,CACF;IAErB,qBAAqB;IACrB,WADW,MAAM,CACH;IAEd;;OAEG;IACH,mBAFW,MAAM,QAgBhB;IAED;;;;;;;;;;;;;OAaG;IACH,UAFU,MAAM,CAEA;IAEhB;;;;;;;;;;;;OAYG;IACH,aAFU,MAAM,CAEC;IAEjB;;;;;;;;;OASG;IACH,kBAFU,MAAM,CAEO;IAEvB;;;;;;;;;;;;;OAaG;IACH,cAFU,MAAM,CAEM;IAEtB;;;;;;;;;OASG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;;;OAMG;IACH,kBAFU,MAAM,CAEK;IAErB;;;;;;;OAOG;IACH,kBAFU,MAAM,CAEK;IAGrB;;;;;;;OAOG;IACH,2BAFW,MAAM,QAYhB;IAED;;;;;;OAMG;IACH,qBANW,MAAM,UACN,MAAM,iBACN,MAAM,iBACN,MAAM,cACN,MAAM,QAyBhB;CACJ;gCA3kB+B,8BAA8B;+BAK/B,0BAA0B;4BAF7B,uBAAuB;6BADtB,4BAA4B;iCAJxB,uBAAuB;gCAGxB,gCAAgC"}