Grok 20.3.2
grk::HWY_NAMESPACE Namespace Reference

Classes

class  CompressIrrev
 Apply MCT with optional DC shift to irreversible compressed image. More...
class  CompressRev
 Apply MCT with optional DC shift to reversible compressed image. More...
class  DecompressDcShiftIrrev
 Apply dc shift for irreversible decompressed image. More...
class  DecompressDcShiftIrrev16
 Apply dc shift for irreversible decompressed image (16-bit path) (assumes mono with no MCT) NarrowScaleFilter16 has already dequantized T1 output to int16, so only integer shift + clamp is needed (same op as DecompressDcShiftRev16). More...
class  DecompressDcShiftRev
 Apply dc shift for reversible decompressed image (assumes mono with no MCT) input and output buffers are both 32 bit integer. More...
class  DecompressDcShiftRev16
 Apply dc shift for reversible decompressed image (16-bit path) (assumes mono with no MCT) input and output buffers are both 16 bit integer. More...
class  DecompressIrrev
 Apply MCT with optional DC shift to irreversible decompressed image. More...
class  DecompressIrrev16
 Apply MCT with optional DC shift to irreversible decompressed image (16-bit path) Uses fixed-point Q15 arithmetic for the ICT coefficients. More...
class  DecompressRev
 Apply MCT with optional DC shift to reversible decompressed image. More...
class  DecompressRev16
 Apply MCT with optional DC shift to reversible decompressed image (16-bit path). More...
struct  WaveletFwdScheduleDataImpl

Functions

template<class T>
void vscheduler (ScheduleInfo info)
void hwy_compress_rev (ScheduleInfo info)
void hwy_compress_irrev (ScheduleInfo info)
void hwy_schedule_decompress_rev (ScheduleInfo info)
void hwy_schedule_decompress_irrev (ScheduleInfo info)
void hwy_schedule_decompress_dc_shift_irrev (ScheduleInfo info)
void hwy_schedule_decompress_dc_shift_rev (ScheduleInfo info)
template<class T>
void vscheduler16 (ScheduleInfo info)
void hwy_schedule_decompress_dc_shift_irrev16 (ScheduleInfo info)
void hwy_schedule_decompress_dc_shift_rev16 (ScheduleInfo info)
void hwy_schedule_decompress_rev16 (ScheduleInfo info)
void hwy_schedule_decompress_irrev16 (ScheduleInfo info)
static void Hwy_clip_i32 (int32_t *data, uint32_t w, uint32_t h, uint32_t stride, int32_t minVal, int32_t maxVal)
static void Hwy_scale_mul_i32 (int32_t *data, uint32_t w, uint32_t h, uint32_t stride, int32_t scale)
static void Hwy_scale_div_i32 (int32_t *data, uint32_t w, uint32_t h, uint32_t stride, int32_t scale)
static void Hwy_sycc444_to_rgb_i32 (const int32_t *y, const int32_t *cb, const int32_t *cr, int32_t *r, int32_t *g, int32_t *b, uint32_t w, uint32_t h, uint32_t src_stride, uint32_t dst_stride, int32_t offset, int32_t upb)
static void Hwy_esycc_to_rgb_i32 (int32_t *yd, int32_t *bd, int32_t *rd, uint32_t w, uint32_t h, uint32_t stride, int32_t max_value, int32_t flip_value, bool sign1, bool sign2)
static void Hwy_planar_to_packed_8 (const int32_t *r, const int32_t *g, const int32_t *b, uint8_t *out, uint32_t w, uint32_t h, uint32_t src_stride)
static void Hwy_packed_to_planar_8 (const uint8_t *in, int32_t *r, int32_t *g, int32_t *b, uint32_t w, uint32_t h, uint32_t dst_stride)
static void Hwy_planar_to_packed_16 (const int32_t *r, const int32_t *g, const int32_t *b, uint16_t *out, uint32_t w, uint32_t h, uint32_t src_stride)
static void Hwy_packed_to_planar_16 (const uint16_t *in, int32_t *r, int32_t *g, int32_t *b, uint32_t w, uint32_t h, uint32_t dst_stride)
static void Hwy_copy_i32_to_u8_row (const int32_t *HWY_RESTRICT src, uint8_t *HWY_RESTRICT dst, uint32_t n)
static void Hwy_copy_i32_to_i16_row (const int32_t *HWY_RESTRICT src, int16_t *HWY_RESTRICT dst, uint32_t n)
static void Hwy_copy_i32_to_u16_row (const int32_t *HWY_RESTRICT src, uint16_t *HWY_RESTRICT dst, uint32_t n)
static void Hwy_copy_i32_to_u32_row (const int32_t *HWY_RESTRICT src, uint32_t *HWY_RESTRICT dst, uint32_t n)
static void Hwy_unpack_8u_to_i32 (const uint8_t *HWY_RESTRICT src, int32_t *HWY_RESTRICT dest, size_t w, bool invert)
static void Hwy_unpack_8s_to_i32 (const uint8_t *HWY_RESTRICT src, int32_t *HWY_RESTRICT dest, size_t w, bool invert)
static void Hwy_unpack_16be_to_i32 (const uint8_t *HWY_RESTRICT src, int32_t *HWY_RESTRICT dest, size_t w, bool invert)
static void Hwy_unpack_16le_to_i32 (const uint16_t *HWY_RESTRICT src, int32_t *HWY_RESTRICT dest, size_t w, bool invert)
static void Hwy_deinterleave_i32 (const int32_t *HWY_RESTRICT src, int32_t *const *dest, uint32_t w, uint16_t numComps)
static void Hwy_pack_planar_to_8 (const int32_t *const *src, uint32_t numPlanes, uint8_t *dest, uint32_t w, int32_t adjust)
static void Hwy_pack_planar_to_16 (const int32_t *const *src, uint32_t numPlanes, uint16_t *dest, uint32_t w, int32_t adjust)
static void Hwy_pack_planar_to_16be (const int32_t *const *src, uint32_t numPlanes, uint8_t *dest, uint32_t w, int32_t adjust)
static void Hwy_scale_component_up (int32_t *data, uint32_t w, uint32_t h, uint32_t stride, int32_t scale)
static void Hwy_scale_component_down (int32_t *data, uint32_t w, uint32_t h, uint32_t stride, int32_t scale)
template<typename T>
void deinterleave_h (const T *src, T *dst, const uint32_t dn, const uint32_t sn, const uint32_t stride, const uint32_t parity, const uint32_t numrows)
template<typename T>
void deinterleave_v (const T *src, T *dst, const uint32_t dn, const uint32_t sn, const uint32_t stride, const uint32_t parity, const uint32_t numcols)
HWY_ATTR void encode_53_v (int32_t *resolution, int32_t *scratch, const uint32_t height, const uint8_t parity, const uint32_t stride, const uint32_t numcols, int32_t dcShift)
HWY_ATTR void encode_53_h (int32_t *resolution, int32_t *scratch, const uint32_t width, const uint8_t parity, const uint32_t stride, const uint32_t numrows, int32_t dcShift)
void encode_97_h (float *res, float *scratch, const uint32_t width, const uint8_t parity, const uint32_t stride, const uint32_t numrows, float dcShift)
void encode_97_v (float *res, float *scratch, const uint32_t height, const uint8_t parity, const uint32_t stride, const uint32_t numcols, float dcShift, bool intInput)
static HWY_ATTR void narrow_row (const int32_t *src, int16_t *dst, uint32_t numcols)
static HWY_ATTR void widen_row (const int16_t *src, int32_t *dst, uint32_t numcols)
HWY_ATTR void encode_53_16_v (int32_t *resolution, int16_t *scratch, const uint32_t height, const uint8_t parity, const uint32_t stride, const uint32_t numcols, int32_t dcShift)
HWY_ATTR void encode_53_16_h (int32_t *resolution, int16_t *scratch, const uint32_t width, const uint8_t parity, const uint32_t stride, const uint32_t numrows)
bool encode_53_16 (TileComponent *tilec, int32_t dcShift)
static int16_t fwd_mf15 (int16_t a, int16_t b)
 Q1.15 fixed-point multiply (scalar fallback for forward 9/7).
