From 1c01bc10a9d105be5dc286a4c48969d73827cc03 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 27 Oct 2015 17:52:13 -0700 Subject: Remove __DATE__/__TIME__ from Android builds This removes unnecessary changes from build to build. Bug: 24204119 Change-Id: I25258314fe56ea186d38d756fb5fb04aa689a812 (cherry picked from commit f197ccb7562bac6f5bae40c9cb9dbb46a77baeb5) --- decoder/ih264d_api.c | 7 +++++++ encoder/ih264e_version.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c index fc21a06..cd91483 100644 --- a/decoder/ih264d_api.c +++ b/decoder/ih264d_api.c @@ -103,10 +103,17 @@ #define CODEC_RELEASE_VER "05.00" #define CODEC_VENDOR "ITTIAM" #define MAXVERSION_STRLEN 511 +#ifdef __ANDROID__ +#define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor) \ + snprintf(version_string, MAXVERSION_STRLEN, \ + "@(#)Id:%s_%s Ver:%s Released by %s", \ + codec_name, codec_release_type, codec_release_ver, codec_vendor) +#else #define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor) \ snprintf(version_string, MAXVERSION_STRLEN, \ "@(#)Id:%s_%s Ver:%s Released by %s Build: %s @ %s", \ codec_name, codec_release_type, codec_release_ver, codec_vendor, __DATE__, __TIME__) +#endif #define MIN_IN_BUFS 1 diff --git a/encoder/ih264e_version.c b/encoder/ih264e_version.c index 173f17c..e66e1ad 100644 --- a/encoder/ih264e_version.c +++ b/encoder/ih264e_version.c @@ -85,10 +85,17 @@ * Concatenates various strings to form a version string ******************************************************************************* */ +#ifdef __ANDROID__ +#define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor) \ + snprintf(version_string, MAX_STRLEN, \ + "@(#)Id:%s_%s Ver:%s Released by %s", \ + codec_name, codec_release_type, codec_release_ver, codec_vendor) +#else #define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor) \ snprintf(version_string, MAX_STRLEN, \ "@(#)Id:%s_%s Ver:%s Released by %s Build: %s @ %s", \ codec_name, codec_release_type, codec_release_ver, codec_vendor, __DATE__, __TIME__) +#endif /*****************************************************************************/ /* Function Definitions */ -- cgit v1.2.3 From 4a524d3a8ae9aa20c36430008e6bd429443f8f1d Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Thu, 7 Jan 2016 16:59:02 +0530 Subject: Decoder Update mb count after mb map is set. Bug: 25928803 Change-Id: Iccc58a7dd1c5c6ea656dfca332cfb8dddba4de37 --- decoder/ih264d_parse_islice.c | 6 ++---- decoder/ih264d_parse_pslice.c | 11 ++++------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/decoder/ih264d_parse_islice.c b/decoder/ih264d_parse_islice.c index 1e4fdfa..001f8fc 100644 --- a/decoder/ih264d_parse_islice.c +++ b/decoder/ih264d_parse_islice.c @@ -899,7 +899,6 @@ WORD32 ih264d_parse_islice_data_cavlc(dec_struct_t * ps_dec, (UWORD16)(u1_num_mbs >> u1_mbaff)); } u1_num_mbs++; - ps_dec->u2_total_mbs_coded++; /****************************************************************/ /* Check for End Of Row */ @@ -929,7 +928,7 @@ WORD32 ih264d_parse_islice_data_cavlc(dec_struct_t * ps_dec, u1_num_mbs_next, u1_tfr_n_mb, u1_end_of_row); } - + ps_dec->u2_total_mbs_coded += u1_num_mbs; if(u1_tfr_n_mb) u1_num_mbs = 0; u1_mb_idx = u1_num_mbs; @@ -1119,7 +1118,6 @@ WORD32 ih264d_parse_islice_data_cabac(dec_struct_t * ps_dec, (UWORD16)(u1_num_mbs >> u1_mbaff)); } u1_num_mbs++; - ps_dec->u2_total_mbs_coded++; } @@ -1148,7 +1146,7 @@ WORD32 ih264d_parse_islice_data_cabac(dec_struct_t * ps_dec, u1_num_mbs_next, u1_tfr_n_mb, u1_end_of_row); } - + ps_dec->u2_total_mbs_coded += u1_num_mbs; if(u1_tfr_n_mb) u1_num_mbs = 0; u1_mb_idx = u1_num_mbs; diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c index d56f44e..a82b0f8 100644 --- a/decoder/ih264d_parse_pslice.c +++ b/decoder/ih264d_parse_pslice.c @@ -1021,7 +1021,6 @@ WORD32 ih264d_parse_inter_slice_data_cabac(dec_struct_t * ps_dec, } u1_num_mbs++; - ps_dec->u2_total_mbs_coded++; u1_num_mbsNby2++; ps_parse_mb_data++; @@ -1072,7 +1071,7 @@ WORD32 ih264d_parse_inter_slice_data_cabac(dec_struct_t * ps_dec, u1_num_mbs_next, u1_tfr_n_mb, u1_end_of_row); } - + ps_dec->u2_total_mbs_coded += u1_num_mbs; if(u1_tfr_n_mb) u1_num_mbs = 0; u1_mb_idx = u1_num_mbs; @@ -1358,7 +1357,6 @@ WORD32 ih264d_parse_inter_slice_data_cavlc(dec_struct_t * ps_dec, i2_cur_mb_addr++; u1_num_mbs++; - ps_dec->u2_total_mbs_coded++; u1_num_mbsNby2++; ps_parse_mb_data++; @@ -1411,7 +1409,7 @@ WORD32 ih264d_parse_inter_slice_data_cavlc(dec_struct_t * ps_dec, u1_num_mbs_next, u1_tfr_n_mb, u1_end_of_row); } - + ps_dec->u2_total_mbs_coded += u1_num_mbs; if(u1_tfr_n_mb) u1_num_mbs = 0; u1_mb_idx = u1_num_mbs; @@ -1620,7 +1618,7 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec, ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb, u1_end_of_row); } - + ps_dec->u2_total_mbs_coded += u1_num_mbs; ps_dec->u1_mb_idx = 0; ps_dec->u4_num_mbs_cur_nmb = 0; } @@ -1782,7 +1780,6 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec, i2_cur_mb_addr++; u1_num_mbs++; - ps_dec->u2_total_mbs_coded++; u1_num_mbsNby2++; ps_parse_mb_data++; @@ -1818,7 +1815,7 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec, ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb, u1_end_of_row); } - + ps_dec->u2_total_mbs_coded += u1_num_mbs; if(u1_tfr_n_mb) u1_num_mbs = 0; u1_mb_idx = u1_num_mbs; -- cgit v1.2.3 From 943323f1d9d3dd5c2634deb26cbe72343ca6b3db Mon Sep 17 00:00:00 2001 From: Naveen Kumar Ponnusamy Date: Fri, 4 Dec 2015 16:51:43 +0530 Subject: Return error when there are more mmco params than allocated size Bug: 25818142 Change-Id: I5c1b23985eeca5192b42703c627ca3d060e4e13d --- decoder/ih264d_dpb_mgr.c | 10 ++++++++++ decoder/ih264d_parse_bslice.c | 9 ++++++++- decoder/ih264d_parse_islice.c | 10 ++++++++-- decoder/ih264d_parse_pslice.c | 9 ++++++++- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/decoder/ih264d_dpb_mgr.c b/decoder/ih264d_dpb_mgr.c index 205bc9b..7c4305b 100644 --- a/decoder/ih264d_dpb_mgr.c +++ b/decoder/ih264d_dpb_mgr.c @@ -17,6 +17,9 @@ ***************************************************************************** * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore */ +#include "log/log.h" +#include + #include "ih264_typedefs.h" #include "ih264_macros.h" #include "ih264_platform_macros.h" @@ -872,6 +875,13 @@ WORD32 ih264d_read_mmco_commands(struct _DecStruct * ps_dec) pu4_bitstrm_buf); while(u4_mmco != END_OF_MMCO) { + if (j >= MAX_REF_BUFS) + { + ALOGE("b/25818142"); + android_errorWriteLog(0x534e4554, "25818142"); + ps_dpb_cmds->u1_num_of_commands = 0; + return -1; + } ps_mmc_params = &ps_dpb_cmds->as_mmc_params[j]; ps_mmc_params->u4_mmco = u4_mmco; switch(u4_mmco) diff --git a/decoder/ih264d_parse_bslice.c b/decoder/ih264d_parse_bslice.c index 6707039..eb157e6 100644 --- a/decoder/ih264d_parse_bslice.c +++ b/decoder/ih264d_parse_bslice.c @@ -1581,7 +1581,14 @@ WORD32 ih264d_parse_bslice(dec_struct_t * ps_dec, UWORD16 u2_first_mb_in_slice) if(ps_slice->u1_nal_ref_idc != 0) { if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read) - ps_dec->u4_bitoffset = ih264d_read_mmco_commands(ps_dec); + { + i_temp = ih264d_read_mmco_commands(ps_dec); + if (i_temp < 0) + { + return ERROR_DBP_MANAGER_T; + } + ps_dec->u4_bitoffset = i_temp; + } else ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset; } diff --git a/decoder/ih264d_parse_islice.c b/decoder/ih264d_parse_islice.c index 001f8fc..bbb6110 100644 --- a/decoder/ih264d_parse_islice.c +++ b/decoder/ih264d_parse_islice.c @@ -1374,8 +1374,14 @@ WORD32 ih264d_parse_islice(dec_struct_t *ps_dec, if(ps_slice->u1_nal_ref_idc != 0) { if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read) - ps_dec->u4_bitoffset = ih264d_read_mmco_commands( - ps_dec); + { + i_temp = ih264d_read_mmco_commands(ps_dec); + if (i_temp < 0) + { + return ERROR_DBP_MANAGER_T; + } + ps_dec->u4_bitoffset = i_temp; + } else ps_dec->ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset; } diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c index a82b0f8..3cac387 100644 --- a/decoder/ih264d_parse_pslice.c +++ b/decoder/ih264d_parse_pslice.c @@ -2057,7 +2057,14 @@ WORD32 ih264d_parse_pslice(dec_struct_t *ps_dec, UWORD16 u2_first_mb_in_slice) if(ps_cur_slice->u1_nal_ref_idc != 0) { if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read) - ps_dec->u4_bitoffset = ih264d_read_mmco_commands(ps_dec); + { + i_temp = ih264d_read_mmco_commands(ps_dec); + if (i_temp < 0) + { + return ERROR_DBP_MANAGER_T; + } + ps_dec->u4_bitoffset = i_temp; + } else ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset; -- cgit v1.2.3