summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2015-05-28 10:43:20 +0300
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>2015-05-28 10:43:20 +0300
commit4d8eaf1918934db66c43259447146c1ba21e89c6 (patch)
treeb201ad5d9590f3f513ba5a1e573fc770894a8159
parent55775c6203a7dc4c1ed9065176ebb83b7eeab783 (diff)
encoder: vp8: Fix the size over-flow for encoded buffer.
The approximation of 4 times compression ratio will not work in all cases. Especially when enabling I frames. Provide large enough size for coded-buffer creation.
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_vp8.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c b/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
index dadccfd8c5..65b449ed84 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
@@ -161,10 +161,9 @@ set_context_info (GstVaapiEncoder * base_encoder)
base_encoder->num_ref_frames = 3;
- /* Only YUV 4:2:0 formats are supported for now.
- Take an approximation of 4 times compress ratio */
+ /* Only YUV 4:2:0 formats are supported for now. */
base_encoder->codedbuf_size = GST_ROUND_UP_16 (vip->width) *
- GST_ROUND_UP_16 (vip->height) * 3 / 2 / 4;
+ GST_ROUND_UP_16 (vip->height) * 3 / 2;
base_encoder->codedbuf_size +=
MAX_FRAME_TAG_SIZE + MAX_UPDATE_SEGMENTATION_SIZE +