summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst/idct/floatidct.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/idct/floatidct.c')
-rw-r--r--gst-libs/gst/idct/floatidct.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/gst-libs/gst/idct/floatidct.c b/gst-libs/gst/idct/floatidct.c
index b215bd78..0fa1e830 100644
--- a/gst-libs/gst/idct/floatidct.c
+++ b/gst-libs/gst/idct/floatidct.c
@@ -56,51 +56,51 @@ static double gst_idct_float_c[8][8];
/* initialize DCT coefficient matrix */
-void gst_idct_init_float_idct()
+void
+gst_idct_init_float_idct ()
{
int freq, time;
double scale;
- for (freq=0; freq < 8; freq++)
- {
- scale = (freq == 0) ? sqrt(0.125) : 0.5;
- for (time=0; time<8; time++)
- gst_idct_float_c[freq][time] = scale*cos((PI/8.0)*freq*(time + 0.5));
+ for (freq = 0; freq < 8; freq++) {
+ scale = (freq == 0) ? sqrt (0.125) : 0.5;
+ for (time = 0; time < 8; time++)
+ gst_idct_float_c[freq][time] =
+ scale * cos ((PI / 8.0) * freq * (time + 0.5));
}
}
/* perform IDCT matrix multiply for 8x8 coefficient block */
-void gst_idct_float_idct(block)
-short *block;
+void
+gst_idct_float_idct (block)
+ short *block;
{
int i, j, k, v;
double partial_product;
double tmp[64];
- for (i=0; i<8; i++)
- for (j=0; j<8; j++)
- {
+ for (i = 0; i < 8; i++)
+ for (j = 0; j < 8; j++) {
partial_product = 0.0;
- for (k=0; k<8; k++)
- partial_product+= gst_idct_float_c[k][j]*block[8*i+k];
+ for (k = 0; k < 8; k++)
+ partial_product += gst_idct_float_c[k][j] * block[8 * i + k];
- tmp[8*i+j] = partial_product;
+ tmp[8 * i + j] = partial_product;
}
/* Transpose operation is integrated into address mapping by switching
loop order of i and j */
- for (j=0; j<8; j++)
- for (i=0; i<8; i++)
- {
+ for (j = 0; j < 8; j++)
+ for (i = 0; i < 8; i++) {
partial_product = 0.0;
- for (k=0; k<8; k++)
- partial_product+= gst_idct_float_c[k][i]*tmp[8*k+j];
+ for (k = 0; k < 8; k++)
+ partial_product += gst_idct_float_c[k][i] * tmp[8 * k + j];
- v = (int) floor(partial_product+0.5);
- block[8*i+j] = (v<-256) ? -256 : ((v>255) ? 255 : v);
+ v = (int) floor (partial_product + 0.5);
+ block[8 * i + j] = (v < -256) ? -256 : ((v > 255) ? 255 : v);
}
}