diff options
author | Yaowu Xu <yaowu@google.com> | 2014-08-18 09:40:16 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2014-08-18 09:40:16 -0700 |
commit | cfd53a24796c6524475a767bfe072136de705f69 (patch) | |
tree | c10dd8a0ad3ae9a593713abb394b2730a36e0794 /vp9/encoder | |
parent | 0e119457549fa7c295554890c875052bb21c9d8a (diff) | |
parent | beff5b6aa4e8d33bc25d5ae84f743c9fd9656d20 (diff) | |
download | libvpx-cfd53a24796c6524475a767bfe072136de705f69.tar libvpx-cfd53a24796c6524475a767bfe072136de705f69.tar.gz libvpx-cfd53a24796c6524475a767bfe072136de705f69.tar.bz2 libvpx-cfd53a24796c6524475a767bfe072136de705f69.zip |
Merge "Revert "Removing duplicated code from init_config().""
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 22 | ||||
-rw-r--r-- | vp9/encoder/vp9_encoder.h | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 56bce612d..1405bf329 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -451,7 +451,7 @@ static void alloc_util_frame_buffers(VP9_COMP *cpi) { "Failed to allocate scaled last source buffer"); } -static void alloc_compressor_data(VP9_COMP *cpi) { +void vp9_alloc_compressor_data(VP9_COMP *cpi) { VP9_COMMON *cm = &cpi->common; vp9_alloc_context_buffers(cm, cm->width, cm->height); @@ -463,7 +463,7 @@ static void alloc_compressor_data(VP9_COMP *cpi) { CHECK_MEM_ERROR(cm, cpi->tok, vpx_calloc(tokens, sizeof(*cpi->tok))); } - vp9_setup_pc_tree(cm, cpi); + vp9_setup_pc_tree(&cpi->common, cpi); } static void update_frame_size(VP9_COMP *cpi) { @@ -519,17 +519,18 @@ static void init_config(struct VP9_COMP *cpi, VP9EncoderConfig *oxcf) { 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; - alloc_compressor_data(cpi); + vp9_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 && @@ -539,14 +540,23 @@ static void init_config(struct VP9_COMP *cpi, VP9EncoderConfig *oxcf) { 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) { VP9_COMMON *const cm = &cpi->common; RATE_CONTROL *const rc = &cpi->rc; - cm->profile = oxcf->profile; + if (cm->profile != oxcf->profile) + cm->profile = oxcf->profile; cm->bit_depth = oxcf->bit_depth; if (cm->profile <= PROFILE_1) diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h index aca0eaa85..33e9adbae 100644 --- a/vp9/encoder/vp9_encoder.h +++ b/vp9/encoder/vp9_encoder.h @@ -514,6 +514,8 @@ static INLINE int get_token_alloc(int mb_rows, int mb_cols) { 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); |