├── libaom ├── build │ ├── .gitignore │ ├── .gitattributes │ └── cmake │ │ ├── aom_config.c.template │ │ ├── toolchains │ │ ├── x86-macos.cmake │ │ ├── x86-linux.cmake │ │ ├── arm64-ios.cmake │ │ ├── x86_64-ios-simulator.cmake │ │ ├── ios-simulator-common.cmake │ │ ├── x86_64-mingw-gcc.cmake │ │ ├── x86-ios-simulator.cmake │ │ ├── ppc-linux-gcc.cmake │ │ ├── arm-ios-common.cmake │ │ ├── x86-mingw-gcc.cmake │ │ ├── arm64-mingw-gcc.cmake │ │ ├── armv7-mingw-gcc.cmake │ │ ├── armv7-ios.cmake │ │ ├── armv7s-ios.cmake │ │ ├── arm64-linux-gcc.cmake │ │ └── armv7-linux-gcc.cmake │ │ ├── aom_experiment_deps.cmake │ │ ├── ios-Info.plist │ │ ├── exports_sources.cmake │ │ ├── sanitizers.cmake │ │ └── msvc_runtime.cmake ├── tools │ ├── inspect-post.js │ ├── gen_authors.sh │ ├── obu_parser.h │ ├── inspect-cli.js │ └── aggregate_entropy_stats.py ├── av1 │ ├── exports_ident │ ├── exports_test │ ├── exports_enc │ ├── exports_com │ ├── exports_dec │ ├── common │ │ ├── cdef_block_avx2.c │ │ ├── cdef_block_neon.c │ │ ├── cdef_block_sse2.c │ │ ├── cdef_block_sse4.c │ │ ├── cdef_block_ssse3.c │ │ ├── av1_rtcd.c │ │ ├── x86 │ │ │ └── av1_txfm_sse4.c │ │ ├── arm │ │ │ └── av1_txfm_neon.c │ │ ├── av1_inv_txfm1d_cfg.h │ │ ├── scan.h │ │ ├── idct.h │ │ └── alloccommon.h │ ├── encoder │ │ ├── av1_multi_thread.h │ │ ├── corner_detect.h │ │ ├── tpl_model.h │ │ ├── av1_fwd_txfm1d_cfg.h │ │ ├── random.h │ │ ├── dwt.h │ │ ├── picklpf.h │ │ ├── hybrid_fwd_txfm.h │ │ ├── mbgraph.h │ │ ├── pass2_strategy.h │ │ ├── extend.h │ │ ├── aq_variance.h │ │ ├── temporal_filter.h │ │ ├── var_based_part.h │ │ ├── aq_complexity.h │ │ ├── gop_structure.h │ │ ├── corner_match.h │ │ ├── segmentation.h │ │ ├── corner_detect.c │ │ ├── mips │ │ │ └── msa │ │ │ │ └── fdct4x4_msa.c │ │ ├── hash.h │ │ ├── ml.h │ │ └── encodeframe.h │ └── decoder │ │ ├── detokenize.h │ │ ├── decodemv.h │ │ ├── obu.h │ │ ├── decodetxb.h │ │ └── dthread.h ├── aom │ ├── exports_test │ ├── exports_dec │ ├── exports_enc │ └── exports_com ├── third_party │ ├── googletest │ │ ├── gtest.mk │ │ ├── README.libaom │ │ └── src │ │ │ └── googletest │ │ │ ├── CONTRIBUTORS │ │ │ └── LICENSE │ ├── libwebm │ │ ├── AUTHORS.TXT │ │ ├── README.libaom │ │ ├── Android.mk │ │ ├── mkvmuxer │ │ │ ├── mkvmuxertypes.h │ │ │ └── mkvwriter.h │ │ ├── mkvparser │ │ │ └── mkvreader.h │ │ ├── PATENTS.TXT │ │ ├── common │ │ │ └── file_util.h │ │ └── LICENSE.TXT │ ├── vector │ │ ├── README.libaom │ │ └── LICENSE │ ├── libyuv │ │ ├── README.libaom │ │ ├── include │ │ │ └── libyuv │ │ │ │ ├── version.h │ │ │ │ └── rotate_argb.h │ │ └── source │ │ │ └── compare_common.cc │ ├── fastfeat │ │ ├── fast.c │ │ ├── fast.h │ │ ├── README.libvpx │ │ └── LICENSE │ └── x86inc │ │ ├── README.libaom │ │ └── LICENSE ├── CHANGELOG ├── codereview.settings ├── usage_cx.dox ├── test │ ├── simd_avx2_test.cc │ ├── simd_cmp_avx2.cc │ ├── simd_neon_test.cc │ ├── simd_cmp_neon.cc │ ├── simd_cmp_sse2.cc │ ├── simd_sse2_test.cc │ ├── simd_ssse3_test.cc │ ├── simd_cmp_sse4.cc │ ├── simd_cmp_ssse3.cc │ ├── simd_sse4_test.cc │ ├── test_vectors.h │ ├── onyxc_int_test.cc │ ├── clear_system_state.h │ ├── examples.sh │ ├── test_runner.cmake │ ├── run_encodes.sh │ ├── i420_video_source.h │ ├── divu_small_test.cc │ └── test_data_download_worker.cmake ├── aom_dsp │ ├── aom_dsp_rtcd.c │ ├── simd │ │ └── v256_intrinsics_arm.h │ ├── aom_simd_inline.h │ ├── postproc.h │ ├── x86 │ │ ├── sum_squares_sse2.h │ │ ├── fwd_txfm_sse2.c │ │ ├── txfm_common_sse2.h │ │ ├── convolve_common_intrin.h │ │ ├── bitdepth_conversion_avx2.h │ │ ├── bitdepth_conversion_sse2.h │ │ ├── blend_a64_hmask_sse4.c │ │ ├── mem_sse2.h │ │ └── masked_sad_intrin_ssse3.h │ ├── mips │ │ ├── common_dspr2.c │ │ └── common_dspr2.h │ ├── daalaboolwriter.c │ ├── sum_squares.c │ ├── aom_simd.h │ ├── entcode.h │ ├── daalaboolreader.c │ ├── sse.c │ ├── bitreader_buffer.h │ ├── binary_codes_reader.h │ └── subtract.c ├── aom_scale │ ├── aom_scale_rtcd.c │ ├── aom_scale.h │ └── aom_scale.cmake ├── aom_ports │ ├── ppc.h │ ├── system_state.h │ ├── emms.asm │ ├── arm.h │ └── sanitizer.h ├── common │ ├── video_common.h │ ├── ivfdec.h │ ├── rawenc.h │ ├── ivfenc.h │ ├── warnings.h │ ├── y4menc.h │ ├── md5_utils.h │ └── video_writer.h ├── aom_mem │ ├── aom_mem.cmake │ └── include │ │ └── aom_mem_intrnl.h ├── aom_util │ └── aom_util.cmake ├── LICENSE ├── stats │ ├── aomstats.h │ └── rate_hist.h ├── .cmake-format.py ├── examples │ └── encoder_util.h ├── mainpage.dox ├── .mailmap └── apps │ └── aomenc.h ├── Android.mk ├── OWNERS ├── README.version ├── config ├── config │ └── aom_version.h ├── x86_64 │ └── config │ │ └── aom_config.c ├── arm │ └── config │ │ └── aom_config.c ├── arm64 │ └── config │ │ └── aom_config.c └── x86 │ └── config │ └── aom_config.c └── README.android /libaom/build/.gitignore: -------------------------------------------------------------------------------- 1 | x86*-win32-vs* 2 | -------------------------------------------------------------------------------- /libaom/tools/inspect-post.js: -------------------------------------------------------------------------------- 1 | Module["FS"] = FS; 2 | -------------------------------------------------------------------------------- /libaom/av1/exports_ident: -------------------------------------------------------------------------------- 1 | text ifd_init 2 | text ifd_inspect 3 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | #Empty Android.mk to shadow third_party/libwebm/Android.mk 2 | -------------------------------------------------------------------------------- /libaom/aom/exports_test: -------------------------------------------------------------------------------- 1 | text aom_dsp_rtcd 2 | text aom_scale_rtcd 3 | -------------------------------------------------------------------------------- /libaom/av1/exports_test: -------------------------------------------------------------------------------- 1 | text av1_get_fwd_txfm_cfg 2 | text av1_rtcd 3 | -------------------------------------------------------------------------------- /libaom/build/.gitattributes: -------------------------------------------------------------------------------- 1 | *-vs8/*.rules -crlf 2 | *-msvs/*.rules -crlf 3 | -------------------------------------------------------------------------------- /libaom/av1/exports_enc: -------------------------------------------------------------------------------- 1 | data aom_codec_av1_cx_algo 2 | text aom_codec_av1_cx 3 | -------------------------------------------------------------------------------- /libaom/av1/exports_com: -------------------------------------------------------------------------------- 1 | text aom_read_obu_header_and_size 2 | text av1_resize_frame420 3 | -------------------------------------------------------------------------------- /libaom/third_party/googletest/gtest.mk: -------------------------------------------------------------------------------- 1 | GTEST_SRCS-yes += googletest/src/googletest/src/gtest-all.cc 2 | -------------------------------------------------------------------------------- /libaom/av1/exports_dec: -------------------------------------------------------------------------------- 1 | data aom_codec_av1_dx_algo 2 | text aom_codec_av1_dx 3 | text av1_add_film_grain 4 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/AUTHORS.TXT: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | # Default code reviewers picked from top 3 or more developers. 2 | # Please update this list if you find better candidates. 3 | essick@google.com 4 | -------------------------------------------------------------------------------- /libaom/CHANGELOG: -------------------------------------------------------------------------------- 1 | 2018-06-28 v1.0.0 2 | AOMedia Codec Workgroup Approved version 1.0 3 | 4 | 2016-04-07 v0.1.0 "AOMedia Codec 1" 5 | This release is the first Alliance for Open Media codec. 6 | -------------------------------------------------------------------------------- /libaom/codereview.settings: -------------------------------------------------------------------------------- 1 | # This file is used by git cl to get repository specific information. 2 | GERRIT_HOST: True 3 | CODE_REVIEW_SERVER: aomedia-review.googlesource.com 4 | GERRIT_SQUASH_UPLOADS: False 5 | -------------------------------------------------------------------------------- /libaom/usage_cx.dox: -------------------------------------------------------------------------------- 1 | /*! \page usage_encode Encoding 2 | 3 | The aom_codec_encode() function is at the core of the encode loop. It 4 | processes raw images passed by the application, producing packets of 5 | compressed data. 6 | 7 | \ref samples 8 | 9 | */ 10 | -------------------------------------------------------------------------------- /README.version: -------------------------------------------------------------------------------- 1 | URL: https://aomedia.googlesource.com/aom/+archive/978ab9e6cd19904cdd54b69a4c30b10c747eb55a.tar.gz 2 | Version: v1.0.0 3 | Local Modifications: 4 | Remove __clang__analyzer__ preprocessor directives (ag/7285842) 5 | Cherry-pick 0a0368368 Check the conformance requirements in Sec. 6.8.1. 6 | -------------------------------------------------------------------------------- /libaom/tools/gen_authors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Add organization names manually. 4 | 5 | cat <" | sort | uniq | grep -v "corp.google\|clang-format") 10 | EOF 11 | -------------------------------------------------------------------------------- /libaom/aom/exports_dec: -------------------------------------------------------------------------------- 1 | text aom_codec_dec_init_ver 2 | text aom_codec_decode 3 | text aom_codec_get_frame 4 | text aom_codec_get_stream_info 5 | text aom_codec_peek_stream_info 6 | text aom_codec_register_put_frame_cb 7 | text aom_codec_register_put_slice_cb 8 | text aom_codec_set_frame_buffer_functions 9 | text aom_obu_type_to_string 10 | text aom_read_obu_header 11 | -------------------------------------------------------------------------------- /libaom/third_party/vector/README.libaom: -------------------------------------------------------------------------------- 1 | Name: vector 2 | URL: https://github.com/goldsborough/vector 3 | Version: commit-id: 40efe82 4 | License: MIT 5 | License File: LICENSE 6 | 7 | Description: 8 | A feature-complete, generic and customizable resizable 9 | array implementation in pure C that supports almost 10 | the entire C++ std::vector API, including iterators. 11 | 12 | Local Modifications: 13 | Renamed some functions to fit in with the AOMedia 14 | naming convention. 15 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/README.libaom: -------------------------------------------------------------------------------- 1 | URL: https://chromium.googlesource.com/webm/libwebm 2 | Version: 9f23fbc50e7a76c815b1d3f0309abe1066301331 3 | License: BSD 4 | License File: LICENSE.txt 5 | 6 | Description: 7 | libwebm is used to handle WebM container I/O. 8 | 9 | Local Changes: 10 | Only keep: 11 | - Android.mk 12 | - AUTHORS.TXT 13 | - common/ 14 | file_util.cc/h 15 | hdr_util.cc/h 16 | webmids.h 17 | - LICENSE.TXT 18 | - mkvmuxer/ 19 | - mkvparser/ 20 | - PATENTS.TXT 21 | -------------------------------------------------------------------------------- /libaom/third_party/libyuv/README.libaom: -------------------------------------------------------------------------------- 1 | Name: libyuv 2 | URL: http://code.google.com/p/libyuv/ 3 | Version: 1456 4 | License: BSD 5 | License File: LICENSE 6 | 7 | Description: 8 | libyuv is an open source project that includes YUV conversion and scaling 9 | functionality. 10 | 11 | The optimized scaler in libyuv is used in multiple resolution encoder example, 12 | which down-samples the original input video (f.g. 1280x720) a number of times 13 | in order to encode multiple resolution bit streams. 14 | 15 | Local Modifications: 16 | -------------------------------------------------------------------------------- /libaom/third_party/fastfeat/fast.c: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | #include 3 | #include "fast.h" 4 | 5 | 6 | xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners) 7 | { 8 | xy* corners; 9 | int num_corners; 10 | int* scores; 11 | xy* nonmax; 12 | 13 | corners = fast9_detect(im, xsize, ysize, stride, b, &num_corners); 14 | scores = fast9_score(im, stride, corners, num_corners, b); 15 | nonmax = nonmax_suppression(corners, scores, num_corners, ret_num_corners); 16 | 17 | free(corners); 18 | free(scores); 19 | 20 | return nonmax; 21 | } 22 | // clang-format on 23 | -------------------------------------------------------------------------------- /libaom/aom/exports_enc: -------------------------------------------------------------------------------- 1 | text aom_codec_enc_config_default 2 | text aom_codec_enc_config_set 3 | text aom_codec_enc_init_multi_ver 4 | text aom_codec_enc_init_ver 5 | text aom_codec_encode 6 | text aom_codec_get_cx_data 7 | text aom_codec_get_global_headers 8 | text aom_codec_get_preview_frame 9 | text aom_codec_set_cx_data_buf 10 | text aom_film_grain_table_append 11 | text aom_film_grain_table_free 12 | text aom_film_grain_table_write 13 | text aom_flat_block_finder_init 14 | text aom_flat_block_finder_run 15 | text aom_noise_model_init 16 | text aom_noise_model_get_grain_parameters 17 | text aom_noise_model_save_latest 18 | text aom_noise_model_update 19 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE:= libwebm 5 | LOCAL_CPPFLAGS:=-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 6 | LOCAL_CPPFLAGS+=-D__STDC_LIMIT_MACROS -std=c++11 7 | LOCAL_C_INCLUDES:= $(LOCAL_PATH) 8 | LOCAL_EXPORT_C_INCLUDES:= $(LOCAL_PATH) 9 | 10 | LOCAL_SRC_FILES:= common/file_util.cc \ 11 | common/hdr_util.cc \ 12 | mkvparser/mkvparser.cc \ 13 | mkvparser/mkvreader.cc \ 14 | mkvmuxer/mkvmuxer.cc \ 15 | mkvmuxer/mkvmuxerutil.cc \ 16 | mkvmuxer/mkvwriter.cc 17 | include $(BUILD_STATIC_LIBRARY) 18 | -------------------------------------------------------------------------------- /libaom/third_party/fastfeat/fast.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | #ifndef FAST_H 3 | #define FAST_H 4 | 5 | typedef struct { int x, y; } xy; 6 | typedef unsigned char byte; 7 | 8 | int fast9_corner_score(const byte* p, const int pixel[], int bstart); 9 | 10 | xy* fast9_detect(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); 11 | 12 | int* fast9_score(const byte* i, int stride, xy* corners, int num_corners, int b); 13 | 14 | xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners); 15 | 16 | xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax); 17 | 18 | 19 | #endif 20 | // clang-format on 21 | -------------------------------------------------------------------------------- /libaom/av1/common/cdef_block_avx2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "aom_dsp/aom_simd.h" 13 | #define SIMD_FUNC(name) name##_avx2 14 | #include "av1/common/cdef_block_simd.h" 15 | -------------------------------------------------------------------------------- /libaom/av1/common/cdef_block_neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "aom_dsp/aom_simd.h" 13 | #define SIMD_FUNC(name) name##_neon 14 | #include "av1/common/cdef_block_simd.h" 15 | -------------------------------------------------------------------------------- /libaom/av1/common/cdef_block_sse2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "aom_dsp/aom_simd.h" 13 | #define SIMD_FUNC(name) name##_sse2 14 | #include "av1/common/cdef_block_simd.h" 15 | -------------------------------------------------------------------------------- /libaom/av1/common/cdef_block_sse4.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "aom_dsp/aom_simd.h" 13 | #define SIMD_FUNC(name) name##_sse4_1 14 | #include "av1/common/cdef_block_simd.h" 15 | -------------------------------------------------------------------------------- /libaom/av1/common/cdef_block_ssse3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "aom_dsp/aom_simd.h" 13 | #define SIMD_FUNC(name) name##_ssse3 14 | #include "av1/common/cdef_block_simd.h" 15 | -------------------------------------------------------------------------------- /libaom/test/simd_avx2_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #define ARCH AVX2 13 | #define ARCH_POSTFIX(name) name##_avx2 14 | #define SIMD_NAMESPACE simd_test_avx2 15 | #include "test/simd_impl.h" 16 | -------------------------------------------------------------------------------- /libaom/test/simd_cmp_avx2.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #define ARCH AVX2 13 | #define ARCH_POSTFIX(name) name##_avx2 14 | #define SIMD_NAMESPACE simd_test_avx2 15 | #include "test/simd_cmp_impl.h" 16 | -------------------------------------------------------------------------------- /libaom/build/cmake/aom_config.c.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "aom/aom_codec.h" 12 | static const char* const cfg = "${AOM_CMAKE_CONFIG}"; 13 | const char *aom_codec_build_config(void) {return cfg;} 14 | -------------------------------------------------------------------------------- /libaom/aom_dsp/aom_dsp_rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "config/aom_config.h" 12 | 13 | #define RTCD_C 14 | #include "config/aom_dsp_rtcd.h" 15 | 16 | #include "aom_ports/aom_once.h" 17 | 18 | void aom_dsp_rtcd() { aom_once(setup_rtcd_internal); } 19 | -------------------------------------------------------------------------------- /libaom/test/simd_neon_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #if defined(__OPTIMIZE__) && __OPTIMIZE__ 13 | #define ARCH NEON 14 | #define ARCH_POSTFIX(name) name##_neon 15 | #define SIMD_NAMESPACE simd_test_neon 16 | #include "test/simd_impl.h" 17 | #endif 18 | -------------------------------------------------------------------------------- /libaom/test/simd_cmp_neon.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #if defined(__OPTIMIZE__) && __OPTIMIZE__ 13 | #define ARCH NEON 14 | #define ARCH_POSTFIX(name) name##_neon 15 | #define SIMD_NAMESPACE simd_test_neon 16 | #include "test/simd_cmp_impl.h" 17 | #endif 18 | -------------------------------------------------------------------------------- /libaom/third_party/libyuv/include/libyuv/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT 13 | #define INCLUDE_LIBYUV_VERSION_H_ 14 | 15 | #define LIBYUV_VERSION 1456 16 | 17 | #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT 18 | -------------------------------------------------------------------------------- /libaom/aom_scale/aom_scale_rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "config/aom_config.h" 12 | 13 | #define RTCD_C 14 | #include "config/aom_scale_rtcd.h" 15 | 16 | #include "aom_ports/aom_once.h" 17 | 18 | void aom_scale_rtcd() { aom_once(setup_rtcd_internal); } 19 | -------------------------------------------------------------------------------- /libaom/aom_dsp/simd/v256_intrinsics_arm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_SIMD_V256_INTRINSICS_ARM_H_ 13 | #define AOM_AOM_DSP_SIMD_V256_INTRINSICS_ARM_H_ 14 | 15 | #include "aom_dsp/simd/v256_intrinsics_v128.h" 16 | 17 | #endif // AOM_AOM_DSP_SIMD_V256_INTRINSICS_ARM_H_ 18 | -------------------------------------------------------------------------------- /libaom/test/simd_cmp_sse2.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #if (defined(__OPTIMIZE__) && __OPTIMIZE__) || \ 13 | (!defined(__GNUC__) && !defined(_DEBUG)) 14 | #define ARCH SSE2 15 | #define ARCH_POSTFIX(name) name##_sse2 16 | #define SIMD_NAMESPACE simd_test_sse2 17 | #include "test/simd_cmp_impl.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /libaom/test/simd_sse2_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #if (defined(__OPTIMIZE__) && __OPTIMIZE__) || \ 13 | (!defined(__GNUC__) && !defined(_DEBUG)) 14 | #define ARCH SSE2 15 | #define ARCH_POSTFIX(name) name##_sse2 16 | #define SIMD_NAMESPACE simd_test_sse2 17 | #include "test/simd_impl.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /libaom/test/simd_ssse3_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #if (defined(__OPTIMIZE__) && __OPTIMIZE__) || \ 13 | (!defined(__GNUC__) && !defined(_DEBUG)) 14 | #define ARCH SSSE3 15 | #define ARCH_POSTFIX(name) name##_ssse3 16 | #define SIMD_NAMESPACE simd_test_ssse3 17 | #include "test/simd_impl.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /libaom/test/simd_cmp_sse4.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #if (defined(__OPTIMIZE__) && __OPTIMIZE__) || \ 13 | (!defined(__GNUC__) && !defined(_DEBUG)) 14 | #define ARCH SSE4_1 15 | #define ARCH_POSTFIX(name) name##_sse4_1 16 | #define SIMD_NAMESPACE simd_test_sse4_1 17 | #include "test/simd_cmp_impl.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /libaom/test/simd_cmp_ssse3.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #if (defined(__OPTIMIZE__) && __OPTIMIZE__) || \ 13 | (!defined(__GNUC__) && !defined(_DEBUG)) 14 | #define ARCH SSSE3 15 | #define ARCH_POSTFIX(name) name##_ssse3 16 | #define SIMD_NAMESPACE simd_test_ssse3 17 | #include "test/simd_cmp_impl.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /libaom/test/simd_sse4_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #if (defined(__OPTIMIZE__) && __OPTIMIZE__) || \ 13 | (!defined(__GNUC__) && !defined(_DEBUG)) 14 | #define ARCH SSE4_1 15 | #define ARCH_POSTFIX(name) name##_sse4_1 16 | #define SIMD_NAMESPACE simd_test_sse4_1 17 | #include "test/simd_impl.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /libaom/aom_dsp/aom_simd_inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_AOM_SIMD_INLINE_H_ 13 | #define AOM_AOM_DSP_AOM_SIMD_INLINE_H_ 14 | 15 | #include "aom/aom_integer.h" 16 | 17 | #ifndef SIMD_INLINE 18 | #define SIMD_INLINE static AOM_FORCE_INLINE 19 | #endif 20 | 21 | #endif // AOM_AOM_DSP_AOM_SIMD_INLINE_H_ 22 | -------------------------------------------------------------------------------- /config/config/aom_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #define VERSION_MAJOR 1 13 | #define VERSION_MINOR 0 14 | #define VERSION_PATCH 0 15 | #define VERSION_EXTRA "" 16 | #define VERSION_PACKED \ 17 | ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH)) 18 | #define VERSION_STRING_NOSP "v1.0.0" 19 | #define VERSION_STRING " v1.0.0" 20 | -------------------------------------------------------------------------------- /libaom/av1/encoder/av1_multi_thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AV1_ENCODER_AV1_MULTI_THREAD_H 13 | #define AV1_ENCODER_AV1_MULTI_THREAD_H 14 | 15 | #include "av1/encoder/encoder.h" 16 | 17 | void av1_row_mt_mem_alloc(AV1_COMP *cpi, int max_sb_rows); 18 | 19 | void av1_row_mt_mem_dealloc(AV1_COMP *cpi); 20 | 21 | #endif // AV1_ENCODER_AV1_MULTI_THREAD_H 22 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/x86-macos.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | set(CMAKE_SYSTEM_PROCESSOR "x86") 12 | set(CMAKE_SYSTEM_NAME "Darwin") 13 | set(CMAKE_OSX_ARCHITECTURES "i386") 14 | set(CMAKE_C_COMPILER_ARG1 "-arch i386") 15 | set(CMAKE_CXX_COMPILER_ARG1 "-arch i386") 16 | 17 | # Apple tools always complain in 32 bit mode without PIC. 18 | set(CONFIG_PIC 1 CACHE NUMBER "") 19 | -------------------------------------------------------------------------------- /libaom/third_party/googletest/README.libaom: -------------------------------------------------------------------------------- 1 | URL: https://github.com/google/googletest 2 | Version: 1.8.0 3 | License: BSD 4 | License File: LICENSE 5 | 6 | Description: 7 | Google's framework for writing C++ tests on a variety of platforms 8 | (Linux, Mac OS X, Windows, Windows CE, Symbian, etc). Based on the 9 | xUnit architecture. Supports automatic test discovery, a rich set of 10 | assertions, user-defined assertions, death tests, fatal and non-fatal 11 | failures, various options for running the tests, and XML test report 12 | generation. 13 | 14 | Local Modifications: 15 | - Remove everything but: 16 | googletest-release-1.8.0/googletest/ 17 | cmake/ 18 | include/ 19 | src/ 20 | CHANGES 21 | CMakelists.txt 22 | CONTRIBUTORS 23 | LICENSE 24 | README.md 25 | - Suppress unsigned overflow instrumentation in the LCG 26 | https://github.com/google/googletest/pull/1066 27 | -------------------------------------------------------------------------------- /libaom/third_party/x86inc/README.libaom: -------------------------------------------------------------------------------- 1 | URL: https://git.videolan.org/git/x264.git 2 | Version: d23d18655249944c1ca894b451e2c82c7a584c62 3 | License: ISC 4 | License File: LICENSE 5 | 6 | Description: 7 | x264/libav's framework for x86 assembly. Contains a variety of macros and 8 | defines that help automatically allow assembly to work cross-platform. 9 | 10 | Local Modifications: 11 | Get configuration from aom_config.asm. 12 | Prefix functions with aom by default. 13 | Manage name mangling (prefixing with '_') manually because 'PREFIX' does not 14 | exist in libaom. 15 | Expand PIC default to macho64 and respect CONFIG_PIC from libaom 16 | Set 'private_extern' visibility for macho targets. 17 | Copy PIC 'GLOBAL' macros from x86_abi_support.asm 18 | Use .text instead of .rodata on macho to avoid broken tables in PIC mode. 19 | Use .text with no alignment for aout 20 | Only use 'hidden' visibility with Chromium 21 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/x86-linux.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_LINUX_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_LINUX_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_LINUX_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_PROCESSOR "x86") 17 | set(CMAKE_SYSTEM_NAME "Linux") 18 | set(CMAKE_C_COMPILER_ARG1 "-m32") 19 | set(CMAKE_CXX_COMPILER_ARG1 "-m32") 20 | -------------------------------------------------------------------------------- /libaom/av1/common/av1_rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "config/aom_config.h" 12 | 13 | #define RTCD_C 14 | #include "config/av1_rtcd.h" 15 | 16 | #include "aom_ports/aom_once.h" 17 | 18 | void av1_rtcd() { 19 | // TODO(JBB): Remove this aom_once, by insuring that both the encoder and 20 | // decoder setup functions are protected by aom_once(); 21 | aom_once(setup_rtcd_internal); 22 | } 23 | -------------------------------------------------------------------------------- /libaom/aom_ports/ppc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_PORTS_PPC_H_ 13 | #define AOM_AOM_PORTS_PPC_H_ 14 | #include 15 | 16 | #include "config/aom_config.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #define HAS_VSX 0x01 23 | 24 | int ppc_simd_caps(void); 25 | 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | 30 | #endif // AOM_AOM_PORTS_PPC_H_ 31 | -------------------------------------------------------------------------------- /libaom/aom/exports_com: -------------------------------------------------------------------------------- 1 | text aom_codec_build_config 2 | text aom_codec_control_ 3 | text aom_codec_destroy 4 | text aom_codec_err_to_string 5 | text aom_codec_error 6 | text aom_codec_error_detail 7 | text aom_codec_get_caps 8 | text aom_codec_iface_name 9 | text aom_codec_version 10 | text aom_codec_version_extra_str 11 | text aom_codec_version_str 12 | text aom_free 13 | text aom_img_alloc 14 | text aom_img_alloc_with_border 15 | text aom_img_flip 16 | text aom_img_free 17 | text aom_img_plane_height 18 | text aom_img_plane_width 19 | text aom_img_set_rect 20 | text aom_img_wrap 21 | text aom_malloc 22 | text aom_rb_bytes_read 23 | text aom_rb_read_bit 24 | text aom_rb_read_literal 25 | text aom_rb_read_uvlc 26 | text aom_uleb_decode 27 | text aom_uleb_encode 28 | text aom_uleb_encode_fixed_size 29 | text aom_uleb_size_in_bytes 30 | text aom_wb_bytes_written 31 | text aom_wb_write_bit 32 | text aom_wb_write_literal 33 | text aom_wb_write_unsigned_literal 34 | -------------------------------------------------------------------------------- /libaom/av1/common/x86/av1_txfm_sse4.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "config/av1_rtcd.h" 13 | 14 | #include "av1/common/av1_txfm.h" 15 | #include "av1/common/x86/av1_txfm_sse4.h" 16 | 17 | void av1_round_shift_array_sse4_1(int32_t *arr, int size, int bit) { 18 | __m128i *const vec = (__m128i *)arr; 19 | const int vec_size = size >> 2; 20 | av1_round_shift_array_32_sse4_1(vec, vec, vec_size, bit); 21 | } 22 | -------------------------------------------------------------------------------- /libaom/common/video_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_COMMON_VIDEO_COMMON_H_ 13 | #define AOM_COMMON_VIDEO_COMMON_H_ 14 | 15 | #include "common/tools_common.h" 16 | 17 | typedef struct { 18 | uint32_t codec_fourcc; 19 | int frame_width; 20 | int frame_height; 21 | struct AvxRational time_base; 22 | unsigned int is_annexb; 23 | } AvxVideoInfo; 24 | 25 | #endif // AOM_COMMON_VIDEO_COMMON_H_ 26 | -------------------------------------------------------------------------------- /libaom/aom_dsp/postproc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_POSTPROC_H_ 13 | #define AOM_AOM_DSP_POSTPROC_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | // Fills a noise buffer with gaussian noise strength determined by sigma. 20 | int aom_setup_noise(double sigma, int size, char *noise); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif // AOM_AOM_DSP_POSTPROC_H_ 27 | -------------------------------------------------------------------------------- /libaom/test/test_vectors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_TEST_TEST_VECTORS_H_ 13 | #define AOM_TEST_TEST_VECTORS_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | namespace libaom_test { 18 | 19 | #if CONFIG_AV1_DECODER 20 | extern const int kNumAV1TestVectors; 21 | extern const char *const kAV1TestVectors[]; 22 | #endif 23 | 24 | } // namespace libaom_test 25 | 26 | #endif // AOM_TEST_TEST_VECTORS_H_ 27 | -------------------------------------------------------------------------------- /libaom/av1/encoder/corner_detect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_CORNER_DETECT_H_ 13 | #define AOM_AV1_ENCODER_CORNER_DETECT_H_ 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | int fast_corner_detect(unsigned char *buf, int width, int height, int stride, 20 | int *points, int max_points); 21 | 22 | #endif // AOM_AV1_ENCODER_CORNER_DETECT_H_ 23 | -------------------------------------------------------------------------------- /libaom/av1/encoder/tpl_model.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_TPL_MODEL_H_ 13 | #define AOM_AV1_ENCODER_TPL_MODEL_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | void av1_tpl_setup_stats(AV1_COMP *cpi, 20 | const EncodeFrameInput *const frame_input); 21 | 22 | #ifdef __cplusplus 23 | } // extern "C" 24 | #endif 25 | 26 | #endif // AOM_AV1_ENCODER_TPL_MODEL_H_ 27 | -------------------------------------------------------------------------------- /libaom/aom_ports/system_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_PORTS_SYSTEM_STATE_H_ 13 | #define AOM_AOM_PORTS_SYSTEM_STATE_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #if ARCH_X86 || ARCH_X86_64 18 | void aom_reset_mmx_state(void); 19 | #define aom_clear_system_state() aom_reset_mmx_state() 20 | #else 21 | #define aom_clear_system_state() 22 | #endif // ARCH_X86 || ARCH_X86_64 23 | #endif // AOM_AOM_PORTS_SYSTEM_STATE_H_ 24 | -------------------------------------------------------------------------------- /libaom/av1/encoder/av1_fwd_txfm1d_cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_AV1_FWD_TXFM1D_CFG_H_ 13 | #define AOM_AV1_ENCODER_AV1_FWD_TXFM1D_CFG_H_ 14 | #include "av1/common/enums.h" 15 | #include "av1/encoder/av1_fwd_txfm1d.h" 16 | extern const int8_t *fwd_txfm_shift_ls[TX_SIZES_ALL]; 17 | extern const int8_t fwd_cos_bit_col[5][5]; 18 | extern const int8_t fwd_cos_bit_row[5][5]; 19 | #endif // AOM_AV1_ENCODER_AV1_FWD_TXFM1D_CFG_H_ 20 | -------------------------------------------------------------------------------- /config/x86_64/config/aom_config.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "aom/aom_codec.h" 12 | static const char* const cfg = "cmake ../libaom -G \"Unix Makefiles\" -DAOM_TARGET_CPU=x86_64 -DCONFIG_AV1_ENCODER=0 -DCONFIG_RUNTIME_CPU_DETECT=0 -DCONFIG_LOWBITDEPTH=1 -DCONFIG_MAX_DECODE_PROFILE=0 -DCONFIG_NORMAL_TILE_MODE=1 -DCONFIG_SIZE_LIMIT=1 -DDECODE_HEIGHT_LIMIT=16384 -DDECODE_WIDTH_LIMIT=16384 -DENABLE_SSE4_1=0"; 13 | const char *aom_codec_build_config(void) {return cfg;} 14 | -------------------------------------------------------------------------------- /libaom/test/onyxc_int_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" 13 | 14 | #include "av1/common/onyxc_int.h" 15 | 16 | TEST(OnyxcInt, TestGetTxSize) { 17 | for (int t = TX_4X4; t < TX_SIZES_ALL; t++) { 18 | TX_SIZE t2 = get_tx_size(tx_size_wide[t], tx_size_high[t]); 19 | GTEST_ASSERT_EQ(tx_size_wide[t], tx_size_wide[t2]); 20 | GTEST_ASSERT_EQ(tx_size_high[t], tx_size_high[t2]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /config/arm/config/aom_config.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "aom/aom_codec.h" 12 | static const char* const cfg = "cmake ../libaom -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=\"../libaom/build/cmake/toolchains/armv7-linux-gcc.cmake\" -DCONFIG_AV1_ENCODER=0 -DCONFIG_LOWBITDEPTH=1 -DCONFIG_MAX_DECODE_PROFILE=0 -DCONFIG_NORMAL_TILE_MODE=1 -DCONFIG_SIZE_LIMIT=1 -DDECODE_HEIGHT_LIMIT=16384 -DDECODE_WIDTH_LIMIT=16384 -DENABLE_SSE4_1=0"; 13 | const char *aom_codec_build_config(void) {return cfg;} 14 | -------------------------------------------------------------------------------- /config/arm64/config/aom_config.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "aom/aom_codec.h" 12 | static const char* const cfg = "cmake ../libaom -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=\"../libaom/build/cmake/toolchains/arm64-linux-gcc.cmake\" -DCONFIG_AV1_ENCODER=0 -DCONFIG_LOWBITDEPTH=1 -DCONFIG_MAX_DECODE_PROFILE=0 -DCONFIG_NORMAL_TILE_MODE=1 -DCONFIG_SIZE_LIMIT=1 -DDECODE_HEIGHT_LIMIT=16384 -DDECODE_WIDTH_LIMIT=16384 -DENABLE_SSE4_1=0"; 13 | const char *aom_codec_build_config(void) {return cfg;} 14 | -------------------------------------------------------------------------------- /libaom/third_party/x86inc/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2005-2012 x264 project 2 | 3 | Authors: Loren Merritt 4 | Anton Mitrofanov 5 | Jason Garrett-Glaser 6 | Henrik Gramner 7 | 8 | Permission to use, copy, modify, and/or distribute this software for any 9 | purpose with or without fee is hereby granted, provided that the above 10 | copyright notice and this permission notice appear in all copies. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | -------------------------------------------------------------------------------- /libaom/av1/decoder/detokenize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_DETOKENIZE_H_ 13 | #define AOM_AV1_DECODER_DETOKENIZE_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include "av1/common/scan.h" 18 | #include "av1/decoder/decoder.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, aom_reader *r); 25 | 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | #endif // AOM_AV1_DECODER_DETOKENIZE_H_ 30 | -------------------------------------------------------------------------------- /config/x86/config/aom_config.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "aom/aom_codec.h" 12 | static const char* const cfg = "cmake ../libaom -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=\"../libaom/build/cmake/toolchains/x86-linux.cmake\" -DCONFIG_AV1_ENCODER=0 -DCONFIG_PIC=1 -DCONFIG_RUNTIME_CPU_DETECT=0 -DCONFIG_LOWBITDEPTH=1 -DCONFIG_MAX_DECODE_PROFILE=0 -DCONFIG_NORMAL_TILE_MODE=1 -DCONFIG_SIZE_LIMIT=1 -DDECODE_HEIGHT_LIMIT=16384 -DDECODE_WIDTH_LIMIT=16384 -DENABLE_SSE4_1=0"; 13 | const char *aom_codec_build_config(void) {return cfg;} 14 | -------------------------------------------------------------------------------- /libaom/av1/encoder/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_RANDOM_H_ 13 | #define AOM_AV1_ENCODER_RANDOM_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | // Generate a random number in the range [0, 32768). 20 | static INLINE unsigned int lcg_rand16(unsigned int *state) { 21 | *state = (unsigned int)(*state * 1103515245ULL + 12345); 22 | return *state / 65536 % 32768; 23 | } 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // AOM_AV1_ENCODER_RANDOM_H_ 30 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/arm64-ios.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_IOS_CMAKE_ 1) 15 | 16 | if(XCODE) # TODO(tomfinegan): Handle arm builds in Xcode. 17 | message(FATAL_ERROR "This toolchain does not support Xcode.") 18 | endif() 19 | 20 | set(CMAKE_SYSTEM_PROCESSOR "arm64") 21 | set(CMAKE_OSX_ARCHITECTURES "arm64") 22 | 23 | include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake") 24 | -------------------------------------------------------------------------------- /libaom/av1/encoder/dwt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_DWT_H_ 13 | #define AOM_AV1_ENCODER_DWT_H_ 14 | 15 | #include "av1/common/common.h" 16 | #include "av1/common/enums.h" 17 | 18 | #define DWT_MAX_LENGTH 64 19 | 20 | void av1_fdwt8x8(tran_low_t *input, tran_low_t *output, int stride); 21 | void av1_fdwt8x8_uint8_input_c(uint8_t *input, tran_low_t *output, int stride, 22 | int hbd); 23 | int av1_haar_ac_sad_8x8_uint8_input(uint8_t *input, int stride, int hbd); 24 | 25 | #endif // AOM_AV1_ENCODER_DWT_H_ 26 | -------------------------------------------------------------------------------- /libaom/common/ivfdec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_COMMON_IVFDEC_H_ 12 | #define AOM_COMMON_IVFDEC_H_ 13 | 14 | #include "common/tools_common.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | int file_is_ivf(struct AvxInputContext *input); 21 | 22 | typedef int64_t aom_codec_pts_t; 23 | int ivf_read_frame(FILE *infile, uint8_t **buffer, size_t *bytes_read, 24 | size_t *buffer_size, aom_codec_pts_t *pts); 25 | 26 | #ifdef __cplusplus 27 | } /* extern "C" */ 28 | #endif 29 | 30 | #endif // AOM_COMMON_IVFDEC_H_ 31 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/sum_squares_sse2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_DSP_X86_SUM_SQUARES_SSE2_H_ 13 | #define AOM_DSP_X86_SUM_SQUARES_SSE2_H_ 14 | 15 | uint64_t aom_sum_squares_2d_i16_nxn_sse2(const int16_t *src, int stride, 16 | int width, int height); 17 | 18 | uint64_t aom_sum_squares_2d_i16_4xn_sse2(const int16_t *src, int stride, 19 | int height); 20 | uint64_t aom_sum_squares_2d_i16_4x4_sse2(const int16_t *src, int stride); 21 | 22 | #endif // AOM_DSP_X86_SUM_SQUARES_SSE2_H_ 23 | -------------------------------------------------------------------------------- /libaom/aom_dsp/mips/common_dspr2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "aom_dsp/mips/common_dspr2.h" 13 | 14 | #if HAVE_DSPR2 15 | uint8_t aom_ff_cropTbl_a[256 + 2 * CROP_WIDTH]; 16 | uint8_t *aom_ff_cropTbl; 17 | 18 | void aom_dsputil_static_init(void) { 19 | int i; 20 | 21 | for (i = 0; i < 256; i++) aom_ff_cropTbl_a[i + CROP_WIDTH] = i; 22 | 23 | for (i = 0; i < CROP_WIDTH; i++) { 24 | aom_ff_cropTbl_a[i] = 0; 25 | aom_ff_cropTbl_a[i + CROP_WIDTH + 256] = 255; 26 | } 27 | 28 | aom_ff_cropTbl = &aom_ff_cropTbl_a[CROP_WIDTH]; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libaom/av1/encoder/picklpf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_PICKLPF_H_ 13 | #define AOM_AV1_ENCODER_PICKLPF_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #include "av1/encoder/encoder.h" 20 | 21 | struct yv12_buffer_config; 22 | struct AV1_COMP; 23 | int av1_get_max_filter_level(const AV1_COMP *cpi); 24 | void av1_pick_filter_level(const struct yv12_buffer_config *sd, 25 | struct AV1_COMP *cpi, LPF_PICK_METHOD method); 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | 30 | #endif // AOM_AV1_ENCODER_PICKLPF_H_ 31 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/x86_64-ios-simulator.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_IOS_SIMULATOR_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_IOS_SIMULATOR_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_IOS_SIMULATOR_CMAKE_ 1) 15 | 16 | if(XCODE) 17 | 18 | # TODO(tomfinegan): Handle ios sim builds in Xcode. 19 | message(FATAL_ERROR "This toolchain does not support Xcode.") 20 | endif() 21 | 22 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 23 | set(CMAKE_OSX_ARCHITECTURES "x86_64") 24 | 25 | include("${CMAKE_CURRENT_LIST_DIR}/ios-simulator-common.cmake") 26 | -------------------------------------------------------------------------------- /libaom/test/clear_system_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_TEST_CLEAR_SYSTEM_STATE_H_ 12 | #define AOM_TEST_CLEAR_SYSTEM_STATE_H_ 13 | 14 | #include "config/aom_config.h" 15 | 16 | #if ARCH_X86 || ARCH_X86_64 17 | #include "aom_ports/x86.h" 18 | #endif 19 | 20 | namespace libaom_test { 21 | 22 | // Reset system to a known state. This function should be used for all non-API 23 | // test cases. 24 | inline void ClearSystemState() { 25 | #if ARCH_X86 || ARCH_X86_64 26 | aom_reset_mmx_state(); 27 | #endif 28 | } 29 | 30 | } // namespace libaom_test 31 | #endif // AOM_TEST_CLEAR_SYSTEM_STATE_H_ 32 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/fwd_txfm_sse2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include // SSE2 13 | 14 | #include "config/aom_config.h" 15 | #include "config/aom_dsp_rtcd.h" 16 | 17 | #include "aom_dsp/aom_dsp_common.h" 18 | #include "aom_dsp/x86/fwd_txfm_sse2.h" 19 | 20 | #define DCT_HIGH_BIT_DEPTH 0 21 | #define FDCT8x8_2D aom_fdct8x8_sse2 22 | #include "aom_dsp/x86/fwd_txfm_impl_sse2.h" 23 | #undef FDCT8x8_2D 24 | 25 | #undef DCT_HIGH_BIT_DEPTH 26 | #define DCT_HIGH_BIT_DEPTH 1 27 | #define FDCT8x8_2D aom_highbd_fdct8x8_sse2 28 | #include "aom_dsp/x86/fwd_txfm_impl_sse2.h" // NOLINT 29 | #undef FDCT8x8_2D 30 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/ios-simulator-common.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_IOS_SIMULATOR_COMMON_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_IOS_SIMULATOR_COMMON_CMAKE_ 14 | set(AOM_BUILD_CMAKE_IOS_SIMULATOR_COMMON_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_NAME "Darwin") 17 | set(CMAKE_OSX_SYSROOT iphonesimulator) 18 | set(CMAKE_C_COMPILER clang) 19 | set(CMAKE_C_COMPILER_ARG1 "-arch ${CMAKE_SYSTEM_PROCESSOR}") 20 | set(CMAKE_CXX_COMPILER clang++) 21 | set(CMAKE_CXX_COMPILER_ARG1 "-arch ${CMAKE_SYSTEM_PROCESSOR}") 22 | 23 | # TODO(tomfinegan): Handle bit code embedding. 24 | -------------------------------------------------------------------------------- /libaom/tools/obu_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_TOOLS_OBU_PARSER_H_ 13 | #define AOM_TOOLS_OBU_PARSER_H_ 14 | 15 | #include 16 | 17 | namespace aom_tools { 18 | 19 | // Print information obtained from OBU(s) in data until data is exhausted or an 20 | // error occurs. Returns true when all data is consumed successfully, and 21 | // optionally reports OBU storage overhead via obu_overhead_bytes when the 22 | // pointer is non-null. 23 | bool DumpObu(const uint8_t *data, int length, int *obu_overhead_bytes); 24 | 25 | } // namespace aom_tools 26 | 27 | #endif // AOM_TOOLS_OBU_PARSER_H_ 28 | -------------------------------------------------------------------------------- /libaom/aom_scale/aom_scale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_SCALE_AOM_SCALE_H_ 13 | #define AOM_AOM_SCALE_AOM_SCALE_H_ 14 | 15 | #include "aom_scale/yv12config.h" 16 | 17 | extern void aom_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, 18 | unsigned char *temp_area, unsigned char temp_height, 19 | unsigned int hscale, unsigned int hratio, 20 | unsigned int vscale, unsigned int vratio, 21 | unsigned int interlaced, const int num_planes); 22 | 23 | #endif // AOM_AOM_SCALE_AOM_SCALE_H_ 24 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/x86_64-mingw-gcc.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_MINGW_GCC_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_MINGW_GCC_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_64_MINGW_GCC_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 17 | set(CMAKE_SYSTEM_NAME "Windows") 18 | 19 | if("${CROSS}" STREQUAL "") 20 | set(CROSS x86_64-w64-mingw32-) 21 | endif() 22 | 23 | set(CMAKE_C_COMPILER ${CROSS}gcc) 24 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 25 | set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) 26 | set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) 27 | -------------------------------------------------------------------------------- /libaom/third_party/vector/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Peter Goldsborough 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /libaom/build/cmake/aom_experiment_deps.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_AOM_EXPERIMENT_DEPS_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_AOM_EXPERIMENT_DEPS_CMAKE_ 14 | set(AOM_BUILD_CMAKE_AOM_EXPERIMENT_DEPS_CMAKE_ 1) 15 | 16 | # Adjusts CONFIG_* CMake variables to address conflicts between active AV1 17 | # experiments. 18 | macro(fix_experiment_configs) 19 | 20 | if(CONFIG_ANALYZER) 21 | change_config_and_warn(CONFIG_INSPECTION 1 CONFIG_ANALYZER) 22 | endif() 23 | 24 | if(CONFIG_DIST_8X8 AND CONFIG_MULTITHREAD) 25 | change_config_and_warn(CONFIG_DIST_8X8 0 CONFIG_MULTITHREAD) 26 | endif() 27 | 28 | endmacro() 29 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/mkvmuxer/mkvmuxertypes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The WebM project authors. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | 9 | #ifndef MKVMUXER_MKVMUXERTYPES_H_ 10 | #define MKVMUXER_MKVMUXERTYPES_H_ 11 | 12 | namespace mkvmuxer { 13 | typedef unsigned char uint8; 14 | typedef short int16; 15 | typedef int int32; 16 | typedef unsigned int uint32; 17 | typedef long long int64; 18 | typedef unsigned long long uint64; 19 | } // namespace mkvmuxer 20 | 21 | // Copied from Chromium basictypes.h 22 | // A macro to disallow the copy constructor and operator= functions 23 | // This should be used in the private: declarations for a class 24 | #define LIBWEBM_DISALLOW_COPY_AND_ASSIGN(TypeName) \ 25 | TypeName(const TypeName&); \ 26 | void operator=(const TypeName&) 27 | 28 | #endif // MKVMUXER_MKVMUXERTYPES_HPP_ 29 | -------------------------------------------------------------------------------- /libaom/aom_ports/emms.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | ; 4 | ; This source code is subject to the terms of the BSD 2 Clause License and 5 | ; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | ; was not distributed with this source code in the LICENSE file, you can 7 | ; obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | ; Media Patent License 1.0 was not distributed with this source code in the 9 | ; PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | ; 11 | 12 | ; 13 | 14 | 15 | %include "aom_ports/x86_abi_support.asm" 16 | 17 | section .text 18 | global sym(aom_reset_mmx_state) PRIVATE 19 | sym(aom_reset_mmx_state): 20 | emms 21 | ret 22 | 23 | 24 | %if LIBAOM_YASM_WIN64 25 | global sym(aom_winx64_fldcw) PRIVATE 26 | sym(aom_winx64_fldcw): 27 | sub rsp, 8 28 | mov [rsp], rcx ; win x64 specific 29 | fldcw [rsp] 30 | add rsp, 8 31 | ret 32 | 33 | 34 | global sym(aom_winx64_fstcw) PRIVATE 35 | sym(aom_winx64_fstcw): 36 | sub rsp, 8 37 | fstcw [rsp] 38 | mov rax, [rsp] 39 | add rsp, 8 40 | ret 41 | %endif 42 | -------------------------------------------------------------------------------- /libaom/av1/common/arm/av1_txfm_neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 4 | * 5 | * This source code is subject to the terms of the BSD 2 Clause License and 6 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 7 | * was not distributed with this source code in the LICENSE file, you can 8 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 9 | * Media Patent License 1.0 was not distributed with this source code in the 10 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 11 | */ 12 | #include 13 | #include 14 | 15 | #include "config/av1_rtcd.h" 16 | 17 | #include "aom_ports/mem.h" 18 | #include "av1/common/arm/mem_neon.h" 19 | 20 | void av1_round_shift_array_neon(int32_t *arr, int size, int bit) { 21 | assert(!(size % 4)); 22 | if (!bit) return; 23 | const int32x4_t dup_bits_n_32x4 = vdupq_n_s32((int32_t)(-bit)); 24 | for (int i = 0; i < size; i += 4) { 25 | int32x4_t tmp_q_s32 = vld1q_s32(arr); 26 | tmp_q_s32 = vrshlq_s32(tmp_q_s32, dup_bits_n_32x4); 27 | vst1q_s32(arr, tmp_q_s32); 28 | arr += 4; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /libaom/av1/encoder/hybrid_fwd_txfm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_HYBRID_FWD_TXFM_H_ 13 | #define AOM_AV1_ENCODER_HYBRID_FWD_TXFM_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, 22 | TxfmParam *txfm_param); 23 | 24 | void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, 25 | int diff_stride, TxfmParam *txfm_param); 26 | 27 | #ifdef __cplusplus 28 | } // extern "C" 29 | #endif 30 | 31 | #endif // AOM_AV1_ENCODER_HYBRID_FWD_TXFM_H_ 32 | -------------------------------------------------------------------------------- /libaom/build/cmake/ios-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | AOM 9 | CFBundleIdentifier 10 | org.webmproject.AOM 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | AOM 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | ${VERSION} 19 | CFBundleSignature 20 | ???? 21 | CFBundleSupportedPlatforms 22 | 23 | iPhoneOS 24 | 25 | CFBundleVersion 26 | ${VERSION} 27 | MinimumOSVersion 28 | ${IOS_VERSION_MIN} 29 | UIDeviceFamily 30 | 31 | 1 32 | 2 33 | 34 | AOMFullVersion 35 | ${FULLVERSION} 36 | 37 | 38 | -------------------------------------------------------------------------------- /libaom/aom_dsp/daalaboolwriter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | #include "aom_dsp/daalaboolwriter.h" 14 | 15 | void aom_daala_start_encode(daala_writer *br, uint8_t *source) { 16 | br->buffer = source; 17 | br->pos = 0; 18 | od_ec_enc_init(&br->ec, 62025); 19 | } 20 | 21 | int aom_daala_stop_encode(daala_writer *br) { 22 | int nb_bits; 23 | uint32_t daala_bytes; 24 | unsigned char *daala_data; 25 | daala_data = od_ec_enc_done(&br->ec, &daala_bytes); 26 | nb_bits = od_ec_enc_tell(&br->ec); 27 | memcpy(br->buffer, daala_data, daala_bytes); 28 | br->pos = daala_bytes; 29 | od_ec_enc_clear(&br->ec); 30 | return nb_bits; 31 | } 32 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/x86-ios-simulator.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_IOS_SIMULATOR_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_IOS_SIMULATOR_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_IOS_SIMULATOR_CMAKE_ 1) 15 | 16 | if(XCODE) 17 | 18 | # TODO(tomfinegan): Handle ios sim builds in Xcode. 19 | message(FATAL_ERROR "This toolchain does not support Xcode.") 20 | endif() 21 | 22 | set(CMAKE_SYSTEM_PROCESSOR "i386") 23 | set(CMAKE_OSX_ARCHITECTURES "i386") 24 | 25 | # Avoid noisy PIC/PIE warnings. 26 | set(CONFIG_PIC 1 CACHE NUMBER "") 27 | 28 | include("${CMAKE_CURRENT_LIST_DIR}/ios-simulator-common.cmake") 29 | -------------------------------------------------------------------------------- /libaom/common/rawenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_COMMON_RAWENC_H_ 13 | #define AOM_COMMON_RAWENC_H_ 14 | 15 | #include "aom/aom_decoder.h" 16 | #include "common/md5_utils.h" 17 | #include "common/tools_common.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | void raw_write_image_file(const aom_image_t *img, const int *planes, 24 | const int num_planes, FILE *file); 25 | void raw_update_image_md5(const aom_image_t *img, const int *planes, 26 | const int num_planes, MD5Context *md5); 27 | 28 | #ifdef __cplusplus 29 | } // extern "C" 30 | #endif 31 | 32 | #endif // AOM_COMMON_RAWENC_H_ 33 | -------------------------------------------------------------------------------- /libaom/av1/encoder/mbgraph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_MBGRAPH_H_ 13 | #define AOM_AV1_ENCODER_MBGRAPH_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | typedef struct { 20 | struct { 21 | int err; 22 | union { 23 | int_mv mv; 24 | PREDICTION_MODE mode; 25 | } m; 26 | } ref[REF_FRAMES]; 27 | } MBGRAPH_MB_STATS; 28 | 29 | typedef struct { 30 | MBGRAPH_MB_STATS *mb_stats; 31 | } MBGRAPH_FRAME_STATS; 32 | 33 | struct AV1_COMP; 34 | 35 | void av1_update_mbgraph_stats(struct AV1_COMP *cpi); 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // AOM_AV1_ENCODER_MBGRAPH_H_ 42 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/ppc-linux-gcc.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_PPC_LINUX_GCC_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_PPC_LINUX_GCC_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_PPC_LINUX_GCC_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_NAME "Linux") 17 | 18 | if("${CROSS}" STREQUAL "") 19 | 20 | # Default the cross compiler prefix to something known to work. 21 | set(CROSS powerpc64le-unknown-linux-gnu-) 22 | endif() 23 | 24 | set(CMAKE_C_COMPILER ${CROSS}gcc) 25 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 26 | set(AS_EXECUTABLE ${CROSS}as) 27 | set(CMAKE_SYSTEM_PROCESSOR "ppc") 28 | 29 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 30 | -------------------------------------------------------------------------------- /libaom/test/examples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ## Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | ## 4 | ## This source code is subject to the terms of the BSD 2 Clause License and 5 | ## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | ## was not distributed with this source code in the LICENSE file, you can 7 | ## obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | ## Media Patent License 1.0 was not distributed with this source code in the 9 | ## PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | ## 11 | ## This file runs all of the tests for the libaom examples. 12 | ## 13 | . $(dirname $0)/tools_common.sh 14 | 15 | example_tests=$(ls -r $(dirname $0)/*.sh) 16 | 17 | # List of script names to exclude. 18 | exclude_list="best_encode examples run_encodes tools_common" 19 | 20 | # Filter out the scripts in $exclude_list. 21 | for word in ${exclude_list}; do 22 | example_tests=$(filter_strings "${example_tests}" "${word}" exclude) 23 | done 24 | 25 | for test in ${example_tests}; do 26 | # Source each test script so that exporting variables can be avoided. 27 | AOM_TEST_NAME="$(basename ${test%.*})" 28 | . "${test}" 29 | done 30 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/arm-ios-common.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM_IOS_COMMON_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM_IOS_COMMON_CMAKE_ 14 | set(AOM_BUILD_CMAKE_ARM_IOS_COMMON_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_NAME "Darwin") 17 | set(CMAKE_OSX_SYSROOT iphoneos) 18 | set(CMAKE_C_COMPILER clang) 19 | set(CMAKE_C_COMPILER_ARG1 "-arch ${CMAKE_SYSTEM_PROCESSOR}") 20 | set(CMAKE_CXX_COMPILER clang++) 21 | set(CMAKE_CXX_COMPILER_ARG1 "-arch ${CMAKE_SYSTEM_PROCESSOR}") 22 | 23 | # No runtime cpu detect for arm*-ios targets. 24 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 25 | 26 | # TODO(tomfinegan): Handle bit code embedding. 27 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/x86-mingw-gcc.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_X86_MINGW_GCC_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_X86_MINGW_GCC_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_X86_MINGW_GCC_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_PROCESSOR "x86") 17 | set(CMAKE_SYSTEM_NAME "Windows") 18 | set(CMAKE_C_COMPILER_ARG1 "-m32") 19 | set(CMAKE_CXX_COMPILER_ARG1 "-m32") 20 | 21 | if("${CROSS}" STREQUAL "") 22 | set(CROSS i686-w64-mingw32-) 23 | endif() 24 | 25 | set(CMAKE_C_COMPILER ${CROSS}gcc) 26 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 27 | set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) 28 | set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) 29 | -------------------------------------------------------------------------------- /libaom/common/ivfenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_COMMON_IVFENC_H_ 12 | #define AOM_COMMON_IVFENC_H_ 13 | 14 | #include "common/tools_common.h" 15 | 16 | struct aom_codec_enc_cfg; 17 | struct aom_codec_cx_pkt; 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | void ivf_write_file_header(FILE *outfile, const struct aom_codec_enc_cfg *cfg, 24 | uint32_t fourcc, int frame_cnt); 25 | 26 | void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size); 27 | 28 | void ivf_write_frame_size(FILE *outfile, size_t frame_size); 29 | 30 | #ifdef __cplusplus 31 | } /* extern "C" */ 32 | #endif 33 | 34 | #endif // AOM_COMMON_IVFENC_H_ 35 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/txfm_common_sse2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_X86_TXFM_COMMON_SSE2_H_ 13 | #define AOM_AOM_DSP_X86_TXFM_COMMON_SSE2_H_ 14 | 15 | #include 16 | #include "aom/aom_integer.h" 17 | #include "aom_dsp/x86/synonyms.h" 18 | 19 | #define pair_set_epi16(a, b) \ 20 | _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(b)) << 16))) 21 | 22 | // Reverse the 8 16 bit words in __m128i 23 | static INLINE __m128i mm_reverse_epi16(const __m128i x) { 24 | const __m128i a = _mm_shufflelo_epi16(x, 0x1b); 25 | const __m128i b = _mm_shufflehi_epi16(a, 0x1b); 26 | return _mm_shuffle_epi32(b, 0x4e); 27 | } 28 | 29 | #endif // AOM_AOM_DSP_X86_TXFM_COMMON_SSE2_H_ 30 | -------------------------------------------------------------------------------- /libaom/av1/encoder/pass2_strategy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_PASS2_STRATEGY_H_ 13 | #define AOM_AV1_ENCODER_PASS2_STRATEGY_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | struct AV1_COMP; 20 | struct EncodeFrameParams; 21 | 22 | void av1_init_second_pass(struct AV1_COMP *cpi); 23 | 24 | void av1_get_second_pass_params(struct AV1_COMP *cpi, 25 | struct EncodeFrameParams *const frame_params, 26 | unsigned int frame_flags); 27 | 28 | void av1_twopass_postencode_update(struct AV1_COMP *cpi); 29 | 30 | #ifdef __cplusplus 31 | } // extern "C" 32 | #endif 33 | 34 | #endif // AOM_AV1_ENCODER_PASS2_STRATEGY_H_ 35 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/convolve_common_intrin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_X86_CONVOLVE_COMMON_INTRIN_H_ 13 | #define AOM_AOM_DSP_X86_CONVOLVE_COMMON_INTRIN_H_ 14 | 15 | // Note: 16 | // This header file should be put below any x86 intrinsics head file 17 | 18 | static INLINE void add_store(CONV_BUF_TYPE *const dst, const __m128i *const res, 19 | const int do_average) { 20 | __m128i d; 21 | if (do_average) { 22 | d = _mm_load_si128((__m128i *)dst); 23 | d = _mm_add_epi32(d, *res); 24 | d = _mm_srai_epi32(d, 1); 25 | } else { 26 | d = *res; 27 | } 28 | _mm_store_si128((__m128i *)dst, d); 29 | } 30 | 31 | #endif // AOM_AOM_DSP_X86_CONVOLVE_COMMON_INTRIN_H_ 32 | -------------------------------------------------------------------------------- /libaom/aom_mem/aom_mem.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_AOM_MEM_AOM_MEM_CMAKE_) 12 | return() 13 | endif() # AOM_AOM_MEM_AOM_MEM_CMAKE_ 14 | set(AOM_AOM_MEM_AOM_MEM_CMAKE_ 1) 15 | 16 | list(APPEND AOM_MEM_SOURCES "${AOM_ROOT}/aom_mem/aom_mem.c" 17 | "${AOM_ROOT}/aom_mem/aom_mem.h" 18 | "${AOM_ROOT}/aom_mem/include/aom_mem_intrnl.h") 19 | 20 | # Creates the aom_mem build target and makes libaom depend on it. The libaom 21 | # target must exist before this function is called. 22 | function(setup_aom_mem_targets) 23 | add_library(aom_mem OBJECT ${AOM_MEM_SOURCES}) 24 | set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_mem PARENT_SCOPE) 25 | target_sources(aom PRIVATE $) 26 | endfunction() 27 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/arm64-mingw-gcc.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_MINGW_GCC_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_MINGW_GCC_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_MINGW_GCC_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_PROCESSOR "arm64") 17 | set(CMAKE_SYSTEM_NAME "Windows") 18 | 19 | if("${CROSS}" STREQUAL "") 20 | set(CROSS aarch64-w64-mingw32-) 21 | endif() 22 | 23 | set(CMAKE_C_COMPILER ${CROSS}gcc) 24 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 25 | set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) 26 | set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) 27 | 28 | # No runtime cpu detect for arm64-mingw-gcc. 29 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 30 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/armv7-mingw-gcc.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_MINGW_GCC_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_MINGW_GCC_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_MINGW_GCC_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_PROCESSOR "armv7") 17 | set(CMAKE_SYSTEM_NAME "Windows") 18 | 19 | if("${CROSS}" STREQUAL "") 20 | set(CROSS armv7-w64-mingw32-) 21 | endif() 22 | 23 | set(CMAKE_C_COMPILER ${CROSS}gcc) 24 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 25 | set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) 26 | set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) 27 | 28 | # No runtime cpu detect for armv7-mingw-gcc. 29 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 30 | -------------------------------------------------------------------------------- /libaom/av1/encoder/extend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_EXTEND_H_ 13 | #define AOM_AV1_ENCODER_EXTEND_H_ 14 | 15 | #include "aom_scale/yv12config.h" 16 | #include "aom/aom_integer.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | void av1_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src, 23 | YV12_BUFFER_CONFIG *dst); 24 | 25 | void av1_copy_and_extend_frame_with_rect(const YV12_BUFFER_CONFIG *src, 26 | YV12_BUFFER_CONFIG *dst, int srcy, 27 | int srcx, int srch, int srcw); 28 | #ifdef __cplusplus 29 | } // extern "C" 30 | #endif 31 | 32 | #endif // AOM_AV1_ENCODER_EXTEND_H_ 33 | -------------------------------------------------------------------------------- /libaom/aom_dsp/sum_squares.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | 14 | #include "config/aom_dsp_rtcd.h" 15 | 16 | uint64_t aom_sum_squares_2d_i16_c(const int16_t *src, int src_stride, int width, 17 | int height) { 18 | int r, c; 19 | uint64_t ss = 0; 20 | 21 | for (r = 0; r < height; r++) { 22 | for (c = 0; c < width; c++) { 23 | const int16_t v = src[c]; 24 | ss += v * v; 25 | } 26 | src += src_stride; 27 | } 28 | 29 | return ss; 30 | } 31 | 32 | uint64_t aom_sum_squares_i16_c(const int16_t *src, uint32_t n) { 33 | uint64_t ss = 0; 34 | do { 35 | const int16_t v = *src++; 36 | ss += v * v; 37 | } while (--n); 38 | 39 | return ss; 40 | } 41 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/armv7-ios.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_IOS_CMAKE_ 1) 15 | 16 | if(XCODE) 17 | 18 | # TODO(tomfinegan): Handle arm builds in Xcode. 19 | message(FATAL_ERROR "This toolchain does not support Xcode.") 20 | endif() 21 | 22 | set(CMAKE_SYSTEM_PROCESSOR "armv7") 23 | set(CMAKE_OSX_ARCHITECTURES "armv7") 24 | 25 | include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake") 26 | 27 | # No intrinsics flag required for armv7s-ios. 28 | set(AOM_NEON_INTRIN_FLAG "") 29 | 30 | # No runtime cpu detect for armv7s-ios. 31 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 32 | -------------------------------------------------------------------------------- /libaom/third_party/libyuv/include/libyuv/rotate_argb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_ // NOLINT 13 | #define INCLUDE_LIBYUV_ROTATE_ARGB_H_ 14 | 15 | #include "libyuv/basic_types.h" 16 | #include "libyuv/rotate.h" // For RotationMode. 17 | 18 | #ifdef __cplusplus 19 | namespace libyuv { 20 | extern "C" { 21 | #endif 22 | 23 | // Rotate ARGB frame 24 | LIBYUV_API 25 | int ARGBRotate(const uint8* src_argb, int src_stride_argb, 26 | uint8* dst_argb, int dst_stride_argb, 27 | int src_width, int src_height, enum RotationMode mode); 28 | 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | } // namespace libyuv 32 | #endif 33 | 34 | #endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_ NOLINT 35 | -------------------------------------------------------------------------------- /libaom/av1/decoder/decodemv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_DECODEMV_H_ 13 | #define AOM_AV1_DECODER_DECODEMV_H_ 14 | 15 | #include "aom_dsp/bitreader.h" 16 | 17 | #include "av1/decoder/decoder.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | void av1_read_mode_info(AV1Decoder *const pbi, MACROBLOCKD *xd, 24 | 25 | int mi_row, int mi_col, aom_reader *r, int x_mis, 26 | int y_mis); 27 | 28 | #ifdef __cplusplus 29 | } // extern "C" 30 | #endif 31 | 32 | void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd, int blk_row, 33 | int blk_col, TX_SIZE tx_size, aom_reader *r); 34 | 35 | #endif // AOM_AV1_DECODER_DECODEMV_H_ 36 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/armv7s-ios.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7S_IOS_CMAKE_ 1) 15 | 16 | if(XCODE) 17 | 18 | # TODO(tomfinegan): Handle arm builds in Xcode. 19 | message(FATAL_ERROR "This toolchain does not support Xcode.") 20 | endif() 21 | 22 | set(CMAKE_SYSTEM_PROCESSOR "armv7s") 23 | set(CMAKE_OSX_ARCHITECTURES "armv7s") 24 | 25 | include("${CMAKE_CURRENT_LIST_DIR}/arm-ios-common.cmake") 26 | 27 | # No intrinsics flag required for armv7s-ios. 28 | set(AOM_NEON_INTRIN_FLAG "") 29 | 30 | # No runtime cpu detect for armv7s-ios. 31 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 32 | -------------------------------------------------------------------------------- /libaom/test/test_runner.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(NOT GTEST_TOTAL_SHARDS OR "${GTEST_SHARD_INDEX}" STREQUAL "" OR NOT 12 | TEST_LIBAOM) 13 | message( 14 | FATAL_ERROR 15 | "The variables GTEST_SHARD_INDEX, GTEST_TOTAL_SHARDS and TEST_LIBAOM 16 | must be defined." 17 | ) 18 | endif() 19 | 20 | set($ENV{GTEST_SHARD_INDEX} ${GTEST_SHARD_INDEX}) 21 | set($ENV{GTEST_TOTAL_SHARDS} ${GTEST_TOTAL_SHARDS}) 22 | execute_process(COMMAND ${TEST_LIBAOM} RESULT_VARIABLE test_result) 23 | set(test_message "Test shard ${GTEST_SHARD_INDEX}/${GTEST_TOTAL_SHARDS} result") 24 | message("${test_message}: ${test_result}") 25 | 26 | if(NOT "${test_result}" STREQUAL "0") 27 | message(FATAL_ERROR "${test_message}: FAILED, non-zero exit code.") 28 | endif() 29 | -------------------------------------------------------------------------------- /libaom/av1/encoder/aq_variance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_AQ_VARIANCE_H_ 13 | #define AOM_AV1_ENCODER_AQ_VARIANCE_H_ 14 | 15 | #include "av1/encoder/encoder.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void av1_vaq_frame_setup(AV1_COMP *cpi); 22 | 23 | int av1_log_block_var(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); 24 | int av1_compute_deltaq_from_energy_level(const AV1_COMP *const cpi, 25 | int block_var_level); 26 | int av1_block_wavelet_energy_level(const AV1_COMP *cpi, MACROBLOCK *x, 27 | BLOCK_SIZE bs); 28 | 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // AOM_AV1_ENCODER_AQ_VARIANCE_H_ 34 | -------------------------------------------------------------------------------- /libaom/av1/encoder/temporal_filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_TEMPORAL_FILTER_H_ 13 | #define AOM_AV1_ENCODER_TEMPORAL_FILTER_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #define ARNR_FILT_QINDEX 128 20 | 21 | // Block size used in temporal filtering 22 | #define TF_BLOCK BLOCK_32X32 23 | #define BH 32 24 | #define BH_LOG2 5 25 | #define BW 32 26 | #define BW_LOG2 5 27 | #define BLK_PELS 1024 // Pixels in the block 28 | #define THR_SHIFT 2 29 | #define TF_SUB_BLOCK BLOCK_16X16 30 | #define SUB_BH 16 31 | #define SUB_BW 16 32 | 33 | void av1_temporal_filter(AV1_COMP *cpi, int distance); 34 | 35 | #ifdef __cplusplus 36 | } // extern "C" 37 | #endif 38 | 39 | #endif // AOM_AV1_ENCODER_TEMPORAL_FILTER_H_ 40 | -------------------------------------------------------------------------------- /libaom/common/warnings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_COMMON_WARNINGS_H_ 12 | #define AOM_COMMON_WARNINGS_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | struct aom_codec_enc_cfg; 19 | struct AvxEncoderConfig; 20 | 21 | /* 22 | * Checks config for improperly used settings. Warns user upon encountering 23 | * settings that will lead to poor output quality. Prompts user to continue 24 | * when warnings are issued. 25 | */ 26 | void check_encoder_config(int disable_prompt, 27 | const struct AvxEncoderConfig *global_config, 28 | const struct aom_codec_enc_cfg *stream_config); 29 | 30 | #ifdef __cplusplus 31 | } // extern "C" 32 | #endif 33 | 34 | #endif // AOM_COMMON_WARNINGS_H_ 35 | -------------------------------------------------------------------------------- /libaom/third_party/libyuv/source/compare_common.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 The LibYuv Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "libyuv/basic_types.h" 12 | 13 | #ifdef __cplusplus 14 | namespace libyuv { 15 | extern "C" { 16 | #endif 17 | 18 | uint32 SumSquareError_C(const uint8* src_a, const uint8* src_b, int count) { 19 | uint32 sse = 0u; 20 | int i; 21 | for (i = 0; i < count; ++i) { 22 | int diff = src_a[i] - src_b[i]; 23 | sse += (uint32)(diff * diff); 24 | } 25 | return sse; 26 | } 27 | 28 | // hash seed of 5381 recommended. 29 | // Internal C version of HashDjb2 with int sized count for efficiency. 30 | uint32 HashDjb2_C(const uint8* src, int count, uint32 seed) { 31 | uint32 hash = seed; 32 | int i; 33 | for (i = 0; i < count; ++i) { 34 | hash += (hash << 5) + src[i]; 35 | } 36 | return hash; 37 | } 38 | 39 | #ifdef __cplusplus 40 | } // extern "C" 41 | } // namespace libyuv 42 | #endif 43 | -------------------------------------------------------------------------------- /libaom/tools/inspect-cli.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This tool lets you test if the compiled Javascript decoder is functioning properly. You'll 3 | * need to download a SpiderMonkey js-shell to run this script. 4 | * https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/ 5 | * 6 | * Example: 7 | * js-shell inspect-cli.js video.ivf 8 | */ 9 | load("inspect.js"); 10 | var buffer = read(scriptArgs[0], "binary"); 11 | var Module = { 12 | noExitRuntime: true, 13 | noInitialRun: true, 14 | preInit: [], 15 | preRun: [], 16 | postRun: [function () { 17 | printErr(`Loaded Javascript Decoder OK`); 18 | }], 19 | memoryInitializerPrefixURL: "bin/", 20 | arguments: ['input.ivf', 'output.raw'], 21 | on_frame_decoded_json: function (jsonString) { 22 | let json = JSON.parse("[" + Module.UTF8ToString(jsonString) + "null]"); 23 | json.forEach(frame => { 24 | if (frame) { 25 | print(frame.frame); 26 | } 27 | }); 28 | } 29 | }; 30 | DecoderModule(Module); 31 | Module.FS.writeFile("/tmp/input.ivf", buffer, { encoding: "binary" }); 32 | Module._open_file(); 33 | Module._set_layers(0xFFFFFFFF); // Set this to zero if you want to benchmark decoding. 34 | while(true) { 35 | printErr("Decoding Frame ..."); 36 | if (Module._read_frame()) { 37 | break; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /libaom/test/run_encodes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2016, Alliance for Open Media. All rights reserved. 4 | # 5 | # This source code is subject to the terms of the BSD 2 Clause License and 6 | # the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 7 | # was not distributed with this source code in the LICENSE file, you can 8 | # obtain it at www.aomedia.org/license/software. If the Alliance for Open 9 | # Media Patent License 1.0 was not distributed with this source code in the 10 | # PATENTS file, you can obtain it at www.aomedia.org/license/patent. 11 | # 12 | # Author: jimbankoski@google.com (Jim Bankoski) 13 | 14 | if [[ $# -ne 4 ]]; then 15 | echo Encodes all the y4m files in the directory at the bitrates specified by 16 | echo the first 3 parameters and stores the results in a subdirectory named by 17 | echo the 4th parameter: 18 | echo 19 | echo Usage: run_encodes.sh start-kbps end-kbps step-kbps output-directory 20 | echo Example: run_encodes.sh 200 500 50 baseline 21 | exit 22 | fi 23 | 24 | s=$1 25 | e=$2 26 | step=$3 27 | newdir=$4 28 | 29 | for i in ./*y4m; do 30 | for (( b=$s; b<= $e; b+= $step )) 31 | do 32 | best_encode.sh $i $b 33 | done 34 | mv opsnr.stt $i.stt 35 | done 36 | 37 | mkdir $newdir 38 | mv *.stt $newdir 39 | mv *.webm $newdir 40 | -------------------------------------------------------------------------------- /libaom/aom_mem/include/aom_mem_intrnl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ 13 | #define AOM_AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #define ADDRESS_STORAGE_SIZE sizeof(size_t) 18 | 19 | #ifndef DEFAULT_ALIGNMENT 20 | #if defined(VXWORKS) 21 | /*default addr alignment to use in calls to aom_* functions other than 22 | aom_memalign*/ 23 | #define DEFAULT_ALIGNMENT 32 24 | #else 25 | #define DEFAULT_ALIGNMENT (2 * sizeof(void *)) /* NOLINT */ 26 | #endif 27 | #endif 28 | 29 | /*returns an addr aligned to the byte boundary specified by align*/ 30 | #define align_addr(addr, align) \ 31 | (void *)(((size_t)(addr) + ((align)-1)) & ~(size_t)((align)-1)) 32 | 33 | #endif // AOM_AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ 34 | -------------------------------------------------------------------------------- /libaom/aom_ports/arm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_PORTS_ARM_H_ 13 | #define AOM_AOM_PORTS_ARM_H_ 14 | #include 15 | 16 | #include "config/aom_config.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /*ARMv5TE "Enhanced DSP" instructions.*/ 23 | #define HAS_EDSP 0x01 24 | /*ARMv6 "Parallel" or "Media" instructions.*/ 25 | #define HAS_MEDIA 0x02 26 | /*ARMv7 optional NEON instructions.*/ 27 | #define HAS_NEON 0x04 28 | 29 | int aom_arm_cpu_caps(void); 30 | 31 | // Earlier gcc compilers have issues with some neon intrinsics 32 | #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 4 && \ 33 | __GNUC_MINOR__ <= 6 34 | #define AOM_INCOMPATIBLE_GCC 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // AOM_AOM_PORTS_ARM_H_ 42 | -------------------------------------------------------------------------------- /libaom/av1/encoder/var_based_part.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_VAR_BASED_PART_H_ 13 | #define AOM_AV1_ENCODER_VAR_BASED_PART_H_ 14 | 15 | #include 16 | 17 | #include "config/aom_config.h" 18 | #include "config/aom_dsp_rtcd.h" 19 | #include "config/av1_rtcd.h" 20 | 21 | #include "av1/encoder/encoder.h" 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | void av1_set_variance_partition_thresholds(AV1_COMP *cpi, int q, 28 | int content_state); 29 | 30 | int av1_choose_var_based_partitioning(AV1_COMP *cpi, const TileInfo *const tile, 31 | MACROBLOCK *x, int mi_row, int mi_col); 32 | 33 | #ifdef __cplusplus 34 | } // extern "C" 35 | #endif 36 | 37 | #endif // AOM_AV1_ENCODER_VAR_BASED_PART_H_ 38 | -------------------------------------------------------------------------------- /libaom/aom_util/aom_util.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_AOM_UTIL_AOM_UTIL_CMAKE_) 12 | return() 13 | endif() # AOM_AOM_UTIL_AOM_UTIL_CMAKE_ 14 | set(AOM_AOM_UTIL_AOM_UTIL_CMAKE_ 1) 15 | 16 | list(APPEND AOM_UTIL_SOURCES "${AOM_ROOT}/aom_util/aom_thread.c" 17 | "${AOM_ROOT}/aom_util/aom_thread.h" 18 | "${AOM_ROOT}/aom_util/endian_inl.h" 19 | "${AOM_ROOT}/aom_util/debug_util.c" 20 | "${AOM_ROOT}/aom_util/debug_util.h") 21 | 22 | # Creates the aom_util build target and makes libaom depend on it. The libaom 23 | # target must exist before this function is called. 24 | function(setup_aom_util_targets) 25 | add_library(aom_util OBJECT ${AOM_UTIL_SOURCES}) 26 | set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_util PARENT_SCOPE) 27 | target_sources(aom PRIVATE $) 28 | endfunction() 29 | -------------------------------------------------------------------------------- /libaom/av1/encoder/aq_complexity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_AQ_COMPLEXITY_H_ 13 | #define AOM_AV1_ENCODER_AQ_COMPLEXITY_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #include "av1/common/enums.h" 20 | 21 | struct AV1_COMP; 22 | struct macroblock; 23 | 24 | // Select a segment for the current Block. 25 | void av1_caq_select_segment(const struct AV1_COMP *cpi, struct macroblock *, 26 | BLOCK_SIZE bs, int mi_row, int mi_col, 27 | int projected_rate); 28 | 29 | // This function sets up a set of segments with delta Q values around 30 | // the baseline frame quantizer. 31 | void av1_setup_in_frame_q_adj(struct AV1_COMP *cpi); 32 | 33 | #ifdef __cplusplus 34 | } // extern "C" 35 | #endif 36 | 37 | #endif // AOM_AV1_ENCODER_AQ_COMPLEXITY_H_ 38 | -------------------------------------------------------------------------------- /libaom/av1/encoder/gop_structure.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_GOP_STRUCTURE_H_ 13 | #define AOM_AV1_ENCODER_GOP_STRUCTURE_H_ 14 | 15 | #include "av1/common/onyxc_int.h" 16 | #include "av1/encoder/ratectrl.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | struct AV1_COMP; 23 | struct EncodeFrameParams; 24 | 25 | // Set up the Group-Of-Pictures structure for this GF_GROUP. This involves 26 | // deciding where to place the various FRAME_UPDATE_TYPEs in the group. It does 27 | // this primarily by setting the contents of 28 | // cpi->twopass.gf_group.update_type[]. 29 | void av1_gop_setup_structure( 30 | struct AV1_COMP *cpi, const struct EncodeFrameParams *const frame_params); 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | #endif 35 | 36 | #endif // AOM_AV1_ENCODER_GOP_STRUCTURE_H_ 37 | -------------------------------------------------------------------------------- /libaom/av1/encoder/corner_match.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_AV1_ENCODER_CORNER_MATCH_H_ 12 | #define AOM_AV1_ENCODER_CORNER_MATCH_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #define MATCH_SZ 13 19 | #define MATCH_SZ_BY2 ((MATCH_SZ - 1) / 2) 20 | #define MATCH_SZ_SQ (MATCH_SZ * MATCH_SZ) 21 | 22 | typedef struct { 23 | int x, y; 24 | int rx, ry; 25 | } Correspondence; 26 | 27 | int determine_correspondence(unsigned char *frm, int *frm_corners, 28 | int num_frm_corners, unsigned char *ref, 29 | int *ref_corners, int num_ref_corners, int width, 30 | int height, int frm_stride, int ref_stride, 31 | int *correspondence_pts); 32 | 33 | #endif // AOM_AV1_ENCODER_CORNER_MATCH_H_ 34 | -------------------------------------------------------------------------------- /libaom/av1/decoder/obu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_OBU_H_ 13 | #define AOM_AV1_DECODER_OBU_H_ 14 | 15 | #include "aom/aom_codec.h" 16 | #include "av1/decoder/decoder.h" 17 | 18 | // Try to decode one frame from a buffer. 19 | // Returns 1 if we decoded a frame, 20 | // 0 if we didn't decode a frame but that's okay 21 | // (eg, if there was a frame but we skipped it), 22 | // or -1 on error 23 | int aom_decode_frame_from_obus(struct AV1Decoder *pbi, const uint8_t *data, 24 | const uint8_t *data_end, 25 | const uint8_t **p_data_end); 26 | 27 | aom_codec_err_t aom_get_num_layers_from_operating_point_idc( 28 | int operating_point_idc, unsigned int *number_spatial_layers, 29 | unsigned int *number_temporal_layers); 30 | 31 | #endif // AOM_AV1_DECODER_OBU_H_ 32 | -------------------------------------------------------------------------------- /libaom/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Alliance for Open Media. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 25 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | 28 | -------------------------------------------------------------------------------- /libaom/aom_dsp/aom_simd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_AOM_SIMD_H_ 13 | #define AOM_AOM_DSP_AOM_SIMD_H_ 14 | 15 | #include 16 | 17 | #if defined(_WIN32) 18 | #include 19 | #endif 20 | 21 | #include "config/aom_config.h" 22 | 23 | #include "aom_dsp/aom_simd_inline.h" 24 | 25 | #define SIMD_CHECK 1 // Sanity checks in C equivalents 26 | 27 | #if HAVE_NEON 28 | #include "simd/v256_intrinsics_arm.h" 29 | // VS compiling for 32 bit targets does not support vector types in 30 | // structs as arguments, which makes the v256 type of the intrinsics 31 | // hard to support, so optimizations for this target are disabled. 32 | #elif HAVE_SSE2 && (defined(_WIN64) || !defined(_MSC_VER) || defined(__clang__)) 33 | #include "simd/v256_intrinsics_x86.h" 34 | #else 35 | #include "simd/v256_intrinsics.h" 36 | #endif 37 | 38 | #endif // AOM_AOM_DSP_AOM_SIMD_H_ 39 | -------------------------------------------------------------------------------- /libaom/stats/aomstats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_STATS_AOMSTATS_H_ 13 | #define AOM_STATS_AOMSTATS_H_ 14 | 15 | #include 16 | 17 | #include "aom/aom_encoder.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* This structure is used to abstract the different ways of handling 24 | * first pass statistics 25 | */ 26 | typedef struct { 27 | aom_fixed_buf_t buf; 28 | int pass; 29 | FILE *file; 30 | char *buf_ptr; 31 | size_t buf_alloc_sz; 32 | } stats_io_t; 33 | 34 | int stats_open_file(stats_io_t *stats, const char *fpf, int pass); 35 | int stats_open_mem(stats_io_t *stats, int pass); 36 | void stats_close(stats_io_t *stats, int last_pass); 37 | void stats_write(stats_io_t *stats, const void *pkt, size_t len); 38 | aom_fixed_buf_t stats_get(stats_io_t *stats); 39 | 40 | #ifdef __cplusplus 41 | } // extern "C" 42 | #endif 43 | 44 | #endif // AOM_STATS_AOMSTATS_H_ 45 | -------------------------------------------------------------------------------- /libaom/test/i420_video_source.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_TEST_I420_VIDEO_SOURCE_H_ 12 | #define AOM_TEST_I420_VIDEO_SOURCE_H_ 13 | #include 14 | #include 15 | #include 16 | 17 | #include "test/yuv_video_source.h" 18 | 19 | namespace libaom_test { 20 | 21 | // This class extends VideoSource to allow parsing of raw yv12 22 | // so that we can do actual file encodes. 23 | class I420VideoSource : public YUVVideoSource { 24 | public: 25 | I420VideoSource(const std::string &file_name, unsigned int width, 26 | unsigned int height, int rate_numerator, int rate_denominator, 27 | unsigned int start, int limit) 28 | : YUVVideoSource(file_name, AOM_IMG_FMT_I420, width, height, 29 | rate_numerator, rate_denominator, start, limit) {} 30 | }; 31 | 32 | } // namespace libaom_test 33 | 34 | #endif // AOM_TEST_I420_VIDEO_SOURCE_H_ 35 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/bitdepth_conversion_avx2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | 14 | #include "config/aom_config.h" 15 | #include "aom/aom_integer.h" 16 | #include "aom_dsp/aom_dsp_common.h" 17 | 18 | static INLINE __m256i load_tran_low(const tran_low_t *a) { 19 | const __m256i a_low = _mm256_loadu_si256((const __m256i *)a); 20 | const __m256i a_high = _mm256_loadu_si256((const __m256i *)(a + 8)); 21 | return _mm256_packs_epi32(a_low, a_high); 22 | } 23 | 24 | static INLINE void store_tran_low(__m256i a, tran_low_t *b) { 25 | const __m256i one = _mm256_set1_epi16(1); 26 | const __m256i a_hi = _mm256_mulhi_epi16(a, one); 27 | const __m256i a_lo = _mm256_mullo_epi16(a, one); 28 | const __m256i a_1 = _mm256_unpacklo_epi16(a_lo, a_hi); 29 | const __m256i a_2 = _mm256_unpackhi_epi16(a_lo, a_hi); 30 | _mm256_storeu_si256((__m256i *)b, a_1); 31 | _mm256_storeu_si256((__m256i *)(b + 8), a_2); 32 | } 33 | -------------------------------------------------------------------------------- /libaom/av1/encoder/segmentation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_SEGMENTATION_H_ 13 | #define AOM_AV1_ENCODER_SEGMENTATION_H_ 14 | 15 | #include "av1/common/blockd.h" 16 | #include "av1/encoder/encoder.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | void av1_enable_segmentation(struct segmentation *seg); 23 | void av1_disable_segmentation(struct segmentation *seg); 24 | 25 | void av1_disable_segfeature(struct segmentation *seg, int segment_id, 26 | SEG_LVL_FEATURES feature_id); 27 | void av1_clear_segdata(struct segmentation *seg, int segment_id, 28 | SEG_LVL_FEATURES feature_id); 29 | 30 | void av1_choose_segmap_coding_method(AV1_COMMON *cm, MACROBLOCKD *xd); 31 | 32 | void av1_reset_segment_features(AV1_COMMON *cm); 33 | 34 | #ifdef __cplusplus 35 | } // extern "C" 36 | #endif 37 | 38 | #endif // AOM_AV1_ENCODER_SEGMENTATION_H_ 39 | -------------------------------------------------------------------------------- /libaom/build/cmake/exports_sources.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE_ 14 | set(AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE_ 1) 15 | 16 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_com" 17 | "${AOM_ROOT}/av1/exports_com") 18 | 19 | if(CONFIG_AV1_DECODER) 20 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_dec" 21 | "${AOM_ROOT}/av1/exports_dec") 22 | if(CONFIG_INSPECTION) 23 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/av1/exports_ident") 24 | endif() 25 | endif() 26 | 27 | if(CONFIG_AV1_ENCODER) 28 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_enc" 29 | "${AOM_ROOT}/av1/exports_enc") 30 | endif() 31 | 32 | if(ENABLE_TESTS) 33 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_test" 34 | "${AOM_ROOT}/av1/exports_test") 35 | endif() 36 | -------------------------------------------------------------------------------- /libaom/tools/aggregate_entropy_stats.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | ## Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | ## 4 | ## This source code is subject to the terms of the BSD 2 Clause License and 5 | ## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | ## was not distributed with this source code in the LICENSE file, you can 7 | ## obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | ## Media Patent License 1.0 was not distributed with this source code in the 9 | ## PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | ## 11 | """Aggregate multiple entropy stats output which is written in 32-bit int. 12 | 13 | python ./aggregate_entropy_stats.py [dir of stats files] [keyword of filenames] 14 | [filename of final stats] 15 | """ 16 | 17 | __author__ = "yuec@google.com" 18 | 19 | import os 20 | import sys 21 | import numpy as np 22 | 23 | def main(): 24 | dir = sys.argv[1] 25 | sum = [] 26 | for fn in os.listdir(dir): 27 | if sys.argv[2] in fn: 28 | stats = np.fromfile(dir + fn, dtype=np.int32) 29 | if len(sum) == 0: 30 | sum = stats 31 | else: 32 | sum = np.add(sum, stats) 33 | if len(sum) == 0: 34 | print("No stats file is found. Double-check directory and keyword?") 35 | else: 36 | sum.tofile(dir+sys.argv[3]) 37 | 38 | if __name__ == '__main__': 39 | main() 40 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/mkvparser/mkvreader.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | #ifndef MKVPARSER_MKVREADER_H_ 9 | #define MKVPARSER_MKVREADER_H_ 10 | 11 | #include 12 | 13 | #include "mkvparser/mkvparser.h" 14 | 15 | namespace mkvparser { 16 | 17 | class MkvReader : public IMkvReader { 18 | public: 19 | MkvReader(); 20 | explicit MkvReader(FILE* fp); 21 | virtual ~MkvReader(); 22 | 23 | int Open(const char*); 24 | void Close(); 25 | 26 | virtual int Read(long long position, long length, unsigned char* buffer); 27 | virtual int Length(long long* total, long long* available); 28 | 29 | private: 30 | MkvReader(const MkvReader&); 31 | MkvReader& operator=(const MkvReader&); 32 | 33 | // Determines the size of the file. This is called either by the constructor 34 | // or by the Open function depending on file ownership. Returns true on 35 | // success. 36 | bool GetFileSize(); 37 | 38 | long long m_length; 39 | FILE* m_file; 40 | bool reader_owns_file_; 41 | }; 42 | 43 | } // namespace mkvparser 44 | 45 | #endif // MKVPARSER_MKVREADER_H_ 46 | -------------------------------------------------------------------------------- /libaom/.cmake-format.py: -------------------------------------------------------------------------------- 1 | # Generated with cmake-format 0.3.6 2 | # How wide to allow formatted cmake files 3 | line_width = 80 4 | 5 | # How many spaces to tab for indent 6 | tab_size = 2 7 | 8 | # If arglists are longer than this, break them always. This introduces some 9 | # interesting effects with complicated 'if' statements. However, we want file 10 | # lists to look reasonable. Try to strike a balance. 11 | max_subargs_per_line = 10 12 | 13 | # If true, separate flow control names from their parentheses with a space 14 | separate_ctrl_name_with_space = False 15 | 16 | # If true, separate function names from parentheses with a space 17 | separate_fn_name_with_space = False 18 | 19 | # If a statement is wrapped to more than one line, than dangle the closing 20 | # parenthesis on it's own line 21 | dangle_parens = False 22 | 23 | # What character to use for bulleted lists 24 | bullet_char = u'*' 25 | 26 | # What character to use as punctuation after numerals in an enumerated list 27 | enum_char = u'.' 28 | 29 | # What style line endings to use in the output. 30 | line_ending = u'unix' 31 | 32 | # Format command names consistently as 'lower' or 'upper' case 33 | command_case = u'lower' 34 | 35 | # Specify structure for custom cmake functions 36 | additional_commands = { 37 | "foo": { 38 | "flags": [ 39 | "BAR", 40 | "BAZ" 41 | ], 42 | "kwargs": { 43 | "HEADERS": "*", 44 | "DEPENDS": "*", 45 | "SOURCES": "*" 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/arm64-linux-gcc.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_ARM64_LINUX_GCC_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_NAME "Linux") 17 | 18 | if("${CROSS}" STREQUAL "") 19 | 20 | # Default the cross compiler prefix to something known to work. 21 | set(CROSS aarch64-linux-gnu-) 22 | endif() 23 | 24 | set(CMAKE_C_COMPILER ${CROSS}gcc) 25 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 26 | set(AS_EXECUTABLE ${CROSS}as) 27 | set(CMAKE_C_COMPILER_ARG1 "-march=armv8-a") 28 | set(CMAKE_CXX_COMPILER_ARG1 "-march=armv8-a") 29 | set(AOM_AS_FLAGS "-march=armv8-a") 30 | set(CMAKE_SYSTEM_PROCESSOR "arm64") 31 | 32 | # No intrinsics flag required for arm64-linux-gcc. 33 | set(AOM_NEON_INTRIN_FLAG "") 34 | 35 | # No runtime cpu detect for arm64-linux-gcc. 36 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 37 | -------------------------------------------------------------------------------- /libaom/examples/encoder_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | // Utility functions used by encoder binaries. 13 | 14 | #ifndef AOM_EXAMPLES_ENCODER_UTIL_H_ 15 | #define AOM_EXAMPLES_ENCODER_UTIL_H_ 16 | 17 | #include "aom/aom_image.h" 18 | 19 | // Returns mismatch location (?loc[0],?loc[1]) and the values at that location 20 | // in img1 (?loc[2]) and img2 (?loc[3]). 21 | void aom_find_mismatch_high(const aom_image_t *const img1, 22 | const aom_image_t *const img2, int yloc[4], 23 | int uloc[4], int vloc[4]); 24 | 25 | void aom_find_mismatch(const aom_image_t *const img1, 26 | const aom_image_t *const img2, int yloc[4], int uloc[4], 27 | int vloc[4]); 28 | 29 | // Returns 1 if the two images match. 30 | int aom_compare_img(const aom_image_t *const img1, 31 | const aom_image_t *const img2); 32 | 33 | #endif // AOM_EXAMPLES_ENCODER_UTIL_H_ 34 | -------------------------------------------------------------------------------- /libaom/stats/rate_hist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_STATS_RATE_HIST_H_ 13 | #define AOM_STATS_RATE_HIST_H_ 14 | 15 | #include "aom/aom_encoder.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | struct rate_hist; 22 | 23 | struct rate_hist *init_rate_histogram(const aom_codec_enc_cfg_t *cfg, 24 | const aom_rational_t *fps); 25 | 26 | void destroy_rate_histogram(struct rate_hist *hist); 27 | 28 | void update_rate_histogram(struct rate_hist *hist, 29 | const aom_codec_enc_cfg_t *cfg, 30 | const aom_codec_cx_pkt_t *pkt); 31 | 32 | void show_q_histogram(const int counts[64], int max_buckets); 33 | 34 | void show_rate_histogram(struct rate_hist *hist, const aom_codec_enc_cfg_t *cfg, 35 | int max_buckets); 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // AOM_STATS_RATE_HIST_H_ 42 | -------------------------------------------------------------------------------- /README.android: -------------------------------------------------------------------------------- 1 | Name: libaom 2 | URL: https://aomedia.org 3 | Version: v1.0.0 4 | License: BSD 5 | License File: libaom/LICENSE 6 | 7 | Date: Friday March 29 2019 8 | Branch: origin/master 9 | Commit: 978ab9e6cd19904cdd54b69a4c30b10c747eb55a 10 | 11 | Description: 12 | Contains the sources used to compile libaom. 13 | 14 | The libaom source is from aomedia.org: 15 | https://aomedia.googlesource.com/aom/ 16 | 17 | Please follow these steps to update libaom source code: 18 | 19 | 1. Update libaom source tree. Look for "Current HEAD: " output to update 20 | README.android. Look for "git log from upstream: " output to add 21 | to the commit message. 22 | 23 | ./update_libaom.sh [branch name] 24 | 25 | 2. Generate updated Android.bp and config files. 26 | 27 | ./generate_config.sh 28 | 29 | 3. Update this file with any Version, Date, Branch, or Commit changes. The 30 | version is in the file config/config/aom_version.h 31 | 32 | 4. Commit the changes. The commit message should look like this and is printed 33 | by update_libaom.sh: 34 | libaom: Pull from upstream 35 | 36 | Current HEAD: 37 | 38 | git log from upstream: 39 | a6b2070 40 | 08dabbc 41 | c29fb02 42 | 43 | Tools needed to build libaom: 44 | 45 | - generate_config.sh 46 | 47 | Generate config files that contain the source list for each platform. 48 | A list of prerequisites is at the top of generate_config.sh. 49 | -------------------------------------------------------------------------------- /libaom/av1/encoder/corner_detect.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include "third_party/fastfeat/fast.h" 19 | 20 | #include "av1/encoder/corner_detect.h" 21 | 22 | // Fast_9 wrapper 23 | #define FAST_BARRIER 18 24 | int fast_corner_detect(unsigned char *buf, int width, int height, int stride, 25 | int *points, int max_points) { 26 | int num_points; 27 | xy *const frm_corners_xy = fast9_detect_nonmax(buf, width, height, stride, 28 | FAST_BARRIER, &num_points); 29 | num_points = (num_points <= max_points ? num_points : max_points); 30 | if (num_points > 0 && frm_corners_xy) { 31 | memcpy(points, frm_corners_xy, sizeof(*frm_corners_xy) * num_points); 32 | free(frm_corners_xy); 33 | return num_points; 34 | } 35 | free(frm_corners_xy); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /libaom/av1/encoder/mips/msa/fdct4x4_msa.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | 14 | #include "av1/common/enums.h" 15 | 16 | void av1_fwht4x4_msa(const int16_t *input, int16_t *output, 17 | int32_t src_stride) { 18 | v8i16 in0, in1, in2, in3, in4; 19 | 20 | LD_SH4(input, src_stride, in0, in1, in2, in3); 21 | 22 | in0 += in1; 23 | in3 -= in2; 24 | in4 = (in0 - in3) >> 1; 25 | SUB2(in4, in1, in4, in2, in1, in2); 26 | in0 -= in2; 27 | in3 += in1; 28 | 29 | TRANSPOSE4x4_SH_SH(in0, in2, in3, in1, in0, in2, in3, in1); 30 | 31 | in0 += in2; 32 | in1 -= in3; 33 | in4 = (in0 - in1) >> 1; 34 | SUB2(in4, in2, in4, in3, in2, in3); 35 | in0 -= in3; 36 | in1 += in2; 37 | 38 | SLLI_4V(in0, in1, in2, in3, 2); 39 | 40 | TRANSPOSE4x4_SH_SH(in0, in3, in1, in2, in0, in3, in1, in2); 41 | 42 | ST4x2_UB(in0, output, 4); 43 | ST4x2_UB(in3, output + 4, 4); 44 | ST4x2_UB(in1, output + 8, 4); 45 | ST4x2_UB(in2, output + 12, 4); 46 | } 47 | -------------------------------------------------------------------------------- /libaom/build/cmake/sanitizers.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_SANITIZERS_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_SANITIZERS_CMAKE_ 14 | set(AOM_BUILD_CMAKE_SANITIZERS_CMAKE_ 1) 15 | 16 | if(MSVC OR NOT SANITIZE) 17 | return() 18 | endif() 19 | 20 | include("${AOM_ROOT}/build/cmake/compiler_flags.cmake") 21 | 22 | string(TOLOWER ${SANITIZE} SANITIZE) 23 | 24 | # Require the sanitizer requested. 25 | require_linker_flag("-fsanitize=${SANITIZE}") 26 | require_compiler_flag("-fsanitize=${SANITIZE}" YES) 27 | 28 | # Make callstacks accurate. 29 | require_compiler_flag("-fno-omit-frame-pointer -fno-optimize-sibling-calls" YES) 30 | 31 | # Fix link errors due to missing rt compiler lib in 32-bit builds. 32 | # http://llvm.org/bugs/show_bug.cgi?id=17693 33 | if(CMAKE_C_COMPILER_ID MATCHES "Clang") 34 | if(${CMAKE_SIZEOF_VOID_P} EQUAL 4 AND "${SANITIZE}" MATCHES 35 | "integer|undefined") 36 | require_linker_flag("--rtlib=compiler-rt -lgcc_s") 37 | endif() 38 | endif() 39 | -------------------------------------------------------------------------------- /libaom/av1/decoder/decodetxb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_DECODETXB_H_ 13 | #define AOM_AV1_DECODER_DECODETXB_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include "av1/common/blockd.h" 18 | #include "av1/common/onyxc_int.h" 19 | #include "av1/common/txb_common.h" 20 | #include "aom_dsp/bitreader.h" 21 | 22 | uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd, 23 | aom_reader *const r, const int blk_row, 24 | const int blk_col, const int plane, 25 | const TXB_CTX *const txb_ctx, 26 | const TX_SIZE tx_size); 27 | 28 | void av1_read_coeffs_txb_facade(const AV1_COMMON *const cm, 29 | MACROBLOCKD *const xd, aom_reader *const r, 30 | const int plane, const int row, const int col, 31 | const TX_SIZE tx_size); 32 | #endif // AOM_AV1_DECODER_DECODETXB_H_ 33 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/PATENTS.TXT: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | ------------------------------------ 3 | 4 | "These implementations" means the copyrightable works that implement the WebM 5 | codecs distributed by Google as part of the WebM Project. 6 | 7 | Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge, 8 | royalty-free, irrevocable (except as stated in this section) patent license to 9 | make, have made, use, offer to sell, sell, import, transfer, and otherwise 10 | run, modify and propagate the contents of these implementations of WebM, where 11 | such license applies only to those patent claims, both currently owned by 12 | Google and acquired in the future, licensable by Google that are necessarily 13 | infringed by these implementations of WebM. This grant does not include claims 14 | that would be infringed only as a consequence of further modification of these 15 | implementations. If you or your agent or exclusive licensee institute or order 16 | or agree to the institution of patent litigation or any other patent 17 | enforcement activity against any entity (including a cross-claim or 18 | counterclaim in a lawsuit) alleging that any of these implementations of WebM 19 | or any code incorporated within any of these implementations of WebM 20 | constitute direct or contributory patent infringement, or inducement of 21 | patent infringement, then any patent rights granted to you under this License 22 | for these implementations of WebM shall terminate as of the date such 23 | litigation is filed. 24 | -------------------------------------------------------------------------------- /libaom/third_party/googletest/src/googletest/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Bharat Mediratta 9 | Chandler Carruth 10 | Chris Prince 11 | Chris Taylor 12 | Dan Egnor 13 | Eric Roman 14 | Hady Zalek 15 | Jeffrey Yasskin 16 | Jói Sigurðsson 17 | Keir Mierle 18 | Keith Ray 19 | Kenton Varda 20 | Manuel Klimek 21 | Markus Heule 22 | Mika Raento 23 | Miklós Fazekas 24 | Pasi Valminen 25 | Patrick Hanna 26 | Patrick Riley 27 | Peter Kaminski 28 | Preston Jackson 29 | Rainer Klaffenboeck 30 | Russ Cox 31 | Russ Rufer 32 | Sean Mcafee 33 | Sigurður Ásgeirsson 34 | Tracy Bialik 35 | Vadim Berman 36 | Vlad Losev 37 | Zhanyong Wan 38 | -------------------------------------------------------------------------------- /libaom/aom_ports/sanitizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_PORTS_SANITIZER_H_ 13 | #define AOM_AOM_PORTS_SANITIZER_H_ 14 | 15 | // AddressSanitizer support. 16 | 17 | // Define AOM_ADDRESS_SANITIZER if AddressSanitizer is used. 18 | // Clang. 19 | #if defined(__has_feature) 20 | #if __has_feature(address_sanitizer) 21 | #define AOM_ADDRESS_SANITIZER 1 22 | #endif 23 | #endif // defined(__has_feature) 24 | // GCC. 25 | #if defined(__SANITIZE_ADDRESS__) 26 | #define AOM_ADDRESS_SANITIZER 1 27 | #endif // defined(__SANITIZE_ADDRESS__) 28 | 29 | // Define the macros for AddressSanitizer manual memory poisoning. See 30 | // https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning. 31 | #if defined(AOM_ADDRESS_SANITIZER) 32 | #include 33 | #else 34 | #define ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size)) 35 | #define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size)) 36 | #endif 37 | 38 | #endif // AOM_AOM_PORTS_SANITIZER_H_ 39 | -------------------------------------------------------------------------------- /libaom/common/y4menc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_COMMON_Y4MENC_H_ 13 | #define AOM_COMMON_Y4MENC_H_ 14 | 15 | #include "aom/aom_decoder.h" 16 | #include "common/md5_utils.h" 17 | #include "common/tools_common.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #define Y4M_BUFFER_SIZE 128 24 | 25 | int y4m_write_file_header(char *buf, size_t len, int width, int height, 26 | const struct AvxRational *framerate, int monochrome, 27 | aom_chroma_sample_position_t csp, aom_img_fmt_t fmt, 28 | unsigned int bit_depth); 29 | int y4m_write_frame_header(char *buf, size_t len); 30 | void y4m_write_image_file(const aom_image_t *img, const int *planes, 31 | FILE *file); 32 | void y4m_update_image_md5(const aom_image_t *img, const int *planes, 33 | MD5Context *md5); 34 | 35 | #ifdef __cplusplus 36 | } // extern "C" 37 | #endif 38 | 39 | #endif // AOM_COMMON_Y4MENC_H_ 40 | -------------------------------------------------------------------------------- /libaom/test/divu_small_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | 14 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" 15 | 16 | #include "test/acm_random.h" 17 | #include "av1/common/odintrin.h" 18 | 19 | using libaom_test::ACMRandom; 20 | 21 | TEST(Daala, TestDIVUuptoMAX) { 22 | for (int d = 1; d <= OD_DIVU_DMAX; d++) { 23 | for (uint32_t x = 1; x <= 1000000; x++) { 24 | GTEST_ASSERT_EQ(x / d, OD_DIVU_SMALL(x, d)) 25 | << "x=" << x << " d=" << d << " x/d=" << (x / d) 26 | << " != " << OD_DIVU_SMALL(x, d); 27 | } 28 | } 29 | } 30 | 31 | TEST(Daala, TestDIVUrandI31) { 32 | ACMRandom rnd(ACMRandom::DeterministicSeed()); 33 | for (int d = 1; d < OD_DIVU_DMAX; d++) { 34 | for (int i = 0; i < 1000000; i++) { 35 | uint32_t x = rnd.Rand31(); 36 | GTEST_ASSERT_EQ(x / d, OD_DIVU_SMALL(x, d)) 37 | << "x=" << x << " d=" << d << " x/d=" << (x / d) 38 | << " != " << OD_DIVU_SMALL(x, d); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /libaom/third_party/fastfeat/README.libvpx: -------------------------------------------------------------------------------- 1 | URL: https://github.com/edrosten/fast-C-src 2 | Version: 391d5e939eb1545d24c10533d7de424db8d9c191 3 | License: BSD 4 | License File: LICENSE 5 | 6 | Description: 7 | Library to compute FAST features with non-maximum suppression. 8 | 9 | The files are valid C and C++ code, and have no special requirements for 10 | compiling, and they do not depend on any libraries. Just compile them along with 11 | the rest of your project. 12 | 13 | To use the functions, #include "fast.h" 14 | 15 | The corner detectors have the following prototype (where X is 9, 10, 11 or 12): 16 | 17 | xy* fastX_detect_nonmax(const unsigned char * data, int xsize, int ysize, int stride, int threshold, int* numcorners) 18 | 19 | Where xy is the following simple struct typedef: 20 | 21 | typedef struct 22 | { 23 | int x, y; 24 | } xy; 25 | 26 | The image is passed in as a block of data and dimensions, and the list of 27 | corners is returned as an array of xy structs, and an integer (numcorners) 28 | with the number of corners returned. The data can be deallocated with free(). 29 | Nonmaximal suppression is performed on the corners. Note that the stride 30 | is the number of bytes between rows. If your image has no padding, then this 31 | is the same as xsize. 32 | 33 | The detection, scoring and nonmaximal suppression are available as individual 34 | functions. To see how to use the individual functions, see fast.c 35 | 36 | Local Modifications: 37 | Add lines to turn off clang formatting for these files 38 | Remove Fast 10, 11 and 12 39 | Convert tabs to spaces 40 | -------------------------------------------------------------------------------- /libaom/build/cmake/msvc_runtime.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_MSVC_RUNTIME_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_MSVC_RUNTIME_CMAKE_ 14 | set(AOM_BUILD_CMAKE_MSVC_RUNTIME_CMAKE_ 1) 15 | 16 | if(MSVC) 17 | 18 | # CMake defaults to producing code linked to the DLL MSVC runtime. That will 19 | # not work with googletest, and isn't what we want anyway. 20 | if(NOT "${MSVC_RUNTIME}" STREQUAL "dll") 21 | foreach(flag_var 22 | CMAKE_C_FLAGS 23 | CMAKE_C_FLAGS_DEBUG 24 | CMAKE_C_FLAGS_RELEASE 25 | CMAKE_C_FLAGS_MINSIZEREL 26 | CMAKE_C_FLAGS_RELWITHDEBINFO 27 | CMAKE_CXX_FLAGS 28 | CMAKE_CXX_FLAGS_DEBUG 29 | CMAKE_CXX_FLAGS_RELEASE 30 | CMAKE_CXX_FLAGS_MINSIZEREL 31 | CMAKE_CXX_FLAGS_RELWITHDEBINFO) 32 | if(${flag_var} MATCHES "/MD") 33 | string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") 34 | endif(${flag_var} MATCHES "/MD") 35 | endforeach(flag_var) 36 | endif() 37 | endif() 38 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/bitdepth_conversion_sse2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | 14 | #include "config/aom_config.h" 15 | #include "aom/aom_integer.h" 16 | #include "aom_dsp/aom_dsp_common.h" 17 | 18 | // Load 8 16 bit values. If the source is 32 bits then pack down with 19 | // saturation. 20 | static INLINE __m128i load_tran_low(const tran_low_t *a) { 21 | const __m128i a_low = _mm_load_si128((const __m128i *)a); 22 | return _mm_packs_epi32(a_low, *(const __m128i *)(a + 4)); 23 | } 24 | 25 | // Store 8 16 bit values. If the destination is 32 bits then sign extend the 26 | // values by multiplying by 1. 27 | static INLINE void store_tran_low(__m128i a, tran_low_t *b) { 28 | const __m128i one = _mm_set1_epi16(1); 29 | const __m128i a_hi = _mm_mulhi_epi16(a, one); 30 | const __m128i a_lo = _mm_mullo_epi16(a, one); 31 | const __m128i a_1 = _mm_unpacklo_epi16(a_lo, a_hi); 32 | const __m128i a_2 = _mm_unpackhi_epi16(a_lo, a_hi); 33 | _mm_store_si128((__m128i *)(b), a_1); 34 | _mm_store_si128((__m128i *)(b + 4), a_2); 35 | } 36 | -------------------------------------------------------------------------------- /libaom/aom_dsp/entcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_ENTCODE_H_ 13 | #define AOM_AOM_DSP_ENTCODE_H_ 14 | 15 | #include 16 | #include 17 | #include "av1/common/odintrin.h" 18 | #include "aom_dsp/prob.h" 19 | 20 | #define EC_PROB_SHIFT 6 21 | #define EC_MIN_PROB 4 // must be <= (1< 1/8th bits.*/ 32 | #define OD_BITRES (3) 33 | 34 | #define OD_ICDF AOM_ICDF 35 | 36 | /*See entcode.c for further documentation.*/ 37 | 38 | OD_WARN_UNUSED_RESULT uint32_t od_ec_tell_frac(uint32_t nbits_total, 39 | uint32_t rng); 40 | 41 | #endif // AOM_AOM_DSP_ENTCODE_H_ 42 | -------------------------------------------------------------------------------- /libaom/third_party/googletest/src/googletest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/common/file_util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The WebM project authors. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | #ifndef LIBWEBM_COMMON_FILE_UTIL_H_ 9 | #define LIBWEBM_COMMON_FILE_UTIL_H_ 10 | 11 | #include 12 | 13 | #include 14 | 15 | #include "mkvmuxer/mkvmuxertypes.h" // LIBWEBM_DISALLOW_COPY_AND_ASSIGN() 16 | 17 | namespace libwebm { 18 | 19 | // Returns a temporary file name. 20 | std::string GetTempFileName(); 21 | 22 | // Returns size of file specified by |file_name|, or 0 upon failure. 23 | uint64_t GetFileSize(const std::string& file_name); 24 | 25 | // Gets the contents file_name as a string. Returns false on error. 26 | bool GetFileContents(const std::string& file_name, std::string* contents); 27 | 28 | // Manages life of temporary file specified at time of construction. Deletes 29 | // file upon destruction. 30 | class TempFileDeleter { 31 | public: 32 | TempFileDeleter(); 33 | explicit TempFileDeleter(std::string file_name) : file_name_(file_name) {} 34 | ~TempFileDeleter(); 35 | const std::string& name() const { return file_name_; } 36 | 37 | private: 38 | std::string file_name_; 39 | LIBWEBM_DISALLOW_COPY_AND_ASSIGN(TempFileDeleter); 40 | }; 41 | 42 | } // namespace libwebm 43 | 44 | #endif // LIBWEBM_COMMON_FILE_UTIL_H_ 45 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Google Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | * Neither the name of Google nor the names of its contributors may 16 | be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | -------------------------------------------------------------------------------- /libaom/third_party/fastfeat/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, 2008 Edward Rosten 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 8 | 9 | *Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | *Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | *Neither the name of the University of Cambridge nor the names of 17 | its contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /libaom/mainpage.dox: -------------------------------------------------------------------------------- 1 | /*!\mainpage AMedia Codec SDK 2 | 3 | \section main_contents Page Contents 4 | - \ref main_intro 5 | - \ref main_startpoints 6 | - \ref main_support 7 | 8 | \section main_intro Introduction 9 | Welcome to the AMedia Codec SDK. This SDK allows you to integrate your 10 | applications with the AOM and AV1 video codecs. 11 | 12 | This distribution of the AOMedia Codec SDK includes the following support: 13 | 14 | \if aom_encoder 15 | - \ref aom_encoder 16 | \endif 17 | \if aom_decoder 18 | - \ref aom_decoder 19 | \endif 20 | 21 | 22 | \section main_startpoints Starting Points 23 | - Consult the \ref changelog for a complete list of improvements in this 24 | release. 25 | - \ref readme contains instructions on compiling the sample applications. 26 | - Read the \ref usage "usage" for a narrative on codec usage. 27 | - Read the \ref samples "sample code" for examples of how to interact with the 28 | codec. 29 | - \ref codec reference 30 | \if encoder 31 | - \ref encoder reference 32 | \endif 33 | \if decoder 34 | - \ref decoder reference 35 | \endif 36 | 37 | \section main_support Support Options & FAQ 38 | The AOMedia project is an open source project supported by its community. For 39 | questions about this SDK, please mail the apps-devel@webmproject.org list. 40 | To contribute, see http://www.webmproject.org/code/contribute and mail 41 | codec-devel@webmproject.org. 42 | */ 43 | 44 | /*!\page changelog CHANGELOG 45 | \verbinclude CHANGELOG 46 | */ 47 | 48 | /*!\page readme README.md 49 | \include README.md 50 | */ 51 | 52 | /*!\defgroup codecs Supported Codecs */ 53 | -------------------------------------------------------------------------------- /libaom/aom_dsp/daalaboolreader.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "aom_dsp/daalaboolreader.h" 13 | 14 | int aom_daala_reader_init(daala_reader *r, const uint8_t *buffer, int size) { 15 | if (size && !buffer) { 16 | return 1; 17 | } 18 | r->buffer_end = buffer + size; 19 | r->buffer = buffer; 20 | od_ec_dec_init(&r->ec, buffer, size); 21 | #if CONFIG_ACCOUNTING 22 | r->accounting = NULL; 23 | #endif 24 | return 0; 25 | } 26 | 27 | const uint8_t *aom_daala_reader_find_begin(daala_reader *r) { 28 | return r->buffer; 29 | } 30 | 31 | const uint8_t *aom_daala_reader_find_end(daala_reader *r) { 32 | return r->buffer_end; 33 | } 34 | 35 | uint32_t aom_daala_reader_tell(const daala_reader *r) { 36 | return od_ec_dec_tell(&r->ec); 37 | } 38 | 39 | uint32_t aom_daala_reader_tell_frac(const daala_reader *r) { 40 | return od_ec_dec_tell_frac(&r->ec); 41 | } 42 | 43 | int aom_daala_reader_has_overflowed(const daala_reader *r) { 44 | const uint32_t tell_bits = aom_daala_reader_tell(r); 45 | const uint32_t tell_bytes = (tell_bits + 7) >> 3; 46 | return ((ptrdiff_t)tell_bytes > r->buffer_end - r->buffer); 47 | } 48 | -------------------------------------------------------------------------------- /libaom/build/cmake/toolchains/armv7-linux-gcc.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_ARMV7_LINUX_GCC_CMAKE_ 1) 15 | 16 | set(CMAKE_SYSTEM_NAME "Linux") 17 | 18 | if("${CROSS}" STREQUAL "") 19 | 20 | # Default the cross compiler prefix to something known to work. 21 | set(CROSS arm-linux-gnueabihf-) 22 | endif() 23 | 24 | if(NOT ${CROSS} MATCHES hf-$) 25 | set(AOM_EXTRA_TOOLCHAIN_FLAGS "-mfloat-abi=softfp") 26 | endif() 27 | 28 | set(CMAKE_C_COMPILER ${CROSS}gcc) 29 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 30 | set(AS_EXECUTABLE ${CROSS}as) 31 | set(CMAKE_C_COMPILER_ARG1 "-march=armv7-a ${AOM_EXTRA_TOOLCHAIN_FLAGS}") 32 | set(CMAKE_CXX_COMPILER_ARG1 "-march=armv7-a ${AOM_EXTRA_TOOLCHAIN_FLAGS}") 33 | set(AOM_AS_FLAGS --defsym ARCHITECTURE=7 -march=armv7-a -mfpu=neon 34 | ${AOM_EXTRA_TOOLCHAIN_FLAGS}) 35 | set(CMAKE_SYSTEM_PROCESSOR "armv7") 36 | 37 | set(AOM_NEON_INTRIN_FLAG "-mfpu=neon") 38 | 39 | # No runtime cpu detect for armv7-linux-gcc. 40 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 41 | -------------------------------------------------------------------------------- /libaom/common/md5_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is the header file for the MD5 message-digest algorithm. 3 | * The algorithm is due to Ron Rivest. This code was 4 | * written by Colin Plumb in 1993, no copyright is claimed. 5 | * This code is in the public domain; do with it what you wish. 6 | * 7 | * Equivalent code is available from RSA Data Security, Inc. 8 | * This code has been tested against that, and is equivalent, 9 | * except that you don't need to include two pages of legalese 10 | * with every copy. 11 | * 12 | * To compute the message digest of a chunk of bytes, declare an 13 | * MD5Context structure, pass it to MD5Init, call MD5Update as 14 | * needed on buffers full of bytes, and then call MD5Final, which 15 | * will fill a supplied 16-byte array with the digest. 16 | * 17 | * Changed so as no longer to depend on Colin Plumb's `usual.h' 18 | * header definitions 19 | * - Ian Jackson . 20 | * Still in the public domain. 21 | */ 22 | 23 | #ifndef AOM_COMMON_MD5_UTILS_H_ 24 | #define AOM_COMMON_MD5_UTILS_H_ 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #define md5byte unsigned char 31 | #define UWORD32 unsigned int 32 | 33 | typedef struct MD5Context MD5Context; 34 | struct MD5Context { 35 | UWORD32 buf[4]; 36 | UWORD32 bytes[2]; 37 | UWORD32 in[16]; 38 | }; 39 | 40 | void MD5Init(struct MD5Context *context); 41 | void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len); 42 | void MD5Final(unsigned char digest[16], struct MD5Context *context); 43 | void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]); 44 | 45 | #ifdef __cplusplus 46 | } // extern "C" 47 | #endif 48 | 49 | #endif // AOM_COMMON_MD5_UTILS_H_ 50 | -------------------------------------------------------------------------------- /libaom/third_party/libwebm/mkvmuxer/mkvwriter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The WebM project authors. All Rights Reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. An additional intellectual property rights grant can be found 6 | // in the file PATENTS. All contributing project authors may 7 | // be found in the AUTHORS file in the root of the source tree. 8 | 9 | #ifndef MKVMUXER_MKVWRITER_H_ 10 | #define MKVMUXER_MKVWRITER_H_ 11 | 12 | #include 13 | 14 | #include "mkvmuxer/mkvmuxer.h" 15 | #include "mkvmuxer/mkvmuxertypes.h" 16 | 17 | namespace mkvmuxer { 18 | 19 | // Default implementation of the IMkvWriter interface on Windows. 20 | class MkvWriter : public IMkvWriter { 21 | public: 22 | MkvWriter(); 23 | explicit MkvWriter(FILE* fp); 24 | virtual ~MkvWriter(); 25 | 26 | // IMkvWriter interface 27 | virtual int64 Position() const; 28 | virtual int32 Position(int64 position); 29 | virtual bool Seekable() const; 30 | virtual int32 Write(const void* buffer, uint32 length); 31 | virtual void ElementStartNotify(uint64 element_id, int64 position); 32 | 33 | // Creates and opens a file for writing. |filename| is the name of the file 34 | // to open. This function will overwrite the contents of |filename|. Returns 35 | // true on success. 36 | bool Open(const char* filename); 37 | 38 | // Closes an opened file. 39 | void Close(); 40 | 41 | private: 42 | // File handle to output file. 43 | FILE* file_; 44 | bool writer_owns_file_; 45 | 46 | LIBWEBM_DISALLOW_COPY_AND_ASSIGN(MkvWriter); 47 | }; 48 | 49 | } // namespace mkvmuxer 50 | 51 | #endif // MKVMUXER_MKVWRITER_H_ 52 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/blend_a64_hmask_sse4.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "aom/aom_integer.h" 13 | 14 | #include "config/aom_dsp_rtcd.h" 15 | 16 | // To start out, just dispatch to the function using the 2D mask and 17 | // pass mask stride as 0. This can be improved upon if necessary. 18 | 19 | void aom_blend_a64_hmask_sse4_1(uint8_t *dst, uint32_t dst_stride, 20 | const uint8_t *src0, uint32_t src0_stride, 21 | const uint8_t *src1, uint32_t src1_stride, 22 | const uint8_t *mask, int w, int h) { 23 | aom_blend_a64_mask_sse4_1(dst, dst_stride, src0, src0_stride, src1, 24 | src1_stride, mask, 0, w, h, 0, 0); 25 | } 26 | 27 | void aom_highbd_blend_a64_hmask_sse4_1( 28 | uint8_t *dst_8, uint32_t dst_stride, const uint8_t *src0_8, 29 | uint32_t src0_stride, const uint8_t *src1_8, uint32_t src1_stride, 30 | const uint8_t *mask, int w, int h, int bd) { 31 | aom_highbd_blend_a64_mask_sse4_1(dst_8, dst_stride, src0_8, src0_stride, 32 | src1_8, src1_stride, mask, 0, w, h, 0, 0, 33 | bd); 34 | } 35 | -------------------------------------------------------------------------------- /libaom/av1/decoder/dthread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_DTHREAD_H_ 13 | #define AOM_AV1_DECODER_DTHREAD_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include "aom_util/aom_thread.h" 18 | #include "aom/internal/aom_codec_internal.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | struct AV1Common; 25 | struct AV1Decoder; 26 | struct ThreadData; 27 | 28 | typedef struct DecWorkerData { 29 | struct ThreadData *td; 30 | const uint8_t *data_end; 31 | struct aom_internal_error_info error_info; 32 | } DecWorkerData; 33 | 34 | // WorkerData for the FrameWorker thread. It contains all the information of 35 | // the worker and decode structures for decoding a frame. 36 | typedef struct FrameWorkerData { 37 | struct AV1Decoder *pbi; 38 | const uint8_t *data; 39 | const uint8_t *data_end; 40 | size_t data_size; 41 | void *user_priv; 42 | int worker_id; 43 | int received_frame; 44 | int frame_context_ready; // Current frame's context is ready to read. 45 | int frame_decoded; // Finished decoding current frame. 46 | } FrameWorkerData; 47 | 48 | #ifdef __cplusplus 49 | } // extern "C" 50 | #endif 51 | 52 | #endif // AOM_AV1_DECODER_DTHREAD_H_ 53 | -------------------------------------------------------------------------------- /libaom/aom_dsp/sse.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | /* Sum the difference between every corresponding element of the buffers. */ 13 | 14 | #include "config/aom_config.h" 15 | #include "config/aom_dsp_rtcd.h" 16 | 17 | #include "aom/aom_integer.h" 18 | 19 | int64_t aom_sse_c(const uint8_t *a, int a_stride, const uint8_t *b, 20 | int b_stride, int width, int height) { 21 | int y, x; 22 | int64_t sse = 0; 23 | 24 | for (y = 0; y < height; y++) { 25 | for (x = 0; x < width; x++) { 26 | const int32_t diff = abs(a[x] - b[x]); 27 | sse += diff * diff; 28 | } 29 | 30 | a += a_stride; 31 | b += b_stride; 32 | } 33 | return sse; 34 | } 35 | 36 | int64_t aom_highbd_sse_c(const uint8_t *a8, int a_stride, const uint8_t *b8, 37 | int b_stride, int width, int height) { 38 | int y, x; 39 | int64_t sse = 0; 40 | uint16_t *a = CONVERT_TO_SHORTPTR(a8); 41 | uint16_t *b = CONVERT_TO_SHORTPTR(b8); 42 | for (y = 0; y < height; y++) { 43 | for (x = 0; x < width; x++) { 44 | const int32_t diff = (int32_t)(a[x]) - (int32_t)(b[x]); 45 | sse += diff * diff; 46 | } 47 | 48 | a += a_stride; 49 | b += b_stride; 50 | } 51 | return sse; 52 | } 53 | -------------------------------------------------------------------------------- /libaom/av1/encoder/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_HASH_H_ 13 | #define AOM_AV1_ENCODER_HASH_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include "aom/aom_integer.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef struct _crc_calculator { 24 | uint32_t remainder; 25 | uint32_t trunc_poly; 26 | uint32_t bits; 27 | uint32_t table[256]; 28 | uint32_t final_result_mask; 29 | } CRC_CALCULATOR; 30 | 31 | // Initialize the crc calculator. It must be executed at least once before 32 | // calling av1_get_crc_value(). 33 | void av1_crc_calculator_init(CRC_CALCULATOR *p_crc_calculator, uint32_t bits, 34 | uint32_t truncPoly); 35 | uint32_t av1_get_crc_value(void *crc_calculator, uint8_t *p, int length); 36 | 37 | // CRC32C: POLY = 0x82f63b78; 38 | typedef struct _CRC32C { 39 | /* Table for a quadword-at-a-time software crc. */ 40 | uint32_t table[8][256]; 41 | } CRC32C; 42 | 43 | // init table for software version crc32c 44 | void av1_crc32c_calculator_init(CRC32C *p_crc32c); 45 | 46 | #define AOM_BUFFER_SIZE_FOR_BLOCK_HASH (4096) 47 | 48 | #ifdef __cplusplus 49 | } // extern "C" 50 | #endif 51 | 52 | #endif // AOM_AV1_ENCODER_HASH_H_ 53 | -------------------------------------------------------------------------------- /libaom/av1/common/av1_inv_txfm1d_cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_COMMON_AV1_INV_TXFM1D_CFG_H_ 13 | #define AOM_AV1_COMMON_AV1_INV_TXFM1D_CFG_H_ 14 | #include "av1/common/av1_inv_txfm1d.h" 15 | 16 | // sum of fwd_shift_## 17 | static const int8_t inv_start_range[TX_SIZES_ALL] = { 18 | 5, // 4x4 transform 19 | 6, // 8x8 transform 20 | 7, // 16x16 transform 21 | 7, // 32x32 transform 22 | 7, // 64x64 transform 23 | 5, // 4x8 transform 24 | 5, // 8x4 transform 25 | 6, // 8x16 transform 26 | 6, // 16x8 transform 27 | 6, // 16x32 transform 28 | 6, // 32x16 transform 29 | 6, // 32x64 transform 30 | 6, // 64x32 transform 31 | 6, // 4x16 transform 32 | 6, // 16x4 transform 33 | 7, // 8x32 transform 34 | 7, // 32x8 transform 35 | 7, // 16x64 transform 36 | 7, // 64x16 transform 37 | }; 38 | 39 | extern const int8_t *inv_txfm_shift_ls[TX_SIZES_ALL]; 40 | 41 | // Values in both inv_cos_bit_col and inv_cos_bit_row are always 12 42 | // for each valid row and col combination 43 | #define INV_COS_BIT 12 44 | extern const int8_t inv_cos_bit_col[5 /*row*/][5 /*col*/]; 45 | extern const int8_t inv_cos_bit_row[5 /*row*/][5 /*col*/]; 46 | 47 | #endif // AOM_AV1_COMMON_AV1_INV_TXFM1D_CFG_H_ 48 | -------------------------------------------------------------------------------- /libaom/av1/common/scan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_COMMON_SCAN_H_ 13 | #define AOM_AV1_COMMON_SCAN_H_ 14 | 15 | #include "aom/aom_integer.h" 16 | #include "aom_ports/mem.h" 17 | 18 | #include "av1/common/enums.h" 19 | #include "av1/common/onyxc_int.h" 20 | #include "av1/common/blockd.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #define MAX_NEIGHBORS 2 27 | 28 | enum { 29 | SCAN_MODE_ZIG_ZAG, 30 | SCAN_MODE_COL_DIAG, 31 | SCAN_MODE_ROW_DIAG, 32 | SCAN_MODE_COL_1D, 33 | SCAN_MODE_ROW_1D, 34 | SCAN_MODES 35 | } UENUM1BYTE(SCAN_MODE); 36 | 37 | extern const SCAN_ORDER av1_default_scan_orders[TX_SIZES]; 38 | extern const SCAN_ORDER av1_scan_orders[TX_SIZES_ALL][TX_TYPES]; 39 | 40 | void av1_deliver_eob_threshold(const AV1_COMMON *cm, MACROBLOCKD *xd); 41 | 42 | static INLINE const SCAN_ORDER *get_default_scan(TX_SIZE tx_size, 43 | TX_TYPE tx_type) { 44 | return &av1_scan_orders[tx_size][tx_type]; 45 | } 46 | 47 | static INLINE const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) { 48 | return get_default_scan(tx_size, tx_type); 49 | } 50 | 51 | #ifdef __cplusplus 52 | } // extern "C" 53 | #endif 54 | 55 | #endif // AOM_AV1_COMMON_SCAN_H_ 56 | -------------------------------------------------------------------------------- /libaom/av1/encoder/ml.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_ML_H_ 13 | #define AOM_AV1_ENCODER_ML_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #include "config/av1_rtcd.h" 20 | 21 | #define NN_MAX_HIDDEN_LAYERS 10 22 | #define NN_MAX_NODES_PER_LAYER 128 23 | 24 | struct NN_CONFIG { 25 | int num_inputs; // Number of input nodes, i.e. features. 26 | int num_outputs; // Number of output nodes. 27 | int num_hidden_layers; // Number of hidden layers, maximum 10. 28 | // Number of nodes for each hidden layer. 29 | int num_hidden_nodes[NN_MAX_HIDDEN_LAYERS]; 30 | // Weight parameters, indexed by layer. 31 | const float *weights[NN_MAX_HIDDEN_LAYERS + 1]; 32 | // Bias parameters, indexed by layer. 33 | const float *bias[NN_MAX_HIDDEN_LAYERS + 1]; 34 | }; 35 | // Typedef from struct NN_CONFIG to NN_CONFIG is in rtcd_defs 36 | 37 | // Applies the softmax normalization function to the input 38 | // to get a valid probability distribution in the output: 39 | // output[i] = exp(input[i]) / sum_{k \in [0,n)}(exp(input[k])) 40 | void av1_nn_softmax(const float *input, float *output, int n); 41 | 42 | #ifdef __cplusplus 43 | } // extern "C" 44 | #endif 45 | 46 | #endif // AOM_AV1_ENCODER_ML_H_ 47 | -------------------------------------------------------------------------------- /libaom/av1/encoder/encodeframe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_ENCODEFRAME_H_ 13 | #define AOM_AV1_ENCODER_ENCODEFRAME_H_ 14 | 15 | #include "aom/aom_integer.h" 16 | #include "av1/common/blockd.h" 17 | #include "av1/common/enums.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #define DELTAQ_MODULATION 1 // 0: variance based, 1: wavelet AC energy based 24 | 25 | struct macroblock; 26 | struct yv12_buffer_config; 27 | struct AV1_COMP; 28 | struct ThreadData; 29 | 30 | void av1_setup_src_planes(struct macroblock *x, 31 | const struct yv12_buffer_config *src, int mi_row, 32 | int mi_col, const int num_planes, BLOCK_SIZE bsize); 33 | 34 | void av1_encode_frame(struct AV1_COMP *cpi); 35 | 36 | void av1_alloc_tile_data(struct AV1_COMP *cpi); 37 | void av1_init_tile_data(struct AV1_COMP *cpi); 38 | void av1_encode_tile(struct AV1_COMP *cpi, struct ThreadData *td, int tile_row, 39 | int tile_col); 40 | void av1_encode_sb_row(struct AV1_COMP *cpi, struct ThreadData *td, 41 | int tile_row, int tile_col, int mi_row); 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // AOM_AV1_ENCODER_ENCODEFRAME_H_ 48 | -------------------------------------------------------------------------------- /libaom/aom_dsp/bitreader_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_BITREADER_BUFFER_H_ 13 | #define AOM_AOM_DSP_BITREADER_BUFFER_H_ 14 | 15 | #include 16 | 17 | #include "aom/aom_integer.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef void (*aom_rb_error_handler)(void *data); 24 | 25 | struct aom_read_bit_buffer { 26 | const uint8_t *bit_buffer; 27 | const uint8_t *bit_buffer_end; 28 | uint32_t bit_offset; 29 | 30 | void *error_handler_data; 31 | aom_rb_error_handler error_handler; 32 | }; 33 | 34 | size_t aom_rb_bytes_read(const struct aom_read_bit_buffer *rb); 35 | 36 | int aom_rb_read_bit(struct aom_read_bit_buffer *rb); 37 | 38 | int aom_rb_read_literal(struct aom_read_bit_buffer *rb, int bits); 39 | 40 | uint32_t aom_rb_read_unsigned_literal(struct aom_read_bit_buffer *rb, int bits); 41 | 42 | int aom_rb_read_inv_signed_literal(struct aom_read_bit_buffer *rb, int bits); 43 | 44 | uint32_t aom_rb_read_uvlc(struct aom_read_bit_buffer *rb); 45 | 46 | int16_t aom_rb_read_signed_primitive_refsubexpfin( 47 | struct aom_read_bit_buffer *rb, uint16_t n, uint16_t k, int16_t ref); 48 | 49 | #ifdef __cplusplus 50 | } // extern "C" 51 | #endif 52 | 53 | #endif // AOM_AOM_DSP_BITREADER_BUFFER_H_ 54 | -------------------------------------------------------------------------------- /libaom/.mailmap: -------------------------------------------------------------------------------- 1 | Adrian Grange 2 | Aℓex Converse 3 | Aℓex Converse 4 | Alexis Ballier 5 | Alpha Lam 6 | Deb Mukherjee 7 | Erik Niemeyer 8 | Guillaume Martres 9 | Hangyu Kuang 10 | Hui Su 11 | Jacky Chen 12 | Jim Bankoski 13 | Johann Koenig 14 | Johann Koenig 15 | Johann Koenig 16 | John Koleszar 17 | Joshua Litt 18 | Marco Paniconi 19 | Marco Paniconi 20 | Pascal Massimino 21 | Paul Wilkins 22 | Ralph Giles 23 | Ralph Giles 24 | Ronald S. Bultje 25 | Sami Pietilä 26 | Sarah Parker 27 | Tamar Levy 28 | Tamar Levy 29 | Tero Rintaluoma 30 | Timothy B. Terriberry Tim Terriberry 31 | Tom Finegan 32 | Tom Finegan 33 | Yaowu Xu 34 | Yaowu Xu 35 | -------------------------------------------------------------------------------- /libaom/aom_dsp/mips/common_dspr2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_MIPS_COMMON_DSPR2_H_ 13 | #define AOM_AOM_DSP_MIPS_COMMON_DSPR2_H_ 14 | 15 | #include 16 | 17 | #include "config/aom_config.h" 18 | 19 | #include "aom/aom_integer.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | #if HAVE_DSPR2 25 | #define CROP_WIDTH 512 26 | 27 | extern uint8_t *aom_ff_cropTbl; // From "aom_dsp/mips/intrapred4_dspr2.c" 28 | 29 | static INLINE void prefetch_load(const unsigned char *src) { 30 | __asm__ __volatile__("pref 0, 0(%[src]) \n\t" : : [src] "r"(src)); 31 | } 32 | 33 | /* prefetch data for store */ 34 | static INLINE void prefetch_store(unsigned char *dst) { 35 | __asm__ __volatile__("pref 1, 0(%[dst]) \n\t" : : [dst] "r"(dst)); 36 | } 37 | 38 | static INLINE void prefetch_load_streamed(const unsigned char *src) { 39 | __asm__ __volatile__("pref 4, 0(%[src]) \n\t" : : [src] "r"(src)); 40 | } 41 | 42 | /* prefetch data for store */ 43 | static INLINE void prefetch_store_streamed(unsigned char *dst) { 44 | __asm__ __volatile__("pref 5, 0(%[dst]) \n\t" : : [dst] "r"(dst)); 45 | } 46 | #endif // #if HAVE_DSPR2 47 | #ifdef __cplusplus 48 | } // extern "C" 49 | #endif 50 | 51 | #endif // AOM_AOM_DSP_MIPS_COMMON_DSPR2_H_ 52 | -------------------------------------------------------------------------------- /libaom/apps/aomenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_APPS_AOMENC_H_ 12 | #define AOM_APPS_AOMENC_H_ 13 | 14 | #include "aom/aom_encoder.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | enum TestDecodeFatality { 21 | TEST_DECODE_OFF, 22 | TEST_DECODE_FATAL, 23 | TEST_DECODE_WARN, 24 | }; 25 | 26 | typedef enum { 27 | I420, // 4:2:0 8+ bit-depth 28 | I422, // 4:2:2 8+ bit-depth 29 | I444, // 4:4:4 8+ bit-depth 30 | YV12, // 4:2:0 with uv flipped, only 8-bit depth 31 | } ColorInputType; 32 | 33 | struct AvxInterface; 34 | 35 | /* Configuration elements common to all streams. */ 36 | struct AvxEncoderConfig { 37 | const struct AvxInterface *codec; 38 | int passes; 39 | int pass; 40 | int usage; 41 | ColorInputType color_type; 42 | int quiet; 43 | int verbose; 44 | int limit; 45 | int skip_frames; 46 | int show_psnr; 47 | enum TestDecodeFatality test_decode; 48 | int have_framerate; 49 | struct aom_rational framerate; 50 | int debug; 51 | int show_q_hist_buckets; 52 | int show_rate_hist_buckets; 53 | int disable_warnings; 54 | int disable_warning_prompt; 55 | int experimental_bitstream; 56 | aom_chroma_sample_position_t csp; 57 | }; 58 | 59 | #ifdef __cplusplus 60 | } // extern "C" 61 | #endif 62 | 63 | #endif // AOM_APPS_AOMENC_H_ 64 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/mem_sse2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_X86_MEM_SSE2_H_ 13 | #define AOM_AOM_DSP_X86_MEM_SSE2_H_ 14 | 15 | #include // SSE2 16 | 17 | #include "config/aom_config.h" 18 | 19 | #include "aom/aom_integer.h" 20 | 21 | static INLINE __m128i loadh_epi64(const void *const src, const __m128i s) { 22 | return _mm_castps_si128( 23 | _mm_loadh_pi(_mm_castsi128_ps(s), (const __m64 *)src)); 24 | } 25 | 26 | static INLINE __m128i load_8bit_4x4_to_1_reg_sse2(const void *const src, 27 | const int byte_stride) { 28 | return _mm_setr_epi32(*(const int32_t *)((int8_t *)src + 0 * byte_stride), 29 | *(const int32_t *)((int8_t *)src + 1 * byte_stride), 30 | *(const int32_t *)((int8_t *)src + 2 * byte_stride), 31 | *(const int32_t *)((int8_t *)src + 3 * byte_stride)); 32 | } 33 | 34 | static INLINE __m128i load_8bit_8x2_to_1_reg_sse2(const void *const src, 35 | const int byte_stride) { 36 | __m128i dst; 37 | dst = _mm_loadl_epi64((__m128i *)((int8_t *)src + 0 * byte_stride)); 38 | dst = loadh_epi64((int8_t *)src + 1 * byte_stride, dst); 39 | return dst; 40 | } 41 | 42 | #endif // AOM_AOM_DSP_X86_MEM_SSE2_H_ 43 | -------------------------------------------------------------------------------- /libaom/aom_dsp/binary_codes_reader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_BINARY_CODES_READER_H_ 13 | #define AOM_AOM_DSP_BINARY_CODES_READER_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #include 20 | 21 | #include "config/aom_config.h" 22 | 23 | #include "aom/aom_integer.h" 24 | #include "aom_dsp/bitreader.h" 25 | #include "aom_dsp/bitreader_buffer.h" 26 | 27 | #define aom_read_primitive_quniform(r, n, ACCT_STR_NAME) \ 28 | aom_read_primitive_quniform_(r, n ACCT_STR_ARG(ACCT_STR_NAME)) 29 | #define aom_read_primitive_subexpfin(r, n, k, ACCT_STR_NAME) \ 30 | aom_read_primitive_subexpfin_(r, n, k ACCT_STR_ARG(ACCT_STR_NAME)) 31 | #define aom_read_primitive_refsubexpfin(r, n, k, ref, ACCT_STR_NAME) \ 32 | aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME)) 33 | 34 | uint16_t aom_read_primitive_quniform_(aom_reader *r, uint16_t n ACCT_STR_PARAM); 35 | uint16_t aom_read_primitive_subexpfin_(aom_reader *r, uint16_t n, 36 | uint16_t k ACCT_STR_PARAM); 37 | uint16_t aom_read_primitive_refsubexpfin_(aom_reader *r, uint16_t n, uint16_t k, 38 | uint16_t ref ACCT_STR_PARAM); 39 | 40 | #ifdef __cplusplus 41 | } // extern "C" 42 | #endif 43 | 44 | #endif // AOM_AOM_DSP_BINARY_CODES_READER_H_ 45 | -------------------------------------------------------------------------------- /libaom/av1/common/idct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_COMMON_IDCT_H_ 13 | #define AOM_AV1_COMMON_IDCT_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include "av1/common/blockd.h" 18 | #include "av1/common/common.h" 19 | #include "av1/common/enums.h" 20 | #include "aom_dsp/txfm_common.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | typedef void (*transform_1d)(const tran_low_t *, tran_low_t *); 27 | 28 | typedef struct { 29 | transform_1d cols, rows; // vertical and horizontal 30 | } transform_2d; 31 | 32 | #define MAX_TX_SCALE 1 33 | int av1_get_tx_scale(const TX_SIZE tx_size); 34 | 35 | void av1_inverse_transform_block(const MACROBLOCKD *xd, 36 | const tran_low_t *dqcoeff, int plane, 37 | TX_TYPE tx_type, TX_SIZE tx_size, uint8_t *dst, 38 | int stride, int eob, int reduced_tx_set); 39 | void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, 40 | int eob, int bd); 41 | 42 | static INLINE const int32_t *cast_to_int32(const tran_low_t *input) { 43 | assert(sizeof(int32_t) == sizeof(tran_low_t)); 44 | return (const int32_t *)input; 45 | } 46 | 47 | #ifdef __cplusplus 48 | } // extern "C" 49 | #endif 50 | 51 | #endif // AOM_AV1_COMMON_IDCT_H_ 52 | -------------------------------------------------------------------------------- /libaom/common/video_writer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_COMMON_VIDEO_WRITER_H_ 13 | #define AOM_COMMON_VIDEO_WRITER_H_ 14 | 15 | #include "common/video_common.h" 16 | 17 | enum { kContainerIVF } UENUM1BYTE(AvxContainer); 18 | 19 | struct AvxVideoWriterStruct; 20 | typedef struct AvxVideoWriterStruct AvxVideoWriter; 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | // Finds and opens writer for specified container format. 27 | // Returns an opaque AvxVideoWriter* upon success, or NULL upon failure. 28 | // Right now only IVF format is supported. 29 | AvxVideoWriter *aom_video_writer_open(const char *filename, 30 | AvxContainer container, 31 | const AvxVideoInfo *info); 32 | 33 | // Frees all resources associated with AvxVideoWriter* returned from 34 | // aom_video_writer_open() call. 35 | void aom_video_writer_close(AvxVideoWriter *writer); 36 | 37 | // Writes frame bytes to the file. 38 | int aom_video_writer_write_frame(AvxVideoWriter *writer, const uint8_t *buffer, 39 | size_t size, int64_t pts); 40 | // Set fourcc. 41 | void aom_video_writer_set_fourcc(AvxVideoWriter *writer, uint32_t fourcc); 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // AOM_COMMON_VIDEO_WRITER_H_ 48 | -------------------------------------------------------------------------------- /libaom/aom_dsp/x86/masked_sad_intrin_ssse3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_X86_MASKED_SAD_INTRIN_SSSE3_H_ 13 | #define AOM_AOM_DSP_X86_MASKED_SAD_INTRIN_SSSE3_H_ 14 | 15 | unsigned int aom_masked_sad8xh_ssse3(const uint8_t *src_ptr, int src_stride, 16 | const uint8_t *a_ptr, int a_stride, 17 | const uint8_t *b_ptr, int b_stride, 18 | const uint8_t *m_ptr, int m_stride, 19 | int height); 20 | 21 | unsigned int aom_masked_sad4xh_ssse3(const uint8_t *src_ptr, int src_stride, 22 | const uint8_t *a_ptr, int a_stride, 23 | const uint8_t *b_ptr, int b_stride, 24 | const uint8_t *m_ptr, int m_stride, 25 | int height); 26 | 27 | unsigned int aom_highbd_masked_sad4xh_ssse3(const uint8_t *src8, int src_stride, 28 | const uint8_t *a8, int a_stride, 29 | const uint8_t *b8, int b_stride, 30 | const uint8_t *m_ptr, int m_stride, 31 | int height); 32 | 33 | #endif // AOM_AOM_DSP_X86_MASKED_SAD_INTRIN_SSSE3_H_ 34 | -------------------------------------------------------------------------------- /libaom/av1/common/alloccommon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_COMMON_ALLOCCOMMON_H_ 13 | #define AOM_AV1_COMMON_ALLOCCOMMON_H_ 14 | 15 | #define INVALID_IDX -1 // Invalid buffer index. 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | struct AV1Common; 22 | struct BufferPool; 23 | 24 | void av1_remove_common(struct AV1Common *cm); 25 | 26 | int av1_alloc_above_context_buffers(struct AV1Common *cm, 27 | int num_alloc_above_contexts); 28 | void av1_free_above_context_buffers(struct AV1Common *cm, 29 | int num_free_above_contexts); 30 | int av1_alloc_context_buffers(struct AV1Common *cm, int width, int height); 31 | void av1_init_context_buffers(struct AV1Common *cm); 32 | void av1_free_context_buffers(struct AV1Common *cm); 33 | 34 | void av1_free_ref_frame_buffers(struct BufferPool *pool); 35 | void av1_alloc_restoration_buffers(struct AV1Common *cm); 36 | void av1_free_restoration_buffers(struct AV1Common *cm); 37 | 38 | int av1_alloc_state_buffers(struct AV1Common *cm, int width, int height); 39 | void av1_free_state_buffers(struct AV1Common *cm); 40 | 41 | void av1_set_mb_mi(struct AV1Common *cm, int width, int height); 42 | int av1_get_MBs(int width, int height); 43 | 44 | #ifdef __cplusplus 45 | } // extern "C" 46 | #endif 47 | 48 | #endif // AOM_AV1_COMMON_ALLOCCOMMON_H_ 49 | -------------------------------------------------------------------------------- /libaom/test/test_data_download_worker.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | include("${AOM_ROOT}/test/test_data_util.cmake") 12 | 13 | # https://github.com/cheshirekow/cmake_format/issues/34 14 | # cmake-format: off 15 | if (NOT AOM_ROOT OR NOT AOM_CONFIG_DIR OR NOT AOM_TEST_FILE 16 | OR NOT AOM_TEST_CHECKSUM) 17 | message(FATAL_ERROR 18 | "AOM_ROOT, AOM_CONFIG_DIR, AOM_TEST_FILE and AOM_TEST_CHECKSUM must be 19 | defined.") 20 | endif () 21 | # cmake-format: on 22 | 23 | set(AOM_TEST_DATA_URL "http://storage.googleapis.com/aom-test-data") 24 | 25 | if(NOT AOM_TEST_DATA_PATH) 26 | set(AOM_TEST_DATA_PATH "$ENV{LIBAOM_TEST_DATA_PATH}") 27 | endif() 28 | 29 | if("${AOM_TEST_DATA_PATH}" STREQUAL "") 30 | message(WARNING 31 | "Writing test data to ${AOM_CONFIG_DIR}, set " 32 | "$LIBAOM_TEST_DATA_PATH in your environment to avoid this warning.") 33 | set(AOM_TEST_DATA_PATH "${AOM_CONFIG_DIR}") 34 | endif() 35 | 36 | if(NOT EXISTS "${AOM_TEST_DATA_PATH}") 37 | file(MAKE_DIRECTORY "${AOM_TEST_DATA_PATH}") 38 | endif() 39 | 40 | expand_test_file_paths("AOM_TEST_FILE" "${AOM_TEST_DATA_PATH}" "filepath") 41 | expand_test_file_paths("AOM_TEST_FILE" "${AOM_TEST_DATA_URL}" "url") 42 | 43 | check_file("${filepath}" "${AOM_TEST_CHECKSUM}" "needs_download") 44 | if(needs_download) 45 | download_test_file("${url}" "${AOM_TEST_CHECKSUM}" "${filepath}") 46 | endif() 47 | -------------------------------------------------------------------------------- /libaom/aom_dsp/subtract.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | 14 | #include "config/aom_config.h" 15 | #include "config/aom_dsp_rtcd.h" 16 | 17 | #include "aom/aom_integer.h" 18 | #include "aom_ports/mem.h" 19 | 20 | void aom_subtract_block_c(int rows, int cols, int16_t *diff, 21 | ptrdiff_t diff_stride, const uint8_t *src, 22 | ptrdiff_t src_stride, const uint8_t *pred, 23 | ptrdiff_t pred_stride) { 24 | int r, c; 25 | 26 | for (r = 0; r < rows; r++) { 27 | for (c = 0; c < cols; c++) diff[c] = src[c] - pred[c]; 28 | 29 | diff += diff_stride; 30 | pred += pred_stride; 31 | src += src_stride; 32 | } 33 | } 34 | 35 | void aom_highbd_subtract_block_c(int rows, int cols, int16_t *diff, 36 | ptrdiff_t diff_stride, const uint8_t *src8, 37 | ptrdiff_t src_stride, const uint8_t *pred8, 38 | ptrdiff_t pred_stride, int bd) { 39 | int r, c; 40 | uint16_t *src = CONVERT_TO_SHORTPTR(src8); 41 | uint16_t *pred = CONVERT_TO_SHORTPTR(pred8); 42 | (void)bd; 43 | 44 | for (r = 0; r < rows; r++) { 45 | for (c = 0; c < cols; c++) { 46 | diff[c] = src[c] - pred[c]; 47 | } 48 | 49 | diff += diff_stride; 50 | pred += pred_stride; 51 | src += src_stride; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /libaom/aom_scale/aom_scale.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_AOM_SCALE_AOM_SCALE_CMAKE_) 12 | return() 13 | endif() # AOM_AOM_SCALE_AOM_SCALE_CMAKE_ 14 | set(AOM_AOM_SCALE_AOM_SCALE_CMAKE_ 1) 15 | 16 | list(APPEND AOM_SCALE_SOURCES "${AOM_ROOT}/aom_scale/aom_scale.h" 17 | "${AOM_ROOT}/aom_scale/generic/aom_scale.c" 18 | "${AOM_ROOT}/aom_scale/generic/gen_scalers.c" 19 | "${AOM_ROOT}/aom_scale/generic/yv12config.c" 20 | "${AOM_ROOT}/aom_scale/generic/yv12extend.c" 21 | "${AOM_ROOT}/aom_scale/yv12config.h") 22 | 23 | list(APPEND AOM_SCALE_INTRIN_DSPR2 24 | "${AOM_ROOT}/aom_scale/mips/dspr2/yv12extend_dspr2.c") 25 | 26 | # Creates the aom_scale build target and makes libaom depend on it. The libaom 27 | # target must exist before this function is called. 28 | function(setup_aom_scale_targets) 29 | add_library(aom_scale OBJECT ${AOM_SCALE_SOURCES}) 30 | target_sources(aom PRIVATE $) 31 | 32 | if(HAVE_DSPR2) 33 | add_intrinsics_object_library("" "dspr2" "aom_scale" 34 | "AOM_SCALE_INTRIN_DSPR2" "aom") 35 | endif() 36 | 37 | target_sources(aom PRIVATE $) 38 | 39 | # Pass the new lib targets up to the parent scope instance of 40 | # $AOM_LIB_TARGETS. 41 | set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_scale PARENT_SCOPE) 42 | endfunction() 43 | --------------------------------------------------------------------------------