encoder: h264: refine size of coded buffer.

Refine the heuristic to determine the maximum size of a coded buffer
to account for the exact number of slices. set_context_info() is the
last step during codec reconfiguration, no additional change is done
afterwards, so re-using the num_slices field here is fine.

https://bugzilla.gnome.org/show_bug.cgi?id=719953
This commit is contained in:
Gwenole Beauchesne 2014-01-12 22:14:11 +01:00
parent 8df97cf9ec
commit 00e0af9a7c

View file

@ -1589,8 +1589,8 @@ set_context_info (GstVaapiEncoder * base_encoder)
/* XXX: exclude slice groups, scaling lists, MVC/SVC extensions */
base_encoder->codedbuf_size += 4 + GST_ROUND_UP_8 (MAX_PPS_HDR_SIZE) / 8;
/* Account for slice header. At most 200 slices are supported */
base_encoder->codedbuf_size += 200 * (4 +
/* Account for slice header */
base_encoder->codedbuf_size += encoder->num_slices * (4 +
GST_ROUND_UP_8 (MAX_SLICE_HDR_SIZE) / 8);
return GST_VAAPI_ENCODER_STATUS_SUCCESS;