Merge "lito: Tune media_codecs XML files as per modified spec"
diff --git a/conf_files/kona/media_codecs.xml b/conf_files/kona/media_codecs.xml
index de6bde6..b9bce77 100644
--- a/conf_files/kona/media_codecs.xml
+++ b/conf_files/kona/media_codecs.xml
@@ -232,7 +232,7 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="64-138240" />
             <Limit name="blocks-per-second" min="64" max="3916800" />
-            <Limit name="bitrate" range="1-220000000" />
+            <Limit name="bitrate" range="1-160000000" />
             <Limit name="frame-rate" range="1-960" />
             <Limit name="concurrent-instances" max="16" />
             <Feature name="bitrate-modes" value="VBR,CBR" />
@@ -267,18 +267,24 @@
             <Limit name="concurrent-instances" max="6" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="CQ" />
-            <Limit name="performance-point-none" value="0" />
+            <Limit name="performance-point-16384x8192" value="3" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-4096x2304" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+            <Limit name="performance-point-1920x1080" value="6" />
+            <Limit name="performance-point-1280x720" value="6" />
+            <Limit name="performance-point-1280x720" 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="128x128" max="864x864" />
+            <Limit name="size" min="96x96" max="864x864" />
             <Limit name="alignment" value="4x4" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="block-count" range="64-1620" />
-            <Limit name="blocks-per-second" min="64" max="48600" />
+            <Limit name="block-count" range="36-1620" />
+            <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" />
@@ -290,11 +296,11 @@
              <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="864x864" />
+             <Limit name="size" min="96x96" max="864x864" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="block-count" range="64-3600" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <Limit name="block-count" range="36-1620" />
+             <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" />
@@ -377,7 +383,7 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="64-34560" />
             <Limit name="blocks-per-second" min="64" max="1036800" />
-            <Limit name="bitrate" range="1-220000000" />
+            <Limit name="bitrate" range="1-100000000" />
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
@@ -393,7 +399,7 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="64-138240" />
             <Limit name="blocks-per-second" min="64" max="7776000" />
-            <Limit name="bitrate" range="1-220000000" />
+            <Limit name="bitrate" range="1-160000000" />
             <Limit name="frame-rate" range="1-960" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="6" />
@@ -428,7 +434,7 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="64-138240" />
             <Limit name="blocks-per-second" min="64" max="7776000" />
-            <Limit name="bitrate" range="1-220000000" />
+            <Limit name="bitrate" range="1-160000000" />
             <Limit name="frame-rate" range="1-960" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
@@ -459,11 +465,11 @@
         <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="128x128" max="864x864" />
+             <Limit name="size" min="96x96" max="864x864" />
              <Limit name="alignment" value="4x4" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="block-count" range="64-1620" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <Limit name="block-count" range="36-1620" />
+             <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" />
@@ -475,11 +481,11 @@
         <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="128x128" max="1920x1920" />
+             <Limit name="size" min="96x96" max="1920x1920" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="block-count" range="64-8160" />
-             <Limit name="blocks-per-second" min="64" max="244800" />
+             <Limit name="block-count" range="36-8160" />
+             <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" />
@@ -488,11 +494,11 @@
         <MediaCodec name="OMX.qti.video.decoder.divxsw" type="video/divx" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1920" />
+            <Limit name="size" min="96x96" max="1920x1920" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="block-count" range="64-8160" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="block-count" range="36-8160" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
@@ -501,11 +507,11 @@
         <MediaCodec name="OMX.qti.video.decoder.divx4sw" type="video/divx4" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1920" />
+            <Limit name="size" min="96x96" max="1920x1920" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="block-count" range="64-8160" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="block-count" range="36-8160" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
diff --git a/conf_files/kona/media_codecs_performance.xml b/conf_files/kona/media_codecs_performance.xml
index 475fa9d..4766953 100644
--- a/conf_files/kona/media_codecs_performance.xml
+++ b/conf_files/kona/media_codecs_performance.xml
@@ -105,30 +105,30 @@
             <Limit name="measured-frame-rate-1920x1088" range="246-250" />
         </MediaCodec>
             <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-352x288" range="645-668" />
+            <Limit name="measured-frame-rate-352x288" range="756-1179" />
             <Limit name="measured-frame-rate-720x480" range="1046-1157" />
             <Limit name="measured-frame-rate-1280x720" range="318-319" />
             <Limit name="measured-frame-rate-1920x1080" range="316-318" />
             <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="356-356" />
+            <Limit name="measured-frame-rate-176x144" range="530-650" />
             <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="409-410" />
+            <Limit name="measured-frame-rate-176x144" range="381-767" />
             <Limit name="measured-frame-rate-480x360" range="436-524" />
             <Limit name="measured-frame-rate-1280x720" range="240-292" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x240" range="337-337" />
-            <Limit name="measured-frame-rate-640x360" range="337-337" />
+            <Limit name="measured-frame-rate-320x240" range="1111-1357" />
+            <Limit name="measured-frame-rate-640x360" range="571-883" />
             <Limit name="measured-frame-rate-1280x720" range="337-337" />
             <Limit name="measured-frame-rate-1920x1080" range="248-248" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
