]> granicus.if.org Git - libvpx/commitdiff
CR: Don't attempt to read qindex_delta for segments CR is unaware of.
authorAlex Converse <aconverse@google.com>
Mon, 14 Sep 2015 18:43:38 +0000 (11:43 -0700)
committerAlex Converse <aconverse@google.com>
Mon, 14 Sep 2015 20:55:30 +0000 (13:55 -0700)
Found by the remoting VideoEncoderVpxTest.Vp9LossyUnchangedFrame unit
test under asan.

Change-Id: Icac63051bf37c7355e661837b57c257d58c764fc

vp9/encoder/vp9_aq_cyclicrefresh.c

index ebef1a202172123407872536bbd6e4ae69aafe58..625c3d0605d2b758839741970f1653a316337c4a 100644 (file)
@@ -232,10 +232,12 @@ void vp9_cyclic_refresh_update_segment(VP9_COMP *const cpi,
       // don't update the map for them. For cases where motion is non-zero or
       // the reference frame isn't the previous frame, the previous value in
       // the map for this spatial location is not entirely correct.
-      if (!is_inter_block(mbmi) || !skip)
+      if ((!is_inter_block(mbmi) || !skip) &&
+          mbmi->segment_id <= CR_SEGMENT_ID_BOOST2) {
         cr->last_coded_q_map[map_offset] = clamp(
             cm->base_qindex + cr->qindex_delta[mbmi->segment_id], 0, MAXQ);
-      else if (is_inter_block(mbmi) && skip) {
+      } else if (is_inter_block(mbmi) && skip &&
+                 mbmi->segment_id <= CR_SEGMENT_ID_BOOST2) {
         cr->last_coded_q_map[map_offset] = VPXMIN(
             clamp(cm->base_qindex + cr->qindex_delta[mbmi->segment_id],
                   0, MAXQ),