diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-04-21 21:23:22 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-04-21 21:23:22 +0000 |
commit | 2de4ba7ff799b6f89dbbc03819e1b96abb70cb34 (patch) | |
tree | 6e3908c56a63828dbc1ab63bb1442e466c2b2780 /libavcodec/mpeg12.c | |
parent | e2e5894a91b9a14d13d57a5be5544143de4406f7 (diff) | |
download | ffmpeg-2de4ba7ff799b6f89dbbc03819e1b96abb70cb34.tar.gz |
avoid clearing block[] if its not used at all
Originally committed as revision 4148 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r-- | libavcodec/mpeg12.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index fe0ccd1b42..fd75381718 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1140,6 +1140,12 @@ static int mpeg_decode_mb(MpegEncContext *s, dprintf("mb_type=%x\n", mb_type); // motion_type = 0; /* avoid warning */ if (IS_INTRA(mb_type)) { + s->dsp.clear_blocks(s->block[0]); + + if(!s->chroma_y_shift){ + s->dsp.clear_blocks(s->block[6]); + } + /* compute dct type */ if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var? !s->frame_pred_frame_dct) { @@ -1357,8 +1363,13 @@ static int mpeg_decode_mb(MpegEncContext *s, } s->mb_intra = 0; - if (HAS_CBP(mb_type)) { + s->dsp.clear_blocks(s->block[0]); + + if(!s->chroma_y_shift){ + s->dsp.clear_blocks(s->block[6]); + } + cbp = get_vlc2(&s->gb, mb_pat_vlc.table, MB_PAT_VLC_BITS, 1); if (cbp < 0 || ((cbp == 0) && (s->chroma_format < 2)) ){ av_log(s->avctx, AV_LOG_ERROR, "invalid cbp at %d %d\n", s->mb_x, s->mb_y); @@ -2578,10 +2589,6 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, XVMC_init_block(s);//set s->block #endif - s->dsp.clear_blocks(s->block[0]); - if(!s->chroma_y_shift){ - s->dsp.clear_blocks(s->block[6]); - } ret = mpeg_decode_mb(s, s->block); s->chroma_qscale= s->qscale; |