Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: source/libvpx/vp9/encoder/vp9_ratectrl.h

Issue 232133009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_quantize.c ('k') | source/libvpx/vp9/encoder/vp9_ratectrl.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_ratectrl.h
===================================================================
--- source/libvpx/vp9/encoder/vp9_ratectrl.h (revision 263011)
+++ source/libvpx/vp9/encoder/vp9_ratectrl.h (working copy)
@@ -12,12 +12,19 @@
#ifndef VP9_ENCODER_VP9_RATECTRL_H_
#define VP9_ENCODER_VP9_RATECTRL_H_
+#include "vpx/vpx_integer.h"
+
+#include "vp9/common/vp9_blockd.h"
+
#ifdef __cplusplus
extern "C" {
#endif
#define FRAME_OVERHEAD_BITS 200
+// Bits Per MB at different Q (Multiplied by 512)
+#define BPER_MB_NORMBITS 9
+
typedef struct {
// Rate targetting variables
int this_frame_target;
@@ -37,6 +44,7 @@
int frames_since_golden;
int frames_till_gf_update_due;
int max_gf_interval;
+ int static_scene_max_gf_interval;
int baseline_gf_interval;
int frames_to_key;
int frames_since_key;
@@ -53,7 +61,7 @@
int ni_av_qi;
int ni_tot_qi;
int ni_frames;
- int avg_frame_qindex[3]; // 0 - KEY, 1 - INTER, 2 - ARF/GF
+ int avg_frame_qindex[3]; // 0 - KEY, 1 - INTER, 2 - ARF/GF
double tot_q;
double avg_q;
@@ -70,7 +78,8 @@
int long_rolling_actual_bits;
int64_t total_actual_bits;
- int total_target_vs_actual; // debug stats
+ int64_t total_target_bits;
+ int64_t total_target_vs_actual;
int worst_quality;
int best_quality;
@@ -78,17 +87,13 @@
} RATE_CONTROL;
struct VP9_COMP;
+struct VP9_CONFIG;
-void vp9_save_coding_context(struct VP9_COMP *cpi);
-void vp9_restore_coding_context(struct VP9_COMP *cpi);
+void vp9_rc_init(const struct VP9_CONFIG *oxcf, int pass, RATE_CONTROL *rc);
-void vp9_setup_key_frame(struct VP9_COMP *cpi);
-void vp9_setup_inter_frame(struct VP9_COMP *cpi);
-
double vp9_convert_qindex_to_q(int qindex);
-// initialize luts for minq
-void vp9_rc_init_minq_luts(void);
+void vp9_rc_init_minq_luts();
// Generally at the high level, the following flow is expected
// to be enforced for rate control:
@@ -161,6 +166,15 @@
// This function is called only from the vp9_rc_get_..._params() functions.
void vp9_rc_set_frame_target(struct VP9_COMP *cpi, int target);
+// Computes a q delta (in "q index" terms) to get from a starting q value
+// to a target q value
+int vp9_compute_qdelta(const RATE_CONTROL *rc, double qstart, double qtarget);
+
+// Computes a q delta (in "q index" terms) to get from a starting q value
+// to a value that should equate to the given rate ratio.
+int vp9_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type,
+ int qindex, double rate_target_ratio);
+
#ifdef __cplusplus
} // extern "C"
#endif
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_quantize.c ('k') | source/libvpx/vp9/encoder/vp9_ratectrl.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698