91 int step_num,
ui32 repeat) = NULL;
117#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
130#ifndef OJPH_DISABLE_INTEL_SIMD
189 -1.586134342059924f, -0.052980118572961f, +0.882911075530934f,
191 +1.586134342059924f, +0.052980118572961f, -0.882911075530934f,
199#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
207 const si32 *src1 = line_src1->
i32, *src2 = line_src2->
i32;
208 for (
ui32 i = repeat; i > 0; --i)
209 *dst++ -= (*src1++ + *src2++) >> 1;
218 const si32 *src1 = line_src1->
i32, *src2 = line_src2->
i32;
219 for (
ui32 i = repeat; i > 0; --i)
220 *dst++ += (*src1++ + *src2++ + 2) >> 2;
230 si32 *ldst = line_ldst->
i32, *hdst = line_hdst->
i32;
232 const ui32 L_width = (width + (even ? 1 : 0)) >> 1;
233 const ui32 H_width = (width + (even ? 0 : 1)) >> 1;
237 src[width] = src[width-2];
239 const si32* sp = src + (even ? 1 : 0);
241 for (
ui32 i = H_width; i > 0; --i, sp+=2)
242 *dph++ = sp[0] - ((sp[-1] + sp[1]) >> 1);
246 hdst[H_width] = hdst[H_width-1];
248 sp = src + (even ? 0 : 1);
249 const si32* sph = hdst + (even ? 0 : 1);
251 for (
ui32 i = L_width; i > 0; --i, sp+=2, sph++)
252 *dpl++ = *sp + ((2 + sph[-1] + sph[0]) >> 2);
257 line_ldst->
i32[0] = line_src->
i32[0];
259 line_hdst->
i32[0] = line_src->
i32[0] << 1;
269 const si32 *src1 = line_src1->
i32, *src2 = line_src2->
i32;
270 for (
ui32 i = repeat; i > 0; --i)
271 *dst++ += (*src1++ + *src2++) >> 1;
280 const si32 *src1 = line_src1->
i32, *src2 = line_src2->
i32;
281 for (
ui32 i = repeat; i > 0; --i)
282 *dst++ -= (2 + *src1++ + *src2++) >> 2;
291 si32 *lsrc = line_lsrc->
i32, *hsrc = line_hsrc->
i32;
294 const ui32 L_width = (width + (even ? 1 : 0)) >> 1;
295 const ui32 H_width = (width + (even ? 0 : 1)) >> 1;
299 hsrc[H_width] = hsrc[H_width-1];
301 const si32 *sph = hsrc + (even ? 0 : 1);
303 for (
ui32 i = L_width; i > 0; --i, sph++, spl++)
304 *spl -= ((2 + sph[-1] + sph[0]) >> 2);
308 lsrc[L_width] = lsrc[L_width - 1];
310 si32 *dp = dst + (even ? 0 : -1);
311 spl = lsrc + (even ? 0 : -1);
313 for (
ui32 i = L_width + (even ? 0 : 1); i > 0; --i, spl++, sph++)
316 *dp++ = *sph + ((spl[0] + spl[1]) >> 1);
322 line_dst->
i32[0] = line_lsrc->
i32[0];
324 line_dst->
i32[0] = line_hsrc->
i32[0] >> 1;
333 int step_num,
ui32 repeat)
335 float *dst = line_dst->
f32;
336 const float *src1 = line_src1->
f32, *src2 = line_src2->
f32;
338 for (
ui32 i = repeat; i > 0; --i)
339 *dst++ += factor * (*src1++ + *src2++);
345 bool L_analysis_or_H_synthesis,
ui32 repeat)
347 float *dst = line_dst->
f32;
348 const float *src = line_src->
f32;
351 for (
ui32 i = repeat; i > 0; --i)
352 *dst++ = *src++ * factor;
360 ui32 width,
bool even)
364 float *src = line_src->
f32;
365 float *ldst = line_ldst->
f32, *hdst = line_hdst->
f32;
367 const ui32 L_width = (width + (even ? 1 : 0)) >> 1;
368 const ui32 H_width = (width + (even ? 0 : 1)) >> 1;
372 src[width] = src[width-2];
375 const float* sp = src + (even ? 1 : 0);
377 for (
ui32 i = H_width; i > 0; --i, sp+=2)
378 *dph++ = sp[0] + factor * (sp[-1] + sp[1]);
382 hdst[H_width] = hdst[H_width-1];
385 sp = src + (even ? 0 : 1);
386 const float* sph = hdst + (even ? 0 : 1);
388 for (
ui32 i = L_width; i > 0; --i, sp+=2, sph++)
389 *dpl++ = sp[0] + factor * (sph[-1] + sph[0]);
393 ldst[L_width] = ldst[L_width-1];
396 const float* spl = ldst + (even ? 1 : 0);
398 for (
ui32 i = H_width; i > 0; --i, spl++)
399 *dph++ += factor * (spl[-1] + spl[0]);
403 hdst[H_width] = hdst[H_width-1];
406 sph = hdst + (even ? 0 : 1);
408 for (
ui32 i = L_width; i > 0; --i, sph++)
409 *dpl++ += factor * (sph[-1] + sph[0]);
413 for (
ui32 i = L_width; i > 0; --i, dp++)
416 for (
ui32 i = H_width; i > 0; --i, dp++)
422 line_ldst->
f32[0] = line_src->
f32[0];
424 line_hdst->
f32[0] = line_src->
f32[0] + line_src->
f32[0];
435 float *lsrc = line_lsrc->
f32, *hsrc = line_hsrc->
f32;
436 float *dst = line_dst->
f32;
438 const ui32 L_width = (width + (even ? 1 : 0)) >> 1;
439 const ui32 H_width = (width + (even ? 0 : 1)) >> 1;
443 for (
ui32 i = L_width; i > 0; --i, dp++)
446 for (
ui32 i = H_width; i > 0; --i, dp++)
451 hsrc[H_width] = hsrc[H_width-1];
454 const float *sph = hsrc + (even ? 0 : 1);
456 for (
ui32 i = L_width; i > 0; --i, dpl++, sph++)
457 *dpl += factor * (sph[-1] + sph[0]);
461 lsrc[L_width] = lsrc[L_width-1];
464 const float *spl = lsrc + (even ? 0 : -1);
466 for (
ui32 i = H_width; i > 0; --i, dph++, spl++)
467 *dph += factor * (spl[0] + spl[1]);
471 hsrc[H_width] = hsrc[H_width-1];
474 sph = hsrc + (even ? 0 : 1);
476 for (
ui32 i = L_width; i > 0; --i, dpl++, sph++)
477 *dpl += factor * (sph[-1] + sph[0]);
481 lsrc[L_width] = lsrc[L_width-1];
484 dp = dst + (even ? 0 : -1);
485 spl = lsrc + (even ? 0 : -1);
487 for (
ui32 i = L_width+(even?0:1); i > 0; --i, spl++, sph++)
490 *dp++ = *sph + factor * (spl[0] + spl[1]);
496 line_dst->
f32[0] = line_lsrc->
f32[0];
498 line_dst->
f32[0] = line_hsrc->
f32[0] * 0.5f;
void wasm_rev_horz_wvlt_bwd_tx(line_buf *line_dst, line_buf *line_lsrc, line_buf *line_hsrc, ui32 width, bool even)
void avx2_rev_vert_wvlt_fwd_update(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void sse_irrev_horz_wvlt_bwd_tx(line_buf *src, line_buf *ldst, line_buf *hdst, ui32 width, bool even)
void gen_rev_vert_wvlt_bwd_update(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void gen_rev_vert_wvlt_fwd_predict(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void sse2_rev_horz_wvlt_fwd_tx(line_buf *src, line_buf *ldst, line_buf *hdst, ui32 width, bool even)
void avx_irrev_horz_wvlt_bwd_tx(line_buf *line_dst, line_buf *line_lsrc, line_buf *line_hsrc, ui32 width, bool even)
void avx2_rev_horz_wvlt_fwd_tx(line_buf *line_src, line_buf *line_ldst, line_buf *line_hdst, ui32 width, bool even)
void wasm_rev_vert_wvlt_fwd_update(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void wasm_rev_vert_wvlt_bwd_predict(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void gen_rev_horz_wvlt_bwd_tx(line_buf *line_dst, line_buf *line_lsrc, line_buf *line_hsrc, ui32 width, bool even)
void(* irrev_horz_wvlt_fwd_tx)(line_buf *src, line_buf *ldst, line_buf *hdst, ui32 width, bool even)
void avx2_rev_vert_wvlt_fwd_predict(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void avx_irrev_horz_wvlt_fwd_tx(line_buf *line_src, line_buf *line_ldst, line_buf *line_hdst, ui32 width, bool even)
void wasm_irrev_horz_wvlt_bwd_tx(line_buf *line_src, line_buf *line_ldst, line_buf *line_hdst, ui32 width, bool even)
void sse2_rev_vert_wvlt_fwd_update(const line_buf *src1, const line_buf *src2, line_buf *dst, ui32 repeat)
void(* rev_horz_wvlt_bwd_tx)(line_buf *dst, line_buf *lsrc, line_buf *hsrc, ui32 width, bool even)
void sse2_rev_horz_wvlt_bwd_tx(line_buf *dst, line_buf *lsrc, line_buf *hsrc, ui32 width, bool even)
void wasm_irrev_vert_wvlt_K(const line_buf *line_src, line_buf *line_dst, bool L_analysis_or_H_synthesis, ui32 repeat)
void gen_rev_vert_wvlt_fwd_update(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
static bool wavelet_transform_functions_initialized
void avx_irrev_vert_wvlt_K(const line_buf *line_src, line_buf *line_dst, bool L_analysis_or_H_synthesis, ui32 repeat)
void avx2_rev_vert_wvlt_bwd_predict(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void init_wavelet_transform_functions()
void(* rev_vert_wvlt_fwd_update)(const line_buf *src1, const line_buf *src2, line_buf *dst, ui32 repeat)
void avx_irrev_vert_wvlt_step(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, int step_num, ui32 repeat)
void sse_irrev_horz_wvlt_fwd_tx(line_buf *src, line_buf *ldst, line_buf *hdst, ui32 width, bool even)
void sse2_rev_vert_wvlt_bwd_predict(const line_buf *src1, const line_buf *src2, line_buf *dst, ui32 repeat)
void gen_rev_horz_wvlt_fwd_tx(line_buf *line_src, line_buf *line_ldst, line_buf *line_hdst, ui32 width, bool even)
void(* rev_horz_wvlt_fwd_tx)(line_buf *src, line_buf *ldst, line_buf *hdst, ui32 width, bool even)
void(* irrev_vert_wvlt_step)(const line_buf *src1, const line_buf *src2, line_buf *dst, int step_num, ui32 repeat)
void wasm_irrev_vert_wvlt_step(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, int step_num, ui32 repeat)
void gen_irrev_vert_wvlt_K(const line_buf *line_src, line_buf *line_dst, bool L_analysis_or_H_synthesis, ui32 repeat)
void gen_irrev_horz_wvlt_fwd_tx(line_buf *line_src, line_buf *line_ldst, line_buf *line_hdst, ui32 width, bool even)
void sse2_rev_vert_wvlt_fwd_predict(const line_buf *src1, const line_buf *src2, line_buf *dst, ui32 repeat)
void(* rev_vert_wvlt_bwd_update)(const line_buf *src1, const line_buf *src2, line_buf *dst, ui32 repeat)
void avx2_rev_horz_wvlt_bwd_tx(line_buf *line_dst, line_buf *line_lsrc, line_buf *line_hsrc, ui32 width, bool even)
void gen_irrev_horz_wvlt_bwd_tx(line_buf *line_dst, line_buf *line_lsrc, line_buf *line_hsrc, ui32 width, bool even)
void(* rev_vert_wvlt_bwd_predict)(const line_buf *src1, const line_buf *src2, line_buf *dst, ui32 repeat)
void(* rev_vert_wvlt_fwd_predict)(const line_buf *src1, const line_buf *src2, line_buf *dst, ui32 repeat)
void(* irrev_horz_wvlt_bwd_tx)(line_buf *src, line_buf *ldst, line_buf *hdst, ui32 width, bool even)
void sse_irrev_vert_wvlt_K(const line_buf *src, line_buf *dst, bool L_analysis_or_H_synthesis, ui32 repeat)
void(* irrev_vert_wvlt_K)(const line_buf *src, line_buf *dst, bool L_analysis_or_H_synthesis, ui32 repeat)
void sse_irrev_vert_wvlt_step(const line_buf *src1, const line_buf *src2, line_buf *dst, int step_num, ui32 repeat)
void wasm_rev_horz_wvlt_fwd_tx(line_buf *line_src, line_buf *line_ldst, line_buf *line_hdst, ui32 width, bool even)
void wasm_irrev_horz_wvlt_fwd_tx(line_buf *line_src, line_buf *line_ldst, line_buf *line_hdst, ui32 width, bool even)
void wasm_rev_vert_wvlt_fwd_predict(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void gen_rev_vert_wvlt_bwd_predict(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void avx2_rev_vert_wvlt_bwd_update(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
void gen_irrev_vert_wvlt_step(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, int step_num, ui32 repeat)
void sse2_rev_vert_wvlt_bwd_update(const line_buf *src1, const line_buf *src2, line_buf *dst, ui32 repeat)
void wasm_rev_vert_wvlt_bwd_update(const line_buf *line_src1, const line_buf *line_src2, line_buf *line_dst, ui32 repeat)
OJPH_EXPORT int get_cpu_ext_level()
static const float steps[8]