This commit allows the encoder to check the eob per transform
block to decide how to compute the SATD rate cost. If the entire
block is quantized to zero, there is no need to add anything; if
only the DC coefficient is non-zero, add its absolute value;
otherwise, sum over the block. This reduces the CPU cycles spent
on vp9_satd_sse2 to one third.
Change-Id: I0d56044b793b286efc0875fafc0b8bf2d2047e32
}
*dist += vp9_block_error(coeff, dqcoeff, step << 4, &this_sse) >> shift;
- *rate += (int)vp9_satd((const int16_t *)qcoeff, step << 4);
+
+ if (*eob == 1)
+ *rate += (int)abs(qcoeff[0]);
+ else if (*eob > 1)
+ *rate += (int)vp9_satd((const int16_t *)qcoeff, step << 4);
*sse += (this_sse >> shift);
*skippable &= (*eob == 0);