Revision 69cc3183

View differences:

libavcodec/h264.c
2257 2257
                ++s->mb_y;
2258 2258
                if(FIELD_OR_MBAFF_PICTURE) {
2259 2259
                    ++s->mb_y;
2260
                    if(FRAME_MBAFF && s->mb_y < s->mb_height)
2261
                        predict_field_decoding_flag(h);
2260 2262
                }
2261 2263
            }
2262 2264

  
......
2295 2297
                ++s->mb_y;
2296 2298
                if(FIELD_OR_MBAFF_PICTURE) {
2297 2299
                    ++s->mb_y;
2300
                    if(FRAME_MBAFF && s->mb_y < s->mb_height)
2301
                        predict_field_decoding_flag(h);
2298 2302
                }
2299 2303
                if(s->mb_y >= s->mb_height){
2300 2304
                    tprintf(s->avctx, "slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits);
libavcodec/h264.h
1453 1453

  
1454 1454
static void predict_field_decoding_flag(H264Context *h){
1455 1455
    MpegEncContext * const s = &h->s;
1456
    const int mb_xy= h->mb_xy;
1456
    const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
1457 1457
    int mb_type = (h->slice_table[mb_xy-1] == h->slice_num)
1458 1458
                ? s->current_picture.mb_type[mb_xy-1]
1459 1459
                : (h->slice_table[mb_xy-s->mb_stride] == h->slice_num)
libavcodec/h264_cabac.c
1196 1196
    if( h->slice_type_nos != FF_I_TYPE ) {
1197 1197
        int skip;
1198 1198
        /* a skipped mb needs the aff flag from the following mb */
1199
        if( FRAME_MBAFF && s->mb_x==0 && (s->mb_y&1)==0 )
1200
            predict_field_decoding_flag(h);
1201 1199
        if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped )
1202 1200
            skip = h->next_mb_skipped;
1203 1201
        else
libavcodec/h264_cavlc.c
547 547
            if(FRAME_MBAFF && (s->mb_y&1) == 0){
548 548
                if(s->mb_skip_run==0)
549 549
                    h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&s->gb);
550
                else
551
                    predict_field_decoding_flag(h);
552 550
            }
553 551
            decode_mb_skip(h);
554 552
            return 0;

Also available in: Unified diff