Merge remote-tracking branch 'goog/qcom/release/LA.UM.9.12.R2.10.00.00.685.011' into rvc-d1-dev am: f58212eb01

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/qcom/sm7250/media/+/11685279

Change-Id: I3d124f8bb21472940b7bd303044ed1da8709124e
diff --git a/conf_files/bengal/bengal.mk b/conf_files/bengal/bengal.mk
index 583366b..9ee35f3 100644
--- a/conf_files/bengal/bengal.mk
+++ b/conf_files/bengal/bengal.mk
@@ -4,14 +4,25 @@
 PRODUCT_COPY_FILES += \
     $(CONFIG_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
     $(CONFIG_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
-    $(CONFIG_PATH)/media_codecs_vendor.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor.xml \
     $(CONFIG_PATH)/media_codecs_vendor_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_audio.xml \
-    $(CONFIG_PATH)/media_codecs_vendor_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v1.xml \
     $(CONFIG_PATH)/media_codecs_performance_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_v1.xml \
+    $(CONFIG_PATH)/media_codecs_performance_scuba_v0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_v2.xml \
     $(CONFIG_PATH)/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_vendor.xml \
     $(CONFIG_PATH)/mediacodec-seccomp.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
     $(CONFIG_PATH)/system_properties.xml:$(TARGET_COPY_OUT_VENDOR)/etc/system_properties.xml
 
+ifeq ($(filter $(TARGET_BOARD_SUFFIX), _32 _32go),$(TARGET_BOARD_SUFFIX))
+	PRODUCT_COPY_FILES += \
+		$(CONFIG_PATH)/media_codecs_vendor_32.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor.xml \
+		$(CONFIG_PATH)/media_codecs_vendor_v1_32.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v1.xml \
+        $(CONFIG_PATH)/media_codecs_vendor_scuba_v0_32.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v2.xml
+else
+	PRODUCT_COPY_FILES += \
+		$(CONFIG_PATH)/media_codecs_vendor.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor.xml \
+		$(CONFIG_PATH)/media_codecs_vendor_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v1.xml \
+        $(CONFIG_PATH)/media_codecs_vendor_scuba_v0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v2.xml
+endif
+
 # Vendor property overrides
 
 ifeq ($(GENERIC_ODM_IMAGE),true)
diff --git a/conf_files/bengal/media_codecs.xml b/conf_files/bengal/media_codecs.xml
index d489fc4..273ecf6 100644
--- a/conf_files/bengal/media_codecs.xml
+++ b/conf_files/bengal/media_codecs.xml
@@ -137,6 +137,8 @@
             <Limit name="bitrate" range="1-60000000" />
             <Limit name="frame-rate" range="1-120" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -151,6 +153,20 @@
             <Limit name="concurrent-instances" max="16" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-output-ports" />
+                <Quirk name="requires-loaded-to-idle-after-allocation" />
+                <Limit name="size" min="512x512" max="512x512" />
+                <Limit name="frame-rate" range="1-20" />
+                <Limit name="concurrent-instances" max="16" />
+                <Limit name="quality" range="0-100" default="80" />
+                <Feature name="bitrate-modes" value="CQ" />
+                <Limit name="performance-point-512x512" value="2025" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -162,6 +178,8 @@
             <Limit name="concurrent-instances" max="6" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
@@ -174,7 +192,8 @@
             <Limit name="blocks-per-second" min="36" max="48600" />
             <Limit name="bitrate" range="1-2000000" />
             <Limit name="frame-rate" range="1-30" />
-            <Limit name="concurrent-instances" max="16" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
              <Quirk name="requires-allocate-on-input-ports" />
@@ -186,7 +205,8 @@
              <Limit name="blocks-per-second" min="36" max="48600" />
              <Limit name="bitrate" range="1-8000000" />
              <Limit name="frame-rate" range="1-30" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
     </Encoders>
     <Decoders>
@@ -202,6 +222,8 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -215,6 +237,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -227,6 +250,8 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -240,6 +265,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -252,6 +278,8 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -265,6 +293,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
@@ -277,7 +306,8 @@
              <Limit name="bitrate" range="1-16000000" />
              <Limit name="frame-rate" range="1-30" />
              <Feature name="adaptive-playback" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
              <Quirk name="requires-allocate-on-input-ports" />
@@ -288,7 +318,8 @@
              <Limit name="blocks-per-second" min="36" max="244800" />
              <Limit name="bitrate" range="1-40000000" />
              <Limit name="frame-rate" range="1-30" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
     </Decoders>
     <Include href="media_codecs_google_video.xml" />
diff --git a/conf_files/bengal/media_codecs_performance.xml b/conf_files/bengal/media_codecs_performance.xml
index ff1ed77..2e94378 100644
--- a/conf_files/bengal/media_codecs_performance.xml
+++ b/conf_files/bengal/media_codecs_performance.xml
@@ -56,6 +56,31 @@
         <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
             <Limit name="measured-frame-rate-176x144" range="250-320" />
         </MediaCodec>
+        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="124-176" />
+            <Limit name="measured-frame-rate-720x480" range="53-76" />
+            <Limit name="measured-frame-rate-1280x720" range="35-50" />
+            <Limit name="measured-frame-rate-1920x1080" range="19-28" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="17-24" />
+            <Limit name="measured-frame-rate-720x480" range="7-10" />
+            <Limit name="measured-frame-rate-1280x720" range="3-6" />
+            <Limit name="measured-frame-rate-1920x1080" range="2-3" />
+            <Limit name="measured-frame-rate-3840x2160" range="1-2" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="130-175" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="119-168" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="85-119" />
+            <Limit name="measured-frame-rate-640x360" range="41-65" />
+            <Limit name="measured-frame-rate-1280x720" range="21-30" />
+            <Limit name="measured-frame-rate-1920x1080" range="10-15" />
+        </MediaCodec>
     </Encoders>
     <Decoders>
         <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
@@ -76,7 +101,7 @@
             <Limit name="measured-frame-rate-352x288" range="292-292" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es" update="true">
-            <Limit name="measured-frame-rate-176x144" range="270-295" />
+            <Limit name="measured-frame-rate-176x144" range="418-551" />
             <Limit name="measured-frame-rate-480x360" range="245-265" />
             <Limit name="measured-frame-rate-1280x720" range="80-200" />
         </MediaCodec>
@@ -116,5 +141,36 @@
             <Limit name="measured-frame-rate-1280x720" range="60-85" />
             <Limit name="measured-frame-rate-1920x1080" range="33-55" />
         </MediaCodec>
+        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="63-165" />
+            <Limit name="measured-frame-rate-720x480" range="42-59" />
+            <Limit name="measured-frame-rate-1280x720" range="17-24" />
+            <Limit name="measured-frame-rate-1920x1080" range="8-12" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="67-232" />
+            <Limit name="measured-frame-rate-640x360" range="57-89" />
+            <Limit name="measured-frame-rate-720x480" range="69-99" />
+            <Limit name="measured-frame-rate-1280x720" range="35-51" />
+            <Limit name="measured-frame-rate-1920x1080" range="20-29" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="376-524" />
+            <Limit name="measured-frame-rate-352x288" range="310-415" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="406-543" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="160-480" />
+            <Limit name="measured-frame-rate-640x360" range="133-184" />
+            <Limit name="measured-frame-rate-1920x1080" range="15-22" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="182-360" />
+            <Limit name="measured-frame-rate-640x360" range="85-200" />
+            <Limit name="measured-frame-rate-1280x720" range="35-49" />
+            <Limit name="measured-frame-rate-1920x1080" range="23-33" />
+        </MediaCodec>
     </Decoders>
 </MediaCodecs>
diff --git a/conf_files/bengal/media_codecs_performance_scuba_v0.xml b/conf_files/bengal/media_codecs_performance_scuba_v0.xml
new file mode 100644
index 0000000..3c8f92b
--- /dev/null
+++ b/conf_files/bengal/media_codecs_performance_scuba_v0.xml
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+Copyright (c) 2015-2017, 2019-2020 The Linux Foundation. All rights reserved.
+
+Not a Contribution.
+
+Copyright 2015 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+u may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<MediaCodecs>
+    <Encoders>
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="238-238" />
+            <Limit name="measured-frame-rate-720x480" range="123-123" />
+            <Limit name="measured-frame-rate-1280x720" range="50-50" />
+            <Limit name="measured-frame-rate-1920x1080" range="55-65" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="226-226" />
+            <Limit name="measured-frame-rate-720x480" range="121-121" />
+            <Limit name="measured-frame-rate-1280x720" range="49-49" />
+            <Limit name="measured-frame-rate-1920x1080" range="55-65" />
+            <Limit name="measured-frame-rate-3840x2160" range="20-27" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="60-90" />
+            <Limit name="measured-frame-rate-352x288" range="55-85" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="125-135" />
+            <Limit name="measured-frame-rate-352x288" range="55-85" />
+            <Limit name="measured-frame-rate-640x480" range="47-52" />
+            <Limit name="measured-frame-rate-1280x720" range="30-50" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="215-215" />
+            <Limit name="measured-frame-rate-720x480" range="100-100" />
+            <Limit name="measured-frame-rate-1280x720" range="56-56" />
+            <Limit name="measured-frame-rate-1920x1080" range="30-30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="200-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="250-320" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="124-176" />
+            <Limit name="measured-frame-rate-720x480" range="53-76" />
+            <Limit name="measured-frame-rate-1280x720" range="35-50" />
+            <Limit name="measured-frame-rate-1920x1080" range="19-28" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="17-24" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="130-175" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="119-168" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="85-119" />
+            <Limit name="measured-frame-rate-640x360" range="41-65" />
+            <Limit name="measured-frame-rate-1280x720" range="21-30" />
+            <Limit name="measured-frame-rate-1920x1080" range="10-15" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="480-510" />
+            <Limit name="measured-frame-rate-720x480" range="460-490" />
+            <Limit name="measured-frame-rate-1280x720" range="350-400" />
+            <Limit name="measured-frame-rate-1920x1088" range="180-190" />
+        </MediaCodec>
+            <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="510-530" />
+            <Limit name="measured-frame-rate-720x480" range="465-620" />
+            <Limit name="measured-frame-rate-1280x720" range="200-390" />
+            <Limit name="measured-frame-rate-1920x1080" range="210-230" />
+            <Limit name="measured-frame-rate-3840x2160" range="65-75" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="356-356" />
+            <Limit name="measured-frame-rate-352x288" range="292-292" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="270-295" />
+            <Limit name="measured-frame-rate-480x360" range="245-265" />
+            <Limit name="measured-frame-rate-1280x720" range="80-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x240" range="377-377" />
+            <Limit name="measured-frame-rate-640x360" range="323-323" />
+            <Limit name="measured-frame-rate-1280x720" range="262-262" />
+            <Limit name="measured-frame-rate-1920x1080" range="220-220" />
+            <Limit name="measured-frame-rate-3840x2160" range="51-51" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="270-310" />
+            <Limit name="measured-frame-rate-720x480" range="68-68" />
+            <Limit name="measured-frame-rate-1280x720" range="32-32" />
+            <Limit name="measured-frame-rate-1920x1080" range="6-10" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="104-279" />
+            <Limit name="measured-frame-rate-352x288" range="200-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="520-650" />
+            <Limit name="measured-frame-rate-640x360" range="145-190" />
+            <Limit name="measured-frame-rate-720x480" range="235-245" />
+            <Limit name="measured-frame-rate-1280x720" range="88-100" />
+            <Limit name="measured-frame-rate-1920x1080" range="48-52" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.decoder" update="true">
+            <Type name="video/mp4v-es">
+                <Limit name="measured-frame-rate-176x144" range="430-450" />
+            </Type>
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="640-720" />
+            <Limit name="measured-frame-rate-320x240" range="200-230" />
+            <Limit name="measured-frame-rate-640x360" range="81-90" />
+            <Limit name="measured-frame-rate-1280x720" range="60-85" />
+            <Limit name="measured-frame-rate-1920x1080" range="33-55" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="63-165" />
+            <Limit name="measured-frame-rate-720x480" range="42-59" />
+            <Limit name="measured-frame-rate-1280x720" range="17-24" />
+            <Limit name="measured-frame-rate-1920x1080" range="8-12" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="67-232" />
+            <Limit name="measured-frame-rate-640x360" range="57-89" />
+            <Limit name="measured-frame-rate-720x480" range="69-99" />
+            <Limit name="measured-frame-rate-1280x720" range="35-51" />
+            <Limit name="measured-frame-rate-1920x1080" range="20-29" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="376-524" />
+            <Limit name="measured-frame-rate-352x288" range="310-415" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="406-543" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="160-480" />
+            <Limit name="measured-frame-rate-640x360" range="133-184" />
+            <Limit name="measured-frame-rate-1920x1080" range="15-22" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="182-360" />
+            <Limit name="measured-frame-rate-640x360" range="85-200" />
+            <Limit name="measured-frame-rate-1280x720" range="35-49" />
+            <Limit name="measured-frame-rate-1920x1080" range="23-33" />
+        </MediaCodec>
+    </Decoders>
+</MediaCodecs>
diff --git a/conf_files/bengal/media_codecs_performance_v1.xml b/conf_files/bengal/media_codecs_performance_v1.xml
index ff1ed77..2e94378 100644
--- a/conf_files/bengal/media_codecs_performance_v1.xml
+++ b/conf_files/bengal/media_codecs_performance_v1.xml
@@ -56,6 +56,31 @@
         <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
             <Limit name="measured-frame-rate-176x144" range="250-320" />
         </MediaCodec>
+        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="124-176" />
+            <Limit name="measured-frame-rate-720x480" range="53-76" />
+            <Limit name="measured-frame-rate-1280x720" range="35-50" />
+            <Limit name="measured-frame-rate-1920x1080" range="19-28" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="17-24" />
+            <Limit name="measured-frame-rate-720x480" range="7-10" />
+            <Limit name="measured-frame-rate-1280x720" range="3-6" />
+            <Limit name="measured-frame-rate-1920x1080" range="2-3" />
+            <Limit name="measured-frame-rate-3840x2160" range="1-2" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="130-175" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="119-168" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="85-119" />
+            <Limit name="measured-frame-rate-640x360" range="41-65" />
+            <Limit name="measured-frame-rate-1280x720" range="21-30" />
+            <Limit name="measured-frame-rate-1920x1080" range="10-15" />
+        </MediaCodec>
     </Encoders>
     <Decoders>
         <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
@@ -76,7 +101,7 @@
             <Limit name="measured-frame-rate-352x288" range="292-292" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es" update="true">
-            <Limit name="measured-frame-rate-176x144" range="270-295" />
+            <Limit name="measured-frame-rate-176x144" range="418-551" />
             <Limit name="measured-frame-rate-480x360" range="245-265" />
             <Limit name="measured-frame-rate-1280x720" range="80-200" />
         </MediaCodec>
@@ -116,5 +141,36 @@
             <Limit name="measured-frame-rate-1280x720" range="60-85" />
             <Limit name="measured-frame-rate-1920x1080" range="33-55" />
         </MediaCodec>
+        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="63-165" />
+            <Limit name="measured-frame-rate-720x480" range="42-59" />
+            <Limit name="measured-frame-rate-1280x720" range="17-24" />
+            <Limit name="measured-frame-rate-1920x1080" range="8-12" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="67-232" />
+            <Limit name="measured-frame-rate-640x360" range="57-89" />
+            <Limit name="measured-frame-rate-720x480" range="69-99" />
+            <Limit name="measured-frame-rate-1280x720" range="35-51" />
+            <Limit name="measured-frame-rate-1920x1080" range="20-29" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="376-524" />
+            <Limit name="measured-frame-rate-352x288" range="310-415" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="406-543" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="160-480" />
+            <Limit name="measured-frame-rate-640x360" range="133-184" />
+            <Limit name="measured-frame-rate-1920x1080" range="15-22" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="182-360" />
+            <Limit name="measured-frame-rate-640x360" range="85-200" />
+            <Limit name="measured-frame-rate-1280x720" range="35-49" />
+            <Limit name="measured-frame-rate-1920x1080" range="23-33" />
+        </MediaCodec>
     </Decoders>
 </MediaCodecs>
diff --git a/conf_files/bengal/media_codecs_vendor.xml b/conf_files/bengal/media_codecs_vendor.xml
index 4188022..dc7a1a4 100644
--- a/conf_files/bengal/media_codecs_vendor.xml
+++ b/conf_files/bengal/media_codecs_vendor.xml
@@ -138,6 +138,8 @@
             <Limit name="bitrate" range="1-60000000" />
             <Limit name="frame-rate" range="1-120" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -152,6 +154,8 @@
             <Limit name="concurrent-instances" max="16" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
                 <Quirk name="requires-allocate-on-input-ports" />
@@ -175,6 +179,8 @@
             <Limit name="concurrent-instances" max="6" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
@@ -187,7 +193,8 @@
             <Limit name="blocks-per-second" min="36" max="48600" />
             <Limit name="bitrate" range="1-2000000" />
             <Limit name="frame-rate" range="1-30" />
-            <Limit name="concurrent-instances" max="16" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
              <Quirk name="requires-allocate-on-input-ports" />
@@ -199,7 +206,8 @@
              <Limit name="blocks-per-second" min="36" max="48600" />
              <Limit name="bitrate" range="1-8000000" />
              <Limit name="frame-rate" range="1-30" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
     </Encoders>
     <Decoders>
@@ -215,6 +223,8 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -228,6 +238,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -240,6 +251,8 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -253,6 +266,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -265,6 +279,8 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -278,6 +294,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
@@ -290,7 +307,8 @@
              <Limit name="bitrate" range="1-16000000" />
              <Limit name="frame-rate" range="1-30" />
              <Feature name="adaptive-playback" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
              <Quirk name="requires-allocate-on-input-ports" />
@@ -301,8 +319,28 @@
              <Limit name="blocks-per-second" min="36" max="244800" />
              <Limit name="bitrate" range="1-40000000" />
              <Limit name="frame-rate" range="1-30" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <!-- profiles and levels:  ProfileMain : MainTierLevel51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="8x8" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-2000000" />
+       </MediaCodec>
+       <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <!-- profiles and levels:  ProfileHigh : Level51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Feature name="adaptive-playback" />
+       </MediaCodec>
     </Decoders>
-    <Include href="media_codecs_google_video.xml" />
+    <Include href="media_codecs_google_video_le.xml" />
 </MediaCodecs>
diff --git a/conf_files/bengal/media_codecs_vendor_32.xml b/conf_files/bengal/media_codecs_vendor_32.xml
new file mode 100644
index 0000000..16a7080
--- /dev/null
+++ b/conf_files/bengal/media_codecs_vendor_32.xml
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved.
+     Not a contribution.
+     Copyright (C) 2012-2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+
+-->
+<!--
+ Non-Secure decoder capabilities
+ (MB is defined as 16x16)
+
+  _______________________________________________________
+ | Codec       |  W        H    fps     Mbps     MB/s    |
+ |_____________|_________________________________________|
+ | h264        | 1920    1088    60      60     489600   |
+ | hevc        | 1920    1080    60      60     489600   |
+ | vp9         | 1920    1088    60      60     489600   |
+ | mpeg4-sw    | 1920    1088    30      40     244800   |
+ | h263-sw     | 864     480     30      16      48600   |
+ |_____________|_________________________________________|
+
+ Non-Secure encoder capabilities (Secure not supported)
+ (MB is defined as 16x16)
+
+ ______________________________________________________
+ | Codec    | W       H      fps     Mbps     MB/s    |
+ |__________|_________________________________________|
+ | h264     | 1920    1088    60      60     489600   |
+ | hevc     | 1920    1088    60      60     489600   |
+ | mpeg4-sw | 864     480     30      8       48600   |
+ | h263-sw  | 864     480     30      2       48600   |
+ |__________|_________________________________________|
+-->
+
+<MediaCodecs>
+    <Include href="media_codecs_google_audio.xml" />
+    <Include href="media_codecs_vendor_audio.xml" />
+    <Include href="media_codecs_google_telephony.xml" />
+    <Settings>
+        <Setting name="max-video-encoder-input-buffers" value="11" />
+    </Settings>
+    <Encoders>
+        <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="489600" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="489600" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-output-ports" />
+                <Quirk name="requires-loaded-to-idle-after-allocation" />
+                <Limit name="size" min="512x512" max="512x512" />
+                <Limit name="frame-rate" range="1-20" />
+                <Limit name="concurrent-instances" max="16" />
+                <Limit name="quality" range="0-100" default="80" />
+                <Feature name="bitrate-modes" value="CQ" />
+                <Limit name="performance-point-512x512" value="2025" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="8192x8192" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="864x480" />
+            <Limit name="alignment" value="4x4" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="36" max="48600" />
+            <Limit name="bitrate" range="1-2000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Quirk name="requires-loaded-to-idle-after-allocation" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-8000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+       <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="489600" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="489600" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="489600" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="60" />
+            <Limit name="performance-point-1280x720" value="120" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="4x4" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-16000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Feature name="adaptive-playback" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="1920x1088" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="244800" />
+             <Limit name="bitrate" range="1-40000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <!-- profiles and levels:  ProfileMain : MainTierLevel51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="8x8" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-2000000" />
+       </MediaCodec>
+       <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <!-- profiles and levels:  ProfileHigh : Level51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Feature name="adaptive-playback" />
+       </MediaCodec>
+    </Decoders>
+    <Include href="media_codecs_google_video_le.xml" />
+</MediaCodecs>
diff --git a/conf_files/bengal/media_codecs_vendor_scuba_v0.xml b/conf_files/bengal/media_codecs_vendor_scuba_v0.xml
new file mode 100644
index 0000000..e674234
--- /dev/null
+++ b/conf_files/bengal/media_codecs_vendor_scuba_v0.xml
@@ -0,0 +1,351 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved.
+     Not a contribution.
+     Copyright (C) 2012-2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+
+-->
+<!--
+ Non-Secure decoder capabilities
+ (MB is defined as 16x16)
+
+  _______________________________________________________
+ | Codec       |  W        H    fps     Mbps     MB/s    |
+ |_____________|_________________________________________|
+ | h264        | 1920    1088    30      60     244800   |
+ | hevc        | 1920    1080    30      60     244800   |
+ | vp9         | 1920    1088    30      60     244800   |
+ | mpeg4-sw    | 1920    1088    30      40     244800   |
+ | h263-sw     | 864     480     30      16      48600   |
+ |_____________|_________________________________________|
+
+ Secure decoder capabilities
+ (MB is defined as 16x16)
+
+ _____________________________________________________
+ | Codec    |   W      H     fps     Mbps      MB/s   |
+ |__________|_________________________________________|
+ | h264     | 1920    1088    30      35      244800  |
+ | vp9      | 1920    1088    30      35      244800  |
+ | hevc     | 1920    1088    30      35      244800  |
+ |__________|_________________________________________|
+
+
+ Non-Secure encoder capabilities (Secure not supported)
+ (MB is defined as 16x16)
+
+ ______________________________________________________
+ | Codec    | W       H      fps     Mbps     MB/s    |
+ |__________|_________________________________________|
+ | h264     | 1920    1088    30      60     244800   |
+ | hevc     | 1920    1088    30      60     244800   |
+ | mpeg4-sw | 864     480     30      8       48600   |
+ | h263-sw  | 864     480     30      2       48600   |
+ |__________|_________________________________________|
+-->
+
+<MediaCodecs>
+    <Include href="media_codecs_google_audio.xml" />
+    <Include href="media_codecs_vendor_audio.xml" />
+    <Include href="media_codecs_google_telephony.xml" />
+    <Settings>
+        <Setting name="max-video-encoder-input-buffers" value="11" />
+    </Settings>
+    <Encoders>
+        <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-output-ports" />
+                <Quirk name="requires-loaded-to-idle-after-allocation" />
+                <Limit name="size" min="512x512" max="512x512" />
+                <Limit name="frame-rate" range="1-20" />
+                <Limit name="concurrent-instances" max="16" />
+                <Limit name="quality" range="0-100" default="80" />
+                <Feature name="bitrate-modes" value="CQ" />
+                <Limit name="performance-point-512x512" value="2025" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="8192x8192" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="864x480" />
+            <Limit name="alignment" value="4x4" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="36" max="48600" />
+            <Limit name="bitrate" range="1-2000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Quirk name="requires-loaded-to-idle-after-allocation" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-8000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+       <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-35000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-35000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-35000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="4x4" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-16000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Feature name="adaptive-playback" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="1920x1088" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="244800" />
+             <Limit name="bitrate" range="1-40000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <!-- profiles and levels:  ProfileMain : MainTierLevel51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="8x8" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-2000000" />
+       </MediaCodec>
+       <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <!-- profiles and levels:  ProfileHigh : Level51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Feature name="adaptive-playback" />
+       </MediaCodec>
+    </Decoders>
+    <Include href="media_codecs_google_video_le.xml" />
+</MediaCodecs>
diff --git a/conf_files/bengal/media_codecs_vendor_scuba_v0_32.xml b/conf_files/bengal/media_codecs_vendor_scuba_v0_32.xml
new file mode 100644
index 0000000..a2214e7
--- /dev/null
+++ b/conf_files/bengal/media_codecs_vendor_scuba_v0_32.xml
@@ -0,0 +1,297 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved.
+     Not a contribution.
+     Copyright (C) 2012-2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+
+-->
+<!--
+ Non-Secure decoder capabilities
+ (MB is defined as 16x16)
+
+  _______________________________________________________
+ | Codec       |  W        H    fps     Mbps     MB/s    |
+ |_____________|_________________________________________|
+ | h264        | 1920    1088    30      60     244800   |
+ | hevc        | 1920    1080    30      60     244800   |
+ | vp9         | 1920    1088    30      60     244800   |
+ | mpeg4-sw    | 1920    1088    30      40     244800   |
+ | h263-sw     | 864     480     30      16      48600   |
+ |_____________|_________________________________________|
+
+ Non-Secure encoder capabilities (Secure not supported)
+ (MB is defined as 16x16)
+
+ ______________________________________________________
+ | Codec    | W       H      fps     Mbps     MB/s    |
+ |__________|_________________________________________|
+ | h264     | 1920    1088    30      60     244800   |
+ | hevc     | 1920    1088    30      60     244800   |
+ | mpeg4-sw | 864     480     30      8       48600   |
+ | h263-sw  | 864     480     30      2       48600   |
+ |__________|_________________________________________|
+-->
+
+<MediaCodecs>
+    <Include href="media_codecs_google_audio.xml" />
+    <Include href="media_codecs_vendor_audio.xml" />
+    <Include href="media_codecs_google_telephony.xml" />
+    <Settings>
+        <Setting name="max-video-encoder-input-buffers" value="11" />
+    </Settings>
+    <Encoders>
+        <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-output-ports" />
+                <Quirk name="requires-loaded-to-idle-after-allocation" />
+                <Limit name="size" min="512x512" max="512x512" />
+                <Limit name="frame-rate" range="1-20" />
+                <Limit name="concurrent-instances" max="16" />
+                <Limit name="quality" range="0-100" default="80" />
+                <Feature name="bitrate-modes" value="CQ" />
+                <Limit name="performance-point-512x512" value="2025" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="8192x8192" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="864x480" />
+            <Limit name="alignment" value="4x4" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="36" max="48600" />
+            <Limit name="bitrate" range="1-2000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Quirk name="requires-loaded-to-idle-after-allocation" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-8000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+       <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="4x4" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-16000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Feature name="adaptive-playback" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="1920x1088" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="244800" />
+             <Limit name="bitrate" range="1-40000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <!-- profiles and levels:  ProfileMain : MainTierLevel51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="8x8" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-2000000" />
+       </MediaCodec>
+       <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <!-- profiles and levels:  ProfileHigh : Level51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Feature name="adaptive-playback" />
+       </MediaCodec>
+    </Decoders>
+    <Include href="media_codecs_google_video_le.xml" />
+</MediaCodecs>
diff --git a/conf_files/bengal/media_codecs_vendor_v1.xml b/conf_files/bengal/media_codecs_vendor_v1.xml
index 759f1de..e674234 100644
--- a/conf_files/bengal/media_codecs_vendor_v1.xml
+++ b/conf_files/bengal/media_codecs_vendor_v1.xml
@@ -138,6 +138,9 @@
             <Limit name="bitrate" range="1-60000000" />
             <Limit name="frame-rate" range="1-120" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -152,6 +155,9 @@
             <Limit name="concurrent-instances" max="16" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
                 <Quirk name="requires-allocate-on-input-ports" />
@@ -175,6 +181,8 @@
             <Limit name="concurrent-instances" max="6" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
@@ -187,7 +195,8 @@
             <Limit name="blocks-per-second" min="36" max="48600" />
             <Limit name="bitrate" range="1-2000000" />
             <Limit name="frame-rate" range="1-30" />
-            <Limit name="concurrent-instances" max="16" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
              <Quirk name="requires-allocate-on-input-ports" />
@@ -199,7 +208,8 @@
              <Limit name="blocks-per-second" min="36" max="48600" />
              <Limit name="bitrate" range="1-8000000" />
              <Limit name="frame-rate" range="1-30" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
     </Encoders>
     <Decoders>
@@ -215,6 +225,9 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -228,6 +241,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -240,6 +254,9 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -253,6 +270,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -265,6 +283,9 @@
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -278,6 +299,7 @@
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
@@ -290,7 +312,8 @@
              <Limit name="bitrate" range="1-16000000" />
              <Limit name="frame-rate" range="1-30" />
              <Feature name="adaptive-playback" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
              <Quirk name="requires-allocate-on-input-ports" />
@@ -301,8 +324,28 @@
              <Limit name="blocks-per-second" min="36" max="244800" />
              <Limit name="bitrate" range="1-40000000" />
              <Limit name="frame-rate" range="1-30" />
-             <Limit name="concurrent-instances" max="16" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <!-- profiles and levels:  ProfileMain : MainTierLevel51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="8x8" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-2000000" />
+       </MediaCodec>
+       <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <!-- profiles and levels:  ProfileHigh : Level51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Feature name="adaptive-playback" />
+       </MediaCodec>
     </Decoders>
-    <Include href="media_codecs_google_video.xml" />
+    <Include href="media_codecs_google_video_le.xml" />
 </MediaCodecs>
diff --git a/conf_files/bengal/media_codecs_vendor_v1_32.xml b/conf_files/bengal/media_codecs_vendor_v1_32.xml
new file mode 100644
index 0000000..a2214e7
--- /dev/null
+++ b/conf_files/bengal/media_codecs_vendor_v1_32.xml
@@ -0,0 +1,297 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved.
+     Not a contribution.
+     Copyright (C) 2012-2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+
+-->
+<!--
+ Non-Secure decoder capabilities
+ (MB is defined as 16x16)
+
+  _______________________________________________________
+ | Codec       |  W        H    fps     Mbps     MB/s    |
+ |_____________|_________________________________________|
+ | h264        | 1920    1088    30      60     244800   |
+ | hevc        | 1920    1080    30      60     244800   |
+ | vp9         | 1920    1088    30      60     244800   |
+ | mpeg4-sw    | 1920    1088    30      40     244800   |
+ | h263-sw     | 864     480     30      16      48600   |
+ |_____________|_________________________________________|
+
+ Non-Secure encoder capabilities (Secure not supported)
+ (MB is defined as 16x16)
+
+ ______________________________________________________
+ | Codec    | W       H      fps     Mbps     MB/s    |
+ |__________|_________________________________________|
+ | h264     | 1920    1088    30      60     244800   |
+ | hevc     | 1920    1088    30      60     244800   |
+ | mpeg4-sw | 864     480     30      8       48600   |
+ | h263-sw  | 864     480     30      2       48600   |
+ |__________|_________________________________________|
+-->
+
+<MediaCodecs>
+    <Include href="media_codecs_google_audio.xml" />
+    <Include href="media_codecs_vendor_audio.xml" />
+    <Include href="media_codecs_google_telephony.xml" />
+    <Settings>
+        <Setting name="max-video-encoder-input-buffers" value="11" />
+    </Settings>
+    <Encoders>
+        <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-input-ports" />
+                <Quirk name="requires-allocate-on-output-ports" />
+                <Quirk name="requires-loaded-to-idle-after-allocation" />
+                <Limit name="size" min="512x512" max="512x512" />
+                <Limit name="frame-rate" range="1-20" />
+                <Limit name="concurrent-instances" max="16" />
+                <Limit name="quality" range="0-100" default="80" />
+                <Feature name="bitrate-modes" value="CQ" />
+                <Limit name="performance-point-512x512" value="2025" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="8192x8192" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="864x480" />
+            <Limit name="alignment" value="4x4" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="36" max="48600" />
+            <Limit name="bitrate" range="1-2000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Quirk name="requires-loaded-to-idle-after-allocation" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-8000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+       <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-60000000" />
+            <Limit name="frame-rate" range="1-120" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+            <Limit name="performance-point-1280x720" value="60" />
+            <Limit name="performance-point-720x480" value="120" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="4x4" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-16000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Feature name="adaptive-playback" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="1920x1088" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="244800" />
+             <Limit name="bitrate" range="1-40000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <!-- profiles and levels:  ProfileMain : MainTierLevel51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="8x8" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-2000000" />
+       </MediaCodec>
+       <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <!-- profiles and levels:  ProfileHigh : Level51 -->
+            <Limit name="size" min="2x2" max="1280x720" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="block-count" range="1-3600" />
+            <Limit name="blocks-per-second" range="1-108000" />
+            <Limit name="bitrate" range="1-20000000" />
+            <Feature name="adaptive-playback" />
+       </MediaCodec>
+    </Decoders>
+    <Include href="media_codecs_google_video_le.xml" />
+</MediaCodecs>
diff --git a/conf_files/bengal/media_profiles.xml b/conf_files/bengal/media_profiles.xml
index 735e5dc..d3ceb1d 100644
--- a/conf_files/bengal/media_profiles.xml
+++ b/conf_files/bengal/media_profiles.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012-2019 The Linux Foundation. All rights reserved.
+<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved.
      Not a contribution.
      Copyright (C) 2010 The Android Open Source Project
 
@@ -363,7 +363,7 @@
 
     <EncoderProfile quality="high" fileFormat="mp4" duration="30">
       <Video codec="h264"
-             bitRate="42000000"
+             bitRate="20000000"
              width="1920"
              height="1080"
              frameRate="30" />
@@ -482,7 +482,7 @@
 
     <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
       <Video codec="h264"
-             bitRate="42000000"
+             bitRate="20000000"
              width="1920"
              height="1080"
              frameRate="30" />
diff --git a/conf_files/bengal/system_properties.xml b/conf_files/bengal/system_properties.xml
index d4d02f0..545b5f4 100644
--- a/conf_files/bengal/system_properties.xml
+++ b/conf_files/bengal/system_properties.xml
@@ -37,4 +37,6 @@
         <property name="vidc_c2d_rotation" value="1"/>
         <!-- Bitmask for arb mode: 1: AVC, 2: HEVC, 4: MPEG2 -->
         <property name="vidc_dec_arb_mode_override" value="7"/>
+        <!-- Bitmask for hdr disable mode: 1: dec, 2: enc -->
+        <property name="vidc_disable_hdr" value="3"/>
 </configs>
diff --git a/conf_files/kona/kona.mk b/conf_files/kona/kona.mk
index b2fd6da..76c03de 100644
--- a/conf_files/kona/kona.mk
+++ b/conf_files/kona/kona.mk
@@ -4,9 +4,12 @@
 PRODUCT_COPY_FILES += \
     $(CONFIG_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
     $(CONFIG_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
+    $(CONFIG_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_kona.xml \
     $(CONFIG_PATH)/media_codecs_vendor.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor.xml \
+    $(CONFIG_PATH)/media_codecs_vendor.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_kona.xml \
     $(CONFIG_PATH)/media_codecs_vendor_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_audio.xml \
     $(CONFIG_PATH)/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_vendor.xml \
+    $(CONFIG_PATH)/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_kona.xml \
     $(CONFIG_PATH)/mediacodec-seccomp.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
     $(CONFIG_PATH)/system_properties.xml:$(TARGET_COPY_OUT_VENDOR)/etc/system_properties.xml
 
diff --git a/conf_files/kona/media_codecs_performance.xml b/conf_files/kona/media_codecs_performance.xml
index e7fc6f4..d9ac7e8 100644
--- a/conf_files/kona/media_codecs_performance.xml
+++ b/conf_files/kona/media_codecs_performance.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <!--
-Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 
 Not a Contribution.
 
@@ -40,10 +40,11 @@
         <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" update="true">
             <Limit name="measured-frame-rate-176x144" range="303-303" />
             <Limit name="measured-frame-rate-352x288" range="259-259" />
+            <Limit name="measured-frame-rate-704x576" range="87-155" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" update="true">
             <Limit name="measured-frame-rate-176x144" range="299-299" />
-            <Limit name="measured-frame-rate-352x288" range="245-245" />
+            <Limit name="measured-frame-rate-352x288" range="56-81" />
             <Limit name="measured-frame-rate-640x480" range="148-148" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
@@ -112,13 +113,13 @@
             <Limit name="measured-frame-rate-3840x2160" range="148-149" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" update="true">
-            <Limit name="measured-frame-rate-176x144" range="530-650" />
+            <Limit name="measured-frame-rate-176x144" range="782-1581" />
             <Limit name="measured-frame-rate-352x288" range="380-920" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es" update="true">
-            <Limit name="measured-frame-rate-176x144" range="381-767" />
+            <Limit name="measured-frame-rate-176x144" range="775-2064" />
             <Limit name="measured-frame-rate-480x360" range="695-915" />
-            <Limit name="measured-frame-rate-1280x720" range="240-292" />
+            <Limit name="measured-frame-rate-1280x720" range="369-529" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
             <Limit name="measured-frame-rate-320x240" range="1111-1357" />
@@ -128,7 +129,7 @@
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
             <Limit name="measured-frame-rate-320x240" range="806-1245" />
-            <Limit name="measured-frame-rate-640x360" range="499-695" />
+            <Limit name="measured-frame-rate-640x360" range="832-1285" />
             <Limit name="measured-frame-rate-1280x720" range="485-600" />
             <Limit name="measured-frame-rate-1920x1080" range="435-495" />
             <Limit name="measured-frame-rate-3840x2160" range="83-98" />
@@ -170,17 +171,17 @@
             <Limit name="measured-frame-rate-1920x1080" range="19-23" />
         </MediaCodec>
         <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="196-269" />
-            <Limit name="measured-frame-rate-720x480" range="56-77" />
-            <Limit name="measured-frame-rate-1280x720" range="21-33" />
+            <Limit name="measured-frame-rate-320x240" range="350-469" />
+            <Limit name="measured-frame-rate-720x480" range="326-436" />
+            <Limit name="measured-frame-rate-1280x720" range="21-155" />
             <Limit name="measured-frame-rate-1920x1080" range="12-17" />
         </MediaCodec>
         <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
             <Limit name="measured-frame-rate-352x288" range="355-960" />
-            <Limit name="measured-frame-rate-640x360" range="120-164" />
-            <Limit name="measured-frame-rate-720x480" range="111-152" />
-            <Limit name="measured-frame-rate-1280x720" range="61-83" />
-            <Limit name="measured-frame-rate-1920x1080" range="36-49" />
+            <Limit name="measured-frame-rate-640x360" range="308-526" />
+            <Limit name="measured-frame-rate-720x480" range="370-455" />
+            <Limit name="measured-frame-rate-1280x720" range="105-210" />
+            <Limit name="measured-frame-rate-1920x1080" range="92-143" />
         </MediaCodec>
         <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
             <Limit name="measured-frame-rate-176x144" range="550-1200" />
@@ -190,13 +191,13 @@
             <Limit name="measured-frame-rate-352x288" range="324-769" />
         </MediaCodec>
         <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
-            <Limit name="measured-frame-rate-320x180" range="415-575" />
+            <Limit name="measured-frame-rate-320x180" range="573-1136" />
             <Limit name="measured-frame-rate-640x360" range="200-450" />
-            <Limit name="measured-frame-rate-1280x720" range="44-60" />
-            <Limit name="measured-frame-rate-1920x1080" range="28-38" />
+            <Limit name="measured-frame-rate-1280x720" range="190-244" />
+            <Limit name="measured-frame-rate-1920x1080" range="19-31" />
         </MediaCodec>
         <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="460-626" />
+            <Limit name="measured-frame-rate-320x180" range="601-1177" />
             <Limit name="measured-frame-rate-640x360" range="222-302" />
             <Limit name="measured-frame-rate-1280x720" range="107-145" />
             <Limit name="measured-frame-rate-1920x1080" range="31-43" />
diff --git a/conf_files/kona/system_properties.xml b/conf_files/kona/system_properties.xml
index efde013..c94cb2e 100644
--- a/conf_files/kona/system_properties.xml
+++ b/conf_files/kona/system_properties.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!--
-Copyright (c) 2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -39,8 +39,11 @@
         <!-- Buffer size : internal : 200 MB (200 X 1), output : 200 MB (12.5 X 16) -->
         <property name="vidc_dec_sec_prefetch_size_internal" value="209715200"/>
         <property name="vidc_dec_sec_prefetch_size_output" value="13434880"/>
-        <property name="vidc_enc_bitrate_savings_enable" value="1"/>
+        <!-- Enable CAC control: 0x0: disabled, 0x1:enabled for 8 bit, 0x2:enabled for 10 bit, 0x3:enabled for 8 and 10 bits both -->
+        <property name="vidc_enc_bitrate_savings_enable" value="3"/>
         <property name="vidc_enc_auto_blur_disable" value="0"/>
         <!-- Bitmask 0: RGB565  1: YUV420P 8-bit, 2: YUV420P 10-bit, 3: YUV420p 8&10 bit -->
         <property name="vidc_dec_thumbnail_yuv_output" value="0"/>
+        <property name="vidc_enc_quality_boost_enable" value="1"/>
+        <property name="vidc_dec_output_rate" value="120"/>
 </configs>
diff --git a/conf_files/lito/lito.mk b/conf_files/lito/lito.mk
index 1a96734..59a583c 100644
--- a/conf_files/lito/lito.mk
+++ b/conf_files/lito/lito.mk
@@ -6,8 +6,12 @@
     $(CONFIG_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
     $(CONFIG_PATH)/media_codecs_vendor.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor.xml \
     $(CONFIG_PATH)/media_codecs_vendor_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_audio.xml \
-	$(CONFIG_PATH)/media_codecs_vendor_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v1.xml \
-	$(CONFIG_PATH)/media_codecs_performance_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_v1.xml \
+    $(CONFIG_PATH)/media_codecs_vendor_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v1.xml \
+    $(CONFIG_PATH)/media_codecs_performance_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_v1.xml \
+    $(CONFIG_PATH)/media_codecs_performance_lagoon_v0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_v2.xml \
+    $(CONFIG_PATH)/media_codecs_vendor_lagoon_v0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v2.xml \
+    $(CONFIG_PATH)/media_codecs_performance_lagoon_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_v3.xml \
+    $(CONFIG_PATH)/media_codecs_vendor_lagoon_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_vendor_v3.xml \
     $(CONFIG_PATH)/mediacodec-seccomp.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
     $(CONFIG_PATH)/system_properties.xml:$(TARGET_COPY_OUT_VENDOR)/etc/system_properties.xml
 
diff --git a/conf_files/lito/media_codecs.xml b/conf_files/lito/media_codecs.xml
index 7716be2..3b0af5b 100644
--- a/conf_files/lito/media_codecs.xml
+++ b/conf_files/lito/media_codecs.xml
@@ -86,16 +86,13 @@
   _____________________________________________________
  | Codec       |  W      H      fps     Mbps    MB/s   |
  |_____________|_______________________________________|
- | h264        | 3840   2176    60      100    1958400 |
- |             | 4096   2176    48      100            |
- | hevc        | 3840   2176    60      100    1958400 |
- |             | 4096   2176    48      100            |
- | mpeg4-sw    | 1920   1088    30       40     244800 |
- | vp8         | 3840   2176    30      100     979200 |
+ | h264        | 3840   2176    30      100     979200 |
  |             | 4096   2176    24      100            |
- | vp9         | 3840   2176    60      100    1958400 |
- |             | 4096   2176    48      100            |
- | vc1         | 1920   1088    30       20     244800 |
+ | hevc        | 3840   2176    30      100     979200 |
+ |             | 4096   2176    24      100            |
+ | mpeg4-sw    | 1920   1088    30       40     244800 |
+ | vp9         | 3840   2176    30      100     979200 |
+ |             | 4096   2176    24      100            |
  | h263-sw     |  864    480    30       16      48600 |
  | mpeg2       | 1920   1088    30       40     244800 |
  |_____________|_______________________________________|
@@ -106,12 +103,12 @@
  _________________________________________________
  | Codec    |  W      H      fps    Mbps   MB/s   |
  |__________|_____________________________________|
- | h264     | 3840   2176    60     40    1958400 |
- |          | 4096   2176    48     40            |
- | vp9      | 3840   2176    60     40    1958400 |
- |          | 4096   2176    48     40            |
- | hevc     | 3840   2176    60     40    1958400 |
- |          | 4096   2176    48     40            |
+ | h264     | 3840   2176    30     40     979200 |
+ |          | 4096   2176    24     40            |
+ | vp9      | 3840   2176    30     40     979200 |
+ |          | 4096   2176    24     40            |
+ | hevc     | 3840   2176    30     40     979200 |
+ |          | 4096   2176    24     40            |
  | mpeg2    | 1920   1088    30     40     244800 |
  |__________|_____________________________________|
 
@@ -122,13 +119,11 @@
  _________________________________________________
  | Codec    |  W      H      fps   Mbps    MB/s   |
  |__________|_____________________________________|
- | h264     | 3840   2176    60    100    1958400 |
- |          | 4096   2176    48    100            |
- | hevc     | 3840   2176    60    100    1958400 |
- |          | 4096   2176    48    100            |
- | mpeg4-sw |  864    480    30      8      48600 |
- | vp8      | 3840   2176    30    100     979200 |
+ | h264     | 3840   2176    30    100     979200 |
  |          | 4096   2176    24    100            |
+ | hevc     | 3840   2176    30    100     979200 |
+ |          | 4096   2176    24    100            |
+ | mpeg4-sw |  864    480    30      8      48600 |
  | h263-sw  |  864    480    30      2      48600 |
  |__________|_____________________________________|
 -->
@@ -145,51 +140,35 @@
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
             <Quirk name="requires-loaded-to-idle-after-allocation" />
-            <Limit name="size" min="96x96" max="4096x2176" />
+            <Limit name="size" min="128x128" max="4096x2176" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="1958400" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-480" />
-            <Limit name="performance-point-4096x2304" value="30" />
-            <Limit name="performance-point-3840x2160" value="60" />
-            <Limit name="performance-point-1920x1080" value="240" />
-            <Limit name="performance-point-1280x720" value="480" />
-            <Limit name="concurrent-instances" max="16" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Quirk name="requires-loaded-to-idle-after-allocation" />
-            <Limit name="size" min="96x96" max="4096x2176" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="979200" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
             <Limit name="bitrate" range="1-100000000" />
             <Limit name="frame-rate" range="1-240" />
-            <Limit name="concurrent-instances" max="16" />
             <Limit name="performance-point-4096x2304" value="24" />
             <Limit name="performance-point-3840x2160" value="30" />
             <Limit name="performance-point-1920x1080" value="120" />
             <Limit name="performance-point-1280x720" value="240" />
+            <Limit name="concurrent-instances" max="16" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
             <Quirk name="requires-loaded-to-idle-after-allocation" />
-            <Limit name="size" min="96x96" max="4096x2176" />
+            <Limit name="size" min="128x128" max="4096x2176" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="1958400" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
             <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-480" />
+            <Limit name="frame-rate" range="1-240" />
             <Limit name="concurrent-instances" max="16" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="VBR,CBR" />
-            <Limit name="performance-point-4096x2304" value="30" />
-            <Limit name="performance-point-3840x2160" value="60" />
-            <Limit name="performance-point-1920x1080" value="240" />
-            <Limit name="performance-point-1280x720" value="480" />
+            <Limit name="performance-point-4096x2304" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -203,6 +182,19 @@
             <Feature name="bitrate-modes" value="CQ" />
             <Limit name="performance-point-512x512" value="2025" />
         </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="8192x8192" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+        </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -236,68 +228,10 @@
         <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2176" />
+            <Limit name="size" min="128x128" max="4096x2176" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="1958400" />
-            <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-480" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="16" />
-            <Limit name="performance-point-4096x2304" value="30" />
-            <Limit name="performance-point-3840x2160" value="60" />
-            <Limit name="performance-point-1920x1080" value="240" />
-            <Limit name="performance-point-1280x720" value="480" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2176" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="1958400" />
-            <Limit name="bitrate" range="1-40000000" />
-            <Limit name="frame-rate" range="1-60" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="3" />
-            <Limit name="performance-point-4096x2304" value="30" />
-            <Limit name="performance-point-3840x2160" value="60" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="1920x1088" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="244800" />
-            <Limit name="bitrate" range="1-40000000" />
-            <Limit name="frame-rate" range="1-30" />
-            <Feature name="adaptive-playback" />
-            <Limit name="concurrent-instances" max="16" />
-            <Limit name="performance-point-1920x1080" value="30" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="1920x1088" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="244800" />
-            <Limit name="bitrate" range="1-40000000" />
-            <Limit name="frame-rate" range="1-30" />
-            <Feature name="adaptive-playback" />
-            <Feature name="secure-playback" required="true" />
-            <Limit name="concurrent-instances" max="3" />
-            <Limit name="performance-point-1920x1080" value="30" />
-        </MediaCodec>
-        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
-            <Quirk name="requires-allocate-on-input-ports" />
-            <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2176" />
-            <Limit name="alignment" value="2x2" />
-            <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="979200" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
             <Limit name="bitrate" range="1-100000000" />
             <Limit name="frame-rate" range="1-240" />
             <Feature name="adaptive-playback" />
@@ -307,67 +241,112 @@
             <Limit name="performance-point-1920x1080" value="120" />
             <Limit name="performance-point-1280x720" value="240" />
         </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-4096x2304" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="60" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2176" />
+            <Limit name="size" min="128x128" max="4096x2176" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="1958400" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
             <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-480" />
+            <Limit name="frame-rate" range="1-240" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="6" />
-            <Limit name="performance-point-4096x2304" value="30" />
-            <Limit name="performance-point-3840x2160" value="60" />
-            <Limit name="performance-point-1920x1080" value="240" />
-            <Limit name="performance-point-1280x720" value="480" />
+            <Limit name="performance-point-4096x2304" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2176" />
+            <Limit name="size" min="128x128" max="4096x2176" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="1958400" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
             <Limit name="bitrate" range="1-40000000" />
             <Limit name="frame-rate" range="1-60" />
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
-            <Limit name="performance-point-4096x2304" value="30" />
-            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-4096x2304" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="60" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2176" />
+            <Limit name="size" min="128x128" max="4096x2176" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="1958400" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
             <Limit name="bitrate" range="1-100000000" />
-            <Limit name="frame-rate" range="1-480" />
+            <Limit name="frame-rate" range="1-240" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
-            <Limit name="performance-point-4096x2304" value="30" />
-            <Limit name="performance-point-3840x2160" value="60" />
-            <Limit name="performance-point-1920x1080" value="240" />
-            <Limit name="performance-point-1280x720" value="480" />
+            <Limit name="performance-point-4096x2304" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="96x96" max="4096x2176" />
+            <Limit name="size" min="128x128" max="4096x2176" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="36" max="1958400" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
             <Limit name="bitrate" range="1-40000000" />
             <Limit name="frame-rate" range="1-60" />
             <Feature name="adaptive-playback" />
             <Feature name="secure-playback" required="true" />
             <Limit name="concurrent-instances" max="3" />
-            <Limit name="performance-point-4096x2304" value="30" />
-            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-4096x2304" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="60" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
diff --git a/conf_files/lito/media_codecs_performance.xml b/conf_files/lito/media_codecs_performance.xml
index 7281b95..cbdac98 100644
--- a/conf_files/lito/media_codecs_performance.xml
+++ b/conf_files/lito/media_codecs_performance.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <!--
-Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved.
+Copyright (c) 2015-2017, 2019-2020 The Linux Foundation. All rights reserved.
 
 Not a Contribution.
 
@@ -22,14 +22,14 @@
 <MediaCodecs>
     <Encoders>
         <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="238-238" />
-            <Limit name="measured-frame-rate-720x480" range="123-123" />
+            <Limit name="measured-frame-rate-320x240" range="337-452" />
+            <Limit name="measured-frame-rate-720x480" range="182-312" />
             <Limit name="measured-frame-rate-1280x720" range="66-94" />
             <Limit name="measured-frame-rate-1920x1080" range="55-65" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="226-226" />
-            <Limit name="measured-frame-rate-720x480" range="121-121" />
+            <Limit name="measured-frame-rate-320x240" range="332-443" />
+            <Limit name="measured-frame-rate-720x480" range="194-317" />
             <Limit name="measured-frame-rate-1280x720" range="65-94" />
             <Limit name="measured-frame-rate-1920x1080" range="55-65" />
             <Limit name="measured-frame-rate-3840x2160" range="20-27" />
@@ -41,7 +41,7 @@
         <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" update="true">
             <Limit name="measured-frame-rate-176x144" range="125-135" />
             <Limit name="measured-frame-rate-352x288" range="55-85" />
-            <Limit name="measured-frame-rate-640x480" range="47-52" />
+            <Limit name="measured-frame-rate-640x480" range="70-106" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
             <Limit name="measured-frame-rate-320x180" range="339-486" />
@@ -184,11 +184,12 @@
         <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
             <Limit name="measured-frame-rate-320x180" range="310-690" />
             <Limit name="measured-frame-rate-640x360" range="233-321" />
+            <Limit name="measured-frame-rate-1280x720" range="64-91" />
             <Limit name="measured-frame-rate-1920x1080" range="22-33" />
         </MediaCodec>
         <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
             <Limit name="measured-frame-rate-320x180" range="234-450" />
-            <Limit name="measured-frame-rate-640x360" range="65-91" />
+            <Limit name="measured-frame-rate-640x360" range="203-330" />
             <Limit name="measured-frame-rate-1280x720" range="34-49" />
             <Limit name="measured-frame-rate-1920x1080" range="20-31" />
         </MediaCodec>
diff --git a/conf_files/lito/media_codecs_performance_lagoon_v0.xml b/conf_files/lito/media_codecs_performance_lagoon_v0.xml
new file mode 100644
index 0000000..b8af425
--- /dev/null
+++ b/conf_files/lito/media_codecs_performance_lagoon_v0.xml
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
+
+Not a Contribution.
+
+Copyright 2015 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+u may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<MediaCodecs>
+    <Encoders>
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="238-238" />
+            <Limit name="measured-frame-rate-720x480" range="123-123" />
+            <Limit name="measured-frame-rate-1280x720" range="66-94" />
+            <Limit name="measured-frame-rate-1920x1080" range="55-65" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="226-226" />
+            <Limit name="measured-frame-rate-720x480" range="121-121" />
+            <Limit name="measured-frame-rate-1280x720" range="65-94" />
+            <Limit name="measured-frame-rate-1920x1080" range="55-65" />
+            <Limit name="measured-frame-rate-3840x2160" range="20-27" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="60-90" />
+            <Limit name="measured-frame-rate-352x288" range="55-85" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="125-135" />
+            <Limit name="measured-frame-rate-352x288" range="55-85" />
+            <Limit name="measured-frame-rate-640x480" range="47-52" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="215-215" />
+            <Limit name="measured-frame-rate-720x480" range="100-100" />
+            <Limit name="measured-frame-rate-1280x720" range="56-56" />
+            <Limit name="measured-frame-rate-1920x1080" range="30-30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="200-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="250-320" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="70-75" />
+            <Limit name="measured-frame-rate-640x360" range="32-32" />
+            <Limit name="measured-frame-rate-1280x720" range="17-24" />
+            <Limit name="measured-frame-rate-1920x1080" range="8-12" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="167-248" />
+            <Limit name="measured-frame-rate-720x480" range="62-90" />
+            <Limit name="measured-frame-rate-1280x720" range="48-56" />
+            <Limit name="measured-frame-rate-1920x1080" range="24-34" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="20-28" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="317-410" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="315-379" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="104-156" />
+            <Limit name="measured-frame-rate-640x360" range="76-105" />
+            <Limit name="measured-frame-rate-1280x720" range="26-32" />
+            <Limit name="measured-frame-rate-1920x1080" range="19-26" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="480-510" />
+            <Limit name="measured-frame-rate-720x480" range="460-490" />
+            <Limit name="measured-frame-rate-1280x720" range="350-400" />
+            <Limit name="measured-frame-rate-1920x1088" range="180-190" />
+        </MediaCodec>
+            <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="510-530" />
+            <Limit name="measured-frame-rate-720x480" range="465-620" />
+            <Limit name="measured-frame-rate-1280x720" range="200-390" />
+            <Limit name="measured-frame-rate-1920x1080" range="210-230" />
+            <Limit name="measured-frame-rate-3840x2160" range="65-75" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="356-356" />
+            <Limit name="measured-frame-rate-352x288" range="292-292" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="374-542" />
+            <Limit name="measured-frame-rate-480x360" range="245-265" />
+            <Limit name="measured-frame-rate-1280x720" range="80-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x240" range="377-377" />
+            <Limit name="measured-frame-rate-640x360" range="486-751" />
+            <Limit name="measured-frame-rate-1280x720" range="262-262" />
+            <Limit name="measured-frame-rate-1920x1080" range="220-220" />
+            <Limit name="measured-frame-rate-3840x2160" range="51-51" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="270-310" />
+            <Limit name="measured-frame-rate-720x480" range="68-68" />
+            <Limit name="measured-frame-rate-1280x720" range="32-32" />
+            <Limit name="measured-frame-rate-1920x1080" range="6-10" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="104-279" />
+            <Limit name="measured-frame-rate-352x288" range="200-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="520-650" />
+            <Limit name="measured-frame-rate-640x360" range="145-190" />
+            <Limit name="measured-frame-rate-720x480" range="235-245" />
+            <Limit name="measured-frame-rate-1280x720" range="88-100" />
+            <Limit name="measured-frame-rate-1920x1080" range="48-52" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.decoder" update="true">
+            <Type name="video/mp4v-es">
+                <Limit name="measured-frame-rate-176x144" range="430-450" />
+            </Type>
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="800-850" />
+            <Limit name="measured-frame-rate-320x240" range="330-381" />
+            <Limit name="measured-frame-rate-640x360" range="385-425" />
+            <Limit name="measured-frame-rate-1280x720" range="22-38" />
+            <Limit name="measured-frame-rate-1920x1080" range="32-37" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="640-720" />
+            <Limit name="measured-frame-rate-320x240" range="200-230" />
+            <Limit name="measured-frame-rate-640x360" range="81-90" />
+            <Limit name="measured-frame-rate-1280x720" range="60-85" />
+            <Limit name="measured-frame-rate-1920x1080" range="33-55" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="115-169" />
+            <Limit name="measured-frame-rate-720x480" range="40-60" />
+            <Limit name="measured-frame-rate-1280x720" range="17-24" />
+            <Limit name="measured-frame-rate-1920x1080" range="10-13" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="128-178" />
+            <Limit name="measured-frame-rate-640x360" range="84-96" />
+            <Limit name="measured-frame-rate-720x480" range="66-94" />
+            <Limit name="measured-frame-rate-1280x720" range="47-74" />
+            <Limit name="measured-frame-rate-1920x1080" range="29-43" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="450-850" />
+            <Limit name="measured-frame-rate-352x288" range="650-780" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="374-542" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="310-690" />
+            <Limit name="measured-frame-rate-640x360" range="233-321" />
+            <Limit name="measured-frame-rate-1920x1080" range="22-33" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="234-450" />
+            <Limit name="measured-frame-rate-640x360" range="65-91" />
+            <Limit name="measured-frame-rate-1280x720" range="34-49" />
+            <Limit name="measured-frame-rate-1920x1080" range="20-31" />
+        </MediaCodec>
+    </Decoders>
+</MediaCodecs>
diff --git a/conf_files/lito/media_codecs_performance_lagoon_v1.xml b/conf_files/lito/media_codecs_performance_lagoon_v1.xml
new file mode 100644
index 0000000..b8af425
--- /dev/null
+++ b/conf_files/lito/media_codecs_performance_lagoon_v1.xml
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
+
+Not a Contribution.
+
+Copyright 2015 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+u may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<MediaCodecs>
+    <Encoders>
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="238-238" />
+            <Limit name="measured-frame-rate-720x480" range="123-123" />
+            <Limit name="measured-frame-rate-1280x720" range="66-94" />
+            <Limit name="measured-frame-rate-1920x1080" range="55-65" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="226-226" />
+            <Limit name="measured-frame-rate-720x480" range="121-121" />
+            <Limit name="measured-frame-rate-1280x720" range="65-94" />
+            <Limit name="measured-frame-rate-1920x1080" range="55-65" />
+            <Limit name="measured-frame-rate-3840x2160" range="20-27" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="60-90" />
+            <Limit name="measured-frame-rate-352x288" range="55-85" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="125-135" />
+            <Limit name="measured-frame-rate-352x288" range="55-85" />
+            <Limit name="measured-frame-rate-640x480" range="47-52" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="215-215" />
+            <Limit name="measured-frame-rate-720x480" range="100-100" />
+            <Limit name="measured-frame-rate-1280x720" range="56-56" />
+            <Limit name="measured-frame-rate-1920x1080" range="30-30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="200-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="250-320" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="70-75" />
+            <Limit name="measured-frame-rate-640x360" range="32-32" />
+            <Limit name="measured-frame-rate-1280x720" range="17-24" />
+            <Limit name="measured-frame-rate-1920x1080" range="8-12" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="167-248" />
+            <Limit name="measured-frame-rate-720x480" range="62-90" />
+            <Limit name="measured-frame-rate-1280x720" range="48-56" />
+            <Limit name="measured-frame-rate-1920x1080" range="24-34" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="20-28" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="317-410" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="315-379" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="104-156" />
+            <Limit name="measured-frame-rate-640x360" range="76-105" />
+            <Limit name="measured-frame-rate-1280x720" range="26-32" />
+            <Limit name="measured-frame-rate-1920x1080" range="19-26" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="480-510" />
+            <Limit name="measured-frame-rate-720x480" range="460-490" />
+            <Limit name="measured-frame-rate-1280x720" range="350-400" />
+            <Limit name="measured-frame-rate-1920x1088" range="180-190" />
+        </MediaCodec>
+            <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="510-530" />
+            <Limit name="measured-frame-rate-720x480" range="465-620" />
+            <Limit name="measured-frame-rate-1280x720" range="200-390" />
+            <Limit name="measured-frame-rate-1920x1080" range="210-230" />
+            <Limit name="measured-frame-rate-3840x2160" range="65-75" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="356-356" />
+            <Limit name="measured-frame-rate-352x288" range="292-292" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="374-542" />
+            <Limit name="measured-frame-rate-480x360" range="245-265" />
+            <Limit name="measured-frame-rate-1280x720" range="80-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x240" range="377-377" />
+            <Limit name="measured-frame-rate-640x360" range="486-751" />
+            <Limit name="measured-frame-rate-1280x720" range="262-262" />
+            <Limit name="measured-frame-rate-1920x1080" range="220-220" />
+            <Limit name="measured-frame-rate-3840x2160" range="51-51" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="270-310" />
+            <Limit name="measured-frame-rate-720x480" range="68-68" />
+            <Limit name="measured-frame-rate-1280x720" range="32-32" />
+            <Limit name="measured-frame-rate-1920x1080" range="6-10" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="104-279" />
+            <Limit name="measured-frame-rate-352x288" range="200-200" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="520-650" />
+            <Limit name="measured-frame-rate-640x360" range="145-190" />
+            <Limit name="measured-frame-rate-720x480" range="235-245" />
+            <Limit name="measured-frame-rate-1280x720" range="88-100" />
+            <Limit name="measured-frame-rate-1920x1080" range="48-52" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.decoder" update="true">
+            <Type name="video/mp4v-es">
+                <Limit name="measured-frame-rate-176x144" range="430-450" />
+            </Type>
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="800-850" />
+            <Limit name="measured-frame-rate-320x240" range="330-381" />
+            <Limit name="measured-frame-rate-640x360" range="385-425" />
+            <Limit name="measured-frame-rate-1280x720" range="22-38" />
+            <Limit name="measured-frame-rate-1920x1080" range="32-37" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="640-720" />
+            <Limit name="measured-frame-rate-320x240" range="200-230" />
+            <Limit name="measured-frame-rate-640x360" range="81-90" />
+            <Limit name="measured-frame-rate-1280x720" range="60-85" />
+            <Limit name="measured-frame-rate-1920x1080" range="33-55" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="115-169" />
+            <Limit name="measured-frame-rate-720x480" range="40-60" />
+            <Limit name="measured-frame-rate-1280x720" range="17-24" />
+            <Limit name="measured-frame-rate-1920x1080" range="10-13" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="128-178" />
+            <Limit name="measured-frame-rate-640x360" range="84-96" />
+            <Limit name="measured-frame-rate-720x480" range="66-94" />
+            <Limit name="measured-frame-rate-1280x720" range="47-74" />
+            <Limit name="measured-frame-rate-1920x1080" range="29-43" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="450-850" />
+            <Limit name="measured-frame-rate-352x288" range="650-780" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="374-542" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="310-690" />
+            <Limit name="measured-frame-rate-640x360" range="233-321" />
+            <Limit name="measured-frame-rate-1920x1080" range="22-33" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="234-450" />
+            <Limit name="measured-frame-rate-640x360" range="65-91" />
+            <Limit name="measured-frame-rate-1280x720" range="34-49" />
+            <Limit name="measured-frame-rate-1920x1080" range="20-31" />
+        </MediaCodec>
+    </Decoders>
+</MediaCodecs>
diff --git a/conf_files/lito/media_codecs_performance_v1.xml b/conf_files/lito/media_codecs_performance_v1.xml
index cadc1e7..27048cb 100644
--- a/conf_files/lito/media_codecs_performance_v1.xml
+++ b/conf_files/lito/media_codecs_performance_v1.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <!--
-Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 
 Not a Contribution.
 
@@ -22,14 +22,14 @@
 <MediaCodecs>
     <Encoders>
         <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="238-238" />
-            <Limit name="measured-frame-rate-720x480" range="123-123" />
+            <Limit name="measured-frame-rate-320x240" range="337-452" />
+            <Limit name="measured-frame-rate-720x480" range="182-312" />
             <Limit name="measured-frame-rate-1280x720" range="50-50" />
             <Limit name="measured-frame-rate-1920x1080" range="16-40" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="226-226" />
-            <Limit name="measured-frame-rate-720x480" range="121-121" />
+            <Limit name="measured-frame-rate-320x240" range="332-443" />
+            <Limit name="measured-frame-rate-720x480" range="194-317" />
             <Limit name="measured-frame-rate-1280x720" range="49-49" />
             <Limit name="measured-frame-rate-1920x1080" range="55-65" />
             <Limit name="measured-frame-rate-3840x2160" range="18-25" />
@@ -41,7 +41,7 @@
         <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" update="true">
             <Limit name="measured-frame-rate-176x144" range="125-135" />
             <Limit name="measured-frame-rate-352x288" range="68-85" />
-            <Limit name="measured-frame-rate-640x480" range="47-52" />
+            <Limit name="measured-frame-rate-640x480" range="70-106" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
             <Limit name="measured-frame-rate-320x180" range="266-266" />
@@ -184,6 +184,7 @@
         <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
             <Limit name="measured-frame-rate-320x180" range="510-810" />
             <Limit name="measured-frame-rate-640x360" range="197-336" />
+            <Limit name="measured-frame-rate-1280x720" range="64-91" />
             <Limit name="measured-frame-rate-1920x1080" range="21-31" />
         </MediaCodec>
         <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
diff --git a/conf_files/lito/media_codecs_vendor_lagoon_v0.xml b/conf_files/lito/media_codecs_vendor_lagoon_v0.xml
new file mode 100644
index 0000000..282c42d
--- /dev/null
+++ b/conf_files/lito/media_codecs_vendor_lagoon_v0.xml
@@ -0,0 +1,368 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved.
+     Not a contribution.
+     Copyright (C) 2012-2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+
+-->
+<!--
+ Non-Secure decoder capabilities
+ (MB is defined as 16x16)
+
+  _____________________________________________________
+ | Codec       |  W      H      fps     Mbps    MB/s   |
+ |_____________|_______________________________________|
+ | h264        | 3840   2176    60      100    1958400 |
+ | hevc        | 3840   2176    60      100    1958400 |
+ | mpeg4-sw    | 1920   1088    30       40     244800 |
+ | vp9         | 3840   2176    60      100    1958400 |
+ | h263-sw     |  864    480    30       16      48600 |
+ | mpeg2       | 1920   1088    30       40     244800 |
+ |_____________|_______________________________________|
+
+ Secure decoder capabilities
+ (MB is defined as 16x16)
+
+ _________________________________________________
+ | Codec    |  W      H      fps    Mbps   MB/s   |
+ |__________|_____________________________________|
+ | h264     | 3840   2176    60     40    1958400 |
+ | vp9      | 3840   2176    60     40    1958400 |
+ | hevc     | 3840   2176    60     40    1958400 |
+ | mpeg2    | 1920   1088    30     40     244800 |
+ |__________|_____________________________________|
+
+
+ Non-Secure encoder capabilities (Secure not supported)
+ (MB is defined as 16x16)
+
+ _________________________________________________
+ | Codec    |  W      H      fps   Mbps    MB/s   |
+ |__________|_____________________________________|
+ | h264     | 3840   2176    30    100     979200 |
+ | hevc     | 3840   2176    30    100     979200 |
+ | mpeg4-sw |  864    480    30      8      48600 |
+ | h263-sw  |  864    480    30      2      48600 |
+ |__________|_____________________________________|
+-->
+
+<MediaCodecs>
+    <Include href="media_codecs_google_audio.xml" />
+    <Include href="media_codecs_vendor_audio.xml" />
+    <Include href="media_codecs_google_telephony.xml" />
+    <Settings>
+        <Setting name="max-video-encoder-input-buffers" value="11" />
+    </Settings>
+    <Encoders>
+        <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200"/>
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="512x512" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-512x512" value="2025" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="8192x8192" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="864x480" />
+            <Limit name="alignment" value="4x4" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="36" max="48600" />
+            <Limit name="bitrate" range="1-2000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Quirk name="requires-loaded-to-idle-after-allocation" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-8000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+       <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="1958400" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-480" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2160" value="48" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Limit name="performance-point-1280x720" value="480" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="1958400" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-4096x2160" value="48" />
+            <Limit name="performance-point-3840x2160" value="60" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="1958400" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-480" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2160" value="48" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Limit name="performance-point-1280x720" value="480" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="1958400" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-4096x2160" value="48" />
+            <Limit name="performance-point-3840x2160" value="60" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="1958400" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-480" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2160" value="48" />
+            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-1920x1080" value="240" />
+            <Limit name="performance-point-1280x720" value="480" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="1958400" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-4096x2160" value="48" />
+            <Limit name="performance-point-3840x2160" value="60" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="4x4" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-16000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Feature name="adaptive-playback" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="1920x1088" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="244800" />
+             <Limit name="bitrate" range="1-40000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+    </Decoders>
+    <Include href="media_codecs_google_video.xml" />
+</MediaCodecs>
diff --git a/conf_files/lito/media_codecs_vendor_lagoon_v1.xml b/conf_files/lito/media_codecs_vendor_lagoon_v1.xml
new file mode 100644
index 0000000..9ee2141
--- /dev/null
+++ b/conf_files/lito/media_codecs_vendor_lagoon_v1.xml
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved.
+     Not a contribution.
+     Copyright (C) 2012-2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+
+-->
+<!--
+ Non-Secure decoder capabilities
+ (MB is defined as 16x16)
+
+  ____________________________________________________
+ | Codec       |  W      H      fps     Mbps   MB/s   |
+ |_____________|______________________________________|
+ | h264        | 3840   2176    30      100    979200 |
+ | hevc        | 3840   2176    30      100    979200 |
+ | mpeg4-sw    | 1920   1088    30       40    244800 |
+ | vp9         | 3840   2176    30      100    979200 |
+ | h263-sw     |  864    480    30       16     48600 |
+ | mpeg2       | 1920   1088    30       40    244800 |
+ |_____________|______________________________________|
+
+ Secure decoder capabilities
+ (MB is defined as 16x16)
+
+ ________________________________________________
+ | Codec    |  W      H      fps    Mbps  MB/s   |
+ |__________|____________________________________|
+ | h264     | 3840   2176    30     40    979200 |
+ | vp9      | 3840   2176    30     40    979200 |
+ | hevc     | 3840   2176    30     40    979200 |
+ | mpeg2    | 1920   1088    30     40    244800 |
+ |__________|____________________________________|
+
+
+ Non-Secure encoder capabilities (Secure not supported)
+ (MB is defined as 16x16)
+
+ ________________________________________________
+ | Codec    |  W      H      fps   Mbps   MB/s   |
+ |__________|____________________________________|
+ | h264     | 3840   2176    30    100    979200 |
+ | hevc     | 3840   2176    30    100    979200 |
+ | mpeg4-sw |  864    480    30      8     48600 |
+ | h263-sw  |  864    480    30      2     48600 |
+ |__________|____________________________________|
+-->
+
+<MediaCodecs>
+    <Include href="media_codecs_google_audio.xml" />
+    <Include href="media_codecs_vendor_audio.xml" />
+    <Include href="media_codecs_google_telephony.xml" />
+    <Settings>
+        <Setting name="max-video-encoder-input-buffers" value="11" />
+    </Settings>
+    <Encoders>
+        <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200"/>
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="VBR,CBR" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="512x512" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-512x512" value="2025" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="512x512" max="8192x8192" />
+            <Limit name="frame-rate" range="1-20" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="quality" range="0-100" default="80" />
+            <Feature name="bitrate-modes" value="CQ" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Quirk name="requires-loaded-to-idle-after-allocation" />
+            <Limit name="size" min="96x96" max="864x480" />
+            <Limit name="alignment" value="4x4" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="36" max="48600" />
+            <Limit name="bitrate" range="1-2000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Quirk name="requires-loaded-to-idle-after-allocation" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-8000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="3" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+       <!-- Video Hardware  -->
+        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="60" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-30" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="6" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="60" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-100000000" />
+            <Limit name="frame-rate" range="1-240" />
+            <Feature name="adaptive-playback" />
+            <Limit name="concurrent-instances" max="16" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="120" />
+            <Limit name="performance-point-1280x720" value="240" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
+            <Quirk name="requires-allocate-on-input-ports" />
+            <Quirk name="requires-allocate-on-output-ports" />
+            <Limit name="size" min="128x128" max="4096x2176" />
+            <Limit name="alignment" value="2x2" />
+            <Limit name="block-size" value="16x16" />
+            <Limit name="blocks-per-second" min="64" max="979200" />
+            <Limit name="bitrate" range="1-40000000" />
+            <Limit name="frame-rate" range="1-60" />
+            <Feature name="adaptive-playback" />
+            <Feature name="secure-playback" required="true" />
+            <Limit name="concurrent-instances" max="3" />
+            <Limit name="performance-point-4096x2160" value="24" />
+            <Limit name="performance-point-3840x2160" value="30" />
+            <Limit name="performance-point-1920x1080" value="60" />
+        </MediaCodec>
+        <!-- Video Software -->
+        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="864x480" />
+             <Limit name="alignment" value="4x4" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="48600" />
+             <Limit name="bitrate" range="1-16000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Feature name="adaptive-playback" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-720x480" value="30" />
+        </MediaCodec>
+        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
+             <Quirk name="requires-allocate-on-input-ports" />
+             <Quirk name="requires-allocate-on-output-ports" />
+             <Limit name="size" min="96x96" max="1920x1088" />
+             <Limit name="alignment" value="2x2" />
+             <Limit name="block-size" value="16x16" />
+             <Limit name="blocks-per-second" min="36" max="244800" />
+             <Limit name="bitrate" range="1-40000000" />
+             <Limit name="frame-rate" range="1-30" />
+             <Limit name="concurrent-instances" max="4" />
+             <Limit name="performance-point-1920x1080" value="30" />
+        </MediaCodec>
+    </Decoders>
+    <Include href="media_codecs_google_video.xml" />
+</MediaCodecs>
diff --git a/conf_files/lito/system_properties.xml b/conf_files/lito/system_properties.xml
index 5b9def2..b8f0db0 100644
--- a/conf_files/lito/system_properties.xml
+++ b/conf_files/lito/system_properties.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!--
-Copyright (c) 2017,2019 The Linux Foundation. All rights reserved.
+Copyright (c) 2017,2019-2020 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -41,4 +41,5 @@
         <property name="vidc_dec_thumbnail_yuv_output" value="0"/>
         <!-- Bitmask for arb mode: 1: AVC, 2: HEVC, 4: MPEG2 -->
         <property name="vidc_dec_arb_mode_override" value="7"/>
+        <property name="vidc_enc_quality_boost_enable" value="1"/>
 </configs>
diff --git a/libplatformconfig/PlatformConfig.h b/libplatformconfig/PlatformConfig.h
index 1c32987..d758860 100644
--- a/libplatformconfig/PlatformConfig.h
+++ b/libplatformconfig/PlatformConfig.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -75,6 +75,9 @@
     vidc_enc_auto_blur_disable,
     vidc_dec_thumbnail_yuv_output,
     vidc_c2d_rotation,
+    vidc_disable_hdr,
+    vidc_enc_quality_boost_enable,
+    vidc_dec_output_rate,
 } Config_t;
 
 struct configStr {
@@ -99,6 +102,9 @@
     {vidc_enc_auto_blur_disable, "vidc_enc_auto_blur_disable"},
     {vidc_dec_thumbnail_yuv_output, "vidc_dec_thumbnail_yuv_output"},
     {vidc_c2d_rotation, "vidc_c2d_rotation"},
+    {vidc_disable_hdr, "vidc_disable_hdr"},
+    {vidc_enc_quality_boost_enable, "vidc_enc_quality_boost_enable"},
+    {vidc_dec_output_rate, "vidc_dec_output_rate"},
 };
 
 class Config {
diff --git a/mm-core/Android.mk b/mm-core/Android.mk
index cff4b16..1fb8524 100644
--- a/mm-core/Android.mk
+++ b/mm-core/Android.mk
@@ -16,8 +16,13 @@
 #             Figure out the targets
 #===============================================================================
 
-ifeq ($(filter $(TARGET_BOARD_PLATFORM), kona lito bengal),$(TARGET_BOARD_PLATFORM))
-OMXCORE_CFLAGS += -D_KONA_
+MPEGH_TARGET_LIST := kona lito bengal
+ifeq ($(call is-board-platform-in-list, $(MPEGH_TARGET_LIST)), true)
+OMXCORE_CFLAGS += -DAUDIO_MPEGH_ENABLED
+endif
+
+ifeq ($(filter $(TARGET_BOARD_PLATFORM), bengal),$(TARGET_BOARD_PLATFORM))
+OMXCORE_CFLAGS += -D_BENGAL_
 else ifeq ($(filter $(TARGET_BOARD_PLATFORM), $(MSMSTEPPE)),$(TARGET_BOARD_PLATFORM))
 OMXCORE_CFLAGS += -D_STEPPE_
 else
diff --git a/mm-core/inc/OMX_QCOMExtns.h b/mm-core/inc/OMX_QCOMExtns.h
index 4298213..f2b7c03 100644
--- a/mm-core/inc/OMX_QCOMExtns.h
+++ b/mm-core/inc/OMX_QCOMExtns.h
@@ -696,6 +696,9 @@
 
     /*"OMX.google.android.index.describeHDR10PlusInfo"*/
     OMX_QTIIndexConfigDescribeHDR10PlusInfo = 0x7F100008,
+
+    /* Configure Bitrate Savings (CAC) */
+    OMX_QTIIndexConfigContentAdaptiveCoding = 0x7F100009,
 };
 
 /**
diff --git a/mm-core/src/registry_table.c b/mm-core/src/registry_table.c
index ec1c202..8ec43ef 100644
--- a/mm-core/src/registry_table.c
+++ b/mm-core/src/registry_table.c
@@ -43,10 +43,8 @@
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.avc", "libOmxVdec.so", "video_decoder.avc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.avc.dsmode", "libOmxVideoDSMode.so", "video_decoder.avc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.hevc", "libOmxVdec.so", "video_decoder.hevc"),
-    OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.vp8", "libOmxVdec.so", "video_decoder.vp8"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.vp9", "libOmxVdec.so", "video_decoder.vp9"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.avc", "libOmxVenc.so", "video_encoder.avc"),
-    OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.vp8", "libOmxVenc.so", "video_encoder.vp8"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.hevc", "libOmxVenc.so", "video_encoder.hevc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.hevc.cq", "libOmxVenc.so", "video_encoder.hevc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.heic", "libOmxVenc.so", "image_encoder.heic"),
diff --git a/mm-core/src/registry_table_android.c b/mm-core/src/registry_table_android.c
index ff22f00..279e297 100644
--- a/mm-core/src/registry_table_android.c
+++ b/mm-core/src/registry_table_android.c
@@ -44,12 +44,10 @@
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.avc.secure", "libOmxVdec.so", "video_decoder.avc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.hevc", "libOmxVdec.so", "video_decoder.hevc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.hevc.secure", "libOmxVdec.so", "video_decoder.hevc"),
-    OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.vp8", "libOmxVdec.so", "video_decoder.vp8"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.vp9", "libOmxVdec.so", "video_decoder.vp9"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.decoder.vp9.secure", "libOmxVdec.so", "video_decoder.vp9"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.avc", "libOmxVenc.so", "video_encoder.avc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.avc.secure", "libOmxVenc.so", "video_encoder.avc"),
-    OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.vp8", "libOmxVenc.so", "video_encoder.vp8"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.hevc", "libOmxVenc.so", "video_encoder.hevc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.hevc.cq", "libOmxVenc.so", "video_encoder.hevc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.video.encoder.hevc.secure", "libOmxVenc.so", "video_encoder.hevc"),
diff --git a/mm-video-v4l2/vidc/common/Android.mk b/mm-video-v4l2/vidc/common/Android.mk
index 034c234..724e2ae 100644
--- a/mm-video-v4l2/vidc/common/Android.mk
+++ b/mm-video-v4l2/vidc/common/Android.mk
@@ -16,6 +16,10 @@
 libmm-vidc-def += -Werror
 libmm-vidc-def += -D_ANDROID_ICS_
 
+ifeq ($(TARGET_USES_ION),true)
+libmm-vidc-def += -DUSE_ION
+endif
+
 # ---------------------------------------------------------------------------------
 # 			Make the Shared library (libOmxVidcCommon)
 # ---------------------------------------------------------------------------------
diff --git a/mm-video-v4l2/vidc/common/inc/vidc_common.h b/mm-video-v4l2/vidc/common/inc/vidc_common.h
index 2cabbf9..8035328 100644
--- a/mm-video-v4l2/vidc/common/inc/vidc_common.h
+++ b/mm-video-v4l2/vidc/common/inc/vidc_common.h
@@ -33,6 +33,7 @@
 #include <unordered_map>
 
 #include "OMX_QCOMExtns.h"
+#include <linux/dma-buf.h>
 #ifdef _ANDROID_
 #include <gralloc_priv.h>
 #endif
@@ -101,4 +102,56 @@
 void get_gralloc_format_as_string(char * buf, int buf_len, int format);
 void get_v4l2_color_format_as_string(char * buf, int buf_len, unsigned long v4l2Pixformat);
 
+void do_sync_ioctl(int fd, struct dma_buf_sync* sync);
+
+static inline void sync_start_write(int fd) {
+    struct dma_buf_sync sync = {0};
+    sync.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_WRITE;
+    do_sync_ioctl(fd, &sync);
+}
+
+static inline void sync_end_write(int fd) {
+    struct dma_buf_sync sync = {0};
+    sync.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_WRITE;
+    do_sync_ioctl(fd, &sync);
+}
+
+static inline void sync_start_read(int fd) {
+    struct dma_buf_sync sync = {0};
+    sync.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_READ;
+    do_sync_ioctl(fd, &sync);
+}
+
+static inline void sync_end_read(int fd) {
+    struct dma_buf_sync sync = {0};
+    sync.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_READ;
+    do_sync_ioctl(fd, &sync);
+}
+
+static inline void sync_start_rw(int fd) {
+    struct dma_buf_sync sync = {0};
+    sync.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
+    do_sync_ioctl(fd, &sync);
+}
+
+static inline void sync_end_rw(int fd) {
+    struct dma_buf_sync sync = {0};
+    sync.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
+    do_sync_ioctl(fd, &sync);
+}
+
+static inline void cache_clean(int fd) {
+    sync_start_write(fd);
+    sync_end_write(fd);
+}
+
+static inline void cache_invalidate(int fd) {
+    sync_start_write(fd);
+    sync_end_read(fd);
+}
+
+static inline void cache_clean_invalidate(int fd) {
+    sync_start_rw(fd);
+    sync_end_rw(fd);
+}
 #endif // __VIDC_COMMON_H__
diff --git a/mm-video-v4l2/vidc/common/src/vidc_common.cpp b/mm-video-v4l2/vidc/common/src/vidc_common.cpp
index 0953f6b..d4d6d66 100644
--- a/mm-video-v4l2/vidc/common/src/vidc_common.cpp
+++ b/mm-video-v4l2/vidc/common/src/vidc_common.cpp
@@ -410,3 +410,15 @@
     filledLen(filledLen),
     timeStamp(timeStamp) {
 }
+
+void do_sync_ioctl(int fd, struct dma_buf_sync* sync) {
+#ifdef USE_ION
+    int rc = ioctl(fd, DMA_BUF_IOCTL_SYNC, sync);
+    if (rc < 0) {
+        DEBUG_PRINT_ERROR("Failed DMA_BUF_IOCTL_SYNC");
+        return;
+    }
+#else
+    (void)fd, (void)sync;
+#endif
+}
diff --git a/mm-video-v4l2/vidc/vdec/Android.mk b/mm-video-v4l2/vidc/vdec/Android.mk
index 6a9e208..a6c6c4f 100644
--- a/mm-video-v4l2/vidc/vdec/Android.mk
+++ b/mm-video-v4l2/vidc/vdec/Android.mk
@@ -171,6 +171,7 @@
 LOCAL_ADDITIONAL_DEPENDENCIES := $(libmm-vdec-add-dep)
 
 LOCAL_PRELINK_MODULE          := false
+LOCAL_STATIC_LIBRARIES        := libOmxVidcCommon
 LOCAL_SHARED_LIBRARIES        := liblog libcutils libc2dcolorconvert libion
 LOCAL_SHARED_LIBRARIES        += libswvdec
 
diff --git a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
index 539ce60..9fbe6db 100644
--- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
+++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
@@ -885,7 +885,6 @@
 #ifdef USE_ION
         bool alloc_map_ion_memory(OMX_U32 buffer_size, vdec_ion *ion_info, int flag);
         void free_ion_memory(struct vdec_ion *buf_ion_info);
-        void do_cache_operations(int fd);
 #endif
 
 #ifdef USE_GBM
@@ -1002,6 +1001,7 @@
         ts_arr_list           m_timestamp_list;
 #endif
 
+        char m_platform_name[PROPERTY_VALUE_MAX] = {0};
         bool input_flush_progress;
         bool output_flush_progress;
         bool input_use_buffer;
@@ -1061,8 +1061,6 @@
         OMX_U32 m_disp_hor_size;
         OMX_U32 m_disp_vert_size;
         OMX_S64 prev_ts;
-        OMX_S64 prev_ts_actual;
-        bool rst_prev_ts;
         OMX_U32 frm_int;
         OMX_U32 m_fps_received;
 
@@ -1091,6 +1089,7 @@
         };
         meta_buffer meta_buff;
         OMX_PARAM_PORTDEFINITIONTYPE m_port_def;
+        omx_time_stamp_reorder time_stamp_dts;
         desc_buffer_hdr *m_desc_buffer_ptr;
         bool secure_mode;
         bool allocate_native_handle;
@@ -1207,6 +1206,8 @@
         int32_t m_dec_secure_prefetch_size_internal;
         int32_t m_dec_secure_prefetch_size_output;
         int32_t m_arb_mode_override;
+        int32_t m_disable_hdr;
+        int32_t m_dec_output_rate;
         volatile int32_t m_queued_codec_config_count;
         OMX_U32 current_perf_level;
         int32_t m_thumbnail_yuv_output;
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp b/mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp
index 8af50ad..fcf7626 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp
@@ -1,7 +1,7 @@
 /**
  * @copyright
  *
- *   Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
+ *   Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions are met:
@@ -50,6 +50,7 @@
 #include "omx_swvdec.h"
 
 #include "swvdec_api.h"
+#include "vidc_common.h"
 
 static unsigned int split_buffer_mpeg4(unsigned int         *offset_array,
                                        OMX_BUFFERHEADERTYPE *p_buffer_hdr);
@@ -3530,7 +3531,9 @@
 
         if (m_sync_frame_decoding_mode)
         {
-            p_buffer_req->mincount = 1;
+            /* Content for which low delay is 0 for ex: XVID clips
+               minimum two buffers are required to generate thumbnail */
+            p_buffer_req->mincount = 2;
         }
 
         m_port_op.def.nBufferSize        = p_buffer_req->size;
@@ -4794,33 +4797,10 @@
 void omx_swvdec::ion_flush_op(unsigned int index)
 {
     if (index < m_port_op.def.nBufferCountActual)
-    {
-#ifdef USE_ION
-        struct dma_buf_sync dma_buf_sync_data[2];
-        dma_buf_sync_data[0].flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_WRITE;
-        dma_buf_sync_data[1].flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_WRITE;
-
-        for (unsigned int i=0; i<2; i++)
-        {
-            int ret = ioctl(m_buffer_array_op[index].buffer_swvdec.fd,
-                      DMA_BUF_IOCTL_SYNC, &dma_buf_sync_data[i]);
-            if (ret < 0)
-            {
-                OMX_SWVDEC_LOG_ERROR("Cache %s failed for fd %d : %s\n",
-                                  (i==0) ? "START" : "END",
-                                  m_buffer_array_op[index].buffer_swvdec.fd,
-                                  strerror(errno));
-                goto ion_flush_op_exit;
-            }
-       }
-#endif
-    }
+        cache_clean_invalidate(m_buffer_array_op[index].buffer_swvdec.fd);
     else
-    {
         OMX_SWVDEC_LOG_ERROR("buffer index '%d' invalid", index);
-    }
 
-ion_flush_op_exit:
     return;
 }
 
@@ -4840,9 +4820,17 @@
 {
     unsigned long index = (unsigned long) p_buffer_ip->p_client_data;
 
-    m_buffer_array_ip[index].buffer_header.nFilledLen =
-        p_buffer_ip->filled_length;
-
+    if (m_arbitrary_bytes_mode)
+    {
+        if (!m_buffer_array_ip[index].split_count)
+        {
+            m_buffer_array_ip[index].buffer_header.nFilledLen =
+                p_buffer_ip->filled_length;
+        }
+    }
+    else
+        m_buffer_array_ip[index].buffer_header.nFilledLen =
+            p_buffer_ip->filled_length;
     async_post_event(OMX_SWVDEC_EVENT_EBD,
                      (unsigned long) &m_buffer_array_ip[index].buffer_header,
                      index);
@@ -6521,7 +6509,7 @@
 
 /**
  * @brief Map the memory and run the ioctl SYNC operations
- *.on ION fd with DMA_BUF_IOCTL_SYNC
+ *.on ION fd
  *.@param[in] fd: ION header.
  * @param[in] len:Lenth of the memory.
  * @retval mapped memory pointer
@@ -6530,16 +6518,8 @@
 {
     unsigned char *bufaddr = (unsigned char*)mmap(NULL, len, PROT_READ|PROT_WRITE,
                                 MAP_SHARED, fd, 0);
-    if (bufaddr != MAP_FAILED) {
-#ifdef USE_ION
-        struct dma_buf_sync buf_sync;
-        buf_sync.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
-        int rc = ioctl(fd, DMA_BUF_IOCTL_SYNC, &buf_sync);
-        if (rc) {
-            OMX_SWVDEC_LOG_ERROR("Failed DMA_BUF_IOCTL_SYNC");
-        }
-#endif
-    }
+    if (bufaddr != MAP_FAILED)
+        cache_clean_invalidate(fd);
     return bufaddr;
 }
 
@@ -6552,14 +6532,7 @@
  */
 OMX_ERRORTYPE omx_swvdec::ion_unmap(int fd, void *bufaddr, int len)
 {
-#ifdef USE_ION
-    struct dma_buf_sync buf_sync;
-    buf_sync.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
-    int rc = ioctl(fd, DMA_BUF_IOCTL_SYNC, &buf_sync);
-    if (rc) {
-        OMX_SWVDEC_LOG_ERROR("Failed DMA_BUF_IOCTL_SYNC");
-    }
-#endif
+    cache_clean_invalidate(fd);
     if (-1 == munmap(bufaddr, len)) {
         OMX_SWVDEC_LOG_ERROR("munmap failed.");
         return OMX_ErrorInsufficientResources;
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
index 1b972c2..eb0db84 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -137,6 +137,7 @@
 as 0. This disables sending metadata via gralloc handle.
 */
 #define HDR10_SETMETADATA_ENABLE 0
+#define DEC_HDR_DISABLE_FLAG 0x1
 
 #define THUMBNAIL_YUV420P_8BIT 0x01
 #define THUMBNAIL_YUV420P_10BIT 0x02
@@ -568,8 +569,6 @@
     m_disp_hor_size(0),
     m_disp_vert_size(0),
     prev_ts(LLONG_MAX),
-    prev_ts_actual(LLONG_MAX),
-    rst_prev_ts(true),
     frm_int(0),
     m_fps_received(0),
     in_reconfig(false),
@@ -645,6 +644,12 @@
     Platform::Config::getInt32(Platform::vidc_dec_thumbnail_yuv_output,
             (int32_t *)&m_thumbnail_yuv_output, 0);
 
+    Platform::Config::getInt32(Platform::vidc_disable_hdr,
+            (int32_t *)&m_disable_hdr, 0);
+
+    Platform::Config::getInt32(Platform::vidc_dec_output_rate,
+            (int32_t *)&m_dec_output_rate, 60);
+
     property_value[0] = '\0';
     property_get("vendor.vidc.dec.log.in", property_value, "0");
     m_debug.in_buffer_log |= atoi(property_value);
@@ -1045,11 +1050,21 @@
                     break;
 
                 case OMX_COMPONENT_GENERATE_EBD:
-
                     if (p2 != VDEC_S_SUCCESS && p2 != VDEC_S_INPUT_BITSTREAM_ERR) {
                         DEBUG_PRINT_ERROR("OMX_COMPONENT_GENERATE_EBD failure");
                         pThis->omx_report_error ();
                     } else {
+                        if (p2 == VDEC_S_INPUT_BITSTREAM_ERR && p1) {
+                            OMX_BUFFERHEADERTYPE* buffer =
+                                    ((OMX_BUFFERHEADERTYPE *)(intptr_t)p1);
+                            if (!buffer->pMarkData && !buffer->hMarkTargetComponent) {
+                                pThis->time_stamp_dts.remove_time_stamp(
+                                        buffer->nTimeStamp,
+                                        (pThis->drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
+                                        ?true:false);
+                            }
+                        }
+
                         if ( pThis->empty_buffer_done(&pThis->m_cmp,
                                     (OMX_BUFFERHEADERTYPE *)(intptr_t)p1) != OMX_ErrorNone) {
                             DEBUG_PRINT_ERROR("empty_buffer_done failure");
@@ -1058,41 +1073,36 @@
                     }
                     break;
                 case OMX_COMPONENT_GENERATE_FBD:
-                                        if (p2 != VDEC_S_SUCCESS) {
-                                            DEBUG_PRINT_ERROR("OMX_COMPONENT_GENERATE_FBD failure");
-                                            pThis->omx_report_error ();
-                                            break;
-                                        }
-                                        if (pThis->fill_buffer_done(&pThis->m_cmp,
-                                                    (OMX_BUFFERHEADERTYPE *)(intptr_t)p1) != OMX_ErrorNone ) {
-                                            DEBUG_PRINT_ERROR("fill_buffer_done failure");
-                                            pThis->omx_report_error ();
-                                            break;
-                                        }
+                    if (p2 != VDEC_S_SUCCESS) {
+                        DEBUG_PRINT_ERROR("OMX_COMPONENT_GENERATE_FBD failure");
+                        pThis->omx_report_error ();
+                        break;
+                    }
 #if !HDR10_SETMETADATA_ENABLE
-                                        if (pThis->output_capability != V4L2_PIX_FMT_VP9 &&
-                                            pThis->output_capability != V4L2_PIX_FMT_HEVC)
-                                            break;
-
-                                        if (!pThis->m_cb.EventHandler) {
-                                            DEBUG_PRINT_ERROR("fill_buffer_done: null event handler");
-                                            break;
-                                        }
-                                        bool is_list_empty;
-                                        is_list_empty = false;
-                                        pthread_mutex_lock(&pThis->m_hdr10pluslock);
-                                        is_list_empty = pThis->m_hdr10pluslist.empty();
-                                        pthread_mutex_unlock(&pThis->m_hdr10pluslock);
-                                        if (!is_list_empty) {
-                                            DEBUG_PRINT_LOW("fill_buffer_done: event config update");
-                                            pThis->m_cb.EventHandler(&pThis->m_cmp,
-                                                    pThis->m_app_data,
-                                                    OMX_EventConfigUpdate,
-                                                    OMX_CORE_OUTPUT_PORT_INDEX,
-                                                    OMX_QTIIndexConfigDescribeHDR10PlusInfo, NULL);
-                                        }
+                    if (pThis->m_cb.EventHandler) {
+                        OMX_BUFFERHEADERTYPE * buffer = (OMX_BUFFERHEADERTYPE *)(intptr_t)p1;
+                        if (buffer->nFilledLen && (pThis->output_capability == V4L2_PIX_FMT_HEVC ||
+                            (pThis->output_capability == V4L2_PIX_FMT_VP9 && buffer->pMarkData))) {
+                           bool is_list_empty;
+                           is_list_empty = false;
+                           pthread_mutex_lock(&pThis->m_hdr10pluslock);
+                           is_list_empty = pThis->m_hdr10pluslist.empty();
+                           pthread_mutex_unlock(&pThis->m_hdr10pluslock);
+                           if (!is_list_empty) {
+                               DEBUG_PRINT_LOW("fill_buffer_done: event config update");
+                               pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
+                                       OMX_EventConfigUpdate, OMX_CORE_OUTPUT_PORT_INDEX,
+                                       OMX_QTIIndexConfigDescribeHDR10PlusInfo, NULL);
+                           }
+                        }
+                    }
 #endif
-                                        break;
+                    if (pThis->fill_buffer_done(&pThis->m_cmp,
+                               (OMX_BUFFERHEADERTYPE *)(intptr_t)p1) != OMX_ErrorNone ) {
+                        DEBUG_PRINT_ERROR("fill_buffer_done failure");
+                        pThis->omx_report_error ();
+                    }
+                    break;
 
                 case OMX_COMPONENT_GENERATE_EVENT_INPUT_FLUSH:
                                         DEBUG_PRINT_HIGH("Driver flush i/p Port complete, flags %#llx",
@@ -1400,7 +1410,6 @@
                                             DEBUG_PRINT_ERROR("ERROR: %s()::EventHandler is NULL", __func__);
                                         }
                                         pThis->prev_ts = LLONG_MAX;
-                                        pThis->rst_prev_ts = true;
                                         break;
 
                 case OMX_COMPONENT_GENERATE_HARDWARE_ERROR:
@@ -1469,11 +1478,7 @@
     if (!m_debug.in_buffer_log)
         return 0;
 
-#ifdef USE_ION
-    do_cache_operations(fd);
-#else
-    (void)fd;
-#endif
+    sync_start_read(fd);
     if (m_debug.in_buffer_log && !m_debug.infile) {
         if(!strncmp(drv_ctx.kind,"OMX.qcom.video.decoder.mpeg2", OMX_MAX_STRINGNAME_SIZE)) {
                 snprintf(m_debug.infile_name, OMX_MAX_STRINGNAME_SIZE, "%s/input_dec_%d_%d_%p_%" PRId64 ".mpg", m_debug.log_loc,
@@ -1499,9 +1504,7 @@
             DEBUG_PRINT_HIGH("Failed to open input file: %s for logging (%d:%s)",
                              m_debug.infile_name, errno, strerror(errno));
             m_debug.infile_name[0] = '\0';
-#ifdef USE_ION
-            do_cache_operations(fd);
-#endif
+            sync_end_read(fd);
             return -1;
         }
         if (!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.vp8", OMX_MAX_STRINGNAME_SIZE) ||
@@ -1523,18 +1526,21 @@
         }
         fwrite(buffer_addr, buffer_len, 1, m_debug.infile);
     }
-#ifdef USE_ION
-    do_cache_operations(fd);
-#endif
+    sync_end_read(fd);
     return 0;
 }
 
 int omx_vdec::log_cc_output_buffers(OMX_BUFFERHEADERTYPE *buffer)
 {
+    vdec_bufferpayload *vdec_buf = NULL;
+    int index = 0;
     if (client_buffers.client_buffers_invalid() ||
         !m_debug.out_cc_buffer_log || !buffer || !buffer->nFilledLen)
         return 0;
 
+    index = buffer - m_out_mem_ptr;
+    vdec_buf = &drv_ctx.ptr_outputbuffer[index];
+    sync_start_read(vdec_buf->pmem_fd);
     if (m_debug.out_cc_buffer_log && !m_debug.ccoutfile) {
         snprintf(m_debug.ccoutfile_name, OMX_MAX_STRINGNAME_SIZE, "%s/output_cc_%d_%d_%p_%" PRId64 "_%d.yuv",
                 m_debug.log_loc, drv_ctx.video_resolution.frame_width, drv_ctx.video_resolution.frame_height, this,
@@ -1549,6 +1555,7 @@
     }
 
     fwrite(buffer->pBuffer, buffer->nFilledLen, 1, m_debug.ccoutfile);
+    sync_end_read(vdec_buf->pmem_fd);
     return 0;
 }
 
@@ -1774,10 +1781,9 @@
     struct v4l2_control ctrl[2];
     int conceal_color_8bit = 0, conceal_color_10bit = 0;
 
+    property_get("ro.board.platform", m_platform_name, "0");
 #ifdef _ANDROID_
-    char platform_name[PROPERTY_VALUE_MAX];
-    property_get("ro.board.platform", platform_name, "0");
-    if (!strncmp(platform_name, "msm8610", 7)) {
+    if (!strncmp(m_platform_name, "msm8610", 7)) {
         device_name = (OMX_STRING)"/dev/video/q6_dec";
     }
 #endif
@@ -1855,6 +1861,15 @@
         eCompressionFormat = (OMX_VIDEO_CODINGTYPE)QOMX_VIDEO_CodingHevc;
     } else if (!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.vp8",    \
                 OMX_MAX_STRINGNAME_SIZE)) {
+        char version[PROP_VALUE_MAX] = {0};
+        if (!strncmp(m_platform_name, "lito", 4))
+            if (property_get("vendor.media.target.version", version, "0") &&
+                    ((atoi(version) == 2) || (atoi(version) == 3))) {
+                //sku version, VP8 is disabled on lagoon
+                DEBUG_PRINT_ERROR("VP8 unsupported on lagoon");
+                eRet = OMX_ErrorInvalidComponentName;
+                return eRet;
+            }
         strlcpy((char *)m_cRole, "video_decoder.vp8",OMX_MAX_STRINGNAME_SIZE);
         drv_ctx.decoder_format = VDEC_CODECTYPE_VP8;
         output_capability = V4L2_PIX_FMT_VP8;
@@ -2729,11 +2744,11 @@
             empty_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p1);
         }
     }
+    time_stamp_dts.flush_timestamp();
     /*Check if Heap Buffers are to be flushed*/
     pthread_mutex_unlock(&m_lock);
     input_flush_progress = false;
     prev_ts = LLONG_MAX;
-    rst_prev_ts = true;
 
     DEBUG_PRINT_HIGH("OMX flush i/p Port complete PenBuf(%d)", pending_input_buffers);
     return bRet;
@@ -2852,6 +2867,7 @@
 OMX_ERRORTYPE omx_vdec::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVELTYPE *profileLevelType)
 {
     OMX_ERRORTYPE eRet = OMX_ErrorNone;
+    bool hdr_supported = true;
     struct v4l2_queryctrl profile_cap, level_cap, tier_cap;
     int v4l2_profile;
     int avc_profiles[5] = { QOMX_VIDEO_AVCProfileConstrainedBaseline,
@@ -2990,6 +3006,22 @@
         DEBUG_PRINT_ERROR("%s: Invalid index corresponding profile not supported : %d ",__FUNCTION__, profileLevelType->eProfile);
         eRet = OMX_ErrorNoMore;
     }
+    if (m_disable_hdr & DEC_HDR_DISABLE_FLAG) {
+        if (output_capability == V4L2_PIX_FMT_VP9) {
+            if (profileLevelType->eProfile == OMX_VIDEO_VP9Profile2HDR || profileLevelType->eProfile == OMX_VIDEO_VP9Profile2HDR10Plus)
+                hdr_supported = false;
+        }
+        if (output_capability == V4L2_PIX_FMT_HEVC) {
+            if (profileLevelType->eProfile == OMX_VIDEO_HEVCProfileMain10 || profileLevelType->eProfile == OMX_VIDEO_HEVCProfileMain10HDR10
+            || profileLevelType->eProfile == OMX_VIDEO_HEVCProfileMain10HDR10Plus) {
+                hdr_supported = false;
+            }
+        }
+        if (!hdr_supported) {
+            DEBUG_PRINT_LOW("%s: HDR profile unsupported", __FUNCTION__);
+            return OMX_ErrorHardware;
+        }
+    }
 
     DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported for Input port returned Profile:%u, Level:%u",
             (unsigned int)profileLevelType->eProfile, (unsigned int)profileLevelType->eLevel);
@@ -3240,6 +3272,9 @@
         control.id = V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE;
         control.value = rate->nU32;
 
+        if (rate->nU32 > INT_MAX)
+            control.value = INT_MAX;
+
         if (ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
             ret = errno == EBUSY ? OMX_ErrorInsufficientResources :
                     OMX_ErrorUnsupportedSetting;
@@ -3424,7 +3459,7 @@
 
    DESCRIPTION
    Map the memory and run the ioctl SYNC operations
-   on ION fd with DMA_BUF_IOCTL_SYNC
+   on ION fd
 
    PARAMETERS
    fd    : ION fd
@@ -3438,11 +3473,8 @@
 {
     char *bufaddr = (char*)mmap(NULL, len, PROT_READ|PROT_WRITE,
                                 MAP_SHARED, fd, 0);
-    if (bufaddr != MAP_FAILED) {
-#ifdef USE_ION
-    do_cache_operations(fd);
-#endif
-    }
+    if (bufaddr != MAP_FAILED)
+        cache_clean_invalidate(fd);
     return bufaddr;
 }
 
@@ -3464,11 +3496,7 @@
    ========================================================================== */
 OMX_ERRORTYPE omx_vdec::ion_unmap(int fd, void *bufaddr, int len)
 {
-#ifdef USE_ION
-    do_cache_operations(fd);
-#else
-    (void)fd;
-#endif
+    cache_clean_invalidate(fd);
     if (-1 == munmap(bufaddr, len)) {
         DEBUG_PRINT_ERROR("munmap failed.");
         return OMX_ErrorInsufficientResources;
@@ -4999,6 +5027,7 @@
     buffer->pMarkData = (OMX_PTR)(unsigned long)m_etb_count;
     post_event ((unsigned long)hComp,(unsigned long)buffer,OMX_COMPONENT_GENERATE_ETB);
 
+    time_stamp_dts.insert_timestamp(buffer);
     return OMX_ErrorNone;
 }
 
@@ -6091,6 +6120,20 @@
     }
 #endif
 
+    /* For use buffer we need to copy the data */
+    if (!output_flush_progress) {
+        /* This is the error check for non-recoverable errros */
+        bool is_duplicate_ts_valid = true;
+        bool is_interlaced = (drv_ctx.interlace != VDEC_InterlaceFrameProgressive);
+
+        if (output_capability == V4L2_PIX_FMT_MPEG4 ||
+                output_capability == V4L2_PIX_FMT_MPEG2)
+            is_duplicate_ts_valid = false;
+
+        time_stamp_dts.get_next_timestamp(buffer,
+                is_interlaced && is_duplicate_ts_valid && !is_mbaff);
+
+    }
     VIDC_TRACE_INT_LOW("FBD-TS", buffer->nTimeStamp / 1000);
 
     if (m_cb.FillBufferDone) {
@@ -6118,7 +6161,6 @@
         }
         if (buffer->nFlags & OMX_BUFFERFLAG_EOS) {
             prev_ts = LLONG_MAX;
-            rst_prev_ts = true;
             proc_frms = 0;
         }
 
@@ -6423,6 +6465,9 @@
                        omxhdr->nFlags |= QOMX_VIDEO_BUFFERFLAG_BFRAME;
                    }
 
+                   if (v4l2_buf_ptr->flags & V4L2_BUF_FLAG_CODECCONFIG)
+                       omxhdr->nFlags |= OMX_BUFFERFLAG_CODECCONFIG;
+
                    if (vdec_msg->msgdata.output_frame.len) {
                        DEBUG_PRINT_LOW("Processing extradata");
                        reconfig_event_sent = omx->handle_extradata(omxhdr);
@@ -6712,24 +6757,6 @@
     }
 }
 
-void omx_vdec::do_cache_operations(int fd)
-{
-    if (fd < 0)
-        return;
-
-    struct dma_buf_sync dma_buf_sync_data[2];
-    dma_buf_sync_data[0].flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
-    dma_buf_sync_data[1].flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
-
-    for(unsigned int i=0; i<2; i++) {
-        int rc = ioctl(fd, DMA_BUF_IOCTL_SYNC, &dma_buf_sync_data[i]);
-        if (rc < 0) {
-            DEBUG_PRINT_ERROR("Failed DMA_BUF_IOCTL_SYNC %s fd : %d", i==0?"start":"end", fd);
-            return;
-        }
-    }
-}
-
 #endif
 void omx_vdec::free_output_buffer_header(bool intermediate)
 {
@@ -7481,8 +7508,7 @@
     OMX_U32 new_frame_interval = 0;
     if (VALID_TS(act_timestamp) && VALID_TS(prev_ts) && act_timestamp != prev_ts
             && (llabs(act_timestamp - prev_ts) > 2000 || frm_int == 0)) {
-        new_frame_interval = client_set_fps ? frm_int : (act_timestamp - prev_ts) > 0 ?
-            llabs(act_timestamp - prev_ts) : llabs(act_timestamp - prev_ts_actual);
+        new_frame_interval = client_set_fps ? frm_int : llabs(act_timestamp - prev_ts);
         if (new_frame_interval != frm_int || frm_int == 0) {
             frm_int = new_frame_interval;
             if (frm_int) {
@@ -7883,6 +7909,11 @@
     const ColorAspects &defaultColor = preferClientColor ?
         m_internal_color_space.sAspects : m_client_color_space.sAspects;
 
+    if ((m_client_color_space.sAspects.mPrimaries == ColorAspects::PrimariesBT2020) && (dpb_bit_depth == MSM_VIDC_BIT_DEPTH_8)) {
+        m_client_color_space.sAspects.mPrimaries = ColorAspects::PrimariesBT709_5;
+        m_client_color_space.sAspects.mMatrixCoeffs = ColorAspects::MatrixBT709_5;
+    }
+
     preferredColorAspects.mPrimaries = preferredColor.mPrimaries != ColorAspects::PrimariesUnspecified ?
         preferredColor.mPrimaries : defaultColor.mPrimaries;
     preferredColorAspects.mTransfer = preferredColor.mTransfer != ColorAspects::TransferUnspecified ?
@@ -7983,6 +8014,7 @@
     m_extradata_misr.output_crop_updated = OMX_FALSE;
     data = (struct OMX_OTHER_EXTRADATATYPE *)p_extradata;
     if (data) {
+        bool is_hdr10_plus_info_found = false;
         while ((((consumed_len + sizeof(struct OMX_OTHER_EXTRADATATYPE)) <
                 drv_ctx.extradata_info.buffer_size) && ((consumed_len + data->nSize) <
                 drv_ctx.extradata_info.buffer_size))
@@ -8099,7 +8131,10 @@
                             memcpy(color_mdata.dynamicMetaDataPayload, userdata_payload->data, payload_len);
                             DEBUG_PRINT_HIGH("Copied %u bytes of HDR10+ extradata", payload_len);
 #else
-                            store_hevc_hdr10plusinfo(payload_len, userdata_payload);
+                            if(!is_hdr10_plus_info_found) {
+                               store_hevc_hdr10plusinfo(payload_len, userdata_payload);
+                               is_hdr10_plus_info_found = true;
+                            }
 #endif
                         }
                     }
@@ -8407,6 +8442,7 @@
     unsigned int src_size = 0, destination_size = 0;
     unsigned int height, width;
     struct v4l2_format fmt;
+    bool is_interlaced = false;
     OMX_COLOR_FORMATTYPE drv_color_format;
 
     if (!omx) {
@@ -8439,7 +8475,8 @@
 
     bool resolution_upgrade = (height > m_c2d_height ||
             width > m_c2d_width);
-    bool is_interlaced = omx->m_progressive != MSM_VIDC_PIC_STRUCT_PROGRESSIVE;
+    if (omx->drv_ctx.output_format != VDEC_YUV_FORMAT_NV12)
+        is_interlaced = omx->m_progressive != MSM_VIDC_PIC_STRUCT_PROGRESSIVE;
     if (resolution_upgrade) {
         // resolution upgraded ? ensure we are yet to allocate;
         // failing which, c2d buffers will never be reallocated and bad things will happen
@@ -8587,16 +8624,16 @@
         bool status = false;
         if (!omx->in_reconfig && !omx->output_flush_progress && bufadd->nFilledLen) {
             pthread_mutex_lock(&omx->c_lock);
-            omx->do_cache_operations(omx->drv_ctx.op_intermediate_buf_ion_info[index].data_fd);
 
             DEBUG_PRINT_INFO("C2D: Start color convertion");
+            cache_invalidate(omx->drv_ctx.ptr_outputbuffer[index].pmem_fd);
             status = c2dcc.convertC2D(
                              omx->drv_ctx.ptr_intermediate_outputbuffer[index].pmem_fd,
                              bufadd->pBuffer, bufadd->pBuffer,
                              omx->drv_ctx.ptr_outputbuffer[index].pmem_fd,
                              omx->m_out_mem_ptr[index].pBuffer,
                              omx->m_out_mem_ptr[index].pBuffer);
-            omx->do_cache_operations(omx->drv_ctx.op_intermediate_buf_ion_info[index].data_fd);
+            cache_invalidate(omx->drv_ctx.ptr_outputbuffer[index].pmem_fd);
             if (!status) {
                 DEBUG_PRINT_ERROR("Failed color conversion %d", status);
                 m_out_mem_ptr_client[index].nFilledLen = 0;
@@ -9071,7 +9108,7 @@
     memset(&metadata, 0, sizeof(struct hdr10plusInfo));
     metadata.nParamSizeUsed = payload_size;
     memcpy(metadata.payload, hdr10plusdata->data , payload_size);
-    metadata.is_new = true;
+    metadata.is_new = false;
     if (m_etb_count) {
         metadata.timestamp = m_etb_timestamp + 1;
     }
@@ -9220,7 +9257,6 @@
 
 void omx_vdec::get_hdr10plusinfo(DescribeHDR10PlusInfoParams *hdr10plusdata)
 {
-    std::list<hdr10plusInfo>::iterator iter;
     bool is_list_empty = false;
 
     if (output_capability != V4L2_PIX_FMT_VP9 &&
@@ -9237,19 +9273,12 @@
     }
 
     pthread_mutex_lock(&m_hdr10pluslock);
-    iter = m_hdr10pluslist.begin();
-    while (iter != m_hdr10pluslist.end()) {
-        if (!iter->is_new) {
-            hdr10plusdata->nParamSizeUsed = iter->nParamSizeUsed;
-            memcpy(hdr10plusdata->nValue, iter->payload,
-                iter->nParamSizeUsed);
-            DEBUG_PRINT_LOW("found hdr10plus metadata with timestamp %lld, size %u",
-                iter->timestamp, iter->nParamSizeUsed);
-            iter = m_hdr10pluslist.erase(iter);
-            break;
-        }
-        iter++;
-    }
+    hdr10plusInfo item = m_hdr10pluslist.front();
+    hdr10plusdata->nParamSizeUsed = item.nParamSizeUsed;
+    memcpy(hdr10plusdata->nValue, item.payload,item.nParamSizeUsed);
+    DEBUG_PRINT_LOW("found hdr10plus metadata with timestamp %lld, size %u",
+        item.timestamp, item.nParamSizeUsed);
+    m_hdr10pluslist.pop_front();
     pthread_mutex_unlock(&m_hdr10pluslock);
 }
 
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
index e9e49a1..463a347 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2010 - 2020, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -923,6 +923,7 @@
                                          pic_order = V4L2_MPEG_MSM_VIDC_DISABLE;
                                      } else if (pictureOrder->eOutputPictureOrder == QOMX_VIDEO_DECODE_ORDER) {
                                          pic_order = V4L2_MPEG_MSM_VIDC_ENABLE;
+                                         time_stamp_dts.set_timestamp_reorder_mode(false);
                                      } else
                                          eRet = OMX_ErrorBadParameter;
                                      if (eRet == OMX_ErrorNone) {
@@ -1044,9 +1045,22 @@
 #endif //ALLOCATE_OUTPUT_NATIVEHANDLE
 #endif
         case OMX_QcomIndexParamEnableTimeStampReorder: {
-            DEBUG_PRINT_HIGH("timestamp reorder not supported anymore, arbitrary bytes mode has been moved to parser.");
-            break;
-        }
+                                       VALIDATE_OMX_PARAM_DATA(paramData, QOMX_INDEXTIMESTAMPREORDER);
+                                       QOMX_INDEXTIMESTAMPREORDER *reorder = (QOMX_INDEXTIMESTAMPREORDER *)paramData;
+                                       if (drv_ctx.picture_order == (vdec_output_order)QOMX_VIDEO_DISPLAY_ORDER) {
+                                           if (reorder->bEnable == OMX_TRUE) {
+                                               frm_int =0;
+                                               time_stamp_dts.set_timestamp_reorder_mode(true);
+                                           } else
+                                               time_stamp_dts.set_timestamp_reorder_mode(false);
+                                       } else {
+                                           time_stamp_dts.set_timestamp_reorder_mode(false);
+                                           if (reorder->bEnable == OMX_TRUE) {
+                                               eRet = OMX_ErrorUnsupportedSetting;
+                                           }
+                                       }
+                                   }
+                                   break;
         case OMX_IndexParamVideoProfileLevelCurrent: {
             VALIDATE_OMX_PARAM_DATA(paramData, OMX_VIDEO_PARAM_PROFILELEVELTYPE);
             OMX_VIDEO_PARAM_PROFILELEVELTYPE *pParam = (OMX_VIDEO_PARAM_PROFILELEVELTYPE*)paramData;
@@ -1064,6 +1078,9 @@
             QOMX_VIDEO_OUTPUT_FRAME_RATE *pParam = (QOMX_VIDEO_OUTPUT_FRAME_RATE*)paramData;
             DEBUG_PRINT_LOW("set_parameter: decoder output-frame-rate %d", pParam->fps);
             m_dec_hfr_fps=pParam->fps;
+            if (m_dec_hfr_fps > m_dec_output_rate)
+                m_dec_hfr_fps = m_dec_output_rate;
+
             DEBUG_PRINT_HIGH("output-frame-rate value = %d", m_dec_hfr_fps);
             if (m_dec_hfr_fps) {
                 m_last_rendered_TS = 0;
diff --git a/mm-video-v4l2/vidc/vdec/src/ts_parser.cpp b/mm-video-v4l2/vidc/vdec/src/ts_parser.cpp
index 809a1f7..e6c29ef 100644
--- a/mm-video-v4l2/vidc/vdec/src/ts_parser.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/ts_parser.cpp
@@ -266,6 +266,9 @@
 
     if (!phead || !phead->entries_filled) return false;
 
+    if (header->nFlags & OMX_BUFFERFLAG_CODECCONFIG)
+        return true;
+
     for (int i=0; i < TIME_SZ; i++) {
         if (phead->input_timestamps[i].in_use) {
             status = true;
diff --git a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
index 1835342..9efdbca 100644
--- a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
+++ b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h
@@ -641,7 +641,6 @@
         bool alloc_map_ion_memory(int size, venc_ion *ion_info,
                                  int flag);
         void free_ion_memory(struct venc_ion *buf_ion_info);
-        void do_cache_operations(int fd);
 #endif
 
         //*************************************************************
diff --git a/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h b/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
index 707c466..48c5c74 100644
--- a/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
+++ b/mm-video-v4l2/vidc/venc/inc/omx_video_encoder.h
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010-2017, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2017, 2020 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -55,6 +55,7 @@
         bool is_secure_session();
         //OMX strucutres
         OMX_U32 m_nVenc_format;
+        char m_platform_name[PROPERTY_VALUE_MAX] = {0};
         class venc_dev *handle;
         int dev_handle_output_extradata(void *, int);
         int dev_set_format(int);
diff --git a/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h b/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h
index eb7a0e8..291d505 100644
--- a/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h
+++ b/mm-video-v4l2/vidc/venc/inc/video_encoder_device_v4l2.h
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -74,6 +74,8 @@
 #define REQUEST_LINEAR_COLOR_10_BIT  0x2
 #define REQUEST_LINEAR_COLOR_ALL     (REQUEST_LINEAR_COLOR_8_BIT | REQUEST_LINEAR_COLOR_10_BIT)
 
+#define VENC_QUALITY_BOOST_BITRATE_THRESHOLD 2000000
+
 enum hier_type {
     HIER_NONE = 0x0,
     HIER_P = 0x1,
@@ -377,6 +379,7 @@
         bool is_auto_blur_disabled;
         bool csc_enable;
         bool m_bDimensionsNeedFlip;
+        int32_t m_disable_hdr;
         unsigned long get_media_colorformat(unsigned long);
 
     private:
@@ -422,6 +425,7 @@
         bool set_nP_frames(unsigned long nPframes);
         bool venc_set_target_bitrate(OMX_U32 nTargetBitrate);
         bool venc_set_ratectrl_cfg(OMX_VIDEO_CONTROLRATETYPE eControlRate);
+        bool venc_set_bitrate_savings_mode(OMX_U32 bitrateSavingEnable);
         bool venc_set_session_qp_range(OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE *qp_range);
         bool venc_set_encode_framerate(OMX_U32 encode_framerate);
         bool venc_set_intra_vop_refresh(OMX_BOOL intra_vop_refresh);
@@ -469,6 +473,8 @@
         bool venc_get_cvp_metadata(private_handle_t *handle, struct v4l2_buffer *buf);
         bool venc_set_cvp_skipratio_controls();
         bool venc_superframe_enable(private_handle_t *handle);
+        void venc_set_quality_boost(OMX_BOOL c2d_enable);
+        bool reconfigure_avc_param(OMX_VIDEO_PARAM_AVCTYPE *param);
 
         OMX_U32 pmem_free();
         OMX_U32 pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count);
@@ -525,7 +531,9 @@
         bool venc_set_hdr_info(const MasteringDisplay&, const ContentLightLevel&);
         bool mIsGridset;
         OMX_U32 mUseLinearColorFormat;
-        bool mBitrateSavingsEnable;
+        OMX_U32 mBitrateSavingsEnable;
+        bool mQualityBoostRequested;
+        bool mQualityBoostEligible;
 
         union dynamicConfigData {
             OMX_VIDEO_CONFIG_BITRATETYPE bitrate;
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index d969c32..61457c2 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -292,6 +292,7 @@
             {HAL_PIXEL_FORMAT_RGBA_8888, RGBA8888},
             {HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC, NV12_UBWC},
             {HAL_PIXEL_FORMAT_NV12_ENCODEABLE, NV12_128m},
+            {HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS, NV12_128m},
                 });
 
     pthread_mutex_init(&m_lock, NULL);
@@ -4736,10 +4737,10 @@
             m_fbd_count++;
 
             if (dev_get_output_log_flag()) {
-                do_cache_operations(m_pOutput_ion[index].data_fd);
+                sync_start_read(m_pOutput_ion[index].data_fd);
                 dev_output_log_buffers((const char*)buffer->pBuffer + buffer->nOffset, buffer->nFilledLen,
                                         buffer->nTimeStamp);
-                do_cache_operations(m_pOutput_ion[index].data_fd);
+                sync_end_read(m_pOutput_ion[index].data_fd);
 
             }
         }
@@ -4856,50 +4857,18 @@
     }
 }
 
-void omx_video::do_cache_operations(int fd)
-{
-#ifdef USE_ION
-    struct dma_buf_sync buf_sync;
-
-    if (fd < 0)
-        return;
-
-    struct dma_buf_sync dma_buf_sync_data[2];
-    dma_buf_sync_data[0].flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
-    dma_buf_sync_data[1].flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
-
-    for(unsigned int i=0; i<2; i++) {
-        int rc = ioctl(fd, DMA_BUF_IOCTL_SYNC, &dma_buf_sync_data[i]);
-        if (rc < 0) {
-            DEBUG_PRINT_ERROR("Failed DMA_BUF_IOCTL_SYNC %s fd : %d", i==0?"start":"end", fd);
-            return;
-        }
-    }
-#else
-    (void)fd;
-    return;
-#endif
-}
-
 char *omx_video::ion_map(int fd, int len)
 {
     char *bufaddr = (char*)mmap(NULL, len, PROT_READ|PROT_WRITE,
                                 MAP_SHARED, fd, 0);
-#ifdef USE_ION
-    if (bufaddr != MAP_FAILED) {
-        do_cache_operations(fd);
-    }
-#endif
+    if (bufaddr != MAP_FAILED)
+        cache_clean_invalidate(fd);
     return bufaddr;
 }
 
 OMX_ERRORTYPE omx_video::ion_unmap(int fd, void *bufaddr, int len)
 {
-#ifdef USE_ION
-    do_cache_operations(fd);
-#else
-    (void)fd;
-#endif
+    cache_clean_invalidate(fd);
     if (-1 == munmap(bufaddr, len)) {
         DEBUG_PRINT_ERROR("munmap failed.");
         return OMX_ErrorInsufficientResources;
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
index b52ce94..4b6f46c 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2020 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -225,6 +225,7 @@
 
     OMX_VIDEO_CODINGTYPE codec_type;
 
+    property_get("ro.board.platform", m_platform_name, "0");
     DEBUG_PRINT_HIGH("omx_venc(): Inside component_init()");
     // Copy the role information which provides the decoder m_nkind
     strlcpy((char *)m_nkind,role,OMX_MAX_STRINGNAME_SIZE);
@@ -241,6 +242,15 @@
         secure_session = true;
     } else if (!strncmp((char *)m_nkind, "OMX.qcom.video.encoder.vp8",    \
                 OMX_MAX_STRINGNAME_SIZE)) {
+        char version[PROP_VALUE_MAX] = {0};
+        if (!strncmp(m_platform_name, "lito", 4))
+            if (property_get("vendor.media.target.version", version, "0") &&
+                    ((atoi(version) == 2) || (atoi(version) == 3))) {
+                //sku version, VP8 is disabled on lagoon
+                DEBUG_PRINT_ERROR("VP8 unsupported on lagoon");
+                eRet = OMX_ErrorInvalidComponentName;
+                return eRet;
+            }
         strlcpy((char *)m_cRole, "video_encoder.vp8",OMX_MAX_STRINGNAME_SIZE);
         codec_type = OMX_VIDEO_CodingVP8;
     } else if (!strncmp((char *)m_nkind, "OMX.qcom.video.encoder.hevc",    \
@@ -2031,6 +2041,15 @@
                 break;
 
             }
+        case OMX_QTIIndexConfigContentAdaptiveCoding:
+           {
+                OMX_U32* bitrateSavingsMode = (OMX_U32*) configData;
+                if (!handle->venc_set_config(bitrateSavingsMode, (OMX_INDEXTYPE)OMX_QTIIndexConfigContentAdaptiveCoding)) {
+                    DEBUG_PRINT_ERROR("Failed to set OMX_QTIIndexConfigContentAdaptiveCoding");
+                    return OMX_ErrorUnsupportedSetting;
+                }
+                break;
+           }
         default:
             DEBUG_PRINT_ERROR("ERROR: unsupported index %d", (int) configIndex);
             break;
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_extensions.hpp b/mm-video-v4l2/vidc/venc/src/omx_video_extensions.hpp
index 484fcda..189cb59 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_extensions.hpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_extensions.hpp
@@ -147,6 +147,9 @@
 
     ADD_EXTENSION("qti-ext-enc-roiinfo-rect-mode", OMX_QTIIndexConfigVideoRoiRectRegionInfo, OMX_DirOutput)
     ADD_PARAM_END("enable", OMX_AndroidVendorValueInt32)
+
+    ADD_EXTENSION("qti-ext-enc-content-adaptive-mode", OMX_QTIIndexConfigContentAdaptiveCoding, OMX_DirInput)
+    ADD_PARAM_END("value", OMX_AndroidVendorValueInt32)
 }
 
 OMX_ERRORTYPE omx_video::get_vendor_extension_config(
@@ -332,6 +335,7 @@
         }
         case OMX_QTIIndexParamVideoEnableBlur:
         case OMX_QTIIndexConfigVideoBlurResolution:
+        case OMX_QTIIndexConfigContentAdaptiveCoding:
         {
             break;
         }
@@ -1033,6 +1037,23 @@
             }
             break;
         }
+        case OMX_QTIIndexConfigContentAdaptiveCoding:
+        {
+            OMX_U32 bitrateSavingsMode;
+            valueSet |= vExt.readParamInt32(ext, "value", (OMX_S32 *)&(bitrateSavingsMode));
+            if (!valueSet) {
+                break;
+            }
+            DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: OMX_QTIIndexConfigContentAdaptiveCoding : %u",
+                             bitrateSavingsMode);
+
+            err = set_config(
+                    NULL, (OMX_INDEXTYPE)OMX_QTIIndexConfigContentAdaptiveCoding, &bitrateSavingsMode);
+            if (err != OMX_ErrorNone) {
+                DEBUG_PRINT_ERROR("set_config: OMX_QTIIndexConfigContentAdaptiveCoding failed !");
+            }
+            break;
+        }
         default:
         {
             return OMX_ErrorNotImplemented;
diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index 6cc62a1..a29918d 100644
--- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2020 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -81,6 +81,7 @@
 #define HEVC_MAIN10_START (HEVC_MAIN_START + 13)
 #define POLL_TIMEOUT 1000
 #define MAX_SUPPORTED_SLICES_PER_FRAME 28 /* Max supported slices with 32 output buffers */
+#define ENC_HDR_DISABLE_FLAG 0x2
 
 #define SZ_4K 0x1000
 #define SZ_1M 0x100000
@@ -171,6 +172,8 @@
             (int32_t *)&is_csc_custom_matrix_enabled, 0);
     Platform::Config::getInt32(Platform::vidc_enc_auto_blur_disable,
             (int32_t *)&is_auto_blur_disabled, 0);
+    Platform::Config::getInt32(Platform::vidc_disable_hdr,
+            (int32_t *)&m_disable_hdr, 0);
 
     char property_value[PROPERTY_VALUE_MAX] = {0};
 
@@ -206,7 +209,10 @@
     Platform::Config::getInt32(Platform::vidc_enc_linear_color_format,
             (int32_t *)&mUseLinearColorFormat, 0);
     Platform::Config::getInt32(Platform::vidc_enc_bitrate_savings_enable,
-            (int32_t *)&mBitrateSavingsEnable, 1);
+            (int32_t *)&mBitrateSavingsEnable, 3);
+    Platform::Config::getInt32(Platform::vidc_enc_quality_boost_enable,
+            (int32_t *)&mQualityBoostRequested, 0);
+    mQualityBoostEligible = false;
 
     profile_level_converter::init();
 }
@@ -669,9 +675,7 @@
     }
 
     DEBUG_PRINT_HIGH("Processing Extradata for Buffer = %lld", nTimeStamp); // Useful for debugging
-#ifdef USE_ION
-    venc_handle->do_cache_operations(input_extradata_info.ion[index].data_fd);
-#endif
+    sync_start_rw(input_extradata_info.ion[index].data_fd);
 
     p_extradata = input_extradata_info.ion[index].uaddr;
     data = (struct OMX_OTHER_EXTRADATATYPE *)p_extradata;
@@ -834,9 +838,7 @@
     data->data[0] = 0;
 
 bailout:
-#ifdef USE_ION
-    venc_handle->do_cache_operations(input_extradata_info.ion[index].data_fd);
-#endif
+    sync_end_rw(input_extradata_info.ion[index].data_fd);
     return status;
 }
 
@@ -1272,9 +1274,7 @@
     else
         fd = output_extradata_info.ion[index].data_fd;
 
-#ifdef USE_ION
-    venc_handle->do_cache_operations(fd);
-#endif
+    sync_start_read(fd);
     if (!m_debug.extradatafile && m_debug.extradata_log) {
         int size = 0;
 
@@ -1294,9 +1294,7 @@
             DEBUG_PRINT_ERROR("Failed to open extradata file: %s for logging errno:%d",
                                m_debug.extradatafile_name, errno);
             m_debug.extradatafile_name[0] = '\0';
-#ifdef USE_ION
-            venc_handle->do_cache_operations(fd);
-#endif
+            sync_end_read(fd);
             return -1;
         }
     }
@@ -1309,9 +1307,7 @@
             fwrite(p_extra, p_extra->nSize, 1, m_debug.extradatafile);
         } while (p_extra->eType != OMX_ExtraDataNone);
     }
-#ifdef USE_ION
-    venc_handle->do_cache_operations(fd);
-#endif
+    sync_end_read(fd);
     return 0;
 }
 
@@ -1323,9 +1319,7 @@
         return -1;
     }
 
-#ifdef USE_ION
-    venc_handle->do_cache_operations(fd);
-#endif
+    sync_start_read(fd);
     if (!m_debug.infile) {
         int size = snprintf(m_debug.infile_name, PROPERTY_VALUE_MAX, "%s/input_enc_%lu_%lu_%p.yuv",
                             m_debug.log_loc, m_sVenc_cfg.input_width, m_sVenc_cfg.input_height, this);
@@ -1417,9 +1411,7 @@
         }
     }
 bailout:
