use crate::{adaptive_quant, dct, enc_ac_strategy, enc_group, enc_xyb};
#[derive(Clone, Copy)]
pub(crate) struct EncodingContext {
pub(crate) to_xyb_band: enc_xyb::ToXybBandFn,
pub(crate) fill_quant_field: adaptive_quant::FillQuantFieldFn,
pub(crate) sse_and_rate: enc_ac_strategy::SseAndRateFn,
pub(crate) rate_log2_lut: &'static enc_ac_strategy::RateLog2Lut,
pub(crate) quantize_block_ac: enc_group::QuantizeBlockAcFn,
pub(crate) dct8x8: &'static dct::DctFn<64>,
pub(crate) dct8x16: &'static dct::DctFn<128>,
pub(crate) dct16x8: &'static dct::DctFn<128>,
pub(crate) dct16x16: &'static dct::DctFn<256>,
pub(crate) dct4x4: &'static dct::DctFn<64>,
pub(crate) dct4x8: &'static dct::DctFn<64>,
pub(crate) dct8x4: &'static dct::DctFn<64>,
pub(crate) dct32x32: &'static dct::DctFn<1024>,
pub(crate) dct32x16: &'static dct::DctFn<512>,
pub(crate) dct16x32: &'static dct::DctFn<512>,
}
impl EncodingContext {
pub(crate) fn new() -> Self {
Self {
to_xyb_band: enc_xyb::selected_to_xyb_band_fn(),
fill_quant_field: adaptive_quant::selected_fill_quant_field_fn(),
sse_and_rate: enc_ac_strategy::selected_sse_and_rate_fn(),
rate_log2_lut: enc_ac_strategy::rate_log2_lut(),
quantize_block_ac: enc_group::selected_quantize_block_ac_fn(),
dct8x8: dct::selected_dct8x8(),
dct8x16: dct::selected_dct8x16(),
dct16x8: dct::selected_dct16x8(),
dct16x16: dct::selected_dct16x16(),
dct4x4: dct::selected_dct4x4(),
dct4x8: dct::selected_dct4x8(),
dct8x4: dct::selected_dct8x4(),
dct32x32: dct::selected_dct32x32(),
dct32x16: dct::selected_dct32x16(),
dct16x32: dct::selected_dct16x32(),
}
}
}
impl Default for EncodingContext {
#[inline]
fn default() -> Self {
Self::new()
}
}