@woosh/meep-engine 3.9.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/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/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,616 @@
|
|
|
1
|
+
import { clamp_index } from "../../../../core/math/clamp_index.js";
|
|
2
|
+
import { RESTORE_NONE, RESTORE_WIENER } from "../tables/av1_symbols.js";
|
|
3
|
+
import { WIENER_TAPS_MAX, WIENER_TAPS_MID, WIENER_TAPS_MIN } from "../tables/filter_tables.js";
|
|
4
|
+
import { apply_loop_restoration, count_units_in_frame, restoration_unit_of } from "../filter/loop_restoration.js";
|
|
5
|
+
import { DECODE_THOROUGH } from "./decode_effort.js";
|
|
6
|
+
import { apply_cdef } from "../filter/cdef.js";
|
|
7
|
+
import { round2 } from "../util/round2.js";
|
|
8
|
+
import { write_lr_unit } from "./write_lr.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Taps in each direction, and the fraction they are counted in.
|
|
12
|
+
* @type {number}
|
|
13
|
+
*/
|
|
14
|
+
const TAPS = 3;
|
|
15
|
+
|
|
16
|
+
/** @type {number} the coded taps are sixty-fourths of the filter's unit gain of 128 */
|
|
17
|
+
const TAP_SCALE = 128;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Added to the diagonal of each fit, in the units the samples are measured in.
|
|
21
|
+
*
|
|
22
|
+
* A flat unit — a patch of sky, a black border — leaves a system with no information in it, and
|
|
23
|
+
* without this the solve returns whatever the rounding left. With it, such a unit fits the identity,
|
|
24
|
+
* which is the right answer for a patch with nothing in it to restore.
|
|
25
|
+
* @type {number}
|
|
26
|
+
*/
|
|
27
|
+
const RIDGE = 1e-3;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Choose a restoration filter for each unit of the frame, after everything else is decided.
|
|
31
|
+
*
|
|
32
|
+
* ### What it is
|
|
33
|
+
*
|
|
34
|
+
* Deblocking and the directional filter both work on what a block looks like. Restoration works on
|
|
35
|
+
* what the *picture* looks like: it fits a small symmetric blur or sharpen to each patch of the
|
|
36
|
+
* reconstruction so that the patch lands closer to the source. The filter is seven taps across and
|
|
37
|
+
* seven down, symmetric in each direction and summing to one, which is three numbers per direction
|
|
38
|
+
* and the format codes them per unit.
|
|
39
|
+
*
|
|
40
|
+
* ### Why it is fitted rather than searched
|
|
41
|
+
*
|
|
42
|
+
* A least squares fit is the answer, not an approximation to it: with the vertical taps fixed, the
|
|
43
|
+
* horizontal ones that minimise squared error against the source solve a three by three system.
|
|
44
|
+
* Fixing the horizontal and solving the vertical does the same, and alternating converges in two
|
|
45
|
+
* rounds. Searching a ladder of filters, the way the deblocking level is chosen, would be both
|
|
46
|
+
* slower and worse.
|
|
47
|
+
*
|
|
48
|
+
* ### Why a unit may end up with none
|
|
49
|
+
*
|
|
50
|
+
* The taps cost thirty or forty bits, and a unit the reconstruction already got right does not earn
|
|
51
|
+
* them back. So each unit is priced — by writing its real syntax against a costing writer, both
|
|
52
|
+
* ways — and keeps the filter only when the error it saves is worth what it costs, at the same
|
|
53
|
+
* lambda every other decision in this encoder is taken at. A plane where no unit keeps one is
|
|
54
|
+
* signalled as having no restoration at all, which costs it nothing anywhere.
|
|
55
|
+
*
|
|
56
|
+
* @param {Av1EncodeContext} ec
|
|
57
|
+
* @see AV1 spec 7.17 "Loop restoration process", which is what this is choosing the parameters for
|
|
58
|
+
*
|
|
59
|
+
* @author Alex Goldring
|
|
60
|
+
* @copyright Company Named Limited (c) 2026
|
|
61
|
+
*/
|
|
62
|
+
export function choose_restoration(ec) {
|
|
63
|
+
const ctx = ec.frame_context;
|
|
64
|
+
const frame = ec.frame;
|
|
65
|
+
|
|
66
|
+
const wanted = frame.uses_lr;
|
|
67
|
+
|
|
68
|
+
frame.frame_restoration_type[0] = RESTORE_NONE;
|
|
69
|
+
frame.frame_restoration_type[1] = RESTORE_NONE;
|
|
70
|
+
frame.frame_restoration_type[2] = RESTORE_NONE;
|
|
71
|
+
frame.uses_lr = 0;
|
|
72
|
+
|
|
73
|
+
if (wanted === 0 || ec.decode_effort < DECODE_THOROUGH || ec.restoration_trials < 1 || ctx.lr_type === null) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
ec.resize_restoration(ctx);
|
|
78
|
+
|
|
79
|
+
prepare_deringed(ec);
|
|
80
|
+
|
|
81
|
+
frame.uses_lr = 1;
|
|
82
|
+
|
|
83
|
+
const planes = Math.min(ctx.num_planes, ec.restoration_planes);
|
|
84
|
+
|
|
85
|
+
for (let plane = 0; plane < planes; plane++) {
|
|
86
|
+
frame.frame_restoration_type[plane] = RESTORE_WIENER;
|
|
87
|
+
|
|
88
|
+
fit_plane(ec, plane);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// the units are priced against what the filter actually did, so it has to actually be run
|
|
92
|
+
apply_loop_restoration(ctx, ctx.planes, ctx.cdef_planes, ctx.lr_planes, ctx.plane_stride);
|
|
93
|
+
|
|
94
|
+
let any = 0;
|
|
95
|
+
|
|
96
|
+
for (let plane = 0; plane < planes; plane++) {
|
|
97
|
+
measure_units(ec, plane);
|
|
98
|
+
|
|
99
|
+
if (keep_units(ec, plane) === 0) {
|
|
100
|
+
frame.frame_restoration_type[plane] = RESTORE_NONE;
|
|
101
|
+
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
any = 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
frame.uses_lr = any;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Leave the frame as the decoder will have it when restoration starts: deblocked in `planes`, and
|
|
113
|
+
* deringed in `cdef_planes` — which is a copy of the first when no directional filter is signalled,
|
|
114
|
+
* exactly as the decoder makes it.
|
|
115
|
+
*
|
|
116
|
+
* @param {Av1EncodeContext} ec
|
|
117
|
+
*/
|
|
118
|
+
function prepare_deringed(ec) {
|
|
119
|
+
const ctx = ec.frame_context;
|
|
120
|
+
const frame = ec.frame;
|
|
121
|
+
|
|
122
|
+
const uses_cdef = frame.coded_lossless === 0
|
|
123
|
+
&& frame.allow_intrabc === 0
|
|
124
|
+
&& ec.sequence.enable_cdef === 1;
|
|
125
|
+
|
|
126
|
+
if (uses_cdef) {
|
|
127
|
+
apply_cdef(ctx);
|
|
128
|
+
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
for (let plane = 0; plane < ctx.num_planes; plane++) {
|
|
133
|
+
const samples = ctx.plane_stride[plane] * ctx.plane_rows[plane];
|
|
134
|
+
|
|
135
|
+
for (let i = 0; i < samples; i++) {
|
|
136
|
+
ctx.cdef_planes[plane][i] = ctx.planes[plane][i];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Fit one plane's units, alternating between the two directions.
|
|
143
|
+
*
|
|
144
|
+
* @param {Av1EncodeContext} ec
|
|
145
|
+
* @param {number} plane
|
|
146
|
+
*/
|
|
147
|
+
function fit_plane(ec, plane) {
|
|
148
|
+
const ctx = ec.frame_context;
|
|
149
|
+
|
|
150
|
+
const width = ctx.plane_width[plane];
|
|
151
|
+
const height = ctx.plane_height[plane];
|
|
152
|
+
const stride = ctx.plane_stride[plane];
|
|
153
|
+
|
|
154
|
+
const map_stride = build_unit_map(ec, plane);
|
|
155
|
+
|
|
156
|
+
const units = unit_count(ec, plane);
|
|
157
|
+
|
|
158
|
+
for (let i = 0; i < units; i++) {
|
|
159
|
+
const index = ctx.lr_unit_index(plane, Math.floor(i / ec.restoration_columns), i % ec.restoration_columns);
|
|
160
|
+
|
|
161
|
+
ctx.lr_type[index] = RESTORE_WIENER;
|
|
162
|
+
|
|
163
|
+
for (let j = 0; j < 6; j++) {
|
|
164
|
+
ctx.lr_wiener[index * 6 + j] = 0;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const input = ctx.cdef_planes[plane];
|
|
169
|
+
|
|
170
|
+
for (let round = 0; round < ec.restoration_trials; round++) {
|
|
171
|
+
// the horizontal taps against a picture the vertical ones have already been through
|
|
172
|
+
filter_plane(ec, plane, input, ec.restoration_middle, stride, width, height, map_stride, 0, round === 0 ? 0 : 1);
|
|
173
|
+
|
|
174
|
+
fit_direction(ec, plane, ec.restoration_middle, stride, width, height, map_stride, 1);
|
|
175
|
+
|
|
176
|
+
// and then the vertical taps against a picture the horizontal ones have been through
|
|
177
|
+
filter_plane(ec, plane, input, ec.restoration_middle, stride, width, height, map_stride, 1, 1);
|
|
178
|
+
|
|
179
|
+
fit_direction(ec, plane, ec.restoration_middle, stride, width, height, map_stride, 0);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Which unit each 4x4 block of a plane belongs to, worked out once rather than per sample.
|
|
185
|
+
*
|
|
186
|
+
* @param {Av1EncodeContext} ec
|
|
187
|
+
* @param {number} plane
|
|
188
|
+
* @returns {number} the map's stride, in 4x4 blocks
|
|
189
|
+
*/
|
|
190
|
+
function build_unit_map(ec, plane) {
|
|
191
|
+
const ctx = ec.frame_context;
|
|
192
|
+
|
|
193
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
194
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
195
|
+
|
|
196
|
+
const columns = (ctx.plane_width[plane] + 3) >> 2;
|
|
197
|
+
const rows = (ctx.plane_height[plane] + 3) >> 2;
|
|
198
|
+
|
|
199
|
+
const map = ec.restoration_map;
|
|
200
|
+
|
|
201
|
+
for (let y = 0; y < rows; y++) {
|
|
202
|
+
for (let x = 0; x < columns; x++) {
|
|
203
|
+
map[y * columns + x] = restoration_unit_of(ctx, plane, y << sub_y, x << sub_x);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return columns;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Run one direction's taps over a whole plane, per unit.
|
|
212
|
+
*
|
|
213
|
+
* @param {Av1EncodeContext} ec
|
|
214
|
+
* @param {number} plane
|
|
215
|
+
* @param {Uint16Array} input
|
|
216
|
+
* @param {Float32Array} output
|
|
217
|
+
* @param {number} stride
|
|
218
|
+
* @param {number} width
|
|
219
|
+
* @param {number} height
|
|
220
|
+
* @param {number} map_stride
|
|
221
|
+
* @param {number} pass `0` for the vertical taps, `1` for the horizontal
|
|
222
|
+
* @param {number} filtering `0` copies instead, which is what the identity would have done
|
|
223
|
+
*/
|
|
224
|
+
function filter_plane(ec, plane, input, output, stride, width, height, map_stride, pass, filtering) {
|
|
225
|
+
const ctx = ec.frame_context;
|
|
226
|
+
|
|
227
|
+
const taps = ctx.lr_wiener;
|
|
228
|
+
const filter = ec.restoration_taps;
|
|
229
|
+
|
|
230
|
+
for (let y = 0; y < height; y++) {
|
|
231
|
+
const row = y * stride;
|
|
232
|
+
const map_row = (y >> 2) * map_stride;
|
|
233
|
+
|
|
234
|
+
for (let x = 0; x < width; x++) {
|
|
235
|
+
if (filtering === 0) {
|
|
236
|
+
output[row + x] = input[row + x];
|
|
237
|
+
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
expand(taps, ec.restoration_map[map_row + (x >> 2)] * 6 + pass * 3, filter);
|
|
242
|
+
|
|
243
|
+
let sum = 0;
|
|
244
|
+
|
|
245
|
+
for (let t = 0; t < 7; t++) {
|
|
246
|
+
const at = pass === 1
|
|
247
|
+
? row + clamp_index(x + t - 3, width)
|
|
248
|
+
: clamp_index(y + t - 3, height) * stride + x;
|
|
249
|
+
|
|
250
|
+
sum += filter[t] * input[at];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
output[row + x] = sum / TAP_SCALE;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Solve one direction's taps for every unit of a plane at once.
|
|
260
|
+
*
|
|
261
|
+
* Three free numbers per unit: the filter is symmetric and sums to one, so the centre tap follows
|
|
262
|
+
* from the other three and each of them multiplies a *pair* of samples either side of the middle.
|
|
263
|
+
* That is what makes the basis below what it is.
|
|
264
|
+
*
|
|
265
|
+
* @param {Av1EncodeContext} ec
|
|
266
|
+
* @param {number} plane
|
|
267
|
+
* @param {Float32Array} values what the other direction left
|
|
268
|
+
* @param {number} stride
|
|
269
|
+
* @param {number} width
|
|
270
|
+
* @param {number} height
|
|
271
|
+
* @param {number} map_stride
|
|
272
|
+
* @param {number} pass `0` for the vertical taps, `1` for the horizontal
|
|
273
|
+
*/
|
|
274
|
+
function fit_direction(ec, plane, values, stride, width, height, map_stride, pass) {
|
|
275
|
+
const ctx = ec.frame_context;
|
|
276
|
+
|
|
277
|
+
const stats = ec.restoration_stats;
|
|
278
|
+
|
|
279
|
+
stats.fill(0);
|
|
280
|
+
|
|
281
|
+
const source = ec.source[plane];
|
|
282
|
+
const source_stride = ec.source_stride[plane];
|
|
283
|
+
|
|
284
|
+
const map = ec.restoration_map;
|
|
285
|
+
|
|
286
|
+
const basis = ec.restoration_basis;
|
|
287
|
+
|
|
288
|
+
for (let y = 0; y < height; y++) {
|
|
289
|
+
const row = y * stride;
|
|
290
|
+
const map_row = (y >> 2) * map_stride;
|
|
291
|
+
|
|
292
|
+
for (let x = 0; x < width; x++) {
|
|
293
|
+
const centre = values[row + x];
|
|
294
|
+
|
|
295
|
+
for (let i = 0; i < TAPS; i++) {
|
|
296
|
+
const near = pass === 1
|
|
297
|
+
? values[row + clamp_index(x + i - 3, width)]
|
|
298
|
+
: values[clamp_index(y + i - 3, height) * stride + x];
|
|
299
|
+
|
|
300
|
+
const far = pass === 1
|
|
301
|
+
? values[row + clamp_index(x + 3 - i, width)]
|
|
302
|
+
: values[clamp_index(y + 3 - i, height) * stride + x];
|
|
303
|
+
|
|
304
|
+
basis[i] = near + far - 2 * centre;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const target = source[y * source_stride + x] - centre;
|
|
308
|
+
|
|
309
|
+
const at = map[map_row + (x >> 2)] * 12;
|
|
310
|
+
|
|
311
|
+
for (let i = 0; i < TAPS; i++) {
|
|
312
|
+
stats[at + TAPS * TAPS + i] += basis[i] * target;
|
|
313
|
+
|
|
314
|
+
for (let j = 0; j < TAPS; j++) {
|
|
315
|
+
stats[at + i * TAPS + j] += basis[i] * basis[j];
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// chroma's outermost tap is not coded, so it is not fitted either
|
|
322
|
+
const first = plane > 0 ? 1 : 0;
|
|
323
|
+
|
|
324
|
+
const units = unit_count(ec, plane);
|
|
325
|
+
|
|
326
|
+
for (let i = 0; i < units; i++) {
|
|
327
|
+
const index = ctx.lr_unit_index(plane, Math.floor(i / ec.restoration_columns), i % ec.restoration_columns);
|
|
328
|
+
|
|
329
|
+
solve(ec, stats, index * 12, first);
|
|
330
|
+
|
|
331
|
+
for (let j = 0; j < TAPS; j++) {
|
|
332
|
+
const tap = j < first
|
|
333
|
+
? 0
|
|
334
|
+
: Math.round(ec.restoration_solution[j] * TAP_SCALE);
|
|
335
|
+
|
|
336
|
+
ctx.lr_wiener[index * 6 + pass * 3 + j] = clamp_tap(tap, j);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Gaussian elimination on the three by three the fit leaves, or the two by two for chroma.
|
|
343
|
+
*
|
|
344
|
+
* @param {Av1EncodeContext} ec
|
|
345
|
+
* @param {Float64Array} stats
|
|
346
|
+
* @param {number} at
|
|
347
|
+
* @param {number} first the first tap that is fitted rather than fixed at zero
|
|
348
|
+
*/
|
|
349
|
+
function solve(ec, stats, at, first) {
|
|
350
|
+
const n = TAPS - first;
|
|
351
|
+
|
|
352
|
+
const m = ec.restoration_system;
|
|
353
|
+
const out = ec.restoration_solution;
|
|
354
|
+
|
|
355
|
+
out.fill(0);
|
|
356
|
+
|
|
357
|
+
for (let i = 0; i < n; i++) {
|
|
358
|
+
for (let j = 0; j < n; j++) {
|
|
359
|
+
m[i * (n + 1) + j] = stats[at + (i + first) * TAPS + j + first];
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
m[i * (n + 1) + i] += RIDGE;
|
|
363
|
+
m[i * (n + 1) + n] = stats[at + TAPS * TAPS + i + first];
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
for (let column = 0; column < n; column++) {
|
|
367
|
+
let pivot = column;
|
|
368
|
+
|
|
369
|
+
for (let row = column + 1; row < n; row++) {
|
|
370
|
+
if (Math.abs(m[row * (n + 1) + column]) > Math.abs(m[pivot * (n + 1) + column])) {
|
|
371
|
+
pivot = row;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (m[pivot * (n + 1) + column] === 0) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if (pivot !== column) {
|
|
380
|
+
for (let j = column; j <= n; j++) {
|
|
381
|
+
const swap = m[column * (n + 1) + j];
|
|
382
|
+
|
|
383
|
+
m[column * (n + 1) + j] = m[pivot * (n + 1) + j];
|
|
384
|
+
m[pivot * (n + 1) + j] = swap;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
for (let row = 0; row < n; row++) {
|
|
389
|
+
if (row === column) {
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const factor = m[row * (n + 1) + column] / m[column * (n + 1) + column];
|
|
394
|
+
|
|
395
|
+
if (factor === 0) {
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
for (let j = column; j <= n; j++) {
|
|
400
|
+
m[row * (n + 1) + j] -= factor * m[column * (n + 1) + j];
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
for (let i = 0; i < n; i++) {
|
|
406
|
+
out[i + first] = m[i * (n + 1) + n] / m[i * (n + 1) + i];
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Squared error, per unit, of the restored picture and of the one it was made from.
|
|
412
|
+
*
|
|
413
|
+
* Attributed by the same rule the filter itself uses, so that a unit is judged on exactly the
|
|
414
|
+
* samples it filtered — the mapping is offset vertically by eight luma samples and getting that
|
|
415
|
+
* wrong would credit each unit with its neighbour's work.
|
|
416
|
+
*
|
|
417
|
+
* @param {Av1EncodeContext} ec
|
|
418
|
+
* @param {number} plane
|
|
419
|
+
*/
|
|
420
|
+
function measure_units(ec, plane) {
|
|
421
|
+
const ctx = ec.frame_context;
|
|
422
|
+
|
|
423
|
+
const errors = ec.restoration_errors;
|
|
424
|
+
|
|
425
|
+
// only this plane's slots, so that what each plane decided on is still there afterwards — the
|
|
426
|
+
// spec reads it, and so does anyone asking why a unit went the way it did
|
|
427
|
+
const span = ctx.lr_unit_rows * ctx.lr_unit_stride;
|
|
428
|
+
|
|
429
|
+
errors.fill(0, plane * span * 2, (plane + 1) * span * 2);
|
|
430
|
+
|
|
431
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
432
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
433
|
+
|
|
434
|
+
const width = ctx.plane_width[plane];
|
|
435
|
+
const height = ctx.plane_height[plane];
|
|
436
|
+
const stride = ctx.plane_stride[plane];
|
|
437
|
+
|
|
438
|
+
const restored = ctx.lr_planes[plane];
|
|
439
|
+
const deringed = ctx.cdef_planes[plane];
|
|
440
|
+
|
|
441
|
+
const source = ec.source[plane];
|
|
442
|
+
const source_stride = ec.source_stride[plane];
|
|
443
|
+
|
|
444
|
+
const step_x = 4 >> sub_x;
|
|
445
|
+
const step_y = 4 >> sub_y;
|
|
446
|
+
|
|
447
|
+
for (let y = 0; y < height; y += step_y) {
|
|
448
|
+
for (let x = 0; x < width; x += step_x) {
|
|
449
|
+
const unit = restoration_unit_of(ctx, plane, (y << sub_y) >> 2, (x << sub_x) >> 2);
|
|
450
|
+
|
|
451
|
+
let with_filter = 0;
|
|
452
|
+
let without = 0;
|
|
453
|
+
|
|
454
|
+
for (let j = 0; j < step_y && y + j < height; j++) {
|
|
455
|
+
const row = (y + j) * stride;
|
|
456
|
+
const source_row = (y + j) * source_stride;
|
|
457
|
+
|
|
458
|
+
for (let i = 0; i < step_x && x + i < width; i++) {
|
|
459
|
+
const target = source[source_row + x + i];
|
|
460
|
+
|
|
461
|
+
const a = restored[row + x + i] - target;
|
|
462
|
+
const b = deringed[row + x + i] - target;
|
|
463
|
+
|
|
464
|
+
with_filter += a * a;
|
|
465
|
+
without += b * b;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
errors[unit * 2] += with_filter;
|
|
470
|
+
errors[unit * 2 + 1] += without;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Keep the filter on the units that earned it, walking them in the order they will be coded so that
|
|
477
|
+
* each one is priced against the taps the one before it left as the reference.
|
|
478
|
+
*
|
|
479
|
+
* @param {Av1EncodeContext} ec
|
|
480
|
+
* @param {number} plane
|
|
481
|
+
* @returns {number} `1` if any unit kept its filter
|
|
482
|
+
*/
|
|
483
|
+
function keep_units(ec, plane) {
|
|
484
|
+
const ctx = ec.frame_context;
|
|
485
|
+
|
|
486
|
+
unit_count(ec, plane);
|
|
487
|
+
|
|
488
|
+
const writer = ec.restoration_writer;
|
|
489
|
+
|
|
490
|
+
const errors = ec.restoration_errors;
|
|
491
|
+
|
|
492
|
+
for (let pass = 0; pass < 2; pass++) {
|
|
493
|
+
for (let i = 0; i < TAPS; i++) {
|
|
494
|
+
ctx.ref_lr_wiener[(plane * 2 + pass) * 3 + i] = WIENER_TAPS_MID[i];
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
let kept = 0;
|
|
499
|
+
|
|
500
|
+
for (let unit_row = 0; unit_row < ec.restoration_rows; unit_row++) {
|
|
501
|
+
for (let unit_col = 0; unit_col < ec.restoration_columns; unit_col++) {
|
|
502
|
+
const index = ctx.lr_unit_index(plane, unit_row, unit_col);
|
|
503
|
+
|
|
504
|
+
ctx.lr_type[index] = RESTORE_WIENER;
|
|
505
|
+
|
|
506
|
+
save_reference(ec, plane);
|
|
507
|
+
|
|
508
|
+
writer.reset_costing();
|
|
509
|
+
write_lr_unit(ctx, writer, plane, unit_row, unit_col);
|
|
510
|
+
|
|
511
|
+
const with_filter = writer.cost;
|
|
512
|
+
|
|
513
|
+
restore_reference(ec, plane);
|
|
514
|
+
|
|
515
|
+
ctx.lr_type[index] = RESTORE_NONE;
|
|
516
|
+
|
|
517
|
+
writer.reset_costing();
|
|
518
|
+
write_lr_unit(ctx, writer, plane, unit_row, unit_col);
|
|
519
|
+
|
|
520
|
+
const without = writer.cost;
|
|
521
|
+
|
|
522
|
+
restore_reference(ec, plane);
|
|
523
|
+
|
|
524
|
+
if (errors[index * 2] + ec.lambda * (with_filter - without) >= errors[index * 2 + 1]) {
|
|
525
|
+
continue;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
ctx.lr_type[index] = RESTORE_WIENER;
|
|
529
|
+
|
|
530
|
+
// and let the reference advance, because the unit after this one is coded against it
|
|
531
|
+
for (let pass = 0; pass < 2; pass++) {
|
|
532
|
+
for (let i = plane > 0 ? 1 : 0; i < TAPS; i++) {
|
|
533
|
+
ctx.ref_lr_wiener[(plane * 2 + pass) * 3 + i] = ctx.lr_wiener[index * 6 + pass * 3 + i];
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
kept = 1;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
return kept;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* @param {Av1EncodeContext} ec
|
|
546
|
+
* @param {number} plane
|
|
547
|
+
*/
|
|
548
|
+
function save_reference(ec, plane) {
|
|
549
|
+
const ctx = ec.frame_context;
|
|
550
|
+
|
|
551
|
+
for (let i = 0; i < 6; i++) {
|
|
552
|
+
ec.restoration_reference[i] = ctx.ref_lr_wiener[plane * 6 + i];
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* @param {Av1EncodeContext} ec
|
|
558
|
+
* @param {number} plane
|
|
559
|
+
*/
|
|
560
|
+
function restore_reference(ec, plane) {
|
|
561
|
+
const ctx = ec.frame_context;
|
|
562
|
+
|
|
563
|
+
for (let i = 0; i < 6; i++) {
|
|
564
|
+
ctx.ref_lr_wiener[plane * 6 + i] = ec.restoration_reference[i];
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* @param {Av1EncodeContext} ec
|
|
570
|
+
* @param {number} plane
|
|
571
|
+
* @returns {number} units in the plane, and the shape of them on the encode context
|
|
572
|
+
*/
|
|
573
|
+
function unit_count(ec, plane) {
|
|
574
|
+
const ctx = ec.frame_context;
|
|
575
|
+
const frame = ec.frame;
|
|
576
|
+
|
|
577
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
578
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
579
|
+
|
|
580
|
+
const unit_size = frame.loop_restoration_size[plane];
|
|
581
|
+
|
|
582
|
+
ec.restoration_rows = count_units_in_frame(unit_size, round2(frame.frame_height, sub_y));
|
|
583
|
+
ec.restoration_columns = count_units_in_frame(unit_size, round2(frame.upscaled_width, sub_x));
|
|
584
|
+
|
|
585
|
+
return ec.restoration_rows * ec.restoration_columns;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* @param {Int8Array} coefficients
|
|
590
|
+
* @param {number} offset
|
|
591
|
+
* @param {Int32Array} filter
|
|
592
|
+
*/
|
|
593
|
+
function expand(coefficients, offset, filter) {
|
|
594
|
+
filter[3] = TAP_SCALE;
|
|
595
|
+
|
|
596
|
+
for (let i = 0; i < TAPS; i++) {
|
|
597
|
+
const c = coefficients[offset + i];
|
|
598
|
+
|
|
599
|
+
filter[i] = c;
|
|
600
|
+
filter[6 - i] = c;
|
|
601
|
+
filter[3] -= 2 * c;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* @param {number} tap
|
|
607
|
+
* @param {number} j
|
|
608
|
+
* @returns {number}
|
|
609
|
+
*/
|
|
610
|
+
function clamp_tap(tap, j) {
|
|
611
|
+
if (tap < WIENER_TAPS_MIN[j]) {
|
|
612
|
+
return WIENER_TAPS_MIN[j];
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
return tap > WIENER_TAPS_MAX[j] ? WIENER_TAPS_MAX[j] : tap;
|
|
616
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much work the file asks of whoever reads it.
|
|
3
|
+
*
|
|
4
|
+
* The other axis to {@link EFFORT_FAST} and its neighbours, and an unrelated one. Encode effort
|
|
5
|
+
* spends *this* machine's time to make a smaller file; decode effort spends the *reader's* time to
|
|
6
|
+
* the same end, by signalling in-loop filters the decoder then has to run over the whole frame.
|
|
7
|
+
* A file is smaller with them and slower to read; the trade lands on different people.
|
|
8
|
+
*
|
|
9
|
+
* Measured over eight pictures — five of them photographs — against libavif at speed 6, at
|
|
10
|
+
* {@link EFFORT_BALANCED}, with the decode times on one megapixel of the same picture:
|
|
11
|
+
*
|
|
12
|
+
* DECODE_FAST +13.1% rate 115 ms/MP
|
|
13
|
+
* DECODE_BALANCED +8.6% 294 ms/MP
|
|
14
|
+
* DECODE_THOROUGH +7.9% 350 ms/MP
|
|
15
|
+
*
|
|
16
|
+
* The directional filter is the whole of that first step: four and a half points of rate for a
|
|
17
|
+
* hundred and seventy milliseconds a megapixel, because its direction search runs over every 8x8
|
|
18
|
+
* block of the frame. Restoration is the second: another seven tenths of a point for fifty-odd
|
|
19
|
+
* milliseconds. Deblocking is in all three because it is nearly free — fifteen milliseconds — and
|
|
20
|
+
* worth two and a half points.
|
|
21
|
+
*
|
|
22
|
+
* ### Why fast is the default
|
|
23
|
+
*
|
|
24
|
+
* A texture is decoded on the machine that will draw with it, once per load, competing with
|
|
25
|
+
* everything else that machine is doing. A megapixel texture five per cent larger costs a few
|
|
26
|
+
* kilobytes of download — tens of milliseconds on a slow connection, and cached after that — where
|
|
27
|
+
* the filters cost two hundred and forty milliseconds of CPU every single time it is read. For
|
|
28
|
+
* pictures that are decoded far more often than they are transferred, the fast setting is the right
|
|
29
|
+
* one by two orders of magnitude, and that is what this codec is for.
|
|
30
|
+
*
|
|
31
|
+
* Reverse it for anything whose bytes are the scarce thing: an image served to many readers over a
|
|
32
|
+
* network it is paid for by the gigabyte, where a fifth of a second on each of their machines is
|
|
33
|
+
* someone else's problem and five per cent of every transfer is yours.
|
|
34
|
+
*
|
|
35
|
+
* None of this changes fidelity at a given quality setting. What the filters buy is *rate* at
|
|
36
|
+
* matched fidelity — the same picture in fewer bytes, not a better one.
|
|
37
|
+
*
|
|
38
|
+
* @author Alex Goldring
|
|
39
|
+
* @copyright Company Named Limited (c) 2026
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Deblocking only. Three times faster to read, five per cent larger.
|
|
43
|
+
* @type {number}
|
|
44
|
+
*/
|
|
45
|
+
export const DECODE_FAST: number;
|
|
46
|
+
/**
|
|
47
|
+
* And the directional filter, which is most of what the other two settings cost and most of what
|
|
48
|
+
* they save.
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
export const DECODE_BALANCED: number;
|
|
52
|
+
/**
|
|
53
|
+
* And loop restoration: the smallest file this encoder makes, and the slowest to read.
|
|
54
|
+
* @type {number}
|
|
55
|
+
*/
|
|
56
|
+
export const DECODE_THOROUGH: number;
|
|
57
|
+
//# sourceMappingURL=decode_effort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode_effort.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/encode/decode_effort.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;GAGG;AACH,0BAFU,MAAM,CAEa;AAE7B;;;;GAIG;AACH,8BAFU,MAAM,CAEiB;AAEjC;;;GAGG;AACH,8BAFU,MAAM,CAEiB"}
|