Mercurial > libavcodec.hg
comparison mpeg12.c @ 2624:fe4ed09b0f0d libavcodec
avoid clearing block[] if its not used at all
author | michael |
---|---|
date | Thu, 21 Apr 2005 21:23:22 +0000 |
parents | 943c38487346 |
children | 511e3afc43e1 |
comparison
equal
deleted
inserted
replaced
2623:aaf8e94bce00 | 2624:fe4ed09b0f0d |
---|---|
1138 break; | 1138 break; |
1139 } | 1139 } |
1140 dprintf("mb_type=%x\n", mb_type); | 1140 dprintf("mb_type=%x\n", mb_type); |
1141 // motion_type = 0; /* avoid warning */ | 1141 // motion_type = 0; /* avoid warning */ |
1142 if (IS_INTRA(mb_type)) { | 1142 if (IS_INTRA(mb_type)) { |
1143 s->dsp.clear_blocks(s->block[0]); | |
1144 | |
1145 if(!s->chroma_y_shift){ | |
1146 s->dsp.clear_blocks(s->block[6]); | |
1147 } | |
1148 | |
1143 /* compute dct type */ | 1149 /* compute dct type */ |
1144 if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var? | 1150 if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var? |
1145 !s->frame_pred_frame_dct) { | 1151 !s->frame_pred_frame_dct) { |
1146 s->interlaced_dct = get_bits1(&s->gb); | 1152 s->interlaced_dct = get_bits1(&s->gb); |
1147 } | 1153 } |
1355 } | 1361 } |
1356 } | 1362 } |
1357 } | 1363 } |
1358 | 1364 |
1359 s->mb_intra = 0; | 1365 s->mb_intra = 0; |
1360 | |
1361 if (HAS_CBP(mb_type)) { | 1366 if (HAS_CBP(mb_type)) { |
1367 s->dsp.clear_blocks(s->block[0]); | |
1368 | |
1369 if(!s->chroma_y_shift){ | |
1370 s->dsp.clear_blocks(s->block[6]); | |
1371 } | |
1372 | |
1362 cbp = get_vlc2(&s->gb, mb_pat_vlc.table, MB_PAT_VLC_BITS, 1); | 1373 cbp = get_vlc2(&s->gb, mb_pat_vlc.table, MB_PAT_VLC_BITS, 1); |
1363 if (cbp < 0 || ((cbp == 0) && (s->chroma_format < 2)) ){ | 1374 if (cbp < 0 || ((cbp == 0) && (s->chroma_format < 2)) ){ |
1364 av_log(s->avctx, AV_LOG_ERROR, "invalid cbp at %d %d\n", s->mb_x, s->mb_y); | 1375 av_log(s->avctx, AV_LOG_ERROR, "invalid cbp at %d %d\n", s->mb_x, s->mb_y); |
1365 return -1; | 1376 return -1; |
1366 } | 1377 } |
2576 //one 1 we memcpy blocks in xvmcvideo | 2587 //one 1 we memcpy blocks in xvmcvideo |
2577 if(s->avctx->xvmc_acceleration > 1) | 2588 if(s->avctx->xvmc_acceleration > 1) |
2578 XVMC_init_block(s);//set s->block | 2589 XVMC_init_block(s);//set s->block |
2579 #endif | 2590 #endif |
2580 | 2591 |
2581 s->dsp.clear_blocks(s->block[0]); | |
2582 if(!s->chroma_y_shift){ | |
2583 s->dsp.clear_blocks(s->block[6]); | |
2584 } | |
2585 ret = mpeg_decode_mb(s, s->block); | 2592 ret = mpeg_decode_mb(s, s->block); |
2586 s->chroma_qscale= s->qscale; | 2593 s->chroma_qscale= s->qscale; |
2587 | 2594 |
2588 dprintf("ret=%d\n", ret); | 2595 dprintf("ret=%d\n", ret); |
2589 if (ret < 0) | 2596 if (ret < 0) |