Commit Graph
99 Commits
Author SHA1 Message Date
Nigel Tao 65c2f4971f Rename some initialize methods to prepare or set 2019-01-26 15:46:42 +11:00
Nigel Tao dec519d9b4 Remove image_config.workbuf_len 2019-01-19 14:49:27 +11:00
Nigel Tao dd3d9f6766 Add wuffs_base__pixel_format__bits_per_pixel 2019-01-12 11:52:02 +11:00
Nigel Tao 867ea1cdcc Re-organize WUFFS_VERSION_BUILD_METADATA_XXX 2019-01-06 21:21:36 +11:00
Nigel Tao aef136611c Add WUFFS_VERSION_GIT_REV_LIST_COUNT comment 2018-12-30 21:39:14 +11:00
Nigel Tao 2b631202bc Generate WUFFS_VERSION_GIT_REV_LIST_COUNT 2018-12-29 15:45:04 +11:00
Nigel Tao 80bd4061b5 Unroll wuffs_base__pixel_swizzler__copy_4_1
It's a mystery why some non-bgra benchmarks improve (e.g. std/lzw
improves, std/deflate does not), but I'll take it.

name                                    old speed      new speed      delta

wuffs_lzw_decode_20k/clang               242MB/s ± 0%   251MB/s ± 0%  +3.75%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/clang              419MB/s ± 0%   432MB/s ± 0%  +3.16%  (p=0.008 n=5+5)

wuffs_lzw_decode_20k/gcc                 260MB/s ± 0%   264MB/s ± 0%  +1.40%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/gcc                449MB/s ± 1%   474MB/s ± 0%  +5.45%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k/clang            152MB/s ± 1%   154MB/s ± 1%  +0.97%  (p=0.032 n=5+5)
wuffs_deflate_decode_10k/clang           242MB/s ± 0%   243MB/s ± 1%    ~     (p=0.548 n=5+5)
wuffs_deflate_decode_100k/clang          276MB/s ± 0%   275MB/s ± 1%    ~     (p=0.222 n=5+5)

wuffs_deflate_decode_1k/gcc              157MB/s ± 0%   156MB/s ± 1%  -0.89%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k/gcc             261MB/s ± 0%   260MB/s ± 0%    ~     (p=0.222 n=5+5)
wuffs_deflate_decode_100k/gcc            317MB/s ± 0%   315MB/s ± 0%  -0.66%  (p=0.008 n=5+5)

