Skip to content

Commit ec1d949

Browse files
committed
Add --sato flag to avifdec instead of --depth 16
1 parent 0e5fd10 commit ec1d949

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The changes are relative to the previous release, unless the baseline is specifi
2424
avifDecoder::imageContentToDecode & AVIF_IMAGE_CONTENT_SAMPLE_TRANSFORMS is
2525
not zero.
2626
* Support Sample Transform derived image items with grid input image items.
27+
* Add --sato flag to avifdec to enable Sample Transforms support at decoding.
2728
* Add --grid option to avifgainmaputil.
2829

2930
### Changed since 1.3.0

apps/avifdec.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static void syntax(void)
3434
printf(" -j,--jobs J : Number of jobs (worker threads), or 'all' to potentially use as many cores as possible. (Default: all)\n");
3535
printf(" -c,--codec C : Codec to use (choose from versions list below)\n");
3636
printf(" -d,--depth D : Output depth, either 8 or 16. (PNG only; For y4m, depth is retained, and JPEG is always 8bpc)\n");
37-
printf(" Output depth set to 16 enables Sample Transform decoding no matter the output format.\n");
37+
printf(" --sato : Enable Sample Transforms decoding (e.g. 16-bit AVIF)\n");
3838
printf(" -q,--quality Q : Output quality in 0..100. (JPEG only, default: %d)\n", DEFAULT_JPEG_QUALITY);
3939
printf(" --png-compress L : PNG compression level in 0..9 (PNG only; 0=none, 9=max). Defaults to libpng's builtin default\n");
4040
printf(" -u,--upsampling U : Chroma upsampling (for 420/422). One of 'automatic' (default), 'fastest', 'best', 'nearest', or 'bilinear'\n");
@@ -89,6 +89,7 @@ int main(int argc, char * argv[])
8989
const char * inputFilename = NULL;
9090
const char * outputFilename = NULL;
9191
int requestedDepth = 0;
92+
avifBool enableSampleTransforms = AVIF_FALSE;
9293
int jobs = -1;
9394
int jpegQuality = DEFAULT_JPEG_QUALITY;
9495
int pngCompressionLevel = -1; // -1 is a sentinel to avifPNGWrite() to skip calling png_set_compression_level()
@@ -169,6 +170,8 @@ int main(int argc, char * argv[])
169170
fprintf(stderr, "ERROR: invalid depth: %s\n", arg);
170171
return 1;
171172
}
173+
} else if (!strcmp(arg, "--sato")) {
174+
enableSampleTransforms = AVIF_TRUE;
172175
} else if (!strcmp(arg, "-q") || !strcmp(arg, "--quality")) {
173176
NEXTARG();
174177
jpegQuality = atoi(arg);
@@ -314,7 +317,7 @@ int main(int argc, char * argv[])
314317
decoder->allowProgressive = allowProgressive;
315318
if (infoOnly) {
316319
decoder->imageContentToDecode |= AVIF_IMAGE_CONTENT_GAIN_MAP | AVIF_IMAGE_CONTENT_SAMPLE_TRANSFORMS;
317-
} else if (requestedDepth == 16) {
320+
} else if (enableSampleTransforms) {
318321
decoder->imageContentToDecode |= AVIF_IMAGE_CONTENT_SAMPLE_TRANSFORMS;
319322
}
320323

0 commit comments

Comments
 (0)