├── .clang-format ├── .gitattributes ├── .gitignore ├── .mailmap ├── AUTHORS ├── CHANGELOG ├── CONTRIBUTING.md ├── LICENSE ├── PATENTS ├── README ├── args.c ├── args.h ├── build └── make │ ├── Android.mk │ ├── Makefile │ ├── ads2armasm_ms.pl │ ├── ads2gas.pl │ ├── ads2gas_apple.pl │ ├── armlink_adapter.sh │ ├── configure.sh │ ├── gen_asm_deps.sh │ ├── gen_msvs_def.sh │ ├── gen_msvs_sln.sh │ ├── gen_msvs_vcxproj.sh │ ├── ios-Info.plist │ ├── iosbuild.sh │ ├── msvs_common.sh │ ├── rtcd.pl │ ├── thumb.pm │ └── version.sh ├── build_debug └── non_greedy_mv_test_files │ ├── cur_frame_16x16.txt │ ├── estimation_16x16.txt │ ├── exhaust_16x16.txt │ ├── ground_truth_16x16.txt │ ├── localVar_16x16.txt │ ├── raw_1.png │ ├── raw_1_12_12.png │ └── ref_frame_16x16.txt ├── codereview.settings ├── configure ├── docs.mk ├── examples.mk ├── examples ├── decode_to_md5.c ├── decode_with_drops.c ├── postproc.c ├── set_maps.c ├── simple_decoder.c ├── simple_encoder.c ├── svc_context.h ├── svc_encodeframe.c ├── twopass_encoder.c ├── vp8_multi_resolution_encoder.c ├── vp8cx_set_ref.c ├── vp9_lossless_encoder.c ├── vp9_spatial_svc_encoder.c ├── vp9cx_set_ref.c ├── vpx_dec_fuzzer.cc └── vpx_temporal_svc_encoder.c ├── ivfdec.c ├── ivfdec.h ├── ivfenc.c ├── ivfenc.h ├── keywords.dox ├── libs.doxy_template ├── libs.mk ├── mainpage.dox ├── md5_utils.c ├── md5_utils.h ├── rate_hist.c ├── rate_hist.h ├── solution.mk ├── test ├── acm_random.h ├── active_map_refresh_test.cc ├── active_map_test.cc ├── add_noise_test.cc ├── alt_ref_aq_segment_test.cc ├── altref_test.cc ├── android │ ├── Android.mk │ ├── README │ ├── get_files.py │ └── scrape_gtest_log.py ├── aq_segment_test.cc ├── avg_test.cc ├── bench.cc ├── bench.h ├── blockiness_test.cc ├── borders_test.cc ├── buffer.h ├── byte_alignment_test.cc ├── clear_system_state.h ├── codec_factory.h ├── comp_avg_pred_test.cc ├── config_test.cc ├── consistency_test.cc ├── convolve_test.cc ├── cpu_speed_test.cc ├── cq_test.cc ├── cx_set_ref.sh ├── dct16x16_test.cc ├── dct32x32_test.cc ├── dct_partial_test.cc ├── dct_test.cc ├── decode_api_test.cc ├── decode_corrupted.cc ├── decode_perf_test.cc ├── decode_svc_test.cc ├── decode_test_driver.cc ├── decode_test_driver.h ├── decode_to_md5.sh ├── decode_with_drops.sh ├── encode_api_test.cc ├── encode_perf_test.cc ├── encode_test_driver.cc ├── encode_test_driver.h ├── error_resilience_test.cc ├── examples.sh ├── external_frame_buffer_test.cc ├── fdct8x8_test.cc ├── frame_size_tests.cc ├── hadamard_test.cc ├── i420_video_source.h ├── idct8x8_test.cc ├── idct_test.cc ├── init_vpx_test.cc ├── init_vpx_test.h ├── invalid_file_test.cc ├── ivf_video_source.h ├── keyframe_test.cc ├── level_test.cc ├── lpf_test.cc ├── md5_helper.h ├── minmax_test.cc ├── non_greedy_mv_test.cc ├── partial_idct_test.cc ├── postproc.sh ├── pp_filter_test.cc ├── predict_test.cc ├── quantize_test.cc ├── realtime_test.cc ├── register_state_check.h ├── resize_test.cc ├── sad_test.cc ├── set_maps.sh ├── set_roi.cc ├── simple_decoder.sh ├── simple_encoder.sh ├── stress.sh ├── sum_squares_test.cc ├── superframe_test.cc ├── svc_datarate_test.cc ├── svc_end_to_end_test.cc ├── svc_test.cc ├── svc_test.h ├── test-data.mk ├── test-data.sha1 ├── test.mk ├── test_intra_pred_speed.cc ├── test_libvpx.cc ├── test_rc_interface.cc ├── test_vector_test.cc ├── test_vectors.cc ├── test_vectors.h ├── tile_independence_test.cc ├── timestamp_test.cc ├── tools_common.sh ├── twopass_encoder.sh ├── user_priv_test.cc ├── util.h ├── variance_test.cc ├── video_source.h ├── vp8_boolcoder_test.cc ├── vp8_datarate_test.cc ├── vp8_decrypt_test.cc ├── vp8_denoiser_sse2_test.cc ├── vp8_fdct4x4_test.cc ├── vp8_fragments_test.cc ├── vp8_multi_resolution_encoder.sh ├── vp8_ratectrl_rtc_test.cc ├── vp9_arf_freq_test.cc ├── vp9_block_error_test.cc ├── vp9_boolcoder_test.cc ├── vp9_c_vs_simd_encode.sh ├── vp9_datarate_test.cc ├── vp9_decrypt_test.cc ├── vp9_denoiser_test.cc ├── vp9_encoder_parms_get_to_decoder.cc ├── vp9_end_to_end_test.cc ├── vp9_ethread_test.cc ├── vp9_ext_ratectrl_test.cc ├── vp9_intrapred_test.cc ├── vp9_lossless_test.cc ├── vp9_motion_vector_test.cc ├── vp9_quantize_test.cc ├── vp9_ratectrl_rtc_test.cc ├── vp9_roi_test.cc ├── vp9_scale_test.cc ├── vp9_skip_loopfilter_test.cc ├── vp9_subtract_test.cc ├── vp9_thread_test.cc ├── vpx_image_test.cc ├── vpx_scale_test.cc ├── vpx_scale_test.h ├── vpx_temporal_svc_encoder.sh ├── vpxdec.sh ├── vpxenc.sh ├── webm_video_source.h ├── y4m_test.cc ├── y4m_video_source.h ├── yuv_temporal_filter_test.cc └── yuv_video_source.h ├── third_party ├── googletest │ ├── README.libvpx │ ├── gtest.mk │ └── src │ │ ├── .clang-format │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── 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.libvpx │ ├── 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.libvpx │ ├── include │ │ └── libyuv │ │ │ ├── basic_types.h │ │ │ ├── compare.h │ │ │ ├── convert.h │ │ │ ├── convert_argb.h │ │ │ ├── convert_from.h │ │ │ ├── convert_from_argb.h │ │ │ ├── cpu_id.h │ │ │ ├── macros_msa.h │ │ │ ├── mjpeg_decoder.h │ │ │ ├── planar_functions.h │ │ │ ├── rotate.h │ │ │ ├── rotate_argb.h │ │ │ ├── rotate_row.h │ │ │ ├── row.h │ │ │ ├── scale.h │ │ │ ├── scale_argb.h │ │ │ ├── scale_row.h │ │ │ ├── version.h │ │ │ └── video_common.h │ └── source │ │ ├── compare.cc │ │ ├── compare_common.cc │ │ ├── compare_gcc.cc │ │ ├── compare_msa.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_msa.cc │ │ ├── rotate_neon.cc │ │ ├── rotate_neon64.cc │ │ ├── rotate_win.cc │ │ ├── row_any.cc │ │ ├── row_common.cc │ │ ├── row_gcc.cc │ │ ├── row_msa.cc │ │ ├── row_neon.cc │ │ ├── row_neon64.cc │ │ ├── row_win.cc │ │ ├── scale.cc │ │ ├── scale_any.cc │ │ ├── scale_argb.cc │ │ ├── scale_common.cc │ │ ├── scale_gcc.cc │ │ ├── scale_msa.cc │ │ ├── scale_neon.cc │ │ ├── scale_neon64.cc │ │ ├── scale_win.cc │ │ └── video_common.cc └── x86inc │ ├── LICENSE │ ├── README.libvpx │ └── x86inc.asm ├── tools.mk ├── tools ├── 3D-Reconstruction │ ├── MotionEST │ │ ├── Anandan.py │ │ ├── Exhaust.py │ │ ├── GroundTruth.py │ │ ├── HornSchunck.py │ │ ├── MotionEST.py │ │ ├── SearchSmooth.py │ │ └── Util.py │ ├── genY4M │ │ └── genY4M.py │ └── sketch_3D_reconstruction │ │ ├── BVH.pde │ │ ├── Camera.pde │ │ ├── MotionField.pde │ │ ├── PointCloud.pde │ │ ├── Ray_Tracing.pde │ │ ├── Scene.pde │ │ ├── Transform.pde │ │ ├── Util.pde │ │ └── sketch_3D_reconstruction.pde ├── README.pgo.md ├── cpplint.py ├── diff.py ├── gen_authors.sh ├── intersect-diffs.py ├── lint-hunks.py ├── non_greedy_mv │ └── non_greedy_mv.py ├── set_analyzer_env.sh ├── tiny_ssim.c └── wrap-commit-msg.py ├── tools_common.c ├── tools_common.h ├── usage.dox ├── usage_cx.dox ├── usage_dx.dox ├── video_common.h ├── video_reader.c ├── video_reader.h ├── video_writer.c ├── video_writer.h ├── vp8 ├── common │ ├── alloccommon.c │ ├── alloccommon.h │ ├── arm │ │ ├── loopfilter_arm.c │ │ ├── loopfilter_arm.h │ │ └── neon │ │ │ ├── bilinearpredict_neon.c │ │ │ ├── copymem_neon.c │ │ │ ├── dc_only_idct_add_neon.c │ │ │ ├── dequant_idct_neon.c │ │ │ ├── dequantizeb_neon.c │ │ │ ├── idct_blk_neon.c │ │ │ ├── iwalsh_neon.c │ │ │ ├── loopfiltersimplehorizontaledge_neon.c │ │ │ ├── loopfiltersimpleverticaledge_neon.c │ │ │ ├── mbloopfilter_neon.c │ │ │ ├── shortidct4x4llm_neon.c │ │ │ ├── sixtappredict_neon.c │ │ │ └── vp8_loopfilter_neon.c │ ├── blockd.c │ ├── blockd.h │ ├── coefupdateprobs.h │ ├── common.h │ ├── context.c │ ├── debugmodes.c │ ├── default_coef_probs.h │ ├── dequantize.c │ ├── entropy.c │ ├── entropy.h │ ├── entropymode.c │ ├── entropymode.h │ ├── entropymv.c │ ├── entropymv.h │ ├── extend.c │ ├── extend.h │ ├── filter.c │ ├── filter.h │ ├── findnearmv.c │ ├── findnearmv.h │ ├── generic │ │ └── systemdependent.c │ ├── header.h │ ├── idct_blk.c │ ├── idctllm.c │ ├── invtrans.h │ ├── loongarch │ │ ├── idct_lsx.c │ │ ├── loopfilter_filters_lsx.c │ │ └── sixtap_filter_lsx.c │ ├── loopfilter.h │ ├── loopfilter_filters.c │ ├── mbpitch.c │ ├── mfqe.c │ ├── mips │ │ ├── dspr2 │ │ │ ├── dequantize_dspr2.c │ │ │ ├── filter_dspr2.c │ │ │ ├── idct_blk_dspr2.c │ │ │ ├── idctllm_dspr2.c │ │ │ ├── reconinter_dspr2.c │ │ │ └── vp8_loopfilter_filters_dspr2.c │ │ ├── mmi │ │ │ ├── copymem_mmi.c │ │ │ ├── dequantize_mmi.c │ │ │ ├── idct_blk_mmi.c │ │ │ ├── idctllm_mmi.c │ │ │ ├── loopfilter_filters_mmi.c │ │ │ └── sixtap_filter_mmi.c │ │ └── msa │ │ │ ├── bilinear_filter_msa.c │ │ │ ├── copymem_msa.c │ │ │ ├── idct_msa.c │ │ │ ├── loopfilter_filters_msa.c │ │ │ ├── mfqe_msa.c │ │ │ ├── sixtap_filter_msa.c │ │ │ └── vp8_macros_msa.h │ ├── modecont.c │ ├── modecont.h │ ├── mv.h │ ├── onyx.h │ ├── onyxc_int.h │ ├── onyxd.h │ ├── postproc.c │ ├── postproc.h │ ├── ppflags.h │ ├── quant_common.c │ ├── quant_common.h │ ├── reconinter.c │ ├── reconinter.h │ ├── reconintra.c │ ├── reconintra.h │ ├── reconintra4x4.c │ ├── reconintra4x4.h │ ├── rtcd.c │ ├── rtcd_defs.pl │ ├── setupintrarecon.c │ ├── setupintrarecon.h │ ├── swapyv12buffer.c │ ├── swapyv12buffer.h │ ├── systemdependent.h │ ├── threading.h │ ├── treecoder.c │ ├── treecoder.h │ ├── vp8_entropymodedata.h │ ├── vp8_loopfilter.c │ ├── vp8_skin_detection.c │ ├── vp8_skin_detection.h │ └── x86 │ │ ├── bilinear_filter_sse2.c │ │ ├── dequantize_mmx.asm │ │ ├── idct_blk_mmx.c │ │ ├── idct_blk_sse2.c │ │ ├── idctllm_mmx.asm │ │ ├── idctllm_sse2.asm │ │ ├── iwalsh_sse2.asm │ │ ├── loopfilter_block_sse2_x86_64.asm │ │ ├── loopfilter_sse2.asm │ │ ├── loopfilter_x86.c │ │ ├── mfqe_sse2.asm │ │ ├── recon_mmx.asm │ │ ├── recon_sse2.asm │ │ ├── subpixel_mmx.asm │ │ ├── subpixel_sse2.asm │ │ ├── subpixel_ssse3.asm │ │ └── vp8_asm_stubs.c ├── decoder │ ├── dboolhuff.c │ ├── dboolhuff.h │ ├── decodeframe.c │ ├── decodemv.c │ ├── decodemv.h │ ├── decoderthreading.h │ ├── detokenize.c │ ├── detokenize.h │ ├── ec_types.h │ ├── error_concealment.c │ ├── error_concealment.h │ ├── onyxd_if.c │ ├── onyxd_int.h │ ├── threading.c │ └── treereader.h ├── encoder │ ├── arm │ │ └── neon │ │ │ ├── denoising_neon.c │ │ │ ├── fastquantizeb_neon.c │ │ │ ├── shortfdct_neon.c │ │ │ └── vp8_shortwalsh4x4_neon.c │ ├── bitstream.c │ ├── bitstream.h │ ├── block.h │ ├── boolhuff.c │ ├── boolhuff.h │ ├── copy_c.c │ ├── dct.c │ ├── dct_value_cost.h │ ├── dct_value_tokens.h │ ├── defaultcoefcounts.h │ ├── denoising.c │ ├── denoising.h │ ├── encodeframe.c │ ├── encodeframe.h │ ├── encodeintra.c │ ├── encodeintra.h │ ├── encodemb.c │ ├── encodemb.h │ ├── encodemv.c │ ├── encodemv.h │ ├── ethreading.c │ ├── ethreading.h │ ├── firstpass.c │ ├── firstpass.h │ ├── lookahead.c │ ├── lookahead.h │ ├── loongarch │ │ ├── dct_lsx.c │ │ ├── encodeopt_lsx.c │ │ └── vp8_quantize_lsx.c │ ├── mcomp.c │ ├── mcomp.h │ ├── mips │ │ ├── mmi │ │ │ ├── dct_mmi.c │ │ │ └── vp8_quantize_mmi.c │ │ └── msa │ │ │ ├── dct_msa.c │ │ │ ├── denoising_msa.c │ │ │ ├── encodeopt_msa.c │ │ │ ├── quantize_msa.c │ │ │ └── temporal_filter_msa.c │ ├── modecosts.c │ ├── modecosts.h │ ├── mr_dissim.c │ ├── mr_dissim.h │ ├── onyx_if.c │ ├── onyx_int.h │ ├── pickinter.c │ ├── pickinter.h │ ├── picklpf.c │ ├── picklpf.h │ ├── quantize.h │ ├── ratectrl.c │ ├── ratectrl.h │ ├── rdopt.c │ ├── rdopt.h │ ├── segmentation.c │ ├── segmentation.h │ ├── temporal_filter.c │ ├── temporal_filter.h │ ├── tokenize.c │ ├── tokenize.h │ ├── treewriter.c │ ├── treewriter.h │ ├── vp8_quantize.c │ └── x86 │ │ ├── block_error_sse2.asm │ │ ├── copy_sse2.asm │ │ ├── copy_sse3.asm │ │ ├── dct_sse2.asm │ │ ├── denoising_sse2.c │ │ ├── fwalsh_sse2.asm │ │ ├── quantize_sse4.c │ │ ├── temporal_filter_apply_sse2.asm │ │ ├── vp8_enc_stubs_sse2.c │ │ ├── vp8_quantize_sse2.c │ │ └── vp8_quantize_ssse3.c ├── exports_dec ├── exports_enc ├── vp8_common.mk ├── vp8_cx_iface.c ├── vp8_dx_iface.c ├── vp8_ratectrl_rtc.cc ├── vp8_ratectrl_rtc.h ├── vp8cx.mk └── vp8dx.mk ├── vp9 ├── common │ ├── arm │ │ └── neon │ │ │ ├── vp9_highbd_iht16x16_add_neon.c │ │ │ ├── vp9_highbd_iht4x4_add_neon.c │ │ │ ├── vp9_highbd_iht8x8_add_neon.c │ │ │ ├── vp9_iht16x16_add_neon.c │ │ │ ├── vp9_iht4x4_add_neon.c │ │ │ ├── vp9_iht8x8_add_neon.c │ │ │ └── vp9_iht_neon.h │ ├── mips │ │ ├── dspr2 │ │ │ ├── vp9_itrans16_dspr2.c │ │ │ ├── vp9_itrans4_dspr2.c │ │ │ └── vp9_itrans8_dspr2.c │ │ └── msa │ │ │ ├── vp9_idct16x16_msa.c │ │ │ ├── vp9_idct4x4_msa.c │ │ │ ├── vp9_idct8x8_msa.c │ │ │ └── vp9_mfqe_msa.c │ ├── ppc │ │ └── vp9_idct_vsx.c │ ├── vp9_alloccommon.c │ ├── vp9_alloccommon.h │ ├── vp9_blockd.c │ ├── vp9_blockd.h │ ├── vp9_common.h │ ├── vp9_common_data.c │ ├── vp9_common_data.h │ ├── vp9_debugmodes.c │ ├── vp9_entropy.c │ ├── vp9_entropy.h │ ├── vp9_entropymode.c │ ├── vp9_entropymode.h │ ├── vp9_entropymv.c │ ├── vp9_entropymv.h │ ├── vp9_enums.h │ ├── vp9_filter.c │ ├── vp9_filter.h │ ├── vp9_frame_buffers.c │ ├── vp9_frame_buffers.h │ ├── vp9_idct.c │ ├── vp9_idct.h │ ├── vp9_loopfilter.c │ ├── vp9_loopfilter.h │ ├── vp9_mfqe.c │ ├── vp9_mfqe.h │ ├── vp9_mv.h │ ├── vp9_mvref_common.c │ ├── vp9_mvref_common.h │ ├── vp9_onyxc_int.h │ ├── vp9_postproc.c │ ├── vp9_postproc.h │ ├── vp9_ppflags.h │ ├── vp9_pred_common.c │ ├── vp9_pred_common.h │ ├── vp9_quant_common.c │ ├── vp9_quant_common.h │ ├── vp9_reconinter.c │ ├── vp9_reconinter.h │ ├── vp9_reconintra.c │ ├── vp9_reconintra.h │ ├── vp9_rtcd.c │ ├── vp9_rtcd_defs.pl │ ├── vp9_scale.c │ ├── vp9_scale.h │ ├── vp9_scan.c │ ├── vp9_scan.h │ ├── vp9_seg_common.c │ ├── vp9_seg_common.h │ ├── vp9_thread_common.c │ ├── vp9_thread_common.h │ ├── vp9_tile_common.c │ ├── vp9_tile_common.h │ └── x86 │ │ ├── vp9_highbd_iht16x16_add_sse4.c │ │ ├── vp9_highbd_iht4x4_add_sse4.c │ │ ├── vp9_highbd_iht8x8_add_sse4.c │ │ ├── vp9_idct_intrin_sse2.c │ │ └── vp9_mfqe_sse2.asm ├── decoder │ ├── vp9_decodeframe.c │ ├── vp9_decodeframe.h │ ├── vp9_decodemv.c │ ├── vp9_decodemv.h │ ├── vp9_decoder.c │ ├── vp9_decoder.h │ ├── vp9_detokenize.c │ ├── vp9_detokenize.h │ ├── vp9_dsubexp.c │ ├── vp9_dsubexp.h │ ├── vp9_job_queue.c │ └── vp9_job_queue.h ├── encoder │ ├── arm │ │ └── neon │ │ │ ├── vp9_dct_neon.c │ │ │ ├── vp9_denoiser_neon.c │ │ │ ├── vp9_diamond_search_sad_neon.c │ │ │ ├── vp9_error_neon.c │ │ │ ├── vp9_error_sve.c │ │ │ ├── vp9_frame_scale_neon.c │ │ │ ├── vp9_highbd_error_neon.c │ │ │ ├── vp9_highbd_temporal_filter_neon.c │ │ │ ├── vp9_quantize_neon.c │ │ │ ├── vp9_temporal_filter_neon.c │ │ │ ├── vp9_temporal_filter_neon_dotprod.c │ │ │ └── vp9_temporal_filter_neon_i8mm.c │ ├── mips │ │ └── msa │ │ │ ├── vp9_error_msa.c │ │ │ ├── vp9_fdct16x16_msa.c │ │ │ ├── vp9_fdct4x4_msa.c │ │ │ ├── vp9_fdct8x8_msa.c │ │ │ └── vp9_fdct_msa.h │ ├── ppc │ │ └── vp9_quantize_vsx.c │ ├── vp9_alt_ref_aq.c │ ├── vp9_alt_ref_aq.h │ ├── vp9_aq_360.c │ ├── vp9_aq_360.h │ ├── vp9_aq_complexity.c │ ├── vp9_aq_complexity.h │ ├── vp9_aq_cyclicrefresh.c │ ├── vp9_aq_cyclicrefresh.h │ ├── vp9_aq_variance.c │ ├── vp9_aq_variance.h │ ├── vp9_bitstream.c │ ├── vp9_bitstream.h │ ├── vp9_block.h │ ├── vp9_blockiness.c │ ├── vp9_blockiness.h │ ├── vp9_context_tree.c │ ├── vp9_context_tree.h │ ├── vp9_cost.c │ ├── vp9_cost.h │ ├── vp9_dct.c │ ├── vp9_denoiser.c │ ├── vp9_denoiser.h │ ├── vp9_encodeframe.c │ ├── vp9_encodeframe.h │ ├── vp9_encodemb.c │ ├── vp9_encodemb.h │ ├── vp9_encodemv.c │ ├── vp9_encodemv.h │ ├── vp9_encoder.c │ ├── vp9_encoder.h │ ├── vp9_ethread.c │ ├── vp9_ethread.h │ ├── vp9_ext_ratectrl.c │ ├── vp9_ext_ratectrl.h │ ├── vp9_extend.c │ ├── vp9_extend.h │ ├── vp9_firstpass.c │ ├── vp9_firstpass.h │ ├── vp9_firstpass_stats.h │ ├── vp9_frame_scale.c │ ├── vp9_job_queue.h │ ├── vp9_lookahead.c │ ├── vp9_lookahead.h │ ├── vp9_mbgraph.c │ ├── vp9_mbgraph.h │ ├── vp9_mcomp.c │ ├── vp9_mcomp.h │ ├── vp9_multi_thread.c │ ├── vp9_multi_thread.h │ ├── vp9_noise_estimate.c │ ├── vp9_noise_estimate.h │ ├── vp9_non_greedy_mv.c │ ├── vp9_non_greedy_mv.h │ ├── vp9_partition_models.h │ ├── vp9_picklpf.c │ ├── vp9_picklpf.h │ ├── vp9_pickmode.c │ ├── vp9_pickmode.h │ ├── vp9_quantize.c │ ├── vp9_quantize.h │ ├── vp9_ratectrl.c │ ├── vp9_ratectrl.h │ ├── vp9_rd.c │ ├── vp9_rd.h │ ├── vp9_rdopt.c │ ├── vp9_rdopt.h │ ├── vp9_resize.c │ ├── vp9_resize.h │ ├── vp9_segmentation.c │ ├── vp9_segmentation.h │ ├── vp9_skin_detection.c │ ├── vp9_skin_detection.h │ ├── vp9_speed_features.c │ ├── vp9_speed_features.h │ ├── vp9_subexp.c │ ├── vp9_subexp.h │ ├── vp9_svc_layercontext.c │ ├── vp9_svc_layercontext.h │ ├── vp9_temporal_filter.c │ ├── vp9_temporal_filter.h │ ├── vp9_temporal_filter_constants.h │ ├── vp9_tokenize.c │ ├── vp9_tokenize.h │ ├── vp9_tpl_model.c │ ├── vp9_tpl_model.h │ ├── vp9_treewriter.c │ ├── vp9_treewriter.h │ └── x86 │ │ ├── highbd_temporal_filter_avx2.c │ │ ├── highbd_temporal_filter_sse4.c │ │ ├── highbd_temporal_filter_ssse3.c │ │ ├── temporal_filter_avx2.c │ │ ├── temporal_filter_sse4.c │ │ ├── temporal_filter_ssse3.c │ │ ├── vp9_dct_intrin_sse2.c │ │ ├── vp9_dct_sse2.asm │ │ ├── vp9_denoiser_sse2.c │ │ ├── vp9_error_avx2.c │ │ ├── vp9_error_sse2.asm │ │ ├── vp9_frame_scale_ssse3.c │ │ ├── vp9_highbd_block_error_intrin_sse2.c │ │ ├── vp9_quantize_avx2.c │ │ ├── vp9_quantize_sse2.c │ │ └── vp9_quantize_ssse3.c ├── exports_dec ├── exports_enc ├── ratectrl_rtc.cc ├── ratectrl_rtc.h ├── vp9_common.mk ├── vp9_cx_iface.c ├── vp9_cx_iface.h ├── vp9_dx_iface.c ├── vp9_dx_iface.h ├── vp9_iface_common.c ├── vp9_iface_common.h ├── vp9cx.mk └── vp9dx.mk ├── vpx ├── exports_com ├── exports_dec ├── exports_enc ├── internal │ ├── vpx_codec_internal.h │ └── vpx_ratectrl_rtc.h ├── src │ ├── vpx_codec.c │ ├── vpx_decoder.c │ ├── vpx_encoder.c │ └── vpx_image.c ├── vp8.h ├── vp8cx.h ├── vp8dx.h ├── vpx_codec.h ├── vpx_codec.mk ├── vpx_decoder.h ├── vpx_encoder.h ├── vpx_ext_ratectrl.h ├── vpx_frame_buffer.h ├── vpx_image.h ├── vpx_integer.h └── vpx_tpl.h ├── vpx_dsp ├── add_noise.c ├── arm │ ├── avg_neon.c │ ├── avg_pred_neon.c │ ├── deblock_neon.c │ ├── fdct16x16_neon.c │ ├── fdct16x16_neon.h │ ├── fdct32x32_neon.c │ ├── fdct32x32_neon.h │ ├── fdct4x4_neon.c │ ├── fdct4x4_neon.h │ ├── fdct8x8_neon.c │ ├── fdct8x8_neon.h │ ├── fdct_neon.h │ ├── fdct_partial_neon.c │ ├── hadamard_neon.c │ ├── highbd_avg_neon.c │ ├── highbd_avg_pred_neon.c │ ├── highbd_convolve8_neon.h │ ├── highbd_convolve8_sve.h │ ├── highbd_hadamard_neon.c │ ├── highbd_idct16x16_add_neon.c │ ├── highbd_idct32x32_1024_add_neon.c │ ├── highbd_idct32x32_135_add_neon.c │ ├── highbd_idct32x32_34_add_neon.c │ ├── highbd_idct32x32_add_neon.c │ ├── highbd_idct4x4_add_neon.c │ ├── highbd_idct8x8_add_neon.c │ ├── highbd_idct_neon.h │ ├── highbd_intrapred_neon.c │ ├── highbd_loopfilter_neon.c │ ├── highbd_quantize_neon.c │ ├── highbd_sad4d_neon.c │ ├── highbd_sad_neon.c │ ├── highbd_sse_neon.c │ ├── highbd_subpel_variance_neon.c │ ├── highbd_variance_neon.c │ ├── highbd_variance_neon_dotprod.c │ ├── highbd_variance_sve.c │ ├── highbd_vpx_convolve8_neon.c │ ├── highbd_vpx_convolve8_sve.c │ ├── highbd_vpx_convolve8_sve2.c │ ├── highbd_vpx_convolve_avg_neon.c │ ├── highbd_vpx_convolve_copy_neon.c │ ├── idct16x16_1_add_neon.c │ ├── idct16x16_add_neon.c │ ├── idct32x32_135_add_neon.c │ ├── idct32x32_1_add_neon.c │ ├── idct32x32_34_add_neon.c │ ├── idct32x32_add_neon.c │ ├── idct4x4_1_add_neon.asm │ ├── idct4x4_1_add_neon.c │ ├── idct4x4_add_neon.asm │ ├── idct4x4_add_neon.c │ ├── idct8x8_1_add_neon.c │ ├── idct8x8_add_neon.c │ ├── idct_neon.asm │ ├── idct_neon.h │ ├── intrapred_neon.c │ ├── intrapred_neon_asm.asm │ ├── loopfilter_16_neon.asm │ ├── loopfilter_4_neon.asm │ ├── loopfilter_8_neon.asm │ ├── loopfilter_neon.c │ ├── mem_neon.h │ ├── quantize_neon.c │ ├── sad4d_neon.c │ ├── sad4d_neon_dotprod.c │ ├── sad_neon.c │ ├── sad_neon_dotprod.c │ ├── save_reg_neon.asm │ ├── sse_neon.c │ ├── sse_neon_dotprod.c │ ├── subpel_variance_neon.c │ ├── subtract_neon.c │ ├── sum_neon.h │ ├── sum_squares_neon.c │ ├── sum_squares_sve.c │ ├── transpose_neon.h │ ├── variance_neon.c │ ├── variance_neon_dotprod.c │ ├── vpx_convolve8_avg_horiz_filter_type1_neon.asm │ ├── vpx_convolve8_avg_horiz_filter_type2_neon.asm │ ├── vpx_convolve8_avg_vert_filter_type1_neon.asm │ ├── vpx_convolve8_avg_vert_filter_type2_neon.asm │ ├── vpx_convolve8_horiz_filter_type1_neon.asm │ ├── vpx_convolve8_horiz_filter_type2_neon.asm │ ├── vpx_convolve8_neon.c │ ├── vpx_convolve8_neon.h │ ├── vpx_convolve8_neon_asm.c │ ├── vpx_convolve8_neon_asm.h │ ├── vpx_convolve8_neon_dotprod.c │ ├── vpx_convolve8_neon_i8mm.c │ ├── vpx_convolve8_vert_filter_type1_neon.asm │ ├── vpx_convolve8_vert_filter_type2_neon.asm │ ├── vpx_convolve_avg_neon.c │ ├── vpx_convolve_avg_neon_asm.asm │ ├── vpx_convolve_copy_neon.c │ ├── vpx_convolve_copy_neon_asm.asm │ ├── vpx_convolve_neon.c │ ├── vpx_neon_sve2_bridge.h │ ├── vpx_neon_sve_bridge.h │ └── vpx_scaled_convolve8_neon.c ├── avg.c ├── bitreader.c ├── bitreader.h ├── bitreader_buffer.c ├── bitreader_buffer.h ├── bitwriter.c ├── bitwriter.h ├── bitwriter_buffer.c ├── bitwriter_buffer.h ├── deblock.c ├── fastssim.c ├── fwd_txfm.c ├── fwd_txfm.h ├── intrapred.c ├── inv_txfm.c ├── inv_txfm.h ├── loongarch │ ├── avg_lsx.c │ ├── avg_pred_lsx.c │ ├── bitdepth_conversion_lsx.h │ ├── fwd_dct32x32_lsx.c │ ├── fwd_txfm_lsx.c │ ├── fwd_txfm_lsx.h │ ├── idct32x32_lsx.c │ ├── intrapred_lsx.c │ ├── loopfilter_16_lsx.c │ ├── loopfilter_4_lsx.c │ ├── loopfilter_8_lsx.c │ ├── loopfilter_lsx.h │ ├── quantize_lsx.c │ ├── sad_lsx.c │ ├── sub_pixel_variance_lsx.c │ ├── subtract_lsx.c │ ├── txfm_macros_lsx.h │ ├── variance_lsx.c │ ├── variance_lsx.h │ ├── vpx_convolve8_avg_horiz_lsx.c │ ├── vpx_convolve8_avg_lsx.c │ ├── vpx_convolve8_avg_vert_lsx.c │ ├── vpx_convolve8_horiz_lsx.c │ ├── vpx_convolve8_lsx.c │ ├── vpx_convolve8_vert_lsx.c │ ├── vpx_convolve_avg_lsx.c │ ├── vpx_convolve_copy_lsx.c │ └── vpx_convolve_lsx.h ├── loopfilter.c ├── mips │ ├── add_noise_msa.c │ ├── avg_msa.c │ ├── common_dspr2.c │ ├── common_dspr2.h │ ├── convolve2_avg_dspr2.c │ ├── convolve2_avg_horiz_dspr2.c │ ├── convolve2_dspr2.c │ ├── convolve2_horiz_dspr2.c │ ├── convolve2_vert_dspr2.c │ ├── convolve8_avg_dspr2.c │ ├── convolve8_avg_horiz_dspr2.c │ ├── convolve8_dspr2.c │ ├── convolve8_horiz_dspr2.c │ ├── convolve8_vert_dspr2.c │ ├── convolve_common_dspr2.h │ ├── deblock_msa.c │ ├── fwd_dct32x32_msa.c │ ├── fwd_txfm_msa.c │ ├── fwd_txfm_msa.h │ ├── idct16x16_msa.c │ ├── idct32x32_msa.c │ ├── idct4x4_msa.c │ ├── idct8x8_msa.c │ ├── intrapred16_dspr2.c │ ├── intrapred4_dspr2.c │ ├── intrapred8_dspr2.c │ ├── intrapred_msa.c │ ├── inv_txfm_dspr2.h │ ├── inv_txfm_msa.h │ ├── itrans16_dspr2.c │ ├── itrans32_cols_dspr2.c │ ├── itrans32_dspr2.c │ ├── itrans4_dspr2.c │ ├── itrans8_dspr2.c │ ├── loopfilter_16_msa.c │ ├── loopfilter_4_msa.c │ ├── loopfilter_8_msa.c │ ├── loopfilter_filters_dspr2.c │ ├── loopfilter_filters_dspr2.h │ ├── loopfilter_macros_dspr2.h │ ├── loopfilter_masks_dspr2.h │ ├── loopfilter_mb_dspr2.c │ ├── loopfilter_mb_horiz_dspr2.c │ ├── loopfilter_mb_vert_dspr2.c │ ├── loopfilter_msa.h │ ├── macros_msa.h │ ├── sad_mmi.c │ ├── sad_msa.c │ ├── sub_pixel_variance_msa.c │ ├── subtract_mmi.c │ ├── subtract_msa.c │ ├── sum_squares_msa.c │ ├── txfm_macros_msa.h │ ├── variance_mmi.c │ ├── variance_msa.c │ ├── vpx_convolve8_avg_horiz_msa.c │ ├── vpx_convolve8_avg_msa.c │ ├── vpx_convolve8_avg_vert_msa.c │ ├── vpx_convolve8_horiz_msa.c │ ├── vpx_convolve8_mmi.c │ ├── vpx_convolve8_msa.c │ ├── vpx_convolve8_vert_msa.c │ ├── vpx_convolve_avg_msa.c │ ├── vpx_convolve_copy_msa.c │ └── vpx_convolve_msa.h ├── postproc.h ├── ppc │ ├── bitdepth_conversion_vsx.h │ ├── deblock_vsx.c │ ├── fdct32x32_vsx.c │ ├── hadamard_vsx.c │ ├── intrapred_vsx.c │ ├── inv_txfm_vsx.c │ ├── inv_txfm_vsx.h │ ├── quantize_vsx.c │ ├── sad_vsx.c │ ├── subtract_vsx.c │ ├── transpose_vsx.h │ ├── txfm_common_vsx.h │ ├── types_vsx.h │ ├── variance_vsx.c │ └── vpx_convolve_vsx.c ├── prob.c ├── prob.h ├── psnr.c ├── psnr.h ├── psnrhvs.c ├── quantize.c ├── quantize.h ├── sad.c ├── skin_detection.c ├── skin_detection.h ├── sse.c ├── ssim.c ├── ssim.h ├── subtract.c ├── sum_squares.c ├── txfm_common.h ├── variance.c ├── variance.h ├── vpx_convolve.c ├── vpx_convolve.h ├── vpx_dsp.mk ├── vpx_dsp_common.h ├── vpx_dsp_rtcd.c ├── vpx_dsp_rtcd_defs.pl ├── vpx_filter.h └── x86 │ ├── add_noise_sse2.asm │ ├── avg_intrin_avx2.c │ ├── avg_intrin_sse2.c │ ├── avg_pred_avx2.c │ ├── avg_pred_sse2.c │ ├── avg_ssse3_x86_64.asm │ ├── bitdepth_conversion_avx2.h │ ├── bitdepth_conversion_sse2.asm │ ├── bitdepth_conversion_sse2.h │ ├── convolve.h │ ├── convolve_avx2.h │ ├── convolve_sse2.h │ ├── convolve_ssse3.h │ ├── deblock_sse2.asm │ ├── fwd_dct32x32_impl_avx2.h │ ├── fwd_dct32x32_impl_sse2.h │ ├── fwd_txfm_avx2.c │ ├── fwd_txfm_impl_sse2.h │ ├── fwd_txfm_sse2.c │ ├── fwd_txfm_sse2.h │ ├── fwd_txfm_ssse3_x86_64.asm │ ├── highbd_convolve_avx2.c │ ├── highbd_idct16x16_add_sse2.c │ ├── highbd_idct16x16_add_sse4.c │ ├── highbd_idct32x32_add_sse2.c │ ├── highbd_idct32x32_add_sse4.c │ ├── highbd_idct4x4_add_sse2.c │ ├── highbd_idct4x4_add_sse4.c │ ├── highbd_idct8x8_add_sse2.c │ ├── highbd_idct8x8_add_sse4.c │ ├── highbd_intrapred_intrin_sse2.c │ ├── highbd_intrapred_intrin_ssse3.c │ ├── highbd_intrapred_sse2.asm │ ├── highbd_inv_txfm_sse2.h │ ├── highbd_inv_txfm_sse4.h │ ├── highbd_loopfilter_sse2.c │ ├── highbd_quantize_intrin_avx2.c │ ├── highbd_quantize_intrin_sse2.c │ ├── highbd_sad4d_avx2.c │ ├── highbd_sad4d_sse2.asm │ ├── highbd_sad_avx2.c │ ├── highbd_sad_sse2.asm │ ├── highbd_subpel_variance_impl_sse2.asm │ ├── highbd_variance_impl_sse2.asm │ ├── highbd_variance_sse2.c │ ├── intrapred_sse2.asm │ ├── intrapred_ssse3.asm │ ├── inv_txfm_avx2.c │ ├── inv_txfm_sse2.c │ ├── inv_txfm_sse2.h │ ├── inv_txfm_ssse3.c │ ├── inv_txfm_ssse3.h │ ├── inv_wht_sse2.asm │ ├── loopfilter_avx2.c │ ├── loopfilter_sse2.c │ ├── mem_sse2.h │ ├── post_proc_sse2.c │ ├── quantize_avx.c │ ├── quantize_avx2.c │ ├── quantize_sse2.c │ ├── quantize_sse2.h │ ├── quantize_ssse3.c │ ├── quantize_ssse3.h │ ├── sad4d_avx2.c │ ├── sad4d_avx512.c │ ├── sad4d_sse2.asm │ ├── sad_avx2.c │ ├── sad_avx512.c │ ├── sad_sse2.asm │ ├── sse_avx2.c │ ├── sse_sse4.c │ ├── ssim_opt_x86_64.asm │ ├── subpel_variance_sse2.asm │ ├── subtract_avx2.c │ ├── subtract_sse2.asm │ ├── sum_squares_sse2.c │ ├── transpose_sse2.h │ ├── txfm_common_sse2.h │ ├── variance_avx2.c │ ├── variance_sse2.c │ ├── vpx_convolve_copy_sse2.asm │ ├── vpx_high_subpixel_8t_sse2.asm │ ├── vpx_high_subpixel_bilinear_sse2.asm │ ├── vpx_subpixel_4t_intrin_sse2.c │ ├── vpx_subpixel_8t_intrin_avx2.c │ ├── vpx_subpixel_8t_intrin_ssse3.c │ ├── vpx_subpixel_8t_sse2.asm │ ├── vpx_subpixel_8t_ssse3.asm │ ├── vpx_subpixel_bilinear_sse2.asm │ └── vpx_subpixel_bilinear_ssse3.asm ├── vpx_mem ├── include │ └── vpx_mem_intrnl.h ├── vpx_mem.c ├── vpx_mem.h └── vpx_mem.mk ├── vpx_ports ├── aarch32_cpudetect.c ├── aarch64_cpudetect.c ├── arm.h ├── arm_cpudetect.h ├── asmdefs_mmi.h ├── bitops.h ├── compiler_attributes.h ├── emmintrin_compat.h ├── emms_mmx.asm ├── emms_mmx.c ├── float_control_word.asm ├── loongarch.h ├── loongarch_cpudetect.c ├── mem.h ├── mem_ops.h ├── mem_ops_aligned.h ├── mips.h ├── mips_cpudetect.c ├── ppc.h ├── ppc_cpudetect.c ├── static_assert.h ├── system_state.h ├── vpx_once.h ├── vpx_ports.mk ├── vpx_timer.h ├── x86.h └── x86_abi_support.asm ├── vpx_scale ├── generic │ ├── gen_scalers.c │ ├── vpx_scale.c │ ├── yv12config.c │ └── yv12extend.c ├── mips │ └── dspr2 │ │ └── yv12extend_dspr2.c ├── vpx_scale.h ├── vpx_scale.mk ├── vpx_scale_rtcd.c ├── vpx_scale_rtcd.pl └── yv12config.h ├── vpx_util ├── endian_inl.h ├── loongson_intrinsics.h ├── vpx_atomics.h ├── vpx_debug_util.c ├── vpx_debug_util.h ├── vpx_pthread.h ├── vpx_thread.c ├── vpx_thread.h ├── vpx_timestamp.h ├── vpx_util.mk ├── vpx_write_yuv_frame.c └── vpx_write_yuv_frame.h ├── vpxdec.c ├── vpxenc.c ├── vpxenc.h ├── vpxstats.c ├── vpxstats.h ├── warnings.c ├── warnings.h ├── webmdec.cc ├── webmdec.h ├── webmenc.cc ├── webmenc.h ├── y4menc.c ├── y4menc.h ├── y4minput.c └── y4minput.h /.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 | configure eol=lf 2 | *.sh eol=lf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.S 2 | *.a 3 | *.asm.s 4 | *.d 5 | *.gcda 6 | *.gcno 7 | *.o 8 | *~ 9 | .cproject 10 | .idea 11 | .project 12 | .settings 13 | .vscode 14 | /*-*.mk 15 | /*.asm 16 | /*.doxy 17 | /*.ivf 18 | /*.ivf.md5 19 | /.bins 20 | /.deps 21 | /.docs 22 | /.install-* 23 | /.libs 24 | /Makefile 25 | /arm_neon.h 26 | /config.log 27 | /config.mk 28 | /docs/ 29 | /doxyfile 30 | /examples/*.dox 31 | /examples/decode_to_md5 32 | /examples/decode_with_drops 33 | /examples/decode_with_partial_drops 34 | /examples/example_xma 35 | /examples/postproc 36 | /examples/resize_util 37 | /examples/set_maps 38 | /examples/simple_decoder 39 | /examples/simple_encoder 40 | /examples/twopass_encoder 41 | /examples/vp8_multi_resolution_encoder 42 | /examples/vp8cx_set_ref 43 | /examples/vp9cx_set_ref 44 | /examples/vp9_lossless_encoder 45 | /examples/vp9_spatial_svc_encoder 46 | /examples/vpx_temporal_svc_encoder 47 | /ivfdec 48 | /ivfdec.dox 49 | /ivfenc 50 | /ivfenc.dox 51 | /libvpx.so* 52 | /libvpx.ver 53 | /samples.dox 54 | /test_intra_pred_speed 55 | /test_libvpx 56 | /tools.dox 57 | /tools/*.dox 58 | /tools/tiny_ssim 59 | /vp8_api1_migration.dox 60 | /vp[89x]_rtcd.h 61 | /vpx.pc 62 | /vpx_config.c 63 | /vpx_config.h 64 | /vpx_dsp_rtcd.h 65 | /vpx_scale_rtcd.h 66 | /vpx_version.h 67 | /vpxdec 68 | /vpxdec.dox 69 | /vpxenc 70 | /vpxenc.dox 71 | TAGS 72 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution; 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use a [Gerrit](https://www.gerritcodereview.com) instance hosted at 22 | https://chromium-review.googlesource.com for this purpose. See the 23 | [WebM Project page](https://www.webmproject.org/code/contribute/submitting-patches/) 24 | for additional details. 25 | 26 | ## Community Guidelines 27 | 28 | This project follows 29 | [Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, The WebM 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 WebM Project, nor the names 16 | of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written 18 | 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 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /PATENTS: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /build/make/ads2armasm_ms.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | ## 3 | ## Copyright (c) 2013 The WebM project authors. All Rights Reserved. 4 | ## 5 | ## Use of this source code is governed by a BSD-style license 6 | ## that can be found in the LICENSE file in the root of the source 7 | ## tree. An additional intellectual property rights grant can be found 8 | ## in the file PATENTS. All contributing project authors may 9 | ## be found in the AUTHORS file in the root of the source tree. 10 | ## 11 | 12 | use FindBin; 13 | use lib $FindBin::Bin; 14 | use thumb; 15 | 16 | print "; This file was created from a .asm file\n"; 17 | print "; using the ads2armasm_ms.pl script.\n"; 18 | 19 | while () 20 | { 21 | undef $comment; 22 | undef $line; 23 | 24 | s/REQUIRE8//; 25 | s/PRESERVE8//; 26 | s/^\s*ARM\s*$//; 27 | s/AREA\s+\|\|(.*)\|\|/AREA |$1|/; 28 | s/qsubaddx/qsax/i; 29 | s/qaddsubx/qasx/i; 30 | 31 | thumb::FixThumbInstructions($_); 32 | 33 | s/ldrneb/ldrbne/i; 34 | s/ldrneh/ldrhne/i; 35 | s/^(\s*)ENDP.*/$&\n$1ALIGN 4/; 36 | 37 | print; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /build/make/ios-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | VPX 9 | CFBundleIdentifier 10 | org.webmproject.VPX 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | VPX 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | ${VERSION} 19 | CFBundleSignature 20 | ???? 21 | CFBundleSupportedPlatforms 22 | 23 | iPhoneOS 24 | 25 | CFBundleVersion 26 | ${VERSION} 27 | MinimumOSVersion 28 | ${IOS_VERSION_MIN} 29 | UIDeviceFamily 30 | 31 | 1 32 | 2 33 | 34 | VPXFullVersion 35 | ${FULLVERSION} 36 | 37 | 38 | -------------------------------------------------------------------------------- /build_debug/non_greedy_mv_test_files/raw_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webmproject/libvpx/69396c5e7307e4eb8d0d9b7c31481d1658928f5c/build_debug/non_greedy_mv_test_files/raw_1.png -------------------------------------------------------------------------------- /build_debug/non_greedy_mv_test_files/raw_1_12_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webmproject/libvpx/69396c5e7307e4eb8d0d9b7c31481d1658928f5c/build_debug/non_greedy_mv_test_files/raw_1_12_12.png -------------------------------------------------------------------------------- /codereview.settings: -------------------------------------------------------------------------------- 1 | # This file is used by git cl to get repository specific information. 2 | GERRIT_HOST: True 3 | CODE_REVIEW_SERVER: chromium-review.googlesource.com 4 | GERRIT_SQUASH_UPLOADS: False 5 | -------------------------------------------------------------------------------- /ivfdec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 | #ifndef VPX_IVFDEC_H_ 11 | #define VPX_IVFDEC_H_ 12 | 13 | #include "./tools_common.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int file_is_ivf(struct VpxInputContext *input); 20 | 21 | int ivf_read_frame(FILE *infile, uint8_t **buffer, size_t *bytes_read, 22 | size_t *buffer_size); 23 | 24 | #ifdef __cplusplus 25 | } /* extern "C" */ 26 | #endif 27 | 28 | #endif // VPX_IVFDEC_H_ 29 | -------------------------------------------------------------------------------- /ivfenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 | #ifndef VPX_IVFENC_H_ 11 | #define VPX_IVFENC_H_ 12 | 13 | #include "./tools_common.h" 14 | 15 | #include "vpx/vpx_encoder.h" 16 | 17 | struct vpx_codec_enc_cfg; 18 | struct vpx_codec_cx_pkt; 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | void ivf_write_file_header_with_video_info(FILE *outfile, unsigned int fourcc, 25 | int frame_cnt, int frame_width, 26 | int frame_height, 27 | vpx_rational_t timebase); 28 | 29 | void ivf_write_file_header(FILE *outfile, const struct vpx_codec_enc_cfg *cfg, 30 | uint32_t fourcc, int frame_cnt); 31 | 32 | void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size); 33 | 34 | void ivf_write_frame_size(FILE *outfile, size_t frame_size); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif // VPX_IVFENC_H_ 41 | -------------------------------------------------------------------------------- /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 VPX_MD5_UTILS_H_ 24 | #define VPX_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 // VPX_MD5_UTILS_H_ 50 | -------------------------------------------------------------------------------- /rate_hist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 VPX_RATE_HIST_H_ 12 | #define VPX_RATE_HIST_H_ 13 | 14 | #include "vpx/vpx_encoder.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | struct rate_hist; 21 | 22 | struct rate_hist *init_rate_histogram(const vpx_codec_enc_cfg_t *cfg, 23 | const vpx_rational_t *fps); 24 | 25 | void destroy_rate_histogram(struct rate_hist *hist); 26 | 27 | void update_rate_histogram(struct rate_hist *hist, 28 | const vpx_codec_enc_cfg_t *cfg, 29 | const vpx_codec_cx_pkt_t *pkt); 30 | 31 | void show_q_histogram(const int counts[64], int max_buckets); 32 | 33 | void show_rate_histogram(struct rate_hist *hist, const vpx_codec_enc_cfg_t *cfg, 34 | int max_buckets); 35 | 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // VPX_RATE_HIST_H_ 41 | -------------------------------------------------------------------------------- /solution.mk: -------------------------------------------------------------------------------- 1 | ## 2 | ## Copyright (c) 2010 The WebM 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 | # libvpx reverse dependencies (targets that depend on libvpx) 12 | VPX_NONDEPS=$(addsuffix .$(VCPROJ_SFX),vpx gtest) 13 | VPX_RDEPS=$(foreach vcp,\ 14 | $(filter-out $(VPX_NONDEPS),$^), --dep=$(vcp:.$(VCPROJ_SFX)=):vpx) 15 | 16 | vpx.sln: $(wildcard *.$(VCPROJ_SFX)) 17 | @echo " [CREATE] $@" 18 | $(SRC_PATH_BARE)/build/make/gen_msvs_sln.sh \ 19 | $(if $(filter vpx.$(VCPROJ_SFX),$^),$(VPX_RDEPS)) \ 20 | --dep=test_libvpx:gtest \ 21 | --ver=$(CONFIG_VS_VERSION)\ 22 | --out=$@ $^ 23 | vpx.sln.mk: vpx.sln 24 | @true 25 | 26 | PROJECTS-yes += vpx.sln vpx.sln.mk 27 | -include vpx.sln.mk 28 | 29 | # Always install this file, as it is an unconditional post-build rule. 30 | INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% 31 | INSTALL-SRCS-yes += $(target).mk 32 | -------------------------------------------------------------------------------- /test/android/README: -------------------------------------------------------------------------------- 1 | Android.mk will build vpx unittests on android. 2 | 1) Configure libvpx from the parent directory: 3 | ./libvpx/configure --target=armv7-android-gcc --enable-external-build \ 4 | --enable-postproc --disable-install-srcs --enable-multi-res-encoding \ 5 | --enable-temporal-denoising --disable-unit-tests --disable-install-docs \ 6 | --disable-examples --disable-runtime-cpu-detect 7 | 8 | 2) From the parent directory, invoke ndk-build: 9 | NDK_PROJECT_PATH=. ndk-build APP_BUILD_SCRIPT=./libvpx/test/android/Android.mk \ 10 | APP_ABI=armeabi-v7a APP_PLATFORM=android-18 APP_OPTIM=release \ 11 | APP_STL=c++_static 12 | 13 | Note: Both adb and ndk-build are available at: 14 | https://developer.android.com/studio#downloads 15 | https://developer.android.com/ndk/downloads 16 | 17 | 3) Run get_files.py to download the test files: 18 | python get_files.py -i /path/to/test-data.sha1 -o /path/to/put/files \ 19 | -u https://storage.googleapis.com/downloads.webmproject.org/test_data/libvpx 20 | 21 | 4) Transfer files to device using adb. Ensure you have proper permissions for 22 | the target 23 | 24 | adb push /path/to/test_files /data/local/tmp 25 | adb push /path/to/built_libs /data/local/tmp 26 | 27 | NOTE: Built_libs defaults to parent_dir/libs/armeabi-v7a 28 | 29 | 5) Run tests: 30 | adb shell 31 | (on device) 32 | cd /data/local/tmp 33 | LD_LIBRARY_PATH=. ./vpx_test 34 | -------------------------------------------------------------------------------- /test/bench.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "test/bench.h" 16 | #include "vpx_ports/vpx_timer.h" 17 | 18 | void AbstractBench::RunNTimes(int n) { 19 | for (int r = 0; r < VPX_BENCH_ROBUST_ITER; r++) { 20 | vpx_usec_timer timer; 21 | vpx_usec_timer_start(&timer); 22 | for (int j = 0; j < n; ++j) { 23 | Run(); 24 | } 25 | vpx_usec_timer_mark(&timer); 26 | times_[r] = static_cast(vpx_usec_timer_elapsed(&timer)); 27 | } 28 | } 29 | 30 | void AbstractBench::PrintMedian(const char *title) { 31 | std::sort(times_, times_ + VPX_BENCH_ROBUST_ITER); 32 | const int med = times_[VPX_BENCH_ROBUST_ITER >> 1]; 33 | int sad = 0; 34 | for (int t = 0; t < VPX_BENCH_ROBUST_ITER; t++) { 35 | sad += abs(times_[t] - med); 36 | } 37 | printf("[%10s] %s %.1f ms ( ±%.1f ms )\n", "BENCH ", title, med / 1000.0, 38 | sad / (VPX_BENCH_ROBUST_ITER * 1000.0)); 39 | } 40 | -------------------------------------------------------------------------------- /test/bench.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebM 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 VPX_TEST_BENCH_H_ 12 | #define VPX_TEST_BENCH_H_ 13 | 14 | // Number of iterations used to compute median run time. 15 | #define VPX_BENCH_ROBUST_ITER 15 16 | 17 | class AbstractBench { 18 | public: 19 | virtual ~AbstractBench() = default; 20 | 21 | void RunNTimes(int n); 22 | void PrintMedian(const char *title); 23 | 24 | protected: 25 | // Implement this method and put the code to benchmark in it. 26 | virtual void Run() = 0; 27 | 28 | private: 29 | int times_[VPX_BENCH_ROBUST_ITER]; 30 | }; 31 | 32 | #endif // VPX_TEST_BENCH_H_ 33 | -------------------------------------------------------------------------------- /test/clear_system_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 | #ifndef VPX_TEST_CLEAR_SYSTEM_STATE_H_ 11 | #define VPX_TEST_CLEAR_SYSTEM_STATE_H_ 12 | 13 | #include "./vpx_config.h" 14 | #include "vpx_ports/system_state.h" 15 | 16 | namespace libvpx_test { 17 | 18 | // Reset system to a known state. This function should be used for all non-API 19 | // test cases. 20 | inline void ClearSystemState() { vpx_clear_system_state(); } 21 | 22 | } // namespace libvpx_test 23 | #endif // VPX_TEST_CLEAR_SYSTEM_STATE_H_ 24 | -------------------------------------------------------------------------------- /test/examples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ## 3 | ## Copyright (c) 2014 The WebM project authors. All Rights Reserved. 4 | ## 5 | ## Use of this source code is governed by a BSD-style license 6 | ## that can be found in the LICENSE file in the root of the source 7 | ## tree. An additional intellectual property rights grant can be found 8 | ## in the file PATENTS. All contributing project authors may 9 | ## be found in the AUTHORS file in the root of the source tree. 10 | ## 11 | ## This file runs all of the tests for the libvpx examples. 12 | ## 13 | . $(dirname $0)/tools_common.sh 14 | 15 | example_tests=$(ls $(dirname $0)/*.sh) 16 | 17 | # List of script names to exclude. 18 | exclude_list="examples stress tools_common" 19 | 20 | # Filter out the scripts in $exclude_list. 21 | for word in ${exclude_list}; do 22 | example_tests=$(filter_strings "${example_tests}" "${word}" exclude) 23 | done 24 | 25 | for test in ${example_tests}; do 26 | # Source each test script so that exporting variables can be avoided. 27 | VPX_TEST_NAME="$(basename ${test%.*})" 28 | . "${test}" 29 | done 30 | -------------------------------------------------------------------------------- /test/i420_video_source.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The WebM 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 | #ifndef VPX_TEST_I420_VIDEO_SOURCE_H_ 11 | #define VPX_TEST_I420_VIDEO_SOURCE_H_ 12 | #include 13 | #include 14 | #include 15 | 16 | #include "test/yuv_video_source.h" 17 | 18 | namespace libvpx_test { 19 | 20 | // This class extends VideoSource to allow parsing of raw yv12 21 | // so that we can do actual file encodes. 22 | class I420VideoSource : public YUVVideoSource { 23 | public: 24 | I420VideoSource(const std::string &file_name, unsigned int width, 25 | unsigned int height, int rate_numerator, int rate_denominator, 26 | unsigned int start, int limit) 27 | : YUVVideoSource(file_name, VPX_IMG_FMT_I420, width, height, 28 | rate_numerator, rate_denominator, start, limit) {} 29 | }; 30 | 31 | } // namespace libvpx_test 32 | 33 | #endif // VPX_TEST_I420_VIDEO_SOURCE_H_ 34 | -------------------------------------------------------------------------------- /test/init_vpx_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 The WebM 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 TEST_INIT_VPX_TEST_H_ 12 | #define TEST_INIT_VPX_TEST_H_ 13 | 14 | namespace libvpx_test { 15 | void init_vpx_test(); 16 | } 17 | 18 | #endif // TEST_INIT_VPX_TEST_H_ 19 | -------------------------------------------------------------------------------- /test/test_libvpx.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "gtest/gtest.h" 12 | #include "test/init_vpx_test.h" 13 | 14 | int main(int argc, char **argv) { 15 | ::testing::InitGoogleTest(&argc, argv); 16 | ::libvpx_test::init_vpx_test(); 17 | return RUN_ALL_TESTS(); 18 | } 19 | -------------------------------------------------------------------------------- /test/test_rc_interface.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "gtest/gtest.h" 12 | 13 | int main(int argc, char **argv) { 14 | ::testing::InitGoogleTest(&argc, argv); 15 | return RUN_ALL_TESTS(); 16 | } 17 | -------------------------------------------------------------------------------- /test/test_vectors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 VPX_TEST_TEST_VECTORS_H_ 12 | #define VPX_TEST_TEST_VECTORS_H_ 13 | 14 | #include "./vpx_config.h" 15 | 16 | namespace libvpx_test { 17 | 18 | #if CONFIG_VP8_DECODER 19 | extern const int kNumVP8TestVectors; 20 | extern const char *const kVP8TestVectors[]; 21 | #endif 22 | 23 | #if CONFIG_VP9_DECODER 24 | extern const int kNumVP9TestVectors; 25 | extern const char *const kVP9TestVectors[]; 26 | extern const int kNumVP9TestVectorsSvc; 27 | extern const char *const kVP9TestVectorsSvc[]; 28 | extern const int kNumVP9TestVectorsResize; 29 | extern const char *const kVP9TestVectorsResize[]; 30 | #endif // CONFIG_VP9_DECODER 31 | 32 | } // namespace libvpx_test 33 | 34 | #endif // VPX_TEST_TEST_VECTORS_H_ 35 | -------------------------------------------------------------------------------- /test/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The WebM 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 VPX_TEST_UTIL_H_ 12 | #define VPX_TEST_UTIL_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #include "gtest/gtest.h" 19 | #include "vpx/vpx_image.h" 20 | 21 | // Macros 22 | #define GET_PARAM(k) std::get(GetParam()) 23 | 24 | inline double compute_psnr(const vpx_image_t *img1, const vpx_image_t *img2) { 25 | assert((img1->fmt == img2->fmt) && (img1->d_w == img2->d_w) && 26 | (img1->d_h == img2->d_h)); 27 | 28 | const unsigned int width_y = img1->d_w; 29 | const unsigned int height_y = img1->d_h; 30 | unsigned int i, j; 31 | 32 | int64_t sqrerr = 0; 33 | for (i = 0; i < height_y; ++i) { 34 | for (j = 0; j < width_y; ++j) { 35 | int64_t d = img1->planes[VPX_PLANE_Y][i * img1->stride[VPX_PLANE_Y] + j] - 36 | img2->planes[VPX_PLANE_Y][i * img2->stride[VPX_PLANE_Y] + j]; 37 | sqrerr += d * d; 38 | } 39 | } 40 | double mse = static_cast(sqrerr) / (width_y * height_y); 41 | double psnr = 100.0; 42 | if (mse > 0.0) { 43 | psnr = 10 * log10(255.0 * 255.0 / mse); 44 | } 45 | return psnr; 46 | } 47 | 48 | #endif // VPX_TEST_UTIL_H_ 49 | -------------------------------------------------------------------------------- /test/vp8_fragments_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 | #include "gtest/gtest.h" 11 | #include "test/codec_factory.h" 12 | #include "test/video_source.h" 13 | 14 | namespace { 15 | 16 | class VP8FragmentsTest : public ::libvpx_test::EncoderTest, 17 | public ::testing::Test { 18 | protected: 19 | VP8FragmentsTest() : EncoderTest(&::libvpx_test::kVP8) {} 20 | ~VP8FragmentsTest() override = default; 21 | 22 | void SetUp() override { 23 | const unsigned long init_flags = // NOLINT(runtime/int) 24 | VPX_CODEC_USE_OUTPUT_PARTITION; 25 | InitializeConfig(); 26 | SetMode(::libvpx_test::kRealTime); 27 | set_init_flags(init_flags); 28 | } 29 | }; 30 | 31 | TEST_F(VP8FragmentsTest, TestFragmentsEncodeDecode) { 32 | ::libvpx_test::RandomVideoSource video; 33 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); 34 | } 35 | 36 | } // namespace 37 | -------------------------------------------------------------------------------- /third_party/googletest/README.libvpx: -------------------------------------------------------------------------------- 1 | URL: https://github.com/google/googletest.git 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 | CONTRIBUTORS 18 | googletest/ 19 | include 20 | README.md 21 | src 22 | LICENSE 23 | - Move .clang-format, CONTRIBUTORS, and LICENSE into googletest/ 24 | - In googletest/include/gtest/internal/custom/gtest-port.h, define 25 | GTEST_HAS_NOTIFICATION_ as 1 and use a stub Notification class to fix 26 | the mingw32 g++ compilation errors caused by the lack of std::mutex 27 | and std::condition_variable in the and 28 | headers if mingw32 is configured with the win32 threads option. See 29 | https://stackoverflow.com/questions/17242516/mingw-w64-threads-posix-vs-win32 30 | -------------------------------------------------------------------------------- /third_party/googletest/gtest.mk: -------------------------------------------------------------------------------- 1 | GTEST_SRCS-yes += src/gtest-all.cc 2 | -------------------------------------------------------------------------------- /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/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/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 | Elijah Cirioli 6 | -------------------------------------------------------------------------------- /third_party/libwebm/Android.mk: -------------------------------------------------------------------------------- 1 | # Ignore this file during non-NDK builds. 2 | ifdef NDK_ROOT 3 | LOCAL_PATH:= $(call my-dir) 4 | 5 | include $(CLEAR_VARS) 6 | LOCAL_MODULE:= libwebm 7 | LOCAL_CPPFLAGS:=-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 8 | LOCAL_CPPFLAGS+=-D__STDC_LIMIT_MACROS -std=c++11 9 | LOCAL_C_INCLUDES:= $(LOCAL_PATH) 10 | LOCAL_EXPORT_C_INCLUDES:= $(LOCAL_PATH) 11 | 12 | LOCAL_SRC_FILES:= common/file_util.cc \ 13 | common/hdr_util.cc \ 14 | mkvparser/mkvparser.cc \ 15 | mkvparser/mkvreader.cc \ 16 | mkvmuxer/mkvmuxer.cc \ 17 | mkvmuxer/mkvmuxerutil.cc \ 18 | mkvmuxer/mkvwriter.cc 19 | LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD 20 | LOCAL_LICENSE_CONDITIONS := notice 21 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.TXT $(LOCAL_PATH)/PATENTS.TXT 22 | include $(BUILD_STATIC_LIBRARY) 23 | endif # NDK_ROOT 24 | -------------------------------------------------------------------------------- /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.libvpx: -------------------------------------------------------------------------------- 1 | URL: https://chromium.googlesource.com/webm/libwebm 2 | Version: 3b630045052e1e4d563207ab9e3be8d137c26067 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/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.libvpx: -------------------------------------------------------------------------------- 1 | Name: libyuv 2 | URL: https://chromium.googlesource.com/libyuv/libyuv 3 | Version: a37e7bfece9e0676ae90a1700b0ec85b0f4f22a1 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 the multiple resolution encoder 12 | example which down-samples the original input video (f.g. 1280x720) a number of 13 | times in order to encode multiple resolution bit streams. 14 | 15 | Local Modifications: 16 | Disable ARGBToRGB24Row_AVX512VBMI due to build failure on Mac. 17 | rm libyuv/include/libyuv.h libyuv/include/libyuv/compare_row.h 18 | mv libyuv/include tmp/ 19 | mv libyuv/source tmp/ 20 | mv libyuv/LICENSE tmp/ 21 | rm -rf libyuv 22 | 23 | mv tmp/* third_party/libyuv/ 24 | -------------------------------------------------------------------------------- /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/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 1711 15 | 16 | #endif // INCLUDE_LIBYUV_VERSION_H_ 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.libvpx: -------------------------------------------------------------------------------- 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 vpx_config.asm. 12 | Prefix functions with vpx by default. 13 | Manage name mangling (prefixing with '_') manually because 'PREFIX' does not 14 | exist in libvpx. 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 | Prefix ARCH_* with VPX_. 20 | -------------------------------------------------------------------------------- /tools/3D-Reconstruction/sketch_3D_reconstruction/Util.pde: -------------------------------------------------------------------------------- 1 | // show grids 2 | void showGrids(int block_size) { 3 | ortho(-width, 0, -height, 0); 4 | camera(0, 0, 0, 0, 0, 1, 0, 1, 0); 5 | stroke(0, 0, 255); 6 | for (int i = 0; i < height; i += block_size) { 7 | line(0, i, width, i); 8 | } 9 | for (int i = 0; i < width; i += block_size) { 10 | line(i, 0, i, height); 11 | } 12 | } 13 | 14 | // save the point clould information 15 | void savePointCloud(PointCloud point_cloud, String file_name) { 16 | String[] positions = new String[point_cloud.points.size()]; 17 | String[] colors = new String[point_cloud.points.size()]; 18 | for (int i = 0; i < point_cloud.points.size(); i++) { 19 | PVector point = point_cloud.getPosition(i); 20 | color point_color = point_cloud.getColor(i); 21 | positions[i] = str(point.x) + ' ' + str(point.y) + ' ' + str(point.z); 22 | colors[i] = str(((point_color >> 16) & 0xFF) / 255.0) + ' ' + 23 | str(((point_color >> 8) & 0xFF) / 255.0) + ' ' + 24 | str((point_color & 0xFF) / 255.0); 25 | } 26 | saveStrings(file_name + "_pos.txt", positions); 27 | saveStrings(file_name + "_color.txt", colors); 28 | } 29 | -------------------------------------------------------------------------------- /tools/README.pgo.md: -------------------------------------------------------------------------------- 1 | # Using Profile Guided Optimizations to identify compiler optimization failures 2 | 3 | When using Clang, the `-Rpass-missed` flag enables the verbose log of failed 4 | compiler optimizations. However, the extensive log messages can obscure 5 | potential optimization opportunities. 6 | 7 | Use the following steps to generate a more transparent optimization report 8 | using a previously created PGO profile file. The report also includes code 9 | hotness diagnostics: 10 | 11 | ```bash 12 | $ ../libvpx/configure --use-profile=perf.profdata \ 13 | --extra-cflags="-fsave-optimization-record -fdiagnostics-show-hotness" 14 | ``` 15 | 16 | Convert the generated YAML files into a detailed HTML report using the 17 | [optviewer2](https://github.com/OfekShilon/optview2) tool: 18 | 19 | ```bash 20 | $ opt-viewer.py --output-dir=out/ --source-dir=libvpx . 21 | ``` 22 | 23 | The HTML report displays each code line's relative hotness, cross-referenced 24 | with the failed compiler optimizations. 25 | -------------------------------------------------------------------------------- /tools/gen_authors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Add organization names manually. 4 | 5 | cat <" | sort | uniq | grep -v corp.google \ 10 | | grep -v noreply) 11 | Google Inc. 12 | The Mozilla Foundation 13 | The Xiph.Org Foundation 14 | EOF 15 | -------------------------------------------------------------------------------- /usage_cx.dox: -------------------------------------------------------------------------------- 1 | /*! \page usage_encode Encoding 2 | 3 | The vpx_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. The deadline parameter controls the amount 6 | of time in microseconds the encoder should spend working on the frame. For 7 | more information on the deadline parameter, see 8 | \ref usage_deadline. 9 | 10 | 11 | \if samples 12 | \ref samples 13 | \endif 14 | 15 | */ 16 | -------------------------------------------------------------------------------- /video_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 VPX_VIDEO_COMMON_H_ 12 | #define VPX_VIDEO_COMMON_H_ 13 | 14 | #include "./tools_common.h" 15 | 16 | typedef struct { 17 | uint32_t codec_fourcc; 18 | int frame_width; 19 | int frame_height; 20 | struct VpxRational time_base; 21 | } VpxVideoInfo; 22 | 23 | #endif // VPX_VIDEO_COMMON_H_ 24 | -------------------------------------------------------------------------------- /video_writer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 VPX_VIDEO_WRITER_H_ 12 | #define VPX_VIDEO_WRITER_H_ 13 | 14 | #include "./video_common.h" 15 | 16 | typedef enum { kContainerIVF } VpxContainer; 17 | 18 | struct VpxVideoWriterStruct; 19 | typedef struct VpxVideoWriterStruct VpxVideoWriter; 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | // Finds and opens writer for specified container format. 26 | // Returns an opaque VpxVideoWriter* upon success, or NULL upon failure. 27 | // Right now only IVF format is supported. 28 | VpxVideoWriter *vpx_video_writer_open(const char *filename, 29 | VpxContainer container, 30 | const VpxVideoInfo *info); 31 | 32 | // Frees all resources associated with VpxVideoWriter* returned from 33 | // vpx_video_writer_open() call. 34 | void vpx_video_writer_close(VpxVideoWriter *writer); 35 | 36 | // Writes frame bytes to the file. 37 | int vpx_video_writer_write_frame(VpxVideoWriter *writer, const uint8_t *buffer, 38 | size_t size, int64_t pts); 39 | 40 | #ifdef __cplusplus 41 | } // extern "C" 42 | #endif 43 | 44 | #endif // VPX_VIDEO_WRITER_H_ 45 | -------------------------------------------------------------------------------- /vp8/common/alloccommon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_ALLOCCOMMON_H_ 12 | #define VPX_VP8_COMMON_ALLOCCOMMON_H_ 13 | 14 | #include "onyxc_int.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp8_create_common(VP8_COMMON *oci); 21 | void vp8_remove_common(VP8_COMMON *oci); 22 | void vp8_de_alloc_frame_buffers(VP8_COMMON *oci); 23 | int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height); 24 | void vp8_setup_version(VP8_COMMON *cm); 25 | 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | 30 | #endif // VPX_VP8_COMMON_ALLOCCOMMON_H_ 31 | -------------------------------------------------------------------------------- /vp8/common/arm/loopfilter_arm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 The WebM 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 VPX_VP8_COMMON_ARM_LOOPFILTER_ARM_H_ 12 | #define VPX_VP8_COMMON_ARM_LOOPFILTER_ARM_H_ 13 | 14 | typedef void loopfilter_y_neon(unsigned char *src, int pitch, 15 | unsigned char blimit, unsigned char limit, 16 | unsigned char thresh); 17 | typedef void loopfilter_uv_neon(unsigned char *u, int pitch, 18 | unsigned char blimit, unsigned char limit, 19 | unsigned char thresh, unsigned char *v); 20 | 21 | loopfilter_y_neon vp8_loop_filter_horizontal_edge_y_neon; 22 | loopfilter_y_neon vp8_loop_filter_vertical_edge_y_neon; 23 | loopfilter_uv_neon vp8_loop_filter_horizontal_edge_uv_neon; 24 | loopfilter_uv_neon vp8_loop_filter_vertical_edge_uv_neon; 25 | 26 | loopfilter_y_neon vp8_mbloop_filter_horizontal_edge_y_neon; 27 | loopfilter_y_neon vp8_mbloop_filter_vertical_edge_y_neon; 28 | loopfilter_uv_neon vp8_mbloop_filter_horizontal_edge_uv_neon; 29 | loopfilter_uv_neon vp8_mbloop_filter_vertical_edge_uv_neon; 30 | 31 | #endif // VPX_VP8_COMMON_ARM_LOOPFILTER_ARM_H_ 32 | -------------------------------------------------------------------------------- /vp8/common/arm/neon/copymem_neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | 13 | #include "./vp8_rtcd.h" 14 | 15 | void vp8_copy_mem8x4_neon(unsigned char *src, int src_stride, 16 | unsigned char *dst, int dst_stride) { 17 | uint8x8_t vtmp; 18 | int r; 19 | 20 | for (r = 0; r < 4; ++r) { 21 | vtmp = vld1_u8(src); 22 | vst1_u8(dst, vtmp); 23 | src += src_stride; 24 | dst += dst_stride; 25 | } 26 | } 27 | 28 | void vp8_copy_mem8x8_neon(unsigned char *src, int src_stride, 29 | unsigned char *dst, int dst_stride) { 30 | uint8x8_t vtmp; 31 | int r; 32 | 33 | for (r = 0; r < 8; ++r) { 34 | vtmp = vld1_u8(src); 35 | vst1_u8(dst, vtmp); 36 | src += src_stride; 37 | dst += dst_stride; 38 | } 39 | } 40 | 41 | void vp8_copy_mem16x16_neon(unsigned char *src, int src_stride, 42 | unsigned char *dst, int dst_stride) { 43 | int r; 44 | uint8x16_t qtmp; 45 | 46 | for (r = 0; r < 16; ++r) { 47 | qtmp = vld1q_u8(src); 48 | vst1q_u8(dst, qtmp); 49 | src += src_stride; 50 | dst += dst_stride; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vp8/common/arm/neon/dc_only_idct_add_neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | 13 | #include "./vp8_rtcd.h" 14 | 15 | void vp8_dc_only_idct_add_neon(int16_t input_dc, unsigned char *pred_ptr, 16 | int pred_stride, unsigned char *dst_ptr, 17 | int dst_stride) { 18 | int i; 19 | uint16_t a1 = ((input_dc + 4) >> 3); 20 | uint32x2_t d2u32 = vdup_n_u32(0); 21 | uint8x8_t d2u8; 22 | uint16x8_t q1u16; 23 | uint16x8_t qAdd; 24 | 25 | qAdd = vdupq_n_u16(a1); 26 | 27 | for (i = 0; i < 2; ++i) { 28 | d2u32 = vld1_lane_u32((const uint32_t *)pred_ptr, d2u32, 0); 29 | pred_ptr += pred_stride; 30 | d2u32 = vld1_lane_u32((const uint32_t *)pred_ptr, d2u32, 1); 31 | pred_ptr += pred_stride; 32 | 33 | q1u16 = vaddw_u8(qAdd, vreinterpret_u8_u32(d2u32)); 34 | d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q1u16)); 35 | 36 | vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 0); 37 | dst_ptr += dst_stride; 38 | vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 1); 39 | dst_ptr += dst_stride; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vp8/common/arm/neon/dequantizeb_neon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | 13 | #include "./vp8_rtcd.h" 14 | #include "vp8/common/blockd.h" 15 | 16 | void vp8_dequantize_b_neon(BLOCKD *d, short *DQC) { 17 | int16x8x2_t qQ, qDQC, qDQ; 18 | 19 | qQ = vld2q_s16(d->qcoeff); 20 | qDQC = vld2q_s16(DQC); 21 | 22 | qDQ.val[0] = vmulq_s16(qQ.val[0], qDQC.val[0]); 23 | qDQ.val[1] = vmulq_s16(qQ.val[1], qDQC.val[1]); 24 | 25 | vst2q_s16(d->dqcoeff, qDQ); 26 | } 27 | -------------------------------------------------------------------------------- /vp8/common/blockd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "blockd.h" 12 | #include "vpx_mem/vpx_mem.h" 13 | 14 | const unsigned char vp8_block2left[25] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 15 | 2, 2, 2, 3, 3, 3, 3, 4, 4, 16 | 5, 5, 6, 6, 7, 7, 8 }; 17 | const unsigned char vp8_block2above[25] = { 0, 1, 2, 3, 0, 1, 2, 3, 0, 18 | 1, 2, 3, 0, 1, 2, 3, 4, 5, 19 | 4, 5, 6, 7, 6, 7, 8 }; 20 | -------------------------------------------------------------------------------- /vp8/common/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_COMMON_H_ 12 | #define VPX_VP8_COMMON_COMMON_H_ 13 | 14 | #include 15 | 16 | /* Interface header for common constant data structures and lookup tables */ 17 | 18 | #include "vpx_mem/vpx_mem.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Only need this for fixed-size arrays, for structs just assign. */ 25 | 26 | #define vp8_copy(Dest, Src) \ 27 | do { \ 28 | assert(sizeof(Dest) == sizeof(Src)); \ 29 | memcpy(Dest, Src, sizeof(Src)); \ 30 | } while (0) 31 | 32 | /* Use this for variably-sized arrays. */ 33 | 34 | #define vp8_copy_array(Dest, Src, N) \ 35 | do { \ 36 | assert(sizeof(*(Dest)) == sizeof(*(Src))); \ 37 | memcpy(Dest, Src, (N) * sizeof(*(Src))); \ 38 | } while (0) 39 | 40 | #define vp8_zero(Dest) memset(&(Dest), 0, sizeof(Dest)) 41 | 42 | #define vp8_zero_array(Dest, N) memset(Dest, 0, (N) * sizeof(*(Dest))) 43 | 44 | #ifdef __cplusplus 45 | } // extern "C" 46 | #endif 47 | 48 | #endif // VPX_VP8_COMMON_COMMON_H_ 49 | -------------------------------------------------------------------------------- /vp8/common/dequantize.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "vpx_config.h" 12 | #include "vp8_rtcd.h" 13 | #include "vp8/common/blockd.h" 14 | #include "vpx_mem/vpx_mem.h" 15 | 16 | void vp8_dequantize_b_c(BLOCKD *d, short *DQC) { 17 | int i; 18 | short *DQ = d->dqcoeff; 19 | short *Q = d->qcoeff; 20 | 21 | for (i = 0; i < 16; ++i) { 22 | DQ[i] = Q[i] * DQC[i]; 23 | } 24 | } 25 | 26 | void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *dest, 27 | int stride) { 28 | int i; 29 | 30 | for (i = 0; i < 16; ++i) { 31 | input[i] = dq[i] * input[i]; 32 | } 33 | 34 | vp8_short_idct4x4llm_c(input, dest, stride, dest, stride); 35 | 36 | memset(input, 0, 32); 37 | } 38 | -------------------------------------------------------------------------------- /vp8/common/entropymv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "entropymv.h" 12 | 13 | /* clang-format off */ 14 | const MV_CONTEXT vp8_mv_update_probs[2] = { 15 | { { 16 | 237, 17 | 246, 18 | 253, 253, 254, 254, 254, 254, 254, 19 | 254, 254, 254, 254, 254, 250, 250, 252, 254, 254 20 | } }, 21 | { { 22 | 231, 23 | 243, 24 | 245, 253, 254, 254, 254, 254, 254, 25 | 254, 254, 254, 254, 254, 251, 251, 254, 254, 254 26 | } } 27 | }; 28 | /* clang-format on */ 29 | 30 | const MV_CONTEXT vp8_default_mv_context[2] = { 31 | { { 32 | /* row */ 33 | 162, /* is short */ 34 | 128, /* sign */ 35 | 225, 146, 172, 147, 214, 39, 156, /* short tree */ 36 | 128, 129, 132, 75, 145, 178, 206, 239, 254, 254 /* long bits */ 37 | } }, 38 | 39 | { { 40 | /* same for column */ 41 | 164, /* is short */ 42 | 128, /**/ 43 | 204, 170, 119, 235, 140, 230, 228, /**/ 44 | 128, 130, 130, 74, 148, 180, 203, 236, 254, 254 /* long bits */ 45 | 46 | } } 47 | }; 48 | -------------------------------------------------------------------------------- /vp8/common/extend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_EXTEND_H_ 12 | #define VPX_VP8_COMMON_EXTEND_H_ 13 | 14 | #include "vpx_scale/yv12config.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, 21 | unsigned char *UPtr, unsigned char *VPtr); 22 | void vp8_copy_and_extend_frame(YV12_BUFFER_CONFIG *src, 23 | YV12_BUFFER_CONFIG *dst); 24 | void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src, 25 | YV12_BUFFER_CONFIG *dst, int srcy, 26 | int srcx, int srch, int srcw); 27 | 28 | #ifdef __cplusplus 29 | } // extern "C" 30 | #endif 31 | 32 | #endif // VPX_VP8_COMMON_EXTEND_H_ 33 | -------------------------------------------------------------------------------- /vp8/common/filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The WebM 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 VPX_VP8_COMMON_FILTER_H_ 12 | #define VPX_VP8_COMMON_FILTER_H_ 13 | 14 | #include "vpx_ports/mem.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #define BLOCK_HEIGHT_WIDTH 4 21 | #define VP8_FILTER_WEIGHT 128 22 | #define VP8_FILTER_SHIFT 7 23 | 24 | extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]); 25 | extern DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][6]); 26 | 27 | #ifdef __cplusplus 28 | } // extern "C" 29 | #endif 30 | 31 | #endif // VPX_VP8_COMMON_FILTER_H_ 32 | -------------------------------------------------------------------------------- /vp8/common/header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_HEADER_H_ 12 | #define VPX_VP8_COMMON_HEADER_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /* 24 bits total */ 19 | typedef struct { 20 | unsigned int type : 1; 21 | unsigned int version : 3; 22 | unsigned int show_frame : 1; 23 | 24 | /* Allow 2^20 bytes = 8 megabits for first partition */ 25 | 26 | unsigned int first_partition_length_in_bytes : 19; 27 | 28 | #ifdef PACKET_TESTING 29 | unsigned int frame_number; 30 | unsigned int update_gold : 1; 31 | unsigned int uses_gold : 1; 32 | unsigned int update_last : 1; 33 | unsigned int uses_last : 1; 34 | #endif 35 | 36 | } VP8_HEADER; 37 | 38 | #ifdef PACKET_TESTING 39 | #define VP8_HEADER_SIZE 8 40 | #else 41 | #define VP8_HEADER_SIZE 3 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } // extern "C" 46 | #endif 47 | 48 | #endif // VPX_VP8_COMMON_HEADER_H_ 49 | -------------------------------------------------------------------------------- /vp8/common/mips/dspr2/dequantize_dspr2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "vpx_config.h" 12 | #include "vp8_rtcd.h" 13 | #include "vpx_mem/vpx_mem.h" 14 | 15 | #if HAVE_DSPR2 16 | void vp8_dequant_idct_add_dspr2(short *input, short *dq, unsigned char *dest, 17 | int stride) { 18 | int i; 19 | 20 | for (i = 0; i < 16; ++i) { 21 | input[i] = dq[i] * input[i]; 22 | } 23 | 24 | vp8_short_idct4x4llm_dspr2(input, dest, stride, dest, stride); 25 | 26 | memset(input, 0, 32); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /vp8/common/modecont.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "entropy.h" 12 | 13 | const int vp8_mode_contexts[6][4] = { 14 | { /* 0 */ 15 | 7, 1, 1, 143 }, 16 | { /* 1 */ 17 | 14, 18, 14, 107 }, 18 | { /* 2 */ 19 | 135, 64, 57, 68 }, 20 | { /* 3 */ 21 | 60, 56, 128, 65 }, 22 | { /* 4 */ 23 | 159, 134, 128, 34 }, 24 | { /* 5 */ 25 | 234, 188, 128, 28 }, 26 | }; 27 | -------------------------------------------------------------------------------- /vp8/common/modecont.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_MODECONT_H_ 12 | #define VPX_VP8_COMMON_MODECONT_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | extern const int vp8_mode_contexts[6][4]; 19 | 20 | #ifdef __cplusplus 21 | } // extern "C" 22 | #endif 23 | 24 | #endif // VPX_VP8_COMMON_MODECONT_H_ 25 | -------------------------------------------------------------------------------- /vp8/common/mv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_MV_H_ 12 | #define VPX_VP8_COMMON_MV_H_ 13 | #include "vpx/vpx_integer.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | typedef struct { 20 | short row; 21 | short col; 22 | } MV; 23 | 24 | typedef union int_mv { 25 | uint32_t as_int; 26 | MV as_mv; 27 | } int_mv; /* facilitates faster equality tests and copies */ 28 | 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // VPX_VP8_COMMON_MV_H_ 34 | -------------------------------------------------------------------------------- /vp8/common/postproc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_POSTPROC_H_ 12 | #define VPX_VP8_COMMON_POSTPROC_H_ 13 | 14 | #include "vpx_ports/mem.h" 15 | struct postproc_state { 16 | int last_q; 17 | int last_noise; 18 | int last_base_qindex; 19 | int last_frame_valid; 20 | int clamp; 21 | int8_t *generated_noise; 22 | }; 23 | #include "onyxc_int.h" 24 | #include "ppflags.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | int vp8_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest, 30 | vp8_ppflags_t *ppflags); 31 | 32 | void vp8_de_noise(struct VP8Common *cm, YV12_BUFFER_CONFIG *source, int q, 33 | int uvfilter); 34 | 35 | void vp8_deblock(struct VP8Common *cm, YV12_BUFFER_CONFIG *source, 36 | YV12_BUFFER_CONFIG *post, int q); 37 | 38 | #define MFQE_PRECISION 4 39 | 40 | void vp8_multiframe_quality_enhance(struct VP8Common *cm); 41 | #ifdef __cplusplus 42 | } // extern "C" 43 | #endif 44 | 45 | #endif // VPX_VP8_COMMON_POSTPROC_H_ 46 | -------------------------------------------------------------------------------- /vp8/common/ppflags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_PPFLAGS_H_ 12 | #define VPX_VP8_COMMON_PPFLAGS_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | enum { 18 | VP8D_NOFILTERING = 0, 19 | VP8D_DEBLOCK = 1 << 0, 20 | VP8D_DEMACROBLOCK = 1 << 1, 21 | VP8D_ADDNOISE = 1 << 2, 22 | VP8D_MFQE = 1 << 3 23 | }; 24 | 25 | typedef struct { 26 | int post_proc_flag; 27 | int deblocking_level; 28 | int noise_level; 29 | int display_ref_frame_flag; 30 | int display_mb_modes_flag; 31 | int display_b_modes_flag; 32 | int display_mv_flag; 33 | } vp8_ppflags_t; 34 | 35 | #ifdef __cplusplus 36 | } // extern "C" 37 | #endif 38 | 39 | #endif // VPX_VP8_COMMON_PPFLAGS_H_ 40 | -------------------------------------------------------------------------------- /vp8/common/quant_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_QUANT_COMMON_H_ 12 | #define VPX_VP8_COMMON_QUANT_COMMON_H_ 13 | 14 | #include "string.h" 15 | #include "blockd.h" 16 | #include "onyxc_int.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | extern int vp8_ac_yquant(int QIndex); 23 | extern int vp8_dc_quant(int QIndex, int Delta); 24 | extern int vp8_dc2quant(int QIndex, int Delta); 25 | extern int vp8_ac2quant(int QIndex, int Delta); 26 | extern int vp8_dc_uv_quant(int QIndex, int Delta); 27 | extern int vp8_ac_uv_quant(int QIndex, int Delta); 28 | 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // VPX_VP8_COMMON_QUANT_COMMON_H_ 34 | -------------------------------------------------------------------------------- /vp8/common/reconinter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_RECONINTER_H_ 12 | #define VPX_VP8_COMMON_RECONINTER_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | void vp8_build_inter_predictors_mb(MACROBLOCKD *xd); 19 | void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x, unsigned char *dst_y, 20 | unsigned char *dst_u, 21 | unsigned char *dst_v, int dst_ystride, 22 | int dst_uvstride); 23 | 24 | void vp8_build_inter16x16_predictors_mby(MACROBLOCKD *x, unsigned char *dst_y, 25 | int dst_ystride); 26 | void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, unsigned char *base_pre, 27 | int pre_stride, vp8_subpix_fn_t sppf); 28 | 29 | void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *x); 30 | void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x); 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | #endif 35 | 36 | #endif // VPX_VP8_COMMON_RECONINTER_H_ 37 | -------------------------------------------------------------------------------- /vp8/common/reconintra.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_RECONINTRA_H_ 12 | #define VPX_VP8_COMMON_RECONINTRA_H_ 13 | 14 | #include "vp8/common/blockd.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x, unsigned char *yabove_row, 21 | unsigned char *yleft, int left_stride, 22 | unsigned char *ypred_ptr, int y_stride); 23 | 24 | void vp8_build_intra_predictors_mbuv_s( 25 | MACROBLOCKD *x, unsigned char *uabove_row, unsigned char *vabove_row, 26 | unsigned char *uleft, unsigned char *vleft, int left_stride, 27 | unsigned char *upred_ptr, unsigned char *vpred_ptr, int pred_stride); 28 | 29 | void vp8_init_intra_predictors(void); 30 | 31 | #ifdef __cplusplus 32 | } // extern "C" 33 | #endif 34 | 35 | #endif // VPX_VP8_COMMON_RECONINTRA_H_ 36 | -------------------------------------------------------------------------------- /vp8/common/rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The WebM 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 | #include "./vpx_config.h" 11 | #define RTCD_C 12 | #include "./vp8_rtcd.h" 13 | #include "vpx_ports/vpx_once.h" 14 | 15 | void vp8_rtcd(void) { once(setup_rtcd_internal); } 16 | -------------------------------------------------------------------------------- /vp8/common/setupintrarecon.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "setupintrarecon.h" 12 | #include "vpx_mem/vpx_mem.h" 13 | 14 | void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf) { 15 | int i; 16 | 17 | /* set up frame new frame for intra coded blocks */ 18 | memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5); 19 | for (i = 0; i < ybf->y_height; ++i) { 20 | ybf->y_buffer[ybf->y_stride * i - 1] = (unsigned char)129; 21 | } 22 | 23 | memset(ybf->u_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); 24 | for (i = 0; i < ybf->uv_height; ++i) { 25 | ybf->u_buffer[ybf->uv_stride * i - 1] = (unsigned char)129; 26 | } 27 | 28 | memset(ybf->v_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); 29 | for (i = 0; i < ybf->uv_height; ++i) { 30 | ybf->v_buffer[ybf->uv_stride * i - 1] = (unsigned char)129; 31 | } 32 | } 33 | 34 | void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf) { 35 | memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5); 36 | memset(ybf->u_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); 37 | memset(ybf->v_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); 38 | } 39 | -------------------------------------------------------------------------------- /vp8/common/setupintrarecon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_SETUPINTRARECON_H_ 12 | #define VPX_VP8_COMMON_SETUPINTRARECON_H_ 13 | 14 | #include "./vpx_config.h" 15 | #include "vpx_scale/yv12config.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | extern void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf); 21 | extern void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf); 22 | 23 | static INLINE void setup_intra_recon_left(unsigned char *y_buffer, 24 | unsigned char *u_buffer, 25 | unsigned char *v_buffer, int y_stride, 26 | int uv_stride) { 27 | int i; 28 | 29 | for (i = 0; i < 16; ++i) y_buffer[y_stride * i] = (unsigned char)129; 30 | 31 | for (i = 0; i < 8; ++i) u_buffer[uv_stride * i] = (unsigned char)129; 32 | 33 | for (i = 0; i < 8; ++i) v_buffer[uv_stride * i] = (unsigned char)129; 34 | } 35 | 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // VPX_VP8_COMMON_SETUPINTRARECON_H_ 41 | -------------------------------------------------------------------------------- /vp8/common/swapyv12buffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "swapyv12buffer.h" 12 | 13 | void vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, 14 | YV12_BUFFER_CONFIG *last_frame) { 15 | unsigned char *temp; 16 | 17 | temp = last_frame->buffer_alloc; 18 | last_frame->buffer_alloc = new_frame->buffer_alloc; 19 | new_frame->buffer_alloc = temp; 20 | 21 | temp = last_frame->y_buffer; 22 | last_frame->y_buffer = new_frame->y_buffer; 23 | new_frame->y_buffer = temp; 24 | 25 | temp = last_frame->u_buffer; 26 | last_frame->u_buffer = new_frame->u_buffer; 27 | new_frame->u_buffer = temp; 28 | 29 | temp = last_frame->v_buffer; 30 | last_frame->v_buffer = new_frame->v_buffer; 31 | new_frame->v_buffer = temp; 32 | } 33 | -------------------------------------------------------------------------------- /vp8/common/swapyv12buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_SWAPYV12BUFFER_H_ 12 | #define VPX_VP8_COMMON_SWAPYV12BUFFER_H_ 13 | 14 | #include "vpx_scale/yv12config.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, 21 | YV12_BUFFER_CONFIG *last_frame); 22 | 23 | #ifdef __cplusplus 24 | } // extern "C" 25 | #endif 26 | 27 | #endif // VPX_VP8_COMMON_SWAPYV12BUFFER_H_ 28 | -------------------------------------------------------------------------------- /vp8/common/systemdependent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_COMMON_SYSTEMDEPENDENT_H_ 12 | #define VPX_VP8_COMMON_SYSTEMDEPENDENT_H_ 13 | 14 | #include "vpx_config.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | struct VP8Common; 21 | void vp8_machine_specific_config(struct VP8Common *); 22 | 23 | #ifdef __cplusplus 24 | } // extern "C" 25 | #endif 26 | 27 | #endif // VPX_VP8_COMMON_SYSTEMDEPENDENT_H_ 28 | -------------------------------------------------------------------------------- /vp8/common/vp8_skin_detection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM 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 VPX_VP8_COMMON_VP8_SKIN_DETECTION_H_ 12 | #define VPX_VP8_COMMON_VP8_SKIN_DETECTION_H_ 13 | 14 | #include "vp8/encoder/onyx_int.h" 15 | #include "vpx/vpx_integer.h" 16 | #include "vpx_dsp/skin_detection.h" 17 | #include "vpx_scale/yv12config.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | struct VP8_COMP; 24 | 25 | typedef enum { 26 | // Skin detection based on 8x8 block. If two of them are identified as skin, 27 | // the macroblock is marked as skin. 28 | SKIN_8X8, 29 | // Skin detection based on 16x16 block. 30 | SKIN_16X16 31 | } SKIN_DETECTION_BLOCK_SIZE; 32 | 33 | int vp8_compute_skin_block(const uint8_t *y, const uint8_t *u, const uint8_t *v, 34 | int stride, int strideuv, 35 | SKIN_DETECTION_BLOCK_SIZE bsize, int consec_zeromv, 36 | int curr_motion_magn); 37 | 38 | #ifdef OUTPUT_YUV_SKINMAP 39 | // For viewing skin map on input source. 40 | void vp8_compute_skin_map(struct VP8_COMP *const cpi, FILE *yuv_skinmap_file); 41 | #endif 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // VPX_VP8_COMMON_VP8_SKIN_DETECTION_H_ 48 | -------------------------------------------------------------------------------- /vp8/common/x86/idct_blk_mmx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "vpx_config.h" 12 | #include "vp8_rtcd.h" 13 | #include "vp8/common/blockd.h" 14 | #include "vpx_mem/vpx_mem.h" 15 | 16 | extern void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q); 17 | 18 | void vp8_dequantize_b_mmx(BLOCKD *d, short *DQC) { 19 | short *sq = (short *)d->qcoeff; 20 | short *dq = (short *)d->dqcoeff; 21 | 22 | vp8_dequantize_b_impl_mmx(sq, dq, DQC); 23 | } 24 | -------------------------------------------------------------------------------- /vp8/decoder/decodemv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_DECODER_DECODEMV_H_ 12 | #define VPX_VP8_DECODER_DECODEMV_H_ 13 | 14 | #include "onyxd_int.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp8_decode_mode_mvs(VP8D_COMP *); 21 | 22 | #ifdef __cplusplus 23 | } // extern "C" 24 | #endif 25 | 26 | #endif // VPX_VP8_DECODER_DECODEMV_H_ 27 | -------------------------------------------------------------------------------- /vp8/decoder/decoderthreading.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_DECODER_DECODERTHREADING_H_ 12 | #define VPX_VP8_DECODER_DECODERTHREADING_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #if CONFIG_MULTITHREAD 19 | int vp8mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd); 20 | void vp8_decoder_remove_threads(VP8D_COMP *pbi); 21 | void vp8_decoder_create_threads(VP8D_COMP *pbi); 22 | void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows); 23 | void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows); 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | 30 | #endif // VPX_VP8_DECODER_DECODERTHREADING_H_ 31 | -------------------------------------------------------------------------------- /vp8/decoder/detokenize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_DECODER_DETOKENIZE_H_ 12 | #define VPX_VP8_DECODER_DETOKENIZE_H_ 13 | 14 | #include "onyxd_int.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp8_reset_mb_tokens_context(MACROBLOCKD *x); 21 | int vp8_decode_mb_tokens(VP8D_COMP *, MACROBLOCKD *); 22 | 23 | #ifdef __cplusplus 24 | } // extern "C" 25 | #endif 26 | 27 | #endif // VPX_VP8_DECODER_DETOKENIZE_H_ 28 | -------------------------------------------------------------------------------- /vp8/decoder/ec_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The WebM 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 VPX_VP8_DECODER_EC_TYPES_H_ 12 | #define VPX_VP8_DECODER_EC_TYPES_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define MAX_OVERLAPS 16 19 | 20 | /* The area (pixel area in Q6) the block pointed to by bmi overlaps 21 | * another block with. 22 | */ 23 | typedef struct { 24 | int overlap; 25 | union b_mode_info *bmi; 26 | } OVERLAP_NODE; 27 | 28 | /* Structure to keep track of overlapping blocks on a block level. */ 29 | typedef struct { 30 | /* TODO(holmer): This array should be exchanged for a linked list */ 31 | OVERLAP_NODE overlaps[MAX_OVERLAPS]; 32 | } B_OVERLAP; 33 | 34 | /* Structure used to hold all the overlaps of a macroblock. The overlaps of a 35 | * macroblock is further divided into block overlaps. 36 | */ 37 | typedef struct { 38 | B_OVERLAP overlaps[16]; 39 | } MB_OVERLAP; 40 | 41 | /* Structure for keeping track of motion vectors and which reference frame they 42 | * refer to. Used for motion vector interpolation. 43 | */ 44 | typedef struct { 45 | MV mv; 46 | MV_REFERENCE_FRAME ref_frame; 47 | } EC_BLOCK; 48 | 49 | #ifdef __cplusplus 50 | } // extern "C" 51 | #endif 52 | 53 | #endif // VPX_VP8_DECODER_EC_TYPES_H_ 54 | -------------------------------------------------------------------------------- /vp8/decoder/error_concealment.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The WebM 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 VPX_VP8_DECODER_ERROR_CONCEALMENT_H_ 12 | #define VPX_VP8_DECODER_ERROR_CONCEALMENT_H_ 13 | 14 | #include "onyxd_int.h" 15 | #include "ec_types.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Allocate memory for the overlap lists */ 22 | int vp8_alloc_overlap_lists(VP8D_COMP *pbi); 23 | 24 | /* Deallocate the overlap lists */ 25 | void vp8_de_alloc_overlap_lists(VP8D_COMP *pbi); 26 | 27 | /* Estimate all missing motion vectors. */ 28 | void vp8_estimate_missing_mvs(VP8D_COMP *pbi); 29 | 30 | /* Functions for spatial MV interpolation */ 31 | 32 | /* Interpolates all motion vectors for a macroblock mb at position 33 | * (mb_row, mb_col). */ 34 | void vp8_interpolate_motion(MACROBLOCKD *mb, int mb_row, int mb_col, 35 | int mb_rows, int mb_cols); 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // VPX_VP8_DECODER_ERROR_CONCEALMENT_H_ 42 | -------------------------------------------------------------------------------- /vp8/decoder/treereader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_DECODER_TREEREADER_H_ 12 | #define VPX_VP8_DECODER_TREEREADER_H_ 13 | 14 | #include "./vpx_config.h" 15 | #include "vp8/common/treecoder.h" 16 | #include "dboolhuff.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | typedef BOOL_DECODER vp8_reader; 23 | 24 | #define vp8_read vp8dx_decode_bool 25 | #define vp8_read_literal vp8_decode_value 26 | #define vp8_read_bit(R) vp8_read(R, vp8_prob_half) 27 | 28 | /* Intent of tree data structure is to make decoding trivial. */ 29 | 30 | static INLINE int vp8_treed_read( 31 | vp8_reader *const r, /* !!! must return a 0 or 1 !!! */ 32 | vp8_tree t, const vp8_prob *const p) { 33 | vp8_tree_index i = 0; 34 | 35 | while ((i = t[i + vp8_read(r, p[i >> 1])]) > 0) { 36 | } 37 | 38 | return -i; 39 | } 40 | 41 | #ifdef __cplusplus 42 | } // extern "C" 43 | #endif 44 | 45 | #endif // VPX_VP8_DECODER_TREEREADER_H_ 46 | -------------------------------------------------------------------------------- /vp8/encoder/bitstream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_BITSTREAM_H_ 12 | #define VPX_VP8_ENCODER_BITSTREAM_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #include "vp8/encoder/treewriter.h" 19 | #include "vp8/encoder/tokenize.h" 20 | 21 | void vp8_pack_tokens(vp8_writer *w, const TOKENEXTRA *p, int xcount); 22 | void vp8_convert_rfct_to_prob(struct VP8_COMP *const cpi); 23 | void vp8_calc_ref_frame_costs(int *ref_frame_cost, int prob_intra, 24 | int prob_last, int prob_garf); 25 | int vp8_estimate_entropy_savings(struct VP8_COMP *cpi); 26 | void vp8_update_coef_probs(struct VP8_COMP *cpi); 27 | 28 | #ifdef __cplusplus 29 | } // extern "C" 30 | #endif 31 | 32 | #endif // VPX_VP8_ENCODER_BITSTREAM_H_ 33 | -------------------------------------------------------------------------------- /vp8/encoder/copy_c.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | 13 | #include "./vp8_rtcd.h" 14 | #include "vpx/vpx_integer.h" 15 | 16 | /* Copy 2 macroblocks to a buffer */ 17 | void vp8_copy32xn_c(const unsigned char *src_ptr, int src_stride, 18 | unsigned char *dst_ptr, int dst_stride, int height) { 19 | int r; 20 | 21 | for (r = 0; r < height; ++r) { 22 | memcpy(dst_ptr, src_ptr, 32); 23 | 24 | src_ptr += src_stride; 25 | dst_ptr += dst_stride; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vp8/encoder/encodeframe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The WebM 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 | #ifndef VPX_VP8_ENCODER_ENCODEFRAME_H_ 11 | #define VPX_VP8_ENCODER_ENCODEFRAME_H_ 12 | 13 | #include "vp8/encoder/tokenize.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | struct VP8_COMP; 20 | struct macroblock; 21 | 22 | void vp8_activity_masking(struct VP8_COMP *cpi, MACROBLOCK *x); 23 | 24 | void vp8_build_block_offsets(struct macroblock *x); 25 | 26 | void vp8_setup_block_ptrs(struct macroblock *x); 27 | 28 | void vp8_encode_frame(struct VP8_COMP *cpi); 29 | 30 | int vp8cx_encode_inter_macroblock(struct VP8_COMP *cpi, struct macroblock *x, 31 | TOKENEXTRA **t, int recon_yoffset, 32 | int recon_uvoffset, int mb_row, int mb_col); 33 | 34 | int vp8cx_encode_intra_macroblock(struct VP8_COMP *cpi, struct macroblock *x, 35 | TOKENEXTRA **t); 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // VPX_VP8_ENCODER_ENCODEFRAME_H_ 41 | -------------------------------------------------------------------------------- /vp8/encoder/encodeintra.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_ENCODEINTRA_H_ 12 | #define VPX_VP8_ENCODER_ENCODEINTRA_H_ 13 | #include "onyx_int.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int vp8_encode_intra(MACROBLOCK *x, int use_dc_pred); 20 | void vp8_encode_intra16x16mby(MACROBLOCK *x); 21 | void vp8_encode_intra16x16mbuv(MACROBLOCK *x); 22 | void vp8_encode_intra4x4mby(MACROBLOCK *mb); 23 | void vp8_encode_intra4x4block(MACROBLOCK *x, int ib); 24 | #ifdef __cplusplus 25 | } // extern "C" 26 | #endif 27 | 28 | #endif // VPX_VP8_ENCODER_ENCODEINTRA_H_ 29 | -------------------------------------------------------------------------------- /vp8/encoder/encodemb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_ENCODEMB_H_ 12 | #define VPX_VP8_ENCODER_ENCODEMB_H_ 13 | 14 | #include "onyx_int.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | void vp8_encode_inter16x16(MACROBLOCK *x); 20 | 21 | void vp8_subtract_b(BLOCK *be, BLOCKD *bd, int pitch); 22 | void vp8_subtract_mbuv(short *diff, unsigned char *usrc, unsigned char *vsrc, 23 | int src_stride, unsigned char *upred, 24 | unsigned char *vpred, int pred_stride); 25 | void vp8_subtract_mby(short *diff, unsigned char *src, int src_stride, 26 | unsigned char *pred, int pred_stride); 27 | 28 | void vp8_build_dcblock(MACROBLOCK *b); 29 | void vp8_transform_mb(MACROBLOCK *mb); 30 | void vp8_transform_mbuv(MACROBLOCK *x); 31 | void vp8_transform_intra_mby(MACROBLOCK *x); 32 | 33 | void vp8_optimize_mby(MACROBLOCK *x); 34 | void vp8_optimize_mbuv(MACROBLOCK *x); 35 | void vp8_encode_inter16x16y(MACROBLOCK *x); 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // VPX_VP8_ENCODER_ENCODEMB_H_ 41 | -------------------------------------------------------------------------------- /vp8/encoder/encodemv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_ENCODEMV_H_ 12 | #define VPX_VP8_ENCODER_ENCODEMV_H_ 13 | 14 | #include "onyx_int.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp8_write_mvprobs(VP8_COMP *); 21 | void vp8_encode_motion_vector(vp8_writer *, const MV *, const MV_CONTEXT *); 22 | void vp8_build_component_cost_table(int *mvcost[2], const MV_CONTEXT *mvc, 23 | int mvc_flag[2]); 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // VPX_VP8_ENCODER_ENCODEMV_H_ 30 | -------------------------------------------------------------------------------- /vp8/encoder/ethreading.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 The WebM 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 VPX_VP8_ENCODER_ETHREADING_H_ 12 | #define VPX_VP8_ENCODER_ETHREADING_H_ 13 | 14 | #include "vp8/encoder/onyx_int.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | struct VP8_COMP; 21 | struct macroblock; 22 | 23 | void vp8cx_init_mbrthread_data(struct VP8_COMP *cpi, struct macroblock *x, 24 | MB_ROW_COMP *mbr_ei, int count); 25 | int vp8cx_create_encoder_threads(struct VP8_COMP *cpi); 26 | void vp8cx_remove_encoder_threads(struct VP8_COMP *cpi); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif // VPX_VP8_ENCODER_ETHREADING_H_ 33 | -------------------------------------------------------------------------------- /vp8/encoder/firstpass.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_FIRSTPASS_H_ 12 | #define VPX_VP8_ENCODER_FIRSTPASS_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | extern void vp8_init_first_pass(VP8_COMP *cpi); 19 | extern void vp8_first_pass(VP8_COMP *cpi); 20 | extern void vp8_end_first_pass(VP8_COMP *cpi); 21 | 22 | extern void vp8_init_second_pass(VP8_COMP *cpi); 23 | extern void vp8_second_pass(VP8_COMP *cpi); 24 | extern void vp8_end_second_pass(VP8_COMP *cpi); 25 | 26 | extern size_t vp8_firstpass_stats_sz(unsigned int mb_count); 27 | #ifdef __cplusplus 28 | } // extern "C" 29 | #endif 30 | 31 | #endif // VPX_VP8_ENCODER_FIRSTPASS_H_ 32 | -------------------------------------------------------------------------------- /vp8/encoder/modecosts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_MODECOSTS_H_ 12 | #define VPX_VP8_ENCODER_MODECOSTS_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | struct VP8_COMP; 19 | 20 | void vp8_init_mode_costs(struct VP8_COMP *c); 21 | 22 | #ifdef __cplusplus 23 | } // extern "C" 24 | #endif 25 | 26 | #endif // VPX_VP8_ENCODER_MODECOSTS_H_ 27 | -------------------------------------------------------------------------------- /vp8/encoder/mr_dissim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_MR_DISSIM_H_ 12 | #define VPX_VP8_ENCODER_MR_DISSIM_H_ 13 | #include "vpx_config.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | extern void vp8_cal_low_res_mb_cols(VP8_COMP *cpi); 20 | extern void vp8_cal_dissimilarity(VP8_COMP *cpi); 21 | extern void vp8_store_drop_frame_info(VP8_COMP *cpi); 22 | 23 | #ifdef __cplusplus 24 | } // extern "C" 25 | #endif 26 | 27 | #endif // VPX_VP8_ENCODER_MR_DISSIM_H_ 28 | -------------------------------------------------------------------------------- /vp8/encoder/pickinter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_PICKINTER_H_ 12 | #define VPX_VP8_ENCODER_PICKINTER_H_ 13 | #include "vpx_config.h" 14 | #include "vp8/common/onyxc_int.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | extern void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, 21 | int recon_uvoffset, int *returnrate, 22 | int *returndistortion, int *returnintra, 23 | int mb_row, int mb_col); 24 | extern void vp8_pick_intra_mode(MACROBLOCK *x, int *rate); 25 | 26 | extern int vp8_get_inter_mbpred_error(MACROBLOCK *mb, 27 | const vp8_variance_fn_ptr_t *vfp, 28 | unsigned int *sse, int_mv this_mv); 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // VPX_VP8_ENCODER_PICKINTER_H_ 34 | -------------------------------------------------------------------------------- /vp8/encoder/picklpf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 The WebM 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 VPX_VP8_ENCODER_PICKLPF_H_ 12 | #define VPX_VP8_ENCODER_PICKLPF_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | struct VP8_COMP; 19 | struct yv12_buffer_config; 20 | 21 | void vp8cx_pick_filter_level_fast(struct yv12_buffer_config *sd, 22 | struct VP8_COMP *cpi); 23 | void vp8cx_set_alt_lf_level(struct VP8_COMP *cpi, int filt_val); 24 | void vp8cx_pick_filter_level(struct yv12_buffer_config *sd, VP8_COMP *cpi); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif // VPX_VP8_ENCODER_PICKLPF_H_ 31 | -------------------------------------------------------------------------------- /vp8/encoder/quantize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_QUANTIZE_H_ 12 | #define VPX_VP8_ENCODER_QUANTIZE_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | struct VP8_COMP; 19 | struct macroblock; 20 | extern void vp8_quantize_mb(struct macroblock *x); 21 | extern void vp8_quantize_mby(struct macroblock *x); 22 | extern void vp8_quantize_mbuv(struct macroblock *x); 23 | extern void vp8_set_quantizer(struct VP8_COMP *cpi, int Q); 24 | extern void vp8cx_frame_init_quantizer(struct VP8_COMP *cpi); 25 | extern void vp8_update_zbin_extra(struct VP8_COMP *cpi, struct macroblock *x); 26 | extern void vp8cx_mb_init_quantizer(struct VP8_COMP *cpi, struct macroblock *x, 27 | int ok_to_skip); 28 | extern void vp8cx_init_quantizer(struct VP8_COMP *cpi); 29 | 30 | #ifdef __cplusplus 31 | } // extern "C" 32 | #endif 33 | 34 | #endif // VPX_VP8_ENCODER_QUANTIZE_H_ 35 | -------------------------------------------------------------------------------- /vp8/encoder/ratectrl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_RATECTRL_H_ 12 | #define VPX_VP8_ENCODER_RATECTRL_H_ 13 | 14 | #include "onyx_int.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | extern void vp8_save_coding_context(VP8_COMP *cpi); 21 | extern void vp8_restore_coding_context(VP8_COMP *cpi); 22 | 23 | extern void vp8_setup_key_frame(VP8_COMP *cpi); 24 | extern void vp8_update_rate_correction_factors(VP8_COMP *cpi, int damp_var); 25 | extern int vp8_regulate_q(VP8_COMP *cpi, int target_bits_per_frame); 26 | extern void vp8_adjust_key_frame_context(VP8_COMP *cpi); 27 | extern void vp8_compute_frame_size_bounds(VP8_COMP *cpi, 28 | int *frame_under_shoot_limit, 29 | int *frame_over_shoot_limit); 30 | 31 | /* return of 0 means drop frame */ 32 | extern int vp8_pick_frame_size(VP8_COMP *cpi); 33 | 34 | extern int vp8_drop_encodedframe_overshoot(VP8_COMP *cpi, int Q); 35 | 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // VPX_VP8_ENCODER_RATECTRL_H_ 41 | -------------------------------------------------------------------------------- /vp8/encoder/segmentation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_SEGMENTATION_H_ 12 | #define VPX_VP8_ENCODER_SEGMENTATION_H_ 13 | 14 | #include "string.h" 15 | #include "vp8/common/blockd.h" 16 | #include "onyx_int.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | extern void vp8_update_gf_usage_maps(VP8_COMP *cpi, VP8_COMMON *cm, 23 | MACROBLOCK *x); 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // VPX_VP8_ENCODER_SEGMENTATION_H_ 30 | -------------------------------------------------------------------------------- /vp8/encoder/temporal_filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 The WebM 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 VPX_VP8_ENCODER_TEMPORAL_FILTER_H_ 12 | #define VPX_VP8_ENCODER_TEMPORAL_FILTER_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | struct VP8_COMP; 19 | 20 | void vp8_temporal_filter_prepare_c(struct VP8_COMP *cpi, int distance); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif // VPX_VP8_ENCODER_TEMPORAL_FILTER_H_ 27 | -------------------------------------------------------------------------------- /vp8/encoder/tokenize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP8_ENCODER_TOKENIZE_H_ 12 | #define VPX_VP8_ENCODER_TOKENIZE_H_ 13 | 14 | #include "vp8/common/entropy.h" 15 | #include "block.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | typedef struct { 22 | short Token; 23 | short Extra; 24 | } TOKENVALUE; 25 | 26 | typedef struct { 27 | const vp8_prob *context_tree; 28 | short Extra; 29 | unsigned char Token; 30 | unsigned char skip_eob_node; 31 | } TOKENEXTRA; 32 | 33 | int rd_cost_mby(MACROBLOCKD *); 34 | 35 | extern const short *const vp8_dct_value_cost_ptr; 36 | /* TODO: The Token field should be broken out into a separate char array to 37 | * improve cache locality, since it's needed for costing when the rest of the 38 | * fields are not. 39 | */ 40 | extern const TOKENVALUE *const vp8_dct_value_tokens_ptr; 41 | 42 | #ifdef __cplusplus 43 | } // extern "C" 44 | #endif 45 | 46 | #endif // VPX_VP8_ENCODER_TOKENIZE_H_ 47 | -------------------------------------------------------------------------------- /vp8/encoder/treewriter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "treewriter.h" 12 | 13 | static void cost(int *const C, vp8_tree T, const vp8_prob *const P, int i, 14 | int c) { 15 | const vp8_prob p = P[i >> 1]; 16 | 17 | do { 18 | const vp8_tree_index j = T[i]; 19 | const int d = c + vp8_cost_bit(p, i & 1); 20 | 21 | if (j <= 0) { 22 | C[-j] = d; 23 | } else { 24 | cost(C, T, P, j, d); 25 | } 26 | } while (++i & 1); 27 | } 28 | void vp8_cost_tokens(int *c, const vp8_prob *p, vp8_tree t) { 29 | cost(c, t, p, 0, 0); 30 | } 31 | void vp8_cost_tokens2(int *c, const vp8_prob *p, vp8_tree t, int start) { 32 | cost(c, t, p, start, 0); 33 | } 34 | -------------------------------------------------------------------------------- /vp8/encoder/x86/vp8_enc_stubs_sse2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "vpx_config.h" 12 | #include "vp8_rtcd.h" 13 | #include "vpx_ports/x86.h" 14 | #include "vp8/encoder/block.h" 15 | 16 | int vp8_mbblock_error_sse2_impl(short *coeff_ptr, short *dcoef_ptr, int dc); 17 | int vp8_mbblock_error_sse2(MACROBLOCK *mb, int dc) { 18 | short *coeff_ptr = mb->block[0].coeff; 19 | short *dcoef_ptr = mb->e_mbd.block[0].dqcoeff; 20 | return vp8_mbblock_error_sse2_impl(coeff_ptr, dcoef_ptr, dc); 21 | } 22 | 23 | int vp8_mbuverror_sse2_impl(short *s_ptr, short *d_ptr); 24 | int vp8_mbuverror_sse2(MACROBLOCK *mb) { 25 | short *s_ptr = &mb->coeff[256]; 26 | short *d_ptr = &mb->e_mbd.dqcoeff[256]; 27 | return vp8_mbuverror_sse2_impl(s_ptr, d_ptr); 28 | } 29 | -------------------------------------------------------------------------------- /vp8/exports_dec: -------------------------------------------------------------------------------- 1 | data vpx_codec_vp8_dx_algo 2 | text vpx_codec_vp8_dx 3 | -------------------------------------------------------------------------------- /vp8/exports_enc: -------------------------------------------------------------------------------- 1 | data vpx_codec_vp8_cx_algo 2 | text vpx_codec_vp8_cx 3 | -------------------------------------------------------------------------------- /vp8/vp8dx.mk: -------------------------------------------------------------------------------- 1 | ## 2 | ## Copyright (c) 2010 The WebM 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 | 12 | VP8_DX_EXPORTS += exports_dec 13 | 14 | VP8_DX_SRCS-yes += $(VP8_COMMON_SRCS-yes) 15 | VP8_DX_SRCS-no += $(VP8_COMMON_SRCS-no) 16 | VP8_DX_SRCS_REMOVE-yes += $(VP8_COMMON_SRCS_REMOVE-yes) 17 | VP8_DX_SRCS_REMOVE-no += $(VP8_COMMON_SRCS_REMOVE-no) 18 | 19 | VP8_DX_SRCS-yes += vp8dx.mk 20 | 21 | VP8_DX_SRCS-yes += vp8_dx_iface.c 22 | 23 | VP8_DX_SRCS-yes += decoder/dboolhuff.c 24 | VP8_DX_SRCS-yes += decoder/decodemv.c 25 | VP8_DX_SRCS-yes += decoder/decodeframe.c 26 | VP8_DX_SRCS-yes += decoder/detokenize.c 27 | VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT) += decoder/ec_types.h 28 | VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT) += decoder/error_concealment.h 29 | VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT) += decoder/error_concealment.c 30 | VP8_DX_SRCS-yes += decoder/dboolhuff.h 31 | VP8_DX_SRCS-yes += decoder/decodemv.h 32 | VP8_DX_SRCS-yes += decoder/decoderthreading.h 33 | VP8_DX_SRCS-yes += decoder/detokenize.h 34 | VP8_DX_SRCS-yes += decoder/onyxd_int.h 35 | VP8_DX_SRCS-yes += decoder/treereader.h 36 | VP8_DX_SRCS-yes += decoder/onyxd_if.c 37 | VP8_DX_SRCS-$(CONFIG_MULTITHREAD) += decoder/threading.c 38 | 39 | VP8_DX_SRCS-yes := $(filter-out $(VP8_DX_SRCS_REMOVE-yes),$(VP8_DX_SRCS-yes)) 40 | -------------------------------------------------------------------------------- /vp9/common/vp9_filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The WebM 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 VPX_VP9_COMMON_VP9_FILTER_H_ 12 | #define VPX_VP9_COMMON_VP9_FILTER_H_ 13 | 14 | #include "./vpx_config.h" 15 | #include "vpx/vpx_integer.h" 16 | #include "vpx_dsp/vpx_filter.h" 17 | #include "vpx_ports/mem.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #define EIGHTTAP 0 24 | #define EIGHTTAP_SMOOTH 1 25 | #define EIGHTTAP_SHARP 2 26 | #define SWITCHABLE_FILTERS 3 /* Number of switchable filters */ 27 | #define BILINEAR 3 28 | #define FOURTAP 4 29 | // The codec can operate in four possible inter prediction filter mode: 30 | // 8-tap, 8-tap-smooth, 8-tap-sharp, and switching between the three. 31 | #define SWITCHABLE_FILTER_CONTEXTS (SWITCHABLE_FILTERS + 1) 32 | #define SWITCHABLE 4 /* should be the last one */ 33 | 34 | typedef uint8_t INTERP_FILTER; 35 | 36 | extern const InterpKernel *vp9_filter_kernels[5]; 37 | 38 | #ifdef __cplusplus 39 | } // extern "C" 40 | #endif 41 | 42 | #endif // VPX_VP9_COMMON_VP9_FILTER_H_ 43 | -------------------------------------------------------------------------------- /vp9/common/vp9_mfqe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 VPX_VP9_COMMON_VP9_MFQE_H_ 12 | #define VPX_VP9_COMMON_VP9_MFQE_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | // Multiframe Quality Enhancement. 19 | // The aim for MFQE is to replace pixel blocks in the current frame with 20 | // the correlated pixel blocks (with higher quality) in the last frame. 21 | // The replacement can only be taken in stationary blocks by checking 22 | // the motion of the blocks and other conditions such as the SAD of 23 | // the current block and correlated block, the variance of the block 24 | // difference, etc. 25 | void vp9_mfqe(struct VP9Common *cm); 26 | 27 | #ifdef __cplusplus 28 | } // extern "C" 29 | #endif 30 | 31 | #endif // VPX_VP9_COMMON_VP9_MFQE_H_ 32 | -------------------------------------------------------------------------------- /vp9/common/vp9_mv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_COMMON_VP9_MV_H_ 12 | #define VPX_VP9_COMMON_VP9_MV_H_ 13 | 14 | #include "vpx/vpx_integer.h" 15 | 16 | #include "vp9/common/vp9_common.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #define INVALID_MV 0x80008000 23 | 24 | typedef struct mv { 25 | int16_t row; 26 | int16_t col; 27 | } MV; 28 | 29 | typedef union int_mv { 30 | uint32_t as_int; 31 | MV as_mv; 32 | } int_mv; /* facilitates faster equality tests and copies */ 33 | 34 | typedef struct mv32 { 35 | int32_t row; 36 | int32_t col; 37 | } MV32; 38 | 39 | static INLINE int is_zero_mv(const MV *mv) { 40 | return *((const uint32_t *)mv) == 0; 41 | } 42 | 43 | static INLINE int is_equal_mv(const MV *a, const MV *b) { 44 | return *((const uint32_t *)a) == *((const uint32_t *)b); 45 | } 46 | 47 | static INLINE void clamp_mv(MV *mv, int min_col, int max_col, int min_row, 48 | int max_row) { 49 | mv->col = clamp(mv->col, min_col, max_col); 50 | mv->row = clamp(mv->row, min_row, max_row); 51 | } 52 | 53 | #ifdef __cplusplus 54 | } // extern "C" 55 | #endif 56 | 57 | #endif // VPX_VP9_COMMON_VP9_MV_H_ 58 | -------------------------------------------------------------------------------- /vp9/common/vp9_postproc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_COMMON_VP9_POSTPROC_H_ 12 | #define VPX_VP9_COMMON_VP9_POSTPROC_H_ 13 | 14 | #include "vpx_ports/mem.h" 15 | #include "vpx_scale/yv12config.h" 16 | #include "vp9/common/vp9_blockd.h" 17 | #include "vp9/common/vp9_mfqe.h" 18 | #include "vp9/common/vp9_ppflags.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | struct postproc_state { 25 | int last_q; 26 | int last_noise; 27 | int last_base_qindex; 28 | int last_frame_valid; 29 | MODE_INFO *prev_mip; 30 | MODE_INFO *prev_mi; 31 | int clamp; 32 | uint8_t *limits; 33 | int8_t *generated_noise; 34 | }; 35 | 36 | struct VP9Common; 37 | 38 | #define MFQE_PRECISION 4 39 | 40 | int vp9_post_proc_frame(struct VP9Common *cm, YV12_BUFFER_CONFIG *dest, 41 | vp9_ppflags_t *ppflags, int unscaled_width); 42 | 43 | void vp9_denoise(struct VP9Common *cm, const YV12_BUFFER_CONFIG *src, 44 | YV12_BUFFER_CONFIG *dst, int q, uint8_t *limits); 45 | 46 | void vp9_deblock(struct VP9Common *cm, const YV12_BUFFER_CONFIG *src, 47 | YV12_BUFFER_CONFIG *dst, int q, uint8_t *limits); 48 | 49 | #ifdef __cplusplus 50 | } // extern "C" 51 | #endif 52 | 53 | #endif // VPX_VP9_COMMON_VP9_POSTPROC_H_ 54 | -------------------------------------------------------------------------------- /vp9/common/vp9_ppflags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_COMMON_VP9_PPFLAGS_H_ 12 | #define VPX_VP9_COMMON_VP9_PPFLAGS_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | enum { 19 | VP9D_NOFILTERING = 0, 20 | VP9D_DEBLOCK = 1 << 0, 21 | VP9D_DEMACROBLOCK = 1 << 1, 22 | VP9D_ADDNOISE = 1 << 2, 23 | VP9D_MFQE = 1 << 3 24 | }; 25 | 26 | typedef struct { 27 | int post_proc_flag; 28 | int deblocking_level; 29 | int noise_level; 30 | } vp9_ppflags_t; 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | #endif 35 | 36 | #endif // VPX_VP9_COMMON_VP9_PPFLAGS_H_ 37 | -------------------------------------------------------------------------------- /vp9/common/vp9_quant_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_COMMON_VP9_QUANT_COMMON_H_ 12 | #define VPX_VP9_COMMON_VP9_QUANT_COMMON_H_ 13 | 14 | #include "vpx/vpx_codec.h" 15 | #include "vp9/common/vp9_seg_common.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #define MINQ 0 22 | #define MAXQ 255 23 | #define QINDEX_RANGE (MAXQ - MINQ + 1) 24 | #define QINDEX_BITS 8 25 | 26 | int16_t vp9_dc_quant(int qindex, int delta, vpx_bit_depth_t bit_depth); 27 | int16_t vp9_ac_quant(int qindex, int delta, vpx_bit_depth_t bit_depth); 28 | 29 | int vp9_get_qindex(const struct segmentation *seg, int segment_id, 30 | int base_qindex); 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | #endif 35 | 36 | #endif // VPX_VP9_COMMON_VP9_QUANT_COMMON_H_ 37 | -------------------------------------------------------------------------------- /vp9/common/vp9_reconintra.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_COMMON_VP9_RECONINTRA_H_ 12 | #define VPX_VP9_COMMON_VP9_RECONINTRA_H_ 13 | 14 | #include "vpx/vpx_integer.h" 15 | #include "vp9/common/vp9_blockd.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void vp9_init_intra_predictors(void); 22 | 23 | void vp9_predict_intra_block(const MACROBLOCKD *xd, int bwl_in, TX_SIZE tx_size, 24 | PREDICTION_MODE mode, const uint8_t *ref, 25 | int ref_stride, uint8_t *dst, int dst_stride, 26 | int aoff, int loff, int plane); 27 | #ifdef __cplusplus 28 | } // extern "C" 29 | #endif 30 | 31 | #endif // VPX_VP9_COMMON_VP9_RECONINTRA_H_ 32 | -------------------------------------------------------------------------------- /vp9/common/vp9_rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The WebM 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 | #include "./vpx_config.h" 11 | #define RTCD_C 12 | #include "./vp9_rtcd.h" 13 | #include "vpx_ports/vpx_once.h" 14 | 15 | void vp9_rtcd(void) { once(setup_rtcd_internal); } 16 | -------------------------------------------------------------------------------- /vp9/common/vp9_tile_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_COMMON_VP9_TILE_COMMON_H_ 12 | #define VPX_VP9_COMMON_VP9_TILE_COMMON_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | struct VP9Common; 19 | 20 | typedef struct TileInfo { 21 | int mi_row_start, mi_row_end; 22 | int mi_col_start, mi_col_end; 23 | } TileInfo; 24 | 25 | // initializes 'tile->mi_(row|col)_(start|end)' for (row, col) based on 26 | // 'cm->log2_tile_(rows|cols)' & 'cm->mi_(rows|cols)' 27 | void vp9_tile_init(TileInfo *tile, const struct VP9Common *cm, int row, 28 | int col); 29 | 30 | void vp9_tile_set_row(TileInfo *tile, const struct VP9Common *cm, int row); 31 | void vp9_tile_set_col(TileInfo *tile, const struct VP9Common *cm, int col); 32 | 33 | void vp9_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols, 34 | int *max_log2_tile_cols); 35 | 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // VPX_VP9_COMMON_VP9_TILE_COMMON_H_ 41 | -------------------------------------------------------------------------------- /vp9/decoder/vp9_decodeframe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_DECODER_VP9_DECODEFRAME_H_ 12 | #define VPX_VP9_DECODER_VP9_DECODEFRAME_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #include "vp9/common/vp9_enums.h" 19 | 20 | struct VP9Decoder; 21 | struct vpx_read_bit_buffer; 22 | 23 | int vp9_read_sync_code(struct vpx_read_bit_buffer *const rb); 24 | void vp9_read_frame_size(struct vpx_read_bit_buffer *rb, int *width, 25 | int *height); 26 | BITSTREAM_PROFILE vp9_read_profile(struct vpx_read_bit_buffer *rb); 27 | 28 | void vp9_decode_frame(struct VP9Decoder *pbi, const uint8_t *data, 29 | const uint8_t *data_end, const uint8_t **p_data_end); 30 | 31 | #ifdef __cplusplus 32 | } // extern "C" 33 | #endif 34 | 35 | #endif // VPX_VP9_DECODER_VP9_DECODEFRAME_H_ 36 | -------------------------------------------------------------------------------- /vp9/decoder/vp9_decodemv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_DECODER_VP9_DECODEMV_H_ 12 | #define VPX_VP9_DECODER_VP9_DECODEMV_H_ 13 | 14 | #include "vpx_dsp/bitreader.h" 15 | 16 | #include "vp9/decoder/vp9_decoder.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | void vp9_read_mode_info(TileWorkerData *twd, VP9Decoder *const pbi, int mi_row, 23 | int mi_col, int x_mis, int y_mis); 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // VPX_VP9_DECODER_VP9_DECODEMV_H_ 30 | -------------------------------------------------------------------------------- /vp9/decoder/vp9_detokenize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_DECODER_VP9_DETOKENIZE_H_ 12 | #define VPX_VP9_DECODER_VP9_DETOKENIZE_H_ 13 | 14 | #include "vpx_dsp/bitreader.h" 15 | #include "vp9/decoder/vp9_decoder.h" 16 | #include "vp9/common/vp9_scan.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | int vp9_decode_block_tokens(TileWorkerData *twd, int plane, const ScanOrder *sc, 23 | int x, int y, TX_SIZE tx_size, int seg_id); 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // VPX_VP9_DECODER_VP9_DETOKENIZE_H_ 30 | -------------------------------------------------------------------------------- /vp9/decoder/vp9_dsubexp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 VPX_VP9_DECODER_VP9_DSUBEXP_H_ 12 | #define VPX_VP9_DECODER_VP9_DSUBEXP_H_ 13 | 14 | #include "vpx_dsp/bitreader.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp9_diff_update_prob(vpx_reader *r, vpx_prob *p); 21 | 22 | #ifdef __cplusplus 23 | } // extern "C" 24 | #endif 25 | 26 | #endif // VPX_VP9_DECODER_VP9_DSUBEXP_H_ 27 | -------------------------------------------------------------------------------- /vp9/decoder/vp9_job_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebM 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 VPX_VP9_DECODER_VP9_JOB_QUEUE_H_ 12 | #define VPX_VP9_DECODER_VP9_JOB_QUEUE_H_ 13 | 14 | #include "vpx_util/vpx_pthread.h" 15 | 16 | typedef struct { 17 | // Pointer to buffer base which contains the jobs 18 | uint8_t *buf_base; 19 | 20 | // Pointer to current address where new job can be added 21 | uint8_t *volatile buf_wr; 22 | 23 | // Pointer to current address from where next job can be obtained 24 | uint8_t *volatile buf_rd; 25 | 26 | // Pointer to end of job buffer 27 | uint8_t *buf_end; 28 | 29 | int terminate; 30 | 31 | #if CONFIG_MULTITHREAD 32 | pthread_mutex_t mutex; 33 | pthread_cond_t cond; 34 | #endif 35 | } JobQueueRowMt; 36 | 37 | void vp9_jobq_init(JobQueueRowMt *jobq, uint8_t *buf, size_t buf_size); 38 | void vp9_jobq_reset(JobQueueRowMt *jobq); 39 | void vp9_jobq_deinit(JobQueueRowMt *jobq); 40 | void vp9_jobq_terminate(JobQueueRowMt *jobq); 41 | int vp9_jobq_queue(JobQueueRowMt *jobq, void *job, size_t job_size); 42 | int vp9_jobq_dequeue(JobQueueRowMt *jobq, void *job, size_t job_size, 43 | int blocking); 44 | 45 | #endif // VPX_VP9_DECODER_VP9_JOB_QUEUE_H_ 46 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_aq_360.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 VPX_VP9_ENCODER_VP9_AQ_360_H_ 12 | #define VPX_VP9_ENCODER_VP9_AQ_360_H_ 13 | 14 | #include "vp9/encoder/vp9_encoder.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | unsigned int vp9_360aq_segment_id(int mi_row, int mi_rows); 21 | void vp9_360aq_frame_setup(VP9_COMP *cpi); 22 | 23 | #ifdef __cplusplus 24 | } // extern "C" 25 | #endif 26 | 27 | #endif // VPX_VP9_ENCODER_VP9_AQ_360_H_ 28 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_aq_complexity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 VPX_VP9_ENCODER_VP9_AQ_COMPLEXITY_H_ 12 | #define VPX_VP9_ENCODER_VP9_AQ_COMPLEXITY_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #include "vp9/common/vp9_enums.h" 19 | 20 | struct VP9_COMP; 21 | struct macroblock; 22 | 23 | // Select a segment for the current Block. 24 | void vp9_caq_select_segment(struct VP9_COMP *cpi, struct macroblock *, 25 | BLOCK_SIZE bs, int mi_row, int mi_col, 26 | int projected_rate); 27 | 28 | // This function sets up a set of segments with delta Q values around 29 | // the baseline frame quantizer. 30 | void vp9_setup_in_frame_q_adj(struct VP9_COMP *cpi); 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | #endif 35 | 36 | #endif // VPX_VP9_ENCODER_VP9_AQ_COMPLEXITY_H_ 37 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_aq_variance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 VPX_VP9_ENCODER_VP9_AQ_VARIANCE_H_ 12 | #define VPX_VP9_ENCODER_VP9_AQ_VARIANCE_H_ 13 | 14 | #include "vp9/encoder/vp9_encoder.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | unsigned int vp9_vaq_segment_id(int energy); 21 | void vp9_vaq_frame_setup(VP9_COMP *cpi); 22 | 23 | void vp9_get_sub_block_energy(VP9_COMP *cpi, MACROBLOCK *mb, int mi_row, 24 | int mi_col, BLOCK_SIZE bsize, int *min_e, 25 | int *max_e); 26 | int vp9_block_energy(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); 27 | 28 | double vp9_log_block_var(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs); 29 | 30 | #ifdef __cplusplus 31 | } // extern "C" 32 | #endif 33 | 34 | #endif // VPX_VP9_ENCODER_VP9_AQ_VARIANCE_H_ 35 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_blockiness.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 The WebM 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 VPX_VP9_ENCODER_VP9_BLOCKINESS_H_ 12 | #define VPX_VP9_ENCODER_VP9_BLOCKINESS_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | double vp9_get_blockiness(const uint8_t *img1, int img1_pitch, 19 | const uint8_t *img2, int img2_pitch, int width, 20 | int height); 21 | 22 | #ifdef __cplusplus 23 | } // extern "C" 24 | #endif 25 | 26 | #endif // VPX_VP9_ENCODER_VP9_BLOCKINESS_H_ 27 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_encodemv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_ENCODER_VP9_ENCODEMV_H_ 12 | #define VPX_VP9_ENCODER_VP9_ENCODEMV_H_ 13 | 14 | #include "vp9/encoder/vp9_encoder.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp9_entropy_mv_init(void); 21 | 22 | void vp9_write_nmv_probs(VP9_COMMON *cm, int usehp, vpx_writer *w, 23 | nmv_context_counts *const counts); 24 | 25 | void vp9_encode_mv(VP9_COMP *cpi, vpx_writer *w, const MV *mv, const MV *ref, 26 | const nmv_context *mvctx, int usehp, 27 | unsigned int *const max_mv_magnitude); 28 | 29 | void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2], 30 | const nmv_context *ctx, int usehp); 31 | 32 | void vp9_update_mv_count(ThreadData *td); 33 | 34 | #ifdef __cplusplus 35 | } // extern "C" 36 | #endif 37 | 38 | #endif // VPX_VP9_ENCODER_VP9_ENCODEMV_H_ 39 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_extend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_ENCODER_VP9_EXTEND_H_ 12 | #define VPX_VP9_ENCODER_VP9_EXTEND_H_ 13 | 14 | #include "vpx_scale/yv12config.h" 15 | #include "vpx/vpx_integer.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void vp9_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src, 22 | YV12_BUFFER_CONFIG *dst); 23 | 24 | #ifdef __cplusplus 25 | } // extern "C" 26 | #endif 27 | 28 | #endif // VPX_VP9_ENCODER_VP9_EXTEND_H_ 29 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_job_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 The WebM 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 VPX_VP9_ENCODER_VP9_JOB_QUEUE_H_ 12 | #define VPX_VP9_ENCODER_VP9_JOB_QUEUE_H_ 13 | 14 | typedef enum { 15 | FIRST_PASS_JOB, 16 | ENCODE_JOB, 17 | ARNR_JOB, 18 | NUM_JOB_TYPES, 19 | } JOB_TYPE; 20 | 21 | // Encode job parameters 22 | typedef struct { 23 | int vert_unit_row_num; // Index of the vertical unit row 24 | int tile_col_id; // tile col id within a tile 25 | int tile_row_id; // tile col id within a tile 26 | } JobNode; 27 | 28 | // Job queue element parameters 29 | typedef struct { 30 | // Pointer to the next link in the job queue 31 | void *next; 32 | 33 | // Job information context of the module 34 | JobNode job_info; 35 | } JobQueue; 36 | 37 | // Job queue handle 38 | typedef struct { 39 | // Pointer to the next link in the job queue 40 | void *next; 41 | 42 | // Counter to store the number of jobs picked up for processing 43 | int num_jobs_acquired; 44 | } JobQueueHandle; 45 | 46 | #endif // VPX_VP9_ENCODER_VP9_JOB_QUEUE_H_ 47 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_mbgraph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_ENCODER_VP9_MBGRAPH_H_ 12 | #define VPX_VP9_ENCODER_VP9_MBGRAPH_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | typedef struct { 19 | struct { 20 | int err; 21 | union { 22 | int_mv mv; 23 | PREDICTION_MODE mode; 24 | } m; 25 | } ref[MAX_REF_FRAMES]; 26 | } MBGRAPH_MB_STATS; 27 | 28 | typedef struct { 29 | MBGRAPH_MB_STATS *mb_stats; 30 | } MBGRAPH_FRAME_STATS; 31 | 32 | struct VP9_COMP; 33 | 34 | void vp9_update_mbgraph_stats(struct VP9_COMP *cpi); 35 | 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // VPX_VP9_ENCODER_VP9_MBGRAPH_H_ 41 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_multi_thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 The WebM 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 VPX_VP9_ENCODER_VP9_MULTI_THREAD_H_ 12 | #define VPX_VP9_ENCODER_VP9_MULTI_THREAD_H_ 13 | 14 | #include "vp9/encoder/vp9_encoder.h" 15 | #include "vp9/encoder/vp9_job_queue.h" 16 | 17 | void *vp9_enc_grp_get_next_job(MultiThreadHandle *multi_thread_ctxt, 18 | int tile_id); 19 | 20 | void vp9_prepare_job_queue(VP9_COMP *cpi, JOB_TYPE job_type); 21 | 22 | int vp9_get_job_queue_status(MultiThreadHandle *multi_thread_ctxt, 23 | int cur_tile_id); 24 | 25 | void vp9_assign_tile_to_thread(MultiThreadHandle *multi_thread_ctxt, 26 | int tile_cols, int num_workers); 27 | 28 | void vp9_multi_thread_tile_init(VP9_COMP *cpi); 29 | 30 | void vp9_row_mt_mem_alloc(VP9_COMP *cpi); 31 | 32 | void vp9_row_mt_alloc_rd_thresh(VP9_COMP *const cpi, 33 | TileDataEnc *const this_tile); 34 | 35 | void vp9_row_mt_mem_dealloc(VP9_COMP *cpi); 36 | 37 | int vp9_get_tiles_proc_status(MultiThreadHandle *multi_thread_ctxt, 38 | int *tile_completion_status, int *cur_tile_id, 39 | int tile_cols); 40 | 41 | #endif // VPX_VP9_ENCODER_VP9_MULTI_THREAD_H_ 42 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_noise_estimate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The WebM 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 VPX_VP9_ENCODER_VP9_NOISE_ESTIMATE_H_ 12 | #define VPX_VP9_ENCODER_VP9_NOISE_ESTIMATE_H_ 13 | 14 | #include "vp9/encoder/vp9_block.h" 15 | #include "vp9/encoder/vp9_skin_detection.h" 16 | #include "vpx_scale/yv12config.h" 17 | 18 | #if CONFIG_VP9_TEMPORAL_DENOISING 19 | #include "vp9/encoder/vp9_denoiser.h" 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #define MAX_VAR_HIST_BINS 20 27 | 28 | typedef enum noise_level { kLowLow, kLow, kMedium, kHigh } NOISE_LEVEL; 29 | 30 | typedef struct noise_estimate { 31 | int enabled; 32 | NOISE_LEVEL level; 33 | int value; 34 | int thresh; 35 | int adapt_thresh; 36 | int count; 37 | int last_w; 38 | int last_h; 39 | int num_frames_estimate; 40 | } NOISE_ESTIMATE; 41 | 42 | struct VP9_COMP; 43 | 44 | void vp9_noise_estimate_init(NOISE_ESTIMATE *const ne, int width, int height); 45 | 46 | NOISE_LEVEL vp9_noise_estimate_extract_level(NOISE_ESTIMATE *const ne); 47 | 48 | void vp9_update_noise_estimate(struct VP9_COMP *const cpi); 49 | 50 | #ifdef __cplusplus 51 | } // extern "C" 52 | #endif 53 | 54 | #endif // VPX_VP9_ENCODER_VP9_NOISE_ESTIMATE_H_ 55 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_picklpf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VP9_ENCODER_VP9_PICKLPF_H_ 12 | #define VPX_VP9_ENCODER_VP9_PICKLPF_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #include "vp9/encoder/vp9_encoder.h" 19 | 20 | struct yv12_buffer_config; 21 | struct VP9_COMP; 22 | 23 | void vp9_pick_filter_level(const struct yv12_buffer_config *sd, 24 | struct VP9_COMP *cpi, LPF_PICK_METHOD method); 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // VPX_VP9_ENCODER_VP9_PICKLPF_H_ 30 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_pickmode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 VPX_VP9_ENCODER_VP9_PICKMODE_H_ 12 | #define VPX_VP9_ENCODER_VP9_PICKMODE_H_ 13 | 14 | #include "vp9/encoder/vp9_encoder.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void vp9_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost, 21 | BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx); 22 | 23 | void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, 24 | int mi_row, int mi_col, RD_COST *rd_cost, 25 | BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx); 26 | 27 | void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, int mi_row, 28 | int mi_col, RD_COST *rd_cost, BLOCK_SIZE bsize, 29 | PICK_MODE_CONTEXT *ctx); 30 | 31 | #ifdef __cplusplus 32 | } // extern "C" 33 | #endif 34 | 35 | #endif // VPX_VP9_ENCODER_VP9_PICKMODE_H_ 36 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_resize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 VPX_VP9_ENCODER_VP9_RESIZE_H_ 12 | #define VPX_VP9_ENCODER_VP9_RESIZE_H_ 13 | 14 | #include 15 | #include "vpx/vpx_integer.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void vp9_resize_plane(const uint8_t *const input, int height, int width, 22 | int in_stride, uint8_t *output, int height2, int width2, 23 | int out_stride); 24 | 25 | #if CONFIG_VP9_HIGHBITDEPTH 26 | void vp9_highbd_resize_plane(const uint8_t *const input, int height, int width, 27 | int in_stride, uint8_t *output, int height2, 28 | int width2, int out_stride, int bd); 29 | #endif // CONFIG_VP9_HIGHBITDEPTH 30 | 31 | #ifdef __cplusplus 32 | } // extern "C" 33 | #endif 34 | 35 | #endif // VPX_VP9_ENCODER_VP9_RESIZE_H_ 36 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_skin_detection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM 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 VPX_VP9_ENCODER_VP9_SKIN_DETECTION_H_ 12 | #define VPX_VP9_ENCODER_VP9_SKIN_DETECTION_H_ 13 | 14 | #include "vp9/common/vp9_blockd.h" 15 | #include "vpx_dsp/skin_detection.h" 16 | #include "vpx_util/vpx_write_yuv_frame.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | struct VP9_COMP; 23 | 24 | int vp9_compute_skin_block(const uint8_t *y, const uint8_t *u, const uint8_t *v, 25 | int stride, int strideuv, int bsize, 26 | int consec_zeromv, int curr_motion_magn); 27 | 28 | void vp9_compute_skin_sb(struct VP9_COMP *const cpi, BLOCK_SIZE bsize, 29 | int mi_row, int mi_col); 30 | 31 | #ifdef OUTPUT_YUV_SKINMAP 32 | // For viewing skin map on input source. 33 | void vp9_output_skin_map(struct VP9_COMP *const cpi, FILE *yuv_skinmap_file); 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | #endif 39 | 40 | #endif // VPX_VP9_ENCODER_VP9_SKIN_DETECTION_H_ 41 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_subexp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 VPX_VP9_ENCODER_VP9_SUBEXP_H_ 12 | #define VPX_VP9_ENCODER_VP9_SUBEXP_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #include "vpx_dsp/prob.h" 19 | 20 | struct vpx_writer; 21 | 22 | void vp9_write_prob_diff_update(struct vpx_writer *w, vpx_prob newp, 23 | vpx_prob oldp); 24 | 25 | void vp9_cond_prob_diff_update(struct vpx_writer *w, vpx_prob *oldp, 26 | const unsigned int ct[2]); 27 | 28 | int64_t vp9_prob_diff_update_savings_search(const unsigned int *ct, 29 | vpx_prob oldp, vpx_prob *bestp, 30 | vpx_prob upd); 31 | 32 | int64_t vp9_prob_diff_update_savings_search_model(const unsigned int *ct, 33 | const vpx_prob oldp, 34 | vpx_prob *bestp, vpx_prob upd, 35 | int stepsize); 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // VPX_VP9_ENCODER_VP9_SUBEXP_H_ 42 | -------------------------------------------------------------------------------- /vp9/encoder/vp9_tpl_model.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 The WebM 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 VPX_VP9_ENCODER_VP9_TPL_MODEL_H_ 12 | #define VPX_VP9_ENCODER_VP9_TPL_MODEL_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifndef M_LOG2_E 19 | #define M_LOG2_E 0.693147180559945309417 20 | #endif 21 | #define log2f(x) (log(x) / (float)M_LOG2_E) 22 | 23 | #define TPL_DEP_COST_SCALE_LOG2 4 24 | 25 | typedef struct GF_PICTURE { 26 | YV12_BUFFER_CONFIG *frame; 27 | int ref_frame[3]; 28 | FRAME_UPDATE_TYPE update_type; 29 | } GF_PICTURE; 30 | 31 | void vp9_init_tpl_buffer(VP9_COMP *cpi); 32 | void vp9_setup_tpl_stats(VP9_COMP *cpi); 33 | void vp9_free_tpl_buffer(VP9_COMP *cpi); 34 | void vp9_estimate_tpl_qp_gop(VP9_COMP *cpi); 35 | 36 | void vp9_wht_fwd_txfm(int16_t *src_diff, int bw, tran_low_t *coeff, 37 | TX_SIZE tx_size); 38 | #if CONFIG_VP9_HIGHBITDEPTH 39 | void vp9_highbd_wht_fwd_txfm(int16_t *src_diff, int bw, tran_low_t *coeff, 40 | TX_SIZE tx_size); 41 | #endif 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // VPX_VP9_ENCODER_VP9_TPL_MODEL_H_ 48 | -------------------------------------------------------------------------------- /vp9/exports_dec: -------------------------------------------------------------------------------- 1 | data vpx_codec_vp9_dx_algo 2 | text vpx_codec_vp9_dx 3 | -------------------------------------------------------------------------------- /vp9/exports_enc: -------------------------------------------------------------------------------- 1 | data vpx_codec_vp9_cx_algo 2 | text vpx_codec_vp9_cx 3 | -------------------------------------------------------------------------------- /vp9/vp9_iface_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 | #ifndef VPX_VP9_VP9_IFACE_COMMON_H_ 11 | #define VPX_VP9_VP9_IFACE_COMMON_H_ 12 | 13 | #include 14 | #include "vpx_ports/mem.h" 15 | #include "vpx/vp8.h" 16 | #include "vpx_scale/yv12config.h" 17 | #include "common/vp9_enums.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12, 24 | void *user_priv); 25 | 26 | vpx_codec_err_t image2yuvconfig(const vpx_image_t *img, 27 | YV12_BUFFER_CONFIG *yv12); 28 | 29 | static INLINE VP9_REFFRAME 30 | ref_frame_to_vp9_reframe(vpx_ref_frame_type_t frame) { 31 | switch (frame) { 32 | case VP8_LAST_FRAME: return VP9_LAST_FLAG; 33 | case VP8_GOLD_FRAME: return VP9_GOLD_FLAG; 34 | case VP8_ALTR_FRAME: return VP9_ALT_FLAG; 35 | } 36 | assert(0 && "Invalid Reference Frame"); 37 | return VP9_LAST_FLAG; 38 | } 39 | 40 | #ifdef __cplusplus 41 | } // extern "C" 42 | #endif 43 | 44 | #endif // VPX_VP9_VP9_IFACE_COMMON_H_ 45 | -------------------------------------------------------------------------------- /vp9/vp9dx.mk: -------------------------------------------------------------------------------- 1 | ## 2 | ## Copyright (c) 2010 The WebM 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 | VP9_DX_EXPORTS += exports_dec 12 | 13 | VP9_DX_SRCS-yes += $(VP9_COMMON_SRCS-yes) 14 | VP9_DX_SRCS-no += $(VP9_COMMON_SRCS-no) 15 | VP9_DX_SRCS_REMOVE-yes += $(VP9_COMMON_SRCS_REMOVE-yes) 16 | VP9_DX_SRCS_REMOVE-no += $(VP9_COMMON_SRCS_REMOVE-no) 17 | 18 | VP9_DX_SRCS-yes += vp9_dx_iface.c 19 | VP9_DX_SRCS-yes += vp9_dx_iface.h 20 | 21 | VP9_DX_SRCS-yes += decoder/vp9_decodemv.c 22 | VP9_DX_SRCS-yes += decoder/vp9_decodeframe.c 23 | VP9_DX_SRCS-yes += decoder/vp9_decodeframe.h 24 | VP9_DX_SRCS-yes += decoder/vp9_detokenize.c 25 | VP9_DX_SRCS-yes += decoder/vp9_decodemv.h 26 | VP9_DX_SRCS-yes += decoder/vp9_detokenize.h 27 | VP9_DX_SRCS-yes += decoder/vp9_decoder.c 28 | VP9_DX_SRCS-yes += decoder/vp9_decoder.h 29 | VP9_DX_SRCS-yes += decoder/vp9_dsubexp.c 30 | VP9_DX_SRCS-yes += decoder/vp9_dsubexp.h 31 | VP9_DX_SRCS-yes += decoder/vp9_job_queue.c 32 | VP9_DX_SRCS-yes += decoder/vp9_job_queue.h 33 | 34 | VP9_DX_SRCS-yes := $(filter-out $(VP9_DX_SRCS_REMOVE-yes),$(VP9_DX_SRCS-yes)) 35 | -------------------------------------------------------------------------------- /vpx/exports_com: -------------------------------------------------------------------------------- 1 | text vpx_codec_build_config 2 | text vpx_codec_control_ 3 | text vpx_codec_destroy 4 | text vpx_codec_err_to_string 5 | text vpx_codec_error 6 | text vpx_codec_error_detail 7 | text vpx_codec_get_caps 8 | text vpx_codec_iface_name 9 | text vpx_codec_version 10 | text vpx_codec_version_extra_str 11 | text vpx_codec_version_str 12 | text vpx_img_alloc 13 | text vpx_img_flip 14 | text vpx_img_free 15 | text vpx_img_set_rect 16 | text vpx_img_wrap 17 | -------------------------------------------------------------------------------- /vpx/exports_dec: -------------------------------------------------------------------------------- 1 | text vpx_codec_dec_init_ver 2 | text vpx_codec_decode 3 | text vpx_codec_get_frame 4 | text vpx_codec_get_stream_info 5 | text vpx_codec_peek_stream_info 6 | text vpx_codec_register_put_frame_cb 7 | text vpx_codec_register_put_slice_cb 8 | text vpx_codec_set_frame_buffer_functions 9 | -------------------------------------------------------------------------------- /vpx/exports_enc: -------------------------------------------------------------------------------- 1 | text vpx_codec_enc_config_default 2 | text vpx_codec_enc_config_set 3 | text vpx_codec_enc_init_multi_ver 4 | text vpx_codec_enc_init_ver 5 | text vpx_codec_encode 6 | text vpx_codec_get_cx_data 7 | text vpx_codec_get_global_headers 8 | text vpx_codec_get_preview_frame 9 | text vpx_codec_set_cx_data_buf 10 | -------------------------------------------------------------------------------- /vpx/vpx_integer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VPX_VPX_INTEGER_H_ 12 | #define VPX_VPX_VPX_INTEGER_H_ 13 | 14 | /* get ptrdiff_t, size_t, wchar_t, NULL */ 15 | #include // IWYU pragma: export 16 | 17 | #if defined(_MSC_VER) 18 | #define VPX_FORCE_INLINE __forceinline 19 | #define VPX_INLINE __inline 20 | #else 21 | #define VPX_FORCE_INLINE __inline__ __attribute__((always_inline)) 22 | // TODO(jbb): Allow a way to force inline off for older compilers. 23 | #define VPX_INLINE inline 24 | #endif 25 | 26 | /* Assume platforms have the C99 standard integer types. */ 27 | 28 | #if defined(__cplusplus) 29 | #if !defined(__STDC_FORMAT_MACROS) 30 | #define __STDC_FORMAT_MACROS 31 | #endif 32 | #if !defined(__STDC_LIMIT_MACROS) 33 | #define __STDC_LIMIT_MACROS 34 | #endif 35 | #endif // __cplusplus 36 | 37 | #include // IWYU pragma: export 38 | #include // IWYU pragma: export 39 | 40 | #endif // VPX_VPX_VPX_INTEGER_H_ 41 | -------------------------------------------------------------------------------- /vpx_dsp/arm/save_reg_neon.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; Copyright (c) 2010 The WebM 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 | 12 | EXPORT |vpx_push_neon| 13 | EXPORT |vpx_pop_neon| 14 | 15 | ARM 16 | REQUIRE8 17 | PRESERVE8 18 | 19 | AREA ||.text||, CODE, READONLY, ALIGN=2 20 | 21 | |vpx_push_neon| PROC 22 | vstm r0!, {d8-d15} 23 | bx lr 24 | 25 | ENDP 26 | 27 | |vpx_pop_neon| PROC 28 | vldm r0!, {d8-d15} 29 | bx lr 30 | 31 | ENDP 32 | 33 | END 34 | 35 | -------------------------------------------------------------------------------- /vpx_dsp/arm/vpx_convolve8_neon_asm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebM 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 VPX_VPX_DSP_ARM_VPX_CONVOLVE8_NEON_ASM_H_ 12 | #define VPX_VPX_DSP_ARM_VPX_CONVOLVE8_NEON_ASM_H_ 13 | 14 | #define DECLARE_FILTER(dir, type) \ 15 | void vpx_convolve8_##dir##_filter_##type##_neon( \ 16 | const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, \ 17 | ptrdiff_t dst_stride, const InterpKernel *filter, int x0_q4, \ 18 | int x_step_q4, int y0_q4, int y_step_q4, int w, int h); 19 | 20 | DECLARE_FILTER(horiz, type1) 21 | DECLARE_FILTER(avg_horiz, type1) 22 | DECLARE_FILTER(horiz, type2) 23 | DECLARE_FILTER(avg_horiz, type2) 24 | DECLARE_FILTER(vert, type1) 25 | DECLARE_FILTER(avg_vert, type1) 26 | DECLARE_FILTER(vert, type2) 27 | DECLARE_FILTER(avg_vert, type2) 28 | 29 | #endif // VPX_VPX_DSP_ARM_VPX_CONVOLVE8_NEON_ASM_H_ 30 | -------------------------------------------------------------------------------- /vpx_dsp/arm/vpx_neon_sve2_bridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 The WebM 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 VPX_VPX_DSP_ARM_VPX_NEON_SVE2_BRIDGE_H_ 12 | #define VPX_VPX_DSP_ARM_VPX_NEON_SVE2_BRIDGE_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | // Some very useful instructions are exclusive to the SVE2 instruction set. 19 | // However, we can access these instructions from a predominantly Neon context 20 | // by making use of the Neon-SVE bridge intrinsics to reinterpret Neon vectors 21 | // as SVE vectors - with the high part of the SVE vector (if it's longer than 22 | // 128 bits) being "don't care". 23 | 24 | static INLINE int16x8_t vpx_tbl2_s16(int16x8_t s0, int16x8_t s1, 25 | uint16x8_t tbl) { 26 | svint16x2_t samples = svcreate2_s16(svset_neonq_s16(svundef_s16(), s0), 27 | svset_neonq_s16(svundef_s16(), s1)); 28 | return svget_neonq_s16( 29 | svtbl2_s16(samples, svset_neonq_u16(svundef_u16(), tbl))); 30 | } 31 | 32 | #endif // VPX_VPX_DSP_ARM_VPX_NEON_SVE2_BRIDGE_H_ 33 | -------------------------------------------------------------------------------- /vpx_dsp/bitreader_buffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 | #include "./vpx_config.h" 11 | #include "./bitreader_buffer.h" 12 | 13 | size_t vpx_rb_bytes_read(struct vpx_read_bit_buffer *rb) { 14 | return (rb->bit_offset + 7) >> 3; 15 | } 16 | 17 | int vpx_rb_read_bit(struct vpx_read_bit_buffer *rb) { 18 | const size_t off = rb->bit_offset; 19 | const size_t p = off >> 3; 20 | const int q = 7 - (int)(off & 0x7); 21 | if (rb->bit_buffer + p < rb->bit_buffer_end) { 22 | const int bit = (rb->bit_buffer[p] >> q) & 1; 23 | rb->bit_offset = off + 1; 24 | return bit; 25 | } else { 26 | if (rb->error_handler != NULL) rb->error_handler(rb->error_handler_data); 27 | return 0; 28 | } 29 | } 30 | 31 | int vpx_rb_read_literal(struct vpx_read_bit_buffer *rb, int bits) { 32 | int value = 0, bit; 33 | for (bit = bits - 1; bit >= 0; bit--) value |= vpx_rb_read_bit(rb) << bit; 34 | return value; 35 | } 36 | 37 | int vpx_rb_read_signed_literal(struct vpx_read_bit_buffer *rb, int bits) { 38 | const int value = vpx_rb_read_literal(rb, bits); 39 | return vpx_rb_read_bit(rb) ? -value : value; 40 | } 41 | 42 | int vpx_rb_read_inv_signed_literal(struct vpx_read_bit_buffer *rb, int bits) { 43 | return vpx_rb_read_signed_literal(rb, bits); 44 | } 45 | -------------------------------------------------------------------------------- /vpx_dsp/bitreader_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 VPX_VPX_DSP_BITREADER_BUFFER_H_ 12 | #define VPX_VPX_DSP_BITREADER_BUFFER_H_ 13 | 14 | #include 15 | 16 | #include "vpx/vpx_integer.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | typedef void (*vpx_rb_error_handler)(void *data); 23 | 24 | struct vpx_read_bit_buffer { 25 | const uint8_t *bit_buffer; 26 | const uint8_t *bit_buffer_end; 27 | size_t bit_offset; 28 | 29 | void *error_handler_data; 30 | vpx_rb_error_handler error_handler; 31 | }; 32 | 33 | size_t vpx_rb_bytes_read(struct vpx_read_bit_buffer *rb); 34 | 35 | int vpx_rb_read_bit(struct vpx_read_bit_buffer *rb); 36 | 37 | int vpx_rb_read_literal(struct vpx_read_bit_buffer *rb, int bits); 38 | 39 | int vpx_rb_read_signed_literal(struct vpx_read_bit_buffer *rb, int bits); 40 | 41 | int vpx_rb_read_inv_signed_literal(struct vpx_read_bit_buffer *rb, int bits); 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // VPX_VPX_DSP_BITREADER_BUFFER_H_ 48 | -------------------------------------------------------------------------------- /vpx_dsp/bitwriter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "./bitwriter.h" 15 | 16 | #if CONFIG_BITSTREAM_DEBUG 17 | #include "vpx_util/vpx_debug_util.h" 18 | #endif 19 | 20 | void vpx_start_encode(vpx_writer *br, uint8_t *source, size_t size) { 21 | br->lowvalue = 0; 22 | br->range = 255; 23 | br->count = -24; 24 | br->error = 0; 25 | br->pos = 0; 26 | // Make sure it is safe to cast br->pos to int in vpx_write(). 27 | if (size > INT_MAX) size = INT_MAX; 28 | br->size = (unsigned int)size; 29 | br->buffer = source; 30 | vpx_write_bit(br, 0); 31 | } 32 | 33 | int vpx_stop_encode(vpx_writer *br) { 34 | int i; 35 | 36 | #if CONFIG_BITSTREAM_DEBUG 37 | bitstream_queue_set_skip_write(1); 38 | #endif 39 | for (i = 0; i < 32; i++) vpx_write_bit(br, 0); 40 | 41 | // Ensure there's no ambigous collision with any index marker bytes 42 | if (!br->error && (br->buffer[br->pos - 1] & 0xe0) == 0xc0) { 43 | if (br->pos < br->size) { 44 | br->buffer[br->pos++] = 0; 45 | } else { 46 | br->error = 1; 47 | } 48 | } 49 | 50 | #if CONFIG_BITSTREAM_DEBUG 51 | bitstream_queue_set_skip_write(0); 52 | #endif 53 | 54 | return br->error ? -1 : 0; 55 | } 56 | -------------------------------------------------------------------------------- /vpx_dsp/fwd_txfm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM 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 VPX_VPX_DSP_FWD_TXFM_H_ 12 | #define VPX_VPX_DSP_FWD_TXFM_H_ 13 | 14 | #include "vpx_dsp/txfm_common.h" 15 | 16 | static INLINE tran_high_t fdct_round_shift(tran_high_t input) { 17 | tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS); 18 | // TODO(debargha, peter.derivaz): Find new bounds for this assert 19 | // and make the bounds consts. 20 | // assert(INT16_MIN <= rv && rv <= INT16_MAX); 21 | return rv; 22 | } 23 | 24 | void vpx_fdct32(const tran_high_t *input, tran_high_t *output, int round); 25 | #endif // VPX_VPX_DSP_FWD_TXFM_H_ 26 | -------------------------------------------------------------------------------- /vpx_dsp/loongarch/bitdepth_conversion_lsx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 The WebM 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 VPX_VPX_DSP_LOONGARCH_BITDEPTH_CONVERSION_LSX_H_ 12 | #define VPX_VPX_DSP_LOONGARCH_BITDEPTH_CONVERSION_LSX_H_ 13 | 14 | #include "./vpx_config.h" 15 | #include "vpx/vpx_integer.h" 16 | #include "vpx_dsp/vpx_dsp_common.h" 17 | #include "vpx_util/loongson_intrinsics.h" 18 | 19 | static INLINE __m128i load_tran_low(const tran_low_t *s) { 20 | #if CONFIG_VP9_HIGHBITDEPTH 21 | __m128i v0_m = __lsx_vld(s, 0); 22 | __m128i v1_m = __lsx_vld(s + 4, 0); 23 | return __lsx_vsrlni_h_w(v0_m, v1_m, 0); 24 | #else 25 | return __lsx_vld(s, 0); 26 | #endif 27 | } 28 | 29 | static INLINE void store_tran_low(__m128i v, tran_low_t *s, int32_t c) { 30 | #if CONFIG_VP9_HIGHBITDEPTH 31 | __m128i v0_m, v1_m; 32 | v1_m = __lsx_vexth_w_h(v); 33 | v0_m = __lsx_vsllwil_w_h(v, 0); 34 | __lsx_vst(v0_m, s + c, 0); 35 | __lsx_vst(v1_m, s + c + 4, 0); 36 | #else 37 | __lsx_vst(v, s + c, 0); 38 | #endif 39 | } 40 | 41 | #endif // VPX_VPX_DSP_LOONGARCH_BITDEPTH_CONVERSION_LSX_H_ 42 | -------------------------------------------------------------------------------- /vpx_dsp/mips/common_dspr2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "vpx_dsp/mips/common_dspr2.h" 12 | 13 | #if HAVE_DSPR2 14 | uint8_t vpx_ff_cropTbl_a[256 + 2 * CROP_WIDTH]; 15 | uint8_t *vpx_ff_cropTbl; 16 | 17 | void vpx_dsputil_static_init(void) { 18 | int i; 19 | 20 | for (i = 0; i < 256; i++) vpx_ff_cropTbl_a[i + CROP_WIDTH] = i; 21 | 22 | for (i = 0; i < CROP_WIDTH; i++) { 23 | vpx_ff_cropTbl_a[i] = 0; 24 | vpx_ff_cropTbl_a[i + CROP_WIDTH + 256] = 255; 25 | } 26 | 27 | vpx_ff_cropTbl = &vpx_ff_cropTbl_a[CROP_WIDTH]; 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /vpx_dsp/mips/common_dspr2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 VPX_VPX_DSP_MIPS_COMMON_DSPR2_H_ 12 | #define VPX_VPX_DSP_MIPS_COMMON_DSPR2_H_ 13 | 14 | #include 15 | #include "./vpx_config.h" 16 | #include "vpx/vpx_integer.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | #if HAVE_DSPR2 22 | #define CROP_WIDTH 512 23 | 24 | extern uint8_t *vpx_ff_cropTbl; // From "vpx_dsp/mips/intrapred4_dspr2.c" 25 | 26 | static INLINE void prefetch_load(const unsigned char *src) { 27 | __asm__ __volatile__("pref 0, 0(%[src]) \n\t" : : [src] "r"(src)); 28 | } 29 | 30 | /* prefetch data for store */ 31 | static INLINE void prefetch_store(unsigned char *dst) { 32 | __asm__ __volatile__("pref 1, 0(%[dst]) \n\t" : : [dst] "r"(dst)); 33 | } 34 | 35 | static INLINE void prefetch_load_streamed(const unsigned char *src) { 36 | __asm__ __volatile__("pref 4, 0(%[src]) \n\t" : : [src] "r"(src)); 37 | } 38 | 39 | /* prefetch data for store */ 40 | static INLINE void prefetch_store_streamed(unsigned char *dst) { 41 | __asm__ __volatile__("pref 5, 0(%[dst]) \n\t" : : [dst] "r"(dst)); 42 | } 43 | #endif // #if HAVE_DSPR2 44 | #ifdef __cplusplus 45 | } // extern "C" 46 | #endif 47 | 48 | #endif // VPX_VPX_DSP_MIPS_COMMON_DSPR2_H_ 49 | -------------------------------------------------------------------------------- /vpx_dsp/postproc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 The WebM 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 VPX_VPX_DSP_POSTPROC_H_ 12 | #define VPX_VPX_DSP_POSTPROC_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | // Fills a noise buffer with gaussian noise strength determined by sigma. 19 | int vpx_setup_noise(double sigma, int8_t *noise, int size); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif // VPX_VPX_DSP_POSTPROC_H_ 26 | -------------------------------------------------------------------------------- /vpx_dsp/skin_detection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 The WebM 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 VPX_VPX_DSP_SKIN_DETECTION_H_ 12 | #define VPX_VPX_DSP_SKIN_DETECTION_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | int vpx_skin_pixel(const int y, const int cb, const int cr, int motion); 19 | 20 | #ifdef __cplusplus 21 | } // extern "C" 22 | #endif 23 | 24 | #endif // VPX_VPX_DSP_SKIN_DETECTION_H_ 25 | -------------------------------------------------------------------------------- /vpx_dsp/sum_squares.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "./vpx_dsp_rtcd.h" 12 | 13 | uint64_t vpx_sum_squares_2d_i16_c(const int16_t *src, int stride, int size) { 14 | int r, c; 15 | uint64_t ss = 0; 16 | 17 | for (r = 0; r < size; r++) { 18 | for (c = 0; c < size; c++) { 19 | const int16_t v = src[c]; 20 | ss += v * v; 21 | } 22 | src += stride; 23 | } 24 | 25 | return ss; 26 | } 27 | -------------------------------------------------------------------------------- /vpx_dsp/vpx_convolve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 | #ifndef VPX_VPX_DSP_VPX_CONVOLVE_H_ 11 | #define VPX_VPX_DSP_VPX_CONVOLVE_H_ 12 | 13 | #include "./vpx_config.h" 14 | #include "vpx/vpx_integer.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | typedef void (*convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride, 21 | uint8_t *dst, ptrdiff_t dst_stride, 22 | const InterpKernel *filter, int x0_q4, 23 | int x_step_q4, int y0_q4, int y_step_q4, int w, 24 | int h); 25 | 26 | #if CONFIG_VP9_HIGHBITDEPTH 27 | typedef void (*highbd_convolve_fn_t)(const uint16_t *src, ptrdiff_t src_stride, 28 | uint16_t *dst, ptrdiff_t dst_stride, 29 | const InterpKernel *filter, int x0_q4, 30 | int x_step_q4, int y0_q4, int y_step_q4, 31 | int w, int h, int bd); 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | } // extern "C" 36 | #endif 37 | 38 | #endif // VPX_VPX_DSP_VPX_CONVOLVE_H_ 39 | -------------------------------------------------------------------------------- /vpx_dsp/vpx_dsp_rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM 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 | #include "./vpx_config.h" 11 | #define RTCD_C 12 | #include "./vpx_dsp_rtcd.h" 13 | #include "vpx_ports/vpx_once.h" 14 | 15 | void vpx_dsp_rtcd(void) { once(setup_rtcd_internal); } 16 | -------------------------------------------------------------------------------- /vpx_dsp/vpx_filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM 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 VPX_VPX_DSP_VPX_FILTER_H_ 12 | #define VPX_VPX_DSP_VPX_FILTER_H_ 13 | 14 | #include 15 | #include "vpx/vpx_integer.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #define FILTER_BITS 7 22 | 23 | #define SUBPEL_BITS 4 24 | #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) 25 | #define SUBPEL_SHIFTS (1 << SUBPEL_BITS) 26 | #define SUBPEL_TAPS 8 27 | 28 | typedef int16_t InterpKernel[SUBPEL_TAPS]; 29 | 30 | static INLINE int vpx_get_filter_taps(const int16_t *const filter) { 31 | if (filter[0] | filter[7]) { 32 | return 8; 33 | } 34 | if (filter[1] | filter[6]) { 35 | return 6; 36 | } 37 | if (filter[2] | filter[5]) { 38 | return 4; 39 | } 40 | return 2; 41 | } 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // VPX_VPX_DSP_VPX_FILTER_H_ 48 | -------------------------------------------------------------------------------- /vpx_dsp/x86/txfm_common_sse2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM 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 VPX_VPX_DSP_X86_TXFM_COMMON_SSE2_H_ 12 | #define VPX_VPX_DSP_X86_TXFM_COMMON_SSE2_H_ 13 | 14 | #include 15 | #include "vpx/vpx_integer.h" 16 | 17 | #define pair_set_epi16(a, b) \ 18 | _mm_set_epi16((int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a), \ 19 | (int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a)) 20 | 21 | #define pair_set_epi32(a, b) \ 22 | _mm_set_epi32((int)(b), (int)(a), (int)(b), (int)(a)) 23 | 24 | #define dual_set_epi16(a, b) \ 25 | _mm_set_epi16((int16_t)(b), (int16_t)(b), (int16_t)(b), (int16_t)(b), \ 26 | (int16_t)(a), (int16_t)(a), (int16_t)(a), (int16_t)(a)) 27 | 28 | #define octa_set_epi16(a, b, c, d, e, f, g, h) \ 29 | _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \ 30 | (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h)) 31 | 32 | #endif // VPX_VPX_DSP_X86_TXFM_COMMON_SSE2_H_ 33 | -------------------------------------------------------------------------------- /vpx_mem/include/vpx_mem_intrnl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_ 12 | #define VPX_VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_ 13 | #include "./vpx_config.h" 14 | 15 | #define ADDRESS_STORAGE_SIZE sizeof(size_t) 16 | 17 | #ifndef DEFAULT_ALIGNMENT 18 | #if defined(VXWORKS) 19 | /*default addr alignment to use in calls to vpx_* functions other than 20 | * vpx_memalign*/ 21 | #define DEFAULT_ALIGNMENT 32 22 | #else 23 | #define DEFAULT_ALIGNMENT (2 * sizeof(void *)) /* NOLINT */ 24 | #endif 25 | #endif 26 | 27 | /*returns an addr aligned to the byte boundary specified by align*/ 28 | #define align_addr(addr, align) \ 29 | (void *)(((size_t)(addr) + ((align)-1)) & ~(size_t)((align)-1)) 30 | 31 | #endif // VPX_VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_ 32 | -------------------------------------------------------------------------------- /vpx_mem/vpx_mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VPX_MEM_VPX_MEM_H_ 12 | #define VPX_VPX_MEM_VPX_MEM_H_ 13 | 14 | #include "vpx_config.h" 15 | #if defined(__uClinux__) 16 | #include 17 | #endif 18 | 19 | #include 20 | #include 21 | 22 | #include "vpx/vpx_integer.h" 23 | 24 | #if defined(__cplusplus) 25 | extern "C" { 26 | #endif 27 | 28 | void *vpx_memalign(size_t align, size_t size); 29 | void *vpx_malloc(size_t size); 30 | void *vpx_calloc(size_t num, size_t size); 31 | void vpx_free(void *memblk); 32 | 33 | #if CONFIG_VP9_HIGHBITDEPTH 34 | static INLINE void *vpx_memset16(void *dest, int val, size_t length) { 35 | size_t i; 36 | uint16_t *dest16 = (uint16_t *)dest; 37 | for (i = 0; i < length; i++) *dest16++ = val; 38 | return dest; 39 | } 40 | #endif 41 | 42 | #include 43 | 44 | #ifdef VPX_MEM_PLTFRM 45 | #include VPX_MEM_PLTFRM 46 | #endif 47 | 48 | #if defined(__cplusplus) 49 | } 50 | #endif 51 | 52 | #endif // VPX_VPX_MEM_VPX_MEM_H_ 53 | -------------------------------------------------------------------------------- /vpx_mem/vpx_mem.mk: -------------------------------------------------------------------------------- 1 | MEM_SRCS-yes += vpx_mem.mk 2 | MEM_SRCS-yes += vpx_mem.c 3 | MEM_SRCS-yes += vpx_mem.h 4 | MEM_SRCS-yes += include/vpx_mem_intrnl.h 5 | -------------------------------------------------------------------------------- /vpx_ports/arm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VPX_PORTS_ARM_H_ 12 | #define VPX_VPX_PORTS_ARM_H_ 13 | #include 14 | #include "vpx_config.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | // Armv7-A optional Neon instructions, mandatory from Armv8.0-A. 21 | #define HAS_NEON (1 << 0) 22 | // Armv8.2-A optional Neon dot-product instructions, mandatory from Armv8.4-A. 23 | #define HAS_NEON_DOTPROD (1 << 1) 24 | // Armv8.2-A optional Neon i8mm instructions, mandatory from Armv8.6-A. 25 | #define HAS_NEON_I8MM (1 << 2) 26 | // Armv8.2-A optional SVE instructions, mandatory from Armv9.0-A. 27 | #define HAS_SVE (1 << 3) 28 | // Armv9.0-A SVE2 instructions. 29 | #define HAS_SVE2 (1 << 4) 30 | 31 | int arm_cpu_caps(void); 32 | 33 | // Earlier gcc compilers have issues with some neon intrinsics 34 | #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 4 && \ 35 | __GNUC_MINOR__ <= 6 36 | #define VPX_INCOMPATIBLE_GCC 37 | #endif 38 | 39 | #ifdef __cplusplus 40 | } // extern "C" 41 | #endif 42 | 43 | #endif // VPX_VPX_PORTS_ARM_H_ 44 | -------------------------------------------------------------------------------- /vpx_ports/arm_cpudetect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "vpx_config.h" 15 | #include "vpx_ports/arm.h" 16 | 17 | #if defined(_WIN32) 18 | #undef WIN32_LEAN_AND_MEAN 19 | #define WIN32_LEAN_AND_MEAN 20 | #undef WIN32_EXTRA_LEAN 21 | #define WIN32_EXTRA_LEAN 22 | #include 23 | #endif 24 | 25 | #ifdef WINAPI_FAMILY 26 | #include 27 | #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 28 | #define getenv(x) NULL 29 | #endif 30 | #endif 31 | 32 | #if defined(__ANDROID__) && (__ANDROID_API__ < 18) 33 | #define VPX_USE_ANDROID_CPU_FEATURES 1 34 | // Use getauxval() when targeting (64-bit) Android with API level >= 18. 35 | // getauxval() is supported since Android API level 18 (Android 4.3.) 36 | // First Android version with 64-bit support was Android 5.x (API level 21). 37 | #include 38 | #endif 39 | 40 | static INLINE int arm_cpu_env_flags(int *flags) { 41 | const char *env = getenv("VPX_SIMD_CAPS"); 42 | if (env && *env) { 43 | *flags = (int)strtol(env, NULL, 0); 44 | return 1; 45 | } 46 | return 0; 47 | } 48 | 49 | static INLINE int arm_cpu_env_mask(void) { 50 | const char *env = getenv("VPX_SIMD_CAPS_MASK"); 51 | return env && *env ? (int)strtol(env, NULL, 0) : ~0; 52 | } 53 | -------------------------------------------------------------------------------- /vpx_ports/emms_mmx.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; Copyright (c) 2010 The WebM 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 | 12 | %include "vpx_ports/x86_abi_support.asm" 13 | 14 | section .text 15 | globalsym(vpx_clear_system_state) 16 | sym(vpx_clear_system_state): 17 | emms 18 | ret 19 | -------------------------------------------------------------------------------- /vpx_ports/emms_mmx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | 13 | #include "vpx_ports/system_state.h" 14 | 15 | void vpx_clear_system_state(void) { _mm_empty(); } 16 | -------------------------------------------------------------------------------- /vpx_ports/float_control_word.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; Copyright (c) 2010 The WebM 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 | 12 | %include "vpx_ports/x86_abi_support.asm" 13 | 14 | section .text 15 | 16 | %if LIBVPX_YASM_WIN64 17 | globalsym(vpx_winx64_fldcw) 18 | sym(vpx_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(vpx_winx64_fstcw) 27 | sym(vpx_winx64_fstcw): 28 | sub rsp, 8 29 | fstcw [rsp] 30 | mov rax, [rsp] 31 | add rsp, 8 32 | ret 33 | %endif 34 | -------------------------------------------------------------------------------- /vpx_ports/loongarch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Loongson Technology Corporation Limited 3 | * Contributed by Jin Bo 4 | * Contributed by Lu Wang 5 | * 6 | * Use of this source code is governed by a BSD-style license 7 | * that can be found in the LICENSE file in the root of the source 8 | * tree. An additional intellectual property rights grant can be found 9 | * in the file PATENTS. All contributing project authors may 10 | * be found in the AUTHORS file in the root of the source tree. 11 | */ 12 | 13 | #ifndef VPX_VPX_PORTS_LOONGARCH_H_ 14 | #define VPX_VPX_PORTS_LOONGARCH_H_ 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #define HAS_LSX 0x01 21 | #define HAS_LASX 0x02 22 | 23 | int loongarch_cpu_caps(void); 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // VPX_VPX_PORTS_LOONGARCH_H_ 30 | -------------------------------------------------------------------------------- /vpx_ports/loongarch_cpudetect.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 Loongson Technology Corporation Limited 3 | * Contributed by Jin Bo 4 | * Contributed by Lu Wang 5 | * 6 | * Use of this source code is governed by a BSD-style license 7 | * that can be found in the LICENSE file in the root of the source 8 | * tree. An additional intellectual property rights grant can be found 9 | * in the file PATENTS. All contributing project authors may 10 | * be found in the AUTHORS file in the root of the source tree. 11 | */ 12 | 13 | #include "./vpx_config.h" 14 | #include "vpx_ports/loongarch.h" 15 | 16 | #define LOONGARCH_CFG2 0x02 17 | #define LOONGARCH_CFG2_LSX (1 << 6) 18 | #define LOONGARCH_CFG2_LASX (1 << 7) 19 | 20 | #if CONFIG_RUNTIME_CPU_DETECT 21 | #if defined(__loongarch__) && defined(__linux__) 22 | int loongarch_cpu_caps(void) { 23 | int reg = 0; 24 | int flag = 0; 25 | 26 | __asm__ volatile("cpucfg %0, %1 \n\t" : "+&r"(reg) : "r"(LOONGARCH_CFG2)); 27 | if (reg & LOONGARCH_CFG2_LSX) flag |= HAS_LSX; 28 | 29 | if (reg & LOONGARCH_CFG2_LASX) flag |= HAS_LASX; 30 | 31 | return flag; 32 | } 33 | #else /* end __loongarch__ && __linux__ */ 34 | #error \ 35 | "--enable-runtime-cpu-detect selected, but no CPU detection method " \ 36 | "available for your platform. Reconfigure with --disable-runtime-cpu-detect." 37 | #endif 38 | #else /* end CONFIG_RUNTIME_CPU_DETECT */ 39 | int loongarch_cpu_caps(void) { return 0; } 40 | #endif 41 | -------------------------------------------------------------------------------- /vpx_ports/mips.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 The WebM 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 VPX_VPX_PORTS_MIPS_H_ 12 | #define VPX_VPX_PORTS_MIPS_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define HAS_MMI 0x01 19 | #define HAS_MSA 0x02 20 | 21 | int mips_cpu_caps(void); 22 | 23 | #ifdef __cplusplus 24 | } // extern "C" 25 | #endif 26 | 27 | #endif // VPX_VPX_PORTS_MIPS_H_ 28 | -------------------------------------------------------------------------------- /vpx_ports/ppc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 The WebM 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 VPX_VPX_PORTS_PPC_H_ 12 | #define VPX_VPX_PORTS_PPC_H_ 13 | #include 14 | 15 | #include "./vpx_config.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #define HAS_VSX 0x01 22 | 23 | int ppc_simd_caps(void); 24 | 25 | #ifdef __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // VPX_VPX_PORTS_PPC_H_ 30 | -------------------------------------------------------------------------------- /vpx_ports/static_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 The WebM 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 VPX_VPX_PORTS_STATIC_ASSERT_H_ 12 | #define VPX_VPX_PORTS_STATIC_ASSERT_H_ 13 | 14 | #if defined(_MSC_VER) 15 | #define VPX_STATIC_ASSERT(boolexp) \ 16 | do { \ 17 | char vpx_static_assert[(boolexp) ? 1 : -1]; \ 18 | (void)vpx_static_assert; \ 19 | } while (0) 20 | #else // !_MSC_VER 21 | #define VPX_STATIC_ASSERT(boolexp) \ 22 | do { \ 23 | struct { \ 24 | unsigned int vpx_static_assert : (boolexp) ? 1 : -1; \ 25 | } vpx_static_assert; \ 26 | (void)vpx_static_assert; \ 27 | } while (0) 28 | #endif // _MSC_VER 29 | 30 | #endif // VPX_VPX_PORTS_STATIC_ASSERT_H_ 31 | -------------------------------------------------------------------------------- /vpx_ports/system_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM 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 VPX_VPX_PORTS_SYSTEM_STATE_H_ 12 | #define VPX_VPX_PORTS_SYSTEM_STATE_H_ 13 | 14 | #include "./vpx_config.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #if (VPX_ARCH_X86 || VPX_ARCH_X86_64) && HAVE_MMX 21 | extern void vpx_clear_system_state(void); 22 | #else 23 | #define vpx_clear_system_state() 24 | #endif // (VPX_ARCH_X86 || VPX_ARCH_X86_64) && HAVE_MMX 25 | 26 | #ifdef __cplusplus 27 | } // extern "C" 28 | #endif 29 | 30 | #endif // VPX_VPX_PORTS_SYSTEM_STATE_H_ 31 | -------------------------------------------------------------------------------- /vpx_scale/vpx_scale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM 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 VPX_VPX_SCALE_VPX_SCALE_H_ 12 | #define VPX_VPX_SCALE_VPX_SCALE_H_ 13 | 14 | #include "vpx_scale/yv12config.h" 15 | 16 | extern void vpx_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, 17 | unsigned char *temp_area, unsigned char temp_height, 18 | unsigned int hscale, unsigned int hratio, 19 | unsigned int vscale, unsigned int vratio, 20 | unsigned int interlaced); 21 | 22 | #endif // VPX_VPX_SCALE_VPX_SCALE_H_ 23 | -------------------------------------------------------------------------------- /vpx_scale/vpx_scale.mk: -------------------------------------------------------------------------------- 1 | SCALE_SRCS-yes += vpx_scale.mk 2 | SCALE_SRCS-yes += yv12config.h 3 | SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += vpx_scale.h 4 | SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += generic/vpx_scale.c 5 | SCALE_SRCS-yes += generic/yv12config.c 6 | SCALE_SRCS-yes += generic/yv12extend.c 7 | SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += generic/gen_scalers.c 8 | SCALE_SRCS-yes += vpx_scale_rtcd.c 9 | SCALE_SRCS-yes += vpx_scale_rtcd.pl 10 | 11 | #mips(dspr2) 12 | SCALE_SRCS-$(HAVE_DSPR2) += mips/dspr2/yv12extend_dspr2.c 13 | 14 | SCALE_SRCS-no += $(SCALE_SRCS_REMOVE-yes) 15 | 16 | $(eval $(call rtcd_h_template,vpx_scale_rtcd,vpx_scale/vpx_scale_rtcd.pl)) 17 | -------------------------------------------------------------------------------- /vpx_scale/vpx_scale_rtcd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The WebM 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 | #include "./vpx_config.h" 11 | #define RTCD_C 12 | #include "./vpx_scale_rtcd.h" 13 | #include "vpx_ports/vpx_once.h" 14 | 15 | void vpx_scale_rtcd(void) { once(setup_rtcd_internal); } 16 | -------------------------------------------------------------------------------- /vpx_util/vpx_timestamp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 The WebM 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 VPX_VPX_UTIL_VPX_TIMESTAMP_H_ 12 | #define VPX_VPX_UTIL_VPX_TIMESTAMP_H_ 13 | 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif // __cplusplus 19 | 20 | // Rational Number with an int64 numerator 21 | typedef struct vpx_rational64 { 22 | int64_t num; // fraction numerator 23 | int den; // fraction denominator 24 | } vpx_rational64_t; // alias for struct vpx_rational64_t 25 | 26 | static INLINE int gcd(int64_t a, int b) { 27 | int r; // remainder 28 | assert(a >= 0); 29 | assert(b > 0); 30 | while (b != 0) { 31 | r = (int)(a % b); 32 | a = b; 33 | b = r; 34 | } 35 | 36 | return (int)a; 37 | } 38 | 39 | static INLINE void reduce_ratio(vpx_rational64_t *ratio) { 40 | const int denom = gcd(ratio->num, ratio->den); 41 | ratio->num /= denom; 42 | ratio->den /= denom; 43 | } 44 | 45 | #ifdef __cplusplus 46 | } // extern "C" 47 | #endif // __cplusplus 48 | 49 | #endif // VPX_VPX_UTIL_VPX_TIMESTAMP_H_ 50 | -------------------------------------------------------------------------------- /vpx_util/vpx_util.mk: -------------------------------------------------------------------------------- 1 | ## 2 | ## Copyright (c) 2015 The WebM 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 | UTIL_SRCS-yes += vpx_atomics.h 12 | UTIL_SRCS-yes += vpx_util.mk 13 | UTIL_SRCS-yes += vpx_pthread.h 14 | UTIL_SRCS-yes += vpx_thread.c 15 | UTIL_SRCS-yes += vpx_thread.h 16 | UTIL_SRCS-yes += endian_inl.h 17 | UTIL_SRCS-yes += vpx_write_yuv_frame.h 18 | UTIL_SRCS-yes += vpx_write_yuv_frame.c 19 | UTIL_SRCS-yes += vpx_timestamp.h 20 | UTIL_SRCS-$(or $(CONFIG_BITSTREAM_DEBUG),$(CONFIG_MISMATCH_DEBUG)) += vpx_debug_util.h 21 | UTIL_SRCS-$(or $(CONFIG_BITSTREAM_DEBUG),$(CONFIG_MISMATCH_DEBUG)) += vpx_debug_util.c 22 | -------------------------------------------------------------------------------- /vpx_util/vpx_write_yuv_frame.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "vpx_dsp/skin_detection.h" 12 | #include "vpx_util/vpx_write_yuv_frame.h" 13 | 14 | void vpx_write_yuv_frame(FILE *yuv_file, YV12_BUFFER_CONFIG *s) { 15 | #if defined(OUTPUT_YUV_SRC) || defined(OUTPUT_YUV_DENOISED) || \ 16 | defined(OUTPUT_YUV_SKINMAP) || defined(OUTPUT_YUV_SVC_SRC) 17 | 18 | unsigned char *src = s->y_buffer; 19 | int h = s->y_crop_height; 20 | 21 | do { 22 | fwrite(src, s->y_width, 1, yuv_file); 23 | src += s->y_stride; 24 | } while (--h); 25 | 26 | src = s->u_buffer; 27 | h = s->uv_crop_height; 28 | 29 | do { 30 | fwrite(src, s->uv_width, 1, yuv_file); 31 | src += s->uv_stride; 32 | } while (--h); 33 | 34 | src = s->v_buffer; 35 | h = s->uv_crop_height; 36 | 37 | do { 38 | fwrite(src, s->uv_width, 1, yuv_file); 39 | src += s->uv_stride; 40 | } while (--h); 41 | 42 | #else 43 | (void)yuv_file; 44 | (void)s; 45 | #endif 46 | } 47 | -------------------------------------------------------------------------------- /vpx_util/vpx_write_yuv_frame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebM 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 VPX_VPX_UTIL_VPX_WRITE_YUV_FRAME_H_ 12 | #define VPX_VPX_UTIL_VPX_WRITE_YUV_FRAME_H_ 13 | 14 | #include 15 | #include "vpx_scale/yv12config.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void vpx_write_yuv_frame(FILE *yuv_file, YV12_BUFFER_CONFIG *s); 22 | 23 | #ifdef __cplusplus 24 | } // extern "C" 25 | #endif 26 | 27 | #endif // VPX_VPX_UTIL_VPX_WRITE_YUV_FRAME_H_ 28 | -------------------------------------------------------------------------------- /vpxstats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 VPX_VPXSTATS_H_ 12 | #define VPX_VPXSTATS_H_ 13 | 14 | #include 15 | 16 | #include "vpx/vpx_encoder.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* This structure is used to abstract the different ways of handling 23 | * first pass statistics 24 | */ 25 | typedef struct { 26 | vpx_fixed_buf_t buf; 27 | int pass; 28 | FILE *file; 29 | char *buf_ptr; 30 | size_t buf_alloc_sz; 31 | } stats_io_t; 32 | 33 | int stats_open_file(stats_io_t *stats, const char *fpf, int pass); 34 | int stats_open_mem(stats_io_t *stats, int pass); 35 | void stats_close(stats_io_t *stats, int last_pass); 36 | void stats_write(stats_io_t *stats, const void *pkt, size_t len); 37 | vpx_fixed_buf_t stats_get(stats_io_t *stats); 38 | 39 | #ifdef __cplusplus 40 | } // extern "C" 41 | #endif 42 | 43 | #endif // VPX_VPXSTATS_H_ 44 | -------------------------------------------------------------------------------- /warnings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The WebM 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 | #ifndef VPX_WARNINGS_H_ 11 | #define VPX_WARNINGS_H_ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | struct vpx_codec_enc_cfg; 18 | struct VpxEncoderConfig; 19 | 20 | /* 21 | * Checks config for improperly used settings. Warns user upon encountering 22 | * settings that will lead to poor output quality. Prompts user to continue 23 | * when warnings are issued. 24 | */ 25 | void check_encoder_config(int disable_prompt, 26 | const struct VpxEncoderConfig *global_config, 27 | const struct vpx_codec_enc_cfg *stream_config); 28 | 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // VPX_WARNINGS_H_ 34 | -------------------------------------------------------------------------------- /y4menc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 The WebM 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 VPX_Y4MENC_H_ 12 | #define VPX_Y4MENC_H_ 13 | 14 | #include "./tools_common.h" 15 | 16 | #include "vpx/vpx_decoder.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #define Y4M_BUFFER_SIZE 128 23 | 24 | int y4m_write_file_header(char *buf, size_t len, int width, int height, 25 | const struct VpxRational *framerate, 26 | vpx_img_fmt_t fmt, unsigned int bit_depth); 27 | int y4m_write_frame_header(char *buf, size_t len); 28 | 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // VPX_Y4MENC_H_ 34 | --------------------------------------------------------------------------------