History

Merge "VP9 firstpass: Bugfix when mi_col_start/end is odd"

Urvang Joshi committed 7 years ago

Commit b625feb2 parents 3271a7e ad57c721 file · +10 −11Browse files

Unified · Split

vp9/encoder/vp9_firstpass.c+10−11
@@ -820,6 +820,8 @@ void vp9_first_pass_encode_tile_mb_row(VP9_COMP *cpi, ThreadData *td, · 819 unmodified lines
820820 VP9_COMMON *const cm = &cpi->common;
821821 MACROBLOCKD *const xd = &x->e_mbd;
822822 TileInfo tile = tile_data->tile_info;
823+ const int mb_col_start = ROUND_POWER_OF_TWO(tile.mi_col_start, 1);
824+ const int mb_col_end = ROUND_POWER_OF_TWO(tile.mi_col_end, 1);
823825 struct macroblock_plane *const p = x->plane;
824826 struct macroblockd_plane *const pd = xd->plane;
825827 const PICK_MODE_CONTEXT *ctx = &td->pc_root->none;
@@ -846,9 +848,8 @@ void vp9_first_pass_encode_tile_mb_row(VP9_COMP *cpi, ThreadData *td, · 20 unmodified lines
846848 assert(new_yv12 != NULL);
847849 assert(frame_is_intra_only(cm) || (lst_yv12 != NULL));
848850
849− xd->mi = cm->mi_grid_visible + xd->mi_stride * (mb_row << 1) +
850− (tile.mi_col_start >> 1);
851− xd->mi[0] = cm->mi + xd->mi_stride * (mb_row << 1) + (tile.mi_col_start >> 1);
851+ xd->mi = cm->mi_grid_visible + xd->mi_stride * (mb_row << 1) + mb_col_start;
852+ xd->mi[0] = cm->mi + xd->mi_stride * (mb_row << 1) + mb_col_start;
852853
853854 for (i = 0; i < MAX_MB_PLANE; ++i) {
854855 p[i].coeff = ctx->coeff_pbuf[i][1];
@@ -862,10 +863,9 @@ void vp9_first_pass_encode_tile_mb_row(VP9_COMP *cpi, ThreadData *td, · 7 unmodified lines
862863 uv_mb_height = 16 >> (new_yv12->y_height > new_yv12->uv_height);
863864
864865 // Reset above block coeffs.
865− recon_yoffset =
866− (mb_row * recon_y_stride * 16) + (tile.mi_col_start >> 1) * 16;
867− recon_uvoffset = (mb_row * recon_uv_stride * uv_mb_height) +
868− (tile.mi_col_start >> 1) * uv_mb_height;
866+ recon_yoffset = (mb_row * recon_y_stride * 16) + mb_col_start * 16;
867+ recon_uvoffset =
868+ (mb_row * recon_uv_stride * uv_mb_height) + mb_col_start * uv_mb_height;
869869
870870 // Set up limit values for motion vectors to prevent them extending
871871 // outside the UMV borders.
@@ -873,8 +873,7 @@ void vp9_first_pass_encode_tile_mb_row(VP9_COMP *cpi, ThreadData *td, · 1 unmodified line
873873 x->mv_limits.row_max =
874874 ((cm->mb_rows - 1 - mb_row) * 16) + BORDER_MV_PIXELS_B16;
875875
876− for (mb_col = tile.mi_col_start >> 1, c = 0; mb_col < (tile.mi_col_end >> 1);
877− ++mb_col, c++) {
876+ for (mb_col = mb_col_start, c = 0; mb_col < mb_col_end; ++mb_col, c++) {
878877 int this_error;
879878 int this_intra_error;
880879 const int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row);
@@ -920,7 +919,7 @@ void vp9_first_pass_encode_tile_mb_row(VP9_COMP *cpi, ThreadData *td, · 39 unmodified lines
920919 x->skip_encode = 0;
921920 x->fp_src_pred = 0;
922921 // Do intra prediction based on source pixels for tile boundaries
923− if ((mb_col == (tile.mi_col_start >> 1)) && mb_col != 0) {
922+ if (mb_col == mb_col_start && mb_col != 0) {
924923 xd->left_mi = &mi_left;
925924 x->fp_src_pred = 1;
926925 }
@@ -1310,7 +1309,7 @@ void vp9_first_pass_encode_tile_mb_row(VP9_COMP *cpi, ThreadData *td, · 383 unmodified lines
13101309 recon_uvoffset += uv_mb_height;
13111310
13121311 // Accumulate row level stats to the corresponding tile stats
1313− if (cpi->row_mt && mb_col == (tile.mi_col_end >> 1) - 1)
1312+ if (cpi->row_mt && mb_col == mb_col_end - 1)
13141313 accumulate_fp_mb_row_stat(tile_data, fp_acc_data);
13151314
13161315 (*(cpi->row_mt_sync_write_ptr))(&tile_data->row_mt_sync, mb_row, c,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t