Mercurial > libavcodec.hg
comparison utils.c @ 2637:ef44d24680d1 libavcodec
switch to native time bases
| author | michael |
|---|---|
| date | Sat, 30 Apr 2005 21:43:59 +0000 |
| parents | 2344c6713011 |
| children | 659b92488061 |
comparison
equal
deleted
inserted
replaced
| 2636:2344c6713011 | 2637:ef44d24680d1 |
|---|---|
| 440 s->i_quant_factor=-0.8; | 440 s->i_quant_factor=-0.8; |
| 441 s->i_quant_offset=0.0; | 441 s->i_quant_offset=0.0; |
| 442 s->error_concealment= 3; | 442 s->error_concealment= 3; |
| 443 s->error_resilience= 1; | 443 s->error_resilience= 1; |
| 444 s->workaround_bugs= FF_BUG_AUTODETECT; | 444 s->workaround_bugs= FF_BUG_AUTODETECT; |
| 445 s->frame_rate_base= 1; | 445 s->time_base= (AVRational){0,1}; |
| 446 s->frame_rate = 25; | |
| 447 s->gop_size= 50; | 446 s->gop_size= 50; |
| 448 s->me_method= ME_EPZS; | 447 s->me_method= ME_EPZS; |
| 449 s->get_buffer= avcodec_default_get_buffer; | 448 s->get_buffer= avcodec_default_get_buffer; |
| 450 s->release_buffer= avcodec_default_release_buffer; | 449 s->release_buffer= avcodec_default_release_buffer; |
| 451 s->get_format= avcodec_default_get_format; | 450 s->get_format= avcodec_default_get_format; |
| 732 } | 731 } |
| 733 if (enc->width) { | 732 if (enc->width) { |
| 734 snprintf(buf + strlen(buf), buf_size - strlen(buf), | 733 snprintf(buf + strlen(buf), buf_size - strlen(buf), |
| 735 ", %dx%d, %0.2f fps", | 734 ", %dx%d, %0.2f fps", |
| 736 enc->width, enc->height, | 735 enc->width, enc->height, |
| 737 (float)enc->frame_rate / enc->frame_rate_base); | 736 1/av_q2d(enc->time_base)); |
| 738 } | 737 } |
| 739 if (encode) { | 738 if (encode) { |
| 740 snprintf(buf + strlen(buf), buf_size - strlen(buf), | 739 snprintf(buf + strlen(buf), buf_size - strlen(buf), |
| 741 ", q=%d-%d", enc->qmin, enc->qmax); | 740 ", q=%d-%d", enc->qmin, enc->qmax); |
| 742 } | 741 } |
| 928 | 927 |
| 929 int64_t av_rescale(int64_t a, int64_t b, int64_t c){ | 928 int64_t av_rescale(int64_t a, int64_t b, int64_t c){ |
| 930 return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); | 929 return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); |
| 931 } | 930 } |
| 932 | 931 |
| 932 int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ | |
| 933 int64_t b= bq.num * (int64_t)cq.den; | |
| 934 int64_t c= cq.num * (int64_t)bq.den; | |
| 935 return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); | |
| 936 } | |
| 937 | |
| 933 int64_t ff_gcd(int64_t a, int64_t b){ | 938 int64_t ff_gcd(int64_t a, int64_t b){ |
| 934 if(b) return ff_gcd(b, a%b); | 939 if(b) return ff_gcd(b, a%b); |
| 935 else return a; | 940 else return a; |
| 936 } | 941 } |
| 937 | 942 |