-            <Limit name="measured-frame-rate-320x240" range="330-450" />
-            <Limit name="measured-frame-rate-640x360" range="300-390" />
+            <Limit name="measured-frame-rate-320x240" range="806-1245" />
+            <Limit name="measured-frame-rate-640x360" range="499-695" />
             <Limit name="measured-frame-rate-1280x720" range="238-253" />
             <Limit name="measured-frame-rate-1920x1080" range="175-225" />
             <Limit name="measured-frame-rate-3840x2160" range="83-98" />
diff --git a/conf_files/kona/media_codecs_vendor.xml b/conf_files/kona/media_codecs_vendor.xml
index 4a39b68..a7964dc 100644
--- a/conf_files/kona/media_codecs_vendor.xml
+++ b/conf_files/kona/media_codecs_vendor.xml
@@ -233,7 +233,7 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="64-138240" />
             <Limit name="blocks-per-second" min="64" max="3916800" />
-            <Limit name="bitrate" range="1-220000000" />
+            <Limit name="bitrate" range="1-160000000" />
             <Limit name="frame-rate" range="1-960" />
             <Limit name="concurrent-instances" max="16" />
             <Feature name="bitrate-modes" value="VBR,CBR" />
@@ -268,18 +268,24 @@
             <Limit name="concurrent-instances" max="6" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="CQ" />
-            <Limit name="performance-point-none" value="0" />
+            <Limit name="performance-point-16384x8192" value="3" />
+            <Limit name="performance-point-8192x4320" value="3" />
+            <Limit name="performance-point-4096x2304" value="3" />
+            <Limit name="performance-point-1920x1080" value="6" />
+            <Limit name="performance-point-1920x1080" value="6" />
+            <Limit name="performance-point-1280x720" value="6" />
+            <Limit name="performance-point-1280x720" 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="128x128" max="864x864" />
+            <Limit name="size" min="96x96" max="864x864" />
             <Limit name="alignment" value="4x4" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="block-count" range="64-1620" />
-            <Limit name="blocks-per-second" min="64" max="48600" />
+            <Limit name="block-count" range="36-1620" />
+            <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" />
@@ -291,11 +297,11 @@
              <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="864x864" />
+             <Limit name="size" min="96x96" max="864x864" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="block-count" range="64-3600" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <Limit name="block-count" range="36-1620" />
+             <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" />
@@ -378,7 +384,7 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="64-34560" />
             <Limit name="blocks-per-second" min="64" max="1036800" />
-            <Limit name="bitrate" range="1-220000000" />
+            <Limit name="bitrate" range="1-100000000" />
             <Limit name="frame-rate" range="1-120" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
@@ -394,7 +400,7 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="64-138240" />
             <Limit name="blocks-per-second" min="64" max="7776000" />
-            <Limit name="bitrate" range="1-220000000" />
+            <Limit name="bitrate" range="1-160000000" />
             <Limit name="frame-rate" range="1-960" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="6" />
@@ -429,7 +435,7 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="64-138240" />
             <Limit name="blocks-per-second" min="64" max="7776000" />
-            <Limit name="bitrate" range="1-220000000" />
+            <Limit name="bitrate" range="1-160000000" />
             <Limit name="frame-rate" range="1-960" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="16" />
@@ -460,11 +466,11 @@
         <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="128x128" max="864x864" />
+             <Limit name="size" min="96x96" max="864x864" />
              <Limit name="alignment" value="4x4" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="block-count" range="64-1620" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <Limit name="block-count" range="36-1620" />
+             <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" />
@@ -476,11 +482,11 @@
         <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="128x128" max="1920x1920" />
+             <Limit name="size" min="96x96" max="1920x1920" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="block-count" range="64-8160" />
-             <Limit name="blocks-per-second" min="64" max="244800" />
+             <Limit name="block-count" range="36-8160" />
+             <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" />
@@ -489,11 +495,11 @@
         <MediaCodec name="OMX.qti.video.decoder.divxsw" type="video/divx" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1920" />
+            <Limit name="size" min="96x96" max="1920x1920" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="block-count" range="64-8160" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="block-count" range="36-8160" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
@@ -502,11 +508,11 @@
         <MediaCodec name="OMX.qti.video.decoder.divx4sw" type="video/divx4" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1920" />
+            <Limit name="size" min="96x96" max="1920x1920" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="block-count" range="64-8160" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="block-count" range="36-8160" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
diff --git a/conf_files/lito/lito.mk b/conf_files/lito/lito.mk
index 0b3cf03..1ec9901 100644
--- a/conf_files/lito/lito.mk
+++ b/conf_files/lito/lito.mk
@@ -13,7 +13,7 @@
     $(CONFIG_PATH)/system_properties.xml:$(TARGET_COPY_OUT_VENDOR)/etc/system_properties.xml
 
 # Enable CLANG/LLVM integer-overflow sanitization
-TARGET_ENABLE_VIDC_INTSAN := false
+TARGET_ENABLE_VIDC_INTSAN := true
 
 # Enable DIAG mode for CLANG/LLVM integer-overflow sanitization
 # TARGET_ENABLE_VIDC_INTSAN must be set to 'true' before enabling DIAG mode
diff --git a/conf_files/lito/media_codecs.xml b/conf_files/lito/media_codecs.xml
index d5f1e97..744daf8 100644
--- a/conf_files/lito/media_codecs.xml
+++ b/conf_files/lito/media_codecs.xml
@@ -197,10 +197,10 @@
             <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="864x480" />
