decoder: vp9: Fix crop rectangle setting

Align with software vp9dec behaviour: Add crop rectangle
only if display_width/display_height is less than the
frame_hdr->width/frame_hdr->height
This commit is contained in:
Sreerenj Balachandran 2016-01-28 14:21:04 +02:00 committed by Víctor Manuel Jáquez Leal
parent 0a9ce66ec7
commit eb2daed2a7

View file

@ -442,13 +442,16 @@ decode_picture (GstVaapiDecoderVp9 * decoder, const guchar * buf,
if (is_clone_pic)
return GST_VAAPI_DECODER_STATUS_SUCCESS;
if (frame_hdr->display_size_enabled) {
crop_width = frame_hdr->display_width;
crop_height = frame_hdr->display_height;
} else if (priv->width > frame_hdr->width || priv->height > frame_hdr->height) {
if (priv->width > frame_hdr->width || priv->height > frame_hdr->height) {
crop_width = frame_hdr->width;
crop_height = frame_hdr->height;
}
if (frame_hdr->display_size_enabled &&
(frame_hdr->width > frame_hdr->display_width
|| frame_hdr->height > frame_hdr->display_height)) {
crop_width = frame_hdr->display_width;
crop_height = frame_hdr->display_height;
}
if (crop_width || crop_height) {
GstVaapiRectangle crop_rect;
crop_rect.x = 0;