From 767503504fa063b637e35b9a86f85b28025cdd42 Mon Sep 17 00:00:00 2001 From: Jerome Jiang Date: Thu, 21 Sep 2017 10:52:20 -0700 Subject: [PATCH] Add unit test to expose vp8 bug when width is set odd. BUG=b/64710201 Change-Id: Ia518af5494a42e80949cf1165244fbed59606cf7 --- test/encode_api_test.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/encode_api_test.cc b/test/encode_api_test.cc index f685493aa..cad4c0e47 100644 --- a/test/encode_api_test.cc +++ b/test/encode_api_test.cc @@ -79,4 +79,31 @@ TEST(EncodeAPI, HighBitDepthCapability) { #endif } +#if CONFIG_VP8_ENCODER +TEST(EncodeAPI, DISABLED_ImageSizeSetting) { + const int width = 711; + const int height = 360; + const int bps = 12; + vpx_image_t img; + vpx_codec_ctx_t enc; + vpx_codec_enc_cfg_t cfg; + uint8_t *img_buf = reinterpret_cast( + calloc(width * height * bps / 8, sizeof(*img_buf))); + vpx_codec_enc_config_default(vpx_codec_vp8_cx(), &cfg, 0); + + cfg.g_w = width; + cfg.g_h = height; + + vpx_img_wrap(&img, VPX_IMG_FMT_I420, width, height, 1, img_buf); + + vpx_codec_enc_init(&enc, vpx_codec_vp8_cx(), &cfg, 0); + + EXPECT_EQ(VPX_CODEC_OK, vpx_codec_encode(&enc, &img, 0, 1, 0, 0)); + + free(img_buf); + + vpx_codec_destroy(&enc); +} +#endif + } // namespace -- 2.40.0