Add the ignoreICC option to avifDecoder#3280
Conversation
ecb09ed to
1ac6aed
Compare
1ac6aed to
e4e13c8
Compare
This allows us to remove the ignoreColorProfile parameter from the avifImageCreateView() function. There is a change of behavior to avifdec: The message "[--ignore-icc] Discarding ICC profile.\n" won't be printed if the --ignore-icc or --icc option is specified and the image has an ICC profile. Bug: AOMediaCodec#3277
e4e13c8 to
7c4cdf3
Compare
maryla-uc
left a comment
There was a problem hiding this comment.
Are you planning on porting this change to crabbyavif as well?
wantehchang
left a comment
There was a problem hiding this comment.
Thanks for the review. I've ported the avifDecoder::ignoreColorProfile option to CrabbyAvif as you suggested. (See CrabbyAvif feature request webmproject/CrabbyAvif#829 and Google internal CL cl/942193170.)
|
|
||
| // Enable this to avoid reading and surfacing ICC profile to the decoded avifImage and gain map | ||
| // metadata. | ||
| avifBool ignoreICC; |
There was a problem hiding this comment.
I also renamed the ignoreColorProfile field to ignoreICC. The original reason is that the name ignore_icc blends in better with the CrabbyAvif source code. A new reason is that the ignoreColorProfile parameter of the avifReadImage() function in apps/shared/avifutil.h also controls the setting of the colorPrimaries and transferCharacteristics fields when decoding a PNG input file:
// Reads an image from a file with the requested format and depth.
// ...
// May set the image's colorPrimaries, transferCharacteristics and ICC fields
// based on color information found in the image (unless ignoreColorProfile is true).
avifAppFileFormat avifReadImage(const char * filename,
avifAppFileFormat inputFormat,
avifPixelFormat requestedFormat,
int requestedDepth,
avifChromaDownsampling chromaDownsampling,
avifBool ignoreColorProfile,
avifBool ignoreExif,
avifBool ignoreXMP,
avifBool ignoreAlpha,
avifBool ignoreGainMap,
uint32_t imageSizeLimit,
avifImage * image,
uint32_t * outDepth,
avifAppSourceTiming * sourceTiming,
struct y4mFrameIterator ** frameIter);
So the ignoreICC name is more precise.
This allows us to remove the ignoreColorProfile parameter from the
avifImageCreateView() function.
There is a change of behavior to avifdec:
The message "[--ignore-icc] Discarding ICC profile.\n" won't be printed
if the --ignore-icc or --icc option is specified and the image has an
ICC profile.
Bug: #3277