mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
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.
This commit is contained in:
parent
55775c6203
commit
4d8eaf1918
1 changed files with 2 additions and 3 deletions
|
@ -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 +
|
||||
|
|
Loading…
Reference in a new issue