Commit ca18a478 authored by David Conrad's avatar David Conrad

VP8: Inline traversing vp8_small_mvtree

Much faster read_mv_component, slightly faster overall

Originally committed as revision 24470 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 7697cdcf
...@@ -599,7 +599,7 @@ void find_near_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, ...@@ -599,7 +599,7 @@ void find_near_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
*/ */
static int read_mv_component(VP56RangeCoder *c, const uint8_t *p) static int read_mv_component(VP56RangeCoder *c, const uint8_t *p)
{ {
int x = 0; int bit, x = 0;
if (vp56_rac_get_prob_branchy(c, p[0])) { if (vp56_rac_get_prob_branchy(c, p[0])) {
int i; int i;
...@@ -610,8 +610,17 @@ static int read_mv_component(VP56RangeCoder *c, const uint8_t *p) ...@@ -610,8 +610,17 @@ static int read_mv_component(VP56RangeCoder *c, const uint8_t *p)
x += vp56_rac_get_prob(c, p[9 + i]) << i; x += vp56_rac_get_prob(c, p[9 + i]) << i;
if (!(x & 0xFFF0) || vp56_rac_get_prob(c, p[12])) if (!(x & 0xFFF0) || vp56_rac_get_prob(c, p[12]))
x += 8; x += 8;
} else } else {
x = vp8_rac_get_tree(c, vp8_small_mvtree, &p[2]); // small_mvtree
const uint8_t *ps = p+2;
bit = vp56_rac_get_prob(c, *ps);
ps += 1 + 3*bit;
x += 4*bit;
bit = vp56_rac_get_prob(c, *ps);
ps += 1 + bit;
x += 2*bit;
x += vp56_rac_get_prob(c, *ps);
}
return (x && vp56_rac_get_prob(c, p[1])) ? -x : x; return (x && vp56_rac_get_prob(c, p[1])) ? -x : x;
} }
......
...@@ -110,16 +110,6 @@ static const int8_t vp8_pred16x16_tree_mvinter[4][2] = { ...@@ -110,16 +110,6 @@ static const int8_t vp8_pred16x16_tree_mvinter[4][2] = {
{ -VP8_MVMODE_NEW, -VP8_MVMODE_SPLIT } // '1110', '1111' { -VP8_MVMODE_NEW, -VP8_MVMODE_SPLIT } // '1110', '1111'
}; };
static const int8_t vp8_small_mvtree[7][2] = {
{ 1, 4 },
{ 2, 3 },
{ -0, -1 }, // '000', '001'
{ -2, -3 }, // '010', '011'
{ 5, 6 },
{ -4, -5 }, // '100', '101'
{ -6, -7 } // '110', '111'
};
static const uint8_t vp8_mbsplits[5][16] = { static const uint8_t vp8_mbsplits[5][16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1 }, 1, 1, 1, 1, 1, 1, 1, 1 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment