Merge "mm-video-v4l2: venc: add dynamic flip support"
diff --git a/conf_files/kona/kona.mk b/conf_files/kona/kona.mk
index 9001279..a37eda3 100644
--- a/conf_files/kona/kona.mk
+++ b/conf_files/kona/kona.mk
@@ -11,7 +11,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/kona/media_codecs.xml b/conf_files/kona/media_codecs.xml
index 7cf5d2f..de6bde6 100644
--- a/conf_files/kona/media_codecs.xml
+++ b/conf_files/kona/media_codecs.xml
@@ -260,13 +260,14 @@
             <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="size" min="512x512" max="16384x16384" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
             <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-none" value="0" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
diff --git a/conf_files/kona/media_codecs_performance.xml b/conf_files/kona/media_codecs_performance.xml
index 29ecd0b..4766953 100644
--- a/conf_files/kona/media_codecs_performance.xml
+++ b/conf_files/kona/media_codecs_performance.xml
@@ -22,13 +22,13 @@
 <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-320x240" range="310-450" />
             <Limit name="measured-frame-rate-720x480" range="277-287" />
             <Limit name="measured-frame-rate-1280x720" range="200-204" />
             <Limit name="measured-frame-rate-1920x1080" range="116-118" />
         </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-320x240" range="295-435" />
             <Limit name="measured-frame-rate-720x480" range="336-339" />
             <Limit name="measured-frame-rate-1280x720" range="183-194" />
             <Limit name="measured-frame-rate-1920x1080" range="91-104" />
@@ -47,7 +47,7 @@
             <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">
-            <Limit name="measured-frame-rate-320x180" range="266-266" />
+            <Limit name="measured-frame-rate-320x180" range="355-520" />
             <Limit name="measured-frame-rate-640x360" range="165-165" />
             <Limit name="measured-frame-rate-1280x720" range="123-125" />
             <Limit name="measured-frame-rate-1920x1080" range="16-40" />
@@ -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 52c55fa..4a39b68 100644
--- a/conf_files/kona/media_codecs_vendor.xml
+++ b/conf_files/kona/media_codecs_vendor.xml
@@ -261,13 +261,14 @@
             <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="size" min="512x512" max="16384x16384" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
             <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-none" value="0" />
         </MediaCodec>
         <!-- Video Software -->
         <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
diff --git a/conf_files/kona/media_codecs_vendor_audio.xml b/conf_files/kona/media_codecs_vendor_audio.xml
index e6273e9..aae3e59 100644
--- a/conf_files/kona/media_codecs_vendor_audio.xml
+++ b/conf_files/kona/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/kona/media_profiles.xml b/conf_files/kona/media_profiles.xml
index bb9cd1f..924afcd 100644
--- a/conf_files/kona/media_profiles.xml
+++ b/conf_files/kona/media_profiles.xml
@@ -476,6 +476,88 @@
         <ImageEncoding quality="70" />
         <ImageDecoding memCap="20000000" />
 
+    <EncoderProfile quality="highspeedlow" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="6400000"
+             width="640"
+             height="480"
+             frameRate="240" />
+
+      <Audio codec="aac"
+             bitRate="156000"
+             sampleRate="48000"
+             channels="2" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeedhigh" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="120000000"
+             width="3840"
+             height="2160"
+             frameRate="120" />
+
+      <!-- audio setting is ignored -->
+      <Audio codec="aac"
+             bitRate="96000"
+             sampleRate="48000"
+             channels="1" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeed2160p" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="120000000"
+             width="3840"
+             height="2160"
+             frameRate="120" />
+
+      <!-- audio setting is ignored -->
+      <Audio codec="aac"
+             bitRate="96000"
+             sampleRate="48000"
+             channels="1" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeed1080p" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="50000000"
+             width="1920"
+             height="1080"
+             frameRate="120" />
+
+      <!-- audio setting is ignored -->
+      <Audio codec="aac"
+             bitRate="96000"
+             sampleRate="48000"
+             channels="1" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeed720p" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="88000000"
+             width="1280"
+             height="720"
+             frameRate="480" />
+
+      <!-- audio setting is ignored -->
+      <Audio codec="aac"
+             bitRate="96000"
+             sampleRate="48000"
+             channels="1" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeed480p" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="6400000"
+             width="640"
+             height="480"
+             frameRate="240" />
+
+      <Audio codec="aac"
+             bitRate="156000"
+             sampleRate="48000"
+             channels="2" />
+    </EncoderProfile>
+
     </CamcorderProfiles>
     <!-- Front Camera -->
     <CamcorderProfiles cameraId="1">
@@ -856,6 +938,88 @@
             channels="2" />
     </EncoderProfile>
 
+    <EncoderProfile quality="highspeedlow" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="6400000"
+             width="640"
+             height="480"
+             frameRate="240" />
+
+      <Audio codec="aac"
+             bitRate="156000"
+             sampleRate="48000"
+             channels="2" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeedhigh" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="120000000"
+             width="3840"
+             height="2160"
+             frameRate="120" />
+
+      <!-- audio setting is ignored -->
+      <Audio codec="aac"
+             bitRate="96000"
+             sampleRate="48000"
+             channels="1" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeed2160p" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="120000000"
+             width="3840"
+             height="2160"
+             frameRate="120" />
+
+      <!-- audio setting is ignored -->
+      <Audio codec="aac"
+             bitRate="96000"
+             sampleRate="48000"
+             channels="1" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeed1080p" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="50000000"
+             width="1920"
+             height="1080"
+             frameRate="120" />
+
+      <!-- audio setting is ignored -->
+      <Audio codec="aac"
+             bitRate="96000"
+             sampleRate="48000"
+             channels="1" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeed720p" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="88000000"
+             width="1280"
+             height="720"
+             frameRate="480" />
+
+      <!-- audio setting is ignored -->
+      <Audio codec="aac"
+             bitRate="96000"
+             sampleRate="48000"
+             channels="1" />
+    </EncoderProfile>
+
+    <EncoderProfile quality="highspeed480p" fileFormat="mp4" duration="30">
+      <Video codec="h264"
+             bitRate="6400000"
+             width="640"
+             height="480"
+             frameRate="240" />
+
+      <Audio codec="aac"
+             bitRate="156000"
+             sampleRate="48000"
+             channels="2" />
+    </EncoderProfile>
+
         <ImageEncoding quality="95" />
         <ImageEncoding quality="80" />
         <ImageEncoding quality="70" />
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 87f7f78..2b3fcaf 100644
--- a/conf_files/lito/media_codecs.xml
+++ b/conf_files/lito/media_codecs.xml
@@ -97,7 +97,7 @@
  |             | (4096)  (2304)  (30)    (120)           |
  | vc1         | 1920    1088    30      20      244800  |
  | div4/5/6-sw | 1920    1088    30      10      244800  |
- | h263-sw     | 864     480     30      16       48600   |
+ | h263-sw     | 864     480     30      16       48600  |
  | mpeg2       | 1920    1088    30      40      244800  |
  |_____________|_________________________________________|
 
@@ -152,6 +152,10 @@
             <Limit name="blocks-per-second" min="36" max="2073600" />
             <Limit name="bitrate" range="1-120000000" />
             <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" >
@@ -165,6 +169,10 @@
             <Limit name="bitrate" range="1-120000000" />
             <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" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -179,6 +187,10 @@
             <Limit name="concurrent-instances" max="16" />
             <Limit name="quality" range="0-100" default="80" />
             <Feature name="bitrate-modes" value="VBR,CBR,CQ" />
+            <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>
         <!-- Video Software -->
         <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
@@ -192,6 +204,7 @@
             <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" />
@@ -204,6 +217,7 @@
              <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>
@@ -219,6 +233,10 @@
             <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" />
@@ -232,6 +250,8 @@
             <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" />
@@ -244,6 +264,7 @@
             <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" />
