gstreamer1-plugins-good/0001-vp8enc-Fix-default-target-bitrate-value.patch
2012-10-24 19:18:10 +02:00

54 lines
2.4 KiB
Diff

From 1962384cffc037f704c586c85c0cf590c68f8d89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian.droege@collabora.co.uk>
Date: Mon, 15 Oct 2012 15:30:33 +0200
Subject: [PATCH] vp8enc: Fix default target-bitrate value
---
ext/vpx/gstvp8enc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/ext/vpx/gstvp8enc.c b/ext/vpx/gstvp8enc.c
index f465174..2ae7a32 100644
--- a/ext/vpx/gstvp8enc.c
+++ b/ext/vpx/gstvp8enc.c
@@ -441,7 +441,7 @@ gst_vp8_enc_class_init (GstVP8EncClass * klass)
g_object_class_install_property (gobject_class, PROP_RC_TARGET_BITRATE,
g_param_spec_int ("target-bitrate", "Target bitrate",
"Target bitrate (in bits/sec)",
- 0, G_MAXINT, DEFAULT_RC_TARGET_BITRATE,
+ 0, G_MAXINT, DEFAULT_RC_TARGET_BITRATE / 1000,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_RC_MIN_QUANTIZER,
@@ -565,7 +565,7 @@ gst_vp8_enc_class_init (GstVP8EncClass * klass)
"Coding layer target bitrates",
"Target bitrates for coding layers (one per layer, decreasing)",
g_param_spec_int ("target-bitrate", "Target bitrate",
- "Target bitrate", 0, G_MAXINT, DEFAULT_RC_TARGET_BITRATE,
+ "Target bitrate", 0, G_MAXINT, DEFAULT_RC_TARGET_BITRATE / 1000,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS),
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
@@ -724,7 +724,7 @@ gst_vp8_enc_init (GstVP8Enc * gst_vp8_enc)
}
gst_vp8_enc->cfg.rc_end_usage = DEFAULT_RC_END_USAGE;
- gst_vp8_enc->cfg.rc_target_bitrate = DEFAULT_RC_TARGET_BITRATE;
+ gst_vp8_enc->cfg.rc_target_bitrate = DEFAULT_RC_TARGET_BITRATE / 1000;
gst_vp8_enc->rc_target_bitrate_set = FALSE;
gst_vp8_enc->cfg.rc_min_quantizer = DEFAULT_RC_MIN_QUANTIZER;
gst_vp8_enc->cfg.rc_max_quantizer = DEFAULT_RC_MAX_QUANTIZER;
@@ -1504,7 +1504,8 @@ gst_vp8_enc_set_format (GstVideoEncoder * video_encoder,
if (!encoder->rc_target_bitrate_set)
encoder->cfg.rc_target_bitrate =
gst_util_uint64_scale (DEFAULT_RC_TARGET_BITRATE,
- GST_VIDEO_INFO_WIDTH (info) * GST_VIDEO_INFO_HEIGHT (info), 320 * 240);
+ GST_VIDEO_INFO_WIDTH (info) * GST_VIDEO_INFO_HEIGHT (info),
+ 320 * 240 * 1000);
encoder->cfg.g_w = GST_VIDEO_INFO_WIDTH (info);
encoder->cfg.g_h = GST_VIDEO_INFO_HEIGHT (info);
--
1.7.12.1