video: Fix NV12_16L32 size calculation
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 27 May 2022 18:18:30 +0000 (14:18 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 31 May 2022 16:23:01 +0000 (16:23 +0000)
The subsampling of the second plane was not taken into account, resulting in a
16bit per pixel buffers instead of 12.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2512>

subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c

index ea961f1..b3d25d3 100644 (file)
@@ -1129,7 +1129,7 @@ fill_planes (GstVideoInfo * info, gsize plane_size[GST_VIDEO_MAX_PLANES])
       info->offset[1] =
           GST_ROUND_UP_N (width, 1 << ws) * GST_ROUND_UP_N (height, 1 << hs);
       info->size = info->offset[1] + GST_ROUND_UP_N (width, 1 << ws) *
-          GST_ROUND_UP_N (height, 1 << (hs - 1));
+          GST_ROUND_UP_N (height, 1 << hs) / 2;
       break;
     }
     case GST_VIDEO_FORMAT_A420_10LE: