aboutsummaryrefslogtreecommitdiffstats
path: root/tests/checkasm/sw_range_convert.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2024-09-18 16:29:14 +0200
committerRamiro Polla <ramiro.polla@gmail.com>2024-10-27 13:20:56 +0100
commita8ef1fac0dfa9d64ba47fd6c4a307e2d4acb218f (patch)
tree39626bb350d977af26d4546eede36730188098c8 /tests/checkasm/sw_range_convert.c
parent8b30daedf7933346589e6283f0b58f33cd8bf52a (diff)
downloadffmpeg-a8ef1fac0dfa9d64ba47fd6c4a307e2d4acb218f.tar.gz
checkasm: use FF_ARRAY_ELEMS instead of hardcoding size of arrays
Diffstat (limited to 'tests/checkasm/sw_range_convert.c')
-rw-r--r--tests/checkasm/sw_range_convert.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/checkasm/sw_range_convert.c b/tests/checkasm/sw_range_convert.c
index 7da29b896e..06ea3474e4 100644
--- a/tests/checkasm/sw_range_convert.c
+++ b/tests/checkasm/sw_range_convert.c
@@ -32,7 +32,6 @@ static void check_lumConvertRange(int from)
{
const char *func_str = from ? "lumRangeFromJpeg" : "lumRangeToJpeg";
#define LARGEST_INPUT_SIZE 512
-#define INPUT_SIZES 6
static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
SwsContext *sws;
SwsInternal *c;
@@ -52,7 +51,7 @@ static void check_lumConvertRange(int from)
c->srcRange = from;
c->dstRange = !from;
- for (int dstWi = 0; dstWi < INPUT_SIZES; dstWi++) {
+ for (int dstWi = 0; dstWi < FF_ARRAY_ELEMS(input_sizes); dstWi++) {
int width = input_sizes[dstWi];
for (int i = 0; i < width; i++) {
uint8_t r = rnd();
@@ -72,13 +71,11 @@ static void check_lumConvertRange(int from)
sws_freeContext(sws);
}
#undef LARGEST_INPUT_SIZE
-#undef INPUT_SIZES
static void check_chrConvertRange(int from)
{
const char *func_str = from ? "chrRangeFromJpeg" : "chrRangeToJpeg";
#define LARGEST_INPUT_SIZE 512
-#define INPUT_SIZES 6
static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
SwsContext *sws;
SwsInternal *c;
@@ -100,7 +97,7 @@ static void check_chrConvertRange(int from)
c->srcRange = from;
c->dstRange = !from;
- for (int dstWi = 0; dstWi < INPUT_SIZES; dstWi++) {
+ for (int dstWi = 0; dstWi < FF_ARRAY_ELEMS(input_sizes); dstWi++) {
int width = input_sizes[dstWi];
for (int i = 0; i < width; i++) {
uint8_t r = rnd();
@@ -123,7 +120,6 @@ static void check_chrConvertRange(int from)
sws_freeContext(sws);
}
#undef LARGEST_INPUT_SIZE
-#undef INPUT_SIZES
void checkasm_check_sw_range_convert(void)
{