Files
wuffs/internal/cgen/base/image-private.h
T
Nigel Tao 72b9c23120 std/jpeg: decode RGB (not just YCbCr) JPEGs
The benchmarks don't exercise the RGB code paths per se, but it does
affect the numbers. Especially for gcc, this essentially undoes the
performance impact of the previous (trivial) commit. This is all
presumably another code alignment coincidence per
https://news.ycombinator.com/item?id=23633583

name                                             old speed      new speed      delta

wuffs_jpeg_decode_19k_8bpp/clang11                376MB/s ± 0%   376MB/s ± 0%     ~     (p=1.000 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/clang11   338MB/s ± 0%   341MB/s ± 0%   +0.98%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/clang11   1.01GB/s ± 0%  1.01GB/s ± 0%   +0.35%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/clang11               841MB/s ± 0%   836MB/s ± 1%   -0.65%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/clang11          913MB/s ± 0%   912MB/s ± 0%   -0.18%  (p=0.016 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/clang11         1.11GB/s ± 0%  1.10GB/s ± 0%   -0.34%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/clang11             920MB/s ± 0%   916MB/s ± 0%   -0.42%  (p=0.008 n=5+5)

wuffs_jpeg_decode_19k_8bpp/gcc10                  349MB/s ± 0%   368MB/s ± 0%   +5.60%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/gcc10     328MB/s ± 0%   279MB/s ± 0%  -14.82%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/gcc10      925MB/s ± 0%   947MB/s ± 1%   +2.33%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/gcc10                 732MB/s ± 0%   770MB/s ± 0%   +5.23%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/gcc10            798MB/s ± 0%   838MB/s ± 0%   +4.99%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/gcc10            962MB/s ± 0%   996MB/s ± 0%   +3.54%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/gcc10               806MB/s ± 0%   847MB/s ± 0%   +5.19%  (p=0.008 n=5+5)
2023-08-21 16:12:21 +10:00

79 lines
2.4 KiB
C

// Copyright 2017 The Wuffs Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ---------------- 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 width,
uint32_t height,
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,
bool is_rgb_or_cmyk,
bool triangle_filter_for_2to1,
wuffs_base__slice_u8 scratch_buffer_2k);
// ---------------- Images (Utility)
#define wuffs_base__utility__make_pixel_format wuffs_base__make_pixel_format