1 /*
2 * Ratecontrol
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4 * Copyright (c) 2002-2004 Michael Niedermayer
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #ifndef AVCODEC_RATECONTROL_H
24 #define AVCODEC_RATECONTROL_H
25
26 /**
27 * @file
28 * ratecontrol header.
29 */
30
31 #include <stdio.h>
32 #include <stdint.h>
34
40
59
60 /**
61 * rate control context.
62 */
71 double pass1_wanted_bits;
///< bits which should have been output by the pass1 code (including complexity init)
73 double last_qscale_for[5];
///< last qscale for a specific pict type, used for max_diff & ipb factor stuff
82
88
90
91 /* rate control */
98
99 #endif /* AVCODEC_RATECONTROL_H */
double pass1_rc_eq_output_sum
sum of the output of the rc equation, this is used for normalization
void ff_write_pass1_stats(struct MpegEncContext *s)
int num_entries
number of RateControlEntries
float dry_run_qscale
for xvid rc
double pass1_wanted_bits
bits which should have been output by the pass1 code (including complexity init)
void ff_rate_control_uninit(struct MpegEncContext *s)
double buffer_index
amount of bits in the video/audio buffer
int64_t last_mc_mb_var_sum
int ff_vbv_update(struct MpegEncContext *s, int frame_size)
int ff_rate_control_init(struct MpegEncContext *s)
int last_picture_number
for xvid rc
double last_qscale_for[5]
last qscale for a specific pict type, used for max_diff & ipb factor stuff
double short_term_qsum
sum of recent qscales
void * non_lavc_opaque
context for non lavc rc code (for example xvid)
float ff_rate_estimate_qscale(struct MpegEncContext *s, int dry_run)
void ff_get_2pass_fcode(struct MpegEncContext *s)
double short_term_qcount
count of recent qscales
simple arithmetic expression evaluator