+            <Limit name="size" min="96x96" max="864x480" />
             <Limit name="alignment" value="4x4" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="48600" />
+            <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" />
@@ -210,10 +210,10 @@
              <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="864x480" />
+             <Limit name="size" min="96x96" max="864x480" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <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" />
@@ -362,10 +362,10 @@
         <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="128x128" max="864x480" />
+             <Limit name="size" min="96x96" max="864x480" />
              <Limit name="alignment" value="4x4" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <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" />
@@ -375,10 +375,10 @@
         <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="128x128" max="1920x1088" />
+             <Limit name="size" min="96x96" max="1920x1088" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="244800" />
+             <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" />
@@ -387,10 +387,10 @@
         <MediaCodec name="OMX.qti.video.decoder.divxsw" type="video/divx" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="size" min="96x96" max="1920x1088" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
@@ -399,10 +399,10 @@
         <MediaCodec name="OMX.qti.video.decoder.divx4sw" type="video/divx4" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="size" min="96x96" max="1920x1088" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
diff --git a/conf_files/lito/media_codecs_performance_v1.xml b/conf_files/lito/media_codecs_performance_v1.xml
index 66f2a0f..cadc1e7 100644
--- a/conf_files/lito/media_codecs_performance_v1.xml
+++ b/conf_files/lito/media_codecs_performance_v1.xml
@@ -67,6 +67,27 @@
             <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="183-243" />
+            <Limit name="measured-frame-rate-720x480" range="63-90" />
+            <Limit name="measured-frame-rate-1280x720" range="36-57" />
+            <Limit name="measured-frame-rate-1920x1080" range="22-32" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="20-33" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="250-364" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="246-348" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="85-112" />
+            <Limit name="measured-frame-rate-640x360" range="73-103" />
+            <Limit name="measured-frame-rate-1280x720" range="22-32" />
+            <Limit name="measured-frame-rate-1920x1080" range="18-27" />
+        </MediaCodec>
     </Encoders>
     <Decoders>
         <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
@@ -89,7 +110,7 @@
         <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="95-110" />
+            <Limit name="measured-frame-rate-1280x720" range="210-260" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
             <Limit name="measured-frame-rate-320x240" range="337-337" />
@@ -140,5 +161,36 @@
             <Limit name="measured-frame-rate-1280x720" range="32-40" />
             <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="101-183" />
+            <Limit name="measured-frame-rate-720x480" range="36-52" />
+            <Limit name="measured-frame-rate-1280x720" range="15-22" />
+            <Limit name="measured-frame-rate-1920x1080" range="8-13" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="100-181" />
+            <Limit name="measured-frame-rate-640x360" range="71-91" />
+            <Limit name="measured-frame-rate-720x480" range="75-95" />
+            <Limit name="measured-frame-rate-1280x720" range="51-73" />
+            <Limit name="measured-frame-rate-1920x1080" range="29-41" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="414-782" />
+            <Limit name="measured-frame-rate-352x288" range="237-523" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="240-640" />
+        </MediaCodec>
+        <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-1920x1080" range="21-31" />
+        </MediaCodec>
+        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="329-666" />
+            <Limit name="measured-frame-rate-640x360" range="54-83" />
+            <Limit name="measured-frame-rate-1280x720" range="33-47" />
+            <Limit name="measured-frame-rate-1920x1080" range="19-28" />
+        </MediaCodec>
     </Decoders>
 </MediaCodecs>
diff --git a/conf_files/lito/media_codecs_vendor.xml b/conf_files/lito/media_codecs_vendor.xml
index ec8f46a..8e2bdf0 100644
--- a/conf_files/lito/media_codecs_vendor.xml
+++ b/conf_files/lito/media_codecs_vendor.xml
@@ -221,10 +221,10 @@
             <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="864x480" />
+            <Limit name="size" min="96x96" max="864x480" />
             <Limit name="alignment" value="4x4" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="48600" />
+            <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" />
@@ -234,10 +234,10 @@
              <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="864x480" />
+             <Limit name="size" min="96x96" max="864x480" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <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" />
@@ -386,10 +386,10 @@
         <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="128x128" max="864x480" />
+             <Limit name="size" min="96x96" max="864x480" />
              <Limit name="alignment" value="4x4" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <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" />
@@ -399,10 +399,10 @@
         <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="128x128" max="1920x1088" />
+             <Limit name="size" min="96x96" max="1920x1088" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="244800" />
+             <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" />
@@ -411,10 +411,10 @@
         <MediaCodec name="OMX.qti.video.decoder.divxsw" type="video/divx" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="size" min="96x96" max="1920x1088" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
@@ -423,10 +423,10 @@
         <MediaCodec name="OMX.qti.video.decoder.divx4sw" type="video/divx4" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="size" min="96x96" max="1920x1088" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
diff --git a/conf_files/lito/media_codecs_vendor_audio.xml b/conf_files/lito/media_codecs_vendor_audio.xml
index e6273e9..aae3e59 100644
--- a/conf_files/lito/media_codecs_vendor_audio.xml
+++ b/conf_files/lito/media_codecs_vendor_audio.xml
@@ -16,6 +16,11 @@
      limitations under the License.
 -->
 <Included>
