Originally committed as revision 3648 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 20 years ago
parent 9740687b6b
commit 1499a1f7df
  1. 14
      libavcodec/h261.c

@ -596,7 +596,7 @@ static int decode_mv_component(GetBitContext *gb, int v){
static int h261_decode_mb(H261Context *h){ static int h261_decode_mb(H261Context *h){
MpegEncContext * const s = &h->s; MpegEncContext * const s = &h->s;
int i, cbp, xy, old_mtype; int i, cbp, xy;
cbp = 63; cbp = 63;
// Read mba // Read mba
@ -634,7 +634,6 @@ static int h261_decode_mb(H261Context *h){
s->dsp.clear_blocks(s->block[0]); s->dsp.clear_blocks(s->block[0]);
// Read mtype // Read mtype
old_mtype = h->mtype;
h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2); h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
h->mtype = h261_mtype_map[h->mtype]; h->mtype = h261_mtype_map[h->mtype];
@ -654,7 +653,7 @@ static int h261_decode_mb(H261Context *h){
// 2) evaluating MVD for macroblocks in which MBA does not represent a difference of 1; // 2) evaluating MVD for macroblocks in which MBA does not represent a difference of 1;
// 3) MTYPE of the previous macroblock was not MC. // 3) MTYPE of the previous macroblock was not MC.
if ( ( h->current_mba == 1 ) || ( h->current_mba == 12 ) || ( h->current_mba == 23 ) || if ( ( h->current_mba == 1 ) || ( h->current_mba == 12 ) || ( h->current_mba == 23 ) ||
( h->mba_diff != 1) || ( !IS_16X16 ( old_mtype ) )) ( h->mba_diff != 1))
{ {
h->current_mv_x = 0; h->current_mv_x = 0;
h->current_mv_y = 0; h->current_mv_y = 0;
@ -662,6 +661,9 @@ static int h261_decode_mb(H261Context *h){
h->current_mv_x= decode_mv_component(&s->gb, h->current_mv_x); h->current_mv_x= decode_mv_component(&s->gb, h->current_mv_x);
h->current_mv_y= decode_mv_component(&s->gb, h->current_mv_y); h->current_mv_y= decode_mv_component(&s->gb, h->current_mv_y);
}else{
h->current_mv_x = 0;
h->current_mv_y = 0;
} }
// Read cbp // Read cbp
@ -678,14 +680,8 @@ static int h261_decode_mb(H261Context *h){
s->mv_dir = MV_DIR_FORWARD; s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16; s->mv_type = MV_TYPE_16X16;
s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0; s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
if(IS_16X16 ( h->mtype )){
s->mv[0][0][0] = h->current_mv_x * 2;//gets divided by 2 in motion compensation s->mv[0][0][0] = h->current_mv_x * 2;//gets divided by 2 in motion compensation
s->mv[0][0][1] = h->current_mv_y * 2; s->mv[0][0][1] = h->current_mv_y * 2;
}
else{
h->current_mv_x = s->mv[0][0][0] = 0;
h->current_mv_x = s->mv[0][0][1] = 0;
}
intra: intra:
/* decode each block */ /* decode each block */

Loading…
Cancel
Save