mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
This moves from a 2-valued "basic (box) or fancy (triangle)" upsampling parameter to a 3-valued one, which can now represent the fact that libjpeg's and libwebp's fancy (triangle) upsampling is ever-so-slightly different (see script/script/replicate-libwebp-chroma-upsampling.go and its comments). This is not an optimization or pessimization per se, but for the record, the performance impact is mixed. name old speed new speed delta wuffs_jpeg_decode_19k_8bpp/clang14 317MB/s ± 0% 314MB/s ± 0% -0.99% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_progressive/clang14 318MB/s ± 0% 328MB/s ± 0% +3.13% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_sequential/clang14 879MB/s ± 0% 871MB/s ± 0% -0.83% (p=0.008 n=5+5) wuffs_jpeg_decode_77k_24bpp/clang14 719MB/s ± 0% 713MB/s ± 0% -0.89% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_420/clang14 779MB/s ± 0% 771MB/s ± 0% -1.01% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_444/clang14 902MB/s ± 0% 890MB/s ± 0% -1.32% (p=0.008 n=5+5) wuffs_jpeg_decode_4002k_24bpp/clang14 784MB/s ± 0% 779MB/s ± 0% -0.66% (p=0.008 n=5+5) wuffs_jpeg_decode_19k_8bpp/gcc12 358MB/s ± 0% 362MB/s ± 0% +0.93% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_progressive/gcc12 305MB/s ± 0% 311MB/s ± 0% +1.91% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_sequential/gcc12 912MB/s ± 0% 918MB/s ± 0% +0.73% (p=0.016 n=4+5) wuffs_jpeg_decode_77k_24bpp/gcc12 749MB/s ± 0% 763MB/s ± 0% +1.83% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_420/gcc12 813MB/s ± 0% 824MB/s ± 0% +1.37% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_444/gcc12 969MB/s ± 0% 984MB/s ± 0% +1.62% (p=0.008 n=5+5) wuffs_jpeg_decode_4002k_24bpp/gcc12 815MB/s ± 0% 832MB/s ± 0% +2.06% (p=0.008 n=5+5)
77 lines
2.2 KiB
C
77 lines
2.2 KiB
C
// Copyright 2017 The Wuffs Authors.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
|
|
// option. This file may not be copied, modified, or distributed
|
|
// except according to those terms.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
|
|
// ---------------- Images
|
|
|
|
WUFFS_BASE__MAYBE_STATIC uint64_t //
|
|
wuffs_base__pixel_swizzler__limited_swizzle_u32_interleaved_from_reader(
|
|
const wuffs_base__pixel_swizzler* p,
|
|
uint32_t up_to_num_pixels,
|
|
wuffs_base__slice_u8 dst,
|
|
wuffs_base__slice_u8 dst_palette,
|
|
const uint8_t** ptr_iop_r,
|
|
const uint8_t* io2_r);
|
|
|
|
WUFFS_BASE__MAYBE_STATIC uint64_t //
|
|
wuffs_base__pixel_swizzler__swizzle_interleaved_from_reader(
|
|
const wuffs_base__pixel_swizzler* p,
|
|
wuffs_base__slice_u8 dst,
|
|
wuffs_base__slice_u8 dst_palette,
|
|
const uint8_t** ptr_iop_r,
|
|
const uint8_t* io2_r);
|
|
|
|
WUFFS_BASE__MAYBE_STATIC uint64_t //
|
|
wuffs_base__pixel_swizzler__swizzle_interleaved_transparent_black(
|
|
const wuffs_base__pixel_swizzler* p,
|
|
wuffs_base__slice_u8 dst,
|
|
wuffs_base__slice_u8 dst_palette,
|
|
uint64_t num_pixels);
|
|
|
|
WUFFS_BASE__MAYBE_STATIC wuffs_base__status //
|
|
wuffs_base__pixel_swizzler__swizzle_ycck(
|
|
const wuffs_base__pixel_swizzler* p,
|
|
wuffs_base__pixel_buffer* dst,
|
|
wuffs_base__slice_u8 dst_palette,
|
|
uint32_t x_min_incl,
|
|
uint32_t x_max_excl,
|
|
uint32_t y_min_incl,
|
|
uint32_t y_max_excl,
|
|
wuffs_base__slice_u8 src0,
|
|
wuffs_base__slice_u8 src1,
|
|
wuffs_base__slice_u8 src2,
|
|
wuffs_base__slice_u8 src3,
|
|
uint32_t width0,
|
|
uint32_t width1,
|
|
uint32_t width2,
|
|
uint32_t width3,
|
|
uint32_t height0,
|
|
uint32_t height1,
|
|
uint32_t height2,
|
|
uint32_t height3,
|
|
uint32_t stride0,
|
|
uint32_t stride1,
|
|
uint32_t stride2,
|
|
uint32_t stride3,
|
|
uint8_t h0,
|
|
uint8_t h1,
|
|
uint8_t h2,
|
|
uint8_t h3,
|
|
uint8_t v0,
|
|
uint8_t v1,
|
|
uint8_t v2,
|
|
uint8_t v3,
|
|
uint8_t ycc_model,
|
|
uint8_t ycc_upsampling,
|
|
wuffs_base__slice_u8 scratch_buffer_2k);
|
|
|
|
// ---------------- Images (Utility)
|
|
|
|
#define wuffs_base__utility__make_pixel_format wuffs_base__make_pixel_format
|