summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Isorce <jisorce@oblong.com>2020-01-27 15:17:27 -0800
committerTim-Philipp Müller <tim@centricular.com>2020-02-04 13:34:33 +0000
commitc8234337c767f8bdf95e5648fe50e18ee94353e0 (patch)
tree2848319eba2585aca3f617cf119d3462a48763ae
parent9ac4904fa189aaa9db865c6916fed3d03fa42d83 (diff)
downloadgstreamer-plugins-good-c8234337c767f8bdf95e5648fe50e18ee94353e0.tar.gz
vp8enc/vp8enc: set 1 for the default value of VP8E_SET_STATIC_THRESHOLD
In Google webrtc, the setting VP8E_SET_STATIC_THRESHOLD is set to 1 (except when the content is known to be static very often in which case it is set to 100, i.e. when sharing screen with Google Hangouts). The cpu usage drops a lot when using 1 for above setting because it allows the encoder to skip static/low content blocks. The current 0 default value uses too much cpu and confuses the user regarding the cpu usage expectations. User expects vp8enc to use low cpu by default. Documentation of VP8E_SET_STATIC_THRESHOLD: https://github.com/webmproject/libvpx/blob/master/vpx/vp8cx.h#L188 chromium/webrtc: https://chromium.googlesource.com/external/webrtc/+/b484ec0082948ae086c2ba4142b4d2bf8bc4dd4b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc#822 Closes #58
-rw-r--r--ext/vpx/gstvpxenc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/vpx/gstvpxenc.c b/ext/vpx/gstvpxenc.c
index 1fa2cccf3..4aa1bf047 100644
--- a/ext/vpx/gstvpxenc.c
+++ b/ext/vpx/gstvpxenc.c
@@ -88,7 +88,10 @@ GST_DEBUG_CATEGORY_STATIC (gst_vpxenc_debug);
#define DEFAULT_DEADLINE VPX_DL_BEST_QUALITY
#define DEFAULT_NOISE_SENSITIVITY 0
#define DEFAULT_SHARPNESS 0
-#define DEFAULT_STATIC_THRESHOLD 0
+
+/* Use same default value as Chromium/webrtc. */
+#define DEFAULT_STATIC_THRESHOLD 1
+
#define DEFAULT_TOKEN_PARTITIONS 0
#define DEFAULT_ARNR_MAXFRAMES 0
#define DEFAULT_ARNR_STRENGTH 3
@@ -582,8 +585,8 @@ gst_vpx_enc_class_init (GstVPXEncClass * klass)
g_object_class_install_property (gobject_class, PROP_STATIC_THRESHOLD,
g_param_spec_int ("static-threshold", "Static Threshold",
- "Motion detection threshold",
- 0, G_MAXINT, DEFAULT_STATIC_THRESHOLD,
+ "Motion detection threshold. Recommendation is to set 100 for "
+ "screen/window sharing", 0, G_MAXINT, DEFAULT_STATIC_THRESHOLD,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_TOKEN_PARTITIONS,