Mercurial > libavcodec.hg
comparison ratecontrol.c @ 3065:b2c352a66a73 libavcodec
10l forgot #ifdef CONFIG_XVID
author | michael |
---|---|
date | Wed, 25 Jan 2006 02:16:27 +0000 |
parents | a5e0b58b4471 |
children | 646f6344472d |
comparison
equal
deleted
inserted
replaced
3064:a5e0b58b4471 | 3065:b2c352a66a73 |
---|---|
115 return -1; | 115 return -1; |
116 } | 116 } |
117 | 117 |
118 p= next; | 118 p= next; |
119 } | 119 } |
120 | 120 #ifdef CONFIG_XVID |
121 //FIXME maybe move to end | 121 //FIXME maybe move to end |
122 if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) | 122 if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) |
123 return ff_xvid_rate_control_init(s); | 123 return ff_xvid_rate_control_init(s); |
124 #endif | |
124 | 125 |
125 if(init_pass2(s) < 0) return -1; | 126 if(init_pass2(s) < 0) return -1; |
126 } | 127 } |
127 | 128 |
128 if(!(s->flags&CODEC_FLAG_PASS2)){ | 129 if(!(s->flags&CODEC_FLAG_PASS2)){ |
185 RateControlContext *rcc= &s->rc_context; | 186 RateControlContext *rcc= &s->rc_context; |
186 emms_c(); | 187 emms_c(); |
187 | 188 |
188 av_freep(&rcc->entry); | 189 av_freep(&rcc->entry); |
189 | 190 |
191 #ifdef CONFIG_XVID | |
190 if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) | 192 if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) |
191 ff_xvid_rate_control_uninit(s); | 193 ff_xvid_rate_control_uninit(s); |
194 #endif | |
192 } | 195 } |
193 | 196 |
194 static inline double qp2bits(RateControlEntry *rce, double qp){ | 197 static inline double qp2bits(RateControlEntry *rce, double qp){ |
195 if(qp<=0.0){ | 198 if(qp<=0.0){ |
196 av_log(NULL, AV_LOG_ERROR, "qp<=0.0\n"); | 199 av_log(NULL, AV_LOG_ERROR, "qp<=0.0\n"); |
646 int var; | 649 int var; |
647 const int pict_type= s->pict_type; | 650 const int pict_type= s->pict_type; |
648 Picture * const pic= &s->current_picture; | 651 Picture * const pic= &s->current_picture; |
649 emms_c(); | 652 emms_c(); |
650 | 653 |
654 #ifdef CONFIG_XVID | |
651 if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) | 655 if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) |
652 return ff_xvid_rate_estimate_qscale(s, dry_run); | 656 return ff_xvid_rate_estimate_qscale(s, dry_run); |
657 #endif | |
653 | 658 |
654 get_qminmax(&qmin, &qmax, s, pict_type); | 659 get_qminmax(&qmin, &qmax, s, pict_type); |
655 | 660 |
656 fps= 1/av_q2d(s->avctx->time_base); | 661 fps= 1/av_q2d(s->avctx->time_base); |
657 //printf("input_pic_num:%d pic_num:%d frame_rate:%d\n", s->input_picture_number, s->picture_number, s->frame_rate); | 662 //printf("input_pic_num:%d pic_num:%d frame_rate:%d\n", s->input_picture_number, s->picture_number, s->frame_rate); |