]> granicus.if.org Git - libvpx/commitdiff
Adjust MAXRATE_1080P.
authorpaulwilkins <paulwilkins@google.com>
Wed, 7 Feb 2018 15:05:20 +0000 (15:05 +0000)
committerpaulwilkins <paulwilkins@google.com>
Thu, 8 Feb 2018 12:31:09 +0000 (12:31 +0000)
This value was originally set in response to requests from the hardware
team before levels were properly defined for VP9.

Even if a level is not specified for an encode, it imposes a maximum
frame size for videos of dimensions <= 1080P.  For larger formats the
limit was set at 250 bits per MB.

This patch modifies the limit to be more in line with the requirements
specified for level 4 (max rate for a 4 frame group of 16 Mbits).  If a lower
level is specified at encode time and this mandates a smaller maximum frame
size then the level requirement will still take precedence.

Increasing this value allows for some slide shows or very low motion clips
to code a better quality key frame.

Change-Id: Ic08e0e09c8a918077152190c59732b9a1c049787

vp9/encoder/vp9_ratectrl.c

index 72647bf8edf04ad1f16252add09ee989f704a73f..796fe9c5020fb48a4c7a9017c558efd94bcd4bcd 100644 (file)
 #include "vp9/encoder/vp9_encodemv.h"
 #include "vp9/encoder/vp9_ratectrl.h"
 
-// Max rate target for 1080P and below encodes under normal circumstances
-// (1920 * 1080 / (16 * 16)) * MAX_MB_RATE bits per MB
+// Max rate per frame for 1080P and below encodes if no level requirement given.
+// For larger formats limit to MAX_MB_RATE bits per MB
+// 4Mbits is derived from the level requirement for level 4 (1080P 30) which
+// requires that HW can sustain a rate of 16Mbits over a 4 frame group.
+// If a lower level requirement is specified then this may over ride this value.
 #define MAX_MB_RATE 250
-#define MAXRATE_1080P 2025000
+#define MAXRATE_1080P 4000000
 
 #define DEFAULT_KF_BOOST 2000
 #define DEFAULT_GF_BOOST 2000
@@ -1913,12 +1916,12 @@ void vp9_rc_update_framerate(VP9_COMP *cpi) {
       VPXMAX(rc->min_frame_bandwidth, FRAME_OVERHEAD_BITS);
 
   // A maximum bitrate for a frame is defined.
-  // The baseline for this aligns with HW implementations that
-  // can support decode of 1080P content up to a bitrate of MAX_MB_RATE bits
-  // per 16x16 MB (averaged over a frame). However this limit is extended if
-  // a very high rate is given on the command line or the the rate cannnot
-  // be acheived because of a user specificed max q (e.g. when the user
-  // specifies lossless encode.
+  // However this limit is extended if a very high rate is given on the command
+  // line or the the rate cannnot be acheived because of a user specificed max q
+  // (e.g. when the user specifies lossless encode).
+  //
+  // If a level is specified that requires a lower maximum rate then the level
+  // value take precedence.
   vbr_max_bits =
       (int)(((int64_t)rc->avg_frame_bandwidth * oxcf->two_pass_vbrmax_section) /
             100);