Changes to exhaustive motion search.
authorpaulwilkins <paulwilkins@google.com>
Tue, 8 Dec 2015 15:48:24 +0000 (15:48 +0000)
committerpaulwilkins <paulwilkins@google.com>
Tue, 8 Dec 2015 16:54:42 +0000 (16:54 +0000)
commit4e692bbee29d1566e43ed4499249651d4c01f9c4
tree026c07c829b65d4b499dc72723904f7bf12a7229
parent9d85ce8e0cc588629650690a5fa0ed559ed77d30
Changes to exhaustive motion search.

This change has been imported from VP9 and
alters the nature and use of exhaustive motion search.

Firstly any exhaustive search is preceded by a normal step search.
The exhaustive search is only carried out if the distortion resulting
from the step search is above a threshold value.

Secondly the simple +/- 64 exhaustive search is replaced by a
multi stage mesh based search where each stage has a range
and step/interval size. Subsequent stages use the best position from
the previous stage as the center of the search but use a reduced range
and interval size.

For example:
  stage 1: Range +/- 64 interval 4
  stage 2: Range +/- 32 interval 2
  stage 3: Range +/- 15 interval 1

This process, especially when it follows on from a normal step
search, has shown itself to be almost as effective as a full range
exhaustive search with step 1 but greatly lowers the computational
complexity such that it can be used in some cases for speeds 0-2.

This patch also removes a double exhaustive search for sub 8x8 blocks
which also contained  a bug (the two searches used different distortion
metrics).

For best quality in my test animation sequence this patch has almost
no impact on quality but improves encode speed by more than 5X.

Restricted use in good quality speeds 0-2 yields significant quality gains
on the animation test of 0.2 - 0.5 db with only a small impact on encode
speed. On most natural video clips, however, where the step search
is performing well, the quality gain and speed impact are small.

Change-Id: Iac24152ae239f42a246f39ee5f00fe62d193cb98
vp10/encoder/block.h
vp10/encoder/encodeframe.c
vp10/encoder/encoder.c
vp10/encoder/encoder.h
vp10/encoder/ethread.c
vp10/encoder/mcomp.c
vp10/encoder/rdopt.c
vp10/encoder/speed_features.c
vp10/encoder/speed_features.h
vp9/encoder/vp9_ratectrl.c