Declare the param of avifDumpDiagnostics as const
Also omit the 'struct' keyword before avifDiagnostics.
Remove const from non-pointer function parameters
Using 'const' on non-pointer function parameters means the function
cannot modify the parameters. This could be useful in function
implementations, but should be avoided in function declarations.
C++ allows the function declaration and definition to differ in the
constness of the parameters. For example, in add.h we can declare
int Add(int a, int b);
and in add.cc we can define the function with this prototpye:
int Add(const int a, const int b)
{
return a + b;
}
Unfortunately C doesn't allow this, even though gcc and clang allow this
as a language extension.Fix gdk-pixbuf loader install path (#615)
Currently one ends up with the absolute path on the build machine.
Merge avifCodec's open call with its getNextImage call to avoid codec… (
Move svt update changelog entry into Unreleased (v0.9.1 is already do…
…ne), remove extraneous newline
Fix a typo in the diagnostic context for 'ipco'
The diagnostic messages in avifParseItemPropertyContainerBox() should say "Box[ipco]", not "Box[iprp]".
Print the fraction in "not an integer" messages
Also remove two unnecessary int32_t casts. cropY.n and cropY.d are already of the int32_t type.
Simplify avifCodecConfigurationBoxGetFormat
Simplify the conditionals in avifCodecConfigurationBoxGetFormat(). Once monochrome has been eliminated, YUV 4:2:0 is the only one with subsampling_y == 1. And the remaining two can be differentiated by testing subsampling_x.
Don't clear error in avifEncoderSetCodecSpecificOp
Remove the avifDiagnosticsClearError() call from avifEncoderSetCodecSpecificOption() because avifEncoderSetCodecSpecificOption() returns void and doesn't fail.
Change "decode error" to "decode or encode error" in the description of avifDiagnostics. Capitalize "switch".
Simplify the assertion in avifROStreamStart()
P => Q is equivalent to !P || Q. So it is not necessary to test P again in !P || (P && Q).
No need to pass diag to functions that have 'data'
If a function has an avifDecoderData * data parameter, it can use data->diag. It is not necessary to add an avifDiagnostics * diag parameter to the function.
Fix box name of avifParseChunkOffsetBox
The box name of avifParseChunkOffsetBox depends on largeOffsets.
Some straightforward changes to clapFraction code
In calcCenter(), set the numerator to dim directly if dim is odd, rather than calculate it from dim >> 1. In clapFractionCD(), use *= whenever possible.
Check for int32_t cast and unsigned add overflows
Also remove extraneous parentheses.
Avoid multiplying widthN and heightN by 2
Avoid the widthN * 2 and heightN * 2 multiplications, which could overflow int32_t, by performing the widthN / widthD and heightN / heightD divisions early. Those two divisions are needed to calculate cropRect->width and cropRect->height.
Refactor imir implementation to match HEIF Draft Amendment 2, which r…
…eplaces 'axis' with 'mode' and inverts the behavior
Have avifdec print chroma sample position for 420
In the AV1 bitstream, chroma_sample_position is assigned a value if both subsampling_x and subsamplingy are equal to 1. This actually includes both monochrome and YUV 4:2:0, but chroma_sample_position is not used in monochrome, so we only print chroma_sample_position for YUV 4:2:0.
Check for int32_t overflows in 'clap' code
Check if a uint32_t variable is <= INT32_MAX before casting it to int32_t. Perform the arithmetic operations in int64_t and then check for int32_t overflows. Change clapFractionCD(), clapFractionAdd(), and clapFractionSub() to return avifBool. They return AVIF_FALSE if any arithmetic operation overflows int32_t.
Fix the clang -Wunused-macros warning
Fix the clang -Wunused-macros (macro is not used) warning about the HAVE_AOM_CODEC_SET_OPTION macro when libavif is configured to use libaom for decode only (-DAVIF_CODEC_AOM_ENCODE=OFF -DAVIF_CODEC_AOM_DECODE=ON).
Cleanup related to avifDiagnosticsClearError()
1. Have avifCropRectConvertCleanApertureBox() and avifCleanApertureBoxConvertCropRect() call avifDiagnosticsClearError() on entry. 2. avifDiagnosticsClearError() just needs to set the first character of the diag->error buffer to '\0' rather than memset the entire buffer.
Updates the libaom version checked out in the ext and docker scripts from v3.1.0 to v3.1.1.
Allocate codec->internal->svt_config statically
We don't need to allocate codec->internal->svt_config from the heap.
Make tests/compare.h and tests/testcase.h C++ safe
Add extern "C" blocks to tests/compare.h and tests/testcase.h to allow tests written in C++ to include these two headers.
avifenc, avifdec: Allow "-j all" to automatically use all of the core…
…s on the machine Fixes: #645
Update Changelog in prep for version bump
Don't need to disable MSVC warnings 5031 and 5032
Since #pragma warning(push) and #pragma warning(pop) are not used in this file, we cannot possibly get MSVC warnings 5031 and 5032. Therefore it is not necessary to disable these two warnings. Fix #679.