[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec snow.c,1.82,1.83
Loren Merritt CVS
lorenm
Thu Jan 19 10:21:41 CET 2006
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv30922/libavcodec
Modified Files:
snow.c
Log Message:
detect when iterative_me fails to converge, and stop searching
Index: snow.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/snow.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- snow.c 17 Jan 2006 08:27:39 -0000 1.82
+++ snow.c 19 Jan 2006 09:21:38 -0000 1.83
@@ -25,6 +25,8 @@
#include "mpegvideo.h"
+#include <zlib.h>
+
#undef NDEBUG
#include <assert.h>
@@ -3301,6 +3303,8 @@
const int b_height= s->b_height << s->block_max_depth;
const int b_stride= b_width;
int color[3];
+ const int first_crc_pass= 12;
+ uint32_t crcs[50];
for(pass=0; pass<50; pass++){
int change= 0;
@@ -3435,6 +3439,18 @@
}
}
av_log(NULL, AV_LOG_ERROR, "pass:%d changed:%d\n", pass, change);
+
+ if(pass >= first_crc_pass){
+ int i;
+ //FIXME can we hash just the blocks that were analysed?
+ crcs[pass]= crc32(crc32(0,NULL,0), (void*)s->block, b_stride*b_height*sizeof(BlockNode));
+ for(i=pass-1; i>=first_crc_pass; i--){
+ if(crcs[i] == crcs[pass]){
+ change= 0;
+ break;
+ }
+ }
+ }
if(!change)
break;
}
More information about the ffmpeg-cvslog
mailing list