diff options
author | Mike Melanson <mike@multimedia.cx> | 2005-05-06 04:19:17 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2005-05-06 04:19:17 +0000 |
commit | fd42eb6dec2d911a8480d7b30625b27aeb34ce6c (patch) | |
tree | d72cd780ca54c7816180c2bd717ed86444b4fcd9 /src/libffmpeg/libavcodec/utils.c | |
parent | 20f83e09f4e2588b5564be12967c56717a937716 (diff) | |
download | xine-lib-fd42eb6dec2d911a8480d7b30625b27aeb34ce6c.tar.gz xine-lib-fd42eb6dec2d911a8480d7b30625b27aeb34ce6c.tar.bz2 |
syncing to FFmpeg libavcodec build 4754
CVS patchset: 7522
CVS date: 2005/05/06 04:19:17
Diffstat (limited to 'src/libffmpeg/libavcodec/utils.c')
-rw-r--r-- | src/libffmpeg/libavcodec/utils.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libffmpeg/libavcodec/utils.c b/src/libffmpeg/libavcodec/utils.c index afff2f98a..b5bd17f4a 100644 --- a/src/libffmpeg/libavcodec/utils.c +++ b/src/libffmpeg/libavcodec/utils.c @@ -442,8 +442,7 @@ void avcodec_get_context_defaults(AVCodecContext *s){ s->error_concealment= 3; s->error_resilience= 1; s->workaround_bugs= FF_BUG_AUTODETECT; - s->frame_rate_base= 1; - s->frame_rate = 25; + s->time_base= (AVRational){0,1}; s->gop_size= 50; s->me_method= ME_EPZS; s->get_buffer= avcodec_default_get_buffer; @@ -459,6 +458,7 @@ void avcodec_get_context_defaults(AVCodecContext *s){ s->profile= FF_PROFILE_UNKNOWN; s->level= FF_LEVEL_UNKNOWN; s->me_penalty_compensation= 256; + s->pix_fmt= PIX_FMT_NONE; s->intra_quant_bias= FF_DEFAULT_QUANT_BIAS; s->inter_quant_bias= FF_DEFAULT_QUANT_BIAS; @@ -724,7 +724,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) snprintf(buf, buf_size, "Video: %s%s", codec_name, enc->mb_decision ? " (hq)" : ""); - if (enc->codec_id == CODEC_ID_RAWVIDEO) { + if (enc->pix_fmt != PIX_FMT_NONE) { snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %s", avcodec_get_pix_fmt_name(enc->pix_fmt)); @@ -733,7 +733,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %dx%d, %0.2f fps", enc->width, enc->height, - (float)enc->frame_rate / enc->frame_rate_base); + 1/av_q2d(enc->time_base)); } if (encode) { snprintf(buf + strlen(buf), buf_size - strlen(buf), @@ -929,6 +929,12 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c){ return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); } +int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ + int64_t b= bq.num * (int64_t)cq.den; + int64_t c= cq.num * (int64_t)bq.den; + return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); +} + int64_t ff_gcd(int64_t a, int64_t b){ if(b) return ff_gcd(b, a%b); else return a; |