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>
* Dev profile: line tables only for workspace crates, no debug info for dependencies
* xtask ci: dev-profile gate, nextest, tests without examples, wasm --keep-going
* One integration-test binary per crate
* xtask ci: run effectcraft-gpu's shared-device tests in one cargo test process
* xtask ci: run every stage and report all failures
* xtask ci: name the stage type (clippy type_complexity)
* xtask ci: run every test pass and report all failures
* cargo fmt
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>
FilmCraft's AV1 decoder now frame-threads by default, so a picture may
come out of a later decode call; the round-trip check wants each
packet's picture from its own call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>