@woosh/meep-engine 3.79.0 → 3.80.1
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/CHANGELOG.md +62 -3
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts +45 -0
- package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts.map +1 -0
- package/src/format/image/webp/vp8/VP8BoolDecoder.js +137 -0
- package/src/format/image/webp/vp8/vp8_decode.d.ts +21 -0
- package/src/format/image/webp/vp8/vp8_decode.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_decode.js +756 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.d.ts +31 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.js +189 -0
- package/src/format/image/webp/vp8/vp8_predict.d.ts +48 -0
- package/src/format/image/webp/vp8/vp8_predict.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_predict.js +290 -0
- package/src/format/image/webp/vp8/vp8_tables.d.ts +34 -0
- package/src/format/image/webp/vp8/vp8_tables.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_tables.js +350 -0
- package/src/format/image/webp/vp8/vp8_transform.d.ts +22 -0
- package/src/format/image/webp/vp8/vp8_transform.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_transform.js +114 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts +23 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.js +133 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.d.ts +47 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.js +84 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts +27 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.js +184 -0
- package/src/format/image/webp/vp8l/vp8l_decode.d.ts +28 -0
- package/src/format/image/webp/vp8l/vp8l_decode.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_decode.js +261 -0
- package/src/format/image/webp/vp8l/vp8l_distance.d.ts +22 -0
- package/src/format/image/webp/vp8l/vp8l_distance.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_distance.js +62 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts +50 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.js +267 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts +14 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.js +99 -0
- package/src/format/image/webp/webp_decode.d.ts +23 -0
- package/src/format/image/webp/webp_decode.d.ts.map +1 -0
- package/src/format/image/webp/webp_decode.js +179 -0
- package/src/format/image/webp/webp_decode_alpha.d.ts +18 -0
- package/src/format/image/webp/webp_decode_alpha.d.ts.map +1 -0
- package/src/format/image/webp/webp_decode_alpha.js +84 -0
- package/src/format/texture/{basis → astc}/astc_block.d.ts +41 -0
- package/src/format/texture/astc/astc_block.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_block.js +284 -164
- package/src/format/texture/astc/astc_decode_block.d.ts +68 -0
- package/src/format/texture/astc/astc_decode_block.d.ts.map +1 -0
- package/src/format/texture/astc/astc_decode_block.js +1119 -0
- package/src/format/texture/astc/astc_encode_block_4x4.d.ts +32 -0
- package/src/format/texture/astc/astc_encode_block_4x4.d.ts.map +1 -0
- package/src/format/texture/astc/astc_encode_block_4x4.js +181 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts +32 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts.map +1 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.js +337 -0
- package/src/format/texture/astc/astc_integer_sequence.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_integer_sequence.js +251 -251
- package/src/format/texture/astc/astc_partition.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_partition.js +199 -199
- package/src/format/texture/basis/transcode/etc1s_to_astc.js +329 -329
- package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -1
- package/src/format/texture/basis/transcode/etc1s_to_etc2.js +305 -332
- package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -1
- package/src/format/texture/basis/transcode/fit_endpoints.js +14 -27
- package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts +66 -0
- package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_bc7_tables.js +148 -0
- package/src/format/texture/basis/uastc/uastc_decode_block.js +463 -463
- package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -421
- package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +1 -6
- package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -1
- package/src/format/texture/basis/uastc/uastc_to_bc5.js +48 -115
- package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -1
- package/src/format/texture/basis/uastc/uastc_to_bc7.js +604 -602
- package/src/format/texture/bc/bc1_decode_block.d.ts +19 -0
- package/src/format/texture/bc/bc1_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc1_decode_block.js +22 -0
- package/src/format/texture/bc/bc1_decode_colors.d.ts +27 -0
- package/src/format/texture/bc/bc1_decode_colors.d.ts.map +1 -0
- package/src/format/texture/bc/bc1_decode_colors.js +100 -0
- package/src/format/texture/bc/bc2_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc2_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc2_decode_block.js +28 -0
- package/src/format/texture/bc/bc3_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc3_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc3_decode_block.js +23 -0
- package/src/format/texture/bc/bc4_decode_channel.d.ts +56 -0
- package/src/format/texture/bc/bc4_decode_channel.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_decode_channel.js +138 -0
- package/src/format/texture/bc/bc4_encode_block.d.ts +43 -0
- package/src/format/texture/bc/bc4_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_encode_block.js +324 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.js +27 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.d.ts +17 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.js +26 -0
- package/src/format/texture/bc/bc5_encode_block.d.ts +25 -0
- package/src/format/texture/bc/bc5_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_encode_block.js +34 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.js +27 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.d.ts +17 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.js +26 -0
- package/src/format/texture/bc/bc6h_decode_texels.d.ts +30 -0
- package/src/format/texture/bc/bc6h_decode_texels.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_decode_texels.js +430 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts +20 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.js +23 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.js +21 -0
- package/src/format/texture/bc/bc7_decode_block.d.ts +30 -0
- package/src/format/texture/bc/bc7_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc7_decode_block.js +232 -0
- package/src/format/texture/bc/bc7_encode_block.d.ts +39 -0
- package/src/format/texture/bc/bc7_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc7_encode_block.js +423 -0
- package/src/format/texture/bc/bc7_tables.d.ts +126 -0
- package/src/format/texture/bc/bc7_tables.d.ts.map +1 -0
- package/src/format/texture/{basis/uastc → bc}/bc7_tables.js +225 -276
- package/src/format/texture/bc/bc7_write_block.d.ts +65 -0
- package/src/format/texture/bc/bc7_write_block.d.ts.map +1 -0
- package/src/format/texture/{basis/uastc → bc}/bc7_write_block.js +185 -227
- package/src/format/texture/etc/eac_decode_channel.d.ts +50 -0
- package/src/format/texture/etc/eac_decode_channel.d.ts.map +1 -0
- package/src/format/texture/etc/eac_decode_channel.js +142 -0
- package/src/format/texture/etc/eac_modifiers.d.ts +15 -0
- package/src/format/texture/etc/eac_modifiers.d.ts.map +1 -0
- package/src/format/texture/etc/eac_modifiers.js +31 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts +21 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.js +30 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts +20 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.js +29 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts +19 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.js +28 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts +19 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.js +28 -0
- package/src/format/texture/etc/etc2_decode_color.d.ts +25 -0
- package/src/format/texture/etc/etc2_decode_color.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_decode_color.js +370 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts +18 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.js +21 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts +21 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.js +24 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts +18 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.js +24 -0
- package/src/format/texture/fit/fit_line.d.ts +23 -0
- package/src/format/texture/fit/fit_line.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line.js +123 -0
- package/src/format/texture/fit/fit_line_refine.d.ts +21 -0
- package/src/format/texture/fit/fit_line_refine.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line_refine.js +69 -0
- package/src/format/texture/fit/fit_line_solve.d.ts +23 -0
- package/src/format/texture/fit/fit_line_solve.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line_solve.js +71 -0
- package/src/format/texture/texel_decode_image.d.ts +44 -0
- package/src/format/texture/texel_decode_image.d.ts.map +1 -0
- package/src/format/texture/texel_decode_image.js +251 -0
- package/src/format/texture/texel_encode_image.d.ts +77 -0
- package/src/format/texture/texel_encode_image.d.ts.map +1 -0
- package/src/format/texture/texel_encode_image.js +187 -0
- package/src/shade/renderer/ShadeIndirectLightingMode.js +2 -0
- package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +1 -0
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +102 -28
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts +19 -0
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.js +60 -0
- package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_write.js +7 -31
- package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts +23 -0
- package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_write_collection.js +36 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts +13 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.js +39 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +3 -2
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +6 -21
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts +42 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.js +612 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +5 -4
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +8 -25
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +3 -19
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +14 -4
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +65 -54
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +2 -2
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +5 -22
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +1 -1
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts +27 -0
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.js +147 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +3 -4
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +6 -13
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts +13 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.js +66 -0
- package/src/shade/renderer/texture/encode/texture_encode.d.ts +28 -1
- package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/texture_encode.js +202 -168
- package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +13 -1
- package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/texture_encode_shader.js +146 -108
- package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts +20 -0
- package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_formats_to_build.js +98 -0
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +4 -23
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts +53 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.js +76 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts +40 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.js +43 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts +17 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.js +29 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.js +91 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts +32 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.js +216 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts +30 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.js +134 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.js +33 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.js +71 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts +20 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.js +57 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.js +111 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.js +33 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.js +128 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.js +169 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.js +119 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.js +19 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts +24 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.js +41 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts +24 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.js +140 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.js +35 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts +19 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.js +27 -0
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_catmull_rom.js +4 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts +13 -0
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js +54 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mitchell.js +4 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js +9 -13
- package/src/shade/renderer/texture/texture_block_encodings.d.ts +33 -0
- package/src/shade/renderer/texture/texture_block_encodings.d.ts.map +1 -0
- package/src/shade/renderer/texture/texture_block_encodings.js +89 -0
- package/src/format/texture/basis/astc_block.d.ts.map +0 -1
- package/src/format/texture/basis/astc_integer_sequence.d.ts.map +0 -1
- package/src/format/texture/basis/astc_partition.d.ts.map +0 -1
- package/src/format/texture/basis/uastc/bc7_tables.d.ts +0 -111
- package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +0 -1
- package/src/format/texture/basis/uastc/bc7_write_block.d.ts +0 -124
- package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +0 -1
- /package/src/format/texture/{basis → astc}/astc_integer_sequence.d.ts +0 -0
- /package/src/format/texture/{basis → astc}/astc_partition.d.ts +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The simple filter over one edge of `length` samples (luma only).
|
|
3
|
+
*
|
|
4
|
+
* @param {Uint8Array} p
|
|
5
|
+
* @param {number} at the first sample past the edge, at its start
|
|
6
|
+
* @param {number} step across the edge
|
|
7
|
+
* @param {number} pitch along it
|
|
8
|
+
* @param {number} length
|
|
9
|
+
* @param {number} threshold the edge limit
|
|
10
|
+
*
|
|
11
|
+
* @author Alex Goldring
|
|
12
|
+
* @copyright Company Named Limited (c) 2026
|
|
13
|
+
*/
|
|
14
|
+
export function vp8_simple_filter_edge(p: Uint8Array, at: number, step: number, pitch: number, length: number, threshold: number): void;
|
|
15
|
+
/**
|
|
16
|
+
* The normal filter over one edge of `length` samples: a macroblock edge spreads its correction over three samples
|
|
17
|
+
* either side, an edge inside a macroblock over two; where the variance at the edge is high, only the samples next to
|
|
18
|
+
* it move.
|
|
19
|
+
*
|
|
20
|
+
* @param {Uint8Array} p
|
|
21
|
+
* @param {number} at
|
|
22
|
+
* @param {number} step
|
|
23
|
+
* @param {number} pitch
|
|
24
|
+
* @param {number} length
|
|
25
|
+
* @param {number} threshold the edge limit
|
|
26
|
+
* @param {number} interior the interior limit
|
|
27
|
+
* @param {number} hev_threshold the high edge variance threshold
|
|
28
|
+
* @param {boolean} macroblock_edge
|
|
29
|
+
*/
|
|
30
|
+
export function vp8_normal_filter_edge(p: Uint8Array, at: number, step: number, pitch: number, length: number, threshold: number, interior: number, hev_threshold: number, macroblock_edge: boolean): void;
|
|
31
|
+
//# sourceMappingURL=vp8_loop_filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vp8_loop_filter.d.ts","sourceRoot":"","sources":["../../../../../../src/format/image/webp/vp8/vp8_loop_filter.js"],"names":[],"mappings":"AAsIA;;;;;;;;;;;;GAYG;AACH,0CAVW,UAAU,MACV,MAAM,QACN,MAAM,SACN,MAAM,UACN,MAAM,aACN,MAAM,QAahB;AAED;;;;;;;;;;;;;;GAcG;AACH,0CAVW,UAAU,MACV,MAAM,QACN,MAAM,SACN,MAAM,UACN,MAAM,aACN,MAAM,YACN,MAAM,iBACN,MAAM,mBACN,OAAO,QAkBjB"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/*
|
|
2
|
+
The VP8 loop filter (RFC 6386 §15), in place over a plane. An edge is filtered at each of its samples across it:
|
|
3
|
+
`step` crosses the edge, `pitch` moves along it.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {number} v
|
|
8
|
+
* @returns {number} v clamped to a signed byte
|
|
9
|
+
*/
|
|
10
|
+
function s8(v) {
|
|
11
|
+
return v < -128 ? -128 : v > 127 ? 127 : v;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {number} v
|
|
16
|
+
* @returns {number} v clamped to [-16, 15]
|
|
17
|
+
*/
|
|
18
|
+
function s4(v) {
|
|
19
|
+
return v < -16 ? -16 : v > 15 ? 15 : v;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param {number} v
|
|
24
|
+
* @returns {number} v clamped to a byte
|
|
25
|
+
*/
|
|
26
|
+
function u8(v) {
|
|
27
|
+
return v < 0 ? 0 : v > 255 ? 255 : v;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Moves the two samples either side of the edge toward each other, using the samples beyond them too.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} p
|
|
34
|
+
* @param {number} at the first sample past the edge
|
|
35
|
+
* @param {number} step
|
|
36
|
+
*/
|
|
37
|
+
function filter2(p, at, step) {
|
|
38
|
+
const p1 = p[at - 2 * step], p0 = p[at - step], q0 = p[at], q1 = p[at + step];
|
|
39
|
+
|
|
40
|
+
const a = 3 * (q0 - p0) + s8(p1 - q1);
|
|
41
|
+
const a1 = s4((a + 4) >> 3);
|
|
42
|
+
const a2 = s4((a + 3) >> 3);
|
|
43
|
+
|
|
44
|
+
p[at - step] = u8(p0 + a2);
|
|
45
|
+
p[at] = u8(q0 - a1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Moves the two samples either side of the edge toward each other, and the next ones by half as much.
|
|
50
|
+
*
|
|
51
|
+
* @param {Uint8Array} p
|
|
52
|
+
* @param {number} at
|
|
53
|
+
* @param {number} step
|
|
54
|
+
*/
|
|
55
|
+
function filter4(p, at, step) {
|
|
56
|
+
const p1 = p[at - 2 * step], p0 = p[at - step], q0 = p[at], q1 = p[at + step];
|
|
57
|
+
|
|
58
|
+
const a = 3 * (q0 - p0);
|
|
59
|
+
const a1 = s4((a + 4) >> 3);
|
|
60
|
+
const a2 = s4((a + 3) >> 3);
|
|
61
|
+
const a3 = (a1 + 1) >> 1;
|
|
62
|
+
|
|
63
|
+
p[at - 2 * step] = u8(p1 + a3);
|
|
64
|
+
p[at - step] = u8(p0 + a2);
|
|
65
|
+
p[at] = u8(q0 - a1);
|
|
66
|
+
p[at + step] = u8(q1 - a3);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Spreads a correction over three samples either side of a macroblock edge, weighted 27, 18 and 9 out of 128.
|
|
71
|
+
*
|
|
72
|
+
* @param {Uint8Array} p
|
|
73
|
+
* @param {number} at
|
|
74
|
+
* @param {number} step
|
|
75
|
+
*/
|
|
76
|
+
function filter6(p, at, step) {
|
|
77
|
+
const p2 = p[at - 3 * step], p1 = p[at - 2 * step], p0 = p[at - step];
|
|
78
|
+
const q0 = p[at], q1 = p[at + step], q2 = p[at + 2 * step];
|
|
79
|
+
|
|
80
|
+
const a = s8(3 * (q0 - p0) + s8(p1 - q1));
|
|
81
|
+
const a1 = (27 * a + 63) >> 7;
|
|
82
|
+
const a2 = (18 * a + 63) >> 7;
|
|
83
|
+
const a3 = (9 * a + 63) >> 7;
|
|
84
|
+
|
|
85
|
+
p[at - 3 * step] = u8(p2 + a3);
|
|
86
|
+
p[at - 2 * step] = u8(p1 + a2);
|
|
87
|
+
p[at - step] = u8(p0 + a1);
|
|
88
|
+
p[at] = u8(q0 - a1);
|
|
89
|
+
p[at + step] = u8(q1 - a2);
|
|
90
|
+
p[at + 2 * step] = u8(q2 - a3);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @param {Uint8Array} p
|
|
95
|
+
* @param {number} at
|
|
96
|
+
* @param {number} step
|
|
97
|
+
* @param {number} limit
|
|
98
|
+
* @returns {boolean} whether the step across the edge is small enough to be a blocking artefact
|
|
99
|
+
*/
|
|
100
|
+
function edge_is_soft(p, at, step, limit) {
|
|
101
|
+
return 4 * Math.abs(p[at - step] - p[at]) + Math.abs(p[at - 2 * step] - p[at + step]) <= limit;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @param {Uint8Array} p
|
|
106
|
+
* @param {number} at
|
|
107
|
+
* @param {number} step
|
|
108
|
+
* @param {number} limit
|
|
109
|
+
* @param {number} interior
|
|
110
|
+
* @returns {boolean} whether the edge is soft and the samples either side of it are smooth
|
|
111
|
+
*/
|
|
112
|
+
function edge_is_soft_and_smooth(p, at, step, limit, interior) {
|
|
113
|
+
if (!edge_is_soft(p, at, step, limit)) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const p3 = p[at - 4 * step], p2 = p[at - 3 * step], p1 = p[at - 2 * step], p0 = p[at - step];
|
|
118
|
+
const q0 = p[at], q1 = p[at + step], q2 = p[at + 2 * step], q3 = p[at + 3 * step];
|
|
119
|
+
|
|
120
|
+
return Math.abs(p3 - p2) <= interior && Math.abs(p2 - p1) <= interior && Math.abs(p1 - p0) <= interior
|
|
121
|
+
&& Math.abs(q3 - q2) <= interior && Math.abs(q2 - q1) <= interior && Math.abs(q1 - q0) <= interior;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @param {Uint8Array} p
|
|
126
|
+
* @param {number} at
|
|
127
|
+
* @param {number} step
|
|
128
|
+
* @param {number} threshold
|
|
129
|
+
* @returns {boolean} whether the variance at the edge is high
|
|
130
|
+
*/
|
|
131
|
+
function high_edge_variance(p, at, step, threshold) {
|
|
132
|
+
return Math.abs(p[at - 2 * step] - p[at - step]) > threshold || Math.abs(p[at + step] - p[at]) > threshold;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The simple filter over one edge of `length` samples (luma only).
|
|
137
|
+
*
|
|
138
|
+
* @param {Uint8Array} p
|
|
139
|
+
* @param {number} at the first sample past the edge, at its start
|
|
140
|
+
* @param {number} step across the edge
|
|
141
|
+
* @param {number} pitch along it
|
|
142
|
+
* @param {number} length
|
|
143
|
+
* @param {number} threshold the edge limit
|
|
144
|
+
*
|
|
145
|
+
* @author Alex Goldring
|
|
146
|
+
* @copyright Company Named Limited (c) 2026
|
|
147
|
+
*/
|
|
148
|
+
export function vp8_simple_filter_edge(p, at, step, pitch, length, threshold) {
|
|
149
|
+
const limit = 2 * threshold + 1;
|
|
150
|
+
|
|
151
|
+
for (let i = 0; i < length; i++, at += pitch) {
|
|
152
|
+
if (edge_is_soft(p, at, step, limit)) {
|
|
153
|
+
filter2(p, at, step);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The normal filter over one edge of `length` samples: a macroblock edge spreads its correction over three samples
|
|
160
|
+
* either side, an edge inside a macroblock over two; where the variance at the edge is high, only the samples next to
|
|
161
|
+
* it move.
|
|
162
|
+
*
|
|
163
|
+
* @param {Uint8Array} p
|
|
164
|
+
* @param {number} at
|
|
165
|
+
* @param {number} step
|
|
166
|
+
* @param {number} pitch
|
|
167
|
+
* @param {number} length
|
|
168
|
+
* @param {number} threshold the edge limit
|
|
169
|
+
* @param {number} interior the interior limit
|
|
170
|
+
* @param {number} hev_threshold the high edge variance threshold
|
|
171
|
+
* @param {boolean} macroblock_edge
|
|
172
|
+
*/
|
|
173
|
+
export function vp8_normal_filter_edge(p, at, step, pitch, length, threshold, interior, hev_threshold, macroblock_edge) {
|
|
174
|
+
const limit = 2 * threshold + 1;
|
|
175
|
+
|
|
176
|
+
for (let i = 0; i < length; i++, at += pitch) {
|
|
177
|
+
if (!edge_is_soft_and_smooth(p, at, step, limit, interior)) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (high_edge_variance(p, at, step, hev_threshold)) {
|
|
182
|
+
filter2(p, at, step);
|
|
183
|
+
} else if (macroblock_edge) {
|
|
184
|
+
filter6(p, at, step);
|
|
185
|
+
} else {
|
|
186
|
+
filter4(p, at, step);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Predicts a whole luma macroblock (size 16) or one chroma plane of it (size 8) in a plane whose row above and column
|
|
3
|
+
* to the left hold the block's edges: the samples there, or 127 above the picture and 129 left of it.
|
|
4
|
+
*
|
|
5
|
+
* DC averages the edges the picture has, and is 128 with neither.
|
|
6
|
+
*
|
|
7
|
+
* @param {Uint8Array} plane
|
|
8
|
+
* @param {number} offset of the block's top-left sample
|
|
9
|
+
* @param {number} stride
|
|
10
|
+
* @param {number} size 16 or 8
|
|
11
|
+
* @param {number} mode DC, TM, VE or HE of {@link Vp8SubblockMode}
|
|
12
|
+
* @param {boolean} has_top whether the block is below the picture's first row of macroblocks
|
|
13
|
+
* @param {boolean} has_left whether it is right of the first column
|
|
14
|
+
*
|
|
15
|
+
* @author Alex Goldring
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
|
+
*/
|
|
18
|
+
export function vp8_predict_block(plane: Uint8Array, offset: number, stride: number, size: number, mode: number, has_top: boolean, has_left: boolean): void;
|
|
19
|
+
/**
|
|
20
|
+
* Predicts one 4×4 luma sub-block (RFC 6386 §12.3).
|
|
21
|
+
*
|
|
22
|
+
* @param {Uint8Array} plane
|
|
23
|
+
* @param {number} offset of the sub-block's top-left sample
|
|
24
|
+
* @param {number} stride
|
|
25
|
+
* @param {number} mode of {@link Vp8SubblockMode}
|
|
26
|
+
* @param {Uint8Array} above the eight samples above and above-right
|
|
27
|
+
* @param {Uint8Array} left the four samples to the left
|
|
28
|
+
* @param {number} corner the sample above-left
|
|
29
|
+
*/
|
|
30
|
+
export function vp8_predict_subblock(plane: Uint8Array, offset: number, stride: number, mode: number, above: Uint8Array, left: Uint8Array, corner: number): void;
|
|
31
|
+
/**
|
|
32
|
+
* Intra prediction modes of a VP8 sub-block (RFC 6386 §12.3), numbered as the decoder's tables index them. The first
|
|
33
|
+
* four are also the whole-macroblock luma and chroma modes: DC, TrueMotion, vertical and horizontal.
|
|
34
|
+
*/
|
|
35
|
+
export type Vp8SubblockMode = number;
|
|
36
|
+
export namespace Vp8SubblockMode {
|
|
37
|
+
let DC: number;
|
|
38
|
+
let TM: number;
|
|
39
|
+
let VE: number;
|
|
40
|
+
let HE: number;
|
|
41
|
+
let RD: number;
|
|
42
|
+
let VR: number;
|
|
43
|
+
let LD: number;
|
|
44
|
+
let VL: number;
|
|
45
|
+
let HD: number;
|
|
46
|
+
let HU: number;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=vp8_predict.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vp8_predict.d.ts","sourceRoot":"","sources":["../../../../../../src/format/image/webp/vp8/vp8_predict.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;GAgBG;AACH,yCAXW,UAAU,UACV,MAAM,UACN,MAAM,QACN,MAAM,QACN,MAAM,WACN,OAAO,YACP,OAAO,QAsEjB;AAED;;;;;;;;;;GAUG;AACH,4CARW,UAAU,UACV,MAAM,UACN,MAAM,QACN,MAAM,SACN,UAAU,QACV,UAAU,UACV,MAAM,QAwKhB;;;;;8BA5RS,MAAM"}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intra prediction modes of a VP8 sub-block (RFC 6386 §12.3), numbered as the decoder's tables index them. The first
|
|
3
|
+
* four are also the whole-macroblock luma and chroma modes: DC, TrueMotion, vertical and horizontal.
|
|
4
|
+
*
|
|
5
|
+
* @readonly
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
export const Vp8SubblockMode = {
|
|
9
|
+
DC: 0,
|
|
10
|
+
TM: 1,
|
|
11
|
+
VE: 2,
|
|
12
|
+
HE: 3,
|
|
13
|
+
RD: 4,
|
|
14
|
+
VR: 5,
|
|
15
|
+
LD: 6,
|
|
16
|
+
VL: 7,
|
|
17
|
+
HD: 8,
|
|
18
|
+
HU: 9,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {number} v
|
|
23
|
+
* @returns {number}
|
|
24
|
+
*/
|
|
25
|
+
function clip(v) {
|
|
26
|
+
return v < 0 ? 0 : v > 255 ? 255 : v;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Predicts a whole luma macroblock (size 16) or one chroma plane of it (size 8) in a plane whose row above and column
|
|
31
|
+
* to the left hold the block's edges: the samples there, or 127 above the picture and 129 left of it.
|
|
32
|
+
*
|
|
33
|
+
* DC averages the edges the picture has, and is 128 with neither.
|
|
34
|
+
*
|
|
35
|
+
* @param {Uint8Array} plane
|
|
36
|
+
* @param {number} offset of the block's top-left sample
|
|
37
|
+
* @param {number} stride
|
|
38
|
+
* @param {number} size 16 or 8
|
|
39
|
+
* @param {number} mode DC, TM, VE or HE of {@link Vp8SubblockMode}
|
|
40
|
+
* @param {boolean} has_top whether the block is below the picture's first row of macroblocks
|
|
41
|
+
* @param {boolean} has_left whether it is right of the first column
|
|
42
|
+
*
|
|
43
|
+
* @author Alex Goldring
|
|
44
|
+
* @copyright Company Named Limited (c) 2026
|
|
45
|
+
*/
|
|
46
|
+
export function vp8_predict_block(plane, offset, stride, size, mode, has_top, has_left) {
|
|
47
|
+
const above = offset - stride;
|
|
48
|
+
|
|
49
|
+
if (mode === Vp8SubblockMode.DC) {
|
|
50
|
+
const shift = size === 16 ? 4 : 3;
|
|
51
|
+
|
|
52
|
+
let sum = 0;
|
|
53
|
+
let value;
|
|
54
|
+
|
|
55
|
+
if (has_top) {
|
|
56
|
+
for (let x = 0; x < size; x++) {
|
|
57
|
+
sum += plane[above + x];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (has_left) {
|
|
62
|
+
for (let y = 0; y < size; y++) {
|
|
63
|
+
sum += plane[offset + y * stride - 1];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (has_top && has_left) {
|
|
68
|
+
value = (sum + size) >> (shift + 1);
|
|
69
|
+
} else if (has_top || has_left) {
|
|
70
|
+
value = (sum + (size >> 1)) >> shift;
|
|
71
|
+
} else {
|
|
72
|
+
value = 128;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
for (let y = 0; y < size; y++) {
|
|
76
|
+
plane.fill(value, offset + y * stride, offset + y * stride + size);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (mode === Vp8SubblockMode.VE) {
|
|
83
|
+
for (let y = 0; y < size; y++) {
|
|
84
|
+
plane.copyWithin(offset + y * stride, above, above + size);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (mode === Vp8SubblockMode.HE) {
|
|
91
|
+
for (let y = 0; y < size; y++) {
|
|
92
|
+
const row = offset + y * stride;
|
|
93
|
+
|
|
94
|
+
plane.fill(plane[row - 1], row, row + size);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// TrueMotion
|
|
101
|
+
const corner = plane[above - 1];
|
|
102
|
+
|
|
103
|
+
for (let y = 0; y < size; y++) {
|
|
104
|
+
const row = offset + y * stride;
|
|
105
|
+
const left = plane[row - 1] - corner;
|
|
106
|
+
|
|
107
|
+
for (let x = 0; x < size; x++) {
|
|
108
|
+
plane[row + x] = clip(plane[above + x] + left);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Predicts one 4×4 luma sub-block (RFC 6386 §12.3).
|
|
115
|
+
*
|
|
116
|
+
* @param {Uint8Array} plane
|
|
117
|
+
* @param {number} offset of the sub-block's top-left sample
|
|
118
|
+
* @param {number} stride
|
|
119
|
+
* @param {number} mode of {@link Vp8SubblockMode}
|
|
120
|
+
* @param {Uint8Array} above the eight samples above and above-right
|
|
121
|
+
* @param {Uint8Array} left the four samples to the left
|
|
122
|
+
* @param {number} corner the sample above-left
|
|
123
|
+
*/
|
|
124
|
+
export function vp8_predict_subblock(plane, offset, stride, mode, above, left, corner) {
|
|
125
|
+
const A = above[0], B = above[1], C = above[2], D = above[3];
|
|
126
|
+
const E = above[4], F = above[5], G = above[6], H = above[7];
|
|
127
|
+
const I = left[0], J = left[1], K = left[2], L = left[3];
|
|
128
|
+
const X = corner;
|
|
129
|
+
|
|
130
|
+
const avg3 = (a, b, c) => (a + 2 * b + c + 2) >> 2;
|
|
131
|
+
const avg2 = (a, b) => (a + b + 1) >> 1;
|
|
132
|
+
|
|
133
|
+
const put = (x, y, v) => {
|
|
134
|
+
plane[offset + y * stride + x] = v;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
switch (mode) {
|
|
138
|
+
case Vp8SubblockMode.DC: {
|
|
139
|
+
const value = (A + B + C + D + I + J + K + L + 4) >> 3;
|
|
140
|
+
|
|
141
|
+
for (let y = 0; y < 4; y++) {
|
|
142
|
+
for (let x = 0; x < 4; x++) {
|
|
143
|
+
put(x, y, value);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
case Vp8SubblockMode.TM:
|
|
150
|
+
for (let y = 0; y < 4; y++) {
|
|
151
|
+
for (let x = 0; x < 4; x++) {
|
|
152
|
+
put(x, y, clip(above[x] + left[y] - X));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
break;
|
|
157
|
+
case Vp8SubblockMode.VE: {
|
|
158
|
+
const v = [avg3(X, A, B), avg3(A, B, C), avg3(B, C, D), avg3(C, D, E)];
|
|
159
|
+
|
|
160
|
+
for (let y = 0; y < 4; y++) {
|
|
161
|
+
for (let x = 0; x < 4; x++) {
|
|
162
|
+
put(x, y, v[x]);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case Vp8SubblockMode.HE: {
|
|
169
|
+
const v = [avg3(X, I, J), avg3(I, J, K), avg3(J, K, L), avg3(K, L, L)];
|
|
170
|
+
|
|
171
|
+
for (let y = 0; y < 4; y++) {
|
|
172
|
+
for (let x = 0; x < 4; x++) {
|
|
173
|
+
put(x, y, v[y]);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
case Vp8SubblockMode.RD:
|
|
180
|
+
put(0, 3, avg3(J, K, L));
|
|
181
|
+
put(0, 2, avg3(I, J, K));
|
|
182
|
+
put(1, 3, avg3(I, J, K));
|
|
183
|
+
put(0, 1, avg3(X, I, J));
|
|
184
|
+
put(1, 2, avg3(X, I, J));
|
|
185
|
+
put(2, 3, avg3(X, I, J));
|
|
186
|
+
put(0, 0, avg3(A, X, I));
|
|
187
|
+
put(1, 1, avg3(A, X, I));
|
|
188
|
+
put(2, 2, avg3(A, X, I));
|
|
189
|
+
put(3, 3, avg3(A, X, I));
|
|
190
|
+
put(1, 0, avg3(B, A, X));
|
|
191
|
+
put(2, 1, avg3(B, A, X));
|
|
192
|
+
put(3, 2, avg3(B, A, X));
|
|
193
|
+
put(2, 0, avg3(C, B, A));
|
|
194
|
+
put(3, 1, avg3(C, B, A));
|
|
195
|
+
put(3, 0, avg3(D, C, B));
|
|
196
|
+
break;
|
|
197
|
+
case Vp8SubblockMode.VR:
|
|
198
|
+
put(0, 0, avg2(X, A));
|
|
199
|
+
put(1, 2, avg2(X, A));
|
|
200
|
+
put(1, 0, avg2(A, B));
|
|
201
|
+
put(2, 2, avg2(A, B));
|
|
202
|
+
put(2, 0, avg2(B, C));
|
|
203
|
+
put(3, 2, avg2(B, C));
|
|
204
|
+
put(3, 0, avg2(C, D));
|
|
205
|
+
put(0, 3, avg3(K, J, I));
|
|
206
|
+
put(0, 2, avg3(J, I, X));
|
|
207
|
+
put(0, 1, avg3(I, X, A));
|
|
208
|
+
put(1, 3, avg3(I, X, A));
|
|
209
|
+
put(1, 1, avg3(X, A, B));
|
|
210
|
+
put(2, 3, avg3(X, A, B));
|
|
211
|
+
put(2, 1, avg3(A, B, C));
|
|
212
|
+
put(3, 3, avg3(A, B, C));
|
|
213
|
+
put(3, 1, avg3(B, C, D));
|
|
214
|
+
break;
|
|
215
|
+
case Vp8SubblockMode.LD:
|
|
216
|
+
put(0, 0, avg3(A, B, C));
|
|
217
|
+
put(1, 0, avg3(B, C, D));
|
|
218
|
+
put(0, 1, avg3(B, C, D));
|
|
219
|
+
put(2, 0, avg3(C, D, E));
|
|
220
|
+
put(1, 1, avg3(C, D, E));
|
|
221
|
+
put(0, 2, avg3(C, D, E));
|
|
222
|
+
put(3, 0, avg3(D, E, F));
|
|
223
|
+
put(2, 1, avg3(D, E, F));
|
|
224
|
+
put(1, 2, avg3(D, E, F));
|
|
225
|
+
put(0, 3, avg3(D, E, F));
|
|
226
|
+
put(3, 1, avg3(E, F, G));
|
|
227
|
+
put(2, 2, avg3(E, F, G));
|
|
228
|
+
put(1, 3, avg3(E, F, G));
|
|
229
|
+
put(3, 2, avg3(F, G, H));
|
|
230
|
+
put(2, 3, avg3(F, G, H));
|
|
231
|
+
put(3, 3, avg3(G, H, H));
|
|
232
|
+
break;
|
|
233
|
+
case Vp8SubblockMode.VL:
|
|
234
|
+
put(0, 0, avg2(A, B));
|
|
235
|
+
put(1, 0, avg2(B, C));
|
|
236
|
+
put(0, 2, avg2(B, C));
|
|
237
|
+
put(2, 0, avg2(C, D));
|
|
238
|
+
put(1, 2, avg2(C, D));
|
|
239
|
+
put(3, 0, avg2(D, E));
|
|
240
|
+
put(2, 2, avg2(D, E));
|
|
241
|
+
put(0, 1, avg3(A, B, C));
|
|
242
|
+
put(1, 1, avg3(B, C, D));
|
|
243
|
+
put(0, 3, avg3(B, C, D));
|
|
244
|
+
put(2, 1, avg3(C, D, E));
|
|
245
|
+
put(1, 3, avg3(C, D, E));
|
|
246
|
+
put(3, 1, avg3(D, E, F));
|
|
247
|
+
put(2, 3, avg3(D, E, F));
|
|
248
|
+
put(3, 2, avg3(E, F, G));
|
|
249
|
+
put(3, 3, avg3(F, G, H));
|
|
250
|
+
break;
|
|
251
|
+
case Vp8SubblockMode.HD:
|
|
252
|
+
put(0, 0, avg2(I, X));
|
|
253
|
+
put(2, 1, avg2(I, X));
|
|
254
|
+
put(0, 1, avg2(J, I));
|
|
255
|
+
put(2, 2, avg2(J, I));
|
|
256
|
+
put(0, 2, avg2(K, J));
|
|
257
|
+
put(2, 3, avg2(K, J));
|
|
258
|
+
put(0, 3, avg2(L, K));
|
|
259
|
+
put(3, 0, avg3(A, B, C));
|
|
260
|
+
put(2, 0, avg3(X, A, B));
|
|
261
|
+
put(1, 0, avg3(I, X, A));
|
|
262
|
+
put(3, 1, avg3(I, X, A));
|
|
263
|
+
put(1, 1, avg3(J, I, X));
|
|
264
|
+
put(3, 2, avg3(J, I, X));
|
|
265
|
+
put(1, 2, avg3(K, J, I));
|
|
266
|
+
put(3, 3, avg3(K, J, I));
|
|
267
|
+
put(1, 3, avg3(L, K, J));
|
|
268
|
+
break;
|
|
269
|
+
case Vp8SubblockMode.HU:
|
|
270
|
+
put(0, 0, avg2(I, J));
|
|
271
|
+
put(2, 0, avg2(J, K));
|
|
272
|
+
put(0, 1, avg2(J, K));
|
|
273
|
+
put(2, 1, avg2(K, L));
|
|
274
|
+
put(0, 2, avg2(K, L));
|
|
275
|
+
put(1, 0, avg3(I, J, K));
|
|
276
|
+
put(3, 0, avg3(J, K, L));
|
|
277
|
+
put(1, 1, avg3(J, K, L));
|
|
278
|
+
put(3, 1, avg3(K, L, L));
|
|
279
|
+
put(1, 2, avg3(K, L, L));
|
|
280
|
+
put(3, 2, L);
|
|
281
|
+
put(2, 2, L);
|
|
282
|
+
put(0, 3, L);
|
|
283
|
+
put(1, 3, L);
|
|
284
|
+
put(2, 3, L);
|
|
285
|
+
put(3, 3, L);
|
|
286
|
+
break;
|
|
287
|
+
default:
|
|
288
|
+
throw new Error(`WebP: sub-block prediction mode ${mode}`);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The default probabilities of the DCT token tree, before a frame updates any (RFC 6386 §13.5):
|
|
3
|
+
* [block type 4][coefficient band 8][context 3][tree node 11], flattened in that order.
|
|
4
|
+
*
|
|
5
|
+
* @type {Uint8Array}
|
|
6
|
+
*/
|
|
7
|
+
export const VP8_COEFFICIENT_DEFAULT_PROBABILITIES: Uint8Array;
|
|
8
|
+
/**
|
|
9
|
+
* The probability that a frame header updates each of {@link VP8_COEFFICIENT_DEFAULT_PROBABILITIES} (RFC 6386 §13.4),
|
|
10
|
+
* in the same order.
|
|
11
|
+
*
|
|
12
|
+
* @type {Uint8Array}
|
|
13
|
+
*/
|
|
14
|
+
export const VP8_COEFFICIENT_UPDATE_PROBABILITIES: Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* The probabilities of a key frame's sub-block mode tree given the modes of the sub-blocks above and to the left
|
|
17
|
+
* (RFC 6386 §11.5): [above 10][left 10][tree node 9], flattened, modes numbered as {@link Vp8SubblockMode}.
|
|
18
|
+
*
|
|
19
|
+
* @type {Uint8Array}
|
|
20
|
+
*/
|
|
21
|
+
export const VP8_SUBBLOCK_MODE_PROBABILITIES: Uint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* DC dequantization factor of each quantizer index (RFC 6386 §14.1).
|
|
24
|
+
*
|
|
25
|
+
* @type {Uint8Array}
|
|
26
|
+
*/
|
|
27
|
+
export const VP8_DC_QUANTIZER: Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* AC dequantization factor of each quantizer index (RFC 6386 §14.1).
|
|
30
|
+
*
|
|
31
|
+
* @type {Uint16Array}
|
|
32
|
+
*/
|
|
33
|
+
export const VP8_AC_QUANTIZER: Uint16Array;
|
|
34
|
+
//# sourceMappingURL=vp8_tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vp8_tables.d.ts","sourceRoot":"","sources":["../../../../../../src/format/image/webp/vp8/vp8_tables.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oDAFU,UAAU,CAmGjB;AAEH;;;;;GAKG;AACH,mDAFU,UAAU,CAmGjB;AAEH;;;;;GAKG;AACH,8CAFU,UAAU,CAuGjB;AAEH;;;;GAIG;AACH,+BAFU,UAAU,CAWjB;AAEH;;;;GAIG;AACH,+BAFU,WAAW,CAWlB"}
|