summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-09-03 00:17:11 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-09-03 00:17:11 +0000
commitfeaf1a739377f8b9ce65e9d3032f3d828d0c15ed (patch)
tree9e76e00db045c0c6a91caeddb5b10cae698fec5b /libavcodec/vp3.c
parente32e2d56d4abd7793dcc2b3116e4bee937e88f20 (diff)
theoradec: skip decoding of uncoded MV in 4MV code
Thusnelda, the new experimental Theora encoder is using this Theora feature that was previously not exploited. fixes issue579 Originally committed as revision 15166 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 6740f0c3e5..4e077c49a3 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -963,7 +963,7 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb)
*/
static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
{
- int i, j, k;
+ int i, j, k, l;
int coding_mode;
int motion_x[6];
int motion_y[6];
@@ -1047,6 +1047,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
* Y fragment, then average for the C fragment vectors */
motion_x[4] = motion_y[4] = 0;
for (k = 0; k < 4; k++) {
+ for (l = 0; l < s->coded_fragment_list_index; l++)
+ if (s->coded_fragment_list[l] == s->macroblock_fragments[6*current_macroblock + k])
+ break;
+ if (l < s->coded_fragment_list_index) {
if (coding_mode == 0) {
motion_x[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
motion_y[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
@@ -1056,6 +1060,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
}
last_motion_x = motion_x[k];
last_motion_y = motion_y[k];
+ } else {
+ motion_x[k] = 0;
+ motion_y[k] = 0;
+ }
motion_x[4] += motion_x[k];
motion_y[4] += motion_y[k];
}