HWY_ATTR void encode_97_16_v (int32_t *resolution, int16_t *scratch, const uint32_t height, const uint8_t parity, const uint32_t stride, const uint32_t numcols, float dcShift, bool intInput)
HWY_ATTR void encode_97_16_h (int32_t *resolution, int16_t *scratch, const uint32_t width, const uint8_t parity, const uint32_t stride, const uint32_t numrows)
HWY_ATTR void encode_97_16_h_nohalf (int32_t *resolution, int16_t *scratch, const uint32_t width, const uint8_t parity, const uint32_t stride, const uint32_t numrows)
bool encode_97_16 (TileComponent *tilec, float dcShift, bool intInput)
template<typename T, typename DWT>
void encode_h (encode_info< T, DWT > *task)
template<typename T, typename DWT>
void encode_v (encode_info< T, DWT > *task)
template<typename T, typename DWT>
bool encode (TileComponent *tilec, T dcShiftVal, bool intInput=false)
bool encode_53 (TileComponent *tilec, int32_t dcShift)
bool encode_97 (TileComponent *tilec, float dcShift, bool intInput)
template<typename T, typename DWT>
std::unique_ptr< WaveletFwdScheduleDataschedule_encode (TileComponent *tilec, T dcShiftVal, std::vector< std::pair< FlowComponent *, FlowComponent * > > &levelFlows, bool intInput=false)
std::unique_ptr< WaveletFwdScheduleDataschedule_encode_53 (TileComponent *tilec, int32_t dcShift, std::vector< std::pair< FlowComponent *, FlowComponent * > > &levelFlows)
std::unique_ptr< WaveletFwdScheduleDataschedule_encode_97 (TileComponent *tilec, float dcShift, std::vector< std::pair< FlowComponent *, FlowComponent * > > &levelFlows, bool intInput)
std::unique_ptr< WaveletFwdScheduleDataschedule_encode_97_16 (TileComponent *tilec, int32_t dcShift, std::vector< std::pair< FlowComponent *, FlowComponent * > > &levelFlows, bool intInput)
static uint32_t GetHWY_PLL_COLS_53 ()
static void hwy_v_final_store_53 (const int32_t *scratch, const uint32_t height, int32_t *dest, const size_t strideDest, int32_t dcShift, int32_t dcMin, int32_t dcMax)
static void hwy_v_p0_53 (int32_t *scratch, const uint32_t height, int32_t *bandL, const size_t strideL, int32_t *bandH, const size_t strideH, int32_t *dest, const uint32_t strideDest, int32_t dcShift, int32_t dcMin, int32_t dcMax)
 Vertical inverse 5x3 wavelet transform for 8 columns in SSE2, or 16 in AVX2, when top-most pixel is on even coordinate.
static void hwy_v_p1_53 (int32_t *scratch, const uint32_t height, int32_t *bandL, const uint32_t strideL, int32_t *bandH, const uint32_t strideH, int32_t *dest, const uint32_t strideDest, int32_t dcShift, int32_t dcMin, int32_t dcMax)
 Vertical inverse 5x3 wavelet transform for 8 columns in SSE2, or 16 in AVX2, when top-most pixel is on odd coordinate.
static uint32_t GetHWY_PLL_COLS_16_53 ()
static HWY_INLINE auto update_avg_16_53 (const HWY_FULL(int16_t) di, decltype(Zero(HWY_FULL(int16_t)())) a, decltype(Zero(HWY_FULL(int16_t)())) b) -> decltype(Zero(HWY_FULL(int16_t)()))
 Compute floor((a + b + 2) / 4) for signed int16 vectors using unsigned averaging, to avoid intermediate overflow in the 5/3 DWT update step.
static HWY_INLINE auto predict_avg_16_53 (const HWY_FULL(int16_t) di, decltype(Zero(HWY_FULL(int16_t)())) a, decltype(Zero(HWY_FULL(int16_t)())) b) -> decltype(Zero(HWY_FULL(int16_t)()))
 Compute floor((a + b) / 2) for signed int16 vectors without overflow.
static void hwy_v_final_store_16_53 (const int16_t *scratch, const uint32_t height, int16_t *dest, const size_t strideDest, int16_t dcShift, int16_t dcMin, int16_t dcMax)
static void hwy_v_p0_16_53 (int16_t *scratch, const uint32_t height, int16_t *bandL, const size_t strideL, int16_t *bandH, const size_t strideH, int16_t *dest, const uint32_t strideDest, int16_t dcShift, int16_t dcMin, int16_t dcMax)
 Vertical inverse 5x3 wavelet transform for int16_t, when top-most pixel is on even coordinate.
