From 75554b30e1491617a55e0b2e610faa2704ae7624 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 18 Jul 2022 11:22:42 +0000 Subject: [PATCH] =?UTF-8?q?Update=20lib=5Fenc.c:=20set=20the=20=E2=80=98sb?= =?UTF-8?q?a=5Fmode=E2=80=99=20parameter=20only=20at=20the=20initializatio?= =?UTF-8?q?n=20stage;=20fixed=20under=20SBA=5FCLEANING=20switch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib_enc/lib_enc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index d2886c39a7..28085ae096 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -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." ); } -- GitLab