Added cu->inter.mv_ref_coded variable

This commit is contained in:
Marko Viitanen 2015-03-10 09:17:25 +02:00
parent ec02642cc8
commit eba298e635
4 changed files with 9 additions and 7 deletions

View file

@ -63,6 +63,7 @@ typedef struct
int16_t mvd[2];
uint8_t mv_cand; // \brief selected MV candidate
uint8_t mv_ref; // \brief Index of the encoder_control.ref array.
uint8_t mv_ref_coded; // \brief Coded and corrected index of ref picture
uint8_t mv_dir; // \brief Probably describes if mv_ref is forward, backward or both. Might not be needed?
int8_t mode;
} cu_info_inter;

View file

@ -1198,7 +1198,7 @@ void encode_coding_tree(encoder_state * const encoder_state,
if (cur_cu->inter.mv_dir & (1 << ref_list_idx)) {
if (ref_list[ref_list_idx] != 1) { //encoder_state->ref_idx_num[uiRefListIdx] != 1)//NumRefIdx != 1)
// parseRefFrmIdx
int32_t ref_frame = cur_cu->inter.mv_ref;
int32_t ref_frame = cur_cu->inter.mv_ref_coded;
cabac->cur_ctx = &(cabac->ctx.cu_ref_pic_model[0]);
CABAC_BIN(cabac, (ref_frame != 0), "ref_frame_flag");

View file

@ -60,6 +60,7 @@ void inter_set_block(videoframe* frame, uint32_t x_cu, uint32_t y_cu, uint8_t de
cu->inter.mv[1] = cur_cu->inter.mv[1];
cu->inter.mv_dir = cur_cu->inter.mv_dir;
cu->inter.mv_ref = cur_cu->inter.mv_ref;
cu->inter.mv_ref_coded = cur_cu->inter.mv_ref_coded;
cu->tr_depth = tr_depth;
}
}

View file

@ -702,17 +702,17 @@ static int search_cu_inter(const encoder_state * const encoder_state, int x, int
int j, ref_list[2] = { 0, 0 };
for (j = 0; j < encoder_state->global->ref->used_size; j++) {
if (encoder_state->global->ref->images[j]->poc < encoder_state->global->poc) {
ref_list[0]++;
if (ref_idx == j) {
cur_cu->inter.mv_dir = 1;
cur_cu->inter.mv_ref = ref_list[0];
cur_cu->inter.mv_dir = 1;
cur_cu->inter.mv_ref_coded = ref_list[0];
}
} else {
ref_list[1]++;
ref_list[0]++;
} else {
if (ref_idx == j) {
cur_cu->inter.mv_dir = 2;
cur_cu->inter.mv_ref = ref_list[1];
cur_cu->inter.mv_ref_coded = ref_list[1];
}
ref_list[1]++;
}
}
cur_cu->merged = merged;