[SCM] libav/experimental: psnr calculation with threads>1 fix

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:45:32 UTC 2013


The following commit has been merged in the experimental branch:
commit 60d76256cb6abb7a5f65e434031d0ebb114599ea
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Wed Dec 7 18:21:16 2005 +0000

    psnr calculation with threads>1 fix
    
    Originally committed as revision 4725 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 96f2fc8..bfc8944 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++){

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list