⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.23
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
local
/
src
/
libavif-0.11.1
/
tests
/
gtest
/
View File Name :
aviftilingtest.cc
// Copyright 2022 Google LLC. All rights reserved. // SPDX-License-Identifier: BSD-2-Clause #include <ostream> #include "avif/avif.h" #include "avif/internal.h" #include "gtest/gtest.h" namespace { struct SetTileConfigurationTestParams { int threads; uint32_t width; uint32_t height; int expected_tile_rows_log2; int expected_tile_cols_log2; }; std::ostream& operator<<(std::ostream& os, const SetTileConfigurationTestParams& test) { return os << "SetTileConfigurationTestParams { threads:" << test.threads << " width:" << test.width << " height:" << test.height << " }"; } TEST(TilingTest, SetTileConfiguration) { constexpr int kThreads = 8; int tile_rows_log2; int tile_cols_log2; constexpr SetTileConfigurationTestParams kTests[]{ // 144p {kThreads, 256, 144, 0, 0}, // 240p {kThreads, 426, 240, 0, 0}, // 360p {kThreads, 640, 360, 0, 0}, // 480p {kThreads, 854, 480, 0, 1}, // 720p {kThreads, 1280, 720, 1, 1}, // 1080p {kThreads, 1920, 1080, 1, 2}, // 2K {kThreads, 2560, 1440, 1, 2}, // 4K {32, 3840, 2160, 2, 3}, // 8K {32, 7680, 4320, 2, 3}, // Kodak image set: 768x512 {kThreads, 768, 512, 0, 1}, {kThreads, 16384, 64, 0, 2}, }; for (const auto& test : kTests) { avifSetTileConfiguration(test.threads, test.width, test.height, &tile_rows_log2, &tile_cols_log2); EXPECT_EQ(tile_rows_log2, test.expected_tile_rows_log2) << test; EXPECT_EQ(tile_cols_log2, test.expected_tile_cols_log2) << test; // Swap width and height. avifSetTileConfiguration(test.threads, test.height, test.width, &tile_rows_log2, &tile_cols_log2); EXPECT_EQ(tile_rows_log2, test.expected_tile_cols_log2) << test; EXPECT_EQ(tile_cols_log2, test.expected_tile_rows_log2) << test; } } } // namespace