void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) { int i, shift, sp1, sp2, sp3, sp4; const int32_t *src; int32_t *dst; int tmp[64]; int t0, t1, t2, t3, t4, t5, t6, t7, t8; /* apply the InvHaar8 to all columns */ #define COMPENSATE(x) (x) src = in; dst = tmp; for (i = 0; i < 8; i++) { if (flags[i]) { /* pre-scaling */ shift = !(i & 4); sp1 = src[ 0] << shift; sp2 = src[ 8] << shift; sp3 = src[16] << shift; sp4 = src[24] << shift; INV_HAAR8( sp1, sp2, sp3, sp4, src[32], src[40], src[48], src[56], dst[ 0], dst[ 8], dst[16], dst[24], dst[32], dst[40], dst[48], dst[56], t0, t1, t2, t3, t4, t5, t6, t7, t8); } else dst[ 0] = dst[ 8] = dst[16] = dst[24] = dst[32] = dst[40] = dst[48] = dst[56] = 0; src++; dst++; } #undef COMPENSATE /* apply the InvHaar8 to all rows */ #define COMPENSATE(x) (x) src = tmp; for (i = 0; i < 8; i++) { if ( !src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) { memset(out, 0, 8 * sizeof(out[0])); } else { INV_HAAR8(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7], out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7], t0, t1, t2, t3, t4, t5, t6, t7, t8); } src += 8; out += pitch; } #undef COMPENSATE }
void ff_ivi_col_haar8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) { int i; int t0, t1, t2, t3, t4, t5, t6, t7, t8; /* apply the InvHaar8 to all columns */ #define COMPENSATE(x) (x) for (i = 0; i < 8; i++) { if (flags[i]) { INV_HAAR8(in[ 0], in[ 8], in[16], in[24], in[32], in[40], in[48], in[56], out[0 * pitch], out[1 * pitch], out[2 * pitch], out[3 * pitch], out[4 * pitch], out[5 * pitch], out[6 * pitch], out[7 * pitch], t0, t1, t2, t3, t4, t5, t6, t7, t8); } else out[0 * pitch] = out[1 * pitch] = out[2 * pitch] = out[3 * pitch] = out[4 * pitch] = out[5 * pitch] = out[6 * pitch] = out[7 * pitch] = 0; in++; out++; } #undef COMPENSATE }
void ff_ivi_inverse_haar_8x1(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) { int i; const int32_t *src; int t0, t1, t2, t3, t4, t5, t6, t7, t8; /* apply the InvHaar8 to all rows */ #define COMPENSATE(x) (x) src = in; for (i = 0; i < 8; i++) { if ( !src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) { memset(out, 0, 8 * sizeof(out[0])); } else { INV_HAAR8(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7], out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7], t0, t1, t2, t3, t4, t5, t6, t7, t8); } src += 8; out += pitch; } #undef COMPENSATE }
void ff_ivi_inverse_haar_1x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) { int i; const int32_t *src; int t0, t1, t2, t3, t4, t5, t6, t7, t8; /* apply the InvHaar8 to all columns */ #define COMPENSATE(x) (x) src = in; for (i = 0; i < 8; i++) { if (flags[i]) { INV_HAAR8(src[ 0], src[ 8], src[16], src[24], src[32], src[40], src[48], src[56], out[ 0], out[pitch], out[2*pitch], out[3*pitch], out[4*pitch], out[5*pitch], out[6*pitch], out[7*pitch], t0, t1, t2, t3, t4, t5, t6, t7, t8); } else out[ 0]= out[ pitch]= out[2*pitch]= out[3*pitch]= out[4*pitch]= out[5*pitch]= out[6*pitch]= out[7*pitch]= 0; src++; out++; } #undef COMPENSATE }
void IndeoDSP::ffIviColHaar8(const int32 *in, int16 *out, uint32 pitch, const uint8 *flags) { int t0, t1, t2, t3, t4, t5, t6, t7, t8; // apply the InvHaar8 to all columns #define COMPENSATE(x) (x) for (int i = 0; i < 8; i++) { if (flags[i]) { INV_HAAR8(in[ 0], in[ 8], in[16], in[24], in[32], in[40], in[48], in[56], out[0 * pitch], out[1 * pitch], out[2 * pitch], out[3 * pitch], out[4 * pitch], out[5 * pitch], out[6 * pitch], out[7 * pitch], t0, t1, t2, t3, t4, t5, t6, t7, t8); } else { out[0 * pitch] = out[1 * pitch] = out[2 * pitch] = out[3 * pitch] = out[4 * pitch] = out[5 * pitch] = out[6 * pitch] = out[7 * pitch] = 0; } in++; out++; } #undef COMPENSATE }
void ff_ivi_row_haar8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags) { int i; int t0, t1, t2, t3, t4, t5, t6, t7, t8; /* apply the InvHaar8 to all rows */ #define COMPENSATE(x) (x) for (i = 0; i < 8; i++) { if ( !in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) { memset(out, 0, 8 * sizeof(out[0])); } else { INV_HAAR8(in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7], t0, t1, t2, t3, t4, t5, t6, t7, t8); } in += 8; out += pitch; } #undef COMPENSATE }