-#ifdef USE_ION
-    venc_handle->do_cache_operations(fd);
-#endif
+    sync_end_read(fd);
     return status;
 }
 
@@ -1430,12 +1422,9 @@
     struct v4l2_control control;
     OMX_STRING device_name = (OMX_STRING)"/dev/video33";
     char property_value[PROPERTY_VALUE_MAX] = {0};
-    char platform_name[PROPERTY_VALUE_MAX] = {0};
     FILE *soc_file = NULL;
     char buffer[10];
 
-    property_get("ro.board.platform", platform_name, "0");
-
     m_nDriver_fd = open (device_name, O_RDWR);
     if ((int)m_nDriver_fd < 0) {
         DEBUG_PRINT_ERROR("ERROR: Omx_venc::Comp Init Returning failure");
@@ -1554,6 +1543,13 @@
         m_sInput_buff_property.alignment  = SZ_4K;
     }
 
+    if (m_codec == OMX_VIDEO_CodingImageHEIC) {
+        if (!venc_set_grid_enable()) {
+            DEBUG_PRINT_ERROR("Failed to enable grid");
+            return false;
+        }
+    }
+
     memset(&fmt, 0, sizeof(fmt));
     fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
     fmt.fmt.pix_mp.height = m_sVenc_cfg.dvs_height;