static void hwy_v_p1_16_53 (int16_t *scratch, const uint32_t height, int16_t *bandL, const uint32_t strideL, int16_t *bandH, const uint32_t strideH, int16_t *dest, const uint32_t strideDest, int16_t dcShift, int16_t dcMin, int16_t dcMax)
 Vertical inverse 5x3 wavelet transform for int16_t, when top-most pixel is on odd coordinate.
static size_t num_lanes (void)
static uint32_t GetHWY_PLL_ROWS_97 (void)
static void hwy_step2_97 (float *data, float *dataPrev, uint32_t len, uint32_t lenMax, float c)
static void hwy_step2_97_2x (float *data, float *dataPrev, uint32_t len, uint32_t lenMax, float c)
static void hwy_step_97_lift (float *mem, uint32_t sn, uint32_t dn, uint32_t parity, Line32 win_l, Line32 win_h)
static void hwy_step_97_lift_2x (float *mem, uint32_t sn, uint32_t dn, uint32_t parity, Line32 win_l, Line32 win_h)
static void hwy_h_strip_97 (float *scratchMem, uint32_t sn, uint32_t dn, uint32_t parity, Line32 win_l, Line32 win_h, const uint32_t resHeight, float *srcL, uint32_t strideL, float *srcH, uint32_t strideH, float *dest, uint32_t strideDest)
static void hwy_v_strip_97 (float *scratchMem, uint32_t sn, uint32_t dn, uint32_t parity, Line32 win_l, Line32 win_h, const uint32_t resWidth, const uint32_t resHeight, float *srcL, uint32_t strideL, float *srcH, uint32_t strideH, float *dest, uint32_t strideDest, int32_t dcShift, int32_t dcMin, int32_t dcMax)
static void hwy_v_cascade_stripe_97 (float *scratchMem, uint32_t sn, uint32_t dn, uint32_t parity, Line32 win_l, Line32 win_h, const uint32_t resWidth, float *srcL, uint32_t strideL, float *srcH, uint32_t strideH, float *dest, uint32_t strideDest, int32_t dcShift, int32_t dcMin, int32_t dcMax, uint32_t outputStart, uint32_t outputCount)
static int16_t mf15 (int16_t a, int16_t b)
 Q1.15 fixed-point multiply with rounding (scalar fallback).
static int16_t apply_K_scale (int16_t x)
 Apply K scaling to an even (low-pass) sample.
static int16_t apply_invK_scale (int16_t x)
 Apply 2/K scaling to an odd (high-pass) sample.
static void scalar_v_synth_16_97 (int16_t *scratch, uint32_t height, const int16_t *bandL, uint32_t strideL, const int16_t *bandH, uint32_t strideH, int16_t *dest, uint32_t strideDest, uint32_t parity, uint32_t sn, uint32_t dn)
static void scalar_v_synth_16_97_dc (int16_t *scratch, uint32_t height, const int16_t *bandL, uint32_t strideL, const int16_t *bandH, uint32_t strideH, int16_t *dest, uint32_t strideDest, uint32_t parity, uint32_t sn, uint32_t dn, int16_t dc, int16_t dcMin, int16_t dcMax)
static void hwy_h_synth_16_97 (int16_t *scratch, uint32_t width, const int16_t *bandL, const int16_t *bandH, int16_t *dest, uint32_t parity, uint32_t sn, uint32_t dn)
static uint32_t GetHWY_PLL_COLS_16_97 (void)
static void hwy_v_synth_16_97 (int16_t *scratch, uint32_t height, const int16_t *bandL, uint32_t strideL, const int16_t *bandH, uint32_t strideH, int16_t *dest, uint32_t strideDest, uint32_t parity, uint32_t sn, uint32_t dn, int16_t dc, int16_t dcMin, int16_t dcMax)

Variables

static const float alpha = -1.586134342f
static const float beta = -0.052980118f
static const float gamma = 0.882911075f
static const float delta = 0.443506852f
static const float K = 1.230174105f
static const float invK = (float)(1.0 / 1.230174105)
static const int16_t fwd97_g = (int16_t)(0.5 + 0.413865658 * (double)(1 << 15))
static const int16_t fwd97_4beta = (int16_t)(-0.5 + 4.0 * (-0.052980118) * (double)(1 << 15))
static const int16_t fwd97_half_gamma = (int16_t)(0.5 + 0.882911075 / 2.0 * (double)(1 << 15))
static const int16_t fwd97_2delta = (int16_t)(0.5 + 2.0 * 0.443506852 * (double)(1 << 15))
static const int16_t fwd97_invK = (int16_t)(0.5 + (1.0 / 1.230174105) * (double)(1 << 15))
static const int16_t fwd97_K_frac = (int16_t)(0.5 + (1.230174105 - 1.0) * (double)(1 << 15))
static const int16_t fwd97_nsc_0 = (int16_t)(-0.5 + (1.0 + (-1.586134342)) * (double)(1 << 15))
static const int16_t fwd97_nsc_2beta = (int16_t)(-0.5 + 2.0 * (-0.052980118) * (double)(1 << 15))
static const int16_t fwd97_nsc_gamma = (int16_t)(0.5 + 0.882911075 * (double)(1 << 15))
static const int16_t fwd97_nsc_delta = (int16_t)(0.5 + 0.443506852 * (double)(1 << 15))
static uint32_t HWY_PLL_COLS_53 = GetHWY_PLL_COLS_53()
static uint32_t HWY_PLL_COLS_16_53 = GetHWY_PLL_COLS_16_53()
static const float hwy_K = 1.230174105f
static const float hwy_twice_invK = 1.625732422f
static const float hwy_dwt_alpha = 1.586134342f
static const float hwy_dwt_beta = 0.052980118f
static const float hwy_dwt_gamma = -0.882911075f
static const float hwy_dwt_delta = -0.443506852f
static const int16_t synth_coeff_3 = (int16_t)(0.5 + 0.443506852 * (double)(1 << 15))
static const int16_t synth_coeff_2 = (int16_t)(0.5 + 0.882911075 * (double)(1 << 15))
static const int16_t synth_coeff_1 = (int16_t)(0.5 + 0.052980118 * (double)(1 << 18))
static const int16_t synth_coeff_0_frac = (int16_t)(0.5 + 0.586134342 * (double)(1 << 15))
static const int16_t scale_K_frac = (int16_t)(0.5 + 0.230174105 * (double)(1 << 15))
static const int16_t scale_invK_frac = (int16_t)(0.5 + 0.625732422 * (double)(1 << 15))
static const uint32_t HWY_PLL_COLS_16_97 = GetHWY_PLL_COLS_16_97()

