diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
commit | 6cc1c73d2baa95c46edc04f57cbe9ed690dc2f21 (patch) | |
tree | 82b5546809a42a56a7bc18bacf8ed6e209ad006e /gst/monoscope | |
parent | d07ec45fa47fbd0e36224e11bcd8ba2faee1a78c (diff) |
don't mix tabs and spaces
Original commit message from CVS:
don't mix tabs and spaces
Diffstat (limited to 'gst/monoscope')
-rw-r--r-- | gst/monoscope/convolve.c | 43 | ||||
-rw-r--r-- | gst/monoscope/gstmonoscope.c | 9 | ||||
-rw-r--r-- | gst/monoscope/monoscope.c | 20 |
3 files changed, 38 insertions, 34 deletions
diff --git a/gst/monoscope/convolve.c b/gst/monoscope/convolve.c index 6b8cdd50..fc4f90b6 100644 --- a/gst/monoscope/convolve.c +++ b/gst/monoscope/convolve.c @@ -68,13 +68,16 @@ typedef union stack_entry_s { const double *left, *right; double *out; - } v; + } + v; struct { double *main, *null; - } b; + } + b; -} stack_entry; +} +stack_entry; #define STACK_SIZE (CONVOLVE_DEPTH * 3) @@ -175,11 +178,11 @@ convolve_run (stack_entry * top, unsigned size, double *scratch) /* Create the intermediate factors. */ for (i = 0; i < size; i++) { - double l = left[i] + left[i + size]; - double r = right[i] + right[i + size]; + double l = left[i] + left[i + size]; + double r = right[i] + right[i + size]; - s_left[i + size] = r; - s_left[i] = l; + s_left[i + size] = r; + s_left[i] = l; } /* Push the combine entry onto the stack. */ @@ -227,15 +230,15 @@ convolve_run (stack_entry * top, unsigned size, double *scratch) top++; out[size * 2 - 1] = 0; for (i = 0; i < size - 1; i++) { - double lo; - double hi; - - lo = mid[0] - (out[0] + out[2 * size]) + out[size]; - hi = mid[size] - (out[size] + out[3 * size]) + out[2 * size]; - out[size] = lo; - out[2 * size] = hi; - out++; - mid++; + double lo; + double hi; + + lo = mid[0] - (out[0] + out[2 * size]) + out[size]; + hi = mid[size] - (out[size] + out[3 * size]) + out[2 * size]; + out[size] = lo; + out[2 * size] = hi; + out++; + mid++; } size <<= 1; } while (top->b.null == NULL); @@ -281,7 +284,7 @@ convolve_match (const int *lastchoice, for (i = 0; i < 256; i++) right[i] -= avg; /* End-of-stack marker. */ -#if 0 /* The following line produces a CRASH, need to figure out why?!! */ +#if 0 /* The following line produces a CRASH, need to figure out why?!! */ top[1].b.null = scratch; #endif top[1].b.main = NULL; @@ -327,11 +330,11 @@ convolve_match (const int *lastchoice, unsigned int j; for (j = 0; j < 256; j++) - tot += ((double) input[i + j]) * ((double) lastchoice[j] - avg); + tot += ((double) input[i + j]) * ((double) lastchoice[j] - avg); if (tot > best) - printf ("(%i)", i); + printf ("(%i)", i); if (tot != left[i + 255]) - printf ("!"); + printf ("!"); } printf ("%i\n", p); diff --git a/gst/monoscope/gstmonoscope.c b/gst/monoscope/gstmonoscope.c index f8e82b2f..4582e5bc 100644 --- a/gst/monoscope/gstmonoscope.c +++ b/gst/monoscope/gstmonoscope.c @@ -126,6 +126,7 @@ gst_monoscope_get_type (void) 0, (GInstanceInitFunc) gst_monoscope_init, }; + type = g_type_register_static (GST_TYPE_ELEMENT, "GstMonoscope", &info, 0); } return type; @@ -177,7 +178,7 @@ gst_monoscope_init (GstMonoscope * monoscope) monoscope->first_buffer = TRUE; monoscope->width = 256; monoscope->height = 128; - monoscope->fps = 25.; /* desired frame rate */ + monoscope->fps = 25.; /* desired frame rate */ } static GstPadLinkReturn @@ -216,7 +217,7 @@ gst_monoscope_chain (GstPad * pad, GstData * _data) /* FIXME: should really select the first 1024 samples after the timestamp. */ if (GST_BUFFER_TIMESTAMP (bufin) < monoscope->next_time || samples_in < 1024) { GST_DEBUG ("timestamp is %" G_GUINT64_FORMAT ": want >= %" G_GUINT64_FORMAT, - GST_BUFFER_TIMESTAMP (bufin), monoscope->next_time); + GST_BUFFER_TIMESTAMP (bufin), monoscope->next_time); gst_buffer_unref (bufin); return; } @@ -233,8 +234,8 @@ gst_monoscope_chain (GstPad * pad, GstData * _data) GST_DEBUG ("making new pad"); if (!gst_pad_is_negotiated (monoscope->srcpad)) { if (gst_pad_renegotiate (monoscope->srcpad) <= 0) { - GST_ELEMENT_ERROR (monoscope, CORE, NEGOTIATION, (NULL), (NULL)); - return; + GST_ELEMENT_ERROR (monoscope, CORE, NEGOTIATION, (NULL), (NULL)); + return; } } monoscope->first_buffer = FALSE; diff --git a/gst/monoscope/monoscope.c b/gst/monoscope/monoscope.c index 20a68099..356237e9 100644 --- a/gst/monoscope/monoscope.c +++ b/gst/monoscope/monoscope.c @@ -87,7 +87,7 @@ monoscope_update (struct monoscope_state * stateptr, gint16 data[512]) } stateptr->avgMax += max - (stateptr->avgMax >> 8); if (stateptr->avgMax < max) - stateptr->avgMax = max; /* Avoid overflow */ + stateptr->avgMax = max; /* Avoid overflow */ factor = 0x7fffffff / stateptr->avgMax; /* Keep the scaling sensible. */ if (factor > (1 << 18)) @@ -106,15 +106,15 @@ monoscope_update (struct monoscope_state * stateptr, gint16 data[512]) if ((bar > 0) && (bar < (256 * 128))) { loc = stateptr->display + bar; if (foo < 0) { - for (h = 0; h <= (-foo); h++) { - *loc = stateptr->colors[h]; - loc += 256; - } + for (h = 0; h <= (-foo); h++) { + *loc = stateptr->colors[h]; + loc += 256; + } } else { - for (h = 0; h <= foo; h++) { - *loc = stateptr->colors[h]; - loc -= 256; - } + for (h = 0; h <= foo; h++) { + *loc = stateptr->colors[h]; + loc -= 256; + } } } } @@ -124,7 +124,7 @@ monoscope_update (struct monoscope_state * stateptr, gint16 data[512]) for (h = 0; h < 256; h += 2) { stateptr->display[(i << 8) + h] = stateptr->colors[63]; if (i == 64) - stateptr->display[(i << 8) + h + 1] = stateptr->colors[63]; + stateptr->display[(i << 8) + h + 1] = stateptr->colors[63]; } } for (i = 16; i < 256; i += 16) { |