1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! SIMD acceleration for rusty_h264 — **portable Rust intrinsics**, with a shrinking
//! remainder of vendored openh264 x86 assembly.
//!
//! This crate is deliberately **not** `#![forbid(unsafe_code)]`: it is the one place
//! `unsafe` lives, behind safe wrappers, so the codec core stays `forbid(unsafe)`.
//!
//! ## Structure, and where it is going
//!
//! `docs/add_SIMD_rip_ASM.md` is ripping the assembly out kernel by kernel. Two things
//! follow from that, and this file is arranged around them:
//!
//! * **`x86_asm`** holds everything still backed by openh264 NASM. It is gated on
//! `target_arch = "x86_64"` and shrinks with every phase of the campaign.
//! * **Portable modules** (`chroma_mc`, …) hold Rust intrinsics with an x86-64 path, an
//! aarch64 NEON path, and a scalar reference that all three are tested bit-identical
//! against. These compile and run on **every** architecture.
//!
//! Until the campaign finishes, the crate is a mix. The whole crate used to be
//! `#![cfg(target_arch = "x86_64")]` — compiled to nothing on ARM, which is why aarch64
//! ran fully scalar. That gate now sits on the `x86_asm` module alone, so portable
//! kernels reach ARM as they land.
//!
//! **Order matters: replace, then rip.** The vendored assembly measures ~1.94x on decode
//! (paired, N=5, 34/35 reps above 1.0), so deleting a kernel before its portable
//! replacement is bit-identical and no slower would ship a real regression.
//!
//! openh264 asm is BSD-2 licensed; attribution lives in `vendor/LICENSE.openh264`.
// --- portable: every architecture --------------------------------------------------
pub use ;
pub use ;
// Portable transform/quant. MEASURED SLOWER than the openh264 assembly on x86-64
// (fast preset 1.253 against a 12.7% floor; quality 1.031, within floor), so x86-64
// keeps the assembly and this serves every OTHER architecture — which previously had
// no implementation at all. Reopen the x86 swap with SIMD intrinsics; the scalar
// shape was not enough here, unlike the 4x4 kernels LLVM does vectorise well.
pub use ;
pub use ;
pub use ;
// --- still assembly-backed: x86-64 only ---------------------------------------------
pub use *;