Mercurial > libavcodec.hg
comparison h263.c @ 1389:da0b3a50d209 libavcodec
rate distortion mb decision support
fix decoding of old %16!=0 divx
fix assertion failure in motion_est.c
author | michaelni |
---|---|
date | Tue, 29 Jul 2003 02:09:12 +0000 |
parents | 80067f8d6770 |
children | 39d07c0263de |
comparison
equal
deleted
inserted
replaced
1388:b5c65adac96a | 1389:da0b3a50d209 |
---|---|
507 if((s->avctx->workaround_bugs & FF_BUG_DIRECT_BLOCKSIZE) || !s->quarter_sample) | 507 if((s->avctx->workaround_bugs & FF_BUG_DIRECT_BLOCKSIZE) || !s->quarter_sample) |
508 s->mv_type= MV_TYPE_16X16; | 508 s->mv_type= MV_TYPE_16X16; |
509 else | 509 else |
510 s->mv_type= MV_TYPE_8X8; | 510 s->mv_type= MV_TYPE_8X8; |
511 return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1; //Note see prev line | 511 return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1; //Note see prev line |
512 } | |
513 } | |
514 | |
515 void ff_h263_update_motion_val(MpegEncContext * s){ | |
516 const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; | |
517 //FIXME a lot of thet is only needed for !low_delay | |
518 const int wrap = s->block_wrap[0]; | |
519 const int xy = s->block_index[0]; | |
520 | |
521 s->current_picture.mbskip_table[mb_xy]= s->mb_skiped; | |
522 | |
523 if(s->mv_type != MV_TYPE_8X8){ | |
524 int motion_x, motion_y; | |
525 if (s->mb_intra) { | |
526 motion_x = 0; | |
527 motion_y = 0; | |
528 } else if (s->mv_type == MV_TYPE_16X16) { | |
529 motion_x = s->mv[0][0][0]; | |
530 motion_y = s->mv[0][0][1]; | |
531 } else /*if (s->mv_type == MV_TYPE_FIELD)*/ { | |
532 int i; | |
533 motion_x = s->mv[0][0][0] + s->mv[0][1][0]; | |
534 motion_y = s->mv[0][0][1] + s->mv[0][1][1]; | |
535 motion_x = (motion_x>>1) | (motion_x&1); | |
536 for(i=0; i<2; i++){ | |
537 s->field_mv_table[mb_xy][i][0]= s->mv[0][i][0]; | |
538 s->field_mv_table[mb_xy][i][1]= s->mv[0][i][1]; | |
539 s->field_select_table[mb_xy][i]= s->field_select[0][i]; | |
540 } | |
541 } | |
542 | |
543 /* no update if 8X8 because it has been done during parsing */ | |
544 s->motion_val[xy][0] = motion_x; | |
545 s->motion_val[xy][1] = motion_y; | |
546 s->motion_val[xy + 1][0] = motion_x; | |
547 s->motion_val[xy + 1][1] = motion_y; | |
548 s->motion_val[xy + wrap][0] = motion_x; | |
549 s->motion_val[xy + wrap][1] = motion_y; | |
550 s->motion_val[xy + 1 + wrap][0] = motion_x; | |
551 s->motion_val[xy + 1 + wrap][1] = motion_y; | |
552 } | |
553 | |
554 if(s->encoding){ //FIXME encoding MUST be cleaned up | |
555 if (s->mv_type == MV_TYPE_8X8) | |
556 s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_8x8; | |
557 else | |
558 s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_16x16; | |
512 } | 559 } |
513 } | 560 } |
514 | 561 |
515 #ifdef CONFIG_ENCODERS | 562 #ifdef CONFIG_ENCODERS |
516 void mpeg4_encode_mb(MpegEncContext * s, | 563 void mpeg4_encode_mb(MpegEncContext * s, |