wuffs_gif_decode_1k_bw/clang             242MB/s ± 0%   242MB/s ± 1%    ~     (p=0.222 n=5+5)
wuffs_gif_decode_1k_color/clang          135MB/s ± 0%   139MB/s ± 0%  +3.12%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/clang          663MB/s ± 0%   683MB/s ± 0%  +3.03%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/clang       177MB/s ± 0%   182MB/s ± 1%  +2.91%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/clang   513MB/s ± 0%   529MB/s ± 0%  +3.09%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/clang    205MB/s ± 0%   211MB/s ± 0%  +2.66%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k/clang             209MB/s ± 0%   214MB/s ± 2%  +2.62%  (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/clang   1.05GB/s ± 0%  1.09GB/s ± 0%  +3.40%  (p=0.008 n=5+5)

wuffs_gif_decode_1k_bw/gcc               266MB/s ± 1%   265MB/s ± 0%  -0.46%  (p=0.016 n=5+5)
wuffs_gif_decode_1k_color/gcc            149MB/s ± 1%   150MB/s ± 0%  +0.93%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/gcc            597MB/s ± 1%   609MB/s ± 0%  +1.96%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/gcc         186MB/s ± 0%   189MB/s ± 0%  +1.89%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/gcc     520MB/s ± 0%   518MB/s ± 0%  -0.39%  (p=0.032 n=5+5)
wuffs_gif_decode_100k_realistic/gcc      212MB/s ± 0%   213MB/s ± 0%  +0.55%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k/gcc               216MB/s ± 0%   217MB/s ± 0%  +0.56%  (p=0.016 n=5+5)
wuffs_gif_decode_anim_screencap/gcc     1.09GB/s ± 1%  1.09GB/s ± 0%    ~     (p=0.548 n=5+5)
2018-12-26 13:40:43 +11:00
Nigel Tao 529ebb0a61 Introduce binary alpha 2018-12-22 08:48:49 +11:00
Nigel Tao 57e5a785f7 Rename some private copy_n_from_history variables 2018-12-16 11:33:35 +11:00
Nigel Tao baf1b9f9e6 Rename some I/O private methods 2018-12-16 11:28:25 +11:00
Nigel Tao 247232091d Delete an obsolete io_bind in std/gif 2018-12-16 10:12:43 +11:00
Nigel Tao 6c3c73b056 Fix signed vs unsigned comparison in reader.take 2018-12-15 15:55:37 +11:00
Nigel Tao 33a4557d98 Collect GIF's LZW data into larger batches
name                                    old speed     new speed     delta

wuffs_gif_decode_1k_bw/clang            224MB/s ± 1%  227MB/s ± 0%  +0.98%  (p=0.000 n=10+9)
wuffs_gif_decode_1k_color/clang         116MB/s ± 1%  118MB/s ± 1%  +2.26%  (p=0.000 n=10+10)
wuffs_gif_decode_10k_bgra/clang         541MB/s ± 0%  568MB/s ± 1%  +4.97%  (p=0.000 n=9+10)
wuffs_gif_decode_10k_indexed/clang      144MB/s ± 0%  152MB/s ± 0%  +5.61%  (p=0.000 n=9+10)
wuffs_gif_decode_100k_artificial/clang  438MB/s ± 1%  454MB/s ± 1%  +3.56%  (p=0.000 n=9+10)
wuffs_gif_decode_100k_realistic/clang   171MB/s ± 0%  179MB/s ± 0%  +4.64%  (p=0.000 n=8+10)
wuffs_gif_decode_1000k/clang            174MB/s ± 0%  180MB/s ± 0%  +3.90%  (p=0.000 n=9+10)
wuffs_gif_decode_anim_screencap/clang   897MB/s ± 1%  943MB/s ± 0%  +5.10%  (p=0.000 n=9+9)

wuffs_gif_decode_1k_bw/gcc              250MB/s ± 1%  241MB/s ± 1%  -3.26%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color/gcc           132MB/s ± 1%  130MB/s ± 1%  -2.15%  (p=0.000 n=10+10)
wuffs_gif_decode_10k_bgra/gcc           534MB/s ± 1%  535MB/s ± 1%    ~     (p=0.211 n=9+10)
wuffs_gif_decode_10k_indexed/gcc        162MB/s ± 1%  163MB/s ± 0%    ~     (p=0.105 n=10+10)
wuffs_gif_decode_100k_artificial/gcc    460MB/s ± 0%  456MB/s ± 0%  -0.80%  (p=0.000 n=10+10)
wuffs_gif_decode_100k_realistic/gcc     186MB/s ± 0%  186MB/s ± 1%  -0.33%  (p=0.001 n=9+10)
wuffs_gif_decode_1000k/gcc              189MB/s ± 1%  188MB/s ± 1%    ~     (p=0.053 n=9+10)
wuffs_gif_decode_anim_screencap/gcc     981MB/s ± 1%  971MB/s ± 1%  -0.95%  (p=0.000 n=10+10)
2018-12-15 14:10:10 +11:00
Nigel Tao 45ab79b451 Allow GIF decoding to non-indexed pixel formats 2018-12-08 16:08:02 +11:00
Nigel Tao 90193cb6e2 Add palette arguments to the pixel swizzler 2018-12-08 13:58:52 +11:00
Nigel Tao 6c9dca47ee Add a base.pixel_swizzler type 2018-12-08 13:25:53 +11:00
Nigel Tao 86b8408223 Refactor cgen's base/base-{private,public}.h 2018-12-08 10:46:02 +11:00
Nigel Tao 4023294ba2 Add a gif.decoder.frame_dirty_rect method 2018-11-17 21:26:53 +11:00
Nigel Tao f06126c85a Rename color_u32argb; add YCoCg color 2018-11-17 11:43:34 +11:00
Nigel Tao e2d1f8e0c2 Generate const annotations for pure methods 2018-10-28 17:30:48 +11:00
Nigel Tao 92ecd0a901 Use a table, not a formula, to get low bits mask
It's not an optimization per se. It addresses the fact that, in the C
programming language, if u is an uint32_t value, then (u<<32) is
undefined behavior, so ((1<<32)-1) isn't necessarily 0xFFFFFFFF:

https://stackoverflow.com/questions/7401888/why-doesnt-left-bit-shift-for-32-bit-integers-work-as-expected-when-used

name                                    old speed      new speed      delta

wuffs_deflate_decode_1k/clang            147MB/s ± 1%   147MB/s ± 0%     ~     (p=0.206 n=49+5)
wuffs_deflate_decode_10k/clang           234MB/s ± 1%   239MB/s ± 0%   +2.24%  (p=0.000 n=49+5)
wuffs_deflate_decode_100k/clang          261MB/s ± 0%   270MB/s ± 0%   +3.38%  (p=0.000 n=48+5)

wuffs_deflate_decode_1k/gcc              160MB/s ± 1%   160MB/s ± 0%     ~     (p=0.322 n=43+5)
wuffs_deflate_decode_10k/gcc             270MB/s ± 1%   272MB/s ± 0%   +0.93%  (p=0.000 n=46+5)
wuffs_deflate_decode_100k/gcc            313MB/s ± 1%   322MB/s ± 0%   +2.97%  (p=0.000 n=42+5)

wuffs_gif_decode_1k_bw/clang             253MB/s ± 1%   259MB/s ± 1%   +2.28%  (p=0.000 n=45+5)
wuffs_gif_decode_1k_color/clang          116MB/s ± 1%   128MB/s ± 0%  +11.20%  (p=0.000 n=45+5)
wuffs_gif_decode_10k/clang               135MB/s ± 1%   154MB/s ± 1%  +14.39%  (p=0.000 n=44+5)
wuffs_gif_decode_100k_artificial/clang   429MB/s ± 1%   426MB/s ± 0%   -0.70%  (p=0.000 n=48+5)
wuffs_gif_decode_100k_realistic/clang    162MB/s ± 0%   171MB/s ± 0%   +6.13%  (p=0.000 n=43+5)
wuffs_gif_decode_1000k/clang             163MB/s ± 1%   172MB/s ± 0%   +6.04%  (p=0.000 n=50+5)
wuffs_gif_decode_anim_screencap/clang    900MB/s ± 0%   909MB/s ± 0%   +1.06%  (p=0.000 n=45+5)

wuffs_gif_decode_1k_bw/gcc               268MB/s ± 1%   269MB/s ± 0%   +0.63%  (p=0.000 n=49+5)
wuffs_gif_decode_1k_color/gcc            133MB/s ± 1%   135MB/s ± 1%   +1.45%  (p=0.000 n=50+5)
wuffs_gif_decode_10k/gcc                 160MB/s ± 1%   158MB/s ± 0%   -1.24%  (p=0.000 n=48+5)
wuffs_gif_decode_100k_artificial/gcc     448MB/s ± 1%   446MB/s ± 0%   -0.40%  (p=0.039 n=50+5)
wuffs_gif_decode_100k_realistic/gcc      180MB/s ± 1%   177MB/s ± 0%   -1.48%  (p=0.000 n=50+5)
wuffs_gif_decode_1000k/gcc               182MB/s ± 1%   179MB/s ± 0%   -1.39%  (p=0.000 n=48+5)
wuffs_gif_decode_anim_screencap/gcc      963MB/s ± 1%   960MB/s ± 0%   -0.33%  (p=0.022 n=47+5)

wuffs_gzip_decode_10k/clang              215MB/s ± 1%   221MB/s ± 0%   +2.46%  (p=0.000 n=49+5)
wuffs_gzip_decode_100k/clang             239MB/s ± 1%   246MB/s ± 0%   +3.03%  (p=0.000 n=47+5)

wuffs_gzip_decode_10k/gcc                248MB/s ± 0%   248MB/s ± 0%     ~     (p=0.469 n=45+5)
wuffs_gzip_decode_100k/gcc               290MB/s ± 1%   291MB/s ± 0%   +0.34%  (p=0.007 n=49+5)

wuffs_lzw_decode_20k/clang               187MB/s ± 0%   199MB/s ± 2%   +6.45%  (p=0.000 n=49+5)
wuffs_lzw_decode_100k/clang              304MB/s ± 1%   329MB/s ± 1%   +8.44%  (p=0.000 n=46+5)

wuffs_lzw_decode_20k/gcc                 223MB/s ± 1%   208MB/s ± 2%   -6.78%  (p=0.000 n=46+5)
wuffs_lzw_decode_100k/gcc                364MB/s ± 1%   352MB/s ± 0%   -3.39%  (p=0.000 n=49+5)

wuffs_zlib_decode_10k/clang              214MB/s ± 0%   216MB/s ± 1%   +0.69%  (p=0.026 n=49+5)
wuffs_zlib_decode_100k/clang             237MB/s ± 0%   242MB/s ± 0%   +2.37%  (p=0.000 n=48+5)

wuffs_zlib_decode_10k/gcc                247MB/s ± 1%   245MB/s ± 1%   -0.69%  (p=0.001 n=44+5)
wuffs_zlib_decode_100k/gcc               288MB/s ± 1%   288MB/s ± 1%     ~     (p=0.629 n=47+5)
2018-10-28 17:14:49 +11:00
Nigel Tao 61d03537c2 De-duplicate the gen/c/* files
The gen/c/* files are not checked in, due to the .gitignore file

In Wuffs version 0.1, they were checked in, and programs were expected
to #include them directly. Another goal was for them to be
self-contained, without any #include lines to other Wuffs files, so that
they would be easy to build, without having to configure an -I dir to a
C compiler.

They therefore inlined what would otherwise be an #include. For example,
the generated std/gif.h code would inline the contents of the std/lzw.h
file. The genrelease program would have to de-duplicate these inlines in
order to produce a clean, monolithic release/c/* file.

In Wuffs version 0.2 (the latest version), programs don't #include
gen/c/*. Instead, they #include the monolithic release/c/*. Avoiding the
need to configure an -I directory isn't as important as it used to be.

This change removes that inlining, using the simpler #include line, and
the genrelease program is then simpler because it doesn't need to
de-duplicate.
2018-10-27 12:50:01 +11:00
Nigel Tao 51a0b347ed Add WUFFS_BASE__LOW_BITS_MASK__UXX macros 2018-10-21 21:53:44 +11:00
Nigel Tao 94c054a341 Remove unused byte-swapping functions 2018-10-21 21:11:34 +11:00
Nigel Tao 7be9c39283 Move num_loops out of the image_config
For the GIF format, it isn't necessarily before the first frame.
2018-10-13 17:00:45 +11:00
Nigel Tao dc17398d64 Generate "WUFFS C HEADER ENDS HERE"
Future commits will mean more than one "#ifdef WUFFS_IMPLEMENTATION".
2018-10-06 09:12:04 +10:00
Nigel Tao ad02f2ea62 Have pixbuf_len return uint64_t not size_t 2018-09-15 12:50:39 +10:00
Nigel Tao a12c45bb7f Rename io_position_reader to reader_io_position 2018-09-15 09:19:34 +10:00
Nigel Tao 8c6cc80b57 Add wuffs_base__status__is_complete 2018-09-15 09:18:53 +10:00
Nigel Tao 6fa3d5a9f5 have io_writer.set also reset meta.pos 2018-09-15 08:47:30 +10:00
Nigel Tao 6fed251b40 Split an io_buffer's fields into data and meta 2018-09-15 08:45:50 +10:00
Nigel Tao 990463bdac Move u8 subslice methods from private to public 2018-09-09 21:43:34 +10:00
Nigel Tao 180ce5e481 Add wuffs_base__malloc_slice_uxx functions 2018-09-09 21:31:37 +10:00
Nigel Tao 399a7af6ef Fix comment about palette pointer alignment 2018-09-08 11:21:40 +10:00
Nigel Tao 724b136bf8 Remove the obsolete set_palette method 2018-09-08 11:11:36 +10:00
Nigel Tao 2c7fd8058a Repurpose a pixbuf's plane 3 for the palette 2018-09-08 11:03:22 +10:00
Nigel Tao fbbdc412d1 Rename work_buffer_size to workbuf_len 2018-09-08 09:06:56 +10:00
Nigel Tao ca940b0c56 Rename pixbuf_size to pixbuf_len 2018-09-08 08:47:34 +10:00
Nigel Tao 5bf7c5c051 Add image_config.first_frame_io_position
Also fix a type typo for image_config.first_frame_is_opaque.
2018-09-08 08:40:45 +10:00
Nigel Tao 91451e8095 Add io_buffer.io_position_{read,writ}er methods 2018-09-08 08:27:19 +10:00
Nigel Tao 555a72d7a9 Add a decode_frame_options type 2018-09-02 15:08:00 +10:00
Nigel Tao 8b1e023e6a Add image_config.work_buffer_size 2018-09-02 14:56:53 +10:00
Nigel Tao a34cc5311e Place the frame_config's pos before it not after 2018-08-26 23:58:03 +10:00
Nigel Tao 9c04249bfe Add warnings as another status code category 2018-08-26 23:22:45 +10:00
Nigel Tao 814507e848 First sketch of reset_for_decode_frame 2018-08-26 21:18:08 +10:00
Nigel Tao 132b54378c Remove frame_config.palette_changed 2018-08-26 17:22:29 +10:00
Nigel Tao 7798beaa8c Add I/O positions 2018-08-26 16:31:19 +10:00
Nigel Tao d47bf4e4e5 Fix wuffs_base__frame_config__blend 2018-08-19 18:06:44 +10:00
Nigel Tao fbb8bd44b8 Make blend an enum, not just a bool 2018-08-19 17:00:00 +10:00
Nigel Tao 9367cd800b Remove the (pointer-typed) private_impl.status 2018-08-19 11:32:31 +10:00