Commit d0916d9f authored by Angie Chiang's avatar Angie Chiang

Add aom_merge_corrupted_flag to simplify debugging

This function allows us to set breakpoint when error happens.

Change-Id: I0074a26142625fb95728ed6aa003453ab4203c0f
parent b11aedf9
......@@ -440,6 +440,8 @@ void aom_internal_error(struct aom_internal_error_info *info,
aom_codec_err_t error, const char *fmt,
...) CLANG_ANALYZER_NORETURN;
void aom_merge_corrupted_flag(int *corrupted, int value);
#if CONFIG_DEBUG
#define AOM_CHECK_MEM_ERROR(error_info, lval, expr) \
do { \
......
......@@ -132,3 +132,7 @@ void aom_internal_error(struct aom_internal_error_info *info,
if (info->setjmp) longjmp(info->jmp, info->error_code);
}
void aom_merge_corrupted_flag(int *corrupted, int value) {
*corrupted |= value;
}
......@@ -788,7 +788,7 @@ static void set_ref(AV1_COMMON *const cm, MACROBLOCKD *const xd, int idx,
"Invalid scale factors");
av1_setup_pre_planes(xd, idx, ref_buffer->buf, mi_row, mi_col,
&ref_buffer->sf);
xd->corrupted |= ref_buffer->buf->corrupted;
aom_merge_corrupted_flag(&xd->corrupted, ref_buffer->buf->corrupted);
}
static void dec_predict_b_extend(
......@@ -1486,7 +1486,8 @@ static void decode_mbmi_block(AV1Decoder *const pbi, MACROBLOCKD *const xd,
xd->mi[0]->mbmi.segment_id_supertx = MAX_SEGMENTS;
#endif // CONFIG_SUPERTX
xd->corrupted |= aom_reader_has_error(r);
int reader_corrupted_flag = aom_reader_has_error(r);
aom_merge_corrupted_flag(&xd->corrupted, reader_corrupted_flag);
}
static void decode_token_and_recon_block(AV1Decoder *const pbi,
......@@ -1787,7 +1788,8 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
}
#endif
xd->corrupted |= aom_reader_has_error(r);
int reader_corrupted_flag = aom_reader_has_error(r);
aom_merge_corrupted_flag(&xd->corrupted, reader_corrupted_flag);
}
#if CONFIG_NCOBMC && CONFIG_MOTION_VAR
......@@ -3601,7 +3603,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
cm->sb_size);
#endif
}
pbi->mb.corrupted |= td->xd.corrupted;
aom_merge_corrupted_flag(&pbi->mb.corrupted, td->xd.corrupted);
if (pbi->mb.corrupted)
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Failed to decode tile data");
......@@ -3718,7 +3720,7 @@ static int tile_worker_hook(TileWorkerData *const tile_data,
if (setjmp(tile_data->error_info.jmp)) {
tile_data->error_info.setjmp = 0;
tile_data->xd.corrupted = 1;
aom_merge_corrupted_flag(&tile_data->xd.corrupted, 1);
return 0;
}
......
......@@ -1884,7 +1884,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#endif // CONFIG_EXT_INTER
nearest_sub8x8, near_sub8x8, mi_row, mi_col, is_compound,
allow_hp, r)) {
xd->corrupted |= 1;
aom_merge_corrupted_flag(&xd->corrupted, 1);
break;
};
......@@ -1925,7 +1925,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
nearestmv[ref] = ref_mv[ref];
}
xd->corrupted |=
int mv_corrupted_flag =
!assign_mv(cm, xd, mbmi->mode, mbmi->ref_frame, 0, mbmi->mv,
#if CONFIG_EXT_INTER
mbmi->mode == NEWFROMNEARMV ? nearmv : nearestmv,
......@@ -1933,6 +1933,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
ref_mv,
#endif // CONFIG_EXT_INTER
nearestmv, nearmv, mi_row, mi_col, is_compound, allow_hp, r);
aom_merge_corrupted_flag(&xd->corrupted, mv_corrupted_flag);
}
#if CONFIG_EXT_INTER
......
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