#define CACHE_LINE_FACTOR 16
+#ifndef M_PI
+#define M_PI 3.14159265358979323846264
+#endif
+
double sinc(double x)
{
- static const double cutoff = 1.220703668e-4; // sqrt(sqrt(eps))
+ static const double cutoff = 1.220703668e-4; /* sqrt(sqrt(eps)) */
if (abs(x) < cutoff) {
- // For small |x|, use Taylor series instead
+ /* For small |x|, use Taylor series instead */
const double x2 = x * x;
const double x4 = x2 * x2;
end = w - 1;
}
- // round up so we get a multiple of four for the SSE code
+ /* round up so we get a multiple of four for the SSE code */
int num = (end - start + 1);
if (num % 4 != 0) {
- // prefer aligning it if possible
+ /* prefer aligning it if possible */
if (start % 4 != 0 && start % 4 <= num % 4) {
num += start % 4;
start -= start % 4;
float acc;
long tmp;
static const float low = 0.0, high = 255.0;
- asm (
+ __asm__ (
"pxor %1, %1 \n"
"xor %2, %2 \n"
"0: \n"
* xmm4: current filter coefficient
* xmm5, xmm6, xmm7: scratchpad
*/
- asm (
+ __asm__ (
/* clear */
"pxor %%xmm0, %%xmm0 \n"
"pxor %%xmm1, %%xmm1 \n"
int i;
for (i = 0; i < max_lines; ++i) {
- // simple edge extension
+ /* simple edge extension */
int yline = i + blocks*DCTSIZE*cinfo.comp_info[0].v_samp_factor;
if (yline > nh0 - 1)
yline = nh0 - 1;