Get rid of "this_mi", use "mi_8x8[0]" everywhere instead
The only case where they were intentionally pointing to different structures was in mbgraph, and this didn't have the expected behavior because both of these pointers are used interchangeably through the code Change-Id: I979251782f90885fe962305bcc845bc05907f80c
This commit is contained in:
Родитель
9a03154f46
Коммит
acf0d56f0b
|
@ -196,7 +196,6 @@ typedef struct macroblockd {
|
||||||
struct scale_factors scale_factor[2];
|
struct scale_factors scale_factor[2];
|
||||||
|
|
||||||
MODE_INFO *last_mi;
|
MODE_INFO *last_mi;
|
||||||
MODE_INFO *this_mi;
|
|
||||||
int mode_info_stride;
|
int mode_info_stride;
|
||||||
|
|
||||||
MODE_INFO *mic_stream_ptr;
|
MODE_INFO *mic_stream_ptr;
|
||||||
|
@ -311,7 +310,7 @@ extern const TX_TYPE mode2txfm_map[MB_MODE_COUNT];
|
||||||
|
|
||||||
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->this_mi;
|
const MODE_INFO *const mi = xd->mi_8x8[0];
|
||||||
const MB_MODE_INFO *const mbmi = &mi->mbmi;
|
const MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||||
|
|
||||||
if (plane_type != PLANE_TYPE_Y_WITH_DC ||
|
if (plane_type != PLANE_TYPE_Y_WITH_DC ||
|
||||||
|
@ -326,13 +325,13 @@ static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
|
||||||
static INLINE TX_TYPE get_tx_type_8x8(PLANE_TYPE plane_type,
|
static INLINE TX_TYPE get_tx_type_8x8(PLANE_TYPE plane_type,
|
||||||
const MACROBLOCKD *xd) {
|
const MACROBLOCKD *xd) {
|
||||||
return plane_type == PLANE_TYPE_Y_WITH_DC ?
|
return plane_type == PLANE_TYPE_Y_WITH_DC ?
|
||||||
mode2txfm_map[xd->this_mi->mbmi.mode] : DCT_DCT;
|
mode2txfm_map[xd->mi_8x8[0]->mbmi.mode] : DCT_DCT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE TX_TYPE get_tx_type_16x16(PLANE_TYPE plane_type,
|
static INLINE TX_TYPE get_tx_type_16x16(PLANE_TYPE plane_type,
|
||||||
const MACROBLOCKD *xd) {
|
const MACROBLOCKD *xd) {
|
||||||
return plane_type == PLANE_TYPE_Y_WITH_DC ?
|
return plane_type == PLANE_TYPE_Y_WITH_DC ?
|
||||||
mode2txfm_map[xd->this_mi->mbmi.mode] : DCT_DCT;
|
mode2txfm_map[xd->mi_8x8[0]->mbmi.mode] : DCT_DCT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setup_block_dptrs(MACROBLOCKD *xd, int ss_x, int ss_y) {
|
static void setup_block_dptrs(MACROBLOCKD *xd, int ss_x, int ss_y) {
|
||||||
|
@ -381,7 +380,7 @@ static INLINE void 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->this_mi->mbmi;
|
const MB_MODE_INFO* mbmi = &xd->mi_8x8[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.
|
||||||
|
|
|
@ -43,7 +43,7 @@ void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||||
int mi_row, int mi_col) {
|
int mi_row, int mi_col) {
|
||||||
int_mv dst_list[MAX_MV_REF_CANDIDATES];
|
int_mv dst_list[MAX_MV_REF_CANDIDATES];
|
||||||
int_mv mv_list[MAX_MV_REF_CANDIDATES];
|
int_mv mv_list[MAX_MV_REF_CANDIDATES];
|
||||||
MODE_INFO *const mi = xd->this_mi;
|
MODE_INFO *const mi = xd->mi_8x8[0];
|
||||||
|
|
||||||
assert(ref_idx == 0 || ref_idx == 1);
|
assert(ref_idx == 0 || ref_idx == 1);
|
||||||
assert(MAX_MV_REF_CANDIDATES == 2); // makes code here slightly easier
|
assert(MAX_MV_REF_CANDIDATES == 2); // makes code here slightly easier
|
||||||
|
|
|
@ -389,7 +389,7 @@ unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void vp9_set_pred_flag_seg_id(MACROBLOCKD *xd, uint8_t pred_flag) {
|
void vp9_set_pred_flag_seg_id(MACROBLOCKD *xd, uint8_t pred_flag) {
|
||||||
xd->this_mi->mbmi.seg_id_predicted = pred_flag;
|
xd->mi_8x8[0]->mbmi.seg_id_predicted = pred_flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
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,
|
||||||
|
|
|
@ -49,7 +49,7 @@ static INLINE vp9_prob vp9_get_pred_prob_mbskip(const VP9_COMMON *cm,
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) {
|
static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) {
|
||||||
return xd->this_mi->mbmi.skip_coeff;
|
return xd->mi_8x8[0]->mbmi.skip_coeff;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
|
unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
void vp9_setup_interp_filters(MACROBLOCKD *xd,
|
void vp9_setup_interp_filters(MACROBLOCKD *xd,
|
||||||
INTERPOLATIONFILTERTYPE mcomp_filter_type,
|
INTERPOLATIONFILTERTYPE mcomp_filter_type,
|
||||||
VP9_COMMON *cm) {
|
VP9_COMMON *cm) {
|
||||||
if (xd->mi_8x8 && xd->this_mi) {
|
if (xd->mi_8x8 && xd->mi_8x8[0]) {
|
||||||
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
|
|
||||||
set_scale_factors(xd, mbmi->ref_frame[0] - LAST_FRAME,
|
set_scale_factors(xd, mbmi->ref_frame[0] - LAST_FRAME,
|
||||||
mbmi->ref_frame[1] - LAST_FRAME,
|
mbmi->ref_frame[1] - LAST_FRAME,
|
||||||
|
@ -120,7 +120,7 @@ static void build_inter_predictors(int plane, int block, BLOCK_SIZE bsize,
|
||||||
const int bh = plane_block_height(bsize, pd);
|
const int bh = plane_block_height(bsize, pd);
|
||||||
const int x = 4 * (block & ((1 << bwl) - 1));
|
const int x = 4 * (block & ((1 << bwl) - 1));
|
||||||
const int y = 4 * (block >> bwl);
|
const int y = 4 * (block >> bwl);
|
||||||
const MODE_INFO *mi = xd->this_mi;
|
const MODE_INFO *mi = xd->mi_8x8[0];
|
||||||
const int is_compound = has_second_ref(&mi->mbmi);
|
const int is_compound = has_second_ref(&mi->mbmi);
|
||||||
int ref;
|
int ref;
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ static INLINE void foreach_predicted_block_in_plane(
|
||||||
const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
|
const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
|
||||||
const int bhl = b_height_log2(bsize) - xd->plane[plane].subsampling_y;
|
const int bhl = b_height_log2(bsize) - xd->plane[plane].subsampling_y;
|
||||||
|
|
||||||
if (xd->this_mi->mbmi.sb_type < BLOCK_8X8) {
|
if (xd->mi_8x8[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 < 1 << bhl; ++y)
|
for (y = 0; y < 1 << bhl; ++y)
|
||||||
|
|
|
@ -111,7 +111,7 @@ static int read_intra_segment_id(VP9D_COMP *pbi, int mi_row, int mi_col,
|
||||||
vp9_reader *r) {
|
vp9_reader *r) {
|
||||||
MACROBLOCKD *const xd = &pbi->mb;
|
MACROBLOCKD *const xd = &pbi->mb;
|
||||||
struct segmentation *const seg = &pbi->common.seg;
|
struct segmentation *const seg = &pbi->common.seg;
|
||||||
const BLOCK_SIZE bsize = xd->this_mi->mbmi.sb_type;
|
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
|
||||||
int segment_id;
|
int segment_id;
|
||||||
|
|
||||||
if (!seg->enabled)
|
if (!seg->enabled)
|
||||||
|
@ -130,7 +130,7 @@ static int read_inter_segment_id(VP9D_COMP *pbi, int mi_row, int mi_col,
|
||||||
VP9_COMMON *const cm = &pbi->common;
|
VP9_COMMON *const cm = &pbi->common;
|
||||||
MACROBLOCKD *const xd = &pbi->mb;
|
MACROBLOCKD *const xd = &pbi->mb;
|
||||||
struct segmentation *const seg = &cm->seg;
|
struct segmentation *const seg = &cm->seg;
|
||||||
const BLOCK_SIZE bsize = xd->this_mi->mbmi.sb_type;
|
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
|
||||||
int pred_segment_id, segment_id;
|
int pred_segment_id, segment_id;
|
||||||
|
|
||||||
if (!seg->enabled)
|
if (!seg->enabled)
|
||||||
|
@ -661,7 +661,7 @@ void vp9_prepare_read_mode_info(VP9D_COMP* pbi, vp9_reader *r) {
|
||||||
void vp9_read_mode_info(VP9D_COMP* pbi, int mi_row, int mi_col, vp9_reader *r) {
|
void vp9_read_mode_info(VP9D_COMP* pbi, int mi_row, int mi_col, vp9_reader *r) {
|
||||||
VP9_COMMON *const cm = &pbi->common;
|
VP9_COMMON *const cm = &pbi->common;
|
||||||
MACROBLOCKD *const xd = &pbi->mb;
|
MACROBLOCKD *const xd = &pbi->mb;
|
||||||
MODE_INFO *mi = xd->this_mi;
|
MODE_INFO *mi = xd->mi_8x8[0];
|
||||||
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
|
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
|
||||||
const int bw = 1 << mi_width_log2(bsize);
|
const int bw = 1 << mi_width_log2(bsize);
|
||||||
const int bh = 1 << mi_height_log2(bsize);
|
const int bh = 1 << mi_height_log2(bsize);
|
||||||
|
|
|
@ -134,7 +134,7 @@ static void decode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
TX_SIZE tx_size, void *arg) {
|
TX_SIZE tx_size, void *arg) {
|
||||||
MACROBLOCKD* const xd = arg;
|
MACROBLOCKD* const xd = arg;
|
||||||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||||
MODE_INFO *const mi = xd->this_mi;
|
MODE_INFO *const mi = xd->mi_8x8[0];
|
||||||
const int raster_block = txfrm_block_to_raster_block(plane_bsize, tx_size,
|
const int raster_block = txfrm_block_to_raster_block(plane_bsize, tx_size,
|
||||||
block);
|
block);
|
||||||
uint8_t* const dst = raster_block_offset_uint8(plane_bsize, raster_block,
|
uint8_t* const dst = raster_block_offset_uint8(plane_bsize, raster_block,
|
||||||
|
@ -158,7 +158,7 @@ static void decode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
static int decode_tokens(VP9D_COMP *pbi, BLOCK_SIZE bsize, vp9_reader *r) {
|
static int decode_tokens(VP9D_COMP *pbi, BLOCK_SIZE bsize, vp9_reader *r) {
|
||||||
VP9_COMMON *const cm = &pbi->common;
|
VP9_COMMON *const cm = &pbi->common;
|
||||||
MACROBLOCKD *const xd = &pbi->mb;
|
MACROBLOCKD *const xd = &pbi->mb;
|
||||||
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
|
|
||||||
if (mbmi->skip_coeff) {
|
if (mbmi->skip_coeff) {
|
||||||
reset_skip_context(xd, bsize);
|
reset_skip_context(xd, bsize);
|
||||||
|
@ -187,9 +187,8 @@ static void set_offsets(VP9D_COMP *pbi, BLOCK_SIZE bsize,
|
||||||
xd->prev_mi_8x8 = cm->prev_mi_grid_visible + offset;
|
xd->prev_mi_8x8 = cm->prev_mi_grid_visible + offset;
|
||||||
|
|
||||||
// we are using the mode info context stream here
|
// we are using the mode info context stream here
|
||||||
xd->this_mi =
|
|
||||||
xd->mi_8x8[0] = xd->mic_stream_ptr;
|
xd->mi_8x8[0] = xd->mic_stream_ptr;
|
||||||
xd->this_mi->mbmi.sb_type = bsize;
|
xd->mi_8x8[0]->mbmi.sb_type = bsize;
|
||||||
xd->mic_stream_ptr++;
|
xd->mic_stream_ptr++;
|
||||||
|
|
||||||
// Special case: if prev_mi is NULL, the previous mode info context
|
// Special case: if prev_mi is NULL, the previous mode info context
|
||||||
|
@ -209,7 +208,7 @@ static void set_offsets(VP9D_COMP *pbi, BLOCK_SIZE bsize,
|
||||||
static void set_ref(VP9D_COMP *pbi, int i, int mi_row, int mi_col) {
|
static void set_ref(VP9D_COMP *pbi, int i, int mi_row, int mi_col) {
|
||||||
VP9_COMMON *const cm = &pbi->common;
|
VP9_COMMON *const cm = &pbi->common;
|
||||||
MACROBLOCKD *const xd = &pbi->mb;
|
MACROBLOCKD *const xd = &pbi->mb;
|
||||||
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
const int ref = mbmi->ref_frame[i] - LAST_FRAME;
|
const int ref = mbmi->ref_frame[i] - LAST_FRAME;
|
||||||
const YV12_BUFFER_CONFIG *cfg = &cm->yv12_fb[cm->active_ref_idx[ref]];
|
const YV12_BUFFER_CONFIG *cfg = &cm->yv12_fb[cm->active_ref_idx[ref]];
|
||||||
const struct scale_factors *sf = &cm->active_ref_scale[ref];
|
const struct scale_factors *sf = &cm->active_ref_scale[ref];
|
||||||
|
@ -240,7 +239,7 @@ static void decode_modes_b(VP9D_COMP *pbi, int mi_row, int mi_col,
|
||||||
bsize = BLOCK_8X8;
|
bsize = BLOCK_8X8;
|
||||||
|
|
||||||
// Has to be called after set_offsets
|
// Has to be called after set_offsets
|
||||||
mbmi = &xd->this_mi->mbmi;
|
mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
eobtotal = decode_tokens(pbi, bsize, r);
|
eobtotal = decode_tokens(pbi, bsize, r);
|
||||||
|
|
||||||
if (!is_inter_block(mbmi)) {
|
if (!is_inter_block(mbmi)) {
|
||||||
|
|
|
@ -91,7 +91,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
|
||||||
TX_SIZE tx_size, const int16_t *dq, int pt) {
|
TX_SIZE tx_size, const int16_t *dq, int pt) {
|
||||||
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->this_mi->mbmi);
|
const int ref = is_inter_block(&xd->mi_8x8[0]->mbmi);
|
||||||
int band, c = 0;
|
int band, c = 0;
|
||||||
const vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES] =
|
const vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES] =
|
||||||
fc->coef_probs[tx_size][type][ref];
|
fc->coef_probs[tx_size][type][ref];
|
||||||
|
@ -218,7 +218,7 @@ static void decode_block(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
MACROBLOCKD *xd = &arg->pbi->mb;
|
MACROBLOCKD *xd = &arg->pbi->mb;
|
||||||
struct segmentation *seg = &arg->pbi->common.seg;
|
struct segmentation *seg = &arg->pbi->common.seg;
|
||||||
struct macroblockd_plane* pd = &xd->plane[plane];
|
struct macroblockd_plane* pd = &xd->plane[plane];
|
||||||
const int segment_id = xd->this_mi->mbmi.segment_id;
|
const int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
|
||||||
const int seg_eob = get_tx_eob(seg, segment_id, tx_size);
|
const int seg_eob = get_tx_eob(seg, segment_id, tx_size);
|
||||||
int aoff, loff, eob, pt;
|
int aoff, loff, eob, pt;
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,6 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
|
||||||
|
|
||||||
pbi->mb.mi_8x8 = cm->mi_grid_visible;
|
pbi->mb.mi_8x8 = cm->mi_grid_visible;
|
||||||
pbi->mb.mi_8x8[0] = cm->mi;
|
pbi->mb.mi_8x8[0] = cm->mi;
|
||||||
pbi->mb.this_mi = cm->mi;
|
|
||||||
|
|
||||||
cm->current_video_frame++;
|
cm->current_video_frame++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,7 +353,7 @@ static void encode_ref_frame(VP9_COMP *cpi, vp9_writer *bc) {
|
||||||
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 *mi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *mi = &xd->mi_8x8[0]->mbmi;
|
||||||
const int segment_id = mi->segment_id;
|
const int segment_id = mi->segment_id;
|
||||||
int seg_ref_active = vp9_segfeature_active(&cm->seg, segment_id,
|
int seg_ref_active = vp9_segfeature_active(&cm->seg, segment_id,
|
||||||
SEG_LVL_REF_FRAME);
|
SEG_LVL_REF_FRAME);
|
||||||
|
@ -574,7 +574,6 @@ static void write_modes_b(VP9_COMP *cpi, MODE_INFO **mi_8x8, vp9_writer *bc,
|
||||||
if (xd->ab_index > 0)
|
if (xd->ab_index > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xd->this_mi = mi_8x8[0];
|
|
||||||
xd->mi_8x8 = mi_8x8;
|
xd->mi_8x8 = mi_8x8;
|
||||||
|
|
||||||
set_mi_row_col(&cpi->common, xd,
|
set_mi_row_col(&cpi->common, xd,
|
||||||
|
|
|
@ -352,8 +352,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
||||||
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 = &ctx->mic;
|
MODE_INFO *mi = &ctx->mic;
|
||||||
MB_MODE_INFO * const mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
MODE_INFO *mi_addr = xd->this_mi;
|
MODE_INFO *mi_addr = xd->mi_8x8[0];
|
||||||
|
|
||||||
int mb_mode_index = ctx->best_mode_index;
|
int mb_mode_index = ctx->best_mode_index;
|
||||||
const int mis = cm->mode_info_stride;
|
const int mis = cm->mode_info_stride;
|
||||||
|
@ -497,9 +497,9 @@ static void set_offsets(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||||
// cannot be used.
|
// cannot be used.
|
||||||
xd->last_mi = cm->prev_mi ? xd->prev_mi_8x8[0] : NULL;
|
xd->last_mi = cm->prev_mi ? xd->prev_mi_8x8[0] : NULL;
|
||||||
|
|
||||||
xd->this_mi = xd->mi_8x8[0] = cm->mi + idx_str;
|
xd->mi_8x8[0] = cm->mi + idx_str;
|
||||||
|
|
||||||
mbmi = &xd->this_mi->mbmi;
|
mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
|
|
||||||
// Set up destination pointers
|
// Set up destination pointers
|
||||||
setup_dst_planes(xd, &cm->yv12_fb[dst_fb_idx], mi_row, mi_col);
|
setup_dst_planes(xd, &cm->yv12_fb[dst_fb_idx], mi_row, mi_col);
|
||||||
|
@ -579,10 +579,10 @@ static void pick_sb_modes(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||||
}
|
}
|
||||||
|
|
||||||
set_offsets(cpi, mi_row, mi_col, bsize);
|
set_offsets(cpi, mi_row, mi_col, bsize);
|
||||||
xd->this_mi->mbmi.sb_type = bsize;
|
xd->mi_8x8[0]->mbmi.sb_type = bsize;
|
||||||
|
|
||||||
// Set to zero to make sure we do not use the previous encoded frame stats
|
// Set to zero to make sure we do not use the previous encoded frame stats
|
||||||
xd->this_mi->mbmi.skip_coeff = 0;
|
xd->mi_8x8[0]->mbmi.skip_coeff = 0;
|
||||||
|
|
||||||
x->source_variance = get_sby_perpixel_variance(cpi, x, bsize);
|
x->source_variance = get_sby_perpixel_variance(cpi, x, bsize);
|
||||||
|
|
||||||
|
@ -594,7 +594,7 @@ static void pick_sb_modes(VP9_COMP *cpi, int mi_row, int mi_col,
|
||||||
energy = vp9_block_energy(cpi, x, bsize);
|
energy = vp9_block_energy(cpi, x, bsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
xd->this_mi->mbmi.segment_id = vp9_vaq_segment_id(energy);
|
xd->mi_8x8[0]->mbmi.segment_id = vp9_vaq_segment_id(energy);
|
||||||
rdmult_ratio = vp9_vaq_rdmult_ratio(energy);
|
rdmult_ratio = vp9_vaq_rdmult_ratio(energy);
|
||||||
vp9_mb_init_quantizer(cpi, x);
|
vp9_mb_init_quantizer(cpi, x);
|
||||||
}
|
}
|
||||||
|
@ -627,7 +627,7 @@ static void update_stats(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;
|
||||||
MODE_INFO *mi = xd->this_mi;
|
MODE_INFO *mi = xd->mi_8x8[0];
|
||||||
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||||
|
|
||||||
if (!frame_is_intra_only(cm)) {
|
if (!frame_is_intra_only(cm)) {
|
||||||
|
@ -1866,8 +1866,8 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
|
||||||
|
|
||||||
setup_block_dptrs(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
|
setup_block_dptrs(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
|
||||||
|
|
||||||
xd->this_mi->mbmi.mode = DC_PRED;
|
xd->mi_8x8[0]->mbmi.mode = DC_PRED;
|
||||||
xd->this_mi->mbmi.uv_mode = DC_PRED;
|
xd->mi_8x8[0]->mbmi.uv_mode = DC_PRED;
|
||||||
|
|
||||||
vp9_zero(cpi->y_mode_count);
|
vp9_zero(cpi->y_mode_count);
|
||||||
vp9_zero(cpi->y_uv_mode_count);
|
vp9_zero(cpi->y_uv_mode_count);
|
||||||
|
@ -1941,7 +1941,7 @@ static void encode_frame_internal(VP9_COMP *cpi) {
|
||||||
|
|
||||||
xd->mi_8x8 = cm->mi_grid_visible;
|
xd->mi_8x8 = cm->mi_grid_visible;
|
||||||
// required for vp9_frame_init_quantizer
|
// required for vp9_frame_init_quantizer
|
||||||
xd->this_mi = xd->mi_8x8[0] = cm->mi;
|
xd->mi_8x8[0] = cm->mi;
|
||||||
xd->mic_stream_ptr = cm->mi;
|
xd->mic_stream_ptr = cm->mi;
|
||||||
|
|
||||||
xd->last_mi = cm->prev_mi;
|
xd->last_mi = cm->prev_mi;
|
||||||
|
|
|
@ -117,7 +117,7 @@ static void optimize_b(MACROBLOCK *mb,
|
||||||
TX_SIZE tx_size) {
|
TX_SIZE tx_size) {
|
||||||
MACROBLOCKD *const xd = &mb->e_mbd;
|
MACROBLOCKD *const xd = &mb->e_mbd;
|
||||||
struct macroblockd_plane *pd = &xd->plane[plane];
|
struct macroblockd_plane *pd = &xd->plane[plane];
|
||||||
const int ref = is_inter_block(&xd->this_mi->mbmi);
|
const int ref = is_inter_block(&xd->mi_8x8[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_ptr = BLOCK_OFFSET(mb->plane[plane].coeff, block);
|
const int16_t *coeff_ptr = BLOCK_OFFSET(mb->plane[plane].coeff, block);
|
||||||
|
@ -331,7 +331,7 @@ static void optimize_init_b(int plane, BLOCK_SIZE bsize,
|
||||||
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
|
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
|
||||||
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
|
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
|
||||||
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
|
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
|
||||||
const MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
|
const MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi) : mbmi->tx_size;
|
const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi) : mbmi->tx_size;
|
||||||
|
|
||||||
vp9_get_entropy_contexts(tx_size, args->ctx->ta[plane], args->ctx->tl[plane],
|
vp9_get_entropy_contexts(tx_size, args->ctx->ta[plane], args->ctx->tl[plane],
|
||||||
|
@ -494,7 +494,7 @@ void vp9_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->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[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);
|
||||||
|
@ -596,7 +596,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
scan = get_scan_4x4(tx_type);
|
scan = get_scan_4x4(tx_type);
|
||||||
iscan = get_iscan_4x4(tx_type);
|
iscan = get_iscan_4x4(tx_type);
|
||||||
if (mbmi->sb_type < BLOCK_8X8 && plane == 0)
|
if (mbmi->sb_type < BLOCK_8X8 && plane == 0)
|
||||||
mode = xd->this_mi->bmi[block].as_mode;
|
mode = xd->mi_8x8[0]->bmi[block].as_mode;
|
||||||
else
|
else
|
||||||
mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
|
mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ static void zz_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
// Set up pointers for this macro block recon buffer
|
// Set up pointers for this macro block recon buffer
|
||||||
xd->plane[0].pre[0].buf = recon_buffer->y_buffer + recon_yoffset;
|
xd->plane[0].pre[0].buf = recon_buffer->y_buffer + recon_yoffset;
|
||||||
|
|
||||||
switch (xd->this_mi->mbmi.sb_type) {
|
switch (xd->mi_8x8[0]->mbmi.sb_type) {
|
||||||
case BLOCK_8X8:
|
case BLOCK_8X8:
|
||||||
vp9_mse8x8(x->plane[0].src.buf, x->plane[0].src.stride,
|
vp9_mse8x8(x->plane[0].src.buf, x->plane[0].src.stride,
|
||||||
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
|
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
|
||||||
|
@ -397,7 +397,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
|
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
|
||||||
int n;
|
int n;
|
||||||
vp9_variance_fn_ptr_t v_fn_ptr =
|
vp9_variance_fn_ptr_t v_fn_ptr =
|
||||||
cpi->fn_ptr[xd->this_mi->mbmi.sb_type];
|
cpi->fn_ptr[xd->mi_8x8[0]->mbmi.sb_type];
|
||||||
int new_mv_mode_penalty = 256;
|
int new_mv_mode_penalty = 256;
|
||||||
|
|
||||||
int sr = 0;
|
int sr = 0;
|
||||||
|
@ -414,7 +414,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
further_steps -= sr;
|
further_steps -= sr;
|
||||||
|
|
||||||
// override the default variance function to use MSE
|
// override the default variance function to use MSE
|
||||||
switch (xd->this_mi->mbmi.sb_type) {
|
switch (xd->mi_8x8[0]->mbmi.sb_type) {
|
||||||
case BLOCK_8X8:
|
case BLOCK_8X8:
|
||||||
v_fn_ptr.vf = vp9_mse8x8;
|
v_fn_ptr.vf = vp9_mse8x8;
|
||||||
break;
|
break;
|
||||||
|
@ -518,7 +518,6 @@ void vp9_first_pass(VP9_COMP *cpi) {
|
||||||
|
|
||||||
xd->mi_8x8 = cm->mi_grid_visible;
|
xd->mi_8x8 = cm->mi_grid_visible;
|
||||||
// required for vp9_frame_init_quantizer
|
// required for vp9_frame_init_quantizer
|
||||||
xd->this_mi =
|
|
||||||
xd->mi_8x8[0] = cm->mi;
|
xd->mi_8x8[0] = cm->mi;
|
||||||
xd->mic_stream_ptr = cm->mi;
|
xd->mic_stream_ptr = cm->mi;
|
||||||
|
|
||||||
|
@ -565,26 +564,26 @@ void vp9_first_pass(VP9_COMP *cpi) {
|
||||||
|
|
||||||
if (mb_col * 2 + 1 < cm->mi_cols) {
|
if (mb_col * 2 + 1 < cm->mi_cols) {
|
||||||
if (mb_row * 2 + 1 < cm->mi_rows) {
|
if (mb_row * 2 + 1 < cm->mi_rows) {
|
||||||
xd->this_mi->mbmi.sb_type = BLOCK_16X16;
|
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_16X16;
|
||||||
} else {
|
} else {
|
||||||
xd->this_mi->mbmi.sb_type = BLOCK_16X8;
|
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_16X8;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mb_row * 2 + 1 < cm->mi_rows) {
|
if (mb_row * 2 + 1 < cm->mi_rows) {
|
||||||
xd->this_mi->mbmi.sb_type = BLOCK_8X16;
|
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_8X16;
|
||||||
} else {
|
} else {
|
||||||
xd->this_mi->mbmi.sb_type = BLOCK_8X8;
|
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_8X8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xd->this_mi->mbmi.ref_frame[0] = INTRA_FRAME;
|
xd->mi_8x8[0]->mbmi.ref_frame[0] = INTRA_FRAME;
|
||||||
set_mi_row_col(cm, xd,
|
set_mi_row_col(cm, xd,
|
||||||
mb_row << 1,
|
mb_row << 1,
|
||||||
1 << mi_height_log2(xd->this_mi->mbmi.sb_type),
|
1 << mi_height_log2(xd->mi_8x8[0]->mbmi.sb_type),
|
||||||
mb_col << 1,
|
mb_col << 1,
|
||||||
1 << mi_width_log2(xd->this_mi->mbmi.sb_type));
|
1 << mi_width_log2(xd->mi_8x8[0]->mbmi.sb_type));
|
||||||
|
|
||||||
if (cpi->sf.variance_adaptive_quantization) {
|
if (cpi->sf.variance_adaptive_quantization) {
|
||||||
int energy = vp9_block_energy(cpi, x, xd->this_mi->mbmi.sb_type);
|
int energy = vp9_block_energy(cpi, x, xd->mi_8x8[0]->mbmi.sb_type);
|
||||||
error_weight = vp9_vaq_inv_q_ratio(energy);
|
error_weight = vp9_vaq_inv_q_ratio(energy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -690,13 +689,13 @@ void vp9_first_pass(VP9_COMP *cpi) {
|
||||||
mv.as_mv.col *= 8;
|
mv.as_mv.col *= 8;
|
||||||
this_error = motion_error;
|
this_error = motion_error;
|
||||||
vp9_set_mbmode_and_mvs(x, NEWMV, &mv);
|
vp9_set_mbmode_and_mvs(x, NEWMV, &mv);
|
||||||
xd->this_mi->mbmi.tx_size = TX_4X4;
|
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
|
||||||
xd->this_mi->mbmi.ref_frame[0] = LAST_FRAME;
|
xd->mi_8x8[0]->mbmi.ref_frame[0] = LAST_FRAME;
|
||||||
xd->this_mi->mbmi.ref_frame[1] = NONE;
|
xd->mi_8x8[0]->mbmi.ref_frame[1] = NONE;
|
||||||
vp9_build_inter_predictors_sby(xd, mb_row << 1,
|
vp9_build_inter_predictors_sby(xd, mb_row << 1,
|
||||||
mb_col << 1,
|
mb_col << 1,
|
||||||
xd->this_mi->mbmi.sb_type);
|
xd->mi_8x8[0]->mbmi.sb_type);
|
||||||
vp9_encode_sby(x, xd->this_mi->mbmi.sb_type);
|
vp9_encode_sby(x, xd->mi_8x8[0]->mbmi.sb_type);
|
||||||
sum_mvr += mv.as_mv.row;
|
sum_mvr += mv.as_mv.row;
|
||||||
sum_mvr_abs += abs(mv.as_mv.row);
|
sum_mvr_abs += abs(mv.as_mv.row);
|
||||||
sum_mvc += mv.as_mv.col;
|
sum_mvc += mv.as_mv.col;
|
||||||
|
|
|
@ -149,7 +149,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->this_mi->mbmi.mode = mode;
|
xd->mi_8x8[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);
|
||||||
|
@ -258,7 +258,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->this_mi = &mi_local;
|
xd->mi_8x8[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;
|
||||||
|
|
|
@ -3496,7 +3496,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
|
||||||
|
|
||||||
cpi->mb.e_mbd.mi_8x8 = cm->mi_grid_visible;
|
cpi->mb.e_mbd.mi_8x8 = cm->mi_grid_visible;
|
||||||
cpi->mb.e_mbd.mi_8x8[0] = cm->mi;
|
cpi->mb.e_mbd.mi_8x8[0] = cm->mi;
|
||||||
cpi->mb.e_mbd.this_mi = cm->mi;
|
|
||||||
|
|
||||||
// Don't increment frame counters if this was an altref buffer
|
// Don't increment frame counters if this was an altref buffer
|
||||||
// update not a real frame
|
// update not a real frame
|
||||||
|
|
|
@ -275,7 +275,7 @@ void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) {
|
||||||
VP9_COMMON *const cm = &cpi->common;
|
VP9_COMMON *const cm = &cpi->common;
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
int zbin_extra;
|
int zbin_extra;
|
||||||
int segment_id = xd->this_mi->mbmi.segment_id;
|
int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
|
||||||
const int qindex = vp9_get_qindex(&cpi->common.seg, segment_id,
|
const int qindex = vp9_get_qindex(&cpi->common.seg, segment_id,
|
||||||
cpi->common.base_qindex);
|
cpi->common.base_qindex);
|
||||||
|
|
||||||
|
|
|
@ -489,7 +489,7 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
|
||||||
TX_SIZE tx_size,
|
TX_SIZE tx_size,
|
||||||
const int16_t *scan, const int16_t *nb) {
|
const int16_t *scan, const int16_t *nb) {
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
struct macroblockd_plane *pd = &xd->plane[plane];
|
struct macroblockd_plane *pd = &xd->plane[plane];
|
||||||
const PLANE_TYPE type = pd->plane_type;
|
const PLANE_TYPE type = pd->plane_type;
|
||||||
const int16_t *band_count = &band_counts[tx_size][1];
|
const int16_t *band_count = &band_counts[tx_size][1];
|
||||||
|
@ -567,7 +567,7 @@ static void dist_block(int plane, int block, TX_SIZE tx_size, void *arg) {
|
||||||
args->sse = this_sse >> shift;
|
args->sse = this_sse >> shift;
|
||||||
|
|
||||||
if (x->skip_encode &&
|
if (x->skip_encode &&
|
||||||
xd->this_mi->mbmi.ref_frame[0] == INTRA_FRAME) {
|
xd->mi_8x8[0]->mbmi.ref_frame[0] == INTRA_FRAME) {
|
||||||
// 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);
|
||||||
|
@ -599,7 +599,7 @@ static void block_yrd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
if (args->skip)
|
if (args->skip)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!is_inter_block(&xd->this_mi->mbmi))
|
if (!is_inter_block(&xd->mi_8x8[0]->mbmi))
|
||||||
vp9_encode_block_intra(plane, block, plane_bsize, tx_size, &encode_args);
|
vp9_encode_block_intra(plane, block, plane_bsize, tx_size, &encode_args);
|
||||||
else
|
else
|
||||||
vp9_xform_quant(plane, block, plane_bsize, tx_size, &encode_args);
|
vp9_xform_quant(plane, block, plane_bsize, tx_size, &encode_args);
|
||||||
|
@ -686,7 +686,7 @@ static void txfm_rd_in_plane(MACROBLOCK *x,
|
||||||
init_rdcost_stack(x, tx_size, num_4x4_w, num_4x4_h,
|
init_rdcost_stack(x, tx_size, num_4x4_w, num_4x4_h,
|
||||||
ref_best_rd, rd_stack);
|
ref_best_rd, rd_stack);
|
||||||
if (plane == 0)
|
if (plane == 0)
|
||||||
xd->this_mi->mbmi.tx_size = tx_size;
|
xd->mi_8x8[0]->mbmi.tx_size = tx_size;
|
||||||
|
|
||||||
vp9_get_entropy_contexts(tx_size, rd_stack->t_above, rd_stack->t_left,
|
vp9_get_entropy_contexts(tx_size, rd_stack->t_above, rd_stack->t_left,
|
||||||
pd->above_context, pd->left_context,
|
pd->above_context, pd->left_context,
|
||||||
|
@ -718,7 +718,7 @@ static void choose_largest_txfm_size(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->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
if (max_tx_size == TX_32X32 &&
|
if (max_tx_size == TX_32X32 &&
|
||||||
(cm->tx_mode == ALLOW_32X32 ||
|
(cm->tx_mode == ALLOW_32X32 ||
|
||||||
cm->tx_mode == TX_MODE_SELECT)) {
|
cm->tx_mode == TX_MODE_SELECT)) {
|
||||||
|
@ -748,13 +748,13 @@ 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->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
vp9_prob skip_prob = vp9_get_pred_prob_mbskip(cm, xd);
|
vp9_prob skip_prob = vp9_get_pred_prob_mbskip(cm, xd);
|
||||||
int64_t rd[TX_SIZES][2];
|
int64_t rd[TX_SIZES][2];
|
||||||
int n, m;
|
int n, m;
|
||||||
int s0, s1;
|
int s0, s1;
|
||||||
|
|
||||||
const vp9_prob *tx_probs = get_tx_probs2(xd, &cm->fc.tx_probs, xd->this_mi);
|
const vp9_prob *tx_probs = get_tx_probs2(xd, &cm->fc.tx_probs, xd->mi_8x8[0]);
|
||||||
|
|
||||||
for (n = TX_4X4; n <= max_tx_size; n++) {
|
for (n = TX_4X4; n <= max_tx_size; n++) {
|
||||||
r[n][1] = r[n][0];
|
r[n][1] = r[n][0];
|
||||||
|
@ -851,7 +851,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->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
vp9_prob skip_prob = vp9_get_pred_prob_mbskip(cm, xd);
|
vp9_prob skip_prob = vp9_get_pred_prob_mbskip(cm, xd);
|
||||||
int64_t rd[TX_SIZES][2];
|
int64_t rd[TX_SIZES][2];
|
||||||
int n, m;
|
int n, m;
|
||||||
|
@ -859,7 +859,7 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
double scale_rd[TX_SIZES] = {1.73, 1.44, 1.20, 1.00};
|
double scale_rd[TX_SIZES] = {1.73, 1.44, 1.20, 1.00};
|
||||||
// double scale_r[TX_SIZES] = {2.82, 2.00, 1.41, 1.00};
|
// double scale_r[TX_SIZES] = {2.82, 2.00, 1.41, 1.00};
|
||||||
|
|
||||||
const vp9_prob *tx_probs = get_tx_probs2(xd, &cm->fc.tx_probs, xd->this_mi);
|
const vp9_prob *tx_probs = get_tx_probs2(xd, &cm->fc.tx_probs, xd->mi_8x8[0]);
|
||||||
|
|
||||||
// for (n = TX_4X4; n <= max_txfm_size; n++)
|
// for (n = TX_4X4; n <= max_txfm_size; n++)
|
||||||
// r[n][0] = (r[n][0] * scale_r[n]);
|
// r[n][0] = (r[n][0] * scale_r[n]);
|
||||||
|
@ -944,7 +944,7 @@ static void super_block_yrd(VP9_COMP *cpi,
|
||||||
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->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
struct rdcost_block_args *rdcost_stack = &cpi->rdcost_stack;
|
struct rdcost_block_args *rdcost_stack = &cpi->rdcost_stack;
|
||||||
|
|
||||||
assert(bs == mbmi->sb_type);
|
assert(bs == mbmi->sb_type);
|
||||||
|
@ -1054,7 +1054,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->this_mi->mbmi.tx_size = TX_4X4;
|
xd->mi_8x8[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;
|
||||||
|
@ -1085,7 +1085,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
|
||||||
uint8_t *dst = dst_init + idx * 4 + idy * 4 * dst_stride;
|
uint8_t *dst = dst_init + idx * 4 + idy * 4 * dst_stride;
|
||||||
|
|
||||||
block = ib + idy * 2 + idx;
|
block = ib + idy * 2 + idx;
|
||||||
xd->this_mi->bmi[block].as_mode = mode;
|
xd->mi_8x8[0]->bmi[block].as_mode = mode;
|
||||||
src_diff = raster_block_offset_int16(BLOCK_8X8, block, p->src_diff);
|
src_diff = raster_block_offset_int16(BLOCK_8X8, block, p->src_diff);
|
||||||
coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
|
coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
|
||||||
vp9_predict_intra_block(xd, block, 1,
|
vp9_predict_intra_block(xd, block, 1,
|
||||||
|
@ -1161,10 +1161,10 @@ static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP * const cpi,
|
||||||
int64_t best_rd) {
|
int64_t best_rd) {
|
||||||
int i, j;
|
int i, j;
|
||||||
MACROBLOCKD *const xd = &mb->e_mbd;
|
MACROBLOCKD *const xd = &mb->e_mbd;
|
||||||
MODE_INFO *const mic = xd->this_mi;
|
MODE_INFO *const mic = xd->mi_8x8[0];
|
||||||
const MODE_INFO *above_mi = xd->mi_8x8[-xd->mode_info_stride];
|
const MODE_INFO *above_mi = xd->mi_8x8[-xd->mode_info_stride];
|
||||||
const MODE_INFO *left_mi = xd->mi_8x8[-1];
|
const MODE_INFO *left_mi = xd->mi_8x8[-1];
|
||||||
const BLOCK_SIZE bsize = xd->this_mi->mbmi.sb_type;
|
const BLOCK_SIZE bsize = xd->mi_8x8[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;
|
||||||
|
@ -1235,7 +1235,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->this_mi;
|
MODE_INFO *const mic = xd->mi_8x8[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;
|
||||||
|
@ -1305,7 +1305,7 @@ static void super_block_uvrd(VP9_COMP *const 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->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[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;
|
||||||
|
@ -1428,7 +1428,7 @@ static int cost_mv_ref(VP9_COMP *cpi, MB_PREDICTION_MODE mode,
|
||||||
int mode_context) {
|
int mode_context) {
|
||||||
MACROBLOCK *const x = &cpi->mb;
|
MACROBLOCK *const x = &cpi->mb;
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
const int segment_id = xd->this_mi->mbmi.segment_id;
|
const int segment_id = xd->mi_8x8[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)) {
|
||||||
|
@ -1464,7 +1464,7 @@ static int labels2mode(MACROBLOCK *x, int i,
|
||||||
int_mv *second_best_ref_mv,
|
int_mv *second_best_ref_mv,
|
||||||
int *mvjcost, int *mvcost[2], VP9_COMP *cpi) {
|
int *mvjcost, int *mvcost[2], VP9_COMP *cpi) {
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MODE_INFO *const mic = xd->this_mi;
|
MODE_INFO *const mic = xd->mi_8x8[0];
|
||||||
MB_MODE_INFO *mbmi = &mic->mbmi;
|
MB_MODE_INFO *mbmi = &mic->mbmi;
|
||||||
int cost = 0, thismvcost = 0;
|
int cost = 0, thismvcost = 0;
|
||||||
int idx, idy;
|
int idx, idy;
|
||||||
|
@ -1542,7 +1542,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->this_mi;
|
MODE_INFO *const mi = xd->mi_8x8[0];
|
||||||
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
|
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
|
||||||
const int width = plane_block_width(bsize, pd);
|
const int width = plane_block_width(bsize, pd);
|
||||||
const int height = plane_block_height(bsize, pd);
|
const int height = plane_block_height(bsize, pd);
|
||||||
|
@ -2059,7 +2059,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->this_mi;
|
MODE_INFO *mi = xd->mi_8x8[0];
|
||||||
MB_MODE_INFO *mbmi = &mi->mbmi;
|
MB_MODE_INFO *mbmi = &mi->mbmi;
|
||||||
int mode_idx;
|
int mode_idx;
|
||||||
|
|
||||||
|
@ -2105,7 +2105,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->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
int_mv this_mv;
|
int_mv this_mv;
|
||||||
int i;
|
int i;
|
||||||
int zero_seen = 0;
|
int zero_seen = 0;
|
||||||
|
@ -2229,7 +2229,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->this_mi;
|
ctx->mic = *xd->mi_8x8[0];
|
||||||
|
|
||||||
ctx->best_ref_mv.as_int = ref_mv->as_int;
|
ctx->best_ref_mv.as_int = ref_mv->as_int;
|
||||||
ctx->second_best_ref_mv.as_int = second_ref_mv->as_int;
|
ctx->second_best_ref_mv.as_int = second_ref_mv->as_int;
|
||||||
|
@ -2280,7 +2280,7 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
VP9_COMMON *cm = &cpi->common;
|
VP9_COMMON *cm = &cpi->common;
|
||||||
YV12_BUFFER_CONFIG *yv12 = &cm->yv12_fb[cpi->common.ref_frame_map[idx]];
|
YV12_BUFFER_CONFIG *yv12 = &cm->yv12_fb[cpi->common.ref_frame_map[idx]];
|
||||||
MACROBLOCKD *const xd = &x->e_mbd;
|
MACROBLOCKD *const xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
|
|
||||||
// set up scaling factors
|
// set up scaling factors
|
||||||
scale[frame_type] = cpi->common.active_ref_scale[frame_type - 1];
|
scale[frame_type] = cpi->common.active_ref_scale[frame_type - 1];
|
||||||
|
@ -2298,7 +2298,7 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
&scale[frame_type], &scale[frame_type]);
|
&scale[frame_type], &scale[frame_type]);
|
||||||
|
|
||||||
// Gets an initial list of candidate vectors from neighbours and orders them
|
// Gets an initial list of candidate vectors from neighbours and orders them
|
||||||
vp9_find_mv_refs(&cpi->common, xd, xd->this_mi,
|
vp9_find_mv_refs(&cpi->common, xd, xd->mi_8x8[0],
|
||||||
xd->last_mi,
|
xd->last_mi,
|
||||||
frame_type,
|
frame_type,
|
||||||
mbmi->ref_mvs[frame_type], mi_row, mi_col);
|
mbmi->ref_mvs[frame_type], mi_row, mi_col);
|
||||||
|
@ -2328,7 +2328,7 @@ static YV12_BUFFER_CONFIG *get_scaled_ref_frame(VP9_COMP *cpi, int ref_frame) {
|
||||||
|
|
||||||
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->this_mi->mbmi;
|
const MB_MODE_INFO *const mbmi = &xd->mi_8x8[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];
|
||||||
|
@ -2340,7 +2340,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->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[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;
|
||||||
|
@ -2479,7 +2479,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int *rate_mv) {
|
int *rate_mv) {
|
||||||
int pw = 4 << b_width_log2(bsize), ph = 4 << b_height_log2(bsize);
|
int pw = 4 << b_width_log2(bsize), ph = 4 << b_height_log2(bsize);
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
int refs[2] = { mbmi->ref_frame[0],
|
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];
|
||||||
|
@ -2644,7 +2644,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->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[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;
|
||||||
|
@ -2690,7 +2690,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
single_motion_search(cpi, x, bsize, mi_row, mi_col, &tmp_mv, &rate_mv);
|
single_motion_search(cpi, x, bsize, mi_row, mi_col, &tmp_mv, &rate_mv);
|
||||||
*rate2 += rate_mv;
|
*rate2 += rate_mv;
|
||||||
frame_mv[refs[0]].as_int =
|
frame_mv[refs[0]].as_int =
|
||||||
xd->this_mi->bmi[0].as_mv[0].as_int = tmp_mv.as_int;
|
xd->mi_8x8[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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3054,7 +3054,7 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
int64_t dist_y = 0, dist_uv = 0, tx_cache[TX_MODES] = { 0 };
|
int64_t dist_y = 0, dist_uv = 0, tx_cache[TX_MODES] = { 0 };
|
||||||
x->skip_encode = 0;
|
x->skip_encode = 0;
|
||||||
ctx->skip = 0;
|
ctx->skip = 0;
|
||||||
xd->this_mi->mbmi.ref_frame[0] = INTRA_FRAME;
|
xd->mi_8x8[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,
|
||||||
&dist_y, &y_skip, bsize, tx_cache,
|
&dist_y, &y_skip, bsize, tx_cache,
|
||||||
|
@ -3094,7 +3094,7 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->mic = *xd->this_mi;
|
ctx->mic = *xd->mi_8x8[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,
|
||||||
|
@ -3106,7 +3106,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 *cm = &cpi->common;
|
VP9_COMMON *cm = &cpi->common;
|
||||||
MACROBLOCKD *xd = &x->e_mbd;
|
MACROBLOCKD *xd = &x->e_mbd;
|
||||||
MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
const struct segmentation *seg = &cm->seg;
|
const struct segmentation *seg = &cm->seg;
|
||||||
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]);
|
||||||
MB_PREDICTION_MODE this_mode;
|
MB_PREDICTION_MODE this_mode;
|
||||||
|
@ -3537,15 +3537,15 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep record of best intra rd
|
// Keep record of best intra rd
|
||||||
if (xd->this_mi->mbmi.ref_frame[0] == INTRA_FRAME &&
|
if (xd->mi_8x8[0]->mbmi.ref_frame[0] == INTRA_FRAME &&
|
||||||
is_intra_mode(xd->this_mi->mbmi.mode) &&
|
is_intra_mode(xd->mi_8x8[0]->mbmi.mode) &&
|
||||||
this_rd < best_intra_rd) {
|
this_rd < best_intra_rd) {
|
||||||
best_intra_rd = this_rd;
|
best_intra_rd = this_rd;
|
||||||
best_intra_mode = xd->this_mi->mbmi.mode;
|
best_intra_mode = xd->mi_8x8[0]->mbmi.mode;
|
||||||
}
|
}
|
||||||
// Keep record of best inter rd with single reference
|
// Keep record of best inter rd with single reference
|
||||||
if (xd->this_mi->mbmi.ref_frame[0] > INTRA_FRAME &&
|
if (xd->mi_8x8[0]->mbmi.ref_frame[0] > INTRA_FRAME &&
|
||||||
xd->this_mi->mbmi.ref_frame[1] == NONE &&
|
xd->mi_8x8[0]->mbmi.ref_frame[1] == NONE &&
|
||||||
!mode_excluded &&
|
!mode_excluded &&
|
||||||
this_rd < best_inter_rd) {
|
this_rd < best_inter_rd) {
|
||||||
best_inter_rd = this_rd;
|
best_inter_rd = this_rd;
|
||||||
|
@ -3804,7 +3804,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->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
const struct segmentation *seg = &cm->seg;
|
const struct segmentation *seg = &cm->seg;
|
||||||
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]);
|
||||||
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
|
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
|
||||||
|
@ -4093,7 +4093,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->this_mi->mbmi.tx_size = TX_4X4;
|
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
|
||||||
|
|
||||||
cpi->rd_filter_cache[SWITCHABLE_FILTERS] = INT64_MAX;
|
cpi->rd_filter_cache[SWITCHABLE_FILTERS] = INT64_MAX;
|
||||||
if (cm->mcomp_filter_type != BILINEAR) {
|
if (cm->mcomp_filter_type != BILINEAR) {
|
||||||
|
@ -4148,7 +4148,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->this_mi->bmi[i];
|
tmp_best_bmodes[i] = xd->mi_8x8[0]->bmi[i];
|
||||||
pred_exists = 1;
|
pred_exists = 1;
|
||||||
if (switchable_filter_index == 0 &&
|
if (switchable_filter_index == 0 &&
|
||||||
cpi->sf.use_rd_breakout &&
|
cpi->sf.use_rd_breakout &&
|
||||||
|
@ -4199,7 +4199,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->this_mi->bmi[i] = tmp_best_bmodes[i];
|
xd->mi_8x8[0]->bmi[i] = tmp_best_bmodes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
rate2 += rate;
|
rate2 += rate;
|
||||||
|
@ -4292,8 +4292,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 (xd->this_mi->mbmi.ref_frame[0] > INTRA_FRAME &&
|
if (xd->mi_8x8[0]->mbmi.ref_frame[0] > INTRA_FRAME &&
|
||||||
xd->this_mi->mbmi.ref_frame[1] == NONE &&
|
xd->mi_8x8[0]->mbmi.ref_frame[1] == NONE &&
|
||||||
!mode_excluded &&
|
!mode_excluded &&
|
||||||
this_rd < best_inter_rd) {
|
this_rd < best_inter_rd) {
|
||||||
best_inter_rd = this_rd;
|
best_inter_rd = this_rd;
|
||||||
|
@ -4329,7 +4329,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
sizeof(ctx->zcoeff_blk));
|
sizeof(ctx->zcoeff_blk));
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
best_bmodes[i] = xd->this_mi->bmi[i];
|
best_bmodes[i] = xd->mi_8x8[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
|
||||||
|
@ -4480,13 +4480,13 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
x->skip |= best_skip2;
|
x->skip |= best_skip2;
|
||||||
if (best_mbmode.ref_frame[0] == INTRA_FRAME) {
|
if (best_mbmode.ref_frame[0] == INTRA_FRAME) {
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
xd->this_mi->bmi[i].as_mode = best_bmodes[i].as_mode;
|
xd->mi_8x8[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->this_mi->bmi[i], &best_bmodes[i], sizeof(b_mode_info));
|
vpx_memcpy(&xd->mi_8x8[0]->bmi[i], &best_bmodes[i], sizeof(b_mode_info));
|
||||||
|
|
||||||
mbmi->mv[0].as_int = xd->this_mi->bmi[3].as_mv[0].as_int;
|
mbmi->mv[0].as_int = xd->mi_8x8[0]->bmi[3].as_mv[0].as_int;
|
||||||
mbmi->mv[1].as_int = xd->this_mi->bmi[3].as_mv[1].as_int;
|
mbmi->mv[1].as_int = xd->mi_8x8[0]->bmi[3].as_mv[1].as_int;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < NB_PREDICTION_TYPES; ++i) {
|
for (i = 0; i < NB_PREDICTION_TYPES; ++i) {
|
||||||
|
|
|
@ -129,9 +129,8 @@ static void count_segs(VP9_COMP *cpi, MODE_INFO **mi_8x8,
|
||||||
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
segment_id = mi_8x8[0]->mbmi.segment_id;
|
|
||||||
xd->mi_8x8 = mi_8x8;
|
xd->mi_8x8 = mi_8x8;
|
||||||
xd->this_mi = mi_8x8[0];
|
segment_id = xd->mi_8x8[0]->mbmi.segment_id;
|
||||||
|
|
||||||
set_mi_row_col(cm, xd, mi_row, bh, mi_col, bw);
|
set_mi_row_col(cm, xd, mi_row, bh, mi_col, bw);
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
||||||
MACROBLOCKD *xd = args->xd;
|
MACROBLOCKD *xd = args->xd;
|
||||||
TOKENEXTRA **tp = args->tp;
|
TOKENEXTRA **tp = args->tp;
|
||||||
struct macroblockd_plane *pd = &xd->plane[plane];
|
struct macroblockd_plane *pd = &xd->plane[plane];
|
||||||
MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
|
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
int pt; /* near block/prev token context index */
|
int pt; /* near block/prev token context index */
|
||||||
int c = 0, rc = 0;
|
int c = 0, rc = 0;
|
||||||
TOKENEXTRA *t = *tp; /* store tokens starting here */
|
TOKENEXTRA *t = *tp; /* store tokens starting here */
|
||||||
|
@ -200,7 +200,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->this_mi->mbmi;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
TOKENEXTRA *t_backup = *t;
|
TOKENEXTRA *t_backup = *t;
|
||||||
const int mb_skip_context = vp9_get_pred_context_mbskip(xd);
|
const int mb_skip_context = vp9_get_pred_context_mbskip(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,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче