shithub: libvpx

Download patch

ref: a4c7e92b81737ce4c77ced96ba3c8096e1cfe19e
parent: bbb9ca4535bf0f32706209fd4463e16cc8d42d7a
author: hui su <huisu@google.com>
date: Sun Aug 16 13:24:35 EDT 2015

VP9EncoderConfig -> VP10EncoderConfig

Change-Id: Id691d8a9d4aa137e8de73fe680016fd4fd070e6e

--- a/vp10/encoder/encoder.c
+++ b/vp10/encoder/encoder.c
@@ -614,7 +614,7 @@
 
 static void alloc_raw_frame_buffers(VP10_COMP *cpi) {
   VP10_COMMON *cm = &cpi->common;
-  const VP9EncoderConfig *oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *oxcf = &cpi->oxcf;
 
   if (!cpi->lookahead)
     cpi->lookahead = vp10_lookahead_init(oxcf->width, oxcf->height,
@@ -762,7 +762,7 @@
   cpi->alt_fb_idx = 2;
 }
 
-static void init_config(struct VP10_COMP *cpi, VP9EncoderConfig *oxcf) {
+static void init_config(struct VP10_COMP *cpi, VP10EncoderConfig *oxcf) {
   VP10_COMMON *const cm = &cpi->common;
 
   cpi->oxcf = *oxcf;
@@ -806,7 +806,7 @@
 }
 
 static void set_rc_buffer_sizes(RATE_CONTROL *rc,
-                                const VP9EncoderConfig *oxcf) {
+                                const VP10EncoderConfig *oxcf) {
   const int64_t bandwidth = oxcf->target_bandwidth;
   const int64_t starting = oxcf->starting_buffer_level_ms;
   const int64_t optimal = oxcf->optimal_buffer_level_ms;
@@ -1451,7 +1451,7 @@
                   vpx_calloc(cm->mi_rows * cm->mi_cols, 1));
 }
 
-void vp10_change_config(struct VP10_COMP *cpi, const VP9EncoderConfig *oxcf) {
+void vp10_change_config(struct VP10_COMP *cpi, const VP10EncoderConfig *oxcf) {
   VP10_COMMON *const cm = &cpi->common;
   RATE_CONTROL *const rc = &cpi->rc;
 
@@ -1590,7 +1590,7 @@
 }
 
 
-VP10_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf,
+VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf,
                                 BufferPool *const pool) {
   unsigned int i;
   VP10_COMP *volatile const cpi = vpx_memalign(32, sizeof(VP10_COMP));
@@ -2627,7 +2627,7 @@
                             int high_limit, int low_limit,
                             int q, int maxq, int minq) {
   const RATE_CONTROL *const rc = &cpi->rc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   const int frame_is_kfgfarf = frame_is_kf_gf_arf(cpi);
   int force_recode = 0;
 
@@ -3031,7 +3031,7 @@
 static void set_size_dependent_vars(VP10_COMP *cpi, int *q,
                                     int *bottom_index, int *top_index) {
   VP10_COMMON *const cm = &cpi->common;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
 
   // Setup variables that depend on the dimensions of the frame.
   vp10_set_speed_features_framesize_dependent(cpi);
@@ -3089,7 +3089,7 @@
 static void set_frame_size(VP10_COMP *cpi) {
   int ref_frame;
   VP10_COMMON *const cm = &cpi->common;
-  VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  VP10EncoderConfig *const oxcf = &cpi->oxcf;
   MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
 
   if (oxcf->pass == 2 &&
@@ -3633,7 +3633,7 @@
                                       uint8_t *dest,
                                       unsigned int *frame_flags) {
   VP10_COMMON *const cm = &cpi->common;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   struct segmentation *const seg = &cm->seg;
   TX_SIZE t;
 
@@ -4103,7 +4103,7 @@
 int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
                             size_t *size, uint8_t *dest,
                             int64_t *time_stamp, int64_t *time_end, int flush) {
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   VP10_COMMON *const cm = &cpi->common;
   BufferPool *const pool = cm->buffer_pool;
   RATE_CONTROL *const rc = &cpi->rc;
--- a/vp10/encoder/encoder.h
+++ b/vp10/encoder/encoder.h
@@ -121,7 +121,7 @@
   RESIZE_DYNAMIC = 2  // Coded size of each frame is determined by the codec.
 } RESIZE_TYPE;
 
-typedef struct VP9EncoderConfig {
+typedef struct VP10EncoderConfig {
   BITSTREAM_PROFILE profile;
   vpx_bit_depth_t bit_depth;     // Codec bit-depth.
   int width;  // width of data passed to the compressor
@@ -240,9 +240,9 @@
 #endif
   vpx_color_space_t color_space;
   VP9E_TEMPORAL_LAYERING_MODE temporal_layering_mode;
-} VP9EncoderConfig;
+} VP10EncoderConfig;
 
-static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) {
+static INLINE int is_lossless_requested(const VP10EncoderConfig *cfg) {
   return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0;
 }
 
@@ -296,7 +296,7 @@
   DECLARE_ALIGNED(16, int16_t, y_dequant[QINDEX_RANGE][8]);
   DECLARE_ALIGNED(16, int16_t, uv_dequant[QINDEX_RANGE][8]);
   VP10_COMMON common;
-  VP9EncoderConfig oxcf;
+  VP10EncoderConfig oxcf;
   struct lookahead_ctx    *lookahead;
   struct lookahead_entry  *alt_ref_source;
 
@@ -505,11 +505,11 @@
 
 void vp10_initialize_enc(void);
 
-struct VP10_COMP *vp10_create_compressor(VP9EncoderConfig *oxcf,
+struct VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf,
                                        BufferPool *const pool);
 void vp10_remove_compressor(VP10_COMP *cpi);
 
-void vp10_change_config(VP10_COMP *cpi, const VP9EncoderConfig *oxcf);
+void vp10_change_config(VP10_COMP *cpi, const VP10EncoderConfig *oxcf);
 
   // receive a frames worth of data. caller can assume that a copy of this
   // frame is made and not just a copy of the pointer..
--- a/vp10/encoder/firstpass.c
+++ b/vp10/encoder/firstpass.c
@@ -253,7 +253,7 @@
 #define ACT_AREA_CORRECTION 0.5
 static double calculate_modified_err(const VP10_COMP *cpi,
                                      const TWO_PASS *twopass,
-                                     const VP9EncoderConfig *oxcf,
+                                     const VP10EncoderConfig *oxcf,
                                      const FIRSTPASS_STATS *this_frame) {
   const FIRSTPASS_STATS *const stats = &twopass->total_stats;
   const double av_weight = stats->weight / stats->count;
@@ -276,7 +276,7 @@
 
 // This function returns the maximum target rate per frame.
 static int frame_max_bits(const RATE_CONTROL *rc,
-                          const VP9EncoderConfig *oxcf) {
+                          const VP10EncoderConfig *oxcf) {
   int64_t max_bits = ((int64_t)rc->avg_frame_bandwidth *
                           (int64_t)oxcf->two_pass_vbrmax_section) / 100;
   if (max_bits < 0)
@@ -1183,7 +1183,7 @@
                                      int section_target_bandwidth,
                                      double group_weight_factor) {
   const RATE_CONTROL *const rc = &cpi->rc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
 
   inactive_zone = fclamp(inactive_zone, 0.0, 1.0);
 
@@ -1265,7 +1265,7 @@
 
 void vp10_init_second_pass(VP10_COMP *cpi) {
   SVC *const svc = &cpi->svc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   const int is_two_pass_svc = (svc->number_spatial_layers > 1) ||
                               (svc->number_temporal_layers > 1);
   TWO_PASS *const twopass = is_two_pass_svc ?
@@ -1684,7 +1684,7 @@
 static void allocate_gf_group_bits(VP10_COMP *cpi, int64_t gf_group_bits,
                                    double group_error, int gf_arf_bits) {
   RATE_CONTROL *const rc = &cpi->rc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   TWO_PASS *const twopass = &cpi->twopass;
   GF_GROUP *const gf_group = &twopass->gf_group;
   FIRSTPASS_STATS frame_stats;
@@ -1845,7 +1845,7 @@
 static void define_gf_group(VP10_COMP *cpi, FIRSTPASS_STATS *this_frame) {
   VP10_COMMON *const cm = &cpi->common;
   RATE_CONTROL *const rc = &cpi->rc;
-  VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  VP10EncoderConfig *const oxcf = &cpi->oxcf;
   TWO_PASS *const twopass = &cpi->twopass;
   FIRSTPASS_STATS next_frame;
   const FIRSTPASS_STATS *const start_pos = twopass->stats_in;
@@ -2267,7 +2267,7 @@
   RATE_CONTROL *const rc = &cpi->rc;
   TWO_PASS *const twopass = &cpi->twopass;
   GF_GROUP *const gf_group = &twopass->gf_group;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   const FIRSTPASS_STATS first_frame = *this_frame;
   const FIRSTPASS_STATS *const start_position = twopass->stats_in;
   FIRSTPASS_STATS next_frame;
--- a/vp10/encoder/ratectrl.c
+++ b/vp10/encoder/ratectrl.c
@@ -198,7 +198,7 @@
 
 int vp10_rc_clamp_pframe_target_size(const VP10_COMP *const cpi, int target) {
   const RATE_CONTROL *rc = &cpi->rc;
-  const VP9EncoderConfig *oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *oxcf = &cpi->oxcf;
   const int min_frame_target = MAX(rc->min_frame_bandwidth,
                                    rc->avg_frame_bandwidth >> 5);
   if (target < min_frame_target)
@@ -223,7 +223,7 @@
 
 int vp10_rc_clamp_iframe_target_size(const VP10_COMP *const cpi, int target) {
   const RATE_CONTROL *rc = &cpi->rc;
-  const VP9EncoderConfig *oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *oxcf = &cpi->oxcf;
   if (oxcf->rc_max_intra_bitrate_pct) {
     const int max_rate = rc->avg_frame_bandwidth *
                              oxcf->rc_max_intra_bitrate_pct / 100;
@@ -301,7 +301,7 @@
   return MAX(interval, min_gf_interval);
 }
 
-void vp10_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
+void vp10_rc_init(const VP10EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
   int i;
 
   if (pass == 0 && oxcf->rc_mode == VPX_CBR) {
@@ -359,7 +359,7 @@
 }
 
 int vp10_rc_drop_frame(VP10_COMP *cpi) {
-  const VP9EncoderConfig *oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *oxcf = &cpi->oxcf;
   RATE_CONTROL *const rc = &cpi->rc;
 
   if (!oxcf->drop_frames_water_mark) {
@@ -796,7 +796,7 @@
 }
 
 static int get_active_cq_level(const RATE_CONTROL *rc,
-                               const VP9EncoderConfig *const oxcf) {
+                               const VP10EncoderConfig *const oxcf) {
   static const double cq_adjust_threshold = 0.1;
   int active_cq_level = oxcf->cq_level;
   if (oxcf->rc_mode == VPX_CQ &&
@@ -814,7 +814,7 @@
                                              int *top_index) {
   const VP10_COMMON *const cm = &cpi->common;
   const RATE_CONTROL *const rc = &cpi->rc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   const int cq_level = get_active_cq_level(rc, oxcf);
   int active_best_quality;
   int active_worst_quality = calc_active_worst_quality_one_pass_vbr(cpi);
@@ -983,7 +983,7 @@
                                          int *top_index) {
   const VP10_COMMON *const cm = &cpi->common;
   const RATE_CONTROL *const rc = &cpi->rc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   const GF_GROUP *gf_group = &cpi->twopass.gf_group;
   const int cq_level = get_active_cq_level(rc, oxcf);
   int active_best_quality;
@@ -1267,7 +1267,7 @@
 
 void vp10_rc_postencode_update(VP10_COMP *cpi, uint64_t bytes_used) {
   const VP10_COMMON *const cm = &cpi->common;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   RATE_CONTROL *const rc = &cpi->rc;
   const int qindex = cm->base_qindex;
 
@@ -1439,7 +1439,7 @@
 }
 
 static int calc_pframe_target_size_one_pass_cbr(const VP10_COMP *cpi) {
-  const VP9EncoderConfig *oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *oxcf = &cpi->oxcf;
   const RATE_CONTROL *rc = &cpi->rc;
   const SVC *const svc = &cpi->svc;
   const int64_t diff = rc->optimal_buffer_level - rc->buffer_level;
@@ -1487,7 +1487,7 @@
 
 static int calc_iframe_target_size_one_pass_cbr(const VP10_COMP *cpi) {
   const RATE_CONTROL *rc = &cpi->rc;
-  const VP9EncoderConfig *oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *oxcf = &cpi->oxcf;
   const SVC *const svc = &cpi->svc;
   int target;
   if (cpi->common.current_video_frame == 0) {
@@ -1688,7 +1688,7 @@
 
 void vp10_rc_set_gf_interval_range(const VP10_COMP *const cpi,
                                   RATE_CONTROL *const rc) {
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
 
   // Set Maximum gf/arf interval
   rc->max_gf_interval = oxcf->max_gf_interval;
@@ -1717,7 +1717,7 @@
 
 void vp10_rc_update_framerate(VP10_COMP *cpi) {
   const VP10_COMMON *const cm = &cpi->common;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   RATE_CONTROL *const rc = &cpi->rc;
   int vbr_max_bits;
 
--- a/vp10/encoder/ratectrl.h
+++ b/vp10/encoder/ratectrl.h
@@ -145,9 +145,9 @@
 } RATE_CONTROL;
 
 struct VP10_COMP;
-struct VP9EncoderConfig;
+struct VP10EncoderConfig;
 
-void vp10_rc_init(const struct VP9EncoderConfig *oxcf, int pass,
+void vp10_rc_init(const struct VP10EncoderConfig *oxcf, int pass,
                  RATE_CONTROL *rc);
 
 int vp10_estimate_bits_at_q(FRAME_TYPE frame_kind, int q, int mbs,
--- a/vp10/encoder/speed_features.c
+++ b/vp10/encoder/speed_features.c
@@ -404,7 +404,7 @@
 
 void vp10_set_speed_features_framesize_dependent(VP10_COMP *cpi) {
   SPEED_FEATURES *const sf = &cpi->sf;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   RD_OPT *const rd = &cpi->rd;
   int i;
 
@@ -435,7 +435,7 @@
   SPEED_FEATURES *const sf = &cpi->sf;
   VP10_COMMON *const cm = &cpi->common;
   MACROBLOCK *const x = &cpi->td.mb;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   int i;
 
   // best quality defaults
--- a/vp10/encoder/svc_layercontext.c
+++ b/vp10/encoder/svc_layercontext.c
@@ -20,7 +20,7 @@
 
 void vp10_init_layer_context(VP10_COMP *const cpi) {
   SVC *const svc = &cpi->svc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   int sl, tl;
   int alt_ref_idx = svc->number_spatial_layers;
 
@@ -106,7 +106,7 @@
 void vp10_update_layer_context_change_config(VP10_COMP *const cpi,
                                             const int target_bandwidth) {
   SVC *const svc = &cpi->svc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   const RATE_CONTROL *const rc = &cpi->rc;
   int sl, tl, layer = 0, spatial_layer_target;
   float bitrate_alloc = 1.0;
@@ -204,7 +204,7 @@
 
 void vp10_update_temporal_layer_framerate(VP10_COMP *const cpi) {
   SVC *const svc = &cpi->svc;
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   LAYER_CONTEXT *const lc = get_layer_context(cpi);
   RATE_CONTROL *const lrc = &lc->rc;
   // Index into spatial+temporal arrays.
@@ -231,7 +231,7 @@
 
 void vp10_update_spatial_layer_framerate(VP10_COMP *const cpi,
                                          double framerate) {
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   LAYER_CONTEXT *const lc = get_layer_context(cpi);
   RATE_CONTROL *const lrc = &lc->rc;
 
@@ -262,7 +262,7 @@
 }
 
 void vp10_save_layer_context(VP10_COMP *const cpi) {
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   LAYER_CONTEXT *const lc = get_layer_context(cpi);
 
   lc->rc = cpi->rc;
--- a/vp10/encoder/temporal_filter.c
+++ b/vp10/encoder/temporal_filter.c
@@ -591,7 +591,7 @@
 static void adjust_arnr_filter(VP10_COMP *cpi,
                                int distance, int group_boost,
                                int *arnr_frames, int *arnr_strength) {
-  const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const VP10EncoderConfig *const oxcf = &cpi->oxcf;
   const int frames_after_arf =
       vp10_lookahead_depth(cpi->lookahead) - distance - 1;
   int frames_fwd = (cpi->oxcf.arnr_max_frames - 1) >> 1;
--- a/vp10/vp10_cx_iface.c
+++ b/vp10/vp10_cx_iface.c
@@ -76,12 +76,12 @@
 struct vpx_codec_alg_priv {
   vpx_codec_priv_t        base;
   vpx_codec_enc_cfg_t     cfg;
-  struct vp10_extracfg     extra_cfg;
-  VP9EncoderConfig        oxcf;
+  struct vp10_extracfg    extra_cfg;
+  VP10EncoderConfig       oxcf;
   VP10_COMP               *cpi;
-  unsigned char          *cx_data;
+  unsigned char           *cx_data;
   size_t                  cx_data_sz;
-  unsigned char          *pending_cx_data;
+  unsigned char           *pending_cx_data;
   size_t                  pending_cx_data_sz;
   int                     pending_frame_count;
   size_t                  pending_frame_sizes[8];
@@ -90,7 +90,7 @@
   vpx_enc_frame_flags_t   next_frame_flags;
   vp8_postproc_cfg_t      preview_ppcfg;
   vpx_codec_pkt_list_decl(256) pkt_list;
-  unsigned int                 fixed_kf_cntr;
+  unsigned int            fixed_kf_cntr;
   vpx_codec_priv_output_cx_pkt_cb_pair_t output_cx_pkt_cb;
   // BufferPool that holds all reference frames.
   BufferPool              *buffer_pool;
@@ -377,7 +377,7 @@
 }
 
 static vpx_codec_err_t set_encoder_config(
-  VP9EncoderConfig *oxcf,
+  VP10EncoderConfig *oxcf,
   const vpx_codec_enc_cfg_t *cfg,
   const struct vp10_extracfg *extra_cfg) {
   const int is_vbr = cfg->rc_end_usage == VPX_VBR;