[Mplayer-cvslog] CVS: main/libmpcodecs/native roqav.c,1.5,1.6

Ivan Kalvachev iive at mplayerhq.hu
Thu Apr 18 19:08:11 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs/native
In directory mail:/var/tmp.root/cvs-serv17027

Modified Files:
	roqav.c 
Log Message:
fixed block artefacts and speedup at the same time

Index: roqav.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/native/roqav.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- roqav.c	18 Mar 2002 05:29:59 -0000	1.5
+++ roqav.c	18 Apr 2002 17:08:08 -0000	1.6
@@ -64,6 +64,7 @@
   roq_v2_codebook v2[MAX_ROQ_CODEBOOK_SIZE];
   roq_v4_codebook v4[MAX_ROQ_CODEBOOK_SIZE];
   mp_image_t *prev_frame;
+  uint32_t numframe;
 } roqvideo_info;
 
 
@@ -232,6 +233,7 @@
     (roqvideo_info *)calloc(sizeof(roqvideo_info), 1);
 
   info->prev_frame = NULL;
+  info->numframe=0;
 
   return info;
 }
@@ -386,9 +388,11 @@
     mean_motion_y = encoded[stream_ptr++];
     mean_motion_x = encoded[stream_ptr++];
 
-    // start by copying entire previous frame
-    if (info->prev_frame)
+    //RoQ reuses its buffers so a transparent block keeps content 
+    //from 2 frames ago. The only exception is 2'd frame (#1)
+    if(info->numframe==1)
     {
+      CHECK_PREV_FRAME();
       memcpy(mpi->planes[0], info->prev_frame->planes[0],
         mpi->width * mpi->height);
       memcpy(mpi->planes[1], info->prev_frame->planes[1],
@@ -606,6 +610,7 @@
   }
 
   // save the current frame as the previous frame for the next iteration
+  info->numframe++;
   info->prev_frame = mpi;
 }
 




More information about the MPlayer-cvslog mailing list