@woosh/meep-engine 3.9.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -152
- package/build/bundle-worker-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/package.json +3 -2
- package/src/REVIEW_2026_08_06.md +610 -610
- 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/geom/3d/shape/ConvexHullShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/ConvexHullShape3D.js +28 -4
- 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.d.ts +26 -0
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/FrameGraph.js +947 -900
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +69 -81
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +83 -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/ShadeGPUCommandContext.d.ts +21 -0
- package/src/shade/device/ShadeGPUCommandContext.d.ts.map +1 -1
- package/src/shade/device/ShadeGPUCommandContext.js +940 -749
- package/src/shade/device/timing/GPUTimerArray.d.ts +22 -4
- package/src/shade/device/timing/GPUTimerArray.d.ts.map +1 -1
- package/src/shade/device/timing/GPUTimerArray.js +88 -14
- package/src/shade/device/timing/GPU_PROFILER_PROPOSAL_2026_08_28.md +876 -0
- package/src/shade/device/timing/profile/GPUFrameRecorder.d.ts +93 -0
- package/src/shade/device/timing/profile/GPUFrameRecorder.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUFrameRecorder.js +297 -0
- package/src/shade/device/timing/profile/GPUProfileCapture.d.ts +62 -0
- package/src/shade/device/timing/profile/GPUProfileCapture.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileCapture.js +77 -0
- package/src/shade/device/timing/profile/GPUProfileFrame.d.ts +73 -0
- package/src/shade/device/timing/profile/GPUProfileFrame.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileFrame.js +88 -0
- package/src/shade/device/timing/profile/GPUProfileLevel.d.ts +20 -0
- package/src/shade/device/timing/profile/GPUProfileLevel.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileLevel.js +50 -0
- package/src/shade/device/timing/profile/GPUProfileMeta.d.ts +63 -0
- package/src/shade/device/timing/profile/GPUProfileMeta.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileMeta.js +73 -0
- package/src/shade/device/timing/profile/GPUProfileSession.d.ts +173 -0
- package/src/shade/device/timing/profile/GPUProfileSession.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileSession.js +470 -0
- package/src/shade/device/timing/profile/GPUProfileSpan.d.ts +60 -0
- package/src/shade/device/timing/profile/GPUProfileSpan.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileSpan.js +65 -0
- package/src/shade/device/timing/profile/GPUProfileSpanKind.d.ts +19 -0
- package/src/shade/device/timing/profile/GPUProfileSpanKind.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileSpanKind.js +25 -0
- package/src/shade/device/timing/profile/GPUProfileTopology.d.ts +159 -0
- package/src/shade/device/timing/profile/GPUProfileTopology.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileTopology.js +202 -0
- package/src/shade/device/timing/profile/GPUProfileWork.d.ts +90 -0
- package/src/shade/device/timing/profile/GPUProfileWork.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileWork.js +115 -0
- package/src/shade/device/timing/profile/SGPTDefect.d.ts +43 -0
- package/src/shade/device/timing/profile/SGPTDefect.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPTDefect.js +65 -0
- package/src/shade/device/timing/profile/SGPTHeader.d.ts +38 -0
- package/src/shade/device/timing/profile/SGPTHeader.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPTHeader.js +46 -0
- package/src/shade/device/timing/profile/SGPTRecordRef.d.ts +37 -0
- package/src/shade/device/timing/profile/SGPTRecordRef.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPTRecordRef.js +45 -0
- package/src/shade/device/timing/profile/SGPTWriteStream.d.ts +103 -0
- package/src/shade/device/timing/profile/SGPTWriteStream.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPTWriteStream.js +287 -0
- package/src/shade/device/timing/profile/SGPT_DEFECT.d.ts +19 -0
- package/src/shade/device/timing/profile/SGPT_DEFECT.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_DEFECT.js +26 -0
- package/src/shade/device/timing/profile/SGPT_FLAG.d.ts +8 -0
- package/src/shade/device/timing/profile/SGPT_FLAG.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_FLAG.js +15 -0
- package/src/shade/device/timing/profile/SGPT_FORMAT.md +345 -0
- package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.d.ts +10 -0
- package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.js +9 -0
- package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.d.ts +17 -0
- package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.js +16 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.d.ts +16 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.js +15 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.d.ts +15 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.js +29 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.d.ts +7 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.js +6 -0
- package/src/shade/device/timing/profile/SGPT_MAGIC.d.ts +7 -0
- package/src/shade/device/timing/profile/SGPT_MAGIC.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_MAGIC.js +6 -0
- package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.d.ts +16 -0
- package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.js +15 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.d.ts +7 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.js +6 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.d.ts +13 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.js +23 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.d.ts +12 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.js +11 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.d.ts +18 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.js +46 -0
- package/src/shade/device/timing/profile/frame_graph_extract_topology.d.ts +20 -0
- package/src/shade/device/timing/profile/frame_graph_extract_topology.d.ts.map +1 -0
- package/src/shade/device/timing/profile/frame_graph_extract_topology.js +174 -0
- package/src/shade/device/timing/profile/make_profiling_pass_encoder.d.ts +21 -0
- package/src/shade/device/timing/profile/make_profiling_pass_encoder.d.ts.map +1 -0
- package/src/shade/device/timing/profile/make_profiling_pass_encoder.js +114 -0
- package/src/shade/device/timing/profile/parse_workgroup_size.d.ts +20 -0
- package/src/shade/device/timing/profile/parse_workgroup_size.d.ts.map +1 -0
- package/src/shade/device/timing/profile/parse_workgroup_size.js +43 -0
- package/src/shade/device/timing/profile/sgpt_fourcc.d.ts +18 -0
- package/src/shade/device/timing/profile/sgpt_fourcc.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_fourcc.js +34 -0
- package/src/shade/device/timing/profile/sgpt_frame_codec.d.ts +42 -0
- package/src/shade/device/timing/profile/sgpt_frame_codec.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_frame_codec.js +172 -0
- package/src/shade/device/timing/profile/sgpt_meta_codec.d.ts +20 -0
- package/src/shade/device/timing/profile/sgpt_meta_codec.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_meta_codec.js +65 -0
- package/src/shade/device/timing/profile/sgpt_read_capture.d.ts +19 -0
- package/src/shade/device/timing/profile/sgpt_read_capture.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_read_capture.js +134 -0
- package/src/shade/device/timing/profile/sgpt_read_header.d.ts +22 -0
- package/src/shade/device/timing/profile/sgpt_read_header.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_read_header.js +94 -0
- package/src/shade/device/timing/profile/sgpt_read_records.d.ts +27 -0
- package/src/shade/device/timing/profile/sgpt_read_records.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_read_records.js +153 -0
- package/src/shade/device/timing/profile/sgpt_topology_codec.d.ts +54 -0
- package/src/shade/device/timing/profile/sgpt_topology_codec.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_topology_codec.js +329 -0
- package/src/shade/device/timing/profile/sgpt_write_header.d.ts +22 -0
- package/src/shade/device/timing/profile/sgpt_write_header.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_write_header.js +47 -0
- package/src/shade/device/timing/profile/sgpt_write_record.d.ts +23 -0
- package/src/shade/device/timing/profile/sgpt_write_record.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_write_record.js +62 -0
- package/src/shade/renderer/Renderer.d.ts +21 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +2513 -2455
- 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
- package/src/engine/save/GameStateLoader.d.ts +0 -49
- package/src/engine/save/GameStateLoader.d.ts.map +0 -1
- package/src/engine/save/GameStateLoader.js +0 -168
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { Av1BlockSnapshot } from "./Av1BlockSnapshot.js";
|
|
2
|
+
import { DECODE_FAST } from "./decode_effort.js";
|
|
3
|
+
import { Av1FrameContext } from "../decode/Av1FrameContext.js";
|
|
4
|
+
import { ColourTransform } from "../../color/ColourTransform.js";
|
|
5
|
+
import { SymbolWriter } from "../entropy/SymbolWriter.js";
|
|
6
|
+
import { FrameHeader } from "../obu/FrameHeader.js";
|
|
7
|
+
import { INTRA_MODES } from "../tables/av1_symbols.js";
|
|
8
|
+
import { SequenceHeader } from "../obu/SequenceHeader.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Largest transform this encoder emits, in samples along one side.
|
|
12
|
+
* @type {number}
|
|
13
|
+
*/
|
|
14
|
+
const MAX_TRANSFORM = 32;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Three views of the same length over one allocation, laid end to end.
|
|
18
|
+
*
|
|
19
|
+
* Per-plane scratch is asked for one plane at a time and in order, so putting the three next to
|
|
20
|
+
* each other in memory is worth doing on purpose: three separately allocated typed arrays are three
|
|
21
|
+
* objects the heap may put anywhere, and the encoder walks all three of them for every block.
|
|
22
|
+
*
|
|
23
|
+
* @param {Function} kind the typed array constructor
|
|
24
|
+
* @param {number} length entries per plane
|
|
25
|
+
* @returns {Array} three views
|
|
26
|
+
*/
|
|
27
|
+
function plane_views(kind, length) {
|
|
28
|
+
const buffer = new ArrayBuffer(length * kind.BYTES_PER_ELEMENT * 3);
|
|
29
|
+
|
|
30
|
+
return [
|
|
31
|
+
new kind(buffer, 0, length),
|
|
32
|
+
new kind(buffer, length * kind.BYTES_PER_ELEMENT, length),
|
|
33
|
+
new kind(buffer, length * kind.BYTES_PER_ELEMENT * 2, length)
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Fields of {@link Av1EncodeContext#decisions}, in the order they are laid out.
|
|
39
|
+
* @type {number}
|
|
40
|
+
*/
|
|
41
|
+
export const DECISION_Y_MODE = 0;
|
|
42
|
+
|
|
43
|
+
/** @type {number} */
|
|
44
|
+
export const DECISION_UV_MODE = 1;
|
|
45
|
+
|
|
46
|
+
/** @type {number} */
|
|
47
|
+
export const DECISION_SKIP = 2;
|
|
48
|
+
|
|
49
|
+
/** @type {number} */
|
|
50
|
+
export const DECISION_TX_TYPE = 3;
|
|
51
|
+
|
|
52
|
+
/** @type {number} */
|
|
53
|
+
export const DECISION_TX_SIZE = 4;
|
|
54
|
+
|
|
55
|
+
/** @type {number} */
|
|
56
|
+
const DECISION_FIELDS = 5;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Depths a partition is recorded at: a superblock is 64x64 and the smallest block is 4x4, so a node
|
|
60
|
+
* sits at one of 64, 32, 16, 8 or 4.
|
|
61
|
+
* @type {number}
|
|
62
|
+
*/
|
|
63
|
+
const PARTITION_DEPTHS = 5;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Everything an encode needs on top of what a decode does.
|
|
67
|
+
*
|
|
68
|
+
* The frame context is the decoder's, unchanged: an encoder has to hold the *reconstruction* — what
|
|
69
|
+
* the decoder will end up with — because that is what the next block predicts from. Keeping the same
|
|
70
|
+
* struct means the two cannot drift apart in what they think a plane or a context is.
|
|
71
|
+
*
|
|
72
|
+
* @author Alex Goldring
|
|
73
|
+
* @copyright Company Named Limited (c) 2026
|
|
74
|
+
*/
|
|
75
|
+
export class Av1EncodeContext {
|
|
76
|
+
/** @type {Av1FrameContext} holds the reconstruction, the contexts and the symbol writer */
|
|
77
|
+
frame_context = new Av1FrameContext();
|
|
78
|
+
|
|
79
|
+
/** @type {SequenceHeader} */
|
|
80
|
+
sequence = new SequenceHeader();
|
|
81
|
+
|
|
82
|
+
/** @type {FrameHeader} */
|
|
83
|
+
frame = new FrameHeader();
|
|
84
|
+
|
|
85
|
+
/** @type {Uint16Array[]} the picture being encoded, padded out to the mode info grid */
|
|
86
|
+
source = [null, null, null];
|
|
87
|
+
|
|
88
|
+
/** @type {Int32Array} */
|
|
89
|
+
source_stride = new Int32Array(3);
|
|
90
|
+
|
|
91
|
+
/** @type {Int32Array} residual, then coefficients */
|
|
92
|
+
residual = new Int32Array(MAX_TRANSFORM * MAX_TRANSFORM);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Quantised levels of the transform block being coded, one view per plane.
|
|
96
|
+
*
|
|
97
|
+
* A plane of one block holds as many levels as it has samples however it is cut into transform
|
|
98
|
+
* blocks — sixty-four four by fours or one thirty-two by thirty-two come to the same thousand
|
|
99
|
+
* and twenty-four — so one buffer per plane covers every transform size the encoder can pick,
|
|
100
|
+
* with each transform block's levels laid end to end.
|
|
101
|
+
*
|
|
102
|
+
* The three are views into one allocation, laid out in the order they are used. Three separate
|
|
103
|
+
* typed arrays would be three separate objects on the heap with nothing keeping them near each
|
|
104
|
+
* other; one buffer keeps a block's whole working set inside a page.
|
|
105
|
+
* @type {Int32Array[]}
|
|
106
|
+
*/
|
|
107
|
+
levels = plane_views(Int32Array, MAX_TRANSFORM * MAX_TRANSFORM);
|
|
108
|
+
|
|
109
|
+
/** @type {Int32Array} whether each plane's chosen levels are all zero */
|
|
110
|
+
chosen_empty = new Int32Array(3);
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @type {number} squared error in the coefficient domain that the last quantised transform
|
|
114
|
+
* block cost, which is what a trial reads instead of reconstructing to find out
|
|
115
|
+
*/
|
|
116
|
+
quantised_error = 0;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @type {number} `1` to measure a trial's loss by reconstructing it and subtracting the source,
|
|
120
|
+
* rather than by reading it off the quantiser. Slower by the price of an inverse transform per
|
|
121
|
+
* candidate, and here to keep the cheap answer honest
|
|
122
|
+
*/
|
|
123
|
+
exact_trial_distortion = 0;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @type {number} `1` while a plane is being coded only so that what comes after it can see the
|
|
127
|
+
* reconstruction, which is the one time a trial has to build one
|
|
128
|
+
*/
|
|
129
|
+
materialising = 0;
|
|
130
|
+
|
|
131
|
+
/** @type {number} the transform type the block's luma residual is coded with */
|
|
132
|
+
luma_tx_type = 0;
|
|
133
|
+
|
|
134
|
+
/** @type {number} what the winning luma mode's plane cost, which the transform search starts from */
|
|
135
|
+
chosen_plane_cost = 0;
|
|
136
|
+
|
|
137
|
+
/** @type {number} whether the plane the last trial priced quantised to nothing */
|
|
138
|
+
trial_empty = 1;
|
|
139
|
+
|
|
140
|
+
/** @type {number} the same, for the U plane, which the chroma decision prices before the V */
|
|
141
|
+
trial_empty_u = 1;
|
|
142
|
+
|
|
143
|
+
/** @type {Int32Array} candidate prediction modes, best-predicting first */
|
|
144
|
+
mode_order = new Int32Array(INTRA_MODES);
|
|
145
|
+
|
|
146
|
+
/** @type {Float64Array} the squared prediction error each entry of {@link mode_order} scored */
|
|
147
|
+
mode_error = new Float64Array(INTRA_MODES);
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Writers that price rather than emit, one per level of the search that nests inside another.
|
|
151
|
+
*
|
|
152
|
+
* The same class as the one that writes the bitstream, in its costing mode: the coefficient
|
|
153
|
+
* writer is handed one or the other, and it is the hottest function in the encoder, so what it
|
|
154
|
+
* sees at that call site has to be one shape rather than two.
|
|
155
|
+
* @type {SymbolWriter}
|
|
156
|
+
*/
|
|
157
|
+
cost_writer = new SymbolWriter();
|
|
158
|
+
|
|
159
|
+
/** @type {SymbolWriter} prices a whole block, which nests around {@link cost_writer} */
|
|
160
|
+
block_cost_writer = new SymbolWriter();
|
|
161
|
+
|
|
162
|
+
/** @type {SymbolWriter} prices a partition symbol, which nests around both */
|
|
163
|
+
partition_cost_writer = new SymbolWriter();
|
|
164
|
+
|
|
165
|
+
/** @type {number} the dequantiser the last quantised block's DC will be multiplied back up by */
|
|
166
|
+
step_dc = 1;
|
|
167
|
+
|
|
168
|
+
/** @type {number} and its AC */
|
|
169
|
+
step_ac = 1;
|
|
170
|
+
|
|
171
|
+
/** @type {number} and what the dequantiser divides by afterwards */
|
|
172
|
+
step_denominator = 1;
|
|
173
|
+
|
|
174
|
+
/** @type {number} squared error the block being priced would leave behind */
|
|
175
|
+
block_distortion = 0;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Saved state a partition decision can be put back to.
|
|
179
|
+
*
|
|
180
|
+
* One for the superblock, whose search has to be undone in full before the winning tree is
|
|
181
|
+
* written, and then two for each depth that decides anything — the state before any answer was
|
|
182
|
+
* tried, and the state the best answer so far left, so that answer does not have to be made
|
|
183
|
+
* again when it turns out to have won. Blocks run 32x32 down to 8x8 and each of those three
|
|
184
|
+
* decides, so seven is the whole of it.
|
|
185
|
+
* @type {Av1BlockSnapshot[]}
|
|
186
|
+
*/
|
|
187
|
+
snapshots = [
|
|
188
|
+
new Av1BlockSnapshot(),
|
|
189
|
+
new Av1BlockSnapshot(),
|
|
190
|
+
new Av1BlockSnapshot(),
|
|
191
|
+
new Av1BlockSnapshot(),
|
|
192
|
+
new Av1BlockSnapshot(),
|
|
193
|
+
new Av1BlockSnapshot(),
|
|
194
|
+
new Av1BlockSnapshot()
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* What the search settled on, for the whole frame: one entry per 4x4 position per field.
|
|
199
|
+
*
|
|
200
|
+
* Frame-wide rather than a superblock at a time because the writing pass may have to run twice.
|
|
201
|
+
* Loop restoration is chosen from the finished, filtered picture and coded per superblock
|
|
202
|
+
* *inside* the tile, so the only way to write it is to code the tile once, look at what came
|
|
203
|
+
* out, and then code it again from the same decisions.
|
|
204
|
+
* @type {Uint8Array}
|
|
205
|
+
*/
|
|
206
|
+
decisions = new Uint8Array(0);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* How far apart the fields of {@link decisions} are, which is one frame of 4x4 positions.
|
|
210
|
+
* @type {number}
|
|
211
|
+
*/
|
|
212
|
+
decision_stride = 0;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Which partition the search chose at each node, by depth and corner, for the whole frame.
|
|
216
|
+
*
|
|
217
|
+
* Not in the snapshot, because a node writes only its own entry and a losing branch's children
|
|
218
|
+
* are never read: the writing pass descends only where the parent says it split.
|
|
219
|
+
* @type {Uint8Array}
|
|
220
|
+
*/
|
|
221
|
+
partitions = new Uint8Array(0);
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* How many of the eight uneven partitions are searched, in the order they are worth asking
|
|
225
|
+
* about: the two halves, then the four T-shapes, then the two quarterings.
|
|
226
|
+
*
|
|
227
|
+
* Each is another whole subtree to price and they are gated on the whole and the quartered
|
|
228
|
+
* answers being close, so this is a knob rather than a fact.
|
|
229
|
+
* @type {number}
|
|
230
|
+
*/
|
|
231
|
+
uneven_partitions = 2;
|
|
232
|
+
|
|
233
|
+
/** @type {Int32Array} scratch for the Walsh-Hadamard pair */
|
|
234
|
+
scratch = new Int32Array(4);
|
|
235
|
+
|
|
236
|
+
/** @type {number} the quantiser step the frame's decisions are measured against */
|
|
237
|
+
quantiser_step = 1;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Squared error the encoder will give up to save one bit.
|
|
241
|
+
*
|
|
242
|
+
* The slope of the rate-distortion curve at this quantiser: a decision is taken when
|
|
243
|
+
* `distortion + lambda * rate` falls, which is the Lagrangian that makes "smaller" and "better"
|
|
244
|
+
* one number rather than two. Set per frame by {@link encode_av1_still} from the quantiser step,
|
|
245
|
+
* because the trade is worth more where the quantiser is coarse.
|
|
246
|
+
*
|
|
247
|
+
* In squared error per {@link COST_ONE_BIT} of rate, so that the rate the cost writer reports
|
|
248
|
+
* can be used without scaling it first.
|
|
249
|
+
* @type {number}
|
|
250
|
+
*/
|
|
251
|
+
lambda = 1;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @type {Uint16Array[]} the reconstruction before any in-loop filter, so that a filter strength
|
|
255
|
+
* can be tried, measured and taken back
|
|
256
|
+
*/
|
|
257
|
+
unfiltered = [null, null, null];
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* How many deblocking levels are measured before refining around the best of them.
|
|
261
|
+
*
|
|
262
|
+
* Zero signals no deblocking at all, which is what this encoder did before it could measure.
|
|
263
|
+
* @type {number}
|
|
264
|
+
*/
|
|
265
|
+
filter_trials = 7;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* How many directional filter strengths are measured.
|
|
269
|
+
*
|
|
270
|
+
* One pass over the frame measures one candidate for luma and one for chroma at once, because
|
|
271
|
+
* the two are independent — a strength touches only its own planes. Zero signals no directional
|
|
272
|
+
* filter at all.
|
|
273
|
+
*
|
|
274
|
+
* Three rather than the whole ladder: each is a pass over the frame, and because the ladder is
|
|
275
|
+
* ordered to spread rather than to crowd the weak end, three of them come within a percent of
|
|
276
|
+
* all twelve and cost a third of what they do.
|
|
277
|
+
* @type {number}
|
|
278
|
+
*/
|
|
279
|
+
cdef_trials = 3;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Size the filter scratch for a frame, allocating only what has grown.
|
|
283
|
+
*
|
|
284
|
+
* @param {Av1FrameContext} ctx
|
|
285
|
+
*/
|
|
286
|
+
resize_filters(ctx) {
|
|
287
|
+
for (let plane = 0; plane < ctx.num_planes; plane++) {
|
|
288
|
+
const samples = ctx.plane_stride[plane] * ctx.plane_rows[plane];
|
|
289
|
+
|
|
290
|
+
const existing = this.unfiltered[plane];
|
|
291
|
+
|
|
292
|
+
if (existing === null || existing.length < samples) {
|
|
293
|
+
this.unfiltered[plane] = new Uint16Array(samples);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Make room for the restoration fit: one plane of intermediates, one unit index per 4x4 block,
|
|
300
|
+
* and the normal equations of every unit at once.
|
|
301
|
+
*
|
|
302
|
+
* @param {Av1FrameContext} ctx
|
|
303
|
+
*/
|
|
304
|
+
resize_restoration(ctx) {
|
|
305
|
+
let samples = 0;
|
|
306
|
+
|
|
307
|
+
for (let plane = 0; plane < ctx.num_planes; plane++) {
|
|
308
|
+
samples = Math.max(samples, ctx.plane_stride[plane] * ctx.plane_rows[plane]);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (this.restoration_middle.length < samples) {
|
|
312
|
+
this.restoration_middle = new Float32Array(samples);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const blocks = ((ctx.plane_stride[0] >> 2) + 1) * ((ctx.plane_rows[0] >> 2) + 1);
|
|
316
|
+
|
|
317
|
+
if (this.restoration_map.length < blocks) {
|
|
318
|
+
this.restoration_map = new Int32Array(blocks);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const units = 3 * ctx.lr_unit_rows * ctx.lr_unit_stride;
|
|
322
|
+
|
|
323
|
+
if (this.restoration_stats.length < units * 12) {
|
|
324
|
+
this.restoration_stats = new Float64Array(units * 12);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (this.restoration_errors.length < units * 2) {
|
|
328
|
+
this.restoration_errors = new Float64Array(units * 2);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** @type {Float32Array} one plane, with one direction's taps run over it */
|
|
333
|
+
restoration_middle = new Float32Array(0);
|
|
334
|
+
|
|
335
|
+
/** @type {Int32Array} which restoration unit each 4x4 block of a plane belongs to */
|
|
336
|
+
restoration_map = new Int32Array(0);
|
|
337
|
+
|
|
338
|
+
/** @type {Float64Array} the normal equations of every unit: nine of a matrix, then three of a
|
|
339
|
+
* right hand side */
|
|
340
|
+
restoration_stats = new Float64Array(0);
|
|
341
|
+
|
|
342
|
+
/** @type {Float64Array} squared error per unit, with the filter and without it */
|
|
343
|
+
restoration_errors = new Float64Array(0);
|
|
344
|
+
|
|
345
|
+
/** @type {Int32Array} three coded taps expanded into the seven of a symmetric filter */
|
|
346
|
+
restoration_taps = new Int32Array(7);
|
|
347
|
+
|
|
348
|
+
/** @type {Float64Array} the three sums one sample contributes to a fit */
|
|
349
|
+
restoration_basis = new Float64Array(3);
|
|
350
|
+
|
|
351
|
+
/** @type {Float64Array} the augmented matrix a unit's fit is eliminated in */
|
|
352
|
+
restoration_system = new Float64Array(12);
|
|
353
|
+
|
|
354
|
+
/** @type {Float64Array} the taps it comes out with, before they are rounded and clamped */
|
|
355
|
+
restoration_solution = new Float64Array(3);
|
|
356
|
+
|
|
357
|
+
/** @type {Int8Array} one plane's reference taps, put back after a unit is priced */
|
|
358
|
+
restoration_reference = new Int8Array(6);
|
|
359
|
+
|
|
360
|
+
/** @type {SymbolWriter} prices a restoration unit by writing its real syntax */
|
|
361
|
+
restoration_writer = new SymbolWriter();
|
|
362
|
+
|
|
363
|
+
/** @type {number} restoration units down the frame, for the plane being fitted */
|
|
364
|
+
restoration_rows = 0;
|
|
365
|
+
|
|
366
|
+
/** @type {number} and across it */
|
|
367
|
+
restoration_columns = 0;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* How many times the restoration fit alternates between the two directions.
|
|
371
|
+
*
|
|
372
|
+
* The first round fits the horizontal taps against the picture as it is and the vertical ones
|
|
373
|
+
* against what those left; a second round refits both against each other and is where the fit
|
|
374
|
+
* settles. Zero asks for no restoration at all, which is what a frame gets when the filter
|
|
375
|
+
* would cost more than it saves everywhere.
|
|
376
|
+
* @type {number}
|
|
377
|
+
*/
|
|
378
|
+
restoration_trials = 2;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* How large a restoration unit is: zero for sixty-four samples, one for a hundred and
|
|
382
|
+
* twenty-eight, two for two hundred and fifty-six.
|
|
383
|
+
*
|
|
384
|
+
* A unit's taps cost thirty or forty bits whatever it covers, so the smallest units are the
|
|
385
|
+
* most adapted and the least affordable — on a small picture sixty-four sample units would
|
|
386
|
+
* spend a tenth of the file describing filters. Two hundred and fifty-six is where the cost
|
|
387
|
+
* disappears and most of the gain is still there.
|
|
388
|
+
* @type {number}
|
|
389
|
+
*/
|
|
390
|
+
restoration_unit_shift = 2;
|
|
391
|
+
|
|
392
|
+
/** @type {number} how many planes are offered a restoration filter */
|
|
393
|
+
restoration_planes = 3;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Which in-loop filters the file asks the reader to run: one of the `DECODE_*` constants.
|
|
397
|
+
*
|
|
398
|
+
* The other axis to effort, and an unrelated one — this one spends the *reader's* time rather
|
|
399
|
+
* than this machine's. See {@link decode_effort.js} for what each setting costs and buys, and
|
|
400
|
+
* for why a codec that exists to load textures defaults to the fast one.
|
|
401
|
+
* @type {number}
|
|
402
|
+
*/
|
|
403
|
+
decode_effort = DECODE_FAST;
|
|
404
|
+
|
|
405
|
+
/** @type {ColourTransform} how the caller's RGB becomes the planes this codes */
|
|
406
|
+
transform = new ColourTransform();
|
|
407
|
+
|
|
408
|
+
/** @type {Float32Array} one row of interleaved RGB, at the padded width */
|
|
409
|
+
rgb_row = null;
|
|
410
|
+
|
|
411
|
+
/** @type {Float32Array} */
|
|
412
|
+
cb_row = null;
|
|
413
|
+
|
|
414
|
+
/** @type {Float32Array} */
|
|
415
|
+
cr_row = null;
|
|
416
|
+
|
|
417
|
+
/** @type {Float32Array} one chroma row being averaged into */
|
|
418
|
+
chroma_blue = null;
|
|
419
|
+
|
|
420
|
+
/** @type {Float32Array} */
|
|
421
|
+
chroma_red = null;
|
|
422
|
+
|
|
423
|
+
/** @type {Float32Array} */
|
|
424
|
+
chroma_weight = null;
|
|
425
|
+
|
|
426
|
+
/** @type {number} */
|
|
427
|
+
row_width = 0;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @param {number} width the padded width, in luma samples
|
|
431
|
+
*/
|
|
432
|
+
resize_rows(width) {
|
|
433
|
+
if (this.row_width >= width) {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
this.row_width = width;
|
|
438
|
+
|
|
439
|
+
this.rgb_row = new Float32Array(width * 3);
|
|
440
|
+
this.cb_row = new Float32Array(width);
|
|
441
|
+
this.cr_row = new Float32Array(width);
|
|
442
|
+
|
|
443
|
+
this.chroma_blue = new Float32Array(width);
|
|
444
|
+
this.chroma_red = new Float32Array(width);
|
|
445
|
+
this.chroma_weight = new Float32Array(width);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* How far a coefficient must be past a quantiser step before it is coded at all, as a fraction
|
|
450
|
+
* of the step.
|
|
451
|
+
*
|
|
452
|
+
* Below one half this is a dead zone: it costs a little accuracy on coefficients that were
|
|
453
|
+
* nearly zero anyway, and saves a great many bits, because a coefficient that quantises to zero
|
|
454
|
+
* costs almost nothing to code.
|
|
455
|
+
*
|
|
456
|
+
* Nine twentieths of a step, which is where it measures best. It is also, now, the *only* thing
|
|
457
|
+
* deciding: an encoder that also priced the last few coefficients against what coding them cost,
|
|
458
|
+
* and dropped the ones that did not pay, measured half a per cent *worse* than this and took
|
|
459
|
+
* five times as long over the coefficient syntax. See D35.
|
|
460
|
+
* @type {number}
|
|
461
|
+
*/
|
|
462
|
+
rounding = 0.45;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* What a split costs at the very least, in bits, below which one is not looked for.
|
|
466
|
+
*
|
|
467
|
+
* Splitting a block into four writes a partition symbol and then, per quarter, a skip flag and
|
|
468
|
+
* a luma and a chroma mode — a dozen bits before a single coefficient. So a block already
|
|
469
|
+
* costing less than a dozen bits' worth of squared error cannot be improved by splitting it,
|
|
470
|
+
* whatever the four quarters would do, and the whole subtree under it can go unsearched.
|
|
471
|
+
*
|
|
472
|
+
* That is nearly a proof rather than a heuristic; the "nearly" is that the dozen is a count of
|
|
473
|
+
* symbols rather than a floor on what those symbols cost in this block's contexts. Raising it
|
|
474
|
+
* trades compression for speed, and it is the first knob to reach for.
|
|
475
|
+
* @type {number}
|
|
476
|
+
*/
|
|
477
|
+
split_floor = 12;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* How close the whole and the quartered answers must be before the halves are searched too.
|
|
481
|
+
*
|
|
482
|
+
* A half is the answer between a whole and a quarter, so it is worth asking about exactly when
|
|
483
|
+
* those two are close. When one wins outright the picture has already said whether the detail
|
|
484
|
+
* here is worth another partition symbol, and two more subtrees will not change its mind —
|
|
485
|
+
* while each costs as much again as the unsplit answer did. One turns the rectangles off; a
|
|
486
|
+
* large number searches them always.
|
|
487
|
+
* @type {number}
|
|
488
|
+
*/
|
|
489
|
+
rectangle_margin = 1.2;
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* {@link lambda} as a multiple of the squared quantiser step.
|
|
493
|
+
*
|
|
494
|
+
* The constant in the usual relation between a quantiser and the slope of the rate-distortion
|
|
495
|
+
* curve, and it has to be measured rather than derived: the step it multiplies is the
|
|
496
|
+
* *transform-domain* dequantiser, the distortion it converts to is in samples, and the ratio
|
|
497
|
+
* between those depends on the transform's gain.
|
|
498
|
+
*
|
|
499
|
+
* Measured as the encoder's own slope — encode at two quantisers, divide the change in squared
|
|
500
|
+
* error over the coded planes by the change in coded bits — which comes out at this value to
|
|
501
|
+
* within a sixth across photographic and synthetic pictures and across three decades of
|
|
502
|
+
* quantiser. That is a property of the format's quantiser tables, not of the pictures.
|
|
503
|
+
* @type {number}
|
|
504
|
+
*/
|
|
505
|
+
lambda_scale = 0.0016;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* How many prediction modes are priced properly, out of the thirteen.
|
|
509
|
+
*
|
|
510
|
+
* Every candidate is predicted and ranked by how close its prediction lands; only this many are
|
|
511
|
+
* then transformed, quantised and costed. The ranking is nearly free and the pricing is not, and
|
|
512
|
+
* the mode that wins on rate and distortion is almost always among the two or three that
|
|
513
|
+
* predicted best. Raising this is the quality-for-time knob; two is a sensible floor and
|
|
514
|
+
* thirteen is an exhaustive search.
|
|
515
|
+
* @type {number}
|
|
516
|
+
*/
|
|
517
|
+
mode_trials = 3;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* How many transforms beyond the plain DCT the block's luma residual is tried against.
|
|
521
|
+
*
|
|
522
|
+
* Zero codes every block with a DCT, which is what the format's larger transform sizes allow
|
|
523
|
+
* anyway. Three is the whole of what {@link forward_transform_2d} can build a matrix for.
|
|
524
|
+
* @type {number}
|
|
525
|
+
*/
|
|
526
|
+
transform_trials = 3;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* How many transform sizes the block's luma is tried at, largest first.
|
|
530
|
+
*
|
|
531
|
+
* One takes the largest the block allows, which is what the format calls largest-transform mode
|
|
532
|
+
* and is what this encoder did before it could ask. Each step after that halves again, and the
|
|
533
|
+
* returns fall away quickly: the first is worth 1.7% and the second 0.6%.
|
|
534
|
+
* @type {number}
|
|
535
|
+
*/
|
|
536
|
+
transform_depths = 3;
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Make room for a frame's worth of decisions.
|
|
541
|
+
*
|
|
542
|
+
* The five fields live end to end in one array rather than in five of their own, because they
|
|
543
|
+
* are read together, one position at a time, by the writing pass.
|
|
544
|
+
*
|
|
545
|
+
* @param {number} mi_count 4x4 positions in the frame
|
|
546
|
+
*/
|
|
547
|
+
resize_decisions(mi_count) {
|
|
548
|
+
if (this.decisions.length < mi_count * DECISION_FIELDS) {
|
|
549
|
+
this.decisions = new Uint8Array(mi_count * DECISION_FIELDS);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
this.decision_stride = mi_count;
|
|
553
|
+
|
|
554
|
+
if (this.partitions.length < mi_count * PARTITION_DEPTHS) {
|
|
555
|
+
this.partitions = new Uint8Array(mi_count * PARTITION_DEPTHS);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* @param {number} width
|
|
561
|
+
* @param {number} height
|
|
562
|
+
* @param {number} subsampling_x
|
|
563
|
+
* @param {number} subsampling_y
|
|
564
|
+
* @param {number} num_planes
|
|
565
|
+
*/
|
|
566
|
+
resize_source(width, height, subsampling_x, subsampling_y, num_planes) {
|
|
567
|
+
for (let plane = 0; plane < 3; plane++) {
|
|
568
|
+
if (plane >= num_planes) {
|
|
569
|
+
this.source[plane] = null;
|
|
570
|
+
this.source_stride[plane] = 0;
|
|
571
|
+
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
const sub_x = plane > 0 ? subsampling_x : 0;
|
|
576
|
+
const sub_y = plane > 0 ? subsampling_y : 0;
|
|
577
|
+
|
|
578
|
+
const stride = (width + sub_x) >> sub_x;
|
|
579
|
+
const rows = (height + sub_y) >> sub_y;
|
|
580
|
+
|
|
581
|
+
this.source_stride[plane] = stride;
|
|
582
|
+
|
|
583
|
+
const existing = this.source[plane];
|
|
584
|
+
|
|
585
|
+
if (existing === null || existing.length < stride * rows) {
|
|
586
|
+
this.source[plane] = new Uint16Array(stride * rows);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fill in a sequence header for a still picture.
|
|
3
|
+
*
|
|
4
|
+
* `reduced_still_picture_header` is set, which is what it exists for: it drops every field about
|
|
5
|
+
* timing, operating points and reference frames, none of which a single coded picture has.
|
|
6
|
+
*
|
|
7
|
+
* @param {SequenceHeader} sequence
|
|
8
|
+
* @param {object} options
|
|
9
|
+
* @param {number} options.width
|
|
10
|
+
* @param {number} options.height
|
|
11
|
+
* @param {number} options.bit_depth
|
|
12
|
+
* @param {number} options.monochrome
|
|
13
|
+
* @param {number} options.subsampling_x
|
|
14
|
+
* @param {number} options.subsampling_y
|
|
15
|
+
* @param {number} [options.color_primaries]
|
|
16
|
+
* @param {number} [options.transfer_characteristics]
|
|
17
|
+
* @param {number} [options.matrix_coefficients]
|
|
18
|
+
* @param {number} [options.color_range]
|
|
19
|
+
* @see AV1 spec 5.5.1 "General sequence header OBU syntax"
|
|
20
|
+
*
|
|
21
|
+
* @author Alex Goldring
|
|
22
|
+
* @copyright Company Named Limited (c) 2026
|
|
23
|
+
*/
|
|
24
|
+
export function build_sequence_header(sequence: SequenceHeader, options: {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
bit_depth: number;
|
|
28
|
+
monochrome: number;
|
|
29
|
+
subsampling_x: number;
|
|
30
|
+
subsampling_y: number;
|
|
31
|
+
color_primaries?: number;
|
|
32
|
+
transfer_characteristics?: number;
|
|
33
|
+
matrix_coefficients?: number;
|
|
34
|
+
color_range?: number;
|
|
35
|
+
}): void;
|
|
36
|
+
/**
|
|
37
|
+
* Fill in a frame header for a still picture.
|
|
38
|
+
*
|
|
39
|
+
* @param {FrameHeader} frame
|
|
40
|
+
* @param {SequenceHeader} sequence
|
|
41
|
+
* @param {object} options
|
|
42
|
+
* @param {number} options.base_q_idx
|
|
43
|
+
* @param {number} options.restoration_unit_shift how large a loop restoration unit is
|
|
44
|
+
* @see AV1 spec 5.9.2 "Uncompressed header syntax"
|
|
45
|
+
*/
|
|
46
|
+
export function build_frame_header(frame: FrameHeader, sequence: SequenceHeader, options: {
|
|
47
|
+
base_q_idx: number;
|
|
48
|
+
restoration_unit_shift: number;
|
|
49
|
+
}): void;
|
|
50
|
+
//# sourceMappingURL=build_headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build_headers.d.ts","sourceRoot":"","sources":["../../../../../../src/avif/native/av1/encode/build_headers.js"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAf2B,KAAK,EAArB,MAAM;IACU,MAAM,EAAtB,MAAM;IACU,SAAS,EAAzB,MAAM;IACU,UAAU,EAA1B,MAAM;IACU,aAAa,EAA7B,MAAM;IACU,aAAa,EAA7B,MAAM;IACW,eAAe,GAAhC,MAAM;IACW,wBAAwB,GAAzC,MAAM;IACW,mBAAmB,GAApC,MAAM;IACW,WAAW,GAA5B,MAAM;SAqFhB;AA6BD;;;;;;;;;GASG;AACH;IAJ2B,UAAU,EAA1B,MAAM;IACU,sBAAsB,EAAtC,MAAM;SA6HhB"}
|