]> granicus.if.org Git - libjpeg-turbo/commitdiff
Expose new scaling factors in TurboJPEG API
authorDRC <dcommander@users.sourceforge.net>
Sat, 28 Jan 2012 06:49:56 +0000 (06:49 +0000)
committerDRC <dcommander@users.sourceforge.net>
Sat, 28 Jan 2012 06:49:56 +0000 (06:49 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@757 632fc199-4ca6-4c93-a231-07263d6284db

tjbench.c
turbojpeg.c

index f298732c19e6a91cb53bb0a59ca6ac86179235fa..8125e56af20c7930870398bb3945833706c90021 100644 (file)
--- a/tjbench.c
+++ b/tjbench.c
@@ -696,6 +696,7 @@ void usage(char *progname)
                        if(i!=nsf-1) printf(", ");
                        if(i==nsf-2) printf("or ");
                }
+               if(i%8==0 && i!=0) printf("\n     ");
        }
        printf(")\n");
        printf("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =\n");
@@ -811,7 +812,8 @@ int main(int argc, char *argv[])
                                {
                                        for(j=0; j<nsf; j++)
                                        {
-                                               if(temp1==scalingfactors[j].num && temp2==scalingfactors[j].denom)
+                                               if((double)temp1/(double)temp2
+                                                       == (double)scalingfactors[j].num/(double)scalingfactors[j].denom)
                                                {
                                                        sf=scalingfactors[j];
                                                        match=1;  break;
index 2d5959a361150a036fdba2ceb8e581a5e78fcf0b..2f7cbf9a645a8bf14e8aafe3b59f7c8fda6d22e5 100644 (file)
@@ -92,10 +92,22 @@ static const JXFORM_CODE xformtypes[TJ_NUMXOP]=
        JXFORM_TRANSVERSE, JXFORM_ROT_90, JXFORM_ROT_180, JXFORM_ROT_270
 };
 
-#define NUMSF 4
+#define NUMSF 16
 static const tjscalingfactor sf[NUMSF]={
+       {2, 1},
+       {15, 8},
+       {7, 4},
+       {13, 8},
+       {3, 2},
+       {11, 8},
+       {5, 4},
+       {9, 8},
        {1, 1},
+       {7, 8},
+       {3, 4},
+       {5, 8},
        {1, 2},
+       {3, 8},
        {1, 4},
        {1, 8}
 };