use crate::memory::{CudaBufferPool, CudaDeviceBuffer, CudaPooledDeviceBuffer};
#[derive(Debug, PartialEq, Eq)]
#[doc(hidden)]
pub struct CudaTranscodeReversible53Bands {
pub ll: Vec<i32>,
pub hl: Vec<i32>,
pub lh: Vec<i32>,
pub hh: Vec<i32>,
pub low_width: usize,
pub low_height: usize,
pub high_width: usize,
pub high_height: usize,
}
#[derive(Clone, Copy)]
pub(crate) struct Reversible53Dims {
pub(crate) block_cols: i32,
pub(crate) width: i32,
pub(crate) height: i32,
pub(crate) low_width: i32,
pub(crate) high_width: i32,
}
#[derive(Clone, Copy)]
pub(crate) struct DctBlockGrid {
pub(crate) block_count: usize,
pub(crate) expected_coeffs: usize,
pub(crate) low_width: usize,
pub(crate) low_height: usize,
pub(crate) high_width: usize,
pub(crate) high_height: usize,
pub(crate) dims: Reversible53Dims,
}
#[derive(Debug, PartialEq)]
#[doc(hidden)]
pub struct CudaTranscodeDwt97Bands {
pub ll: Vec<f32>,
pub hl: Vec<f32>,
pub lh: Vec<f32>,
pub hh: Vec<f32>,
pub low_width: usize,
pub low_height: usize,
pub high_width: usize,
pub high_height: usize,
}
#[derive(Clone, Copy, Debug)]
#[doc(hidden)]
pub struct CudaHtj2k97QuantizeParams {
pub inv_delta_ll: f32,
pub inv_delta_hl: f32,
pub inv_delta_lh: f32,
pub inv_delta_hh: f32,
pub cb_width: usize,
pub cb_height: usize,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[doc(hidden)]
pub struct CudaDwt97BatchGeometry {
pub item_count: usize,
pub block_cols: usize,
pub block_rows: usize,
pub width: usize,
pub height: usize,
}
#[derive(Clone, Copy)]
#[doc(hidden)]
pub struct CudaDwt97BatchWithPoolRequest<'a> {
pub blocks: &'a [f32],
pub geometry: CudaDwt97BatchGeometry,
pub pool: &'a CudaBufferPool,
}
#[derive(Clone, Copy)]
#[doc(hidden)]
pub struct CudaHtj2k97CodeblockBatchWithPoolRequest<'a> {
pub blocks: &'a [f32],
pub geometry: CudaDwt97BatchGeometry,
pub params: CudaHtj2k97QuantizeParams,
pub pool: &'a CudaBufferPool,
}
#[derive(Clone, Copy)]
#[doc(hidden)]
pub struct CudaHtj2k97I16CodeblockBatchWithPoolRequest<'a> {
pub blocks: &'a [i16],
pub geometry: CudaDwt97BatchGeometry,
pub params: CudaHtj2k97QuantizeParams,
pub pool: &'a CudaBufferPool,
}
#[derive(Clone, Copy)]
pub(crate) struct Dwt97CodeblockBandBuffers<'a> {
pub(crate) ll: &'a CudaDeviceBuffer,
pub(crate) hl: &'a CudaDeviceBuffer,
pub(crate) lh: &'a CudaDeviceBuffer,
pub(crate) hh: &'a CudaDeviceBuffer,
}
#[derive(Debug, PartialEq, Eq)]
#[doc(hidden)]
pub struct CudaHtj2k97CodeblockBands {
pub ll: Vec<i32>,
pub hl: Vec<i32>,
pub lh: Vec<i32>,
pub hh: Vec<i32>,
pub item_count: usize,
pub low_width: usize,
pub low_height: usize,
pub high_width: usize,
pub high_height: usize,
}
#[derive(Debug)]
#[doc(hidden)]
pub struct CudaHtj2k97DeviceCodeblockBands {
pub ll: CudaPooledDeviceBuffer,
pub hl: CudaPooledDeviceBuffer,
pub lh: CudaPooledDeviceBuffer,
pub hh: CudaPooledDeviceBuffer,
pub item_count: usize,
pub low_width: usize,
pub low_height: usize,
pub high_width: usize,
pub high_height: usize,
}
pub(crate) struct Dwt97BatchDeviceBands {
pub(crate) ll: CudaPooledDeviceBuffer,
pub(crate) lh: CudaPooledDeviceBuffer,
pub(crate) hl: CudaPooledDeviceBuffer,
pub(crate) hh: CudaPooledDeviceBuffer,
pub(crate) low_width: usize,
pub(crate) low_height: usize,
pub(crate) high_width: usize,
pub(crate) high_height: usize,
}
#[derive(Clone, Copy)]
pub(crate) enum Dwt97BatchInput<'a> {
F32(&'a [f32]),
I16(&'a [i16]),
}
#[derive(Clone, Copy)]
pub(super) struct Dwt97BatchDeviceRequest<'a> {
pub(super) input: Dwt97BatchInput<'a>,
pub(super) geometry: CudaDwt97BatchGeometry,
pub(super) pool: &'a CudaBufferPool,
}
#[derive(Clone, Copy)]
pub(super) struct Htj2k97I16ResidentFusedRequest<'a> {
pub(super) blocks: &'a [i16],
pub(super) geometry: CudaDwt97BatchGeometry,
pub(super) params: CudaHtj2k97QuantizeParams,
pub(super) pool: &'a CudaBufferPool,
}
pub(super) struct Dwt97ColumnLiftBatchLaunch<'a> {
pub(super) rows_buffer: &'a CudaDeviceBuffer,
pub(super) band_width: i32,
pub(super) height: i32,
pub(super) low_height: i32,
pub(super) high_height: i32,
pub(super) items: u32,
pub(super) low_out: &'a CudaDeviceBuffer,
pub(super) high_out: &'a CudaDeviceBuffer,
}
pub(super) struct Dwt97ColumnLiftQuantizeCodeblocksBatchLaunch<'a> {
pub(super) column: Dwt97ColumnLiftBatchLaunch<'a>,
pub(super) cb_width: i32,
pub(super) cb_height: i32,
pub(super) inv_delta_low: f32,
pub(super) inv_delta_high: f32,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub(super) struct Dwt97ColumnLiftQuantizeCodeblocksParams {
pub(super) cb_width: i32,
pub(super) cb_height: i32,
pub(super) inv_delta_low: f32,
pub(super) inv_delta_high: f32,
}
unsafe impl crate::execution::CudaKernelParam for Dwt97ColumnLiftQuantizeCodeblocksParams {}
pub(super) struct Dwt97QuantizeCodeblocksLaunch<'a> {
pub(super) band: &'a CudaDeviceBuffer,
pub(super) output: &'a CudaDeviceBuffer,
pub(super) width: i32,
pub(super) height: i32,
pub(super) cb_width: i32,
pub(super) cb_height: i32,
pub(super) inv_delta: f32,
pub(super) items: u32,
}