Just some cosmetics & comments, the only functional change "error_resilience: use s->last_picture for accessing last MVs." Is so buggy that it needs a full rewrite, guess -1.0 PSNR loss wasnt enough for ronald to realize there was a problem.
Unified · Split
| @@ -663,6 +663,7 @@ static int is_intra_more_likely(MpegEncContext *s){ · 662 unmodified lines | |||
| 663 | uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize; | 663 | uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize; |
| 664 | 664 | ||
| 665 | is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16); | 665 | is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16); |
| 666 | // FIXME need await_progress() here | ||
| 666 | is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16); | 667 | is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16); |
| 667 | }else{ | 668 | }else{ |
| 668 | if(IS_INTRA(s->current_picture.mb_type[mb_xy])) | 669 | if(IS_INTRA(s->current_picture.mb_type[mb_xy])) |
| @@ -1000,6 +1001,7 @@ void ff_er_frame_end(MpegEncContext *s){ · 331 unmodified lines | |||
| 1000 | int time_pp= s->pp_time; | 1001 | int time_pp= s->pp_time; |
| 1001 | int time_pb= s->pb_time; | 1002 | int time_pb= s->pb_time; |
| 1002 | 1003 | ||
| 1004 | // FIXME await_progress here | ||
| 1003 | s->mv[0][0][0] = s->next_picture.motion_val[0][xy][0]*time_pb/time_pp; | 1005 | s->mv[0][0][0] = s->next_picture.motion_val[0][xy][0]*time_pb/time_pp; |
| 1004 | s->mv[0][0][1] = s->next_picture.motion_val[0][xy][1]*time_pb/time_pp; | 1006 | s->mv[0][0][1] = s->next_picture.motion_val[0][xy][1]*time_pb/time_pp; |
| 1005 | s->mv[1][0][0] = s->next_picture.motion_val[0][xy][0]*(time_pb - time_pp)/time_pp; | 1007 | s->mv[1][0][0] = s->next_picture.motion_val[0][xy][0]*(time_pb - time_pp)/time_pp; |
| @@ -680,6 +680,7 @@ av_cold int MPV_common_init(MpegEncContext *s) · 679 unmodified lines | |||
| 680 | FF_ALLOCZ_OR_GOTO(s->avctx, s->dct_offset, 2 * 64 * sizeof(uint16_t), fail) | 680 | FF_ALLOCZ_OR_GOTO(s->avctx, s->dct_offset, 2 * 64 * sizeof(uint16_t), fail) |
| 681 | } | 681 | } |
| 682 | } | 682 | } |
| 683 | |||
| 683 | s->picture_count = MAX_PICTURE_COUNT * FFMAX(1, s->avctx->thread_count); | 684 | s->picture_count = MAX_PICTURE_COUNT * FFMAX(1, s->avctx->thread_count); |
| 684 | FF_ALLOCZ_OR_GOTO(s->avctx, s->picture, s->picture_count * sizeof(Picture), fail) | 685 | FF_ALLOCZ_OR_GOTO(s->avctx, s->picture, s->picture_count * sizeof(Picture), fail) |
| 685 | for(i = 0; i < s->picture_count; i++) { | 686 | for(i = 0; i < s->picture_count; i++) { |
| @@ -754,7 +755,7 @@ av_cold int MPV_common_init(MpegEncContext *s) · 68 unmodified lines | |||
| 754 | 755 | ||
| 755 | for(i=0; i<threads; i++){ | 756 | for(i=0; i<threads; i++){ |
| 756 | if(init_duplicate_context(s->thread_context[i], s) < 0) | 757 | if(init_duplicate_context(s->thread_context[i], s) < 0) |
| 757 | goto fail; | 758 | goto fail; |
| 758 | s->thread_context[i]->start_mb_y= (s->mb_height*(i ) + s->avctx->thread_count/2) / s->avctx->thread_count; | 759 | s->thread_context[i]->start_mb_y= (s->mb_height*(i ) + s->avctx->thread_count/2) / s->avctx->thread_count; |
| 759 | s->thread_context[i]->end_mb_y = (s->mb_height*(i+1) + s->avctx->thread_count/2) / s->avctx->thread_count; | 760 | s->thread_context[i]->end_mb_y = (s->mb_height*(i+1) + s->avctx->thread_count/2) / s->avctx->thread_count; |
| 760 | } | 761 | } |