strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.77k stars 305 forks source link

Build with svt-av1 fails with GCC 14.1 #1223

Closed bbhtt closed 4 months ago

bbhtt commented 4 months ago
/buildstream-build/libheif/plugins/encoder_svt.cc: In function ‘heif_error svt_encode_image(void*, const heif_image*, heif_image_input_class)’:
/buildstream-build/libheif/plugins/encoder_svt.cc:654:34: error: invalid conversion from ‘uint8_t’ {aka ‘unsigned char’} to ‘EbColorPrimaries’ [-fpermissive]
  654 |     svt_config.color_primaries = static_cast<uint8_t>(nclx->color_primaries);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  uint8_t {aka unsigned char}
/buildstream-build/libheif/plugins/encoder_svt.cc:655:43: error: invalid conversion from ‘uint8_t’ {aka ‘unsigned char’} to ‘EbTransferCharacteristics’ [-fpermissive]
  655 |     svt_config.transfer_characteristics = static_cast<uint8_t>(nclx->transfer_characteristics);
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                           |
      |                                           uint8_t {aka unsigned char}
/buildstream-build/libheif/plugins/encoder_svt.cc:656:38: error: invalid conversion from ‘uint8_t’ {aka ‘unsigned char’} to ‘EbMatrixCoefficients’ [-fpermissive]
  656 |     svt_config.matrix_coefficients = static_cast<uint8_t>(nclx->matrix_coefficients);
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                      |
      |                                      uint8_t {aka unsigned char}
/buildstream-build/libheif/plugins/encoder_svt.cc:657:52: error: invalid conversion from ‘int’ to ‘EbColorRange’ [-fpermissive]
  657 |     svt_config.color_range = nclx->full_range_flag ? 1 : 0;
      |                              ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
      |                                                    |
      |                                                    int

Build config:


cmake -B_builddir -H"." -G"Ninja" -DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX:PATH="/usr" \
-DCMAKE_INSTALL_LIBDIR:PATH="lib/x86_64-linux-gnu" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS_RELWITHDEBINFO="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-DNDEBUG" -DENABLE_PLUGIN_LOADING=ON -DPLUGIN_DIRECTORY="/usr/lib/x86_64-linux-gnu/ffmpeg" -DWITH_LIBDE265_PLUGIN="OFF" -DWITH_X265_PLUGIN="OFF" -DWITH_DAV1D=ON -DWITH_DAV1D_PLUGIN=OFF -DWITH_AOM_ENCODER=ON -DWITH_AOM_ENCODER_PLUGIN=OFF -DWITH_AOM_DECODER=ON -DWITH_AOM_DECODER_PLUGIN=OFF -DWITH_JPEG_DECODER=ON -DWITH_JPEG_DECODER_PLUGIN=OFF -DWITH_JPEG_ENCODER=ON -DWITH_JPEG_ENCODER_PLUGIN=OFF -DWITH_OpenJPEG_DECODER=ON -DWITH_OpenJPEG_DECODER_PLUGIN=OFF -DWITH_OpenJPEG_ENCODER=ON -DWITH_OpenJPEG_ENCODER_PLUGIN=OFF -DWITH_SvtEnc=ON -DWITH_SvtEnc_PLUGIN=OFF -DWITH_EXAMPLES=OFF -DBUILD_TESTING=OFF -DENABLE_PLUGIN_LOADING=ON -DPLUGIN_DIRECTORY="/usr/lib/x86_64-linux-gnu/ffmpeg" -DWITH_LIBDE265_PLUGIN="OFF" -DWITH_X265_PLUGIN="OFF" -DWITH_DAV1D=ON -DWITH_DAV1D_PLUGIN=OFF -DWITH_AOM_ENCODER=ON -DWITH_AOM_ENCODER_PLUGIN=OFF -DWITH_AOM_DECODER=ON -DWITH_AOM_DECODER_PLUGIN=OFF -DWITH_JPEG_DECODER=ON -DWITH_JPEG_DECODER_PLUGIN=OFF -DWITH_JPEG_ENCODER=ON -DWITH_JPEG_ENCODER_PLUGIN=OFF -DWITH_OpenJPEG_DECODER=ON -DWITH_OpenJPEG_DECODER_PLUGIN=OFF -DWITH_OpenJPEG_ENCODER=ON -DWITH_OpenJPEG_ENCODER_PLUGIN=OFF -DWITH_SvtEnc=ON -DWITH_SvtEnc_PLUGIN=OFF -DWITH_EXAMPLES=OFF -DBUILD_TESTING=OFF -DWITH_GDK_PIXBUF=ON

Using svt-av1 2.1.2

bbhtt commented 4 months ago

Already fixed https://github.com/strukturag/libheif/commit/a911b26a902c5f89fee2dc20ac4dfaafcb8144ec