Function Documentation

◆ apply_invK_scale()

int16_t grk::HWY_NAMESPACE::apply_invK_scale ( int16_t x)
inlinestatic

Apply 2/K scaling to an odd (high-pass) sample.

Computes x × (2/K) = x + round(x × (2/K−1)) where 2/K = 1.625732422. Uses additive decomposition since 2/K > 1.0 (see Section 6).

References mf15(), and scale_invK_frac.

Referenced by hwy_h_synth_16_97(), and scalar_v_synth_16_97().

◆ apply_K_scale()

int16_t grk::HWY_NAMESPACE::apply_K_scale ( int16_t x)
inlinestatic

Apply K scaling to an even (low-pass) sample.

Computes x × K = x + round(x × (K−1)) where K = 1.230174105. Uses additive decomposition since K > 1.0 (see Section 6).

References mf15(), and scale_K_frac.

Referenced by hwy_h_synth_16_97(), and scalar_v_synth_16_97().

◆ deinterleave_h()

template<typename T>
void grk::HWY_NAMESPACE::deinterleave_h ( const T * src,
T * dst,
const uint32_t dn,
const uint32_t sn,
const uint32_t stride,
const uint32_t parity,
const uint32_t numrows )

Referenced by encode_53_h(), and encode_97_h().

◆ deinterleave_v()

template<typename T>
void grk::HWY_NAMESPACE::deinterleave_v ( const T * src,
T * dst,
const uint32_t dn,
const uint32_t sn,
const uint32_t stride,
const uint32_t parity,
const uint32_t numcols )

Referenced by encode_53_v(), and encode_97_v().

◆ encode()

◆ encode_53()

bool grk::HWY_NAMESPACE::encode_53 ( TileComponent * tilec,
int32_t dcShift )

References encode().

◆ encode_53_16()

◆ encode_53_16_h()

HWY_ATTR void grk::HWY_NAMESPACE::encode_53_16_h ( int32_t * resolution,
int16_t * scratch,
const uint32_t width,
const uint8_t parity,
const uint32_t stride,
const uint32_t numrows )

References narrow_row().

Referenced by encode_53_16().

◆ encode_53_16_v()

HWY_ATTR void grk::HWY_NAMESPACE::encode_53_16_v ( int32_t * resolution,
int16_t * scratch,
const uint32_t height,
const uint8_t parity,
const uint32_t stride,
const uint32_t numcols,
int32_t dcShift )

References narrow_row(), and widen_row().

Referenced by encode_53_16().

◆ encode_53_h()

HWY_ATTR void grk::HWY_NAMESPACE::encode_53_h ( int32_t * resolution,
int32_t * scratch,
const uint32_t width,
const uint8_t parity,
const uint32_t stride,
const uint32_t numrows,
int32_t dcShift )

References deinterleave_h().

◆ encode_53_v()

HWY_ATTR void grk::HWY_NAMESPACE::encode_53_v ( int32_t * resolution,
int32_t * scratch,
const uint32_t height,
const uint8_t parity,
const uint32_t stride,
const uint32_t numcols,
int32_t dcShift )

References deinterleave_v().

◆ encode_97()

bool grk::HWY_NAMESPACE::encode_97 ( TileComponent * tilec,
float dcShift,
bool intInput )

References encode().

◆ encode_97_16()

◆ encode_97_16_h()

HWY_ATTR void grk::HWY_NAMESPACE::encode_97_16_h ( int32_t * resolution,
int16_t * scratch,
const uint32_t width,
const uint8_t parity,
const uint32_t stride,
const uint32_t numrows )

◆ encode_97_16_h_nohalf()

HWY_ATTR void grk::HWY_NAMESPACE::encode_97_16_h_nohalf ( int32_t * resolution,
int16_t * scratch,
const uint32_t width,
const uint8_t parity,
const uint32_t stride,
const uint32_t numrows )

◆ encode_97_16_v()

HWY_ATTR void grk::HWY_NAMESPACE::encode_97_16_v ( int32_t * resolution,
int16_t * scratch,
const uint32_t height,
const uint8_t parity,
const uint32_t stride,
const uint32_t numcols,
float dcShift,
bool intInput )

◆ encode_97_h()

void grk::HWY_NAMESPACE::encode_97_h ( float * res,
float * scratch,
const uint32_t width,
const uint8_t parity,
const uint32_t stride,
const uint32_t numrows,
float dcShift )

References alpha, beta, deinterleave_h(), delta, gamma, invK, and K.

◆ encode_97_v()

void grk::HWY_NAMESPACE::encode_97_v ( float * res,
float * scratch,
const uint32_t height,
const uint8_t parity,
const uint32_t stride,
const uint32_t numcols,
float dcShift,
bool intInput )

References alpha, beta, deinterleave_v(), delta, gamma, invK, and K.

◆ encode_h()

template<typename T, typename DWT>
void grk::HWY_NAMESPACE::encode_h ( encode_info< T, DWT > * task)

Referenced by encode(), and schedule_encode().

◆ encode_v()

template<typename T, typename DWT>
void grk::HWY_NAMESPACE::encode_v ( encode_info< T, DWT > * task)

Referenced by encode(), and schedule_encode().

◆ fwd_mf15()

int16_t grk::HWY_NAMESPACE::fwd_mf15 ( int16_t a,
int16_t b )
inlinestatic

Q1.15 fixed-point multiply (scalar fallback for forward 9/7).

Referenced by encode_97_16_h(), encode_97_16_h_nohalf(), and encode_97_16_v().

◆ GetHWY_PLL_COLS_16_53()

uint32_t grk::HWY_NAMESPACE::GetHWY_PLL_COLS_16_53 ( )
static

◆ GetHWY_PLL_COLS_16_97()

uint32_t grk::HWY_NAMESPACE::GetHWY_PLL_COLS_16_97 ( void )
static

◆ GetHWY_PLL_COLS_53()

uint32_t grk::HWY_NAMESPACE::GetHWY_PLL_COLS_53 ( )
static

◆ GetHWY_PLL_ROWS_97()

uint32_t grk::HWY_NAMESPACE::GetHWY_PLL_ROWS_97 ( void )
static

