Fix incorrect macroblock counts in twopass rate control
authorJames Berry <jamesberry@google.com>
Thu, 10 Mar 2011 16:13:44 +0000 (11:13 -0500)
committerJames Berry <jamesberry@google.com>
Thu, 10 Mar 2011 18:33:06 +0000 (13:33 -0500)
commitf3e9e2a0f8d277f3b3c59ded05c0de6fd00a7326
treef75c843b7630d0bcb5373e48a8206e8ac62e1d5a
parenta0306ea660b2a35d09645e6d3e98d786614a874d
Fix incorrect macroblock counts in twopass rate control

The previous calculation of macroblock count (w*h)/256
is not correct when the width/height are not multiples of
16. Use the precalculated macroblock count from
cpi->common instead. This manifested itself as a divide
by zero when the number of pixels was less than 256.
num_mbs updated in estimate_max_q, estimate_q,
 estimate_kf_group_q, and estimate_cq

Change-Id: I92ff98587864c801b1ee5485cfead964673a9973
vp8/encoder/firstpass.c