summaryrefslogtreecommitdiff
path: root/gst/videoconvert
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2013-09-03 15:42:44 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2013-09-03 15:42:44 +0200
commit10b3b88e9cc414fd8fce6f1545b55f43c28d0396 (patch)
tree29edcf66e1af6fada65b6e7b3782080c57cafe04 /gst/videoconvert
parentcfb7b51c084d7bb81519586729673582bc1920a3 (diff)
downloadgstreamer-plugins-base-10b3b88e9cc414fd8fce6f1545b55f43c28d0396.tar.gz
videoconvert: fix handling of chroma resample
Increase the number of temporary lines that we need, it is possible that the up and downsampling offsets are out of phase and that we need to keep some extra lines around. Also copy the unhandled output lines for the next round instead of overwriting them. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=706823
Diffstat (limited to 'gst/videoconvert')
-rw-r--r--gst/videoconvert/videoconvert.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/videoconvert/videoconvert.c b/gst/videoconvert/videoconvert.c
index a745e7c9b..22be66513 100644
--- a/gst/videoconvert/videoconvert.c
+++ b/gst/videoconvert/videoconvert.c
@@ -422,7 +422,7 @@ videoconvert_convert_compute_resample (VideoConvert * convert)
convert->downsample, out_info->chroma_site, convert->down_offset,
convert->down_n_lines);
- lines = MAX (convert->down_n_lines, convert->up_n_lines);
+ lines = convert->down_n_lines + convert->up_n_lines;
convert->n_tmplines = lines;
convert->tmplines = g_malloc (lines * sizeof (gpointer));
@@ -499,7 +499,7 @@ videoconvert_convert_generic (VideoConvert * convert, GstVideoFrame * dest,
up_offset = convert->up_offset;
down_n_lines = convert->down_n_lines;
down_offset = convert->down_offset;
- max_lines = MAX (down_n_lines, up_n_lines);
+ max_lines = convert->n_tmplines;
in_lines = 0;
out_lines = 0;
@@ -592,6 +592,12 @@ videoconvert_convert_generic (VideoConvert * convert, GstVideoFrame * dest,
start += down_n_lines;
out_lines -= down_n_lines;
}
+ /* we didn't process these lines, move them up for the next round */
+ for (j = 0; j < out_lines; j++) {
+ GST_DEBUG ("move line %d->%d", j + start, j);
+ out_tmplines[j] = out_tmplines[j + start];
+ }
+
up_offset += up_n_lines;
}
if ((pal =