Commit ead552a9 authored by Yushin Cho's avatar Yushin Cho
Browse files

Fix ASAN warnings with PVQ

Change-Id: I4d6912f3a0df0bdb3f435cc8057b63fbaa3aaa6d
parent b05eeaef
......@@ -591,7 +591,7 @@ static int32_t od_pow(int32_t x, od_val16 beta)
/*log2(g/OD_COMPAND_SCALE) = log2(x) - OD_COMPAND_SHIFT in
Q(OD_LOG2_OUTSHIFT).*/
logr = od_log2(t) + (log2_x - OD_COMPAND_SHIFT)*OD_LOG2_OUTSCALE;
logr = OD_MULT16_32_QBETA(beta, logr);
logr = (od_val32)OD_MULT16_32_QBETA(beta, logr);
return od_exp2(logr);
}
#endif
......@@ -974,7 +974,7 @@ void od_pvq_synthesis_partial(od_coeff *xcoeff, const od_coeff *ypulse,
od_val32 x;
/* This multiply doesn't round, so it introduces some bias.
It would be nice (but not critical) to fix this. */
x = OD_MULT16_32_Q16(ypulse[i], scale);
x = (od_val32)OD_MULT16_32_Q16(ypulse[i], scale);
#if defined(OD_FLOAT_PVQ)
xcoeff[i] = (od_coeff)floor(.5
+ x*(qm_inv[i]*OD_QM_INV_SCALE_1));
......
......@@ -1491,11 +1491,12 @@ static int64_t av1_block_error2_c(const tran_low_t *coeff,
const tran_low_t *ref, intptr_t block_size,
int64_t *ssz) {
int64_t error;
int64_t ssz_trash;
// Use the existing sse codes for calculating distortion of decoded signal:
// i.e. (orig - decoded)^2
error = av1_block_error_fp(coeff, dqcoeff, block_size);
error = av1_block_error(coeff, dqcoeff, block_size, &ssz_trash);
// prediction residue^2 = (orig - ref)^2
*ssz = av1_block_error_fp(coeff, ref, block_size);
*ssz = av1_block_error(coeff, ref, block_size, &ssz_trash);
return error;
}
#endif // CONFIG_HIGHBITDEPTH
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment