comparison snow.c @ 11486:1bf7af4db35a libavcodec

Add ff_ prefix to dwt functions
author mru
date Sun, 14 Mar 2010 17:50:16 +0000
parents 0f0cd6b5791f
children 8a4984c5cacc
comparison
equal deleted inserted replaced
11485:0f0cd6b5791f 11486:1bf7af4db35a
2079 if(decode_header(s)<0) 2079 if(decode_header(s)<0)
2080 return -1; 2080 return -1;
2081 common_init_after_header(avctx); 2081 common_init_after_header(avctx);
2082 2082
2083 // realloc slice buffer for the case that spatial_decomposition_count changed 2083 // realloc slice buffer for the case that spatial_decomposition_count changed
2084 slice_buffer_destroy(&s->sb); 2084 ff_slice_buffer_destroy(&s->sb);
2085 slice_buffer_init(&s->sb, s->plane[0].height, (MB_SIZE >> s->block_max_depth) + s->spatial_decomposition_count * 8 + 1, s->plane[0].width, s->spatial_idwt_buffer); 2085 ff_slice_buffer_init(&s->sb, s->plane[0].height, (MB_SIZE >> s->block_max_depth) + s->spatial_decomposition_count * 8 + 1, s->plane[0].width, s->spatial_idwt_buffer);
2086 2086
2087 for(plane_index=0; plane_index<3; plane_index++){ 2087 for(plane_index=0; plane_index<3; plane_index++){
2088 Plane *p= &s->plane[plane_index]; 2088 Plane *p= &s->plane[plane_index];
2089 p->fast_mc= p->diag_mc && p->htaps==6 && p->hcoeff[0]==40 2089 p->fast_mc= p->diag_mc && p->htaps==6 && p->hcoeff[0]==40
2090 && p->hcoeff[1]==-10 2090 && p->hcoeff[1]==-10
2197 predict_slice_buffered(s, &s->sb, s->spatial_idwt_buffer, plane_index, 1, mb_y); 2197 predict_slice_buffered(s, &s->sb, s->spatial_idwt_buffer, plane_index, 1, mb_y);
2198 2198
2199 y = FFMIN(p->height, slice_starty); 2199 y = FFMIN(p->height, slice_starty);
2200 end_y = FFMIN(p->height, slice_h); 2200 end_y = FFMIN(p->height, slice_h);
2201 while(y < end_y) 2201 while(y < end_y)
2202 slice_buffer_release(&s->sb, y++); 2202 ff_slice_buffer_release(&s->sb, y++);
2203 } 2203 }
2204 2204
2205 slice_buffer_flush(&s->sb); 2205 ff_slice_buffer_flush(&s->sb);
2206 } 2206 }
2207 2207
2208 } 2208 }
2209 2209
2210 emms_c(); 2210 emms_c();
2226 2226
2227 static av_cold int decode_end(AVCodecContext *avctx) 2227 static av_cold int decode_end(AVCodecContext *avctx)
2228 { 2228 {
2229 SnowContext *s = avctx->priv_data; 2229 SnowContext *s = avctx->priv_data;
2230 2230
2231 slice_buffer_destroy(&s->sb); 2231 ff_slice_buffer_destroy(&s->sb);
2232 2232
2233 common_end(s); 2233 common_end(s);
2234 2234
2235 return 0; 2235 return 0;
2236 } 2236 }
2827 /* FIXME cmps overlap but do not cover the wavelet's whole support. 2827 /* FIXME cmps overlap but do not cover the wavelet's whole support.
2828 * So improving the score of one block is not strictly guaranteed 2828 * So improving the score of one block is not strictly guaranteed
2829 * to improve the score of the whole frame, thus iterative motion 2829 * to improve the score of the whole frame, thus iterative motion
2830 * estimation does not always converge. */ 2830 * estimation does not always converge. */
2831 if(s->avctx->me_cmp == FF_CMP_W97) 2831 if(s->avctx->me_cmp == FF_CMP_W97)
2832 distortion = w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); 2832 distortion = ff_w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32);
2833 else if(s->avctx->me_cmp == FF_CMP_W53) 2833 else if(s->avctx->me_cmp == FF_CMP_W53)
2834 distortion = w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); 2834 distortion = ff_w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32);
2835 else{ 2835 else{
2836 distortion = 0; 2836 distortion = 0;
2837 for(i=0; i<4; i++){ 2837 for(i=0; i<4; i++){
2838 int off = sx+16*(i&1) + (sy+16*(i>>1))*ref_stride; 2838 int off = sx+16*(i&1) + (sy+16*(i>>1))*ref_stride;
2839 distortion += s->dsp.me_cmp[0](&s->m, src + off, dst + off, ref_stride, 16); 2839 distortion += s->dsp.me_cmp[0](&s->m, src + off, dst + off, ref_stride, 16);