Commit 83876afa authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

fix clang warnings in ivas_qmetadata_enc.c and ivas_qmetadata_dec.c under FIX_506

parent 343bb6a7
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -213,6 +213,8 @@
#ifdef HR_METADATA
#define FIX_505_MASA_SPHGRID_REUSE                      /* Nokia: Fix issue #505: MASA spherical grid reuse fix */
#endif

#define FIX_506
                                                        /* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */

+26 −3
Original line number Diff line number Diff line
@@ -805,11 +805,15 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
)
{
    int16_t d, b, m;
#ifndef FIX_506
    int16_t bits_diff_sum;
#endif
    int16_t nbands, start_band;
    IVAS_QDIRECTION *q_direction;
    int16_t start_index_0;
#ifndef FIX_506
    int16_t bits_no_dirs_coh, bits_sur_coherence;
#endif
    uint16_t all_coherence_zero;
    int16_t p[MASA_MAXIMUM_CODING_SUBBANDS], dif_p[MASA_MAXIMUM_CODING_SUBBANDS];
#ifdef FIX_HBR_MASAMETA
@@ -892,13 +896,17 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(

#endif
    /*Coherence flag decoding*/
#ifndef FIX_506
    bits_no_dirs_coh = 0;
#endif
    all_coherence_zero = 1;
    if ( hQMetaData->coherence_flag )
    {
        /* read if coherence is zero */
        all_coherence_zero = bitstream[( *index )--];
#ifndef FIX_506
        bits_no_dirs_coh += 1;
#endif
    }

    hQMetaData->all_coherence_zero = (uint8_t) all_coherence_zero;
@@ -934,7 +942,9 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
            p[b] = p[b - 1] + dif_p[b] + 1;
            hQMetaData->twoDirBands[p[b]] = 1;
        }
#ifndef FIX_506
        bits_no_dirs_coh += ( d - *index );
#endif
    }

#ifdef FIX_HBR_MASAMETA
@@ -947,11 +957,17 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
        }
    }
#endif
    bits_diff_sum = ivas_qmetadata_entropy_decode_diffuseness_hr_512( bitstream, index, &( hQMetaData->q_direction[0] ) );
#ifndef FIX_506
    bits_diff_sum =
#endif
        ivas_qmetadata_entropy_decode_diffuseness_hr_512( bitstream, index, &( hQMetaData->q_direction[0] ) );

    if ( hQMetaData->no_directions == 2 )
    {
        bits_diff_sum += ivas_qmetadata_entropy_decode_diffuseness_hr_512( bitstream, index, &( hQMetaData->q_direction[1] ) );
#ifndef FIX_506
        bits_diff_sum +=
#endif
            ivas_qmetadata_entropy_decode_diffuseness_hr_512( bitstream, index, &( hQMetaData->q_direction[1] ) );
    }


@@ -1000,11 +1016,16 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(

    if ( all_coherence_zero == 0 )
    {
        bits_sur_coherence = read_surround_coherence_hr( bitstream, index, hQMetaData );
#ifndef FIX_506
        bits_sur_coherence =
#endif
            read_surround_coherence_hr( bitstream, index, hQMetaData );
    }
    else
    {
#ifndef FIX_506
        bits_sur_coherence = 0;
#endif
        /*Surround coherence*/
        for ( b = 0; b < hQMetaData->q_direction[0].cfg.nbands; b++ )
        {
@@ -1014,7 +1035,9 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
            }
        }
    }
#ifndef FIX_506
    bits_no_dirs_coh += bits_sur_coherence;
#endif

    for ( d = 0; d < hQMetaData->no_directions; d++ )
    {
+10 −1
Original line number Diff line number Diff line
@@ -759,7 +759,9 @@ ivas_error ivas_qmetadata_enc_encode_hr_384_512(
    int16_t nbands, nblocks, start_band;
    int16_t ndirections, d;
    int16_t all_coherence_zero;
#ifndef FIX_506
    int16_t bits_no_dirs_coh;
#endif
    int16_t bits_ec;
    float azimuth_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES], elevation_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES];
    ivas_error error;
@@ -796,7 +798,9 @@ ivas_error ivas_qmetadata_enc_encode_hr_384_512(

    /* Check if coherence should be encoded */
    all_coherence_zero = 1;
#ifndef FIX_506
    bits_no_dirs_coh = 0;
#endif
#ifdef FIX_HBR_MASAMETA
    if ( hQMetaData->q_direction->cfg.inactiveBands > 0 )
    {
@@ -814,13 +818,18 @@ ivas_error ivas_qmetadata_enc_encode_hr_384_512(
    {
        all_coherence_zero = hQMetaData->all_coherence_zero;
        push_next_indice( hMetaData, all_coherence_zero, 1 ); /* signal coherence */
#ifndef FIX_506
        bits_no_dirs_coh += 1;
#endif
    }

    /* encode 2 direction subbands position */
    if ( ndirections == 2 && bits_sph_idx == 11 )
    {
        bits_no_dirs_coh += write_2dir_info( hMetaData, hQMetaData->twoDirBands, hQMetaData->q_direction[0].cfg.nbands, hQMetaData->numTwoDirBands );
#ifndef FIX_506
        bits_no_dirs_coh +=
#endif
            write_2dir_info( hMetaData, hQMetaData->twoDirBands, hQMetaData->q_direction[0].cfg.nbands, hQMetaData->numTwoDirBands );

        for ( i = hQMetaData->numTwoDirBands; i < hQMetaData->q_direction[0].cfg.nbands; i++ )
        {
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ if [ ! -d "lib_com" ]; then
    exit 255
fi

CLANG_FORMAT=clang-format
CLANG_FORMAT=../clang-format.exe
CLANG_FORMAT_REQUIRED_VERSION="13.0" 

# list (with space between entries) of substrings that are excluded from the file list, e.g. very large files