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