mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-08 23:42:28 +00:00
video-format: fix off-by-one for tiled coordinates
https://bugzilla.gnome.org/show_bug.cgi?id=707361
This commit is contained in:
parent
fb0fecbf48
commit
f3e989179b
2 changed files with 5 additions and 5 deletions
|
@ -2142,7 +2142,7 @@ unpack_NV12T (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
|
||||||
/* first x tile to convert */
|
/* first x tile to convert */
|
||||||
tx = x >> ws;
|
tx = x >> ws;
|
||||||
/* Last tile to convert */
|
/* Last tile to convert */
|
||||||
ntx = (x + width) >> ws;
|
ntx = ((x + width - 1) >> ws) + 1;
|
||||||
/* The row we are going to convert */
|
/* The row we are going to convert */
|
||||||
ty = y >> hs;
|
ty = y >> hs;
|
||||||
|
|
||||||
|
@ -2151,7 +2151,7 @@ unpack_NV12T (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
|
||||||
/* x position in a tile */
|
/* x position in a tile */
|
||||||
x = x & (tile_width - 1);
|
x = x & (tile_width - 1);
|
||||||
|
|
||||||
for (; tx <= ntx; tx++) {
|
for (; tx < ntx; tx++) {
|
||||||
gpointer tdata[GST_VIDEO_MAX_PLANES];
|
gpointer tdata[GST_VIDEO_MAX_PLANES];
|
||||||
gint tstride[GST_VIDEO_MAX_PLANES];
|
gint tstride[GST_VIDEO_MAX_PLANES];
|
||||||
gint unpack_width;
|
gint unpack_width;
|
||||||
|
@ -2200,7 +2200,7 @@ pack_NV12T (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
|
||||||
pack_pstride = GST_VIDEO_FORMAT_INFO_PSTRIDE (pack_info, 0);
|
pack_pstride = GST_VIDEO_FORMAT_INFO_PSTRIDE (pack_info, 0);
|
||||||
|
|
||||||
/* Last tile to convert */
|
/* Last tile to convert */
|
||||||
ntx = width >> ws;
|
ntx = ((width - 1) >> ws) + 1;
|
||||||
/* The row we are going to convert */
|
/* The row we are going to convert */
|
||||||
ty = y >> hs;
|
ty = y >> hs;
|
||||||
|
|
||||||
|
|
|
@ -280,8 +280,8 @@ gst_video_frame_copy_plane (GstVideoFrame * dest, const GstVideoFrame * src,
|
||||||
dy_tiles = dinfo->stride[tidx];
|
dy_tiles = dinfo->stride[tidx];
|
||||||
|
|
||||||
/* this is the amount of tiles to copy */
|
/* this is the amount of tiles to copy */
|
||||||
w = (w + (1 << ws) - 1) >> ws;
|
w = ((w - 1) >> ws) + 1;
|
||||||
h = (h + (1 << hs) - 1) >> hs;
|
h = ((h - 1) >> hs) + 1;
|
||||||
|
|
||||||
/* FIXME can possibly do better when no retiling is needed, it depends on
|
/* FIXME can possibly do better when no retiling is needed, it depends on
|
||||||
* the stride and the tile_size */
|
* the stride and the tile_size */
|
||||||
|
|
Loading…
Reference in a new issue