vp9_firstpass: Get rid of magic number in bits per MB calculation

Change-Id: Ib3886cb7cafc211581f4f9e7f76782d9d1984434
Replace imprecise 32 bits calculations by 64 bits calculations

Change-Id: If1b0a2d6603ce24f5dd99855e8dfe459e7a2835a
vp9_ratectrl: change ARF overlays rate correction factor

ARF overlays now use the same rate correction factor as regular inter
frames, further testing would be needed to see if it makes sense to use
a completely separate rate correction factor for ARF overlays.

$ vpxenc --cpu-used=5  --fps=50/1 --target-bitrate=2000
         parkjoy.y4m -o out.webm
=> Before: 3356 kb/s
=> After: 2271 kb/s

Change-Id: I73e4defa615ba7a8a2bdb845864f4b1721cbbffe
Moving init_rate_control() to vp9_ratectrl.{c, h}.

Change-Id: Iab3effc39064f265426c82b455ef38d37dcce5a8
Cleaning up encode_frame_internal().

Change-Id: I9c5f7edc2d5d1ec5aee396b87bdfc99ee21c435a
Converting set_prev_mi() to get_prev_mi().

Change-Id: Iad4002d7aecaae0e25d88e286bacde7e6cd7264f
Cleaning up vp9_diamond_search_sad_c() function.

Change-Id: I0816ec12ec0a6f21d0f25f10c214b5fd327afc6c
Moving compute_qdelta functions into vp9_ratectrl.{h, c}.

Change-Id: I512f2a287dd8765879a2d1144e2f028dc65f71ff
Merge "Moving compute_qdelta functions into vp9_ratectrl.{h, c}."
Merge "vp9_firstpass: Get rid of magic number in bits per MB calculation"
Merge "Replace imprecise 32 bits calculations by 64 bits calculations"
Merge "vp9_ratectrl: change ARF overlays rate correction factor"
Renaming VP9D_COMP & VP9Decompressor to VP9Decoder.

Change-Id: Ieb9b455b8aaef9884391021b7f640ef24c554687
Cleaning up vp9_ratectrl.c file.

Change-Id: If8044d9c71afe02ed1e6c94487344e143bdfcd74
Merge "Moving init_rate_control() to vp9_ratectrl.{c, h}."
Merge "Cleaning up vp9_diamond_search_sad_c() function."
Merge "Cleaning up vp9_ratectrl.c file."
Fix decoder resolution change with tiles

There was a bug with the decoder that if you started the decoder
with more threads than the first frame had tile columns. Afterwards
tried to decode a frame with more tile columns than the first frame,
the decoder would hang. E.g. run vpxdec --threads=4. The first frame
had two tile columns, then the next key frame had 4 tile columns, the
decoder would hang. If you started with 4 tiles and switched to 2
tiles the decoder would be fine. The issue is that the worker the thread
loop is using is stale.

I added a test vector "vp90-2-14-resize-848x480-1280x720.webm" that
exhibited the bug.

Change-Id: I7bdd47241a52ac0fe1c693a609bc779257e94229
Cleaning up vp9_firstpass.c

Change-Id: Ie5723690f7c0bfa29a7ccef5da0c6c6326600ee6
Adding vp9_ssim.h file.

Change-Id: Ib3b3864a6018c62ac1ea18e30795af74464596cd