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

Commit 522ba90e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adjust the IAMF AAC/Opus bitrates to be dependent on the number of channels." into main

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