You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 35be9bf
Browse filesBrowse the repository at this point in the historyBrowse files
Encode AVIF: an AV1 intra encoder mirroring the decoder
Image.encodeAVIF encodes AV1 still pictures in an AVIF container (alpha as a
monochrome auxiliary image). The encoder's syntax and contexts mirror the
dav1d based decoder and its reconstruction uses the decoder's predictors and
inverse transforms, so dav1d decodes the files to exactly the encoder's
reconstruction. Partitions, intra modes, chroma from luma and transform types
are chosen by rate and distortion, coefficients quantized by rate and
distortion; the loop filter level and up to 8 CDEF strengths by the filtered
image. Lossless (quality 100) uses the Walsh-Hadamard transform and RGB with
the identity matrix. The symbol encoder and the forward WHT are ported from
libaom. On photos the files are within about 1-4% of avifenc's (libaom, speed
6) at the same PSNR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lfv41PqHEGbU7SLg5onpG1
|[RFC 6386](https://www.rfc-editor.org/rfc/rfc6386) (VP8 Data Format and Decoding Guide, with the libvpx reference decoder) |`src/codecs/vp8-tables.ts` (probability and quantizer tables), `src/codecs/vp8.ts` (decoding procedures) | BSD-3-Clause |
15
15
|[libwebp](https://chromium.googlesource.com/webm/libwebp)|`src/codecs/vp8.ts` (YUV to RGB conversion, "fancy" chroma upsampling), `src/codecs/webp.ts` (animation frame blending), `src/codecs/vp8-enc.ts`, `src/codecs/vp8-enc-dsp.ts` (the lossy encoder: RGB to YUV conversion, analysis, segments, rate-distortion optimized mode decisions, quantization, token probabilities, bitstream, alpha filtering), `src/codecs/vp8-enc-tables.ts` (its tables, generated from libwebp by `scripts/vp8-enc-tables.py`) | BSD-3-Clause |
16
-
|[dav1d](https://code.videolan.org/videolan/dav1d) by VideoLAN, the dav1d authors and Two Orioles |`src/codecs/av1/*` (the AV1 decoder: bitstream parsing, symbol decoding, prediction, inverse transforms, loop filters, film grain; the tables in `src/codecs/av1/data.ts`, generated from dav1d by `scripts/av1-tables.c`) | BSD-2-Clause |
16
+
|[dav1d](https://code.videolan.org/videolan/dav1d) by VideoLAN, the dav1d authors and Two Orioles |`src/codecs/av1/*` (the AV1 decoder, and the encoder's syntax, contexts and reconstruction mirrored from it: bitstream parsing, symbol decoding, prediction, inverse transforms, loop filters, film grain; the tables in `src/codecs/av1/data.ts`, generated from dav1d by `scripts/av1-tables.c`) | BSD-2-Clause |
17
+
|[libaom](https://aomedia.googlesource.com/aom/) by the Alliance for Open Media |`src/codecs/av1/msac-enc.ts` (the symbol encoder), `src/codecs/av1/fdct.ts` (the forward Walsh-Hadamard transform), `src/codecs/av1/encode.ts` (the loop filter level from the quantizer), `src/codecs/avif-enc.ts` (the quantizer to qindex table) | BSD-2-Clause |
17
18
|[libavif](https://github.com/AOMediaCodec/libavif) by Joe Drago |`src/codecs/avif.ts` (YUV to RGB conversion with bilinear chroma upsampling, alpha range expansion and unpremultiplication) | BSD-2-Clause |
18
19
|[jxl-oxide](https://github.com/tirr-c/jxl-oxide) by Wonwoo Choi |`src/codecs/jxl/*` (the JPEG XL decoder: bit reader, header and frame header fields, entropy decoding, VarDCT, dequantization matrices, transforms, restoration filters, upsampling, the parsing of patches, splines and noise) | MIT (or Apache-2.0) |
19
20
|[libjxl](https://github.com/libjxl/libjxl) by the JPEG XL Project Authors |`src/codecs/jxl/modular.ts` (Modular decoding: MA trees, predictors, the self-correcting predictor, transforms), `src/codecs/jxl/frame.ts` (the sections of frames, the order of the rendering stages, reference frames), `src/codecs/jxl/blend.ts`, `src/codecs/jxl/color.ts` (XYB to RGB), `src/codecs/jxl/features.ts` (rendering patches, splines and noise), `src/codecs/jxl/fast-lossless.ts` (the lossless encoder: palette detection, YCoCg, the gradient predictor, prefix codes, runs as LZ77, the headers) | BSD-3-Clause |
@@ -188,6 +189,41 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
188
189
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
189
190
```
190
191
192
+
## libaom
193
+
194
+
The AV1 encoder's symbol encoder and forward Walsh-Hadamard transform are ported from libaom, the AV1 reference
195
+
implementation, as are its guess of the loop filter level and the quantizer table of the quality. AV1 is covered by the
196
+
[Alliance for Open Media Patent License 1.0](https://aomedia.org/license/patent-license/).
197
+
198
+
```
199
+
Copyright (c) 2016, Alliance for Open Media. All rights reserved.
200
+
201
+
Redistribution and use in source and binary forms, with or without
202
+
modification, are permitted provided that the following conditions
203
+
are met:
204
+
205
+
1. Redistributions of source code must retain the above copyright
206
+
notice, this list of conditions and the following disclaimer.
207
+
208
+
2. Redistributions in binary form must reproduce the above copyright
209
+
notice, this list of conditions and the following disclaimer in
210
+
the documentation and/or other materials provided with the
211
+
distribution.
212
+
213
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
214
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
215
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
216
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
217
+
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
218
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
219
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
220
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
221
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
222
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
223
+
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
224
+
POSSIBILITY OF SUCH DAMAGE.
225
+
```
226
+
191
227
## libavif
192
228
193
229
The conversion of decoded AVIFs to RGB reproduces libavif's reference conversion (in floating point, with bilinear
0 commit comments