@@ -257,6 +278,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.vp8" type="video/x-vnd.on2.vp8" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -269,6 +291,10 @@
             <Limit name="frame-rate" range="1-240" />
             <Feature name="adaptive-playback" />
             <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" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -281,6 +307,10 @@
             <Limit name="frame-rate" range="1-480" />
             <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" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -294,6 +324,8 @@
             <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.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -306,6 +338,10 @@
             <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.hevc.secure" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -319,6 +355,8 @@
             <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>
         <!-- Video Software -->
         <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
@@ -332,6 +370,7 @@
              <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" />
@@ -343,6 +382,7 @@
              <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="OMX.qti.video.decoder.divxsw" type="video/divx" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -354,6 +394,7 @@
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.divx4sw" type="video/divx4" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -365,6 +406,7 @@
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <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/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 7da517d..06ff889 100644
--- a/conf_files/lito/media_codecs_vendor.xml
+++ b/conf_files/lito/media_codecs_vendor.xml
@@ -97,7 +97,7 @@
  |             | (4096)  (2304)  (30)    (120)           |
  | vc1         | 1920    1088    30      20      244800  |
  | div4/5/6-sw | 1920    1088    30      10      244800  |
- | h263-sw     | 864     480     30      16       48600   |
+ | h263-sw     | 864     480     30      16       48600  |
  | mpeg2       | 1920    1088    30      40      244800  |
  |_____________|_________________________________________|
 
@@ -153,6 +153,10 @@
             <Limit name="blocks-per-second" min="36" max="2073600" />
             <Limit name="bitrate" range="1-120000000" />
             <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" >
@@ -166,6 +170,10 @@
             <Limit name="bitrate" range="1-120000000" />
             <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" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -180,6 +188,10 @@
             <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" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -188,9 +200,10 @@
             <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="6" />
+            <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" />
@@ -215,6 +228,7 @@
             <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" />
@@ -227,6 +241,7 @@
              <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>
@@ -242,6 +257,10 @@
             <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" />
@@ -255,6 +274,8 @@
             <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" />
@@ -267,6 +288,7 @@
             <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" />
@@ -280,6 +302,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.vp8" type="video/x-vnd.on2.vp8" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -292,6 +315,10 @@
             <Limit name="frame-rate" range="1-240" />
             <Feature name="adaptive-playback" />
             <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" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -304,6 +331,10 @@
             <Limit name="frame-rate" range="1-480" />
             <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" />
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -317,6 +348,8 @@
             <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.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -329,6 +362,10 @@
             <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.hevc.secure" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -342,6 +379,8 @@
             <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>
         <!-- Video Software -->
         <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
@@ -355,6 +394,7 @@
              <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" />
@@ -366,6 +406,7 @@
              <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="OMX.qti.video.decoder.divxsw" type="video/divx" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -377,6 +418,7 @@
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.divx4sw" type="video/divx4" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -388,6 +430,7 @@
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <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/lito/media_codecs_vendor_v1.xml b/conf_files/lito/media_codecs_vendor_v1.xml
index b4e4f62..89013d5 100644
--- a/conf_files/lito/media_codecs_vendor_v1.xml
+++ b/conf_files/lito/media_codecs_vendor_v1.xml
@@ -149,8 +149,12 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="blocks-per-second" min="36" max="1036800" />
             <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="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.vp8" type="video/x-vnd.on2.vp8" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -163,6 +167,8 @@
             <Limit name="bitrate" range="1-40000000" />
             <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" />
@@ -173,10 +179,14 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="blocks-per-second" min="36" max="1036800" />
             <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="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" />
@@ -185,9 +195,10 @@
             <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="6" />
+            <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" />
@@ -212,6 +223,7 @@
             <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" />
@@ -224,6 +236,7 @@
              <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>
@@ -236,9 +249,13 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="blocks-per-second" min="36" max="1036800" />
             <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="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" />
@@ -252,6 +269,9 @@
             <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" />
@@ -264,6 +284,7 @@
             <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" />
@@ -277,6 +298,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.vp8" type="video/x-vnd.on2.vp8" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -289,6 +311,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.vp9" type="video/x-vnd.on2.vp9" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -298,9 +322,13 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="blocks-per-second" min="36" max="1036800" />
             <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="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" />
@@ -314,6 +342,9 @@
             <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.hevc" type="video/hevc" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -323,9 +354,13 @@
             <Limit name="block-size" value="16x16" />
             <Limit name="blocks-per-second" min="36" max="1036800" />
             <Limit name="bitrate" range="1-120000000" />
-            <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="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" />
@@ -339,6 +374,9 @@
             <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>
         <!-- Video Software -->
         <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
@@ -352,6 +390,7 @@
              <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" />
@@ -363,6 +402,7 @@
              <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="OMX.qti.video.decoder.divxsw" type="video/divx" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -374,6 +414,7 @@
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <Limit name="concurrent-instances" max="4" />
+            <Limit name="performance-point-1920x1080" value="30" />
         </MediaCodec>
         <MediaCodec name="OMX.qti.video.decoder.divx4sw" type="video/divx4" >
             <Quirk name="requires-allocate-on-input-ports" />
@@ -385,6 +426,7 @@
             <Limit name="frame-rate" range="1-30" />
             <Limit name="bitrate" range="1-10000000" />
             <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/lito/media_profiles.xml b/conf_files/lito/media_profiles.xml
index a7ff232..56a2286 100644
--- a/conf_files/lito/media_profiles.xml
+++ b/conf_files/lito/media_profiles.xml
@@ -111,7 +111,7 @@
     <EncoderProfile quality="high" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -281,7 +281,7 @@
     <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -470,7 +470,7 @@
     <EncoderProfile quality="high" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -633,7 +633,7 @@
     <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -1120,7 +1120,7 @@
     <EncoderProfile quality="high" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -1290,7 +1290,7 @@
     <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -1480,7 +1480,7 @@
     <EncoderProfile quality="high" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -1650,7 +1650,7 @@
     <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -1840,7 +1840,7 @@
     <EncoderProfile quality="high" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
@@ -2010,7 +2010,7 @@
     <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
       <Video codec="h264"
              bitRate="42000000"
-             width="4096"
+             width="3840"
              height="2160"
              frameRate="30" />
 
diff --git a/mm-core/Android.mk b/mm-core/Android.mk
index 075169d..65aaa1b 100644
--- a/mm-core/Android.mk
+++ b/mm-core/Android.mk
@@ -16,8 +16,8 @@
 #             Figure out the targets
 #===============================================================================
 
-ifeq ($(filter $(TARGET_BOARD_PLATFORM), kona lito bengal),$(TARGET_BOARD_PLATFORM))
-OMXCORE_CFLAGS += -D_NILE_
+ifeq ($(filter $(TARGET_BOARD_PLATFORM), kona),$(TARGET_BOARD_PLATFORM))
+OMXCORE_CFLAGS += -D_KONA_
 else ifeq ($(filter $(TARGET_BOARD_PLATFORM), $(MSMSTEPPE)),$(TARGET_BOARD_PLATFORM))
 OMXCORE_CFLAGS += -D_STEPPE_
 else
@@ -97,7 +97,7 @@
 ifneq (,$(filter lito bengal kona $(MSMSTEPPE),$(TARGET_BOARD_PLATFORM)))
 LOCAL_SRC_FILES         += src/registry_table_android.c
 else
-LOCAL_SRC_FILES         += src/qc_registry_table_android.c
+LOCAL_SRC_FILES         += src/default/qc_registry_table_android.c
 endif
 
 include $(BUILD_SHARED_LIBRARY)
@@ -140,7 +140,7 @@
 ifneq (,$(filter lito bengal kona $(MSMSTEPPE),$(TARGET_BOARD_PLATFORM)))
 LOCAL_SRC_FILES         += src/$(MM_CORE_TARGET)/registry_table.c
 else
-LOCAL_SRC_FILES         += src/$(MM_CORE_TARGET)/qc_registry_table.c
+LOCAL_SRC_FILES         += src/$(MM_CORE_TARGET)/default/qc_registry_table.c
 endif
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/mm-core/src/registry_table.c b/mm-core/src/registry_table.c
index 2f396a8..494d14e 100644
--- a/mm-core/src/registry_table.c
+++ b/mm-core/src/registry_table.c
@@ -64,7 +64,6 @@
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.decoder.alac", "libOmxAlacDec.so", "audio_decoder.alac"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.decoder.ape", "libOmxApeDec.so", "audio_decoder.ape"),
     OMX_REGISTRY_ENTRY("OMX.qti.audio.decoder.dsd", "libOmxDsdDec.so", "audio_decoder.dsd"),
-    OMX_REGISTRY_ENTRY("OMX.qti.audio.decoder.mpegh", "libOmxMpeghDecSw.so", "audio_decoder.mpegh"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.aac", "libOmxAacEnc.so", "audio_encoder.aac"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.qcelp13", "libOmxQcelp13Enc.so", "audio_encoder.qcelp13"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.evrc", "libOmxEvrcEnc.so", "audio_encoder.evrc"),
@@ -72,10 +71,11 @@
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.decoder.aac", "libOmxAacDec.so", "audio_decoder.aac"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.decoder.multiaac", "libOmxAacDec.so", "audio_decoder.aac"),
     OMX_REGISTRY_ENTRY("OMX.qti.vdec.vpp", "libOmxVpp.so", "video_decoder.vpp"),
+#ifdef _KONA_
+    //Entries specific to kona
+    OMX_REGISTRY_ENTRY("OMX.qti.audio.decoder.mpegh", "libOmxMpeghDecSw.so", "audio_decoder.mpegh"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.mpegh", "libOmxMpeghEncSw.so", "audio_encoder.mpegh"),
-#ifdef _NILE_
-    //Entries specific to msmnile
-#endif //_NILE_
+#endif //_KONA_
 
 #ifdef _STEPPE_
     //Entries specific to msmsteppe
diff --git a/mm-core/src/registry_table_android.c b/mm-core/src/registry_table_android.c
index 1ad8796..417f3d1 100644
--- a/mm-core/src/registry_table_android.c
+++ b/mm-core/src/registry_table_android.c
@@ -76,13 +76,17 @@
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.decoder.ape", "libOmxApeDec.so", "audio_decoder.ape"),
     OMX_REGISTRY_ENTRY("OMX.qti.audio.decoder.ape.sw", "libOmxApeDecSw.so", "audio_decoder.ape"),
     OMX_REGISTRY_ENTRY("OMX.qti.audio.decoder.dsd", "libOmxDsdDec.so", "audio_decoder.dsd"),
-    OMX_REGISTRY_ENTRY("OMX.qti.audio.decoder.mpegh", "libOmxMpeghDecSw.so", "audio_decoder.mpegh"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.aac", "libOmxAacEnc.so", "audio_encoder.aac"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.qcelp13", "libOmxQcelp13Enc.so", "audio_encoder.qcelp13"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.evrc", "libOmxEvrcEnc.so", "audio_encoder.evrc"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.amrnb", "libOmxAmrEnc.so", "audio_encoder.amrnb"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.decoder.multiaac", "libOmxAacDec.so", "audio_decoder.aac"),
+
+#ifdef _KONA_
+    //Entries specific to kona
+    OMX_REGISTRY_ENTRY("OMX.qti.audio.decoder.mpegh", "libOmxMpeghDecSw.so", "audio_decoder.mpegh"),
     OMX_REGISTRY_ENTRY("OMX.qcom.audio.encoder.mpegh", "libOmxMpeghEncSw.so", "audio_encoder.mpegh"),
+#endif //_KONA_
 
     // HACK: Hidden components marker
     OMX_REGISTRY_ENTRY("OMX.QCOM.CUST.COMP.START", NULL, NULL),
diff --git a/mm-video-v4l2/vidc/common/inc/vidc_common.h b/mm-video-v4l2/vidc/common/inc/vidc_common.h
index 77d27ed..2cabbf9 100644
--- a/mm-video-v4l2/vidc/common/inc/vidc_common.h
+++ b/mm-video-v4l2/vidc/common/inc/vidc_common.h
@@ -95,7 +95,7 @@
     static bool convert_omx_profile_to_v4l2(int codec, int omx_profile, int *v4l2_profile);
     static bool convert_v4l2_level_to_omx(int codec, int v4l2_level, int *omx_level);
     static bool find_tier(int codec, int omx_level, unsigned int *tire);
-    static bool convert_omx_level_to_v4l2(int codec, int omx_level, int *v4l2_level, unsigned int *tire);
+    static bool convert_omx_level_to_v4l2(int codec, int omx_level, int *v4l2_level);
 };
 
 void get_gralloc_format_as_string(char * buf, int buf_len, int format);
diff --git a/mm-video-v4l2/vidc/common/inc/vidc_debug.h b/mm-video-v4l2/vidc/common/inc/vidc_debug.h
old mode 100644
new mode 100755
index d935fdd..ca24a57
--- a/mm-video-v4l2/vidc/common/inc/vidc_debug.h
+++ b/mm-video-v4l2/vidc/common/inc/vidc_debug.h
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2013 - 2017, The Linux Foundation. All rights reserved.
+Copyright (c) 2013 - 2019, 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:
@@ -45,6 +45,7 @@
 #include <color_metadata.h>
 #define STRINGIFY_ENUMS
 #include "media/hardware/VideoAPI.h"
+#include "media/msm_vidc_utils.h"
 
 using android::ColorAspects;
 using android::HDRStaticInfo;
@@ -200,6 +201,12 @@
             ts.tv_sec  += 1;
         }
         int ret = pthread_cond_timedwait(&condition, &mutex, &ts);
+        //as the mutex lock is released inside timedwait first
+        //the singalled variant maybe changed by the main thread in some rare cases
+        //meanwhile still returns wait time out
+        //need to double check it and return 0 to process the last cmd/event during time out
+        if (signalled)
+            ret = 0;
         signalled = false;
         pthread_mutex_unlock(&mutex);
         return ret;
diff --git a/mm-video-v4l2/vidc/common/src/vidc_common.cpp b/mm-video-v4l2/vidc/common/src/vidc_common.cpp
index 217dab1..37e093d 100644
--- a/mm-video-v4l2/vidc/common/src/vidc_common.cpp
+++ b/mm-video-v4l2/vidc/common/src/vidc_common.cpp
@@ -58,12 +58,14 @@
 pl_map profile_level_converter::profile_hevc_omx_to_v4l2 ({
             {OMX_VIDEO_HEVCProfileMain,
                         V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN},
+            {OMX_VIDEO_HEVCProfileMain10,
+                        V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10},
+            {OMX_VIDEO_HEVCProfileMainStill,
+                        V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE},
             {OMX_VIDEO_HEVCProfileMain10HDR10,
                         V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10},
             {OMX_VIDEO_HEVCProfileMain10HDR10Plus,
                         V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10},
-            {OMX_VIDEO_HEVCProfileMainStill,
-                        V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE},
         });
 
 pl_map profile_level_converter::profile_hevc_v4l2_to_omx ({});
@@ -85,6 +87,7 @@
 
 pl_map profile_level_converter::profile_vp9_omx_to_v4l2 ({
             {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},
         });
 
@@ -129,19 +132,6 @@
             {OMX_VIDEO_HEVCMainTierLevel6,  V4L2_MPEG_VIDEO_HEVC_LEVEL_6},
             {OMX_VIDEO_HEVCMainTierLevel61, V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1},
             {OMX_VIDEO_HEVCMainTierLevel62, V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2},
