cmake: Set C standard to C90 and move few macros to specific targets
- Set CMAKE_C_STANDARD to 90 Because of this, moved some declarations to start of the block - Move PROFILE_ENABLE and MD5_DISABLE to specific targets as these macros are not used when building libraries Bug: 242076773 Test: Builds Change-Id: Icd0b8a48f015a695185ce2220800348f7a7512f1
This commit is contained in:
parent
b7ac6e9575
commit
eb463e5aa2
11 changed files with 48 additions and 41 deletions
|
|
@ -1,4 +1,5 @@
|
|||
include(CheckCXXCompilerFlag)
|
||||
set(CMAKE_C_STANDARD 90)
|
||||
|
||||
# Adds compiler options for all targets
|
||||
function(libavc_add_compile_options)
|
||||
|
|
@ -9,6 +10,7 @@ function(libavc_add_compile_options)
|
|||
else()
|
||||
add_compile_options(-msse4.2 -mno-avx)
|
||||
endif()
|
||||
add_compile_options(-Wdeclaration-after-statement)
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS -fsanitize=fuzzer-no-link)
|
||||
check_cxx_compiler_flag(-fsanitize=fuzzer-no-link
|
||||
|
|
@ -32,8 +34,6 @@ endfunction()
|
|||
|
||||
# Adds defintions for all targets
|
||||
function(libavc_add_definitions)
|
||||
add_definitions(-DPROFILE_ENABLE -DMD5_DISABLE)
|
||||
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
|
||||
add_definitions(-DARMV8 -DDEFAULT_ARCH=D_ARCH_ARMV8_GENERIC)
|
||||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch32")
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ WORD32 ithread_create(void *thread_handle, void *attribute, void *strt, void *ar
|
|||
|
||||
WORD32 ithread_join(void *thread_handle, void ** val_ptr)
|
||||
{
|
||||
UNUSED(val_ptr);
|
||||
pthread_t *pthread_handle = (pthread_t *)thread_handle;
|
||||
UNUSED(val_ptr);
|
||||
return pthread_join(*pthread_handle, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3435,7 +3435,7 @@ WORD32 ih264d_set_params(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
|
|||
ih264d_ctl_set_config_ip_t *ps_h264d_ctl_ip =
|
||||
(ih264d_ctl_set_config_ip_t *)pv_api_ip;
|
||||
ih264d_ctl_set_config_op_t *ps_h264d_ctl_op =
|
||||
(ih264d_ctl_set_config_op_t *)pv_api_op;;
|
||||
(ih264d_ctl_set_config_op_t *)pv_api_op;
|
||||
ivd_ctl_set_config_ip_t *ps_ctl_ip =
|
||||
&ps_h264d_ctl_ip->s_ivd_ctl_set_config_ip_t;
|
||||
ivd_ctl_set_config_op_t *ps_ctl_op =
|
||||
|
|
|
|||
|
|
@ -1601,16 +1601,19 @@ WORD32 ih264d_parse_bslice(dec_struct_t * ps_dec, UWORD16 u2_first_mb_in_slice)
|
|||
COPYTHECONTEXT("SH: cabac_init_idc",ps_slice->u1_cabac_init_idc);
|
||||
}
|
||||
|
||||
/* Read slice_qp_delta */
|
||||
WORD64 i8_temp = (WORD64)ps_pps->u1_pic_init_qp
|
||||
+ ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
{
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
WORD64 i8_temp;
|
||||
/* Read slice_qp_delta */
|
||||
i8_temp = (WORD64)ps_pps->u1_pic_init_qp
|
||||
+ ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
{
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
}
|
||||
ps_slice->u1_slice_qp = i8_temp;
|
||||
COPYTHECONTEXT("SH: slice_qp_delta",
|
||||
(WORD8)(ps_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
|
||||
}
|
||||
ps_slice->u1_slice_qp = i8_temp;
|
||||
COPYTHECONTEXT("SH: slice_qp_delta",
|
||||
(WORD8)(ps_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
|
||||
|
||||
if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
|
||||
{
|
||||
|
|
@ -1691,4 +1694,3 @@ WORD32 ih264d_parse_bslice(dec_struct_t * ps_dec, UWORD16 u2_first_mb_in_slice)
|
|||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -362,23 +362,24 @@ WORD32 ih264d_parse_pps(dec_struct_t * ps_dec, dec_bit_stream_t * ps_bitstrm)
|
|||
|
||||
if(ps_pps->u1_wted_bipred_idc > MAX_WEIGHT_BIPRED_IDC)
|
||||
return ERROR_INV_SPS_PPS_T;
|
||||
{
|
||||
WORD64 i8_temp;
|
||||
i8_temp = (WORD64)26 + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
|
||||
WORD64 i8_temp = (WORD64)26
|
||||
+ ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
ps_pps->u1_pic_init_qp = i8_temp;
|
||||
COPYTHECONTEXT("PPS: pic_init_qp_minus26",ps_pps->u1_pic_init_qp - 26);
|
||||
|
||||
ps_pps->u1_pic_init_qp = i8_temp;
|
||||
COPYTHECONTEXT("PPS: pic_init_qp_minus26",ps_pps->u1_pic_init_qp - 26);
|
||||
i8_temp = (WORD64)26 + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
|
||||
i8_temp = (WORD64)26 + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
|
||||
ps_pps->u1_pic_init_qs = i8_temp;
|
||||
COPYTHECONTEXT("PPS: pic_init_qs_minus26",ps_pps->u1_pic_init_qs - 26);
|
||||
ps_pps->u1_pic_init_qs = i8_temp;
|
||||
COPYTHECONTEXT("PPS: pic_init_qs_minus26",ps_pps->u1_pic_init_qs - 26);
|
||||
}
|
||||
|
||||
i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
if((i_temp < -12) || (i_temp > 12))
|
||||
|
|
@ -1373,4 +1374,3 @@ WORD32 ih264d_parse_nal_unit(iv_obj_t *dec_hdl,
|
|||
return i_status;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1388,6 +1388,7 @@ WORD32 ih264d_parse_islice(dec_struct_t *ps_dec,
|
|||
UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
|
||||
UWORD32 u4_temp;
|
||||
WORD32 i_temp;
|
||||
WORD64 i8_temp;
|
||||
WORD32 ret;
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
|
|
@ -1412,7 +1413,7 @@ WORD32 ih264d_parse_islice(dec_struct_t *ps_dec,
|
|||
/* G050 */
|
||||
|
||||
/* Read slice_qp_delta */
|
||||
WORD64 i8_temp = (WORD64)ps_pps->u1_pic_init_qp
|
||||
i8_temp = (WORD64)ps_pps->u1_pic_init_qp
|
||||
+ ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
|
|
|
|||
|
|
@ -2164,17 +2164,19 @@ WORD32 ih264d_parse_pslice(dec_struct_t *ps_dec, UWORD16 u2_first_mb_in_slice)
|
|||
ps_cur_slice->u1_cabac_init_idc = u4_temp;
|
||||
COPYTHECONTEXT("SH: cabac_init_idc",ps_cur_slice->u1_cabac_init_idc);
|
||||
}
|
||||
|
||||
/* Read slice_qp_delta */
|
||||
WORD64 i8_temp = (WORD64)ps_pps->u1_pic_init_qp
|
||||
+ ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
{
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
WORD64 i8_temp;
|
||||
/* Read slice_qp_delta */
|
||||
i8_temp = (WORD64)ps_pps->u1_pic_init_qp
|
||||
+ ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
|
||||
if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
|
||||
{
|
||||
return ERROR_INV_RANGE_QP_T;
|
||||
}
|
||||
ps_cur_slice->u1_slice_qp = i8_temp;
|
||||
COPYTHECONTEXT("SH: slice_qp_delta",
|
||||
(WORD8)(ps_cur_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
|
||||
}
|
||||
ps_cur_slice->u1_slice_qp = i8_temp;
|
||||
COPYTHECONTEXT("SH: slice_qp_delta",
|
||||
(WORD8)(ps_cur_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
|
||||
|
||||
if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -692,10 +692,10 @@ WORD32 ih264d_start_of_pic(dec_struct_t *ps_dec,
|
|||
{
|
||||
ret = ih264d_form_default_scaling_matrix(ps_dec);
|
||||
}
|
||||
|
||||
|
||||
if(ret != OK)
|
||||
return ret;
|
||||
|
||||
|
||||
/* required while reading the transform_size_8x8 u4_flag */
|
||||
ps_dec->s_high_profile.u1_direct_8x8_inference_flag =
|
||||
ps_seq->u1_direct_8x8_inference_flag;
|
||||
|
|
@ -1427,6 +1427,7 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
|
|||
|
||||
if(ps_cur_slice->u1_mmco_equalto5)
|
||||
{
|
||||
WORD64 i8_result;
|
||||
WORD32 i4_temp_poc;
|
||||
WORD32 i4_top_field_order_poc, i4_bot_field_order_poc;
|
||||
|
||||
|
|
@ -1443,8 +1444,7 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
|
|||
else
|
||||
i4_temp_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
|
||||
|
||||
WORD64 i8_result = (WORD64)i4_temp_poc
|
||||
- ps_dec->ps_cur_pic->i4_top_field_order_cnt;
|
||||
i8_result = (WORD64)i4_temp_poc - ps_dec->ps_cur_pic->i4_top_field_order_cnt;
|
||||
if(IS_OUT_OF_RANGE_S32(i8_result))
|
||||
{
|
||||
return ERROR_INV_POC;
|
||||
|
|
@ -1944,4 +1944,3 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
libavc_add_executable(avcdec libavcdec SOURCES ${AVC_ROOT}/test/decoder/main.c)
|
||||
target_compile_definitions(avcdec PRIVATE PROFILE_ENABLE MD5_DISABLE)
|
||||
|
|
|
|||
|
|
@ -8,3 +8,4 @@ list(
|
|||
"${AVC_ROOT}/test/encoder/recon.c")
|
||||
|
||||
libavc_add_executable(avcenc libavcenc SOURCES ${AVCENC_SRCS})
|
||||
target_compile_definitions(avcenc PRIVATE PROFILE_ENABLE MD5_DISABLE)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
list(APPEND MVC_DEC_APP_SRCS "${AVC_ROOT}/test/mvcdec/main.c")
|
||||
|
||||
libavc_add_executable(mvcdec libmvcdec SOURCES ${MVC_DEC_APP_SRCS})
|
||||
target_compile_definitions(mvcdec PRIVATE PROFILE_ENABLE MD5_DISABLE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue