├── .clang-format ├── .cmake-format.py ├── .gitattributes ├── .gitignore ├── .mailmap ├── AUTHORS ├── CHANGELOG ├── CMakeLists.txt ├── LICENSE ├── PATENTS ├── README.md ├── aom ├── aom.h ├── aom_codec.h ├── aom_decoder.h ├── aom_encoder.h ├── aom_frame_buffer.h ├── aom_image.h ├── aom_integer.h ├── aomcx.h ├── aomdx.h ├── exports_com ├── exports_dec ├── exports_enc ├── internal │ └── aom_codec_internal.h └── src │ ├── aom_codec.c │ ├── aom_decoder.c │ ├── aom_encoder.c │ ├── aom_image.c │ └── aom_integer.c ├── aom_dsp ├── add_noise.c ├── aom_convolve.c ├── aom_convolve.h ├── aom_dsp.cmake ├── aom_dsp_common.h ├── aom_dsp_rtcd.c ├── aom_dsp_rtcd_defs.pl ├── aom_filter.h ├── aom_simd.h ├── aom_simd_inline.h ├── arm │ ├── blend_a64_mask_neon.c │ ├── fwd_txfm_neon.c │ ├── intrapred_neon.c │ ├── loopfilter_neon.c │ ├── sad4d_neon.c │ ├── sad_neon.c │ ├── subpel_variance_neon.c │ ├── subtract_neon.c │ └── variance_neon.c ├── binary_codes_reader.c ├── binary_codes_reader.h ├── binary_codes_writer.c ├── binary_codes_writer.h ├── bitreader.h ├── bitreader_buffer.c ├── bitreader_buffer.h ├── bitwriter.h ├── bitwriter_buffer.c ├── bitwriter_buffer.h ├── blend.h ├── blend_a64_hmask.c ├── blend_a64_mask.c ├── blend_a64_vmask.c ├── buf_ans.c ├── buf_ans.h ├── daalaboolreader.c ├── daalaboolreader.h ├── daalaboolwriter.c ├── daalaboolwriter.h ├── entcode.c ├── entcode.h ├── entdec.c ├── entdec.h ├── entenc.c ├── entenc.h ├── fastssim.c ├── fft.c ├── fft_common.h ├── fwd_txfm.c ├── grain_synthesis.c ├── grain_synthesis.h ├── grain_table.c ├── grain_table.h ├── intrapred.c ├── intrapred_common.h ├── loopfilter.c ├── mips │ ├── add_noise_msa.c │ ├── aom_convolve8_horiz_msa.c │ ├── aom_convolve8_vert_msa.c │ ├── aom_convolve_copy_msa.c │ ├── aom_convolve_msa.h │ ├── common_dspr2.c │ ├── common_dspr2.h │ ├── convolve2_dspr2.c │ ├── convolve2_horiz_dspr2.c │ ├── convolve2_vert_dspr2.c │ ├── convolve8_dspr2.c │ ├── convolve8_horiz_dspr2.c │ ├── convolve8_vert_dspr2.c │ ├── convolve_common_dspr2.h │ ├── intrapred16_dspr2.c │ ├── intrapred4_dspr2.c │ ├── intrapred8_dspr2.c │ ├── intrapred_msa.c │ ├── loopfilter_16_msa.c │ ├── loopfilter_4_msa.c │ ├── loopfilter_8_msa.c │ ├── loopfilter_filters_dspr2.c │ ├── loopfilter_filters_dspr2.h │ ├── loopfilter_macros_dspr2.h │ ├── loopfilter_masks_dspr2.h │ ├── loopfilter_mb_dspr2.c │ ├── loopfilter_mb_horiz_dspr2.c │ ├── loopfilter_mb_vert_dspr2.c │ ├── loopfilter_msa.h │ ├── macros_msa.h │ ├── sad_msa.c │ ├── sub_pixel_variance_msa.c │ ├── subtract_msa.c │ └── variance_msa.c ├── noise_model.c ├── noise_model.h ├── noise_util.c ├── noise_util.h ├── postproc.h ├── prob.h ├── psnr.c ├── psnr.h ├── psnrhvs.c ├── quantize.c ├── quantize.h ├── sad.c ├── sad_av1.c ├── simd │ ├── v128_intrinsics.h │ ├── v128_intrinsics_arm.h │ ├── v128_intrinsics_c.h │ ├── v128_intrinsics_x86.h │ ├── v256_intrinsics.h │ ├── v256_intrinsics_arm.h │ ├── v256_intrinsics_c.h │ ├── v256_intrinsics_v128.h │ ├── v256_intrinsics_x86.h │ ├── v64_intrinsics.h │ ├── v64_intrinsics_arm.h │ ├── v64_intrinsics_c.h │ └── v64_intrinsics_x86.h ├── ssim.c ├── ssim.h ├── subtract.c ├── sum_squares.c ├── txfm_common.h ├── variance.c ├── variance.h └── x86 │ ├── aom_asm_stubs.c │ ├── aom_convolve_copy_sse2.asm │ ├── aom_high_subpixel_8t_sse2.asm │ ├── aom_high_subpixel_bilinear_sse2.asm │ ├── aom_subpixel_8t_intrin_avx2.c │ ├── aom_subpixel_8t_intrin_ssse3.c │ ├── aom_subpixel_8t_sse2.asm │ ├── aom_subpixel_8t_ssse3.asm │ ├── aom_subpixel_bilinear_sse2.asm │ ├── aom_subpixel_bilinear_ssse3.asm │ ├── blend_a64_hmask_sse4.c │ ├── blend_a64_mask_sse4.c │ ├── blend_a64_vmask_sse4.c │ ├── blend_sse4.h │ ├── common_avx2.h │ ├── convolve.h │ ├── convolve_avx2.h │ ├── convolve_common_intrin.h │ ├── convolve_sse2.h │ ├── convolve_sse4_1.h │ ├── fft_avx2.c │ ├── fft_sse2.c │ ├── fwd_txfm_impl_sse2.h │ ├── fwd_txfm_sse2.c │ ├── fwd_txfm_sse2.h │ ├── fwd_txfm_ssse3_x86_64.asm │ ├── halfpix_variance_impl_sse2.asm │ ├── halfpix_variance_sse2.c │ ├── highbd_convolve_avx2.c │ ├── highbd_convolve_ssse3.c │ ├── highbd_intrapred_sse2.asm │ ├── highbd_intrapred_sse2.c │ ├── highbd_loopfilter_avx2.c │ ├── highbd_loopfilter_sse2.c │ ├── highbd_quantize_intrin_avx2.c │ ├── highbd_quantize_intrin_sse2.c │ ├── highbd_sad4d_sse2.asm │ ├── highbd_sad_sse2.asm │ ├── highbd_subpel_variance_impl_sse2.asm │ ├── highbd_subtract_sse2.c │ ├── highbd_variance_impl_sse2.asm │ ├── highbd_variance_sse2.c │ ├── highbd_variance_sse4.c │ ├── intrapred_avx2.c │ ├── intrapred_sse2.asm │ ├── intrapred_sse2.c │ ├── intrapred_ssse3.c │ ├── inv_wht_sse2.asm │ ├── jnt_sad_ssse3.c │ ├── jnt_variance_ssse3.c │ ├── loopfilter_avx2.c │ ├── loopfilter_sse2.c │ ├── lpf_common_sse2.h │ ├── masked_sad_intrin_ssse3.c │ ├── masked_variance_intrin_ssse3.c │ ├── masked_variance_intrin_ssse3.h │ ├── mem_sse2.h │ ├── obmc_intrinsic_ssse3.h │ ├── obmc_sad_sse4.c │ ├── obmc_variance_sse4.c │ ├── quantize_avx_x86_64.asm │ ├── quantize_sse2.c │ ├── quantize_ssse3_x86_64.asm │ ├── sad4d_avx2.c │ ├── sad4d_sse2.asm │ ├── sad_avx2.c │ ├── sad_highbd_avx2.c │ ├── sad_impl_avx2.c │ ├── sad_sse2.asm │ ├── ssim_opt_x86_64.asm │ ├── subpel_variance_sse2.asm │ ├── subtract_sse2.asm │ ├── sum_squares_sse2.c │ ├── synonyms.h │ ├── synonyms_avx2.h │ ├── transpose_sse2.h │ ├── txfm_common_sse2.h │ ├── variance_avx2.c │ ├── variance_impl_avx2.c │ └── variance_sse2.c ├── aom_mem ├── aom_mem.c ├── aom_mem.cmake ├── aom_mem.h └── include │ └── aom_mem_intrnl.h ├── aom_ports ├── aom_once.h ├── aom_ports.cmake ├── aom_timer.h ├── arm.h ├── arm_cpudetect.c ├── bitops.h ├── emmintrin_compat.h ├── emms.asm ├── mem.h ├── mem_ops.h ├── mem_ops_aligned.h ├── msvc.h ├── ppc.h ├── ppc_cpudetect.c ├── sanitizer.h ├── system_state.h ├── x86.h └── x86_abi_support.asm ├── aom_scale ├── aom_scale.cmake ├── aom_scale.h ├── aom_scale_rtcd.c ├── aom_scale_rtcd.pl ├── generic │ ├── aom_scale.c │ ├── gen_scalers.c │ ├── yv12config.c │ └── yv12extend.c ├── mips │ └── dspr2 │ │ └── yv12extend_dspr2.c └── yv12config.h ├── aom_util ├── aom_thread.c ├── aom_thread.h ├── aom_util.cmake ├── debug_util.c ├── debug_util.h └── endian_inl.h ├── apps ├── aomdec.c ├── aomenc.c └── aomenc.h ├── av1 ├── av1.cmake ├── av1_cx_iface.c ├── av1_dx_iface.c ├── av1_iface_common.h ├── common │ ├── alloccommon.c │ ├── alloccommon.h │ ├── arm │ │ ├── av1_txfm_neon.c │ │ ├── blend_a64_hmask_neon.c │ │ ├── blend_a64_vmask_neon.c │ │ ├── cfl_neon.c │ │ ├── convolve_neon.c │ │ ├── convolve_neon.h │ │ ├── intrapred_neon.c │ │ ├── jnt_convolve_neon.c │ │ ├── mem_neon.h │ │ ├── reconinter_neon.c │ │ ├── transpose_neon.h │ │ └── wiener_convolve_neon.c │ ├── av1_inv_txfm1d.c │ ├── av1_inv_txfm1d.h │ ├── av1_inv_txfm1d_cfg.h │ ├── av1_inv_txfm2d.c │ ├── av1_loopfilter.c │ ├── av1_loopfilter.h │ ├── av1_rtcd.c │ ├── av1_rtcd_defs.pl │ ├── av1_txfm.c │ ├── av1_txfm.h │ ├── blockd.c │ ├── blockd.h │ ├── cdef.c │ ├── cdef.h │ ├── cdef_block.c │ ├── cdef_block.h │ ├── cdef_block_avx2.c │ ├── cdef_block_neon.c │ ├── cdef_block_simd.h │ ├── cdef_block_sse2.c │ ├── cdef_block_sse4.c │ ├── cdef_block_ssse3.c │ ├── cfl.c │ ├── cfl.h │ ├── common.h │ ├── common_data.h │ ├── convolve.c │ ├── convolve.h │ ├── debugmodes.c │ ├── entropy.c │ ├── entropy.h │ ├── entropymode.c │ ├── entropymode.h │ ├── entropymv.c │ ├── entropymv.h │ ├── enums.h │ ├── filter.c │ ├── filter.h │ ├── frame_buffers.c │ ├── frame_buffers.h │ ├── idct.c │ ├── idct.h │ ├── mv.h │ ├── mvref_common.c │ ├── mvref_common.h │ ├── obmc.h │ ├── odintrin.c │ ├── odintrin.h │ ├── onyxc_int.h │ ├── ppc │ │ └── cfl_ppc.c │ ├── pred_common.c │ ├── pred_common.h │ ├── quant_common.c │ ├── quant_common.h │ ├── reconinter.c │ ├── reconinter.h │ ├── reconintra.c │ ├── reconintra.h │ ├── resize.c │ ├── resize.h │ ├── restoration.c │ ├── restoration.h │ ├── scale.c │ ├── scale.h │ ├── scan.c │ ├── scan.h │ ├── seg_common.c │ ├── seg_common.h │ ├── thread_common.c │ ├── thread_common.h │ ├── tile_common.c │ ├── tile_common.h │ ├── timing.c │ ├── timing.h │ ├── token_cdfs.h │ ├── txb_common.c │ ├── txb_common.h │ ├── warped_motion.c │ ├── warped_motion.h │ └── x86 │ │ ├── av1_convolve_horiz_rs_sse4.c │ │ ├── av1_convolve_scale_sse4.c │ │ ├── av1_highbd_convolve_sse4.c │ │ ├── av1_inv_txfm_avx2.c │ │ ├── av1_inv_txfm_avx2.h │ │ ├── av1_inv_txfm_ssse3.c │ │ ├── av1_inv_txfm_ssse3.h │ │ ├── av1_txfm_sse2.h │ │ ├── av1_txfm_sse4.c │ │ ├── av1_txfm_sse4.h │ │ ├── cfl_avx2.c │ │ ├── cfl_simd.h │ │ ├── cfl_sse2.c │ │ ├── cfl_ssse3.c │ │ ├── convolve_2d_avx2.c │ │ ├── convolve_2d_sse2.c │ │ ├── convolve_avx2.c │ │ ├── convolve_sse2.c │ │ ├── filterintra_sse4.c │ │ ├── highbd_convolve_2d_avx2.c │ │ ├── highbd_convolve_2d_sse2.c │ │ ├── highbd_convolve_2d_sse4.c │ │ ├── highbd_convolve_2d_ssse3.c │ │ ├── highbd_inv_txfm_avx2.c │ │ ├── highbd_inv_txfm_sse4.c │ │ ├── highbd_jnt_convolve_avx2.c │ │ ├── highbd_jnt_convolve_sse4.c │ │ ├── highbd_txfm_utility_sse4.h │ │ ├── highbd_warp_plane_sse4.c │ │ ├── highbd_wiener_convolve_avx2.c │ │ ├── highbd_wiener_convolve_ssse3.c │ │ ├── intra_edge_sse4.c │ │ ├── jnt_convolve_avx2.c │ │ ├── jnt_convolve_sse2.c │ │ ├── jnt_convolve_ssse3.c │ │ ├── reconinter_avx2.c │ │ ├── reconinter_sse4.c │ │ ├── reconinter_ssse3.c │ │ ├── selfguided_avx2.c │ │ ├── selfguided_sse4.c │ │ ├── warp_plane_sse4.c │ │ ├── wiener_convolve_avx2.c │ │ └── wiener_convolve_sse2.c ├── decoder │ ├── accounting.c │ ├── accounting.h │ ├── decodeframe.c │ ├── decodeframe.h │ ├── decodemv.c │ ├── decodemv.h │ ├── decoder.c │ ├── decoder.h │ ├── decodetxb.c │ ├── decodetxb.h │ ├── detokenize.c │ ├── detokenize.h │ ├── dthread.c │ ├── dthread.h │ ├── inspection.c │ ├── inspection.h │ ├── obu.c │ └── obu.h ├── encoder │ ├── ab_partition_model_weights.h │ ├── aq_complexity.c │ ├── aq_complexity.h │ ├── aq_cyclicrefresh.c │ ├── aq_cyclicrefresh.h │ ├── aq_variance.c │ ├── aq_variance.h │ ├── arm │ │ └── neon │ │ │ └── quantize_neon.c │ ├── av1_fwd_txfm1d.c │ ├── av1_fwd_txfm1d.h │ ├── av1_fwd_txfm1d_cfg.h │ ├── av1_fwd_txfm2d.c │ ├── av1_quantize.c │ ├── av1_quantize.h │ ├── bitstream.c │ ├── bitstream.h │ ├── block.h │ ├── blockiness.c │ ├── context_tree.c │ ├── context_tree.h │ ├── corner_detect.c │ ├── corner_detect.h │ ├── corner_match.c │ ├── corner_match.h │ ├── cost.c │ ├── cost.h │ ├── dwt.c │ ├── dwt.h │ ├── encodeframe.c │ ├── encodeframe.h │ ├── encodemb.c │ ├── encodemb.h │ ├── encodemv.c │ ├── encodemv.h │ ├── encoder.c │ ├── encoder.h │ ├── encodetxb.c │ ├── encodetxb.h │ ├── ethread.c │ ├── ethread.h │ ├── extend.c │ ├── extend.h │ ├── firstpass.c │ ├── firstpass.h │ ├── global_motion.c │ ├── global_motion.h │ ├── grain_test_vectors.h │ ├── hash.c │ ├── hash.h │ ├── hash_motion.c │ ├── hash_motion.h │ ├── hybrid_fwd_txfm.c │ ├── hybrid_fwd_txfm.h │ ├── k_means_template.h │ ├── lookahead.c │ ├── lookahead.h │ ├── mathutils.h │ ├── mbgraph.c │ ├── mbgraph.h │ ├── mcomp.c │ ├── mcomp.h │ ├── mips │ │ └── msa │ │ │ ├── error_msa.c │ │ │ ├── fdct4x4_msa.c │ │ │ └── temporal_filter_msa.c │ ├── ml.c │ ├── ml.h │ ├── palette.c │ ├── palette.h │ ├── pickcdef.c │ ├── picklpf.c │ ├── picklpf.h │ ├── pickrst.c │ ├── pickrst.h │ ├── pustats.h │ ├── random.h │ ├── ransac.c │ ├── ransac.h │ ├── ratectrl.c │ ├── ratectrl.h │ ├── ratectrl_xiph.c │ ├── ratectrl_xiph.h │ ├── rd.c │ ├── rd.h │ ├── rdopt.c │ ├── rdopt.h │ ├── segmentation.c │ ├── segmentation.h │ ├── speed_features.c │ ├── speed_features.h │ ├── temporal_filter.c │ ├── temporal_filter.h │ ├── tokenize.c │ ├── tokenize.h │ ├── tx_prune_model_weights.h │ ├── wedge_utils.c │ └── x86 │ │ ├── av1_fwd_txfm1d_sse4.c │ │ ├── av1_fwd_txfm2d_sse4.c │ │ ├── av1_fwd_txfm_sse2.c │ │ ├── av1_fwd_txfm_sse2.h │ │ ├── av1_highbd_quantize_avx2.c │ │ ├── av1_highbd_quantize_sse4.c │ │ ├── av1_quantize_avx2.c │ │ ├── av1_quantize_sse2.c │ │ ├── av1_quantize_ssse3_x86_64.asm │ │ ├── av1_ssim_opt_x86_64.asm │ │ ├── av1_txfm1d_sse4.h │ │ ├── corner_match_sse4.c │ │ ├── dct_sse2.asm │ │ ├── encodetxb_sse2.c │ │ ├── encodetxb_sse4.c │ │ ├── error_intrin_avx2.c │ │ ├── error_sse2.asm │ │ ├── hash_sse42.c │ │ ├── highbd_block_error_intrin_sse2.c │ │ ├── highbd_fwd_txfm_sse4.c │ │ ├── temporal_filter_apply_sse2.asm │ │ └── wedge_utils_sse2.c ├── exports_dec └── exports_enc ├── build ├── .gitattributes ├── .gitignore ├── cmake │ ├── aom_config.c.template │ ├── aom_config_defaults.cmake │ ├── aom_configure.cmake │ ├── aom_experiment_deps.cmake │ ├── aom_optimization.cmake │ ├── compiler_flags.cmake │ ├── compiler_tests.cmake │ ├── cpu.cmake │ ├── dist.cmake │ ├── exports.cmake │ ├── exports_sources.cmake │ ├── generate_aom_config_templates.cmake │ ├── generate_exports.cmake │ ├── msvc_runtime.cmake │ ├── pkg_config.cmake │ ├── sanitizers.cmake │ ├── toolchains │ │ ├── arm-ios-common.cmake │ │ ├── arm64-ios.cmake │ │ ├── arm64-linux-gcc.cmake │ │ ├── arm64-mingw-gcc.cmake │ │ ├── armv7-ios.cmake │ │ ├── armv7-linux-gcc.cmake │ │ ├── armv7-mingw-gcc.cmake │ │ ├── armv7s-ios.cmake │ │ ├── ios-simulator-common.cmake │ │ ├── mips32-linux-gcc.cmake │ │ ├── mips64-linux-gcc.cmake │ │ ├── ppc-linux-gcc.cmake │ │ ├── x86-ios-simulator.cmake │ │ ├── x86-linux.cmake │ │ ├── x86-macos.cmake │ │ ├── x86-mingw-gcc.cmake │ │ ├── x86_64-ios-simulator.cmake │ │ └── x86_64-mingw-gcc.cmake │ ├── util.cmake │ ├── version.cmake │ └── version.pl └── make │ ├── ios-Info.plist │ ├── iosbuild.sh │ ├── rtcd.pl │ └── thumb.pm ├── codereview.settings ├── common ├── args.c ├── args.h ├── ivfdec.c ├── ivfdec.h ├── ivfenc.c ├── ivfenc.h ├── md5_utils.c ├── md5_utils.h ├── obudec.c ├── obudec.h ├── tools_common.c ├── tools_common.h ├── video_common.h ├── video_reader.c ├── video_reader.h ├── video_writer.c ├── video_writer.h ├── warnings.c ├── warnings.h ├── webmdec.cc ├── webmdec.h ├── webmenc.cc ├── webmenc.h ├── y4menc.c ├── y4menc.h ├── y4minput.c └── y4minput.h ├── docs.cmake ├── examples ├── analyzer.cc ├── aom_cx_set_ref.c ├── decode_to_md5.c ├── decode_with_drops.c ├── encoder_util.c ├── encoder_util.h ├── inspect.c ├── lightfield_bitstream_parsing.c ├── lightfield_decoder.c ├── lightfield_encoder.c ├── lightfield_tile_list_decoder.c ├── lossless_encoder.c ├── noise_model.c ├── resize_util.c ├── scalable_decoder.c ├── scalable_encoder.c ├── set_maps.c ├── simple_decoder.c ├── simple_encoder.c └── twopass_encoder.c ├── keywords.dox ├── libs.doxy_template ├── mainpage.dox ├── stats ├── aomstats.c ├── aomstats.h ├── rate_hist.c └── rate_hist.h ├── test ├── accounting_test.cc ├── acm_random.h ├── active_map_test.cc ├── altref_test.cc ├── aom_integer_test.cc ├── aomcx_set_ref.sh ├── aomdec.sh ├── aomenc.sh ├── aq_segment_test.cc ├── arf_freq_test.cc ├── av1_convolve_2d_test.cc ├── av1_convolve_2d_test_util.cc ├── av1_convolve_2d_test_util.h ├── av1_convolve_scale_test.cc ├── av1_ext_tile_test.cc ├── av1_fwd_txfm1d_test.cc ├── av1_fwd_txfm2d_test.cc ├── av1_highbd_iht_test.cc ├── av1_horz_only_frame_superres_test.cc ├── av1_inv_txfm1d_test.cc ├── av1_inv_txfm2d_test.cc ├── av1_quantize_test.cc ├── av1_round_shift_array_test.cc ├── av1_txfm_test.cc ├── av1_txfm_test.h ├── av1_wedge_utils_test.cc ├── best_encode.sh ├── binary_codes_test.cc ├── blend_a64_mask_1d_test.cc ├── blend_a64_mask_test.cc ├── boolcoder_test.cc ├── borders_test.cc ├── cdef_test.cc ├── cfl_test.cc ├── clear_system_state.h ├── codec_factory.h ├── coding_path_sync.cc ├── comp_avg_pred_test.cc ├── comp_avg_pred_test.h ├── comp_mask_variance_test.cc ├── convolve_round_test.cc ├── convolve_test.cc ├── corner_match_test.cc ├── cpu_speed_test.cc ├── datarate_test.cc ├── decode_api_test.cc ├── decode_multithreaded_test.cc ├── decode_perf_test.cc ├── decode_test_driver.cc ├── decode_test_driver.h ├── decode_to_md5.sh ├── decode_with_drops.sh ├── divu_small_test.cc ├── dr_prediction_test.cc ├── dump_obu.sh ├── ec_test.cc ├── encode_api_test.cc ├── encode_perf_test.cc ├── encode_test_driver.cc ├── encode_test_driver.h ├── encodetxb_test.cc ├── end_to_end_test.cc ├── error_block_test.cc ├── error_resilience_test.cc ├── ethread_test.cc ├── examples.sh ├── fft_test.cc ├── film_grain_table_test.cc ├── filterintra_test.cc ├── frame_size_tests.cc ├── function_equivalence_test.h ├── fwht4x4_test.cc ├── gviz_api.py ├── hash_test.cc ├── hbd_metrics_test.cc ├── hiprec_convolve_test.cc ├── hiprec_convolve_test_util.cc ├── hiprec_convolve_test_util.h ├── horz_superres_test.cc ├── i420_video_source.h ├── intra_edge_test.cc ├── intrabc_test.cc ├── intrapred_test.cc ├── invalid_file_test.cc ├── ivf_video_source.h ├── lossless_test.cc ├── lpf_test.cc ├── masked_sad_test.cc ├── masked_variance_test.cc ├── md5_helper.h ├── metrics_template.html ├── monochrome_test.cc ├── motion_vector_test.cc ├── noise_model_test.cc ├── obmc_sad_test.cc ├── obmc_variance_test.cc ├── onyxc_int_test.cc ├── qm_test.cc ├── quantize_func_test.cc ├── reconinter_test.cc ├── register_state_check.h ├── resize_test.cc ├── run_encodes.sh ├── sad_test.cc ├── scalability_test.cc ├── scan_test.cc ├── segment_binarization_sync.cc ├── selfguided_filter_test.cc ├── set_maps.sh ├── simd_avx2_test.cc ├── simd_cmp_avx2.cc ├── simd_cmp_impl.h ├── simd_cmp_neon.cc ├── simd_cmp_sse2.cc ├── simd_cmp_sse4.cc ├── simd_cmp_ssse3.cc ├── simd_impl.h ├── simd_neon_test.cc ├── simd_sse2_test.cc ├── simd_sse4_test.cc ├── simd_ssse3_test.cc ├── simple_decoder.sh ├── simple_encoder.sh ├── subtract_test.cc ├── sum_squares_test.cc ├── superframe_test.cc ├── test-data.sha1 ├── test.cmake ├── test_data_download_worker.cmake ├── test_data_util.cmake ├── test_intra_pred_speed.cc ├── test_libaom.cc ├── test_runner.cmake ├── test_vector_test.cc ├── test_vectors.cc ├── test_vectors.h ├── tile_independence_test.cc ├── tools_common.sh ├── transform_test_base.h ├── twopass_encoder.sh ├── util.h ├── variance_test.cc ├── video_source.h ├── visual_metrics.py ├── warp_filter_test.cc ├── warp_filter_test_util.cc ├── warp_filter_test_util.h ├── webm_video_source.h ├── y4m_test.cc ├── y4m_video_source.h └── yuv_video_source.h ├── third_party ├── fastfeat │ ├── LICENSE │ ├── README.libvpx │ ├── fast.c │ ├── fast.h │ ├── fast_9.c │ └── nonmax.c ├── googletest │ ├── README.libaom │ ├── gtest.mk │ └── src │ │ └── googletest │ │ ├── CHANGES │ │ ├── CMakeLists.txt │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cmake │ │ └── internal_utils.cmake │ │ ├── include │ │ └── gtest │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-param-test.h.pump │ │ │ ├── gtest-printers.h │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── custom │ │ │ ├── gtest-port.h │ │ │ ├── gtest-printers.h │ │ │ └── gtest.h │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-linked_ptr.h │ │ │ ├── gtest-param-util-generated.h │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port-arch.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ ├── gtest-tuple.h │ │ │ ├── gtest-tuple.h.pump │ │ │ ├── gtest-type-util.h │ │ │ └── gtest-type-util.h.pump │ │ └── src │ │ ├── gtest-all.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-port.cc │ │ ├── gtest-printers.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc ├── libwebm │ ├── AUTHORS.TXT │ ├── Android.mk │ ├── LICENSE.TXT │ ├── PATENTS.TXT │ ├── README.libaom │ ├── common │ │ ├── file_util.cc │ │ ├── file_util.h │ │ ├── hdr_util.cc │ │ ├── hdr_util.h │ │ └── webmids.h │ ├── mkvmuxer │ │ ├── mkvmuxer.cc │ │ ├── mkvmuxer.h │ │ ├── mkvmuxertypes.h │ │ ├── mkvmuxerutil.cc │ │ ├── mkvmuxerutil.h │ │ ├── mkvwriter.cc │ │ └── mkvwriter.h │ └── mkvparser │ │ ├── mkvparser.cc │ │ ├── mkvparser.h │ │ ├── mkvreader.cc │ │ └── mkvreader.h ├── libyuv │ ├── README.libaom │ ├── include │ │ └── libyuv │ │ │ ├── basic_types.h │ │ │ ├── compare.h │ │ │ ├── convert.h │ │ │ ├── convert_argb.h │ │ │ ├── convert_from.h │ │ │ ├── convert_from_argb.h │ │ │ ├── cpu_id.h │ │ │ ├── mjpeg_decoder.h │ │ │ ├── planar_functions.h │ │ │ ├── rotate.h │ │ │ ├── rotate_argb.h │ │ │ ├── rotate_row.h │ │ │ ├── row.h │ │ │ ├── scale.h │ │ │ ├── scale_argb.h │ │ │ ├── scale_row.h │ │ │ ├── version.h │ │ │ └── video_common.h │ └── source │ │ ├── compare.cc │ │ ├── compare_common.cc │ │ ├── compare_gcc.cc │ │ ├── compare_neon.cc │ │ ├── compare_neon64.cc │ │ ├── compare_win.cc │ │ ├── convert.cc │ │ ├── convert_argb.cc │ │ ├── convert_from.cc │ │ ├── convert_from_argb.cc │ │ ├── convert_jpeg.cc │ │ ├── convert_to_argb.cc │ │ ├── convert_to_i420.cc │ │ ├── cpu_id.cc │ │ ├── mjpeg_decoder.cc │ │ ├── mjpeg_validate.cc │ │ ├── planar_functions.cc │ │ ├── rotate.cc │ │ ├── rotate_any.cc │ │ ├── rotate_argb.cc │ │ ├── rotate_common.cc │ │ ├── rotate_gcc.cc │ │ ├── rotate_mips.cc │ │ ├── rotate_neon.cc │ │ ├── rotate_neon64.cc │ │ ├── rotate_win.cc │ │ ├── row_any.cc │ │ ├── row_common.cc │ │ ├── row_gcc.cc │ │ ├── row_mips.cc │ │ ├── row_neon.cc │ │ ├── row_neon64.cc │ │ ├── row_win.cc │ │ ├── row_x86.asm │ │ ├── scale.cc │ │ ├── scale_any.cc │ │ ├── scale_argb.cc │ │ ├── scale_common.cc │ │ ├── scale_gcc.cc │ │ ├── scale_mips.cc │ │ ├── scale_neon.cc │ │ ├── scale_neon64.cc │ │ ├── scale_win.cc │ │ ├── video_common.cc │ │ └── x86inc.asm ├── vector │ ├── vector.c │ └── vector.h └── x86inc │ ├── LICENSE │ ├── README.libaom │ └── x86inc.asm ├── tools ├── aggregate_entropy_stats.py ├── aom_entropy_optimizer.c ├── cpplint.py ├── diff.py ├── dump_obu.cc ├── gen_authors.sh ├── gen_constrained_tokenset.py ├── inspect-cli.js ├── inspect-post.js ├── intersect-diffs.py ├── lint-hunks.py ├── obu_parser.cc ├── obu_parser.h ├── txfm_analyzer │ ├── txfm_gen_code.cc │ ├── txfm_graph.cc │ └── txfm_graph.h └── wrap-commit-msg.py ├── usage.dox ├── usage_cx.dox └── usage_dx.dox /.cmake-format.py: -------------------------------------------------------------------------------- 1 | # How wide to allow formatted cmake files 2 | line_width = 80 3 | 4 | # How many spaces to tab for indent 5 | tab_size = 2 6 | 7 | # If arglists are longer than this, break them always. This introduces some 8 | # interesting effects with complicated 'if' statements. However, we want file 9 | # lists to look reasonable. Try to strike a balance. 10 | max_subargs_per_line = 10 11 | 12 | # If true, separate flow control names from their parentheses with a space 13 | separate_ctrl_name_with_space = False 14 | 15 | # If true, separate function names from parentheses with a space 16 | separate_fn_name_with_space = False 17 | 18 | # If a statement is wrapped to more than one line, than dangle the closing 19 | # parenthesis on it's own line 20 | dangle_parens = False 21 | 22 | # What character to use for bulleted lists 23 | bullet_char = u'*' 24 | 25 | # What character to use as punctuation after numerals in an enumerated list 26 | enum_char = u'.' 27 | 28 | # What style line endings to use in the output. 29 | line_ending = u'unix' 30 | 31 | # Format command names consistently as 'lower' or 'upper' case 32 | command_case = u'lower' 33 | 34 | # Specify structure for custom cmake functions 35 | additional_commands = { 36 | "foo": { 37 | "flags": [ 38 | "BAR", 39 | "BAZ" 40 | ], 41 | "kwargs": { 42 | "HEADERS": "*", 43 | "DEPENDS": "*", 44 | "SOURCES": "*" 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.[chs] filter=fixtabswsp 2 | *.[ch]pp filter=fixtabswsp 3 | *.[ch]xx filter=fixtabswsp 4 | *.asm filter=fixtabswsp 5 | *.php filter=fixtabswsp 6 | *.pl filter=fixtabswsp 7 | *.sh filter=fixtabswsp 8 | *.txt filter=fixwsp 9 | [Mm]akefile filter=fixwsp 10 | *.mk filter=fixwsp 11 | *.rc -crlf 12 | *.ds[pw] -crlf 13 | *.bat -crlf 14 | *.mmp -crlf 15 | *.dpj -crlf 16 | *.pjt -crlf 17 | *.vcp -crlf 18 | *.inf -crlf 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | TAGS 3 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /PATENTS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luctrudeau/libaom/96ee0eb4586b69c07662d7c7606fd2fa0bad7b2c/PATENTS -------------------------------------------------------------------------------- /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_img_alloc 13 | text aom_img_flip 14 | text aom_img_free 15 | text aom_img_plane_width 16 | text aom_img_plane_height 17 | text aom_img_set_rect 18 | text aom_img_wrap 19 | text aom_img_alloc_with_border 20 | text aom_uleb_decode 21 | text aom_uleb_encode 22 | text aom_uleb_encode_fixed_size 23 | text aom_uleb_size_in_bytes 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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() { once(setup_rtcd_internal); } 19 | -------------------------------------------------------------------------------- /aom_dsp/aom_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_DSP_AOM_FILTER_H_ 13 | #define AOM_DSP_AOM_FILTER_H_ 14 | 15 | #include "aom/aom_integer.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #define FILTER_BITS 7 22 | 23 | #define SUBPEL_BITS 4 24 | #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) 25 | #define SUBPEL_SHIFTS (1 << SUBPEL_BITS) 26 | #define SUBPEL_TAPS 8 27 | 28 | #define SCALE_SUBPEL_BITS 10 29 | #define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS) 30 | #define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1) 31 | #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS) 32 | #define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2) 33 | 34 | #define RS_SUBPEL_BITS 6 35 | #define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1) 36 | #define RS_SCALE_SUBPEL_BITS 14 37 | #define RS_SCALE_SUBPEL_MASK ((1 << RS_SCALE_SUBPEL_BITS) - 1) 38 | #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS) 39 | #define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1)) 40 | 41 | typedef int16_t InterpKernel[SUBPEL_TAPS]; 42 | 43 | #define BIL_SUBPEL_BITS 3 44 | #define BIL_SUBPEL_SHIFTS (1 << BIL_SUBPEL_BITS) 45 | 46 | // 2 tap bilinear filters 47 | static const uint8_t bilinear_filters_2t[BIL_SUBPEL_SHIFTS][2] = { 48 | { 128, 0 }, { 112, 16 }, { 96, 32 }, { 80, 48 }, 49 | { 64, 64 }, { 48, 80 }, { 32, 96 }, { 16, 112 }, 50 | }; 51 | 52 | #ifdef __cplusplus 53 | } // extern "C" 54 | #endif 55 | 56 | #endif // AOM_DSP_AOM_FILTER_H_ 57 | -------------------------------------------------------------------------------- /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_DSP_AOM_AOM_SIMD_H_ 13 | #define AOM_DSP_AOM_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_DSP_AOM_AOM_SIMD_H_ 39 | -------------------------------------------------------------------------------- /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_DSP_AOM_SIMD_INLINE_H_ 13 | #define 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_DSP_AOM_SIMD_INLINE_H_ 22 | -------------------------------------------------------------------------------- /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_DSP_BITREADER_BUFFER_H_ 13 | #define 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(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 | #ifdef __cplusplus 45 | } // extern "C" 46 | #endif 47 | 48 | #endif // AOM_DSP_BITREADER_BUFFER_H_ 49 | -------------------------------------------------------------------------------- /aom_dsp/bitwriter_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_DSP_BITWRITER_BUFFER_H_ 13 | #define AOM_DSP_BITWRITER_BUFFER_H_ 14 | 15 | #include "aom/aom_integer.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | struct aom_write_bit_buffer { 22 | uint8_t *bit_buffer; 23 | uint32_t bit_offset; 24 | }; 25 | 26 | int aom_wb_is_byte_aligned(const struct aom_write_bit_buffer *wb); 27 | 28 | uint32_t aom_wb_bytes_written(const struct aom_write_bit_buffer *wb); 29 | 30 | void aom_wb_write_bit(struct aom_write_bit_buffer *wb, int bit); 31 | 32 | void aom_wb_overwrite_bit(struct aom_write_bit_buffer *wb, int bit); 33 | 34 | void aom_wb_write_literal(struct aom_write_bit_buffer *wb, int data, int bits); 35 | 36 | void aom_wb_write_unsigned_literal(struct aom_write_bit_buffer *wb, 37 | uint32_t data, int bits); 38 | 39 | void aom_wb_overwrite_literal(struct aom_write_bit_buffer *wb, int data, 40 | int bits); 41 | 42 | void aom_wb_write_inv_signed_literal(struct aom_write_bit_buffer *wb, int data, 43 | int bits); 44 | 45 | #ifdef __cplusplus 46 | } // extern "C" 47 | #endif 48 | 49 | #endif // AOM_DSP_BITWRITER_BUFFER_H_ 50 | -------------------------------------------------------------------------------- /aom_dsp/blend.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_DSP_BLEND_H_ 13 | #define AOM_DSP_BLEND_H_ 14 | 15 | #include "aom_ports/mem.h" 16 | 17 | // Various blending functions and macros. 18 | // See also the aom_blend_* functions in aom_dsp_rtcd.h 19 | 20 | // Alpha blending with alpha values from the range [0, 64], where 64 21 | // means use the first input and 0 means use the second input. 22 | 23 | #define AOM_BLEND_A64_ROUND_BITS 6 24 | #define AOM_BLEND_A64_MAX_ALPHA (1 << AOM_BLEND_A64_ROUND_BITS) // 64 25 | 26 | #define AOM_BLEND_A64(a, v0, v1) \ 27 | ROUND_POWER_OF_TWO((a) * (v0) + (AOM_BLEND_A64_MAX_ALPHA - (a)) * (v1), \ 28 | AOM_BLEND_A64_ROUND_BITS) 29 | 30 | // Alpha blending with alpha values from the range [0, 256], where 256 31 | // means use the first input and 0 means use the second input. 32 | #define AOM_BLEND_A256_ROUND_BITS 8 33 | #define AOM_BLEND_A256_MAX_ALPHA (1 << AOM_BLEND_A256_ROUND_BITS) // 256 34 | 35 | #define AOM_BLEND_A256(a, v0, v1) \ 36 | ROUND_POWER_OF_TWO((a) * (v0) + (AOM_BLEND_A256_MAX_ALPHA - (a)) * (v1), \ 37 | AOM_BLEND_A256_ROUND_BITS) 38 | 39 | // Blending by averaging. 40 | #define AOM_BLEND_AVG(v0, v1) ROUND_POWER_OF_TWO((v0) + (v1), 1) 41 | 42 | #define DIFF_FACTOR_LOG2 4 43 | #define DIFF_FACTOR (1 << DIFF_FACTOR_LOG2) 44 | 45 | #endif // AOM_DSP_BLEND_H_ 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_DSP_ENTCODE_H_ 13 | #define 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.*/ 31 | #define OD_BITRES (3) 32 | 33 | #define OD_ICDF AOM_ICDF 34 | 35 | /*See entcode.c for further documentation.*/ 36 | 37 | OD_WARN_UNUSED_RESULT uint32_t od_ec_tell_frac(uint32_t nbits_total, 38 | uint32_t rng); 39 | 40 | #endif // AOM_DSP_ENTCODE_H_ 41 | -------------------------------------------------------------------------------- /aom_dsp/intrapred_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_DSP_INTRAPRED_COMMON_H 13 | #define _AOM_DSP_INTRAPRED_COMMON_H 14 | 15 | #include "config/aom_config.h" 16 | 17 | // Weights are quadratic from '1' to '1 / block_size', scaled by 18 | // 2^sm_weight_log2_scale. 19 | static const int sm_weight_log2_scale = 8; 20 | 21 | // max(block_size_wide[BLOCK_LARGEST], block_size_high[BLOCK_LARGEST]) 22 | #define MAX_BLOCK_DIM 64 23 | 24 | /* clang-format off */ 25 | static const uint8_t sm_weight_arrays[2 * MAX_BLOCK_DIM] = { 26 | // Unused, because we always offset by bs, which is at least 2. 27 | 0, 0, 28 | // bs = 2 29 | 255, 128, 30 | // bs = 4 31 | 255, 149, 85, 64, 32 | // bs = 8 33 | 255, 197, 146, 105, 73, 50, 37, 32, 34 | // bs = 16 35 | 255, 225, 196, 170, 145, 123, 102, 84, 68, 54, 43, 33, 26, 20, 17, 16, 36 | // bs = 32 37 | 255, 240, 225, 210, 196, 182, 169, 157, 145, 133, 122, 111, 101, 92, 83, 74, 38 | 66, 59, 52, 45, 39, 34, 29, 25, 21, 17, 14, 12, 10, 9, 8, 8, 39 | // bs = 64 40 | 255, 248, 240, 233, 225, 218, 210, 203, 196, 189, 182, 176, 169, 163, 156, 41 | 150, 144, 138, 133, 127, 121, 116, 111, 106, 101, 96, 91, 86, 82, 77, 73, 69, 42 | 65, 61, 57, 54, 50, 47, 44, 41, 38, 35, 32, 29, 27, 25, 22, 20, 18, 16, 15, 43 | 13, 12, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4, 44 | }; 45 | /* clang-format on */ 46 | 47 | #endif // _AOM_DSP_INTRAPRED_COMMON_H 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_COMMON_MIPS_DSPR2_H_ 13 | #define AOM_COMMON_MIPS_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_COMMON_MIPS_DSPR2_H_ 52 | -------------------------------------------------------------------------------- /aom_dsp/mips/convolve_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_DSP_MIPS_AOM_COMMON_DSPR2_H_ 13 | #define AOM_DSP_MIPS_AOM_COMMON_DSPR2_H_ 14 | 15 | #include 16 | 17 | #include "config/aom_config.h" 18 | 19 | #include "aom/aom_integer.h" 20 | #include "aom_dsp/mips/common_dspr2.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #if HAVE_DSPR2 27 | void aom_convolve2_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, 28 | uint8_t *dst, ptrdiff_t dst_stride, 29 | const int16_t *filter_x, int x_step_q4, 30 | const int16_t *filter_y, int y_step_q4, int w, 31 | int h); 32 | 33 | void aom_convolve2_dspr2(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, 34 | ptrdiff_t dst_stride, const int16_t *filter, int w, 35 | int h); 36 | 37 | void aom_convolve2_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, 38 | uint8_t *dst, ptrdiff_t dst_stride, 39 | const int16_t *filter_x, int x_step_q4, 40 | const int16_t *filter_y, int y_step_q4, int w, 41 | int h); 42 | 43 | #endif // #if HAVE_DSPR2 44 | #ifdef __cplusplus 45 | } // extern "C" 46 | #endif 47 | 48 | #endif // AOM_DSP_MIPS_AOM_COMMON_DSPR2_H_ 49 | -------------------------------------------------------------------------------- /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_DSP_POSTPROC_H_ 13 | #define 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_DSP_POSTPROC_H_ 27 | -------------------------------------------------------------------------------- /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 _V256_INTRINSICS_H 13 | #define _V256_INTRINSICS_H 14 | 15 | #include "aom_dsp/simd/v256_intrinsics_v128.h" 16 | 17 | #endif /* _V256_INTRINSICS_H */ 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_DSP_X86_CONVOLVE_COMMON_INTRIN_H_ 13 | #define _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_DSP_X86_TXFM_COMMON_INTRIN_H_ 32 | -------------------------------------------------------------------------------- /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_DSP_X86_MEM_SSE2_H_ 13 | #define 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_DSP_X86_MEM_SSE2_H_ 43 | -------------------------------------------------------------------------------- /aom_dsp/x86/obmc_intrinsic_ssse3.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_DSP_X86_OBMC_INTRINSIC_SSSE3_H_ 13 | #define AOM_DSP_X86_OBMC_INTRINSIC_SSSE3_H_ 14 | 15 | #include 16 | 17 | #include "config/aom_config.h" 18 | 19 | static INLINE int32_t xx_hsum_epi32_si32(__m128i v_d) { 20 | v_d = _mm_hadd_epi32(v_d, v_d); 21 | v_d = _mm_hadd_epi32(v_d, v_d); 22 | return _mm_cvtsi128_si32(v_d); 23 | } 24 | 25 | static INLINE int64_t xx_hsum_epi64_si64(__m128i v_q) { 26 | v_q = _mm_add_epi64(v_q, _mm_srli_si128(v_q, 8)); 27 | #if ARCH_X86_64 28 | return _mm_cvtsi128_si64(v_q); 29 | #else 30 | { 31 | int64_t tmp; 32 | _mm_storel_epi64((__m128i *)&tmp, v_q); 33 | return tmp; 34 | } 35 | #endif 36 | } 37 | 38 | static INLINE int64_t xx_hsum_epi32_si64(__m128i v_d) { 39 | const __m128i v_sign_d = _mm_cmplt_epi32(v_d, _mm_setzero_si128()); 40 | const __m128i v_0_q = _mm_unpacklo_epi32(v_d, v_sign_d); 41 | const __m128i v_1_q = _mm_unpackhi_epi32(v_d, v_sign_d); 42 | return xx_hsum_epi64_si64(_mm_add_epi64(v_0_q, v_1_q)); 43 | } 44 | 45 | #endif // AOM_DSP_X86_OBMC_INTRINSIC_SSSE3_H_ 46 | -------------------------------------------------------------------------------- /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_DSP_X86_TXFM_COMMON_SSE2_H_ 13 | #define 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_DSP_X86_TXFM_COMMON_SSE2_H_ 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_MEM_INCLUDE_AOM_MEM_INTRNL_H_ 13 | #define 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_MEM_INCLUDE_AOM_MEM_INTRNL_H_ 34 | -------------------------------------------------------------------------------- /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_PORTS_ARM_H_ 13 | #define 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 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_PORTS_ARM_H_ 42 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_PORTS_PPC_H_ 13 | #define 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_PORTS_PPC_H_ 31 | -------------------------------------------------------------------------------- /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_PORTS_SANITIZER_H_ 13 | #define 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_PORTS_SANITIZER_H_ 39 | -------------------------------------------------------------------------------- /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_PORTS_SYSTEM_STATE_H_ 13 | #define 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_PORTS_SYSTEM_STATE_H_ 24 | -------------------------------------------------------------------------------- /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 | set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_scale PARENT_SCOPE) 38 | endfunction() 39 | -------------------------------------------------------------------------------- /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_SCALE_AOM_SCALE_H_ 13 | #define 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_SCALE_AOM_SCALE_H_ 24 | -------------------------------------------------------------------------------- /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() { once(setup_rtcd_internal); } 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 AOMENC_H_ 12 | #define 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 out_part; 51 | int debug; 52 | int show_q_hist_buckets; 53 | int show_rate_hist_buckets; 54 | int disable_warnings; 55 | int disable_warning_prompt; 56 | int experimental_bitstream; 57 | }; 58 | 59 | #ifdef __cplusplus 60 | } // extern "C" 61 | #endif 62 | 63 | #endif // AOMENC_H_ 64 | -------------------------------------------------------------------------------- /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 AV1_COMMON_ALLOCCOMMON_H_ 13 | #define 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 // AV1_COMMON_ALLOCCOMMON_H_ 49 | -------------------------------------------------------------------------------- /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 "aom_ports/mem.h" 16 | #include "av1/common/arm/mem_neon.h" 17 | 18 | void av1_round_shift_array_neon(int32_t *arr, int size, int bit) { 19 | assert(!(size % 4)); 20 | if (!bit) return; 21 | const int32x4_t dup_bits_n_32x4 = vdupq_n_s32((int32_t)(-bit)); 22 | for (int i = 0; i < size; i += 4) { 23 | int32x4_t tmp_q_s32 = vld1q_s32(arr); 24 | tmp_q_s32 = vrshlq_s32(tmp_q_s32, dup_bits_n_32x4); 25 | vst1q_s32(arr, tmp_q_s32); 26 | arr += 4; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /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 AV1_INV_TXFM2D_CFG_H_ 13 | #define AV1_INV_TXFM2D_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 // AV1_INV_TXFM2D_CFG_H_ 48 | -------------------------------------------------------------------------------- /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 once, by insuring that both the encoder and 20 | // decoder setup functions are protected by once(); 21 | once(setup_rtcd_internal); 22 | } 23 | -------------------------------------------------------------------------------- /av1/common/cdef.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 AV1_COMMON_CDEF_H_ 12 | #define AV1_COMMON_CDEF_H_ 13 | 14 | #define CDEF_STRENGTH_BITS 6 15 | 16 | #define CDEF_PRI_STRENGTHS 16 17 | #define CDEF_SEC_STRENGTHS 4 18 | 19 | #include "config/aom_config.h" 20 | 21 | #include "aom/aom_integer.h" 22 | #include "aom_ports/mem.h" 23 | #include "av1/common/cdef_block.h" 24 | #include "av1/common/onyxc_int.h" 25 | 26 | static INLINE int sign(int i) { return i < 0 ? -1 : 1; } 27 | 28 | static INLINE int constrain(int diff, int threshold, int damping) { 29 | if (!threshold) return 0; 30 | 31 | const int shift = AOMMAX(0, damping - get_msb(threshold)); 32 | return sign(diff) * 33 | AOMMIN(abs(diff), AOMMAX(0, threshold - (abs(diff) >> shift))); 34 | } 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | int sb_all_skip(const AV1_COMMON *const cm, int mi_row, int mi_col); 41 | int sb_compute_cdef_list(const AV1_COMMON *const cm, int mi_row, int mi_col, 42 | cdef_list *dlist, BLOCK_SIZE bsize); 43 | void av1_cdef_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, MACROBLOCKD *xd); 44 | 45 | void av1_cdef_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref, 46 | AV1_COMMON *cm, MACROBLOCKD *xd, int fast); 47 | 48 | #ifdef __cplusplus 49 | } // extern "C" 50 | #endif 51 | #endif // AV1_COMMON_CDEF_H_ 52 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 AV1_COMMON_IDCT_H_ 13 | #define 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 | 40 | void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, 41 | int stride, const TxfmParam *param); 42 | #ifdef __cplusplus 43 | } // extern "C" 44 | #endif 45 | 46 | #endif // AV1_COMMON_IDCT_H_ 47 | -------------------------------------------------------------------------------- /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/aom_dsp_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 | -------------------------------------------------------------------------------- /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 AV1_DECODER_DECODEMV_H_ 13 | #define 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 // AV1_DECODER_DECODEMV_H_ 36 | -------------------------------------------------------------------------------- /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 DECODETXB_H_ 13 | #define 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 | uint8_t av1_read_coeffs_txb_facade(const AV1_COMMON *const cm, 29 | MACROBLOCKD *const xd, aom_reader *const r, 30 | const int row, const int col, 31 | const int plane, const TX_SIZE tx_size); 32 | #endif // DECODETXB_H_ 33 | -------------------------------------------------------------------------------- /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 AV1_DECODER_DETOKENIZE_H_ 13 | #define 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 // AV1_DECODER_DETOKENIZE_H_ 30 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_AQ_COMPLEXITY_H_ 13 | #define 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 // AV1_ENCODER_AQ_COMPLEXITY_H_ 38 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_AQ_VARIANCE_H_ 13 | #define AV1_ENCODER_AQ_VARIANCE_H_ 14 | 15 | #include "av1/encoder/encoder.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | unsigned int av1_vaq_segment_id(int energy); 22 | void av1_vaq_frame_setup(AV1_COMP *cpi); 23 | 24 | int av1_block_energy(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); 25 | double av1_log_block_var(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); 26 | int av1_compute_deltaq_from_energy_level(const AV1_COMP *const cpi, 27 | int block_var_level); 28 | int av1_block_wavelet_energy_level(const AV1_COMP *cpi, MACROBLOCK *x, 29 | BLOCK_SIZE bs); 30 | 31 | #ifdef __cplusplus 32 | } // extern "C" 33 | #endif 34 | 35 | #endif // AV1_ENCODER_AQ_VARIANCE_H_ 36 | -------------------------------------------------------------------------------- /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 AV1_FWD_TXFM2D_CFG_H_ 13 | #define AV1_FWD_TXFM2D_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 // AV1_FWD_TXFM2D_CFG_H_ 20 | -------------------------------------------------------------------------------- /av1/encoder/bitstream.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 AV1_ENCODER_BITSTREAM_H_ 13 | #define AV1_ENCODER_BITSTREAM_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #include "av1/encoder/encoder.h" 20 | 21 | struct aom_write_bit_buffer; 22 | 23 | void write_sequence_header(AV1_COMP *cpi, struct aom_write_bit_buffer *wb); 24 | 25 | uint32_t write_obu_header(OBU_TYPE obu_type, int obu_extension, 26 | uint8_t *const dst); 27 | 28 | int write_uleb_obu_size(uint32_t obu_header_size, uint32_t obu_payload_size, 29 | uint8_t *dest); 30 | 31 | int av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size); 32 | 33 | static INLINE int av1_preserve_existing_gf(AV1_COMP *cpi) { 34 | // Do not swap gf and arf indices for internal overlay frames 35 | return !cpi->multi_arf_allowed && cpi->rc.is_src_frame_alt_ref && 36 | !cpi->rc.is_src_frame_ext_arf; 37 | } 38 | 39 | void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd, 40 | int blk_row, int blk_col, int plane, TX_SIZE tx_size, 41 | aom_writer *w); 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // AV1_ENCODER_BITSTREAM_H_ 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_CORNER_DETECT_H_ 13 | #define 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 // AV1_ENCODER_CORNER_DETECT_H_ 23 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_CORNER_MATCH_H_ 12 | #define 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 // AV1_ENCODER_CORNER_MATCH_H_ 34 | -------------------------------------------------------------------------------- /av1/encoder/cost.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 AV1_ENCODER_COST_H_ 13 | #define AV1_ENCODER_COST_H_ 14 | 15 | #include "aom_dsp/prob.h" 16 | #include "aom/aom_integer.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | extern const uint16_t av1_prob_cost[128]; 23 | 24 | // The factor to scale from cost in bits to cost in av1_prob_cost units. 25 | #define AV1_PROB_COST_SHIFT 9 26 | 27 | // Cost of coding an n bit literal, using 128 (i.e. 50%) probability 28 | // for each bit. 29 | #define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT)) 30 | 31 | // Calculate the cost of a symbol with probability p15 / 2^15 32 | static INLINE int av1_cost_symbol(aom_cdf_prob p15) { 33 | assert(0 < p15 && p15 < CDF_PROB_TOP); 34 | const int shift = CDF_PROB_BITS - 1 - get_msb(p15); 35 | const int prob = get_prob(p15 << shift, CDF_PROB_TOP); 36 | assert(prob >= 128); 37 | return av1_prob_cost[prob - 128] + av1_cost_literal(shift); 38 | } 39 | 40 | void av1_cost_tokens_from_cdf(int *costs, const aom_cdf_prob *cdf, 41 | const int *inv_map); 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // AV1_ENCODER_COST_H_ 48 | -------------------------------------------------------------------------------- /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 | #include "av1/common/common.h" 13 | #include "av1/common/enums.h" 14 | 15 | #define DWT_MAX_LENGTH 64 16 | 17 | void av1_fdwt8x8(tran_low_t *input, tran_low_t *output, int stride); 18 | void av1_fdwt8x8_uint8_input_c(uint8_t *input, tran_low_t *output, int stride, 19 | int hbd); 20 | int av1_haar_ac_sad_8x8_uint8_input(uint8_t *input, int stride, int hbd); 21 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_ENCODEFRAME_H_ 13 | #define 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 0 // 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); 33 | 34 | void av1_encode_frame(struct AV1_COMP *cpi); 35 | 36 | void av1_init_tile_data(struct AV1_COMP *cpi); 37 | void av1_encode_tile(struct AV1_COMP *cpi, struct ThreadData *td, int tile_row, 38 | int tile_col); 39 | 40 | #ifdef __cplusplus 41 | } // extern "C" 42 | #endif 43 | 44 | #endif // AV1_ENCODER_ENCODEFRAME_H_ 45 | -------------------------------------------------------------------------------- /av1/encoder/encodemv.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 AV1_ENCODER_ENCODEMV_H_ 13 | #define AV1_ENCODER_ENCODEMV_H_ 14 | 15 | #include "av1/encoder/encoder.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void av1_encode_mv(AV1_COMP *cpi, aom_writer *w, const MV *mv, const MV *ref, 22 | nmv_context *mvctx, int usehp); 23 | 24 | void av1_build_nmv_cost_table(int *mvjoint, int *mvcost[2], 25 | const nmv_context *mvctx, 26 | MvSubpelPrecision precision); 27 | 28 | void av1_update_mv_count(ThreadData *td); 29 | 30 | void av1_encode_dv(aom_writer *w, const MV *mv, const MV *ref, 31 | nmv_context *mvctx); 32 | int_mv av1_get_ref_mv(const MACROBLOCK *x, int ref_idx); 33 | int_mv av1_get_ref_mv_from_stack(int ref_idx, 34 | const MV_REFERENCE_FRAME *ref_frame, 35 | int ref_mv_idx, 36 | const MB_MODE_INFO_EXT *mbmi_ext); 37 | void av1_find_best_ref_mvs_from_stack(int allow_hp, 38 | const MB_MODE_INFO_EXT *mbmi_ext, 39 | MV_REFERENCE_FRAME ref_frame, 40 | int_mv *nearest_mv, int_mv *near_mv, 41 | int is_integer); 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // AV1_ENCODER_ENCODEMV_H_ 48 | -------------------------------------------------------------------------------- /av1/encoder/ethread.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 AV1_ENCODER_ETHREAD_H_ 13 | #define AV1_ENCODER_ETHREAD_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | struct AV1_COMP; 20 | struct ThreadData; 21 | 22 | typedef struct EncWorkerData { 23 | struct AV1_COMP *cpi; 24 | struct ThreadData *td; 25 | int start; 26 | } EncWorkerData; 27 | 28 | void av1_encode_tiles_mt(struct AV1_COMP *cpi); 29 | 30 | void av1_accumulate_frame_counts(struct FRAME_COUNTS *acc_counts, 31 | const struct FRAME_COUNTS *counts); 32 | 33 | #ifdef __cplusplus 34 | } // extern "C" 35 | #endif 36 | 37 | #endif // AV1_ENCODER_ETHREAD_H_ 38 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_EXTEND_H_ 13 | #define 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 // AV1_ENCODER_EXTEND_H_ 33 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_HASH_H_ 13 | #define 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 | #ifdef __cplusplus 47 | } // extern "C" 48 | #endif 49 | 50 | #endif // AV1_ENCODER_HASH_H_ 51 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_HYBRID_FWD_TXFM_H_ 13 | #define 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 // AV1_ENCODER_HYBRID_FWD_TXFM_H_ 32 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_MBGRAPH_H_ 13 | #define 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 // AV1_ENCODER_MBGRAPH_H_ 42 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_ML_H_ 13 | #define AV1_ENCODER_ML_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #define NN_MAX_HIDDEN_LAYERS 10 20 | #define NN_MAX_NODES_PER_LAYER 128 21 | 22 | typedef struct { 23 | int num_inputs; // Number of input nodes, i.e. features. 24 | int num_outputs; // Number of output nodes. 25 | int num_hidden_layers; // Number of hidden layers, maximum 10. 26 | // Number of nodes for each hidden layer. 27 | int num_hidden_nodes[NN_MAX_HIDDEN_LAYERS]; 28 | // Weight parameters, indexed by layer. 29 | const float *weights[NN_MAX_HIDDEN_LAYERS + 1]; 30 | // Bias parameters, indexed by layer. 31 | const float *bias[NN_MAX_HIDDEN_LAYERS + 1]; 32 | } NN_CONFIG; 33 | 34 | // Calculate prediction based on the given input features and neural net config. 35 | // Assume there are no more than NN_MAX_NODES_PER_LAYER nodes in each hidden 36 | // layer. 37 | void av1_nn_predict(const float *features, const NN_CONFIG *nn_config, 38 | float *output); 39 | 40 | #ifdef __cplusplus 41 | } // extern "C" 42 | #endif 43 | 44 | #endif // AV1_ENCODER_RD_H_ 45 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_PICKLPF_H_ 13 | #define 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 // AV1_ENCODER_PICKLPF_H_ 31 | -------------------------------------------------------------------------------- /av1/encoder/pickrst.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 AV1_ENCODER_PICKRST_H_ 12 | #define AV1_ENCODER_PICKRST_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #include "av1/encoder/encoder.h" 19 | 20 | struct yv12_buffer_config; 21 | struct AV1_COMP; 22 | 23 | void av1_pick_filter_restoration(const YV12_BUFFER_CONFIG *sd, AV1_COMP *cpi); 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // AV1_ENCODER_PICKRST_H_ 30 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_RANDOM_H_ 13 | #define 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 // AV1_ENCODER_RANDOM_H_ 30 | -------------------------------------------------------------------------------- /av1/encoder/ransac.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 AV1_ENCODER_RANSAC_H_ 13 | #define AV1_ENCODER_RANSAC_H_ 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include "av1/common/warped_motion.h" 21 | 22 | typedef int (*RansacFunc)(int *matched_points, int npoints, 23 | int *num_inliers_by_motion, double *params_by_motion, 24 | int num_motions); 25 | 26 | /* Each of these functions fits a motion model from a set of 27 | corresponding points in 2 frames using RANSAC. */ 28 | int ransac_affine(int *matched_points, int npoints, int *num_inliers_by_motion, 29 | double *params_by_motion, int num_motions); 30 | int ransac_rotzoom(int *matched_points, int npoints, int *num_inliers_by_motion, 31 | double *params_by_motion, int num_motions); 32 | int ransac_translation(int *matched_points, int npoints, 33 | int *num_inliers_by_motion, double *params_by_motion, 34 | int num_motions); 35 | #endif // AV1_ENCODER_RANSAC_H_ 36 | -------------------------------------------------------------------------------- /av1/encoder/ratectrl_xiph.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luctrudeau/libaom/96ee0eb4586b69c07662d7c7606fd2fa0bad7b2c/av1/encoder/ratectrl_xiph.c -------------------------------------------------------------------------------- /av1/encoder/ratectrl_xiph.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luctrudeau/libaom/96ee0eb4586b69c07662d7c7606fd2fa0bad7b2c/av1/encoder/ratectrl_xiph.h -------------------------------------------------------------------------------- /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 AV1_ENCODER_SEGMENTATION_H_ 13 | #define 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 // AV1_ENCODER_SEGMENTATION_H_ 39 | -------------------------------------------------------------------------------- /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 AV1_ENCODER_TEMPORAL_FILTER_H_ 13 | #define AV1_ENCODER_TEMPORAL_FILTER_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | void av1_temporal_filter(AV1_COMP *cpi, int distance); 20 | 21 | #ifdef __cplusplus 22 | } // extern "C" 23 | #endif 24 | 25 | #endif // AV1_ENCODER_TEMPORAL_FILTER_H_ 26 | -------------------------------------------------------------------------------- /av1/encoder/x86/hash_sse42.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 13 | #include 14 | 15 | // Byte-boundary alignment issues 16 | #define ALIGN_SIZE 8 17 | #define ALIGN_MASK (ALIGN_SIZE - 1) 18 | 19 | #define CALC_CRC(op, crc, type, buf, len) \ 20 | while ((len) >= sizeof(type)) { \ 21 | (crc) = op((crc), *(type *)(buf)); \ 22 | (len) -= sizeof(type); \ 23 | buf += sizeof(type); \ 24 | } 25 | 26 | /** 27 | * Calculates 32-bit CRC for the input buffer 28 | * polynomial is 0x11EDC6F41 29 | * @return A 32-bit unsigned integer representing the CRC 30 | */ 31 | uint32_t av1_get_crc32c_value_sse4_2(void *crc_calculator, uint8_t *p, 32 | size_t len) { 33 | (void)crc_calculator; 34 | const uint8_t *buf = p; 35 | uint32_t crc = 0xFFFFFFFF; 36 | 37 | // Align the input to the word boundary 38 | for (; (len > 0) && ((intptr_t)buf & ALIGN_MASK); len--, buf++) { 39 | crc = _mm_crc32_u8(crc, *buf); 40 | } 41 | 42 | #ifdef __x86_64__ 43 | uint64_t crc64 = crc; 44 | CALC_CRC(_mm_crc32_u64, crc64, uint64_t, buf, len); 45 | crc = (uint32_t)crc64; 46 | #endif 47 | CALC_CRC(_mm_crc32_u32, crc, uint32_t, buf, len); 48 | CALC_CRC(_mm_crc32_u16, crc, uint16_t, buf, len); 49 | CALC_CRC(_mm_crc32_u8, crc, uint8_t, buf, len); 50 | return (crc ^= 0xFFFFFFFF); 51 | } 52 | -------------------------------------------------------------------------------- /av1/exports_dec: -------------------------------------------------------------------------------- 1 | data aom_codec_av1_dx_algo 2 | text aom_codec_av1_dx 3 | -------------------------------------------------------------------------------- /av1/exports_enc: -------------------------------------------------------------------------------- 1 | data aom_codec_av1_cx_algo 2 | text aom_codec_av1_cx 3 | -------------------------------------------------------------------------------- /build/.gitattributes: -------------------------------------------------------------------------------- 1 | *-vs8/*.rules -crlf 2 | *-msvs/*.rules -crlf 3 | -------------------------------------------------------------------------------- /build/.gitignore: -------------------------------------------------------------------------------- 1 | x86*-win32-vs* 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_RD_DEBUG) 25 | change_config_and_warn(CONFIG_RD_DEBUG 0 CONFIG_JNT_COMP) 26 | endif() 27 | 28 | endmacro() 29 | -------------------------------------------------------------------------------- /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 | set(AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_com") 17 | 18 | if(CONFIG_AV1_DECODER) 19 | set(AOM_EXPORTS_SOURCES ${AOM_EXPORTS_SOURCES} "${AOM_ROOT}/aom/exports_dec" 20 | "${AOM_ROOT}/av1/exports_dec") 21 | endif() 22 | 23 | if(CONFIG_AV1_ENCODER) 24 | set(AOM_EXPORTS_SOURCES ${AOM_EXPORTS_SOURCES} "${AOM_ROOT}/aom/exports_enc" 25 | "${AOM_ROOT}/av1/exports_enc") 26 | endif() 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 31 | # Disable the use of the gtest's CMake support. 32 | set(AOM_DISABLE_GTEST_CMAKE 1) 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 32 | "-march=armv7-a -mfpu=neon ${AOM_EXTRA_TOOLCHAIN_FLAGS}") 33 | set(CMAKE_CXX_COMPILER_ARG1 34 | "-march=armv7-a -mfpu=neon ${AOM_EXTRA_TOOLCHAIN_FLAGS}") 35 | set(AOM_AS_FLAGS --defsym ARCHITECTURE=7 -march=armv7-a -mfpu=neon 36 | ${AOM_EXTRA_TOOLCHAIN_FLAGS}) 37 | set(CMAKE_SYSTEM_PROCESSOR "armv7") 38 | 39 | # No intrinsics flag required for armv7-linux-gcc. 40 | set(AOM_NEON_INTRIN_FLAG "") 41 | 42 | # No runtime cpu detect for armv7-linux-gcc. 43 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "") 44 | -------------------------------------------------------------------------------- /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 | 31 | # Disable the use of the gtest's CMake support. 32 | set(AOM_DISABLE_GTEST_CMAKE 1) 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 30 | # Disable the use of the gtest's CMake support. 31 | set(AOM_DISABLE_GTEST_CMAKE 1) 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 28 | # Disable the use of the gtest's CMake support. 29 | set(AOM_DISABLE_GTEST_CMAKE 1) 30 | -------------------------------------------------------------------------------- /build/make/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 IVFDEC_H_ 12 | #define 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 // IVFDEC_H_ 31 | -------------------------------------------------------------------------------- /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 IVFENC_H_ 12 | #define 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 // IVFENC_H_ 35 | -------------------------------------------------------------------------------- /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 MD5_UTILS_H_ 24 | #define 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 // MD5_UTILS_H_ 50 | -------------------------------------------------------------------------------- /common/obudec.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 | #ifndef OBUDEC_H_ 12 | #define OBUDEC_H_ 13 | 14 | #include "common/tools_common.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | struct ObuDecInputContext { 21 | struct AvxInputContext *avx_ctx; 22 | uint8_t *buffer; 23 | size_t buffer_capacity; 24 | size_t bytes_buffered; 25 | int is_annexb; 26 | }; 27 | 28 | // Returns 1 when file data starts (if Annex B stream, after reading the 29 | // size of the OBU) with what appears to be a Temporal Delimiter 30 | // OBU as defined by Section 5 of the AV1 bitstream specification. 31 | int file_is_obu(struct ObuDecInputContext *obu_ctx); 32 | 33 | // Reads one Temporal Unit from the input file. Returns 0 when a TU is 34 | // successfully read, 1 when end of file is reached, and less than 0 when an 35 | // error occurs. Stores TU data in 'buffer'. Reallocs buffer to match TU size, 36 | // returns buffer capacity via 'buffer_size', and returns size of buffered data 37 | // via 'bytes_read'. 38 | int obudec_read_temporal_unit(struct ObuDecInputContext *obu_ctx, 39 | uint8_t **buffer, size_t *bytes_read, 40 | size_t *buffer_size); 41 | 42 | void obudec_free(struct ObuDecInputContext *obu_ctx); 43 | 44 | #ifdef __cplusplus 45 | } /* extern "C" */ 46 | #endif 47 | 48 | #endif // OBUDEC_H_ 49 | -------------------------------------------------------------------------------- /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 VIDEO_COMMON_H_ 13 | #define 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 | } AvxVideoInfo; 23 | 24 | #endif // VIDEO_COMMON_H_ 25 | -------------------------------------------------------------------------------- /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 VIDEO_WRITER_H_ 13 | #define VIDEO_WRITER_H_ 14 | 15 | #include "common/video_common.h" 16 | 17 | typedef enum { kContainerIVF } 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 | 41 | #ifdef __cplusplus 42 | } // extern "C" 43 | #endif 44 | 45 | #endif // VIDEO_WRITER_H_ 46 | -------------------------------------------------------------------------------- /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 WARNINGS_H_ 12 | #define 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 // WARNINGS_H_ 35 | -------------------------------------------------------------------------------- /common/webmenc.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 WEBMENC_H_ 12 | #define WEBMENC_H_ 13 | 14 | #include 15 | #include 16 | 17 | #include "tools_common.h" 18 | #include "aom/aom_encoder.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | struct WebmOutputContext { 25 | int debug; 26 | FILE *stream; 27 | int64_t last_pts_ns; 28 | void *writer; 29 | void *segment; 30 | }; 31 | 32 | /* Stereo 3D packed frame format */ 33 | typedef enum stereo_format { 34 | STEREO_FORMAT_MONO = 0, 35 | STEREO_FORMAT_LEFT_RIGHT = 1, 36 | STEREO_FORMAT_BOTTOM_TOP = 2, 37 | STEREO_FORMAT_TOP_BOTTOM = 3, 38 | STEREO_FORMAT_RIGHT_LEFT = 11 39 | } stereo_format_t; 40 | 41 | void write_webm_file_header(struct WebmOutputContext *webm_ctx, 42 | const aom_codec_enc_cfg_t *cfg, 43 | stereo_format_t stereo_fmt, unsigned int fourcc, 44 | const struct AvxRational *par); 45 | 46 | void write_webm_block(struct WebmOutputContext *webm_ctx, 47 | const aom_codec_enc_cfg_t *cfg, 48 | const aom_codec_cx_pkt_t *pkt); 49 | 50 | void write_webm_file_footer(struct WebmOutputContext *webm_ctx); 51 | 52 | #ifdef __cplusplus 53 | } // extern "C" 54 | #endif 55 | 56 | #endif // WEBMENC_H_ 57 | -------------------------------------------------------------------------------- /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 Y4MENC_H_ 13 | #define Y4MENC_H_ 14 | 15 | #include "aom/aom_decoder.h" 16 | #include "common/tools_common.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #define Y4M_BUFFER_SIZE 128 23 | 24 | int y4m_write_file_header(char *buf, size_t len, int width, int height, 25 | const struct AvxRational *framerate, 26 | aom_img_fmt_t fmt, unsigned int bit_depth); 27 | int y4m_write_frame_header(char *buf, size_t len); 28 | 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // Y4MENC_H_ 34 | -------------------------------------------------------------------------------- /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 EXAMPLES_ENCODER_UTIL_H_ 15 | #define 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 // EXAMPLES_ENCODER_UTIL_H_ 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 AOMSTATS_H_ 13 | #define 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 // AOMSTATS_H_ 45 | -------------------------------------------------------------------------------- /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 RATE_HIST_H_ 13 | #define 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 // RATE_HIST_H_ 42 | -------------------------------------------------------------------------------- /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 TEST_CLEAR_SYSTEM_STATE_H_ 12 | #define 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 // TEST_CLEAR_SYSTEM_STATE_H_ 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 TEST_I420_VIDEO_SOURCE_H_ 12 | #define 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 // TEST_I420_VIDEO_SOURCE_H_ 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/set_maps.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 tests the libaom set_maps example. To add new tests to this file, 12 | ## do the following: 13 | ## 1. Write a shell function (this is your test). 14 | ## 2. Add the function to set_maps_tests (on a new line). 15 | ## 16 | . $(dirname $0)/tools_common.sh 17 | 18 | # Environment check: $YUV_RAW_INPUT is required, and set_maps must exist in 19 | # $LIBAOM_BIN_PATH. 20 | set_maps_verify_environment() { 21 | if [ ! -e "${YUV_RAW_INPUT}" ]; then 22 | echo "Libaom test data must exist in LIBAOM_TEST_DATA_PATH." 23 | return 1 24 | fi 25 | if [ -z "$(aom_tool_path set_maps)" ]; then 26 | elog "set_maps not found. It must exist in LIBAOM_BIN_PATH or its parent." 27 | return 1 28 | fi 29 | } 30 | 31 | # Runs set_maps using the codec specified by $1. 32 | set_maps() { 33 | local encoder="$(aom_tool_path set_maps)" 34 | local codec="$1" 35 | local output_file="${AOM_TEST_OUTPUT_DIR}/set_maps_${codec}.ivf" 36 | 37 | eval "${AOM_TEST_PREFIX}" "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" \ 38 | "${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \ 39 | ${devnull} 40 | 41 | [ -e "${output_file}" ] || return 1 42 | } 43 | 44 | set_maps_av1() { 45 | if [ "$(av1_encode_available)" = "yes" ]; then 46 | set_maps av1 || return 1 47 | fi 48 | } 49 | 50 | set_maps_tests="set_maps_av1" 51 | 52 | run_tests set_maps_verify_environment "${set_maps_tests}" 53 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 TEST_TEST_VECTORS_H_ 13 | #define 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 // TEST_TEST_VECTORS_H_ 27 | -------------------------------------------------------------------------------- /test/util.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 TEST_UTIL_H_ 13 | #define TEST_UTIL_H_ 14 | 15 | #include 16 | #include 17 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" 18 | #include "aom/aom_integer.h" 19 | #include "aom/aom_image.h" 20 | #include "aom_ports/aom_timer.h" 21 | 22 | // Macros 23 | #define GET_PARAM(k) ::testing::get(GetParam()) 24 | 25 | inline double compute_psnr(const aom_image_t *img1, const aom_image_t *img2) { 26 | assert((img1->fmt == img2->fmt) && (img1->d_w == img2->d_w) && 27 | (img1->d_h == img2->d_h)); 28 | 29 | const unsigned int width_y = img1->d_w; 30 | const unsigned int height_y = img1->d_h; 31 | unsigned int i, j; 32 | 33 | int64_t sqrerr = 0; 34 | for (i = 0; i < height_y; ++i) 35 | for (j = 0; j < width_y; ++j) { 36 | int64_t d = img1->planes[AOM_PLANE_Y][i * img1->stride[AOM_PLANE_Y] + j] - 37 | img2->planes[AOM_PLANE_Y][i * img2->stride[AOM_PLANE_Y] + j]; 38 | sqrerr += d * d; 39 | } 40 | double mse = static_cast(sqrerr) / (width_y * height_y); 41 | double psnr = 100.0; 42 | if (mse > 0.0) { 43 | psnr = 10 * log10(255.0 * 255.0 / mse); 44 | } 45 | return psnr; 46 | } 47 | 48 | static INLINE double get_time_mark(aom_usec_timer *t) { 49 | aom_usec_timer_mark(t); 50 | return static_cast(aom_usec_timer_elapsed(t)); 51 | } 52 | 53 | #endif // TEST_UTIL_H_ 54 | -------------------------------------------------------------------------------- /test/warp_filter_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 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" 12 | #include "test/warp_filter_test_util.h" 13 | using ::testing::make_tuple; 14 | using ::testing::tuple; 15 | using libaom_test::ACMRandom; 16 | using libaom_test::AV1HighbdWarpFilter::AV1HighbdWarpFilterTest; 17 | using libaom_test::AV1WarpFilter::AV1WarpFilterTest; 18 | 19 | namespace { 20 | #if HAVE_SSE4_1 21 | TEST_P(AV1WarpFilterTest, CheckOutput) { RunCheckOutput(GET_PARAM(3)); } 22 | TEST_P(AV1WarpFilterTest, DISABLED_Speed) { RunSpeedTest(GET_PARAM(3)); } 23 | 24 | INSTANTIATE_TEST_CASE_P( 25 | SSE4_1, AV1WarpFilterTest, 26 | libaom_test::AV1WarpFilter::BuildParams(av1_warp_affine_sse4_1)); 27 | 28 | TEST_P(AV1HighbdWarpFilterTest, CheckOutput) { RunCheckOutput(GET_PARAM(4)); } 29 | TEST_P(AV1HighbdWarpFilterTest, DISABLED_Speed) { RunSpeedTest(GET_PARAM(4)); } 30 | 31 | INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdWarpFilterTest, 32 | libaom_test::AV1HighbdWarpFilter::BuildParams( 33 | av1_highbd_warp_affine_sse4_1)); 34 | 35 | #endif // HAVE_SSE4_1 36 | } // namespace 37 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /third_party/googletest/gtest.mk: -------------------------------------------------------------------------------- 1 | GTEST_SRCS-yes += googletest/src/googletest/src/gtest-all.cc 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /third_party/googletest/src/googletest/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, 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 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /third_party/libwebm/AUTHORS.TXT: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /third_party/libwebm/README.libaom: -------------------------------------------------------------------------------- 1 | URL: https://chromium.googlesource.com/webm/libwebm 2 | Version: af81f26025b7435fa9a14ad07c58b44cf9280430 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 | Add av1 codec as an eligible codec for webm: 11 | https://aomedia-review.googlesource.com/c/aom/+/15103 12 | Only keep: 13 | - Android.mk 14 | - AUTHORS.TXT 15 | - common/ 16 | file_util.cc/h 17 | hdr_util.cc/h 18 | webmids.h 19 | - LICENSE.TXT 20 | - mkvmuxer/ 21 | - mkvparser/ 22 | - PATENTS.TXT 23 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/inspect-post.js: -------------------------------------------------------------------------------- 1 | Module["FS"] = FS; 2 | -------------------------------------------------------------------------------- /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 TOOLS_OBU_PARSER_H_ 13 | #define 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 // TOOLS_OBU_PARSER_H_ 28 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------