Mercurial > libavcodec.hg
comparison rv10.c @ 1748:8336c5e14765 libavcodec
rv20 mv prediction in b frames fix
author | michael |
---|---|
date | Sun, 18 Jan 2004 02:59:01 +0000 |
parents | 07a484280a82 |
children | bdf3927bf8c5 |
comparison
equal
deleted
inserted
replaced
1747:8cfd36bfe504 | 1748:8336c5e14765 |
---|---|
545 if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr==NULL) { | 545 if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr==NULL) { |
546 if(MPV_frame_start(s, avctx) < 0) | 546 if(MPV_frame_start(s, avctx) < 0) |
547 return -1; | 547 return -1; |
548 } | 548 } |
549 | 549 |
550 if(s->pict_type == B_TYPE){ //FIXME remove after cleaning mottion_val indexing | |
551 memset(s->current_picture.motion_val[0], 0, sizeof(int16_t)*2*(s->mb_width*2+2)*(s->mb_height*2+2)); | |
552 } | |
553 | |
550 #ifdef DEBUG | 554 #ifdef DEBUG |
551 printf("qscale=%d\n", s->qscale); | 555 printf("qscale=%d\n", s->qscale); |
552 #endif | 556 #endif |
553 | 557 |
554 /* default quantization values */ | 558 /* default quantization values */ |
573 ff_set_qscale(s, s->qscale); | 577 ff_set_qscale(s, s->qscale); |
574 | 578 |
575 s->rv10_first_dc_coded[0] = 0; | 579 s->rv10_first_dc_coded[0] = 0; |
576 s->rv10_first_dc_coded[1] = 0; | 580 s->rv10_first_dc_coded[1] = 0; |
577 s->rv10_first_dc_coded[2] = 0; | 581 s->rv10_first_dc_coded[2] = 0; |
578 | 582 //printf("%d %X %X\n", s->pict_type, s->current_picture.motion_val[0], s->current_picture.motion_val[1]); |
579 s->block_wrap[0]= | 583 s->block_wrap[0]= |
580 s->block_wrap[1]= | 584 s->block_wrap[1]= |
581 s->block_wrap[2]= | 585 s->block_wrap[2]= |
582 s->block_wrap[3]= s->mb_width*2 + 2; | 586 s->block_wrap[3]= s->mb_width*2 + 2; |
583 s->block_wrap[4]= | 587 s->block_wrap[4]= |
598 | 602 |
599 if (ret == SLICE_ERROR) { | 603 if (ret == SLICE_ERROR) { |
600 av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y); | 604 av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y); |
601 return -1; | 605 return -1; |
602 } | 606 } |
603 ff_h263_update_motion_val(s); | 607 if(s->pict_type != B_TYPE) |
608 ff_h263_update_motion_val(s); | |
604 MPV_decode_mb(s, s->block); | 609 MPV_decode_mb(s, s->block); |
605 if(s->loop_filter) | 610 if(s->loop_filter) |
606 ff_h263_loop_filter(s); | 611 ff_h263_loop_filter(s); |
607 | 612 |
608 if (++s->mb_x == s->mb_width) { | 613 if (++s->mb_x == s->mb_width) { |
633 /* no supplementary picture */ | 638 /* no supplementary picture */ |
634 if (buf_size == 0) { | 639 if (buf_size == 0) { |
635 *data_size = 0; | 640 *data_size = 0; |
636 return 0; | 641 return 0; |
637 } | 642 } |
638 | 643 |
639 if(avctx->slice_count){ | 644 if(avctx->slice_count){ |
640 for(i=0; i<avctx->slice_count; i++){ | 645 for(i=0; i<avctx->slice_count; i++){ |
641 int offset= avctx->slice_offset[i]; | 646 int offset= avctx->slice_offset[i]; |
642 int size; | 647 int size; |
643 | 648 |