diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-12-07 18:21:16 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-12-07 18:21:16 +0000 |
commit | 60d76256cb6abb7a5f65e434031d0ebb114599ea (patch) | |
tree | 0d74ffbd42c66238a45b7a72c62a0bff2f61a6ee /libavcodec | |
parent | a4893bafd8b303c7933c2f4badedcf95d088c212 (diff) | |
download | ffmpeg-60d76256cb6abb7a5f65e434031d0ebb114599ea.tar.gz |
psnr calculation with threads>1 fix
Originally committed as revision 4725 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 96f2fc8a7e..bfc894410a 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -2362,6 +2362,7 @@ int MPV_encode_picture(AVCodecContext *avctx, ff_write_pass1_stats(s); for(i=0; i<4; i++){ + s->current_picture_ptr->error[i]= s->current_picture.error[i]; avctx->error[i] += s->current_picture_ptr->error[i]; } @@ -4653,7 +4654,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ /* note: quant matrix value (8) is implied here */ s->last_dc[i] = 128 << s->intra_dc_precision; - s->current_picture_ptr->error[i] = 0; + s->current_picture.error[i] = 0; } s->mb_skip_run = 0; memset(s->last_mv, 0, sizeof(s->last_mv)); @@ -5168,13 +5169,13 @@ static int encode_thread(AVCodecContext *c, void *arg){ if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16; if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16; - s->current_picture_ptr->error[0] += sse( + s->current_picture.error[0] += sse( s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize); - s->current_picture_ptr->error[1] += sse( + s->current_picture.error[1] += sse( s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8, s->dest[1], w>>1, h>>1, s->uvlinesize); - s->current_picture_ptr->error[2] += sse( + s->current_picture.error[2] += sse( s, s->new_picture .data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8, s->dest[2], w>>1, h>>1, s->uvlinesize); } @@ -5226,6 +5227,9 @@ static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src) MERGE(misc_bits); MERGE(error_count); MERGE(padding_bug_score); + MERGE(current_picture.error[0]); + MERGE(current_picture.error[1]); + MERGE(current_picture.error[2]); if(dst->avctx->noise_reduction){ for(i=0; i<64; i++){ |