From 7e5e240f3f77e1243c09757700755ea62e16c1f9 Mon Sep 17 00:00:00 2001 From: Aous Naman Date: Tue, 29 Oct 2024 17:48:10 +1100 Subject: [PATCH] The front end is complete for generic code (not SIMD). --- src/core/codestream/ojph_tile.cpp | 91 +++++----- src/core/common/ojph_mem.h | 6 +- src/core/transform/ojph_colour.cpp | 224 ++++++++++++++++++++----- src/core/transform/ojph_colour.h | 32 ++-- src/core/transform/ojph_colour_local.h | 22 ++- 5 files changed, 263 insertions(+), 112 deletions(-) diff --git a/src/core/codestream/ojph_tile.cpp b/src/core/codestream/ojph_tile.cpp index 281e156..b1cb95a 100644 --- a/src/core/codestream/ojph_tile.cpp +++ b/src/core/codestream/ojph_tile.cpp @@ -259,17 +259,15 @@ namespace ojph { line_buf *tc = comps[comp_num].get_line(); if (reversible) { - int shift = 1 << (num_bits[comp_num] - 1); - const si32 *sp = line->i32 + line_offsets[comp_num]; - si32* dp = tc->i32; - if (is_signed[comp_num]) { - if (nlt_type3[comp_num]) - cnvrt_si32_to_si32_nlt_type3(sp, dp, shift + 1, comp_width); - else - memcpy(dp, sp, comp_width * sizeof(si32)); + si64 shift = 1LL << (num_bits[comp_num] - 1); + if (is_signed[comp_num] && nlt_type3[comp_num]) + rev_convert_nlt_type3(line, line_offsets[comp_num], + tc, 0, shift + 1, comp_width); + else { + shift = is_signed[comp_num] ? 0 : -shift; + rev_convert(line, line_offsets[comp_num], tc, 0, + shift, comp_width); } - else - cnvrt_si32_to_si32_shftd(sp, dp, -shift, comp_width); } else { @@ -285,26 +283,25 @@ namespace ojph { } else { - int shift = 1 << (num_bits[comp_num] - 1); + si64 shift = 1LL << (num_bits[comp_num] - 1); ui32 comp_width = comp_rects[comp_num].siz.w; if (reversible) { - const si32 *sp = line->i32 + line_offsets[comp_num]; - si32 *dp = lines[comp_num].i32; - if (is_signed[comp_num]) { - if (nlt_type3[comp_num]) - cnvrt_si32_to_si32_nlt_type3(sp, dp, shift + 1, comp_width); - else - memcpy(dp, sp, comp_width * sizeof(si32)); + if (is_signed[comp_num] && nlt_type3[comp_num]) + rev_convert_nlt_type3(line, line_offsets[comp_num], + lines + comp_num, 0, shift + 1, comp_width); + else { + shift = is_signed[comp_num] ? 0 : -shift; + rev_convert(line, line_offsets[comp_num], lines + comp_num, 0, + shift, comp_width); } - else - cnvrt_si32_to_si32_shftd(sp, dp, -shift, comp_width); + if (comp_num == 2) { // reversible color transform - rct_forward(lines[0].i32, lines[1].i32, lines[2].i32, - comps[0].get_line()->i32, - comps[1].get_line()->i32, - comps[2].get_line()->i32, comp_width); + rct_forward(lines + 0, lines + 1, lines + 2, + comps[0].get_line(), + comps[1].get_line(), + comps[2].get_line(), comp_width); comps[0].push_line(); comps[1].push_line(); comps[2].push_line(); @@ -350,17 +347,15 @@ namespace ojph { ui32 comp_width = recon_comp_rects[comp_num].siz.w; if (reversible) { - int shift = 1 << (num_bits[comp_num] - 1); - const si32 *sp = src_line->i32; - si32* dp = tgt_line->i32 + line_offsets[comp_num]; - if (is_signed[comp_num]) { - if (nlt_type3[comp_num]) - cnvrt_si32_to_si32_nlt_type3(sp, dp, shift + 1, comp_width); - else - memcpy(dp, sp, comp_width * sizeof(si32)); + si64 shift = 1LL << (num_bits[comp_num] - 1); + if (is_signed[comp_num] && nlt_type3[comp_num]) + rev_convert_nlt_type3(src_line, 0, tgt_line, + line_offsets[comp_num], shift + 1, comp_width); + else { + shift = is_signed[comp_num] ? 0 : shift; + rev_convert(src_line, 0, tgt_line, + line_offsets[comp_num], shift, comp_width); } - else - cnvrt_si32_to_si32_shftd(sp, dp, +shift, comp_width); } else { @@ -380,9 +375,9 @@ namespace ojph { if (comp_num == 0) { if (reversible) - rct_backward(comps[0].pull_line()->i32, comps[1].pull_line()->i32, - comps[2].pull_line()->i32, lines[0].i32, lines[1].i32, - lines[2].i32, comp_width); + rct_backward(comps[0].pull_line(), comps[1].pull_line(), + comps[2].pull_line(), lines + 0, lines + 1, + lines + 2, comp_width); else ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32, comps[2].pull_line()->f32, lines[0].f32, lines[1].f32, @@ -390,21 +385,21 @@ namespace ojph { } if (reversible) { - int shift = 1 << (num_bits[comp_num] - 1); - const si32 *sp; + si64 shift = 1LL << (num_bits[comp_num] - 1); + line_buf* src_line; if (comp_num < 3) - sp = lines[comp_num].i32; + src_line = lines + comp_num; else - sp = comps[comp_num].pull_line()->i32; + src_line = comps[comp_num].pull_line(); si32* dp = tgt_line->i32 + line_offsets[comp_num]; - if (is_signed[comp_num]) { - if (nlt_type3[comp_num]) - cnvrt_si32_to_si32_nlt_type3(sp, dp, shift + 1, comp_width); - else - memcpy(dp, sp, comp_width * sizeof(si32)); + if (is_signed[comp_num] && nlt_type3[comp_num]) + rev_convert_nlt_type3(src_line, 0, tgt_line, + line_offsets[comp_num], shift + 1, comp_width); + else { + shift = is_signed[comp_num] ? 0 : shift; + rev_convert(src_line, 0, tgt_line, + line_offsets[comp_num], shift, comp_width); } - else - cnvrt_si32_to_si32_shftd(sp, dp, +shift, comp_width); } else { diff --git a/src/core/common/ojph_mem.h b/src/core/common/ojph_mem.h index f58c8ad..abd5a0f 100644 --- a/src/core/common/ojph_mem.h +++ b/src/core/common/ojph_mem.h @@ -139,9 +139,9 @@ namespace ojph { LFT_UNDEFINED = 0x00, // Type is undefined/uninitialized // These flags reflects data size in bytes LFT_BYTE = 0x01, // Set when data is 1 byte - LFT_SHORT = 0x02, // Set when data is 2 bytes - LFT_INTEGER = 0x04, // Set when data is 4 bytes - LFT_LONG = 0x08, // Set when data is 8 bytes + LFT_16BIT = 0x02, // Set when data is 2 bytes + LFT_32BIT = 0x04, // Set when data is 4 bytes + LFT_64BIT = 0x08, // Set when data is 8 bytes LFT_REVERSIBLE = 0x10, // Set when data is used for reversible coding // Not all combinations are useful LFT_SIZE_MASK = 0x0F, // To extract data size diff --git a/src/core/transform/ojph_colour.cpp b/src/core/transform/ojph_colour.cpp index 6ef88ca..154b66b 100644 --- a/src/core/transform/ojph_colour.cpp +++ b/src/core/transform/ojph_colour.cpp @@ -51,28 +51,32 @@ namespace ojph { namespace local { ////////////////////////////////////////////////////////////////////////// - void (*cnvrt_si32_to_si32_shftd) - (const line_buf* src, line_buf* dst, int shift, ui32 width) = NULL; + void (*rev_convert) + (const line_buf *src_line, const ui32 src_line_offset, + line_buf *dst_line, const ui32 dst_line_offset, + si64 shift, ui32 width) = NULL; ////////////////////////////////////////////////////////////////////////// - void (*cnvrt_si32_to_si32_nlt_type3) - (const line_buf* src, line_buf* dst, int shift, ui32 width) = NULL; + void (*rev_convert_nlt_type3) + (const line_buf *src_line, const ui32 src_line_offset, + line_buf *dst_line, const ui32 dst_line_offset, + si64 shift, ui32 width) = NULL; ////////////////////////////////////////////////////////////////////////// void (*cnvrt_si32_to_float_shftd) - (const line_buf* src, line_buf* dst, float mul, ui32 width) = NULL; + (const si32 *sp, float *dp, float mul, ui32 width) = NULL; ////////////////////////////////////////////////////////////////////////// void (*cnvrt_si32_to_float) - (const line_buf* src, line_buf* dst, float mul, ui32 width) = NULL; + (const si32 *sp, float *dp, float mul, ui32 width) = NULL; ////////////////////////////////////////////////////////////////////////// void (*cnvrt_float_to_si32_shftd) - (const line_buf* sp, line_buf* dp, float mul, ui32 width) = NULL; + (const float *sp, si32 *dp, float mul, ui32 width) = NULL; ////////////////////////////////////////////////////////////////////////// void (*cnvrt_float_to_si32) - (const line_buf* sp, line_buf* dp, float mul, ui32 width) = NULL; + (const float *sp, si32 *dp, float mul, ui32 width) = NULL; ////////////////////////////////////////////////////////////////////////// void (*rct_forward) @@ -91,8 +95,8 @@ namespace ojph { ////////////////////////////////////////////////////////////////////////// void (*ict_backward) - (const line_buf* y, const line_buf* cb, const line_buf* cr, - line_buf* r, line_buf* g, line_buf* b, ui32 repeat) = NULL; + (const float *y, const float *cb, const float *cr, + float *r, float *g, float *b, ui32 repeat) = NULL; ////////////////////////////////////////////////////////////////////////// static bool colour_transform_functions_initialized = false; @@ -105,8 +109,10 @@ namespace ojph { #if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN) - cnvrt_si32_to_si32_shftd = gen_cnvrt_si32_to_si32_shftd; - cnvrt_si32_to_si32_nlt_type3 = gen_cnvrt_si32_to_si32_nlt_type3; + // cnvrt_si32_to_si32_shftd = gen_cnvrt_si32_to_si32_shftd; + // cnvrt_si32_to_si32_nlt_type3 = gen_cnvrt_si32_to_si32_nlt_type3; + rev_convert = gen_rev_convert; + rev_convert_nlt_type3 = gen_rev_convert_nlt_type3; cnvrt_si32_to_float_shftd = gen_cnvrt_si32_to_float_shftd; cnvrt_si32_to_float = gen_cnvrt_si32_to_float; cnvrt_float_to_si32_shftd = gen_cnvrt_float_to_si32_shftd; @@ -137,10 +143,10 @@ namespace ojph { { cnvrt_float_to_si32_shftd = sse2_cnvrt_float_to_si32_shftd; cnvrt_float_to_si32 = sse2_cnvrt_float_to_si32; - cnvrt_si32_to_si32_shftd = sse2_cnvrt_si32_to_si32_shftd; - cnvrt_si32_to_si32_nlt_type3 = sse2_cnvrt_si32_to_si32_nlt_type3; - rct_forward = sse2_rct_forward; - rct_backward = sse2_rct_backward; + // cnvrt_si32_to_si32_shftd = sse2_cnvrt_si32_to_si32_shftd; + // cnvrt_si32_to_si32_nlt_type3 = sse2_cnvrt_si32_to_si32_nlt_type3; + // rct_forward = sse2_rct_forward; + // rct_backward = sse2_rct_backward; } #endif // !OJPH_DISABLE_SSE2 @@ -159,10 +165,10 @@ namespace ojph { #ifndef OJPH_DISABLE_AVX2 if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2) { - cnvrt_si32_to_si32_shftd = avx2_cnvrt_si32_to_si32_shftd; - cnvrt_si32_to_si32_nlt_type3 = avx2_cnvrt_si32_to_si32_nlt_type3; - rct_forward = avx2_rct_forward; - rct_backward = avx2_rct_backward; + // cnvrt_si32_to_si32_shftd = avx2_cnvrt_si32_to_si32_shftd; + // cnvrt_si32_to_si32_nlt_type3 = avx2_cnvrt_si32_to_si32_nlt_type3; + // rct_forward = avx2_rct_forward; + // rct_backward = avx2_rct_backward; } #endif // !OJPH_DISABLE_AVX2 @@ -206,20 +212,78 @@ namespace ojph { #if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN) ////////////////////////////////////////////////////////////////////////// - void gen_cnvrt_si32_to_si32_shftd(const si32 *sp, si32 *dp, int shift, - ui32 width) + void gen_rev_convert( + const line_buf *src_line, const ui32 src_line_offset, + line_buf *dst_line, const ui32 dst_line_offset, + si64 shift, ui32 width) { - for (ui32 i = width; i > 0; --i) - *dp++ = *sp++ + shift; + if (src_line->flags | line_buf::LFT_32BIT) + { + if (dst_line->flags | line_buf::LFT_32BIT) + { + const si32 *sp = src_line->i32 + src_line_offset; + si32 *dp = dst_line->i32 + dst_line_offset; + si32 s = (si32)shift; + for (ui32 i = width; i > 0; --i) + *dp++ = *sp++ + s; + } + else + { + const si32 *sp = src_line->i32 + src_line_offset; + si64 *dp = (si64*)dst_line->p + dst_line_offset; + for (ui32 i = width; i > 0; --i) + *dp++ = *sp++ + shift; + } + } + else + { + assert(src_line->flags | line_buf::LFT_64BIT); + assert(dst_line->flags | line_buf::LFT_32BIT); + const si64 *sp = (si64*)src_line->p + src_line_offset; + si32 *dp = dst_line->i32 + dst_line_offset; + for (ui32 i = width; i > 0; --i) + *dp++ = (si32)(*sp++ + shift); + } } ////////////////////////////////////////////////////////////////////////// - void gen_cnvrt_si32_to_si32_nlt_type3(const si32 *sp, si32 *dp, - int shift, ui32 width) + void gen_rev_convert_nlt_type3( + const line_buf *src_line, const ui32 src_line_offset, + line_buf *dst_line, const ui32 dst_line_offset, + si64 shift, ui32 width) { - for (ui32 i = width; i > 0; --i) { - const si32 v = *sp++; - *dp++ = v >= 0 ? v : (- v - shift); + if (src_line->flags | line_buf::LFT_32BIT) + { + if (dst_line->flags | line_buf::LFT_32BIT) + { + const si32 *sp = src_line->i32 + src_line_offset; + si32 *dp = dst_line->i32 + dst_line_offset; + si32 s = (si32)shift; + for (ui32 i = width; i > 0; --i) { + const si32 v = *sp++; + *dp++ = v >= 0 ? v : (- v - s); + } + } + else + { + const si32 *sp = src_line->i32 + src_line_offset; + si64 *dp = (si64*)dst_line->p + dst_line_offset; + for (ui32 i = width; i > 0; --i) { + const si64 v = *sp++; + *dp++ = v >= 0 ? v : (- v - shift); + } + } + } + else + { + assert(src_line->flags | line_buf::LFT_64BIT); + assert(dst_line->flags | line_buf::LFT_32BIT); + const si64 *sp = (si64*)src_line->p + src_line_offset; + si32 *dp = dst_line->i32 + dst_line_offset; + for (ui32 i = width; i > 0; --i) { + const si64 v = *sp++; + *dp++ = (si32)(v >= 0 ? v : (- v - shift)); + } } } @@ -256,26 +320,104 @@ namespace ojph { } ////////////////////////////////////////////////////////////////////////// - void gen_rct_forward(const si32 *r, const si32 *g, const si32 *b, - si32 *y, si32 *cb, si32 *cr, ui32 repeat) + void gen_rct_forward( + const line_buf *r, const line_buf *g, const line_buf *b, + line_buf *y, line_buf *cb, line_buf *cr, ui32 repeat) { - for (ui32 i = repeat; i > 0; --i) + assert((y->flags | line_buf::LFT_REVERSIBLE) && + (cb->flags | line_buf::LFT_REVERSIBLE) && + (cr->flags | line_buf::LFT_REVERSIBLE) && + (r->flags | line_buf::LFT_REVERSIBLE) && + (g->flags | line_buf::LFT_REVERSIBLE) && + (b->flags | line_buf::LFT_REVERSIBLE)); + + if (y->flags | line_buf::LFT_32BIT) + { + assert((y->flags | line_buf::LFT_32BIT) && + (cb->flags | line_buf::LFT_32BIT) && + (cr->flags | line_buf::LFT_32BIT) && + (r->flags | line_buf::LFT_32BIT) && + (g->flags | line_buf::LFT_32BIT) && + (b->flags | line_buf::LFT_32BIT)); + const si32 *rp = r->i32, * gp = g->i32, * bp = b->i32; + si32 *yp = y->i32, * cbp = cb->i32, * crp = cr->i32; + for (ui32 i = repeat; i > 0; --i) + { + si32 rr = *rp++, gg = *gp++, bb = *bp++; + *yp++ = (rr + (gg << 1) + bb) >> 2; + *cbp++ = (bb - gg); + *crp++ = (rr - gg); + } + } + else { - *y++ = (*r + (*g << 1) + *b) >> 2; - *cb++ = (*b++ - *g); - *cr++ = (*r++ - *g++); + assert((y->flags | line_buf::LFT_64BIT) && + (cb->flags | line_buf::LFT_64BIT) && + (cr->flags | line_buf::LFT_64BIT) && + (r->flags | line_buf::LFT_32BIT) && + (g->flags | line_buf::LFT_32BIT) && + (b->flags | line_buf::LFT_32BIT)); + const si32 *rp = r->i32, *gp = g->i32, *bp = b->i32; + si64 *yp = (si64*)y->p, *cbp = (si64*)cb->p, *crp = (si64*)cr->p; + for (ui32 i = repeat; i > 0; --i) + { + si64 rr = *rp++, gg = *gp++, bb = *bp++; + *yp++ = (rr + (gg << 1) + bb) >> 2; + *cbp++ = (bb - gg); + *crp++ = (rr - gg); + } } } ////////////////////////////////////////////////////////////////////////// - void gen_rct_backward(const si32 *y, const si32 *cb, const si32 *cr, - si32 *r, si32 *g, si32 *b, ui32 repeat) + void gen_rct_backward( + const line_buf *y, const line_buf *cb, const line_buf *cr, + line_buf *r, line_buf *g, line_buf *b, ui32 repeat) { - for (ui32 i = repeat; i > 0; --i) + assert((y->flags | line_buf::LFT_REVERSIBLE) && + (cb->flags | line_buf::LFT_REVERSIBLE) && + (cr->flags | line_buf::LFT_REVERSIBLE) && + (r->flags | line_buf::LFT_REVERSIBLE) && + (g->flags | line_buf::LFT_REVERSIBLE) && + (b->flags | line_buf::LFT_REVERSIBLE)); + + if (y->flags | line_buf::LFT_32BIT) { - *g = *y++ - ((*cb + *cr)>>2); - *b++ = *cb++ + *g; - *r++ = *cr++ + *g++; + assert((y->flags | line_buf::LFT_32BIT) && + (cb->flags | line_buf::LFT_32BIT) && + (cr->flags | line_buf::LFT_32BIT) && + (r->flags | line_buf::LFT_32BIT) && + (g->flags | line_buf::LFT_32BIT) && + (b->flags | line_buf::LFT_32BIT)); + const si32 *yp = y->i32, *cbp = cb->i32, *crp = cr->i32; + si32 *rp = r->i32, *gp = g->i32, *bp = b->i32; + for (ui32 i = repeat; i > 0; --i) + { + si32 yy = *yp++, cbb = *cbp++, crr = *crp++; + si32 gg = yy - ((cbb + crr) >> 2); + *rp++ = crr + gg; + *gp++ = gg; + *bp++ = cbb + gg; + } + } + else + { + assert((y->flags | line_buf::LFT_64BIT) && + (cb->flags | line_buf::LFT_64BIT) && + (cr->flags | line_buf::LFT_64BIT) && + (r->flags | line_buf::LFT_32BIT) && + (g->flags | line_buf::LFT_32BIT) && + (b->flags | line_buf::LFT_32BIT)); + const si64 *yp = (si64*)y->p, *cbp = (si64*)cb->p, *crp = (si64*)cr->p; + si32 *rp = r->i32, *gp = g->i32, *bp = b->i32; + for (ui32 i = repeat; i > 0; --i) + { + si64 yy = *yp++, cbb = *cbp++, crr = *crp++; + si64 gg = yy - ((cbb + crr) >> 2); + *rp++ = (si32)(crr + gg); + *gp++ = (si32)gg; + *bp++ = (si32)(cbb + gg); + } } } diff --git a/src/core/transform/ojph_colour.h b/src/core/transform/ojph_colour.h index a03759e..cc42aaa 100644 --- a/src/core/transform/ojph_colour.h +++ b/src/core/transform/ojph_colour.h @@ -40,34 +40,42 @@ #define OJPH_COLOR_H namespace ojph { + + // defined elsewhere + class line_buf; + namespace local { //////////////////////////////////////////////////////////////////////////// void init_colour_transform_functions(); //////////////////////////////////////////////////////////////////////////// - extern void (*cnvrt_si32_to_si32_shftd) - (const line_buf* sp, line_buf* dp, int shift, ui32 width); + extern void (*rev_convert) + (const line_buf *src_line, const ui32 src_line_offset, + line_buf *dst_line, const ui32 dst_line_offset, + si64 shift, ui32 width); //////////////////////////////////////////////////////////////////////////// - extern void (*cnvrt_si32_to_si32_nlt_type3) - (const line_buf *sp, line_buf *dp, int shift, ui32 width); + extern void (*rev_convert_nlt_type3) + (const line_buf *src_line, const ui32 src_line_offset, + line_buf *dst_line, const ui32 dst_line_offset, + si64 shift, ui32 width); //////////////////////////////////////////////////////////////////////////// extern void (*cnvrt_si32_to_float_shftd) - (const line_buf *sp, line_buf *dp, float mul, ui32 width); + (const si32 *sp, float *dp, float mul, ui32 width); //////////////////////////////////////////////////////////////////////////// extern void (*cnvrt_si32_to_float) - (const line_buf *sp, line_buf *dp, float mul, ui32 width); + (const si32 *sp, float *dp, float mul, ui32 width); //////////////////////////////////////////////////////////////////////////// extern void (*cnvrt_float_to_si32_shftd) - (const line_buf *sp, line_buf *dp, float mul, ui32 width); + (const float *sp, si32 *dp, float mul, ui32 width); //////////////////////////////////////////////////////////////////////////// extern void (*cnvrt_float_to_si32) - (const line_buf *sp, line_buf *dp, float mul, ui32 width); + (const float *sp, si32 *dp, float mul, ui32 width); //////////////////////////////////////////////////////////////////////////// extern void (*rct_forward) @@ -81,13 +89,13 @@ namespace ojph { //////////////////////////////////////////////////////////////////////////// extern void (*ict_forward) - (const line_buf *r, const line_buf *g, const line_buf *b, - line_buf *y, line_buf *cb, line_buf *cr, ui32 repeat); + (const float *r, const float *g, const float *b, + float *y, float *cb, float *cr, ui32 repeat); //////////////////////////////////////////////////////////////////////////// extern void (*ict_backward) - (const line_buf *y, const line_buf *cb, const line_buf *cr, - line_buf *r, line_buf *g, line_buf *b, ui32 repeat); + (const float *y, const float *cb, const float *cr, + float *r, float *g, float *b, ui32 repeat); } } diff --git a/src/core/transform/ojph_colour_local.h b/src/core/transform/ojph_colour_local.h index ae5eba1..08e99a9 100644 --- a/src/core/transform/ojph_colour_local.h +++ b/src/core/transform/ojph_colour_local.h @@ -65,12 +65,16 @@ namespace ojph { ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// - void gen_cnvrt_si32_to_si32_shftd(const si32 *sp, si32 *dp, int shift, - ui32 width); + void gen_rev_convert( + const line_buf *src_line, const ui32 src_line_offset, + line_buf *dst_line, const ui32 dst_line_offset, + si64 shift, ui32 width); ////////////////////////////////////////////////////////////////////////// - void gen_cnvrt_si32_to_si32_nlt_type3(const si32 *sp, si32 *dp, - int shift, ui32 width); + void gen_rev_convert_nlt_type3( + const line_buf *src_line, const ui32 src_line_offset, + line_buf *dst_line, const ui32 dst_line_offset, + si64 shift, ui32 width); ////////////////////////////////////////////////////////////////////////// void gen_cnvrt_si32_to_float_shftd(const si32 *sp, float *dp, float mul, @@ -89,12 +93,14 @@ namespace ojph { ui32 width); ////////////////////////////////////////////////////////////////////////// - void gen_rct_forward(const si32 *r, const si32 *g, const si32 *b, - si32 *y, si32 *cb, si32 *cr, ui32 repeat); + void gen_rct_forward( + const line_buf *r, const line_buf *g, const line_buf *b, + line_buf *y, line_buf *cb, line_buf *cr, ui32 repeat); ////////////////////////////////////////////////////////////////////////// - void gen_rct_backward(const si32 *y, const si32 *cb, const si32 *cr, - si32 *r, si32 *g, si32 *b, ui32 repeat); + void gen_rct_backward( + const line_buf *y, const line_buf *cb, const line_buf *cr, + line_buf *r, line_buf *g, line_buf *b, ui32 repeat); ////////////////////////////////////////////////////////////////////////// void gen_ict_forward(const float *r, const float *g, const float *b,