-            {OMX_VIDEO_HEVCHighTierLevel1,  V4L2_MPEG_VIDEO_HEVC_LEVEL_1},
-            {OMX_VIDEO_HEVCHighTierLevel2,  V4L2_MPEG_VIDEO_HEVC_LEVEL_2},
-            {OMX_VIDEO_HEVCHighTierLevel21, V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1},
-            {OMX_VIDEO_HEVCHighTierLevel3,  V4L2_MPEG_VIDEO_HEVC_LEVEL_3},
-            {OMX_VIDEO_HEVCHighTierLevel31, V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1},
-            {OMX_VIDEO_HEVCHighTierLevel4,  V4L2_MPEG_VIDEO_HEVC_LEVEL_4},
-            {OMX_VIDEO_HEVCHighTierLevel41, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1},
-            {OMX_VIDEO_HEVCHighTierLevel5,  V4L2_MPEG_VIDEO_HEVC_LEVEL_5},
-            {OMX_VIDEO_HEVCHighTierLevel51, V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1},
-            {OMX_VIDEO_HEVCHighTierLevel52, V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2},
-            {OMX_VIDEO_HEVCHighTierLevel6,  V4L2_MPEG_VIDEO_HEVC_LEVEL_6},
-            {OMX_VIDEO_HEVCHighTierLevel61, V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1},
-            {OMX_VIDEO_HEVCHighTierLevel62, V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2},
         });
 
 pl_map profile_level_converter::level_hevc_v4l2_to_omx ({});
@@ -315,14 +305,14 @@
     return true;
 }
 
-bool profile_level_converter::convert_omx_level_to_v4l2(int codec, int omx_level, int *v4l2_level, unsigned int *tier)
+bool profile_level_converter::convert_omx_level_to_v4l2(int codec, int omx_level, int *v4l2_level)
 {
     pl_map *level_map;
 
     if (!find_map(level_omx_to_v4l2_map, codec, &level_map))
         return false;
 
-    return find_item(*level_map, omx_level, v4l2_level) && find_tier(codec, omx_level, tier);
+    return find_item(*level_map, omx_level, v4l2_level);
 }
 
 void get_gralloc_format_as_string(char * buf, int buf_len, int format) {
diff --git a/mm-video-v4l2/vidc/common/src/vidc_debug.cpp b/mm-video-v4l2/vidc/common/src/vidc_debug.cpp
index b775287..8a3c164 100644
--- a/mm-video-v4l2/vidc/common/src/vidc_debug.cpp
+++ b/mm-video-v4l2/vidc/common/src/vidc_debug.cpp
@@ -50,18 +50,18 @@
             "%s: %s: idx %2d userptr %#lx fd %d off %d size %d filled %d flags %#x\n",
             str, v4l2->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ?
             "OUTPUT" : "CAPTURE", v4l2->index,
-            v4l2->m.planes[0].m.userptr, v4l2->m.planes[0].reserved[0],
-            v4l2->m.planes[0].reserved[1], v4l2->m.planes[0].length,
+            v4l2->m.planes[0].m.userptr, v4l2->m.planes[0].reserved[MSM_VIDC_BUFFER_FD],
+            v4l2->m.planes[0].reserved[MSM_VIDC_DATA_OFFSET], v4l2->m.planes[0].length,
             v4l2->m.planes[0].bytesused, v4l2->flags);
     else
         DEBUG_PRINT_HIGH(
             "%s: %s: idx %2d userptr %#lx fd %d off %d size %d filled %d flags %#x, extradata: fd %d off %d size %d filled %d\n",
             str, v4l2->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ?
             "OUTPUT" : "CAPTURE", v4l2->index,
-            v4l2->m.planes[0].m.userptr, v4l2->m.planes[0].reserved[0],
-            v4l2->m.planes[0].reserved[1], v4l2->m.planes[0].length,
-            v4l2->m.planes[0].bytesused, v4l2->m.planes[1].reserved[0],
-            v4l2->flags, v4l2->m.planes[1].reserved[1],
+            v4l2->m.planes[0].m.userptr, v4l2->m.planes[0].reserved[MSM_VIDC_BUFFER_FD],
+            v4l2->m.planes[0].reserved[MSM_VIDC_DATA_OFFSET], v4l2->m.planes[0].length,
+            v4l2->m.planes[0].bytesused, v4l2->m.planes[1].reserved[MSM_VIDC_BUFFER_FD],
+            v4l2->flags, v4l2->m.planes[1].reserved[MSM_VIDC_DATA_OFFSET],
             v4l2->m.planes[1].length, v4l2->m.planes[1].bytesused);
 }
 
diff --git a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
index b666cd6..af4fa47 100644
--- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
+++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
@@ -851,7 +851,7 @@
         void adjust_timestamp(OMX_S64 &act_timestamp);
         void set_frame_rate(OMX_S64 act_timestamp);
         bool handle_extradata(OMX_BUFFERHEADERTYPE *p_buf_hdr);