◆ Hwy_clip_i32()

void grk::HWY_NAMESPACE::Hwy_clip_i32 ( int32_t * data,
uint32_t w,
uint32_t h,
uint32_t stride,
int32_t minVal,
int32_t maxVal )
static

◆ hwy_compress_irrev()

void grk::HWY_NAMESPACE::hwy_compress_irrev ( ScheduleInfo info)

References vscheduler().

◆ hwy_compress_rev()

void grk::HWY_NAMESPACE::hwy_compress_rev ( ScheduleInfo info)

References vscheduler().

◆ Hwy_copy_i32_to_i16_row()

void grk::HWY_NAMESPACE::Hwy_copy_i32_to_i16_row ( const int32_t *HWY_RESTRICT src,
int16_t *HWY_RESTRICT dst,
uint32_t n )
static

◆ Hwy_copy_i32_to_u16_row()

void grk::HWY_NAMESPACE::Hwy_copy_i32_to_u16_row ( const int32_t *HWY_RESTRICT src,
uint16_t *HWY_RESTRICT dst,
uint32_t n )
static

◆ Hwy_copy_i32_to_u32_row()

void grk::HWY_NAMESPACE::Hwy_copy_i32_to_u32_row ( const int32_t *HWY_RESTRICT src,
uint32_t *HWY_RESTRICT dst,
uint32_t n )
static

◆ Hwy_copy_i32_to_u8_row()

void grk::HWY_NAMESPACE::Hwy_copy_i32_to_u8_row ( const int32_t *HWY_RESTRICT src,
uint8_t *HWY_RESTRICT dst,
uint32_t n )
static

◆ Hwy_deinterleave_i32()

void grk::HWY_NAMESPACE::Hwy_deinterleave_i32 ( const int32_t *HWY_RESTRICT src,
int32_t *const * dest,
uint32_t w,
uint16_t numComps )
static

◆ Hwy_esycc_to_rgb_i32()

void grk::HWY_NAMESPACE::Hwy_esycc_to_rgb_i32 ( int32_t * yd,
int32_t * bd,
int32_t * rd,
uint32_t w,
uint32_t h,
uint32_t stride,
int32_t max_value,
int32_t flip_value,
bool sign1,
bool sign2 )
static

◆ hwy_h_strip_97()

void grk::HWY_NAMESPACE::hwy_h_strip_97 ( float * scratchMem,
uint32_t sn,
uint32_t dn,
uint32_t parity,
Line32 win_l,
Line32 win_h,
const uint32_t resHeight,
float * srcL,
uint32_t strideL,
float * srcH,
uint32_t strideH,
float * dest,
uint32_t strideDest )
static

◆ hwy_h_synth_16_97()

void grk::HWY_NAMESPACE::hwy_h_synth_16_97 ( int16_t * scratch,
uint32_t width,
const int16_t * bandL,
const int16_t * bandH,
int16_t * dest,
uint32_t parity,
uint32_t sn,
uint32_t dn )
static

◆ Hwy_pack_planar_to_16()

void grk::HWY_NAMESPACE::Hwy_pack_planar_to_16 ( const int32_t *const * src,
uint32_t numPlanes,
uint16_t * dest,
uint32_t w,
int32_t adjust )
static

◆ Hwy_pack_planar_to_16be()

void grk::HWY_NAMESPACE::Hwy_pack_planar_to_16be ( const int32_t *const * src,
uint32_t numPlanes,
uint8_t * dest,
uint32_t w,
int32_t adjust )
static

◆ Hwy_pack_planar_to_8()

void grk::HWY_NAMESPACE::Hwy_pack_planar_to_8 ( const int32_t *const * src,
uint32_t numPlanes,
uint8_t * dest,
uint32_t w,
int32_t adjust )
static

◆ Hwy_packed_to_planar_16()

void grk::HWY_NAMESPACE::Hwy_packed_to_planar_16 ( const uint16_t * in,
int32_t * r,
int32_t * g,
int32_t * b,
uint32_t w,
uint32_t h,
uint32_t dst_stride )
static

◆ Hwy_packed_to_planar_8()

void grk::HWY_NAMESPACE::Hwy_packed_to_planar_8 ( const uint8_t * in,
int32_t * r,
int32_t * g,
int32_t * b,
uint32_t w,
uint32_t h,
uint32_t dst_stride )
static

◆ Hwy_planar_to_packed_16()

void grk::HWY_NAMESPACE::Hwy_planar_to_packed_16 ( const int32_t * r,
const int32_t * g,
const int32_t * b,
uint16_t * out,
uint32_t w,
uint32_t h,
uint32_t src_stride )
static

◆ Hwy_planar_to_packed_8()

void grk::HWY_NAMESPACE::Hwy_planar_to_packed_8 ( const int32_t * r,
const int32_t * g,
const int32_t * b,
uint8_t * out,
uint32_t w,
uint32_t h,
uint32_t src_stride )
static

◆ Hwy_scale_component_down()

void grk::HWY_NAMESPACE::Hwy_scale_component_down ( int32_t * data,
uint32_t w,
uint32_t h,
uint32_t stride,
int32_t scale )
static

References grk::scale.

◆ Hwy_scale_component_up()

void grk::HWY_NAMESPACE::Hwy_scale_component_up ( int32_t * data,
uint32_t w,
uint32_t h,
uint32_t stride,
int32_t scale )
static

References grk::scale.

◆ Hwy_scale_div_i32()

void grk::HWY_NAMESPACE::Hwy_scale_div_i32 ( int32_t * data,
uint32_t w,
uint32_t h,
uint32_t stride,
int32_t scale )
static

References grk::scale.

◆ Hwy_scale_mul_i32()

void grk::HWY_NAMESPACE::Hwy_scale_mul_i32 ( int32_t * data,
uint32_t w,
uint32_t h,
uint32_t stride,
int32_t scale )
static

References grk::scale.

◆ hwy_schedule_decompress_dc_shift_irrev()

void grk::HWY_NAMESPACE::hwy_schedule_decompress_dc_shift_irrev ( ScheduleInfo info)

References vscheduler().

◆ hwy_schedule_decompress_dc_shift_irrev16()

void grk::HWY_NAMESPACE::hwy_schedule_decompress_dc_shift_irrev16 ( ScheduleInfo info)

References vscheduler16().

◆ hwy_schedule_decompress_dc_shift_rev()

