diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-04-10 13:18:38 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-04-10 13:18:38 +0000 |
commit | 7bc9090a4176de2bc834e2a7df131047b944f3b5 (patch) | |
tree | 1d57ac078ac227d652202cc1077ac565b8e36122 /libavcodec/wmv2.c | |
parent | 84876d36774b6633c2950291fbfb3db5922273fb (diff) | |
download | ffmpeg-7bc9090a4176de2bc834e2a7df131047b944f3b5.tar.gz |
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
more direct use of the new mb_type stuff instead of codec specific stuff
runtime mb_type debug output h264/h263 variants/mpeg1/2/4
error concealment /resilience for mpeg1/2
various minor optimizations
Originally committed as revision 1746 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/wmv2.c')
-rw-r--r-- | libavcodec/wmv2.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index 2c15694212..1097b7c29c 100644 --- a/libavcodec/wmv2.c +++ b/libavcodec/wmv2.c @@ -267,20 +267,21 @@ void ff_wmv2_encode_mb(MpegEncContext * s, static void parse_mb_skip(Wmv2Context * w){ int mb_x, mb_y; MpegEncContext * const s= &w->s; + uint32_t * const mb_type= s->current_picture_ptr->mb_type; w->skip_type= get_bits(&s->gb, 2); switch(w->skip_type){ case SKIP_TYPE_NONE: for(mb_y=0; mb_y<s->mb_height; mb_y++){ for(mb_x=0; mb_x<s->mb_width; mb_x++){ - s->mb_type[mb_y*s->mb_width + mb_x]= 0; + mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_16x16 | MB_TYPE_L0; } } break; case SKIP_TYPE_MPEG: for(mb_y=0; mb_y<s->mb_height; mb_y++){ for(mb_x=0; mb_x<s->mb_width; mb_x++){ - s->mb_type[mb_y*s->mb_width + mb_x]= get_bits1(&s->gb) ? MB_TYPE_SKIPED : 0; + mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0; } } break; @@ -288,11 +289,11 @@ static void parse_mb_skip(Wmv2Context * w){ for(mb_y=0; mb_y<s->mb_height; mb_y++){ if(get_bits1(&s->gb)){ for(mb_x=0; mb_x<s->mb_width; mb_x++){ - s->mb_type[mb_y*s->mb_width + mb_x]= MB_TYPE_SKIPED; + mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; } }else{ for(mb_x=0; mb_x<s->mb_width; mb_x++){ - s->mb_type[mb_y*s->mb_width + mb_x]= get_bits1(&s->gb) ? MB_TYPE_SKIPED : 0; + mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0; } } } @@ -301,11 +302,11 @@ static void parse_mb_skip(Wmv2Context * w){ for(mb_x=0; mb_x<s->mb_width; mb_x++){ if(get_bits1(&s->gb)){ for(mb_y=0; mb_y<s->mb_height; mb_y++){ - s->mb_type[mb_y*s->mb_width + mb_x]= MB_TYPE_SKIPED; + mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; } }else{ for(mb_y=0; mb_y<s->mb_height; mb_y++){ - s->mb_type[mb_y*s->mb_width + mb_x]= get_bits1(&s->gb) ? MB_TYPE_SKIPED : 0; + mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0; } } } @@ -455,12 +456,6 @@ return -1; s->esc3_level_length= 0; s->esc3_run_length= 0; - if(s->avctx->debug&FF_DEBUG_SKIP){ - for(i=0; i<s->mb_num; i++){ - if(i%s->mb_width==0) printf("\n"); - printf("%d", s->mb_type[i]); - } - } s->picture_number++; //FIXME ? @@ -712,7 +707,7 @@ static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) if(w->j_type) return 0; if (s->pict_type == P_TYPE) { - if(s->mb_type[s->mb_y * s->mb_width + s->mb_x]&MB_TYPE_SKIPED){ + if(IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])){ /* skip mb */ s->mb_intra = 0; for(i=0;i<6;i++) |