Snap for 4448085 from 785d3ca40477fb107a20b9d0561b44ca052ad00a to oc-m3-release

Change-Id: I8e4662678c83f0701cc2f554bcec255a1280c395
diff --git a/apns-full-conf.xml b/apns-full-conf.xml
index 6080daa..99a8d3d 100644
--- a/apns-full-conf.xml
+++ b/apns-full-conf.xml
@@ -7259,6 +7259,7 @@
       apn="pda.bell.ca"
       type="default,mms,supl"
       mmsc="http://mms.bell.ca/mms/wapenc"
+      protocol="IPV4V6"
   />
 
   <apn carrier="Virgin Mobile"
@@ -7269,6 +7270,7 @@
       mmsc="http://mms.bell.ca/mms/wapenc"
       mvno_match_data="3E"
       mvno_type="gid"
+      protocol="IPV4V6"
   />
 
   <apn carrier="MTS"
diff --git a/camera/QCamera2/HAL3/QCamera3Channel.cpp b/camera/QCamera2/HAL3/QCamera3Channel.cpp
index cb31953..bfeb46a 100644
--- a/camera/QCamera2/HAL3/QCamera3Channel.cpp
+++ b/camera/QCamera2/HAL3/QCamera3Channel.cpp
@@ -1974,6 +1974,8 @@
 
         uint32_t raw16_stride = ((uint32_t)dim.width + 15U) & ~15U;
         uint16_t* raw16_buffer = (uint16_t *)frame->buffer;
+        uint8_t first_quintuple[5];
+        memcpy(first_quintuple, raw16_buffer, sizeof(first_quintuple));
 
         // Some raw processing may be needed prior to conversion.
         static bool raw_proc_lib_load_attempted = false;
@@ -2007,13 +2009,19 @@
             for (int32_t xs = dim.width - 1; xs >= 0; xs--) {
                 uint32_t x = (uint32_t)xs;
                 uint8_t upper_8bit = row_start[5*(x/4)+x%4];
-                uint8_t lower_2bit = ((row_start[5*(x/4)+4] >> (x%4)) & 0x3);
+                uint8_t lower_2bit = ((row_start[5*(x/4)+4] >> ((x%4) << 1)) & 0x3);
                 uint16_t raw16_pixel =
                         (uint16_t)(((uint16_t)upper_8bit)<<2 |
                         (uint16_t)lower_2bit);
                 raw16_buffer[y*raw16_stride+x] = raw16_pixel;
             }
         }
+
+        // Re-convert the first 2 pixels of the buffer because the loop above messes
+        // them up by reading the first quintuple while modifying it.
+        raw16_buffer[0] = ((uint16_t)first_quintuple[0]<<2) | (first_quintuple[4] & 0x3);
+        raw16_buffer[1] = ((uint16_t)first_quintuple[1]<<2) | ((first_quintuple[4] >> 2) & 0x3);
+
     } else {
         ALOGE("%s: Could not find stream", __func__);
     }
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 05c0c41..eecd454 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -6791,7 +6791,12 @@
        ANDROID_STATISTICS_HISTOGRAM_MODE, ANDROID_STATISTICS_SHARPNESS_MAP_MODE,
        ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, ANDROID_TONEMAP_CURVE_BLUE,
        ANDROID_TONEMAP_CURVE_GREEN, ANDROID_TONEMAP_CURVE_RED, ANDROID_TONEMAP_MODE,
-       ANDROID_BLACK_LEVEL_LOCK, NEXUS_EXPERIMENTAL_2016_HYBRID_AE_ENABLE};
+       ANDROID_BLACK_LEVEL_LOCK, NEXUS_EXPERIMENTAL_2016_HYBRID_AE_ENABLE,
+       QCAMERA3_PRIVATEDATA_REPROCESS, QCAMERA3_CDS_MODE, QCAMERA3_CDS_INFO,
+       QCAMERA3_CROP_COUNT_REPROCESS, QCAMERA3_CROP_REPROCESS,
+       QCAMERA3_CROP_ROI_MAP_REPROCESS, QCAMERA3_TEMPORAL_DENOISE_ENABLE,
+       QCAMERA3_TEMPORAL_DENOISE_PROCESS_TYPE, QCAMERA3_USE_AV_TIMER
+       };
 
     size_t request_keys_cnt =
             sizeof(request_keys_basic)/sizeof(request_keys_basic[0]);