+    <Encoders>
+        <MediaCodec name="OMX.qcom.audio.encoder.mpegh" type="audio/mhas" rank="0">
+            <Limit name="concurrent-instances" max="1" />
+        </MediaCodec>
+    </Encoders>
     <Decoders>
         <MediaCodec name="OMX.google.opus.decoder" type="audio/opus" update="true" rank="100"/>
         <!-- SimpleOMXComponet based software decoder-->
diff --git a/conf_files/lito/media_codecs_vendor_v1.xml b/conf_files/lito/media_codecs_vendor_v1.xml
index 12888e0..86b9599 100644
--- a/conf_files/lito/media_codecs_vendor_v1.xml
+++ b/conf_files/lito/media_codecs_vendor_v1.xml
@@ -216,10 +216,10 @@
             <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="864x480" />
+            <Limit name="size" min="96x96" max="864x480" />
             <Limit name="alignment" value="4x4" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="48600" />
+            <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" />
@@ -229,10 +229,10 @@
              <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="864x480" />
+             <Limit name="size" min="96x96" max="864x480" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <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" />
@@ -382,10 +382,10 @@
         <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="128x128" max="864x480" />
+             <Limit name="size" min="96x96" max="864x480" />
              <Limit name="alignment" value="4x4" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="48600" />
+             <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" />
@@ -395,10 +395,10 @@
         <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="128x128" max="1920x1088" />
+             <Limit name="size" min="96x96" max="1920x1088" />
              <Limit name="alignment" value="2x2" />
              <Limit name="block-size" value="16x16" />
-             <Limit name="blocks-per-second" min="64" max="244800" />
+             <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" />
@@ -407,10 +407,10 @@
         <MediaCodec name="OMX.qti.video.decoder.divxsw" type="video/divx" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="size" min="96x96" max="1920x1088" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
@@ -419,10 +419,10 @@
         <MediaCodec name="OMX.qti.video.decoder.divx4sw" type="video/divx4" >
             <Quirk name="requires-allocate-on-input-ports" />
             <Quirk name="requires-allocate-on-output-ports" />
-            <Limit name="size" min="128x128" max="1920x1088" />
+            <Limit name="size" min="96x96" max="1920x1088" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
-            <Limit name="blocks-per-second" min="64" max="244800" />
+            <Limit name="blocks-per-second" min="36" max="244800" />
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
diff --git a/mm-core/Android.mk b/mm-core/Android.mk
index 65aaa1b..148c8a3 100644
--- a/mm-core/Android.mk
+++ b/mm-core/Android.mk
@@ -16,7 +16,7 @@
 #             Figure out the targets
 #===============================================================================
 
-ifeq ($(filter $(TARGET_BOARD_PLATFORM), kona),$(TARGET_BOARD_PLATFORM))
+ifeq ($(filter $(TARGET_BOARD_PLATFORM), kona lito),$(TARGET_BOARD_PLATFORM))
 OMXCORE_CFLAGS += -D_KONA_
 else ifeq ($(filter $(TARGET_BOARD_PLATFORM), $(MSMSTEPPE)),$(TARGET_BOARD_PLATFORM))
 OMXCORE_CFLAGS += -D_STEPPE_
diff --git a/mm-core/inc/OMX_QCOMExtns.h b/mm-core/inc/OMX_QCOMExtns.h
index bb1235e..4298213 100644
--- a/mm-core/inc/OMX_QCOMExtns.h
+++ b/mm-core/inc/OMX_QCOMExtns.h
@@ -693,6 +693,9 @@
 
     /* Configure Rectangle Region based ROI info */
     OMX_QTIIndexConfigVideoRoiRectRegionInfo = 0x7F100007,
