ref: 878464150bf15d916cc1f082acafe0eefb3afc5d
parent: f12e786c543176f4fd2e71190c423c282598345e
parent: 767503504fa063b637e35b9a86f85b28025cdd42
author: Jerome Jiang <jianj@google.com>
date: Tue Sep 26 21:26:59 EDT 2017
Merge "Add unit test to expose vp8 bug when width is set odd."
--- a/test/encode_api_test.cc
+++ b/test/encode_api_test.cc
@@ -79,4 +79,31 @@
#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<uint8_t *>(
+ 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