From 6a6c3687f13a8c2f933916c07e5e464afd0ec0d9 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 12 Apr 2022 12:16:23 -0400 Subject: [PATCH] video: Port video frame to the new tile size helper This is now moved to the library, so it can be used in multiple places. Part-of: --- .../gst-libs/gst/video/video-frame.c | 30 +--------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c index cbd6369..a86c70a 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-frame.c @@ -278,27 +278,6 @@ gst_video_frame_unmap (GstVideoFrame * frame) gst_buffer_unref (frame->buffer); } -static void -scale_tile_shifts (const GstVideoFormatInfo * finfo, gint plane, guint * ws, - guint * hs) -{ - gint comp[GST_VIDEO_MAX_COMPONENTS]; - gint i; - - gst_video_format_info_component (finfo, plane, comp); - - /* scale the tile size according to the subsampling */ - *ws -= finfo->w_sub[comp[0]]; - *hs -= finfo->h_sub[comp[0]]; - - /* for each additional component in the same plane, double the tile width, - * this should provide the appropriate tile size when the tile size varies - * base on the subsampling. */ - for (i = 1; i < GST_VIDEO_MAX_COMPONENTS && comp[i] >= 0; i++) - *ws += 1; -} - - /** * gst_video_frame_copy_plane: * @dest: a #GstVideoFrame @@ -367,16 +346,9 @@ gst_video_frame_copy_plane (GstVideoFrame * dest, const GstVideoFrame * src, guint i, j, ws, hs, ts; GstVideoTileMode mode; - ws = GST_VIDEO_FORMAT_INFO_TILE_WS (finfo); - hs = GST_VIDEO_FORMAT_INFO_TILE_HS (finfo); - - if (GST_VIDEO_FORMAT_INFO_HAS_SUBTILES (finfo)) - scale_tile_shifts (finfo, plane, &ws, &hs); - + tile_size = gst_video_format_info_get_tile_sizes (finfo, plane, &ws, &hs); ts = ws + hs; - tile_size = 1 << ts; - mode = GST_VIDEO_FORMAT_INFO_TILE_MODE (finfo); sx_tiles = GST_VIDEO_TILE_X_TILES (ss); -- 2.7.4