[x265] [PATCH] sao.cpp: init additional pixels for SAO
Steve Borho
steve at borho.org
Thu Mar 5 17:06:50 CET 2015
On 03/05, praveen at multicorewareinc.com wrote:
> # HG changeset patch
> # User Praveen Tiwari <praveen at multicorewareinc.com>
> # Date 1425551764 -19800
> # Node ID 60f49deb3fa58bc35ba6e0557259433c01ee43e6
> # Parent ea9bdb10353fcb06cea1045ba0186c22c448df63
> sao.cpp: init additional pixels for SAO
>
> Prevents uninit read warnings from valgrind
Queued, with an comment in the code for why the memset is necessary.
If you're only setting two bytes, you should be able to do something
like this: *(uint16_t*)(_upBuff1 + MAX_CU_SIZE) = 0;
It would likely be faster than a memset.
> diff -r ea9bdb10353f -r 60f49deb3fa5 source/encoder/sao.cpp
> --- a/source/encoder/sao.cpp Wed Mar 04 13:20:55 2015 +0530
> +++ b/source/encoder/sao.cpp Thu Mar 05 16:06:04 2015 +0530
> @@ -261,6 +261,8 @@
> int8_t _upBuff1[MAX_CU_SIZE + 2], *upBuff1 = _upBuff1 + 1;
> int8_t _upBufft[MAX_CU_SIZE + 2], *upBufft = _upBufft + 1;
>
> + memset(_upBuff1 + MAX_CU_SIZE, 0, 2 * sizeof(int8_t));
> +
> {
> const pixel* recR = &rec[ctuWidth - 1];
> for (int i = 0; i < ctuHeight + 1; i++)
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
--
Steve Borho
More information about the x265-devel
mailing list