[x265] [PATCH] primitive function for luma and chroma for loops in addAvg()

chen chenm003 at 163.com
Sat Nov 16 10:23:07 CET 2013


>@@ -641,26 +629,8 @@
>         width  >>= m_hChromaShift;
>         height >>= m_vChromaShift;
> 
>-        for (y = height - 1; y >= 0; y--)
>-        {
>-            for (x = width - 1; x >= 0; )
>-            {
>-                // note: chroma min width is 2
>-                dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);
>-                dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);
>-                x--;
>-                dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);
>-                dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);
>-                x--;
>-            }
>-
>-            srcU0 += src0Stride;
>-            srcU1 += src1Stride;
>-            srcV0 += src0Stride;
>-            srcV1 += src1Stride;
>-            dstU  += dststride;
>-            dstV  += dststride;
>-        }
>+        primitives.addAvg_c[part](dstU, dststride, srcU0, src0Stride, srcU1, src1Stride);
>+        primitives.addAvg_c[part](dstV, dststride, srcV0, src0Stride, srcV1, src1Stride);

I guess you use luma index here will be wrong size for chroma
 


No, it is correct to use the luma partition enum here.
 
They old code not split into luma_addAvg[] and chroma_addAvg[], so reuse index is right, but really size wrong
 
>+
>+    addAvg_t        addAvg_c[NUM_LUMA_PARTITIONS];

name addAvg_c is for C reference code, here use addAvg is better


agreed 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131116/99cee01c/attachment-0001.html>


More information about the x265-devel mailing list