-        void convert_color_space_info(OMX_U32 primaries, OMX_U32 range,
+        void convert_color_space_info(OMX_U32 primaries,
             OMX_U32 transfer, OMX_U32 matrix,
             ColorAspects *aspects);
         bool handle_color_space_info(void *data);
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp b/mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp
index 6707653..9c04ae1 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp
@@ -3527,8 +3527,9 @@
 
         m_port_ip.def.nBufferSize        = p_buffer_req->size;
         m_port_ip.def.nBufferCountMin    = p_buffer_req->mincount;
-        m_port_ip.def.nBufferCountActual = MAX(p_buffer_req->mincount,
-                                               OMX_SWVDEC_IP_BUFFER_COUNT_MIN);
+        m_port_ip.def.nBufferCountActual = MAX((MAX(p_buffer_req->mincount,
+                                               OMX_SWVDEC_IP_BUFFER_COUNT_MIN)),
+                                               m_port_ip.def.nBufferCountActual);
         m_port_ip.def.nBufferAlignment   = p_buffer_req->alignment;
 
         OMX_SWVDEC_LOG_HIGH("ip port: %d bytes x %d, %d-byte aligned",
@@ -4795,7 +4796,6 @@
         (unsigned int)p_ion_buf_info->alloc_data.heap_id_mask);
 
     if (p_ion_buf_info->data_fd >= 0) {
-        close(p_ion_buf_info->data_fd);
         p_ion_buf_info->data_fd = -1;
     }
 
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 9f821fb..37071c4 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -206,15 +206,15 @@
 
                 vdec_msg.msgcode=VDEC_MSG_EVT_CONFIG_CHANGED;
                 vdec_msg.status_code=VDEC_S_SUCCESS;
-                vdec_msg.msgdata.output_frame.picsize.frame_height = ptr[0];
-                vdec_msg.msgdata.output_frame.picsize.frame_width = ptr[1];
+                vdec_msg.msgdata.output_frame.picsize.frame_height = ptr[MSM_VIDC_HEIGHT];
+                vdec_msg.msgdata.output_frame.picsize.frame_width = ptr[MSM_VIDC_WIDTH];
                 vdec_msg.msgdata.output_frame.flags = true; // INSUFFICIENT event
                 DEBUG_PRINT_HIGH("VIDC Port Reconfig received insufficient");
-                omx->dpb_bit_depth = ptr[2];
-                DEBUG_PRINT_HIGH("VIDC Port Reconfig Bitdepth - %d", ptr[2]);
-                omx->m_progressive = ptr[3];
-                DEBUG_PRINT_HIGH("VIDC Port Reconfig PicStruct - %d", ptr[3]);
-                omx->m_color_space = (ptr[4] == MSM_VIDC_BT2020 ? (omx_vdec::BT2020):
+                omx->dpb_bit_depth = ptr[MSM_VIDC_BIT_DEPTH];
+                DEBUG_PRINT_HIGH("VIDC Port Reconfig Bitdepth - %d", ptr[MSM_VIDC_BIT_DEPTH]);
+                omx->m_progressive = ptr[MSM_VIDC_PIC_STRUCT];
+                DEBUG_PRINT_HIGH("VIDC Port Reconfig PicStruct - %d", ptr[MSM_VIDC_PIC_STRUCT]);
+                omx->m_color_space = (ptr[MSM_VIDC_COLOR_SPACE] == MSM_VIDC_BT2020 ? (omx_vdec::BT2020):
                                       (omx_vdec:: EXCEPT_BT2020));
                 DEBUG_PRINT_HIGH("VIDC Port Reconfig ColorSpace - %d", omx->m_color_space);
                 if (omx->async_message_process(input,&vdec_msg) < 0) {
@@ -2449,7 +2449,7 @@
                struct timespec ts;
 
                clock_gettime(CLOCK_REALTIME, &ts);
-               ts.tv_sec += 2;
+               ts.tv_sec += 1;
                DEBUG_PRINT_LOW("waiting for %d EBDs of CODEC CONFIG buffers ",
                        m_queued_codec_config_count);
                BITMASK_SET(&m_flags, OMX_COMPONENT_FLUSH_DEFERRED);
@@ -2828,15 +2828,16 @@
                             QOMX_VIDEO_AVCProfileMain,
                             QOMX_VIDEO_AVCProfileConstrainedHigh,
                             QOMX_VIDEO_AVCProfileHigh };
-    int hevc_profiles[4] = { OMX_VIDEO_HEVCProfileMain,
+    int hevc_profiles[5] = { OMX_VIDEO_HEVCProfileMain,
                              OMX_VIDEO_HEVCProfileMain10,
+                             OMX_VIDEO_HEVCProfileMainStill,
                              OMX_VIDEO_HEVCProfileMain10HDR10,
                              OMX_VIDEO_HEVCProfileMain10HDR10Plus };
     int mpeg2_profiles[2] = { OMX_VIDEO_MPEG2ProfileSimple,
                               OMX_VIDEO_MPEG2ProfileMain};
     int vp9_profiles[3] = { OMX_VIDEO_VP9Profile0,
                             OMX_VIDEO_VP9Profile2,
-                            OMX_VIDEO_VP9Profile2HDR};
+                            OMX_VIDEO_VP9Profile2HDR };
 
     if (!profileLevelType)
         return OMX_ErrorBadParameter;
@@ -2949,39 +2950,9 @@
     /* Check if the profile is supported by driver or not  */
     /* During query caps of profile driver sends a mask of */
     /* of all v4l2 profiles supported(in the flags field)  */
-    if((output_capability != V4L2_PIX_FMT_HEVC) &&
-         (output_capability != V4L2_PIX_FMT_VP9)) {
-        if (!profile_level_converter::convert_omx_profile_to_v4l2(output_capability, profileLevelType->eProfile, &v4l2_profile)) {
-            DEBUG_PRINT_ERROR("Invalid profile, cannot find corresponding omx profile");
-            return OMX_ErrorHardware;
-        }
-    }else if(output_capability == V4L2_PIX_FMT_HEVC) { //convert omx profile to v4l2 profile for HEVC Main10 and Main10HDR10 profiles,seperately
-        switch (profileLevelType->eProfile) {
-            case OMX_VIDEO_HEVCProfileMain:
-                v4l2_profile = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN;
-                break;
-            case OMX_VIDEO_HEVCProfileMain10:
-            case OMX_VIDEO_HEVCProfileMain10HDR10:
-            case OMX_VIDEO_HEVCProfileMain10HDR10Plus:
-                v4l2_profile = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10;
-                break;
-            default:
-                DEBUG_PRINT_ERROR("Invalid profile, cannot find corresponding omx profile");
-                return OMX_ErrorHardware;
-        }
-    }else { //convert omx profile to v4l2 profile for VP9 Profile2 and VP9 Profile2HDR profiles,seperately
-        switch (profileLevelType->eProfile) {
-            case OMX_VIDEO_VP9Profile0:
-                v4l2_profile = V4L2_MPEG_VIDEO_VP9_PROFILE_0;
-                break;
-            case OMX_VIDEO_VP9Profile2:
-            case OMX_VIDEO_VP9Profile2HDR:
-                v4l2_profile = V4L2_MPEG_VIDEO_VP9_PROFILE_2;
-                break;
-            default:
-                DEBUG_PRINT_ERROR("Invalid profile, cannot find corresponding omx profile");
-                return OMX_ErrorHardware;
-        }
+    if (!profile_level_converter::convert_omx_profile_to_v4l2(output_capability, profileLevelType->eProfile, &v4l2_profile)) {
+        DEBUG_PRINT_ERROR("Invalid profile, cannot find corresponding omx profile");
+        return OMX_ErrorHardware;
     }
     if(!((profile_cap.flags >> v4l2_profile) & 0x1)) {
         DEBUG_PRINT_ERROR("%s: Invalid index corresponding profile not supported : %d ",__FUNCTION__, profileLevelType->eProfile);
@@ -5145,10 +5116,10 @@
     plane.length = drv_ctx.ip_buf.buffer_size;
     plane.m.userptr = (unsigned long)temp_buffer->bufferaddr -
         (unsigned long)temp_buffer->offset;
-    plane.reserved[0] = temp_buffer->pmem_fd;
-    plane.reserved[1] = temp_buffer->offset;
-    plane.reserved[3] = (unsigned long)buffer->pMarkData;
-    plane.reserved[4] = (unsigned long)buffer->hMarkTargetComponent;
+    plane.reserved[MSM_VIDC_BUFFER_FD] = temp_buffer->pmem_fd;
+    plane.reserved[MSM_VIDC_DATA_OFFSET] = temp_buffer->offset;
+    plane.reserved[MSM_VIDC_INPUT_TAG_1] = (unsigned long)buffer->pMarkData;
+    plane.reserved[MSM_VIDC_INPUT_TAG_2] = (unsigned long)buffer->hMarkTargetComponent;
     plane.data_offset = 0;
     buf.m.planes = &plane;
     buf.length = 1;
@@ -5405,8 +5376,8 @@
     plane[0].m.userptr =
         (unsigned long)omx_ptr_outputbuffer[bufIndex].bufferaddr -
         (unsigned long)omx_ptr_outputbuffer[bufIndex].offset;
-    plane[0].reserved[0] = omx_ptr_outputbuffer[bufIndex].pmem_fd;
-    plane[0].reserved[1] = omx_ptr_outputbuffer[bufIndex].offset;
+    plane[0].reserved[MSM_VIDC_BUFFER_FD] = omx_ptr_outputbuffer[bufIndex].pmem_fd;
+    plane[0].reserved[MSM_VIDC_DATA_OFFSET] = omx_ptr_outputbuffer[bufIndex].offset;
     plane[0].data_offset = 0;
     extra_idx = EXTRADATA_IDX(drv_ctx.num_planes);
     if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
@@ -5414,9 +5385,9 @@
         plane[extra_idx].length = drv_ctx.extradata_info.buffer_size;
         plane[extra_idx].m.userptr = (long unsigned int)drv_ctx.extradata_info.ion[bufIndex].uaddr;
 #ifdef USE_ION
-        plane[extra_idx].reserved[0] = drv_ctx.extradata_info.ion[bufIndex].data_fd;
+        plane[extra_idx].reserved[MSM_VIDC_BUFFER_FD] = drv_ctx.extradata_info.ion[bufIndex].data_fd;
 #endif
-        plane[extra_idx].reserved[1] = 0;
+        plane[extra_idx].reserved[MSM_VIDC_DATA_OFFSET] = 0;
         plane[extra_idx].data_offset = 0;
     } else if (extra_idx >= VIDEO_MAX_PLANES) {
         DEBUG_PRINT_ERROR("Extradata index higher than expected: %u", extra_idx);
@@ -6390,8 +6361,8 @@
                    (((struct vdec_output_frameinfo *)omxhdr->pOutputPortPrivate
                      - omx_ptr_respbuffer) < (int)omx->drv_ctx.op_buf.actualcount)) {
 
-               omxhdr->pMarkData = (OMX_PTR)(unsigned long)plane[0].reserved[3];
-               omxhdr->hMarkTargetComponent = (OMX_HANDLETYPE)(unsigned long)plane[0].reserved[4];
+               omxhdr->pMarkData = (OMX_PTR)(unsigned long)plane[0].reserved[MSM_VIDC_INPUT_TAG_1];
+               omxhdr->hMarkTargetComponent = (OMX_HANDLETYPE)(unsigned long)plane[0].reserved[MSM_VIDC_INPUT_TAG_2];
 
                if (vdec_msg->msgdata.output_frame.len <=  omxhdr->nAllocLen) {
                    omxhdr->nFilledLen = vdec_msg->msgdata.output_frame.len;
@@ -6449,23 +6420,6 @@
                            vdec_msg->msgdata.output_frame.framesize.bottom = omx->m_extradata_misr.output_crop_rect.nHeight;
                            vdec_msg->msgdata.output_frame.picsize.frame_width = omx->m_extradata_misr.output_width;
                            vdec_msg->msgdata.output_frame.picsize.frame_height = omx->m_extradata_misr.output_height;
-                       } else {
-                           DEBUG_PRINT_LOW("Read FBD crop from v4l2 reserved fields");
-                           vdec_msg->msgdata.output_frame.framesize.left = plane[0].reserved[2];
-                           vdec_msg->msgdata.output_frame.framesize.top = plane[0].reserved[3];
-                           vdec_msg->msgdata.output_frame.framesize.right = plane[0].reserved[2] + plane[0].reserved[4];
-                           vdec_msg->msgdata.output_frame.framesize.bottom = plane[0].reserved[3] + plane[0].reserved[5];
-                           vdec_msg->msgdata.output_frame.picsize.frame_width = plane[0].reserved[6];
-                           vdec_msg->msgdata.output_frame.picsize.frame_height = plane[0].reserved[7];
-
-                           /* Copy these values back to OMX internal variables to make both handlign same*/
-
-                           omx->m_extradata_misr.output_crop_rect.nLeft = vdec_msg->msgdata.output_frame.framesize.left;
-                           omx->m_extradata_misr.output_crop_rect.nTop = vdec_msg->msgdata.output_frame.framesize.top;
-                           omx->m_extradata_misr.output_crop_rect.nWidth = vdec_msg->msgdata.output_frame.framesize.right;
-                           omx->m_extradata_misr.output_crop_rect.nHeight = vdec_msg->msgdata.output_frame.framesize.bottom;
-                           omx->m_extradata_misr.output_width = vdec_msg->msgdata.output_frame.picsize.frame_width;
-                           omx->m_extradata_misr.output_height = vdec_msg->msgdata.output_frame.picsize.frame_height;
                        }
                    }
 
@@ -7518,7 +7472,7 @@
     prev_ts = act_timestamp;
 }
 
-void omx_vdec::convert_color_space_info(OMX_U32 primaries, OMX_U32 range,
+void omx_vdec::convert_color_space_info(OMX_U32 primaries,
     OMX_U32 transfer, OMX_U32 matrix, ColorAspects *aspects)
 {
     switch (primaries) {
@@ -7548,8 +7502,6 @@
             break;
     }
 
-    aspects->mRange = range ? ColorAspects::RangeFull : ColorAspects::RangeLimited;
-
     switch (transfer) {
         case MSM_VIDC_TRANSFER_BT709_5:
         case MSM_VIDC_TRANSFER_601_6_525: // case MSM_VIDC_TRANSFER_601_6_625:
@@ -7632,7 +7584,7 @@
 
                 if (seqdisp_payload && seqdisp_payload->color_descp) {
 
-                    convert_color_space_info(seqdisp_payload->color_primaries, 0,
+                    convert_color_space_info(seqdisp_payload->color_primaries,
                             seqdisp_payload->transfer_char, seqdisp_payload->matrix_coeffs,
                             aspects);
                     /* MPEG2 seqdisp payload doesn't give range info. Hence assing the value
@@ -7647,17 +7599,20 @@
         case V4L2_PIX_FMT_HEVC:
             {
                 struct msm_vidc_vui_display_info_payload *display_info_payload;
+                OMX_U32 range;
                 display_info_payload = (struct msm_vidc_vui_display_info_payload*)data;
 
                 /* Refer H264 Spec @ Rec. ITU-T H.264 (02/2014) to understand this code */
 
-                if (display_info_payload->video_signal_present_flag &&
-                        display_info_payload->color_description_present_flag) {
-                    convert_color_space_info(display_info_payload->color_primaries,
-                            display_info_payload->video_full_range_flag,
-                            display_info_payload->transfer_char,
-                            display_info_payload->matrix_coeffs,
-                            aspects);
+                if (display_info_payload->video_signal_present_flag) {
+                    range = display_info_payload->video_full_range_flag;
+                    aspects->mRange = range ? ColorAspects::RangeFull : ColorAspects::RangeLimited;
+                    if (display_info_payload->color_description_present_flag) {
+                        convert_color_space_info(display_info_payload->color_primaries,
+                                display_info_payload->transfer_char,
+                                display_info_payload->matrix_coeffs,
+                                aspects);
+                    }
                 }
             }
             break;
@@ -8711,15 +8666,29 @@
 void omx_vdec::send_codec_config()
 {
     if (codec_config_flag) {
-        unsigned long p1 = 0; // Parameter - 1
-        unsigned long p2 = 0; // Parameter - 2
-        unsigned long ident = 0;
+        unsigned long p1 = 0, p2 = 0;
+        unsigned long p3 = 0, p4 = 0;
+        unsigned long ident = 0, ident2 = 0;
         pthread_mutex_lock(&m_lock);
         DEBUG_PRINT_LOW("\n Check Queue for codec_config buffer \n");
         while (m_etb_q.m_size) {
             m_etb_q.pop_entry(&p1,&p2,&ident);
             if (ident == OMX_COMPONENT_GENERATE_ETB) {
                 if (((OMX_BUFFERHEADERTYPE *)p2)->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
+                    while (m_ftb_q.m_size) {
+                        m_ftb_q.pop_entry(&p3,&p4,&ident2);
+                        if (ident2 == OMX_COMPONENT_GENERATE_FTB) {
+                            pthread_mutex_unlock(&m_lock);
+                            if (fill_this_buffer_proxy((OMX_HANDLETYPE)p3,\
+                                        (OMX_BUFFERHEADERTYPE *)p4) != OMX_ErrorNone) {
+                                DEBUG_PRINT_ERROR("\n fill_this_buffer_proxy failure");
+                                omx_report_error ();
+                            }
+                            pthread_mutex_lock(&m_lock);
+                        } else if (ident2 == OMX_COMPONENT_GENERATE_FBD) {
+                            fill_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p3);
+                        }
+                    }
                     pthread_mutex_unlock(&m_lock);
                     if (empty_this_buffer_proxy((OMX_HANDLETYPE)p1,\
                                 (OMX_BUFFERHEADERTYPE *)p2) != OMX_ErrorNone) {
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 5cd20cf..7420dbb 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
@@ -461,6 +461,7 @@
         bool venc_store_dynamic_config(OMX_INDEXTYPE type, OMX_PTR config);
         bool venc_cvp_enable(private_handle_t *handle);
         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);
 
         OMX_U32 pmem_free();
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 36657b7..90913e3 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
@@ -641,7 +641,7 @@
     int height = m_sVenc_cfg.input_height;
     int width = m_sVenc_cfg.input_width;
     OMX_TICKS nTimeStamp = static_cast<OMX_TICKS>(buf.timestamp.tv_sec) * 1000000 + buf.timestamp.tv_usec;
-    int fd = buf.m.planes[0].reserved[0];
+    int fd = buf.m.planes[0].reserved[MSM_VIDC_BUFFER_FD];
     char *p_extradata = NULL;
     OMX_OTHER_EXTRADATATYPE *data = NULL;
     struct roidata roi;
@@ -970,9 +970,11 @@
                             QOMX_VIDEO_AVCProfileMain,
                             QOMX_VIDEO_AVCProfileConstrainedHigh,
                             QOMX_VIDEO_AVCProfileHigh };
-    int hevc_profiles[3] = { OMX_VIDEO_HEVCProfileMain,
+    int hevc_profiles[5] = { OMX_VIDEO_HEVCProfileMain,
+                             OMX_VIDEO_HEVCProfileMain10,
+                             OMX_VIDEO_HEVCProfileMainStill,
                              OMX_VIDEO_HEVCProfileMain10HDR10,
-                             OMX_VIDEO_HEVCProfileMainStill };
+                             OMX_VIDEO_HEVCProfileMain10HDR10Plus };
 
     if (!profileLevelType)
         return OMX_ErrorBadParameter;
@@ -1819,13 +1821,6 @@
             return false;
         }
 
-        /* Need more buffers for HFR usecase */
-        if (operating_rate >= 120 || (m_sVenc_cfg.fps_num / m_sVenc_cfg.fps_den) >= 120) {
-            minCount = MAX(minCount, 16);
-            DEBUG_PRINT_HIGH("fps %d, operating rate %d, input min count %d",
-                   (int)(m_sVenc_cfg.fps_num / m_sVenc_cfg.fps_den), operating_rate, minCount);
-        }
-
         // Request MAX_V4L2_BUFS from V4L2 in batch mode.
         // Keep the original count for the client
         if (metadatamode && mBatchSize) {
@@ -1922,13 +1917,6 @@
             DEBUG_PRINT_LOW("set min count %d as mBatchSize %d", minCount, mBatchSize);
         }
 
-        /* Need more buffers for HFR usecase */
-        if (operating_rate >= 120 || (m_sVenc_cfg.fps_num / m_sVenc_cfg.fps_den) >= 120) {
-            minCount = MAX(minCount, 16);
-            DEBUG_PRINT_HIGH("fps %d, operating rate %d, output min count %d",
-                   (int)(m_sVenc_cfg.fps_num / m_sVenc_cfg.fps_den), operating_rate, minCount);
-        }
-
         m_sOutput_buff_property.mincount = minCount;
 
         if (m_sOutput_buff_property.actualcount < m_sOutput_buff_property.mincount)
@@ -2151,25 +2139,6 @@
     venc_reconfig_reqbufs();
     resume_in_stopped = 0;
 
-    if (m_codec == OMX_VIDEO_CodingImageHEIC && mIsGridset) {
-        struct v4l2_format fmt;
-        memset(&fmt, 0, sizeof(fmt));
-        fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
-        fmt.fmt.pix_mp.height = DEFAULT_TILE_DIMENSION;
-        fmt.fmt.pix_mp.width = DEFAULT_TILE_DIMENSION;
-        fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype;
-        DEBUG_PRINT_INFO("set format type %d, wxh %dx%d, pixelformat %#x",
-            fmt.type, fmt.fmt.pix_mp.width, fmt.fmt.pix_mp.height,
-            fmt.fmt.pix_mp.pixelformat);
-        if (ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt)) {
-            DEBUG_PRINT_ERROR("set format failed, type %d, wxh %dx%d, pixelformat %#x",
-                fmt.type, fmt.fmt.pix_mp.width, fmt.fmt.pix_mp.height,
-                fmt.fmt.pix_mp.pixelformat);
-            hw_overload = errno == EBUSY;
-            return false;
-        }
-    }
-
     buf_type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
     DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing");
     ret=ioctl(m_nDriver_fd, VIDIOC_STREAMON,&buf_type);
@@ -2798,7 +2767,8 @@
                         }
                     } // Check OUTPUT Streaming
 
-                    venc_get_cvp_metadata(handle, &buf);
+                    if (!venc_get_cvp_metadata(handle, &buf))
+                        return false;
 
                     struct UBWCStats cam_ubwc_stats[2];
                     unsigned long long int compression_ratio = 1 << 16;
@@ -2861,12 +2831,12 @@
                     plane[0].data_offset = 0;
                     plane[0].length = handle->size;
                     plane[0].bytesused = handle->size;
-                    plane[0].reserved[2] = (unsigned long int)compression_ratio;
+                    plane[0].reserved[MSM_VIDC_COMP_RATIO] = (unsigned long int)compression_ratio;
                     char v4l2ColorFormatStr[200];
                     get_v4l2_color_format_as_string(v4l2ColorFormatStr, sizeof(v4l2ColorFormatStr), m_sVenc_cfg.inputformat);
                     DEBUG_PRINT_LOW("venc_empty_buf: Opaque camera buf: fd = %d "
                                 ": filled %d of %d format 0x%lx (%s) CR %d", fd, plane[0].bytesused,
-                                plane[0].length, m_sVenc_cfg.inputformat, v4l2ColorFormatStr, plane[0].reserved[2]);
+                                plane[0].length, m_sVenc_cfg.inputformat, v4l2ColorFormatStr, plane[0].reserved[MSM_VIDC_COMP_RATIO]);
                 }
             } else {
                 // Metadata mode
@@ -2949,9 +2919,9 @@
         plane[extra_idx].length = input_extradata_info.buffer_size;
         plane[extra_idx].m.userptr = (unsigned long)input_extradata_info.ion[extradata_index].uaddr;
 #ifdef USE_ION
-        plane[extra_idx].reserved[0] = input_extradata_info.ion[extradata_index].data_fd;
+        plane[extra_idx].reserved[MSM_VIDC_BUFFER_FD] = input_extradata_info.ion[extradata_index].data_fd;
 #endif
-        plane[extra_idx].reserved[1] = 0;
+        plane[extra_idx].reserved[MSM_VIDC_DATA_OFFSET] = 0;
         plane[extra_idx].data_offset = 0;
     } else if (extra_idx >= VIDEO_MAX_PLANES) {
         DEBUG_PRINT_ERROR("Extradata index higher than expected: %d\n", extra_idx);
@@ -2961,8 +2931,8 @@
     buf.index = index;
     buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
     buf.memory = V4L2_MEMORY_USERPTR;
-    plane[0].reserved[0] = fd;
-    plane[0].reserved[1] = 0;
+    plane[0].reserved[MSM_VIDC_BUFFER_FD] = fd;
+    plane[0].reserved[MSM_VIDC_DATA_OFFSET] = 0;
     buf.m.planes = plane;
     buf.length = num_input_planes;
     buf.timestamp.tv_sec = bufhdr->nTimeStamp / 1000000;
@@ -3106,8 +3076,8 @@
             buf.index = (unsigned)v4l2Id;
             buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
             buf.memory = V4L2_MEMORY_USERPTR;
-            plane[0].reserved[0] = MetaBufferUtil::getFdAt(hnd, i);
-            plane[0].reserved[1] = 0;
+            plane[0].reserved[MSM_VIDC_BUFFER_FD] = MetaBufferUtil::getFdAt(hnd, i);
+            plane[0].reserved[MSM_VIDC_DATA_OFFSET] = 0;
             plane[0].data_offset = MetaBufferUtil::getIntAt(hnd, i, MetaBufferUtil::INT_OFFSET);
             plane[0].m.userptr = (unsigned long)meta_buf;
             plane[0].length = plane[0].bytesused = MetaBufferUtil::getIntAt(hnd, i, MetaBufferUtil::INT_SIZE);
@@ -3120,7 +3090,7 @@
             extra_idx = EXTRADATA_IDX(num_input_planes);
 
             if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
-                int fd = plane[0].reserved[0];
+                int fd = plane[0].reserved[MSM_VIDC_BUFFER_FD];
                 OMX_U32 extradata_index;
                 if (!venc_get_index_from_fd(fd, &extradata_index)) {
                     DEBUG_PRINT_ERROR("Extradata index not found for fd: %d\n", fd);
@@ -3130,8 +3100,8 @@
                 plane[extra_idx].bytesused = input_extradata_info.buffer_size;
                 plane[extra_idx].length = input_extradata_info.buffer_size;
                 plane[extra_idx].m.userptr = (unsigned long)input_extradata_info.ion[extradata_index].uaddr;
-                plane[extra_idx].reserved[0] = input_extradata_info.ion[extradata_index].data_fd;
-                plane[extra_idx].reserved[1] = 0;
+                plane[extra_idx].reserved[MSM_VIDC_BUFFER_FD] = input_extradata_info.ion[extradata_index].data_fd;
+                plane[extra_idx].reserved[MSM_VIDC_DATA_OFFSET] = 0;
                 plane[extra_idx].data_offset = 0;
             } else if (extra_idx >= VIDEO_MAX_PLANES) {
                 DEBUG_PRINT_ERROR("Extradata index higher than expected: %d\n", extra_idx);
@@ -3145,7 +3115,7 @@
             bufTimeStamp = bufhdr->nTimeStamp + MetaBufferUtil::getIntAt(hnd, i, MetaBufferUtil::INT_TIMESTAMP) / 1000;
 
             DEBUG_PRINT_LOW(" Q Batch [%d of %d] : buf=%p fd=%d len=%d TS=%lld",
-                i, numBufs, bufhdr, plane[0].reserved[0], plane[0].length, bufTimeStamp);
+                i, numBufs, bufhdr, plane[0].reserved[MSM_VIDC_BUFFER_FD], plane[0].length, bufTimeStamp);
             buf.timestamp.tv_sec = bufTimeStamp / 1000000;
             buf.timestamp.tv_usec = (bufTimeStamp % 1000000);
 
@@ -3240,8 +3210,8 @@
     buf.memory = V4L2_MEMORY_USERPTR;
     plane[0].length = bufhdr->nAllocLen;
     plane[0].bytesused = bufhdr->nFilledLen;
-    plane[0].reserved[0] = fd;
-    plane[0].reserved[1] = 0;
+    plane[0].reserved[MSM_VIDC_BUFFER_FD] = fd;
+    plane[0].reserved[MSM_VIDC_DATA_OFFSET] = 0;
     plane[0].data_offset = bufhdr->nOffset;
     buf.m.planes = plane;
     buf.length = num_output_planes;
@@ -3265,9 +3235,9 @@
         plane[extra_idx].length = output_extradata_info.buffer_size;
         plane[extra_idx].m.userptr = (unsigned long)output_extradata_info.ion[index].uaddr;
 #ifdef USE_ION
-        plane[extra_idx].reserved[0] = output_extradata_info.ion[index].data_fd;
+        plane[extra_idx].reserved[MSM_VIDC_BUFFER_FD] = output_extradata_info.ion[index].data_fd;
 #endif
-        plane[extra_idx].reserved[1] = 0;
+        plane[extra_idx].reserved[MSM_VIDC_DATA_OFFSET] = 0;
         plane[extra_idx].data_offset = 0;
     } else if (extra_idx >= VIDEO_MAX_PLANES) {
         DEBUG_PRINT_ERROR("Extradata index higher than expected: %d", extra_idx);
@@ -4309,6 +4279,8 @@
             }
             m_cvp_meta_enabled = true;
             DEBUG_PRINT_HIGH("CVP metadata enabled");
+            if (!venc_set_cvp_skipratio_controls())
+                return false;
         } else {
             DEBUG_PRINT_ERROR("ERROR: External CVP mode disabled for this session and continue!");
             clearMetaData(handle, SET_CVP_METADATA);
@@ -4317,11 +4289,39 @@
     return true;
 }
 
+bool venc_dev::venc_set_cvp_skipratio_controls()
+{
+    struct v4l2_control ctrl;
+
+    if (!cvpMetadata.cvp_frame_rate || !cvpMetadata.capture_frame_rate) {
+        DEBUG_PRINT_LOW("ERROR: Invalid cvp frame rate received");
+        return true;
+    }
+
+    ctrl.id = V4L2_CID_MPEG_VIDC_CAPTURE_FRAME_RATE;
+    ctrl.value = cvpMetadata.capture_frame_rate;
+    if (ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &ctrl)) {
+        DEBUG_PRINT_ERROR("ERROR: Setting capture frame rate control failed");
+        return false;
+    }
+
+    ctrl.id = V4L2_CID_MPEG_VIDC_CVP_FRAME_RATE;
+    ctrl.value = cvpMetadata.cvp_frame_rate;
+    if (ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &ctrl)) {
+        DEBUG_PRINT_LOW("ERROR: Setting cvp frame rate control failed");
+        return false;
+    }
+    return true;
+}
+
 bool venc_dev::venc_get_cvp_metadata(private_handle_t *handle, struct v4l2_buffer *buf)
 {
     if (!m_cvp_meta_enabled)
         return true;
 
+    unsigned int capture_rate = cvpMetadata.capture_frame_rate;
+    unsigned int cvp_rate = cvpMetadata.cvp_frame_rate;
+
     buf->flags &= ~V4L2_BUF_FLAG_CVPMETADATA_SKIP;
     cvpMetadata.size = 0;
     if (getMetaData(handle, GET_CVP_METADATA, &cvpMetadata) == 0) {
@@ -4340,6 +4340,11 @@
         DEBUG_PRINT_LOW("venc_empty_buf: V4L2_BUF_FLAG_CVPMETADATA_SKIP is set");
         DEBUG_PRINT_LOW("CVP metadata not available");
     }
+    if ((cvpMetadata.capture_frame_rate != capture_rate) ||
+        (cvpMetadata.cvp_frame_rate != cvp_rate)) {
+        if(!venc_set_cvp_skipratio_controls())
+            return false;
+    }
     return true;
 }
 
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
old mode 100755
new mode 100644
index 830a06a..0ddc8ce
--- 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
@@ -1238,6 +1238,7 @@
     int rc;
     struct v4l2_control control;
     unsigned int tier = V4L2_MPEG_VIDEO_HEVC_TIER_HIGH;
