Revision 7c4f71c4

View differences:

libavcodec/h263.c
577 577
    } else if(IS_INTERLACED(colocated_mb_type)){
578 578
        s->mv_type = MV_TYPE_FIELD;
579 579
        for(i=0; i<2; i++){
580
            int field_select= s->next_picture.ref_index[0][s->block_index[2*i]];
580 581
            if(s->top_field_first){
581
                time_pp= s->pp_field_time - s->p_field_select_table[i][mb_index] + i;
582
                time_pb= s->pb_field_time - s->p_field_select_table[i][mb_index] + i;
582
                time_pp= s->pp_field_time - field_select + i;
583
                time_pb= s->pb_field_time - field_select + i;
583 584
            }else{
584
                time_pp= s->pp_field_time + s->p_field_select_table[i][mb_index] - i;
585
                time_pb= s->pb_field_time + s->p_field_select_table[i][mb_index] - i;
585
                time_pp= s->pp_field_time + field_select - i;
586
                time_pb= s->pb_field_time + field_select - i;
586 587
            }
587 588
            s->mv[0][i][0] = s->p_field_mv_table[i][0][mb_index][0]*time_pb/time_pp + mx;
588 589
            s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1]*time_pb/time_pp + my;
......
631 632
            for(i=0; i<2; i++){
632 633
                s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0];
633 634
                s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1];
634
                s->p_field_select_table[i][mb_xy]= s->field_select[0][i];
635 635
            }
636
            s->current_picture.ref_index[0][xy           ]=
637
            s->current_picture.ref_index[0][xy        + 1]= s->field_select[0][0];
638
            s->current_picture.ref_index[0][xy + wrap    ]=
639
            s->current_picture.ref_index[0][xy + wrap + 1]= s->field_select[0][1];
636 640
        }
637
        
641

  
638 642
        /* no update if 8X8 because it has been done during parsing */
639 643
        s->current_picture.motion_val[0][xy][0] = motion_x;
640 644
        s->current_picture.motion_val[0][xy][1] = motion_y;
libavcodec/mpeg12.c
2341 2341
                        motion_x = s->mv[dir][i][0];
2342 2342
                        motion_y = s->mv[dir][i][1];
2343 2343
                    }
2344
                    
2344

  
2345 2345
                    s->current_picture.motion_val[dir][xy    ][0] = motion_x;
2346 2346
                    s->current_picture.motion_val[dir][xy    ][1] = motion_y;
2347 2347
                    s->current_picture.motion_val[dir][xy + 1][0] = motion_x;
2348 2348
                    s->current_picture.motion_val[dir][xy + 1][1] = motion_y;
2349
                    s->current_picture.ref_index [dir][xy    ]=
2350
                    s->current_picture.ref_index [dir][xy + 1]= s->field_select[dir][i];
2349 2351
                }
2350 2352
                xy += wrap;
2351 2353
            }
libavcodec/mpegvideo.c
307 307
                memcpy(dst->motion_val[i], src->motion_val[i], 2*stride*height*sizeof(int16_t));
308 308
            }
309 309
            if(src->ref_index[i] && src->ref_index[i] != dst->ref_index[i]){
310
                memcpy(dst->ref_index[i], src->ref_index[i], s->mb_stride*s->mb_height*sizeof(int8_t)); //FIXME init this too
310
                memcpy(dst->ref_index[i], src->ref_index[i], s->b8_stride*2*s->mb_height*sizeof(int8_t));
311 311
            }
312 312
        }
313 313
    }
......
369 369
            for(i=0; i<2; i++){
370 370
                CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b4_array_size+2)  * sizeof(int16_t))
371 371
                pic->motion_val[i]= pic->motion_val_base[i]+2;
372
                CHECKED_ALLOCZ(pic->ref_index[i] , b8_array_size * sizeof(uint8_t))
372
                CHECKED_ALLOCZ(pic->ref_index[i], b8_array_size * sizeof(uint8_t))
373 373
            }
374 374
            pic->motion_subsample_log2= 2;
375 375
        }else if(s->out_format == FMT_H263 || s->encoding || (s->avctx->debug&FF_DEBUG_MV) || (s->avctx->debug_mv)){
376 376
            for(i=0; i<2; i++){
377 377
                CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b8_array_size+2) * sizeof(int16_t))
378 378
                pic->motion_val[i]= pic->motion_val_base[i]+2;
379
                CHECKED_ALLOCZ(pic->ref_index[i], mb_array_size * sizeof(int8_t))
379
                CHECKED_ALLOCZ(pic->ref_index[i], b8_array_size * sizeof(uint8_t))
380 380
            }
381 381
            pic->motion_subsample_log2= 3;
382 382
        }

Also available in: Unified diff