diff options
author | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2012-01-28 06:49:56 +0000 |
---|---|---|
committer | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2012-01-28 06:49:56 +0000 |
commit | 912538986e29225ecb77ce32ec97ed18325cd902 (patch) | |
tree | b50a5773cc276d169d7d3a8c15e507ac2b929358 /trunk | |
parent | 6daa08e6b7dfd9c367de76942dad3c4fce8164f3 (diff) |
Expose new scaling factors in TurboJPEG API
git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@757 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'trunk')
-rw-r--r-- | trunk/tjbench.c | 4 | ||||
-rw-r--r-- | trunk/turbojpeg.c | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/trunk/tjbench.c b/trunk/tjbench.c index f298732..8125e56 100644 --- a/trunk/tjbench.c +++ b/trunk/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; diff --git a/trunk/turbojpeg.c b/trunk/turbojpeg.c index 2d5959a..2f7cbf9 100644 --- a/trunk/turbojpeg.c +++ b/trunk/turbojpeg.c @@ -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} }; |