void grk::HWY_NAMESPACE::hwy_schedule_decompress_dc_shift_rev ( ScheduleInfo info)

References vscheduler().

◆ hwy_schedule_decompress_dc_shift_rev16()

void grk::HWY_NAMESPACE::hwy_schedule_decompress_dc_shift_rev16 ( ScheduleInfo info)

References vscheduler16().

◆ hwy_schedule_decompress_irrev()

void grk::HWY_NAMESPACE::hwy_schedule_decompress_irrev ( ScheduleInfo info)

References vscheduler().

◆ hwy_schedule_decompress_irrev16()

void grk::HWY_NAMESPACE::hwy_schedule_decompress_irrev16 ( ScheduleInfo info)

References vscheduler16().

◆ hwy_schedule_decompress_rev()

void grk::HWY_NAMESPACE::hwy_schedule_decompress_rev ( ScheduleInfo info)

References vscheduler().

◆ hwy_schedule_decompress_rev16()

void grk::HWY_NAMESPACE::hwy_schedule_decompress_rev16 ( ScheduleInfo info)

References vscheduler16().

◆ hwy_step2_97()

void grk::HWY_NAMESPACE::hwy_step2_97 ( float * data,
float * dataPrev,
uint32_t len,
uint32_t lenMax,
float c )
static

Referenced by hwy_step_97_lift().

◆ hwy_step2_97_2x()

void grk::HWY_NAMESPACE::hwy_step2_97_2x ( float * data,
float * dataPrev,
uint32_t len,
uint32_t lenMax,
float c )
static

Referenced by hwy_step_97_lift_2x().

◆ hwy_step_97_lift()

void grk::HWY_NAMESPACE::hwy_step_97_lift ( float * mem,
uint32_t sn,
uint32_t dn,
uint32_t parity,
Line32 win_l,
Line32 win_h )
static

◆ hwy_step_97_lift_2x()

void grk::HWY_NAMESPACE::hwy_step_97_lift_2x ( float * mem,
uint32_t sn,
uint32_t dn,
uint32_t parity,
Line32 win_l,
Line32 win_h )
static

◆ Hwy_sycc444_to_rgb_i32()

void grk::HWY_NAMESPACE::Hwy_sycc444_to_rgb_i32 ( const int32_t * y,
const int32_t * cb,
const int32_t * cr,
int32_t * r,
int32_t * g,
int32_t * b,
uint32_t w,
uint32_t h,
uint32_t src_stride,
uint32_t dst_stride,
int32_t offset,
int32_t upb )
static

◆ Hwy_unpack_16be_to_i32()

void grk::HWY_NAMESPACE::Hwy_unpack_16be_to_i32 ( const uint8_t *HWY_RESTRICT src,
int32_t *HWY_RESTRICT dest,
size_t w,
bool invert )
static

◆ Hwy_unpack_16le_to_i32()

void grk::HWY_NAMESPACE::Hwy_unpack_16le_to_i32 ( const uint16_t *HWY_RESTRICT src,
int32_t *HWY_RESTRICT dest,
size_t w,
bool invert )
static

◆ Hwy_unpack_8s_to_i32()

void grk::HWY_NAMESPACE::Hwy_unpack_8s_to_i32 ( const uint8_t *HWY_RESTRICT src,
int32_t *HWY_RESTRICT dest,
size_t w,
bool invert )
static

◆ Hwy_unpack_8u_to_i32()

void grk::HWY_NAMESPACE::Hwy_unpack_8u_to_i32 ( const uint8_t *HWY_RESTRICT src,
int32_t *HWY_RESTRICT dest,
size_t w,
bool invert )
static

◆ hwy_v_cascade_stripe_97()

void grk::HWY_NAMESPACE::hwy_v_cascade_stripe_97 ( float * scratchMem,
uint32_t sn,
uint32_t dn,
uint32_t parity,
Line32 win_l,
Line32 win_h,
const uint32_t resWidth,
float * srcL,
uint32_t strideL,
float * srcH,
uint32_t strideH,
float * dest,
uint32_t strideDest,
int32_t dcShift,
int32_t dcMin,
int32_t dcMax,
uint32_t outputStart,
uint32_t outputCount )
static

◆ hwy_v_final_store_16_53()

void grk::HWY_NAMESPACE::hwy_v_final_store_16_53 ( const int16_t * scratch,
const uint32_t height,
int16_t * dest,
const size_t strideDest,
int16_t dcShift,
int16_t dcMin,
int16_t dcMax )
static

References HWY_PLL_COLS_16_53.

Referenced by hwy_v_p0_16_53(), and hwy_v_p1_16_53().

◆ hwy_v_final_store_53()

void grk::HWY_NAMESPACE::hwy_v_final_store_53 ( const int32_t * scratch,
const uint32_t height,
int32_t * dest,
const size_t strideDest,
int32_t dcShift,
int32_t dcMin,
int32_t dcMax )
static

References HWY_PLL_COLS_53.

Referenced by hwy_v_p0_53(), and hwy_v_p1_53().

◆ hwy_v_p0_16_53()

void grk::HWY_NAMESPACE::hwy_v_p0_16_53 ( int16_t * scratch,
const uint32_t height,
int16_t * bandL,
const size_t strideL,
int16_t * bandH,
const size_t strideH,
int16_t * dest,
const uint32_t strideDest,
int16_t dcShift,
int16_t dcMin,
int16_t dcMax )
static

Vertical inverse 5x3 wavelet transform for int16_t, when top-most pixel is on even coordinate.

References HWY_PLL_COLS_16_53, hwy_v_final_store_16_53(), predict_avg_16_53(), and update_avg_16_53().

◆ hwy_v_p0_53()

void grk::HWY_NAMESPACE::hwy_v_p0_53 ( int32_t * scratch,
const uint32_t height,
int32_t * bandL,
const size_t strideL,
int32_t * bandH,
const size_t strideH,
int32_t * dest,
const uint32_t strideDest,
int32_t dcShift,
int32_t dcMin,
int32_t dcMax )
static

Vertical inverse 5x3 wavelet transform for 8 columns in SSE2, or 16 in AVX2, when top-most pixel is on even coordinate.

References HWY_PLL_COLS_53, and hwy_v_final_store_53().

◆ hwy_v_p1_16_53()

