Add two-pass quantization
authorYunqing Wang <yunqingwang@google.com>
Wed, 19 Jun 2013 00:09:50 +0000 (17:09 -0700)
committerYunqing Wang <yunqingwang@google.com>
Wed, 19 Jun 2013 17:35:02 +0000 (10:35 -0700)
commitb5bf7b13a83fc6fccafec1611410910eb78155a9
tree60c4e18486cc559ff67457e314c6e6a534e96dd1
parent2319b7aaf17b7efe143862bf0569fe8c9efd9d1f
Add two-pass quantization

Optimized the quantization function by making it a two-pass
process. The first pass does a quick checking of the transform
coefficients against the base ZBIN, and only keep the good
enough set of coefficients for quantization. A skipping
check is added. If all coefficients are within the base ZBIN, no
quantization is needed. The second pass is the actual quantization
pass, which only processes the coefficient subset determined
in first pass. This reduces the computation. Furthermore, an
alternitive method is used for large transform size, which often
has sparse nonzero quantized coefficients.

Overall, the encoder speedup is about 4%. The quantization function
itself gets 20% faster.

Change-Id: I3a9dd0da6db030260b6d9c314a9fa48ecae89f22
vp9/encoder/vp9_quantize.c