gstreamer-plugins-bad-free/vp8enc-bitrate-fix.patch
2012-05-29 23:13:38 +02:00

24 lines
917 B
Diff

diff -ru gst-plugins-bad-0.10.23.orign/ext/vp8/gstvp8enc.c gst-plugins-bad-0.10.23/ext/vp8/gstvp8enc.c
--- gst-plugins-bad-0.10.23.orign/ext/vp8/gstvp8enc.c 2012-01-25 18:10:21.000000000 +0100
+++ gst-plugins-bad-0.10.23/ext/vp8/gstvp8enc.c 2012-05-28 14:21:16.552995768 +0200
@@ -732,6 +732,11 @@
return FALSE;
}
+ /* Scale default bitrate to our size */
+ cfg.rc_target_bitrate = gst_util_uint64_scale (cfg.rc_target_bitrate,
+ state->width * state->height,
+ cfg.g_w * cfg.g_h);
+
cfg.g_w = state->width;
cfg.g_h = state->height;
cfg.g_timebase.num = state->fps_d;
@@ -755,7 +760,6 @@
} else {
cfg.rc_min_quantizer = (gint) (63 - encoder->quality * 6.2);
cfg.rc_max_quantizer = (gint) (63 - encoder->quality * 6.2);
- cfg.rc_target_bitrate = encoder->bitrate;
}
cfg.rc_dropframe_thresh = encoder->drop_frame;
cfg.rc_resize_allowed = encoder->resize_allowed;