From: Eunki, Hong Date: Thu, 4 Jan 2024 08:27:36 +0000 (+0900) Subject: Optimize downscale scanline for RGBA format X-Git-Tag: dali_2.3.5~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F303751%2F1;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Optimize downscale scanline for RGBA format Each components of RGBA channel has uint8_t type. So we can parallaly calculate each components of RGBA. It will increase the speed of operation. Change-Id: I3b738926b8a5d706844550a63cbc7256a7c3122f Signed-off-by: Eunki, Hong --- diff --git a/dali/internal/imaging/common/image-operations.cpp b/dali/internal/imaging/common/image-operations.cpp index 8e39268..5d6f347 100644 --- a/dali/internal/imaging/common/image-operations.cpp +++ b/dali/internal/imaging/common/image-operations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1549,14 +1549,20 @@ void AverageScanlinesRGBA8888(const uint8_t* const scanline1, DALI_ASSERT_DEBUG(((reinterpret_cast(scanline2) & 3u) == 0u) && "Pointer should be 4-byte aligned for performance on some platforms."); DALI_ASSERT_DEBUG(((reinterpret_cast(outputScanline) & 3u) == 0u) && "Pointer should be 4-byte aligned for performance on some platforms."); - const uint32_t* const alignedScanline1 = reinterpret_cast(scanline1); - const uint32_t* const alignedScanline2 = reinterpret_cast(scanline2); - uint32_t* const alignedOutput = reinterpret_cast(outputScanline); + /** + * @code + * const uint32_t* const alignedScanline1 = reinterpret_cast(scanline1); + * const uint32_t* const alignedScanline2 = reinterpret_cast(scanline2); + * uint32_t* const alignedOutput = reinterpret_cast(outputScanline); + * + * for(uint32_t pixel = 0; pixel < width; ++pixel) + * { + * alignedOutput[pixel] = AveragePixelRGBA8888(alignedScanline1[pixel], alignedScanline2[pixel]); + * } + * @endcode + */ - for(uint32_t pixel = 0; pixel < width; ++pixel) - { - alignedOutput[pixel] = AveragePixelRGBA8888(alignedScanline1[pixel], alignedScanline2[pixel]); - } + AverageScanlinesWithMultipleComponents(scanline1, scanline2, outputScanline, width * 4u); } void AverageScanlinesRGB565(const uint8_t* const scanline1,