Skip to content

Commit

Permalink
Bump AVM to research-8.1.0 (#2506)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud authored Nov 28, 2024
1 parent 03738d5 commit fa62667
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The changes are relative to the previous release, unless the baseline is specifi
decoder->image->gainMap != NULL instead.
* Write an empty HandlerBox name field instead of "libavif" (saves 7 bytes).
* Update aom.cmd/LocalAom.cmake: v3.11.0
* Update avm.cmd: research-v8.0.0
* Update avm.cmd: research-v8.1.0
* Update dav1d.cmd/dav1d_android.sh/LocalDav1d.cmake: 1.5.0
* Update libjpeg.cmd/LocalJpeg.cmake: v3.0.4
* Update libxml2.cmd/LocalLibXml2.cmake: v2.13.4
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/LocalAom.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(AVIF_LOCAL_AOM_GIT_TAG v3.11.0)
set(AVIF_LOCAL_AVM_GIT_TAG research-v8.0.0)
set(AVIF_LOCAL_AVM_GIT_TAG research-v8.1.0)

if(AVIF_CODEC_AVM)
# Building the avm repository generates files such as "libaom.a" because it is a fork of aom,
Expand Down
2 changes: 1 addition & 1 deletion ext/avm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
: # If you're running this on Windows, be sure you've already run this (from your VC2019 install dir):
: # "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"

git clone -b research-v8.0.0 --depth 1 https://gitlab.com/AOMediaCodec/avm.git
git clone -b research-v8.1.0 --depth 1 https://gitlab.com/AOMediaCodec/avm.git

cd avm

Expand Down
6 changes: 4 additions & 2 deletions src/codec_avm.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ static avifBool avmCodecGetNextImage(struct avifCodec * codec,
return AVIF_FALSE;
}
if (codec->internal->image->monochrome) {
// avm does not handle monochrome as of research-v8.0.0.
// avm does not handle monochrome as of research-v8.1.0.
// https://gitlab.com/AOMediaCodec/avm/-/issues/522
// This should not happen.
yuvFormat = AVIF_PIXEL_FORMAT_YUV400;
}
Expand Down Expand Up @@ -658,7 +659,8 @@ static avifResult avmCodecEncodeImage(avifCodec * codec,
cfg->g_threads = AVIF_MIN(encoder->maxThreads, 64);
}

// avm does not handle monochrome as of research-v8.0.0.
// avm does not handle monochrome as of research-v8.1.0.
// https://gitlab.com/AOMediaCodec/avm/-/issues/522
// TODO(yguyon): Enable when fixed upstream
codec->internal->monochromeEnabled = AVIF_FALSE;

Expand Down
30 changes: 0 additions & 30 deletions src/obu.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ static avifBool parseAV1SequenceHeader(avifBits * bits, avifSequenceHeader * hea
// See https://gitlab.com/AOMediaCodec/avm/-/blob/main/av1/decoder/decodeframe.c
static avifBool parseAV2SequenceHeader(avifBits * bits, avifSequenceHeader * header)
{
#if defined(AVIF_ENABLE_CWG_E103)
// See read_sequence_header_obu() in avm.
AVIF_CHECK(parseSequenceHeaderProfile(bits, header));

Expand All @@ -387,42 +386,13 @@ static avifBool parseAV2SequenceHeader(avifBits * bits, avifSequenceHeader * hea
// See read_sequence_header_obu() in avm.
AVIF_CHECK(parseSequenceHeaderLevelIdxAndTier(bits, header));

return !bits->error;
#else // !defined(AVIF_ENABLE_CWG_E103)
// See read_sequence_header_obu() in avm.
AVIF_CHECK(parseSequenceHeaderProfile(bits, header));
AVIF_CHECK(parseSequenceHeaderLevelIdxAndTier(bits, header));

// See av1_read_sequence_header() in avm.
AVIF_CHECK(parseSequenceHeaderFrameMaxDimensions(bits, header));
if (!avifBitsRead(bits, 1)) // BLOCK_256X256
avifBitsRead(bits, 1); // BLOCK_128X128
AVIF_CHECK(parseSequenceHeaderEnabledFeatures(bits, header));

avifBitsRead(bits, 2); // enable_superres, enable_cdef
if (avifBitsRead(bits, 1)) { // enable_restoration
const int lr_tools_disable_mask_length = /*RESTORE_SWITCHABLE_TYPES=*/5 - 1;
avifBitsRead(bits, lr_tools_disable_mask_length); // lr_tools_disable_mask[0]
if (avifBitsRead(bits, 1)) {
avifBitsRead(bits, lr_tools_disable_mask_length - 1); // lr_tools_disable_mask[1]
}
}

// See av1_read_color_config() in avm.
AVIF_CHECK(parseSequenceHeaderColorConfig(bits, header));
// Ignored fields.
// separate_uv_delta_q
// base_y_dc_delta_q
// base_uv_dc_delta_q

// See read_sequence_header_obu() in avm.
// Ignored field.
// film_grain_params_present

// See av1_read_sequence_header_beyond_av1() in avm.
// Other ignored fields.
return !bits->error;
#endif // defined(AVIF_ENABLE_CWG_E103)
}
#endif

Expand Down

0 comments on commit fa62667

Please sign in to comment.