X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=ycbcr_input_test.cpp;h=873a6c5f132c3b0e5a303e4192d5905f0c69c049;hp=6895b3834a62602aa293c012957638684b471074;hb=5f81c29e307735bbadb3c0cb06500af627b2e57a;hpb=5ee3e6bb0bf100d57a06911b89c3a0a0dc49e2be diff --git a/ycbcr_input_test.cpp b/ycbcr_input_test.cpp index 6895b38..873a6c5 100644 --- a/ycbcr_input_test.cpp +++ b/ycbcr_input_test.cpp @@ -1,5 +1,4 @@ // Unit tests for YCbCrInput. -// FIXME: This class really ought to support mipmaps. #include #include @@ -12,7 +11,7 @@ namespace movit { -TEST(YCbCrInput, Simple444) { +TEST(YCbCrInputTest, Simple444) { const int width = 1; const int height = 5; @@ -45,6 +44,7 @@ TEST(YCbCrInput, Simple444) { YCbCrFormat ycbcr_format; ycbcr_format.luma_coefficients = YCBCR_REC_601; ycbcr_format.full_range = false; + ycbcr_format.num_levels = 256; ycbcr_format.chroma_subsampling_x = 1; ycbcr_format.chroma_subsampling_y = 1; ycbcr_format.cb_x_position = 0.5f; @@ -65,7 +65,7 @@ TEST(YCbCrInput, Simple444) { expect_equal(expected_data, out_data, 4 * width, height, 0.025, 0.002); } -TEST(YCbCrInput, FullRangeRec601) { +TEST(YCbCrInputTest, FullRangeRec601) { const int width = 1; const int height = 5; @@ -99,6 +99,7 @@ TEST(YCbCrInput, FullRangeRec601) { YCbCrFormat ycbcr_format; ycbcr_format.luma_coefficients = YCBCR_REC_601; ycbcr_format.full_range = true; + ycbcr_format.num_levels = 256; ycbcr_format.chroma_subsampling_x = 1; ycbcr_format.chroma_subsampling_y = 1; ycbcr_format.cb_x_position = 0.5f; @@ -119,7 +120,7 @@ TEST(YCbCrInput, FullRangeRec601) { expect_equal(expected_data, out_data, 4 * width, height, 0.025, 0.002); } -TEST(YCbCrInput, Rec709) { +TEST(YCbCrInputTest, Rec709) { const int width = 1; const int height = 5; @@ -152,6 +153,7 @@ TEST(YCbCrInput, Rec709) { YCbCrFormat ycbcr_format; ycbcr_format.luma_coefficients = YCBCR_REC_709; ycbcr_format.full_range = false; + ycbcr_format.num_levels = 256; ycbcr_format.chroma_subsampling_x = 1; ycbcr_format.chroma_subsampling_y = 1; ycbcr_format.cb_x_position = 0.5f; @@ -172,7 +174,7 @@ TEST(YCbCrInput, Rec709) { expect_equal(expected_data, out_data, 4 * width, height, 0.025, 0.002); } -TEST(YCbCrInput, Rec2020) { +TEST(YCbCrInputTest, Rec2020) { const int width = 1; const int height = 5; @@ -207,6 +209,7 @@ TEST(YCbCrInput, Rec2020) { YCbCrFormat ycbcr_format; ycbcr_format.luma_coefficients = YCBCR_REC_2020; ycbcr_format.full_range = false; + ycbcr_format.num_levels = 256; ycbcr_format.chroma_subsampling_x = 1; ycbcr_format.chroma_subsampling_y = 1; ycbcr_format.cb_x_position = 0.5f; @@ -227,7 +230,7 @@ TEST(YCbCrInput, Rec2020) { expect_equal(expected_data, out_data, 4 * width, height, 0.025, 0.002); } -TEST(YCbCrInput, Subsampling420) { +TEST(YCbCrInputTest, Subsampling420) { const int width = 4; const int height = 4; @@ -268,6 +271,7 @@ TEST(YCbCrInput, Subsampling420) { YCbCrFormat ycbcr_format; ycbcr_format.luma_coefficients = YCBCR_REC_601; ycbcr_format.full_range = false; + ycbcr_format.num_levels = 256; ycbcr_format.chroma_subsampling_x = 2; ycbcr_format.chroma_subsampling_y = 2; ycbcr_format.cb_x_position = 0.5f; @@ -288,7 +292,7 @@ TEST(YCbCrInput, Subsampling420) { expect_equal(expected_data, out_data, width, height, 0.01, 0.001); } -TEST(YCbCrInput, Subsampling420WithNonCenteredSamples) { +TEST(YCbCrInputTest, Subsampling420WithNonCenteredSamples) { const int width = 4; const int height = 4; @@ -329,6 +333,7 @@ TEST(YCbCrInput, Subsampling420WithNonCenteredSamples) { YCbCrFormat ycbcr_format; ycbcr_format.luma_coefficients = YCBCR_REC_601; ycbcr_format.full_range = false; + ycbcr_format.num_levels = 256; ycbcr_format.chroma_subsampling_x = 2; ycbcr_format.chroma_subsampling_y = 2; ycbcr_format.cb_x_position = 0.0f; @@ -350,7 +355,7 @@ TEST(YCbCrInput, Subsampling420WithNonCenteredSamples) { } // Yes, some 4:2:2 formats actually have this craziness. -TEST(YCbCrInput, DifferentCbAndCrPositioning) { +TEST(YCbCrInputTest, DifferentCbAndCrPositioning) { const int width = 4; const int height = 4; @@ -398,6 +403,7 @@ TEST(YCbCrInput, DifferentCbAndCrPositioning) { YCbCrFormat ycbcr_format; ycbcr_format.luma_coefficients = YCBCR_REC_601; ycbcr_format.full_range = false; + ycbcr_format.num_levels = 256; ycbcr_format.chroma_subsampling_x = 2; ycbcr_format.chroma_subsampling_y = 1; ycbcr_format.cb_x_position = 0.0f; @@ -420,7 +426,7 @@ TEST(YCbCrInput, DifferentCbAndCrPositioning) { expect_equal(expected_data_blue, out_data, width, height, 0.01, 0.001); } -TEST(YCbCrInput, PBO) { +TEST(YCbCrInputTest, PBO) { const int width = 1; const int height = 5; @@ -455,6 +461,7 @@ TEST(YCbCrInput, PBO) { YCbCrFormat ycbcr_format; ycbcr_format.luma_coefficients = YCBCR_REC_601; ycbcr_format.full_range = false; + ycbcr_format.num_levels = 256; ycbcr_format.chroma_subsampling_x = 1; ycbcr_format.chroma_subsampling_y = 1; ycbcr_format.cb_x_position = 0.5f;