diff -Nru aom-3.1.1/AUTHORS aom-3.1.2/AUTHORS --- aom-3.1.1/AUTHORS 2021-06-28 23:29:30.000000000 +0000 +++ aom-3.1.2/AUTHORS 2021-07-30 19:18:45.000000000 +0000 @@ -259,6 +259,7 @@ Wei-Ting Lin Wenyao Liu Will Bresnahan +Xiaoqing Zhu Xing Jin Xin Zhao Yaowu Xu diff -Nru aom-3.1.1/av1/av1_dx_iface.c aom-3.1.2/av1/av1_dx_iface.c --- aom-3.1.1/av1/av1_dx_iface.c 2021-06-28 23:29:31.000000000 +0000 +++ aom-3.1.2/av1/av1_dx_iface.c 2021-07-30 19:18:45.000000000 +0000 @@ -817,8 +817,8 @@ ctx->img.fb_priv = output_frame_buf->raw_frame_buffer.priv; img = &ctx->img; - img->temporal_id = cm->temporal_layer_id; - img->spatial_id = cm->spatial_layer_id; + img->temporal_id = output_frame_buf->temporal_id; + img->spatial_id = output_frame_buf->spatial_id; if (pbi->skip_film_grain) grain_params->apply_grain = 0; aom_image_t *res = add_grain_if_needed(ctx, img, &ctx->image_with_grain, grain_params); diff -Nru aom-3.1.1/av1/common/av1_common_int.h aom-3.1.2/av1/common/av1_common_int.h --- aom-3.1.1/av1/common/av1_common_int.h 2021-06-28 23:29:31.000000000 +0000 +++ aom-3.1.2/av1/common/av1_common_int.h 2021-07-30 19:18:45.000000000 +0000 @@ -151,6 +151,8 @@ aom_film_grain_t film_grain_params; aom_codec_frame_buffer_t raw_frame_buffer; YV12_BUFFER_CONFIG buf; + int temporal_id; // Temporal layer ID of the frame + int spatial_id; // Spatial layer ID of the frame FRAME_TYPE frame_type; // This is only used in the encoder but needs to be indexed per ref frame diff -Nru aom-3.1.1/av1/decoder/obu.c aom-3.1.2/av1/decoder/obu.c --- aom-3.1.1/av1/decoder/obu.c 2021-06-28 23:29:31.000000000 +0000 +++ aom-3.1.2/av1/decoder/obu.c 2021-07-30 19:18:45.000000000 +0000 @@ -987,6 +987,8 @@ decoded_payload_size = frame_header_size; pbi->frame_header_size = frame_header_size; + cm->cur_frame->temporal_id = obu_header.temporal_layer_id; + cm->cur_frame->spatial_id = obu_header.spatial_layer_id; if (cm->show_existing_frame) { if (obu_header.type == OBU_FRAME) { diff -Nru aom-3.1.1/build/cmake/exports.cmake aom-3.1.2/build/cmake/exports.cmake --- aom-3.1.1/build/cmake/exports.cmake 2021-06-28 23:29:32.000000000 +0000 +++ aom-3.1.2/build/cmake/exports.cmake 2021-07-30 19:18:46.000000000 +0000 @@ -17,9 +17,9 @@ # Creates the custom target which handles generation of the symbol export lists. function(setup_exports_target) - if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin") + if(APPLE) set(symbol_file_ext "syms") - elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS" AND MSVC) + elseif(WIN32) set(symbol_file_ext "def") else() set(symbol_file_ext "ver") @@ -43,7 +43,7 @@ -P "${AOM_ROOT}/build/cmake/generate_exports.cmake" SOURCES ${AOM_EXPORTS_SOURCES} - DEPENDS ${AOM_EXPORTS_SOURCES}) + DEPENDS ${AOM_EXPORTS_SOURCES} BYPRODUCTS ${aom_sym_file}) # Make libaom depend on the exports file, and set flags to pick it up when # creating the dylib. @@ -54,14 +54,12 @@ APPEND_STRING PROPERTY LINK_FLAGS "-exported_symbols_list ${aom_sym_file}") elseif(WIN32) - if(NOT MSVC) - set_property(TARGET aom - APPEND_STRING - PROPERTY LINK_FLAGS "-Wl,--version-script ${aom_sym_file}") - else() + if(MSVC) set_property(TARGET aom APPEND_STRING PROPERTY LINK_FLAGS "/DEF:${aom_sym_file}") + else() + target_sources(aom PRIVATE "${aom_sym_file}") endif() # TODO(tomfinegan): Sort out the import lib situation and flags for MSVC. diff -Nru aom-3.1.1/build/cmake/generate_exports.cmake aom-3.1.2/build/cmake/generate_exports.cmake --- aom-3.1.1/build/cmake/generate_exports.cmake 2021-06-28 23:29:32.000000000 +0000 +++ aom-3.1.2/build/cmake/generate_exports.cmake 2021-07-30 19:18:46.000000000 +0000 @@ -23,7 +23,7 @@ if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin") set(symbol_prefix "_") -elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS" AND AOM_MSVC) +elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS") file(WRITE "${AOM_SYM_FILE}" "LIBRARY aom\n" "EXPORTS\n") else() set(symbol_suffix ";") @@ -33,7 +33,7 @@ if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin") file(REMOVE "${aom_sym_file}") -elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS" AND AOM_MSVC) +elseif("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS") file(WRITE "${aom_sym_file}" "LIBRARY aom\n" "EXPORTS\n") else() file(WRITE "${aom_sym_file}" "{\nglobal:\n") @@ -47,7 +47,7 @@ foreach(exported_symbol ${exported_symbols}) string(STRIP "${exported_symbol}" exported_symbol) - if("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS" AND AOM_MSVC) + if("${AOM_TARGET_SYSTEM}" MATCHES "Windows\|MSYS") string(SUBSTRING ${exported_symbol} 0 4 export_type) string(COMPARE EQUAL "${export_type}" "data" is_data) if(is_data) diff -Nru aom-3.1.1/build/cmake/version.pl aom-3.1.2/build/cmake/version.pl --- aom-3.1.1/build/cmake/version.pl 2021-06-28 23:29:32.000000000 +0000 +++ aom-3.1.2/build/cmake/version.pl 2021-07-30 19:18:46.000000000 +0000 @@ -62,7 +62,9 @@ my $version_extra = ""; if (length($git_desc) > 0) { my @git_desc_components = split('-', $git_desc, 2); - $version_extra = $git_desc_components[1]; + if (@git_desc_components > 1) { + $version_extra = $git_desc_components[1]; + } } open(my $version_file, '>', $version_filename) or diff -Nru aom-3.1.1/CHANGELOG aom-3.1.2/CHANGELOG --- aom-3.1.1/CHANGELOG 2021-06-28 23:29:30.000000000 +0000 +++ aom-3.1.2/CHANGELOG 2021-07-30 19:18:45.000000000 +0000 @@ -1,3 +1,19 @@ +2021-07-20 v3.1.2 + This release includes several bug fixes. + + - Bug fixes: + exports.cmake: use APPLE and WIN32 and use def for mingw-w64 + https://aomedia-review.googlesource.com/c/aom/+/139882 + + Issue 2993: Incorrect spatial_id when decoding base layer of + multi-layer stream + + Issue 3080: Chroma Resampling by Encoder on Y4M Inputs Files Tagged + as C420mpeg2 + + Issue 3081: Use of uninitialized value $version_extra in + concatenation (.) or string at aom/build/cmake/version.pl line 88. + 2021-06-08 v3.1.1 This release includes several bug fixes. diff -Nru aom-3.1.1/CMakeLists.txt aom-3.1.2/CMakeLists.txt --- aom-3.1.1/CMakeLists.txt 2021-06-28 23:29:30.000000000 +0000 +++ aom-3.1.2/CMakeLists.txt 2021-07-30 19:18:45.000000000 +0000 @@ -43,7 +43,7 @@ # # We set SO_FILE_VERSION = [c-a].a.r set(LT_CURRENT 4) -set(LT_REVISION 1) +set(LT_REVISION 2) set(LT_AGE 1) math(EXPR SO_VERSION "${LT_CURRENT} - ${LT_AGE}") set(SO_FILE_VERSION "${SO_VERSION}.${LT_AGE}.${LT_REVISION}") diff -Nru aom-3.1.1/common/y4minput.c aom-3.1.2/common/y4minput.c --- aom-3.1.1/common/y4minput.c 2021-06-28 23:29:32.000000000 +0000 +++ aom-3.1.2/common/y4minput.c 2021-07-30 19:18:46.000000000 +0000 @@ -307,26 +307,6 @@ } } -/*Handles both 422 and 420mpeg2 to 422jpeg and 420jpeg, respectively.*/ -static void y4m_convert_42xmpeg2_42xjpeg(y4m_input *_y4m, unsigned char *_dst, - unsigned char *_aux) { - int c_w; - int c_h; - int c_sz; - int pli; - /*Skip past the luma data.*/ - _dst += _y4m->pic_w * _y4m->pic_h; - /*Compute the size of each chroma plane.*/ - c_w = (_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h; - c_h = (_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v; - c_sz = c_w * c_h; - for (pli = 1; pli < 3; pli++) { - y4m_42xmpeg2_42xjpeg_helper(_dst, _aux, c_w, c_h); - _dst += c_sz; - _aux += c_sz; - } -} - /*This format is only used for interlaced content, but is included for completeness. @@ -925,7 +905,8 @@ y4m_ctx->aux_buf = NULL; y4m_ctx->dst_buf = NULL; if (strcmp(y4m_ctx->chroma_type, "420") == 0 || - strcmp(y4m_ctx->chroma_type, "420jpeg") == 0) { + strcmp(y4m_ctx->chroma_type, "420jpeg") == 0 || + strcmp(y4m_ctx->chroma_type, "420mpeg2") == 0) { y4m_ctx->src_c_dec_h = y4m_ctx->dst_c_dec_h = y4m_ctx->src_c_dec_v = y4m_ctx->dst_c_dec_v = 2; y4m_ctx->dst_buf_read_sz = @@ -970,18 +951,6 @@ fprintf(stderr, "Unsupported conversion from 420p12 to 420jpeg\n"); return -1; } - } else if (strcmp(y4m_ctx->chroma_type, "420mpeg2") == 0) { - y4m_ctx->src_c_dec_h = y4m_ctx->dst_c_dec_h = y4m_ctx->src_c_dec_v = - y4m_ctx->dst_c_dec_v = 2; - y4m_ctx->dst_buf_read_sz = y4m_ctx->pic_w * y4m_ctx->pic_h; - /*Chroma filter required: read into the aux buf first.*/ - y4m_ctx->aux_buf_sz = y4m_ctx->aux_buf_read_sz = - 2 * ((y4m_ctx->pic_w + 1) / 2) * ((y4m_ctx->pic_h + 1) / 2); - y4m_ctx->convert = y4m_convert_null; - if (csp != AOM_CSP_VERTICAL) { - y4m_ctx->convert = y4m_convert_42xmpeg2_42xjpeg; - snprintf(y4m_ctx->chroma_type, sizeof(y4m_ctx->chroma_type), "420"); - } } else if (strcmp(y4m_ctx->chroma_type, "420paldv") == 0) { y4m_ctx->src_c_dec_h = y4m_ctx->dst_c_dec_h = y4m_ctx->src_c_dec_v = y4m_ctx->dst_c_dec_v = 2; diff -Nru aom-3.1.1/debian/changelog aom-3.1.2/debian/changelog --- aom-3.1.1/debian/changelog 2021-06-29 04:56:36.000000000 +0000 +++ aom-3.1.2/debian/changelog 2021-07-30 19:20:20.000000000 +0000 @@ -1,3 +1,9 @@ +aom (3.1.2-0ubuntu1~20.04.sav0) focal; urgency=medium + + * New upstream bugfix release + + -- Rob Savoury Fri, 30 Jul 2021 12:20:20 -0700 + aom (3.1.1-0ubuntu1~20.04.sav0) focal; urgency=medium * New upstream release diff -Nru aom-3.1.1/debian/patches/debian-changes aom-3.1.2/debian/patches/debian-changes --- aom-3.1.1/debian/patches/debian-changes 2021-06-29 04:56:36.000000000 +0000 +++ aom-3.1.2/debian/patches/debian-changes 2021-07-30 19:20:20.000000000 +0000 @@ -15,17 +15,17 @@ clone`.) A single combined diff, containing all the changes, follows. ---- aom-3.1.1.orig/aom/exports_enc -+++ aom-3.1.1/aom/exports_enc +--- aom-3.1.2.orig/aom/exports_enc ++++ aom-3.1.2/aom/exports_enc @@ -15,3 +15,5 @@ text aom_noise_model_init text aom_noise_model_get_grain_parameters text aom_noise_model_save_latest text aom_noise_model_update +text aom_wb_write_literal +text aom_wb_write_unsigned_literal ---- aom-3.1.1.orig/CHANGELOG -+++ aom-3.1.1/CHANGELOG -@@ -171,6 +171,20 @@ +--- aom-3.1.2.orig/CHANGELOG ++++ aom-3.1.2/CHANGELOG +@@ -187,6 +187,20 @@ - Enhancements: Full-sweep document update for codec controls. diff -Nru aom-3.1.1/test/decode_scalability_test.cc aom-3.1.2/test/decode_scalability_test.cc --- aom-3.1.1/test/decode_scalability_test.cc 1970-01-01 00:00:00.000000000 +0000 +++ aom-3.1.2/test/decode_scalability_test.cc 2021-07-30 19:18:46.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2021, Alliance for Open Media. All rights reserved + * + * This source code is subject to the terms of the BSD 2 Clause License and + * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License + * was not distributed with this source code in the LICENSE file, you can + * obtain it at www.aomedia.org/license/software. If the Alliance for Open + * Media Patent License 1.0 was not distributed with this source code in the + * PATENTS file, you can obtain it at www.aomedia.org/license/patent. + */ + +#include +#include + +#include "test/codec_factory.h" +#include "test/decode_test_driver.h" +#include "test/ivf_video_source.h" +#include "test/util.h" +#include "test/video_source.h" +#include "third_party/googletest/src/googletest/include/gtest/gtest.h" + +namespace { + +struct ObuExtensionHeader { + int temporal_id; + int spatial_id; +}; + +struct DecodeParam { + const char *filename; + const ObuExtensionHeader *headers; + size_t num_headers; +}; + +std::ostream &operator<<(std::ostream &os, const DecodeParam &dp) { + return os << "file: " << dp.filename; +} + +class DecodeScalabilityTest + : public ::libaom_test::DecoderTest, + public ::libaom_test::CodecTestWithParam { + protected: + DecodeScalabilityTest() + : DecoderTest(GET_PARAM(0)), headers_(GET_PARAM(1).headers), + num_headers_(GET_PARAM(1).num_headers) {} + + ~DecodeScalabilityTest() override {} + + void PreDecodeFrameHook(const libaom_test::CompressedVideoSource &video, + libaom_test::Decoder *decoder) override { + if (video.frame_number() == 0) + decoder->Control(AV1D_SET_OUTPUT_ALL_LAYERS, 1); + } + + void DecompressedFrameHook(const aom_image_t &img, + const unsigned int /*frame_number*/) override { + const ObuExtensionHeader &header = headers_[header_index_]; + EXPECT_EQ(img.temporal_id, header.temporal_id); + EXPECT_EQ(img.spatial_id, header.spatial_id); + header_index_ = (header_index_ + 1) % num_headers_; + } + + void RunTest() { + const DecodeParam input = GET_PARAM(1); + aom_codec_dec_cfg_t cfg = { 1, 0, 0, !FORCE_HIGHBITDEPTH_DECODING }; + const std::string filename = input.filename; + libaom_test::IVFVideoSource decode_video(filename); + decode_video.Init(); + + ASSERT_NO_FATAL_FAILURE(RunLoop(&decode_video, cfg)); + } + + private: + const ObuExtensionHeader *const headers_; + const size_t num_headers_; + size_t header_index_ = 0; +}; + +TEST_P(DecodeScalabilityTest, ObuExtensionHeader) { RunTest(); } + +// For all test files, we have: +// operatingPoint = 0 +// OperatingPointIdc = operating_point_idc[ 0 ] + +// av1-1-b8-01-size-16x16.ivf: +// operating_points_cnt_minus_1 = 0 +// operating_point_idc[ 0 ] = 0x0 +const ObuExtensionHeader kSize16x16Headers[1] = { { 0, 0 } }; + +#if !CONFIG_REALTIME_ONLY +// av1-1-b8-22-svc-L1T2.ivf: +// operating_points_cnt_minus_1 = 1 +// operating_point_idc[ 0 ] = 0x103 +// operating_point_idc[ 1 ] = 0x101 +const ObuExtensionHeader kL1T2Headers[2] = { { 0, 0 }, { 1, 0 } }; + +// av1-1-b8-22-svc-L2T1.ivf: +// operating_points_cnt_minus_1 = 1 +// operating_point_idc[ 0 ] = 0x301 +// operating_point_idc[ 1 ] = 0x101 +const ObuExtensionHeader kL2T1Headers[2] = { { 0, 0 }, { 0, 1 } }; + +// av1-1-b8-22-svc-L2T2.ivf: +// operating_points_cnt_minus_1 = 3 +// operating_point_idc[ 0 ] = 0x303 +// operating_point_idc[ 1 ] = 0x301 +// operating_point_idc[ 2 ] = 0x103 +// operating_point_idc[ 3 ] = 0x101 +const ObuExtensionHeader kL2T2Headers[4] = { + { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1, 1 } +}; +#endif // !CONFIG_REALTIME_ONLY + +const DecodeParam kAV1DecodeScalabilityTests[] = { + // { filename, headers, num_headers } + { "av1-1-b8-01-size-16x16.ivf", kSize16x16Headers, 1 }, +#if !CONFIG_REALTIME_ONLY + // These test vectors use loop restoration, which is not supported in + // the CONFIG_REALTIME_ONLY builds. + { "av1-1-b8-22-svc-L1T2.ivf", kL1T2Headers, 2 }, + { "av1-1-b8-22-svc-L2T1.ivf", kL2T1Headers, 2 }, + { "av1-1-b8-22-svc-L2T2.ivf", kL2T2Headers, 4 }, +#endif // !CONFIG_REALTIME_ONLY +}; + +AV1_INSTANTIATE_TEST_SUITE(DecodeScalabilityTest, + ::testing::ValuesIn(kAV1DecodeScalabilityTests)); + +} // namespace diff -Nru aom-3.1.1/test/test.cmake aom-3.1.2/test/test.cmake --- aom-3.1.1/test/test.cmake 2021-06-28 23:29:33.000000000 +0000 +++ aom-3.1.2/test/test.cmake 2021-07-30 19:18:46.000000000 +0000 @@ -54,6 +54,7 @@ endif() list(APPEND AOM_UNIT_TEST_DECODER_SOURCES "${AOM_ROOT}/test/decode_api_test.cc" + "${AOM_ROOT}/test/decode_scalability_test.cc" "${AOM_ROOT}/test/external_frame_buffer_test.cc" "${AOM_ROOT}/test/invalid_file_test.cc" "${AOM_ROOT}/test/test_vector_test.cc" diff -Nru aom-3.1.1/test/y4m_test.cc aom-3.1.2/test/y4m_test.cc --- aom-3.1.1/test/y4m_test.cc 2021-06-28 23:29:33.000000000 +0000 +++ aom-3.1.2/test/y4m_test.cc 2021-07-30 19:18:46.000000000 +0000 @@ -40,7 +40,7 @@ { "park_joy_90p_8_420_monochrome.y4m", 8, AOM_IMG_FMT_I420, "95ef5bf6218580588be24a5271bb6a7f" }, { "park_joy_90p_8_420_vertical_csp.y4m", 8, AOM_IMG_FMT_I420, - "f53a40fec15254ac312527339d9c686b" }, + "e5406275b9fc6bb3436c31d4a05c1cab" }, { "park_joy_90p_8_422.y4m", 8, AOM_IMG_FMT_I422, "284a47a47133b12884ec3a14e959a0b6" }, { "park_joy_90p_8_444.y4m", 8, AOM_IMG_FMT_I444,