+
+    /*"OMX.google.android.index.describeHDR10PlusInfo"*/
+    OMX_QTIIndexConfigDescribeHDR10PlusInfo = 0x7F100008,
 };
 
 /**
diff --git a/mm-core/inc/OMX_VideoExt.h b/mm-core/inc/OMX_VideoExt.h
index b80227c..a7db3d9 100644
--- a/mm-core/inc/OMX_VideoExt.h
+++ b/mm-core/inc/OMX_VideoExt.h
@@ -164,6 +164,7 @@
     // HDR profiles also support passing HDR metadata
     OMX_VIDEO_VP9Profile2HDR = 0x1000,
     OMX_VIDEO_VP9Profile3HDR = 0x2000,
+    OMX_VIDEO_VP9Profile2HDR10Plus = 0x4000,
     OMX_VIDEO_VP9ProfileUnknown = 0x6EFFFFFF,
     OMX_VIDEO_VP9ProfileMax = 0x7FFFFFFF
 } OMX_VIDEO_VP9PROFILETYPE;
diff --git a/mm-video-v4l2/vidc/common/src/vidc_common.cpp b/mm-video-v4l2/vidc/common/src/vidc_common.cpp
index 37e093d..0953f6b 100644
--- a/mm-video-v4l2/vidc/common/src/vidc_common.cpp
+++ b/mm-video-v4l2/vidc/common/src/vidc_common.cpp
@@ -89,6 +89,7 @@
             {OMX_VIDEO_VP9Profile0, V4L2_MPEG_VIDEO_VP9_PROFILE_0},
             {OMX_VIDEO_VP9Profile2, V4L2_MPEG_VIDEO_VP9_PROFILE_2},
             {OMX_VIDEO_VP9Profile2HDR, V4L2_MPEG_VIDEO_VP9_PROFILE_2},
+            {OMX_VIDEO_VP9Profile2HDR10Plus, V4L2_MPEG_VIDEO_VP9_PROFILE_2},
         });
 
 pl_map profile_level_converter::profile_vp9_v4l2_to_omx ({});
diff --git a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
index af4fa47..dce07cb 100644
--- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
+++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
@@ -57,6 +57,7 @@
 #include <unordered_map>
 #include <media/msm_media_info.h>
 #include <OMX_Core.h>
+#include <list>
 
 #include <linux/msm_ion.h>
 #if TARGET_ION_ABI_VERSION >= 2
@@ -349,6 +350,18 @@
 	unsigned long fps_numerator;
 };
 
+struct hdr10plusInfo {
+    bool is_new;
+    unsigned int cookie;
+    OMX_TICKS timestamp;
+    OMX_U32 nSize;
+    OMX_VERSIONTYPE nVersion;
+    OMX_U32 nPortIndex;
+    OMX_U32 nParamSize;
+    OMX_U32 nParamSizeUsed;
+    OMX_U8 payload[MAX_HDR10PLUSINFO_SIZE];
+};
+
 #ifdef USE_ION
 struct vdec_ion {
     int dev_fd;
@@ -981,6 +994,9 @@
         OMX_BUFFERHEADERTYPE  *m_client_output_extradata_mem_ptr;
         // number of input bitstream error frame count
         unsigned int m_inp_err_count;
+
+        pthread_mutex_t m_hdr10pluslock;
+        std::list<hdr10plusInfo> m_hdr10pluslist;
 #ifdef _ANDROID_
         // Timestamp list
         ts_arr_list           m_timestamp_list;
@@ -1008,6 +1024,8 @@
         // encapsulate the waiting states.
         uint64_t m_flags;
 
+        OMX_U32 m_etb_count;
+        OMX_TICKS m_etb_timestamp;
         // store I/P PORT state
         OMX_BOOL m_inp_bEnabled;
         // store O/P PORT state
@@ -1286,6 +1304,11 @@
         void get_preferred_color_aspects(ColorAspects& preferredColorAspects);
         void get_preferred_hdr_info(HDRStaticInfo& preferredHDRInfo);
         bool vdec_query_cap(struct v4l2_queryctrl &cap);
+        bool store_hdr10plusinfo(DescribeHDR10PlusInfoParams *hdr10plusinfo);
+        void update_hdr10plusinfo_cookie_using_timestamp(OMX_PTR cookie, OMX_TICKS timestamp);
+        void convert_hdr10plusinfo_to_metadata(OMX_PTR cookie, ColorMetaData &colorData);
+        void remove_hdr10plusinfo_using_cookie(OMX_PTR cookie);
+        void clear_hdr10plusinfo();
 public:
         bool m_buffer_error;
         OMX_VIDEO_PARAM_PROFILELEVELTYPE get_clientSet_profile_level() {
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 37071c4..ce7b0be 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -696,6 +696,7 @@
     pthread_mutex_init(&m_lock, NULL);
     pthread_mutex_init(&c_lock, NULL);
     pthread_mutex_init(&buf_lock, NULL);
+    pthread_mutex_init(&m_hdr10pluslock, NULL);
     sem_init(&m_cmd_lock,0,0);
     sem_init(&m_safe_flush, 0, 0);
     streaming[CAPTURE_PORT] =
@@ -729,6 +730,9 @@
     m_client_hdr_info.nPortIndex = (OMX_U32)OMX_CORE_INPUT_PORT_INDEX;
     m_internal_hdr_info.nPortIndex = (OMX_U32)OMX_CORE_OUTPUT_PORT_INDEX;
 
+    m_etb_count = 0;
+    m_etb_timestamp = 0;
+
     m_color_space = EXCEPT_BT2020;
 
     init_color_aspects_map();
@@ -849,9 +853,11 @@
     unsubscribe_to_events(drv_ctx.video_driver_fd);
     close(m_poll_efd);
     close(drv_ctx.video_driver_fd);
+    clear_hdr10plusinfo();
     pthread_mutex_destroy(&m_lock);
     pthread_mutex_destroy(&c_lock);
     pthread_mutex_destroy(&buf_lock);
+    pthread_mutex_destroy(&m_hdr10pluslock);
     sem_destroy(&m_cmd_lock);
     if (perf_flag) {
         DEBUG_PRINT_HIGH("--> TOTAL PROCESSING TIME");
@@ -2744,6 +2750,8 @@
             pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
                     OMX_EventCmdComplete,OMX_CommandFlush,
                     OMX_CORE_INPUT_PORT_INDEX,NULL );
+            //clear hdr10plusinfo list upon input flush done
+            clear_hdr10plusinfo();
         }
     }
 }
@@ -2835,9 +2843,10 @@
                              OMX_VIDEO_HEVCProfileMain10HDR10Plus };
     int mpeg2_profiles[2] = { OMX_VIDEO_MPEG2ProfileSimple,
                               OMX_VIDEO_MPEG2ProfileMain};
-    int vp9_profiles[3] = { OMX_VIDEO_VP9Profile0,
+    int vp9_profiles[4] = { OMX_VIDEO_VP9Profile0,
                             OMX_VIDEO_VP9Profile2,
-                            OMX_VIDEO_VP9Profile2HDR };
+                            OMX_VIDEO_VP9Profile2HDR,
+                            OMX_VIDEO_VP9Profile2HDR10Plus};
 
     if (!profileLevelType)
         return OMX_ErrorBadParameter;
@@ -3069,6 +3078,12 @@
 
             break;
         }
+        case OMX_QTIIndexConfigDescribeHDR10PlusInfo:
+        {
+            VALIDATE_OMX_PARAM_DATA(configData, DescribeHDR10PlusInfoParams);
+            //TODO
+            break;
+        }
         case OMX_IndexConfigAndroidVendorExtension:
         {
             VALIDATE_OMX_PARAM_DATA(configData, OMX_CONFIG_ANDROID_VENDOR_EXTENSIONTYPE);
@@ -3221,6 +3236,13 @@
         memcpy(&m_client_hdr_info, params, sizeof(DescribeHDRStaticInfoParams));
         return ret;
 
+    } else if ((int)configIndex == (int)OMX_QTIIndexConfigDescribeHDR10PlusInfo) {
+        VALIDATE_OMX_PARAM_DATA(configData, DescribeHDR10PlusInfoParams);
+        if (!store_hdr10plusinfo((DescribeHDR10PlusInfoParams *)configData)) {
+            DEBUG_PRINT_ERROR("Failed to set hdr10plus info");
+        }
+        return ret;
+
     } else if ((int)configIndex == (int)OMX_IndexConfigAndroidVendorExtension) {
         VALIDATE_OMX_PARAM_DATA(configData, OMX_CONFIG_ANDROID_VENDOR_EXTENSIONTYPE);
 
@@ -3309,6 +3331,8 @@
         *indexType = (OMX_INDEXTYPE)OMX_QTIIndexConfigDescribeColorAspects;
     } else if (extn_equals(paramName, "OMX.google.android.index.describeHDRStaticInfo")) {
         *indexType = (OMX_INDEXTYPE)OMX_QTIIndexConfigDescribeHDRColorInfo;
+    } else if (extn_equals(paramName, "OMX.google.android.index.describeHDR10PlusInfo")) {
+        *indexType = (OMX_INDEXTYPE)OMX_QTIIndexConfigDescribeHDR10PlusInfo;
     }else {
         DEBUG_PRINT_ERROR("Extension: %s not implemented", paramName);
         return OMX_ErrorNotImplemented;
@@ -4940,8 +4964,14 @@
         buffer->pBuffer = (OMX_U8*)drv_ctx.ptr_inputbuffer[nBufferIndex].bufferaddr;
     }
 
-    DEBUG_PRINT_LOW("[ETB] BHdr(%p) pBuf(%p) nTS(%lld) nFL(%u)",
-            buffer, buffer->pBuffer, buffer->nTimeStamp, (unsigned int)buffer->nFilledLen);
+    m_etb_count++;
+    //To handle wrap around case. m_etb_count++ to ensure value is non-zero.
+    if (!m_etb_count)
+        m_etb_count++;
+    m_etb_timestamp = buffer->nTimeStamp;
+    DEBUG_PRINT_LOW("[ETB] nCnt(%u) BHdr(%p) pBuf(%p) nTS(%lld) nFL(%u)",
+            m_etb_count, buffer, buffer->pBuffer, buffer->nTimeStamp, (unsigned int)buffer->nFilledLen);
+    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);
@@ -4994,7 +5024,7 @@
     /* return zero length and not an EOS buffer */
     if ((buffer->nFilledLen == 0) &&
             ((buffer->nFlags & OMX_BUFFERFLAG_EOS) == 0)) {
-        DEBUG_PRINT_HIGH("return zero legth buffer");
+        DEBUG_PRINT_HIGH("return zero length buffer");
         post_event ((unsigned long)buffer,VDEC_S_SUCCESS,
                 OMX_COMPONENT_GENERATE_EBD);
         return OMX_ErrorNone;
@@ -5107,6 +5137,8 @@
         buf.flags = V4L2_BUF_FLAG_EOS;
     }
 
