Preload reference area to an intermediate buffer in sub-pixel motion search
authorYunqing Wang <yunqingwang@google.com>
Tue, 28 Jun 2011 13:14:13 +0000 (09:14 -0400)
committerYunqing Wang <yunqingwang@google.com>
Fri, 22 Jul 2011 13:28:06 +0000 (09:28 -0400)
commit20bd1446c0c3ee82c6be9102ed911477639908c5
tree93b6abf071dc9766c5d3e0d38fc232b7103a5f4e
parentb5ea2fbc2c1554769848774c836aad262af95072
Preload reference area to an intermediate buffer in sub-pixel motion search

In sub-pixel motion search, the search range is small(+/- 3 pixels).
Preload whole search area from reference buffer into a 32-byte
aligned buffer. Then in search, load reference data from this buffer
instead. This keeps data in cache, and reduces the crossing cache-
line penalty. For tulip clip, tests on Intel Core2 Quad machine(linux)
showed encoder speed improvement:
  3.4%   at --rt --cpu-used =-4
  2.8%   at --rt --cpu-used =-3
  2.3%   at --rt --cpu-used =-2
  2.2%   at --rt --cpu-used =-1

Test on Atom notebook showed only 1.1% speed improvement(speed=-4).
Test on Xeon machine also showed less improvement, since unaligned
data access latency is greatly reduced in newer cores.

Next, I will apply similar idea to other 2 sub-pixel search functions
for encoding speed > 4.

Make this change exclusively for x86 platforms.

Change-Id: Ia7bb9f56169eac0f01009fe2b2f2ab5b61d2eb2f
vp8/common/blockd.h
vp8/encoder/generic/csystemdependent.c
vp8/encoder/mcomp.c
vp8/encoder/onyx_if.c
vp8/encoder/sad_c.c
vp8/encoder/variance.h
vp8/encoder/x86/sad_sse2.asm
vp8/encoder/x86/sad_sse3.asm
vp8/encoder/x86/variance_x86.h
vp8/encoder/x86/x86_csystemdependent.c