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

Commit 5c0e40dc authored by Lajos Molnar's avatar Lajos Molnar
Browse files

media: add CBR_FD video encoding bitrate mode

Constant bitrate with frame drops allows a higher quality constant bitrate
encoding for high complexity portion of the input.

In this mode some frames may get dropped (not encoded) to allow neighboring
frames to use more bits while still staying at the constant bitrate.

The exact number of dropping behavior is undefined.

Bug: 183147292
Change-Id: I96d625f958a2a301b11d41f1c4cc12e680d68d68
parent de4d7421
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -21743,6 +21743,7 @@ package android.media {
    method public android.util.Range<java.lang.Integer> getQualityRange();
    method public android.util.Range<java.lang.Integer> getQualityRange();
    method public boolean isBitrateModeSupported(int);
    method public boolean isBitrateModeSupported(int);
    field public static final int BITRATE_MODE_CBR = 2; // 0x2
    field public static final int BITRATE_MODE_CBR = 2; // 0x2
    field public static final int BITRATE_MODE_CBR_FD = 3; // 0x3
    field public static final int BITRATE_MODE_CQ = 0; // 0x0
    field public static final int BITRATE_MODE_CQ = 0; // 0x0
    field public static final int BITRATE_MODE_VBR = 1; // 0x1
    field public static final int BITRATE_MODE_VBR = 1; // 0x1
  }
  }
+4 −1
Original line number Original line Diff line number Diff line
@@ -3434,11 +3434,14 @@ public final class MediaCodecInfo {
        public static final int BITRATE_MODE_VBR = 1;
        public static final int BITRATE_MODE_VBR = 1;
        /** Constant bitrate mode */
        /** Constant bitrate mode */
        public static final int BITRATE_MODE_CBR = 2;
        public static final int BITRATE_MODE_CBR = 2;
        /** Constant bitrate mode with frame drops */
        public static final int BITRATE_MODE_CBR_FD =  3;


        private static final Feature[] bitrates = new Feature[] {
        private static final Feature[] bitrates = new Feature[] {
            new Feature("VBR", BITRATE_MODE_VBR, true),
            new Feature("VBR", BITRATE_MODE_VBR, true),
            new Feature("CBR", BITRATE_MODE_CBR, false),
            new Feature("CBR", BITRATE_MODE_CBR, false),
            new Feature("CQ",  BITRATE_MODE_CQ,  false)
            new Feature("CQ",  BITRATE_MODE_CQ,  false),
            new Feature("CBR-FD", BITRATE_MODE_CBR_FD, false)
        };
        };


        private static int parseBitrateMode(String mode) {
        private static int parseBitrateMode(String mode) {