shithub: libvpx

Download patch

ref: 5509b7fd8fe6ad3555831b8d49077182daf92758
parent: fa8de273e771bb0af79a226ba1dc34da02d0955c
author: Dmitry Kovalev <[email protected]>
date: Fri Aug 15 10:25:00 EDT 2014

Removing duplicated code from init_config().

Change-Id: I50f4485cfbdaadc3084aa5bc63bf3a2f15a0d903

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -451,7 +451,7 @@
                        "Failed to allocate scaled last source buffer");
 }
 
-void vp9_alloc_compressor_data(VP9_COMP *cpi) {
+static void alloc_compressor_data(VP9_COMP *cpi) {
   VP9_COMMON *cm = &cpi->common;
 
   vp9_alloc_context_buffers(cm, cm->width, cm->height);
@@ -463,7 +463,7 @@
     CHECK_MEM_ERROR(cm, cpi->tok, vpx_calloc(tokens, sizeof(*cpi->tok)));
   }
 
-  vp9_setup_pc_tree(&cpi->common, cpi);
+  vp9_setup_pc_tree(cm, cpi);
 }
 
 static void update_frame_size(VP9_COMP *cpi) {
@@ -519,18 +519,17 @@
 
   cpi->oxcf = *oxcf;
   cpi->framerate = oxcf->init_framerate;
+  cpi->static_mb_pct = 0;
+  cpi->ref_frame_flags = 0;
 
   cm->profile = oxcf->profile;
   cm->bit_depth = oxcf->bit_depth;
   cm->color_space = UNKNOWN;
-
   cm->width = oxcf->width;
   cm->height = oxcf->height;
-  vp9_alloc_compressor_data(cpi);
+  alloc_compressor_data(cpi);
 
-  // Spatial scalability.
   cpi->svc.number_spatial_layers = oxcf->ss_number_layers;
-  // Temporal scalability.
   cpi->svc.number_temporal_layers = oxcf->ts_number_layers;
 
   if ((cpi->svc.number_temporal_layers > 1 &&
@@ -540,15 +539,7 @@
     vp9_init_layer_context(cpi);
   }
 
-  // change includes all joint functionality
   vp9_change_config(cpi, oxcf);
-
-  cpi->static_mb_pct = 0;
-  cpi->ref_frame_flags = 0;
-
-  init_buffer_indices(cpi);
-
-  set_tile_limits(cpi);
 }
 
 void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
@@ -555,8 +546,7 @@
   VP9_COMMON *const cm = &cpi->common;
   RATE_CONTROL *const rc = &cpi->rc;
 
-  if (cm->profile != oxcf->profile)
-    cm->profile = oxcf->profile;
+  cm->profile = oxcf->profile;
   cm->bit_depth = oxcf->bit_depth;
 
   if (cm->profile <= PROFILE_1)
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -514,8 +514,6 @@
 
 int vp9_get_y_sse(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b);
 
-void vp9_alloc_compressor_data(VP9_COMP *cpi);
-
 void vp9_scale_references(VP9_COMP *cpi);
 
 void vp9_update_reference_frames(VP9_COMP *cpi);