Use big cfg.g_w in ConfigResizeChangeThreadCount
authorWan-Teh Chang <wtc@google.com>
Sun, 1 Oct 2023 02:45:35 +0000 (19:45 -0700)
committerWan-Teh Chang <wtc@google.com>
Mon, 2 Oct 2023 20:55:16 +0000 (13:55 -0700)
vp8cx_create_encoder_threads() caps the thread count at
(cm->mb_cols / cpi->mt_sync_range) - 1. If cfg.g_w is 16, cm->mb_cols is
only 1 (see vp8_alloc_frame_buffers: mb_cols = width >> 4), so we won't
be using multiple threads. To reproduce bug chromium:1486441, the test
just needs to increase cfg.g_h sufficiently.

Bug: chromium:1486441
Change-Id: Ie6b2da2e31cfa1717a481f55eebc8c875db94d87

test/encode_api_test.cc

index f1c98b2..6b22feb 100644 (file)
@@ -396,7 +396,7 @@ TEST(EncodeAPI, ConfigResizeChangeThreadCount) {
       EXPECT_EQ(vpx_codec_enc_config_set(&enc.ctx, &cfg), VPX_CODEC_OK)
           << vpx_codec_error_detail(&enc.ctx);
 
-      cfg.g_w = 16;
+      cfg.g_w = 1000;
       cfg.g_h = 720;
 
       for (const auto threads : { 1, 4, 8, 6, 2, 1 }) {