Revision 7bc9090a libavcodec/wmv2.c

View differences:

libavcodec/wmv2.c
267 267
static void parse_mb_skip(Wmv2Context * w){
268 268
    int mb_x, mb_y;
269 269
    MpegEncContext * const s= &w->s;
270
    uint32_t * const mb_type= s->current_picture_ptr->mb_type;
270 271

  
271 272
    w->skip_type= get_bits(&s->gb, 2);
272 273
    switch(w->skip_type){
273 274
    case SKIP_TYPE_NONE:
274 275
        for(mb_y=0; mb_y<s->mb_height; mb_y++){
275 276
            for(mb_x=0; mb_x<s->mb_width; mb_x++){
276
                s->mb_type[mb_y*s->mb_width + mb_x]= 0;
277
                mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_16x16 | MB_TYPE_L0;
277 278
            }
278 279
        }
279 280
        break;
280 281
    case SKIP_TYPE_MPEG:
281 282
        for(mb_y=0; mb_y<s->mb_height; mb_y++){
282 283
            for(mb_x=0; mb_x<s->mb_width; mb_x++){
283
                s->mb_type[mb_y*s->mb_width + mb_x]= get_bits1(&s->gb) ? MB_TYPE_SKIPED : 0;
284
                mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
284 285
            }
285 286
        }
286 287
        break;
......
288 289
        for(mb_y=0; mb_y<s->mb_height; mb_y++){
289 290
            if(get_bits1(&s->gb)){
290 291
                for(mb_x=0; mb_x<s->mb_width; mb_x++){
291
                    s->mb_type[mb_y*s->mb_width + mb_x]=  MB_TYPE_SKIPED;
292
                    mb_type[mb_y*s->mb_stride + mb_x]=  MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
292 293
                }
293 294
            }else{
294 295
                for(mb_x=0; mb_x<s->mb_width; mb_x++){
295
                    s->mb_type[mb_y*s->mb_width + mb_x]= get_bits1(&s->gb) ? MB_TYPE_SKIPED : 0;
296
                    mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
296 297
                }
297 298
            }
298 299
        }
......
301 302
        for(mb_x=0; mb_x<s->mb_width; mb_x++){
302 303
            if(get_bits1(&s->gb)){
303 304
                for(mb_y=0; mb_y<s->mb_height; mb_y++){
304
                    s->mb_type[mb_y*s->mb_width + mb_x]=  MB_TYPE_SKIPED;
305
                    mb_type[mb_y*s->mb_stride + mb_x]=  MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
305 306
                }
306 307
            }else{
307 308
                for(mb_y=0; mb_y<s->mb_height; mb_y++){
308
                    s->mb_type[mb_y*s->mb_width + mb_x]= get_bits1(&s->gb) ? MB_TYPE_SKIPED : 0;
309
                    mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
309 310
                }
310 311
            }
311 312
        }
......
455 456
    s->esc3_level_length= 0;
456 457
    s->esc3_run_length= 0;
457 458
    
458
    if(s->avctx->debug&FF_DEBUG_SKIP){
459
        for(i=0; i<s->mb_num; i++){
460
            if(i%s->mb_width==0) printf("\n");
461
            printf("%d", s->mb_type[i]);
462
        }
463
    }
464 459
s->picture_number++; //FIXME ?
465 460

  
466 461

  
......
712 707
    if(w->j_type) return 0;
713 708
    
714 709
    if (s->pict_type == P_TYPE) {
715
        if(s->mb_type[s->mb_y * s->mb_width + s->mb_x]&MB_TYPE_SKIPED){
710
        if(IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])){
716 711
            /* skip mb */
717 712
            s->mb_intra = 0;
718 713
            for(i=0;i<6;i++)

Also available in: Unified diff