summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
index 876dc6d9..90a6e23d 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c
@@ -635,6 +635,11 @@ gst_vaapi_encoder_mpeg2_set_context_info (GstVaapiEncoder * base_encoder)
cip->profile = to_vaapi_profile (encoder->profile);
cip->ref_frames = 2;
+
+ /* Only YUV 4:2:0 formats are supported for now. This means that we
+ have a limit of 4608 bits per macroblock. */
+ base_encoder->codedbuf_size = (GST_ROUND_UP_16 (cip->width) *
+ GST_ROUND_UP_16 (cip->height) / 256) * 576;
}
static gboolean