void grk::HWY_NAMESPACE::hwy_v_p1_16_53 ( int16_t * scratch,
const uint32_t height,
int16_t * bandL,
const uint32_t strideL,
int16_t * bandH,
const uint32_t strideH,
int16_t * dest,
const uint32_t strideDest,
int16_t dcShift,
int16_t dcMin,
int16_t dcMax )
static

Vertical inverse 5x3 wavelet transform for int16_t, when top-most pixel is on odd coordinate.

References HWY_PLL_COLS_16_53, hwy_v_final_store_16_53(), predict_avg_16_53(), and update_avg_16_53().

◆ hwy_v_p1_53()

void grk::HWY_NAMESPACE::hwy_v_p1_53 ( int32_t * scratch,
const uint32_t height,
int32_t * bandL,
const uint32_t strideL,
int32_t * bandH,
const uint32_t strideH,
int32_t * dest,
const uint32_t strideDest,
int32_t dcShift,
int32_t dcMin,
int32_t dcMax )
static

Vertical inverse 5x3 wavelet transform for 8 columns in SSE2, or 16 in AVX2, when top-most pixel is on odd coordinate.

References HWY_PLL_COLS_53, and hwy_v_final_store_53().

◆ hwy_v_strip_97()

void grk::HWY_NAMESPACE::hwy_v_strip_97 ( float * scratchMem,
uint32_t sn,
uint32_t dn,
uint32_t parity,
Line32 win_l,
Line32 win_h,
const uint32_t resWidth,
const uint32_t resHeight,
float * srcL,
uint32_t strideL,
float * srcH,
uint32_t strideH,
float * dest,
uint32_t strideDest,
int32_t dcShift,
int32_t dcMin,
int32_t dcMax )
static

◆ hwy_v_synth_16_97()

void grk::HWY_NAMESPACE::hwy_v_synth_16_97 ( int16_t * scratch,
uint32_t height,
const int16_t * bandL,
uint32_t strideL,
const int16_t * bandH,
uint32_t strideH,
int16_t * dest,
uint32_t strideDest,
uint32_t parity,
uint32_t sn,
uint32_t dn,
int16_t dc,
int16_t dcMin,
int16_t dcMax )
static

◆ mf15()

int16_t grk::HWY_NAMESPACE::mf15 ( int16_t a,
int16_t b )
inlinestatic

Q1.15 fixed-point multiply with rounding (scalar fallback).

Computes round(a × b / 2^15) = (a × b + 2^14) >> 15. This matches Highway's MulFixedPoint15 semantics exactly.

The intermediate product a×b is computed in 32 bits to avoid overflow. Result is truncated back to int16.

Referenced by apply_invK_scale(), apply_K_scale(), hwy_h_synth_16_97(), and scalar_v_synth_16_97().

◆ narrow_row()

HWY_ATTR void grk::HWY_NAMESPACE::narrow_row ( const int32_t * src,
int16_t * dst,
uint32_t numcols )
static

Referenced by encode_53_16_h(), and encode_53_16_v().

◆ num_lanes()

size_t grk::HWY_NAMESPACE::num_lanes ( void )
static

◆ predict_avg_16_53()

HWY_INLINE auto grk::HWY_NAMESPACE::predict_avg_16_53 ( const HWY_FULL(int16_t) di,
decltype(Zero(HWY_FULL(int16_t)())) a,
decltype(Zero(HWY_FULL(int16_t)())) b ) -> decltype(Zero(HWY_FULL(int16_t)()))
static

Compute floor((a + b) / 2) for signed int16 vectors without overflow.

Used in the 5/3 DWT predict step: odd += (s_prev + s_next) >> 1.

Identity: (a + b) >> 1 = (a >> 1) + (b >> 1) + ((a & b) & 1) This avoids the intermediate sum a + b which can overflow int16.

Referenced by hwy_v_p0_16_53(), and hwy_v_p1_16_53().

◆ scalar_v_synth_16_97()

void grk::HWY_NAMESPACE::scalar_v_synth_16_97 ( int16_t * scratch,
uint32_t height,
const int16_t * bandL,
uint32_t strideL,
const int16_t * bandH,
uint32_t strideH,
int16_t * dest,
uint32_t strideDest,
uint32_t parity,
uint32_t sn,
uint32_t dn )
static

◆ scalar_v_synth_16_97_dc()

void grk::HWY_NAMESPACE::scalar_v_synth_16_97_dc ( int16_t * scratch,
uint32_t height,
const int16_t * bandL,
uint32_t strideL,
const int16_t * bandH,
uint32_t strideH,
int16_t * dest,
uint32_t strideDest,
uint32_t parity,
uint32_t sn,
uint32_t dn,
int16_t dc,
int16_t dcMin,
int16_t dcMax )
static

◆ schedule_encode()

◆ schedule_encode_53()

std::unique_ptr< WaveletFwdScheduleData > grk::HWY_NAMESPACE::schedule_encode_53 ( TileComponent * tilec,
int32_t dcShift,
std::vector< std::pair< FlowComponent *, FlowComponent * > > & levelFlows )

References schedule_encode().

◆ schedule_encode_97()

std::unique_ptr< WaveletFwdScheduleData > grk::HWY_NAMESPACE::schedule_encode_97 ( TileComponent * tilec,
float dcShift,
std::vector< std::pair< FlowComponent *, FlowComponent * > > & levelFlows,
bool intInput )

References schedule_encode().

◆ schedule_encode_97_16()

std::unique_ptr< WaveletFwdScheduleData > grk::HWY_NAMESPACE::schedule_encode_97_16 ( TileComponent * tilec,
int32_t dcShift,
std::vector< std::pair< FlowComponent *, FlowComponent * > > & levelFlows,
bool intInput )

References schedule_encode().

◆ update_avg_16_53()

HWY_INLINE auto grk::HWY_NAMESPACE::update_avg_16_53 ( const HWY_FULL(int16_t) di,
decltype(Zero(HWY_FULL(int16_t)())) a,
decltype(Zero(HWY_FULL(int16_t)())) b ) -> decltype(Zero(HWY_FULL(int16_t)()))
static

Compute floor((a + b + 2) / 4) for signed int16 vectors using unsigned averaging, to avoid intermediate overflow in the 5/3 DWT update step.

Identity: floor((a + b + 2) / 4) == (floor((a + b) / 2) + 1) >> 1

Uses _mm256_avg_epu16 (via HWY AverageRound) which computes floor((a + b + 1) / 2) with a 17-bit intermediate — no overflow. Sign conversion via XOR 0x8000 (signed ↔ unsigned).

