Revision dc541ee7 libavcodec/fdctref.c

View differences:

libavcodec/fdctref.c
116 116
 */
117 117
      }
118 118
}
119

  
120
/* perform IDCT matrix multiply for 8x8 coefficient block */
121

  
122
void idct(block)
123
short *block;
124
{
125
  int i, j, k, v;
126
  double partial_product;
127
  double tmp[64];
128

  
129
  for (i=0; i<8; i++)
130
    for (j=0; j<8; j++)
131
    {
132
      partial_product = 0.0;
133

  
134
      for (k=0; k<8; k++)
135
        partial_product+= c[k][j]*block[8*i+k];
136

  
137
      tmp[8*i+j] = partial_product;
138
    }
139

  
140
  /* Transpose operation is integrated into address mapping by switching 
141
     loop order of i and j */
142

  
143
  for (j=0; j<8; j++)
144
    for (i=0; i<8; i++)
145
    {
146
      partial_product = 0.0;
147

  
148
      for (k=0; k<8; k++)
149
        partial_product+= c[k][i]*tmp[8*k+j];
150

  
151
      v = (int) floor(partial_product+0.5);
152
      block[8*i+j] = v;
153
    }
154
}

Also available in: Unified diff