]> git.videolan.org Git - x264.git/commit
CABAC trellis opts part 2: C optimizations
authorLoren Merritt <pengvado@akuvian.org>
Thu, 22 Dec 2011 17:56:06 +0000 (17:56 +0000)
committerJason Garrett-Glaser <jason@x264.com>
Sun, 15 Jan 2012 22:27:32 +0000 (14:27 -0800)
commit65bd12ae875a768a06b67ec6297dec18323e0768
tree246b72026c7401e6c93edc55628a99d4f57b7d28
parente176619d010fc32c970c7ab7a769bbfbe2665f61
CABAC trellis opts part 2: C optimizations

Hoist the branch on coef value out of the loop over node contexts.
Special cases for each possible coef value (0,1,n).
Special case for dc-only blocks.
Template the main loop for two common subsets of nodes, to avoid a bunch of branches about which nodes are live.
Use the nonupdating version of cabac_size_decision in more cases, and omit those bins from the node struct.
CABAC offsets are now compile-time constants.
Change TRELLIS_SCORE_MAX from a specific constant to anything negative, which is cheaper to test.
Remove dct_weight2_zigzag[], since trellis has to lookup zigzag[] anyway.

60% faster on x86_64.
25k->18k codesize.
common/dct.c
common/dct.h
encoder/encoder.c
encoder/rdo.c