]> granicus.if.org Git - libvpx/commitdiff
Add unit test to expose vp8 bug when width is set odd.
authorJerome Jiang <jianj@google.com>
Thu, 21 Sep 2017 17:52:20 +0000 (10:52 -0700)
committerJerome Jiang <jianj@google.com>
Wed, 27 Sep 2017 00:40:13 +0000 (17:40 -0700)
BUG=b/64710201

Change-Id: Ia518af5494a42e80949cf1165244fbed59606cf7

test/encode_api_test.cc

index f685493aa085c861a23ba3a71a6ef6454c9b48a2..cad4c0e471c10630dd57a81f4ac3a6ce1a1d26f8 100644 (file)
@@ -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<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