summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLalit Kansara <lkansara@codeaurora.org>2016-07-25 15:11:20 +0530
committerLinux Build Service Account <lnxbuild@localhost>2016-08-24 08:18:53 -0600
commitf56b76d5968ee5ab940091344b378619b5607997 (patch)
tree2a78829fe79131ebd63368e200961a514eef1477
parent665daeb413f6e0a84c3e6dd29e6e8a1791ae8bcb (diff)
downloadandroid_external_libhevc-staging/cm-14.0-caf.tar.gz
android_external_libhevc-staging/cm-14.0-caf.tar.bz2
android_external_libhevc-staging/cm-14.0-caf.zip
Revert "Added few memsets to avoid uninitialized reads for error clips"staging/cm-14.0-caf
This reverts commit dca46f9e910edc5a31d19304ffa98e0654dfb638 Change-Id: I4d2ea73f903eb29bce9a381a029713e28e8af7e8
-rw-r--r--decoder/ihevcd_api.c3
-rw-r--r--decoder/ihevcd_utils.c40
2 files changed, 6 insertions, 37 deletions
diff --git a/decoder/ihevcd_api.c b/decoder/ihevcd_api.c
index e331337..55d965c 100644
--- a/decoder/ihevcd_api.c
+++ b/decoder/ihevcd_api.c
@@ -1237,7 +1237,6 @@ WORD32 ihevcd_allocate_static_bufs(iv_obj_t **pps_codec_obj,
size = MAX_SLICE_HDR_CNT * sizeof(slice_header_t);
pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
RETURN_IF((NULL == pv_buf), IV_FAIL);
- memset(pv_buf, 0, size);
ps_codec->ps_slice_hdr_base = (slice_header_t *)pv_buf;
ps_codec->s_parse.ps_slice_hdr_base = ps_codec->ps_slice_hdr_base;
@@ -1306,7 +1305,7 @@ WORD32 ihevcd_allocate_static_bufs(iv_obj_t **pps_codec_obj,
pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
RETURN_IF((NULL == pu1_buf), IV_FAIL);
- memset(pu1_buf, 0, size);
+
for(i = 0; i < MAX_PROCESS_THREADS; i++)
{
diff --git a/decoder/ihevcd_utils.c b/decoder/ihevcd_utils.c
index c6c21f5..4587694 100644
--- a/decoder/ihevcd_utils.c
+++ b/decoder/ihevcd_utils.c
@@ -606,8 +606,8 @@ IHEVCD_ERROR_T ihevcd_mv_buf_mgr_add_bufs(codec_t *ps_codec)
mv_bank_size_allocated = ps_codec->i4_total_mv_bank_size - max_dpb_size * sizeof(mv_buf_t);
/* Compute MV bank size per picture */
- pic_mv_bank_size = ihevcd_get_pic_mv_bank_size(ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
- ALIGN64(ps_sps->i2_pic_height_in_luma_samples));
+ pic_mv_bank_size = ihevcd_get_pic_mv_bank_size(ps_sps->i2_pic_width_in_luma_samples *
+ ps_sps->i2_pic_height_in_luma_samples);
for(i = 0; i < max_dpb_size; i++)
{
@@ -641,7 +641,6 @@ IHEVCD_ERROR_T ihevcd_mv_buf_mgr_add_bufs(codec_t *ps_codec)
pu1_buf += ALIGN4(num_ctb * sizeof(UWORD16));
ps_mv_buf->ps_pic_pu = (pu_t *)pu1_buf;
- pu1_buf += num_pu * sizeof(pu_t);
buf_ret = ihevc_buf_mgr_add((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, ps_mv_buf, i);
@@ -650,7 +649,7 @@ IHEVCD_ERROR_T ihevcd_mv_buf_mgr_add_bufs(codec_t *ps_codec)
ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR;
return IHEVCD_BUF_MGR_ERROR;
}
-
+ pu1_buf += pic_mv_bank_size;
ps_mv_buf++;
}
@@ -802,35 +801,6 @@ IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec)
ps_pic_buf_ref = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ps_slice_hdr->i4_abs_pic_order_cnt);
if(NULL == ps_pic_buf_ref)
{
- WORD32 size;
-
- WORD32 num_pu;
- WORD32 num_ctb;
- WORD32 pic_size;
- /* In case current mv buffer itself is being used as reference mv buffer for colocated
- * calculations, then memset all the buffers to zero.
- */
- pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
- ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
-
- num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
- num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
-
- memset(ps_mv_buf->ai4_l0_collocated_poc, 0, sizeof(ps_mv_buf->ai4_l0_collocated_poc));
- memset(ps_mv_buf->ai1_l0_collocated_poc_lt, 0, sizeof(ps_mv_buf->ai1_l0_collocated_poc_lt));
- memset(ps_mv_buf->ai4_l1_collocated_poc, 0, sizeof(ps_mv_buf->ai4_l1_collocated_poc));
- memset(ps_mv_buf->ai1_l1_collocated_poc_lt, 0, sizeof(ps_mv_buf->ai1_l1_collocated_poc_lt));
-
- size = (num_ctb + 1) * sizeof(WORD32);
- memset(ps_mv_buf->pu4_pic_pu_idx, 0, size);
-
- size = num_pu;
- memset(ps_mv_buf->pu1_pic_pu_map, 0, size);
- size = ALIGN4(num_ctb * sizeof(UWORD16));
- memset(ps_mv_buf->pu1_pic_slice_map, 0, size);
- size = num_pu * sizeof(pu_t);
- memset(ps_mv_buf->ps_pic_pu, 0, size);
-
ps_pic_buf_ref = ps_cur_pic;
ps_mv_buf_ref = ps_mv_buf;
}
@@ -894,8 +864,8 @@ IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec)
WORD32 pic_size;
WORD32 num_ctb;
- pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
- ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
+ pic_size = ps_sps->i2_pic_width_in_luma_samples *
+ ps_sps->i2_pic_height_in_luma_samples;
ctb_luma_min_tu_cnt = pic_size / (MIN_TU_SIZE * MIN_TU_SIZE);