Fix uninitialized sao_info structure members, which was creating false positive when checkpointing SAO

This commit is contained in:
Laurent Fasnacht 2014-06-12 08:35:33 +02:00
parent f371bdafc3
commit ae4dc4eb44
2 changed files with 11 additions and 0 deletions

View file

@ -301,6 +301,9 @@ static void encoder_state_worker_encode_lcu(void * opaque) {
sao_luma->merge_left_flag = sao_luma->merge_left_flag & sao_chroma->merge_left_flag;
sao_luma->merge_up_flag = sao_luma->merge_up_flag & sao_chroma->merge_up_flag;
assert(sao_luma->eo_class < SAO_NUM_EO);
assert(sao_chroma->eo_class < SAO_NUM_EO);
CHECKPOINT_SAO_INFO("sao_luma", *sao_luma);
CHECKPOINT_SAO_INFO("sao_chroma", *sao_chroma);
}

View file

@ -738,6 +738,14 @@ static void sao_search_best_mode(const encoder_state * const encoder_state, cons
sao_info edge_sao;
sao_info band_sao;
//Avoid "random" uninitialized value
edge_sao.band_position = 0;
edge_sao.eo_class = SAO_EO0;
band_sao.offsets[0] = 0;
band_sao.eo_class = SAO_EO0;
//memset(&edge_sao, 0, sizeof(sao_info));
//memset(&band_sao, 0, sizeof(sao_info));
sao_search_edge_sao(encoder_state, data, recdata, block_width, block_height, buf_cnt, &edge_sao, sao_top, sao_left);
sao_search_band_sao(encoder_state, data, recdata, block_width, block_height, buf_cnt, &band_sao, sao_top, sao_left);