Make get_coef_context() branchless.
authorRonald S. Bultje <rbultje@google.com>
Mon, 1 Jul 2013 17:40:00 +0000 (10:40 -0700)
committerRonald S. Bultje <rbultje@google.com>
Mon, 1 Jul 2013 23:34:10 +0000 (16:34 -0700)
commit26b6318de83761dd268a589f0b1324153e9d0923
tree607898c1ad9e5e07b54ffea00ad52fed10c7330c
parentc8defcfdeea614a780af9a2405f59c60cab876ad
Make get_coef_context() branchless.

This should significantly speedup cost_coeffs(). Basically what the
patch does is to make the neighbour arrays padded by one item to
prevent an eob check in get_coef_context(), then it populates each
col/row scan and left/top edge coefficient with two times the same
neighbour - this prevents a single/double context branch in
get_coef_context(). Lastly, it populates neighbour arrays in pixel
order (rather than scan order), so we don't have to dereference the
scantable to get the correct neighbours.

Total encoding time of first 50 frames of bus (speed 0) at 1500kbps
goes from 2min10.1 to 2min5.3, i.e. a 2.6% overall speed increase.

Change-Id: I42bcd2210fd7bec03767ef0e2945a665b851df56
vp9/common/vp9_entropy.c
vp9/common/vp9_entropy.h
vp9/decoder/vp9_detokenize.c
vp9/encoder/vp9_encodemb.c
vp9/encoder/vp9_rdopt.c
vp9/encoder/vp9_tokenize.c