Skip to main content

Module decode_bench

Module decode_bench 

Source
Expand description

Prepared per-stage workloads for the HEVC decoder benchmark.

crates/zvidlib-av1/benches/codec.rs is an external crate and the HEVC engine (crate::engine) is crate-private, so a benchmark cannot reach the individual decode stages the way it reaches the public AV1 kernels. This module is the narrow surface that closes that gap: one prepared workload per hot stage, each with its input construction in HevcStageInputs::new and only the kernel under test inside the run_* method.

Every run_* method returns the eight bytes of an FNV-1a fold over all of the samples the stage produced. The bytes exist for the benchmark harness’s bit-exactness guard, which compares one instruction set’s arm against the scalar arm; folding rather than returning the samples themselves keeps a multi-megabyte allocation out of the timed loop, and the fold still depends on every output sample, so a backend that diverged anywhere changes it.

None of these methods pin an instruction set. They call the same entry points the decoder calls, which resolve through crate::simd::set_override, so the caller selects the arm exactly as it does for a whole-frame decode.

Structs§

HevcStageInputs
Prepared inputs for every HEVC stage the benchmark times.

Functions§

decode_frames
Decodes frames frames of samples and stops at the decoded Picture.
decode_pictures