Commit 54e19774 authored by Tristan Matthews's avatar Tristan Matthews Committed by Tristan Matthews
Browse files

pvq: skip gshift calculation in float pvq case

Cherry-picked from daala commit 28de40bfcd84e7df3fbd64de7b89dd7fd889bb27

Change-Id: I31af05f07514c023c5be84f7e2ae353ab7d276f0
parent e2a703e3
......@@ -951,17 +951,21 @@ void od_pvq_synthesis_partial(od_coeff *xcoeff, const od_coeff *ypulse,
int yy;
od_val32 scale;
int nn;
#if !defined(OD_FLOAT_PVQ)
int gshift;
int qshift;
#endif
OD_ASSERT(g != 0);
nn = n-(!noref); /* when noref==0, vector in is sized n-1 */
yy = 0;
for (i = 0; i < nn; i++)
yy += ypulse[i]*(int32_t)ypulse[i];
#if !defined(OD_FLOAT_PVQ)
/* Shift required for the magnitude of the pre-qm synthesis to be guaranteed
to fit in 16 bits. In practice, the range will be 8192-16384 after scaling
most of the time. */
gshift = OD_MAXI(0, OD_ILOG(g) - 14);
#endif
/*scale is g/sqrt(yy) in Q(16-gshift) so that x[]*scale has a norm that fits
in 16 bits.*/
if (yy == 0) scale = 0;
......@@ -969,8 +973,6 @@ void od_pvq_synthesis_partial(od_coeff *xcoeff, const od_coeff *ypulse,
else {
scale = g/sqrt(yy);
}
OD_UNUSED(gshift);
OD_UNUSED(qshift);
#else
else {
int rsqrt_shift;
......
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