pub struct HevcStageInputs { /* private fields */ }Expand description
Prepared inputs for every HEVC stage the benchmark times.
Construction is the setup half — plane allocation, content generation, reference-sample and coefficient-block construction, CABAC bitstream synthesis — and never appears inside a timed loop.
Implementations§
Source§impl HevcStageInputs
impl HevcStageInputs
Sourcepub fn new(width: usize, height: usize) -> Self
pub fn new(width: usize, height: usize) -> Self
Builds every stage’s inputs for a width x height luma frame.
§Panics
Panics if the dimensions are not a multiple of the 64-sample CTB the SAO stage is driven at, or if either is zero.
Sourcepub fn inter_pred_samples(&self) -> u64
pub fn inter_pred_samples(&self) -> u64
Luma samples the inter-prediction stage writes per run.
Luma only, so the figure stays comparable with the one this group reported before it predicted chroma; each of these samples brings half a chroma sample of §8.5.3.3.3.3 work with it at 4:2:0.
Sourcepub fn intra_pred_samples(&self) -> u64
pub fn intra_pred_samples(&self) -> u64
Samples the intra-prediction stage writes per run.
Sourcepub fn deblock_samples(&self) -> u64
pub fn deblock_samples(&self) -> u64
Luma samples the deblocking stage rewrites per run.
Sourcepub fn sao_samples(&self) -> u64
pub fn sao_samples(&self) -> u64
Samples the SAO stage classifies per run, luma plus chroma.
Counts only the CTBs SAO_CTB_MIX leaves switched on, since a CTB
with SaoTypeIdx == 0 is returned from before it reads a sample. On the
measured mix that is a small minority of the picture, which is the
point: the throughput this divides is the classifiers’, not the frame’s.
Sourcepub fn inverse_transform_samples(&self) -> u64
pub fn inverse_transform_samples(&self) -> u64
Residual samples the inverse-transform stage produces per run.
Sourcepub fn color_convert_samples(&self) -> u64
pub fn color_convert_samples(&self) -> u64
Samples the output-conversion stage writes per run, one RGBA pixel each.
Sourcepub fn cabac_bins(&self) -> u64
pub fn cabac_bins(&self) -> u64
Bins the entropy stage decodes per run.
Sourcepub fn run_inter_pred(&self) -> Vec<u8> ⓘ
pub fn run_inter_pred(&self) -> Vec<u8> ⓘ
§8.5.3.3 — fractional-sample interpolation and the weighted combine, over the prediction-unit mix a real decode runs.
Each scheduled unit interpolates its luma through the §8.5.3.3.3.2
8-tap filter and, at 4:2:0, its Cb and Cr through the §8.5.3.3.3.3
4-tap filter, once per used reference list, and combines the result
through the §8.5.3.3.4.2 default weighted prediction. Every one of
those is a vectorized filter_taps / combine_weighted primitive.
The unit sizes, the uni/bi split and the presence of chroma all come
from INTER_PU_MIX, which is measured rather than chosen; see that
constant for what the uniform 16x16 bi-predicted luma-only grid this
replaced was getting wrong.
§Panics
Panics if the prepared planes no longer match their dimensions.
Sourcepub fn run_intra_pred(&self) -> Vec<u8> ⓘ
pub fn run_intra_pred(&self) -> Vec<u8> ⓘ
§8.4.4.2 — reference-sample smoothing and the planar / DC / angular predictors, over every mode at every transform-block size.
Sourcepub fn run_deblock(&self) -> Vec<u8> ⓘ
pub fn run_deblock(&self) -> Vec<u8> ⓘ
§8.7.2.5.4 — the luma block-edge deblocking filter over a whole frame’s worth of vertical edge segments.
bS == 2 and a high QP put the §8.7.2.5.3 thresholds where the strong
filter is reachable; the plane’s flat bands are what actually reach it.
Sourcepub fn run_sao(&self) -> Vec<u8> ⓘ
pub fn run_sao(&self) -> Vec<u8> ⓘ
§8.7.3 — sample adaptive offset over every CTB of a full picture, with both the band-offset and the edge-offset classifiers in the grid.
Sourcepub fn run_inverse_transform(&self) -> Vec<u8> ⓘ
pub fn run_inverse_transform(&self) -> Vec<u8> ⓘ
§8.6.2 / §8.6.3 / §8.6.4 — dequantization and the inverse transform, at every transform-block size and for both the DCT and the 4x4 intra DST.
Sourcepub fn run_color_convert(&self) -> Vec<u8> ⓘ
pub fn run_color_convert(&self) -> Vec<u8> ⓘ
The YUV420-to-RGBA output conversion every whole-frame decode ends in.
Issue #220: this stage is not decoding, but it was a third of what the
whole-frame groups measure (see benches/README.md), so it is timed
directly rather than inferred by subtracting one whole-frame group from
another. Issue #219 gave it the color_convert kernel family, so its
arms now separate by instruction set like the decoding stages do, and
this group is what reports that.
§Panics
Panics if the prepared picture no longer converts.
Sourcepub fn run_cabac(&self) -> Vec<u8> ⓘ
pub fn run_cabac(&self) -> Vec<u8> ⓘ
§9.3.4 — the CABAC arithmetic decoder’s bin loop.
This stage has no vector path and is not expected to grow one: the
arithmetic decoder is inherently serial, each bin’s range update
depending on the previous one’s. It is measured because it is the serial
fraction that bounds what vectorizing everything else can buy — the
residual parser in engine::residual spends essentially all of its time
in these two calls, so their throughput is the Amdahl ceiling for the
whole-frame arms.
The mixture is roughly the context-coded / bypass split of residual parsing: three context-coded decisions per bypass bin.