diff options
author | Adrian Grange <agrange@google.com> | 2015-05-12 17:48:14 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-05-12 17:48:16 +0000 |
commit | 17fc3e94c982319fb5da553bf2d22acd9bc3c498 (patch) | |
tree | f55d48e8427ec7eb347fd91ce4e663775ca03b2b | |
parent | 465ce0e42067ad85019fe1f2f98bf5b081c89880 (diff) | |
parent | 65b768fdf9e7dd0402beedd2513cc1e590c7443e (diff) | |
download | libvpx-17fc3e94c982319fb5da553bf2d22acd9bc3c498.tar.gz libvpx-17fc3e94c982319fb5da553bf2d22acd9bc3c498.tar.bz2 libvpx-17fc3e94c982319fb5da553bf2d22acd9bc3c498.zip |
Merge "Recompute tile params on frame resize"
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 5d500e99c..1f2ae0da6 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -685,6 +685,27 @@ void vp9_alloc_compressor_data(VP9_COMP *cpi) { vp9_setup_pc_tree(&cpi->common, &cpi->td); } +void vp9_new_framerate(VP9_COMP *cpi, double framerate) { + cpi->framerate = framerate < 0.1 ? 30 : framerate; + vp9_rc_update_framerate(cpi); +} + +static void set_tile_limits(VP9_COMP *cpi) { + VP9_COMMON *const cm = &cpi->common; + + int min_log2_tile_cols, max_log2_tile_cols; + vp9_get_tile_n_bits(cm->mi_cols, &min_log2_tile_cols, &max_log2_tile_cols); + + if (is_two_pass_svc(cpi) && cpi->svc.encode_empty_frame_state == ENCODING) { + cm->log2_tile_cols = 0; + cm->log2_tile_rows = 0; + } else { + cm->log2_tile_cols = clamp(cpi->oxcf.tile_columns, + min_log2_tile_cols, max_log2_tile_cols); + cm->log2_tile_rows = cpi->oxcf.tile_rows; + } +} + static void update_frame_size(VP9_COMP *cpi) { VP9_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &cpi->td.mb.e_mbd; @@ -693,6 +714,8 @@ static void update_frame_size(VP9_COMP *cpi) { vp9_init_context_buffers(cm); init_macroblockd(cm, xd); + set_tile_limits(cpi); + if (is_two_pass_svc(cpi)) { if (vp9_realloc_frame_buffer(&cpi->alt_ref_buffer, cm->width, cm->height, @@ -707,27 +730,6 @@ static void update_frame_size(VP9_COMP *cpi) { } } -void vp9_new_framerate(VP9_COMP *cpi, double framerate) { - cpi->framerate = framerate < 0.1 ? 30 : framerate; - vp9_rc_update_framerate(cpi); -} - -static void set_tile_limits(VP9_COMP *cpi) { - VP9_COMMON *const cm = &cpi->common; - - int min_log2_tile_cols, max_log2_tile_cols; - vp9_get_tile_n_bits(cm->mi_cols, &min_log2_tile_cols, &max_log2_tile_cols); - - if (is_two_pass_svc(cpi) && cpi->svc.encode_empty_frame_state == ENCODING) { - cm->log2_tile_cols = 0; - cm->log2_tile_rows = 0; - } else { - cm->log2_tile_cols = clamp(cpi->oxcf.tile_columns, - min_log2_tile_cols, max_log2_tile_cols); - cm->log2_tile_rows = cpi->oxcf.tile_rows; - } -} - static void init_buffer_indices(VP9_COMP *cpi) { cpi->lst_fb_idx = 0; cpi->gld_fb_idx = 1; |