Commit 048e9c09 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Making read_inter_mode_info function more clear.

Now read_inter_mode_info calls read_intra_block_part (renamed from
read_intra_block_modes) or read_inter_block_part (just added).

Change-Id: I541badea6b663e0ae692ec158665efb90ed20c03
parent d53fc9ee
...@@ -380,7 +380,7 @@ static INLINE INTERPOLATIONFILTERTYPE read_switchable_filter_type( ...@@ -380,7 +380,7 @@ static INLINE INTERPOLATIONFILTERTYPE read_switchable_filter_type(
return vp9_switchable_interp[index]; return vp9_switchable_interp[index];
} }
static void read_intra_block_modes(VP9D_COMP *pbi, MODE_INFO *mi, static void read_intra_block_part(VP9D_COMP *pbi, MODE_INFO *mi,
vp9_reader *r) { vp9_reader *r) {
VP9_COMMON *const cm = &pbi->common; VP9_COMMON *const cm = &pbi->common;
MB_MODE_INFO *const mbmi = &mi->mbmi; MB_MODE_INFO *const mbmi = &mi->mbmi;
...@@ -433,29 +433,18 @@ static MV_REFERENCE_FRAME read_reference_frame(VP9D_COMP *pbi, int segment_id, ...@@ -433,29 +433,18 @@ static MV_REFERENCE_FRAME read_reference_frame(VP9D_COMP *pbi, int segment_id,
return ref; return ref;
} }
static void read_inter_mode_info(VP9D_COMP *pbi, MODE_INFO *mi, static void read_inter_block_part(VP9D_COMP *pbi, MODE_INFO *mi,
int mi_row, int mi_col, vp9_reader *r) { 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;
nmv_context *const nmvc = &cm->fc.nmvc; nmv_context *const nmvc = &cm->fc.nmvc;
MB_MODE_INFO *const mbmi = &mi->mbmi; MB_MODE_INFO *const mbmi = &mi->mbmi;
int_mv *const mv0 = &mbmi->mv[0]; int_mv *const mv0 = &mbmi->mv[0];
int_mv *const mv1 = &mbmi->mv[1]; int_mv *const mv1 = &mbmi->mv[1];
const BLOCK_SIZE_TYPE bsize = mi->mbmi.sb_type; const BLOCK_SIZE_TYPE bsize = mbmi->sb_type;
const int bw = 1 << b_width_log2(bsize); const int bw = 1 << b_width_log2(bsize);
const int bh = 1 << b_height_log2(bsize); const int bh = 1 << b_height_log2(bsize);
int idx, idy;
mbmi->segment_id = read_inter_segment_id(pbi, mi_row, mi_col, r);
mbmi->mb_skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r);
mbmi->ref_frame[0] = read_reference_frame(pbi, mbmi->segment_id, r);
mbmi->ref_frame[1] = NONE;
mbmi->txfm_size = read_tx_size(pbi, cm->tx_mode, bsize,
(!mbmi->mb_skip_coeff || mbmi->ref_frame[0] == INTRA_FRAME), r);
if (mbmi->ref_frame[0] != INTRA_FRAME) {
int_mv nearest, nearby, best_mv; int_mv nearest, nearby, best_mv;
int_mv nearest_second, nearby_second, best_mv_second; int_mv nearest_second, nearby_second, best_mv_second;
vp9_prob *mv_ref_p; vp9_prob *mv_ref_p;
...@@ -501,6 +490,7 @@ static void read_inter_mode_info(VP9D_COMP *pbi, MODE_INFO *mi, ...@@ -501,6 +490,7 @@ static void read_inter_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
if (mbmi->sb_type < BLOCK_SIZE_SB8X8) { if (mbmi->sb_type < BLOCK_SIZE_SB8X8) {
int idx, idy;
for (idy = 0; idy < 2; idy += bh) { for (idy = 0; idy < 2; idy += bh) {
for (idx = 0; idx < 2; idx += bw) { for (idx = 0; idx < 2; idx += bw) {
int_mv blockmv, secondmv; int_mv blockmv, secondmv;
...@@ -606,10 +596,28 @@ static void read_inter_mode_info(VP9D_COMP *pbi, MODE_INFO *mi, ...@@ -606,10 +596,28 @@ static void read_inter_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
assert(!"Invalid inter mode value"); assert(!"Invalid inter mode value");
} }
} }
} else { }
mv0->as_int = 0; // required for left and above block mv
read_intra_block_modes(pbi, mi, r); static void read_inter_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
} int mi_row, int mi_col, vp9_reader *r) {
VP9_COMMON *const cm = &pbi->common;
MB_MODE_INFO *const mbmi = &mi->mbmi;
int intra_block;
mbmi->segment_id = read_inter_segment_id(pbi, mi_row, mi_col, r);
mbmi->mb_skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r);
mbmi->ref_frame[0] = read_reference_frame(pbi, mbmi->segment_id, r);
mbmi->ref_frame[1] = NONE;
intra_block = mbmi->ref_frame[0] == INTRA_FRAME;
mbmi->txfm_size = read_tx_size(pbi, cm->tx_mode, mbmi->sb_type,
!mbmi->mb_skip_coeff || intra_block, r);
mbmi->mv[0].as_int = 0;
mbmi->mv[1].as_int = 0;
if (intra_block)
read_intra_block_part(pbi, mi, r);
else
read_inter_block_part(pbi, mi, r);
} }
static void read_comp_pred(VP9_COMMON *cm, vp9_reader *r) { static void read_comp_pred(VP9_COMMON *cm, vp9_reader *r) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment