- int i, n_coeffs;
- uint64_t qmul, qadd;
- uint64_t correction;
-
- qadd = WORD_VEC((qscale - 1) | 1);
- qmul = qscale << 1;
- /* This mask kills spill from negative subwords to the next subword. */
- correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
-
- n_coeffs = s->inter_scantable.raster_end[s->block_last_index[n]];
-
- for(i = 0; i <= n_coeffs; block += 4, i += 4) {
- uint64_t levels, negmask, zeros, add;
-
- levels = ldq(block);
- if (levels == 0)
- continue;
-
-#ifdef __alpha_max__
- /* I don't think the speed difference justifies runtime
- detection. */
- negmask = maxsw4(levels, -1); /* negative -> ffff (-1) */
- negmask = minsw4(negmask, 0); /* positive -> 0000 (0) */
-#else
- negmask = cmpbge(WORD_VEC(0x7fff), levels);
- negmask &= (negmask >> 1) | (1 << 7);
- negmask = zap(-1, negmask);
-#endif