+    OMX_U32 omx_profile_level = eLevel;
 
     DEBUG_PRINT_LOW("venc_set_level:: eLevel = %u",
                     (unsigned int)eLevel);
@@ -1247,8 +1248,16 @@
                     (unsigned int)eLevel );
         return true;
 	}
-
-	if (!profile_level_converter::convert_omx_level_to_v4l2(m_sVenc_cfg.codectype, eLevel, &control.value, &tier)) {
+    if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_HEVC) {
+        if(!profile_level_converter::find_tier(m_sVenc_cfg.codectype, eLevel, &tier)) {
+            DEBUG_PRINT_ERROR("Failed to find HEVC v4l2 level tier for OMX level : %d", eLevel);
+            return true;
+        }
+        /* HEVC high tier profile levels are mapped to same V4L2 profile levels as main tier profile levels */
+        if (tier == V4L2_MPEG_VIDEO_HEVC_TIER_HIGH)
+            omx_profile_level = eLevel >> 1;
+    }
+	if (!profile_level_converter::convert_omx_level_to_v4l2(m_sVenc_cfg.codectype, omx_profile_level, &control.value)) {
         DEBUG_PRINT_ERROR("Failed to find v4l2 level for OMX level : %d" \
                         " Codec : %lu", eLevel, m_sVenc_cfg.codectype);
         return true;