pvq: skip gshift calculation in float pvq case
Cherry-picked from daala commit 28de40bfcd84e7df3fbd64de7b89dd7fd889bb27
Change-Id: I31af05f07514c023c5be84f7e2ae353ab7d276f0
diff --git a/av1/common/pvq.c b/av1/common/pvq.c
index 28de41a..327d8ed 100644
--- a/av1/common/pvq.c
+++ b/av1/common/pvq.c
@@ -951,17 +951,21 @@
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 @@
else {
scale = g/sqrt(yy);
}
- OD_UNUSED(gshift);
- OD_UNUSED(qshift);
#else
else {
int rsqrt_shift;