[x265] [PATCH] Bug fix

chen chenm003 at 163.com
Sat Jul 30 06:24:05 CEST 2016


The code style still mistake
At 2016-07-30 12:20:27,nvijay.anand at trispacetech.com wrote:
># HG changeset patch
># User N Vijay Anand <nvijay.anand at trispacetech.com>
># Date 1469852339 -19800
>#      Sat Jul 30 09:48:59 2016 +0530
># Node ID 72f16a34946f5f03da875c67a75124dfec1b4ecb
># Parent  a19731cbbd224ca642de1a9b8e5159a12fdf5fbf
>Bug fix.
>Coding convention.
>
>diff -r a19731cbbd22 -r 72f16a34946f source/encoder/motion.cpp
>--- a/source/encoder/motion.cpp	Thu Jul 28 15:34:41 2016 +0530
>+++ b/source/encoder/motion.cpp	Sat Jul 30 09:48:59 2016 +0530
>@@ -3,6 +3,7 @@
>  *
>  * Authors: Steve Borho <steve at borho.org>
>  *          Min Chen <chenm003 at 163.com>
>+ *          N Vijay Anand <nvijay.anand at trispacetech.com>
>  *
>  * This program is free software; you can redistribute it and/or modify
>  * it under the terms of the GNU General Public License as published by
>@@ -99,15 +100,17 @@
> 
> }
> 
>+#define MAX_NUM_BESTVECTORS     (4)
>+
> inline void PushToBMVStack(MV  *bStack, MV & bv, int *bCostStack, int bcost)
> {
>-    for (int i=0; i<4; i++)
>+    for (int i=0; i<MAX_NUM_BESTVECTORS; i++)
>     {
>         if((bCostStack[i] == bcost) && (bv == bStack[i]))
>             break;
>         if((bCostStack[i] > bcost) && (bv != bStack[i]))
>         {
>-            for (int j=3; j>i; j--)
>+            for (int j=MAX_NUM_BESTVECTORS-1; j>i; j--)
>             {
>                 bStack[j] = bStack[j-1];
>                 bCostStack[j] = bCostStack[j-1];
>@@ -655,10 +658,13 @@
>     /* re-measure full pel rounded MVP with SAD as search start point */
>     MV bmv = pmv.roundToFPel();
>     MV bmvStack[4] = {bmv, bmv, bmv, bmv};
>-    int bmvCostStack[4] = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff};
>+    int bmvCostStack[4] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};
>     int bcost = bprecost;
>     if (pmv.isSubpel())
>+    {
>         bcost = sad(fenc, FENC_STRIDE, fref + bmv.x + bmv.y * stride, stride) + mvcost(bmv << 2);
>+        bmvCostStack[0] = bcost;
>+    }
> 
>     // measure SAD cost at MV(0) if MVP is not zero
>     if (pmv.notZero())
>@@ -668,6 +674,8 @@
>         {
>             bcost = cost;
>             bmv = 0;
>+            bmvStack[0] = bmv;
>+            bmvCostStack[0] = bcost;
>         }
>     }
> 
>@@ -1147,6 +1155,7 @@
>     {
>         bmv = bestpre;
>         bcost = bprecost;
>+        PushToBMVStack(bmvStack, bmv, bmvCostStack, bcost);
>     }
>     else
>     {
>@@ -1168,7 +1177,7 @@
>     else if (ref->isLowres)
>     {
>         int bdir = 0;
>-        for (int nBmv=0; nBmv<4; nBmv++)
>+        for (int nBmv=0; nBmv<MAX_NUM_BESTVECTORS; nBmv++)
>         {
>           bdir = 0;
>           bmv =  bmvStack[nBmv];
>@@ -1199,7 +1208,7 @@
> 
>         bmv = bmvStack[0];
>         bcost = bmvCostStack[0];
>-        for (int i=1; i<4; i++)
>+        for (int i=1; i<MAX_NUM_BESTVECTORS; i++)
>         {
>           if (bmvCostStack[i]<bcost)
>           {
>@@ -1212,7 +1221,7 @@
>     {
>         pixelcmp_t hpelcomp;
> 
>-        for (int nBmv=0; nBmv<4; nBmv++)
>+        for (int nBmv=0; nBmv<MAX_NUM_BESTVECTORS; nBmv++)
>         {
>           bmv =  bmvStack[nBmv];
> 
>@@ -1266,7 +1275,7 @@
> 
>         bmv = bmvStack[0];
>         bcost = bmvCostStack[0];
>-        for (int i=1; i<4; i++)
>+        for (int i=1; i<MAX_NUM_BESTVECTORS; i++)
>         {
>           if (bmvCostStack[i]<bcost)
>           {
>_______________________________________________
>x265-devel mailing list
>x265-devel at videolan.org
>https://mailman.videolan.org/listinfo/x265-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20160730/aea7a756/attachment-0001.html>


More information about the x265-devel mailing list