X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=ycbcr_input_test.cpp;h=a5032af657de73935aabaef79983b3d7603a28c7;hp=463cb7e2d3771180c0d8fe06a65e62bd7931678e;hb=274627c966f53780991e9f80887aa1906b592751;hpb=9c6b86affb570a2e2d18c6da795c359da393f9a3 diff --git a/ycbcr_input_test.cpp b/ycbcr_input_test.cpp index 463cb7e..a5032af 100644 --- a/ycbcr_input_test.cpp +++ b/ycbcr_input_test.cpp @@ -688,4 +688,35 @@ TEST(YCbCrTest, WikipediaJPEGMatrices) { EXPECT_NEAR(128.0, offset[2] * 255.0, 1e-3); } +TEST(YCbCrInputTest, NoData) { + const int width = 1; + const int height = 5; + + float out_data[4 * width * height]; + + EffectChainTester tester(NULL, width, height); + + ImageFormat format; + format.color_space = COLORSPACE_sRGB; + format.gamma_curve = GAMMA_sRGB; + + 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; + ycbcr_format.cb_y_position = 0.5f; + ycbcr_format.cr_x_position = 0.5f; + ycbcr_format.cr_y_position = 0.5f; + + YCbCrInput *input = new YCbCrInput(format, ycbcr_format, width, height); + tester.get_chain()->add_input(input); + + tester.run(out_data, GL_RGBA, COLORSPACE_sRGB, GAMMA_sRGB); + + // Don't care what the output was, just that it does not crash. +} + } // namespace movit