C2SoftAomEnc: set AOME_SET_MAX_INTRA_BITRATE_PCT

to 300 for CBR, 450 otherwise. This matches the setting in WebRTC [1]
(where this wrapper's settings are derived from) for CBR and prevents
overshoot in CTS tests that set a low (forced) key frame interval and
use VBR.

[1]: https://webrtc.googlesource.com/src/+/bd42ee87507e8b55a37ec89e7e659a249825f69a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc#289

Bug: 369325415
Test: (komodo) atest \
  MctsMediaCodecTestCases:android.media.codec.cts.VideoCodecTest#testBasic \
  -- \
  --module-arg MctsMediaCodecTestCases:instrumentation-arg:codec-prefix:=c2.android.av1.encoder
Change-Id: Id0dbeda7cfec33ef0fa438a7a2b0453c0c504961
diff --git a/media/codec2/components/aom/C2SoftAomEnc.cpp b/media/codec2/components/aom/C2SoftAomEnc.cpp
index 722b13a..93009c4 100644
--- a/media/codec2/components/aom/C2SoftAomEnc.cpp
+++ b/media/codec2/components/aom/C2SoftAomEnc.cpp
@@ -466,6 +466,7 @@
 
 aom_codec_err_t C2SoftAomEnc::setupCodecParameters() {
     aom_codec_err_t codec_return = AOM_CODEC_OK;
+    const int maxIntraBitratePct = mBitrateControlMode == AOM_CBR ? 300 : 450;
 
     codec_return = aom_codec_control(mCodecContext, AV1E_SET_TARGET_SEQ_LEVEL_IDX, mAV1EncLevel);
     if (codec_return != AOM_CODEC_OK) goto BailOut;
@@ -492,6 +493,10 @@
     codec_return = aom_codec_control(mCodecContext, AV1E_SET_AQ_MODE, 3);
     if (codec_return != AOM_CODEC_OK) goto BailOut;
 
+    codec_return = aom_codec_control(mCodecContext, AOME_SET_MAX_INTRA_BITRATE_PCT,
+                                     maxIntraBitratePct);
+    if (codec_return != AOM_CODEC_OK) goto BailOut;
+
     codec_return = aom_codec_control(mCodecContext, AV1E_SET_COEFF_COST_UPD_FREQ, 3);
     if (codec_return != AOM_CODEC_OK) goto BailOut;