From 6579e9e4808ba5dc672fd245606f0850bc8285a4 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Thu, 4 Jan 2024 17:27:36 +0900 Subject: [PATCH] [Tizen] 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 --- dali/internal/imaging/common/image-operations.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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, -- 2.7.4