40 int16_t *
block,
int n,
int qscale)
42 int i,
level, qmul, qadd;
45 qadd = (qscale - 1) | 1;
65 register const vector
signed short vczero = (
const vector
signed short)vec_splat_s16(0);
68 register vector
signed short blockv, qmulv, qaddv, nqaddv, temp1;
69 register vector
bool short blockv_null, blockv_neg;
70 register short backup_0 = block[0];
73 qmulv = vec_splat((
vec_s16)vec_lde(0, &qmul8), 0);
74 qaddv = vec_splat((
vec_s16)vec_lde(0, &qadd8), 0);
75 nqaddv = vec_sub(vczero, qaddv);
79 for(; (j + 7) <= nCoeffs ; j+=8) {
80 blockv = vec_ld(j << 1, block);
81 blockv_neg = vec_cmplt(blockv, vczero);
82 blockv_null = vec_cmpeq(blockv, vczero);
84 temp1 = vec_sel(qaddv, nqaddv, blockv_neg);
86 temp1 = vec_mladd(blockv, qmulv, temp1);
88 blockv = vec_sel(temp1, blockv, blockv_null);
89 vec_st(blockv, j << 1, block);
96 for(; j <= nCoeffs ; j++) {
100 level = level * qmul - qadd;
102 level = level * qmul + qadd;