summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2016-09-21 09:55:53 +0300
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>2016-09-21 09:55:53 +0300
commit0fae277d34cd2db89c9c7be45f41684f1040052f (patch)
treedb2c84b5c341b974634b6a25739576f27537c9aa
parent44a90c196ddce97519d99311983ac04631e43d58 (diff)
encoder: vp8: Increase the allocation size for coded buffer
We are not getting enough compression for some streams and encoded frame end up with more size than allocated. Assuming a compression ratio of 4, which should be good enough for holding the frames. https://bugzilla.gnome.org/show_bug.cgi?id=771528
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_vp8.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c b/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
index c23bd257..af54d919 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
@@ -163,8 +163,9 @@ set_context_info (GstVaapiEncoder * base_encoder)
base_encoder->num_ref_frames = 3;
/* Only YUV 4:2:0 formats are supported for now. */
+ /* Assumig 4 times compression ratio */
base_encoder->codedbuf_size = GST_ROUND_UP_16 (vip->width) *
- GST_ROUND_UP_16 (vip->height) * 3 / 2;
+ GST_ROUND_UP_16 (vip->height) * 12 / 4;
base_encoder->codedbuf_size +=
MAX_FRAME_TAG_SIZE + MAX_UPDATE_SEGMENTATION_SIZE +