diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-07-20 16:12:33 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-07-20 18:59:36 +0200 |
commit | 44972e227df0f7ad5aa9004d971fb54e9dc5c849 (patch) | |
tree | e9e761668e2db86e96e4b9901b994b172df95f00 /libavcodec/mpegvideo_enc.c | |
parent | b4bb9593834460bbbe0e70823f2c503cb01ad052 (diff) | |
download | ffmpeg-streaming-44972e227df0f7ad5aa9004d971fb54e9dc5c849.zip ffmpeg-streaming-44972e227df0f7ad5aa9004d971fb54e9dc5c849.tar.gz |
ratecontrol: Move mpegenc-only function where it is used
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 2667f3b..4e0fae8 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1671,6 +1671,28 @@ static int frame_start(MpegEncContext *s) return 0; } +static void write_pass1_stats(MpegEncContext *s) +{ + snprintf(s->avctx->stats_out, 256, + "in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d " + "fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d " + "hbits:%d;\n", + s->current_picture_ptr->f->display_picture_number, + s->current_picture_ptr->f->coded_picture_number, + s->pict_type, + s->current_picture.f->quality, + s->i_tex_bits, + s->p_tex_bits, + s->mv_bits, + s->misc_bits, + s->f_code, + s->b_code, + s->current_picture.mc_mb_var_sum, + s->current_picture.mb_var_sum, + s->i_count, s->skip_count, + s->header_bits); +} + int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic_arg, int *got_packet) { @@ -1783,7 +1805,7 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (s->avctx->flags & AV_CODEC_FLAG_PASS1) - ff_write_pass1_stats(s); + write_pass1_stats(s); for (i = 0; i < 4; i++) { s->current_picture_ptr->encoding_error[i] = s->current_picture.encoding_error[i]; |