VP9: remove x_mis, y_mis calculations
Passed as arguments instead. Change-Id: I884a90baedf772692372e6e3520702c04a968f44
This commit is contained in:
parent
6261fcf307
commit
6c0ce09029
@ -149,17 +149,12 @@ static int read_intra_segment_id(VP9_COMMON *const cm, int mi_offset,
|
||||
}
|
||||
|
||||
static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||
int mi_row, int mi_col, vpx_reader *r) {
|
||||
int mi_row, int mi_col, vpx_reader *r,
|
||||
int x_mis, int y_mis) {
|
||||
struct segmentation *const seg = &cm->seg;
|
||||
MODE_INFO *const mi = xd->mi[0];
|
||||
int predicted_segment_id, segment_id;
|
||||
const int mi_offset = mi_row * cm->mi_cols + mi_col;
|
||||
const int bw = xd->plane[0].n4_w >> 1;
|
||||
const int bh = xd->plane[0].n4_h >> 1;
|
||||
|
||||
// TODO(slavarnway): move x_mis, y_mis into xd ?????
|
||||
const int x_mis = VPXMIN(cm->mi_cols - mi_col, bw);
|
||||
const int y_mis = VPXMIN(cm->mi_rows - mi_row, bh);
|
||||
|
||||
if (!seg->enabled)
|
||||
return 0; // Default for disabled segmentation
|
||||
@ -202,19 +197,14 @@ static int read_skip(VP9_COMMON *cm, const MACROBLOCKD *xd,
|
||||
|
||||
static void read_intra_frame_mode_info(VP9_COMMON *const cm,
|
||||
MACROBLOCKD *const xd,
|
||||
int mi_row, int mi_col, vpx_reader *r) {
|
||||
int mi_row, int mi_col, vpx_reader *r,
|
||||
int x_mis, int y_mis) {
|
||||
MODE_INFO *const mi = xd->mi[0];
|
||||
const MODE_INFO *above_mi = xd->above_mi;
|
||||
const MODE_INFO *left_mi = xd->left_mi;
|
||||
const BLOCK_SIZE bsize = mi->sb_type;
|
||||
int i;
|
||||
const int mi_offset = mi_row * cm->mi_cols + mi_col;
|
||||
const int bw = xd->plane[0].n4_w >> 1;
|
||||
const int bh = xd->plane[0].n4_h >> 1;
|
||||
|
||||
// TODO(slavarnway): move x_mis, y_mis into xd ?????
|
||||
const int x_mis = VPXMIN(cm->mi_cols - mi_col, bw);
|
||||
const int y_mis = VPXMIN(cm->mi_rows - mi_row, bh);
|
||||
|
||||
mi->segment_id = read_intra_segment_id(cm, mi_offset, x_mis, y_mis, r);
|
||||
mi->skip = read_skip(cm, xd, mi->segment_id, r);
|
||||
@ -839,12 +829,14 @@ static void read_inter_block_mode_info(VP9Decoder *const pbi,
|
||||
|
||||
static void read_inter_frame_mode_info(VP9Decoder *const pbi,
|
||||
MACROBLOCKD *const xd,
|
||||
int mi_row, int mi_col, vpx_reader *r) {
|
||||
int mi_row, int mi_col, vpx_reader *r,
|
||||
int x_mis, int y_mis) {
|
||||
VP9_COMMON *const cm = &pbi->common;
|
||||
MODE_INFO *const mi = xd->mi[0];
|
||||
int inter_block;
|
||||
|
||||
mi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r);
|
||||
mi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r, x_mis,
|
||||
y_mis);
|
||||
mi->skip = read_skip(cm, xd, mi->segment_id, r);
|
||||
inter_block = read_is_inter_block(cm, xd, mi->segment_id, r);
|
||||
mi->tx_size = read_tx_size(cm, xd, !mi->skip || !inter_block, r);
|
||||
@ -869,9 +861,9 @@ void vpx_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd,
|
||||
int w, h;
|
||||
|
||||
if (frame_is_intra_only(cm)) {
|
||||
read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r);
|
||||
read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r, x_mis, y_mis);
|
||||
} else {
|
||||
read_inter_frame_mode_info(pbi, xd, mi_row, mi_col, r);
|
||||
read_inter_frame_mode_info(pbi, xd, mi_row, mi_col, r, x_mis, y_mis);
|
||||
|
||||
for (h = 0; h < y_mis; ++h) {
|
||||
for (w = 0; w < x_mis; ++w) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user