summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Jiang <jianj@google.com>2018-04-05 14:45:06 -0700
committerJerome Jiang <jianj@google.com>2018-04-06 12:52:53 -0700
commitbe4561248d354e7ebd284d238e12ca8ca924bd1e (patch)
treea1e1b98393baf6ae1425a9245981d61ed1897ad8
parent933619766383f9797d0486f8f3c5f00060a48a5f (diff)
downloadlibvpx-be4561248d354e7ebd284d238e12ca8ca924bd1e.tar
libvpx-be4561248d354e7ebd284d238e12ca8ca924bd1e.tar.gz
libvpx-be4561248d354e7ebd284d238e12ca8ca924bd1e.tar.bz2
libvpx-be4561248d354e7ebd284d238e12ca8ca924bd1e.zip
Fix settings for num of tiles in samples & tests.
The control is set by log2 of number of threads (such that the number of tiles is the same of number of threads). Thus it should be log2(num_threads) instead of (num_threads >> 1). Change-Id: I2ccec5557e660048dad3e561534e1c74fc8eec1f
-rw-r--r--examples/vp9_spatial_svc_encoder.c2
-rw-r--r--examples/vpx_temporal_svc_encoder.c3
-rw-r--r--test/svc_datarate_test.cc3
-rw-r--r--test/vp9_datarate_test.cc3
4 files changed, 7 insertions, 4 deletions
diff --git a/examples/vp9_spatial_svc_encoder.c b/examples/vp9_spatial_svc_encoder.c
index 4b3f8530c..747f79ffb 100644
--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -714,7 +714,7 @@ int main(int argc, const char **argv) {
if (svc_ctx.speed != -1)
vpx_codec_control(&codec, VP8E_SET_CPUUSED, svc_ctx.speed);
if (svc_ctx.threads) {
- vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (svc_ctx.threads >> 1));
+ vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, get_msb(svc_ctx.threads));
if (svc_ctx.threads > 1)
vpx_codec_control(&codec, VP9E_SET_ROW_MT, 1);
else
diff --git a/examples/vpx_temporal_svc_encoder.c b/examples/vpx_temporal_svc_encoder.c
index 4a32c22d0..ea475fbf9 100644
--- a/examples/vpx_temporal_svc_encoder.c
+++ b/examples/vpx_temporal_svc_encoder.c
@@ -22,6 +22,7 @@
#include "../vpx_ports/vpx_timer.h"
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
+#include "vpx_ports/bitops.h"
#include "../tools_common.h"
#include "../video_writer.h"
@@ -810,7 +811,7 @@ int main(int argc, char **argv) {
vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, kVp9DenoiserOff);
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0);
- vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (cfg.g_threads >> 1));
+ vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, get_msb(cfg.g_threads));
#if ROI_MAP
set_roi_map(encoder->name, &cfg, &roi);
if (vpx_codec_control(&codec, VP9E_SET_ROI_MAP, &roi))
diff --git a/test/svc_datarate_test.cc b/test/svc_datarate_test.cc
index 2340fa49e..0692fed80 100644
--- a/test/svc_datarate_test.cc
+++ b/test/svc_datarate_test.cc
@@ -15,6 +15,7 @@
#include "test/util.h"
#include "test/y4m_video_source.h"
#include "vpx/vpx_codec.h"
+#include "vpx_ports/bitops.h"
namespace {
@@ -200,7 +201,7 @@ class DatarateOnePassCbrSvc
encoder->Control(VP8E_SET_CPUUSED, speed_setting_);
encoder->Control(VP9E_SET_TILE_COLUMNS, 0);
encoder->Control(VP8E_SET_MAX_INTRA_BITRATE_PCT, 300);
- encoder->Control(VP9E_SET_TILE_COLUMNS, (cfg_.g_threads >> 1));
+ encoder->Control(VP9E_SET_TILE_COLUMNS, get_msb(cfg_.g_threads));
encoder->Control(VP9E_SET_ROW_MT, 1);
encoder->Control(VP8E_SET_STATIC_THRESHOLD, 1);
encoder->Control(VP9E_SET_TUNE_CONTENT, tune_content_);
diff --git a/test/vp9_datarate_test.cc b/test/vp9_datarate_test.cc
index fac4cf362..539c350cb 100644
--- a/test/vp9_datarate_test.cc
+++ b/test/vp9_datarate_test.cc
@@ -15,6 +15,7 @@
#include "test/util.h"
#include "test/y4m_video_source.h"
#include "vpx/vpx_codec.h"
+#include "vpx_ports/bitops.h"
namespace {
@@ -129,7 +130,7 @@ class DatarateTestVP9Large
}
encoder->Control(VP9E_SET_NOISE_SENSITIVITY, denoiser_on_);
- encoder->Control(VP9E_SET_TILE_COLUMNS, (cfg_.g_threads >> 1));
+ encoder->Control(VP9E_SET_TILE_COLUMNS, get_msb(cfg_.g_threads));
encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING,
frame_parallel_decoding_mode_);