From 46c281e8c1823b11085b108a7f13c02103cd5b90 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 3 Aug 2004 02:34:50 +0000 Subject: [PATCH] cleanup Originally committed as revision 3377 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/snow.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/libavcodec/snow.c b/libavcodec/snow.c index 99e39a127e..6b8081b3cc 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -1053,11 +1053,11 @@ STOP_TIMER("vertical_decompose97i") } } -static void spatial_dwt(SnowContext *s, int *buffer, int width, int height, int stride){ +void ff_spatial_dwt(int *buffer, int width, int height, int stride, int type, int decomposition_count){ int level; - for(level=0; levelspatial_decomposition_count; level++){ - switch(s->spatial_decomposition_type){ + for(level=0; level>level, height>>level, stride<>level, height>>level, stride<>level, height>>level, stride<spatial_decomposition_count-1; level>=0; level--){ - switch(s->spatial_decomposition_type){ + for(level=decomposition_count-1; level>=0; level--){ + switch(type){ case 0: spatial_compose97i(buffer, width>>level, height>>level, stride<>level, height>>level, stride<>level, height>>level, stride<spatial_dwt_buffer, 0, sizeof(int)*width*height); buf[b->width/2 + b->height/2*b->stride]= 256*256; - spatial_idwt(s, s->spatial_dwt_buffer, width, height, width); + ff_spatial_idwt(s->spatial_dwt_buffer, width, height, width, s->spatial_decomposition_type, s->spatial_decomposition_count); for(y=0; yspatial_dwt_buffer[x + y*width]; @@ -2583,7 +2583,7 @@ static void calculate_vissual_weight(SnowContext *s, Plane *p){ } b->qlog= (int)(log(352256.0/sqrt(error)) / log(pow(2.0, 1.0/QROOT))+0.5); - av_log(NULL, AV_LOG_DEBUG, "%d %d %d\n", level, orientation, b->qlog/*, sqrt(error)*/); +// av_log(NULL, AV_LOG_DEBUG, "%d %d %d\n", level, orientation, b->qlog/*, sqrt(error)*/); } } } @@ -2894,7 +2894,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, } } - spatial_dwt(s, s->spatial_dwt_buffer, w, h, w); + ff_spatial_dwt(s->spatial_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count); for(level=0; levelspatial_decomposition_count; level++){ for(orientation=level ? 1 : 0; orientation<4; orientation++){ @@ -2919,7 +2919,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, } } - spatial_idwt(s, s->spatial_dwt_buffer, w, h, w); + ff_spatial_idwt(s->spatial_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count); if(s->qlog == LOSSLESS_QLOG){ for(y=0; yavctx->debug&1024)) } } - spatial_idwt(s, s->spatial_dwt_buffer, w, h, w); + ff_spatial_idwt(s->spatial_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count); if(s->qlog == LOSSLESS_QLOG){ for(y=0; yspatial_decomposition_type, s->spatial_decomposition_count); + ff_spatial_idwt(buffer[0], width, height, width, s->spatial_decomposition_type, s->spatial_decomposition_count); for(i=0; ispatial_decomposition_type, s->spatial_decomposition_count); + ff_spatial_idwt(buffer[0], width, height, width, s->spatial_decomposition_type, s->spatial_decomposition_count); for(i=0; ispatial_decomposition_type, s->spatial_decomposition_count); for(y=0; yspatial_decomposition_type, s->spatial_decomposition_count); #else for(y=0; yspatial_decomposition_type, s->spatial_decomposition_count); #endif for(y=0; y