Don't declare variables after statements

This fixes building with compilers that are strict about the pre-C99
rule about having all variable declarations before statements.

(The previous version of this commit was originally made before
the commit adding support for main profile, which added a bunch
more similar issues.)

Bug: 22860270

Change-Id: I0a927deb2ef4125f79429d108439e249fa531607
This commit is contained in:
Martin Storsjo 2015-06-27 00:19:48 +03:00 committed by Marco Nelissen
parent 698de0ed5c
commit 4b09a8c011
3 changed files with 22 additions and 20 deletions

View file

@ -1206,11 +1206,13 @@ static void ih264e_cabac_encode_residue(entropy_ctxt_t *ps_ent_ctxt,
}
else
{
UWORD8 u1_csbf;
PARSE_COEFF_DATA_BLOCK_4x4(pv_mb_coeff_data, ps_mb_coeff_data,
u1_nnz, u2_sig_coeff_map,
pi2_res_block);
UWORD8 u1_csbf = !!(u1_nnz);
u1_csbf = !!(u1_nnz);
{
UWORD8 u1_a, u1_b;
UWORD32 u4_ctx_inc;

View file

@ -393,16 +393,6 @@ WORD32 ih264e_encode(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op)
/* Only encode if the current frame is not pre-encode skip */
if (!i4_rc_pre_enc_skip && s_inp_buf.s_raw_buf.apv_bufs[0])
{
/* array giving pic cnt that is being processed in curr context set */
ps_codec->ai4_pic_cnt[ctxt_sel] = ps_codec->i4_pic_cnt;
/* initialize all relevant process ctxts */
error_status |= ih264e_pic_init(ps_codec, &s_inp_buf);
SET_ERROR_ON_RETURN(error_status,
IVE_FATALERROR,
ps_video_encode_op->s_ive_op.u4_error_code,
IV_FAIL);
/* proc ctxt base idx */
WORD32 proc_ctxt_select = ctxt_sel * MAX_PROCESS_THREADS;
@ -414,6 +404,16 @@ WORD32 ih264e_encode(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op)
/* number of addl. threads to be created */
WORD32 num_thread_cnt = ps_codec->s_cfg.u4_num_cores - 1;
/* array giving pic cnt that is being processed in curr context set */
ps_codec->ai4_pic_cnt[ctxt_sel] = ps_codec->i4_pic_cnt;
/* initialize all relevant process ctxts */
error_status |= ih264e_pic_init(ps_codec, &s_inp_buf);
SET_ERROR_ON_RETURN(error_status,
IVE_FATALERROR,
ps_video_encode_op->s_ive_op.u4_error_code,
IV_FAIL);
for (i = 0; i < num_thread_cnt; i++)
{
ret = ithread_create(ps_codec->apv_proc_thread_handle[i],

View file

@ -241,6 +241,9 @@ static void ih264e_get_search_candidates(process_ctxt_t *ps_proc,
WORD32 i4_srch_range_e = ps_me_ctxt->i4_srch_range_e;
WORD32 i4_srch_range_w = ps_me_ctxt->i4_srch_range_w;
/* num of candidate search candidates */
UWORD32 u4_num_candidates = 0;
ps_left_mv = &ps_proc->s_left_mb_pu_ME.s_me_info[i4_reflist].s_mv;
ps_top_mv = &(ps_proc->ps_top_row_pu_ME + i4_mb_x)->s_me_info[i4_reflist].s_mv;
ps_top_left_mv = &ps_proc->s_top_left_mb_pu_ME.s_me_info[i4_reflist].s_mv;
@ -251,9 +254,6 @@ static void ih264e_get_search_candidates(process_ctxt_t *ps_proc,
i4_top_left_mode = ps_proc->s_top_left_mb_pu_ME.b2_pred_mode != i4_cmpl_predmode;
i4_top_right_mode = (ps_proc->ps_top_row_pu_ME + i4_mb_x + 1)->b2_pred_mode != i4_cmpl_predmode;
/* num of candidate search candidates */
UWORD32 u4_num_candidates =0 ;
/* Taking the Zero motion vector as one of the candidates */
ps_me_ctxt->as_mv_init_search[i4_reflist][u4_num_candidates].i2_mvx = 0;
ps_me_ctxt->as_mv_init_search[i4_reflist][u4_num_candidates].i2_mvy = 0;
@ -893,12 +893,12 @@ void ih264e_compute_me_single_reflist(process_ctxt_t *ps_proc)
/* quantization parameters */
quant_params_t *ps_qp_params = ps_proc->ps_qp_params[0];
/* Sad therholds */
ps_me_ctxt->pu2_sad_thrsh = ps_qp_params->pu2_sad_thrsh;
/* Mb part ctxts for SKIP */
mb_part_ctxt s_skip_mbpart;
/* Sad therholds */
ps_me_ctxt->pu2_sad_thrsh = ps_qp_params->pu2_sad_thrsh;
{
WORD32 rows_above, rows_below, columns_left, columns_right;
@ -1800,12 +1800,12 @@ void ih264e_compute_me_multi_reflist(process_ctxt_t *ps_proc)
/* quantization parameters */
quant_params_t *ps_qp_params = ps_proc->ps_qp_params[0];
/* Sad therholds */
ps_me_ctxt->pu2_sad_thrsh = ps_qp_params->pu2_sad_thrsh;
/* Mb part ctxts for SKIP */
mb_part_ctxt as_skip_mbpart[2];
/* Sad therholds */
ps_me_ctxt->pu2_sad_thrsh = ps_qp_params->pu2_sad_thrsh;
{
WORD32 rows_above, rows_below, columns_left, columns_right;