Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ All notable changes to this project are documented here. The format follows
- The binary uses the library's codec modules instead of compiling its own copies.
- `Cargo.toml` records the license, repository, readme and keywords, and sets `rust-version = 1.89`.
- The library and binary are built with `#![forbid(unsafe_code)]`.
- README and docs/STANDARDS.md state the patent position of each format. The licence grants no rights under third-party patents.

### Fixed

- The JPEG and FLAC decoders no longer panic or allocate without bound on malformed input; regression tests are in `tests/fuzz_regressions.rs`.
- Debug builds no longer panic on the AV1 boolean and coefficient decoding paths. Release
output is unchanged.
- Malformed input can no longer make the decoders panic, hang or over-allocate. Four cases found
Expand Down
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ partial or encode-only. The per-format table below and [ROADMAP.md](ROADMAP.md)
authoritative status. Nothing here is a claim of conformance with a specification beyond what
the tests check.

## Patents and licensing: open decision
## Patents and licensing

**This section must be read before the crate is distributed.** It is not resolved.
transcode is licensed under the Apache License, Version 2.0. The licence covers this code. It does
not license anyone under another party's patents.

- Several formats in this crate are covered by patents in some jurisdictions. H.264 and AAC are
the main examples, and both are licensed through patent pools. MP3 patents have largely
expired, but the position varies by country. The MP4, MKV and HEIF writers carry H.264 here, so the same
questions apply to their output. Container licensing has not been reviewed.
- AV1 is described by its licensors as royalty-free under published terms. That is not the same
as a statement that no patent applies.
- Nothing in this repository is a patent search, a licensing opinion, or a grant of patent
rights. Do not describe the crate as patent-free.
- Maintainers need to decide, with counsel, whether and how these codecs are published. That
decision is tracked as an open item in [docs/OPENSSF.md](docs/OPENSSF.md).
Several formats in this crate are covered by patents in some jurisdictions. H.264 and AAC are
licensed through patent pools (Via LA), and royalties can apply to products that ship an encoder or
decoder for them. The MP4, MKV and HEIF writers carry H.264, so the same applies to their output.
MP3's licensing program ended in 2017, and AV1 is offered royalty-free under AOMedia's published
terms. [docs/STANDARDS.md](docs/STANDARDS.md) has the position for every format, with sources and
how each was checked.

Publishing source does not remove the need for a patent licence in a product. If you ship software
that includes these codecs, you are responsible for the licences it needs. All modules in this
repository are published.

## What works today

Expand Down Expand Up @@ -57,14 +58,14 @@ understood for each one, with a link to check it.

- **Described as royalty-free by their publishers:** PNG (W3C), FLAC (Xiph), Opus (IETF RFC 6716),
AV1 (AOMedia royalty-free patent licence), WebP (Google royalty-free patent licence).
- **Patent-pool or unclear:** H.264 and AAC (patent pools; royalties can apply), MP3 (core patents
understood to have expired, but the position varies by country), and JPEG (baseline understood
to be royalty-free; to be confirmed).
- **Patent-pool:** H.264 and AAC (Via LA pools; royalties can apply to products).
- **Patents expired or understood royalty-free:** MP3 (licensing program ended April 2017; other
jurisdictions not checked) and baseline JPEG.
- **Containers:** the MP4, Matroska and HEIF writers carry H.264 here, so the H.264 position applies
to their output. The Motion-JPEG AVI writer is not an ISO standard and was not reviewed.

An open standard is not automatically royalty-free. The publication status of each row has not
been checked against its primary source yet; see the "Verified" column in docs/STANDARDS.md.
An open standard is not automatically royalty-free. Several rows were checked only against
secondary sources; see the "Source check" column in docs/STANDARDS.md.

This crate is a codec implementation. It is not certified against any conformance suite and is
not a licensed product from any codec vendor.
Expand Down Expand Up @@ -140,4 +141,4 @@ an external-decoder check where one exists, and a note on patent status for revi
Apache License, Version 2.0. See [LICENSE](LICENSE).

The licence covers this code only. It grants no rights under any patent that applies to a format
this crate decodes or encodes; see the patent note above.
this crate decodes or encodes; see [Patents and licensing](#patents-and-licensing).
6 changes: 2 additions & 4 deletions docs/OPENSSF.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ been created or recorded here.

1. **CODEOWNERS.** Resolved. `.github/CODEOWNERS` lists `@twn-lloyd @yokoszn`, two human owners,
as the owners instructed. The ruleset still needs applying (item 6). No bot accounts are listed.
2. **Patents and standards.** The per-format position is in docs/STANDARDS.md. Every row is still
unverified against its primary source, and H.264, AAC, MP3 and the containers that carry them
need counsel's review before publication. **Human**
4. **Contacts.** Resolved. SECURITY.md lists security@twn.systems and CODE_OF_CONDUCT.md lists
2. **Patents and licensing.** Resolved. The code is Apache-2.0, all modules are published, and the README and docs/STANDARDS.md state the patent position of each format and that the licence grants no rights under third-party patents.
3. **Contacts.** Resolved. SECURITY.md lists security@twn.systems and CODE_OF_CONDUCT.md lists
hello@twn.systems, alongside GitHub private reporting.
5. **Visibility.** The repository is private. Scorecard publishing, the badges and
dependency-review on private repositories (which needs GitHub Advanced Security) depend on this.
Expand Down
54 changes: 32 additions & 22 deletions docs/STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This page lists, for each format this crate decodes or encodes, the specification it follows, who
publishes that specification, and what is understood about its licensing and patent position.
It is written so a maintainer or a counsel can check each row quickly.
Each row links to the source to check.

## Read this first

Expand All @@ -12,51 +12,61 @@ It is written so a maintainer or a counsel can check each row quickly.
- **This is a codec implementation, not a certified or licensed product.** Nothing here is
conformance-certified, and no codec vendor has licensed this code. The crate writes and reads
bytes; whether using those bytes needs a patent licence is a separate question.
- **Nothing here is legal advice.** Each row must be reviewed by counsel before the crate is
published or used commercially. See the decision list at the end.
- **Nothing here is legal advice.** It records what the maintainers understand, with sources.
Check the sources yourself before you ship a product built on these formats. See
[Using this code in a product](#using-this-code-in-a-product).

## Verification status

**The rows below were not verified against their primary sources in the session that wrote this
page.** Outbound DNS to the standards hosts (`www.w3.org`, `xiph.org`, `www.rfc-editor.org`,
`aomedia.org`, `developers.google.com`, `www.itu.int`, `via-la.com`, `www.matroska.org`) failed
from that environment. Each row gives the URL to check. Mark a row "verified" only after its
source has been read.
The "Source check" column says how each row was checked.

- **Secondary** means the position was read in secondary sources (news reports, mailing-list and
forum posts quoting the licensor's FAQ). The licensor's own page was not read.
- **No** means the row has not been checked against any source.

The primary hosts (`www.w3.org`, `xiph.org`, `www.rfc-editor.org`, `aomedia.org`,
`developers.google.com`, `www.itu.int`, `www.via-la.com`, `www.matroska.org`) could not be reached
from the environment that wrote this page. Each row gives the URL to check.

## Formats

| Format | Crate module(s) | Specification and body | Licensing and patent position (as understood) | Verified |
| Format | Crate module(s) | Specification and body | Licensing and patent position (as understood) | Source check |
|---|---|---|---|---|
| PNG, RGBA8, non-interlaced | `src/png.rs` | PNG Specification, Third Edition. W3C Recommendation, identified as ISO/IEC 15948 | Published by the W3C under its Patent Policy, which provides royalty-free licensing. Source: https://www.w3.org/TR/png-3/ | No |
| JPEG, baseline sequential | `src/jpeg.rs`, `src/mjpeg.rs` | ITU-T T.81, equivalent to ISO/IEC 10918-1. ITU-T and ISO/IEC JPEG committee | The specification is freely downloadable. Baseline JPEG is widely treated as royalty-free, and the main early patent claims are understood to have expired. Confirm with counsel. Source: https://www.itu.int/rec/T-REC-T.81 | No |
| JPEG, baseline sequential | `src/jpeg.rs`, `src/mjpeg.rs` | ITU-T T.81, equivalent to ISO/IEC 10918-1. ITU-T and ISO/IEC JPEG committee | The specification is freely downloadable. Baseline JPEG is widely treated as royalty-free, and the main early patent claims are understood to have expired. Source: https://www.itu.int/rec/T-REC-T.81 | No |
| WebP, VP8L lossless | `src/webp.rs` | WebP Lossless Bitstream Specification. Google | Google states a royalty-free patent licence for WebP. The reference library, libwebp, is BSD-3-Clause. Source: https://developers.google.com/speed/webp/docs/webp-lossless-bitstream-specification and https://developers.google.com/speed/webp/faq | No |
| RIFF WAVE, PCM | `src/main.rs`, `src/codec.rs` (CLI path) | RIFF/WAVE, as documented by Microsoft and IBM in the Multimedia Programming Interface and Data Specifications 1.0 (1991). No standards body | Not reviewed. The format is old and widely implemented; no licence requirement has been identified, but that has not been checked. | No |
| FLAC | `src/flac.rs` | FLAC format specification. Xiph.Org Foundation | Documented by Xiph as free to use with no royalties; the reference implementation is BSD-licensed. Source: https://xiph.org/flac/format.html | No |
| SLAC | `src/codec.rs` | This crate's own container. No external specification | Covered by this crate's licence. Nothing external to license. | Not applicable |
| MP3, Layer III decode | `src/mp3.rs` | ISO/IEC 11172-3 (MPEG-1 audio), ISO/IEC 13818-3 (MPEG-2 audio) | The core MP3 patents are understood to have expired in most jurisdictions, but the position varies by country, so this is not a clean grant. Confirm with counsel. Source: https://www.iso.org/standard/22412.html | No |
| AAC-LC in ADTS, encode and decode | `src/aac.rs`, `src/aac_tables.rs` | ISO/IEC 13818-7 (MPEG-2 AAC), ISO/IEC 14496-3 (MPEG-4 Audio) | Patents are licensed through the Via LA AAC patent pool. Royalties can apply. Source: https://via-la.com/licensing-programs/aac/ | No |
| MP3, Layer III decode | `src/mp3.rs` | ISO/IEC 11172-3 (MPEG-1 audio), ISO/IEC 13818-3 (MPEG-2 audio) | Fraunhofer and Technicolor ended their MP3 licensing program on 23 April 2017. Secondary sources report that the last US patent in the program expired on 16 April 2017 and that the core EU patents had expired by 2012. Other jurisdictions were not checked. Source: https://www.iso.org/standard/22412.html | Secondary |
| AAC-LC in ADTS, encode and decode | `src/aac.rs`, `src/aac_tables.rs` | ISO/IEC 13818-7 (MPEG-2 AAC), ISO/IEC 14496-3 (MPEG-4 Audio) | Patents are licensed through the Via LA AAC patent pool. Secondary sources quote Via LA's AAC FAQ as saying that manufacturers and developers of end-user encoder or decoder products need a licence, and that implementations, including open-source ones, may need licences from the patent holders. Royalties can apply. Source: https://via-la.com/licensing-programs/aac/ | Secondary |
| Opus, Ogg demux and TOC parsing | `src/opus.rs`, `src/opus_tables.rs` | RFC 6716 (Opus codec), RFC 7845 (Ogg encapsulation). IETF | Opus is documented in the RFCs as royalty-free, with IPR declarations in the RFC record. Packet-to-PCM decode is not implemented. Sources: https://www.rfc-editor.org/rfc/rfc6716 and https://www.rfc-editor.org/rfc/rfc7845 | No |
| H.264 (AVC), Annex B, intra and P-skip encode | `src/h264.rs`, `src/h264_intra.rs`, `src/h264_inter.rs`, `src/h264_i4x4.rs`, `src/h264bits.rs`, `src/h264_cavlc_tables.rs` | ITU-T H.264, equivalent to ISO/IEC 14496-10 | Patents are licensed through the Via LA AVC patent pool. Royalties apply above the pool's thresholds, with stated exceptions. **This is the highest-risk row in this crate.** Source: https://via-la.com/licensing-programs/avc/ and https://www.itu.int/rec/T-REC-H.264 | No |
| H.264 (AVC), Annex B, intra and P-skip encode | `src/h264.rs`, `src/h264_intra.rs`, `src/h264_inter.rs`, `src/h264_i4x4.rs`, `src/h264bits.rs`, `src/h264_cavlc_tables.rs` | ITU-T H.264, equivalent to ISO/IEC 14496-10 | Patents are licensed through the Via LA AVC patent pool. Royalties apply above the pool's thresholds, with stated exceptions. Publishing source code does not license the patents: Cisco released OpenH264 under the BSD licence, covers the pool royalties only for the binaries it distributes, and tells others to get their own licence. **This is the row with the most patent exposure in this crate.** Source: https://via-la.com/licensing-programs/avc/ and https://www.itu.int/rec/T-REC-H.264 | Secondary |
| AV1, keyframe OBU encode | `src/av1_obu.rs`, `src/av1_frame.rs`, `src/av1_intra.rs`, `src/av1_coef.rs`, `src/av1_coef_tables.rs`, `src/av1_ec.rs`, `src/av1_dct.rs` | AV1 Bitstream and Decoding Process Specification. Alliance for Open Media (AOMedia) | AOMedia publishes a royalty-free patent licence for AV1. Its terms include a termination condition if a licensee sues over AV1. A royalty-free licence is not a statement that no patent applies. Source: https://aomedia.org/license/patent-license/ | No |
| MP4 writer | `src/mp4.rs` | ISO/IEC 14496-12 (ISO base media file format), ISO/IEC 14496-14 (MP4 file format) | Container only. Not reviewed. The writer carries H.264 by default, so the H.264 row applies to its output. | No |
| Matroska (MKV) writer | `src/mkv.rs` | Matroska specification. matroska.org | Container only. The licence of the published specification was not verified. The writer carries H.264, so the H.264 row applies to its output. Source: https://www.matroska.org/technical/specs/index.html | No |
| HEIF writer | `src/heif.rs` | ISO/IEC 23008-12 (HEIF). ISO/IEC | Container only. The image coding here is H.264, so the H.264 row applies to its output. Not reviewed beyond that. | No |
| Motion JPEG in AVI | `src/mjpeg.rs` | RIFF AVI, as documented by Microsoft. Frames are JPEG (ITU-T T.81) | AVI is not an ISO standard and its licence was not reviewed. The JPEG frames follow the JPEG row. | No |

Two formats named in the repository description are **not implemented** in this source tree:
NIfTI and HDF5. This page does not cover them. Do not cite them as supported.
NIfTI and HDF5 are **not implemented** in this source tree and are not covered here.

## What the licence covers

The crate's own code is licensed under the Apache License, Version 2.0 (`LICENSE`,
`license = "Apache-2.0"` in `Cargo.toml`). That licence covers this code only. It grants no rights
under any patent that applies to a format above.

## Decisions for the owners
## Using this code in a product

Publishing this source under Apache-2.0 does not license anyone under another party's patents.
That is true of every open-source codec, and it is the position Cisco's OpenH264 states.

1. **Patent review (H.264, AAC, and the MP4, MKV and HEIF writers that carry H.264).** Counsel must
review each row before the crate is published. Until then the README must not describe the
crate as patent-free.
2. **MP3 and JPEG.** Confirm the expiry dates and jurisdictions with counsel.
3. **Verification of every row.** Read each primary source above and mark the "Verified" column.
4. **Publication.** Whether to publish any encoder that writes H.264 or AAC at all.
- **Using the source or the library.** You are responsible for the patent licences your own product
needs. For H.264 and AAC, check with the patent pool (Via LA) before you ship an encoder or
decoder to end users.
- **Formats without a pool.** PNG, WebP, FLAC, Opus and AV1 are published by their authors under
royalty-free terms (see the rows above). Those terms still carry conditions. Read them.
- **Containers.** The MP4, Matroska and HEIF writers carry H.264 here, so the H.264 row applies to
their output.
- **No code is withheld.** All modules in this repository are published. Which codecs you build
in, or ship, is your decision.
Loading
Loading