Commit a13b76e8 authored by vaclav's avatar vaclav
Browse files

Define local arrays using "const"

parent e6b766c3
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3304,7 +3304,6 @@ static void parseObjectPosition(
    int16_t read_values;
    float meta_prm[8] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f };


    readNextMetadataChunk( line, "," );
    *positionDuration = (uint16_t) strtol( line, &endptr, 10 );
    readNextMetadataChunk( line, "\n" );
@@ -3323,6 +3322,7 @@ static void parseObjectPosition(
    position->yaw = meta_prm[5];
    position->pitch = meta_prm[6];
    position->non_diegetic_flag = (int16_t) meta_prm[7];

    return;
}

+5 −5
Original line number Diff line number Diff line
@@ -3244,7 +3244,7 @@ static void DoRTFT600(
)
{
    float scratch[1200], cmplx[1200];
    int16_t factors[3] = { 25, 8, 3 };
    const int16_t factors[3] = { 25, 8, 3 };

    fftf_interleave( x, y, cmplx, 600 );
    pfaDFT( cmplx, 600, scratch, 3, factors );
@@ -3259,7 +3259,7 @@ static void DoRTFT400(
)
{
    float scratch[800], cmplx[800];
    int16_t factors[2] = { 25, 16 };
    const int16_t factors[2] = { 25, 16 };

    fftf_interleave( x, y, cmplx, 400 );
    pfaDFT( cmplx, 400, scratch, 2, factors );
@@ -3275,7 +3275,7 @@ static void DoRTFT240(
)
{
    float scratch[480], cmplx[480];
    int16_t factors[3] = { 16, 5, 3 };
    const int16_t factors[3] = { 16, 5, 3 };

    fftf_interleave( x, y, cmplx, 240 );
    pfaDFT( cmplx, 240, scratch, 3, factors );
@@ -3290,7 +3290,7 @@ static void DoRTFT200(
)
{
    float scratch[400], cmplx[400];
    int16_t factors[2] = { 25, 8 };
    const int16_t factors[2] = { 25, 8 };

    fftf_interleave( x, y, cmplx, 200 );
    pfaDFT( cmplx, 200, scratch, 2, factors );
@@ -3305,7 +3305,7 @@ static void DoRTFT100(
)
{
    float scratch[200], cmplx[200];
    int16_t factors[2] = { 25, 4 };
    const int16_t factors[2] = { 25, 4 };

    fftf_interleave( x, y, cmplx, 100 );
    pfaDFT( cmplx, 100, scratch, 2, factors );
+4 −8
Original line number Diff line number Diff line
@@ -1131,13 +1131,9 @@ PvqEntry mpvq_encode_vec(
)
{
    PvqEntry result;
    uint32_t h_mem[1 + KMAX_NON_DIRECT + 1]; /* allocate max offset memory  for dim 6    */
    /* OPT: actually only 1+k_val_in+1 needed ) */
    uint32_t h_mem[1 + KMAX_NON_DIRECT + 1]; /* allocate max offset memory  for dim 6    */ /* OPT: actually only 1+k_val_in+1 needed ) */
    uint32_t lead_sign_ind;

    VEC2INDFUNCM vec2mind_f[1 + N_OPT] = { NULL, vec2mind_one, vec2mind_two, vec2mind_three, vec2mind_four, vec2mind_five };
    /* VEC2INDFUNCM can be a static global  */

    const VEC2INDFUNCM vec2mind_f[1 + N_OPT] = { NULL, vec2mind_one, vec2mind_two, vec2mind_three, vec2mind_four, vec2mind_five }; /* VEC2INDFUNCM can be a static global  */

    result.k_val = k_val_local;
    result.dim = dim_in;
@@ -1202,8 +1198,7 @@ void mpvq_decode_vec(
)
{
    int16_t i, leading_sign;
    IND2VECFUNCM mind2vec_f[N_OPT + 1] = { NULL, mind2vec_one, mind2vec_two, mind2vec_three, mind2vec_four, mind2vec_five };
    /*IND2VECFUNCM vector can be static global  */
    const IND2VECFUNCM mind2vec_f[N_OPT + 1] = { NULL, mind2vec_one, mind2vec_two, mind2vec_three, mind2vec_four, mind2vec_five }; /*IND2VECFUNCM vector can be static global  */

    for ( i = 0; i < entry->dim; i++ )
    {
@@ -1229,6 +1224,7 @@ void mpvq_decode_vec(
            ( mind2vec_f[entry->dim] )( entry->k_val, leading_sign, entry->index, vec_out );
        }
    }

    return;
}

+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ void deemph_lpc(
{
    int16_t k;
    float b[M + 2];
    float a[2] = { -PREEMPH_FAC, 1.0 };
    const float a[2] = { -PREEMPH_FAC, 1.0 };

    b[0] = 1.0;
    for ( k = 0; k < M; k++ )
+2 −2
Original line number Diff line number Diff line
@@ -1572,8 +1572,8 @@ void interp_code_5over2(
)
{
    int16_t i, kk, kkp1;
    float factor_i[5] = { 0.2f, 0.6f, 1.0f, 0.6f, 0.2f };
    float factor_j[5] = { 0.8f, 0.4f, 0.0f, 0.4f, 0.8f };
    const float factor_i[5] = { 0.2f, 0.6f, 1.0f, 0.6f, 0.2f };
    const float factor_j[5] = { 0.8f, 0.4f, 0.0f, 0.4f, 0.8f };

    interp_code[0] = inp_code[0];
    interp_code[1] = inp_code[0] * factor_i[3] + inp_code[1] * factor_j[3];
Loading