comparison snow.c @ 6517:48759bfbd073 libavcodec

Apply 'cold' attribute to init/uninit functions in libavcodec
author zuxy
date Fri, 21 Mar 2008 03:11:20 +0000
parents 493dc59d469a
children 5b3acf9fd50a
comparison
equal deleted inserted replaced
6516:dbb902bb2347 6517:48759bfbd073
3638 qexp[i]= lrintf(v); 3638 qexp[i]= lrintf(v);
3639 v *= pow(2, 1.0 / QROOT); 3639 v *= pow(2, 1.0 / QROOT);
3640 } 3640 }
3641 } 3641 }
3642 3642
3643 static int common_init(AVCodecContext *avctx){ 3643 static av_cold int common_init(AVCodecContext *avctx){
3644 SnowContext *s = avctx->priv_data; 3644 SnowContext *s = avctx->priv_data;
3645 int width, height; 3645 int width, height;
3646 int i, j; 3646 int i, j;
3647 3647
3648 s->avctx= avctx; 3648 s->avctx= avctx;
3958 memcpy(s->spatial_idwt_buffer, best_dequant, height * stride * sizeof(IDWTELEM)); //FIXME work with that directly instead of copy at the end 3958 memcpy(s->spatial_idwt_buffer, best_dequant, height * stride * sizeof(IDWTELEM)); //FIXME work with that directly instead of copy at the end
3959 } 3959 }
3960 3960
3961 #endif /* QUANTIZE2==1 */ 3961 #endif /* QUANTIZE2==1 */
3962 3962
3963 static int encode_init(AVCodecContext *avctx) 3963 static av_cold int encode_init(AVCodecContext *avctx)
3964 { 3964 {
3965 SnowContext *s = avctx->priv_data; 3965 SnowContext *s = avctx->priv_data;
3966 int plane_index; 3966 int plane_index;
3967 3967
3968 if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){ 3968 if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){
4424 emms_c(); 4424 emms_c();
4425 4425
4426 return ff_rac_terminate(c); 4426 return ff_rac_terminate(c);
4427 } 4427 }
4428 4428
4429 static void common_end(SnowContext *s){ 4429 static av_cold void common_end(SnowContext *s){
4430 int plane_index, level, orientation, i; 4430 int plane_index, level, orientation, i;
4431 4431
4432 av_freep(&s->spatial_dwt_buffer); 4432 av_freep(&s->spatial_dwt_buffer);
4433 av_freep(&s->spatial_idwt_buffer); 4433 av_freep(&s->spatial_idwt_buffer);
4434 4434
4455 } 4455 }
4456 } 4456 }
4457 } 4457 }
4458 } 4458 }
4459 4459
4460 static int encode_end(AVCodecContext *avctx) 4460 static av_cold int encode_end(AVCodecContext *avctx)
4461 { 4461 {
4462 SnowContext *s = avctx->priv_data; 4462 SnowContext *s = avctx->priv_data;
4463 4463
4464 common_end(s); 4464 common_end(s);
4465 av_free(avctx->stats_out); 4465 av_free(avctx->stats_out);
4466 4466
4467 return 0; 4467 return 0;
4468 } 4468 }
4469 4469
4470 static int decode_init(AVCodecContext *avctx) 4470 static av_cold int decode_init(AVCodecContext *avctx)
4471 { 4471 {
4472 avctx->pix_fmt= PIX_FMT_YUV420P; 4472 avctx->pix_fmt= PIX_FMT_YUV420P;
4473 4473
4474 common_init(avctx); 4474 common_init(avctx);
4475 4475
4637 if(bytes_read ==0) av_log(s->avctx, AV_LOG_ERROR, "error at end of frame\n"); //FIXME 4637 if(bytes_read ==0) av_log(s->avctx, AV_LOG_ERROR, "error at end of frame\n"); //FIXME
4638 4638
4639 return bytes_read; 4639 return bytes_read;
4640 } 4640 }
4641 4641
4642 static int decode_end(AVCodecContext *avctx) 4642 static av_cold int decode_end(AVCodecContext *avctx)
4643 { 4643 {
4644 SnowContext *s = avctx->priv_data; 4644 SnowContext *s = avctx->priv_data;
4645 4645
4646 slice_buffer_destroy(&s->sb); 4646 slice_buffer_destroy(&s->sb);
4647 4647