Skip to content

Commit

Permalink
VP8: disallow thread count changes
Browse files Browse the repository at this point in the history
Currently allocations are done at encoder creation time. Going from
threaded to non-threaded would cause a crash.

Bug: chromium:1486441
Change-Id: Ie301c2a70847dff2f0daae408fbef1e4d42e73d4
  • Loading branch information
jzern committed Sep 26, 2023
1 parent af6dedd commit 3fbd1dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions test/encode_api_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,6 @@ TEST(EncodeAPI, ConfigResizeChangeThreadCount) {

for (const auto *iface : kCodecIfaces) {
SCOPED_TRACE(vpx_codec_iface_name(iface));
if (!IsVP9(iface)) {
GTEST_SKIP() << "TODO(https://crbug.com/1486441) remove this condition "
"after VP8 is fixed.";
}
for (int i = 0; i < (IsVP9(iface) ? 2 : 1); ++i) {
vpx_codec_enc_cfg_t cfg = {};
struct Encoder {
Expand Down
5 changes: 5 additions & 0 deletions vp8/encoder/onyx_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,11 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) {
last_h = cpi->oxcf.Height;
prev_number_of_layers = cpi->oxcf.number_of_layers;

if (cpi->initial_width) {
// TODO(https://crbug.com/1486441): Allow changing thread counts; the
// allocation is done once in vp8_create_compressor().
oxcf->multi_threaded = cpi->oxcf.multi_threaded;
}
cpi->oxcf = *oxcf;

switch (cpi->oxcf.Mode) {
Expand Down

0 comments on commit 3fbd1dc

Please sign in to comment.