Skip to content

Commit

Permalink
TJBench: Set TJ*OPT_PROGRESSIVE with -progressive
Browse files Browse the repository at this point in the history
The documented behavior of the -progressive option is to use progressive
entropy coding in JPEG images generated by compression and transform
operations.  However, setting TJFLAG_PROGRESSIVE was insufficient to
accomplish that, because TJBench doesn't enable lossless transformation
if xformOpt == 0.
  • Loading branch information
dcommander committed Jan 20, 2023
1 parent b99e759 commit 98a6455
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ image dimensions.
8. Fixed an issue whereby the Java version of TJBench did not accept a range of
quality values.

9. Fixed an issue whereby, when `-progressive` was passed to TJBench, the JPEG
input image was not transformed into a progressive JPEG image prior to
decompression.


2.1.4
=====
Expand Down
1 change: 1 addition & 0 deletions java/TJBench.java
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ public static void main(String[] argv) {
} else if (argv[i].equalsIgnoreCase("-progressive")) {
System.out.println("Using progressive entropy coding\n");
flags |= TJ.FLAG_PROGRESSIVE;
xformOpt |= TJTransform.OPT_PROGRESSIVE;
} else if (argv[i].equalsIgnoreCase("-rgb"))
pf = TJ.PF_RGB;
else if (argv[i].equalsIgnoreCase("-rgbx"))
Expand Down
1 change: 1 addition & 0 deletions tjbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ int main(int argc, char *argv[])
} else if (!strcasecmp(argv[i], "-progressive")) {
printf("Using progressive entropy coding\n\n");
flags |= TJFLAG_PROGRESSIVE;
xformOpt |= TJXOPT_PROGRESSIVE;
} else if (!strcasecmp(argv[i], "-rgb"))
pf = TJPF_RGB;
else if (!strcasecmp(argv[i], "-rgbx"))
Expand Down

0 comments on commit 98a6455

Please sign in to comment.