27 uint64_t qscale, uint64_t qadd)
29 uint64_t qmul = qscale << 1;
30 uint64_t correction =
WORD_VEC(qmul * 255 >> 8);
35 for(i = 0; i <= n_coeffs; block += 4, i += 4) {
36 uint64_t levels, negmask, zeros, add, sub;
45 negmask = maxsw4(levels, -1);
46 negmask = minsw4(negmask, 0);
48 negmask = cmpbge(
WORD_VEC(0x7fff), levels);
49 negmask &= (negmask >> 1) | (1 << 7);
50 negmask = zap(-1, negmask);
53 zeros = cmpbge(0, levels);
59 levels -= correction & (negmask << 16);
61 add = qadd & ~negmask;
64 add = zap(add, zeros);
77 int16_t block0 = block[0];
84 qadd = (qscale - 1) | 1;