Mercurial > libavcodec.hg
diff h263dec.c @ 411:5c8b3a717929 libavcodec
workaround dc_scale bug in old ffmpeg msmpeg4v3 encoder (set workaround_bugs=1 for this)
author | michaelni |
---|---|
date | Tue, 21 May 2002 23:13:57 +0000 |
parents | fce0a2520551 |
children | 718a22dc121f |
line wrap: on
line diff
--- a/h263dec.c Tue May 21 23:07:26 2002 +0000 +++ b/h263dec.c Tue May 21 23:13:57 2002 +0000 @@ -43,6 +43,7 @@ s->width = avctx->width; s->height = avctx->height; + s->workaround_bugs= avctx->workaround_bugs; /* select sub codec */ switch(avctx->codec->id) { @@ -211,7 +212,11 @@ //fprintf(stderr,"\nFrame: %d\tMB: %d",avctx->frame_number, (s->mb_y * s->mb_width) + s->mb_x); /* DCT & quantize */ if (s->h263_pred && s->msmpeg4_version!=2) { - h263_dc_scale(s); + /* old ffmpeg encoded msmpeg4v3 workaround */ + if(s->workaround_bugs==1 && s->msmpeg4_version==3) + ff_old_msmpeg4_dc_scale(s); + else + h263_dc_scale(s); } else { /* default quantization values */ s->y_dc_scale = 8; @@ -277,9 +282,9 @@ s->has_b_frames=1; for(mb_y=0; mb_y<s->mb_height; mb_y++){ int mb_x; - int y= mb_y*16; + int y= mb_y*16 + 8; for(mb_x=0; mb_x<s->mb_width; mb_x++){ - int x= mb_x*16; + int x= mb_x*16 + 8; uint8_t *ptr= s->last_picture[0]; int xy= 1 + mb_x*2 + (mb_y*2 + 1)*(s->mb_width*2 + 2); int mx= (s->motion_val[xy][0]>>1) + x; @@ -299,6 +304,7 @@ int y1= y + (my-y)*i/max; ptr[y1*s->linesize + x1]+=100; } + ptr[y*s->linesize + x]+=100; s->mbskip_table[mb_x + mb_y*s->mb_width]=0; } }