mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
Fix handling of I420 buffers with odd width
This commit is contained in:
parent
cb6f703669
commit
42d11e8c1b
1 changed files with 3 additions and 7 deletions
|
@ -723,16 +723,12 @@ gst_amc_video_dec_fill_buffer (GstAmcVideoDec * self, gint idx,
|
||||||
gint src_stride, dest_stride;
|
gint src_stride, dest_stride;
|
||||||
gint row_length;
|
gint row_length;
|
||||||
|
|
||||||
/* FIXME: This doesn't look like it could work with
|
|
||||||
* odd widths at all. Needs testing and fixing!
|
|
||||||
*/
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
src_stride = self->stride;
|
src_stride = self->stride;
|
||||||
dest_stride = GST_VIDEO_INFO_COMP_STRIDE (info, i);
|
dest_stride = GST_VIDEO_INFO_COMP_STRIDE (info, i);
|
||||||
} else {
|
} else {
|
||||||
src_stride = self->stride / 2;
|
src_stride = (self->stride + 1) / 2;
|
||||||
dest_stride = GST_VIDEO_INFO_COMP_STRIDE (info, i);
|
dest_stride = GST_VIDEO_INFO_COMP_STRIDE (info, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -746,10 +742,10 @@ gst_amc_video_dec_fill_buffer (GstAmcVideoDec * self, gint idx,
|
||||||
src += self->slice_height * self->stride;
|
src += self->slice_height * self->stride;
|
||||||
src += self->crop_top * src_stride;
|
src += self->crop_top * src_stride;
|
||||||
src += self->crop_left / 2;
|
src += self->crop_left / 2;
|
||||||
row_length = self->width / 2;
|
row_length = (self->width + 1) / 2;
|
||||||
}
|
}
|
||||||
if (i == 2)
|
if (i == 2)
|
||||||
src += (self->slice_height / 2) * (self->stride / 2);
|
src += ((self->slice_height + 1) / 2) * ((self->stride + 1) / 2);
|
||||||
|
|
||||||
dest = GST_BUFFER_DATA (outbuf) + GST_VIDEO_INFO_COMP_OFFSET (info, i);
|
dest = GST_BUFFER_DATA (outbuf) + GST_VIDEO_INFO_COMP_OFFSET (info, i);
|
||||||
height = GST_VIDEO_INFO_COMP_HEIGHT (info, i);
|
height = GST_VIDEO_INFO_COMP_HEIGHT (info, i);
|
||||||
|
|
Loading…
Reference in a new issue