changeset 2955:64f38f1be88f libavcodec

psnr calculation with threads>1 fix
author michael
date Wed, 07 Dec 2005 18:21:16 +0000
parents 43f14ef874de
children 5f51b1e0bed6
files mpegvideo.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.c	Tue Dec 06 17:42:16 2005 +0000
+++ b/mpegvideo.c	Wed Dec 07 18:21:16 2005 +0000
@@ -2362,6 +2362,7 @@
             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 @@
         /* 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 @@
                 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 @@
     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++){