@@ -1581,13 +1577,6 @@
     ret = ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt);
     m_sInput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
 
-    if (m_codec == OMX_VIDEO_CodingImageHEIC) {
-        if (!venc_set_grid_enable()) {
-            DEBUG_PRINT_ERROR("Failed to enable grid");
-            return false;
-        }
-    }
-
     bufreq.memory = V4L2_MEMORY_USERPTR;
     bufreq.count = 2;
 
@@ -2821,7 +2810,7 @@
                         if (encodePerfMode == OMX_TRUE)
                             buf.flags |= V4L2_BUF_FLAG_PERF_MODE;
                         // Clear SET_VIDEO_PERF_MODE in buffer handle
-                        clearMetaData(handle,SET_VIDEO_PERF_MODE);
+                        setMetaData(handle, SET_VIDEO_PERF_MODE, 0);
                     }
                     fd = handle->fd;
                     plane[0].data_offset = 0;
@@ -2883,6 +2872,8 @@
             }
         }
 
+        venc_set_quality_boost((OMX_BOOL)c2d_enabled);
+
         if (!downscalar_enabled) {
             OMX_U32 inp_width = 0, inp_height = 0, out_width = 0, out_height = 0;
 
@@ -3878,15 +3869,63 @@
     return true;
 }
 
