From: Guillaume Desmottes Date: Sat, 2 Nov 2019 11:15:15 +0000 (+0100) Subject: video-info: fix GST_VIDEO_INFO_FIELD_HEIGHT() with frame odd height X-Git-Tag: 1.19.3~511^2~894 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73a628923e5fd540d16684a94533329612ff4c04;p=platform%2Fupstream%2Fgstreamer.git video-info: fix GST_VIDEO_INFO_FIELD_HEIGHT() with frame odd height We want to round up when halfing height. I do have a test for this but it relies on my new video-align tests so it's part of the next commit. Recording the fix separately if we want to backport this fix to the stable branch. --- diff --git a/gst-libs/gst/video/video-info.h b/gst-libs/gst/video/video-info.h index b4d69d9..6adf03c 100644 --- a/gst-libs/gst/video/video-info.h +++ b/gst-libs/gst/video/video-info.h @@ -359,7 +359,7 @@ GType gst_video_info_get_type (void); * * Since: 1.16. */ -#define GST_VIDEO_INFO_FIELD_HEIGHT(i) ((i)->interlace_mode == GST_VIDEO_INTERLACE_MODE_ALTERNATE? (i)->height / 2 : (i)->height) +#define GST_VIDEO_INFO_FIELD_HEIGHT(i) ((i)->interlace_mode == GST_VIDEO_INTERLACE_MODE_ALTERNATE? GST_ROUND_UP_2 ((i)->height) / 2 : (i)->height) #define GST_VIDEO_INFO_SIZE(i) ((i)->size) #define GST_VIDEO_INFO_VIEWS(i) ((i)->views) #define GST_VIDEO_INFO_PAR_N(i) ((i)->par_n)