Skip to content

Commit

Permalink
Add missing f for floats. (AOMediaCodec#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud authored Dec 20, 2023
1 parent 29b0d2e commit 995f89f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/gtest/avifcolrtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TEST(TransferCharacteristicsTest, RoundTrip) {
}

if (tc == AVIF_TRANSFER_CHARACTERISTICS_LOG100) {
EXPECT_NEAR(min_linear, kTransferLog100Threshold / 2.0f, 1e-7);
EXPECT_NEAR(min_linear, kTransferLog100Threshold / 2.0f, 1e-7f);
} else if (tc == AVIF_TRANSFER_CHARACTERISTICS_LOG100_SQRT10) {
EXPECT_EQ(min_linear, kTransferLog100Sqrt10Threshold / 2.0f);
} else {
Expand All @@ -68,7 +68,7 @@ TEST(TransferCharacteristicsTest, RoundTrip) {
0.00001); // HLG max extended SDR value.
} else if (tc == AVIF_TRANSFER_CHARACTERISTICS_SMPTE428) {
// See formula in Table 3 of ITU-T H.273.
EXPECT_NEAR(max_linear, 52.37f / 48.0f, 0.00001);
EXPECT_NEAR(max_linear, 52.37f / 48.0f, 0.00001f);
} else {
EXPECT_EQ(max_linear, 1.0f);
}
Expand Down Expand Up @@ -101,12 +101,12 @@ TEST(TransferCharacteristicsTest, ToGammaHasCorrectShape) {

const float gamma = to_gamma(extended_sdr_scaled);

if (tc == AVIF_TRANSFER_CHARACTERISTICS_SMPTE428 && linear > 0.9) {
if (tc == AVIF_TRANSFER_CHARACTERISTICS_SMPTE428 && linear > 0.9f) {
continue; // Smpte428 is a bit below the y=x diagonal at the high end.
}

// Check the point is above (or at) the y=x diagonal, with some tolerance.
ASSERT_GE(gamma, linear - 1e-6);
ASSERT_GE(gamma, linear - 1e-6f);
}
}
}
Expand Down

0 comments on commit 995f89f

Please sign in to comment.