@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,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply loop restoration.
|
|
3
|
+
*
|
|
4
|
+
* Reads the deringed frame and the pre-CDEF frame, and writes the restored result. The two inputs
|
|
5
|
+
* are not interchangeable: within a stripe the filter reads deringed samples, and outside it reads
|
|
6
|
+
* deblocked ones, which is what lets a hardware decoder run restoration a stripe behind CDEF
|
|
7
|
+
* without an extra line buffer.
|
|
8
|
+
*
|
|
9
|
+
* @param {Av1FrameContext} ctx
|
|
10
|
+
* @param {Uint16Array[]} current the deblocked frame, upscaled if superres is in use
|
|
11
|
+
* @param {Uint16Array[]} cdef the deringed frame, upscaled if superres is in use
|
|
12
|
+
* @param {Uint16Array[]} output
|
|
13
|
+
* @param {Int32Array} stride
|
|
14
|
+
* @see AV1 spec 7.17 "Loop restoration process"
|
|
15
|
+
*
|
|
16
|
+
* @author Alex Goldring
|
|
17
|
+
* @copyright Company Named Limited (c) 2026
|
|
18
|
+
*/
|
|
19
|
+
export function apply_loop_restoration(ctx: Av1FrameContext, current: Uint16Array[], cdef: Uint16Array[], output: Uint16Array[], stride: Int32Array): void;
|
|
20
|
+
/**
|
|
21
|
+
* `count_units_in_frame`: how many restoration units of one size a frame is divided into.
|
|
22
|
+
*
|
|
23
|
+
* @param {number} unit_size
|
|
24
|
+
* @param {number} frame_size
|
|
25
|
+
* @returns {number}
|
|
26
|
+
*/
|
|
27
|
+
export function count_units_in_frame(unit_size: number, frame_size: number): number;
|
|
28
|
+
/**
|
|
29
|
+
* Which restoration unit a 4x4 block is filtered by.
|
|
30
|
+
*
|
|
31
|
+
* The vertical mapping is offset by eight luma samples, because restoration works in stripes that
|
|
32
|
+
* are offset by that much. Exported because the encoder has to attribute a block's error to the
|
|
33
|
+
* same unit this attributes its filtering to, and the two agreeing is the whole point.
|
|
34
|
+
*
|
|
35
|
+
* @param {Av1FrameContext} ctx
|
|
36
|
+
* @param {number} plane
|
|
37
|
+
* @param {number} row 4x4 block row
|
|
38
|
+
* @param {number} col 4x4 block column
|
|
39
|
+
* @returns {number} index into the per-unit arrays
|
|
40
|
+
*/
|
|
41
|
+
export function restoration_unit_of(ctx: Av1FrameContext, plane: number, row: number, col: number): number;
|
|
42
|
+
//# sourceMappingURL=loop_restoration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop_restoration.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/filter/loop_restoration.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;;;;;;GAiBG;AACH,sEATW,WAAW,EAAE,QACb,WAAW,EAAE,UACb,WAAW,EAAE,UACb,UAAU,QA+BpB;AAwDD;;;;;;GAMG;AACH,gDAJW,MAAM,cACN,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;;;;;;GAYG;AACH,iEALW,MAAM,OACN,MAAM,OACN,MAAM,GACJ,MAAM,CAiBlB"}
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { clamp } from "../../../../core/math/clamp.js";
|
|
2
|
+
import {
|
|
3
|
+
FILTER_BITS,
|
|
4
|
+
MI_SIZE,
|
|
5
|
+
RESTORE_NONE,
|
|
6
|
+
RESTORE_SGRPROJ,
|
|
7
|
+
RESTORE_WIENER,
|
|
8
|
+
SGRPROJ_MTABLE_BITS,
|
|
9
|
+
SGRPROJ_PRJ_BITS,
|
|
10
|
+
SGRPROJ_RECIP_BITS,
|
|
11
|
+
SGRPROJ_RST_BITS,
|
|
12
|
+
SGRPROJ_SGR_BITS
|
|
13
|
+
} from "../tables/av1_symbols.js";
|
|
14
|
+
import { SGR_PARAMS } from "../tables/filter_tables.js";
|
|
15
|
+
import { round2 } from "../util/round2.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `A` and `B` from the box filter, valid over one extra sample in each direction.
|
|
19
|
+
* @type {number}
|
|
20
|
+
*/
|
|
21
|
+
const BOX_STRIDE = MI_SIZE + 2;
|
|
22
|
+
|
|
23
|
+
/** @type {Int32Array} */
|
|
24
|
+
const BOX_A = new Int32Array(BOX_STRIDE * BOX_STRIDE);
|
|
25
|
+
|
|
26
|
+
/** @type {Int32Array} */
|
|
27
|
+
const BOX_B = new Int32Array(BOX_STRIDE * BOX_STRIDE);
|
|
28
|
+
|
|
29
|
+
/** @type {Int32Array} the two self-guided passes' outputs */
|
|
30
|
+
const FLT0 = new Int32Array(MI_SIZE * MI_SIZE);
|
|
31
|
+
|
|
32
|
+
/** @type {Int32Array} */
|
|
33
|
+
const FLT1 = new Int32Array(MI_SIZE * MI_SIZE);
|
|
34
|
+
|
|
35
|
+
/** @type {Int32Array} the Wiener filter's horizontal pass */
|
|
36
|
+
const WIENER_INTERMEDIATE = new Int32Array((MI_SIZE + 6) * MI_SIZE);
|
|
37
|
+
|
|
38
|
+
/** @type {Int32Array} the seven symmetric taps expanded from the three coded ones */
|
|
39
|
+
const WIENER_VERTICAL = new Int32Array(7);
|
|
40
|
+
|
|
41
|
+
/** @type {Int32Array} */
|
|
42
|
+
const WIENER_HORIZONTAL = new Int32Array(7);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* State the source-sample fetch needs, kept here rather than threaded through every call.
|
|
46
|
+
*
|
|
47
|
+
* The fetch decides between the deringed frame and the merely deblocked one based on which stripe
|
|
48
|
+
* the sample falls in, and that boundary changes per block. Hoisting it into a small module-level
|
|
49
|
+
* record keeps the innermost loops free of parameters they would otherwise carry six deep.
|
|
50
|
+
*/
|
|
51
|
+
const SOURCE = {
|
|
52
|
+
ctx: null,
|
|
53
|
+
plane: 0,
|
|
54
|
+
stripe_start_y: 0,
|
|
55
|
+
stripe_end_y: 0,
|
|
56
|
+
plane_end_x: 0,
|
|
57
|
+
plane_end_y: 0,
|
|
58
|
+
stride: 0,
|
|
59
|
+
cdef: null,
|
|
60
|
+
current: null
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Apply loop restoration.
|
|
65
|
+
*
|
|
66
|
+
* Reads the deringed frame and the pre-CDEF frame, and writes the restored result. The two inputs
|
|
67
|
+
* are not interchangeable: within a stripe the filter reads deringed samples, and outside it reads
|
|
68
|
+
* deblocked ones, which is what lets a hardware decoder run restoration a stripe behind CDEF
|
|
69
|
+
* without an extra line buffer.
|
|
70
|
+
*
|
|
71
|
+
* @param {Av1FrameContext} ctx
|
|
72
|
+
* @param {Uint16Array[]} current the deblocked frame, upscaled if superres is in use
|
|
73
|
+
* @param {Uint16Array[]} cdef the deringed frame, upscaled if superres is in use
|
|
74
|
+
* @param {Uint16Array[]} output
|
|
75
|
+
* @param {Int32Array} stride
|
|
76
|
+
* @see AV1 spec 7.17 "Loop restoration process"
|
|
77
|
+
*
|
|
78
|
+
* @author Alex Goldring
|
|
79
|
+
* @copyright Company Named Limited (c) 2026
|
|
80
|
+
*/
|
|
81
|
+
export function apply_loop_restoration(ctx, current, cdef, output, stride) {
|
|
82
|
+
const frame = ctx.frame;
|
|
83
|
+
|
|
84
|
+
for (let plane = 0; plane < ctx.num_planes; plane++) {
|
|
85
|
+
// the buffers are reused across frames, so the source may be longer than this frame
|
|
86
|
+
const samples = stride[plane] * ctx.plane_rows[plane];
|
|
87
|
+
|
|
88
|
+
output[plane].set(cdef[plane].subarray(0, samples));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (frame.uses_lr === 0) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
for (let y = 0; y < frame.frame_height; y += MI_SIZE) {
|
|
96
|
+
for (let x = 0; x < frame.upscaled_width; x += MI_SIZE) {
|
|
97
|
+
for (let plane = 0; plane < ctx.num_planes; plane++) {
|
|
98
|
+
if (frame.frame_restoration_type[plane] === RESTORE_NONE) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
restore_block(ctx, current, cdef, output, stride, plane, y >> 2, x >> 2);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @param {Av1FrameContext} ctx
|
|
110
|
+
* @param {Uint16Array[]} current
|
|
111
|
+
* @param {Uint16Array[]} cdef
|
|
112
|
+
* @param {Uint16Array[]} output
|
|
113
|
+
* @param {Int32Array} stride
|
|
114
|
+
* @param {number} plane
|
|
115
|
+
* @param {number} row
|
|
116
|
+
* @param {number} col
|
|
117
|
+
* @see AV1 spec 7.17.1 "Loop restore block process"
|
|
118
|
+
*/
|
|
119
|
+
function restore_block(ctx, current, cdef, output, stride, plane, row, col) {
|
|
120
|
+
const frame = ctx.frame;
|
|
121
|
+
|
|
122
|
+
const luma_y = row * MI_SIZE;
|
|
123
|
+
|
|
124
|
+
// stripes are offset up by eight luma samples so a pipelined decoder can restore a stripe as
|
|
125
|
+
// soon as the superblock row above it is deblocked
|
|
126
|
+
const stripe = Math.floor((luma_y + 8) / 64);
|
|
127
|
+
|
|
128
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
129
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
130
|
+
|
|
131
|
+
SOURCE.ctx = ctx;
|
|
132
|
+
SOURCE.plane = plane;
|
|
133
|
+
SOURCE.stripe_start_y = (-8 + stripe * 64) >> sub_y;
|
|
134
|
+
SOURCE.stripe_end_y = SOURCE.stripe_start_y + (64 >> sub_y) - 1;
|
|
135
|
+
SOURCE.plane_end_x = round2(frame.upscaled_width, sub_x) - 1;
|
|
136
|
+
SOURCE.plane_end_y = round2(frame.frame_height, sub_y) - 1;
|
|
137
|
+
SOURCE.stride = stride[plane];
|
|
138
|
+
SOURCE.cdef = cdef[plane];
|
|
139
|
+
SOURCE.current = current[plane];
|
|
140
|
+
|
|
141
|
+
const x = (col * MI_SIZE) >> sub_x;
|
|
142
|
+
const y = (row * MI_SIZE) >> sub_y;
|
|
143
|
+
|
|
144
|
+
const w = Math.min(MI_SIZE >> sub_x, SOURCE.plane_end_x - x + 1);
|
|
145
|
+
const h = Math.min(MI_SIZE >> sub_y, SOURCE.plane_end_y - y + 1);
|
|
146
|
+
|
|
147
|
+
if (w <= 0 || h <= 0) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const unit_index = restoration_unit_of(ctx, plane, row, col);
|
|
152
|
+
|
|
153
|
+
const type = ctx.lr_type[unit_index];
|
|
154
|
+
|
|
155
|
+
if (type === RESTORE_WIENER) {
|
|
156
|
+
wiener_filter(ctx, output, stride, plane, unit_index, x, y, w, h);
|
|
157
|
+
} else if (type === RESTORE_SGRPROJ) {
|
|
158
|
+
self_guided_filter(ctx, output, stride, plane, unit_index, x, y, w, h);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* `count_units_in_frame`: how many restoration units of one size a frame is divided into.
|
|
164
|
+
*
|
|
165
|
+
* @param {number} unit_size
|
|
166
|
+
* @param {number} frame_size
|
|
167
|
+
* @returns {number}
|
|
168
|
+
*/
|
|
169
|
+
export function count_units_in_frame(unit_size, frame_size) {
|
|
170
|
+
return Math.max(Math.floor((frame_size + (unit_size >> 1)) / unit_size), 1);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Which restoration unit a 4x4 block is filtered by.
|
|
175
|
+
*
|
|
176
|
+
* The vertical mapping is offset by eight luma samples, because restoration works in stripes that
|
|
177
|
+
* are offset by that much. Exported because the encoder has to attribute a block's error to the
|
|
178
|
+
* same unit this attributes its filtering to, and the two agreeing is the whole point.
|
|
179
|
+
*
|
|
180
|
+
* @param {Av1FrameContext} ctx
|
|
181
|
+
* @param {number} plane
|
|
182
|
+
* @param {number} row 4x4 block row
|
|
183
|
+
* @param {number} col 4x4 block column
|
|
184
|
+
* @returns {number} index into the per-unit arrays
|
|
185
|
+
*/
|
|
186
|
+
export function restoration_unit_of(ctx, plane, row, col) {
|
|
187
|
+
const frame = ctx.frame;
|
|
188
|
+
|
|
189
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
190
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
191
|
+
|
|
192
|
+
const unit_size = frame.loop_restoration_size[plane];
|
|
193
|
+
|
|
194
|
+
const unit_rows = count_units_in_frame(unit_size, round2(frame.frame_height, sub_y));
|
|
195
|
+
const unit_cols = count_units_in_frame(unit_size, round2(frame.upscaled_width, sub_x));
|
|
196
|
+
|
|
197
|
+
const unit_row = Math.min(unit_rows - 1, Math.floor(((row * MI_SIZE + 8) >> sub_y) / unit_size));
|
|
198
|
+
const unit_col = Math.min(unit_cols - 1, Math.floor(((col * MI_SIZE) >> sub_x) / unit_size));
|
|
199
|
+
|
|
200
|
+
return ctx.lr_unit_index(plane, unit_row, unit_col);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* `get_source_sample`: deringed inside the current stripe, merely deblocked outside it.
|
|
205
|
+
*
|
|
206
|
+
* @param {number} x
|
|
207
|
+
* @param {number} y
|
|
208
|
+
* @returns {number}
|
|
209
|
+
* @see AV1 spec 7.17.6 "Get source sample process"
|
|
210
|
+
*/
|
|
211
|
+
function source_sample(x, y) {
|
|
212
|
+
const clamped_x = clamp(x, 0, SOURCE.plane_end_x);
|
|
213
|
+
|
|
214
|
+
let clamped_y = clamp(y, 0, SOURCE.plane_end_y);
|
|
215
|
+
|
|
216
|
+
if (clamped_y < SOURCE.stripe_start_y) {
|
|
217
|
+
clamped_y = Math.max(SOURCE.stripe_start_y - 2, clamped_y);
|
|
218
|
+
|
|
219
|
+
return SOURCE.current[clamped_y * SOURCE.stride + clamped_x];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (clamped_y > SOURCE.stripe_end_y) {
|
|
223
|
+
clamped_y = Math.min(SOURCE.stripe_end_y + 2, clamped_y);
|
|
224
|
+
|
|
225
|
+
return SOURCE.current[clamped_y * SOURCE.stride + clamped_x];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return SOURCE.cdef[clamped_y * SOURCE.stride + clamped_x];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @param {Av1FrameContext} ctx
|
|
233
|
+
* @param {Uint16Array[]} output
|
|
234
|
+
* @param {Int32Array} stride
|
|
235
|
+
* @param {number} plane
|
|
236
|
+
* @param {number} unit_index
|
|
237
|
+
* @param {number} x
|
|
238
|
+
* @param {number} y
|
|
239
|
+
* @param {number} w
|
|
240
|
+
* @param {number} h
|
|
241
|
+
* @see AV1 spec 7.17.4 "Wiener filter process"
|
|
242
|
+
*/
|
|
243
|
+
function wiener_filter(ctx, output, stride, plane, unit_index, x, y, w, h) {
|
|
244
|
+
const bit_depth = ctx.bit_depth;
|
|
245
|
+
|
|
246
|
+
// the rounding the specification derives for a non-compound inter prediction, reused here
|
|
247
|
+
const round0 = bit_depth === 12 ? 5 : 3;
|
|
248
|
+
const round1 = bit_depth === 12 ? 9 : 11;
|
|
249
|
+
|
|
250
|
+
expand_wiener(ctx.lr_wiener, unit_index * 6, WIENER_VERTICAL);
|
|
251
|
+
expand_wiener(ctx.lr_wiener, unit_index * 6 + 3, WIENER_HORIZONTAL);
|
|
252
|
+
|
|
253
|
+
const offset = 1 << (bit_depth + FILTER_BITS - round0 - 1);
|
|
254
|
+
const limit = (1 << (bit_depth + 1 + FILTER_BITS - round0)) - 1;
|
|
255
|
+
|
|
256
|
+
for (let r = 0; r < h + 6; r++) {
|
|
257
|
+
for (let c = 0; c < w; c++) {
|
|
258
|
+
let s = 0;
|
|
259
|
+
|
|
260
|
+
for (let t = 0; t < 7; t++) {
|
|
261
|
+
s += WIENER_HORIZONTAL[t] * source_sample(x + c + t - 3, y + r - 3);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
WIENER_INTERMEDIATE[r * MI_SIZE + c] = clamp(round2(s, round0), -offset, limit - offset);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const max_value = (1 << bit_depth) - 1;
|
|
269
|
+
|
|
270
|
+
const plane_output = output[plane];
|
|
271
|
+
const plane_stride = stride[plane];
|
|
272
|
+
|
|
273
|
+
for (let r = 0; r < h; r++) {
|
|
274
|
+
for (let c = 0; c < w; c++) {
|
|
275
|
+
let s = 0;
|
|
276
|
+
|
|
277
|
+
for (let t = 0; t < 7; t++) {
|
|
278
|
+
s += WIENER_VERTICAL[t] * WIENER_INTERMEDIATE[(r + t) * MI_SIZE + c];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
plane_output[(y + r) * plane_stride + x + c] = clamp(round2(s, round1), 0, max_value);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Expand three coded taps into the seven of a symmetric unit-gain filter.
|
|
288
|
+
*
|
|
289
|
+
* @param {Int8Array} coefficients
|
|
290
|
+
* @param {number} offset
|
|
291
|
+
* @param {Int32Array} filter
|
|
292
|
+
* @see AV1 spec 7.17.5 "Wiener coefficient process"
|
|
293
|
+
*/
|
|
294
|
+
function expand_wiener(coefficients, offset, filter) {
|
|
295
|
+
filter[3] = 128;
|
|
296
|
+
|
|
297
|
+
for (let i = 0; i < 3; i++) {
|
|
298
|
+
const c = coefficients[offset + i];
|
|
299
|
+
|
|
300
|
+
filter[i] = c;
|
|
301
|
+
filter[6 - i] = c;
|
|
302
|
+
filter[3] -= 2 * c;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @param {Av1FrameContext} ctx
|
|
308
|
+
* @param {Uint16Array[]} output
|
|
309
|
+
* @param {Int32Array} stride
|
|
310
|
+
* @param {number} plane
|
|
311
|
+
* @param {number} unit_index
|
|
312
|
+
* @param {number} x
|
|
313
|
+
* @param {number} y
|
|
314
|
+
* @param {number} w
|
|
315
|
+
* @param {number} h
|
|
316
|
+
* @see AV1 spec 7.17.2 "Self guided filter process"
|
|
317
|
+
*/
|
|
318
|
+
function self_guided_filter(ctx, output, stride, plane, unit_index, x, y, w, h) {
|
|
319
|
+
const set = ctx.lr_sgr_set[unit_index];
|
|
320
|
+
|
|
321
|
+
box_filter(ctx, x, y, w, h, set, 0, FLT0);
|
|
322
|
+
box_filter(ctx, x, y, w, h, set, 1, FLT1);
|
|
323
|
+
|
|
324
|
+
const w0 = ctx.lr_sgr_xqd[unit_index * 2];
|
|
325
|
+
const w1 = ctx.lr_sgr_xqd[unit_index * 2 + 1];
|
|
326
|
+
const w2 = (1 << SGRPROJ_PRJ_BITS) - w0 - w1;
|
|
327
|
+
|
|
328
|
+
const r0 = SGR_PARAMS[set * 4];
|
|
329
|
+
const r1 = SGR_PARAMS[set * 4 + 2];
|
|
330
|
+
|
|
331
|
+
const max_value = (1 << ctx.bit_depth) - 1;
|
|
332
|
+
|
|
333
|
+
const plane_output = output[plane];
|
|
334
|
+
const plane_stride = stride[plane];
|
|
335
|
+
|
|
336
|
+
for (let i = 0; i < h; i++) {
|
|
337
|
+
for (let j = 0; j < w; j++) {
|
|
338
|
+
const u = SOURCE.cdef[(y + i) * SOURCE.stride + x + j] << SGRPROJ_RST_BITS;
|
|
339
|
+
|
|
340
|
+
let v = w1 * u;
|
|
341
|
+
|
|
342
|
+
v += r0 !== 0 ? w0 * FLT0[i * MI_SIZE + j] : w0 * u;
|
|
343
|
+
v += r1 !== 0 ? w2 * FLT1[i * MI_SIZE + j] : w2 * u;
|
|
344
|
+
|
|
345
|
+
plane_output[(y + i) * plane_stride + x + j] = clamp(
|
|
346
|
+
round2(v, SGRPROJ_RST_BITS + SGRPROJ_PRJ_BITS),
|
|
347
|
+
0,
|
|
348
|
+
max_value
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* @param {Av1FrameContext} ctx
|
|
356
|
+
* @param {number} x
|
|
357
|
+
* @param {number} y
|
|
358
|
+
* @param {number} w
|
|
359
|
+
* @param {number} h
|
|
360
|
+
* @param {number} set
|
|
361
|
+
* @param {number} pass
|
|
362
|
+
* @param {Int32Array} out
|
|
363
|
+
* @see AV1 spec 7.17.3 "Box filter process"
|
|
364
|
+
*/
|
|
365
|
+
function box_filter(ctx, x, y, w, h, set, pass, out) {
|
|
366
|
+
const r = SGR_PARAMS[set * 4 + pass * 2];
|
|
367
|
+
|
|
368
|
+
if (r === 0) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const eps = SGR_PARAMS[set * 4 + pass * 2 + 1];
|
|
373
|
+
|
|
374
|
+
const bit_depth = ctx.bit_depth;
|
|
375
|
+
|
|
376
|
+
const n = (2 * r + 1) * (2 * r + 1);
|
|
377
|
+
const n2e = n * n * eps;
|
|
378
|
+
const s = Math.floor(((1 << SGRPROJ_MTABLE_BITS) + Math.floor(n2e / 2)) / n2e);
|
|
379
|
+
|
|
380
|
+
const one_over_n = Math.floor(((1 << SGRPROJ_RECIP_BITS) + Math.floor(n / 2)) / n);
|
|
381
|
+
|
|
382
|
+
for (let i = -1; i < h + 1; i++) {
|
|
383
|
+
for (let j = -1; j < w + 1; j++) {
|
|
384
|
+
let a = 0;
|
|
385
|
+
let b = 0;
|
|
386
|
+
|
|
387
|
+
for (let dy = -r; dy <= r; dy++) {
|
|
388
|
+
for (let dx = -r; dx <= r; dx++) {
|
|
389
|
+
const c = source_sample(x + j + dx, y + i + dy);
|
|
390
|
+
|
|
391
|
+
a += c * c;
|
|
392
|
+
b += c;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
a = round2(a, 2 * (bit_depth - 8));
|
|
397
|
+
|
|
398
|
+
const d = round2(b, bit_depth - 8);
|
|
399
|
+
|
|
400
|
+
const p = Math.max(0, a * n - d * d);
|
|
401
|
+
const z = round2(p * s, SGRPROJ_MTABLE_BITS);
|
|
402
|
+
|
|
403
|
+
let a2;
|
|
404
|
+
|
|
405
|
+
if (z >= 255) {
|
|
406
|
+
a2 = 256;
|
|
407
|
+
} else if (z === 0) {
|
|
408
|
+
a2 = 1;
|
|
409
|
+
} else {
|
|
410
|
+
a2 = Math.floor(((z << SGRPROJ_SGR_BITS) + Math.floor(z / 2)) / (z + 1));
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
const b2 = ((1 << SGRPROJ_SGR_BITS) - a2) * b * one_over_n;
|
|
414
|
+
|
|
415
|
+
const index = (i + 1) * BOX_STRIDE + j + 1;
|
|
416
|
+
|
|
417
|
+
BOX_A[index] = a2;
|
|
418
|
+
BOX_B[index] = round2(b2, SGRPROJ_RECIP_BITS);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
for (let i = 0; i < h; i++) {
|
|
423
|
+
const shift = pass === 0 && (i & 1) !== 0 ? 4 : 5;
|
|
424
|
+
|
|
425
|
+
for (let j = 0; j < w; j++) {
|
|
426
|
+
let a = 0;
|
|
427
|
+
let b = 0;
|
|
428
|
+
|
|
429
|
+
for (let dy = -1; dy <= 1; dy++) {
|
|
430
|
+
for (let dx = -1; dx <= 1; dx++) {
|
|
431
|
+
let weight;
|
|
432
|
+
|
|
433
|
+
if (pass === 0) {
|
|
434
|
+
weight = ((i + dy) & 1) !== 0 ? (dx === 0 ? 6 : 5) : 0;
|
|
435
|
+
} else {
|
|
436
|
+
weight = dx === 0 || dy === 0 ? 4 : 3;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
const index = (i + dy + 1) * BOX_STRIDE + j + dx + 1;
|
|
440
|
+
|
|
441
|
+
a += weight * BOX_A[index];
|
|
442
|
+
b += weight * BOX_B[index];
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
const v = a * SOURCE.cdef[(y + i) * SOURCE.stride + x + j] + b;
|
|
447
|
+
|
|
448
|
+
out[i * MI_SIZE + j] = round2(v, SGRPROJ_SGR_BITS + shift - SGRPROJ_RST_BITS);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Horizontally upscale a superres frame.
|
|
3
|
+
*
|
|
4
|
+
* Superres codes a frame narrower than it is displayed and restores the width here, with an eight
|
|
5
|
+
* tap filter whose phase advances by a fixed fractional step per output sample. Only the horizontal
|
|
6
|
+
* axis is scaled: the vertical resolution is never reduced.
|
|
7
|
+
*
|
|
8
|
+
* @param {Av1FrameContext} ctx
|
|
9
|
+
* @param {Uint16Array[]} source planes at the coded width
|
|
10
|
+
* @param {Uint16Array[]} destination planes at the upscaled width
|
|
11
|
+
* @param {Int32Array} destination_stride
|
|
12
|
+
* @see AV1 spec 7.16 "Upscaling process"
|
|
13
|
+
*
|
|
14
|
+
* @author Alex Goldring
|
|
15
|
+
* @copyright Company Named Limited (c) 2026
|
|
16
|
+
*/
|
|
17
|
+
export function apply_superres(ctx: Av1FrameContext, source: Uint16Array[], destination: Uint16Array[], destination_stride: Int32Array): void;
|
|
18
|
+
//# sourceMappingURL=superres.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superres.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/filter/superres.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;GAeG;AACH,6DARW,WAAW,EAAE,eACb,WAAW,EAAE,sBACb,UAAU,QA8DpB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { clamp } from "../../../../core/math/clamp.js";
|
|
2
|
+
import {
|
|
3
|
+
FILTER_BITS,
|
|
4
|
+
MI_SIZE,
|
|
5
|
+
SUPERRES_EXTRA_BITS,
|
|
6
|
+
SUPERRES_FILTER_OFFSET,
|
|
7
|
+
SUPERRES_FILTER_TAPS,
|
|
8
|
+
SUPERRES_SCALE_BITS,
|
|
9
|
+
SUPERRES_SCALE_MASK
|
|
10
|
+
} from "../tables/av1_symbols.js";
|
|
11
|
+
import { UPSCALE_FILTER } from "../tables/filter_tables.js";
|
|
12
|
+
import { round2 } from "../util/round2.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Horizontally upscale a superres frame.
|
|
16
|
+
*
|
|
17
|
+
* Superres codes a frame narrower than it is displayed and restores the width here, with an eight
|
|
18
|
+
* tap filter whose phase advances by a fixed fractional step per output sample. Only the horizontal
|
|
19
|
+
* axis is scaled: the vertical resolution is never reduced.
|
|
20
|
+
*
|
|
21
|
+
* @param {Av1FrameContext} ctx
|
|
22
|
+
* @param {Uint16Array[]} source planes at the coded width
|
|
23
|
+
* @param {Uint16Array[]} destination planes at the upscaled width
|
|
24
|
+
* @param {Int32Array} destination_stride
|
|
25
|
+
* @see AV1 spec 7.16 "Upscaling process"
|
|
26
|
+
*
|
|
27
|
+
* @author Alex Goldring
|
|
28
|
+
* @copyright Company Named Limited (c) 2026
|
|
29
|
+
*/
|
|
30
|
+
export function apply_superres(ctx, source, destination, destination_stride) {
|
|
31
|
+
const frame = ctx.frame;
|
|
32
|
+
|
|
33
|
+
const max_value = (1 << ctx.bit_depth) - 1;
|
|
34
|
+
|
|
35
|
+
for (let plane = 0; plane < ctx.num_planes; plane++) {
|
|
36
|
+
const sub_x = plane > 0 ? ctx.subsampling_x : 0;
|
|
37
|
+
const sub_y = plane > 0 ? ctx.subsampling_y : 0;
|
|
38
|
+
|
|
39
|
+
const downscaled_width = round2(frame.frame_width, sub_x);
|
|
40
|
+
const upscaled_width = round2(frame.upscaled_width, sub_x);
|
|
41
|
+
const plane_height = round2(frame.frame_height, sub_y);
|
|
42
|
+
|
|
43
|
+
const step_x = Math.trunc(((downscaled_width * (1 << SUPERRES_SCALE_BITS)) + Math.trunc(upscaled_width / 2)) / upscaled_width);
|
|
44
|
+
|
|
45
|
+
const error = upscaled_width * step_x - downscaled_width * (1 << SUPERRES_SCALE_BITS);
|
|
46
|
+
|
|
47
|
+
// both divisions truncate towards zero, and the first one's numerator is negative: the
|
|
48
|
+
// specification's integer division is truncating, not flooring
|
|
49
|
+
let initial_subpel_x = Math.trunc(
|
|
50
|
+
(-((upscaled_width - downscaled_width) * (1 << (SUPERRES_SCALE_BITS - 1))) + Math.trunc(upscaled_width / 2)) / upscaled_width
|
|
51
|
+
) + (1 << (SUPERRES_EXTRA_BITS - 1)) - Math.trunc(error / 2);
|
|
52
|
+
|
|
53
|
+
initial_subpel_x &= SUPERRES_SCALE_MASK;
|
|
54
|
+
|
|
55
|
+
const min_x = 0;
|
|
56
|
+
const max_x = ((ctx.mi_cols >> sub_x) * MI_SIZE) - 1;
|
|
57
|
+
|
|
58
|
+
const source_stride = ctx.plane_stride[plane];
|
|
59
|
+
const out_stride = destination_stride[plane];
|
|
60
|
+
|
|
61
|
+
const in_plane = source[plane];
|
|
62
|
+
const out_plane = destination[plane];
|
|
63
|
+
|
|
64
|
+
for (let y = 0; y < plane_height; y++) {
|
|
65
|
+
const source_row = y * source_stride;
|
|
66
|
+
const destination_row = y * out_stride;
|
|
67
|
+
|
|
68
|
+
for (let x = 0; x < upscaled_width; x++) {
|
|
69
|
+
const src_x = -(1 << SUPERRES_SCALE_BITS) + initial_subpel_x + x * step_x;
|
|
70
|
+
|
|
71
|
+
const src_x_px = src_x >> SUPERRES_SCALE_BITS;
|
|
72
|
+
const src_x_subpel = (src_x & SUPERRES_SCALE_MASK) >> SUPERRES_EXTRA_BITS;
|
|
73
|
+
|
|
74
|
+
let sum = 0;
|
|
75
|
+
|
|
76
|
+
for (let k = 0; k < SUPERRES_FILTER_TAPS; k++) {
|
|
77
|
+
const sample_x = clamp(src_x_px + (k - SUPERRES_FILTER_OFFSET), min_x, max_x);
|
|
78
|
+
|
|
79
|
+
sum += in_plane[source_row + sample_x] * UPSCALE_FILTER[src_x_subpel * SUPERRES_FILTER_TAPS + k];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
out_plane[destination_row + x] = clamp(round2(sum, FILTER_BITS), 0, max_value);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Width of the grain templates, in samples. The luma template is used at full width; the chroma
|
|
3
|
+
* templates use only the leading 44 columns when the chroma planes are subsampled horizontally.
|
|
4
|
+
* @type {number}
|
|
5
|
+
*/
|
|
6
|
+
export const GRAIN_STRIDE: number;
|
|
7
|
+
/**
|
|
8
|
+
* Height of the luma grain template, in samples.
|
|
9
|
+
* @type {number}
|
|
10
|
+
*/
|
|
11
|
+
export const GRAIN_ROWS: number;
|
|
12
|
+
/**
|
|
13
|
+
* Height of one noise stripe, in luma samples. Stripes advance 32 rows at a time, so the last two
|
|
14
|
+
* rows of each exist only to be blended into the first two of the next.
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
17
|
+
export const STRIPE_ROWS: number;
|
|
18
|
+
/**
|
|
19
|
+
* Working storage for film grain synthesis, allocated once and reused.
|
|
20
|
+
*
|
|
21
|
+
* The specification describes the process in terms of a noise image the size of the whole frame.
|
|
22
|
+
* Materialising that would cost three more planes, so this holds one stripe of noise and the two
|
|
23
|
+
* rows of the stripe before it that the vertical blend reads — which is all the process ever looks
|
|
24
|
+
* at, and is what the specification's own note suggests.
|
|
25
|
+
*
|
|
26
|
+
* @author Alex Goldring
|
|
27
|
+
* @copyright Company Named Limited (c) 2026
|
|
28
|
+
*/
|
|
29
|
+
export class FilmGrainState {
|
|
30
|
+
/** @type {Int16Array} the auto-regressively filtered luma template, `GRAIN_ROWS` x `GRAIN_STRIDE` */
|
|
31
|
+
luma_grain: Int16Array;
|
|
32
|
+
/** @type {Int16Array} */
|
|
33
|
+
cb_grain: Int16Array;
|
|
34
|
+
/** @type {Int16Array} */
|
|
35
|
+
cr_grain: Int16Array;
|
|
36
|
+
/** @type {Uint8Array} three planes of 256 entries, indexed `plane * 256 + value` */
|
|
37
|
+
scaling_lut: Uint8Array;
|
|
38
|
+
/** @type {Int16Array[]} the current stripe of noise, one buffer per plane */
|
|
39
|
+
stripe: Int16Array[];
|
|
40
|
+
/** @type {Int16Array[]} the trailing rows of the previous stripe, two per plane */
|
|
41
|
+
overlap: Int16Array[];
|
|
42
|
+
/**
|
|
43
|
+
* Distance between rows of {@link stripe} and {@link overlap}, in samples.
|
|
44
|
+
*
|
|
45
|
+
* Wider than the frame: the stripe is written in 32 sample blocks of which the last may start
|
|
46
|
+
* within the frame and end past its right edge. Those samples are never read, but they are
|
|
47
|
+
* written, so there has to be somewhere to put them.
|
|
48
|
+
* @type {number}
|
|
49
|
+
*/
|
|
50
|
+
stripe_stride: number;
|
|
51
|
+
/** @type {number} the 16 bit shift register the noise is drawn from */
|
|
52
|
+
random_register: number;
|
|
53
|
+
/** @type {number} */
|
|
54
|
+
grain_min: number;
|
|
55
|
+
/** @type {number} */
|
|
56
|
+
grain_max: number;
|
|
57
|
+
/**
|
|
58
|
+
* @param {number} frame_width
|
|
59
|
+
*/
|
|
60
|
+
resize(frame_width: number): void;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=FilmGrainState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilmGrainState.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/grain/FilmGrainState.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,2BAFU,MAAM,CAEe;AAE/B;;;GAGG;AACH,yBAFU,MAAM,CAEa;AAE7B;;;;GAIG;AACH,0BAFU,MAAM,CAEc;AAE9B;;;;;;;;;;GAUG;AACH;IACI,qGAAqG;IACrG,YADW,UAAU,CACkC;IAEvD,yBAAyB;IACzB,UADW,UAAU,CACgC;IAErD,yBAAyB;IACzB,UADW,UAAU,CACgC;IAErD,oFAAoF;IACpF,aADW,UAAU,CACiB;IAEtC,6EAA6E;IAC7E,QADW,UAAU,EAAE,CACK;IAE5B,mFAAmF;IACnF,SADW,UAAU,EAAE,CACM;IAE7B;;;;;;;OAOG;IACH,eAFU,MAAM,CAEE;IAElB,uEAAuE;IACvE,iBADW,MAAM,CACG;IAEpB,qBAAqB;IACrB,WADW,MAAM,CACH;IAEd,qBAAqB;IACrB,WADW,MAAM,CACH;IAEd;;OAEG;IACH,oBAFW,MAAM,QAehB;CACJ"}
|