[x265] [x265 patch] New AQ mode with Variance and Edge information

chen chenm003 at 163.com
Fri Jul 12 03:56:40 CEST 2019


On Wed, Jul 10, 2019 at 3:41 PM Akil <akil at multicorewareinc.com> wrote:

# HG changeset patch
# User Akil Ayyappan<akil at multicorewareinc.com>
# Date 1561035091 -19800
#      Thu Jun 20 18:21:31 2019 +0530
# Node ID d25c33cc2b748401c5e908af445a0a110e26c3cf
# Parent  4f6dde51a5db4f9229bddb60db176f16ac98f505
AQ: New AQ mode with Variance and Edge information


+    //Applying Gaussian filter on the picture
+    src = (pixel*)curFrame->m_fencPic->m_picOrg[0];
+    refPic = pic2 + curFrame->m_fencPic->m_lumaMarginY * stride + curFrame->m_fencPic->m_lumaMarginX;
+    pixel pixelValue = 0;
+    for (int rowNum = 0; rowNum < height; rowNum++)
+    {
+        for (int colNum = 0; colNum < width; colNum++)
+        {
+            if ((rowNum >= 2) && (colNum >= 2) && (rowNum != height - 2) && (colNum != width - 2)) //Ignoring the border pixels of the picture
+            {
+                pixelValue = ((2 * src[(rowNum - 2)*stride + (colNum - 2)] + 4 * src[(rowNum - 2)*stride + (colNum - 1)] + 5 * src[(rowNum - 2)*stride + (colNum)] + 4 * src[(rowNum - 2)*stride + (colNum + 1)] + 2 * src[(rowNum - 2)*stride + (colNum + 2)] +
+                    4 * src[(rowNum - 1)*stride + (colNum - 2)] + 9 * src[(rowNum - 1)*stride + (colNum - 1)] + 12 * src[(rowNum - 1)*stride + (colNum)] + 9 * src[(rowNum - 1)*stride + (colNum + 1)] + 4 * src[(rowNum - 1)*stride + (colNum + 2)] +
+                    5 * src[(rowNum)*stride + (colNum - 2)] + 12 * src[(rowNum)*stride + (colNum - 1)] + 15 * src[(rowNum)*stride + (colNum)] + 12 * src[(rowNum)*stride + (colNum + 1)] + 5 * src[(rowNum)*stride + (colNum + 2)] +
+                    4 * src[(rowNum + 1)*stride + (colNum - 2)] + 9 * src[(rowNum + 1)*stride + (colNum - 1)] + 12 * src[(rowNum + 1)*stride + (colNum)] + 9 * src[(rowNum + 1)*stride + (colNum + 1)] + 4 * src[(rowNum + 1)*stride + (colNum + 2)] +
+                    2 * src[(rowNum + 2)*stride + (colNum - 2)] + 4 * src[(rowNum + 2)*stride + (colNum - 1)] + 5 * src[(rowNum + 2)*stride + (colNum)] + 4 * src[(rowNum + 2)*stride + (colNum + 1)] + 2 * src[(rowNum + 2)*stride + (colNum + 2)]) / 159);
+                refPic[(rowNum*stride) + colNum] = pixelValue;
+            }
+        }
+    }



Could you please modify a little?
Ident or give coif matrix as comment, it will be more readable
moreover, (rowNum+X)*stride can be replace by constant, it does not affect compiled code performance but help human read code.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20190712/0dce51c9/attachment.html>


More information about the x265-devel mailing list