Skip to content

Commit

Permalink
Reflect encoder behaviour (creation of JPH files) to documentation an…
Browse files Browse the repository at this point in the history
…d drop .jphc extension from encoder and decoder
  • Loading branch information
osamu620 committed Oct 31, 2023
1 parent e033001 commit 012ce49
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ To see a help, use `-h` option.
## Supported file types
### Encoder
- input image formats: .pgm, .ppm, .pgx, .tif (libtiff required)
- output codestreams: .j2k, .j2c, .jphc (Part 15 codestream), .jph (Part 15 file format)
- output codestreams: .jhc (Part 15 codestream, .j2k and .j2c can be used as aliases), .jph (Part 15 file format)
- Note: Specifying .jph as the output triggers a JPH file creation, otherwise just a codestream will be generated.
### Decoder
- input codestreams : .j2k, .j2c, .jphc
- input codestreams : .j2k, .j2c, .jhc
- output image formats: .raw, .ppm, .pgm, .pgx
6 changes: 3 additions & 3 deletions source/apps/decoder/main_dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void print_help(char *cmd) {
printf("JPEG 2000 Part 1 and Part 15 decoder\n");
printf("USAGE: %s [options]\n\n", cmd);
printf("OPTIONS:\n");
printf("-i: Input file. .j2k, .j2c, .jhc, and .jphc are supported.\n");
printf("-i: Input file. .j2k, .j2c, and .jhc are supported.\n");
printf(" .jp2 and .jph (box based file-format) are not supported.\n");
printf("-o: Output file. Supported formats are PPM, PGM, PGX and RAW.\n");
printf("-reduce n: Number of DWT resolution reduction.\n");
Expand All @@ -67,8 +67,8 @@ int main(int argc, char *argv[]) {
}
infile_ext_name = strrchr(infile_name, '.');
if (strcmp(infile_ext_name, ".j2k") != 0 && strcmp(infile_ext_name, ".j2c") != 0
&& strcmp(infile_ext_name, ".jhc") != 0 && strcmp(infile_ext_name, ".jphc") != 0) {
printf("ERROR: Supported extensions are .j2k, .j2c, .jhc, and .jphc\n");
&& strcmp(infile_ext_name, ".jhc") != 0) {
printf("ERROR: Supported extensions are .j2k, .j2c, .jhc\n");
exit(EXIT_FAILURE);
}
if (nullptr == (outfile_name = get_command_option(argc, argv, "-o"))) {
Expand Down
5 changes: 4 additions & 1 deletion source/apps/encoder/enc_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ void print_help(char *cmd) {
printf("%s: JPEG 2000 Part 15 encoder\n", cmd);
printf("USAGE: %s -i input-image(s) -o output-codestream [options...]\n\n", cmd);
printf("-i: Input-image(s)\n PGM, PPM, and TIFF (optional, 8 or 16 bpp only) are supported.\n");
printf("-o: Output codestream\n `.jhc` or `.j2c` are recommended as the extension.\n");
printf(
"-o: Output codestream/file\n To create a codestream, `.jhc` or `.j2c` are recommended as the "
"extension.\n");
printf(" Specifying `.jph` triggers a JPH file creation.\n");
printf(" Note: If this option is unspecified, encoding result is placed on a memory buffer.\n\n");
printf("OPTIONS:\n");
printf(
Expand Down

0 comments on commit 012ce49

Please sign in to comment.