Referenced by hwy_v_p0_16_53(), and hwy_v_p1_16_53().

◆ vscheduler()

◆ vscheduler16()

◆ widen_row()

HWY_ATTR void grk::HWY_NAMESPACE::widen_row ( const int16_t * src,
int32_t * dst,
uint32_t numcols )
static

Referenced by encode_53_16_v(), and encode_97_16_v().

Variable Documentation

◆ alpha

const float grk::HWY_NAMESPACE::alpha = -1.586134342f
static

Referenced by encode_97_h(), and encode_97_v().

◆ beta

const float grk::HWY_NAMESPACE::beta = -0.052980118f
static

Referenced by encode_97_h(), and encode_97_v().

◆ delta

const float grk::HWY_NAMESPACE::delta = 0.443506852f
static

Referenced by encode_97_h(), and encode_97_v().

◆ fwd97_2delta

const int16_t grk::HWY_NAMESPACE::fwd97_2delta = (int16_t)(0.5 + 2.0 * 0.443506852 * (double)(1 << 15))
static

Referenced by encode_97_16_h(), and encode_97_16_v().

◆ fwd97_4beta

const int16_t grk::HWY_NAMESPACE::fwd97_4beta = (int16_t)(-0.5 + 4.0 * (-0.052980118) * (double)(1 << 15))
static

Referenced by encode_97_16_h(), and encode_97_16_v().

◆ fwd97_g

const int16_t grk::HWY_NAMESPACE::fwd97_g = (int16_t)(0.5 + 0.413865658 * (double)(1 << 15))
static

Referenced by encode_97_16_h(), and encode_97_16_v().

◆ fwd97_half_gamma

const int16_t grk::HWY_NAMESPACE::fwd97_half_gamma = (int16_t)(0.5 + 0.882911075 / 2.0 * (double)(1 << 15))
static

Referenced by encode_97_16_h(), and encode_97_16_v().

◆ fwd97_invK

const int16_t grk::HWY_NAMESPACE::fwd97_invK = (int16_t)(0.5 + (1.0 / 1.230174105) * (double)(1 << 15))
static

◆ fwd97_K_frac

const int16_t grk::HWY_NAMESPACE::fwd97_K_frac = (int16_t)(0.5 + (1.230174105 - 1.0) * (double)(1 << 15))
static

◆ fwd97_nsc_0

const int16_t grk::HWY_NAMESPACE::fwd97_nsc_0 = (int16_t)(-0.5 + (1.0 + (-1.586134342)) * (double)(1 << 15))
static

Referenced by encode_97_16_h_nohalf().

◆ fwd97_nsc_2beta

const int16_t grk::HWY_NAMESPACE::fwd97_nsc_2beta = (int16_t)(-0.5 + 2.0 * (-0.052980118) * (double)(1 << 15))
static

Referenced by encode_97_16_h_nohalf().

◆ fwd97_nsc_delta

const int16_t grk::HWY_NAMESPACE::fwd97_nsc_delta = (int16_t)(0.5 + 0.443506852 * (double)(1 << 15))
static

Referenced by encode_97_16_h_nohalf().

◆ fwd97_nsc_gamma

const int16_t grk::HWY_NAMESPACE::fwd97_nsc_gamma = (int16_t)(0.5 + 0.882911075 * (double)(1 << 15))
static

Referenced by encode_97_16_h_nohalf().

◆ gamma

const float grk::HWY_NAMESPACE::gamma = 0.882911075f
static

Referenced by encode_97_h(), and encode_97_v().

◆ hwy_dwt_alpha

const float grk::HWY_NAMESPACE::hwy_dwt_alpha = 1.586134342f
static

◆ hwy_dwt_beta

const float grk::HWY_NAMESPACE::hwy_dwt_beta = 0.052980118f
static

◆ hwy_dwt_delta

const float grk::HWY_NAMESPACE::hwy_dwt_delta = -0.443506852f
static

◆ hwy_dwt_gamma

const float grk::HWY_NAMESPACE::hwy_dwt_gamma = -0.882911075f
static

◆ hwy_K

const float grk::HWY_NAMESPACE::hwy_K = 1.230174105f
static

◆ HWY_PLL_COLS_16_53

uint32_t grk::HWY_NAMESPACE::HWY_PLL_COLS_16_53 = GetHWY_PLL_COLS_16_53()
static

◆ HWY_PLL_COLS_16_97

const uint32_t grk::HWY_NAMESPACE::HWY_PLL_COLS_16_97 = GetHWY_PLL_COLS_16_97()
static

Referenced by hwy_v_synth_16_97().

◆ HWY_PLL_COLS_53

uint32_t grk::HWY_NAMESPACE::HWY_PLL_COLS_53 = GetHWY_PLL_COLS_53()
static

◆ hwy_twice_invK

const float grk::HWY_NAMESPACE::hwy_twice_invK = 1.625732422f
static

◆ invK

const float grk::HWY_NAMESPACE::invK = (float)(1.0 / 1.230174105)
static

Referenced by encode_97_h(), and encode_97_v().

◆ K

const float grk::HWY_NAMESPACE::K = 1.230174105f
static

Referenced by encode_97_h(), and encode_97_v().

◆ scale_invK_frac

const int16_t grk::HWY_NAMESPACE::scale_invK_frac = (int16_t)(0.5 + 0.625732422 * (double)(1 << 15))
static

◆ scale_K_frac

const int16_t grk::HWY_NAMESPACE::scale_K_frac = (int16_t)(0.5 + 0.230174105 * (double)(1 << 15))
static

◆ synth_coeff_0_frac

const int16_t grk::HWY_NAMESPACE::synth_coeff_0_frac = (int16_t)(0.5 + 0.586134342 * (double)(1 << 15))
static

◆ synth_coeff_1

const int16_t grk::HWY_NAMESPACE::synth_coeff_1 = (int16_t)(0.5 + 0.052980118 * (double)(1 << 18))
static

◆ synth_coeff_2

const int16_t grk::HWY_NAMESPACE::synth_coeff_2 = (int16_t)(0.5 + 0.882911075 * (double)(1 << 15))
static

◆ synth_coeff_3

const int16_t grk::HWY_NAMESPACE::synth_coeff_3 = (int16_t)(0.5 + 0.443506852 * (double)(1 << 15))
static