summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorLuis de Bethencourt <luis.bg@samsung.com>2015-05-27 13:08:46 +0100
committerLuis de Bethencourt <luis.bg@samsung.com>2015-05-27 13:10:35 +0100
commit9c729ef678f25a0dad9bc00707ce1044082703de (patch)
tree2a849cc6e84fe793c32af58ee9ff2f5baa5d1fda /ext
parent666a80236ce7c51ee4fb03600608039f5f72d932 (diff)
downloadgstreamer-plugins-bad-9c729ef678f25a0dad9bc00707ce1044082703de.tar.gz
opencv: 'for' loop initial declaration
'for' loop initial declarations are not allowed in C89, moving the declarations to before the 'for' loops.
Diffstat (limited to 'ext')
-rw-r--r--ext/opencv/gstretinex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/opencv/gstretinex.c b/ext/opencv/gstretinex.c
index 5bc112a56..9a7c8dc86 100644
--- a/ext/opencv/gstretinex.c
+++ b/ext/opencv/gstretinex.c
@@ -332,6 +332,8 @@ gst_retinex_transform_ip (GstBaseTransform * btrans, GstBuffer * buf)
where O is the output, H is a gaussian 2d filter and I is the input image
sum_i means summatory on var i with i in [0..scales) and wi are the weights */
else if (METHOD_MULTISCALE == retinex->method) {
+ int i;
+
/* allocate or reallocate the weights and sigmas according to scales */
if (retinex->current_scales != retinex->scales || !retinex->sigmas) {
retinex->weights =
@@ -340,7 +342,7 @@ gst_retinex_transform_ip (GstBaseTransform * btrans, GstBuffer * buf)
retinex->sigmas =
(double *) g_realloc (retinex->sigmas,
sizeof (double) * retinex->scales);
- for (int i = 0; i < retinex->scales; i++) {
+ for (i = 0; i < retinex->scales; i++) {
retinex->weights[i] = 1.0 / (double) retinex->scales;
retinex->sigmas[i] = 10.0 + 4.0 * (double) retinex->scales;
}
@@ -352,7 +354,7 @@ gst_retinex_transform_ip (GstBaseTransform * btrans, GstBuffer * buf)
cvLog (retinex->cvA, retinex->cvB);
/* Filter at each scale */
- for (int i = 0; i < retinex->scales; i++) {
+ for (i = 0; i < retinex->scales; i++) {
filter_size = (int) floor (retinex->sigmas[i] * 6) / 2;
filter_size = filter_size * 2 + 1;