Commit Graph
8 Commits
Author SHA1 Message Date
vangel76andClaude Sonnet 5.5 12af1c19cb av1enc: truncate instead of floor, log2 lookup table, skip division in the dead zone
The quantiser in try_tx called libm floorf for every coefficient, estimate_bits
and the motion-vector cost called f64::log2, and coefficients that quantise to
zero still went through an f32 division.

- (x / q + rnd).floor() as i32 becomes (x / q + rnd) as i32: the operand is
  never negative, so truncation equals floor.
- log2 of small integers comes from a table built with the same f64::log2
  call (estimate_bits and the MV cost in motion_search), so the values are
  bit-identical.
- Coefficients below an exact per-(q, rounding offset) threshold are zero
  without dividing. The threshold is found once per Decider by a binary
  search over f32 bit patterns of the monotone quantiser expression.

The encoded stream is unchanged. Unit tests compare the new quantiser with the
old expression at the threshold boundary and on random values for every
quantiser index, and the table with f64::log2.

Fixes #2373

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 12:13:44 +01:00
Brandon ThomasandClaude Opus 5.5 ee90d87742 Never crash: AV1 encoder without expect()/unreachable!()
Replaces the encoder's 11 expect()/unreachable!() calls on internal invariants with handling
that can't panic: the rate-control state is passed in rather than re-borrowed, inter decisions
without a reference frame fall back to intra, per-plane results are bound directly, and the
writer's impossible branches become debug_asserts. Denies the panic lints in the crate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 13:22:59 -04:00
Brandon ThomasandClaude Opus 5.5 04e2e6b898 M13.4: av1enc SATD intra mode ranking, intra benches
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 07:12:59 -04:00
Brandon ThomasandClaude Opus 5.5 88ca7b45fc M13.4: av1enc speedups (vectorisable forward transform, separable sub-sample paths, cheaper loop filter search), more oracle cases
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 05:40:03 -04:00
Brandon ThomasandClaude Opus 5.5 22ec8daf65 M13.4: av1enc frame-to-frame CDF carry-over, intra mode and transform type RD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 05:30:08 -04:00
Brandon ThomasandClaude Opus 5.5 917e5f7ae8 M13.4: av1enc sub-sample motion search, deblocking loop filter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 05:26:15 -04:00
Brandon ThomasandClaude Opus 5.5 4130172bbe M13.4: av1enc key and inter frames, bit-exact with libdav1d
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 05:11:08 -04:00
Brandon ThomasandClaude Opus 5.5 3a8b401e81 M13.4: hevcenc / av1enc crate skeletons (API contract, layers)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 04:42:12 -04:00