@woosh/meep-engine 3.8.0 → 3.10.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.
- package/build/bundle-worker-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/package.json +3 -2
- package/src/avif/encode_image_source.d.ts +70 -0
- package/src/avif/encode_image_source.d.ts.map +1 -0
- package/src/avif/encode_image_source.js +117 -0
- package/src/avif/encoder_worker.js +15 -126
- package/src/avif/index.d.ts +4 -2
- package/src/avif/index.js +21 -2
- package/src/avif/native/DECISIONS.md +537 -0
- package/src/avif/native/NOTICE.md +61 -0
- package/src/avif/native/api/AvifDecoder.d.ts +67 -0
- package/src/avif/native/api/AvifDecoder.d.ts.map +1 -0
- package/src/avif/native/api/AvifDecoder.js +121 -0
- package/src/avif/native/api/apply_transformations.d.ts +30 -0
- package/src/avif/native/api/apply_transformations.d.ts.map +1 -0
- package/src/avif/native/api/apply_transformations.js +120 -0
- package/src/avif/native/api/avif_to_sampler2d.d.ts +25 -0
- package/src/avif/native/api/avif_to_sampler2d.d.ts.map +1 -0
- package/src/avif/native/api/avif_to_sampler2d.js +42 -0
- package/src/avif/native/api/convert_to_rgba.d.ts +54 -0
- package/src/avif/native/api/convert_to_rgba.d.ts.map +1 -0
- package/src/avif/native/api/convert_to_rgba.js +204 -0
- package/src/avif/native/api/decode_avif.d.ts +24 -0
- package/src/avif/native/api/decode_avif.d.ts.map +1 -0
- package/src/avif/native/api/decode_avif.js +111 -0
- package/src/avif/native/api/decode_image_item.d.ts +18 -0
- package/src/avif/native/api/decode_image_item.d.ts.map +1 -0
- package/src/avif/native/api/decode_image_item.js +234 -0
- package/src/avif/native/api/encode_avif.d.ts +73 -0
- package/src/avif/native/api/encode_avif.d.ts.map +1 -0
- package/src/avif/native/api/encode_avif.js +488 -0
- package/src/avif/native/api/sampler2d_to_avif.d.ts +22 -0
- package/src/avif/native/api/sampler2d_to_avif.d.ts.map +1 -0
- package/src/avif/native/api/sampler2d_to_avif.js +108 -0
- package/src/avif/native/av1/decode/Av1FrameContext.d.ts +286 -0
- package/src/avif/native/av1/decode/Av1FrameContext.d.ts.map +1 -0
- package/src/avif/native/av1/decode/Av1FrameContext.js +622 -0
- package/src/avif/native/av1/decode/block_decoded.d.ts +27 -0
- package/src/avif/native/av1/decode/block_decoded.d.ts.map +1 -0
- package/src/avif/native/av1/decode/block_decoded.js +59 -0
- package/src/avif/native/av1/decode/decode_av1_still.d.ts +22 -0
- package/src/avif/native/av1/decode/decode_av1_still.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_av1_still.js +309 -0
- package/src/avif/native/av1/decode/decode_coefficients.d.ts +20 -0
- package/src/avif/native/av1/decode/decode_coefficients.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_coefficients.js +259 -0
- package/src/avif/native/av1/decode/decode_palette.d.ts +28 -0
- package/src/avif/native/av1/decode/decode_palette.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_palette.js +442 -0
- package/src/avif/native/av1/decode/decode_tile.d.ts +14 -0
- package/src/avif/native/av1/decode/decode_tile.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_tile.js +1213 -0
- package/src/avif/native/av1/decode/get_scan.d.ts +16 -0
- package/src/avif/native/av1/decode/get_scan.d.ts.map +1 -0
- package/src/avif/native/av1/decode/get_scan.js +138 -0
- package/src/avif/native/av1/decode/read_lr.d.ts +35 -0
- package/src/avif/native/av1/decode/read_lr.d.ts.map +1 -0
- package/src/avif/native/av1/decode/read_lr.js +277 -0
- package/src/avif/native/av1/decode/read_transform_type.d.ts +19 -0
- package/src/avif/native/av1/decode/read_transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/decode/read_transform_type.js +92 -0
- package/src/avif/native/av1/decode/reconstruct.d.ts +36 -0
- package/src/avif/native/av1/decode/reconstruct.d.ts.map +1 -0
- package/src/avif/native/av1/decode/reconstruct.js +241 -0
- package/src/avif/native/av1/decode/transform_type.d.ts +49 -0
- package/src/avif/native/av1/decode/transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/decode/transform_type.js +137 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts +81 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts.map +1 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.js +299 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.d.ts +384 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.d.ts.map +1 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.js +590 -0
- package/src/avif/native/av1/encode/build_headers.d.ts +50 -0
- package/src/avif/native/av1/encode/build_headers.d.ts.map +1 -0
- package/src/avif/native/av1/encode/build_headers.js +359 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts +26 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.js +90 -0
- package/src/avif/native/av1/encode/choose_filters.d.ts +21 -0
- package/src/avif/native/av1/encode/choose_filters.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_filters.js +318 -0
- package/src/avif/native/av1/encode/choose_restoration.d.ts +35 -0
- package/src/avif/native/av1/encode/choose_restoration.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_restoration.js +616 -0
- package/src/avif/native/av1/encode/decode_effort.d.ts +57 -0
- package/src/avif/native/av1/encode/decode_effort.d.ts.map +1 -0
- package/src/avif/native/av1/encode/decode_effort.js +59 -0
- package/src/avif/native/av1/encode/encode_av1_still.d.ts +17 -0
- package/src/avif/native/av1/encode/encode_av1_still.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_av1_still.js +194 -0
- package/src/avif/native/av1/encode/encode_effort.d.ts +56 -0
- package/src/avif/native/av1/encode/encode_effort.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_effort.js +97 -0
- package/src/avif/native/av1/encode/encode_tile.d.ts +26 -0
- package/src/avif/native/av1/encode/encode_tile.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_tile.js +2331 -0
- package/src/avif/native/av1/encode/quantise.d.ts +51 -0
- package/src/avif/native/av1/encode/quantise.d.ts.map +1 -0
- package/src/avif/native/av1/encode/quantise.js +212 -0
- package/src/avif/native/av1/encode/write_coefficients.d.ts +42 -0
- package/src/avif/native/av1/encode/write_coefficients.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_coefficients.js +367 -0
- package/src/avif/native/av1/encode/write_lr.d.ts +33 -0
- package/src/avif/native/av1/encode/write_lr.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_lr.js +174 -0
- package/src/avif/native/av1/encode/write_transform_type.d.ts +21 -0
- package/src/avif/native/av1/encode/write_transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_transform_type.js +70 -0
- package/src/avif/native/av1/entropy/CdfContext.d.ts +167 -0
- package/src/avif/native/av1/entropy/CdfContext.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/CdfContext.js +433 -0
- package/src/avif/native/av1/entropy/SymbolReader.d.ts +103 -0
- package/src/avif/native/av1/entropy/SymbolReader.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/SymbolReader.js +317 -0
- package/src/avif/native/av1/entropy/SymbolWriter.d.ts +107 -0
- package/src/avif/native/av1/entropy/SymbolWriter.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/SymbolWriter.js +352 -0
- package/src/avif/native/av1/entropy/coefficient_context.d.ts +71 -0
- package/src/avif/native/av1/entropy/coefficient_context.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/coefficient_context.js +325 -0
- package/src/avif/native/av1/entropy/partition_cdf.d.ts +54 -0
- package/src/avif/native/av1/entropy/partition_cdf.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/partition_cdf.js +98 -0
- package/src/avif/native/av1/entropy/symbol_cost.d.ts +37 -0
- package/src/avif/native/av1/entropy/symbol_cost.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/symbol_cost.js +76 -0
- package/src/avif/native/av1/filter/cdef.d.ts +15 -0
- package/src/avif/native/av1/filter/cdef.d.ts.map +1 -0
- package/src/avif/native/av1/filter/cdef.js +313 -0
- package/src/avif/native/av1/filter/loop_filter.d.ts +14 -0
- package/src/avif/native/av1/filter/loop_filter.d.ts.map +1 -0
- package/src/avif/native/av1/filter/loop_filter.js +377 -0
- package/src/avif/native/av1/filter/loop_restoration.d.ts +42 -0
- package/src/avif/native/av1/filter/loop_restoration.d.ts.map +1 -0
- package/src/avif/native/av1/filter/loop_restoration.js +451 -0
- package/src/avif/native/av1/filter/superres.d.ts +18 -0
- package/src/avif/native/av1/filter/superres.d.ts.map +1 -0
- package/src/avif/native/av1/filter/superres.js +86 -0
- package/src/avif/native/av1/grain/FilmGrainState.d.ts +62 -0
- package/src/avif/native/av1/grain/FilmGrainState.d.ts.map +1 -0
- package/src/avif/native/av1/grain/FilmGrainState.js +87 -0
- package/src/avif/native/av1/grain/film_grain.d.ts +16 -0
- package/src/avif/native/av1/grain/film_grain.d.ts.map +1 -0
- package/src/avif/native/av1/grain/film_grain.js +623 -0
- package/src/avif/native/av1/obu/FrameHeader.d.ts +248 -0
- package/src/avif/native/av1/obu/FrameHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/FrameHeader.js +381 -0
- package/src/avif/native/av1/obu/ObuHeader.d.ts +53 -0
- package/src/avif/native/av1/obu/ObuHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/ObuHeader.js +62 -0
- package/src/avif/native/av1/obu/SequenceHeader.d.ts +157 -0
- package/src/avif/native/av1/obu/SequenceHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/SequenceHeader.js +225 -0
- package/src/avif/native/av1/obu/for_each_obu.d.ts +24 -0
- package/src/avif/native/av1/obu/for_each_obu.d.ts.map +1 -0
- package/src/avif/native/av1/obu/for_each_obu.js +50 -0
- package/src/avif/native/av1/obu/parse_frame_header.d.ts +18 -0
- package/src/avif/native/av1/obu/parse_frame_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_frame_header.js +841 -0
- package/src/avif/native/av1/obu/parse_obu_header.d.ts +23 -0
- package/src/avif/native/av1/obu/parse_obu_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_obu_header.js +69 -0
- package/src/avif/native/av1/obu/parse_sequence_header.d.ts +17 -0
- package/src/avif/native/av1/obu/parse_sequence_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_sequence_header.js +263 -0
- package/src/avif/native/av1/obu/write_frame_header.d.ts +16 -0
- package/src/avif/native/av1/obu/write_frame_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/write_frame_header.js +579 -0
- package/src/avif/native/av1/obu/write_sequence_header.d.ts +17 -0
- package/src/avif/native/av1/obu/write_sequence_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/write_sequence_header.js +189 -0
- package/src/avif/native/av1/predict/IntraPredictionState.d.ts +49 -0
- package/src/avif/native/av1/predict/IntraPredictionState.d.ts.map +1 -0
- package/src/avif/native/av1/predict/IntraPredictionState.js +58 -0
- package/src/avif/native/av1/predict/intra_filter_type.d.ts +17 -0
- package/src/avif/native/av1/predict/intra_filter_type.d.ts.map +1 -0
- package/src/avif/native/av1/predict/intra_filter_type.js +79 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts +50 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.js +153 -0
- package/src/avif/native/av1/predict/predict_intra.d.ts +42 -0
- package/src/avif/native/av1/predict/predict_intra.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_intra.js +803 -0
- package/src/avif/native/av1/predict/predict_palette.d.ts +23 -0
- package/src/avif/native/av1/predict/predict_palette.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_palette.js +36 -0
- package/src/avif/native/av1/tables/av1_symbols.d.ts +411 -0
- package/src/avif/native/av1/tables/av1_symbols.d.ts.map +1 -0
- package/src/avif/native/av1/tables/av1_symbols.js +419 -0
- package/src/avif/native/av1/tables/block_tables.d.ts +181 -0
- package/src/avif/native/av1/tables/block_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/block_tables.js +270 -0
- package/src/avif/native/av1/tables/cdf_tables.d.ts +961 -0
- package/src/avif/native/av1/tables/cdf_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/cdf_tables.js +1893 -0
- package/src/avif/native/av1/tables/coefficient_tables.d.ts +41 -0
- package/src/avif/native/av1/tables/coefficient_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/coefficient_tables.js +82 -0
- package/src/avif/native/av1/tables/derived_block_tables.d.ts +15 -0
- package/src/avif/native/av1/tables/derived_block_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/derived_block_tables.js +23 -0
- package/src/avif/native/av1/tables/filter_tables.d.ts +171 -0
- package/src/avif/native/av1/tables/filter_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/filter_tables.js +313 -0
- package/src/avif/native/av1/tables/grain_tables.d.ts +11 -0
- package/src/avif/native/av1/tables/grain_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/grain_tables.js +190 -0
- package/src/avif/native/av1/tables/prediction_tables.d.ts +141 -0
- package/src/avif/native/av1/tables/prediction_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/prediction_tables.js +223 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts +21 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.js +38 -0
- package/src/avif/native/av1/tables/quantizer_tables.d.ts +21 -0
- package/src/avif/native/av1/tables/quantizer_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/quantizer_tables.js +160 -0
- package/src/avif/native/av1/tables/scan_tables.d.ts +321 -0
- package/src/avif/native/av1/tables/scan_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/scan_tables.js +727 -0
- package/src/avif/native/av1/tables/segmentation_tables.d.ts +31 -0
- package/src/avif/native/av1/tables/segmentation_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/segmentation_tables.js +48 -0
- package/src/avif/native/av1/tables/transform_tables.d.ts +91 -0
- package/src/avif/native/av1/tables/transform_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/transform_tables.js +140 -0
- package/src/avif/native/av1/tables/unpack_table.d.ts +33 -0
- package/src/avif/native/av1/tables/unpack_table.d.ts.map +1 -0
- package/src/avif/native/av1/tables/unpack_table.js +73 -0
- package/src/avif/native/av1/transform/forward_transform_2d.d.ts +61 -0
- package/src/avif/native/av1/transform/forward_transform_2d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/forward_transform_2d.js +574 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.d.ts +76 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.js +590 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.d.ts +46 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.js +180 -0
- package/src/avif/native/av1/util/ceil_log2.d.ts +13 -0
- package/src/avif/native/av1/util/ceil_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/ceil_log2.js +18 -0
- package/src/avif/native/av1/util/floor_log2.d.ts +20 -0
- package/src/avif/native/av1/util/floor_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/floor_log2.js +20 -0
- package/src/avif/native/av1/util/round2.d.ts +22 -0
- package/src/avif/native/av1/util/round2.d.ts.map +1 -0
- package/src/avif/native/av1/util/round2.js +27 -0
- package/src/avif/native/av1/util/round2_signed.d.ts +14 -0
- package/src/avif/native/av1/util/round2_signed.d.ts.map +1 -0
- package/src/avif/native/av1/util/round2_signed.js +17 -0
- package/src/avif/native/av1/util/tile_log2.d.ts +16 -0
- package/src/avif/native/av1/util/tile_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/tile_log2.js +23 -0
- package/src/avif/native/bitstream/BitReader.d.ts +174 -0
- package/src/avif/native/bitstream/BitReader.d.ts.map +1 -0
- package/src/avif/native/bitstream/BitReader.js +391 -0
- package/src/avif/native/bitstream/BitWriter.d.ts +122 -0
- package/src/avif/native/bitstream/BitWriter.d.ts.map +1 -0
- package/src/avif/native/bitstream/BitWriter.js +351 -0
- package/src/avif/native/color/ColourTransform.d.ts +62 -0
- package/src/avif/native/color/ColourTransform.d.ts.map +1 -0
- package/src/avif/native/color/ColourTransform.js +189 -0
- package/src/avif/native/color/YuvImage.d.ts +51 -0
- package/src/avif/native/color/YuvImage.d.ts.map +1 -0
- package/src/avif/native/color/YuvImage.js +66 -0
- package/src/avif/native/color/clamp_sample.d.ts +18 -0
- package/src/avif/native/color/clamp_sample.d.ts.map +1 -0
- package/src/avif/native/color/clamp_sample.js +25 -0
- package/src/avif/native/color/linear_to_transfer.d.ts +24 -0
- package/src/avif/native/color/linear_to_transfer.d.ts.map +1 -0
- package/src/avif/native/color/linear_to_transfer.js +126 -0
- package/src/avif/native/color/primaries.d.ts +20 -0
- package/src/avif/native/color/primaries.d.ts.map +1 -0
- package/src/avif/native/color/primaries.js +94 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.d.ts +20 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.d.ts.map +1 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.js +78 -0
- package/src/avif/native/color/transfer_to_linear.d.ts +49 -0
- package/src/avif/native/color/transfer_to_linear.d.ts.map +1 -0
- package/src/avif/native/color/transfer_to_linear.js +171 -0
- package/src/avif/native/color/upsample_chroma_row.d.ts +35 -0
- package/src/avif/native/color/upsample_chroma_row.d.ts.map +1 -0
- package/src/avif/native/color/upsample_chroma_row.js +89 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.d.ts +23 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.d.ts.map +1 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.js +78 -0
- package/src/avif/native/heif/AvifFile.d.ts +112 -0
- package/src/avif/native/heif/AvifFile.d.ts.map +1 -0
- package/src/avif/native/heif/AvifFile.js +142 -0
- package/src/avif/native/heif/ItemProperty.d.ts +244 -0
- package/src/avif/native/heif/ItemProperty.d.ts.map +1 -0
- package/src/avif/native/heif/ItemProperty.js +321 -0
- package/src/avif/native/heif/find_item_property.d.ts +17 -0
- package/src/avif/native/heif/find_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/find_item_property.js +28 -0
- package/src/avif/native/heif/find_item_references.d.ts +16 -0
- package/src/avif/native/heif/find_item_references.d.ts.map +1 -0
- package/src/avif/native/heif/find_item_references.js +29 -0
- package/src/avif/native/heif/find_items_referencing.d.ts +17 -0
- package/src/avif/native/heif/find_items_referencing.d.ts.map +1 -0
- package/src/avif/native/heif/find_items_referencing.js +36 -0
- package/src/avif/native/heif/parse_avif_file.d.ts +15 -0
- package/src/avif/native/heif/parse_avif_file.d.ts.map +1 -0
- package/src/avif/native/heif/parse_avif_file.js +383 -0
- package/src/avif/native/heif/parse_image_grid.d.ts +18 -0
- package/src/avif/native/heif/parse_image_grid.d.ts.map +1 -0
- package/src/avif/native/heif/parse_image_grid.js +48 -0
- package/src/avif/native/heif/parse_item_property.d.ts +18 -0
- package/src/avif/native/heif/parse_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/parse_item_property.js +243 -0
- package/src/avif/native/heif/read_item_data.d.ts +22 -0
- package/src/avif/native/heif/read_item_data.d.ts.map +1 -0
- package/src/avif/native/heif/read_item_data.js +97 -0
- package/src/avif/native/heif/write_avif_file.d.ts +50 -0
- package/src/avif/native/heif/write_avif_file.d.ts.map +1 -0
- package/src/avif/native/heif/write_avif_file.js +348 -0
- package/src/avif/native/heif/write_item_property.d.ts +16 -0
- package/src/avif/native/heif/write_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/write_item_property.js +182 -0
- package/src/avif/native/index.d.ts +14 -0
- package/src/avif/native/index.d.ts.map +1 -0
- package/src/avif/native/index.js +56 -0
- package/src/avif/native/isobmff/BoxHeader.d.ts +50 -0
- package/src/avif/native/isobmff/BoxHeader.d.ts.map +1 -0
- package/src/avif/native/isobmff/BoxHeader.js +57 -0
- package/src/avif/native/isobmff/BoxWriter.d.ts +118 -0
- package/src/avif/native/isobmff/BoxWriter.d.ts.map +1 -0
- package/src/avif/native/isobmff/BoxWriter.js +264 -0
- package/src/avif/native/isobmff/ByteCursor.d.ts +125 -0
- package/src/avif/native/isobmff/ByteCursor.d.ts.map +1 -0
- package/src/avif/native/isobmff/ByteCursor.js +298 -0
- package/src/avif/native/isobmff/for_each_box.d.ts +23 -0
- package/src/avif/native/isobmff/for_each_box.d.ts.map +1 -0
- package/src/avif/native/isobmff/for_each_box.js +39 -0
- package/src/avif/native/isobmff/read_box_header.d.ts +22 -0
- package/src/avif/native/isobmff/read_box_header.d.ts.map +1 -0
- package/src/avif/native/isobmff/read_box_header.js +59 -0
- package/src/avif/native/isobmff/read_full_box_header.d.ts +26 -0
- package/src/avif/native/isobmff/read_full_box_header.d.ts.map +1 -0
- package/src/avif/native/isobmff/read_full_box_header.js +33 -0
- package/src/avif/threaded_image_encoder.d.ts +7 -2
- package/src/avif/threaded_image_encoder.d.ts.map +1 -1
- package/src/avif/threaded_image_encoder.js +107 -21
- package/src/core/binary/BinaryBuffer.d.ts +40 -0
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +100 -0
- package/src/core/binary/hash/crc32.d.ts +16 -0
- package/src/core/binary/hash/crc32.d.ts.map +1 -0
- package/src/core/binary/hash/crc32.js +96 -0
- package/src/core/binary/utf8/utf8_decode.d.ts +21 -0
- package/src/core/binary/utf8/utf8_decode.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_decode.js +43 -0
- package/src/core/binary/utf8/utf8_encode_into.d.ts +20 -0
- package/src/core/binary/utf8/utf8_encode_into.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_encode_into.js +48 -0
- package/src/core/binary/utf8/utf8_encoded_length.d.ts +14 -0
- package/src/core/binary/utf8/utf8_encoded_length.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_encoded_length.js +36 -0
- package/src/core/color/COLOR_FIX_PLAN_2026_08_28.md +417 -0
- package/src/core/color/COLOR_REVIEW_2026_08_28.md +779 -0
- package/src/core/color/Color.d.ts +128 -20
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +959 -866
- package/src/core/color/PQ/PQ_constants.d.ts +10 -0
- package/src/core/color/PQ/PQ_constants.d.ts.map +1 -1
- package/src/core/color/PQ/PQ_constants.js +10 -0
- package/src/core/color/PQ/linear_to_PQ.d.ts.map +1 -1
- package/src/core/color/PQ/linear_to_PQ.js +6 -0
- package/src/core/color/REC709_PRIMARIES.d.ts +50 -0
- package/src/core/color/REC709_PRIMARIES.d.ts.map +1 -0
- package/src/core/color/REC709_PRIMARIES.js +53 -0
- package/src/core/color/construct/color_from_hex.d.ts +21 -0
- package/src/core/color/construct/color_from_hex.d.ts.map +1 -0
- package/src/core/color/construct/color_from_hex.js +33 -0
- package/src/core/color/construct/color_from_temperature.d.ts +22 -0
- package/src/core/color/construct/color_from_temperature.d.ts.map +1 -0
- package/src/core/color/construct/color_from_temperature.js +33 -0
- package/src/core/color/construct/color_from_uint24.d.ts +19 -0
- package/src/core/color/construct/color_from_uint24.d.ts.map +1 -0
- package/src/core/color/construct/color_from_uint24.js +26 -0
- package/src/core/color/construct/color_from_uint32.d.ts +20 -0
- package/src/core/color/construct/color_from_uint32.d.ts.map +1 -0
- package/src/core/color/construct/color_from_uint32.js +39 -0
- package/src/core/color/construct/color_gray.d.ts +17 -0
- package/src/core/color/construct/color_gray.d.ts.map +1 -0
- package/src/core/color/construct/color_gray.js +22 -0
- package/src/core/color/hex/hex2rgb.d.ts +1 -11
- package/src/core/color/hex/hex2rgb.d.ts.map +1 -1
- package/src/core/color/hex/hex2rgb.js +7 -24
- package/src/core/color/hex/hex_to_rgb.d.ts +18 -0
- package/src/core/color/hex/hex_to_rgb.d.ts.map +1 -0
- package/src/core/color/hex/hex_to_rgb.js +62 -0
- package/src/core/color/hex/rgb2hex.d.ts +1 -8
- package/src/core/color/hex/rgb2hex.d.ts.map +1 -1
- package/src/core/color/hex/rgb2hex.js +7 -13
- package/src/core/color/hex/rgb_to_hex.d.ts +9 -0
- package/src/core/color/hex/rgb_to_hex.d.ts.map +1 -0
- package/src/core/color/hex/rgb_to_hex.js +13 -0
- package/src/core/color/hex/rgba_to_hex.d.ts +19 -0
- package/src/core/color/hex/rgba_to_hex.d.ts.map +1 -0
- package/src/core/color/hex/rgba_to_hex.js +23 -0
- package/src/core/color/hsv/hsv2rgb.d.ts +1 -12
- package/src/core/color/hsv/hsv2rgb.d.ts.map +1 -1
- package/src/core/color/hsv/hsv2rgb.js +8 -21
- package/src/core/color/hsv/hsv2rgb_float.d.ts +1 -12
- package/src/core/color/hsv/hsv2rgb_float.d.ts.map +1 -1
- package/src/core/color/hsv/hsv2rgb_float.js +8 -56
- package/src/core/color/hsv/hsv_to_rgb.d.ts +13 -0
- package/src/core/color/hsv/hsv_to_rgb.d.ts.map +1 -0
- package/src/core/color/hsv/hsv_to_rgb.js +39 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.d.ts +13 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.d.ts.map +1 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.js +21 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.d.ts +24 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.d.ts.map +1 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.js +67 -0
- package/src/core/color/hsv/rgb2hsv.d.ts +1 -12
- package/src/core/color/hsv/rgb2hsv.d.ts.map +1 -1
- package/src/core/color/hsv/rgb2hsv.js +7 -42
- package/src/core/color/hsv/rgb_to_hsv.d.ts +13 -0
- package/src/core/color/hsv/rgb_to_hsv.d.ts.map +1 -0
- package/src/core/color/hsv/rgb_to_hsv.js +42 -0
- package/src/core/color/hunt/hpe_to_xyz.d.ts +2 -0
- package/src/core/color/hunt/hpe_to_xyz.d.ts.map +1 -0
- package/src/core/color/hunt/hpe_to_xyz.js +4 -0
- package/src/core/color/hunt/xyz_to_hpe.d.ts +1 -6
- package/src/core/color/hunt/xyz_to_hpe.d.ts.map +1 -1
- package/src/core/color/hunt/xyz_to_hpe.js +12 -15
- package/src/core/color/illuminant/D65_spd_tabulated.d.ts.map +1 -1
- package/src/core/color/illuminant/D65_spd_tabulated.js +107 -104
- package/src/core/color/int2rgb.d.ts +1 -10
- package/src/core/color/int2rgb.d.ts.map +1 -1
- package/src/core/color/int2rgb.js +7 -12
- package/src/core/color/int_to_rgb.d.ts +21 -0
- package/src/core/color/int_to_rgb.d.ts.map +1 -0
- package/src/core/color/int_to_rgb.js +33 -0
- package/src/core/color/kelvin/kelvin_to_rgb.d.ts.map +1 -1
- package/src/core/color/kelvin/kelvin_to_rgb.js +22 -2
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts +22 -2
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts.map +1 -1
- package/src/core/color/kelvin/rgb_to_kelvin.js +22 -2
- package/src/core/color/lab/lab_to_xyz.d.ts +20 -0
- package/src/core/color/lab/lab_to_xyz.d.ts.map +1 -0
- package/src/core/color/lab/lab_to_xyz.js +69 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.d.ts +34 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.js +46 -0
- package/src/core/color/oklab/gamut_clip_at_l0.d.ts +33 -0
- package/src/core/color/oklab/gamut_clip_at_l0.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_at_l0.js +84 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.d.ts +24 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.js +37 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.d.ts +23 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.js +46 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.d.ts +19 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.d.ts.map +1 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.js +93 -0
- package/src/core/color/oklab/linear_srgb_to_okhsv.d.ts +12 -4
- package/src/core/color/oklab/linear_srgb_to_okhsv.d.ts.map +1 -1
- package/src/core/color/oklab/linear_srgb_to_okhsv.js +108 -84
- package/src/core/color/oklab/linear_srgb_to_oklab.d.ts +13 -4
- package/src/core/color/oklab/linear_srgb_to_oklab.d.ts.map +1 -1
- package/src/core/color/oklab/linear_srgb_to_oklab.js +28 -19
- package/src/core/color/oklab/okhsl_chroma_bounds.d.ts +51 -0
- package/src/core/color/oklab/okhsl_chroma_bounds.d.ts.map +1 -0
- package/src/core/color/oklab/okhsl_chroma_bounds.js +128 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.d.ts +19 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.d.ts.map +1 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.js +85 -0
- package/src/core/color/oklab/oklab_to_oklch.d.ts +24 -0
- package/src/core/color/oklab/oklab_to_oklch.d.ts.map +1 -0
- package/src/core/color/oklab/oklab_to_oklch.js +35 -0
- package/src/core/color/oklab/oklch_to_oklab.d.ts +18 -0
- package/src/core/color/oklab/oklch_to_oklab.d.ts.map +1 -0
- package/src/core/color/oklab/oklch_to_oklab.js +26 -0
- package/src/core/color/oklab/toe.d.ts +12 -0
- package/src/core/color/oklab/toe.d.ts.map +1 -1
- package/src/core/color/oklab/toe.js +34 -22
- package/src/core/color/operations/color_add.d.ts +21 -0
- package/src/core/color/operations/color_add.d.ts.map +1 -0
- package/src/core/color/operations/color_add.js +23 -0
- package/src/core/color/operations/color_add_scaled.d.ts +20 -0
- package/src/core/color/operations/color_add_scaled.d.ts.map +1 -0
- package/src/core/color/operations/color_add_scaled.js +30 -0
- package/src/core/color/operations/color_clamp.d.ts +22 -0
- package/src/core/color/operations/color_clamp.d.ts.map +1 -0
- package/src/core/color/operations/color_clamp.js +25 -0
- package/src/core/color/operations/color_darken.d.ts +2 -1
- package/src/core/color/operations/color_darken.d.ts.map +1 -1
- package/src/core/color/operations/color_darken.js +25 -24
- package/src/core/color/operations/color_desaturate.d.ts +2 -1
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -1
- package/src/core/color/operations/color_desaturate.js +25 -24
- package/src/core/color/operations/color_get_hsl.d.ts +18 -0
- package/src/core/color/operations/color_get_hsl.d.ts.map +1 -0
- package/src/core/color/operations/color_get_hsl.js +60 -0
- package/src/core/color/operations/color_is_in_gamut.d.ts +20 -0
- package/src/core/color/operations/color_is_in_gamut.d.ts.map +1 -0
- package/src/core/color/operations/color_is_in_gamut.js +30 -0
- package/src/core/color/operations/color_lerp.d.ts +12 -3
- package/src/core/color/operations/color_lerp.d.ts.map +1 -1
- package/src/core/color/operations/color_lerp.js +55 -46
- package/src/core/color/operations/color_lighten.d.ts +9 -5
- package/src/core/color/operations/color_lighten.d.ts.map +1 -1
- package/src/core/color/operations/color_lighten.js +29 -24
- package/src/core/color/operations/color_mix_okhsv_channel.d.ts +24 -0
- package/src/core/color/operations/color_mix_okhsv_channel.d.ts.map +1 -0
- package/src/core/color/operations/color_mix_okhsv_channel.js +48 -0
- package/src/core/color/operations/color_multiply_rgb.d.ts +21 -0
- package/src/core/color/operations/color_multiply_rgb.d.ts.map +1 -0
- package/src/core/color/operations/color_multiply_rgb.js +26 -0
- package/src/core/color/operations/color_saturate.d.ts +9 -5
- package/src/core/color/operations/color_saturate.d.ts.map +1 -1
- package/src/core/color/operations/color_saturate.js +29 -24
- package/src/core/color/operations/color_scale_okhsv_channel.d.ts +1 -1
- package/src/core/color/operations/color_scale_okhsv_channel.d.ts.map +1 -1
- package/src/core/color/operations/color_scale_okhsv_channel.js +58 -45
- package/src/core/color/operations/color_srgb_apply.d.ts +28 -0
- package/src/core/color/operations/color_srgb_apply.d.ts.map +1 -0
- package/src/core/color/operations/color_srgb_apply.js +40 -0
- package/src/core/color/operations/color_sub.d.ts +16 -0
- package/src/core/color/operations/color_sub.d.ts.map +1 -0
- package/src/core/color/operations/color_sub.js +18 -0
- package/src/core/color/parse_color.d.ts +10 -1
- package/src/core/color/parse_color.d.ts.map +1 -1
- package/src/core/color/parse_color.js +100 -84
- package/src/core/color/parse_color_normalized.d.ts +24 -0
- package/src/core/color/parse_color_normalized.d.ts.map +1 -0
- package/src/core/color/parse_color_normalized.js +38 -0
- package/src/core/color/rgb2uint24.d.ts +1 -8
- package/src/core/color/rgb2uint24.d.ts.map +1 -1
- package/src/core/color/rgb2uint24.js +7 -20
- package/src/core/color/rgb2uint32.d.ts +1 -9
- package/src/core/color/rgb2uint32.d.ts.map +1 -1
- package/src/core/color/rgb2uint32.js +7 -18
- package/src/core/color/rgb_to_luminance.d.ts +14 -5
- package/src/core/color/rgb_to_luminance.d.ts.map +1 -1
- package/src/core/color/rgb_to_luminance.js +24 -13
- package/src/core/color/rgb_to_uint24.d.ts +9 -0
- package/src/core/color/rgb_to_uint24.d.ts.map +1 -0
- package/src/core/color/rgb_to_uint24.js +20 -0
- package/src/core/color/rgb_to_uint32.d.ts +10 -0
- package/src/core/color/rgb_to_uint32.d.ts.map +1 -0
- package/src/core/color/rgb_to_uint32.js +21 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts +7 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
- package/src/core/color/sRGB/linear_to_sRGB.js +39 -32
- package/src/core/color/xyz/hpe_to_xyz.d.ts +24 -0
- package/src/core/color/xyz/hpe_to_xyz.d.ts.map +1 -0
- package/src/core/color/xyz/hpe_to_xyz.js +39 -0
- package/src/core/color/xyz/rgb_to_xyz.d.ts +17 -2
- package/src/core/color/xyz/rgb_to_xyz.d.ts.map +1 -1
- package/src/core/color/xyz/rgb_to_xyz.js +44 -18
- package/src/core/color/xyz/xyz_cmf_tabulated.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_cmf_tabulated.js +217 -211
- package/src/core/color/xyz/xyz_cmf_wyman.d.ts +4 -0
- package/src/core/color/xyz/xyz_cmf_wyman.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_cmf_wyman.js +74 -65
- package/src/core/color/xyz/xyz_to_hpe.d.ts +18 -0
- package/src/core/color/xyz/xyz_to_hpe.d.ts.map +1 -0
- package/src/core/color/xyz/xyz_to_hpe.js +33 -0
- package/src/core/color/xyz/xyz_to_rgb.d.ts +17 -2
- package/src/core/color/xyz/xyz_to_rgb.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_to_rgb.js +39 -16
- package/src/core/color/ycxcz/xyz_to_ycxcz.d.ts +7 -2
- package/src/core/color/ycxcz/xyz_to_ycxcz.d.ts.map +1 -1
- package/src/core/color/ycxcz/xyz_to_ycxcz.js +33 -28
- package/src/core/events/signal/Signal.js +820 -820
- package/src/core/math/clamp_index.d.ts +18 -0
- package/src/core/math/clamp_index.d.ts.map +1 -0
- package/src/core/math/clamp_index.js +23 -0
- package/src/engine/asset/loaders/image/IMAGE_CODEC_REVIEW_2026_08_28.md +803 -0
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts +5 -3
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.js +5 -3
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts +2 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.js +2 -1
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts +17 -0
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegImage.js +197 -157
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts +0 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.js +0 -1
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts +28 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.js +31 -0
- package/src/engine/asset/loaders/image/png/PNG.d.ts +3 -18
- package/src/engine/asset/loaders/image/png/PNG.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNG.js +3 -139
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts +16 -16
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +143 -160
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_iTXt.js +3 -3
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_zTXt.js +3 -3
- package/src/engine/asset/loaders/image/png/crc32.d.ts +1 -15
- package/src/engine/asset/loaders/image/png/crc32.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/crc32.js +5 -89
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts +12 -10
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +20 -45
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts +2 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.js +2 -0
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts +2 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.js +2 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts +22 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.js +68 -0
- package/src/engine/asset/loaders/image/png/png_inflate.d.ts +20 -0
- package/src/engine/asset/loaders/image/png/png_inflate.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/png_inflate.js +85 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts +22 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.js +38 -0
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +135 -132
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +16 -3
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1157 -1149
- package/src/engine/graphics/render/frame_graph/FrameGraph.js +900 -900
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +72 -81
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +86 -77
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/device/IMMEDIATE_DATA_PLAN_2026_08_28.md +451 -0
- package/src/shade/device/timing/GPU_PROFILER_PROPOSAL_2026_08_28.md +625 -0
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/rasterize/native/oit/shader_oit_blend.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/shader_oit_blend.js +5 -4
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.d.ts +14 -3
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.js +50 -51
- package/src/shade/renderer/scene/serialization/deserialize_scene.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/deserialize_scene.js +531 -521
- package/src/shade/renderer/scene/serialization/write_image_source.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/write_image_source.js +6 -4
- package/src/shade/renderer/shader/chunk/color/chunk_rgb_to_luminance.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/chunk_rgb_to_luminance.js +34 -32
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts +31 -0
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.js +62 -31
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.d.ts +10 -0
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.js +32 -22
- package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferOETF.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferOETF.js +22 -21
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts +6 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.js +110 -104
- package/src/shade/renderer/shader/chunk/color/xyz/chunk_rgb_to_xyz.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/xyz/chunk_rgb_to_xyz.js +23 -21
- package/src/shade/renderer/shader/chunk/math/chunk_magnitude_floor.d.ts +9 -0
- package/src/shade/renderer/shader/chunk/math/chunk_magnitude_floor.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/math/chunk_magnitude_floor.js +16 -0
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_magnitude_floor.d.ts +10 -0
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_magnitude_floor.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_magnitude_floor.js +17 -0
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_solve_cubic_blinn.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_solve_cubic_blinn.js +7 -1
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_square_root.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_square_root.js +9 -3
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_cubic.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_cubic.js +13 -7
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_cubic_blinn_smallest.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_cubic_blinn_smallest.js +13 -4
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_quadratic.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_quadratic.js +20 -13
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_quartic_neumark.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_quartic_neumark.js +8 -4
- package/src/shade/renderer/shader/chunk/mboit/NOTES.md +35 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_2_trigonometric_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_2_trigonometric_moments.js +18 -5
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_3_trigonometric_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_3_trigonometric_moments.js +21 -8
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_4_trigonometric_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_4_trigonometric_moments.js +25 -12
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_generate_trigonometric_moments_4.d.ts +6 -2
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_generate_trigonometric_moments_4.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_generate_trigonometric_moments_4.js +42 -35
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_4_power_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_4_power_moments.js +18 -5
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_6_power_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_6_power_moments.js +24 -9
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_8_power_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_8_power_moments.js +29 -13
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_generate_power_moments_4.d.ts +12 -0
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_generate_power_moments_4.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_generate_power_moments_4.js +38 -48
- package/src/view/elements/ColorPickerView.js +296 -296
- package/src/avif/codec/dec/Readme.md +0 -14
- package/src/avif/codec/dec/avif_dec.cpp +0 -234
- package/src/avif/codec/dec/avif_dec.d.ts +0 -3
- package/src/avif/codec/dec/avif_dec.d.ts.map +0 -1
- package/src/avif/codec/dec/avif_dec.js +0 -16
- package/src/avif/codec/dec/avif_dec.wasm +0 -0
- package/src/avif/codec/enc/README.md +0 -37
- package/src/avif/codec/enc/avif_enc.cpp +0 -216
- package/src/avif/codec/enc/avif_enc.d.ts +0 -3
- package/src/avif/codec/enc/avif_enc.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc.js +0 -6144
- package/src/avif/codec/enc/avif_enc.wasm +0 -0
- package/src/avif/codec/enc/avif_enc_mt.d.ts +0 -3
- package/src/avif/codec/enc/avif_enc_mt.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.js +0 -6811
- package/src/avif/codec/enc/avif_enc_mt.wasm +0 -0
- package/src/avif/codec/enc/avif_enc_mt.worker.d.mts +0 -2
- package/src/avif/codec/enc/avif_enc_mt.worker.d.mts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.worker.d.ts +0 -11
- package/src/avif/codec/enc/avif_enc_mt.worker.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.worker.js +0 -171
- package/src/avif/codec/enc/avif_enc_mt.worker.mjs +0 -1
- package/src/avif/decode.d.ts +0 -3
- package/src/avif/decode.d.ts.map +0 -1
- package/src/avif/decode.js +0 -42
- package/src/avif/encode.d.ts +0 -3
- package/src/avif/encode.d.ts.map +0 -1
- package/src/avif/encode.js +0 -75
- package/src/avif/meta.d.ts +0 -24
- package/src/avif/meta.d.ts.map +0 -1
- package/src/avif/meta.js +0 -23
- package/src/avif/tsconfig.tsbuildinfo +0 -1
- package/src/avif/utils.d.ts +0 -17
- package/src/avif/utils.d.ts.map +0 -1
- package/src/avif/utils.js +0 -31
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts +0 -23
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.js +0 -214
- package/src/engine/asset/loaders/image/png/inflate.d.ts +0 -7
- package/src/engine/asset/loaders/image/png/inflate.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/inflate.js +0 -20
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { clamp } from "../../../../core/math/clamp.js";
|
|
2
|
+
import {
|
|
3
|
+
ADST_ADST,
|
|
4
|
+
ADST_DCT,
|
|
5
|
+
ADST_FLIPADST,
|
|
6
|
+
DCT_ADST,
|
|
7
|
+
DCT_DCT,
|
|
8
|
+
DCT_FLIPADST,
|
|
9
|
+
FLIPADST_ADST,
|
|
10
|
+
FLIPADST_DCT,
|
|
11
|
+
FLIPADST_FLIPADST,
|
|
12
|
+
H_ADST,
|
|
13
|
+
H_DCT,
|
|
14
|
+
H_FLIPADST,
|
|
15
|
+
V_ADST,
|
|
16
|
+
V_DCT,
|
|
17
|
+
V_FLIPADST
|
|
18
|
+
} from "../tables/av1_symbols.js";
|
|
19
|
+
import { TRANSFORM_ROW_SHIFT } from "../tables/transform_tables.js";
|
|
20
|
+
import { TX_HEIGHT_LOG2, TX_WIDTH_LOG2 } from "../tables/block_tables.js";
|
|
21
|
+
import { round2 } from "../util/round2.js";
|
|
22
|
+
import { inverse_adst, inverse_dct, inverse_identity, inverse_wht, round2_12 } from "./inverse_transform_1d.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Whether the row (horizontal) transform for `tx_type` is a DCT. Exported because the encoder's
|
|
26
|
+
* forward transform has to be the inverse of whichever pair this picks.
|
|
27
|
+
* @param {number} tx_type
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
export function row_is_dct(tx_type) {
|
|
31
|
+
return tx_type === DCT_DCT || tx_type === ADST_DCT || tx_type === FLIPADST_DCT || tx_type === H_DCT;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Whether the row (horizontal) transform for `tx_type` is an ADST.
|
|
36
|
+
* @param {number} tx_type
|
|
37
|
+
* @returns {boolean}
|
|
38
|
+
*/
|
|
39
|
+
export function row_is_adst(tx_type) {
|
|
40
|
+
return tx_type === DCT_ADST
|
|
41
|
+
|| tx_type === ADST_ADST
|
|
42
|
+
|| tx_type === DCT_FLIPADST
|
|
43
|
+
|| tx_type === FLIPADST_FLIPADST
|
|
44
|
+
|| tx_type === ADST_FLIPADST
|
|
45
|
+
|| tx_type === FLIPADST_ADST
|
|
46
|
+
|| tx_type === H_ADST
|
|
47
|
+
|| tx_type === H_FLIPADST;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Whether the column (vertical) transform for `tx_type` is a DCT.
|
|
52
|
+
* @param {number} tx_type
|
|
53
|
+
* @returns {boolean}
|
|
54
|
+
*/
|
|
55
|
+
export function column_is_dct(tx_type) {
|
|
56
|
+
return tx_type === DCT_DCT || tx_type === DCT_ADST || tx_type === DCT_FLIPADST || tx_type === V_DCT;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Whether the column (vertical) transform for `tx_type` is an ADST.
|
|
61
|
+
* @param {number} tx_type
|
|
62
|
+
* @returns {boolean}
|
|
63
|
+
*/
|
|
64
|
+
export function column_is_adst(tx_type) {
|
|
65
|
+
return tx_type === ADST_DCT
|
|
66
|
+
|| tx_type === ADST_ADST
|
|
67
|
+
|| tx_type === FLIPADST_DCT
|
|
68
|
+
|| tx_type === FLIPADST_FLIPADST
|
|
69
|
+
|| tx_type === ADST_FLIPADST
|
|
70
|
+
|| tx_type === FLIPADST_ADST
|
|
71
|
+
|| tx_type === V_ADST
|
|
72
|
+
|| tx_type === V_FLIPADST;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 2D inverse transform, in place.
|
|
77
|
+
*
|
|
78
|
+
* `residual` holds the dequantised coefficients on entry, row-major with stride `1 << log2W`, and
|
|
79
|
+
* the spatial residual on exit. Coefficients only ever occupy the top-left 32x32 of a block, and
|
|
80
|
+
* the caller is responsible for having zeroed the rest — the specification reads those positions as
|
|
81
|
+
* zero rather than as whatever was left there.
|
|
82
|
+
*
|
|
83
|
+
* @param {Int32Array} residual
|
|
84
|
+
* @param {number} tx_size
|
|
85
|
+
* @param {number} tx_type
|
|
86
|
+
* @param {number} lossless `1` to use the Walsh-Hadamard transform
|
|
87
|
+
* @param {number} bit_depth
|
|
88
|
+
* @param {Int32Array} t scratch of at least 64 entries
|
|
89
|
+
* @see AV1 spec 7.13.3 "2D inverse transform process"
|
|
90
|
+
*
|
|
91
|
+
* @author Alex Goldring
|
|
92
|
+
* @copyright Company Named Limited (c) 2026
|
|
93
|
+
*/
|
|
94
|
+
export function inverse_transform_2d(residual, tx_size, tx_type, lossless, bit_depth, t) {
|
|
95
|
+
const log2_w = TX_WIDTH_LOG2[tx_size];
|
|
96
|
+
const log2_h = TX_HEIGHT_LOG2[tx_size];
|
|
97
|
+
|
|
98
|
+
const w = 1 << log2_w;
|
|
99
|
+
const h = 1 << log2_h;
|
|
100
|
+
|
|
101
|
+
const row_shift = lossless === 1 ? 0 : TRANSFORM_ROW_SHIFT[tx_size];
|
|
102
|
+
const column_shift = lossless === 1 ? 0 : 4;
|
|
103
|
+
|
|
104
|
+
const row_clamp_range = bit_depth + 8;
|
|
105
|
+
const column_clamp_range = Math.max(bit_depth + 6, 16);
|
|
106
|
+
|
|
107
|
+
// a transform whose sides differ by a factor of two carries an extra 1/sqrt(2) so that the
|
|
108
|
+
// basis stays orthonormal; it is folded into the row pass
|
|
109
|
+
const rectangular = Math.abs(log2_w - log2_h) === 1;
|
|
110
|
+
|
|
111
|
+
for (let i = 0; i < h; i++) {
|
|
112
|
+
const row = i * w;
|
|
113
|
+
|
|
114
|
+
let occupied = 0;
|
|
115
|
+
|
|
116
|
+
for (let j = 0; j < w; j++) {
|
|
117
|
+
const coefficient = i < 32 && j < 32 ? residual[row + j] : 0;
|
|
118
|
+
|
|
119
|
+
t[j] = coefficient;
|
|
120
|
+
occupied |= coefficient;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// every step of every one of these transforms is a multiply and a rounded shift of its
|
|
124
|
+
// inputs, and none of them adds a constant, so a row of zeros comes out of all of them as a
|
|
125
|
+
// row of zeros. Past the end of a block a quantiser emptied that is most of the rows, and
|
|
126
|
+
// finding out costs one comparison per coefficient against the whole transform it skips
|
|
127
|
+
if (occupied === 0) {
|
|
128
|
+
residual.fill(0, row, row + w);
|
|
129
|
+
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (rectangular) {
|
|
134
|
+
for (let j = 0; j < w; j++) {
|
|
135
|
+
t[j] = round2_12(t[j] * 2896);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (lossless === 1) {
|
|
140
|
+
inverse_wht(t, 2);
|
|
141
|
+
} else if (row_is_dct(tx_type)) {
|
|
142
|
+
inverse_dct(t, log2_w, row_clamp_range);
|
|
143
|
+
} else if (row_is_adst(tx_type)) {
|
|
144
|
+
inverse_adst(t, log2_w, row_clamp_range);
|
|
145
|
+
} else {
|
|
146
|
+
inverse_identity(t, log2_w);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
for (let j = 0; j < w; j++) {
|
|
150
|
+
residual[row + j] = round2(t[j], row_shift);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const column_low = -(1 << (column_clamp_range - 1));
|
|
155
|
+
const column_high = (1 << (column_clamp_range - 1)) - 1;
|
|
156
|
+
|
|
157
|
+
for (let i = 0; i < h * w; i++) {
|
|
158
|
+
residual[i] = clamp(residual[i], column_low, column_high);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
for (let j = 0; j < w; j++) {
|
|
162
|
+
for (let i = 0; i < h; i++) {
|
|
163
|
+
t[i] = residual[i * w + j];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (lossless === 1) {
|
|
167
|
+
inverse_wht(t, 0);
|
|
168
|
+
} else if (column_is_dct(tx_type)) {
|
|
169
|
+
inverse_dct(t, log2_h, column_clamp_range);
|
|
170
|
+
} else if (column_is_adst(tx_type)) {
|
|
171
|
+
inverse_adst(t, log2_h, column_clamp_range);
|
|
172
|
+
} else {
|
|
173
|
+
inverse_identity(t, log2_h);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
for (let i = 0; i < h; i++) {
|
|
177
|
+
residual[i * w + j] = round2(t[i], column_shift);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `CeilLog2( x )` from the AV1 specification: the number of bits needed to code a value in the
|
|
3
|
+
* range `0 .. x - 1`. Defined to be `0` for `x < 2`.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} x 32-bit unsigned integer, `>= 0`
|
|
6
|
+
* @returns {number}
|
|
7
|
+
* @see AV1 spec 4.7 "Mathematical functions"
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
export function ceil_log2(x: number): number;
|
|
13
|
+
//# sourceMappingURL=ceil_log2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceil_log2.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/util/ceil_log2.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,6BAPW,MAAM,GACJ,MAAM,CAYlB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `CeilLog2( x )` from the AV1 specification: the number of bits needed to code a value in the
|
|
3
|
+
* range `0 .. x - 1`. Defined to be `0` for `x < 2`.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} x 32-bit unsigned integer, `>= 0`
|
|
6
|
+
* @returns {number}
|
|
7
|
+
* @see AV1 spec 4.7 "Mathematical functions"
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
export function ceil_log2(x) {
|
|
13
|
+
if (x < 2) {
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return 32 - Math.clz32(x - 1);
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `FloorLog2( x )` from the AV1 specification: the position of the most significant set bit.
|
|
3
|
+
*
|
|
4
|
+
* The specification guarantees `x >= 1` at every call site. `x === 0` returns `-1` here rather than
|
|
5
|
+
* throwing, matching what the specification's own shift-loop definition would produce, so a caller
|
|
6
|
+
* that reaches it with zero fails on the resulting index rather than being masked by a clamp.
|
|
7
|
+
*
|
|
8
|
+
* The core primitive under its own name: `msb_32` is the same operation, and the alias exists so
|
|
9
|
+
* that code transliterated from the specification can be read against it.
|
|
10
|
+
*
|
|
11
|
+
* @param {number} x 32-bit unsigned integer
|
|
12
|
+
* @returns {number}
|
|
13
|
+
* @see AV1 spec 4.7 "Mathematical functions"
|
|
14
|
+
*
|
|
15
|
+
* @author Alex Goldring
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
|
+
*/
|
|
18
|
+
export const floor_log2: typeof msb_32;
|
|
19
|
+
import { msb_32 } from "../../../../core/binary/msb_32.js";
|
|
20
|
+
//# sourceMappingURL=floor_log2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floor_log2.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/util/floor_log2.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,uCAAiC;uBAnBV,mCAAmC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { msb_32 } from "../../../../core/binary/msb_32.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `FloorLog2( x )` from the AV1 specification: the position of the most significant set bit.
|
|
5
|
+
*
|
|
6
|
+
* The specification guarantees `x >= 1` at every call site. `x === 0` returns `-1` here rather than
|
|
7
|
+
* throwing, matching what the specification's own shift-loop definition would produce, so a caller
|
|
8
|
+
* that reaches it with zero fails on the resulting index rather than being masked by a clamp.
|
|
9
|
+
*
|
|
10
|
+
* The core primitive under its own name: `msb_32` is the same operation, and the alias exists so
|
|
11
|
+
* that code transliterated from the specification can be read against it.
|
|
12
|
+
*
|
|
13
|
+
* @param {number} x 32-bit unsigned integer
|
|
14
|
+
* @returns {number}
|
|
15
|
+
* @see AV1 spec 4.7 "Mathematical functions"
|
|
16
|
+
*
|
|
17
|
+
* @author Alex Goldring
|
|
18
|
+
* @copyright Company Named Limited (c) 2026
|
|
19
|
+
*/
|
|
20
|
+
export const floor_log2 = msb_32;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Round2( x, n )` from the AV1 specification: divide by `2^n` and round half up, rounding towards
|
|
3
|
+
* negative infinity on the halfway case for negative inputs.
|
|
4
|
+
*
|
|
5
|
+
* The specification defines this with real division and a floor; JavaScript's `>>` is an arithmetic
|
|
6
|
+
* shift, which is exactly that floor, so the integer form transliterates directly. The `n === 0`
|
|
7
|
+
* guard is not cosmetic: `1 << -1` is `1 << 31` under JavaScript's shift-count masking, which would
|
|
8
|
+
* silently produce garbage.
|
|
9
|
+
*
|
|
10
|
+
* `x` must fit in a signed 32-bit integer, which every intermediate the specification feeds to this
|
|
11
|
+
* function does.
|
|
12
|
+
*
|
|
13
|
+
* @param {number} x
|
|
14
|
+
* @param {number} n number of bits to shift away, `>= 0`
|
|
15
|
+
* @returns {number}
|
|
16
|
+
* @see AV1 spec 4.7 "Mathematical functions"
|
|
17
|
+
*
|
|
18
|
+
* @author Alex Goldring
|
|
19
|
+
* @copyright Company Named Limited (c) 2026
|
|
20
|
+
*/
|
|
21
|
+
export function round2(x: number, n: number): number;
|
|
22
|
+
//# sourceMappingURL=round2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round2.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/util/round2.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,0BARW,MAAM,KACN,MAAM,GACJ,MAAM,CAYlB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Round2( x, n )` from the AV1 specification: divide by `2^n` and round half up, rounding towards
|
|
3
|
+
* negative infinity on the halfway case for negative inputs.
|
|
4
|
+
*
|
|
5
|
+
* The specification defines this with real division and a floor; JavaScript's `>>` is an arithmetic
|
|
6
|
+
* shift, which is exactly that floor, so the integer form transliterates directly. The `n === 0`
|
|
7
|
+
* guard is not cosmetic: `1 << -1` is `1 << 31` under JavaScript's shift-count masking, which would
|
|
8
|
+
* silently produce garbage.
|
|
9
|
+
*
|
|
10
|
+
* `x` must fit in a signed 32-bit integer, which every intermediate the specification feeds to this
|
|
11
|
+
* function does.
|
|
12
|
+
*
|
|
13
|
+
* @param {number} x
|
|
14
|
+
* @param {number} n number of bits to shift away, `>= 0`
|
|
15
|
+
* @returns {number}
|
|
16
|
+
* @see AV1 spec 4.7 "Mathematical functions"
|
|
17
|
+
*
|
|
18
|
+
* @author Alex Goldring
|
|
19
|
+
* @copyright Company Named Limited (c) 2026
|
|
20
|
+
*/
|
|
21
|
+
export function round2(x, n) {
|
|
22
|
+
if (n === 0) {
|
|
23
|
+
return x;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (x + (1 << (n - 1))) >> n;
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Round2Signed( x, n )` from the AV1 specification: {@link round2} applied to the magnitude, so
|
|
3
|
+
* that rounding is symmetric about zero rather than biased towards negative infinity.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} x
|
|
6
|
+
* @param {number} n number of bits to shift away, `>= 0`
|
|
7
|
+
* @returns {number}
|
|
8
|
+
* @see AV1 spec 4.7 "Mathematical functions"
|
|
9
|
+
*
|
|
10
|
+
* @author Alex Goldring
|
|
11
|
+
* @copyright Company Named Limited (c) 2026
|
|
12
|
+
*/
|
|
13
|
+
export function round2_signed(x: number, n: number): number;
|
|
14
|
+
//# sourceMappingURL=round2_signed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round2_signed.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/util/round2_signed.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,iCARW,MAAM,KACN,MAAM,GACJ,MAAM,CAQlB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { round2 } from "./round2.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `Round2Signed( x, n )` from the AV1 specification: {@link round2} applied to the magnitude, so
|
|
5
|
+
* that rounding is symmetric about zero rather than biased towards negative infinity.
|
|
6
|
+
*
|
|
7
|
+
* @param {number} x
|
|
8
|
+
* @param {number} n number of bits to shift away, `>= 0`
|
|
9
|
+
* @returns {number}
|
|
10
|
+
* @see AV1 spec 4.7 "Mathematical functions"
|
|
11
|
+
*
|
|
12
|
+
* @author Alex Goldring
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
|
+
*/
|
|
15
|
+
export function round2_signed(x, n) {
|
|
16
|
+
return x >= 0 ? round2(x, n) : -round2(-x, n);
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tile_log2( blkSize, target )`: the smallest `k` for which `blkSize << k >= target`.
|
|
3
|
+
*
|
|
4
|
+
* The specification writes this as a loop, and a loop is what it stays: the closed form would need
|
|
5
|
+
* a ceiling of a ratio of logarithms, and the inputs here are tiny.
|
|
6
|
+
*
|
|
7
|
+
* @param {number} block_size
|
|
8
|
+
* @param {number} target
|
|
9
|
+
* @returns {number}
|
|
10
|
+
* @see AV1 spec 5.9.16 "Tile size calculation function"
|
|
11
|
+
*
|
|
12
|
+
* @author Alex Goldring
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
|
+
*/
|
|
15
|
+
export function tile_log2(block_size: number, target: number): number;
|
|
16
|
+
//# sourceMappingURL=tile_log2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile_log2.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/util/tile_log2.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,sCARW,MAAM,UACN,MAAM,GACJ,MAAM,CAclB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tile_log2( blkSize, target )`: the smallest `k` for which `blkSize << k >= target`.
|
|
3
|
+
*
|
|
4
|
+
* The specification writes this as a loop, and a loop is what it stays: the closed form would need
|
|
5
|
+
* a ceiling of a ratio of logarithms, and the inputs here are tiny.
|
|
6
|
+
*
|
|
7
|
+
* @param {number} block_size
|
|
8
|
+
* @param {number} target
|
|
9
|
+
* @returns {number}
|
|
10
|
+
* @see AV1 spec 5.9.16 "Tile size calculation function"
|
|
11
|
+
*
|
|
12
|
+
* @author Alex Goldring
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
|
+
*/
|
|
15
|
+
export function tile_log2(block_size, target) {
|
|
16
|
+
let k = 0;
|
|
17
|
+
|
|
18
|
+
while ((block_size << k) < target) {
|
|
19
|
+
k++;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return k;
|
|
23
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MSB-first bit cursor over a byte range, carrying the AV1 bitstream descriptors.
|
|
3
|
+
*
|
|
4
|
+
* This is the counterpart to {@link BitWriter}. It reads out of an existing `Uint8Array` without
|
|
5
|
+
* copying, so a reader can be pointed at a slice of a much larger file cheaply. Bounds are checked
|
|
6
|
+
* on every read: a truncated or malformed stream throws rather than reading zeroes off the end of
|
|
7
|
+
* the buffer and producing a plausible-looking but wrong header.
|
|
8
|
+
*
|
|
9
|
+
* It is a struct with methods rather than a struct plus free functions because that is the shape
|
|
10
|
+
* meep already uses for stream cursors ({@link BinaryBuffer}), and because a bit cursor's whole
|
|
11
|
+
* purpose is the coupling of the position to the buffer.
|
|
12
|
+
*
|
|
13
|
+
* Not used for tile data: arithmetic-coded payloads are read by the symbol decoder straight from
|
|
14
|
+
* the byte array, so this class is never on a per-sample path.
|
|
15
|
+
*
|
|
16
|
+
* @see AV1 spec 4.10 "Descriptors"
|
|
17
|
+
*
|
|
18
|
+
* @author Alex Goldring
|
|
19
|
+
* @copyright Company Named Limited (c) 2026
|
|
20
|
+
*/
|
|
21
|
+
export class BitReader {
|
|
22
|
+
/**
|
|
23
|
+
* Bytes being read. Not owned.
|
|
24
|
+
* @type {Uint8Array}
|
|
25
|
+
*/
|
|
26
|
+
data: Uint8Array;
|
|
27
|
+
/**
|
|
28
|
+
* Index into {@link data} of the byte holding the next bit.
|
|
29
|
+
* @type {number}
|
|
30
|
+
*/
|
|
31
|
+
byte_position: number;
|
|
32
|
+
/**
|
|
33
|
+
* Index of the next bit within the byte at {@link byte_position}, `0` being the most
|
|
34
|
+
* significant bit.
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
37
|
+
bit_position: number;
|
|
38
|
+
/**
|
|
39
|
+
* Index into {@link data} one past the last readable byte.
|
|
40
|
+
* @type {number}
|
|
41
|
+
*/
|
|
42
|
+
end: number;
|
|
43
|
+
/**
|
|
44
|
+
* Index into {@link data} of the first readable byte. Kept so {@link position_in_bits} can be
|
|
45
|
+
* reported relative to the start of the range rather than the start of the array.
|
|
46
|
+
* @type {number}
|
|
47
|
+
*/
|
|
48
|
+
start: number;
|
|
49
|
+
/**
|
|
50
|
+
* Number of bytes consumed by the most recent {@link leb128} call. The AV1 syntax refers to
|
|
51
|
+
* this as `Leb128Bytes` and several OBU size computations need it.
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
54
|
+
leb128_bytes: number;
|
|
55
|
+
/**
|
|
56
|
+
* Point the reader at a byte range. Cheap: no allocation, no copy, so a reader can be reused
|
|
57
|
+
* across many payloads.
|
|
58
|
+
*
|
|
59
|
+
* @param {Uint8Array} data
|
|
60
|
+
* @param {number} [byte_offset] offset within `data` to start at
|
|
61
|
+
* @param {number} [byte_length] number of bytes readable from `byte_offset`
|
|
62
|
+
* @returns {BitReader} this
|
|
63
|
+
*/
|
|
64
|
+
init(data: Uint8Array, byte_offset?: number, byte_length?: number): BitReader;
|
|
65
|
+
/**
|
|
66
|
+
* Bits consumed since {@link init}.
|
|
67
|
+
* @returns {number}
|
|
68
|
+
*/
|
|
69
|
+
get position_in_bits(): number;
|
|
70
|
+
/**
|
|
71
|
+
* Bits left before the end of the range.
|
|
72
|
+
* @returns {number}
|
|
73
|
+
*/
|
|
74
|
+
get bits_remaining(): number;
|
|
75
|
+
/**
|
|
76
|
+
* Whether the cursor sits on a byte boundary. Several descriptors are only legal there.
|
|
77
|
+
* @returns {boolean}
|
|
78
|
+
*/
|
|
79
|
+
get is_byte_aligned(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* `f(1)`. The single primitive every other descriptor is built from.
|
|
82
|
+
* @returns {number} `0` or `1`
|
|
83
|
+
*/
|
|
84
|
+
read_bit(): number;
|
|
85
|
+
/**
|
|
86
|
+
* `f(n)`: unsigned `n`-bit number, most significant bit first.
|
|
87
|
+
*
|
|
88
|
+
* Accumulates with multiplication rather than `<<` so that `n === 32` does not overflow into a
|
|
89
|
+
* negative number. Bits are taken a byte at a time rather than one at a time, which matters
|
|
90
|
+
* because sequence headers read a lot of 8- and 16-bit fields.
|
|
91
|
+
*
|
|
92
|
+
* @param {number} n `0 .. 32`
|
|
93
|
+
* @returns {number}
|
|
94
|
+
* @see AV1 spec 8.1 "Parsing process for f(n)"
|
|
95
|
+
*/
|
|
96
|
+
f(n: number): number;
|
|
97
|
+
/**
|
|
98
|
+
* `su(n)`: signed integer whose bottom `n` bits appear in the bitstream.
|
|
99
|
+
*
|
|
100
|
+
* @param {number} n `1 .. 32`
|
|
101
|
+
* @returns {number}
|
|
102
|
+
* @see AV1 spec 4.10.6 "su(n)"
|
|
103
|
+
*/
|
|
104
|
+
su(n: number): number;
|
|
105
|
+
/**
|
|
106
|
+
* `ns(n)`: unsigned integer in `0 .. n - 1`, coded with one bit fewer over the lower part of
|
|
107
|
+
* the range.
|
|
108
|
+
*
|
|
109
|
+
* @param {number} n number of distinct values, `>= 1`
|
|
110
|
+
* @returns {number}
|
|
111
|
+
* @see AV1 spec 4.10.7 "ns(n)"
|
|
112
|
+
*/
|
|
113
|
+
ns(n: number): number;
|
|
114
|
+
/**
|
|
115
|
+
* `uvlc()`: Exp-Golomb-style variable length unsigned number.
|
|
116
|
+
*
|
|
117
|
+
* A run of 32 or more leading zeroes is the specification's encoding of `(1 << 32) - 1` and is
|
|
118
|
+
* returned as such rather than treated as corruption. The leading-zero count is still bounded
|
|
119
|
+
* by the buffer, so a stream of zero bytes terminates on the range check in {@link read_bit}.
|
|
120
|
+
*
|
|
121
|
+
* @returns {number}
|
|
122
|
+
* @see AV1 spec 4.10.3 "uvlc()"
|
|
123
|
+
*/
|
|
124
|
+
uvlc(): number;
|
|
125
|
+
/**
|
|
126
|
+
* `le(n)`: unsigned little-endian `n`-byte number. Only legal on a byte boundary.
|
|
127
|
+
*
|
|
128
|
+
* @param {number} n number of bytes
|
|
129
|
+
* @returns {number}
|
|
130
|
+
* @see AV1 spec 4.10.4 "le(n)"
|
|
131
|
+
*/
|
|
132
|
+
le(n: number): number;
|
|
133
|
+
/**
|
|
134
|
+
* `leb128()`: unsigned integer in a variable number of little-endian 7-bit groups. Only legal
|
|
135
|
+
* on a byte boundary. Sets {@link leb128_bytes}.
|
|
136
|
+
*
|
|
137
|
+
* Accumulates with multiplication because a conforming eight-byte encoding carries 56 bits of
|
|
138
|
+
* payload; the value itself is required to fit in 32 bits, which is checked, but the shift
|
|
139
|
+
* would have wrapped before the check could run.
|
|
140
|
+
*
|
|
141
|
+
* @returns {number}
|
|
142
|
+
* @see AV1 spec 4.10.5 "leb128()"
|
|
143
|
+
*/
|
|
144
|
+
leb128(): number;
|
|
145
|
+
/**
|
|
146
|
+
* Skip forward to the next byte boundary, requiring the skipped bits to be zero as the
|
|
147
|
+
* specification's `byte_alignment()` does.
|
|
148
|
+
*
|
|
149
|
+
* @see AV1 spec 5.3.5 "Byte alignment syntax"
|
|
150
|
+
*/
|
|
151
|
+
byte_alignment(): void;
|
|
152
|
+
/**
|
|
153
|
+
* Consume the `trailing_one_bit` plus zero padding that terminates an OBU payload.
|
|
154
|
+
*
|
|
155
|
+
* @see AV1 spec 5.3.4 "Trailing bits syntax"
|
|
156
|
+
*/
|
|
157
|
+
trailing_bits(): void;
|
|
158
|
+
/**
|
|
159
|
+
* Advance to the next byte boundary without checking what the skipped bits contain.
|
|
160
|
+
*
|
|
161
|
+
* The specification says the padding "shall be equal to 0", and {@link byte_alignment} enforces
|
|
162
|
+
* that. A decoder cannot afford to: libaom rounds a frame header up to a whole byte by simply
|
|
163
|
+
* advancing its write cursor, so inside an OBU_FRAME those bits are whatever was already in its
|
|
164
|
+
* output buffer. Refusing such a file would reject a large share of the AVIFs in existence over
|
|
165
|
+
* bits nothing reads.
|
|
166
|
+
*/
|
|
167
|
+
skip_to_byte_boundary(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Advance the cursor by whole bytes without reading. Requires byte alignment.
|
|
170
|
+
* @param {number} count
|
|
171
|
+
*/
|
|
172
|
+
skip_bytes(count: number): void;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=BitReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitReader.d.ts","sourceRoot":"","sources":["../../../../../src/avif/native/bitstream/BitReader.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IACI;;;OAGG;IACH,MAFU,UAAU,CAER;IAEZ;;;OAGG;IACH,eAFU,MAAM,CAEE;IAElB;;;;OAIG;IACH,cAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,KAFU,MAAM,CAER;IAER;;;;OAIG;IACH,OAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,cAFU,MAAM,CAEC;IAEjB;;;;;;;;OAQG;IACH,WALW,UAAU,gBACV,MAAM,gBACN,MAAM,GACJ,SAAS,CAerB;IAED;;;OAGG;IACH,+BAEC;IAED;;;OAGG;IACH,6BAEC;IAED;;;OAGG;IACH,+BAEC;IAED;;;OAGG;IACH,YAFa,MAAM,CAiBlB;IAED;;;;;;;;;;OAUG;IACH,KAJW,MAAM,GACJ,MAAM,CA6ClB;IAED;;;;;;OAMG;IACH,MAJW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;;;;OAOG;IACH,MAJW,MAAM,GACJ,MAAM,CAclB;IAED;;;;;;;;;OASG;IACH,QAHa,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,MAJW,MAAM,GACJ,MAAM,CAqBlB;IAED;;;;;;;;;;OAUG;IACH,UAHa,MAAM,CAqClB;IAED;;;;;OAKG;IACH,uBAMC;IAED;;;;OAIG;IACH,sBAUC;IAED;;;;;;;;OAQG;IACH,8BAIC;IAED;;;OAGG;IACH,kBAFW,MAAM,QAYhB;CACJ"}
|