Skip to content

Commit

Permalink
Remove EXPERIMENTAL from AVIF_ENABLE_EXPERIMENTAL_YCGCO_R
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Mar 26, 2024
1 parent 34642a2 commit ebecdcb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-unix-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
-DAVIF_LIBSHARPYUV=LOCAL
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_LOCAL_GTEST=ON
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_YCGCO_R=ON
-DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_AVIR=ON
-DAVIF_ENABLE_WERROR=ON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
-DAVIF_LOCAL_ZLIBPNG=ON
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_LOCAL_GTEST=ON
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_YCGCO_R=ON
-DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_AVIR=ON -DAVIF_ENABLE_WERROR=ON
- name: Build libavif (ninja)
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ List of incompatible ABI changes in this release:
* Add experimental support for AV2 behind the compilation flag AVIF_CODEC_AVM.
AVIF_CODEC_CHOICE_AVM is now part of avifCodecChoice.
* Add experimental YCgCo-R support behind the compilation flag
AVIF_ENABLE_EXPERIMENTAL_YCGCO_R.
AVIF_ENABLE_YCGCO_R.
* Allow lossless 4:0:0 on grayscale input.
* Add avifenc --no-overwrite flag to avoid overwriting output file.
* Add avifenc --clli flag to set clli.
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ option(BUILD_SHARED_LIBS "Build shared avif library" ON)
option(AVIF_ENABLE_WERROR "Treat all compiler warnings as errors" OFF)
option(AVIF_ENABLE_WUNUSED_RESULT "Add [[nodiscard]] to some functions. CMake must be at least 3.21 to force C23" OFF)

option(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R "Enable experimental YCgCo-R matrix code for encoding" OFF)
option(AVIF_ENABLE_YCGCO_R "Enable experimental YCgCo-R matrix code for encoding" OFF)
option(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP
"Enable experimental gain map code (for HDR images that look good both on HDR and SDR displays)" OFF
)
Expand Down Expand Up @@ -316,8 +316,8 @@ if(AVIF_ENABLE_COVERAGE)
endif()
endif()

if(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
add_compile_definitions(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
if(AVIF_ENABLE_YCGCO_R)
add_compile_definitions(AVIF_ENABLE_YCGCO_R)
endif()

if(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP)
Expand Down
8 changes: 4 additions & 4 deletions apps/avifenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1936,12 +1936,12 @@ int main(int argc, char * argv[])
// Matrix coefficients.
if (settings.cicpExplicitlySet) {
avifBool incompatibleMC = (settings.matrixCoefficients != AVIF_MATRIX_COEFFICIENTS_IDENTITY);
#if defined(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
#if defined(AVIF_ENABLE_YCGCO_R)
incompatibleMC &= (settings.matrixCoefficients != AVIF_MATRIX_COEFFICIENTS_YCGCO_RE &&
settings.matrixCoefficients != AVIF_MATRIX_COEFFICIENTS_YCGCO_RO);
#endif
if (incompatibleMC) {
#if defined(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
#if defined(AVIF_ENABLE_YCGCO_R)
fprintf(stderr, "Matrix coefficients have to be identity, YCgCo-Re, or YCgCo-Ro in lossless mode.\n");
#else
fprintf(stderr, "Matrix coefficients have to be identity in lossless mode.\n");
Expand Down Expand Up @@ -2374,12 +2374,12 @@ int main(int argc, char * argv[])
}

avifBool matrixCoefficientsAreLosslessCompatible = usingIdentityMatrix;
#if defined(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
#if defined(AVIF_ENABLE_YCGCO_R)
matrixCoefficientsAreLosslessCompatible |= (image->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_YCGCO_RE ||
image->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_YCGCO_RO);
#endif
if (!matrixCoefficientsAreLosslessCompatible && !using400) {
#if defined(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
#if defined(AVIF_ENABLE_YCGCO_R)
fprintf(stderr, "WARNING: [--lossless] Input data was RGB and matrixCoefficients isn't set to identity (--cicp x/x/0) or YCgCo-Re/Ro (--cicp x/x/15 or x/x/16); Output might not be lossless.\n");
#else
fprintf(stderr, "WARNING: [--lossless] Input data was RGB and matrixCoefficients isn't set to identity (--cicp x/x/0); Output might not be lossless.\n");
Expand Down
4 changes: 2 additions & 2 deletions src/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,12 +1239,12 @@ static avifResult avifValidateGrid(uint32_t gridCols,
cellImage = cellImage->gainMap->image;
}
#endif
#if !defined(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
#if !defined(AVIF_ENABLE_YCGCO_R)
if (cellImage->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_YCGCO_RE ||
cellImage->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_YCGCO_RO) {
avifDiagnosticsPrintf(diag,
"YCGCO_R is not enabled for encoding. "
"Please set AVIF_ENABLE_EXPERIMENTAL_YCGCO_R in CMake. "
"Please set AVIF_ENABLE_YCGCO_R in CMake. "
"cf https://github.com/AOMediaCodec/libavif/issues/2077.");
return AVIF_RESULT_INVALID_IMAGE_GRID;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/gtest/aviflosslesstest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ TEST(BasicTest, EncodeDecodeMatrixCoefficients) {
avifResult result =
avifEncoderWrite(encoder.get(), image.get(), &encoded);

#if !defined(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
#if !defined(AVIF_ENABLE_YCGCO_R)
if (matrix_coefficient == AVIF_MATRIX_COEFFICIENTS_YCGCO_RE) {
ASSERT_NE(result, AVIF_RESULT_OK);
continue;
Expand Down

0 comments on commit ebecdcb

Please sign in to comment.