Documentation
/*
 * // Copyright (c) Radzivon Bartoshyk 6/2026. All rights reserved.
 * //
 * // Redistribution and use in source and binary forms, with or without modification,
 * // are permitted provided that the following conditions are met:
 * //
 * // 1.  Redistributions of source code must retain the above copyright notice, this
 * // list of conditions and the following disclaimer.
 * //
 * // 2.  Redistributions in binary form must reproduce the above copyright notice,
 * // this list of conditions and the following disclaimer in the documentation
 * // and/or other materials provided with the distribution.
 * //
 * // 3.  Neither the name of the copyright holder nor the names of its
 * // contributors may be used to endorse or promote products derived from
 * // this software without specific prior written permission.
 * //
 * // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
mod ac_strategy;
mod adaptive_quant;
mod afv;
mod cfl;
#[cfg(feature = "extraslow")]
mod coef_polish;
mod color;
mod dc_ops;
mod dct;
mod divide;
mod entropy;
mod haar;
mod inflated_cost;
mod ink_layer;
mod lossless_grad;
mod lossless_search;
#[cfg(target_arch = "x86_64")]
mod lz_match;
mod modular;
mod noise;
mod quant;
mod quantize_xyb;
#[cfg(feature = "splines")]
mod splines;
mod xyb;

pub(crate) use ac_strategy::{
    gradient_region_stats_sse41, gradient_region_stats_with_chroma_sse41, sse_and_rate_sse,
    sse_and_rate_sse_impl,
};
pub(crate) use adaptive_quant::fill_quant_field;
pub(crate) use afv::{afv0_sse41, afv1_sse41, afv2_sse41, afv3_sse41};
pub(crate) use cfl::{cfl_rd_cost_sse41, cfl_rd_costs_sse41, cfl_rdo_refill_sse41};
pub(crate) use color::color_matrix_shaper_sse41;
pub(crate) use dc_ops::{
    add_scaled_sse41, adjust_b_dc_sse41, compensate_b_dc_sse41, dc_distortion_row_sse41,
    dc_error_row_sse41, reconstruct_dc_sse41,
};

pub(crate) use divide::rounded_quotients_sse41;
pub(crate) use entropy::counts_bit_cost_sse41;
pub(crate) use haar::haar_rows_sse41;
pub(crate) use inflated_cost::{
    combine_error_sse41, error_gradient_energy_sse41, error_gradient_peak_energy_sse41,
    rgb_hue_chroma_edge_loss_sse41,
};
pub(crate) use ink_layer::{luma_row_sse41, ridge_row_sse41};
pub(crate) use lossless_grad::grad_pack_interior;
pub(crate) use lossless_search::{palette_row_sse41, rct_row_sse41};
#[cfg(target_arch = "x86_64")]
pub(crate) use lz_match::{match_len_compact_sse2, match_len_sse2};
pub(crate) use modular::{
    tokenize_alpha_u8_first_row_sse41, tokenize_alpha_u8_interior_sse41,
    tokenize_alpha_u16_first_row_sse41, tokenize_alpha_u16_interior_sse41,
};
pub(crate) use noise::{
    noise_laplacian_stats_sse41, noise_shrink_sse41, noise_texture_score_sse41,
};
pub(crate) use quant::{
    quantize_block_ac_sse41, quantize_dc_cfl_i32_sse41, quantize_dc_cfl_sse41,
    quantize_dc_i32_sse41, quantize_dc_sse41,
};
pub(crate) use quantize_xyb::{
    quantize_xyb_channels_sse41, quantize_xyb_tile_colors_sse41, round_lattice_pow2_sse2,
};
pub(crate) use xyb::{to_linear_rows_sse41, to_xyb_sse41_band};

#[cfg(feature = "splines")]
pub(crate) use splines::{continuous_idct_sse2, continuous_idct_sse41};

#[cfg(feature = "extraslow")]
pub(crate) use coef_polish::{polish_add_scaled_sse41, polish_count_nonzero_sse41};