├── .clang-format ├── .cmake-format.py ├── .gitattributes ├── .gitignore ├── .mailmap ├── AUTHORS ├── CHANGELOG ├── CMakeLists.txt ├── LICENSE ├── PATENTS ├── README.md ├── Sample.cfg ├── aom ├── aom.h ├── aom_codec.h ├── aom_decoder.h ├── aom_encoder.h ├── aom_external_partition.h ├── aom_frame_buffer.h ├── aom_image.h ├── aom_integer.h ├── aomcx.h ├── aomdx.h ├── exports_com ├── exports_dec ├── exports_enc ├── exports_test ├── internal │ ├── aom_codec_internal.h │ └── aom_image_internal.h └── src │ ├── aom_codec.c │ ├── aom_decoder.c │ ├── aom_encoder.c │ ├── aom_image.c │ └── aom_integer.c ├── aom_dsp ├── aom_convolve.c ├── 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 │ ├── aom_convolve_copy_neon.c │ ├── avg_neon.c │ ├── blend_a64_mask_neon.c │ ├── fwd_txfm_neon.c │ ├── hadamard_neon.c │ ├── highbd_intrapred_neon.c │ ├── highbd_loopfilter_neon.c │ ├── highbd_quantize_neon.c │ ├── highbd_variance_neon.c │ ├── intrapred_neon.c │ ├── loopfilter_neon.c │ ├── mem_neon.h │ ├── sad4d_neon.c │ ├── sad_neon.c │ ├── sse_neon.c │ ├── subpel_variance_neon.c │ ├── subtract_neon.c │ ├── sum_neon.h │ ├── sum_squares_neon.c │ ├── transpose_neon.h │ └── variance_neon.c ├── avg.c ├── binary_codes_reader.c ├── binary_codes_reader.h ├── binary_codes_writer.c ├── binary_codes_writer.h ├── bitreader.c ├── bitreader.h ├── bitreader_buffer.c ├── bitreader_buffer.h ├── bitwriter.c ├── bitwriter.h ├── bitwriter_buffer.c ├── bitwriter_buffer.h ├── blend.h ├── blend_a64_hmask.c ├── blend_a64_mask.c ├── blend_a64_vmask.c ├── blk_sse_sum.c ├── butteraugli.c ├── butteraugli.h ├── entcode.c ├── entcode.h ├── entdec.c ├── entdec.h ├── entenc.c ├── entenc.h ├── fastssim.c ├── fft.c ├── fft_common.h ├── flow_estimation │ ├── corner_detect.c │ ├── corner_detect.h │ ├── corner_match.c │ ├── corner_match.h │ ├── disflow.c │ ├── disflow.h │ ├── flow_estimation.c │ ├── flow_estimation.h │ ├── ransac.c │ ├── ransac.h │ └── x86 │ │ ├── corner_match_avx2.c │ │ └── corner_match_sse4.c ├── fwd_txfm.c ├── grain_params.h ├── grain_table.c ├── grain_table.h ├── intrapred.c ├── intrapred_common.h ├── loopfilter.c ├── mathutils.h ├── noise_model.c ├── noise_model.h ├── noise_util.c ├── noise_util.h ├── odintrin.c ├── odintrin.h ├── prob.h ├── psnr.c ├── psnr.h ├── psnrhvs.c ├── pyramid.c ├── pyramid.h ├── quantize.c ├── quantize.h ├── recenter.h ├── rect.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 ├── sse.c ├── ssim.c ├── ssim.h ├── subtract.c ├── sum_squares.c ├── txfm_common.h ├── variance.c ├── variance.h ├── vmaf.c ├── vmaf.h └── x86 │ ├── adaptive_quantize_avx2.c │ ├── adaptive_quantize_sse2.c │ ├── aom_asm_stubs.c │ ├── aom_convolve_copy_avx2.c │ ├── aom_convolve_copy_sse2.c │ ├── aom_high_subpixel_8t_sse2.asm │ ├── aom_high_subpixel_bilinear_sse2.asm │ ├── aom_quantize_avx.c │ ├── aom_subpixel_8t_intrin_avx2.c │ ├── aom_subpixel_8t_intrin_sse2.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 │ ├── avg_intrin_avx2.c │ ├── avg_intrin_sse2.c │ ├── avg_intrin_sse4.c │ ├── bitdepth_conversion_avx2.h │ ├── bitdepth_conversion_sse2.h │ ├── blend_a64_hmask_sse4.c │ ├── blend_a64_mask_avx2.c │ ├── blend_a64_mask_sse4.c │ ├── blend_a64_vmask_sse4.c │ ├── blend_mask_sse4.h │ ├── blend_sse4.h │ ├── blk_sse_sum_avx2.c │ ├── blk_sse_sum_sse2.c │ ├── common_avx2.h │ ├── convolve.h │ ├── convolve_avx2.h │ ├── convolve_common_intrin.h │ ├── convolve_sse2.h │ ├── convolve_sse4_1.h │ ├── convolve_ssse3.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 │ ├── highbd_adaptive_quantize_avx2.c │ ├── highbd_adaptive_quantize_sse2.c │ ├── highbd_convolve_avx2.c │ ├── highbd_convolve_sse2.c │ ├── highbd_convolve_ssse3.c │ ├── highbd_intrapred_asm_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_avx2.c │ ├── highbd_sad_sse2.asm │ ├── highbd_subpel_variance_impl_sse2.asm │ ├── highbd_subtract_sse2.c │ ├── highbd_variance_avx2.c │ ├── highbd_variance_impl_sse2.asm │ ├── highbd_variance_sse2.c │ ├── highbd_variance_sse4.c │ ├── intrapred_asm_sse2.asm │ ├── intrapred_avx2.c │ ├── intrapred_sse2.c │ ├── intrapred_sse4.c │ ├── intrapred_ssse3.c │ ├── intrapred_utils.h │ ├── intrapred_x86.h │ ├── inv_wht_sse2.asm │ ├── jnt_sad_ssse3.c │ ├── jnt_variance_ssse3.c │ ├── loopfilter_avx2.c │ ├── loopfilter_sse2.c │ ├── lpf_common_sse2.h │ ├── masked_sad4d_ssse3.c │ ├── masked_sad_intrin_avx2.c │ ├── masked_sad_intrin_ssse3.c │ ├── masked_sad_intrin_ssse3.h │ ├── masked_variance_intrin_ssse3.c │ ├── masked_variance_intrin_ssse3.h │ ├── mem_sse2.h │ ├── obmc_intrinsic_sse4.h │ ├── obmc_intrinsic_ssse3.h │ ├── obmc_sad_avx2.c │ ├── obmc_sad_sse4.c │ ├── obmc_variance_avx2.c │ ├── obmc_variance_sse4.c │ ├── quantize_avx2.c │ ├── quantize_sse2.c │ ├── quantize_ssse3.c │ ├── quantize_ssse3_x86_64.asm │ ├── quantize_x86.h │ ├── sad4d_avx2.c │ ├── sad4d_sse2.asm │ ├── sad_avx2.c │ ├── sad_impl_avx2.c │ ├── sad_sse2.asm │ ├── sse_avx2.c │ ├── sse_sse4.c │ ├── ssim_sse2_x86_64.asm │ ├── subpel_variance_sse2.asm │ ├── subtract_avx2.c │ ├── subtract_sse2.asm │ ├── sum_squares_avx2.c │ ├── sum_squares_sse2.c │ ├── sum_squares_sse2.h │ ├── synonyms.h │ ├── synonyms_avx2.h │ ├── transpose_sse2.h │ ├── txfm_common_avx2.h │ ├── txfm_common_sse2.h │ ├── variance_avx2.c │ ├── variance_impl_avx2.c │ ├── variance_impl_ssse3.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 ├── float.asm ├── mem.h ├── mem_ops.h ├── mem_ops_aligned.h ├── msvc.h ├── ppc.h ├── ppc_cpudetect.c ├── sanitizer.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 └── yv12config.h ├── aom_util ├── aom_thread.c ├── aom_thread.h ├── aom_util.cmake ├── debug_util.c ├── debug_util.h └── endian_inl.h ├── aomedia_logo_200.png ├── apps ├── aomdec.c ├── aomenc.c └── aomenc.h ├── av1 ├── arg_defs.c ├── arg_defs.h ├── av1.cmake ├── av1_cx_iface.c ├── av1_cx_iface.h ├── av1_dx_iface.c ├── av1_iface_common.h ├── common │ ├── alloccommon.c │ ├── alloccommon.h │ ├── arm │ │ ├── av1_inv_txfm_neon.c │ │ ├── av1_inv_txfm_neon.h │ │ ├── av1_txfm_neon.c │ │ ├── blend_a64_hmask_neon.c │ │ ├── blend_a64_vmask_neon.c │ │ ├── cdef_block_neon.c │ │ ├── cfl_neon.c │ │ ├── convolve_neon.c │ │ ├── convolve_neon.h │ │ ├── highbd_inv_txfm_neon.c │ │ ├── jnt_convolve_neon.c │ │ ├── reconinter_neon.c │ │ ├── reconintra_neon.c │ │ ├── resize_neon.c │ │ ├── selfguided_neon.c │ │ ├── warp_plane_neon.c │ │ └── wiener_convolve_neon.c │ ├── av1_common_int.h │ ├── 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_simd.h │ ├── cfl.c │ ├── cfl.h │ ├── common.h │ ├── common_data.c │ ├── common_data.h │ ├── convolve.c │ ├── convolve.h │ ├── debugmodes.c │ ├── entropy.c │ ├── entropy.h │ ├── entropymode.c │ ├── entropymode.h │ ├── entropymv.c │ ├── entropymv.h │ ├── enums.h │ ├── filter.h │ ├── frame_buffers.c │ ├── frame_buffers.h │ ├── idct.c │ ├── idct.h │ ├── mv.h │ ├── mvref_common.c │ ├── mvref_common.h │ ├── obmc.h │ ├── obu_util.c │ ├── obu_util.h │ ├── ppc │ │ └── cfl_ppc.c │ ├── pred_common.c │ ├── pred_common.h │ ├── quant_common.c │ ├── quant_common.h │ ├── reconinter.c │ ├── reconinter.h │ ├── reconinter_template.inc │ ├── 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_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 │ │ ├── cdef_block_avx2.c │ │ ├── cdef_block_sse2.c │ │ ├── cdef_block_sse4.c │ │ ├── cdef_block_ssse3.c │ │ ├── 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_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_affine_avx2.c │ │ ├── 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 │ │ ├── resize_ssse3.c │ │ ├── selfguided_avx2.c │ │ ├── selfguided_sse4.c │ │ ├── warp_plane_avx2.c │ │ ├── warp_plane_sse2.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.h │ ├── grain_synthesis.c │ ├── grain_synthesis.h │ ├── inspection.c │ ├── inspection.h │ ├── obu.c │ └── obu.h ├── encoder │ ├── allintra_vis.c │ ├── allintra_vis.h │ ├── aq_complexity.c │ ├── aq_complexity.h │ ├── aq_cyclicrefresh.c │ ├── aq_cyclicrefresh.h │ ├── aq_variance.c │ ├── aq_variance.h │ ├── arm │ │ ├── crc32 │ │ │ └── hash_crc32.c │ │ └── neon │ │ │ ├── av1_error_neon.c │ │ │ ├── av1_fwd_txfm2d_neon.c │ │ │ ├── av1_highbd_quantize_neon.c │ │ │ ├── av1_temporal_denoiser_neon.c │ │ │ ├── encodetxb_neon.c │ │ │ ├── highbd_fwd_txfm_neon.c │ │ │ ├── hybrid_fwd_txfm_neon.c │ │ │ ├── ml_neon.c │ │ │ ├── picksrt_neon.c │ │ │ ├── quantize_neon.c │ │ │ ├── rdopt_neon.c │ │ │ ├── temporal_filter_neon.c │ │ │ └── wedge_utils_neon.c │ ├── av1_fwd_txfm1d.c │ ├── av1_fwd_txfm1d.h │ ├── av1_fwd_txfm1d_cfg.h │ ├── av1_fwd_txfm2d.c │ ├── av1_ml_partition_models.h │ ├── av1_noise_estimate.c │ ├── av1_noise_estimate.h │ ├── av1_quantize.c │ ├── av1_quantize.h │ ├── av1_temporal_denoiser.c │ ├── av1_temporal_denoiser.h │ ├── bitstream.c │ ├── bitstream.h │ ├── block.h │ ├── blockiness.c │ ├── cnn.c │ ├── cnn.h │ ├── compound_type.c │ ├── compound_type.h │ ├── context_tree.c │ ├── context_tree.h │ ├── cost.c │ ├── cost.h │ ├── deltaq4_model.c │ ├── dwt.c │ ├── dwt.h │ ├── enc_enums.h │ ├── encode_strategy.c │ ├── encode_strategy.h │ ├── encodeframe.c │ ├── encodeframe.h │ ├── encodeframe_utils.c │ ├── encodeframe_utils.h │ ├── encodemb.c │ ├── encodemb.h │ ├── encodemv.c │ ├── encodemv.h │ ├── encoder.c │ ├── encoder.h │ ├── encoder_alloc.h │ ├── encoder_utils.c │ ├── encoder_utils.h │ ├── encodetxb.c │ ├── encodetxb.h │ ├── ethread.c │ ├── ethread.h │ ├── extend.c │ ├── extend.h │ ├── external_partition.c │ ├── external_partition.h │ ├── firstpass.c │ ├── firstpass.h │ ├── global_motion.c │ ├── global_motion.h │ ├── global_motion_facade.c │ ├── global_motion_facade.h │ ├── gop_structure.c │ ├── gop_structure.h │ ├── grain_test_vectors.h │ ├── hash.c │ ├── hash.h │ ├── hash_motion.c │ ├── hash_motion.h │ ├── hybrid_fwd_txfm.c │ ├── hybrid_fwd_txfm.h │ ├── interp_search.c │ ├── interp_search.h │ ├── intra_mode_search.c │ ├── intra_mode_search.h │ ├── intra_mode_search_utils.h │ ├── k_means_template.h │ ├── level.c │ ├── level.h │ ├── lookahead.c │ ├── lookahead.h │ ├── mcomp.c │ ├── mcomp.h │ ├── mcomp_structs.h │ ├── misc_model_weights.h │ ├── ml.c │ ├── ml.h │ ├── mode_prune_model_weights.h │ ├── model_rd.h │ ├── motion_search_facade.c │ ├── motion_search_facade.h │ ├── mv_prec.c │ ├── mv_prec.h │ ├── nonrd_opt.h │ ├── nonrd_pickmode.c │ ├── optical_flow.c │ ├── optical_flow.h │ ├── palette.c │ ├── palette.h │ ├── partition_cnn_weights.h │ ├── partition_model_weights.h │ ├── partition_search.c │ ├── partition_search.h │ ├── partition_strategy.c │ ├── partition_strategy.h │ ├── pass2_strategy.c │ ├── pass2_strategy.h │ ├── pickcdef.c │ ├── pickcdef.h │ ├── picklpf.c │ ├── picklpf.h │ ├── pickrst.c │ ├── pickrst.h │ ├── pustats.h │ ├── random.h │ ├── ratectrl.c │ ├── ratectrl.h │ ├── rc_utils.h │ ├── rd.c │ ├── rd.h │ ├── rdopt.c │ ├── rdopt.h │ ├── rdopt_data_defs.h │ ├── rdopt_utils.h │ ├── reconinter_enc.c │ ├── reconinter_enc.h │ ├── segmentation.c │ ├── segmentation.h │ ├── sorting_network.h │ ├── sparse_linear_solver.c │ ├── sparse_linear_solver.h │ ├── speed_features.c │ ├── speed_features.h │ ├── superres_scale.c │ ├── superres_scale.h │ ├── svc_layercontext.c │ ├── svc_layercontext.h │ ├── temporal_filter.c │ ├── temporal_filter.h │ ├── thirdpass.c │ ├── thirdpass.h │ ├── tokenize.c │ ├── tokenize.h │ ├── tpl_model.c │ ├── tpl_model.h │ ├── tune_butteraugli.c │ ├── tune_butteraugli.h │ ├── tune_vmaf.c │ ├── tune_vmaf.h │ ├── tx_prune_model_weights.h │ ├── tx_search.c │ ├── tx_search.h │ ├── txb_rdopt.c │ ├── txb_rdopt.h │ ├── txb_rdopt_utils.h │ ├── var_based_part.c │ ├── var_based_part.h │ ├── wedge_utils.c │ └── x86 │ │ ├── av1_fwd_txfm1d_sse4.c │ │ ├── av1_fwd_txfm2d_avx2.c │ │ ├── av1_fwd_txfm2d_sse4.c │ │ ├── av1_fwd_txfm_avx2.h │ │ ├── av1_fwd_txfm_sse2.c │ │ ├── av1_fwd_txfm_sse2.h │ │ ├── av1_highbd_quantize_avx2.c │ │ ├── av1_highbd_quantize_sse4.c │ │ ├── av1_k_means_avx2.c │ │ ├── av1_k_means_sse2.c │ │ ├── av1_quantize_avx2.c │ │ ├── av1_quantize_sse2.c │ │ ├── av1_quantize_ssse3_x86_64.asm │ │ ├── av1_ssim_opt_x86_64.asm │ │ ├── av1_temporal_denoiser_sse2.c │ │ ├── av1_txfm1d_sse4.h │ │ ├── cnn_avx2.c │ │ ├── dct_sse2.asm │ │ ├── encodetxb_avx2.c │ │ ├── encodetxb_sse2.c │ │ ├── encodetxb_sse4.c │ │ ├── error_intrin_avx2.c │ │ ├── error_intrin_sse2.c │ │ ├── error_sse2.asm │ │ ├── hash_sse42.c │ │ ├── highbd_block_error_intrin_avx2.c │ │ ├── highbd_block_error_intrin_sse2.c │ │ ├── highbd_fwd_txfm_avx2.c │ │ ├── highbd_fwd_txfm_sse4.c │ │ ├── highbd_temporal_filter_avx2.c │ │ ├── highbd_temporal_filter_sse2.c │ │ ├── ml_sse3.c │ │ ├── pickrst_avx2.c │ │ ├── pickrst_sse4.c │ │ ├── rdopt_avx2.c │ │ ├── rdopt_sse4.c │ │ ├── reconinter_enc_sse2.c │ │ ├── reconinter_enc_ssse3.c │ │ ├── temporal_filter_avx2.c │ │ ├── temporal_filter_sse2.c │ │ ├── wedge_utils_avx2.c │ │ └── wedge_utils_sse2.c ├── exports_com ├── exports_dec ├── exports_enc ├── exports_ident ├── exports_test ├── qmode_rc │ ├── ducky_encode.cc │ ├── ducky_encode.h │ ├── ratectrl_qmode.cc │ ├── ratectrl_qmode.h │ ├── ratectrl_qmode_interface.cc │ ├── ratectrl_qmode_interface.h │ ├── reference_manager.cc │ └── reference_manager.h ├── ratectrl_rtc.cc └── ratectrl_rtc.h ├── build ├── .gitattributes ├── .gitignore └── cmake │ ├── aom_config.c.template │ ├── aom_config_defaults.cmake │ ├── aom_configure.cmake │ ├── aom_experiment_deps.cmake │ ├── aom_install.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 │ ├── pkg_config.cmake │ ├── rtcd.pl │ ├── sanitizers.cmake │ ├── toolchains │ ├── android.cmake │ ├── arm-ios-common.cmake │ ├── arm64-ios.cmake │ ├── arm64-linux-gcc.cmake │ ├── arm64-macos.cmake │ ├── arm64-mingw-gcc.cmake │ ├── armv7-ios.cmake │ ├── armv7-linux-gcc.cmake │ ├── armv7-mingw-gcc.cmake │ ├── armv7s-ios.cmake │ ├── ios-simulator-common.cmake │ ├── ppc-linux-gcc.cmake │ ├── riscv-linux-gcc.cmake │ ├── x86-ios-simulator.cmake │ ├── x86-linux.cmake │ ├── x86-macos.cmake │ ├── x86-mingw-gcc.cmake │ ├── x86_64-ios-simulator.cmake │ ├── x86_64-macos.cmake │ └── x86_64-mingw-gcc.cmake │ ├── util.cmake │ ├── version.cmake │ └── version.pl ├── codereview.settings ├── common ├── args.c ├── args.h ├── args_helper.c ├── args_helper.h ├── av1_config.c ├── av1_config.h ├── ivf_dec.cmake ├── ivfdec.c ├── ivfdec.h ├── ivfenc.c ├── ivfenc.h ├── md5_utils.c ├── md5_utils.h ├── obudec.c ├── obudec.h ├── rawenc.c ├── rawenc.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 ├── doc ├── AlgorithmDescription.md ├── dev_guide │ ├── av1_decoder.dox │ ├── av1_encoder.dox │ ├── av1encoderflow.png │ ├── av1partitions.png │ ├── coeff_coding.png │ ├── filter_flow.png │ ├── filter_thr.png │ ├── genericcodecflow.png │ ├── gf_group.png │ ├── partition.png │ └── tplgfgroupdiagram.png └── img │ ├── edge_direction.svg │ ├── equ_dir_search.svg │ ├── equ_dual_self_guided.svg │ ├── equ_dual_self_para.svg │ ├── equ_edge_direction.svg │ ├── equ_guided_filter.svg │ ├── equ_wiener_filter.svg │ ├── inter_motion_field.svg │ ├── inter_obmc.svg │ ├── inter_spatial_mvp.svg │ ├── inter_tmvp_positions.svg │ ├── inter_tx_partition.svg │ ├── intra_cfl.svg │ ├── intra_directional.svg │ ├── intra_paeth.svg │ ├── intra_recursive.svg │ ├── intra_tx_partition.svg │ ├── loop_restoration.svg │ ├── partition_codingblock.svg │ ├── primary_tap.svg │ ├── quant_ac.svg │ ├── quant_dc.svg │ ├── scc_intrabc.svg │ ├── secondary_tap.svg │ ├── tx_basis.svg │ ├── tx_cands_large.svg │ ├── tx_cands_small.svg │ ├── tx_chroma.svg │ ├── tx_partition.svg │ └── tx_set.svg ├── docs.cmake ├── examples ├── analyzer.cc ├── aom_cx_set_ref.c ├── av1_dec_fuzzer.cc ├── av1_dec_fuzzer.dict ├── build_av1_dec_fuzzer.sh ├── 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 ├── photon_noise_table.c ├── resize_util.c ├── scalable_decoder.c ├── scalable_encoder.c ├── set_maps.c ├── simple_decoder.c ├── simple_encoder.c ├── svc_encoder_rtc.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 ├── allintra_end_to_end_test.cc ├── altref_test.cc ├── aom_image_test.cc ├── aom_integer_test.cc ├── aom_mem_test.cc ├── aomcx_set_ref.sh ├── aomdec.sh ├── aomenc.sh ├── aq_segment_test.cc ├── arf_freq_test.cc ├── av1_common_int_test.cc ├── av1_config_test.cc ├── av1_convolve_scale_test.cc ├── av1_convolve_test.cc ├── av1_encoder_parms_get_to_decoder.cc ├── av1_ext_tile_test.cc ├── av1_external_partition_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_k_means_test.cc ├── av1_key_value_api_test.cc ├── av1_nn_predict_test.cc ├── av1_quantize_test.cc ├── av1_round_shift_array_test.cc ├── av1_softmax_test.cc ├── av1_temporal_denoiser_test.cc ├── av1_txfm_test.cc ├── av1_txfm_test.h ├── av1_wedge_utils_test.cc ├── avg_test.cc ├── best_encode.sh ├── binary_codes_test.cc ├── blend_a64_mask_1d_test.cc ├── blend_a64_mask_test.cc ├── block_test.cc ├── boolcoder_test.cc ├── borders_test.cc ├── cdef_test.cc ├── cfl_test.cc ├── cnn_test.cc ├── 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 ├── cpu_used_firstpass_test.cc ├── datarate_test.cc ├── datarate_test.h ├── decode_api_test.cc ├── decode_multithreaded_test.cc ├── decode_perf_test.cc ├── decode_scalability_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 ├── ducky_encode_test.cc ├── dump_obu.sh ├── ec_test.cc ├── encode_api_test.cc ├── encode_perf_test.cc ├── encode_small_width_height_test.cc ├── encode_test_driver.cc ├── encode_test_driver.h ├── encodemb_test.cc ├── encodetxb_test.cc ├── end_to_end_psnr_test.cc ├── end_to_end_qmpsnr_test.cc ├── end_to_end_ssim_test.cc ├── error_block_test.cc ├── error_resilience_test.cc ├── ethread_test.cc ├── examples.sh ├── external_frame_buffer_test.cc ├── fdct4x4_test.cc ├── fft_test.cc ├── film_grain_table_test.cc ├── filterintra_test.cc ├── firstpass_test.cc ├── force_key_frame_test.cc ├── forced_max_frame_width_height_test.cc ├── frame_error_test.cc ├── frame_parallel_enc_test.cc ├── frame_size_tests.cc ├── function_equivalence_test.h ├── fwht4x4_test.cc ├── gf_pyr_height_test.cc ├── gviz_api.py ├── hadamard_test.cc ├── hash_test.cc ├── hbd_metrics_test.cc ├── hiprec_convolve_test.cc ├── hiprec_convolve_test_util.cc ├── hiprec_convolve_test_util.h ├── horver_correlation_test.cc ├── 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 ├── kf_test.cc ├── level_test.cc ├── lightfield_test.sh ├── log2_test.cc ├── loopfilter_control_test.cc ├── lossless_test.cc ├── lpf_test.cc ├── masked_sad_test.cc ├── masked_variance_test.cc ├── md5_helper.h ├── metadata_test.cc ├── metrics_template.html ├── mock_ratectrl_qmode.h ├── monochrome_test.cc ├── motion_vector_test.cc ├── mv_cost_test.cc ├── noise_model_test.cc ├── obmc_sad_test.cc ├── obmc_variance_test.cc ├── pickrst_test.cc ├── postproc_filters_test.cc ├── quant_test.cc ├── quantize_func_test.cc ├── ratectrl_qmode_test.cc ├── ratectrl_rtc_test.cc ├── ratectrl_test.cc ├── rd_test.cc ├── reconinter_test.cc ├── register_state_check.h ├── resize_test.cc ├── rt_end_to_end_test.cc ├── run_encodes.sh ├── sad_test.cc ├── sb_multipass_test.cc ├── sb_qp_sweep_test.cc ├── scalability_test.cc ├── scan_test.cc ├── screen_content_test.cc ├── segment_binarization_sync.cc ├── selfguided_filter_test.cc ├── set_maps.sh ├── sharpness_test.cc ├── 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 ├── sse_sum_test.cc ├── still_picture_test.cc ├── subtract_test.cc ├── sum_squares_test.cc ├── svc_datarate_test.cc ├── temporal_filter_test.cc ├── test-data.sha1 ├── test.cmake ├── test_aom_rc_interface.cc ├── 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_config_test.cc ├── tile_independence_test.cc ├── time_stamp_test.cc ├── tools_common.sh ├── tpl_model_test.cc ├── 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 ├── webmenc_test.cc ├── wiener_test.cc ├── y4m_test.cc ├── y4m_video_source.h └── yuv_video_source.h ├── third_party ├── SVT-AV1 │ ├── EbMemory_AVX2.h │ ├── EbMemory_SSE4_1.h │ ├── LICENSE.md │ ├── PATENTS.md │ ├── README.libaom │ ├── convolve_2d_avx2.h │ ├── convolve_avx2.h │ └── synonyms.h ├── fastfeat │ ├── LICENSE │ ├── README.libaom │ ├── fast.c │ ├── fast.h │ ├── fast_9.c │ └── nonmax.c ├── googletest │ ├── README.libaom │ └── src │ │ ├── .clang-format │ │ ├── CMakeLists.txt │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── googlemock │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cmake │ │ │ ├── gmock.pc.in │ │ │ └── gmock_main.pc.in │ │ ├── include │ │ │ └── gmock │ │ │ │ ├── gmock-actions.h │ │ │ │ ├── gmock-cardinalities.h │ │ │ │ ├── gmock-function-mocker.h │ │ │ │ ├── gmock-matchers.h │ │ │ │ ├── gmock-more-actions.h │ │ │ │ ├── gmock-more-matchers.h │ │ │ │ ├── gmock-nice-strict.h │ │ │ │ ├── gmock-spec-builders.h │ │ │ │ ├── gmock.h │ │ │ │ └── internal │ │ │ │ ├── custom │ │ │ │ ├── README.md │ │ │ │ ├── gmock-generated-actions.h │ │ │ │ ├── gmock-matchers.h │ │ │ │ └── gmock-port.h │ │ │ │ ├── gmock-internal-utils.h │ │ │ │ ├── gmock-port.h │ │ │ │ └── gmock-pp.h │ │ └── src │ │ │ ├── gmock-all.cc │ │ │ ├── gmock-cardinalities.cc │ │ │ ├── gmock-internal-utils.cc │ │ │ ├── gmock-matchers.cc │ │ │ ├── gmock-spec-builders.cc │ │ │ ├── gmock.cc │ │ │ └── gmock_main.cc │ │ └── googletest │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cmake │ │ ├── Config.cmake.in │ │ ├── gtest.pc.in │ │ ├── gtest_main.pc.in │ │ ├── internal_utils.cmake │ │ └── libgtest.la.in │ │ ├── include │ │ └── gtest │ │ │ ├── gtest-assertion-result.h │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-matchers.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── 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 │ │ │ ├── README.md │ │ │ ├── gtest-port.h │ │ │ ├── gtest-printers.h │ │ │ └── gtest.h │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port-arch.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ └── gtest-type-util.h │ │ └── src │ │ ├── gtest-all.cc │ │ ├── gtest-assertion-result.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-matchers.cc │ │ ├── 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 │ ├── LICENSE │ ├── 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 │ │ │ ├── scale_uv.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_uv.cc │ │ ├── scale_win.cc │ │ ├── video_common.cc │ │ └── x86inc.asm ├── vector │ ├── LICENSE │ ├── README.libaom │ ├── vector.c │ └── vector.h └── x86inc │ ├── LICENSE │ ├── README.libaom │ └── x86inc.asm ├── tools ├── aggregate_entropy_stats.py ├── aom_entropy_optimizer.c ├── auto_refactor │ ├── auto_refactor.py │ ├── av1_preprocess.py │ ├── c_files │ │ ├── decl_status_code.c │ │ ├── func_in_out.c │ │ ├── global_variable.c │ │ ├── parse_lvalue.c │ │ ├── simple_code.c │ │ └── struct_code.c │ └── test_auto_refactor.py ├── cpplint.py ├── diff.py ├── dump_obu.cc ├── frame_size_variation_analyzer.py ├── gen_authors.sh ├── gen_constrained_tokenset.py ├── gop_bitrate │ ├── analyze_data.py │ ├── encode_all_script.sh │ └── python │ │ └── bitrate_accuracy.py ├── inspect-cli.js ├── inspect-post.js ├── intersect-diffs.py ├── lint-hunks.py ├── obu_parser.cc ├── obu_parser.h ├── ratectrl_log_analyzer │ └── analyze_ratectrl_log.py ├── txfm_analyzer │ ├── txfm_gen_code.cc │ ├── txfm_graph.cc │ └── txfm_graph.h └── wrap-commit-msg.py ├── usage.dox ├── usage_cx.dox └── usage_dx.dox /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | AllowShortCaseLabelsOnASingleLine: true 5 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 6 | Cpp11BracedListStyle: false 7 | DerivePointerAlignment: false 8 | PointerAlignment: Right 9 | SortIncludes: false 10 | -------------------------------------------------------------------------------- /.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 | cmbuild 3 | .cproject 4 | .idea 5 | .project 6 | .vscode 7 | .gitignore 8 | TAGS 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_set_option 10 | text aom_codec_version 11 | text aom_codec_version_extra_str 12 | text aom_codec_version_str 13 | text aom_free 14 | text aom_img_add_metadata 15 | text aom_img_alloc 16 | text aom_img_alloc_with_border 17 | text aom_img_flip 18 | text aom_img_free 19 | text aom_img_get_metadata 20 | text aom_img_metadata_array_free 21 | text aom_img_metadata_array_alloc 22 | text aom_img_metadata_free 23 | text aom_img_metadata_alloc 24 | text aom_img_num_metadata 25 | text aom_img_plane_height 26 | text aom_img_plane_width 27 | text aom_img_remove_metadata 28 | text aom_img_set_rect 29 | text aom_img_wrap 30 | text aom_malloc 31 | text aom_rb_bytes_read 32 | text aom_rb_read_bit 33 | text aom_rb_read_literal 34 | text aom_rb_read_uvlc 35 | text aom_uleb_decode 36 | text aom_uleb_encode 37 | text aom_uleb_encode_fixed_size 38 | text aom_uleb_size_in_bytes 39 | text aom_wb_bytes_written 40 | text aom_wb_write_bit 41 | text aom_wb_write_literal 42 | text aom_wb_write_unsigned_literal 43 | -------------------------------------------------------------------------------- /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_set_frame_buffer_functions 7 | text aom_obu_type_to_string 8 | text aom_read_obu_header 9 | -------------------------------------------------------------------------------- /aom/exports_enc: -------------------------------------------------------------------------------- 1 | text aom_codec_enc_config_default 2 | text aom_codec_enc_config_set 3 | text aom_codec_enc_init_ver 4 | text aom_codec_encode 5 | text aom_codec_get_cx_data 6 | text aom_codec_get_global_headers 7 | text aom_codec_get_preview_frame 8 | text aom_codec_set_cx_data_buf 9 | text aom_film_grain_table_append 10 | text aom_film_grain_table_free 11 | text aom_film_grain_table_write 12 | text aom_flat_block_finder_init 13 | text aom_flat_block_finder_run 14 | text aom_noise_model_init 15 | text aom_noise_model_get_grain_parameters 16 | text aom_noise_model_save_latest 17 | text aom_noise_model_update 18 | -------------------------------------------------------------------------------- /aom/exports_test: -------------------------------------------------------------------------------- 1 | text aom_copy_metadata_to_frame_buffer 2 | text aom_dsp_rtcd 3 | text aom_remove_metadata_from_frame_buffer 4 | text aom_scale_rtcd 5 | -------------------------------------------------------------------------------- /aom_dsp/aom_dsp_rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "config/aom_config.h" 12 | 13 | #define RTCD_C 14 | #include "config/aom_dsp_rtcd.h" 15 | 16 | #include "aom_ports/aom_once.h" 17 | 18 | void aom_dsp_rtcd() { aom_once(setup_rtcd_internal); } 19 | -------------------------------------------------------------------------------- /aom_dsp/aom_simd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_AOM_SIMD_H_ 13 | #define AOM_AOM_DSP_AOM_SIMD_H_ 14 | 15 | #include 16 | 17 | #if defined(_WIN32) 18 | #include 19 | #endif 20 | 21 | #include "config/aom_config.h" 22 | 23 | #include "aom_dsp/aom_simd_inline.h" 24 | 25 | #define SIMD_CHECK 1 // Sanity checks in C equivalents 26 | 27 | #if HAVE_NEON 28 | #include "simd/v256_intrinsics_arm.h" 29 | // VS compiling for 32 bit targets does not support vector types in 30 | // structs as arguments, which makes the v256 type of the intrinsics 31 | // hard to support, so optimizations for this target are disabled. 32 | #elif HAVE_SSE2 && (defined(_WIN64) || !defined(_MSC_VER) || defined(__clang__)) 33 | #include "simd/v256_intrinsics_x86.h" 34 | #else 35 | #include "simd/v256_intrinsics.h" 36 | #endif 37 | 38 | #endif // AOM_AOM_DSP_AOM_SIMD_H_ 39 | -------------------------------------------------------------------------------- /aom_dsp/aom_simd_inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_AOM_SIMD_INLINE_H_ 13 | #define AOM_AOM_DSP_AOM_SIMD_INLINE_H_ 14 | 15 | #include "aom/aom_integer.h" 16 | 17 | #ifndef SIMD_INLINE 18 | #define SIMD_INLINE static AOM_FORCE_INLINE 19 | #endif 20 | 21 | #define SIMD_CLAMP(value, min, max) \ 22 | ((value) > (max) ? (max) : (value) < (min) ? (min) : (value)) 23 | 24 | #endif // AOM_AOM_DSP_AOM_SIMD_INLINE_H_ 25 | -------------------------------------------------------------------------------- /aom_dsp/arm/aom_convolve_copy_neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Alliance for Open Media. 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 12 | 13 | #include "config/aom_dsp_rtcd.h" 14 | 15 | void aom_convolve_copy_neon(const uint8_t *src, ptrdiff_t src_stride, 16 | uint8_t *dst, ptrdiff_t dst_stride, int w, int h) { 17 | const uint8_t *src1; 18 | uint8_t *dst1; 19 | int y; 20 | 21 | if (!(w & 0x0F)) { 22 | for (y = 0; y < h; ++y) { 23 | src1 = src; 24 | dst1 = dst; 25 | for (int x = 0; x < (w >> 4); ++x) { 26 | vst1q_u8(dst1, vld1q_u8(src1)); 27 | src1 += 16; 28 | dst1 += 16; 29 | } 30 | src += src_stride; 31 | dst += dst_stride; 32 | } 33 | } else if (!(w & 0x07)) { 34 | for (y = 0; y < h; ++y) { 35 | vst1_u8(dst, vld1_u8(src)); 36 | src += src_stride; 37 | dst += dst_stride; 38 | } 39 | } else if (!(w & 0x03)) { 40 | for (y = 0; y < h; ++y) { 41 | vst1_lane_u32((uint32_t *)(dst), vreinterpret_u32_u8(vld1_u8(src)), 0); 42 | src += src_stride; 43 | dst += dst_stride; 44 | } 45 | } else if (!(w & 0x01)) { 46 | for (y = 0; y < h; ++y) { 47 | vst1_lane_u16((uint16_t *)(dst), vreinterpret_u16_u8(vld1_u8(src)), 0); 48 | src += src_stride; 49 | dst += dst_stride; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /aom_dsp/bitreader.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/bitreader.h" 13 | 14 | int aom_reader_init(aom_reader *r, const uint8_t *buffer, size_t 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, (uint32_t)size); 21 | #if CONFIG_ACCOUNTING 22 | r->accounting = NULL; 23 | #endif 24 | return 0; 25 | } 26 | 27 | const uint8_t *aom_reader_find_begin(aom_reader *r) { return r->buffer; } 28 | 29 | const uint8_t *aom_reader_find_end(aom_reader *r) { return r->buffer_end; } 30 | 31 | uint32_t aom_reader_tell(const aom_reader *r) { return od_ec_dec_tell(&r->ec); } 32 | 33 | uint32_t aom_reader_tell_frac(const aom_reader *r) { 34 | return od_ec_dec_tell_frac(&r->ec); 35 | } 36 | 37 | int aom_reader_has_overflowed(const aom_reader *r) { 38 | const uint32_t tell_bits = aom_reader_tell(r); 39 | const uint32_t tell_bytes = (tell_bits + 7) >> 3; 40 | return ((ptrdiff_t)tell_bytes > r->buffer_end - r->buffer); 41 | } 42 | -------------------------------------------------------------------------------- /aom_dsp/bitreader_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_BITREADER_BUFFER_H_ 13 | #define AOM_AOM_DSP_BITREADER_BUFFER_H_ 14 | 15 | #include 16 | 17 | #include "aom/aom_integer.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef void (*aom_rb_error_handler)(void *data); 24 | 25 | struct aom_read_bit_buffer { 26 | const uint8_t *bit_buffer; 27 | const uint8_t *bit_buffer_end; 28 | uint32_t bit_offset; 29 | 30 | void *error_handler_data; 31 | aom_rb_error_handler error_handler; 32 | }; 33 | 34 | size_t aom_rb_bytes_read(const struct aom_read_bit_buffer *rb); 35 | 36 | int aom_rb_read_bit(struct aom_read_bit_buffer *rb); 37 | 38 | int aom_rb_read_literal(struct aom_read_bit_buffer *rb, int bits); 39 | 40 | uint32_t aom_rb_read_unsigned_literal(struct aom_read_bit_buffer *rb, int bits); 41 | 42 | int aom_rb_read_inv_signed_literal(struct aom_read_bit_buffer *rb, int bits); 43 | 44 | uint32_t aom_rb_read_uvlc(struct aom_read_bit_buffer *rb); 45 | 46 | int16_t aom_rb_read_signed_primitive_refsubexpfin( 47 | struct aom_read_bit_buffer *rb, uint16_t n, uint16_t k, int16_t ref); 48 | 49 | #ifdef __cplusplus 50 | } // extern "C" 51 | #endif 52 | 53 | #endif // AOM_AOM_DSP_BITREADER_BUFFER_H_ 54 | -------------------------------------------------------------------------------- /aom_dsp/bitwriter.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/bitwriter.h" 14 | 15 | void aom_start_encode(aom_writer *w, uint8_t *source) { 16 | w->buffer = source; 17 | w->pos = 0; 18 | od_ec_enc_init(&w->ec, 62025); 19 | } 20 | 21 | int aom_stop_encode(aom_writer *w) { 22 | int nb_bits; 23 | uint32_t bytes; 24 | unsigned char *data; 25 | data = od_ec_enc_done(&w->ec, &bytes); 26 | nb_bits = od_ec_enc_tell(&w->ec); 27 | memcpy(w->buffer, data, bytes); 28 | w->pos = bytes; 29 | od_ec_enc_clear(&w->ec); 30 | return nb_bits; 31 | } 32 | 33 | int aom_tell_size(aom_writer *w) { 34 | const int nb_bits = od_ec_enc_tell(&w->ec); 35 | return nb_bits; 36 | } 37 | -------------------------------------------------------------------------------- /aom_dsp/blk_sse_sum.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "config/aom_dsp_rtcd.h" 13 | 14 | void aom_get_blk_sse_sum_c(const int16_t *data, int stride, int bw, int bh, 15 | int *x_sum, int64_t *x2_sum) { 16 | *x_sum = 0; 17 | *x2_sum = 0; 18 | for (int i = 0; i < bh; ++i) { 19 | for (int j = 0; j < bw; ++j) { 20 | const int val = data[j]; 21 | *x_sum += val; 22 | *x2_sum += val * val; 23 | } 24 | data += stride; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /aom_dsp/butteraugli.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_BUTTERAUGLI_H_ 13 | #define AOM_AOM_DSP_BUTTERAUGLI_H_ 14 | 15 | #include "aom_scale/yv12config.h" 16 | 17 | // Returns a boolean that indicates success/failure. 18 | int aom_calc_butteraugli(const YV12_BUFFER_CONFIG *source, 19 | const YV12_BUFFER_CONFIG *distorted, int bit_depth, 20 | aom_matrix_coefficients_t matrix_coefficients, 21 | aom_color_range_t color_range, float *dist_map); 22 | 23 | #endif // AOM_AOM_DSP_BUTTERAUGLI_H_ 24 | -------------------------------------------------------------------------------- /aom_dsp/entcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_ENTCODE_H_ 13 | #define AOM_AOM_DSP_ENTCODE_H_ 14 | 15 | #include 16 | #include 17 | #include "aom_dsp/odintrin.h" 18 | #include "aom_dsp/prob.h" 19 | 20 | #define EC_PROB_SHIFT 6 21 | #define EC_MIN_PROB 4 // must be <= (1< 1/8th bits.*/ 32 | #define OD_BITRES (3) 33 | 34 | #define OD_ICDF AOM_ICDF 35 | 36 | /*See entcode.c for further documentation.*/ 37 | 38 | OD_WARN_UNUSED_RESULT uint32_t od_ec_tell_frac(uint32_t nbits_total, 39 | uint32_t rng); 40 | 41 | #endif // AOM_AOM_DSP_ENTCODE_H_ 42 | -------------------------------------------------------------------------------- /aom_dsp/flow_estimation/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 "aom_dsp/flow_estimation/corner_detect.h" 21 | 22 | // Fast_9 wrapper 23 | #define FAST_BARRIER 18 24 | int av1_fast_corner_detect(const unsigned char *buf, int width, int height, 25 | int stride, int *points, int max_points) { 26 | int num_points; 27 | xy *const frm_corners_xy = aom_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 | -------------------------------------------------------------------------------- /aom_dsp/flow_estimation/corner_detect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_DETECT_H_ 13 | #define AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_DETECT_H_ 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | int av1_fast_corner_detect(const unsigned char *buf, int width, int height, 24 | int stride, int *points, int max_points); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif // AOM_AOM_DSP_FLOW_ESTIMATION_CORNER_DETECT_H_ 31 | -------------------------------------------------------------------------------- /aom_dsp/flow_estimation/disflow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_FLOW_ESTIMATION_DISFLOW_H_ 13 | #define AOM_AOM_DSP_FLOW_ESTIMATION_DISFLOW_H_ 14 | 15 | #include "aom_dsp/flow_estimation/flow_estimation.h" 16 | #include "aom_scale/yv12config.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | int av1_compute_global_motion_disflow_based( 23 | TransformationType type, ImagePyramid *frm_pyramid, int *frm_corners, 24 | int num_frm_corners, ImagePyramid *ref_pyramid, int *num_inliers_by_motion, 25 | MotionModel *params_by_motion, int num_motions); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif // AOM_AOM_DSP_FLOW_ESTIMATION_DISFLOW_H_ 32 | -------------------------------------------------------------------------------- /aom_dsp/flow_estimation/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 AOM_AOM_DSP_FLOW_ESTIMATION_RANSAC_H_ 13 | #define AOM_AOM_DSP_FLOW_ESTIMATION_RANSAC_H_ 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include "aom_dsp/flow_estimation/flow_estimation.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | typedef int (*RansacFunc)(int *matched_points, int npoints, 27 | int *num_inliers_by_motion, 28 | MotionModel *params_by_motion, int num_motions); 29 | typedef int (*RansacFuncDouble)(double *matched_points, int npoints, 30 | int *num_inliers_by_motion, 31 | MotionModel *params_by_motion, int num_motions); 32 | RansacFunc av1_get_ransac_type(TransformationType type); 33 | RansacFuncDouble av1_get_ransac_double_prec_type(TransformationType type); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif // AOM_AOM_DSP_FLOW_ESTIMATION_RANSAC_H_ 40 | -------------------------------------------------------------------------------- /aom_dsp/rect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_RECT_H_ 13 | #define AOM_AOM_DSP_RECT_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include 18 | 19 | // Struct representing a rectangle of pixels. 20 | // The axes are inclusive-exclusive, ie. the point (top, left) is included 21 | // in the rectangle but (bottom, right) is not. 22 | typedef struct { 23 | int left, right, top, bottom; 24 | } PixelRect; 25 | 26 | static INLINE int rect_width(const PixelRect *r) { return r->right - r->left; } 27 | 28 | static INLINE int rect_height(const PixelRect *r) { return r->bottom - r->top; } 29 | 30 | static INLINE bool is_inside_rect(const int x, const int y, 31 | const PixelRect *r) { 32 | return (r->left <= x && x < r->right) && (r->top <= y && y < r->bottom); 33 | } 34 | 35 | #endif // AOM_AOM_DSP_RECT_H_ 36 | -------------------------------------------------------------------------------- /aom_dsp/simd/v256_intrinsics_arm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_SIMD_V256_INTRINSICS_ARM_H_ 13 | #define AOM_AOM_DSP_SIMD_V256_INTRINSICS_ARM_H_ 14 | 15 | #include "aom_dsp/simd/v256_intrinsics_v128.h" 16 | 17 | #endif // AOM_AOM_DSP_SIMD_V256_INTRINSICS_ARM_H_ 18 | -------------------------------------------------------------------------------- /aom_dsp/sse.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | /* Sum the difference between every corresponding element of the buffers. */ 13 | 14 | #include "config/aom_config.h" 15 | #include "config/aom_dsp_rtcd.h" 16 | 17 | #include "aom/aom_integer.h" 18 | 19 | int64_t aom_sse_c(const uint8_t *a, int a_stride, const uint8_t *b, 20 | int b_stride, int width, int height) { 21 | int y, x; 22 | int64_t sse = 0; 23 | 24 | for (y = 0; y < height; y++) { 25 | for (x = 0; x < width; x++) { 26 | const int32_t diff = abs(a[x] - b[x]); 27 | sse += diff * diff; 28 | } 29 | 30 | a += a_stride; 31 | b += b_stride; 32 | } 33 | return sse; 34 | } 35 | 36 | #if CONFIG_AV1_HIGHBITDEPTH 37 | int64_t aom_highbd_sse_c(const uint8_t *a8, int a_stride, const uint8_t *b8, 38 | int b_stride, int width, int height) { 39 | int y, x; 40 | int64_t sse = 0; 41 | uint16_t *a = CONVERT_TO_SHORTPTR(a8); 42 | uint16_t *b = CONVERT_TO_SHORTPTR(b8); 43 | for (y = 0; y < height; y++) { 44 | for (x = 0; x < width; x++) { 45 | const int32_t diff = (int32_t)(a[x]) - (int32_t)(b[x]); 46 | sse += diff * diff; 47 | } 48 | 49 | a += a_stride; 50 | b += b_stride; 51 | } 52 | return sse; 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /aom_dsp/vmaf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_VMAF_H_ 13 | #define AOM_AOM_DSP_VMAF_H_ 14 | 15 | #include 16 | #include 17 | 18 | #include "aom_scale/yv12config.h" 19 | 20 | void aom_init_vmaf_context(VmafContext **vmaf_context, VmafModel *vmaf_model, 21 | bool cal_vmaf_neg); 22 | void aom_close_vmaf_context(VmafContext *vmaf_context); 23 | 24 | void aom_init_vmaf_model(VmafModel **vmaf_model, const char *model_path); 25 | void aom_close_vmaf_model(VmafModel *vmaf_model); 26 | 27 | void aom_calc_vmaf(VmafModel *vmaf_model, const YV12_BUFFER_CONFIG *source, 28 | const YV12_BUFFER_CONFIG *distorted, int bit_depth, 29 | bool cal_vmaf_neg, double *vmaf); 30 | 31 | void aom_read_vmaf_image(VmafContext *vmaf_context, 32 | const YV12_BUFFER_CONFIG *source, 33 | const YV12_BUFFER_CONFIG *distorted, int bit_depth, 34 | int frame_index); 35 | 36 | double aom_calc_vmaf_at_index(VmafContext *vmaf_context, VmafModel *vmaf_model, 37 | int frame_index); 38 | 39 | void aom_flush_vmaf_context(VmafContext *vmaf_context); 40 | 41 | #endif // AOM_AOM_DSP_VMAF_H_ 42 | -------------------------------------------------------------------------------- /aom_dsp/x86/bitdepth_conversion_avx2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include 13 | 14 | #include "config/aom_config.h" 15 | #include "aom/aom_integer.h" 16 | #include "aom_dsp/aom_dsp_common.h" 17 | 18 | static INLINE __m256i load_tran_low(const tran_low_t *a) { 19 | const __m256i a_low = _mm256_loadu_si256((const __m256i *)a); 20 | const __m256i a_high = _mm256_loadu_si256((const __m256i *)(a + 8)); 21 | return _mm256_packs_epi32(a_low, a_high); 22 | } 23 | 24 | static INLINE void store_tran_low(__m256i a, tran_low_t *b) { 25 | const __m256i one = _mm256_set1_epi16(1); 26 | const __m256i a_hi = _mm256_mulhi_epi16(a, one); 27 | const __m256i a_lo = _mm256_mullo_epi16(a, one); 28 | const __m256i a_1 = _mm256_unpacklo_epi16(a_lo, a_hi); 29 | const __m256i a_2 = _mm256_unpackhi_epi16(a_lo, a_hi); 30 | _mm256_storeu_si256((__m256i *)b, a_1); 31 | _mm256_storeu_si256((__m256i *)(b + 8), a_2); 32 | } 33 | -------------------------------------------------------------------------------- /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 | #if CONFIG_AV1_HIGHBITDEPTH 28 | void aom_highbd_blend_a64_hmask_sse4_1( 29 | uint8_t *dst_8, uint32_t dst_stride, const uint8_t *src0_8, 30 | uint32_t src0_stride, const uint8_t *src1_8, uint32_t src1_stride, 31 | const uint8_t *mask, int w, int h, int bd) { 32 | aom_highbd_blend_a64_mask_sse4_1(dst_8, dst_stride, src0_8, src0_stride, 33 | src1_8, src1_stride, mask, 0, w, h, 0, 0, 34 | bd); 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /aom_dsp/x86/fwd_txfm_sse2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include // SSE2 13 | 14 | #include "config/aom_config.h" 15 | #include "config/aom_dsp_rtcd.h" 16 | 17 | #include "aom_dsp/aom_dsp_common.h" 18 | #include "aom_dsp/x86/fwd_txfm_sse2.h" 19 | 20 | #define DCT_HIGH_BIT_DEPTH 0 21 | #define FDCT4x4_2D_HELPER fdct4x4_helper 22 | #define FDCT4x4_2D aom_fdct4x4_sse2 23 | #define FDCT4x4_2D_LP aom_fdct4x4_lp_sse2 24 | #define FDCT8x8_2D aom_fdct8x8_sse2 25 | #include "aom_dsp/x86/fwd_txfm_impl_sse2.h" 26 | #undef FDCT4x4_2D_HELPER 27 | #undef FDCT4x4_2D 28 | #undef FDCT4x4_2D_LP 29 | #undef FDCT8x8_2D 30 | 31 | #if CONFIG_AV1_HIGHBITDEPTH 32 | 33 | #undef DCT_HIGH_BIT_DEPTH 34 | #define DCT_HIGH_BIT_DEPTH 1 35 | #define FDCT8x8_2D aom_highbd_fdct8x8_sse2 36 | #include "aom_dsp/x86/fwd_txfm_impl_sse2.h" // NOLINT 37 | #undef FDCT8x8_2D 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /aom_dsp/x86/intrapred_x86.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_X86_INTRAPRED_X86_H_ 13 | #define AOM_AOM_DSP_X86_INTRAPRED_X86_H_ 14 | 15 | #include // SSE2 16 | #include "aom/aom_integer.h" 17 | #include "config/aom_config.h" 18 | 19 | static INLINE __m128i dc_sum_16_sse2(const uint8_t *ref) { 20 | __m128i x = _mm_load_si128((__m128i const *)ref); 21 | const __m128i zero = _mm_setzero_si128(); 22 | x = _mm_sad_epu8(x, zero); 23 | const __m128i high = _mm_unpackhi_epi64(x, x); 24 | return _mm_add_epi16(x, high); 25 | } 26 | 27 | static INLINE __m128i dc_sum_32_sse2(const uint8_t *ref) { 28 | __m128i x0 = _mm_load_si128((__m128i const *)ref); 29 | __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16)); 30 | const __m128i zero = _mm_setzero_si128(); 31 | x0 = _mm_sad_epu8(x0, zero); 32 | x1 = _mm_sad_epu8(x1, zero); 33 | x0 = _mm_add_epi16(x0, x1); 34 | const __m128i high = _mm_unpackhi_epi64(x0, x0); 35 | return _mm_add_epi16(x0, high); 36 | } 37 | 38 | #endif // AOM_AOM_DSP_X86_INTRAPRED_X86_H_ 39 | -------------------------------------------------------------------------------- /aom_dsp/x86/sum_squares_sse2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_DSP_X86_SUM_SQUARES_SSE2_H_ 13 | #define AOM_DSP_X86_SUM_SQUARES_SSE2_H_ 14 | 15 | uint64_t aom_sum_squares_2d_i16_nxn_sse2(const int16_t *src, int stride, 16 | int width, int height); 17 | 18 | uint64_t aom_sum_squares_2d_i16_4xn_sse2(const int16_t *src, int stride, 19 | int height); 20 | uint64_t aom_sum_squares_2d_i16_4x4_sse2(const int16_t *src, int stride); 21 | 22 | uint64_t aom_sum_sse_2d_i16_4x4_sse2(const int16_t *src, int stride, int *sum); 23 | uint64_t aom_sum_sse_2d_i16_4xn_sse2(const int16_t *src, int stride, int height, 24 | int *sum); 25 | uint64_t aom_sum_sse_2d_i16_nxn_sse2(const int16_t *src, int stride, int width, 26 | int height, int *sum); 27 | 28 | #endif // AOM_DSP_X86_SUM_SQUARES_SSE2_H_ 29 | -------------------------------------------------------------------------------- /aom_dsp/x86/txfm_common_sse2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_DSP_X86_TXFM_COMMON_SSE2_H_ 13 | #define AOM_AOM_DSP_X86_TXFM_COMMON_SSE2_H_ 14 | 15 | #include 16 | #include "aom/aom_integer.h" 17 | #include "aom_dsp/x86/synonyms.h" 18 | 19 | #define pair_set_epi16(a, b) \ 20 | _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(b)) << 16))) 21 | 22 | // Reverse the 8 16 bit words in __m128i 23 | static INLINE __m128i mm_reverse_epi16(const __m128i x) { 24 | const __m128i a = _mm_shufflelo_epi16(x, 0x1b); 25 | const __m128i b = _mm_shufflehi_epi16(a, 0x1b); 26 | return _mm_shuffle_epi32(b, 0x4e); 27 | } 28 | 29 | #define octa_set_epi16(a, b, c, d, e, f, g, h) \ 30 | _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \ 31 | (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h)) 32 | 33 | #endif // AOM_AOM_DSP_X86_TXFM_COMMON_SSE2_H_ 34 | -------------------------------------------------------------------------------- /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 | if(BUILD_SHARED_LIBS) 27 | target_sources(aom_static PRIVATE $) 28 | endif() 29 | endfunction() 30 | -------------------------------------------------------------------------------- /aom_mem/include/aom_mem_intrnl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ 13 | #define AOM_AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #define ADDRESS_STORAGE_SIZE sizeof(size_t) 18 | 19 | #ifndef DEFAULT_ALIGNMENT 20 | #if defined(VXWORKS) 21 | /*default addr alignment to use in calls to aom_* functions other than 22 | aom_memalign*/ 23 | #define DEFAULT_ALIGNMENT 32 24 | #else 25 | #define DEFAULT_ALIGNMENT (2 * sizeof(void *)) /* NOLINT */ 26 | #endif 27 | #endif 28 | 29 | #endif // AOM_AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ 30 | -------------------------------------------------------------------------------- /aom_ports/arm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_PORTS_ARM_H_ 13 | #define AOM_AOM_PORTS_ARM_H_ 14 | #include 15 | 16 | #include "config/aom_config.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /*ARMv5TE "Enhanced DSP" instructions.*/ 23 | #define HAS_EDSP 0x01 24 | /*ARMv6 "Parallel" or "Media" instructions.*/ 25 | #define HAS_MEDIA 0x02 26 | /*ARMv7 optional NEON instructions.*/ 27 | #define HAS_NEON 0x04 28 | 29 | int aom_arm_cpu_caps(void); 30 | 31 | // Earlier gcc compilers have issues with some neon intrinsics 32 | #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 4 && \ 33 | __GNUC_MINOR__ <= 6 34 | #define AOM_INCOMPATIBLE_GCC 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // AOM_AOM_PORTS_ARM_H_ 42 | -------------------------------------------------------------------------------- /aom_ports/float.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 | %include "aom_ports/x86_abi_support.asm" 14 | 15 | section .text 16 | %if LIBAOM_YASM_WIN64 17 | globalsym(aom_winx64_fldcw) 18 | sym(aom_winx64_fldcw): 19 | sub rsp, 8 20 | mov [rsp], rcx ; win x64 specific 21 | fldcw [rsp] 22 | add rsp, 8 23 | ret 24 | 25 | 26 | globalsym(aom_winx64_fstcw) 27 | sym(aom_winx64_fstcw): 28 | sub rsp, 8 29 | fstcw [rsp] 30 | mov rax, [rsp] 31 | add rsp, 8 32 | ret 33 | %endif 34 | -------------------------------------------------------------------------------- /aom_ports/ppc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_PORTS_PPC_H_ 13 | #define AOM_AOM_PORTS_PPC_H_ 14 | #include 15 | 16 | #include "config/aom_config.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #define HAS_VSX 0x01 23 | 24 | int ppc_simd_caps(void); 25 | 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | 30 | #endif // AOM_AOM_PORTS_PPC_H_ 31 | -------------------------------------------------------------------------------- /aom_ports/sanitizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_PORTS_SANITIZER_H_ 13 | #define AOM_AOM_PORTS_SANITIZER_H_ 14 | 15 | // AddressSanitizer support. 16 | 17 | // Define AOM_ADDRESS_SANITIZER if AddressSanitizer is used. 18 | // Clang. 19 | #if defined(__has_feature) 20 | #if __has_feature(address_sanitizer) 21 | #define AOM_ADDRESS_SANITIZER 1 22 | #endif 23 | #endif // defined(__has_feature) 24 | // GCC. 25 | #if defined(__SANITIZE_ADDRESS__) 26 | #define AOM_ADDRESS_SANITIZER 1 27 | #endif // defined(__SANITIZE_ADDRESS__) 28 | 29 | // Define the macros for AddressSanitizer manual memory poisoning. See 30 | // https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning. 31 | #if defined(AOM_ADDRESS_SANITIZER) 32 | #include 33 | #else 34 | #define ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size)) 35 | #define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size)) 36 | #endif 37 | 38 | #endif // AOM_AOM_PORTS_SANITIZER_H_ 39 | -------------------------------------------------------------------------------- /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 | # Creates the aom_scale build target and makes libaom depend on it. The libaom 24 | # target must exist before this function is called. 25 | function(setup_aom_scale_targets) 26 | add_library(aom_scale OBJECT ${AOM_SCALE_SOURCES}) 27 | target_sources(aom PRIVATE $) 28 | 29 | target_sources(aom PRIVATE $) 30 | if(BUILD_SHARED_LIBS) 31 | target_sources(aom_static PRIVATE $) 32 | endif() 33 | 34 | # Pass the new lib targets up to the parent scope instance of 35 | # $AOM_LIB_TARGETS. 36 | set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_scale PARENT_SCOPE) 37 | endfunction() 38 | -------------------------------------------------------------------------------- /aom_scale/aom_scale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AOM_SCALE_AOM_SCALE_H_ 13 | #define AOM_AOM_SCALE_AOM_SCALE_H_ 14 | 15 | #include "aom_scale/yv12config.h" 16 | 17 | extern void aom_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, 18 | unsigned char *temp_area, unsigned char temp_height, 19 | unsigned int hscale, unsigned int hratio, 20 | unsigned int vscale, unsigned int vratio, 21 | unsigned int interlaced, const int num_planes); 22 | 23 | #endif // AOM_AOM_SCALE_AOM_SCALE_H_ 24 | -------------------------------------------------------------------------------- /aom_scale/aom_scale_rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #include "config/aom_config.h" 12 | 13 | #define RTCD_C 14 | #include "config/aom_scale_rtcd.h" 15 | 16 | #include "aom_ports/aom_once.h" 17 | 18 | void aom_scale_rtcd() { aom_once(setup_rtcd_internal); } 19 | -------------------------------------------------------------------------------- /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 | if(BUILD_SHARED_LIBS) 29 | target_sources(aom_static PRIVATE $) 30 | endif() 31 | endfunction() 32 | -------------------------------------------------------------------------------- /aomedia_logo_200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/aomedia_logo_200.png -------------------------------------------------------------------------------- /av1/common/arm/av1_txfm_neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 4 | * 5 | * This source code is subject to the terms of the BSD 2 Clause License and 6 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 7 | * was not distributed with this source code in the LICENSE file, you can 8 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 9 | * Media Patent License 1.0 was not distributed with this source code in the 10 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 11 | */ 12 | #include 13 | #include 14 | 15 | #include "config/av1_rtcd.h" 16 | 17 | #include "aom_dsp/arm/mem_neon.h" 18 | #include "aom_ports/mem.h" 19 | 20 | void av1_round_shift_array_neon(int32_t *arr, int size, int bit) { 21 | assert(!(size % 4)); 22 | if (!bit) return; 23 | const int32x4_t dup_bits_n_32x4 = vdupq_n_s32((int32_t)(-bit)); 24 | for (int i = 0; i < size; i += 4) { 25 | int32x4_t tmp_q_s32 = vld1q_s32(arr); 26 | tmp_q_s32 = vrshlq_s32(tmp_q_s32, dup_bits_n_32x4); 27 | vst1q_s32(arr, tmp_q_s32); 28 | arr += 4; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /av1/common/arm/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 | 16 | void cdef_copy_rect8_8bit_to_16bit_neon(uint16_t *dst, int dstride, 17 | const uint8_t *src, int sstride, 18 | int width, int height) { 19 | int j; 20 | for (int i = 0; i < height; i++) { 21 | for (j = 0; j < (width & ~0x7); j += 8) { 22 | v64 row = v64_load_unaligned(&src[i * sstride + j]); 23 | v128_store_unaligned(&dst[i * dstride + j], v128_unpack_u8_s16(row)); 24 | } 25 | for (; j < width; j++) { 26 | dst[i * dstride + j] = src[i * sstride + j]; 27 | } 28 | } 29 | } 30 | 31 | void cdef_find_dir_dual_neon(const uint16_t *img1, const uint16_t *img2, 32 | int stride, int32_t *var_out_1st, 33 | int32_t *var_out_2nd, int coeff_shift, 34 | int *out_dir_1st_8x8, int *out_dir_2nd_8x8) { 35 | // Process first 8x8. 36 | *out_dir_1st_8x8 = cdef_find_dir(img1, stride, var_out_1st, coeff_shift); 37 | 38 | // Process second 8x8. 39 | *out_dir_2nd_8x8 = cdef_find_dir(img2, stride, var_out_2nd, coeff_shift); 40 | } 41 | -------------------------------------------------------------------------------- /av1/common/av1_inv_txfm1d_cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_COMMON_AV1_INV_TXFM1D_CFG_H_ 13 | #define AOM_AV1_COMMON_AV1_INV_TXFM1D_CFG_H_ 14 | #include "av1/common/av1_inv_txfm1d.h" 15 | 16 | // sum of fwd_shift_## 17 | static const int8_t inv_start_range[TX_SIZES_ALL] = { 18 | 5, // 4x4 transform 19 | 6, // 8x8 transform 20 | 7, // 16x16 transform 21 | 7, // 32x32 transform 22 | 7, // 64x64 transform 23 | 5, // 4x8 transform 24 | 5, // 8x4 transform 25 | 6, // 8x16 transform 26 | 6, // 16x8 transform 27 | 6, // 16x32 transform 28 | 6, // 32x16 transform 29 | 6, // 32x64 transform 30 | 6, // 64x32 transform 31 | 6, // 4x16 transform 32 | 6, // 16x4 transform 33 | 7, // 8x32 transform 34 | 7, // 32x8 transform 35 | 7, // 16x64 transform 36 | 7, // 64x16 transform 37 | }; 38 | 39 | extern const int8_t *av1_inv_txfm_shift_ls[TX_SIZES_ALL]; 40 | 41 | // Values in both av1_inv_cos_bit_col and av1_inv_cos_bit_row are always 12 42 | // for each valid row and col combination 43 | #define INV_COS_BIT 12 44 | 45 | #endif // AOM_AV1_COMMON_AV1_INV_TXFM1D_CFG_H_ 46 | -------------------------------------------------------------------------------- /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() { aom_once(setup_rtcd_internal); } 19 | -------------------------------------------------------------------------------- /av1/common/scan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_COMMON_SCAN_H_ 13 | #define AOM_AV1_COMMON_SCAN_H_ 14 | 15 | #include "aom/aom_integer.h" 16 | #include "aom_ports/mem.h" 17 | 18 | #include "av1/common/av1_common_int.h" 19 | #include "av1/common/blockd.h" 20 | #include "av1/common/enums.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #define MAX_NEIGHBORS 2 27 | 28 | enum { 29 | SCAN_MODE_ZIG_ZAG, 30 | SCAN_MODE_COL_DIAG, 31 | SCAN_MODE_ROW_DIAG, 32 | SCAN_MODE_COL_1D, 33 | SCAN_MODE_ROW_1D, 34 | SCAN_MODES 35 | } UENUM1BYTE(SCAN_MODE); 36 | 37 | extern const SCAN_ORDER av1_scan_orders[TX_SIZES_ALL][TX_TYPES]; 38 | 39 | void av1_deliver_eob_threshold(const AV1_COMMON *cm, MACROBLOCKD *xd); 40 | 41 | static INLINE const SCAN_ORDER *get_default_scan(TX_SIZE tx_size, 42 | TX_TYPE tx_type) { 43 | return &av1_scan_orders[tx_size][tx_type]; 44 | } 45 | 46 | static INLINE const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) { 47 | return get_default_scan(tx_size, tx_type); 48 | } 49 | 50 | #ifdef __cplusplus 51 | } // extern "C" 52 | #endif 53 | 54 | #endif // AOM_AV1_COMMON_SCAN_H_ 55 | -------------------------------------------------------------------------------- /av1/common/x86/av1_txfm_sse4.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #include "config/av1_rtcd.h" 13 | 14 | #include "av1/common/av1_txfm.h" 15 | #include "av1/common/x86/av1_txfm_sse4.h" 16 | 17 | void av1_round_shift_array_sse4_1(int32_t *arr, int size, int bit) { 18 | __m128i *const vec = (__m128i *)arr; 19 | const int vec_size = size >> 2; 20 | av1_round_shift_array_32_sse4_1(vec, vec, vec_size, bit); 21 | } 22 | -------------------------------------------------------------------------------- /av1/common/x86/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 | 16 | void cdef_find_dir_dual_sse2(const uint16_t *img1, const uint16_t *img2, 17 | int stride, int32_t *var_out_1st, 18 | int32_t *var_out_2nd, int coeff_shift, 19 | int *out_dir_1st_8x8, int *out_dir_2nd_8x8) { 20 | // Process first 8x8. 21 | *out_dir_1st_8x8 = cdef_find_dir(img1, stride, var_out_1st, coeff_shift); 22 | 23 | // Process second 8x8. 24 | *out_dir_2nd_8x8 = cdef_find_dir(img2, stride, var_out_2nd, coeff_shift); 25 | } 26 | 27 | void cdef_copy_rect8_8bit_to_16bit_sse2(uint16_t *dst, int dstride, 28 | const uint8_t *src, int sstride, 29 | int width, int height) { 30 | int j = 0; 31 | for (int i = 0; i < height; i++) { 32 | for (j = 0; j < (width & ~0x7); j += 8) { 33 | v64 row = v64_load_unaligned(&src[i * sstride + j]); 34 | v128_store_unaligned(&dst[i * dstride + j], v128_unpack_u8_s16(row)); 35 | } 36 | for (; j < width; j++) { 37 | dst[i * dstride + j] = src[i * sstride + j]; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /av1/common/x86/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 | 16 | void cdef_find_dir_dual_ssse3(const uint16_t *img1, const uint16_t *img2, 17 | int stride, int32_t *var_out_1st, 18 | int32_t *var_out_2nd, int coeff_shift, 19 | int *out_dir_1st_8x8, int *out_dir_2nd_8x8) { 20 | // Process first 8x8. 21 | *out_dir_1st_8x8 = cdef_find_dir(img1, stride, var_out_1st, coeff_shift); 22 | 23 | // Process second 8x8. 24 | *out_dir_2nd_8x8 = cdef_find_dir(img2, stride, var_out_2nd, coeff_shift); 25 | } 26 | 27 | void cdef_copy_rect8_8bit_to_16bit_ssse3(uint16_t *dst, int dstride, 28 | const uint8_t *src, int sstride, 29 | int width, int height) { 30 | int j; 31 | for (int i = 0; i < height; i++) { 32 | for (j = 0; j < (width & ~0x7); j += 8) { 33 | v64 row = v64_load_unaligned(&src[i * sstride + j]); 34 | v128_store_unaligned(&dst[i * dstride + j], v128_unpack_u8_s16(row)); 35 | } 36 | for (; j < width; j++) { 37 | dst[i * dstride + j] = src[i * sstride + j]; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /av1/decoder/decodemv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_DECODEMV_H_ 13 | #define AOM_AV1_DECODER_DECODEMV_H_ 14 | 15 | #include "aom_dsp/bitreader.h" 16 | 17 | #include "av1/decoder/decoder.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | void av1_read_mode_info(AV1Decoder *const pbi, DecoderCodingBlock *dcb, 24 | aom_reader *r, int x_mis, int y_mis); 25 | 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | 30 | void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd, int blk_row, 31 | int blk_col, TX_SIZE tx_size, aom_reader *r); 32 | 33 | #endif // AOM_AV1_DECODER_DECODEMV_H_ 34 | -------------------------------------------------------------------------------- /av1/decoder/decodetxb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_DECODETXB_H_ 13 | #define AOM_AV1_DECODER_DECODETXB_H_ 14 | 15 | #include "av1/common/enums.h" 16 | 17 | struct aom_reader; 18 | struct AV1Common; 19 | struct DecoderCodingBlock; 20 | struct txb_ctx; 21 | 22 | uint8_t av1_read_coeffs_txb(const struct AV1Common *const cm, 23 | struct DecoderCodingBlock *dcb, 24 | struct aom_reader *const r, const int blk_row, 25 | const int blk_col, const int plane, 26 | const struct txb_ctx *const txb_ctx, 27 | const TX_SIZE tx_size); 28 | 29 | void av1_read_coeffs_txb_facade(const struct AV1Common *const cm, 30 | struct DecoderCodingBlock *dcb, 31 | struct aom_reader *const r, const int plane, 32 | const int row, const int col, 33 | const TX_SIZE tx_size); 34 | #endif // AOM_AV1_DECODER_DECODETXB_H_ 35 | -------------------------------------------------------------------------------- /av1/decoder/detokenize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_DETOKENIZE_H_ 13 | #define AOM_AV1_DECODER_DETOKENIZE_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include "av1/common/scan.h" 18 | #include "av1/decoder/decoder.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, aom_reader *r); 25 | 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | #endif // AOM_AV1_DECODER_DETOKENIZE_H_ 30 | -------------------------------------------------------------------------------- /av1/decoder/dthread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_DTHREAD_H_ 13 | #define AOM_AV1_DECODER_DTHREAD_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include "aom_util/aom_thread.h" 18 | #include "aom/internal/aom_codec_internal.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | struct AV1Common; 25 | struct AV1Decoder; 26 | struct ThreadData; 27 | 28 | typedef struct DecWorkerData { 29 | struct ThreadData *td; 30 | const uint8_t *data_end; 31 | struct aom_internal_error_info error_info; 32 | } DecWorkerData; 33 | 34 | // WorkerData for the FrameWorker thread. It contains all the information of 35 | // the worker and decode structures for decoding a frame. 36 | typedef struct FrameWorkerData { 37 | struct AV1Decoder *pbi; 38 | const uint8_t *data; 39 | const uint8_t *data_end; 40 | size_t data_size; 41 | void *user_priv; 42 | int received_frame; 43 | int frame_context_ready; // Current frame's context is ready to read. 44 | int frame_decoded; // Finished decoding current frame. 45 | } FrameWorkerData; 46 | 47 | #ifdef __cplusplus 48 | } // extern "C" 49 | #endif 50 | 51 | #endif // AOM_AV1_DECODER_DTHREAD_H_ 52 | -------------------------------------------------------------------------------- /av1/decoder/obu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_DECODER_OBU_H_ 13 | #define AOM_AV1_DECODER_OBU_H_ 14 | 15 | #include "aom/aom_codec.h" 16 | #include "av1/decoder/decoder.h" 17 | 18 | // Try to decode one frame from a buffer. 19 | // Returns 1 if we decoded a frame, 20 | // 0 if we didn't decode a frame but that's okay 21 | // (eg, if there was a frame but we skipped it), 22 | // or -1 on error 23 | int aom_decode_frame_from_obus(struct AV1Decoder *pbi, const uint8_t *data, 24 | const uint8_t *data_end, 25 | const uint8_t **p_data_end); 26 | 27 | aom_codec_err_t aom_get_num_layers_from_operating_point_idc( 28 | int operating_point_idc, unsigned int *number_spatial_layers, 29 | unsigned int *number_temporal_layers); 30 | 31 | #endif // AOM_AV1_DECODER_OBU_H_ 32 | -------------------------------------------------------------------------------- /av1/encoder/allintra_vis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_ALLINTRA_VIS_H_ 13 | #define AOM_AV1_ENCODER_ALLINTRA_VIS_H_ 14 | 15 | #include "config/aom_dsp_rtcd.h" 16 | 17 | #include "av1/common/enums.h" 18 | #include "av1/common/reconintra.h" 19 | 20 | #include "av1/encoder/block.h" 21 | #include "av1/encoder/encoder.h" 22 | 23 | void av1_init_mb_wiener_var_buffer(AV1_COMP *cpi); 24 | 25 | void av1_calc_mb_wiener_var_row(AV1_COMP *const cpi, const int mi_row, 26 | int16_t *src_diff, tran_low_t *coeff, 27 | tran_low_t *qcoeff, tran_low_t *dqcoeff, 28 | double *sum_rec_distortion, 29 | double *sum_est_rate); 30 | 31 | void av1_set_mb_wiener_variance(AV1_COMP *cpi); 32 | 33 | int av1_get_sbq_perceptual_ai(AV1_COMP *const cpi, BLOCK_SIZE bsize, int mi_row, 34 | int mi_col); 35 | 36 | // User rating based mode 37 | void av1_init_mb_ur_var_buffer(AV1_COMP *cpi); 38 | 39 | void av1_set_mb_ur_variance(AV1_COMP *cpi); 40 | 41 | int av1_get_sbq_user_rating_based(AV1_COMP *const cpi, int mi_row, int mi_col); 42 | 43 | #endif // AOM_AV1_ENCODER_ALLINTRA_VIS_H_ 44 | -------------------------------------------------------------------------------- /av1/encoder/aq_complexity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_AQ_COMPLEXITY_H_ 13 | #define AOM_AV1_ENCODER_AQ_COMPLEXITY_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #include "av1/common/enums.h" 20 | 21 | struct AV1_COMP; 22 | struct macroblock; 23 | 24 | // Select a segment for the current Block. 25 | void av1_caq_select_segment(const struct AV1_COMP *cpi, struct macroblock *, 26 | BLOCK_SIZE bs, int mi_row, int mi_col, 27 | int projected_rate); 28 | 29 | // This function sets up a set of segments with delta Q values around 30 | // the baseline frame quantizer. 31 | void av1_setup_in_frame_q_adj(struct AV1_COMP *cpi); 32 | 33 | #ifdef __cplusplus 34 | } // extern "C" 35 | #endif 36 | 37 | #endif // AOM_AV1_ENCODER_AQ_COMPLEXITY_H_ 38 | -------------------------------------------------------------------------------- /av1/encoder/aq_variance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_AQ_VARIANCE_H_ 13 | #define AOM_AV1_ENCODER_AQ_VARIANCE_H_ 14 | 15 | #include "av1/encoder/encoder.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void av1_vaq_frame_setup(AV1_COMP *cpi); 22 | 23 | int av1_log_block_var(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); 24 | int av1_log_block_avg(MACROBLOCK *x, BLOCK_SIZE bs); 25 | int av1_log_block_avg_hbd(MACROBLOCK *x, BLOCK_SIZE bs); 26 | int av1_compute_q_from_energy_level_deltaq_mode(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 // AOM_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 AOM_AV1_ENCODER_AV1_FWD_TXFM1D_CFG_H_ 13 | #define AOM_AV1_ENCODER_AV1_FWD_TXFM1D_CFG_H_ 14 | #include "av1/common/enums.h" 15 | #include "av1/encoder/av1_fwd_txfm1d.h" 16 | extern const int8_t *av1_fwd_txfm_shift_ls[TX_SIZES_ALL]; 17 | extern const int8_t av1_fwd_cos_bit_col[5][5]; 18 | extern const int8_t av1_fwd_cos_bit_row[5][5]; 19 | #endif // AOM_AV1_ENCODER_AV1_FWD_TXFM1D_CFG_H_ 20 | -------------------------------------------------------------------------------- /av1/encoder/av1_noise_estimate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_AV1_NOISE_ESTIMATE_H_ 13 | #define AOM_AV1_ENCODER_AV1_NOISE_ESTIMATE_H_ 14 | 15 | #include "av1/encoder/block.h" 16 | #include "aom_scale/yv12config.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #define MAX_VAR_HIST_BINS 20 23 | 24 | typedef enum noise_level { kLowLow, kLow, kMedium, kHigh } NOISE_LEVEL; 25 | 26 | typedef struct noise_estimate { 27 | int enabled; 28 | NOISE_LEVEL level; 29 | int value; 30 | int thresh; 31 | int adapt_thresh; 32 | int count; 33 | int last_w; 34 | int last_h; 35 | int num_frames_estimate; 36 | } NOISE_ESTIMATE; 37 | 38 | struct AV1_COMP; 39 | 40 | void av1_noise_estimate_init(NOISE_ESTIMATE *const ne, int width, int height); 41 | 42 | NOISE_LEVEL av1_noise_estimate_extract_level(NOISE_ESTIMATE *const ne); 43 | 44 | void av1_update_noise_estimate(struct AV1_COMP *const cpi); 45 | 46 | #ifdef __cplusplus 47 | } // extern "C" 48 | #endif 49 | 50 | #endif // AOM_AV1_ENCODER_AV1_NOISE_ESTIMATE_H_ 51 | -------------------------------------------------------------------------------- /av1/encoder/dwt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_DWT_H_ 13 | #define AOM_AV1_ENCODER_DWT_H_ 14 | 15 | #include "av1/common/common.h" 16 | #include "av1/common/enums.h" 17 | 18 | #define DWT_MAX_LENGTH 64 19 | 20 | void av1_fdwt8x8_uint8_input_c(const uint8_t *input, tran_low_t *output, 21 | int stride, int hbd); 22 | 23 | int64_t av1_haar_ac_sad_mxn_uint8_input(const uint8_t *input, int stride, 24 | int hbd, int num_8x8_rows, 25 | int num_8x8_cols); 26 | 27 | #endif // AOM_AV1_ENCODER_DWT_H_ 28 | -------------------------------------------------------------------------------- /av1/encoder/extend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_EXTEND_H_ 13 | #define AOM_AV1_ENCODER_EXTEND_H_ 14 | 15 | #include "aom_scale/yv12config.h" 16 | #include "aom/aom_integer.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | void av1_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src, 23 | YV12_BUFFER_CONFIG *dst); 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // AOM_AV1_ENCODER_EXTEND_H_ 30 | -------------------------------------------------------------------------------- /av1/encoder/global_motion_facade.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_GLOBAL_MOTION_FACADE_H_ 13 | #define AOM_AV1_ENCODER_GLOBAL_MOTION_FACADE_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | struct yv12_buffer_config; 19 | struct AV1_COMP; 20 | 21 | void av1_compute_gm_for_valid_ref_frames( 22 | struct AV1_COMP *cpi, YV12_BUFFER_CONFIG *ref_buf[REF_FRAMES], int frame, 23 | int num_src_corners, int *src_corners, MotionModel *params_by_motion, 24 | uint8_t *segment_map, int segment_map_w, int segment_map_h); 25 | void av1_compute_global_motion_facade(struct AV1_COMP *cpi); 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | 30 | #endif // AOM_AV1_ENCODER_GLOBAL_MOTION_FACADE_H_ 31 | -------------------------------------------------------------------------------- /av1/encoder/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_HASH_H_ 13 | #define AOM_AV1_ENCODER_HASH_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #include "aom/aom_integer.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef struct _crc_calculator { 24 | uint32_t remainder; 25 | uint32_t trunc_poly; 26 | uint32_t bits; 27 | uint32_t table[256]; 28 | uint32_t final_result_mask; 29 | } CRC_CALCULATOR; 30 | 31 | // Initialize the crc calculator. It must be executed at least once before 32 | // calling av1_get_crc_value(). 33 | void av1_crc_calculator_init(CRC_CALCULATOR *p_crc_calculator, uint32_t bits, 34 | uint32_t truncPoly); 35 | uint32_t av1_get_crc_value(CRC_CALCULATOR *p_crc_calculator, uint8_t *p, 36 | int length); 37 | 38 | // CRC32C: POLY = 0x82f63b78; 39 | typedef struct _CRC32C { 40 | /* Table for a quadword-at-a-time software crc. */ 41 | uint32_t table[8][256]; 42 | } CRC32C; 43 | 44 | // init table for software version crc32c 45 | void av1_crc32c_calculator_init(CRC32C *p_crc32c); 46 | 47 | #define AOM_BUFFER_SIZE_FOR_BLOCK_HASH (4096) 48 | 49 | #ifdef __cplusplus 50 | } // extern "C" 51 | #endif 52 | 53 | #endif // AOM_AV1_ENCODER_HASH_H_ 54 | -------------------------------------------------------------------------------- /av1/encoder/hybrid_fwd_txfm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_HYBRID_FWD_TXFM_H_ 13 | #define AOM_AV1_ENCODER_HYBRID_FWD_TXFM_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, 22 | TxfmParam *txfm_param); 23 | 24 | void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, 25 | int diff_stride, TxfmParam *txfm_param); 26 | 27 | /*!\brief Apply Hadamard or DCT transform 28 | * 29 | * \callergraph 30 | * DCT and Hadamard transforms are commonly used for quick RD score estimation. 31 | * The coeff buffer's size should be equal to the number of pixels 32 | * corresponding to tx_size. 33 | */ 34 | void av1_quick_txfm(int use_hadamard, TX_SIZE tx_size, BitDepthInfo bd_info, 35 | const int16_t *src_diff, int src_stride, tran_low_t *coeff); 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // AOM_AV1_ENCODER_HYBRID_FWD_TXFM_H_ 41 | -------------------------------------------------------------------------------- /av1/encoder/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_RANDOM_H_ 13 | #define AOM_AV1_ENCODER_RANDOM_H_ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | // Generate a random number in the range [0, 32768). 20 | static INLINE unsigned int lcg_rand16(unsigned int *state) { 21 | *state = (unsigned int)(*state * 1103515245ULL + 12345); 22 | return *state / 65536 % 32768; 23 | } 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // AOM_AV1_ENCODER_RANDOM_H_ 30 | -------------------------------------------------------------------------------- /av1/encoder/segmentation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_SEGMENTATION_H_ 13 | #define AOM_AV1_ENCODER_SEGMENTATION_H_ 14 | 15 | #include "av1/common/blockd.h" 16 | #include "av1/encoder/encoder.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | void av1_enable_segmentation(struct segmentation *seg); 23 | void av1_disable_segmentation(struct segmentation *seg); 24 | 25 | void av1_disable_segfeature(struct segmentation *seg, int segment_id, 26 | SEG_LVL_FEATURES feature_id); 27 | void av1_clear_segdata(struct segmentation *seg, int segment_id, 28 | SEG_LVL_FEATURES feature_id); 29 | 30 | void av1_choose_segmap_coding_method(AV1_COMMON *cm, MACROBLOCKD *xd); 31 | 32 | void av1_reset_segment_features(AV1_COMMON *cm); 33 | 34 | #ifdef __cplusplus 35 | } // extern "C" 36 | #endif 37 | 38 | #endif // AOM_AV1_ENCODER_SEGMENTATION_H_ 39 | -------------------------------------------------------------------------------- /av1/encoder/superres_scale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_AV1_ENCODER_SUPERRES_SCALE_H_ 13 | #define AOM_AV1_ENCODER_SUPERRES_SCALE_H_ 14 | 15 | #include "av1/encoder/encoder.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | int av1_superres_in_recode_allowed(const AV1_COMP *const cpi); 22 | void av1_superres_post_encode(AV1_COMP *cpi); 23 | 24 | #ifdef __cplusplus 25 | } // extern "C" 26 | #endif 27 | 28 | #endif // AOM_AV1_ENCODER_SUPERRES_SCALE_H_ 29 | -------------------------------------------------------------------------------- /av1/exports_com: -------------------------------------------------------------------------------- 1 | text aom_read_obu_header_and_size 2 | text av1_resize_frame420 3 | -------------------------------------------------------------------------------- /av1/exports_dec: -------------------------------------------------------------------------------- 1 | data aom_codec_av1_dx_algo 2 | text aom_codec_av1_dx 3 | text av1_add_film_grain 4 | -------------------------------------------------------------------------------- /av1/exports_enc: -------------------------------------------------------------------------------- 1 | data aom_codec_av1_cx_algo 2 | text aom_codec_av1_cx 3 | -------------------------------------------------------------------------------- /av1/exports_ident: -------------------------------------------------------------------------------- 1 | text ifd_init 2 | text ifd_inspect 3 | -------------------------------------------------------------------------------- /av1/exports_test: -------------------------------------------------------------------------------- 1 | text av1_get_fwd_txfm_cfg 2 | text av1_rtcd 3 | -------------------------------------------------------------------------------- /av1/qmode_rc/ratectrl_qmode_interface.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, 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/qmode_rc/ratectrl_qmode_interface.h" 13 | 14 | namespace aom { 15 | 16 | AV1RateControlQModeInterface::AV1RateControlQModeInterface() = default; 17 | AV1RateControlQModeInterface::~AV1RateControlQModeInterface() = default; 18 | 19 | } // namespace aom 20 | -------------------------------------------------------------------------------- /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 | endmacro() 25 | -------------------------------------------------------------------------------- /build/cmake/exports_sources.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | # 4 | # This source code is subject to the terms of the BSD 2 Clause License and the 5 | # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 | # not distributed with this source code in the LICENSE file, you can obtain it 7 | # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 | # License 1.0 was not distributed with this source code in the PATENTS file, you 9 | # can obtain it at www.aomedia.org/license/patent. 10 | # 11 | if(AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE_ 14 | set(AOM_BUILD_CMAKE_EXPORTS_SOURCES_CMAKE_ 1) 15 | 16 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_com" 17 | "${AOM_ROOT}/av1/exports_com") 18 | 19 | if(CONFIG_AV1_DECODER) 20 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_dec" 21 | "${AOM_ROOT}/av1/exports_dec") 22 | if(CONFIG_INSPECTION) 23 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/av1/exports_ident") 24 | endif() 25 | endif() 26 | 27 | if(CONFIG_AV1_ENCODER) 28 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_enc" 29 | "${AOM_ROOT}/av1/exports_enc") 30 | endif() 31 | 32 | if(ENABLE_TESTS) 33 | list(APPEND AOM_EXPORTS_SOURCES "${AOM_ROOT}/aom/exports_test" 34 | "${AOM_ROOT}/av1/exports_test") 35 | endif() 36 | -------------------------------------------------------------------------------- /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_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") 20 | set(CMAKE_CXX_COMPILER clang++) 21 | set(CMAKE_CXX_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") 22 | set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") 23 | 24 | # No runtime cpu detect for arm*-ios targets. 25 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") 26 | 27 | # TODO(tomfinegan): Handle bit code embedding. 28 | -------------------------------------------------------------------------------- /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 | if(NOT CMAKE_C_COMPILER) 25 | set(CMAKE_C_COMPILER ${CROSS}gcc) 26 | endif() 27 | if(NOT CMAKE_CXX_COMPILER) 28 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 29 | endif() 30 | if(NOT AS_EXECUTABLE) 31 | set(AS_EXECUTABLE ${CROSS}as) 32 | endif() 33 | set(CMAKE_C_FLAGS_INIT "-march=armv8-a") 34 | set(CMAKE_CXX_FLAGS_INIT "-march=armv8-a") 35 | set(AOM_AS_FLAGS "-march=armv8-a") 36 | set(CMAKE_SYSTEM_PROCESSOR "arm64") 37 | 38 | # No intrinsics flag required for arm64-linux-gcc. 39 | set(AOM_NEON_INTRIN_FLAG "") 40 | 41 | # No runtime cpu detect for arm64-linux-gcc. 42 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") 43 | -------------------------------------------------------------------------------- /build/cmake/toolchains/arm64-macos.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2022, 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 "arm64") 12 | set(CMAKE_SYSTEM_NAME "Darwin") 13 | set(CMAKE_OSX_ARCHITECTURES "arm64") 14 | set(CMAKE_C_FLAGS_INIT "-arch arm64") 15 | set(CMAKE_CXX_FLAGS_INIT "-arch arm64") 16 | set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch arm64") 17 | -------------------------------------------------------------------------------- /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 | if(NOT CMAKE_C_COMPILER) 24 | set(CMAKE_C_COMPILER ${CROSS}gcc) 25 | endif() 26 | if(NOT CMAKE_CXX_COMPILER) 27 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 28 | endif() 29 | if(NOT CMAKE_AR) 30 | set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) 31 | endif() 32 | if(NOT CMAKE_RANLIB) 33 | set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) 34 | endif() 35 | 36 | # No runtime cpu detect for arm64-mingw-gcc. 37 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") 38 | -------------------------------------------------------------------------------- /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 STRING "") 32 | -------------------------------------------------------------------------------- /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 | if(NOT CMAKE_C_COMPILER) 24 | set(CMAKE_C_COMPILER ${CROSS}gcc) 25 | endif() 26 | if(NOT CMAKE_CXX_COMPILER) 27 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 28 | endif() 29 | if(NOT CMAKE_AR) 30 | set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) 31 | endif() 32 | if(NOT CMAKE_RANLIB) 33 | set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) 34 | endif() 35 | 36 | # No runtime cpu detect for armv7-mingw-gcc. 37 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") 38 | -------------------------------------------------------------------------------- /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 STRING "") 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_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") 20 | set(CMAKE_CXX_COMPILER clang++) 21 | set(CMAKE_CXX_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") 22 | set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch ${CMAKE_SYSTEM_PROCESSOR}") 23 | 24 | # TODO(tomfinegan): Handle bit code embedding. 25 | -------------------------------------------------------------------------------- /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 | if(NOT CMAKE_C_COMPILER) 25 | set(CMAKE_C_COMPILER ${CROSS}gcc) 26 | endif() 27 | if(NOT CMAKE_CXX_COMPILER) 28 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 29 | endif() 30 | if(NOT AS_EXECUTABLE) 31 | set(AS_EXECUTABLE ${CROSS}as) 32 | endif() 33 | set(CMAKE_SYSTEM_PROCESSOR "ppc") 34 | 35 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") 36 | -------------------------------------------------------------------------------- /build/cmake/toolchains/riscv-linux-gcc.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2022, 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_RISCV_LINUX_GCC_CMAKE_) 12 | return() 13 | endif() # AOM_BUILD_CMAKE_TOOLCHAINS_RISCV_LINUX_GCC_CMAKE_ 14 | set(AOM_BUILD_CMAKE_TOOLCHAINS_RISCV_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 riscv64-unknown-linux-gnu-) 22 | endif() 23 | 24 | if(NOT CMAKE_C_COMPILER) 25 | set(CMAKE_C_COMPILER ${CROSS}gcc) 26 | endif() 27 | if(NOT CMAKE_CXX_COMPILER) 28 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 29 | endif() 30 | if(NOT AS_EXECUTABLE) 31 | set(AS_EXECUTABLE ${CROSS}as) 32 | endif() 33 | set(CMAKE_SYSTEM_PROCESSOR "riscv") 34 | 35 | set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "") 36 | -------------------------------------------------------------------------------- /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 STRING "") 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_FLAGS_INIT "-m32") 19 | set(CMAKE_CXX_FLAGS_INIT "-m32") 20 | set(CMAKE_EXE_LINKER_FLAGS_INIT "-m32") 21 | -------------------------------------------------------------------------------- /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_FLAGS_INIT "-arch i386") 15 | set(CMAKE_CXX_FLAGS_INIT "-arch i386") 16 | set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch i386") 17 | 18 | # Apple tools always complain in 32 bit mode without PIC. 19 | set(CONFIG_PIC 1 CACHE STRING "") 20 | -------------------------------------------------------------------------------- /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_FLAGS_INIT "-m32") 19 | set(CMAKE_CXX_FLAGS_INIT "-m32") 20 | set(CMAKE_EXE_LINKER_FLAGS_INIT "-m32") 21 | 22 | if("${CROSS}" STREQUAL "") 23 | set(CROSS i686-w64-mingw32-) 24 | endif() 25 | 26 | if(NOT CMAKE_C_COMPILER) 27 | set(CMAKE_C_COMPILER ${CROSS}gcc) 28 | endif() 29 | if(NOT CMAKE_CXX_COMPILER) 30 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 31 | endif() 32 | if(NOT CMAKE_AR) 33 | set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) 34 | endif() 35 | if(NOT CMAKE_RANLIB) 36 | set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) 37 | endif() 38 | -------------------------------------------------------------------------------- /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-macos.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2022, 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_64") 12 | set(CMAKE_SYSTEM_NAME "Darwin") 13 | set(CMAKE_OSX_ARCHITECTURES "x86_64") 14 | set(CMAKE_C_FLAGS_INIT "-arch x86_64") 15 | set(CMAKE_CXX_FLAGS_INIT "-arch x86_64") 16 | set(CMAKE_EXE_LINKER_FLAGS_INIT "-arch x86_64") 17 | -------------------------------------------------------------------------------- /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 | if(NOT CMAKE_C_COMPILER) 24 | set(CMAKE_C_COMPILER ${CROSS}gcc) 25 | endif() 26 | if(NOT CMAKE_CXX_COMPILER) 27 | set(CMAKE_CXX_COMPILER ${CROSS}g++) 28 | endif() 29 | if(NOT CMAKE_AR) 30 | set(CMAKE_AR ${CROSS}ar CACHE FILEPATH Archiver) 31 | endif() 32 | if(NOT CMAKE_RANLIB) 33 | set(CMAKE_RANLIB ${CROSS}ranlib CACHE FILEPATH Indexer) 34 | endif() 35 | -------------------------------------------------------------------------------- /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/args.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_ARGS_H_ 13 | #define AOM_COMMON_ARGS_H_ 14 | #include 15 | 16 | #include "aom/aom_codec.h" 17 | #include "aom/aom_encoder.h" 18 | #include "common/args_helper.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int arg_match(struct arg *arg_, const struct arg_def *def, char **argv); 25 | int parse_cfg(const char *file, cfg_options_t *config); 26 | const char *arg_next(struct arg *arg); 27 | void arg_show_usage(FILE *fp, const struct arg_def *const *defs); 28 | char **argv_dup(int argc, const char **argv); 29 | 30 | unsigned int arg_parse_uint(const struct arg *arg); 31 | int arg_parse_int(const struct arg *arg); 32 | struct aom_rational arg_parse_rational(const struct arg *arg); 33 | int arg_parse_enum(const struct arg *arg); 34 | int arg_parse_enum_or_int(const struct arg *arg); 35 | int arg_parse_list(const struct arg *arg, int *list, int n); 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // AOM_COMMON_ARGS_H_ 41 | -------------------------------------------------------------------------------- /common/ivf_dec.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, 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_COMMON_IVF_DEC_CMAKE_) 12 | return() 13 | endif() # AOM_COMMON_AOM_COMMON_CMAKE_ 14 | set(AOM_COMMON_IVF_DEC_CMAKE_ 1) 15 | 16 | list(APPEND IVF_DEC_SOURCES "${AOM_ROOT}/common/ivfdec.c" 17 | "${AOM_ROOT}/common/ivfdec.h") 18 | 19 | # Creates the aom_common build target and makes libaom depend on it. The libaom 20 | # target must exist before this function is called. 21 | function(setup_ivf_dec_targets) 22 | add_library(ivf_dec OBJECT ${IVF_DEC_SOURCES}) 23 | set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} ivf_dec PARENT_SCOPE) 24 | target_sources(aom PRIVATE $) 25 | if(BUILD_SHARED_LIBS) 26 | target_sources(aom_static PRIVATE $) 27 | endif() 28 | endfunction() 29 | -------------------------------------------------------------------------------- /common/ivfdec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_COMMON_IVFDEC_H_ 12 | #define AOM_COMMON_IVFDEC_H_ 13 | 14 | #include "aom/aom_codec.h" 15 | #include "common/tools_common.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | int file_is_ivf(struct AvxInputContext *input); 22 | int ivf_read_frame(struct AvxInputContext *input_ctx, uint8_t **buffer, 23 | size_t *bytes_read, size_t *buffer_size, 24 | aom_codec_pts_t *pts); 25 | 26 | #ifdef __cplusplus 27 | } /* extern "C" */ 28 | #endif 29 | 30 | #endif // AOM_COMMON_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 AOM_COMMON_IVFENC_H_ 12 | #define AOM_COMMON_IVFENC_H_ 13 | 14 | #include "common/tools_common.h" 15 | 16 | struct aom_codec_enc_cfg; 17 | struct aom_codec_cx_pkt; 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | void ivf_write_file_header(FILE *outfile, const struct aom_codec_enc_cfg *cfg, 24 | uint32_t fourcc, int frame_cnt); 25 | 26 | void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size); 27 | 28 | void ivf_write_frame_size(FILE *outfile, size_t frame_size); 29 | 30 | #ifdef __cplusplus 31 | } /* extern "C" */ 32 | #endif 33 | 34 | #endif // AOM_COMMON_IVFENC_H_ 35 | -------------------------------------------------------------------------------- /common/md5_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is the header file for the MD5 message-digest algorithm. 3 | * The algorithm is due to Ron Rivest. This code was 4 | * written by Colin Plumb in 1993, no copyright is claimed. 5 | * This code is in the public domain; do with it what you wish. 6 | * 7 | * Equivalent code is available from RSA Data Security, Inc. 8 | * This code has been tested against that, and is equivalent, 9 | * except that you don't need to include two pages of legalese 10 | * with every copy. 11 | * 12 | * To compute the message digest of a chunk of bytes, declare an 13 | * MD5Context structure, pass it to MD5Init, call MD5Update as 14 | * needed on buffers full of bytes, and then call MD5Final, which 15 | * will fill a supplied 16-byte array with the digest. 16 | * 17 | * Changed so as no longer to depend on Colin Plumb's `usual.h' 18 | * header definitions 19 | * - Ian Jackson . 20 | * Still in the public domain. 21 | */ 22 | 23 | #ifndef AOM_COMMON_MD5_UTILS_H_ 24 | #define AOM_COMMON_MD5_UTILS_H_ 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #define md5byte unsigned char 31 | #define UWORD32 unsigned int 32 | 33 | typedef struct MD5Context MD5Context; 34 | struct MD5Context { 35 | UWORD32 buf[4]; 36 | UWORD32 bytes[2]; 37 | UWORD32 in[16]; 38 | }; 39 | 40 | void MD5Init(struct MD5Context *context); 41 | void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len); 42 | void MD5Final(unsigned char digest[16], struct MD5Context *context); 43 | void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]); 44 | 45 | #ifdef __cplusplus 46 | } // extern "C" 47 | #endif 48 | 49 | #endif // AOM_COMMON_MD5_UTILS_H_ 50 | -------------------------------------------------------------------------------- /common/rawenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_COMMON_RAWENC_H_ 13 | #define AOM_COMMON_RAWENC_H_ 14 | 15 | #include "aom/aom_decoder.h" 16 | #include "common/md5_utils.h" 17 | #include "common/tools_common.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | void raw_write_image_file(const aom_image_t *img, const int *planes, 24 | const int num_planes, FILE *file); 25 | void raw_update_image_md5(const aom_image_t *img, const int *planes, 26 | const int num_planes, MD5Context *md5); 27 | 28 | #ifdef __cplusplus 29 | } // extern "C" 30 | #endif 31 | 32 | #endif // AOM_COMMON_RAWENC_H_ 33 | -------------------------------------------------------------------------------- /common/video_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_COMMON_VIDEO_COMMON_H_ 13 | #define AOM_COMMON_VIDEO_COMMON_H_ 14 | 15 | #include "common/tools_common.h" 16 | 17 | typedef struct { 18 | uint32_t codec_fourcc; 19 | int frame_width; 20 | int frame_height; 21 | struct AvxRational time_base; 22 | unsigned int is_annexb; 23 | } AvxVideoInfo; 24 | 25 | #endif // AOM_COMMON_VIDEO_COMMON_H_ 26 | -------------------------------------------------------------------------------- /common/warnings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_COMMON_WARNINGS_H_ 12 | #define AOM_COMMON_WARNINGS_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | struct aom_codec_enc_cfg; 19 | struct AvxEncoderConfig; 20 | 21 | /* 22 | * Checks config for improperly used settings. Warns user upon encountering 23 | * settings that will lead to poor output quality. Prompts user to continue 24 | * when warnings are issued. 25 | */ 26 | void check_encoder_config(int disable_prompt, 27 | const struct AvxEncoderConfig *global_config, 28 | const struct aom_codec_enc_cfg *stream_config); 29 | 30 | #ifdef __cplusplus 31 | } // extern "C" 32 | #endif 33 | 34 | #endif // AOM_COMMON_WARNINGS_H_ 35 | -------------------------------------------------------------------------------- /common/y4menc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_COMMON_Y4MENC_H_ 13 | #define AOM_COMMON_Y4MENC_H_ 14 | 15 | #include "aom/aom_decoder.h" 16 | #include "common/md5_utils.h" 17 | #include "common/tools_common.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #define Y4M_BUFFER_SIZE 256 24 | 25 | int y4m_write_file_header(char *buf, size_t len, int width, int height, 26 | const struct AvxRational *framerate, int monochrome, 27 | aom_chroma_sample_position_t csp, aom_img_fmt_t fmt, 28 | unsigned int bit_depth, aom_color_range_t range); 29 | int y4m_write_frame_header(char *buf, size_t len); 30 | void y4m_write_image_file(const aom_image_t *img, const int *planes, 31 | FILE *file); 32 | void y4m_update_image_md5(const aom_image_t *img, const int *planes, 33 | MD5Context *md5); 34 | 35 | #ifdef __cplusplus 36 | } // extern "C" 37 | #endif 38 | 39 | #endif // AOM_COMMON_Y4MENC_H_ 40 | -------------------------------------------------------------------------------- /doc/dev_guide/av1_decoder.dox: -------------------------------------------------------------------------------- 1 | /*!\page decoder_guide AV1 DECODER GUIDE 2 | 3 | Describe AV1 decoding techniques here. 4 | 5 | \cond 6 | \if av1_md_support 7 | [AV1 Algorithm Description](\ref LALGORITHMDESCRIPTION) 8 | \endif 9 | \endcond 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /doc/dev_guide/av1encoderflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/av1encoderflow.png -------------------------------------------------------------------------------- /doc/dev_guide/av1partitions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/av1partitions.png -------------------------------------------------------------------------------- /doc/dev_guide/coeff_coding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/coeff_coding.png -------------------------------------------------------------------------------- /doc/dev_guide/filter_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/filter_flow.png -------------------------------------------------------------------------------- /doc/dev_guide/filter_thr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/filter_thr.png -------------------------------------------------------------------------------- /doc/dev_guide/genericcodecflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/genericcodecflow.png -------------------------------------------------------------------------------- /doc/dev_guide/gf_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/gf_group.png -------------------------------------------------------------------------------- /doc/dev_guide/partition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/partition.png -------------------------------------------------------------------------------- /doc/dev_guide/tplgfgroupdiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueSwordM/aom-av1-psy/33d1bd19ff594144b75f6ca5eb764fc8c1dffc74/doc/dev_guide/tplgfgroupdiagram.png -------------------------------------------------------------------------------- /examples/av1_dec_fuzzer.dict: -------------------------------------------------------------------------------- 1 | # IVF Signature + version (bytes 0-5) 2 | kw1="DKIF\x00\x00" 3 | 4 | # AV1 codec fourCC (bytes 8-11) 5 | kw2="AV01" 6 | -------------------------------------------------------------------------------- /examples/encoder_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | // Utility functions used by encoder binaries. 13 | 14 | #ifndef AOM_EXAMPLES_ENCODER_UTIL_H_ 15 | #define AOM_EXAMPLES_ENCODER_UTIL_H_ 16 | 17 | #include "aom/aom_image.h" 18 | 19 | // Returns mismatch location (?loc[0],?loc[1]) and the values at that location 20 | // in img1 (?loc[2]) and img2 (?loc[3]). 21 | void aom_find_mismatch_high(const aom_image_t *const img1, 22 | const aom_image_t *const img2, int yloc[4], 23 | int uloc[4], int vloc[4]); 24 | 25 | void aom_find_mismatch(const aom_image_t *const img1, 26 | const aom_image_t *const img2, int yloc[4], int uloc[4], 27 | int vloc[4]); 28 | 29 | // Returns 1 if the two images match. 30 | int aom_compare_img(const aom_image_t *const img1, 31 | const aom_image_t *const img2); 32 | 33 | #endif // AOM_EXAMPLES_ENCODER_UTIL_H_ 34 | -------------------------------------------------------------------------------- /stats/aomstats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_STATS_AOMSTATS_H_ 13 | #define AOM_STATS_AOMSTATS_H_ 14 | 15 | #include 16 | 17 | #include "aom/aom_encoder.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* This structure is used to abstract the different ways of handling 24 | * first pass statistics 25 | */ 26 | typedef struct { 27 | aom_fixed_buf_t buf; 28 | int pass; 29 | FILE *file; 30 | char *buf_ptr; 31 | size_t buf_alloc_sz; 32 | } stats_io_t; 33 | 34 | int stats_open_file(stats_io_t *stats, const char *fpf, int pass); 35 | int stats_open_mem(stats_io_t *stats, int pass); 36 | void stats_close(stats_io_t *stats, int last_pass); 37 | void stats_write(stats_io_t *stats, const void *pkt, size_t len); 38 | aom_fixed_buf_t stats_get(stats_io_t *stats); 39 | 40 | #ifdef __cplusplus 41 | } // extern "C" 42 | #endif 43 | 44 | #endif // AOM_STATS_AOMSTATS_H_ 45 | -------------------------------------------------------------------------------- /stats/rate_hist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_STATS_RATE_HIST_H_ 13 | #define AOM_STATS_RATE_HIST_H_ 14 | 15 | #include "aom/aom_encoder.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | struct rate_hist; 22 | 23 | struct rate_hist *init_rate_histogram(const aom_codec_enc_cfg_t *cfg, 24 | const aom_rational_t *fps); 25 | 26 | void destroy_rate_histogram(struct rate_hist *hist); 27 | 28 | void update_rate_histogram(struct rate_hist *hist, 29 | const aom_codec_enc_cfg_t *cfg, 30 | const aom_codec_cx_pkt_t *pkt); 31 | 32 | void show_q_histogram(const int counts[64], int max_buckets); 33 | 34 | void show_rate_histogram(struct rate_hist *hist, const aom_codec_enc_cfg_t *cfg, 35 | int max_buckets); 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // AOM_STATS_RATE_HIST_H_ 42 | -------------------------------------------------------------------------------- /test/aom_mem_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 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_mem/aom_mem.h" 13 | 14 | #include 15 | #include 16 | 17 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" 18 | 19 | TEST(AomMemTest, Overflow) { 20 | // Allocations are aligned > 1 so SIZE_MAX should always fail. 21 | ASSERT_EQ(aom_malloc(SIZE_MAX), nullptr); 22 | ASSERT_EQ(aom_calloc(1, SIZE_MAX), nullptr); 23 | ASSERT_EQ(aom_calloc(32, SIZE_MAX / 32), nullptr); 24 | ASSERT_EQ(aom_calloc(SIZE_MAX, SIZE_MAX), nullptr); 25 | ASSERT_EQ(aom_memalign(1, SIZE_MAX), nullptr); 26 | ASSERT_EQ(aom_memalign(64, SIZE_MAX), nullptr); 27 | ASSERT_EQ(aom_memalign(64, SIZE_MAX - 64), nullptr); 28 | ASSERT_EQ(aom_memalign(64, SIZE_MAX - 64 - sizeof(size_t) + 2), nullptr); 29 | } 30 | 31 | TEST(AomMemTest, NullParams) { 32 | ASSERT_EQ(aom_memset16(nullptr, 0, 0), nullptr); 33 | aom_free(nullptr); 34 | } 35 | -------------------------------------------------------------------------------- /test/av1_common_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/av1_common_int.h" 15 | 16 | TEST(AV1CommonInt, 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/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 "aom_dsp/odintrin.h" 18 | 19 | using libaom_test::ACMRandom; 20 | 21 | TEST(DivuSmallTest, 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(DivuSmallTest, 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 | if [ "$(realtime_only_build)" = "yes" ]; then 21 | exclude_list="${exclude_list} twopass_encoder simple_decoder lightfield_test" 22 | fi 23 | 24 | # Filter out the scripts in $exclude_list. 25 | for word in ${exclude_list}; do 26 | example_tests=$(filter_strings "${example_tests}" "${word}" exclude) 27 | done 28 | 29 | for test in ${example_tests}; do 30 | # Source each test script so that exporting variables can be avoided. 31 | AOM_TEST_NAME="$(basename ${test%.*})" 32 | . "${test}" 33 | done 34 | -------------------------------------------------------------------------------- /test/i420_video_source.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | #ifndef AOM_TEST_I420_VIDEO_SOURCE_H_ 12 | #define AOM_TEST_I420_VIDEO_SOURCE_H_ 13 | #include 14 | #include 15 | #include 16 | 17 | #include "test/yuv_video_source.h" 18 | 19 | namespace libaom_test { 20 | 21 | // This class extends VideoSource to allow parsing of raw yv12 22 | // so that we can do actual file encodes. 23 | class I420VideoSource : public YUVVideoSource { 24 | public: 25 | I420VideoSource(const std::string &file_name, unsigned int width, 26 | unsigned int height, int rate_numerator, int rate_denominator, 27 | unsigned int start, int limit) 28 | : YUVVideoSource(file_name, AOM_IMG_FMT_I420, width, height, 29 | rate_numerator, rate_denominator, start, limit) {} 30 | }; 31 | 32 | } // namespace libaom_test 33 | 34 | #endif // AOM_TEST_I420_VIDEO_SOURCE_H_ 35 | -------------------------------------------------------------------------------- /test/mock_ratectrl_qmode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, Alliance for Open Media. All rights reserved 3 | * 4 | * This source code is subject to the terms of the BSD 2 Clause License and 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 | * was not distributed with this source code in the LICENSE file, you can 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 | * Media Patent License 1.0 was not distributed with this source code in the 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 | */ 11 | 12 | #ifndef AOM_TEST_MOCK_RATECTRL_QMODE_H_ 13 | #define AOM_TEST_MOCK_RATECTRL_QMODE_H_ 14 | 15 | #include "av1/qmode_rc/ratectrl_qmode_interface.h" 16 | #include "third_party/googletest/src/googlemock/include/gmock/gmock.h" 17 | 18 | namespace aom { 19 | 20 | class MockRateControlQMode : public AV1RateControlQModeInterface { 21 | public: 22 | MOCK_METHOD(Status, SetRcParam, (const RateControlParam &rc_param), 23 | (override)); 24 | MOCK_METHOD(StatusOr, DetermineGopInfo, 25 | (const FirstpassInfo &firstpass_info), (override)); 26 | MOCK_METHOD(StatusOr, GetGopEncodeInfo, 27 | (const GopStruct &gop_struct, const TplGopStats &tpl_gop_stats, 28 | const std::vector &lookahead_stats, 29 | const FirstpassInfo &firstpass_info, 30 | const RefFrameTable &ref_frame_table_snapshot_init), 31 | (override)); 32 | MOCK_METHOD(StatusOr, GetTplPassGopEncodeInfo, 33 | (const GopStruct &gop_struct, 34 | const FirstpassInfo &firstpass_info), 35 | (override)); 36 | }; 37 | 38 | } // namespace aom 39 | 40 | #endif // AOM_TEST_MOCK_RATECTRL_QMODE_H_ 41 | -------------------------------------------------------------------------------- /test/ratectrl_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 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/encoder/firstpass.h" 13 | #include "av1/encoder/ratectrl.h" 14 | #include "av1/encoder/tpl_model.h" 15 | #include "third_party/googletest/src/googletest/include/gtest/gtest.h" 16 | 17 | namespace { 18 | 19 | TEST(RatectrlTest, QModeGetQIndexTest) { 20 | int base_q_index = 36; 21 | int gf_update_type = INTNL_ARF_UPDATE; 22 | int gf_pyramid_level = 1; 23 | int arf_q = 100; 24 | int q_index = av1_q_mode_get_q_index(base_q_index, gf_update_type, 25 | gf_pyramid_level, arf_q); 26 | EXPECT_EQ(q_index, arf_q); 27 | 28 | gf_update_type = INTNL_ARF_UPDATE; 29 | gf_pyramid_level = 3; 30 | q_index = av1_q_mode_get_q_index(base_q_index, gf_update_type, 31 | gf_pyramid_level, arf_q); 32 | EXPECT_LT(q_index, arf_q); 33 | 34 | gf_update_type = LF_UPDATE; 35 | q_index = av1_q_mode_get_q_index(base_q_index, gf_update_type, 36 | gf_pyramid_level, arf_q); 37 | EXPECT_EQ(q_index, base_q_index); 38 | } 39 | } // namespace 40 | -------------------------------------------------------------------------------- /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/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_aom_rc_interface.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 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 | int main(int argc, char **argv) { 15 | ::testing::InitGoogleTest(&argc, argv); 16 | return RUN_ALL_TESTS(); 17 | } 18 | -------------------------------------------------------------------------------- /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 12 | OR "${GTEST_SHARD_INDEX}" STREQUAL "" 13 | OR NOT TEST_LIBAOM) 14 | message( 15 | FATAL_ERROR 16 | "The variables GTEST_SHARD_INDEX, GTEST_TOTAL_SHARDS and TEST_LIBAOM 17 | must be defined.") 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 AOM_TEST_TEST_VECTORS_H_ 13 | #define AOM_TEST_TEST_VECTORS_H_ 14 | 15 | #include "config/aom_config.h" 16 | 17 | namespace libaom_test { 18 | 19 | #if CONFIG_AV1_DECODER 20 | extern const int kNumAV1TestVectors; 21 | extern const char *const kAV1TestVectors[]; 22 | #endif 23 | 24 | } // namespace libaom_test 25 | 26 | #endif // AOM_TEST_TEST_VECTORS_H_ 27 | -------------------------------------------------------------------------------- /third_party/SVT-AV1/EbMemory_SSE4_1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright(c) 2019 Intel Corporation 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 https://www.aomedia.org/license/software-license. If the 8 | * Alliance for Open Media Patent License 1.0 was not distributed with this 9 | * source code in the PATENTS file, you can obtain it at 10 | * https://www.aomedia.org/license/patent-license. 11 | */ 12 | 13 | #ifndef AOM_THIRD_PARTY_SVT_AV1_EBMEMORY_SSE4_1_H_ 14 | #define AOM_THIRD_PARTY_SVT_AV1_EBMEMORY_SSE4_1_H_ 15 | 16 | #include 17 | 18 | #include "config/aom_config.h" 19 | 20 | #include "aom/aom_integer.h" 21 | 22 | static INLINE __m128i load8bit_4x2_sse4_1(const void *const src, 23 | const ptrdiff_t strideInByte) { 24 | const __m128i s = _mm_cvtsi32_si128(*(int32_t *)((uint8_t *)src)); 25 | return _mm_insert_epi32(s, *(int32_t *)((uint8_t *)src + strideInByte), 1); 26 | } 27 | 28 | static INLINE __m128i load_u8_4x2_sse4_1(const uint8_t *const src, 29 | const ptrdiff_t stride) { 30 | return load8bit_4x2_sse4_1(src, sizeof(*src) * stride); 31 | } 32 | 33 | static INLINE __m128i load_u16_2x2_sse4_1(const uint16_t *const src, 34 | const ptrdiff_t stride) { 35 | return load8bit_4x2_sse4_1(src, sizeof(*src) * stride); 36 | } 37 | 38 | #endif // AOM_THIRD_PARTY_SVT_AV1_EBMEMORY_SSE4_1_H_ 39 | -------------------------------------------------------------------------------- /third_party/SVT-AV1/LICENSE.md: -------------------------------------------------------------------------------- 1 | BSD 3-Clause Clear License 2 | The Clear BSD License 3 | 4 | Copyright (c) 2021, Alliance for Open Media 5 | 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted (subject to the limitations in the disclaimer below) 10 | provided that the following conditions are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | 2. Redistributions in binary form must reproduce the above copyright 16 | notice, this list of conditions and the following disclaimer in 17 | the documentation and/or other materials provided with the distribution. 18 | 19 | 3. Neither the name of the Alliance for Open Media nor the names of its 20 | contributors may be used to endorse or promote products derived from 21 | this software without specific prior written permission. 22 | 23 | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 26 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 27 | THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 29 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /third_party/SVT-AV1/README.libaom: -------------------------------------------------------------------------------- 1 | URL: https://gitlab.com/AOMediaCodec/SVT-AV1 2 | 3 | Version: 8ff99c90359330d2e807757c9425560bbc452ff3 4 | License: BSD-3-clause clear 5 | License File: LICENSE.md 6 | 7 | Description: 8 | Port the x86 intrinsics used for single reference convolve reconstructions. 9 | 10 | Local Changes: 11 | Only ported the functions pertinent to single reference convolves. 12 | All functions are made static inline to avoid function call overheads. 13 | References to some arrays are changed to libaom version when applicable. 14 | Some extra intrinsic functions are added to support missing block sizes. 15 | -------------------------------------------------------------------------------- /third_party/SVT-AV1/synonyms.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_THIRD_PARTY_SVT_AV1_SYNONYMS_H_ 13 | #define AOM_THIRD_PARTY_SVT_AV1_SYNONYMS_H_ 14 | 15 | #include "aom_dsp/x86/mem_sse2.h" 16 | #include "aom_dsp/x86/synonyms.h" 17 | 18 | static INLINE __m128i load_u8_8x2_sse2(const uint8_t *const src, 19 | const ptrdiff_t stride) { 20 | return load_8bit_8x2_to_1_reg_sse2(src, (int)(sizeof(*src) * stride)); 21 | } 22 | 23 | static AOM_FORCE_INLINE void store_u8_4x2_sse2(const __m128i src, 24 | uint8_t *const dst, 25 | const ptrdiff_t stride) { 26 | xx_storel_32(dst, src); 27 | *(uint32_t *)(dst + stride) = 28 | ((uint32_t)_mm_extract_epi16(src, 3) << 16) | _mm_extract_epi16(src, 2); 29 | } 30 | 31 | #endif // AOM_THIRD_PARTY_SVT_AV1_SYNONYMS_H_ 32 | -------------------------------------------------------------------------------- /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.libaom: -------------------------------------------------------------------------------- 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 | Prefix global functions with "aom_" 41 | Add error checking 42 | -------------------------------------------------------------------------------- /third_party/googletest/README.libaom: -------------------------------------------------------------------------------- 1 | URL: https://github.com/google/googletest 2 | Version: release-1.12.1 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 | .clang-format 17 | CMakeLists.txt 18 | CONTRIBUTORS 19 | googlemock/ 20 | cmake 21 | CMakeLists.txt 22 | include 23 | README.md 24 | src 25 | googletest/ 26 | cmake 27 | CMakeLists.txt 28 | include 29 | README.md 30 | src 31 | LICENSE 32 | README.md 33 | - In googletest/include/gtest/internal/custom/gtest-port.h, define 34 | GTEST_HAS_NOTIFICATION_ as 1 and use a stub Notification class to fix 35 | the mingw32 g++ compilation errors caused by the lack of std::mutex 36 | and std::condition_variable in the and 37 | headers if mingw32 is configured with the win32 threads option. See 38 | https://stackoverflow.com/questions/17242516/mingw-w64-threads-posix-vs-win32 39 | -------------------------------------------------------------------------------- /third_party/googletest/src/.clang-format: -------------------------------------------------------------------------------- 1 | # Run manually to reformat a file: 2 | # clang-format -i --style=file 3 | Language: Cpp 4 | BasedOnStyle: Google 5 | -------------------------------------------------------------------------------- /third_party/googletest/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Note: CMake support is community-based. The maintainers do not use CMake 2 | # internally. 3 | 4 | cmake_minimum_required(VERSION 3.5) 5 | 6 | if (POLICY CMP0048) 7 | cmake_policy(SET CMP0048 NEW) 8 | endif (POLICY CMP0048) 9 | 10 | if (POLICY CMP0077) 11 | cmake_policy(SET CMP0077 NEW) 12 | endif (POLICY CMP0077) 13 | 14 | project(googletest-distribution) 15 | set(GOOGLETEST_VERSION 1.12.1) 16 | 17 | if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) 18 | set(CMAKE_CXX_EXTENSIONS OFF) 19 | endif() 20 | 21 | enable_testing() 22 | 23 | include(CMakeDependentOption) 24 | include(GNUInstallDirs) 25 | 26 | #Note that googlemock target already builds googletest 27 | option(BUILD_GMOCK "Builds the googlemock subproject" ON) 28 | option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) 29 | 30 | if(BUILD_GMOCK) 31 | add_subdirectory( googlemock ) 32 | else() 33 | add_subdirectory( googletest ) 34 | endif() 35 | -------------------------------------------------------------------------------- /third_party/googletest/src/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/googlemock/README.md: -------------------------------------------------------------------------------- 1 | # Googletest Mocking (gMock) Framework 2 | 3 | ### Overview 4 | 5 | Google's framework for writing and using C++ mock classes. It can help you 6 | derive better designs of your system and write better tests. 7 | 8 | It is inspired by: 9 | 10 | * [jMock](http://www.jmock.org/) 11 | * [EasyMock](http://www.easymock.org/) 12 | * [Hamcrest](http://code.google.com/p/hamcrest/) 13 | 14 | It is designed with C++'s specifics in mind. 15 | 16 | gMock: 17 | 18 | - Provides a declarative syntax for defining mocks. 19 | - Can define partial (hybrid) mocks, which are a cross of real and mock 20 | objects. 21 | - Handles functions of arbitrary types and overloaded functions. 22 | - Comes with a rich set of matchers for validating function arguments. 23 | - Uses an intuitive syntax for controlling the behavior of a mock. 24 | - Does automatic verification of expectations (no record-and-replay needed). 25 | - Allows arbitrary (partial) ordering constraints on function calls to be 26 | expressed. 27 | - Lets a user extend it by defining new matchers and actions. 28 | - Does not use exceptions. 29 | - Is easy to learn and use. 30 | 31 | Details and examples can be found here: 32 | 33 | * [gMock for Dummies](https://google.github.io/googletest/gmock_for_dummies.html) 34 | * [Legacy gMock FAQ](https://google.github.io/googletest/gmock_faq.html) 35 | * [gMock Cookbook](https://google.github.io/googletest/gmock_cook_book.html) 36 | * [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html) 37 | 38 | GoogleMock is a part of 39 | [GoogleTest C++ testing framework](http://github.com/google/googletest/) and a 40 | subject to the same requirements. 41 | -------------------------------------------------------------------------------- /third_party/googletest/src/googlemock/cmake/gmock.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gmock 5 | Description: GoogleMock (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /third_party/googletest/src/googlemock/cmake/gmock_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gmock_main 5 | Description: GoogleMock (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gmock = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /third_party/googletest/src/googlemock/include/gmock/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gmock-port.h` 6 | 7 | The following macros can be defined: 8 | 9 | ### Flag related macros: 10 | 11 | * `GMOCK_DECLARE_bool_(name)` 12 | * `GMOCK_DECLARE_int32_(name)` 13 | * `GMOCK_DECLARE_string_(name)` 14 | * `GMOCK_DEFINE_bool_(name, default_val, doc)` 15 | * `GMOCK_DEFINE_int32_(name, default_val, doc)` 16 | * `GMOCK_DEFINE_string_(name, default_val, doc)` 17 | * `GMOCK_FLAG_GET(flag_name)` 18 | * `GMOCK_FLAG_SET(flag_name, value)` 19 | -------------------------------------------------------------------------------- /third_party/googletest/src/googlemock/include/gmock/internal/custom/gmock-generated-actions.h: -------------------------------------------------------------------------------- 1 | // IWYU pragma: private, include "gmock/gmock.h" 2 | // IWYU pragma: friend gmock/.* 3 | 4 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 5 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 6 | 7 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 8 | -------------------------------------------------------------------------------- /third_party/googletest/src/googletest/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | include(CMakeFindDependencyMacro) 3 | if (@GTEST_HAS_PTHREAD@) 4 | set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@) 5 | find_dependency(Threads) 6 | endif() 7 | 8 | include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") 9 | check_required_components("@project_name@") 10 | -------------------------------------------------------------------------------- /third_party/googletest/src/googletest/cmake/gtest.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest 5 | Description: GoogleTest (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@ 9 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 10 | -------------------------------------------------------------------------------- /third_party/googletest/src/googletest/cmake/gtest_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest_main 5 | Description: GoogleTest (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /third_party/googletest/src/googletest/cmake/libgtest.la.in: -------------------------------------------------------------------------------- 1 | # libgtest.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.6 3 | 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Names of this library. 8 | library_names='libgtest.so' 9 | 10 | # Is this an already installed library? 11 | installed=yes 12 | 13 | # Should we warn about portability when linking against -modules? 14 | shouldnotlink=no 15 | 16 | # Files to dlopen/dlpreopen 17 | dlopen='' 18 | dlpreopen='' 19 | 20 | # Directory that this library needs to be installed in: 21 | libdir='@CMAKE_INSTALL_FULL_LIBDIR@' 22 | -------------------------------------------------------------------------------- /third_party/googletest/src/googletest/include/gtest/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gtest.h` 6 | 7 | ### The following macros can be defined: 8 | 9 | * `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of 10 | `OsStackTraceGetterInterface`. 11 | * `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See 12 | `testing::TempDir` for semantics and signature. 13 | 14 | ## Header `gtest-port.h` 15 | 16 | The following macros can be defined: 17 | 18 | ### Logging: 19 | 20 | * `GTEST_LOG_(severity)` 21 | * `GTEST_CHECK_(condition)` 22 | * Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too. 23 | 24 | ### Threading: 25 | 26 | * `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided. 27 | * `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal` 28 | are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)` 29 | and `GTEST_DEFINE_STATIC_MUTEX_(mutex)` 30 | * `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)` 31 | * `GTEST_LOCK_EXCLUDED_(locks)` 32 | 33 | ### Underlying library support features 34 | 35 | * `GTEST_HAS_CXXABI_H_` 36 | 37 | ### Exporting API symbols: 38 | 39 | * `GTEST_API_` - Specifier for exported symbols. 40 | 41 | ## Header `gtest-printers.h` 42 | 43 | * See documentation at `gtest/gtest-printers.h` for details on how to define a 44 | custom printer. 45 | -------------------------------------------------------------------------------- /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 | LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD 18 | LOCAL_LICENSE_CONDITIONS := notice 19 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.TXT $(LOCAL_PATH)/PATENTS.TXT 20 | include $(BUILD_STATIC_LIBRARY) 21 | -------------------------------------------------------------------------------- /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: ee0bab576c338c9807249b99588e352b7268cb62 3 | License: BSD 4 | License File: LICENSE.txt 5 | 6 | Description: 7 | libwebm is used to handle WebM container I/O. 8 | 9 | Local Changes: 10 | Only keep: 11 | - Android.mk 12 | - AUTHORS.TXT 13 | - common/ 14 | file_util.cc/h 15 | hdr_util.cc/h 16 | webmids.h 17 | - LICENSE.TXT 18 | - mkvmuxer/ 19 | - mkvparser/ 20 | - PATENTS.TXT 21 | -------------------------------------------------------------------------------- /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/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011 The LibYuv Project Authors. 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 | -------------------------------------------------------------------------------- /third_party/libyuv/README.libaom: -------------------------------------------------------------------------------- 1 | Name: libyuv 2 | URL: https://chromium.googlesource.com/libyuv/libyuv/ 3 | Version: dfaf7534e0e536f7e5ef8ddd7326797bd09b8622 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 | 17 | diff --git a/third_party/libyuv/source/cpu_id.cc b/third_party/libyuv/source/cpu_id.cc 18 | index fe89452b7..72a7fb82f 100644 19 | --- a/third_party/libyuv/source/cpu_id.cc 20 | +++ b/third_party/libyuv/source/cpu_id.cc 21 | @@ -108,7 +108,7 @@ void CpuId(int eax, int ecx, int* cpu_info) { 22 | // } 23 | // For VS2013 and earlier 32 bit, the _xgetbv(0) optimizer produces bad code. 24 | // https://code.google.com/p/libyuv/issues/detail?id=529 25 | -#if defined(_M_IX86) && (_MSC_VER < 1900) 26 | +#if defined(_M_IX86) && defined(_MSC_VER) && (_MSC_VER < 1900) 27 | #pragma optimize("g", off) 28 | #endif 29 | #if (defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \ 30 | @@ -129,7 +129,7 @@ int GetXCR0() { 31 | #define GetXCR0() 0 32 | #endif // defined(_M_IX86) || defined(_M_X64) .. 33 | // Return optimization to previous setting. 34 | -#if defined(_M_IX86) && (_MSC_VER < 1900) 35 | +#if defined(_M_IX86) && defined(_MSC_VER) && (_MSC_VER < 1900) 36 | #pragma optimize("g", on) 37 | #endif 38 | -------------------------------------------------------------------------------- /third_party/libyuv/include/libyuv/rotate_argb.h: -------------------------------------------------------------------------------- 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 | #ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_ 12 | #define INCLUDE_LIBYUV_ROTATE_ARGB_H_ 13 | 14 | #include "libyuv/basic_types.h" 15 | #include "libyuv/rotate.h" // For RotationMode. 16 | 17 | #ifdef __cplusplus 18 | namespace libyuv { 19 | extern "C" { 20 | #endif 21 | 22 | // Rotate ARGB frame 23 | LIBYUV_API 24 | int ARGBRotate(const uint8_t* src_argb, 25 | int src_stride_argb, 26 | uint8_t* dst_argb, 27 | int dst_stride_argb, 28 | int src_width, 29 | int src_height, 30 | enum RotationMode mode); 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | } // namespace libyuv 35 | #endif 36 | 37 | #endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_ 38 | -------------------------------------------------------------------------------- /third_party/libyuv/include/libyuv/scale_uv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 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 | #ifndef INCLUDE_LIBYUV_SCALE_UV_H_ 12 | #define INCLUDE_LIBYUV_SCALE_UV_H_ 13 | 14 | #include "libyuv/basic_types.h" 15 | #include "libyuv/scale.h" // For FilterMode 16 | 17 | #ifdef __cplusplus 18 | namespace libyuv { 19 | extern "C" { 20 | #endif 21 | 22 | LIBYUV_API 23 | int UVScale(const uint8_t* src_uv, 24 | int src_stride_uv, 25 | int src_width, 26 | int src_height, 27 | uint8_t* dst_uv, 28 | int dst_stride_uv, 29 | int dst_width, 30 | int dst_height, 31 | enum FilterMode filtering); 32 | 33 | #ifdef __cplusplus 34 | } // extern "C" 35 | } // namespace libyuv 36 | #endif 37 | 38 | #endif // INCLUDE_LIBYUV_SCALE_UV_H_ 39 | -------------------------------------------------------------------------------- /third_party/libyuv/include/libyuv/version.h: -------------------------------------------------------------------------------- 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 | #ifndef INCLUDE_LIBYUV_VERSION_H_ 12 | #define INCLUDE_LIBYUV_VERSION_H_ 13 | 14 | #define LIBYUV_VERSION 1768 15 | 16 | #endif // INCLUDE_LIBYUV_VERSION_H_ 17 | -------------------------------------------------------------------------------- /third_party/vector/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Peter Goldsborough 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /third_party/vector/README.libaom: -------------------------------------------------------------------------------- 1 | Name: vector 2 | URL: https://github.com/goldsborough/vector 3 | Version: commit-id: 40efe82 4 | License: MIT 5 | License File: LICENSE 6 | 7 | Description: 8 | A feature-complete, generic and customizable resizable 9 | array implementation in pure C that supports almost 10 | the entire C++ std::vector API, including iterators. 11 | 12 | Local Modifications: 13 | 1. Renamed some functions to fit in with the AOMedia 14 | naming convention. 15 | 2. Removed non-global functions from vector.h. 16 | 3. Made all non-global functions in vector.c static. 17 | -------------------------------------------------------------------------------- /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: 3e5aed95cc470f37e2db3e6506a8deb89b527720 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 config/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 | Copy PIC 'GLOBAL' macros from x86_abi_support.asm 16 | Use .text instead of .rodata on macho to avoid broken tables in PIC mode. 17 | Use .text with no alignment for aout. 18 | Only use 'hidden' visibility with Chromium. 19 | -------------------------------------------------------------------------------- /tools/aggregate_entropy_stats.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 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/auto_refactor/c_files/decl_status_code.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 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 | typedef struct S1 { 13 | int x; 14 | } T1; 15 | 16 | int parse_decl_node_2() { int arr[3]; } 17 | 18 | int parse_decl_node_3() { int *a; } 19 | 20 | int parse_decl_node_4() { T1 t1[3]; } 21 | 22 | int parse_decl_node_5() { T1 *t2[3]; } 23 | 24 | int parse_decl_node_6() { T1 t3[3][3]; } 25 | 26 | int main() { 27 | int a; 28 | T1 t1; 29 | struct S1 s1; 30 | T1 *t2; 31 | } 32 | -------------------------------------------------------------------------------- /tools/auto_refactor/c_files/global_variable.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 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 | extern const int global_a[13]; 13 | 14 | const int global_b = 0; 15 | 16 | typedef struct S1 { 17 | int x; 18 | } T1; 19 | 20 | struct S3 { 21 | int x; 22 | } s3; 23 | 24 | int func_global_1(int *a) { 25 | *a = global_a[3]; 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /tools/auto_refactor/c_files/parse_lvalue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 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 | typedef struct RD { 13 | int u; 14 | int v; 15 | int arr[3]; 16 | } RD; 17 | 18 | typedef struct VP9_COMP { 19 | int y; 20 | RD *rd; 21 | RD rd2; 22 | RD rd3[2]; 23 | } VP9_COMP; 24 | 25 | int parse_lvalue_2(VP9_COMP *cpi) { RD *rd2 = &cpi->rd2; } 26 | 27 | int func(VP9_COMP *cpi, int x) { 28 | cpi->rd->u = 0; 29 | 30 | int y; 31 | y = 0; 32 | 33 | cpi->rd2.v = 0; 34 | 35 | cpi->rd->arr[2] = 0; 36 | 37 | cpi->rd3[1]->arr[2] = 0; 38 | 39 | return 0; 40 | } 41 | 42 | int main() { 43 | int x = 0; 44 | VP9_COMP cpi; 45 | func(&cpi, x); 46 | } 47 | -------------------------------------------------------------------------------- /tools/auto_refactor/c_files/simple_code.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 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 | typedef struct S { 13 | int x; 14 | int y; 15 | int z; 16 | } S; 17 | 18 | typedef struct T { 19 | S s; 20 | } T; 21 | 22 | int d(S *s) { 23 | ++s->x; 24 | s->x--; 25 | s->y = s->y + 1; 26 | int *c = &s->x; 27 | S ss; 28 | ss.x = 1; 29 | ss.x += 2; 30 | ss.z *= 2; 31 | return 0; 32 | } 33 | int b(S *s) { 34 | d(s); 35 | return 0; 36 | } 37 | int c(int x) { 38 | if (x) { 39 | c(x - 1); 40 | } else { 41 | S s; 42 | d(&s); 43 | } 44 | return 0; 45 | } 46 | int a(S *s) { 47 | b(s); 48 | c(1); 49 | return 0; 50 | } 51 | int e() { 52 | c(0); 53 | return 0; 54 | } 55 | int main() { 56 | int p = 3; 57 | S s; 58 | s.x = p + 1; 59 | s.y = 2; 60 | s.z = 3; 61 | a(&s); 62 | T t; 63 | t.s.x = 3; 64 | } 65 | -------------------------------------------------------------------------------- /tools/auto_refactor/c_files/struct_code.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 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 | typedef struct S1 { 13 | int x; 14 | } T1; 15 | 16 | struct S3 { 17 | int x; 18 | }; 19 | 20 | typedef struct { 21 | int x; 22 | struct S3 s3; 23 | } T4; 24 | 25 | typedef union U5 { 26 | int x; 27 | double y; 28 | } T5; 29 | 30 | typedef struct S6 { 31 | struct { 32 | int x; 33 | }; 34 | union { 35 | int y; 36 | int z; 37 | }; 38 | } T6; 39 | 40 | typedef struct S7 { 41 | struct { 42 | int x; 43 | } y; 44 | union { 45 | int w; 46 | } z; 47 | } T7; 48 | 49 | int main() {} 50 | -------------------------------------------------------------------------------- /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/gop_bitrate/analyze_data.py: -------------------------------------------------------------------------------- 1 | with open('experiment.txt', 'r') as file: 2 | lines = file.readlines() 3 | curr_filename = '' 4 | keyframe = 0 5 | actual_value = 0 6 | estimate_value = 0 7 | print('filename, estimated value (b), actual value (b)') 8 | for line in lines: 9 | if line.startswith('input:'): 10 | curr_filename = line[13:].strip() 11 | if line.startswith('estimated'): 12 | estimate_value = float(line[19:].strip()) 13 | if line.startswith('frame:'): 14 | actual_value += float(line[line.find('size')+6:line.find('total')-2]) 15 | if line.startswith('****'): 16 | print(f'{curr_filename}, {estimate_value}, {actual_value}') 17 | estimate_value = 0 18 | actual_value = 0 19 | -------------------------------------------------------------------------------- /tools/gop_bitrate/encode_all_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #INPUT=media/cheer_sif.y4m 3 | OUTPUT=test.webm 4 | LIMIT=17 5 | CPU_USED=3 6 | CQ_LEVEL=36 7 | 8 | for input in media/* 9 | do 10 | echo "****" >> experiment.txt 11 | echo "input: $input" >> experiment.txt 12 | ./aomenc --limit=$LIMIT --codec=av1 --cpu-used=$CPU_USED --end-usage=q --cq-level=$CQ_LEVEL --psnr --threads=0 --profile=0 --lag-in-frames=35 --min-q=0 --max-q=63 --auto-alt-ref=1 --passes=2 --kf-max-dist=160 --kf-min-dist=0 --drop-frame=0 --static-thresh=0 --minsection-pct=0 --maxsection-pct=2000 --arnr-maxframes=7 --arnr-strength=5 --sharpness=0 --undershoot-pct=100 --overshoot-pct=100 --frame-parallel=0 --tile-columns=0 -o $OUTPUT $input >> experiment.txt 13 | done 14 | -------------------------------------------------------------------------------- /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 AOM_TOOLS_OBU_PARSER_H_ 13 | #define AOM_TOOLS_OBU_PARSER_H_ 14 | 15 | #include 16 | 17 | namespace aom_tools { 18 | 19 | // Print information obtained from OBU(s) in data until data is exhausted or an 20 | // error occurs. Returns true when all data is consumed successfully, and 21 | // optionally reports OBU storage overhead via obu_overhead_bytes when the 22 | // pointer is non-null. 23 | bool DumpObu(const uint8_t *data, int length, int *obu_overhead_bytes); 24 | 25 | } // namespace aom_tools 26 | 27 | #endif // AOM_TOOLS_OBU_PARSER_H_ 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /usage_dx.dox: -------------------------------------------------------------------------------- 1 | /*! \page usage_decode Decoding 2 | 3 | The aom_codec_decode() function is at the core of the decode loop. It 4 | processes packets of compressed data passed by the application, producing 5 | decoded images. The decoder expects packets to comprise exactly one image 6 | frame of data. Packets \ref MUST be passed in decode order. If the 7 | application wishes to associate some data with the frame, the 8 | user_priv member may be set. 9 | 10 | \ref samples 11 | 12 | 13 | \section usage_frame_iter Frame Iterator Based Decoding 14 | Decoded frames are made available to the application 15 | through the aom_codec_get_frame() iterator. The application initializes the 16 | iterator storage (of type #aom_codec_iter_t) to NULL, then calls 17 | aom_codec_get_frame repeatedly until it returns NULL, indicating that all 18 | images have been returned. This process may result in zero, one, or many 19 | frames that are ready for display, depending on the codec. 20 | 21 | 22 | */ 23 | --------------------------------------------------------------------------------