Commit 606baabd authored by Lauros Pajunen's avatar Lauros Pajunen
Browse files

Format code

parent c4918202
Loading
Loading
Loading
Loading
Loading
+502 −457
Original line number Diff line number Diff line
@@ -145,22 +145,27 @@ ivas_error ivas_dec_get_format_fx(
    test();
    IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->ivas_format, st_ivas->last_ivas_format ) &&
        !( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_ISM_FORMAT ) ) &&
        !( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) ){
        !( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) )
    {
#ifdef DECODER_FORMAT_SWITCHING
        IF( isVoipMode ){
        IF( isVoipMode )
        {
            st_ivas->restartNeeded = 1;
            move16();
            return IVAS_ERR_OK;
        }
        ELSE
        {
#endif
#ifdef DEBUGGING
            fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
#endif
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
        }
#else
#ifdef DEBUGGING
        fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
#endif
        return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
#endif
    }

@@ -197,22 +202,27 @@ IF( is_DTXrate( ivas_total_brate ) == 0 )
            }

            test();
        IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
    #ifdef DECODER_FORMAT_SWITCHING
            IF( isVoipMode ){
                IF( isVoipMode )
                {
                    st_ivas->restartNeeded = 1;
                    move16();
                    return IVAS_ERR_OK;
                }
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #else
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
    #endif
            }

@@ -235,22 +245,27 @@ ELSE IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) )
            num_bits_read = add( num_bits_read, SBA_PLANAR_BITS );

            test();
    IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) ){
            IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) )
            {
    #ifdef DECODER_FORMAT_SWITCHING
        IF( isVoipMode ){
                IF( isVoipMode )
                {
                    st_ivas->restartNeeded = 1;
                    move16();
                    return IVAS_ERR_OK;
                }
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the SBA planar/3D layout is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA planar flag signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #else
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Changing the SBA planar/3D layout is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA planar flag signalled!" );
    #endif
            }

@@ -260,22 +275,27 @@ move16();
            sba_order = add( sba_order, shl( st_ivas->bit_stream[num_bits_read], 1 ) );

            test();
IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ){
            IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) )
            {
    #ifdef DECODER_FORMAT_SWITCHING
    IF( isVoipMode ){
                IF( isVoipMode )
                {
                    st_ivas->restartNeeded = 1;
                move16();
                return IVAS_ERR_OK;
                }
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" );
    #else
    #endif
            }

@@ -359,22 +379,27 @@ ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) )
    #endif

            test();
    IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
    #ifdef DECODER_FORMAT_SWITCHING
        IF( isVoipMode ){
                IF( isVoipMode )
                {
                    st_ivas->restartNeeded = 1;
                    move16();
                    return IVAS_ERR_OK;
                }
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #else
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
    #endif
            }

@@ -392,7 +417,8 @@ ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) )
            st_ivas->ism_mode = ivas_omasa_ism_mode_select_fx( ivas_total_brate, nchan_ism );

            test();
    IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
    #ifdef DECODER_FORMAT_SWITCHING
                IF( isVoipMode ){
                    st_ivas->restartNeeded = 1;
@@ -401,13 +427,16 @@ ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) )
                }
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #else
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
    #endif
            }

@@ -421,22 +450,27 @@ ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
            nchan_ism = add( add( shl( st_ivas->bit_stream[k - 1], 1 ), st_ivas->bit_stream[k - 2] ), 1 );

            test();
    IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ){
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
    #ifdef DECODER_FORMAT_SWITCHING
        IF( isVoipMode ){
                IF( isVoipMode )
                {
                    st_ivas->restartNeeded = 1;
                    move16();
                    return IVAS_ERR_OK;
                }
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #else
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
    #endif
            }

@@ -463,7 +497,8 @@ IF( LT_32( ivas_total_brate, IVAS_24k4 ) )
            }

            test();
IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ){
            IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) )
            {
    #ifdef DECODER_FORMAT_SWITCHING
                IF( isVoipMode ){
                    st_ivas->restartNeeded = 1;
@@ -472,13 +507,16 @@ return IVAS_ERR_OK;
                }
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #else
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" );
    #endif
            }

@@ -504,7 +542,8 @@ ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) )
            signaled_config = ivas_mc_map_ls_setup_to_output_config_fx( idx );

            test();
    IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) ){
            IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) )
            {
    #ifdef DECODER_FORMAT_SWITCHING
                IF( isVoipMode ){
                    st_ivas->restartNeeded = 1;
@@ -513,13 +552,16 @@ ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) )
                }
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #else
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" );
    #endif
            }

@@ -624,15 +666,18 @@ ELSE IF( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) )
                    move16();
                    return IVAS_ERR_OK;
                }
    else
                ELSE
                {
#endif
    #ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
#ifdef DECODER_FORMAT_SWITCHING
                }
    #else
    #ifdef DEBUGGING
                fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
    #endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
    #endif
            }

+2 −0
Original line number Diff line number Diff line
@@ -3681,7 +3681,9 @@ ivas_error IVAS_DEC_ReadFormat(
    renderer_type_old = st_ivas->renderer_type;
    renderer_type_sec_old = ivas_renderer_secondary_select_fx( st_ivas );
    move32();
#ifndef DECODER_FORMAT_SWITCHING
    move32();
#endif
    move32();
    move16();
    move32();