+    // update hdr10plusinfo list with cookie as pMarkData
+    update_hdr10plusinfo_cookie_using_timestamp(buffer->pMarkData, buffer->nTimeStamp);
 
     OMX_ERRORTYPE eRet = OMX_ErrorNone;
     buf.index = nPortIndex;
@@ -8124,6 +8156,8 @@
                 get_preferred_hdr_info(final_hdr_info);
                 convert_color_aspects_to_metadata(final_color_aspects, color_mdata);
                 convert_hdr_info_to_metadata(final_hdr_info, color_mdata);
+                convert_hdr10plusinfo_to_metadata(p_buf_hdr->pMarkData, color_mdata);
+                remove_hdr10plusinfo_using_cookie(p_buf_hdr->pMarkData);
                 print_debug_hdr_color_info_mdata(&color_mdata);
                 print_debug_hdr10plus_metadata(color_mdata);
                 setMetaData(private_handle, COLOR_METADATA, (void*)&color_mdata);
@@ -8946,6 +8980,160 @@
     return rc;
 }
 
+bool omx_vdec::store_hdr10plusinfo(DescribeHDR10PlusInfoParams *hdr10plusdata)
+{
+    struct hdr10plusInfo metadata;
+
+    if (!hdr10plusdata) {
+        DEBUG_PRINT_ERROR("hdr10plus info not present");
+        return false;
+    }
+
+    if (hdr10plusdata->nParamSize > MAX_HDR10PLUSINFO_SIZE ||
+            hdr10plusdata->nParamSize < 1) {
+        DEBUG_PRINT_ERROR("Invalid hdr10plus metadata size %u", hdr10plusdata->nParamSize);
+        return false;
+    }
+
+    if (output_capability != V4L2_PIX_FMT_VP9) {
+        DEBUG_PRINT_ERROR("DescribeHDR10PlusInfoParams is not supported for %d codec",
+            output_capability);
+        return false;
+    }
+
+    memset(&metadata, 0, sizeof(struct hdr10plusInfo));
+    metadata.nSize = hdr10plusdata->nSize;
+    metadata.nVersion = hdr10plusdata->nVersion;
+    metadata.nPortIndex = hdr10plusdata->nPortIndex;
+    metadata.nParamSize = hdr10plusdata->nParamSize;
+    metadata.nParamSizeUsed = hdr10plusdata->nParamSizeUsed;
+    memcpy(metadata.payload, hdr10plusdata->nValue , hdr10plusdata->nParamSizeUsed);
+    metadata.is_new = true;
+
+    /*
+     * For the first setconfig, set the timestamp as zero. For
+     * the remaining, set the timestamp equal to previous
+     * etb timestamp + 1 to know this hdr10plus data arrived
+     * after previous etb.
+     */
+    if (m_etb_count) {
+        metadata.timestamp = m_etb_timestamp + 1;
+    }
+
+    pthread_mutex_lock(&m_hdr10pluslock);
+    DEBUG_PRINT_LOW("add hdr10plus info to the list with timestamp %lld and size %u",
+        metadata.timestamp, metadata.nParamSizeUsed);
+    m_hdr10pluslist.push_back(metadata);
+    pthread_mutex_unlock(&m_hdr10pluslock);
+
+    return true;
+}
+
+void omx_vdec::update_hdr10plusinfo_cookie_using_timestamp(OMX_PTR markdata, OMX_TICKS timestamp)
+{
+    std::list<hdr10plusInfo>::reverse_iterator iter;
+    unsigned int found = 0;
+    unsigned int cookie = (unsigned int)(unsigned long)markdata;
+
+    if (output_capability != V4L2_PIX_FMT_VP9)
+        return;
+
+    if (m_hdr10pluslist.empty()) {
+        DEBUG_PRINT_HIGH("update_hdr10plusinfo_cookie_using_timestamp: hdr10plusinfo list is empty!");
+        return;
+    }
+
+    /*
+     * look for the hdr10plus data which has timestamp nearest and
+     * lower than the etb timestamp, we should not take the
+     * hdr10plus data which has the timestamp greater than etb timestamp.
+     */
+    pthread_mutex_lock(&m_hdr10pluslock);
+    iter = m_hdr10pluslist.rbegin();
+    while (iter != m_hdr10pluslist.rend()) {
+        if (iter->timestamp <= timestamp && iter->is_new) {
+            found++;
+            if (found == 1) {
+                iter->cookie = cookie;
+                iter->is_new = false;
+                DEBUG_PRINT_LOW("Cookie value %u stored in hdr10plus list with timestamp %lld, size %u",
+                    iter->cookie, iter->timestamp, iter->nParamSizeUsed);
+            }
+        }
+        iter++;
+    }
+    pthread_mutex_unlock(&m_hdr10pluslock);
+
+    if(found > 1)
+        DEBUG_PRINT_HIGH("Multiple hdr10plus data not expected. Continue with the latest");
+}
+
+void omx_vdec::convert_hdr10plusinfo_to_metadata(OMX_PTR markdata, ColorMetaData &colorData)
+{
+    std::list<hdr10plusInfo>::iterator iter;
+    unsigned int cookie = (unsigned int)(unsigned long)markdata;
+
+    if (output_capability != V4L2_PIX_FMT_VP9)
+        return;
+
+    if (m_hdr10pluslist.empty()) {
+        DEBUG_PRINT_HIGH("convert_hdr10plusinfo_to_metadata: hdr10plus list is empty!");
+        return;
+    }
+
+    pthread_mutex_lock(&m_hdr10pluslock);
+    iter = m_hdr10pluslist.begin();
+    while (iter != m_hdr10pluslist.end()) {
+        if (iter->cookie == cookie && !iter->is_new) {
+            colorData.dynamicMetaDataValid = true;
+            colorData.dynamicMetaDataLen = iter->nParamSizeUsed;
+            memcpy(colorData.dynamicMetaDataPayload, iter->payload,
+                iter->nParamSizeUsed);
+            DEBUG_PRINT_LOW("found hdr10plus metadata for cookie %u with timestamp %lld, size %u",
+                cookie, iter->timestamp, colorData.dynamicMetaDataLen);
+            break;
+        }
+        iter++;
+    }
+    pthread_mutex_unlock(&m_hdr10pluslock);
+}
+
+void omx_vdec::remove_hdr10plusinfo_using_cookie(OMX_PTR markdata)
+{
+    std::list<hdr10plusInfo>::iterator iter;
+    unsigned int cookie = (unsigned int)(unsigned long)markdata;
+
+    if (output_capability != V4L2_PIX_FMT_VP9)
+        return;
+
+    if (m_hdr10pluslist.empty()) {
+        DEBUG_PRINT_HIGH("remove_hdr10plusinfo_using_cookie: hdr10plus list is empty!");
+        return;
+    }
+
+    pthread_mutex_lock(&m_hdr10pluslock);
+    iter = m_hdr10pluslist.begin();
+    while (iter != m_hdr10pluslist.end()) {
+        if (iter->cookie == cookie && !iter->is_new) {
+            iter = m_hdr10pluslist.erase(iter);
+            DEBUG_PRINT_LOW("removed hdr10plusinfo from the list for the cookie %u", cookie);
+            break;
+        }
+        iter++;
+    }
+    pthread_mutex_unlock(&m_hdr10pluslock);
+}
+
+void omx_vdec::clear_hdr10plusinfo()
+{
+    if (m_hdr10pluslist.empty() || output_capability != V4L2_PIX_FMT_VP9)
+        return;
+
+    pthread_mutex_lock(&m_hdr10pluslock);
+    m_hdr10pluslist.clear();
+    pthread_mutex_unlock(&m_hdr10pluslock);
+}
+
 void perf_metrics::start()
 {
     if (!active) {
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 0bc575b..ada2b7c 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
@@ -264,7 +264,7 @@
 
 struct statistics {
     struct timeval prev_tv;
-    int prev_fbd;
+    OMX_U32 prev_fbd;
     OMX_U32 bytes_generated;
 };
 
@@ -348,7 +348,7 @@
         OMX_U32 m_nDriver_fd;
         int m_poll_efd;
         int num_input_planes, num_output_planes;
-        int etb, ebd, ftb, fbd;
+        OMX_U32 etb, ebd, ftb, fbd;
 
         int nPframes_cache;
         int stopped;
@@ -525,6 +525,7 @@
             QOMX_VIDEO_INTRAPERIODTYPE intraperiod;
             OMX_CONFIG_INTRAREFRESHVOPTYPE intravoprefresh;
             OMX_CONFIG_ROTATIONTYPE rotation;
+            OMX_CONFIG_MIRRORTYPE mirror;
             OMX_VIDEO_VP8REFERENCEFRAMETYPE vp8refframe;
             OMX_QCOM_VIDEO_CONFIG_LTRMARK_TYPE markltr;
             OMX_QCOM_VIDEO_CONFIG_LTRUSE_TYPE useltr;
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 de9b696..b4233d8 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
@@ -439,14 +439,21 @@
 
         /* calc avg. fps, bitrate */
         struct timeval tv;
+        OMX_U64 current_time;
+        OMX_U64 prev_time;
         gettimeofday(&tv,NULL);
-        OMX_U64 time_diff = ((uint64_t) tv.tv_sec * (uint64_t) 1000000ULL + (uint64_t) tv.tv_usec) -
-                ((uint64_t) stats.prev_tv.tv_sec * (uint64_t) 1000000ULL + (uint64_t) stats.prev_tv.tv_usec);
-        if (time_diff >= 1000000) {
+        current_time = (OMX_U64)tv.tv_sec * 1000000ULL + (OMX_U64)tv.tv_usec;
+        prev_time = (OMX_U64)stats.prev_tv.tv_sec * 1000000ULL + (OMX_U64)stats.prev_tv.tv_usec;
+        if (current_time < prev_time) {
+            stats.prev_tv = tv;
+            stats.bytes_generated = 0;
+            stats.prev_fbd = omx->handle->fbd;
+        } else if (current_time - prev_time  >= 1000000ULL) {
             OMX_U32 num_fbd = omx->handle->fbd - stats.prev_fbd;
+            OMX_U64 time_diff = current_time - prev_time;
             if (stats.prev_tv.tv_sec && num_fbd && time_diff) {
-                float framerate = num_fbd * 1000000/(float)time_diff;
-                OMX_U64 bitrate = (stats.bytes_generated * 8 / num_fbd) * framerate;
+                float framerate = ((OMX_U64)num_fbd * 1000000ULL) / (float)time_diff;
+                OMX_U64 bitrate = ((OMX_U64)stats.bytes_generated * 8 / (float)num_fbd) * framerate;
                 DEBUG_PRINT_INFO("stats: avg. fps %0.2f, bitrate %llu",
                     framerate, bitrate);
             }
@@ -616,6 +623,11 @@
                 if (!venc_config_bitrate(&iter->config_data.bitrate))
                     goto bailout;
                 break;
+            case OMX_IndexConfigCommonMirror:
+                DEBUG_PRINT_LOW("handle_dynamic_config: OMX_IndexConfigCommonMirror");
+                if (!venc_set_mirror(iter->config_data.mirror.eMirror))
+                    goto bailout;
+                break;
             default:
                 DEBUG_PRINT_ERROR("Unsupported dynamic config type %d with timestamp %lld us", iter->type, iter->timestamp);
                 goto bailout;
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 6ffaf4f..0ddc8ce 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
@@ -480,6 +480,9 @@
         case OMX_IndexConfigVideoVp8ReferenceFrame:
             memcpy(&newConfig.config_data.vp8refframe, config, sizeof(OMX_VIDEO_VP8REFERENCEFRAMETYPE));
             break;
+        case OMX_IndexConfigCommonMirror:
+            memcpy(&newConfig.config_data.mirror, config, sizeof(OMX_CONFIG_MIRRORTYPE));
+            break;
         default:
             DEBUG_PRINT_INFO("Unsupported dynamic config.");
             return false;