<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div>What's your sequence and cmdline?</div><div>I will check and find a way to solve it.<br></div><div></div><div id="divNeteaseMailCard"></div><div><br></div>At 2015-06-29 13:27:14,"Deepthi Nandakumar" <deepthi@multicorewareinc.com> wrote:<br> <blockquote id="isReplyContent" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir="ltr">Bitrate inflation is pretty drastic....<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 27, 2015 at 7:43 AM, Min Chen <span dir="ltr"><<a href="mailto:chenm003@163.com" target="_blank">chenm003@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"># HG changeset patch<br>
# User Min Chen <<a href="mailto:chenm003@163.com">chenm003@163.com</a>><br>
# Date 1435370058 25200<br>
# Node ID fb038742dabd93a1993562c093839e5362ad3d46<br>
# Parent a8198965fbf18d7ced2cd8e8acd07fcc4ee6a2b3<br>
improve Diamon Search by reduce duplicate SAD [OUTPUT CHANGED]<br>
Side effect by modify DIA ME template:<br>
0 0<br>
2 3 --> 3 1<br>
1 2<br>
---<br>
source/encoder/motion.cpp | 41 +++++++++++++++++++++++++++++++++++++++++<br>
1 files changed, 41 insertions(+), 0 deletions(-)<br>
<br>
diff -r a8198965fbf1 -r fb038742dabd source/encoder/motion.cpp<br>
--- a/source/encoder/motion.cpp Fri Jun 26 18:54:15 2015 -0700<br>
+++ b/source/encoder/motion.cpp Fri Jun 26 18:54:18 2015 -0700<br>
@@ -2,6 +2,7 @@<br>
* Copyright (C) 2013 x265 project<br>
*<br>
* Authors: Steve Borho <<a href="mailto:steve@borho.org">steve@borho.org</a>><br>
+ * Min Chen <<a href="mailto:chenm003@163.com">chenm003@163.com</a>><br>
*<br>
* This program is free software; you can redistribute it and/or modify<br>
* it under the terms of the GNU General Public License as published by<br>
@@ -59,6 +60,8 @@<br>
int sizeScale[NUM_PU_SIZES];<br>
#define SAD_THRESH(v) (bcost < (((v >> 4) * sizeScale[partEnum])))<br>
<br>
+const MV dia2[6] = { MV(1, 0), MV(0, -1), MV(-1, 0), MV(0, 1), MV(1, 0), MV(0, -1) };<br>
+<br>
/* radius 2 hexagon. repeated entries are to avoid having to compute mod6 every time. */<br>
const MV hex2[8] = { MV(-1, -2), MV(-2, 0), MV(-1, 2), MV(1, 2), MV(2, 0), MV(1, -2), MV(-1, -2), MV(-2, 0) };<br>
const uint8_t mod6m1[8] = { 5, 0, 1, 2, 3, 4, 5, 0 }; /* (x-1)%6 */<br>
@@ -681,6 +684,7 @@<br>
case X265_DIA_SEARCH:<br>
{<br>
/* diamond search, radius 1 */<br>
+#if 0<br>
bcost <<= 4;<br>
int i = merange;<br>
do<br>
@@ -699,6 +703,43 @@<br>
while (--i && bmv.checkRange(mvmin, mvmax));<br>
bcost >>= 4;<br>
break;<br>
+<br>
+#else // if 0<br>
+<br>
+ /* approach equivalent to the above, but eliminates duplicate candidates */<br>
+ bcost <<= 3;<br>
+ COST_MV_X4_DIR(0, -1, 0, 1, -1, 0, 1, 0, costs);<br>
+ COPY1_IF_LT(bcost, (costs[0] << 3) + 2);<br>
+ COPY1_IF_LT(bcost, (costs[1] << 3) + 3);<br>
+ COPY1_IF_LT(bcost, (costs[2] << 3) + 4);<br>
+ COPY1_IF_LT(bcost, (costs[3] << 3) + 5);<br>
+<br>
+ if (bcost & 7)<br>
+ {<br>
+ int dir = (bcost & 7) - 2;<br>
+ bmv += dia2[dir + 1];<br>
+<br>
+ for (int i = merange - 1; i > 0 && bmv.checkRange(mvmin, mvmax); i--)<br>
+ {<br>
+ COST_MV_X3_DIR(dia2[dir + 0].x, dia2[dir + 0].y,<br>
+ dia2[dir + 1].x, dia2[dir + 1].y,<br>
+ dia2[dir + 2].x, dia2[dir + 2].y,<br>
+ costs);<br>
+ bcost &= ~7;<br>
+ COPY1_IF_LT(bcost, (costs[0] << 3) + 1);<br>
+ COPY1_IF_LT(bcost, (costs[1] << 3) + 2);<br>
+ COPY1_IF_LT(bcost, (costs[2] << 3) + 3);<br>
+ if (!(bcost & 7))<br>
+ break;<br>
+ dir += (bcost & 7) - 1;<br>
+ X265_CHECK(dir >= 0 && dir <= 5, "dir check failure\n");<br>
+ dir = (3 & (dir + 3)); // (dir-1)%4<br>
+ bmv += dia2[dir];<br>
+ }<br>
+ }<br>
+ bcost >>= 3;<br>
+ break;<br>
+#endif // if 0<br>
}<br>
<br>
case X265_HEX_SEARCH:<br>
<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank" rel="noreferrer">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div>
</blockquote></div>