C2SoftAacEnc: Fix setting SBR mode

SBR Mode value in C2 and the value that aac encoder library accepts
are not same.
SBR Mode in c2 is used to signal both SBR mode and ratio.
So when setting AACENC_SBR_MODE in the encoder library, c2's SBR value
needs to be appropriately converted to values that encoder understands.

Bug: 184898642
Test: atest set aac-sbr-mode using AMediaCodec based application
Test: atest CtsMediaV2TestCases

Change-Id: If4565297bd116230731e454c48f86ba8ca431e2b
diff --git a/media/codec2/components/aac/C2SoftAacEnc.cpp b/media/codec2/components/aac/C2SoftAacEnc.cpp
index ea76cbb..d865ab2 100644
--- a/media/codec2/components/aac/C2SoftAacEnc.cpp
+++ b/media/codec2/components/aac/C2SoftAacEnc.cpp
@@ -272,8 +272,9 @@
         return UNKNOWN_ERROR;
     }
 
-    if (sbrMode != -1 && aacProfile == C2Config::PROFILE_AAC_ELD) {
-        if (AACENC_OK != aacEncoder_SetParam(mAACEncoder, AACENC_SBR_MODE, sbrMode)) {
+    if (sbrMode != C2Config::AAC_SBR_AUTO && aacProfile == C2Config::PROFILE_AAC_ELD) {
+        int aacSbrMode = sbrMode != C2Config::AAC_SBR_OFF;
+        if (AACENC_OK != aacEncoder_SetParam(mAACEncoder, AACENC_SBR_MODE, aacSbrMode)) {
             ALOGE("Failed to set AAC encoder parameters");
             return UNKNOWN_ERROR;
         }