diff options
author | Jason Garrett-Glaser <darkshikari@gmail.com> | 2010-08-03 10:37:14 +0000 |
---|---|---|
committer | Jason Garrett-Glaser <darkshikari@gmail.com> | 2010-08-03 10:37:14 +0000 |
commit | c5dec7f137280c7cdf770027e87630b9dcf6bd4e (patch) | |
tree | f5bb3bf3e9b1ed8eac8560980631ac455ad56272 /libavcodec/vp8.c | |
parent | 23117d69c19e3ce844f7fee805fc2f230322d92d (diff) | |
download | ffmpeg-c5dec7f137280c7cdf770027e87630b9dcf6bd4e.tar.gz |
VP8: unroll splitmv decoding tree
Much faster splitmv mode decoding.
Originally committed as revision 24680 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r-- | libavcodec/vp8.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index af18b0d241..d21ed5eb72 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -673,20 +673,19 @@ int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb) submv_prob = get_submv_prob(left, above); - switch (vp8_rac_get_tree(c, vp8_submv_ref_tree, submv_prob)) { - case VP8_SUBMVMODE_NEW4X4: - mb->bmv[n].y = mb->mv.y + read_mv_component(c, s->prob->mvc[0]); - mb->bmv[n].x = mb->mv.x + read_mv_component(c, s->prob->mvc[1]); - break; - case VP8_SUBMVMODE_ZERO4X4: - AV_ZERO32(&mb->bmv[n]); - break; - case VP8_SUBMVMODE_LEFT4X4: + if (vp56_rac_get_prob_branchy(c, submv_prob[0])) { + if (vp56_rac_get_prob_branchy(c, submv_prob[1])) { + if (vp56_rac_get_prob_branchy(c, submv_prob[2])) { + mb->bmv[n].y = mb->mv.y + read_mv_component(c, s->prob->mvc[0]); + mb->bmv[n].x = mb->mv.x + read_mv_component(c, s->prob->mvc[1]); + } else { + AV_ZERO32(&mb->bmv[n]); + } + } else { + AV_WN32A(&mb->bmv[n], above); + } + } else { AV_WN32A(&mb->bmv[n], left); - break; - case VP8_SUBMVMODE_TOP4X4: - AV_WN32A(&mb->bmv[n], above); - break; } } |