@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,325 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COEFF_BASE_RANGE,
|
|
3
|
+
NUM_BASE_LEVELS,
|
|
4
|
+
SIG_COEF_CONTEXTS,
|
|
5
|
+
SIG_REF_DIFF_OFFSET_NUM,
|
|
6
|
+
TX_CLASS_2D,
|
|
7
|
+
TX_CLASS_VERT
|
|
8
|
+
} from "../tables/av1_symbols.js";
|
|
9
|
+
import { SUBSAMPLED_SIZE, TX_HEIGHT, TX_WIDTH } from "../tables/block_tables.js";
|
|
10
|
+
import { BLOCK_HEIGHT, BLOCK_WIDTH } from "../tables/derived_block_tables.js";
|
|
11
|
+
import {
|
|
12
|
+
COEFF_BASE_CTX_OFFSET,
|
|
13
|
+
COEFF_BASE_POS_CTX_OFFSET,
|
|
14
|
+
MAG_REF_OFFSET_WITH_TX_CLASS,
|
|
15
|
+
SIG_REF_DIFF_OFFSET
|
|
16
|
+
} from "../tables/coefficient_tables.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The contexts coefficient coding conditions its probabilities on.
|
|
20
|
+
*
|
|
21
|
+
* Shared rather than duplicated: an encoder has to derive every one of these identically to the
|
|
22
|
+
* decoder, and a context that drifted by one would desynchronise the arithmetic coder several
|
|
23
|
+
* blocks later, somewhere that looks nothing like the mistake.
|
|
24
|
+
*
|
|
25
|
+
* @author Alex Goldring
|
|
26
|
+
* @copyright Company Named Limited (c) 2026
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param {Av1FrameContext} ctx
|
|
31
|
+
* @param {number} plane
|
|
32
|
+
* @param {number} x4
|
|
33
|
+
* @param {number} y4
|
|
34
|
+
* @param {number} w4
|
|
35
|
+
* @param {number} h4
|
|
36
|
+
* @param {number} tx_size
|
|
37
|
+
* @returns {number}
|
|
38
|
+
* @see AV1 spec 8.3.2, `all_zero`
|
|
39
|
+
*/
|
|
40
|
+
export function get_all_zero_ctx(ctx, plane, x4, y4, w4, h4, tx_size) {
|
|
41
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
42
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
43
|
+
|
|
44
|
+
const max_x4 = ctx.mi_cols >> sub_x;
|
|
45
|
+
const max_y4 = ctx.mi_rows >> sub_y;
|
|
46
|
+
|
|
47
|
+
const w = TX_WIDTH[tx_size];
|
|
48
|
+
const h = TX_HEIGHT[tx_size];
|
|
49
|
+
|
|
50
|
+
const plane_size = SUBSAMPLED_SIZE[(ctx.mi_size * 2 + sub_x) * 2 + sub_y];
|
|
51
|
+
const bw = BLOCK_WIDTH[plane_size];
|
|
52
|
+
const bh = BLOCK_HEIGHT[plane_size];
|
|
53
|
+
|
|
54
|
+
const above_level = ctx.above_level_context[plane];
|
|
55
|
+
const above_dc = ctx.above_dc_context[plane];
|
|
56
|
+
const left_level = ctx.left_level_context[plane];
|
|
57
|
+
const left_dc = ctx.left_dc_context[plane];
|
|
58
|
+
|
|
59
|
+
if (plane === 0) {
|
|
60
|
+
let top = 0;
|
|
61
|
+
let left = 0;
|
|
62
|
+
|
|
63
|
+
for (let k = 0; k < w4; k++) {
|
|
64
|
+
if (x4 + k < max_x4) {
|
|
65
|
+
top = Math.max(top, above_level[x4 + k]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
for (let k = 0; k < h4; k++) {
|
|
70
|
+
if (y4 + k < max_y4) {
|
|
71
|
+
left = Math.max(left, left_level[y4 + k]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
top = Math.min(top, 255);
|
|
76
|
+
left = Math.min(left, 255);
|
|
77
|
+
|
|
78
|
+
if (bw === w && bh === h) {
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (top === 0 && left === 0) {
|
|
83
|
+
return 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (top === 0 || left === 0) {
|
|
87
|
+
return 2 + (Math.max(top, left) > 3 ? 1 : 0);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (Math.max(top, left) <= 3) {
|
|
91
|
+
return 4;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (Math.min(top, left) <= 3) {
|
|
95
|
+
return 5;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return 6;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
let above = 0;
|
|
102
|
+
let left = 0;
|
|
103
|
+
|
|
104
|
+
for (let i = 0; i < w4; i++) {
|
|
105
|
+
if (x4 + i < max_x4) {
|
|
106
|
+
above |= above_level[x4 + i];
|
|
107
|
+
above |= above_dc[x4 + i];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
for (let i = 0; i < h4; i++) {
|
|
112
|
+
if (y4 + i < max_y4) {
|
|
113
|
+
left |= left_level[y4 + i];
|
|
114
|
+
left |= left_dc[y4 + i];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let result = (above !== 0 ? 1 : 0) + (left !== 0 ? 1 : 0) + 7;
|
|
119
|
+
|
|
120
|
+
if (bw * bh > w * h) {
|
|
121
|
+
result += 3;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @param {Int32Array} quant
|
|
129
|
+
* @param {number} tx_class
|
|
130
|
+
* @param {number} bwl
|
|
131
|
+
* @param {number} width
|
|
132
|
+
* @param {number} height
|
|
133
|
+
* @param {number} pos
|
|
134
|
+
* @param {number} c
|
|
135
|
+
* @param {number} is_eob
|
|
136
|
+
* @param {number} tx_size
|
|
137
|
+
* @returns {number}
|
|
138
|
+
* @see AV1 spec 8.3.2, `get_coeff_base_ctx`
|
|
139
|
+
*/
|
|
140
|
+
export function get_coeff_base_ctx(quant, tx_class, bwl, width, height, pos, c, is_eob, tx_size) {
|
|
141
|
+
if (is_eob === 1) {
|
|
142
|
+
if (c === 0) {
|
|
143
|
+
return SIG_COEF_CONTEXTS - 4;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (c <= (height << bwl) / 8) {
|
|
147
|
+
return SIG_COEF_CONTEXTS - 3;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (c <= (height << bwl) / 4) {
|
|
151
|
+
return SIG_COEF_CONTEXTS - 2;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return SIG_COEF_CONTEXTS - 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const row = pos >> bwl;
|
|
158
|
+
const col = pos - (row << bwl);
|
|
159
|
+
|
|
160
|
+
let mag = 0;
|
|
161
|
+
|
|
162
|
+
const offset_base = tx_class * SIG_REF_DIFF_OFFSET_NUM * 2;
|
|
163
|
+
|
|
164
|
+
for (let idx = 0; idx < SIG_REF_DIFF_OFFSET_NUM; idx++) {
|
|
165
|
+
const ref_row = row + SIG_REF_DIFF_OFFSET[offset_base + idx * 2];
|
|
166
|
+
const ref_col = col + SIG_REF_DIFF_OFFSET[offset_base + idx * 2 + 1];
|
|
167
|
+
|
|
168
|
+
if (ref_row >= 0 && ref_col >= 0 && ref_row < height && ref_col < width) {
|
|
169
|
+
mag += Math.min(Math.abs(quant[(ref_row << bwl) + ref_col]), 3);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const base = Math.min((mag + 1) >> 1, 4);
|
|
174
|
+
|
|
175
|
+
if (tx_class === TX_CLASS_2D) {
|
|
176
|
+
if (row === 0 && col === 0) {
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return base + COEFF_BASE_CTX_OFFSET[(tx_size * 5 + Math.min(row, 4)) * 5 + Math.min(col, 4)];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const idx = tx_class === TX_CLASS_VERT ? row : col;
|
|
184
|
+
|
|
185
|
+
return base + COEFF_BASE_POS_CTX_OFFSET[Math.min(idx, 2)];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @param {Int32Array} quant
|
|
190
|
+
* @param {number} tx_class
|
|
191
|
+
* @param {number} bwl
|
|
192
|
+
* @param {number} width
|
|
193
|
+
* @param {number} height
|
|
194
|
+
* @param {number} pos
|
|
195
|
+
* @returns {number}
|
|
196
|
+
* @see AV1 spec 8.3.2, `coeff_br`
|
|
197
|
+
*/
|
|
198
|
+
export function get_coeff_br_ctx(quant, tx_class, bwl, width, height, pos) {
|
|
199
|
+
const row = pos >> bwl;
|
|
200
|
+
const col = pos - (row << bwl);
|
|
201
|
+
|
|
202
|
+
let mag = 0;
|
|
203
|
+
|
|
204
|
+
const offset_base = tx_class * 3 * 2;
|
|
205
|
+
|
|
206
|
+
for (let idx = 0; idx < 3; idx++) {
|
|
207
|
+
const ref_row = row + MAG_REF_OFFSET_WITH_TX_CLASS[offset_base + idx * 2];
|
|
208
|
+
const ref_col = col + MAG_REF_OFFSET_WITH_TX_CLASS[offset_base + idx * 2 + 1];
|
|
209
|
+
|
|
210
|
+
if (ref_row >= 0 && ref_col >= 0 && ref_row < height && ref_col < width) {
|
|
211
|
+
// the specification indexes Quant by `refRow * txw + refCol` here and by
|
|
212
|
+
// `(refRow << bwl) + refCol` in get_coeff_base_ctx; `txw` is the adjusted transform's
|
|
213
|
+
// width, which is `1 << bwl`, so the two agree
|
|
214
|
+
mag += Math.min(quant[ref_row * width + ref_col], COEFF_BASE_RANGE + NUM_BASE_LEVELS + 1);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
mag = Math.min((mag + 1) >> 1, 6);
|
|
219
|
+
|
|
220
|
+
if (pos === 0) {
|
|
221
|
+
return mag;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (tx_class === TX_CLASS_2D) {
|
|
225
|
+
return row < 2 && col < 2 ? mag + 7 : mag + 14;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (tx_class === 1) {
|
|
229
|
+
return col === 0 ? mag + 7 : mag + 14;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return row === 0 ? mag + 7 : mag + 14;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Clear the coefficient contexts a block covers, which is what a skipped block leaves behind.
|
|
237
|
+
*
|
|
238
|
+
* A block coded with `skip` writes no coefficients at all, so both sides have to agree that it
|
|
239
|
+
* contributed nothing — not that it contributed whatever the block before it did.
|
|
240
|
+
*
|
|
241
|
+
* @param {Av1FrameContext} ctx
|
|
242
|
+
* @param {number} bw4 block width in 4x4 units
|
|
243
|
+
* @param {number} bh4
|
|
244
|
+
* @see AV1 spec 5.11.6, `reset_block_context`
|
|
245
|
+
*/
|
|
246
|
+
export function reset_block_context(ctx, bw4, bh4) {
|
|
247
|
+
const planes = 1 + 2 * ctx.has_chroma;
|
|
248
|
+
|
|
249
|
+
for (let plane = 0; plane < planes; plane++) {
|
|
250
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
251
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
252
|
+
|
|
253
|
+
const above_level = ctx.above_level_context[plane];
|
|
254
|
+
const above_dc = ctx.above_dc_context[plane];
|
|
255
|
+
const left_level = ctx.left_level_context[plane];
|
|
256
|
+
const left_dc = ctx.left_dc_context[plane];
|
|
257
|
+
|
|
258
|
+
for (let i = ctx.mi_col >> sub_x; i < (ctx.mi_col + bw4) >> sub_x; i++) {
|
|
259
|
+
above_level[i] = 0;
|
|
260
|
+
above_dc[i] = 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
for (let i = ctx.mi_row >> sub_y; i < (ctx.mi_row + bh4) >> sub_y; i++) {
|
|
264
|
+
left_level[i] = 0;
|
|
265
|
+
left_dc[i] = 0;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @param {Av1FrameContext} ctx
|
|
272
|
+
* @param {number} plane
|
|
273
|
+
* @param {number} x4
|
|
274
|
+
* @param {number} y4
|
|
275
|
+
* @param {number} w4
|
|
276
|
+
* @param {number} h4
|
|
277
|
+
* @returns {number}
|
|
278
|
+
* @see AV1 spec 8.3.2, `dc_sign`
|
|
279
|
+
*/
|
|
280
|
+
export function get_dc_sign_ctx(ctx, plane, x4, y4, w4, h4) {
|
|
281
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
282
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
283
|
+
|
|
284
|
+
const max_x4 = ctx.mi_cols >> sub_x;
|
|
285
|
+
const max_y4 = ctx.mi_rows >> sub_y;
|
|
286
|
+
|
|
287
|
+
const above_dc = ctx.above_dc_context[plane];
|
|
288
|
+
const left_dc = ctx.left_dc_context[plane];
|
|
289
|
+
|
|
290
|
+
let dc_sign = 0;
|
|
291
|
+
|
|
292
|
+
for (let k = 0; k < w4; k++) {
|
|
293
|
+
if (x4 + k < max_x4) {
|
|
294
|
+
const sign = above_dc[x4 + k];
|
|
295
|
+
|
|
296
|
+
if (sign === 1) {
|
|
297
|
+
dc_sign--;
|
|
298
|
+
} else if (sign === 2) {
|
|
299
|
+
dc_sign++;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
for (let k = 0; k < h4; k++) {
|
|
305
|
+
if (y4 + k < max_y4) {
|
|
306
|
+
const sign = left_dc[y4 + k];
|
|
307
|
+
|
|
308
|
+
if (sign === 1) {
|
|
309
|
+
dc_sign--;
|
|
310
|
+
} else if (sign === 2) {
|
|
311
|
+
dc_sign++;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (dc_sign < 0) {
|
|
317
|
+
return 1;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (dc_sign > 0) {
|
|
321
|
+
return 2;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return 0;
|
|
325
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Choosing the probabilities a partition decision is coded with.
|
|
3
|
+
*
|
|
4
|
+
* Shared with the encoder, which has to select exactly the same CDF and derive exactly the same
|
|
5
|
+
* context, or the two sides disagree about what a symbol meant.
|
|
6
|
+
*
|
|
7
|
+
* @author Alex Goldring
|
|
8
|
+
* @copyright Company Named Limited (c) 2026
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @param {Av1FrameContext} ctx
|
|
12
|
+
* @param {number} r
|
|
13
|
+
* @param {number} c
|
|
14
|
+
* @param {number} b_size
|
|
15
|
+
* @param {number} avail_u
|
|
16
|
+
* @param {number} avail_l
|
|
17
|
+
* @returns {number}
|
|
18
|
+
* @see AV1 spec 8.3.2, `partition`
|
|
19
|
+
*/
|
|
20
|
+
export function partition_context(ctx: Av1FrameContext, r: number, c: number, b_size: number, avail_u: number, avail_l: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* @param {Av1FrameContext} ctx
|
|
23
|
+
* @param {number} b_size
|
|
24
|
+
* @param {number} context
|
|
25
|
+
* @returns {PartitionCdf} the context's own, refilled — valid until the next call
|
|
26
|
+
*/
|
|
27
|
+
export function partition_cdf(ctx: Av1FrameContext, b_size: number, context: number): PartitionCdf;
|
|
28
|
+
/**
|
|
29
|
+
* The probability mass a CDF assigns to one symbol.
|
|
30
|
+
* @param {Uint16Array} cdf
|
|
31
|
+
* @param {number} base
|
|
32
|
+
* @param {number} symbol
|
|
33
|
+
* @returns {number}
|
|
34
|
+
*/
|
|
35
|
+
export function probability_of(cdf: Uint16Array, base: number, symbol: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* Which probabilities a partition decision is coded against, and where in them.
|
|
38
|
+
*
|
|
39
|
+
* A struct rather than a returned object literal: the encoder's partition search asks this question
|
|
40
|
+
* ten times per node and a hundred thousand times per picture, and an object literal is an
|
|
41
|
+
* allocation each time. One per frame context, refilled and handed back.
|
|
42
|
+
*
|
|
43
|
+
* @author Alex Goldring
|
|
44
|
+
* @copyright Company Named Limited (c) 2026
|
|
45
|
+
*/
|
|
46
|
+
export class PartitionCdf {
|
|
47
|
+
/** @type {Uint16Array|null} */
|
|
48
|
+
cdf: Uint16Array | null;
|
|
49
|
+
/** @type {number} */
|
|
50
|
+
offset: number;
|
|
51
|
+
/** @type {number} */
|
|
52
|
+
symbols: number;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=partition_cdf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partition_cdf.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/entropy/partition_cdf.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,2DARW,MAAM,KACN,MAAM,UACN,MAAM,WACN,MAAM,WACN,MAAM,GACJ,MAAM,CAUlB;AAuBD;;;;;GAKG;AACH,4DAJW,MAAM,WACN,MAAM,GACJ,YAAY,CA8BxB;AAED;;;;;;GAMG;AACH,oCALW,WAAW,QACX,MAAM,UACN,MAAM,GACJ,MAAM,CAIlB;AAlED;;;;;;;;;GASG;AACH;IACI,+BAA+B;IAC/B,KADW,WAAW,GAAC,IAAI,CAChB;IAEX,qBAAqB;IACrB,QADW,MAAM,CACN;IAEX,qBAAqB;IACrB,SADW,MAAM,CACL;CACf"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { MI_HEIGHT_LOG2, MI_WIDTH_LOG2 } from "../tables/block_tables.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Choosing the probabilities a partition decision is coded with.
|
|
5
|
+
*
|
|
6
|
+
* Shared with the encoder, which has to select exactly the same CDF and derive exactly the same
|
|
7
|
+
* context, or the two sides disagree about what a symbol meant.
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {Av1FrameContext} ctx
|
|
15
|
+
* @param {number} r
|
|
16
|
+
* @param {number} c
|
|
17
|
+
* @param {number} b_size
|
|
18
|
+
* @param {number} avail_u
|
|
19
|
+
* @param {number} avail_l
|
|
20
|
+
* @returns {number}
|
|
21
|
+
* @see AV1 spec 8.3.2, `partition`
|
|
22
|
+
*/
|
|
23
|
+
export function partition_context(ctx, r, c, b_size, avail_u, avail_l) {
|
|
24
|
+
const bsl = MI_WIDTH_LOG2[b_size];
|
|
25
|
+
|
|
26
|
+
const above = avail_u === 1 && MI_WIDTH_LOG2[ctx.mi_sizes[(r - 1) * ctx.mi_stride + c]] < bsl ? 1 : 0;
|
|
27
|
+
const left = avail_l === 1 && MI_HEIGHT_LOG2[ctx.mi_sizes[r * ctx.mi_stride + c - 1]] < bsl ? 1 : 0;
|
|
28
|
+
|
|
29
|
+
return left * 2 + above;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Which probabilities a partition decision is coded against, and where in them.
|
|
34
|
+
*
|
|
35
|
+
* A struct rather than a returned object literal: the encoder's partition search asks this question
|
|
36
|
+
* ten times per node and a hundred thousand times per picture, and an object literal is an
|
|
37
|
+
* allocation each time. One per frame context, refilled and handed back.
|
|
38
|
+
*
|
|
39
|
+
* @author Alex Goldring
|
|
40
|
+
* @copyright Company Named Limited (c) 2026
|
|
41
|
+
*/
|
|
42
|
+
export class PartitionCdf {
|
|
43
|
+
/** @type {Uint16Array|null} */
|
|
44
|
+
cdf = null;
|
|
45
|
+
|
|
46
|
+
/** @type {number} */
|
|
47
|
+
offset = 0;
|
|
48
|
+
|
|
49
|
+
/** @type {number} */
|
|
50
|
+
symbols = 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @param {Av1FrameContext} ctx
|
|
55
|
+
* @param {number} b_size
|
|
56
|
+
* @param {number} context
|
|
57
|
+
* @returns {PartitionCdf} the context's own, refilled — valid until the next call
|
|
58
|
+
*/
|
|
59
|
+
export function partition_cdf(ctx, b_size, context) {
|
|
60
|
+
const bsl = MI_WIDTH_LOG2[b_size];
|
|
61
|
+
|
|
62
|
+
const selected = ctx.partition_selection;
|
|
63
|
+
|
|
64
|
+
if (bsl === 1) {
|
|
65
|
+
selected.cdf = ctx.cdf.partition_w8;
|
|
66
|
+
selected.offset = context * 5;
|
|
67
|
+
selected.symbols = 4;
|
|
68
|
+
} else if (bsl === 2) {
|
|
69
|
+
selected.cdf = ctx.cdf.partition_w16;
|
|
70
|
+
selected.offset = context * 11;
|
|
71
|
+
selected.symbols = 10;
|
|
72
|
+
} else if (bsl === 3) {
|
|
73
|
+
selected.cdf = ctx.cdf.partition_w32;
|
|
74
|
+
selected.offset = context * 11;
|
|
75
|
+
selected.symbols = 10;
|
|
76
|
+
} else if (bsl === 4) {
|
|
77
|
+
selected.cdf = ctx.cdf.partition_w64;
|
|
78
|
+
selected.offset = context * 11;
|
|
79
|
+
selected.symbols = 10;
|
|
80
|
+
} else {
|
|
81
|
+
selected.cdf = ctx.cdf.partition_w128;
|
|
82
|
+
selected.offset = context * 9;
|
|
83
|
+
selected.symbols = 8;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return selected;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The probability mass a CDF assigns to one symbol.
|
|
91
|
+
* @param {Uint16Array} cdf
|
|
92
|
+
* @param {number} base
|
|
93
|
+
* @param {number} symbol
|
|
94
|
+
* @returns {number}
|
|
95
|
+
*/
|
|
96
|
+
export function probability_of(cdf, base, symbol) {
|
|
97
|
+
return cdf[base + symbol] - cdf[base + symbol - 1];
|
|
98
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What one symbol would cost to write, without writing it.
|
|
3
|
+
*
|
|
4
|
+
* The interval the arithmetic coder gives a symbol is not `cdf[s] - cdf[s-1]`: it is that
|
|
5
|
+
* probability pushed through the same shifts {@link SymbolWriter.write_symbol} applies, plus the
|
|
6
|
+
* floor of {@link EC_MIN_PROB} every symbol gets so that none is ever impossible. Measuring the
|
|
7
|
+
* partition rather than the CDF is what keeps the estimate honest for the rare symbols — which are
|
|
8
|
+
* the expensive ones, and therefore the ones a decision turns on.
|
|
9
|
+
*
|
|
10
|
+
* Evaluated at a range of `1 << 15`, which is the range renormalisation keeps the coder near and
|
|
11
|
+
* makes the answer independent of where in the stream the symbol lands.
|
|
12
|
+
*
|
|
13
|
+
* @param {Uint16Array} cdf in specification form
|
|
14
|
+
* @param {number} offset
|
|
15
|
+
* @param {number} symbol `0 .. n - 1`
|
|
16
|
+
* @param {number} n number of symbols
|
|
17
|
+
* @returns {number} cost in {@link COST_ONE_BIT} units
|
|
18
|
+
*
|
|
19
|
+
* @author Alex Goldring
|
|
20
|
+
* @copyright Company Named Limited (c) 2026
|
|
21
|
+
*/
|
|
22
|
+
export function symbol_cost(cdf: Uint16Array, offset: number, symbol: number, n: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* Fixed-point unit the costs here are counted in: a bit is this many.
|
|
25
|
+
*
|
|
26
|
+
* A tenth of a percent of a bit. Fine enough that ten thousand near-certain symbols — which cost a
|
|
27
|
+
* hundredth of a bit each and are where a coarse table goes wrong — still add up to within a bit of
|
|
28
|
+
* the truth, and coarse enough that the whole table is sixteen bit.
|
|
29
|
+
* @type {number}
|
|
30
|
+
*/
|
|
31
|
+
export const COST_ONE_BIT: number;
|
|
32
|
+
/**
|
|
33
|
+
* What one even-odds bit costs. Slightly more than a bit, because of the same floor.
|
|
34
|
+
* @type {number}
|
|
35
|
+
*/
|
|
36
|
+
export const BOOL_COST: number;
|
|
37
|
+
//# sourceMappingURL=symbol_cost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol_cost.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/entropy/symbol_cost.js"],"names":[],"mappings":"AAsCA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iCATW,WAAW,UACX,MAAM,UACN,MAAM,KACN,MAAM,GACJ,MAAM,CAalB;AAjED;;;;;;;GAOG;AACH,2BAFU,MAAM,CAEiB;AA2DjC;;;GAGG;AACH,wBAFU,MAAM,CAId"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { EC_MIN_PROB, EC_PROB_SHIFT } from "../tables/av1_symbols.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Fixed-point unit the costs here are counted in: a bit is this many.
|
|
5
|
+
*
|
|
6
|
+
* A tenth of a percent of a bit. Fine enough that ten thousand near-certain symbols — which cost a
|
|
7
|
+
* hundredth of a bit each and are where a coarse table goes wrong — still add up to within a bit of
|
|
8
|
+
* the truth, and coarse enough that the whole table is sixteen bit.
|
|
9
|
+
* @type {number}
|
|
10
|
+
*/
|
|
11
|
+
export const COST_ONE_BIT = 1024;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* `-log2(p)` for every probability the symbol coder can hold, in {@link COST_ONE_BIT} units.
|
|
15
|
+
*
|
|
16
|
+
* Indexed by the probability in fifteen-bit units. The rarest representable symbol costs fifteen
|
|
17
|
+
* bits, so the largest entry is `15 * COST_ONE_BIT`, which is well inside sixteen bits.
|
|
18
|
+
* @type {Uint16Array}
|
|
19
|
+
*/
|
|
20
|
+
const COST_OF_PROBABILITY = build_cost_table();
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @returns {Uint16Array}
|
|
24
|
+
*/
|
|
25
|
+
function build_cost_table() {
|
|
26
|
+
const table = new Uint16Array(32769);
|
|
27
|
+
|
|
28
|
+
for (let p = 1; p <= 32768; p++) {
|
|
29
|
+
table[p] = Math.round(-Math.log2(p / 32768) * COST_ONE_BIT);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// a probability of zero cannot occur — the coder floors every symbol at EC_MIN_PROB — but an
|
|
33
|
+
// index of zero must still return a number rather than a hole
|
|
34
|
+
table[0] = table[1];
|
|
35
|
+
|
|
36
|
+
return table;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* What one symbol would cost to write, without writing it.
|
|
41
|
+
*
|
|
42
|
+
* The interval the arithmetic coder gives a symbol is not `cdf[s] - cdf[s-1]`: it is that
|
|
43
|
+
* probability pushed through the same shifts {@link SymbolWriter.write_symbol} applies, plus the
|
|
44
|
+
* floor of {@link EC_MIN_PROB} every symbol gets so that none is ever impossible. Measuring the
|
|
45
|
+
* partition rather than the CDF is what keeps the estimate honest for the rare symbols — which are
|
|
46
|
+
* the expensive ones, and therefore the ones a decision turns on.
|
|
47
|
+
*
|
|
48
|
+
* Evaluated at a range of `1 << 15`, which is the range renormalisation keeps the coder near and
|
|
49
|
+
* makes the answer independent of where in the stream the symbol lands.
|
|
50
|
+
*
|
|
51
|
+
* @param {Uint16Array} cdf in specification form
|
|
52
|
+
* @param {number} offset
|
|
53
|
+
* @param {number} symbol `0 .. n - 1`
|
|
54
|
+
* @param {number} n number of symbols
|
|
55
|
+
* @returns {number} cost in {@link COST_ONE_BIT} units
|
|
56
|
+
*
|
|
57
|
+
* @author Alex Goldring
|
|
58
|
+
* @copyright Company Named Limited (c) 2026
|
|
59
|
+
*/
|
|
60
|
+
export function symbol_cost(cdf, offset, symbol, n) {
|
|
61
|
+
const high = (((128 * (((1 << 15) - cdf[offset + symbol]) >> EC_PROB_SHIFT)) >> (7 - EC_PROB_SHIFT)) + EC_MIN_PROB * (n - symbol - 1)) | 0;
|
|
62
|
+
|
|
63
|
+
const low = symbol > 0
|
|
64
|
+
? (((128 * (((1 << 15) - cdf[offset + symbol - 1]) >> EC_PROB_SHIFT)) >> (7 - EC_PROB_SHIFT)) + EC_MIN_PROB * (n - symbol)) | 0
|
|
65
|
+
: 1 << 15;
|
|
66
|
+
|
|
67
|
+
return COST_OF_PROBABILITY[low - high];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* What one even-odds bit costs. Slightly more than a bit, because of the same floor.
|
|
72
|
+
* @type {number}
|
|
73
|
+
*/
|
|
74
|
+
export const BOOL_COST = COST_OF_PROBABILITY[
|
|
75
|
+
(1 << 15) - ((((128 * ((1 << 14) >> EC_PROB_SHIFT)) >> (7 - EC_PROB_SHIFT)) + EC_MIN_PROB) | 0)
|
|
76
|
+
];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply constrained directional enhancement to a decoded frame.
|
|
3
|
+
*
|
|
4
|
+
* Reads from `ctx.planes` and writes to `ctx.cdef_planes`, which the caller must have sized to
|
|
5
|
+
* match. The two cannot be the same buffer: the filter reads its neighbourhood from the *unfiltered*
|
|
6
|
+
* frame, so filtering in place would feed already-filtered samples back into later blocks.
|
|
7
|
+
*
|
|
8
|
+
* @param {Av1FrameContext} ctx
|
|
9
|
+
* @see AV1 spec 7.15 "CDEF process"
|
|
10
|
+
*
|
|
11
|
+
* @author Alex Goldring
|
|
12
|
+
* @copyright Company Named Limited (c) 2026
|
|
13
|
+
*/
|
|
14
|
+
export function apply_cdef(ctx: Av1FrameContext): void;
|
|
15
|
+
//# sourceMappingURL=cdef.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdef.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/filter/cdef.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;GAYG;AACH,uDAWC"}
|