]> git.sesse.net Git - qscale/blobdiff - qscale.c
Make everything compile and work for amd64.
[qscale] / qscale.c
index f3f0fa95ed89cbd585244ac1c3ff8999ca691e5a..992bf7d24e3aae137f887bd3215876db66921ed5 100644 (file)
--- a/qscale.c
+++ b/qscale.c
@@ -103,7 +103,7 @@ void hscale(float *pix, unsigned char *npix, unsigned w, unsigned h, unsigned nw
                for (x = 0; x < nw; ++x) {
                        int result;
                        float acc;
-                       int tmp;
+                       long tmp;
                        static const float low = 0.0, high = 255.0;
                        asm (
                                "pxor %1, %1               \n"
@@ -113,7 +113,7 @@ void hscale(float *pix, unsigned char *npix, unsigned w, unsigned h, unsigned nw
                                "movups (%3,%2),%%xmm2     \n"
                                "mulps %%xmm2,%%xmm1       \n"
                                "addps %%xmm1,%1           \n"
-                               "addl $16,%2               \n"
+                               "add $16,%2                \n"
                                "dec %5                    \n"
                                "jnz .lbl2                 \n"
                                "haddps %1,%1              \n"
@@ -301,7 +301,7 @@ void vscale(unsigned char *pix, float *npix, unsigned w, unsigned h, unsigned nh
                                "r" (&sptr[pd[y].start * w]),        /* 0: srcptr base */
                                "r" (pd[y].end - pd[y].start + 1),   /* 1: filter len */
                                "r" (&coeffs[pd[y].startcoeff]),     /* 2: coeffs base */
-                               "r" (w),                             /* 3: stride */
+                               "r" ((long)w),                       /* 3: stride */
                                "r" (dptr)                           /* 4: dstptr base */
                                : "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
                        );
@@ -366,8 +366,6 @@ int main(int argc, char **argv)
        unsigned w2 = dinfo.image_width * dinfo.comp_info[2].h_samp_factor / dinfo.max_h_samp_factor;
        unsigned h2 = dinfo.image_height * dinfo.comp_info[2].v_samp_factor / dinfo.max_v_samp_factor;
 
-       fprintf(stderr, "h0 = %u, h1=%u, h2=%u\n", h0, h1, h2);
-
        fprintf(stderr, "Scaling using Lanczos filter:\n");
        fprintf(stderr, "  Y component: %ux%u -> %ux%u\n", dinfo.comp_info[0].width_in_blocks * DCTSIZE, dinfo.comp_info[0].height_in_blocks * DCTSIZE, nw0, nh0);
        fprintf(stderr, "  Cb component: %ux%u -> %ux%u\n", dinfo.comp_info[1].width_in_blocks * DCTSIZE, dinfo.comp_info[1].height_in_blocks * DCTSIZE, nw1, nh1);