@@ -6828,7 +6833,13 @@
        ANDROID_STATISTICS_FACE_SCORES,
        ANDROID_SENSOR_DYNAMIC_BLACK_LEVEL,
        ANDROID_SENSOR_DYNAMIC_WHITE_LEVEL, NEXUS_EXPERIMENTAL_2016_HYBRID_AE_ENABLE,
-       ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST };
+       ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST,
+       QCAMERA3_PRIVATEDATA_REPROCESS, QCAMERA3_CDS_MODE, QCAMERA3_CDS_INFO,
+       QCAMERA3_CROP_COUNT_REPROCESS, QCAMERA3_CROP_REPROCESS,
+       QCAMERA3_CROP_ROI_MAP_REPROCESS, QCAMERA3_TUNING_META_DATA_BLOB,
+       QCAMERA3_TEMPORAL_DENOISE_ENABLE, QCAMERA3_TEMPORAL_DENOISE_PROCESS_TYPE,
+       QCAMERA3_SENSOR_DYNAMIC_BLACK_LEVEL_PATTERN
+       };
     size_t result_keys_cnt =
             sizeof(result_keys_basic)/sizeof(result_keys_basic[0]);
 
@@ -6906,7 +6917,8 @@
        ANDROID_CONTROL_AWB_LOCK_AVAILABLE,
        ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES,
        ANDROID_SHADING_AVAILABLE_MODES,
-       ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL };
+       ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, QCAMERA3_OPAQUE_RAW_FORMAT
+       };
 
     Vector<int32_t> available_characteristics_keys;
     available_characteristics_keys.appendArray(characteristics_keys_basic,
@@ -6914,9 +6926,6 @@
     if (hasBlackRegions) {
         available_characteristics_keys.add(ANDROID_SENSOR_OPTICAL_BLACK_REGIONS);
     }
-    staticInfo.update(ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS,
-                      available_characteristics_keys.array(),
-                      available_characteristics_keys.size());
 
     /*available stall durations depend on the hw + sw and will be different for different devices */
     /*have to add for raw after implementation*/
@@ -6989,8 +6998,15 @@
             &gCamCapability[cameraId]->padding_info, &buf_planes);
         strides[i*3+2] = buf_planes.plane_info.mp[0].stride;
     }
-    staticInfo.update(QCAMERA3_OPAQUE_RAW_STRIDES, strides,
-            3*raw_count);
+
+    if (raw_count > 0) {
+        staticInfo.update(QCAMERA3_OPAQUE_RAW_STRIDES, strides,
+                3*raw_count);
+        available_characteristics_keys.add(QCAMERA3_OPAQUE_RAW_STRIDES);
+    }
+    staticInfo.update(ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS,
+                      available_characteristics_keys.array(),
+                      available_characteristics_keys.size());
 
     gStaticMetadata[cameraId] = staticInfo.release();
     return rc;
diff --git a/camera/QCamera2/HAL3/QCamera3Stream.cpp b/camera/QCamera2/HAL3/QCamera3Stream.cpp
index 399e73d..e87d1ec 100644
--- a/camera/QCamera2/HAL3/QCamera3Stream.cpp
+++ b/camera/QCamera2/HAL3/QCamera3Stream.cpp
@@ -588,9 +588,9 @@
             break;
         case CAMERA_CMD_TYPE_EXIT:
             CDBG_HIGH("%s: Exit", __func__);
+            pme->flushFreeBatchBufQ();
             /* flush data buf queue */
             pme->mDataQ.flush();
-            pme->flushFreeBatchBufQ();
             running = 0;
             break;
         default:
diff --git a/camera/QCamera2/QCamera2Factory.cpp b/camera/QCamera2/QCamera2Factory.cpp
index 676dd65..6101036 100644
--- a/camera/QCamera2/QCamera2Factory.cpp
+++ b/camera/QCamera2/QCamera2Factory.cpp
@@ -58,7 +58,6 @@
  *==========================================================================*/
 QCamera2Factory::QCamera2Factory()
 {
-    camera_info info;
     mHalDescriptors = NULL;
     mCallbacks = NULL;
     mNumOfCameras = get_num_of_cameras();
@@ -78,10 +77,6 @@
                 } else {
                     mHalDescriptors[i].device_version = CAMERA_DEVICE_API_VERSION_1_0;
                 }
-                //Query camera at this point in order
-                //to avoid any delays during subsequent
-                //calls to 'getCameraInfo()'
-                getCameraInfo(i, &info);
             }
         } else {
             ALOGE("%s: Not enough resources to allocate HAL descriptor table!",
diff --git a/media_codecs_performance.xml b/media_codecs_performance.xml
index 8d27d69..72abe44 100644
--- a/media_codecs_performance.xml
+++ b/media_codecs_performance.xml
@@ -14,126 +14,130 @@
      limitations under the License.
 -->
 
-<!-- Generated file for bullhead using measurements between OPR1.170619.001/OPR1.170623.008 and OPM1.170904.001 -->
+<!-- Generated file for bullhead using measurements between OPR1.170623.011 and OPM1.170912.002 -->
 <MediaCodecs>
+    <!-- Measurements between OPR1.170623.010 and OPM1.170908.002 -->
     <Encoders>
         <MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" update="true">
             <!-- measured 98%:101-511 med:187/183 variance:2.2 -->
-            <Limit name="measured-frame-rate-176x144" range="181-256" /> <!-- N=116 -->
-            <!-- measured 98%:162-490 med:239/231 FLAKY(116 - 490 < mx=495.3) -->
-            <Limit name="measured-frame-rate-352x288" range="231-248" /> <!-- TWEAKED N=116 v98%=1.7 -->
-            <Limit name="measured-frame-rate-704x576" range="128-128" /> <!-- N=112 v98%=1.4 -->
+            <Limit name="measured-frame-rate-176x144" range="181-256" /> <!-- N=118 -->
+            <!-- measured 98%:165-490 med:241/235 FLAKY(118 - 490 < mx=495.3) -->
+            <Limit name="measured-frame-rate-352x288" range="235-248" /> <!-- TWEAKED N=118 v98%=1.7 -->
+            <Limit name="measured-frame-rate-704x576" range="128-128" /> <!-- N=114 v98%=1.4 -->
         </MediaCodec>
+        <!-- Measurements between OPR1.170623.011 and OPM1.170908.002 -->
         <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="213-255" /> <!-- N=116 v98%=1.9 -->
+            <Limit name="measured-frame-rate-320x240" range="212-255" /> <!-- N=118 v98%=1.9 (OPR1.170623.010-) -->
             <Limit name="measured-frame-rate-720x480" range="143-143" /> <!-- N=116 v98%=1.5 -->
-            <Limit name="measured-frame-rate-1280x720" range="71-71" /> <!-- N=116 v98%=1.4 -->
+            <Limit name="measured-frame-rate-1280x720" range="72-72" /> <!-- N=118 v98%=1.4 (OPR1.170623.010-) -->
             <Limit name="measured-frame-rate-1920x1080" range="37-37" /> <!-- N=116 v98%=1.3 -->
         </MediaCodec>
+        <!-- Measurements between OPR1.170623.011 and OPM1.170908.002 -->
         <MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" update="true">
-            <Limit name="measured-frame-rate-176x144" range="178-198" /> <!-- N=116 v98%=1.8 -->
-            <Limit name="measured-frame-rate-352x288" range="197-197" /> <!-- N=116 v98%=1.2 -->
+            <Limit name="measured-frame-rate-176x144" range="178-198" /> <!-- N=118 v98%=1.8 (OPR1.170623.010-) -->
+            <Limit name="measured-frame-rate-352x288" range="199-199" /> <!-- N=116 v98%=1.2 -->
             <Limit name="measured-frame-rate-640x480" range="77-77" /> <!-- N=116 v98%=1.0 -->
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="112-112" /> <!-- N=116 v98%=1.1 -->
-            <Limit name="measured-frame-rate-640x360" range="103-103" /> <!-- N=114 v98%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="38-38" /> <!-- N=116 v98%=1.0 -->
-            <Limit name="measured-frame-rate-1920x1080" range="15-15" /> <!-- N=112 v98%=1.0 -->
+            <Limit name="measured-frame-rate-320x180" range="112-112" /> <!-- N=118 v98%=1.1 -->
+            <Limit name="measured-frame-rate-640x360" range="103-103" /> <!-- N=116 v98%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="38-38" /> <!-- N=118 v98%=1.0 -->
+            <Limit name="measured-frame-rate-1920x1080" range="15-15" /> <!-- N=112 v98%=1.1 (OPR1.170623.011-) -->
         </MediaCodec>
         <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
-            <Limit name="measured-frame-rate-176x144" range="229-229" /> <!-- N=116 v98%=1.4 -->
+            <Limit name="measured-frame-rate-176x144" range="230-230" /> <!-- N=118 v98%=1.3 -->
         </MediaCodec>
+        <!-- Measurements between OPR1.170623.011 and OPM1.170908.002 -->
         <MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="233-233" /> <!-- N=116 v98%=1.4 -->
-            <Limit name="measured-frame-rate-720x480" range="100-100" /> <!-- N=116 v98%=1.3 -->
-            <Limit name="measured-frame-rate-1280x720" range="51-51" /> <!-- N=116 v98%=1.5 -->
-            <Limit name="measured-frame-rate-1920x1080" range="19-21" /> <!-- N=116 v98%=1.3 -->
+            <Limit name="measured-frame-rate-320x240" range="234-234" /> <!-- N=116 v98%=1.4 -->
+            <Limit name="measured-frame-rate-720x480" range="99-99" /> <!-- N=116 v98%=1.3 -->
+            <Limit name="measured-frame-rate-1280x720" range="50-50" /> <!-- N=118 v98%=1.5 (OPR1.170623.010-) -->
+            <Limit name="measured-frame-rate-1920x1080" range="19-20" /> <!-- N=116 v98%=1.3 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
-            <Limit name="measured-frame-rate-176x144" range="257-257" /> <!-- N=116 v98%=1.3 -->
+            <Limit name="measured-frame-rate-176x144" range="256-257" /> <!-- N=118 v98%=1.3 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="99-99" /> <!-- N=116 v98%=1.0 -->
-            <Limit name="measured-frame-rate-640x360" range="37-37" /> <!-- N=110 v98%=1.0 (OPR1.170623.006-) -->
-            <Limit name="measured-frame-rate-1280x720" range="31-31" /> <!-- N=114 v98%=1.2 -->
-            <Limit name="measured-frame-rate-1920x1080" range="14-14" /> <!-- N=116 v98%=1.3 -->
+            <Limit name="measured-frame-rate-320x180" range="99-99" /> <!-- N=116 v98%=1.0 (OPR1.170623.011-) -->
+            <Limit name="measured-frame-rate-640x360" range="37-37" /> <!-- N=114 v98%=1.0 (OPR1.170623.009-) -->
+            <Limit name="measured-frame-rate-1280x720" range="31-31" /> <!-- N=116 v98%=1.2 -->
+            <Limit name="measured-frame-rate-1920x1080" range="14-14" /> <!-- N=118 v98%=1.3 -->
         </MediaCodec>
+        <!-- Measurements between OPR1.170208.003 and OPM1.170908.002 -->
         <MediaCodec name="OMX.google.vp9.encoder" type="video/x-vnd.on2.vp9" update="true">
-            <!-- measured 98%:86-119 med:107/107 N=66 FLAKY(mn=45.9 < 54 - 214) -->
-            <Limit name="measured-frame-rate-320x180" range="107-107" /> <!-- v98%=1.2 (OPR1.170208.003-) -->
-            <!-- measured 98%:14-45 med:36/39 N=66 -->
-            <Limit name="measured-frame-rate-640x360" range="23-39" /> <!-- v98%=1.8 (OPR1.170208.003-) -->
-            <!-- measured 98%:4-12 med:8/9 N=70 -->
-            <Limit name="measured-frame-rate-1280x720" range="5-9" /> <!-- v98%=1.7 (OPR1.170208.003-) -->
-            <!-- measured 98%:1-6 med:5/4 N=64 -->
-            <Limit name="measured-frame-rate-1920x1080" range="2-4" /> <!-- v98%=1.9 (OPR1.170208.003-OPM1.170814.001) -->
+            <!-- measured 98%:86-119 med:107/107 N=76 FLAKY(mn=45.9 < 54 - 214) -->
+            <Limit name="measured-frame-rate-320x180" range="107-107" /> <!-- v98%=1.2 -->
+            <!-- measured 98%:14-45 med:43/41 N=74 -->
+            <Limit name="measured-frame-rate-640x360" range="24-41" /> <!-- v98%=1.8 -->
+            <!-- measured 98%:4-12 med:10/9 N=78 -->
+            <Limit name="measured-frame-rate-1280x720" range="5-9" /> <!-- v98%=1.7 -->
         </MediaCodec>
     </Encoders>
     <Decoders>
         <MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" update="true">
-            <!-- measured 98%:522-741 med:677/677 N=98 -->
-            <Limit name="measured-frame-rate-176x144" range="677-677" /> <!-- v98%=1.2 -->
-            <Limit name="measured-frame-rate-352x288" range="644-644" /> <!-- N=100 v98%=1.2 -->
+            <!-- measured 98%:500-737 med:673/673 N=98 -->
+            <Limit name="measured-frame-rate-176x144" range="673-673" /> <!-- v98%=1.2 -->
+            <Limit name="measured-frame-rate-352x288" range="640-640" /> <!-- N=100 v98%=1.2 -->
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="381-381" /> <!-- N=100 v98%=1.1 -->
-            <Limit name="measured-frame-rate-720x480" range="212-212" /> <!-- N=100 v98%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="285-285" /> <!-- N=100 v98%=1.1 -->
+            <Limit name="measured-frame-rate-320x240" range="382-382" /> <!-- N=100 v98%=1.1 -->
+            <Limit name="measured-frame-rate-720x480" range="211-211" /> <!-- N=102 v98%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="284-285" /> <!-- N=100 v98%=1.1 -->
             <Limit name="measured-frame-rate-1920x1080" range="141-141" /> <!-- N=100 v98%=1.1 -->
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
-            <Limit name="measured-frame-rate-352x288" range="408-409" /> <!-- N=100 v98%=1.2 -->
-            <Limit name="measured-frame-rate-640x360" range="368-368" /> <!-- N=100 v98%=1.2 -->
-            <Limit name="measured-frame-rate-720x480" range="331-331" /> <!-- N=100 v98%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="370-371" /> <!-- N=100 v98%=1.2 -->
+            <Limit name="measured-frame-rate-352x288" range="410-411" /> <!-- N=100 v98%=1.2 -->
+            <Limit name="measured-frame-rate-640x360" range="367-368" /> <!-- N=102 v98%=1.1 -->
+            <Limit name="measured-frame-rate-720x480" range="331-331" /> <!-- N=102 v98%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="374-374" /> <!-- N=100 v98%=1.2 -->
             <Limit name="measured-frame-rate-1920x1080" range="253-253" /> <!-- N=100 v98%=1.1 -->
-            <Limit name="measured-frame-rate-3840x2160" range="43-43" /> <!-- N=100 v98%=1.0 -->
+            <Limit name="measured-frame-rate-3840x2160" range="43-43" /> <!-- N=102 v98%=1.0 -->
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" update="true">
-            <Limit name="measured-frame-rate-176x144" range="664-664" /> <!-- N=100 v98%=1.2 -->
-            <Limit name="measured-frame-rate-480x360" range="568-568" /> <!-- N=100 v98%=1.1 -->
+            <Limit name="measured-frame-rate-176x144" range="663-663" /> <!-- N=102 v98%=1.2 -->
+            <Limit name="measured-frame-rate-480x360" range="567-567" /> <!-- N=102 v98%=1.1 -->
         </MediaCodec>
         <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
-            <Limit name="measured-frame-rate-320x180" range="382-382" /> <!-- N=100 v98%=1.0 -->
-            <!-- measured 97%:336-376 med:357/357 FLAKY(mn=0.5 < 179 - 714) -->
-            <Limit name="measured-frame-rate-640x360" range="357-357" /> <!-- N=100 v97%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="385-385" /> <!-- N=100 v98%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="248-248" /> <!-- N=100 v98%=1.0 -->
+            <Limit name="measured-frame-rate-320x180" range="382-382" /> <!-- N=102 v98%=1.0 -->
+            <!-- measured 98%:333-376 med:357/357 FLAKY(mn=0.5 < 179 - 714) -->
+            <Limit name="measured-frame-rate-640x360" range="357-357" /> <!-- N=102 v98%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="387-387" /> <!-- N=102 v98%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="248-248" /> <!-- N=102 v98%=1.0 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
-            <!-- measured 98%:85-244 med:101/101 FLAKY(51 - 244 < mx=253.7) -->
-            <Limit name="measured-frame-rate-176x144" range="101-122" /> <!-- N=100 v98%=1.7 -->
+            <!-- measured 98%:85-244 med:101/101 FLAKY(51 - 244 < mx=247.5) -->
+            <Limit name="measured-frame-rate-176x144" range="101-124" /> <!-- TWEAKED N=100 v98%=1.7 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
-            <Limit name="measured-frame-rate-320x240" range="329-330" /> <!-- N=100 v98%=1.1 -->
-            <Limit name="measured-frame-rate-720x480" range="107-107" /> <!-- N=100 v98%=1.1 -->
-            <Limit name="measured-frame-rate-1280x720" range="44-44" /> <!-- N=100 v98%=1.1 -->
-            <Limit name="measured-frame-rate-1920x1080" range="18-18" /> <!-- N=100 v98%=1.3 -->
+            <Limit name="measured-frame-rate-320x240" range="327-327" /> <!-- N=100 v98%=1.1 -->
+            <Limit name="measured-frame-rate-720x480" range="106-106" /> <!-- N=100 v98%=1.1 -->
+            <Limit name="measured-frame-rate-1280x720" range="44-44" /> <!-- N=102 v98%=1.1 -->
+            <Limit name="measured-frame-rate-1920x1080" range="18-18" /> <!-- N=102 v98%=1.3 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
             <Limit name="measured-frame-rate-352x288" range="270-270" /> <!-- N=100 v98%=1.4 -->
-            <Limit name="measured-frame-rate-640x360" range="175-175" /> <!-- N=100 v98%=1.2 -->
-            <Limit name="measured-frame-rate-720x480" range="167-167" /> <!-- N=100 v98%=1.2 -->
-            <Limit name="measured-frame-rate-1280x720" range="63-65" /> <!-- N=104 v98%=1.2 -->
-            <Limit name="measured-frame-rate-1920x1080" range="37-37" /> <!-- N=100 v98%=1.2 -->
+            <Limit name="measured-frame-rate-640x360" range="173-174" /> <!-- N=100 v98%=1.3 -->
+            <Limit name="measured-frame-rate-720x480" range="165-165" /> <!-- N=102 v98%=1.2 -->
+            <Limit name="measured-frame-rate-1280x720" range="63-63" /> <!-- N=102 v98%=1.2 -->
+            <Limit name="measured-frame-rate-1920x1080" range="36-36" /> <!-- N=100 v98%=1.2 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" update="true">
-            <Limit name="measured-frame-rate-176x144" range="124-154" /> <!-- N=100 v98%=1.8 -->
+            <Limit name="measured-frame-rate-176x144" range="119-154" /> <!-- N=102 v98%=1.8 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
-            <!-- measured 98%:317-939 med:334/334 FLAKY(167 - 940 < mx=956.9) -->
-            <Limit name="measured-frame-rate-320x180" range="334-470" /> <!-- N=100 v98%=1.7 -->
-            <!-- measured 97%:191-299 med:258/258 FLAKY(mn=108.1 < 129 - 516) -->
-            <Limit name="measured-frame-rate-640x360" range="216-258" /> <!-- TWEAKED N=110 v97%=1.2 -->
-            <Limit name="measured-frame-rate-1280x720" range="51-59" /> <!-- N=132 v98%=1.5 (OPR1.170613.002-) -->
-            <Limit name="measured-frame-rate-1920x1080" range="19-23" /> <!-- N=124 v98%=1.5 -->
+            <!-- measured 98%:305-939 med:332/333 FLAKY(166 - 940 < mx=956.9) -->
+            <Limit name="measured-frame-rate-320x180" range="332-470" /> <!-- N=102 v98%=1.8 -->
+            <!-- measured 90%:191-298 med:258/258 FLAKY(mn=105.9 < 129 - 516) -->
+            <Limit name="measured-frame-rate-640x360" range="211-258" /> <!-- TWEAKED N=102 v90%=1.2 -->
+            <!-- measured 98%:26-61 med:59/59 FLAKY(mn=25.3 < 26 - 118) -->
+            <Limit name="measured-frame-rate-1280x720" range="50-59" /> <!-- TWEAKED N=122 v98%=1.5 (OPR1.170623.005-) -->
+            <Limit name="measured-frame-rate-1920x1080" range="17-23" /> <!-- N=114 v98%=1.5 -->
         </MediaCodec>
         <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
-            <Limit name="measured-frame-rate-320x180" range="284-346" /> <!-- N=100 v98%=1.6 -->
-            <!-- measured 98%:104-305 med:122/122 FLAKY(61 - 306 < mx=317.3) -->
-            <Limit name="measured-frame-rate-640x360" range="122-153" /> <!-- N=100 v98%=1.7 -->
-            <Limit name="measured-frame-rate-1280x720" range="54-54" /> <!-- N=100 v98%=1.1 -->
+            <Limit name="measured-frame-rate-320x180" range="281-322" /> <!-- N=100 v98%=1.6 -->
+            <!-- measured 98%:104-305 med:121/121 FLAKY(61 - 306 < mx=317.3) -->
+            <Limit name="measured-frame-rate-640x360" range="121-153" /> <!-- N=100 v98%=1.7 -->
+            <Limit name="measured-frame-rate-1280x720" range="53-53" /> <!-- N=100 v98%=1.1 -->
             <Limit name="measured-frame-rate-1920x1080" range="33-33" /> <!-- N=100 v98%=1.1 -->
         </MediaCodec>
     </Decoders>
diff --git a/proprietary-blobs.txt b/proprietary-blobs.txt
index e43d98a..e692958 100644
--- a/proprietary-blobs.txt
+++ b/proprietary-blobs.txt
@@ -22,7 +22,6 @@
 /system/bin/diag_klog
 /system/bin/diag_mdlog
 /system/bin/diag_qshrink4_daemon
-/system/bin/halutil
 /system/bin/imsdatadaemon
 /system/bin/imsqmidaemon
 /system/bin/ims_rtp_daemon
diff --git a/self-extractors/extract-lists.txt b/self-extractors/extract-lists.txt
index 72b6c1d..146b48e 100644
--- a/self-extractors/extract-lists.txt
+++ b/self-extractors/extract-lists.txt
@@ -13,7 +13,6 @@
             system/bin/diag_klog \
             system/bin/diag_mdlog \
             system/bin/diag_qshrink4_daemon \
-            system/bin/halutil \
             system/bin/imsdatadaemon \
             system/bin/imsqmidaemon \
             system/bin/ims_rtp_daemon \
diff --git a/self-extractors/qcom/staging/device-partial.mk b/self-extractors/qcom/staging/device-partial.mk
index a4115fc..9efc294 100644
--- a/self-extractors/qcom/staging/device-partial.mk
+++ b/self-extractors/qcom/staging/device-partial.mk
@@ -22,7 +22,6 @@
     vendor/qcom/bullhead/proprietary/diag_klog:system/bin/diag_klog:qcom \
     vendor/qcom/bullhead/proprietary/diag_mdlog:system/bin/diag_mdlog:qcom \
     vendor/qcom/bullhead/proprietary/diag_qshrink4_daemon:system/bin/diag_qshrink4_daemon:qcom \
-    vendor/qcom/bullhead/proprietary/halutil:system/bin/halutil:qcom \
     vendor/qcom/bullhead/proprietary/imsdatadaemon:system/bin/imsdatadaemon:qcom \
     vendor/qcom/bullhead/proprietary/imsqmidaemon:system/bin/imsqmidaemon:qcom \
     vendor/qcom/bullhead/proprietary/ims_rtp_daemon:system/bin/ims_rtp_daemon:qcom \
diff --git a/vendor_owner_info.txt b/vendor_owner_info.txt
index e0dbe38..5812b86 100644
--- a/vendor_owner_info.txt
+++ b/vendor_owner_info.txt
@@ -6,7 +6,6 @@
 system/bin/diag_klog:qcom
 system/bin/diag_mdlog:qcom
 system/bin/diag_qshrink4_daemon:qcom
-system/bin/halutil:qcom
 system/bin/imsdatadaemon:qcom
 system/bin/imsqmidaemon:qcom
 system/bin/ims_rtp_daemon:qcom