Skip to content

Commit b855aea

Browse files
matmenclaude
andcommitted
credit RFC 9649 for the WebP container and lossless codec
The short distance code table is taken from the RFC, whose code components come under the Revised BSD License: the notice is in the vp8l.ts header and THIRD_PARTY_NOTICES.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ljnxm1Qjrocq1izGajLx8J
1 parent 362575c commit b855aea

4 files changed

Lines changed: 35 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The deflate/inflate implementation is derived from [fflate](https://github.com/1
8787
[Fast CRC32 in JavaScript](https://gist.github.com/101arrowz/e58695f7ccfdf74f60ba22018093edea), both by Arjun Barrett.
8888
The JPEG codec is based in part on the work of the Independent JPEG Group (libjpeg) and on
8989
[pdf.js](https://github.com/mozilla/pdf.js), the glyph rasterizer is translated from
90-
[font-rs](https://github.com/raphlinus/font-rs). The WebP decoder follows [RFC 6386](https://www.rfc-editor.org/rfc/rfc6386)
90+
[font-rs](https://github.com/raphlinus/font-rs). The WebP codecs follow [RFC 9649](https://www.rfc-editor.org/rfc/rfc9649) and [RFC 6386](https://www.rfc-editor.org/rfc/rfc6386)
9191
and reproduces [libwebp](https://chromium.googlesource.com/webm/libwebp)'s color conversion. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for their licenses.
9292

9393
---

‎THIRD_PARTY_NOTICES.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ following projects, under their own licenses. Each derived file says so in its h
1010
| [libjpeg](https://ijg.org/) / [libjpeg-turbo](https://libjpeg-turbo.org/) by the Independent JPEG Group | `src/codecs/jpeg.ts` (IDCT, FDCT, upsampling, color conversion, progressive refinement, optimal Huffman tables) | IJG |
1111
| [pdf.js](https://github.com/mozilla/pdf.js) (forked from [jpgjs](https://github.com/notmasteryet/jpgjs) by notmasteryet) | `src/codecs/jpeg.ts` (structure of the scan decoder) | Apache-2.0 |
1212
| [font-rs](https://github.com/raphlinus/font-rs) by Raph Levien | `src/render/text.ts` (the `Rasterizer` class, also used for SVGs) | Apache-2.0 |
13+
| [RFC 9649](https://www.rfc-editor.org/rfc/rfc9649) (WebP Image Format) | `src/codecs/vp8l.ts` (lossless bitstream, short distance code table), `src/codecs/webp.ts` (container) | BSD-3-Clause (Revised BSD) |
1314
| [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 |
1415
| [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) | BSD-3-Clause |
1516

@@ -115,3 +116,29 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
115116
```
116117

117118
The RFC's reference decoder additionally comes with Google's patent grant for VP8 (RFC 6386 section 20.27).
119+
120+
## RFC 9649
121+
122+
The WebP container and the lossless (VP8L) codec follow RFC 9649, the short distance code table is taken from it.
123+
124+
```
125+
Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved.
126+
127+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
128+
following conditions are met:
129+
130+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following
131+
disclaimer.
132+
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
133+
following disclaimer in the documentation and/or other materials provided with the distribution.
134+
- Neither the name of Internet Society, IETF or IETF Trust, nor the names of specific contributors, may be used to
135+
endorse or promote products derived from this software without specific prior written permission.
136+
137+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
138+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
139+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
140+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
141+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
142+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
143+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
144+
```

‎src/codecs/vp8l.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// WebP lossless (VP8L) bitstream, as specified in RFC 9649 section 3 onwards
1+
/*!
2+
* WebP lossless (VP8L) bitstream, as specified in RFC 9649 ("WebP Image Format") section 3 onwards, including its
3+
* table of short distance codes. Copyright (c) 2024 IETF Trust and the persons identified as the document authors,
4+
* Revised BSD License (see THIRD_PARTY_NOTICES.md)
5+
*/
26

37
/** decoded VP8L image: ARGB pixels (0xAARRGGBB) */
48
export interface VP8LImage {

‎src/codecs/webp.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* WebP container. Animation frames are blended with libwebp's integer arithmetic (Copyright (c) 2010 Google Inc., BSD
33
* license, see THIRD_PARTY_NOTICES.md)
44
*/
5-
// RIFF container (RFC 9649): simple lossy/lossless files, extended files with alpha and animation
5+
// RIFF container (RFC 9649, https://www.rfc-editor.org/rfc/rfc9649): simple lossy/lossless files, extended files with
6+
// alpha and animation
67
import * as vp8l from './vp8l.ts';
78
import * as vp8 from './vp8.ts';
89
import { orientation as exifOrientation } from './exif.ts';

0 commit comments

Comments
 (0)