Commit 6f21b3b8 authored by michael's avatar michael

avoid clearing block[] if its not used at all


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4148 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9260905f
...@@ -1140,6 +1140,12 @@ static int mpeg_decode_mb(MpegEncContext *s, ...@@ -1140,6 +1140,12 @@ static int mpeg_decode_mb(MpegEncContext *s,
dprintf("mb_type=%x\n", mb_type); dprintf("mb_type=%x\n", mb_type);
// motion_type = 0; /* avoid warning */ // motion_type = 0; /* avoid warning */
if (IS_INTRA(mb_type)) { 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 */ /* compute dct type */
if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var? if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var?
!s->frame_pred_frame_dct) { !s->frame_pred_frame_dct) {
...@@ -1357,8 +1363,13 @@ static int mpeg_decode_mb(MpegEncContext *s, ...@@ -1357,8 +1363,13 @@ static int mpeg_decode_mb(MpegEncContext *s,
} }
s->mb_intra = 0; s->mb_intra = 0;
if (HAS_CBP(mb_type)) { 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); cbp = get_vlc2(&s->gb, mb_pat_vlc.table, MB_PAT_VLC_BITS, 1);
if (cbp < 0 || ((cbp == 0) && (s->chroma_format < 2)) ){ 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); 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, ...@@ -2578,10 +2589,6 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
XVMC_init_block(s);//set s->block XVMC_init_block(s);//set s->block
#endif #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); ret = mpeg_decode_mb(s, s->block);
s->chroma_qscale= s->qscale; s->chroma_qscale= s->qscale;
......
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