Commit 75554b30 authored by vaclav's avatar vaclav
Browse files

Update lib_enc.c: set the ‘sba_mode’ parameter only at the initialization...

Update lib_enc.c: set the ‘sba_mode’ parameter only at the initialization stage; fixed under SBA_CLEANING switch
parent a66820ad
Loading
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -762,7 +762,9 @@ static ivas_error configureEncoder(
                /* IVAS_fmToDo: needs more work in case of bitrate switching */
                hEncoderConfig->sba_order = 1;
            }
#ifndef SBA_CLEANING            
            st_ivas->sba_mode = ivas_sba_mode_select( hEncoderConfig->ivas_total_brate );
#endif
        }
        else if ( hEncoderConfig->ivas_format == MASA_FORMAT )
        {
@@ -868,12 +870,16 @@ static ivas_error configureEncoder(
        return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Channel-aware mode is not supported in IVAS yet." );
    }

#ifdef SBA_CLEANING
    if ( hEncoderConfig->Opt_AGC_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ) == SBA_MODE_SPAR ) )
#else
    if ( hEncoderConfig->Opt_AGC_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR ) )
#endif
    {
        return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "AGC supported in SBA format at bitrates >= 24.4 kbps only." );
    }

    if ( hEncoderConfig->Opt_PCA_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && hEncoderConfig->ivas_total_brate == PCA_BRATE && hEncoderConfig->ivas_total_brate == IVAS_256k && hEncoderConfig->sba_order == 1 ) )
    if ( hEncoderConfig->Opt_PCA_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && hEncoderConfig->ivas_total_brate == PCA_BRATE && hEncoderConfig->sba_order == 1 ) )
    {
        return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "PCA supported at SBA FOA 256 kbps only." );
    }