[x265] [PATCH]Add: Auto AQ Mode
chen
chenm003 at 163.com
Thu Feb 27 10:04:58 CET 2020
At 2020-02-27 16:59:18, "Niranjan Bala" <niranjan at multicorewareinc.com> wrote:
+double computeBrightnessIntensity(pixel *inPlane, int width, int height, intptr_t stride)
+{
+ pixel* rowStart = inPlane;
restrict with const prefix may better.
+ double count = 0;
why declare as Double?
+
+ for (int i = 0; i < height; i++)
+ {
+ for (int j = 0; j < width; j++)
+ {
+ if (rowStart[j] > BRIGHTNESS_THRESHOLD)
+ count++;
+ }
+ rowStart += stride;
+ }
+
+ /* Returns the brightness percentage of the input plane */
+ return (count / (width * height)) * 100;
+}
+
+double computeEdgeIntensity(pixel *inPlane, int width, int height, intptr_t stride)
+{
+ pixel* rowStart = inPlane;
+ double count = 0;
+
+ for (int i = 0; i < height; i++)
+ {
+ for (int j = 0; j < width; j++)
+ {
+ if (rowStart[j] > 0)
+ count++;
+ }
+ rowStart += stride;
+ }
+
+ /* Returns the edge percentage of the input plane */
+ return (count / (width * height)) * 100;
100 is integer, multiplication with Double.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20200227/697c5a32/attachment.html>
More information about the x265-devel
mailing list