Renaming two members in MACROBLOCKD struct.
Renames: mi_8x8 -> mi mode_info_stride -> mi_stride Change-Id: I66f3e5fd1e7b7f46f108af5bb711c5fd9493c1be
This commit is contained in:
Родитель
7c7fc719c9
Коммит
86f44a91f4
|
@ -21,17 +21,17 @@ static void clear_mi_border(const VP9_COMMON *cm, MODE_INFO *mi) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Top border row
|
// Top border row
|
||||||
vpx_memset(mi, 0, sizeof(*mi) * cm->mode_info_stride);
|
vpx_memset(mi, 0, sizeof(*mi) * cm->mi_stride);
|
||||||
|
|
||||||
// Left border column
|
// Left border column
|
||||||
for (i = 1; i < cm->mi_rows + 1; ++i)
|
for (i = 1; i < cm->mi_rows + 1; ++i)
|
||||||
vpx_memset(&mi[i * cm->mode_info_stride], 0, sizeof(*mi));
|
vpx_memset(&mi[i * cm->mi_stride], 0, sizeof(*mi));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_mb_mi(VP9_COMMON *cm, int aligned_width, int aligned_height) {
|
static void set_mb_mi(VP9_COMMON *cm, int aligned_width, int aligned_height) {
|
||||||
cm->mi_cols = aligned_width >> MI_SIZE_LOG2;
|
cm->mi_cols = aligned_width >> MI_SIZE_LOG2;
|
||||||
cm->mi_rows = aligned_height >> MI_SIZE_LOG2;
|
cm->mi_rows = aligned_height >> MI_SIZE_LOG2;
|
||||||
cm->mode_info_stride = cm->mi_cols + MI_BLOCK_SIZE;
|
cm->mi_stride = cm->mi_cols + MI_BLOCK_SIZE;
|
||||||
|
|
||||||
cm->mb_cols = (cm->mi_cols + 1) >> 1;
|
cm->mb_cols = (cm->mi_cols + 1) >> 1;
|
||||||
cm->mb_rows = (cm->mi_rows + 1) >> 1;
|
cm->mb_rows = (cm->mi_rows + 1) >> 1;
|
||||||
|
@ -39,16 +39,14 @@ static void set_mb_mi(VP9_COMMON *cm, int aligned_width, int aligned_height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setup_mi(VP9_COMMON *cm) {
|
static void setup_mi(VP9_COMMON *cm) {
|
||||||
cm->mi = cm->mip + cm->mode_info_stride + 1;
|
cm->mi = cm->mip + cm->mi_stride + 1;
|
||||||
cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
|
cm->prev_mi = cm->prev_mip + cm->mi_stride + 1;
|
||||||
cm->mi_grid_visible = cm->mi_grid_base + cm->mode_info_stride + 1;
|
cm->mi_grid_visible = cm->mi_grid_base + cm->mi_stride + 1;
|
||||||
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mode_info_stride + 1;
|
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mi_stride + 1;
|
||||||
|
|
||||||
vpx_memset(cm->mip, 0,
|
vpx_memset(cm->mip, 0, cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
|
||||||
cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
|
|
||||||
|
|
||||||
vpx_memset(cm->mi_grid_base, 0,
|
vpx_memset(cm->mi_grid_base, 0, cm->mi_stride * (cm->mi_rows + 1) *
|
||||||
cm->mode_info_stride * (cm->mi_rows + 1) *
|
|
||||||
sizeof(*cm->mi_grid_base));
|
sizeof(*cm->mi_grid_base));
|
||||||
|
|
||||||
clear_mi_border(cm, cm->prev_mip);
|
clear_mi_border(cm, cm->prev_mip);
|
||||||
|
@ -128,7 +126,7 @@ int vp9_resize_frame_buffers(VP9_COMMON *cm, int width, int height) {
|
||||||
set_mb_mi(cm, aligned_width, aligned_height);
|
set_mb_mi(cm, aligned_width, aligned_height);
|
||||||
|
|
||||||
free_mi(cm);
|
free_mi(cm);
|
||||||
if (alloc_mi(cm, cm->mode_info_stride * (cm->mi_rows + MI_BLOCK_SIZE)))
|
if (alloc_mi(cm, cm->mi_stride * (cm->mi_rows + MI_BLOCK_SIZE)))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
setup_mi(cm);
|
setup_mi(cm);
|
||||||
|
@ -191,7 +189,7 @@ int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height) {
|
||||||
|
|
||||||
set_mb_mi(cm, aligned_width, aligned_height);
|
set_mb_mi(cm, aligned_width, aligned_height);
|
||||||
|
|
||||||
if (alloc_mi(cm, cm->mode_info_stride * (cm->mi_rows + MI_BLOCK_SIZE)))
|
if (alloc_mi(cm, cm->mi_stride * (cm->mi_rows + MI_BLOCK_SIZE)))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
setup_mi(cm);
|
setup_mi(cm);
|
||||||
|
@ -248,8 +246,8 @@ void vp9_swap_mi_and_prev_mi(VP9_COMMON *cm) {
|
||||||
cm->mi_grid_base = temp2;
|
cm->mi_grid_base = temp2;
|
||||||
|
|
||||||
// Update the upper left visible macroblock ptrs.
|
// Update the upper left visible macroblock ptrs.
|
||||||
cm->mi = cm->mip + cm->mode_info_stride + 1;
|
cm->mi = cm->mip + cm->mi_stride + 1;
|
||||||
cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
|
cm->prev_mi = cm->prev_mip + cm->mi_stride + 1;
|
||||||
cm->mi_grid_visible = cm->mi_grid_base + cm->mode_info_stride + 1;
|
cm->mi_grid_visible = cm->mi_grid_base + cm->mi_stride + 1;
|
||||||
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mode_info_stride + 1;
|
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mi_stride + 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ void vp9_foreach_transformed_block_in_plane(
|
||||||
const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane,
|
const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane,
|
||||||
foreach_transformed_block_visitor visit, void *arg) {
|
foreach_transformed_block_visitor visit, void *arg) {
|
||||||
const struct macroblockd_plane *const pd = &xd->plane[plane];
|
const struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||||
const MB_MODE_INFO* mbmi = &xd->mi_8x8[0]->mbmi;
|
const MB_MODE_INFO* mbmi = &xd->mi[0]->mbmi;
|
||||||
// block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
|
// block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
|
||||||
// 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
|
// 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
|
||||||
// transform size varies per plane, look it up in a common way.
|
// transform size varies per plane, look it up in a common way.
|
||||||
|
|
|
@ -204,10 +204,10 @@ typedef struct RefBuffer {
|
||||||
typedef struct macroblockd {
|
typedef struct macroblockd {
|
||||||
struct macroblockd_plane plane[MAX_MB_PLANE];
|
struct macroblockd_plane plane[MAX_MB_PLANE];
|
||||||
|
|
||||||
int mode_info_stride;
|
int mi_stride;
|
||||||
|
|
||||||
// A NULL indicates that the 8x8 is not part of the image
|
// A NULL indicates that the 8x8 is not part of the image
|
||||||
MODE_INFO **mi_8x8;
|
MODE_INFO **mi;
|
||||||
|
|
||||||
int up_available;
|
int up_available;
|
||||||
int left_available;
|
int left_available;
|
||||||
|
@ -255,7 +255,7 @@ extern const TX_TYPE intra_mode_to_tx_type_lookup[INTRA_MODES];
|
||||||
|
|
||||||
static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type,
|
static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type,
|
||||||
const MACROBLOCKD *xd) {
|
const MACROBLOCKD *xd) {
|
||||||
const MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
|
|
||||||
if (plane_type != PLANE_TYPE_Y || is_inter_block(mbmi))
|
if (plane_type != PLANE_TYPE_Y || is_inter_block(mbmi))
|
||||||
return DCT_DCT;
|
return DCT_DCT;
|
||||||
|
@ -264,7 +264,7 @@ static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type,
|
||||||
|
|
||||||
static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
|
static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
|
||||||
const MACROBLOCKD *xd, int ib) {
|
const MACROBLOCKD *xd, int ib) {
|
||||||
const MODE_INFO *const mi = xd->mi_8x8[0];
|
const MODE_INFO *const mi = xd->mi[0];
|
||||||
|
|
||||||
if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(&mi->mbmi))
|
if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(&mi->mbmi))
|
||||||
return DCT_DCT;
|
return DCT_DCT;
|
||||||
|
|
|
@ -175,7 +175,7 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
|
||||||
|
|
||||||
static const INLINE scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
|
static const INLINE scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
|
||||||
PLANE_TYPE type, int block_idx) {
|
PLANE_TYPE type, int block_idx) {
|
||||||
const MODE_INFO *const mi = xd->mi_8x8[0];
|
const MODE_INFO *const mi = xd->mi[0];
|
||||||
|
|
||||||
if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) {
|
if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) {
|
||||||
return &vp9_default_scan_orders[tx_size];
|
return &vp9_default_scan_orders[tx_size];
|
||||||
|
|
|
@ -465,11 +465,10 @@ void vp9_setup_past_independence(VP9_COMMON *cm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame_is_intra_only(cm))
|
if (frame_is_intra_only(cm))
|
||||||
vpx_memset(cm->prev_mip, 0,
|
vpx_memset(cm->prev_mip, 0, cm->mi_stride * (cm->mi_rows + 1) *
|
||||||
cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
|
sizeof(*cm->prev_mip));
|
||||||
|
|
||||||
vpx_memset(cm->mip, 0,
|
vpx_memset(cm->mip, 0, cm->mi_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
|
||||||
cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
|
|
||||||
|
|
||||||
vp9_zero(cm->ref_frame_sign_bias);
|
vp9_zero(cm->ref_frame_sign_bias);
|
||||||
|
|
||||||
|
|
|
@ -909,7 +909,7 @@ static void filter_block_plane_non420(VP9_COMMON *cm,
|
||||||
const int ss_y = plane->subsampling_y;
|
const int ss_y = plane->subsampling_y;
|
||||||
const int row_step = 1 << ss_x;
|
const int row_step = 1 << ss_x;
|
||||||
const int col_step = 1 << ss_y;
|
const int col_step = 1 << ss_y;
|
||||||
const int row_step_stride = cm->mode_info_stride * row_step;
|
const int row_step_stride = cm->mi_stride * row_step;
|
||||||
struct buf_2d *const dst = &plane->dst;
|
struct buf_2d *const dst = &plane->dst;
|
||||||
uint8_t* const dst0 = dst->buf;
|
uint8_t* const dst0 = dst->buf;
|
||||||
unsigned int mask_16x16[MI_BLOCK_SIZE] = {0};
|
unsigned int mask_16x16[MI_BLOCK_SIZE] = {0};
|
||||||
|
@ -1201,7 +1201,7 @@ void vp9_loop_filter_rows(const YV12_BUFFER_CONFIG *frame_buffer,
|
||||||
xd->plane[1].subsampling_x == 1);
|
xd->plane[1].subsampling_x == 1);
|
||||||
|
|
||||||
for (mi_row = start; mi_row < stop; mi_row += MI_BLOCK_SIZE) {
|
for (mi_row = start; mi_row < stop; mi_row += MI_BLOCK_SIZE) {
|
||||||
MODE_INFO **mi_8x8 = cm->mi_grid_visible + mi_row * cm->mode_info_stride;
|
MODE_INFO **mi_8x8 = cm->mi_grid_visible + mi_row * cm->mi_stride;
|
||||||
|
|
||||||
for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) {
|
for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) {
|
||||||
int plane;
|
int plane;
|
||||||
|
@ -1210,8 +1210,8 @@ void vp9_loop_filter_rows(const YV12_BUFFER_CONFIG *frame_buffer,
|
||||||
|
|
||||||
// TODO(JBB): Make setup_mask work for non 420.
|
// TODO(JBB): Make setup_mask work for non 420.
|
||||||
if (use_420)
|
if (use_420)
|
||||||
vp9_setup_mask(cm, mi_row, mi_col, mi_8x8 + mi_col,
|
vp9_setup_mask(cm, mi_row, mi_col, mi_8x8 + mi_col, cm->mi_stride,
|
||||||
cm->mode_info_stride, &lfm);
|
&lfm);
|
||||||
|
|
||||||
for (plane = 0; plane < num_planes; ++plane) {
|
for (plane = 0; plane < num_planes; ++plane) {
|
||||||
if (use_420)
|
if (use_420)
|
||||||
|
|
|
@ -194,7 +194,7 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
|
||||||
const int *ref_sign_bias = cm->ref_frame_sign_bias;
|
const int *ref_sign_bias = cm->ref_frame_sign_bias;
|
||||||
int i, refmv_count = 0;
|
int i, refmv_count = 0;
|
||||||
const MODE_INFO *prev_mi = cm->coding_use_prev_mi && cm->prev_mi
|
const MODE_INFO *prev_mi = cm->coding_use_prev_mi && cm->prev_mi
|
||||||
? cm->prev_mi_grid_visible[mi_row * xd->mode_info_stride + mi_col]
|
? cm->prev_mi_grid_visible[mi_row * xd->mi_stride + mi_col]
|
||||||
: NULL;
|
: NULL;
|
||||||
const MB_MODE_INFO *const prev_mbmi = prev_mi ? &prev_mi->mbmi : NULL;
|
const MB_MODE_INFO *const prev_mbmi = prev_mi ? &prev_mi->mbmi : NULL;
|
||||||
|
|
||||||
|
@ -213,8 +213,8 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
|
||||||
for (i = 0; i < 2; ++i) {
|
for (i = 0; i < 2; ++i) {
|
||||||
const POSITION *const mv_ref = &mv_ref_search[i];
|
const POSITION *const mv_ref = &mv_ref_search[i];
|
||||||
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
|
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
|
||||||
const MODE_INFO *const candidate_mi = xd->mi_8x8[mv_ref->col + mv_ref->row
|
const MODE_INFO *const candidate_mi = xd->mi[mv_ref->col + mv_ref->row *
|
||||||
* xd->mode_info_stride];
|
xd->mi_stride];
|
||||||
const MB_MODE_INFO *const candidate = &candidate_mi->mbmi;
|
const MB_MODE_INFO *const candidate = &candidate_mi->mbmi;
|
||||||
// Keep counts for entropy encoding.
|
// Keep counts for entropy encoding.
|
||||||
context_counter += mode_2_counter[candidate->mode];
|
context_counter += mode_2_counter[candidate->mode];
|
||||||
|
@ -233,9 +233,8 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
|
||||||
for (; i < MVREF_NEIGHBOURS; ++i) {
|
for (; i < MVREF_NEIGHBOURS; ++i) {
|
||||||
const POSITION *const mv_ref = &mv_ref_search[i];
|
const POSITION *const mv_ref = &mv_ref_search[i];
|
||||||
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
|
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
|
||||||
const MB_MODE_INFO *const candidate = &xd->mi_8x8[mv_ref->col +
|
const MB_MODE_INFO *const candidate = &xd->mi[mv_ref->col + mv_ref->row *
|
||||||
mv_ref->row
|
xd->mi_stride]->mbmi;
|
||||||
* xd->mode_info_stride]->mbmi;
|
|
||||||
different_ref_found = 1;
|
different_ref_found = 1;
|
||||||
|
|
||||||
if (candidate->ref_frame[0] == ref_frame)
|
if (candidate->ref_frame[0] == ref_frame)
|
||||||
|
@ -260,9 +259,8 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
|
||||||
for (i = 0; i < MVREF_NEIGHBOURS; ++i) {
|
for (i = 0; i < MVREF_NEIGHBOURS; ++i) {
|
||||||
const POSITION *mv_ref = &mv_ref_search[i];
|
const POSITION *mv_ref = &mv_ref_search[i];
|
||||||
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
|
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
|
||||||
const MB_MODE_INFO *const candidate = &xd->mi_8x8[mv_ref->col +
|
const MB_MODE_INFO *const candidate = &xd->mi[mv_ref->col + mv_ref->row
|
||||||
mv_ref->row
|
* xd->mi_stride]->mbmi;
|
||||||
* xd->mode_info_stride]->mbmi;
|
|
||||||
|
|
||||||
// If the candidate is INTRA we don't want to consider its mv.
|
// If the candidate is INTRA we don't want to consider its mv.
|
||||||
if (is_inter_block(candidate))
|
if (is_inter_block(candidate))
|
||||||
|
@ -321,7 +319,7 @@ void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||||
int block, int ref, int mi_row, int mi_col,
|
int block, int ref, int mi_row, int mi_col,
|
||||||
int_mv *nearest, int_mv *near) {
|
int_mv *nearest, int_mv *near) {
|
||||||
int_mv mv_list[MAX_MV_REF_CANDIDATES];
|
int_mv mv_list[MAX_MV_REF_CANDIDATES];
|
||||||
MODE_INFO *const mi = xd->mi_8x8[0];
|
MODE_INFO *const mi = xd->mi[0];
|
||||||
b_mode_info *bmi = mi->bmi;
|
b_mode_info *bmi = mi->bmi;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ typedef struct VP9Common {
|
||||||
int MBs;
|
int MBs;
|
||||||
int mb_rows, mi_rows;
|
int mb_rows, mi_rows;
|
||||||
int mb_cols, mi_cols;
|
int mb_cols, mi_cols;
|
||||||
int mode_info_stride;
|
int mi_stride;
|
||||||
|
|
||||||
/* profile settings */
|
/* profile settings */
|
||||||
TX_MODE tx_mode;
|
TX_MODE tx_mode;
|
||||||
|
@ -247,7 +247,7 @@ static INLINE void init_macroblockd(VP9_COMMON *cm, MACROBLOCKD *xd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
xd->above_seg_context = cm->above_seg_context;
|
xd->above_seg_context = cm->above_seg_context;
|
||||||
xd->mode_info_stride = cm->mode_info_stride;
|
xd->mi_stride = cm->mi_stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE const vp9_prob* get_partition_probs(const VP9_COMMON *cm,
|
static INLINE const vp9_prob* get_partition_probs(const VP9_COMMON *cm,
|
||||||
|
@ -289,7 +289,7 @@ static INLINE void set_prev_mi(VP9_COMMON *cm) {
|
||||||
// Special case: set prev_mi to NULL when the previous mode info
|
// Special case: set prev_mi to NULL when the previous mode info
|
||||||
// context cannot be used.
|
// context cannot be used.
|
||||||
cm->prev_mi = use_prev_in_find_mv_refs ?
|
cm->prev_mi = use_prev_in_find_mv_refs ?
|
||||||
cm->prev_mip + cm->mode_info_stride + 1 : NULL;
|
cm->prev_mip + cm->mi_stride + 1 : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE int frame_is_intra_only(const VP9_COMMON *const cm) {
|
static INLINE int frame_is_intra_only(const VP9_COMMON *const cm) {
|
||||||
|
|
|
@ -348,7 +348,7 @@ int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
|
||||||
// left of the entries corresponding to real blocks.
|
// left of the entries corresponding to real blocks.
|
||||||
// The prediction flags in these dummy entries are initialized to 0.
|
// The prediction flags in these dummy entries are initialized to 0.
|
||||||
int vp9_get_tx_size_context(const MACROBLOCKD *xd) {
|
int vp9_get_tx_size_context(const MACROBLOCKD *xd) {
|
||||||
const int max_tx_size = max_txsize_lookup[xd->mi_8x8[0]->mbmi.sb_type];
|
const int max_tx_size = max_txsize_lookup[xd->mi[0]->mbmi.sb_type];
|
||||||
const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
|
const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
|
||||||
const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
|
const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
|
||||||
const int has_above = above_mbmi != NULL;
|
const int has_above = above_mbmi != NULL;
|
||||||
|
|
|
@ -19,11 +19,11 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static INLINE const MODE_INFO *get_above_mi(const MACROBLOCKD *const xd) {
|
static INLINE const MODE_INFO *get_above_mi(const MACROBLOCKD *const xd) {
|
||||||
return xd->up_available ? xd->mi_8x8[-xd->mode_info_stride] : NULL;
|
return xd->up_available ? xd->mi[-xd->mi_stride] : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE const MODE_INFO *get_left_mi(const MACROBLOCKD *const xd) {
|
static INLINE const MODE_INFO *get_left_mi(const MACROBLOCKD *const xd) {
|
||||||
return xd->left_available ? xd->mi_8x8[-1] : NULL;
|
return xd->left_available ? xd->mi[-1] : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
|
int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
|
||||||
|
|
|
@ -144,7 +144,7 @@ static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
|
||||||
int x, int y, int w, int h,
|
int x, int y, int w, int h,
|
||||||
int mi_x, int mi_y) {
|
int mi_x, int mi_y) {
|
||||||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||||
const MODE_INFO *mi = xd->mi_8x8[0];
|
const MODE_INFO *mi = xd->mi[0];
|
||||||
const int is_compound = has_second_ref(&mi->mbmi);
|
const int is_compound = has_second_ref(&mi->mbmi);
|
||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize,
|
||||||
const int bw = 4 * num_4x4_w;
|
const int bw = 4 * num_4x4_w;
|
||||||
const int bh = 4 * num_4x4_h;
|
const int bh = 4 * num_4x4_h;
|
||||||
|
|
||||||
if (xd->mi_8x8[0]->mbmi.sb_type < BLOCK_8X8) {
|
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) {
|
||||||
int i = 0, x, y;
|
int i = 0, x, y;
|
||||||
assert(bsize == BLOCK_8X8);
|
assert(bsize == BLOCK_8X8);
|
||||||
for (y = 0; y < num_4x4_h; ++y)
|
for (y = 0; y < num_4x4_h; ++y)
|
||||||
|
@ -248,7 +248,7 @@ static void dec_build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
|
||||||
int x, int y, int w, int h,
|
int x, int y, int w, int h,
|
||||||
int mi_x, int mi_y) {
|
int mi_x, int mi_y) {
|
||||||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||||
const MODE_INFO *mi = xd->mi_8x8[0];
|
const MODE_INFO *mi = xd->mi[0];
|
||||||
const int is_compound = has_second_ref(&mi->mbmi);
|
const int is_compound = has_second_ref(&mi->mbmi);
|
||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ void vp9_dec_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
|
||||||
const int bw = 4 * num_4x4_w;
|
const int bw = 4 * num_4x4_w;
|
||||||
const int bh = 4 * num_4x4_h;
|
const int bh = 4 * num_4x4_h;
|
||||||
|
|
||||||
if (xd->mi_8x8[0]->mbmi.sb_type < BLOCK_8X8) {
|
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) {
|
||||||
int i = 0, x, y;
|
int i = 0, x, y;
|
||||||
assert(bsize == BLOCK_8X8);
|
assert(bsize == BLOCK_8X8);
|
||||||
for (y = 0; y < num_4x4_h; ++y)
|
for (y = 0; y < num_4x4_h; ++y)
|
||||||
|
|
|
@ -245,7 +245,7 @@ static void predict_and_reconstruct_intra_block(int plane, int block,
|
||||||
VP9_COMMON *const cm = args->cm;
|
VP9_COMMON *const cm = args->cm;
|
||||||
MACROBLOCKD *const xd = args->xd;
|
MACROBLOCKD *const xd = args->xd;
|
||||||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||||
MODE_INFO *const mi = xd->mi_8x8[0];
|
MODE_INFO *const mi = xd->mi[0];
|
||||||
const MB_PREDICTION_MODE mode = (plane == 0) ? get_y_mode(mi, block)
|
const MB_PREDICTION_MODE mode = (plane == 0) ? get_y_mode(mi, block)
|
||||||
: mi->mbmi.uv_mode;
|
: mi->mbmi.uv_mode;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
@ -298,15 +298,15 @@ static void set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||||
const int bh = num_8x8_blocks_high_lookup[bsize];
|
const int bh = num_8x8_blocks_high_lookup[bsize];
|
||||||
const int x_mis = MIN(bw, cm->mi_cols - mi_col);
|
const int x_mis = MIN(bw, cm->mi_cols - mi_col);
|
||||||
const int y_mis = MIN(bh, cm->mi_rows - mi_row);
|
const int y_mis = MIN(bh, cm->mi_rows - mi_row);
|
||||||
const int offset = mi_row * cm->mode_info_stride + mi_col;
|
const int offset = mi_row * cm->mi_stride + mi_col;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
xd->mi_8x8 = cm->mi_grid_visible + offset;
|
xd->mi = cm->mi_grid_visible + offset;
|
||||||
xd->mi_8x8[0] = &cm->mi[offset];
|
xd->mi[0] = &cm->mi[offset];
|
||||||
xd->mi_8x8[0]->mbmi.sb_type = bsize;
|
xd->mi[0]->mbmi.sb_type = bsize;
|
||||||
for (y = 0; y < y_mis; ++y)
|
for (y = 0; y < y_mis; ++y)
|
||||||
for (x = !y; x < x_mis; ++x)
|
for (x = !y; x < x_mis; ++x)
|
||||||
xd->mi_8x8[y * cm->mode_info_stride + x] = xd->mi_8x8[0];
|
xd->mi[y * cm->mi_stride + x] = xd->mi[0];
|
||||||
|
|
||||||
set_skip_context(xd, mi_row, mi_col);
|
set_skip_context(xd, mi_row, mi_col);
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ static void set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||||
|
|
||||||
static void set_ref(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
static void set_ref(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||||
int idx, int mi_row, int mi_col) {
|
int idx, int mi_row, int mi_col) {
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
RefBuffer *ref_buffer = &cm->frame_refs[mbmi->ref_frame[idx] - LAST_FRAME];
|
RefBuffer *ref_buffer = &cm->frame_refs[mbmi->ref_frame[idx] - LAST_FRAME];
|
||||||
xd->block_refs[idx] = ref_buffer;
|
xd->block_refs[idx] = ref_buffer;
|
||||||
if (!vp9_is_valid_scale(&ref_buffer->sf))
|
if (!vp9_is_valid_scale(&ref_buffer->sf))
|
||||||
|
@ -344,7 +344,7 @@ static void decode_block(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||||
bsize = BLOCK_8X8;
|
bsize = BLOCK_8X8;
|
||||||
|
|
||||||
// Has to be called after set_offsets
|
// Has to be called after set_offsets
|
||||||
mbmi = &xd->mi_8x8[0]->mbmi;
|
mbmi = &xd->mi[0]->mbmi;
|
||||||
|
|
||||||
if (mbmi->skip) {
|
if (mbmi->skip) {
|
||||||
reset_skip_context(xd, bsize);
|
reset_skip_context(xd, bsize);
|
||||||
|
|
|
@ -104,7 +104,7 @@ static int read_intra_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||||
int mi_row, int mi_col,
|
int mi_row, int mi_col,
|
||||||
vp9_reader *r) {
|
vp9_reader *r) {
|
||||||
struct segmentation *const seg = &cm->seg;
|
struct segmentation *const seg = &cm->seg;
|
||||||
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
|
const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
|
||||||
int segment_id;
|
int segment_id;
|
||||||
|
|
||||||
if (!seg->enabled)
|
if (!seg->enabled)
|
||||||
|
@ -121,7 +121,7 @@ static int read_intra_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||||
static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||||
int mi_row, int mi_col, vp9_reader *r) {
|
int mi_row, int mi_col, vp9_reader *r) {
|
||||||
struct segmentation *const seg = &cm->seg;
|
struct segmentation *const seg = &cm->seg;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
const BLOCK_SIZE bsize = mbmi->sb_type;
|
const BLOCK_SIZE bsize = mbmi->sb_type;
|
||||||
int predicted_segment_id, segment_id;
|
int predicted_segment_id, segment_id;
|
||||||
|
|
||||||
|
@ -161,10 +161,10 @@ static int read_skip(VP9_COMMON *cm, const MACROBLOCKD *xd,
|
||||||
static void read_intra_frame_mode_info(VP9_COMMON *const cm,
|
static void read_intra_frame_mode_info(VP9_COMMON *const cm,
|
||||||
MACROBLOCKD *const xd,
|
MACROBLOCKD *const xd,
|
||||||
int mi_row, int mi_col, vp9_reader *r) {
|
int mi_row, int mi_col, vp9_reader *r) {
|
||||||
MODE_INFO *const mi = xd->mi_8x8[0];
|
MODE_INFO *const mi = xd->mi[0];
|
||||||
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||||
const MODE_INFO *above_mi = xd->mi_8x8[-cm->mode_info_stride];
|
const MODE_INFO *above_mi = xd->mi[-cm->mi_stride];
|
||||||
const MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL;
|
const MODE_INFO *left_mi = xd->left_available ? xd->mi[-1] : NULL;
|
||||||
const BLOCK_SIZE bsize = mbmi->sb_type;
|
const BLOCK_SIZE bsize = mbmi->sb_type;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -515,7 +515,7 @@ static void read_inter_frame_mode_info(VP9_COMMON *const cm,
|
||||||
MACROBLOCKD *const xd,
|
MACROBLOCKD *const xd,
|
||||||
const TileInfo *const tile,
|
const TileInfo *const tile,
|
||||||
int mi_row, int mi_col, vp9_reader *r) {
|
int mi_row, int mi_col, vp9_reader *r) {
|
||||||
MODE_INFO *const mi = xd->mi_8x8[0];
|
MODE_INFO *const mi = xd->mi[0];
|
||||||
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||||
int inter_block;
|
int inter_block;
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, PLANE_TYPE type,
|
||||||
const int max_eob = 16 << (tx_size << 1);
|
const int max_eob = 16 << (tx_size << 1);
|
||||||
const FRAME_CONTEXT *const fc = &cm->fc;
|
const FRAME_CONTEXT *const fc = &cm->fc;
|
||||||
FRAME_COUNTS *const counts = &cm->counts;
|
FRAME_COUNTS *const counts = &cm->counts;
|
||||||
const int ref = is_inter_block(&xd->mi_8x8[0]->mbmi);
|
const int ref = is_inter_block(&xd->mi[0]->mbmi);
|
||||||
int band, c = 0;
|
int band, c = 0;
|
||||||
const vp9_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
|
const vp9_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
|
||||||
fc->coef_probs[tx_size][type][ref];
|
fc->coef_probs[tx_size][type][ref];
|
||||||
|
|
|
@ -99,7 +99,7 @@ static void loop_filter_rows_mt(const YV12_BUFFER_CONFIG *const frame_buffer,
|
||||||
|
|
||||||
for (r = start; r < stop; r += num_lf_workers) {
|
for (r = start; r < stop; r += num_lf_workers) {
|
||||||
const int mi_row = r << MI_BLOCK_SIZE_LOG2;
|
const int mi_row = r << MI_BLOCK_SIZE_LOG2;
|
||||||
MODE_INFO **mi_8x8 = cm->mi_grid_visible + mi_row * cm->mode_info_stride;
|
MODE_INFO **mi_8x8 = cm->mi_grid_visible + mi_row * cm->mi_stride;
|
||||||
|
|
||||||
for (c = 0; c < sb_cols; ++c) {
|
for (c = 0; c < sb_cols; ++c) {
|
||||||
const int mi_col = c << MI_BLOCK_SIZE_LOG2;
|
const int mi_col = c << MI_BLOCK_SIZE_LOG2;
|
||||||
|
@ -108,8 +108,7 @@ static void loop_filter_rows_mt(const YV12_BUFFER_CONFIG *const frame_buffer,
|
||||||
sync_read(lf_sync, r, c);
|
sync_read(lf_sync, r, c);
|
||||||
|
|
||||||
vp9_setup_dst_planes(xd, frame_buffer, mi_row, mi_col);
|
vp9_setup_dst_planes(xd, frame_buffer, mi_row, mi_col);
|
||||||
vp9_setup_mask(cm, mi_row, mi_col, mi_8x8 + mi_col, cm->mode_info_stride,
|
vp9_setup_mask(cm, mi_row, mi_col, mi_8x8 + mi_col, cm->mi_stride, &lfm);
|
||||||
&lfm);
|
|
||||||
|
|
||||||
for (plane = 0; plane < num_planes; ++plane) {
|
for (plane = 0; plane < num_planes; ++plane) {
|
||||||
vp9_filter_block_plane(cm, &xd->plane[plane], mi_row, &lfm);
|
vp9_filter_block_plane(cm, &xd->plane[plane], mi_row, &lfm);
|
||||||
|
|
|
@ -192,7 +192,7 @@ static void write_segment_id(vp9_writer *w, const struct segmentation *seg,
|
||||||
static void write_ref_frames(const VP9_COMP *cpi, vp9_writer *w) {
|
static void write_ref_frames(const VP9_COMP *cpi, vp9_writer *w) {
|
||||||
const VP9_COMMON *const cm = &cpi->common;
|
const VP9_COMMON *const cm = &cpi->common;
|
||||||
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||||
const MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
const int is_compound = has_second_ref(mbmi);
|
const int is_compound = has_second_ref(mbmi);
|
||||||
const int segment_id = mbmi->segment_id;
|
const int segment_id = mbmi->segment_id;
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi, MODE_INFO **mi_8x8,
|
||||||
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||||
const struct segmentation *const seg = &cm->seg;
|
const struct segmentation *const seg = &cm->seg;
|
||||||
const MODE_INFO *const mi = mi_8x8[0];
|
const MODE_INFO *const mi = mi_8x8[0];
|
||||||
const MODE_INFO *const above_mi = mi_8x8[-xd->mode_info_stride];
|
const MODE_INFO *const above_mi = mi_8x8[-xd->mi_stride];
|
||||||
const MODE_INFO *const left_mi = xd->left_available ? mi_8x8[-1] : NULL;
|
const MODE_INFO *const left_mi = xd->left_available ? mi_8x8[-1] : NULL;
|
||||||
const MB_MODE_INFO *const mbmi = &mi->mbmi;
|
const MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||||
const BLOCK_SIZE bsize = mbmi->sb_type;
|
const BLOCK_SIZE bsize = mbmi->sb_type;
|
||||||
|
@ -375,15 +375,15 @@ static void write_modes_b(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||||
MODE_INFO *m;
|
MODE_INFO *m;
|
||||||
|
|
||||||
xd->mi_8x8 = cm->mi_grid_visible + (mi_row * cm->mode_info_stride + mi_col);
|
xd->mi = cm->mi_grid_visible + (mi_row * cm->mi_stride + mi_col);
|
||||||
m = xd->mi_8x8[0];
|
m = xd->mi[0];
|
||||||
|
|
||||||
set_mi_row_col(xd, tile,
|
set_mi_row_col(xd, tile,
|
||||||
mi_row, num_8x8_blocks_high_lookup[m->mbmi.sb_type],
|
mi_row, num_8x8_blocks_high_lookup[m->mbmi.sb_type],
|
||||||
mi_col, num_8x8_blocks_wide_lookup[m->mbmi.sb_type],
|
mi_col, num_8x8_blocks_wide_lookup[m->mbmi.sb_type],
|
||||||
cm->mi_rows, cm->mi_cols);
|
cm->mi_rows, cm->mi_cols);
|
||||||
if (frame_is_intra_only(cm)) {
|
if (frame_is_intra_only(cm)) {
|
||||||
write_mb_modes_kf(cpi, xd->mi_8x8, w);
|
write_mb_modes_kf(cpi, xd->mi, w);
|
||||||
} else {
|
} else {
|
||||||
pack_inter_mode_mvs(cpi, m, w);
|
pack_inter_mode_mvs(cpi, m, w);
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ static void write_modes_sb(VP9_COMP *cpi,
|
||||||
const int bs = (1 << bsl) / 4;
|
const int bs = (1 << bsl) / 4;
|
||||||
PARTITION_TYPE partition;
|
PARTITION_TYPE partition;
|
||||||
BLOCK_SIZE subsize;
|
BLOCK_SIZE subsize;
|
||||||
MODE_INFO *m = cm->mi_grid_visible[mi_row * cm->mode_info_stride + mi_col];
|
MODE_INFO *m = cm->mi_grid_visible[mi_row * cm->mi_stride + mi_col];
|
||||||
|
|
||||||
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -163,9 +163,9 @@ static INLINE void set_modeinfo_offsets(VP9_COMMON *const cm,
|
||||||
MACROBLOCKD *const xd,
|
MACROBLOCKD *const xd,
|
||||||
int mi_row,
|
int mi_row,
|
||||||
int mi_col) {
|
int mi_col) {
|
||||||
const int idx_str = xd->mode_info_stride * mi_row + mi_col;
|
const int idx_str = xd->mi_stride * mi_row + mi_col;
|
||||||
xd->mi_8x8 = cm->mi_grid_visible + idx_str;
|
xd->mi = cm->mi_grid_visible + idx_str;
|
||||||
xd->mi_8x8[0] = cm->mi + idx_str;
|
xd->mi[0] = cm->mi + idx_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_block_in_mb_map(const VP9_COMP *cpi, int mi_row, int mi_col,
|
static int is_block_in_mb_map(const VP9_COMP *cpi, int mi_row, int mi_col,
|
||||||
|
@ -225,7 +225,7 @@ static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
|
|
||||||
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
|
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
|
||||||
|
|
||||||
mbmi = &xd->mi_8x8[0]->mbmi;
|
mbmi = &xd->mi[0]->mbmi;
|
||||||
|
|
||||||
// Set up destination pointers.
|
// Set up destination pointers.
|
||||||
vp9_setup_dst_planes(xd, get_frame_new_buffer(cm), mi_row, mi_col);
|
vp9_setup_dst_planes(xd, get_frame_new_buffer(cm), mi_row, mi_col);
|
||||||
|
@ -288,12 +288,11 @@ static void duplicate_mode_info_in_sb(VP9_COMMON * const cm,
|
||||||
BLOCK_SIZE bsize) {
|
BLOCK_SIZE bsize) {
|
||||||
const int block_width = num_8x8_blocks_wide_lookup[bsize];
|
const int block_width = num_8x8_blocks_wide_lookup[bsize];
|
||||||
const int block_height = num_8x8_blocks_high_lookup[bsize];
|
const int block_height = num_8x8_blocks_high_lookup[bsize];
|
||||||
const int mis = xd->mode_info_stride;
|
|
||||||
int i, j;
|
int i, j;
|
||||||
for (j = 0; j < block_height; ++j)
|
for (j = 0; j < block_height; ++j)
|
||||||
for (i = 0; i < block_width; ++i) {
|
for (i = 0; i < block_width; ++i) {
|
||||||
if (mi_row + j < cm->mi_rows && mi_col + i < cm->mi_cols)
|
if (mi_row + j < cm->mi_rows && mi_col + i < cm->mi_cols)
|
||||||
xd->mi_8x8[j * mis + i] = xd->mi_8x8[0];
|
xd->mi[j * xd->mi_stride + i] = xd->mi[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +303,7 @@ static void set_block_size(VP9_COMP * const cpi,
|
||||||
if (cpi->common.mi_cols > mi_col && cpi->common.mi_rows > mi_row) {
|
if (cpi->common.mi_cols > mi_col && cpi->common.mi_rows > mi_row) {
|
||||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||||
set_modeinfo_offsets(&cpi->common, xd, mi_row, mi_col);
|
set_modeinfo_offsets(&cpi->common, xd, mi_row, mi_col);
|
||||||
xd->mi_8x8[0]->mbmi.sb_type = bsize;
|
xd->mi[0]->mbmi.sb_type = bsize;
|
||||||
duplicate_mode_info_in_sb(&cpi->common, xd, mi_row, mi_col, bsize);
|
duplicate_mode_info_in_sb(&cpi->common, xd, mi_row, mi_col, bsize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -501,13 +500,13 @@ static void choose_partitioning(VP9_COMP *cpi,
|
||||||
if (cm->frame_type != KEY_FRAME) {
|
if (cm->frame_type != KEY_FRAME) {
|
||||||
vp9_setup_pre_planes(xd, 0, yv12, mi_row, mi_col, sf);
|
vp9_setup_pre_planes(xd, 0, yv12, mi_row, mi_col, sf);
|
||||||
|
|
||||||
xd->mi_8x8[0]->mbmi.ref_frame[0] = LAST_FRAME;
|
xd->mi[0]->mbmi.ref_frame[0] = LAST_FRAME;
|
||||||
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_64X64;
|
xd->mi[0]->mbmi.sb_type = BLOCK_64X64;
|
||||||
vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv,
|
vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv,
|
||||||
xd->mi_8x8[0]->mbmi.ref_mvs[LAST_FRAME],
|
xd->mi[0]->mbmi.ref_mvs[LAST_FRAME],
|
||||||
&nearest_mv, &near_mv);
|
&nearest_mv, &near_mv);
|
||||||
|
|
||||||
xd->mi_8x8[0]->mbmi.mv[0] = nearest_mv;
|
xd->mi[0]->mbmi.mv[0] = nearest_mv;
|
||||||
vp9_build_inter_predictors_sby(xd, mi_row, mi_col, BLOCK_64X64);
|
vp9_build_inter_predictors_sby(xd, mi_row, mi_col, BLOCK_64X64);
|
||||||
|
|
||||||
d = xd->plane[0].dst.buf;
|
d = xd->plane[0].dst.buf;
|
||||||
|
@ -844,11 +843,11 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
||||||
struct macroblock_plane *const p = x->plane;
|
struct macroblock_plane *const p = x->plane;
|
||||||
struct macroblockd_plane *const pd = xd->plane;
|
struct macroblockd_plane *const pd = xd->plane;
|
||||||
MODE_INFO *mi = &ctx->mic;
|
MODE_INFO *mi = &ctx->mic;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
MODE_INFO *mi_addr = xd->mi_8x8[0];
|
MODE_INFO *mi_addr = xd->mi[0];
|
||||||
const struct segmentation *const seg = &cm->seg;
|
const struct segmentation *const seg = &cm->seg;
|
||||||
|
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
|
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
|
||||||
const int mi_height = num_8x8_blocks_high_lookup[bsize];
|
const int mi_height = num_8x8_blocks_high_lookup[bsize];
|
||||||
int max_plane;
|
int max_plane;
|
||||||
|
@ -861,7 +860,7 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
||||||
// the cyclic refresh map.
|
// the cyclic refresh map.
|
||||||
if ((cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) && seg->enabled &&
|
if ((cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) && seg->enabled &&
|
||||||
output_enabled) {
|
output_enabled) {
|
||||||
vp9_cyclic_refresh_update_segment(cpi, &xd->mi_8x8[0]->mbmi,
|
vp9_cyclic_refresh_update_segment(cpi, &xd->mi[0]->mbmi,
|
||||||
mi_row, mi_col, bsize, 1);
|
mi_row, mi_col, bsize, 1);
|
||||||
vp9_init_plane_quantizers(cpi, x);
|
vp9_init_plane_quantizers(cpi, x);
|
||||||
}
|
}
|
||||||
|
@ -887,7 +886,7 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
||||||
for (x_idx = 0; x_idx < mi_width; x_idx++)
|
for (x_idx = 0; x_idx < mi_width; x_idx++)
|
||||||
if ((xd->mb_to_right_edge >> (3 + MI_SIZE_LOG2)) + mi_width > x_idx
|
if ((xd->mb_to_right_edge >> (3 + MI_SIZE_LOG2)) + mi_width > x_idx
|
||||||
&& (xd->mb_to_bottom_edge >> (3 + MI_SIZE_LOG2)) + mi_height > y) {
|
&& (xd->mb_to_bottom_edge >> (3 + MI_SIZE_LOG2)) + mi_height > y) {
|
||||||
xd->mi_8x8[x_idx + y * mis] = mi_addr;
|
xd->mi[x_idx + y * mis] = mi_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cpi->oxcf.aq_mode)
|
if (cpi->oxcf.aq_mode)
|
||||||
|
@ -1006,7 +1005,7 @@ static void rd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
}
|
}
|
||||||
|
|
||||||
set_offsets(cpi, tile, mi_row, mi_col, bsize);
|
set_offsets(cpi, tile, mi_row, mi_col, bsize);
|
||||||
mbmi = &xd->mi_8x8[0]->mbmi;
|
mbmi = &xd->mi[0]->mbmi;
|
||||||
mbmi->sb_type = bsize;
|
mbmi->sb_type = bsize;
|
||||||
|
|
||||||
for (i = 0; i < MAX_MB_PLANE; ++i) {
|
for (i = 0; i < MAX_MB_PLANE; ++i) {
|
||||||
|
@ -1094,7 +1093,7 @@ static void update_stats(VP9_COMP *cpi) {
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
const MACROBLOCK *const x = &cpi->mb;
|
const MACROBLOCK *const x = &cpi->mb;
|
||||||
const MACROBLOCKD *const xd = &x->e_mbd;
|
const MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
const MODE_INFO *const mi = xd->mi_8x8[0];
|
const MODE_INFO *const mi = xd->mi[0];
|
||||||
const MB_MODE_INFO *const mbmi = &mi->mbmi;
|
const MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||||
|
|
||||||
if (!frame_is_intra_only(cm)) {
|
if (!frame_is_intra_only(cm)) {
|
||||||
|
@ -1337,7 +1336,7 @@ static void set_fixed_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
MODE_INFO **mi_8x8, int mi_row, int mi_col,
|
MODE_INFO **mi_8x8, int mi_row, int mi_col,
|
||||||
BLOCK_SIZE bsize) {
|
BLOCK_SIZE bsize) {
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
int row8x8_remaining = tile->mi_row_end - mi_row;
|
int row8x8_remaining = tile->mi_row_end - mi_row;
|
||||||
int col8x8_remaining = tile->mi_col_end - mi_col;
|
int col8x8_remaining = tile->mi_col_end - mi_col;
|
||||||
int block_row, block_col;
|
int block_row, block_col;
|
||||||
|
@ -1375,7 +1374,7 @@ static void set_fixed_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
|
|
||||||
static void copy_partitioning(VP9_COMMON *cm, MODE_INFO **mi_8x8,
|
static void copy_partitioning(VP9_COMMON *cm, MODE_INFO **mi_8x8,
|
||||||
MODE_INFO **prev_mi_8x8) {
|
MODE_INFO **prev_mi_8x8) {
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
int block_row, block_col;
|
int block_row, block_col;
|
||||||
|
|
||||||
for (block_row = 0; block_row < 8; ++block_row) {
|
for (block_row = 0; block_row < 8; ++block_row) {
|
||||||
|
@ -1393,7 +1392,7 @@ static void copy_partitioning(VP9_COMMON *cm, MODE_INFO **mi_8x8,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sb_has_motion(const VP9_COMMON *cm, MODE_INFO **prev_mi_8x8) {
|
static int sb_has_motion(const VP9_COMMON *cm, MODE_INFO **prev_mi_8x8) {
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
int block_row, block_col;
|
int block_row, block_col;
|
||||||
|
|
||||||
if (cm->prev_mi) {
|
if (cm->prev_mi) {
|
||||||
|
@ -1416,15 +1415,15 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCK *const x = &cpi->mb;
|
MACROBLOCK *const x = &cpi->mb;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
const struct segmentation *const seg = &cm->seg;
|
const struct segmentation *const seg = &cm->seg;
|
||||||
|
|
||||||
*(xd->mi_8x8[0]) = ctx->mic;
|
*(xd->mi[0]) = ctx->mic;
|
||||||
|
|
||||||
// For in frame adaptive Q, check for reseting the segment_id and updating
|
// For in frame adaptive Q, check for reseting the segment_id and updating
|
||||||
// the cyclic refresh map.
|
// the cyclic refresh map.
|
||||||
if ((cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) && seg->enabled) {
|
if ((cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) && seg->enabled) {
|
||||||
vp9_cyclic_refresh_update_segment(cpi, &xd->mi_8x8[0]->mbmi,
|
vp9_cyclic_refresh_update_segment(cpi, &xd->mi[0]->mbmi,
|
||||||
mi_row, mi_col, bsize, 1);
|
mi_row, mi_col, bsize, 1);
|
||||||
vp9_init_plane_quantizers(cpi, x);
|
vp9_init_plane_quantizers(cpi, x);
|
||||||
}
|
}
|
||||||
|
@ -1480,7 +1479,7 @@ static void encode_sb_rt(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
|
|
||||||
if (bsize >= BLOCK_8X8) {
|
if (bsize >= BLOCK_8X8) {
|
||||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||||
const int idx_str = xd->mode_info_stride * mi_row + mi_col;
|
const int idx_str = xd->mi_stride * mi_row + mi_col;
|
||||||
MODE_INFO ** mi_8x8 = cm->mi_grid_visible + idx_str;
|
MODE_INFO ** mi_8x8 = cm->mi_grid_visible + idx_str;
|
||||||
ctx = partition_plane_context(xd, mi_row, mi_col, bsize);
|
ctx = partition_plane_context(xd, mi_row, mi_col, bsize);
|
||||||
subsize = mi_8x8[0]->mbmi.sb_type;
|
subsize = mi_8x8[0]->mbmi.sb_type;
|
||||||
|
@ -1553,7 +1552,7 @@ static void rd_use_partition(VP9_COMP *cpi,
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCK *const x = &cpi->mb;
|
MACROBLOCK *const x = &cpi->mb;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
const int bsl = b_width_log2(bsize);
|
const int bsl = b_width_log2(bsize);
|
||||||
const int mi_step = num_4x4_blocks_wide_lookup[bsize] / 2;
|
const int mi_step = num_4x4_blocks_wide_lookup[bsize] / 2;
|
||||||
const int bss = (1 << bsl) / 4;
|
const int bss = (1 << bsl) / 4;
|
||||||
|
@ -1893,7 +1892,7 @@ static void get_sb_partition_size_range(VP9_COMP *cpi, MODE_INFO ** mi_8x8,
|
||||||
*min_block_size = MIN(*min_block_size, sb_type);
|
*min_block_size = MIN(*min_block_size, sb_type);
|
||||||
*max_block_size = MAX(*max_block_size, sb_type);
|
*max_block_size = MAX(*max_block_size, sb_type);
|
||||||
}
|
}
|
||||||
index += xd->mode_info_stride;
|
index += xd->mi_stride;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1914,10 +1913,10 @@ static void rd_auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
BLOCK_SIZE *max_block_size) {
|
BLOCK_SIZE *max_block_size) {
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||||
MODE_INFO **mi_8x8 = xd->mi_8x8;
|
MODE_INFO **mi_8x8 = xd->mi;
|
||||||
const int left_in_image = xd->left_available && mi_8x8[-1];
|
const int left_in_image = xd->left_available && mi_8x8[-1];
|
||||||
const int above_in_image = xd->up_available &&
|
const int above_in_image = xd->up_available &&
|
||||||
mi_8x8[-xd->mode_info_stride];
|
mi_8x8[-xd->mi_stride];
|
||||||
MODE_INFO **above_sb64_mi_8x8;
|
MODE_INFO **above_sb64_mi_8x8;
|
||||||
MODE_INFO **left_sb64_mi_8x8;
|
MODE_INFO **left_sb64_mi_8x8;
|
||||||
|
|
||||||
|
@ -1937,7 +1936,7 @@ static void rd_auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
// Find the min and max partition used in previous frame at this location
|
// Find the min and max partition used in previous frame at this location
|
||||||
if (cm->frame_type != KEY_FRAME) {
|
if (cm->frame_type != KEY_FRAME) {
|
||||||
MODE_INFO **const prev_mi =
|
MODE_INFO **const prev_mi =
|
||||||
&cm->prev_mi_grid_visible[mi_row * xd->mode_info_stride + mi_col];
|
&cm->prev_mi_grid_visible[mi_row * xd->mi_stride + mi_col];
|
||||||
get_sb_partition_size_range(cpi, prev_mi, &min_size, &max_size);
|
get_sb_partition_size_range(cpi, prev_mi, &min_size, &max_size);
|
||||||
}
|
}
|
||||||
// Find the min and max partition sizes used in the left SB64
|
// Find the min and max partition sizes used in the left SB64
|
||||||
|
@ -1948,7 +1947,7 @@ static void rd_auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
}
|
}
|
||||||
// Find the min and max partition sizes used in the above SB64.
|
// Find the min and max partition sizes used in the above SB64.
|
||||||
if (above_in_image) {
|
if (above_in_image) {
|
||||||
above_sb64_mi_8x8 = &mi_8x8[-xd->mode_info_stride * MI_BLOCK_SIZE];
|
above_sb64_mi_8x8 = &mi_8x8[-xd->mi_stride * MI_BLOCK_SIZE];
|
||||||
get_sb_partition_size_range(cpi, above_sb64_mi_8x8,
|
get_sb_partition_size_range(cpi, above_sb64_mi_8x8,
|
||||||
&min_size, &max_size);
|
&min_size, &max_size);
|
||||||
}
|
}
|
||||||
|
@ -2338,7 +2337,7 @@ static void encode_rd_sb_row(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
cpi->sf.use_lastframe_partitioning) ||
|
cpi->sf.use_lastframe_partitioning) ||
|
||||||
cpi->sf.partition_search_type == FIXED_PARTITION ||
|
cpi->sf.partition_search_type == FIXED_PARTITION ||
|
||||||
cpi->sf.partition_search_type == VAR_BASED_FIXED_PARTITION) {
|
cpi->sf.partition_search_type == VAR_BASED_FIXED_PARTITION) {
|
||||||
const int idx_str = cm->mode_info_stride * mi_row + mi_col;
|
const int idx_str = cm->mi_stride * mi_row + mi_col;
|
||||||
MODE_INFO **mi_8x8 = cm->mi_grid_visible + idx_str;
|
MODE_INFO **mi_8x8 = cm->mi_grid_visible + idx_str;
|
||||||
MODE_INFO **prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
|
MODE_INFO **prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
|
||||||
cpi->mb.source_variance = UINT_MAX;
|
cpi->mb.source_variance = UINT_MAX;
|
||||||
|
@ -2417,8 +2416,8 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
|
||||||
|
|
||||||
vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
|
vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
|
||||||
|
|
||||||
xd->mi_8x8[0]->mbmi.mode = DC_PRED;
|
xd->mi[0]->mbmi.mode = DC_PRED;
|
||||||
xd->mi_8x8[0]->mbmi.uv_mode = DC_PRED;
|
xd->mi[0]->mbmi.uv_mode = DC_PRED;
|
||||||
|
|
||||||
vp9_zero(cm->counts.y_mode);
|
vp9_zero(cm->counts.y_mode);
|
||||||
vp9_zero(cm->counts.uv_mode);
|
vp9_zero(cm->counts.uv_mode);
|
||||||
|
@ -2482,7 +2481,7 @@ static int get_skip_flag(MODE_INFO **mi_8x8, int mis, int ymbs, int xmbs) {
|
||||||
|
|
||||||
static void reset_skip_txfm_size(VP9_COMMON *cm, TX_SIZE txfm_max) {
|
static void reset_skip_txfm_size(VP9_COMMON *cm, TX_SIZE txfm_max) {
|
||||||
int mi_row, mi_col;
|
int mi_row, mi_col;
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
MODE_INFO **mi_ptr = cm->mi_grid_visible;
|
MODE_INFO **mi_ptr = cm->mi_grid_visible;
|
||||||
|
|
||||||
for (mi_row = 0; mi_row < cm->mi_rows; ++mi_row, mi_ptr += mis) {
|
for (mi_row = 0; mi_row < cm->mi_rows; ++mi_row, mi_ptr += mis) {
|
||||||
|
@ -2567,14 +2566,14 @@ static void nonrd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
MACROBLOCK *const x = &cpi->mb;
|
MACROBLOCK *const x = &cpi->mb;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
set_offsets(cpi, tile, mi_row, mi_col, bsize);
|
set_offsets(cpi, tile, mi_row, mi_col, bsize);
|
||||||
xd->mi_8x8[0]->mbmi.sb_type = bsize;
|
xd->mi[0]->mbmi.sb_type = bsize;
|
||||||
|
|
||||||
if (!frame_is_intra_only(cm)) {
|
if (!frame_is_intra_only(cm)) {
|
||||||
vp9_pick_inter_mode(cpi, x, tile, mi_row, mi_col,
|
vp9_pick_inter_mode(cpi, x, tile, mi_row, mi_col,
|
||||||
rate, dist, bsize);
|
rate, dist, bsize);
|
||||||
} else {
|
} else {
|
||||||
MB_PREDICTION_MODE intramode = DC_PRED;
|
MB_PREDICTION_MODE intramode = DC_PRED;
|
||||||
set_mode_info(&xd->mi_8x8[0]->mbmi, bsize, intramode);
|
set_mode_info(&xd->mi[0]->mbmi, bsize, intramode);
|
||||||
}
|
}
|
||||||
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
|
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
|
||||||
}
|
}
|
||||||
|
@ -2594,31 +2593,31 @@ static void fill_mode_info_sb(VP9_COMMON *cm, MACROBLOCK *x,
|
||||||
switch (partition) {
|
switch (partition) {
|
||||||
case PARTITION_NONE:
|
case PARTITION_NONE:
|
||||||
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
|
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
|
||||||
*(xd->mi_8x8[0]) = (get_block_context(x, subsize))->mic;
|
*(xd->mi[0]) = get_block_context(x, subsize)->mic;
|
||||||
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
|
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
|
||||||
break;
|
break;
|
||||||
case PARTITION_VERT:
|
case PARTITION_VERT:
|
||||||
*get_sb_index(x, subsize) = 0;
|
*get_sb_index(x, subsize) = 0;
|
||||||
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
|
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
|
||||||
*(xd->mi_8x8[0]) = (get_block_context(x, subsize))->mic;
|
*(xd->mi[0]) = get_block_context(x, subsize)->mic;
|
||||||
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
|
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
|
||||||
|
|
||||||
if (mi_col + hbs < cm->mi_cols) {
|
if (mi_col + hbs < cm->mi_cols) {
|
||||||
*get_sb_index(x, subsize) = 1;
|
*get_sb_index(x, subsize) = 1;
|
||||||
set_modeinfo_offsets(cm, xd, mi_row, mi_col + hbs);
|
set_modeinfo_offsets(cm, xd, mi_row, mi_col + hbs);
|
||||||
*(xd->mi_8x8[0]) = (get_block_context(x, subsize))->mic;
|
*(xd->mi[0]) = get_block_context(x, subsize)->mic;
|
||||||
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col + hbs, bsize);
|
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col + hbs, bsize);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PARTITION_HORZ:
|
case PARTITION_HORZ:
|
||||||
*get_sb_index(x, subsize) = 0;
|
*get_sb_index(x, subsize) = 0;
|
||||||
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
|
set_modeinfo_offsets(cm, xd, mi_row, mi_col);
|
||||||
*(xd->mi_8x8[0]) = (get_block_context(x, subsize))->mic;
|
*(xd->mi[0]) = get_block_context(x, subsize)->mic;
|
||||||
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
|
duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
|
||||||
if (mi_row + hbs < cm->mi_rows) {
|
if (mi_row + hbs < cm->mi_rows) {
|
||||||
*get_sb_index(x, subsize) = 1;
|
*get_sb_index(x, subsize) = 1;
|
||||||
set_modeinfo_offsets(cm, xd, mi_row + hbs, mi_col);
|
set_modeinfo_offsets(cm, xd, mi_row + hbs, mi_col);
|
||||||
*(xd->mi_8x8[0]) = (get_block_context(x, subsize))->mic;
|
*(xd->mi[0]) = get_block_context(x, subsize)->mic;
|
||||||
duplicate_mode_info_in_sb(cm, xd, mi_row + hbs, mi_col, bsize);
|
duplicate_mode_info_in_sb(cm, xd, mi_row + hbs, mi_col, bsize);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2711,7 +2710,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
if (partition_none_allowed) {
|
if (partition_none_allowed) {
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col,
|
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col,
|
||||||
&this_rate, &this_dist, bsize);
|
&this_rate, &this_dist, bsize);
|
||||||
ctx->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
ctx->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
|
|
||||||
if (this_rate != INT_MAX) {
|
if (this_rate != INT_MAX) {
|
||||||
int pl = partition_plane_context(xd, mi_row, mi_col, bsize);
|
int pl = partition_plane_context(xd, mi_row, mi_col, bsize);
|
||||||
|
@ -2801,7 +2800,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col,
|
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col,
|
||||||
&this_rate, &this_dist, subsize);
|
&this_rate, &this_dist, subsize);
|
||||||
|
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
|
|
||||||
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
|
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
|
||||||
|
|
||||||
|
@ -2813,7 +2812,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row + ms, mi_col,
|
nonrd_pick_sb_modes(cpi, tile, mi_row + ms, mi_col,
|
||||||
&this_rate, &this_dist, subsize);
|
&this_rate, &this_dist, subsize);
|
||||||
|
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
|
|
||||||
if (this_rate == INT_MAX) {
|
if (this_rate == INT_MAX) {
|
||||||
sum_rd = INT64_MAX;
|
sum_rd = INT64_MAX;
|
||||||
|
@ -2843,7 +2842,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
|
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col,
|
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col,
|
||||||
&this_rate, &this_dist, subsize);
|
&this_rate, &this_dist, subsize);
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
|
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
|
||||||
if (sum_rd < best_rd && mi_col + ms < cm->mi_cols) {
|
if (sum_rd < best_rd && mi_col + ms < cm->mi_cols) {
|
||||||
*get_sb_index(x, subsize) = 1;
|
*get_sb_index(x, subsize) = 1;
|
||||||
|
@ -2853,7 +2852,7 @@ static void nonrd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + ms,
|
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + ms,
|
||||||
&this_rate, &this_dist, subsize);
|
&this_rate, &this_dist, subsize);
|
||||||
|
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
|
|
||||||
if (this_rate == INT_MAX) {
|
if (this_rate == INT_MAX) {
|
||||||
sum_rd = INT64_MAX;
|
sum_rd = INT64_MAX;
|
||||||
|
@ -2921,7 +2920,7 @@ static void nonrd_use_partition(VP9_COMP *cpi,
|
||||||
MACROBLOCK *const x = &cpi->mb;
|
MACROBLOCK *const x = &cpi->mb;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
const int bsl = b_width_log2(bsize), hbs = (1 << bsl) / 4;
|
const int bsl = b_width_log2(bsize), hbs = (1 << bsl) / 4;
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
PARTITION_TYPE partition;
|
PARTITION_TYPE partition;
|
||||||
BLOCK_SIZE subsize;
|
BLOCK_SIZE subsize;
|
||||||
int rate = INT_MAX;
|
int rate = INT_MAX;
|
||||||
|
@ -2941,17 +2940,17 @@ static void nonrd_use_partition(VP9_COMP *cpi,
|
||||||
switch (partition) {
|
switch (partition) {
|
||||||
case PARTITION_NONE:
|
case PARTITION_NONE:
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
|
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
break;
|
break;
|
||||||
case PARTITION_VERT:
|
case PARTITION_VERT:
|
||||||
*get_sb_index(x, subsize) = 0;
|
*get_sb_index(x, subsize) = 0;
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
|
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
if (mi_col + hbs < cm->mi_cols) {
|
if (mi_col + hbs < cm->mi_cols) {
|
||||||
*get_sb_index(x, subsize) = 1;
|
*get_sb_index(x, subsize) = 1;
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + hbs,
|
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + hbs,
|
||||||
&rate, &dist, subsize);
|
&rate, &dist, subsize);
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
if (rate != INT_MAX && dist != INT64_MAX &&
|
if (rate != INT_MAX && dist != INT64_MAX &&
|
||||||
*totrate != INT_MAX && *totdist != INT64_MAX) {
|
*totrate != INT_MAX && *totdist != INT64_MAX) {
|
||||||
*totrate += rate;
|
*totrate += rate;
|
||||||
|
@ -2962,12 +2961,12 @@ static void nonrd_use_partition(VP9_COMP *cpi,
|
||||||
case PARTITION_HORZ:
|
case PARTITION_HORZ:
|
||||||
*get_sb_index(x, subsize) = 0;
|
*get_sb_index(x, subsize) = 0;
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
|
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = xd->mi[0]->mbmi;
|
||||||
if (mi_row + hbs < cm->mi_rows) {
|
if (mi_row + hbs < cm->mi_rows) {
|
||||||
*get_sb_index(x, subsize) = 1;
|
*get_sb_index(x, subsize) = 1;
|
||||||
nonrd_pick_sb_modes(cpi, tile, mi_row + hbs, mi_col,
|
nonrd_pick_sb_modes(cpi, tile, mi_row + hbs, mi_col,
|
||||||
&rate, &dist, subsize);
|
&rate, &dist, subsize);
|
||||||
(get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
|
get_block_context(x, subsize)->mic.mbmi = mi_8x8[0]->mbmi;
|
||||||
if (rate != INT_MAX && dist != INT64_MAX &&
|
if (rate != INT_MAX && dist != INT64_MAX &&
|
||||||
*totrate != INT_MAX && *totdist != INT64_MAX) {
|
*totrate != INT_MAX && *totdist != INT64_MAX) {
|
||||||
*totrate += rate;
|
*totrate += rate;
|
||||||
|
@ -3035,7 +3034,7 @@ static void encode_nonrd_sb_row(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
mi_col += MI_BLOCK_SIZE) {
|
mi_col += MI_BLOCK_SIZE) {
|
||||||
int dummy_rate = 0;
|
int dummy_rate = 0;
|
||||||
int64_t dummy_dist = 0;
|
int64_t dummy_dist = 0;
|
||||||
const int idx_str = cm->mode_info_stride * mi_row + mi_col;
|
const int idx_str = cm->mi_stride * mi_row + mi_col;
|
||||||
MODE_INFO **mi_8x8 = cm->mi_grid_visible + idx_str;
|
MODE_INFO **mi_8x8 = cm->mi_grid_visible + idx_str;
|
||||||
MODE_INFO **prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
|
MODE_INFO **prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
|
||||||
|
|
||||||
|
@ -3089,9 +3088,9 @@ static void encode_frame_internal(VP9_COMP *cpi) {
|
||||||
vp9_zero(cm->counts.switchable_interp);
|
vp9_zero(cm->counts.switchable_interp);
|
||||||
vp9_zero(cpi->tx_stepdown_count);
|
vp9_zero(cpi->tx_stepdown_count);
|
||||||
|
|
||||||
xd->mi_8x8 = cm->mi_grid_visible;
|
xd->mi = cm->mi_grid_visible;
|
||||||
// required for vp9_frame_init_quantizer
|
// required for vp9_frame_init_quantizer
|
||||||
xd->mi_8x8[0] = cm->mi;
|
xd->mi[0] = cm->mi;
|
||||||
|
|
||||||
vp9_zero(cm->counts.mv);
|
vp9_zero(cm->counts.mv);
|
||||||
vp9_zero(cpi->coef_counts);
|
vp9_zero(cpi->coef_counts);
|
||||||
|
@ -3415,12 +3414,12 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCK *const x = &cpi->mb;
|
MACROBLOCK *const x = &cpi->mb;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MODE_INFO **mi_8x8 = xd->mi_8x8;
|
MODE_INFO **mi_8x8 = xd->mi;
|
||||||
MODE_INFO *mi = mi_8x8[0];
|
MODE_INFO *mi = mi_8x8[0];
|
||||||
MB_MODE_INFO *mbmi = &mi->mbmi;
|
MB_MODE_INFO *mbmi = &mi->mbmi;
|
||||||
PICK_MODE_CONTEXT *ctx = get_block_context(x, bsize);
|
PICK_MODE_CONTEXT *ctx = get_block_context(x, bsize);
|
||||||
unsigned int segment_id = mbmi->segment_id;
|
unsigned int segment_id = mbmi->segment_id;
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
|
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
|
||||||
const int mi_height = num_8x8_blocks_high_lookup[bsize];
|
const int mi_height = num_8x8_blocks_high_lookup[bsize];
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ static void optimize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
MACROBLOCKD *const xd = &mb->e_mbd;
|
MACROBLOCKD *const xd = &mb->e_mbd;
|
||||||
struct macroblock_plane *p = &mb->plane[plane];
|
struct macroblock_plane *p = &mb->plane[plane];
|
||||||
struct macroblockd_plane *pd = &xd->plane[plane];
|
struct macroblockd_plane *pd = &xd->plane[plane];
|
||||||
const int ref = is_inter_block(&xd->mi_8x8[0]->mbmi);
|
const int ref = is_inter_block(&xd->mi[0]->mbmi);
|
||||||
vp9_token_state tokens[1025][2];
|
vp9_token_state tokens[1025][2];
|
||||||
unsigned best_index[1025][2];
|
unsigned best_index[1025][2];
|
||||||
const int16_t *coeff = BLOCK_OFFSET(mb->plane[plane].coeff, block);
|
const int16_t *coeff = BLOCK_OFFSET(mb->plane[plane].coeff, block);
|
||||||
|
@ -139,7 +139,7 @@ static void optimize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
|
|
||||||
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
|
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
|
||||||
rdmult = mb->rdmult * err_mult;
|
rdmult = mb->rdmult * err_mult;
|
||||||
if (!is_inter_block(&mb->e_mbd.mi_8x8[0]->mbmi))
|
if (!is_inter_block(&mb->e_mbd.mi[0]->mbmi))
|
||||||
rdmult = (rdmult * 9) >> 4;
|
rdmult = (rdmult * 9) >> 4;
|
||||||
rddiv = mb->rddiv;
|
rddiv = mb->rddiv;
|
||||||
/* Initialize the sentinel node of the trellis. */
|
/* Initialize the sentinel node of the trellis. */
|
||||||
|
@ -452,7 +452,7 @@ void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||||
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
struct optimize_ctx ctx;
|
struct optimize_ctx ctx;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
struct encode_b_args arg = {x, &ctx, &mbmi->skip};
|
struct encode_b_args arg = {x, &ctx, &mbmi->skip};
|
||||||
int plane;
|
int plane;
|
||||||
|
|
||||||
|
@ -477,7 +477,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
struct encode_b_args* const args = arg;
|
struct encode_b_args* const args = arg;
|
||||||
MACROBLOCK *const x = args->x;
|
MACROBLOCK *const x = args->x;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
struct macroblock_plane *const p = &x->plane[plane];
|
struct macroblock_plane *const p = &x->plane[plane];
|
||||||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||||
int16_t *coeff = BLOCK_OFFSET(p->coeff, block);
|
int16_t *coeff = BLOCK_OFFSET(p->coeff, block);
|
||||||
|
@ -562,7 +562,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
case TX_4X4:
|
case TX_4X4:
|
||||||
tx_type = get_tx_type_4x4(pd->plane_type, xd, block);
|
tx_type = get_tx_type_4x4(pd->plane_type, xd, block);
|
||||||
scan_order = &vp9_scan_orders[TX_4X4][tx_type];
|
scan_order = &vp9_scan_orders[TX_4X4][tx_type];
|
||||||
mode = plane == 0 ? get_y_mode(xd->mi_8x8[0], block) : mbmi->uv_mode;
|
mode = plane == 0 ? get_y_mode(xd->mi[0], block) : mbmi->uv_mode;
|
||||||
vp9_predict_intra_block(xd, block, bwl, TX_4X4, mode,
|
vp9_predict_intra_block(xd, block, bwl, TX_4X4, mode,
|
||||||
x->skip_encode ? src : dst,
|
x->skip_encode ? src : dst,
|
||||||
x->skip_encode ? src_stride : dst_stride,
|
x->skip_encode ? src_stride : dst_stride,
|
||||||
|
@ -608,14 +608,14 @@ void vp9_encode_block_intra(MACROBLOCK *x, int plane, int block,
|
||||||
|
|
||||||
void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
|
void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
|
||||||
const MACROBLOCKD *const xd = &x->e_mbd;
|
const MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
struct encode_b_args arg = {x, NULL, &xd->mi_8x8[0]->mbmi.skip};
|
struct encode_b_args arg = {x, NULL, &xd->mi[0]->mbmi.skip};
|
||||||
|
|
||||||
vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block_intra,
|
vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block_intra,
|
||||||
&arg);
|
&arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred) {
|
int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred) {
|
||||||
MB_MODE_INFO * mbmi = &x->e_mbd.mi_8x8[0]->mbmi;
|
MB_MODE_INFO * mbmi = &x->e_mbd.mi[0]->mbmi;
|
||||||
x->skip_encode = 0;
|
x->skip_encode = 0;
|
||||||
mbmi->mode = DC_PRED;
|
mbmi->mode = DC_PRED;
|
||||||
mbmi->ref_frame[0] = INTRA_FRAME;
|
mbmi->ref_frame[0] = INTRA_FRAME;
|
||||||
|
|
|
@ -242,7 +242,7 @@ static void inc_mvs(const MB_MODE_INFO *mbmi, const int_mv mvs[2],
|
||||||
}
|
}
|
||||||
|
|
||||||
void vp9_update_mv_count(VP9_COMMON *cm, const MACROBLOCKD *xd) {
|
void vp9_update_mv_count(VP9_COMMON *cm, const MACROBLOCKD *xd) {
|
||||||
const MODE_INFO *mi = xd->mi_8x8[0];
|
const MODE_INFO *mi = xd->mi[0];
|
||||||
const MB_MODE_INFO *const mbmi = &mi->mbmi;
|
const MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||||
|
|
||||||
if (mbmi->sb_type < BLOCK_8X8) {
|
if (mbmi->sb_type < BLOCK_8X8) {
|
||||||
|
|
|
@ -384,7 +384,7 @@ static unsigned int zz_motion_search(const MACROBLOCK *x) {
|
||||||
const uint8_t *const ref = xd->plane[0].pre[0].buf;
|
const uint8_t *const ref = xd->plane[0].pre[0].buf;
|
||||||
const int ref_stride = xd->plane[0].pre[0].stride;
|
const int ref_stride = xd->plane[0].pre[0].stride;
|
||||||
unsigned int sse;
|
unsigned int sse;
|
||||||
vp9_variance_fn_t fn = get_block_variance_fn(xd->mi_8x8[0]->mbmi.sb_type);
|
vp9_variance_fn_t fn = get_block_variance_fn(xd->mi[0]->mbmi.sb_type);
|
||||||
fn(src, src_stride, ref, ref_stride, &sse);
|
fn(src, src_stride, ref, ref_stride, &sse);
|
||||||
return sse;
|
return sse;
|
||||||
}
|
}
|
||||||
|
@ -398,7 +398,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int num00, tmp_err, n, sr = 0;
|
int num00, tmp_err, n, sr = 0;
|
||||||
int step_param = 3;
|
int step_param = 3;
|
||||||
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
|
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
|
||||||
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
|
const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
|
||||||
vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[bsize];
|
vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[bsize];
|
||||||
int new_mv_mode_penalty = 256;
|
int new_mv_mode_penalty = 256;
|
||||||
const int quart_frm = MIN(cpi->common.width, cpi->common.height);
|
const int quart_frm = MIN(cpi->common.width, cpi->common.height);
|
||||||
|
@ -542,8 +542,8 @@ void vp9_first_pass(VP9_COMP *cpi) {
|
||||||
vp9_setup_pre_planes(xd, 0, first_ref_buf, 0, 0, NULL);
|
vp9_setup_pre_planes(xd, 0, first_ref_buf, 0, 0, NULL);
|
||||||
vp9_setup_dst_planes(xd, new_yv12, 0, 0);
|
vp9_setup_dst_planes(xd, new_yv12, 0, 0);
|
||||||
|
|
||||||
xd->mi_8x8 = cm->mi_grid_visible;
|
xd->mi = cm->mi_grid_visible;
|
||||||
xd->mi_8x8[0] = cm->mi;
|
xd->mi[0] = cm->mi;
|
||||||
|
|
||||||
vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
|
vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
|
||||||
|
|
||||||
|
@ -591,8 +591,8 @@ void vp9_first_pass(VP9_COMP *cpi) {
|
||||||
xd->plane[1].dst.buf = new_yv12->u_buffer + recon_uvoffset;
|
xd->plane[1].dst.buf = new_yv12->u_buffer + recon_uvoffset;
|
||||||
xd->plane[2].dst.buf = new_yv12->v_buffer + recon_uvoffset;
|
xd->plane[2].dst.buf = new_yv12->v_buffer + recon_uvoffset;
|
||||||
xd->left_available = (mb_col != 0);
|
xd->left_available = (mb_col != 0);
|
||||||
xd->mi_8x8[0]->mbmi.sb_type = bsize;
|
xd->mi[0]->mbmi.sb_type = bsize;
|
||||||
xd->mi_8x8[0]->mbmi.ref_frame[0] = INTRA_FRAME;
|
xd->mi[0]->mbmi.ref_frame[0] = INTRA_FRAME;
|
||||||
set_mi_row_col(xd, &tile,
|
set_mi_row_col(xd, &tile,
|
||||||
mb_row << 1, num_8x8_blocks_high_lookup[bsize],
|
mb_row << 1, num_8x8_blocks_high_lookup[bsize],
|
||||||
mb_col << 1, num_8x8_blocks_wide_lookup[bsize],
|
mb_col << 1, num_8x8_blocks_wide_lookup[bsize],
|
||||||
|
@ -711,11 +711,11 @@ void vp9_first_pass(VP9_COMP *cpi) {
|
||||||
mv.as_mv.row *= 8;
|
mv.as_mv.row *= 8;
|
||||||
mv.as_mv.col *= 8;
|
mv.as_mv.col *= 8;
|
||||||
this_error = motion_error;
|
this_error = motion_error;
|
||||||
xd->mi_8x8[0]->mbmi.mode = NEWMV;
|
xd->mi[0]->mbmi.mode = NEWMV;
|
||||||
xd->mi_8x8[0]->mbmi.mv[0] = mv;
|
xd->mi[0]->mbmi.mv[0] = mv;
|
||||||
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
|
xd->mi[0]->mbmi.tx_size = TX_4X4;
|
||||||
xd->mi_8x8[0]->mbmi.ref_frame[0] = LAST_FRAME;
|
xd->mi[0]->mbmi.ref_frame[0] = LAST_FRAME;
|
||||||
xd->mi_8x8[0]->mbmi.ref_frame[1] = NONE;
|
xd->mi[0]->mbmi.ref_frame[1] = NONE;
|
||||||
vp9_build_inter_predictors_sby(xd, mb_row << 1, mb_col << 1, bsize);
|
vp9_build_inter_predictors_sby(xd, mb_row << 1, mb_col << 1, bsize);
|
||||||
vp9_encode_sby_pass1(x, bsize);
|
vp9_encode_sby_pass1(x, bsize);
|
||||||
sum_mvr += mv.as_mv.row;
|
sum_mvr += mv.as_mv.row;
|
||||||
|
|
|
@ -61,8 +61,8 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
|
||||||
&sse);
|
&sse);
|
||||||
}
|
}
|
||||||
|
|
||||||
xd->mi_8x8[0]->mbmi.mode = NEWMV;
|
xd->mi[0]->mbmi.mode = NEWMV;
|
||||||
xd->mi_8x8[0]->mbmi.mv[0].as_mv = *dst_mv;
|
xd->mi[0]->mbmi.mv[0].as_mv = *dst_mv;
|
||||||
|
|
||||||
vp9_build_inter_predictors_sby(xd, mb_row, mb_col, BLOCK_16X16);
|
vp9_build_inter_predictors_sby(xd, mb_row, mb_col, BLOCK_16X16);
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ static int find_best_16x16_intra(VP9_COMP *cpi,
|
||||||
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
|
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
|
||||||
unsigned int err;
|
unsigned int err;
|
||||||
|
|
||||||
xd->mi_8x8[0]->mbmi.mode = mode;
|
xd->mi[0]->mbmi.mode = mode;
|
||||||
vp9_predict_intra_block(xd, 0, 2, TX_16X16, mode,
|
vp9_predict_intra_block(xd, 0, 2, TX_16X16, mode,
|
||||||
x->plane[0].src.buf, x->plane[0].src.stride,
|
x->plane[0].src.buf, x->plane[0].src.stride,
|
||||||
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
|
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
|
||||||
|
@ -252,7 +252,7 @@ static void update_mbgraph_frame_stats(VP9_COMP *cpi,
|
||||||
xd->plane[0].dst.stride = buf->y_stride;
|
xd->plane[0].dst.stride = buf->y_stride;
|
||||||
xd->plane[0].pre[0].stride = buf->y_stride;
|
xd->plane[0].pre[0].stride = buf->y_stride;
|
||||||
xd->plane[1].dst.stride = buf->uv_stride;
|
xd->plane[1].dst.stride = buf->uv_stride;
|
||||||
xd->mi_8x8[0] = &mi_local;
|
xd->mi[0] = &mi_local;
|
||||||
mi_local.mbmi.sb_type = BLOCK_16X16;
|
mi_local.mbmi.sb_type = BLOCK_16X16;
|
||||||
mi_local.mbmi.ref_frame[0] = LAST_FRAME;
|
mi_local.mbmi.ref_frame[0] = LAST_FRAME;
|
||||||
mi_local.mbmi.ref_frame[1] = NONE;
|
mi_local.mbmi.ref_frame[1] = NONE;
|
||||||
|
|
|
@ -414,7 +414,7 @@ static void update_reference_segmentation_map(VP9_COMP *cpi) {
|
||||||
uint8_t *cache = cache_ptr;
|
uint8_t *cache = cache_ptr;
|
||||||
for (col = 0; col < cm->mi_cols; col++, mi_8x8++, cache++)
|
for (col = 0; col < cm->mi_cols; col++, mi_8x8++, cache++)
|
||||||
cache[0] = mi_8x8[0]->mbmi.segment_id;
|
cache[0] = mi_8x8[0]->mbmi.segment_id;
|
||||||
mi_8x8_ptr += cm->mode_info_stride;
|
mi_8x8_ptr += cm->mi_stride;
|
||||||
cache_ptr += cm->mi_cols;
|
cache_ptr += cm->mi_cols;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2846,8 +2846,8 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore prev_mi
|
// restore prev_mi
|
||||||
cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
|
cm->prev_mi = cm->prev_mip + cm->mi_stride + 1;
|
||||||
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mode_info_stride + 1;
|
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mi_stride + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SvcEncode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
|
static void SvcEncode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
|
||||||
|
|
|
@ -31,7 +31,7 @@ static void full_pixel_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
BLOCK_SIZE bsize, int mi_row, int mi_col,
|
BLOCK_SIZE bsize, int mi_row, int mi_col,
|
||||||
int_mv *tmp_mv) {
|
int_mv *tmp_mv) {
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
|
struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
|
||||||
int step_param;
|
int step_param;
|
||||||
int sadpb = x->sadperbit16;
|
int sadpb = x->sadperbit16;
|
||||||
|
@ -135,7 +135,7 @@ static void sub_pixel_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
BLOCK_SIZE bsize, int mi_row, int mi_col,
|
BLOCK_SIZE bsize, int mi_row, int mi_col,
|
||||||
MV *tmp_mv, int *rate_mv) {
|
MV *tmp_mv, int *rate_mv) {
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
|
struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
|
||||||
int ref = mbmi->ref_frame[0];
|
int ref = mbmi->ref_frame[0];
|
||||||
MV ref_mv = mbmi->ref_mvs[ref][0].as_mv;
|
MV ref_mv = mbmi->ref_mvs[ref][0].as_mv;
|
||||||
|
@ -209,7 +209,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int64_t *returndistortion,
|
int64_t *returndistortion,
|
||||||
BLOCK_SIZE bsize) {
|
BLOCK_SIZE bsize) {
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
struct macroblock_plane *const p = &x->plane[0];
|
struct macroblock_plane *const p = &x->plane[0];
|
||||||
struct macroblockd_plane *const pd = &xd->plane[0];
|
struct macroblockd_plane *const pd = &xd->plane[0];
|
||||||
const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
|
const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
|
||||||
|
@ -343,7 +343,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
mbmi->mode = best_mode;
|
mbmi->mode = best_mode;
|
||||||
mbmi->ref_frame[0] = best_ref_frame;
|
mbmi->ref_frame[0] = best_ref_frame;
|
||||||
mbmi->mv[0].as_int = frame_mv[best_mode][best_ref_frame].as_int;
|
mbmi->mv[0].as_int = frame_mv[best_mode][best_ref_frame].as_int;
|
||||||
xd->mi_8x8[0]->bmi[0].as_mv[0].as_int = mbmi->mv[0].as_int;
|
xd->mi[0]->bmi[0].as_mv[0].as_int = mbmi->mv[0].as_int;
|
||||||
|
|
||||||
// Perform intra prediction search, if the best SAD is above a certain
|
// Perform intra prediction search, if the best SAD is above a certain
|
||||||
// threshold.
|
// threshold.
|
||||||
|
|
|
@ -217,7 +217,7 @@ void vp9_init_plane_quantizers(VP9_COMP *cpi, MACROBLOCK *x) {
|
||||||
const VP9_COMMON *const cm = &cpi->common;
|
const VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
QUANTS *const quants = &cpi->quants;
|
QUANTS *const quants = &cpi->quants;
|
||||||
const int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
|
const int segment_id = xd->mi[0]->mbmi.segment_id;
|
||||||
const int qindex = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex);
|
const int qindex = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex);
|
||||||
const int rdmult = vp9_compute_rd_mult(cpi, qindex + cm->y_dc_delta_q);
|
const int rdmult = vp9_compute_rd_mult(cpi, qindex + cm->y_dc_delta_q);
|
||||||
const int zbin = cpi->zbin_mode_boost + x->act_zbin_adj;
|
const int zbin = cpi->zbin_mode_boost + x->act_zbin_adj;
|
||||||
|
|
|
@ -432,7 +432,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
|
||||||
int i;
|
int i;
|
||||||
int64_t rate_sum = 0;
|
int64_t rate_sum = 0;
|
||||||
int64_t dist_sum = 0;
|
int64_t dist_sum = 0;
|
||||||
const int ref = xd->mi_8x8[0]->mbmi.ref_frame[0];
|
const int ref = xd->mi[0]->mbmi.ref_frame[0];
|
||||||
unsigned int sse;
|
unsigned int sse;
|
||||||
|
|
||||||
for (i = 0; i < MAX_MB_PLANE; ++i) {
|
for (i = 0; i < MAX_MB_PLANE; ++i) {
|
||||||
|
@ -556,7 +556,7 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
|
||||||
const int16_t *scan, const int16_t *nb,
|
const int16_t *scan, const int16_t *nb,
|
||||||
int use_fast_coef_costing) {
|
int use_fast_coef_costing) {
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
const struct macroblock_plane *p = &x->plane[plane];
|
const struct macroblock_plane *p = &x->plane[plane];
|
||||||
const struct macroblockd_plane *pd = &xd->plane[plane];
|
const struct macroblockd_plane *pd = &xd->plane[plane];
|
||||||
const PLANE_TYPE type = pd->plane_type;
|
const PLANE_TYPE type = pd->plane_type;
|
||||||
|
@ -638,7 +638,7 @@ static void dist_block(int plane, int block, TX_SIZE tx_size,
|
||||||
&this_sse) >> shift;
|
&this_sse) >> shift;
|
||||||
args->sse = this_sse >> shift;
|
args->sse = this_sse >> shift;
|
||||||
|
|
||||||
if (x->skip_encode && !is_inter_block(&xd->mi_8x8[0]->mbmi)) {
|
if (x->skip_encode && !is_inter_block(&xd->mi[0]->mbmi)) {
|
||||||
// TODO(jingning): tune the model to better capture the distortion.
|
// TODO(jingning): tune the model to better capture the distortion.
|
||||||
int64_t p = (pd->dequant[1] * pd->dequant[1] *
|
int64_t p = (pd->dequant[1] * pd->dequant[1] *
|
||||||
(1 << ss_txfrm_size)) >> (shift + 2);
|
(1 << ss_txfrm_size)) >> (shift + 2);
|
||||||
|
@ -663,7 +663,7 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
struct rdcost_block_args *args = arg;
|
struct rdcost_block_args *args = arg;
|
||||||
MACROBLOCK *const x = args->x;
|
MACROBLOCK *const x = args->x;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
int64_t rd1, rd2, rd;
|
int64_t rd1, rd2, rd;
|
||||||
|
|
||||||
if (args->skip)
|
if (args->skip)
|
||||||
|
@ -749,7 +749,7 @@ static void txfm_rd_in_plane(MACROBLOCK *x,
|
||||||
args.use_fast_coef_costing = use_fast_coef_casting;
|
args.use_fast_coef_costing = use_fast_coef_casting;
|
||||||
|
|
||||||
if (plane == 0)
|
if (plane == 0)
|
||||||
xd->mi_8x8[0]->mbmi.tx_size = tx_size;
|
xd->mi[0]->mbmi.tx_size = tx_size;
|
||||||
|
|
||||||
vp9_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
|
vp9_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
|
||||||
|
|
||||||
|
@ -779,7 +779,7 @@ static void choose_largest_txfm_size(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
const TX_SIZE largest_tx_size = tx_mode_to_biggest_tx_size[cm->tx_mode];
|
const TX_SIZE largest_tx_size = tx_mode_to_biggest_tx_size[cm->tx_mode];
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
|
|
||||||
mbmi->tx_size = MIN(max_tx_size, largest_tx_size);
|
mbmi->tx_size = MIN(max_tx_size, largest_tx_size);
|
||||||
|
|
||||||
|
@ -798,7 +798,7 @@ static void choose_txfm_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
|
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
vp9_prob skip_prob = vp9_get_skip_prob(cm, xd);
|
vp9_prob skip_prob = vp9_get_skip_prob(cm, xd);
|
||||||
int64_t rd[TX_SIZES][2] = {{INT64_MAX, INT64_MAX},
|
int64_t rd[TX_SIZES][2] = {{INT64_MAX, INT64_MAX},
|
||||||
{INT64_MAX, INT64_MAX},
|
{INT64_MAX, INT64_MAX},
|
||||||
|
@ -881,7 +881,7 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
|
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
vp9_prob skip_prob = vp9_get_skip_prob(cm, xd);
|
vp9_prob skip_prob = vp9_get_skip_prob(cm, xd);
|
||||||
int64_t rd[TX_SIZES][2] = {{INT64_MAX, INT64_MAX},
|
int64_t rd[TX_SIZES][2] = {{INT64_MAX, INT64_MAX},
|
||||||
{INT64_MAX, INT64_MAX},
|
{INT64_MAX, INT64_MAX},
|
||||||
|
@ -951,7 +951,7 @@ static void inter_super_block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate,
|
||||||
int r[TX_SIZES][2], s[TX_SIZES];
|
int r[TX_SIZES][2], s[TX_SIZES];
|
||||||
int64_t d[TX_SIZES], sse[TX_SIZES];
|
int64_t d[TX_SIZES], sse[TX_SIZES];
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
|
const TX_SIZE max_tx_size = max_txsize_lookup[bs];
|
||||||
TX_SIZE tx_size;
|
TX_SIZE tx_size;
|
||||||
|
|
||||||
|
@ -994,7 +994,7 @@ static void intra_super_block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate,
|
||||||
int64_t ref_best_rd) {
|
int64_t ref_best_rd) {
|
||||||
int64_t sse[TX_SIZES];
|
int64_t sse[TX_SIZES];
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
|
|
||||||
assert(bs == mbmi->sb_type);
|
assert(bs == mbmi->sb_type);
|
||||||
if (cpi->sf.tx_size_search_method != USE_FULL_RD) {
|
if (cpi->sf.tx_size_search_method != USE_FULL_RD) {
|
||||||
|
@ -1070,7 +1070,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
||||||
|
|
||||||
vpx_memcpy(ta, a, sizeof(ta));
|
vpx_memcpy(ta, a, sizeof(ta));
|
||||||
vpx_memcpy(tl, l, sizeof(tl));
|
vpx_memcpy(tl, l, sizeof(tl));
|
||||||
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
|
xd->mi[0]->mbmi.tx_size = TX_4X4;
|
||||||
|
|
||||||
for (mode = DC_PRED; mode <= TM_PRED; ++mode) {
|
for (mode = DC_PRED; mode <= TM_PRED; ++mode) {
|
||||||
int64_t this_rd;
|
int64_t this_rd;
|
||||||
|
@ -1099,7 +1099,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
||||||
int16_t *const src_diff = raster_block_offset_int16(BLOCK_8X8, block,
|
int16_t *const src_diff = raster_block_offset_int16(BLOCK_8X8, block,
|
||||||
p->src_diff);
|
p->src_diff);
|
||||||
int16_t *const coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
|
int16_t *const coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
|
||||||
xd->mi_8x8[0]->bmi[block].as_mode = mode;
|
xd->mi[0]->bmi[block].as_mode = mode;
|
||||||
vp9_predict_intra_block(xd, block, 1,
|
vp9_predict_intra_block(xd, block, 1,
|
||||||
TX_4X4, mode,
|
TX_4X4, mode,
|
||||||
x->skip_encode ? src : dst,
|
x->skip_encode ? src : dst,
|
||||||
|
@ -1172,10 +1172,10 @@ static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP *cpi, MACROBLOCK *mb,
|
||||||
int64_t best_rd) {
|
int64_t best_rd) {
|
||||||
int i, j;
|
int i, j;
|
||||||
const MACROBLOCKD *const xd = &mb->e_mbd;
|
const MACROBLOCKD *const xd = &mb->e_mbd;
|
||||||
MODE_INFO *const mic = xd->mi_8x8[0];
|
MODE_INFO *const mic = xd->mi[0];
|
||||||
const MODE_INFO *above_mi = xd->mi_8x8[-xd->mode_info_stride];
|
const MODE_INFO *above_mi = xd->mi[-xd->mi_stride];
|
||||||
const MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL;
|
const MODE_INFO *left_mi = xd->left_available ? xd->mi[-1] : NULL;
|
||||||
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
|
const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
|
||||||
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
|
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
|
||||||
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
|
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
|
||||||
int idx, idy;
|
int idx, idy;
|
||||||
|
@ -1242,7 +1242,7 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
MB_PREDICTION_MODE mode;
|
MB_PREDICTION_MODE mode;
|
||||||
MB_PREDICTION_MODE mode_selected = DC_PRED;
|
MB_PREDICTION_MODE mode_selected = DC_PRED;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MODE_INFO *const mic = xd->mi_8x8[0];
|
MODE_INFO *const mic = xd->mi[0];
|
||||||
int this_rate, this_rate_tokenonly, s;
|
int this_rate, this_rate_tokenonly, s;
|
||||||
int64_t this_distortion, this_rd;
|
int64_t this_distortion, this_rd;
|
||||||
TX_SIZE best_tx = TX_4X4;
|
TX_SIZE best_tx = TX_4X4;
|
||||||
|
@ -1256,8 +1256,8 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
/* Y Search for intra prediction mode */
|
/* Y Search for intra prediction mode */
|
||||||
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
|
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
|
||||||
int64_t local_tx_cache[TX_MODES];
|
int64_t local_tx_cache[TX_MODES];
|
||||||
MODE_INFO *above_mi = xd->mi_8x8[-xd->mode_info_stride];
|
MODE_INFO *above_mi = xd->mi[-xd->mi_stride];
|
||||||
MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL;
|
MODE_INFO *left_mi = xd->left_available ? xd->mi[-1] : NULL;
|
||||||
|
|
||||||
if (!(cpi->sf.intra_y_mode_mask[max_txsize_lookup[bsize]] & (1 << mode)))
|
if (!(cpi->sf.intra_y_mode_mask[max_txsize_lookup[bsize]] & (1 << mode)))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1311,7 +1311,7 @@ static void super_block_uvrd(const VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int64_t *sse, BLOCK_SIZE bsize,
|
int64_t *sse, BLOCK_SIZE bsize,
|
||||||
int64_t ref_best_rd) {
|
int64_t ref_best_rd) {
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
TX_SIZE uv_txfm_size = get_uv_tx_size(mbmi);
|
TX_SIZE uv_txfm_size = get_uv_tx_size(mbmi);
|
||||||
int plane;
|
int plane;
|
||||||
int pnrate = 0, pnskip = 1;
|
int pnrate = 0, pnskip = 1;
|
||||||
|
@ -1368,7 +1368,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
if (!(cpi->sf.intra_uv_mode_mask[max_tx_size] & (1 << mode)))
|
if (!(cpi->sf.intra_uv_mode_mask[max_tx_size] & (1 << mode)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
xd->mi_8x8[0]->mbmi.uv_mode = mode;
|
xd->mi[0]->mbmi.uv_mode = mode;
|
||||||
|
|
||||||
super_block_uvrd(cpi, x, &this_rate_tokenonly,
|
super_block_uvrd(cpi, x, &this_rate_tokenonly,
|
||||||
&this_distortion, &s, &this_sse, bsize, best_rd);
|
&this_distortion, &s, &this_sse, bsize, best_rd);
|
||||||
|
@ -1409,7 +1409,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xd->mi_8x8[0]->mbmi.uv_mode = mode_selected;
|
xd->mi[0]->mbmi.uv_mode = mode_selected;
|
||||||
return best_rd;
|
return best_rd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1420,7 +1420,7 @@ static int64_t rd_sbuv_dcpred(const VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
const VP9_COMMON *cm = &cpi->common;
|
const VP9_COMMON *cm = &cpi->common;
|
||||||
int64_t unused;
|
int64_t unused;
|
||||||
|
|
||||||
x->e_mbd.mi_8x8[0]->mbmi.uv_mode = DC_PRED;
|
x->e_mbd.mi[0]->mbmi.uv_mode = DC_PRED;
|
||||||
super_block_uvrd(cpi, x, rate_tokenonly, distortion,
|
super_block_uvrd(cpi, x, rate_tokenonly, distortion,
|
||||||
skippable, &unused, bsize, INT64_MAX);
|
skippable, &unused, bsize, INT64_MAX);
|
||||||
*rate = *rate_tokenonly + x->intra_uv_mode_cost[cm->frame_type][DC_PRED];
|
*rate = *rate_tokenonly + x->intra_uv_mode_cost[cm->frame_type][DC_PRED];
|
||||||
|
@ -1446,13 +1446,13 @@ static void choose_intra_uv_mode(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
||||||
rate_uv, rate_uv_tokenonly, dist_uv, skip_uv,
|
rate_uv, rate_uv_tokenonly, dist_uv, skip_uv,
|
||||||
bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize, max_tx_size);
|
bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize, max_tx_size);
|
||||||
}
|
}
|
||||||
*mode_uv = x->e_mbd.mi_8x8[0]->mbmi.uv_mode;
|
*mode_uv = x->e_mbd.mi[0]->mbmi.uv_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cost_mv_ref(const VP9_COMP *cpi, MB_PREDICTION_MODE mode,
|
static int cost_mv_ref(const VP9_COMP *cpi, MB_PREDICTION_MODE mode,
|
||||||
int mode_context) {
|
int mode_context) {
|
||||||
const MACROBLOCK *const x = &cpi->mb;
|
const MACROBLOCK *const x = &cpi->mb;
|
||||||
const int segment_id = x->e_mbd.mi_8x8[0]->mbmi.segment_id;
|
const int segment_id = x->e_mbd.mi[0]->mbmi.segment_id;
|
||||||
|
|
||||||
// Don't account for mode here if segment skip is enabled.
|
// Don't account for mode here if segment skip is enabled.
|
||||||
if (!vp9_segfeature_active(&cpi->common.seg, segment_id, SEG_LVL_SKIP)) {
|
if (!vp9_segfeature_active(&cpi->common.seg, segment_id, SEG_LVL_SKIP)) {
|
||||||
|
@ -1477,7 +1477,7 @@ static int labels2mode(VP9_COMP *cpi, MACROBLOCKD *xd, int i,
|
||||||
int_mv seg_mvs[MAX_REF_FRAMES],
|
int_mv seg_mvs[MAX_REF_FRAMES],
|
||||||
int_mv *best_ref_mv[2],
|
int_mv *best_ref_mv[2],
|
||||||
const int *mvjcost, int *mvcost[2]) {
|
const int *mvjcost, int *mvcost[2]) {
|
||||||
MODE_INFO *const mic = xd->mi_8x8[0];
|
MODE_INFO *const mic = xd->mi[0];
|
||||||
const MB_MODE_INFO *const mbmi = &mic->mbmi;
|
const MB_MODE_INFO *const mbmi = &mic->mbmi;
|
||||||
int thismvcost = 0;
|
int thismvcost = 0;
|
||||||
int idx, idy;
|
int idx, idy;
|
||||||
|
@ -1545,7 +1545,7 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
struct macroblockd_plane *const pd = &xd->plane[0];
|
struct macroblockd_plane *const pd = &xd->plane[0];
|
||||||
struct macroblock_plane *const p = &x->plane[0];
|
struct macroblock_plane *const p = &x->plane[0];
|
||||||
MODE_INFO *const mi = xd->mi_8x8[0];
|
MODE_INFO *const mi = xd->mi[0];
|
||||||
const BLOCK_SIZE plane_bsize = get_plane_block_size(mi->mbmi.sb_type, pd);
|
const BLOCK_SIZE plane_bsize = get_plane_block_size(mi->mbmi.sb_type, pd);
|
||||||
const int width = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
|
const int width = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
|
||||||
const int height = 4 * num_4x4_blocks_high_lookup[plane_bsize];
|
const int height = 4 * num_4x4_blocks_high_lookup[plane_bsize];
|
||||||
|
@ -1642,7 +1642,7 @@ static INLINE int mv_check_bounds(const MACROBLOCK *x, const MV *mv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void mi_buf_shift(MACROBLOCK *x, int i) {
|
static INLINE void mi_buf_shift(MACROBLOCK *x, int i) {
|
||||||
MB_MODE_INFO *const mbmi = &x->e_mbd.mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &x->e_mbd.mi[0]->mbmi;
|
||||||
struct macroblock_plane *const p = &x->plane[0];
|
struct macroblock_plane *const p = &x->plane[0];
|
||||||
struct macroblockd_plane *const pd = &x->e_mbd.plane[0];
|
struct macroblockd_plane *const pd = &x->e_mbd.plane[0];
|
||||||
|
|
||||||
|
@ -1657,7 +1657,7 @@ static INLINE void mi_buf_shift(MACROBLOCK *x, int i) {
|
||||||
|
|
||||||
static INLINE void mi_buf_restore(MACROBLOCK *x, struct buf_2d orig_src,
|
static INLINE void mi_buf_restore(MACROBLOCK *x, struct buf_2d orig_src,
|
||||||
struct buf_2d orig_pre[2]) {
|
struct buf_2d orig_pre[2]) {
|
||||||
MB_MODE_INFO *mbmi = &x->e_mbd.mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &x->e_mbd.mi[0]->mbmi;
|
||||||
x->plane[0].src = orig_src;
|
x->plane[0].src = orig_src;
|
||||||
x->e_mbd.plane[0].pre[0] = orig_pre[0];
|
x->e_mbd.plane[0].pre[0] = orig_pre[0];
|
||||||
if (has_second_ref(mbmi))
|
if (has_second_ref(mbmi))
|
||||||
|
@ -1717,7 +1717,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
MB_PREDICTION_MODE this_mode;
|
MB_PREDICTION_MODE this_mode;
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
VP9_COMMON *cm = &cpi->common;
|
VP9_COMMON *cm = &cpi->common;
|
||||||
MODE_INFO *mi = xd->mi_8x8[0];
|
MODE_INFO *mi = xd->mi[0];
|
||||||
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||||
struct macroblock_plane *const p = &x->plane[0];
|
struct macroblock_plane *const p = &x->plane[0];
|
||||||
struct macroblockd_plane *const pd = &xd->plane[0];
|
struct macroblockd_plane *const pd = &xd->plane[0];
|
||||||
|
@ -2096,7 +2096,7 @@ static int64_t rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int i;
|
int i;
|
||||||
BEST_SEG_INFO *bsi = bsi_buf + filter_idx;
|
BEST_SEG_INFO *bsi = bsi_buf + filter_idx;
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MODE_INFO *mi = xd->mi_8x8[0];
|
MODE_INFO *mi = xd->mi[0];
|
||||||
MB_MODE_INFO *mbmi = &mi->mbmi;
|
MB_MODE_INFO *mbmi = &mi->mbmi;
|
||||||
int mode_idx;
|
int mode_idx;
|
||||||
|
|
||||||
|
@ -2143,7 +2143,7 @@ static void mv_pred(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
uint8_t *ref_y_buffer, int ref_y_stride,
|
uint8_t *ref_y_buffer, int ref_y_stride,
|
||||||
int ref_frame, BLOCK_SIZE block_size ) {
|
int ref_frame, BLOCK_SIZE block_size ) {
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
int_mv this_mv;
|
int_mv this_mv;
|
||||||
int i;
|
int i;
|
||||||
int zero_seen = 0;
|
int zero_seen = 0;
|
||||||
|
@ -2273,7 +2273,7 @@ static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
|
||||||
// restored if we decide to encode this way
|
// restored if we decide to encode this way
|
||||||
ctx->skip = x->skip;
|
ctx->skip = x->skip;
|
||||||
ctx->best_mode_index = mode_index;
|
ctx->best_mode_index = mode_index;
|
||||||
ctx->mic = *xd->mi_8x8[0];
|
ctx->mic = *xd->mi[0];
|
||||||
|
|
||||||
ctx->best_ref_mv[0].as_int = ref_mv->as_int;
|
ctx->best_ref_mv[0].as_int = ref_mv->as_int;
|
||||||
ctx->best_ref_mv[1].as_int = second_ref_mv->as_int;
|
ctx->best_ref_mv[1].as_int = second_ref_mv->as_int;
|
||||||
|
@ -2324,7 +2324,7 @@ void vp9_setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
const VP9_COMMON *cm = &cpi->common;
|
const VP9_COMMON *cm = &cpi->common;
|
||||||
const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
|
const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MODE_INFO *const mi = xd->mi_8x8[0];
|
MODE_INFO *const mi = xd->mi[0];
|
||||||
int_mv *const candidates = mi->mbmi.ref_mvs[ref_frame];
|
int_mv *const candidates = mi->mbmi.ref_mvs[ref_frame];
|
||||||
const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf;
|
const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf;
|
||||||
|
|
||||||
|
@ -2358,7 +2358,7 @@ const YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi,
|
||||||
|
|
||||||
static INLINE int get_switchable_rate(const MACROBLOCK *x) {
|
static INLINE int get_switchable_rate(const MACROBLOCK *x) {
|
||||||
const MACROBLOCKD *const xd = &x->e_mbd;
|
const MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
const MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
const int ctx = vp9_get_pred_context_switchable_interp(xd);
|
const int ctx = vp9_get_pred_context_switchable_interp(xd);
|
||||||
return SWITCHABLE_INTERP_RATE_FACTOR *
|
return SWITCHABLE_INTERP_RATE_FACTOR *
|
||||||
x->switchable_interp_costs[ctx][mbmi->interp_filter];
|
x->switchable_interp_costs[ctx][mbmi->interp_filter];
|
||||||
|
@ -2371,7 +2371,7 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int_mv *tmp_mv, int *rate_mv) {
|
int_mv *tmp_mv, int *rate_mv) {
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
VP9_COMMON *cm = &cpi->common;
|
VP9_COMMON *cm = &cpi->common;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
|
struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
|
||||||
int bestsme = INT_MAX;
|
int bestsme = INT_MAX;
|
||||||
int further_steps, step_param;
|
int further_steps, step_param;
|
||||||
|
@ -2537,7 +2537,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
const int pw = 4 * num_4x4_blocks_wide_lookup[bsize];
|
const int pw = 4 * num_4x4_blocks_wide_lookup[bsize];
|
||||||
const int ph = 4 * num_4x4_blocks_high_lookup[bsize];
|
const int ph = 4 * num_4x4_blocks_high_lookup[bsize];
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
const int refs[2] = { mbmi->ref_frame[0],
|
const int refs[2] = { mbmi->ref_frame[0],
|
||||||
mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1] };
|
mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1] };
|
||||||
int_mv ref_mv[2];
|
int_mv ref_mv[2];
|
||||||
|
@ -2698,7 +2698,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
const int64_t ref_best_rd) {
|
const int64_t ref_best_rd) {
|
||||||
VP9_COMMON *cm = &cpi->common;
|
VP9_COMMON *cm = &cpi->common;
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
const int is_comp_pred = has_second_ref(mbmi);
|
const int is_comp_pred = has_second_ref(mbmi);
|
||||||
const int num_refs = is_comp_pred ? 2 : 1;
|
const int num_refs = is_comp_pred ? 2 : 1;
|
||||||
const int this_mode = mbmi->mode;
|
const int this_mode = mbmi->mode;
|
||||||
|
@ -2750,7 +2750,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
return INT64_MAX;
|
return INT64_MAX;
|
||||||
*rate2 += rate_mv;
|
*rate2 += rate_mv;
|
||||||
frame_mv[refs[0]].as_int =
|
frame_mv[refs[0]].as_int =
|
||||||
xd->mi_8x8[0]->bmi[0].as_mv[0].as_int = tmp_mv.as_int;
|
xd->mi[0]->bmi[0].as_mv[0].as_int = tmp_mv.as_int;
|
||||||
single_newmv[refs[0]].as_int = tmp_mv.as_int;
|
single_newmv[refs[0]].as_int = tmp_mv.as_int;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3072,7 +3072,7 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
TX_SIZE max_uv_tx_size;
|
TX_SIZE max_uv_tx_size;
|
||||||
x->skip_encode = 0;
|
x->skip_encode = 0;
|
||||||
ctx->skip = 0;
|
ctx->skip = 0;
|
||||||
xd->mi_8x8[0]->mbmi.ref_frame[0] = INTRA_FRAME;
|
xd->mi[0]->mbmi.ref_frame[0] = INTRA_FRAME;
|
||||||
|
|
||||||
if (bsize >= BLOCK_8X8) {
|
if (bsize >= BLOCK_8X8) {
|
||||||
if (rd_pick_intra_sby_mode(cpi, x, &rate_y, &rate_y_tokenonly,
|
if (rd_pick_intra_sby_mode(cpi, x, &rate_y, &rate_y_tokenonly,
|
||||||
|
@ -3081,7 +3081,7 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
*returnrate = INT_MAX;
|
*returnrate = INT_MAX;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
max_uv_tx_size = get_uv_tx_size_impl(xd->mi_8x8[0]->mbmi.tx_size, bsize);
|
max_uv_tx_size = get_uv_tx_size_impl(xd->mi[0]->mbmi.tx_size, bsize);
|
||||||
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv, &rate_uv_tokenonly,
|
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv, &rate_uv_tokenonly,
|
||||||
&dist_uv, &uv_skip, bsize, max_uv_tx_size);
|
&dist_uv, &uv_skip, bsize, max_uv_tx_size);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3091,7 +3091,7 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
*returnrate = INT_MAX;
|
*returnrate = INT_MAX;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
max_uv_tx_size = get_uv_tx_size_impl(xd->mi_8x8[0]->mbmi.tx_size, bsize);
|
max_uv_tx_size = get_uv_tx_size_impl(xd->mi[0]->mbmi.tx_size, bsize);
|
||||||
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv, &rate_uv_tokenonly,
|
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv, &rate_uv_tokenonly,
|
||||||
&dist_uv, &uv_skip, BLOCK_8X8, max_uv_tx_size);
|
&dist_uv, &uv_skip, BLOCK_8X8, max_uv_tx_size);
|
||||||
}
|
}
|
||||||
|
@ -3114,7 +3114,7 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->mic = *xd->mi_8x8[0];
|
ctx->mic = *xd->mi[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
|
@ -3127,7 +3127,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int64_t best_rd_so_far) {
|
int64_t best_rd_so_far) {
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
const struct segmentation *const seg = &cm->seg;
|
const struct segmentation *const seg = &cm->seg;
|
||||||
MB_PREDICTION_MODE this_mode;
|
MB_PREDICTION_MODE this_mode;
|
||||||
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
|
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
|
||||||
|
@ -3759,7 +3759,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int64_t best_rd_so_far) {
|
int64_t best_rd_so_far) {
|
||||||
VP9_COMMON *cm = &cpi->common;
|
VP9_COMMON *cm = &cpi->common;
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
const struct segmentation *seg = &cm->seg;
|
const struct segmentation *seg = &cm->seg;
|
||||||
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
|
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
|
||||||
unsigned char segment_id = mbmi->segment_id;
|
unsigned char segment_id = mbmi->segment_id;
|
||||||
|
@ -4037,7 +4037,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
cpi->rd_thresh_sub8x8[segment_id][bsize][THR_ALTR];
|
cpi->rd_thresh_sub8x8[segment_id][bsize][THR_ALTR];
|
||||||
this_rd_thresh = (ref_frame == GOLDEN_FRAME) ?
|
this_rd_thresh = (ref_frame == GOLDEN_FRAME) ?
|
||||||
cpi->rd_thresh_sub8x8[segment_id][bsize][THR_GOLD] : this_rd_thresh;
|
cpi->rd_thresh_sub8x8[segment_id][bsize][THR_GOLD] : this_rd_thresh;
|
||||||
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
|
xd->mi[0]->mbmi.tx_size = TX_4X4;
|
||||||
|
|
||||||
cpi->mask_filter_rd = 0;
|
cpi->mask_filter_rd = 0;
|
||||||
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
|
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
|
||||||
|
@ -4101,7 +4101,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
tmp_best_skippable = skippable;
|
tmp_best_skippable = skippable;
|
||||||
tmp_best_mbmode = *mbmi;
|
tmp_best_mbmode = *mbmi;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
tmp_best_bmodes[i] = xd->mi_8x8[0]->bmi[i];
|
tmp_best_bmodes[i] = xd->mi[0]->bmi[i];
|
||||||
x->zcoeff_blk[TX_4X4][i] = !x->plane[0].eobs[i];
|
x->zcoeff_blk[TX_4X4][i] = !x->plane[0].eobs[i];
|
||||||
}
|
}
|
||||||
pred_exists = 1;
|
pred_exists = 1;
|
||||||
|
@ -4149,7 +4149,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
skippable = tmp_best_skippable;
|
skippable = tmp_best_skippable;
|
||||||
*mbmi = tmp_best_mbmode;
|
*mbmi = tmp_best_mbmode;
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
xd->mi_8x8[0]->bmi[i] = tmp_best_bmodes[i];
|
xd->mi[0]->bmi[i] = tmp_best_bmodes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
rate2 += rate;
|
rate2 += rate;
|
||||||
|
@ -4233,8 +4233,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep record of best inter rd with single reference
|
// Keep record of best inter rd with single reference
|
||||||
if (is_inter_block(&xd->mi_8x8[0]->mbmi) &&
|
if (is_inter_block(&xd->mi[0]->mbmi) &&
|
||||||
!has_second_ref(&xd->mi_8x8[0]->mbmi) &&
|
!has_second_ref(&xd->mi[0]->mbmi) &&
|
||||||
!mode_excluded &&
|
!mode_excluded &&
|
||||||
this_rd < best_inter_rd) {
|
this_rd < best_inter_rd) {
|
||||||
best_inter_rd = this_rd;
|
best_inter_rd = this_rd;
|
||||||
|
@ -4274,7 +4274,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
sizeof(uint8_t) * ctx->num_4x4_blk);
|
sizeof(uint8_t) * ctx->num_4x4_blk);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
best_bmodes[i] = xd->mi_8x8[0]->bmi[i];
|
best_bmodes[i] = xd->mi[0]->bmi[i];
|
||||||
|
|
||||||
// TODO(debargha): enhance this test with a better distortion prediction
|
// TODO(debargha): enhance this test with a better distortion prediction
|
||||||
// based on qp, activity mask and history
|
// based on qp, activity mask and history
|
||||||
|
@ -4423,13 +4423,13 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
x->skip |= best_skip2;
|
x->skip |= best_skip2;
|
||||||
if (!is_inter_block(&best_mbmode)) {
|
if (!is_inter_block(&best_mbmode)) {
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
xd->mi_8x8[0]->bmi[i].as_mode = best_bmodes[i].as_mode;
|
xd->mi[0]->bmi[i].as_mode = best_bmodes[i].as_mode;
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
vpx_memcpy(&xd->mi_8x8[0]->bmi[i], &best_bmodes[i], sizeof(b_mode_info));
|
vpx_memcpy(&xd->mi[0]->bmi[i], &best_bmodes[i], sizeof(b_mode_info));
|
||||||
|
|
||||||
mbmi->mv[0].as_int = xd->mi_8x8[0]->bmi[3].as_mv[0].as_int;
|
mbmi->mv[0].as_int = xd->mi[0]->bmi[3].as_mv[0].as_int;
|
||||||
mbmi->mv[1].as_int = xd->mi_8x8[0]->bmi[3].as_mv[1].as_int;
|
mbmi->mv[1].as_int = xd->mi[0]->bmi[3].as_mv[1].as_int;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < REFERENCE_MODES; ++i) {
|
for (i = 0; i < REFERENCE_MODES; ++i) {
|
||||||
|
|
|
@ -133,8 +133,8 @@ static void count_segs(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xd->mi_8x8 = mi_8x8;
|
xd->mi = mi_8x8;
|
||||||
segment_id = xd->mi_8x8[0]->mbmi.segment_id;
|
segment_id = xd->mi[0]->mbmi.segment_id;
|
||||||
|
|
||||||
set_mi_row_col(xd, tile, mi_row, bh, mi_col, bw, cm->mi_rows, cm->mi_cols);
|
set_mi_row_col(xd, tile, mi_row, bh, mi_col, bw, cm->mi_rows, cm->mi_cols);
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ static void count_segs(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
|
|
||||||
// Store the prediction status for this mb and update counts
|
// Store the prediction status for this mb and update counts
|
||||||
// as appropriate
|
// as appropriate
|
||||||
xd->mi_8x8[0]->mbmi.seg_id_predicted = pred_flag;
|
xd->mi[0]->mbmi.seg_id_predicted = pred_flag;
|
||||||
temporal_predictor_count[pred_context][pred_flag]++;
|
temporal_predictor_count[pred_context][pred_flag]++;
|
||||||
|
|
||||||
if (!pred_flag)
|
if (!pred_flag)
|
||||||
|
@ -169,7 +169,7 @@ static void count_segs_sb(VP9_COMP *cpi, const TileInfo *const tile,
|
||||||
int mi_row, int mi_col,
|
int mi_row, int mi_col,
|
||||||
BLOCK_SIZE bsize) {
|
BLOCK_SIZE bsize) {
|
||||||
const VP9_COMMON *const cm = &cpi->common;
|
const VP9_COMMON *const cm = &cpi->common;
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
int bw, bh;
|
int bw, bh;
|
||||||
const int bs = num_8x8_blocks_wide_lookup[bsize], hbs = bs / 2;
|
const int bs = num_8x8_blocks_wide_lookup[bsize], hbs = bs / 2;
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ void vp9_choose_segmap_coding_method(VP9_COMP *cpi) {
|
||||||
vp9_prob t_pred_tree[SEG_TREE_PROBS];
|
vp9_prob t_pred_tree[SEG_TREE_PROBS];
|
||||||
vp9_prob t_nopred_prob[PREDICTION_PROBS];
|
vp9_prob t_nopred_prob[PREDICTION_PROBS];
|
||||||
|
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mi_stride;
|
||||||
MODE_INFO **mi_ptr, **mi;
|
MODE_INFO **mi_ptr, **mi;
|
||||||
|
|
||||||
// Set default state for the segment tree probabilities and the
|
// Set default state for the segment tree probabilities and the
|
||||||
|
|
|
@ -133,7 +133,7 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
|
||||||
|
|
||||||
MV best_ref_mv1 = {0, 0};
|
MV best_ref_mv1 = {0, 0};
|
||||||
MV best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */
|
MV best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */
|
||||||
MV *ref_mv = &x->e_mbd.mi_8x8[0]->bmi[0].as_mv[0].as_mv;
|
MV *ref_mv = &x->e_mbd.mi[0]->bmi[0].as_mv[0].as_mv;
|
||||||
|
|
||||||
// Save input state
|
// Save input state
|
||||||
struct buf_2d src = x->plane[0].src;
|
struct buf_2d src = x->plane[0].src;
|
||||||
|
@ -250,8 +250,8 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
|
||||||
if (cpi->frames[frame] == NULL)
|
if (cpi->frames[frame] == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mbd->mi_8x8[0]->bmi[0].as_mv[0].as_mv.row = 0;
|
mbd->mi[0]->bmi[0].as_mv[0].as_mv.row = 0;
|
||||||
mbd->mi_8x8[0]->bmi[0].as_mv[0].as_mv.col = 0;
|
mbd->mi[0]->bmi[0].as_mv[0].as_mv.col = 0;
|
||||||
|
|
||||||
if (frame == alt_ref_index) {
|
if (frame == alt_ref_index) {
|
||||||
filter_weight = 2;
|
filter_weight = 2;
|
||||||
|
@ -284,8 +284,8 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
|
||||||
cpi->frames[frame]->v_buffer + mb_uv_offset,
|
cpi->frames[frame]->v_buffer + mb_uv_offset,
|
||||||
cpi->frames[frame]->y_stride,
|
cpi->frames[frame]->y_stride,
|
||||||
mb_uv_height,
|
mb_uv_height,
|
||||||
mbd->mi_8x8[0]->bmi[0].as_mv[0].as_mv.row,
|
mbd->mi[0]->bmi[0].as_mv[0].as_mv.row,
|
||||||
mbd->mi_8x8[0]->bmi[0].as_mv[0].as_mv.col,
|
mbd->mi[0]->bmi[0].as_mv[0].as_mv.col,
|
||||||
predictor, scale,
|
predictor, scale,
|
||||||
mb_col * 16, mb_row * 16);
|
mb_col * 16, mb_row * 16);
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
uint8_t token_cache[32 * 32];
|
uint8_t token_cache[32 * 32];
|
||||||
struct macroblock_plane *p = &cpi->mb.plane[plane];
|
struct macroblock_plane *p = &cpi->mb.plane[plane];
|
||||||
struct macroblockd_plane *pd = &xd->plane[plane];
|
struct macroblockd_plane *pd = &xd->plane[plane];
|
||||||
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
||||||
int pt; /* near block/prev token context index */
|
int pt; /* near block/prev token context index */
|
||||||
int c;
|
int c;
|
||||||
TOKENEXTRA *t = *tp; /* store tokens starting here */
|
TOKENEXTRA *t = *tp; /* store tokens starting here */
|
||||||
|
@ -309,7 +309,7 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
|
||||||
BLOCK_SIZE bsize) {
|
BLOCK_SIZE bsize) {
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
||||||
TOKENEXTRA *t_backup = *t;
|
TOKENEXTRA *t_backup = *t;
|
||||||
const int ctx = vp9_get_skip_context(xd);
|
const int ctx = vp9_get_skip_context(xd);
|
||||||
const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id,
|
const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче