VP8: allow thread count changes
authorWan-Teh Chang <wtc@google.com>
Sat, 30 Sep 2023 22:50:14 +0000 (15:50 -0700)
committerWan-Teh Chang <wtc@google.com>
Fri, 6 Oct 2023 17:40:14 +0000 (10:40 -0700)
commit8cb4544c21a221e04fe21222349431ba1779d884
treed0f3902a774e17ae0737b7906a28d82b08a80a60
parentc23da380a386e2cae2c757f06a2aebfd72451413
VP8: allow thread count changes

Fix the TODO(https://crbug.com/1486441) comment in vp8/vp8_cx_iface.c.

Make vp8cx_create_encoder_threads() work after it has been called
before. If there are already the exact number of threads it needs to
create, return immediately. Otherwise, shut down the existing threads
(by calling vp8cx_remove_encoder_threads()) and create the required
number of threads.

Call vp8cx_create_encoder_threads() in vp8e_set_config() to respond to
changes in g_threads or g_w (which also affects the number of threads
through cm->mb_cols and cpi->mt_sync_range).

Change-Id: I552eeca5b1f1f5313f59559eb1da396f270a2429
vp8/encoder/ethreading.c
vp8/vp8_cx_iface.c