Mercurial > libavcodec.hg
diff mpegvideo.h @ 3789:730ad999e379 libavcodec
Move the ratecontrol related code from mpegvideo.h to a separate header file.
author | takis |
---|---|
date | Fri, 29 Sep 2006 19:39:19 +0000 |
parents | 616a81d04758 |
children | 16ace038f452 |
line wrap: on
line diff
--- a/mpegvideo.h Fri Sep 29 19:36:12 2006 +0000 +++ b/mpegvideo.h Fri Sep 29 19:39:19 2006 +0000 @@ -28,6 +28,7 @@ #include "dsputil.h" #include "bitstream.h" +#include "ratecontrol.h" #define FRAME_SKIPPED 100 ///< return value for header parsers if frame is not coded @@ -72,60 +73,6 @@ #define INPLACE_OFFSET 16 -typedef struct Predictor{ - double coeff; - double count; - double decay; -} Predictor; - -typedef struct RateControlEntry{ - int pict_type; - float qscale; - int mv_bits; - int i_tex_bits; - int p_tex_bits; - int misc_bits; - int header_bits; - uint64_t expected_bits; - int new_pict_type; - float new_qscale; - int mc_mb_var_sum; - int mb_var_sum; - int i_count; - int skip_count; - int f_code; - int b_code; -}RateControlEntry; - -/** - * rate control context. - */ -typedef struct RateControlContext{ - FILE *stats_file; - int num_entries; ///< number of RateControlEntries - RateControlEntry *entry; - double buffer_index; ///< amount of bits in the video/audio buffer - Predictor pred[5]; - double short_term_qsum; ///< sum of recent qscales - double short_term_qcount; ///< count of recent qscales - double pass1_rc_eq_output_sum;///< sum of the output of the rc equation, this is used for normalization - double pass1_wanted_bits; ///< bits which should have been outputed by the pass1 code (including complexity init) - double last_qscale; - double last_qscale_for[5]; ///< last qscale for a specific pict type, used for max_diff & ipb factor stuff - int last_mc_mb_var_sum; - int last_mb_var_sum; - uint64_t i_cplx_sum[5]; - uint64_t p_cplx_sum[5]; - uint64_t mv_bits_sum[5]; - uint64_t qscale_sum[5]; - int frame_count[5]; - int last_non_b_pict_type; - - void *non_lavc_opaque; ///< context for non lavc rc code (for example xvid) - float dry_run_qscale; ///< for xvid rc - int last_picture_number; ///< for xvid rc -}RateControlContext; - /** * Scantable. */ @@ -986,16 +933,5 @@ void ff_mjpeg_stuffing(PutBitContext * pbc); -/* rate control */ -int ff_rate_control_init(MpegEncContext *s); -float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run); -void ff_write_pass1_stats(MpegEncContext *s); -void ff_rate_control_uninit(MpegEncContext *s); -int ff_vbv_update(MpegEncContext *s, int frame_size); -void ff_get_2pass_fcode(MpegEncContext *s); +#endif /* AVCODEC_MPEGVIDEO_H */ -int ff_xvid_rate_control_init(MpegEncContext *s); -void ff_xvid_rate_control_uninit(MpegEncContext *s); -float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run); - -#endif /* AVCODEC_MPEGVIDEO_H */