summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_firstpass.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/encoder/vp9_firstpass.c')
-rw-r--r--vp9/encoder/vp9_firstpass.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index caf41625c..6a3555d68 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -481,13 +481,14 @@ void vp9_first_pass(VP9_COMP *cpi) {
MACROBLOCK *const x = &cpi->mb;
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
+ TileInfo tile;
int recon_yoffset, recon_uvoffset;
const int lst_yv12_idx = cm->ref_frame_map[cpi->lst_fb_idx];
const int gld_yv12_idx = cm->ref_frame_map[cpi->gld_fb_idx];
YV12_BUFFER_CONFIG *const lst_yv12 = &cm->yv12_fb[lst_yv12_idx];
- YV12_BUFFER_CONFIG *const new_yv12 = &cm->yv12_fb[cm->new_fb_idx];
YV12_BUFFER_CONFIG *const gld_yv12 = &cm->yv12_fb[gld_yv12_idx];
+ YV12_BUFFER_CONFIG *const new_yv12 = get_frame_new_buffer(cm);
const int recon_y_stride = lst_yv12->y_stride;
const int recon_uv_stride = lst_yv12->uv_stride;
int64_t intra_error = 0;
@@ -532,6 +533,9 @@ void vp9_first_pass(VP9_COMP *cpi) {
vp9_initialize_rd_consts(cpi);
}
+ // tiling is ignored in the first pass
+ vp9_tile_init(&tile, cm, 0, 0);
+
// for each macroblock row in image
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) {
int_mv best_ref_mv;
@@ -578,11 +582,12 @@ void vp9_first_pass(VP9_COMP *cpi) {
}
}
xd->mi_8x8[0]->mbmi.ref_frame[0] = INTRA_FRAME;
- set_mi_row_col(cm, xd,
+ set_mi_row_col(xd, &tile,
mb_row << 1,
- 1 << mi_height_log2(xd->mi_8x8[0]->mbmi.sb_type),
+ num_8x8_blocks_high_lookup[xd->mi_8x8[0]->mbmi.sb_type],
mb_col << 1,
- 1 << mi_width_log2(xd->mi_8x8[0]->mbmi.sb_type));
+ num_8x8_blocks_wide_lookup[xd->mi_8x8[0]->mbmi.sb_type],
+ cm->mi_rows, cm->mi_cols);
if (cpi->sf.variance_adaptive_quantization) {
int energy = vp9_block_energy(cpi, x, xd->mi_8x8[0]->mbmi.sb_type);
@@ -2164,17 +2169,14 @@ void vp9_second_pass(VP9_COMP *cpi) {
cpi->ni_av_qi = tmp_q;
cpi->avg_q = vp9_convert_qindex_to_q(tmp_q);
-#ifndef ONE_SHOT_Q_ESTIMATE
// Limit the maxq value returned subsequently.
// This increases the risk of overspend or underspend if the initial
// estimate for the clip is bad, but helps prevent excessive
// variation in Q, especially near the end of a clip
// where for example a small overspend may cause Q to crash
adjust_maxq_qrange(cpi);
-#endif
}
-#ifndef ONE_SHOT_Q_ESTIMATE
// The last few frames of a clip almost always have to few or too many
// bits and for the sake of over exact rate control we dont want to make
// radical adjustments to the allowed quantizer range just to use up a
@@ -2197,7 +2199,6 @@ void vp9_second_pass(VP9_COMP *cpi) {
cpi->active_worst_quality =
adjust_active_maxq(cpi->active_worst_quality, tmp_q);
}
-#endif
}
vp9_zero(this_frame);
if (EOF == input_stats(cpi, &this_frame))