<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 13, 2018 at 1:41 PM,  <span dir="ltr"><<a href="mailto:ashok@multicorewareinc.com" target="_blank">ashok@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Ashok Kumar Mishra <<a href="mailto:ashok@multicorewareinc.com">ashok@multicorewareinc.com</a>><br>
# Date 1520928613 -19800<br>
#      Tue Mar 13 13:40:13 2018 +0530<br>
# Node ID e40494afede308b18fb539f43b37d0<wbr>ea3254b924<br>
# Parent  7af1f634a849ba223bf016d1f4bb2d<wbr>043457e1d2<br>
avoid allocating memory when aq-motion is disabled<br>
<br>
diff -r 7af1f634a849 -r e40494afede3 source/common/lowres.cpp<br>
--- a/source/common/lowres.cpp  Sun Mar 11 20:01:49 2018 +0100<br>
+++ b/source/common/lowres.cpp  Tue Mar 13 13:40:13 2018 +0530<br>
@@ -55,14 +55,15 @@<br>
     size_t padoffset = lumaStride * origPic->m_lumaMarginY + origPic->m_lumaMarginX;<br>
     if (bAQEnabled)<br>
     {<br>
-        CHECKED_MALLOC_ZERO(<wbr>qpAqOffset, double, cuCountFullRes);<br>
-        CHECKED_MALLOC_ZERO(<wbr>qpAqMotionOffset, double, cuCountFullRes);<br>
+        CHECKED_MALLOC_ZERO(<wbr>qpAqOffset, double, cuCountFullRes);<br>
         CHECKED_MALLOC_ZERO(<wbr>invQscaleFactor, int, cuCountFullRes);<br>
         CHECKED_MALLOC_ZERO(<wbr>qpCuTreeOffset, double, cuCountFullRes);<br>
         if (qgSize == 8)<br>
             CHECKED_MALLOC_ZERO(<wbr>invQscaleFactor8x8, int, cuCount);<br>
     }<br>
<br>
+       if (origPic->m_param->bAQMotion)<br>
+               CHECKED_MALLOC_ZERO(<wbr>qpAqMotionOffset, double, cuCountFullRes);<br>
     if (origPic->m_param-><wbr>bDynamicRefine)<br>
         CHECKED_MALLOC_ZERO(<wbr>blockVariance, uint32_t, cuCountFullRes);<br>
     CHECKED_MALLOC(propagateCost, uint16_t, cuCount);<br>
@@ -127,13 +128,13 @@<br>
         X265_FREE(lowresMvCosts[0][i])<wbr>;<br>
         X265_FREE(lowresMvCosts[1][i])<wbr>;<br>
     }<br>
-    X265_FREE(qpAqOffset);<br>
-    X265_FREE(qpAqMotionOffset);<br>
+    X265_FREE(qpAqOffset);<br>
     X265_FREE(invQscaleFactor);<br>
     X265_FREE(qpCuTreeOffset);<br>
     X265_FREE(propagateCost);<br>
-    X265_FREE(blockVariance);<br>
-    X265_FREE(invQscaleFactor8x8);<br>
+       X265_FREE(invQscaleFactor8x8);<br>
+       X265_FREE(qpAqMotionOffset);<br>
+    X265_FREE(blockVariance);<br>
 }<br>
<br>
 // (re) initialize lowres state<br>
</blockquote></div><br></div><div class="gmail_extra">Pushed.</div></div>