/* for ORC */
gint inc;
+ gint tmpwidth;
guint32 *tmpline1;
guint32 *tmpline2;
};
}
}
+static void
+realloc_tmplines (GstVideoScaler * scale, gint width)
+{
+ scale->tmpline1 =
+ g_realloc (scale->tmpline1,
+ sizeof (gint32) * width * 4 * scale->resampler.max_taps);
+ scale->tmpline2 = g_realloc (scale->tmpline2, sizeof (gint32) * width * 4);
+ scale->tmpwidth = width;
+}
+
/**
* gst_video_scaler_new:
* @method: a #GstVideoResamplerMethod
else
scale->inc = ((in_size - 1) << 16) / (out_size - 1) - 1;
- scale->tmpline1 =
- g_malloc (sizeof (gint32) * out_size * 4 * scale->resampler.max_taps);
- scale->tmpline2 = g_malloc (sizeof (gint32) * out_size * 4);
-
return scale;
}
pstride = finfo->pixel_stride[0];
g_return_if_fail (pstride == 4 || pstride == 8);
+ if (scale->tmpwidth < width)
+ realloc_tmplines (scale, width);
+
switch (pstride) {
case 4:
switch (scale->resampler.max_taps) {
pstride = finfo->pixel_stride[0];
g_return_if_fail (pstride == 4 || pstride == 8);
+ if (scale->tmpwidth < width)
+ realloc_tmplines (scale, width);
+
switch (pstride) {
case 4:
switch (scale->resampler.max_taps) {