[x265] [PATCH] sao: remove duplicate calculation on BO cost
Ashok Kumar Mishra
ashok at multicorewareinc.com
Thu Jun 29 09:45:37 CEST 2017
Can be pushed.
On Wed, Jun 28, 2017 at 10:14 PM, Ximing Cheng <chengximing1989 at foxmail.com>
wrote:
> # HG changeset patch
> # User Ximing Cheng <ximingcheng at tencent.com>
> # Date 1498668227 -28800
> # Thu Jun 29 00:43:47 2017 +0800
> # Node ID 0bb8e464147ac932c74321663216214969a079ac
> # Parent fa076d29d6191699e314484a94dcae472e9c102a
> sao: remove duplicate calculation on BO cost
>
> diff -r fa076d29d619 -r 0bb8e464147a source/encoder/sao.cpp
> --- a/source/encoder/sao.cpp Tue Jun 27 16:41:11 2017 +0530
> +++ b/source/encoder/sao.cpp Thu Jun 29 00:43:47 2017 +0800
> @@ -1553,14 +1553,17 @@
> }
>
> // Estimate Best Position
> - int64_t bestRDCostBO = MAX_INT64;
> int32_t bestClassBO = 0;
> + int64_t currentRDCost = costClasses[0];
> + currentRDCost += costClasses[1];
> + currentRDCost += costClasses[2];
> + currentRDCost += costClasses[3];
> + int64_t bestRDCostBO = currentRDCost;
>
> - for (int i = 0; i < MAX_NUM_SAO_CLASS - SAO_NUM_OFFSET + 1; i++)
> + for (int i = 1; i < MAX_NUM_SAO_CLASS - SAO_NUM_OFFSET + 1; i++)
> {
> - int64_t currentRDCost = 0;
> - for (int j = i; j < i + SAO_NUM_OFFSET; j++)
> - currentRDCost += costClasses[j];
> + currentRDCost -= costClasses[i - 1];
> + currentRDCost += costClasses[i + 3];
>
> if (currentRDCost < bestRDCostBO)
> {
>
>
> _______________________________________________
> 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/20170629/8cf7ec37/attachment.html>
More information about the x265-devel
mailing list