+bool venc_dev::reconfigure_avc_param(OMX_VIDEO_PARAM_AVCTYPE *param) {
+    param->eProfile = (OMX_VIDEO_AVCPROFILETYPE)QOMX_VIDEO_AVCProfileMain;
+
+    DEBUG_PRINT_LOW("reconfigure_avc_param");
+
+    if (!venc_set_profile (param->eProfile)) {
+        DEBUG_PRINT_ERROR("ERROR: Unsuccessful in updating Profile %d",
+            param->eProfile);
+        return false;
+    }
+    if (set_nP_frames(param->nPFrames) == false ||
+        (param->nBFrames && set_nB_frames(param->nBFrames) == false)) {
+            DEBUG_PRINT_ERROR("ERROR: Request for setting intra period failed");
+            return false;
+    }
+    if (!venc_set_entropy_config (param->bEntropyCodingCABAC, param->nCabacInitIdc)) {
+        DEBUG_PRINT_ERROR("ERROR: Request for setting Entropy failed");
+        return false;
+    }
+    if (!venc_set_inloop_filter (param->eLoopFilterMode)) {
+        DEBUG_PRINT_ERROR("ERROR: Request for setting Inloop filter failed");
+        return false;
+    }
+    if (!venc_set_multislice_cfg(V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB, param->nSliceHeaderSpacing)) {
+        DEBUG_PRINT_ERROR("WARNING: Unsuccessful in updating slice_config");
+        return false;
+    }
+    if (!venc_h264_transform_8x8(param->bDirect8x8Inference)) {
+        DEBUG_PRINT_ERROR("WARNING: Request for setting Transform8x8 failed");
+        return false;
+    }
+
+    return true;
+}
+
 bool venc_dev::venc_set_operatingrate(OMX_U32 rate) {
     struct v4l2_control control;
 
     control.id = V4L2_CID_MPEG_VIDC_VIDEO_OPERATING_RATE;
     control.value = rate;
 
+    if (rate > INT_MAX)
+        control.value = INT_MAX;
+
     DEBUG_PRINT_LOW("venc_set_operating_rate: %u fps", rate >> 16);
     DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%u", control.id, control.value);
 
+    if (!strncmp(venc_handle->m_platform, "bengal", 6) &&
+        (rate >> 16) > 30 && m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264 &&
+        venc_handle->m_sParamAVC.eProfile ==
+            (OMX_VIDEO_AVCPROFILETYPE)QOMX_VIDEO_AVCProfileHigh &&
+        (m_sVenc_cfg.input_width * m_sVenc_cfg.input_height >= 1920 * 1080)) {
+        if (!reconfigure_avc_param(&venc_handle->m_sParamAVC)) {
+            DEBUG_PRINT_ERROR("reconfigure avc param fails");
+        }
+    }
+
     if(ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control)) {
         hw_overload = errno == EBUSY;
         DEBUG_PRINT_ERROR("Failed to set operating rate %d fps (%s)",
@@ -4330,7 +4369,7 @@
                 return false;
         } else {
             DEBUG_PRINT_ERROR("ERROR: External CVP mode disabled for this session and continue!");
-            clearMetaData(handle, SET_CVP_METADATA);
+            setMetaData(handle, SET_CVP_METADATA, 0);
         }
     } else {
         DEBUG_PRINT_INFO("venc_cvp_enable: cvp metadata not available");
@@ -4375,7 +4414,7 @@
     buf->flags &= ~V4L2_BUF_FLAG_CVPMETADATA_SKIP;
     cvpMetadata.size = 0;
     if (getMetaData(handle, GET_CVP_METADATA, &cvpMetadata) == 0) {
-        clearMetaData(handle, SET_CVP_METADATA);
+        setMetaData(handle, SET_CVP_METADATA, 0);
         if (cvpMetadata.size != CVP_METADATA_SIZE) {
             DEBUG_PRINT_ERROR("ERROR: Invalid CVP metadata size %d",
                 cvpMetadata.size);
@@ -4407,8 +4446,13 @@
 
 bool venc_dev::venc_config_bitrate(OMX_VIDEO_CONFIG_BITRATETYPE *bit_rate)
 {
+    OMX_U32 bitrate = bit_rate->nEncodeBitrate;
     if (bit_rate->nPortIndex == (OMX_U32)PORT_INDEX_OUT) {
-        if (venc_set_target_bitrate(bit_rate->nEncodeBitrate) == false) {
+        // If quality boost is eligible, also increase bitrate by 15% in dynamic change case
+        if (mQualityBoostEligible && bitrate < VENC_QUALITY_BOOST_BITRATE_THRESHOLD) {
+            bitrate += bitrate * 15 / 100;
+        }
+        if (venc_set_target_bitrate(bitrate) == false) {
             DEBUG_PRINT_ERROR("ERROR: Setting Target Bit rate failed");
             return false;
         }
@@ -4836,3 +4880,53 @@
     return data->nSize;
 }
 
+void venc_dev::venc_set_quality_boost(OMX_BOOL c2d_enable)
+{
+    OMX_U32 initial_qp;
+    OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE qp_range;
+    OMX_QTI_VIDEO_CONFIG_BLURINFO blurinfo;
+
+    // Conditions to enable encoder quality boost,
+    // 1. Codec is AVC
+    // 2. RCMode is VBR
+    // 3. Input is RGBA/RGBA_UBWC (C2D enabled)
+    // 4. width <= 960 and height <= 960
+    // 5. FPS <= 30
+    // 6. bitrate < 2Mbps
+
+    if (mQualityBoostRequested && c2d_enable &&
+        m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264 &&
+        rate_ctrl.rcmode == V4L2_MPEG_VIDEO_BITRATE_MODE_VBR &&
+        m_sVenc_cfg.dvs_width <= 960 && m_sVenc_cfg.dvs_height <= 960 &&
+        (m_sVenc_cfg.fps_num / m_sVenc_cfg.fps_den) <= 30 &&
+        bitrate.target_bitrate < VENC_QUALITY_BOOST_BITRATE_THRESHOLD) {
+        mQualityBoostEligible = true;
+        DEBUG_PRINT_HIGH("Quality boost eligible encoder session");
+    } else {
+        return;
+    }
+
+    if (bitrate.target_bitrate <= 64000)
+        venc_set_level(OMX_VIDEO_AVCLevel1);
+
+    // Set below configurations to boost quality
+    // 1. Increase bitrate by 15%
+    bitrate.target_bitrate += bitrate.target_bitrate * 15 / 100;
+    venc_set_target_bitrate(bitrate.target_bitrate);
+
+    // 2. Set initial QP=30
+    initial_qp = 30;
+    venc_set_qp(initial_qp, initial_qp, initial_qp, 7);
+
+    // 3. Set QP range [10,40]
+    qp_range.minIQP = qp_range.minPQP = qp_range.minBQP = 10;
+    qp_range.maxIQP = qp_range.maxPQP = qp_range.maxBQP = 40;
+    venc_set_session_qp_range(&qp_range);
+
+    // 4. Disable blur (both external and internal)
+    blurinfo.nBlurInfo = 2;
+    venc_set_blur_resolution(&blurinfo);
+
+    // 5. Disable bitrate savings (CAC)
+    venc_set_bitrate_savings_mode(0);
+}
diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2_params.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2_params.cpp
index ef55daa..0efc7ca 100644
--- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2_params.cpp
+++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2_params.cpp
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2020, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -387,6 +387,12 @@
                     case ColorAspects::TransferSRGB:
                         transfer_chars = MSM_VIDC_TRANSFER_SRGB;
                         break;
+                    case ColorAspects::TransferST2084:
+                        transfer_chars = MSM_VIDC_TRANSFER_SMPTE_ST2084;
+                        break;
+                    case ColorAspects::TransferHLG:
+                        transfer_chars = MSM_VIDC_TRANSFER_HLG;
+                        break;
                     default:
                         //params->sAspects.mTransfer = ColorAspects::TransferSMPTE170M;
                         transfer_chars = MSM_VIDC_TRANSFER_601_6_625;
@@ -451,6 +457,14 @@
             }
             break;
         }
+        case OMX_QTIIndexConfigContentAdaptiveCoding:
+           {
+                if(!venc_set_bitrate_savings_mode(*(OMX_U32*) configData)) {
+                    DEBUG_PRINT_LOW("Failed to set Bitrate Savings Mode");
+                    return false;
+                }
+                break;
+           }
         default:
             DEBUG_PRINT_ERROR("Unsupported config index = %u", index);
             break;
@@ -1590,6 +1604,23 @@
     return codectype;
 }
 
+bool venc_dev::venc_set_bitrate_savings_mode(OMX_U32 bitrateSavingEnable)
+{
+    struct v4l2_control control;
+    int rc = 0;
+
+    DEBUG_PRINT_LOW("Set bitrate savings %d", bitrateSavingEnable);
+    control.id = V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS;
+    control.value = bitrateSavingEnable;
+    rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
+    if (rc) {
+        DEBUG_PRINT_HIGH("Non-Fatal: Request to set bitrate savings failed");
+    }
+    mBitrateSavingsEnable = bitrateSavingEnable;
+
+    return true;
+}
+
 bool venc_dev::venc_set_ratectrl_cfg(OMX_VIDEO_CONTROLRATETYPE eControlRate)
 {
     bool status = true;
@@ -1651,13 +1682,7 @@
         rate_ctrl.rcmode = control.value;
     }
 
-    DEBUG_PRINT_LOW("Set bitrate savings %d", mBitrateSavingsEnable);
-    control.id = V4L2_CID_MPEG_VIDC_VENC_BITRATE_SAVINGS;
-    control.value = mBitrateSavingsEnable;
-    rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
-    if (rc) {
-        DEBUG_PRINT_HIGH("Non-Fatal: Request to set bitrate savings failed");
-    }
+    venc_set_bitrate_savings_mode(mBitrateSavingsEnable);
 
     return status;
 }