Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e7c7e4d authored by Trevor Knight's avatar Trevor Knight
Browse files

Adjust the IAMF AAC/Opus bitrates to be dependent on the number of channels.

Previously, we hardcoded the bitrate range based on the bitrate ranges for the separate AAC and Opus decoders, but IAMF can have many more channels.  So we scale the bitrate range with number of channels, set by profile, but essentially, we are only rejecting very large numbers.

Bug: 411204259
Flag: EXEMPT bug fix
Change-Id: I61ac12e1261abf77f01db89d6550bb3d9458354e
parent 7b2c493f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1982,6 +1982,8 @@ public final class MediaCodecInfo {
                                maxChannels = 28;
                                break;
                            default:
                                // Set maxChannels to the max known for unknown profiles.
                                maxChannels = 28;
                                Log.w(TAG, "Unrecognized IAMF profile "
                                        + iamfProfile + " for "+ mime);
                                mParent.mError |= ERROR_UNRECOGNIZED;
@@ -1992,7 +1994,7 @@ public final class MediaCodecInfo {
                        switch (iamfEncoding) {
                            case CodecProfileLevel.IAMF_CODEC_OPUS:
                                sampleRates = new int[] {48000};
                                bitRates = Range.create(6000, 510000);
                                bitRates = Range.create(6000, 128000 * maxChannels);
                                break;
                            case CodecProfileLevel.IAMF_CODEC_AAC:
                                sampleRates =
@@ -2000,7 +2002,7 @@ public final class MediaCodecInfo {
                                            7350, 8000, 11025, 12000, 16000, 22050, 24000, 32000,
                                            44100, 48000, 64000, 88200, 96000
                                        };
                                bitRates = Range.create(8000, 510000);
                                bitRates = Range.create(6000, 128000 * maxChannels);
                                break;
                            case CodecProfileLevel.IAMF_CODEC_FLAC:
                                sampleRateRange = Range.create(1, 655350);