Commit cd95543e authored by Paul Wilkins's avatar Paul Wilkins
Browse files

Move call to vp9_rc_get_second_pass_params().

Call to vp9_rc_get_second_pass_params() moved from
Pass2Encode() to earlier in vp9_get_compressed_data(),
to ensure that two pass stats and parameters are
available before decisions such as frame scaling.

Change-Id: If21537f0073919b04696a7d5e9aac78e23d76f39
Showing with 6 additions and 3 deletions
...@@ -2397,10 +2397,7 @@ static void Pass0Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest, ...@@ -2397,10 +2397,7 @@ static void Pass0Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
static void Pass2Encode(VP9_COMP *cpi, size_t *size, static void Pass2Encode(VP9_COMP *cpi, size_t *size,
uint8_t *dest, unsigned int *frame_flags) { uint8_t *dest, unsigned int *frame_flags) {
cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED; cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED;
vp9_rc_get_second_pass_params(cpi);
encode_frame_to_data_rate(cpi, size, dest, frame_flags); encode_frame_to_data_rate(cpi, size, dest, frame_flags);
vp9_twopass_postencode_update(cpi); vp9_twopass_postencode_update(cpi);
} }
...@@ -2724,6 +2721,12 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, ...@@ -2724,6 +2721,12 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
cm->frame_bufs[cm->new_fb_idx].ref_count--; cm->frame_bufs[cm->new_fb_idx].ref_count--;
cm->new_fb_idx = get_free_fb(cm); cm->new_fb_idx = get_free_fb(cm);
// For two pass encodes analyse the first pass stats and determine
// the bit allocation and other parameters for this frame / group of frames.
if ((oxcf->pass == 2) && (!cpi->use_svc || is_two_pass_svc(cpi))) {
vp9_rc_get_second_pass_params(cpi);
}
if (!cpi->use_svc && cpi->multi_arf_allowed) { if (!cpi->use_svc && cpi->multi_arf_allowed) {
if (cm->frame_type == KEY_FRAME) { if (cm->frame_type == KEY_FRAME) {
init_buffer_indices(cpi); init_buffer_indices(cpi);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment