Tweaks to mediaformatshaper

-- parameterize the % boost if QP is desired but not present
-- parameterize the upper bounds for where shaping is phased out
-- tuning default bits-per-pixel for AVC

Bug: 183211971
Test: video quality test scripts
Change-Id: I2e83c574e766606c50d7ed5dc26c49ba92ecb2a4
diff --git a/media/libmediaformatshaper/CodecProperties.cpp b/media/libmediaformatshaper/CodecProperties.cpp
index 315b3ec..b118af6 100644
--- a/media/libmediaformatshaper/CodecProperties.cpp
+++ b/media/libmediaformatshaper/CodecProperties.cpp
@@ -60,6 +60,13 @@
     mTargetQpMax = qpMax;
 }
 
+void CodecProperties::setMissingQpBoost(double boost) {
+    mMissingQpBoost = boost;
+}
+void CodecProperties::setPhaseOut(double phaseout) {
+    mPhaseOut = phaseout;
+}
+
 // what API is this codec set up for (e.g. API of the associated partition)
 // vendor-side (OEM) codecs may be older, due to 'vendor freeze' and treble
 int CodecProperties::supportedApi() {
@@ -134,6 +141,22 @@
             setBpp(bpp);
             legal = true;
         }
+    } else if (!strcmp(key.c_str(), "vq-bitrate-phaseout")) {
+        const char *p = value.c_str();
+        char *q;
+        double phaseout = strtod(p, &q);
+        if (q != p) {
+            setPhaseOut(phaseout);
+            legal = true;
+        }
+    } else if (!strcmp(key.c_str(), "vq-boost-missing-qp")) {
+        const char *p = value.c_str();
+        char *q;
+        double boost = strtod(p, &q);
+        if (q != p) {
+            setMissingQpBoost(boost);
+            legal = true;
+        }
     } else {
         legal = true;
     }