From 9c997a3ccf3bfa0a85ad15ea4c126cb069d9d578 Mon Sep 17 00:00:00 2001 From: zhangyichix Date: Thu, 12 Oct 2023 15:58:03 +0800 Subject: [PATCH 1/5] Fixed av1 color aspects issues * Add the return of videoSignal value in av1 Tracked-On: OAM-112687 Signed-off-by: zhangyichix --- _studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp | 10 ++++++++++ .../shared/umc/codec/av1_dec/include/umc_av1_decoder.h | 1 + .../shared/umc/codec/av1_dec/src/umc_av1_decoder.cpp | 1 + 3 files changed, 12 insertions(+) diff --git a/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp b/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp index 9a385381..2374108b 100755 --- a/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp +++ b/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp @@ -1241,6 +1241,16 @@ mfxStatus VideoDECODEAV1::FillVideoParam(UMC_AV1_DECODER::AV1DecoderParams const || par->mfx.FrameInfo.FourCC == MFX_FOURCC_Y416) par->mfx.FrameInfo.Shift = 1; + // video signal section + mfxExtVideoSignalInfo * videoSignal = (mfxExtVideoSignalInfo *)GetExtendedBuffer(par->ExtParam, par->NumExtParam, MFX_EXTBUFF_VIDEO_SIGNAL_INFO); + if (videoSignal) + { + videoSignal->VideoFullRange = vp->color_config.color_range; + videoSignal->ColourPrimaries = vp->color_config.color_primaries; + videoSignal->TransferCharacteristics = vp->color_config.transfer_characteristics; + videoSignal->MatrixCoefficients = vp->color_config.matrix_coefficients; + } + return MFX_ERR_NONE; } diff --git a/_studio/shared/umc/codec/av1_dec/include/umc_av1_decoder.h b/_studio/shared/umc/codec/av1_dec/include/umc_av1_decoder.h index 89b6d1f2..fdc14969 100755 --- a/_studio/shared/umc/codec/av1_dec/include/umc_av1_decoder.h +++ b/_studio/shared/umc/codec/av1_dec/include/umc_av1_decoder.h @@ -72,6 +72,7 @@ namespace UMC_AV1_DECODER bool anchors_loaded; uint32_t skip_first_frames; mfxFrameSurface1** pre_loaded_anchors; + ColorConfig color_config; }; class ReportItem // adopted from HEVC/AVC decoders diff --git a/_studio/shared/umc/codec/av1_dec/src/umc_av1_decoder.cpp b/_studio/shared/umc/codec/av1_dec/src/umc_av1_decoder.cpp index f593a583..3e8026e1 100755 --- a/_studio/shared/umc/codec/av1_dec/src/umc_av1_decoder.cpp +++ b/_studio/shared/umc/codec/av1_dec/src/umc_av1_decoder.cpp @@ -1103,6 +1103,7 @@ namespace UMC_AV1_DECODER par.lFlags = 0; par.film_grain = sh.film_grain_param_present; + par.color_config = sh.color_config; return UMC::UMC_OK; } From 166ffa928e469f5a6eaf1c27f37bc1eb9773ba71 Mon Sep 17 00:00:00 2001 From: zhangyichix Date: Tue, 21 Jun 2022 02:28:50 +0000 Subject: [PATCH 2/5] Ignore reserved units for av1 decoder case:android.mediav2.cts.AdaptivePlaybackTest#testAdaptivePlayback Some av1 videos may contain reserved units. We should ignore it instead of returning an error. Reference source: https://aomediacodec.github.io/av1-spec/av1-spec.pdf Section 6.2.6: Reserved units are for future use and shall be ignored by AV1 decoder. Tracked-On: OAM-102526 Signed-off-by: zhangyichix --- _studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h | 1 + _studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/_studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h b/_studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h index a03177cc..3a0d1c12 100644 --- a/_studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h +++ b/_studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h @@ -104,6 +104,7 @@ namespace UMC_AV1_DECODER enum AV1_OBU_TYPE { + OBU_Reserved = 0, OBU_SEQUENCE_HEADER = 1, OBU_TEMPORAL_DELIMITER = 2, OBU_FRAME_HEADER = 3, diff --git a/_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp b/_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp index 8be3ea77..ddcb06f1 100644 --- a/_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp +++ b/_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp @@ -1211,7 +1211,8 @@ namespace UMC_AV1_DECODER if (info.header.obu_has_size_field) av1_read_obu_size(*this, obu_size, sizeFieldLength); - else if (info.header.obu_type != OBU_TEMPORAL_DELIMITER) + // Av1-spec section 6.2.2: Reserved units are for future use and shall be ignored by AV1 decoder. + else if (info.header.obu_type != OBU_TEMPORAL_DELIMITER && info.header.obu_type != OBU_Reserved) throw av1_exception(UMC::UMC_ERR_NOT_IMPLEMENTED); // no support for OBUs w/o size field so far info.size = headerSize + sizeFieldLength + obu_size; From 9c1340b5679d1b9a0317bf34e04ac227ad93e894 Mon Sep 17 00:00:00 2001 From: zhangyichix Date: Thu, 25 Apr 2024 14:33:14 +0800 Subject: [PATCH 3/5] Add Android.mk and fix compilation issues Tracked-On:OAM-117146 Signed-off-by: zhepeng.xu Signed-off-by: zhangyichix --- Android.mk | 4 + _studio/Android.mk | 3 + _studio/enctools/aenc/Android.mk | 26 ++ _studio/mfx_lib/Android.mk | 343 ++++++++++++++++++ .../ext/mpeg2/include/mfx_mpeg2_encode_hw.h | 2 +- .../ext/mpeg2/src/mfx_mpeg2_encode_hw.cpp | 4 +- _studio/mfx_lib/shared/src/libmfxsw.cpp | 2 +- _studio/shared/Android.mk | 3 + _studio/shared/asc/Android.mk | 92 +++++ _studio/shared/include/mfx_config.h | 12 +- _studio/shared/mfx_logging/Android.mk | 24 ++ _studio/shared/mfx_trace/Android.mk | 23 ++ _studio/shared/src/libmfx_core_vaapi.cpp | 2 +- _studio/shared/umc/Android.mk | 3 + _studio/shared/umc/codec/Android.mk | 83 +++++ _studio/shared/umc/core/Android.mk | 40 ++ _studio/shared/umc/io/Android.mk | 35 ++ android/Android.bp | 10 + android/Android.mk | 12 + android/include/mfx_android_config.h | 24 ++ android/include/mfx_android_defs.h | 57 +++ android/mfx_defs.mk | 115 ++++++ android/mfx_defs_internal.mk | 51 +++ 23 files changed, 962 insertions(+), 8 deletions(-) create mode 100644 Android.mk create mode 100644 _studio/Android.mk create mode 100644 _studio/enctools/aenc/Android.mk create mode 100644 _studio/mfx_lib/Android.mk create mode 100644 _studio/shared/Android.mk create mode 100644 _studio/shared/asc/Android.mk create mode 100644 _studio/shared/mfx_logging/Android.mk create mode 100644 _studio/shared/mfx_trace/Android.mk create mode 100644 _studio/shared/umc/Android.mk create mode 100644 _studio/shared/umc/codec/Android.mk create mode 100644 _studio/shared/umc/core/Android.mk create mode 100644 _studio/shared/umc/io/Android.mk create mode 100644 android/Android.bp create mode 100644 android/Android.mk create mode 100644 android/include/mfx_android_config.h create mode 100644 android/include/mfx_android_defs.h create mode 100644 android/mfx_defs.mk create mode 100644 android/mfx_defs_internal.mk diff --git a/Android.mk b/Android.mk new file mode 100644 index 00000000..bfaab8be --- /dev/null +++ b/Android.mk @@ -0,0 +1,4 @@ +MFX_HOME:= $(call my-dir) + +# Recursively call sub-folder Android.mk +include $(call all-subdir-makefiles) diff --git a/_studio/Android.mk b/_studio/Android.mk new file mode 100644 index 00000000..86c9b78c --- /dev/null +++ b/_studio/Android.mk @@ -0,0 +1,3 @@ +# Recursively call sub-folder Android.mk + +include $(call all-subdir-makefiles) \ No newline at end of file diff --git a/_studio/enctools/aenc/Android.mk b/_studio/enctools/aenc/Android.mk new file mode 100644 index 00000000..0642b0dc --- /dev/null +++ b/_studio/enctools/aenc/Android.mk @@ -0,0 +1,26 @@ +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(addprefix src/, aenc.cpp \ + hevc_asc_apq_tree.cpp \ + av1_asc_agop_tree.cpp \ + av1_asc_tree.cpp \ + hevc_asc_agop_tree.cpp \ + av1_asc.cpp) + +LOCAL_C_INCLUDES := \ + $(MFX_INCLUDES_INTERNAL_HW) \ + $(MFX_HOME)/_studio/enctools/aenc/include/ + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -mavx2 \ + -Wno-error \ + -Wno-unused-parameter + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libmfx_aenc +include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/mfx_lib/Android.mk b/_studio/mfx_lib/Android.mk new file mode 100644 index 00000000..74faa19d --- /dev/null +++ b/_studio/mfx_lib/Android.mk @@ -0,0 +1,343 @@ + +LOCAL_PATH:= $(MFX_HOME)/_studio + +# ============================================================================= + +MFX_LOCAL_DECODERS := h265 h264 vc1 mjpeg vp8 vp9 av1 +MFX_LOCAL_ENCODERS := h264 mpeg2 mjpeg vp9 + +# Setting subdirectories to march thru +MFX_LOCAL_DIRS := \ + scheduler/linux \ + +MFX_LOCAL_DIRS_IMPL := \ + $(addprefix decode/, $(MFX_LOCAL_DECODERS)) \ + vpp + +MFX_LOCAL_DIRS_HW := \ + $(addprefix encode_hw/, $(MFX_LOCAL_ENCODERS)) \ + mctf_package/mctf \ + cmrt_cross_platform + +#scheduler/linux/src +MFX_LOCAL_SRC_FILES := \ + $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp))) + +#decode/h265 h264 vc1 mjpeg vp8 vp9 av1/src +MFX_LOCAL_SRC_FILES_IMPL := \ + $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp))) + +#encode_hw/h264 mpeg2 mjpeg vp9/src +MFX_LOCAL_SRC_FILES_HW := \ + $(MFX_LOCAL_SRC_FILES_IMPL) \ + $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp))) + +#mpeg2 hw decoder +MFX_LOCAL_SRC_FILES_HW += $(addprefix mfx_lib/decode/mpeg2/hw/src/, \ + mfx_mpeg2_decode.cpp) + +MFX_LOCAL_SRC_FILES_HW += $(addprefix mfx_lib/ext/genx/h264_encode/isa/, \ + genx_simple_me_gen12lp_isa.cpp \ + genx_histogram_gen12lp_isa.cpp) + +MFX_LOCAL_SRC_FILES_HW += \ + mfx_lib/encode_hw/av1/av1ehw_disp.cpp \ + mfx_lib/encode_hw/av1/agnostic/av1ehw_base.cpp \ + mfx_lib/encode_hw/av1/linux/base/av1ehw_base_lin.cpp \ + mfx_lib/encode_hw/av1/linux/base/av1ehw_base_va_lin.cpp \ + mfx_lib/encode_hw/av1/linux/base/av1ehw_base_va_packer_lin.cpp \ + mfx_lib/encode_hw/av1/linux/base/av1ehw_base_max_frame_size_lin.cpp \ + mfx_lib/encode_hw/av1/agnostic/Xe_HPM/av1ehw_xe_hpm_segmentation.cpp \ + mfx_lib/encode_hw/av1/linux/Xe_HPM/av1ehw_xe_hpm_lin.cpp \ + mfx_lib/encode_hw/av1/linux/Xe_LPM_plus/av1ehw_xe_lpm_plus_lin.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_alloc.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_constraints.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_qmatrix.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools_com.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_general.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_general_defaults.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_impl.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_packer.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_query_impl_desc.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_segmentation.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_task.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_tile.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_encoded_frame_info.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_max_frame_size.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools.cpp \ + mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_hdr.cpp \ + +MFX_LOCAL_SRC_FILES_HW += \ + mfx_lib/encode_hw/hevc/hevcehw_disp.cpp \ + mfx_lib/encode_hw/hevc/agnostic/hevcehw_base.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_impl.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_alloc.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools_com.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_constraints.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_dirty_rect.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_encoded_frame_info.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_encode_stats.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_ext_brc.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_hdr_sei.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_hrd.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_scc.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_interlace.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_legacy.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_legacy_defaults.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_max_frame_size.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_packer.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_parser.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_recon_info.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_rext.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_roi.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_task.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_query_impl_desc.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_weighted_prediction.cpp \ + mfx_lib/encode_hw/hevc/agnostic/g12/hevcehw_g12_caps.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_interlace_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_dirty_rect_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_max_frame_size_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_enctools_qmatrix_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_roi_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_rext_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_qp_modulation_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_weighted_prediction_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/g12/hevcehw_g12_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/xe_hpm/hevcehw_xe_hpm_lin.cpp \ + mfx_lib/encode_hw/hevc/linux/xe_lpm_plus/hevcehw_xe_lpm_plus_lin.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_extddi.cpp \ + mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_caps.cpp \ + mfx_lib/encode_hw/shared/ehw_resources_pool.cpp \ + mfx_lib/encode_hw/shared/ehw_task_manager.cpp \ + mfx_lib/encode_hw/shared/ehw_device_vaapi.cpp \ + mfx_lib/encode_hw/shared/ehw_utils_vaapi.cpp \ + mfx_lib/ext/cmrt_cross_platform/src/cm_mem_copy.cpp \ + mfx_lib/ext/cmrt_cross_platform/src/cmrt_cross_platform.cpp \ + mfx_lib/ext/cmrt_cross_platform/src/cmrt_utility.cpp \ + mfx_lib/ext/asc/src/asc_cm.cpp \ + mfx_lib/ext/genx/h264_encode/src/genx_simple_me_proto.cpp \ + +#scheduler/linux/include +MFX_LOCAL_INCLUDES := \ + $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include)) + +#decode/h265 h264 vc1 mjpeg vp8 vp9 av1/include +MFX_LOCAL_INCLUDES_IMPL := \ + $(MFX_LOCAL_INCLUDES) \ + $(foreach dir, $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include)) + +#decode/mpeg2/hw/include +MFX_LOCAL_INCLUDES_IMPL += \ + $(MFX_HOME)/_studio/mfx_lib/decode/mpeg2/hw/include + +#encode_hw/h264 mpeg2 mjpeg vp9/include +MFX_LOCAL_INCLUDES_IMPL += \ + $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include)) + +MFX_LOCAL_INCLUDES_HW := \ + $(MFX_LOCAL_INCLUDES_IMPL) \ + $(MFX_HOME)/_studio/mfx_lib/ext/asc/include \ + $(MFX_HOME)/_studio/mfx_lib/ext/genx/h264_encode/isa \ + $(MFX_HOME)/_studio/mfx_lib/ext/genx/field_copy/isa \ + $(MFX_HOME)/_studio/mfx_lib/ext/genx/copy_kernels/isa \ + $(MFX_HOME)/_studio/mfx_lib/ext/cmrt_cross_platform/include \ + $(MFX_HOME)/_studio/mfx_lib/ext/genx/mctf/isa \ + $(MFX_HOME)/_studio/mfx_lib/ext/genx/asc/isa \ + $(MFX_HOME)/_studio/mfx_lib/ext/h264/include \ + $(MFX_HOME)/_studio/mfx_lib/ext/mpeg2/include \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1 \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/agnostic \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/agnostic/base \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/agnostic/Xe_HPM \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/agnostic/Xe_LPM_plus \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/linux \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/linux/base \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/linux/Xe_HPM \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/linux/Xe_LPM_plus \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/agnostic \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/agnostic/base \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/agnostic/g12 \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux/base \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux/g12 \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux/xe_hpm \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux/xe_lpm_plus \ + $(MFX_HOME)/_studio/mfx_lib/encode_hw/shared \ + $(MFX_HOME)/_studio/mfx_lib/shared/include/feature_blocks \ + $(MFX_HOME)/_studio/mfx_lib/scheduler/linux/include \ + $(MFX_HOME)/_studio/shared/asc/include + +MFX_LOCAL_STATIC_LIBRARIES_HW := \ + libmfx_core_hw \ + libumc_codecs_hw \ + libumc_brc \ + libumc_va \ + libumc_core_hw \ + libmfx_gen_trace \ + libmfx_asc \ + libmfx_logging + +MFX_LOCAL_LDFLAGS_HW := \ + $(MFX_LDFLAGS) \ + -Wl,--version-script=$(LOCAL_PATH)/mfx_lib/libmfx-gen.map + +# ============================================================================= + +UMC_DIRS := \ + h264_enc \ + brc + +UMC_DIRS_IMPL := \ + h265_dec h264_dec mpeg2_dec vc1_dec jpeg_dec vp9_dec av1_dec \ + vc1_common jpeg_common color_space_converter + +UMC_LOCAL_INCLUDES := \ + $(foreach dir, $(UMC_DIRS), $(wildcard $(MFX_HOME)/_studio/shared/umc/codec/$(dir)/include)) + +UMC_LOCAL_INCLUDES_IMPL := \ + $(UMC_LOCAL_INCLUDES) \ + $(foreach dir, $(UMC_DIRS_IMPL), $(wildcard $(MFX_HOME)/_studio/shared/umc/codec/$(dir)/include)) + +UMC_LOCAL_INCLUDES_HW := \ + $(UMC_LOCAL_INCLUDES_IMPL) + +# ============================================================================= + +MFX_SHARED_FILES_IMPL := $(addprefix mfx_lib/shared/src/, \ + mfx_feature_blocks_base.cpp \ + mfx_brc_common.cpp \ + mfx_common_decode_int.cpp \ + mfx_common_int.cpp \ + mfx_enc_common.cpp \ + mfx_log.cpp \ + mfx_enc_enctools_common.cpp \ + mfx_mpeg2_dec_common.cpp \ + mfx_vc1_dec_common.cpp \ + mfx_ddi_enc_dump.cpp \ + mfx_vpx_dec_common.cpp) + +MFX_SHARED_FILES_HW := \ + $(MFX_SHARED_FILES_IMPL) + +MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/genx/asc/isa/, \ + genx_scd_gen12lp_isa.cpp) + +MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/genx/copy_kernels/isa/, \ + genx_copy_kernel_gen12lp_isa.cpp) + +MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/genx/field_copy/isa/, \ + genx_fcopy_gen12lp_isa.cpp) + +MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/genx/mctf/isa/, \ + genx_me_gen12lp_isa.cpp \ + genx_mc_gen12lp_isa.cpp \ + genx_sd_gen12lp_isa.cpp) + +MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/mpeg2/src/, \ + mfx_mpeg2_encode_debug_hw.cpp \ + mfx_mpeg2_encode_full_hw.cpp \ + mfx_mpeg2_encode_hw.cpp \ + mfx_mpeg2_encode_utils_hw.cpp \ + mfx_mpeg2_encode_vaapi.cpp \ + mfx_mpeg2_encode_factory.cpp \ + mfx_mpeg2_enc_common_hw.cpp) + +MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/h264/src/, \ + mfx_h264_encode_cm.cpp) + +MFX_LIB_SHARED_FILES_1 := $(addprefix mfx_lib/shared/src/, \ + libmfxsw.cpp \ + libmfxsw_async.cpp \ + libmfxsw_decode.cpp \ + libmfxsw_decode_vp.cpp \ + libmfxsw_functions.cpp \ + libmfxsw_enc.cpp \ + libmfxsw_encode.cpp \ + libmfxsw_pak.cpp \ + libmfxsw_plugin.cpp \ + libmfxsw_query.cpp \ + libmfxsw_session.cpp \ + libmfxsw_vpp.cpp \ + mfx_session.cpp \ + mfx_critical_error_handler.cpp) + +MFX_LIB_SHARED_FILES_2 := $(addprefix shared/src/, \ + fast_copy.cpp \ + fast_copy_c_impl.cpp \ + fast_copy_sse4_impl.cpp \ + mfx_vpp_vaapi.cpp \ + mfx_vpp_helper.cpp \ + libmfx_allocator.cpp \ + libmfx_allocator_vaapi.cpp \ + libmfx_core.cpp \ + libmfx_core_hw.cpp \ + libmfx_core_factory.cpp \ + libmfx_core_vaapi.cpp \ + mfx_umc_alloc_wrapper.cpp \ + mfx_umc_mjpeg_vpp.cpp) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := \ + $(MFX_LOCAL_SRC_FILES) \ + $(MFX_LOCAL_SRC_FILES_HW) \ + $(MFX_SHARED_FILES_HW) + +LOCAL_C_INCLUDES := \ + $(MFX_LOCAL_INCLUDES_HW) \ + $(UMC_LOCAL_INCLUDES_HW) \ + $(MFX_INCLUDES_INTERNAL_HW) + +LOCAL_CPPFLAGS += -std=c++14 + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -Wno-error -Wno-unused-parameter -Wno-implicit-fallthrough + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libmfx_core_hw +LOCAL_SHARED_LIBRARIES := liblog libcutils + +include $(BUILD_STATIC_LIBRARY) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(MFX_LIB_SHARED_FILES_1) $(MFX_LIB_SHARED_FILES_2) + +LOCAL_C_INCLUDES := \ + $(MFX_LOCAL_INCLUDES_HW) \ + $(UMC_LOCAL_INCLUDES_HW) \ + $(MFX_INCLUDES_INTERNAL_HW) + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -Wno-error -Wno-unused-parameter -Wno-implicit-fallthrough + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS_HW) + +LOCAL_CPPFLAGS += -std=c++14 + +LOCAL_WHOLE_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW) +LOCAL_SHARED_LIBRARIES := libva liblog libcutils libdrm + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libmfx-gen + +include $(BUILD_SHARED_LIBRARY) diff --git a/_studio/mfx_lib/ext/mpeg2/include/mfx_mpeg2_encode_hw.h b/_studio/mfx_lib/ext/mpeg2/include/mfx_mpeg2_encode_hw.h index faa60ea9..2fc1abe8 100644 --- a/_studio/mfx_lib/ext/mpeg2/include/mfx_mpeg2_encode_hw.h +++ b/_studio/mfx_lib/ext/mpeg2/include/mfx_mpeg2_encode_hw.h @@ -187,7 +187,7 @@ class MFXVideoENCODEMPEG2_HW : public VideoENCODE }; -MFX_PROPAGATE_GetSurface_VideoENCODE_Impl(MFXVideoENCODEMPEG2_HW); + #endif // MFX_ENABLE_MPEG2_VIDEO_ENCODE #endif diff --git a/_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_hw.cpp b/_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_hw.cpp index 23d53b40..e1eaac0f 100644 --- a/_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_hw.cpp +++ b/_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_hw.cpp @@ -21,13 +21,13 @@ #include #include "mfx_common.h" - +#include "mfx_mpeg2_encode_hw.h" #if defined (MFX_ENABLE_MPEG2_VIDEO_ENCODE) #include "mfx_mpeg2_encode_utils_hw.h" - +MFX_PROPAGATE_GetSurface_VideoENCODE_Impl(MFXVideoENCODEMPEG2_HW); diff --git a/_studio/mfx_lib/shared/src/libmfxsw.cpp b/_studio/mfx_lib/shared/src/libmfxsw.cpp index 93d74430..d3cff5f4 100644 --- a/_studio/mfx_lib/shared/src/libmfxsw.cpp +++ b/_studio/mfx_lib/shared/src/libmfxsw.cpp @@ -31,7 +31,7 @@ #include #include #include -#include "va/va_drm.h" +#include "va/drm/va_drm.h" #include "mediasdk_version.h" #include "libmfx_core_factory.h" diff --git a/_studio/shared/Android.mk b/_studio/shared/Android.mk new file mode 100644 index 00000000..86c9b78c --- /dev/null +++ b/_studio/shared/Android.mk @@ -0,0 +1,3 @@ +# Recursively call sub-folder Android.mk + +include $(call all-subdir-makefiles) \ No newline at end of file diff --git a/_studio/shared/asc/Android.mk b/_studio/shared/asc/Android.mk new file mode 100644 index 00000000..03c8063a --- /dev/null +++ b/_studio/shared/asc/Android.mk @@ -0,0 +1,92 @@ +LOCAL_PATH:= $(call my-dir) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(addprefix src/, asc_avx2_impl.cpp) + +LOCAL_C_INCLUDES := \ + $(MFX_INCLUDES_INTERNAL_HW) \ + $(MFX_HOME)/_studio/mfx_lib/cmrt_cross_platform/include \ + $(MFX_HOME)/_studio/mfx_lib/ext/genx/asc/isa + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -mavx2 \ + -Wno-error \ + -Wno-unused-parameter + +LOCAL_CFLAGS += -I $(MFX_HOME)/_studio/shared/asc/include/ + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libmfx_asc_avx2 +include $(BUILD_STATIC_LIBRARY) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(addprefix src/, asc_sse4_impl.cpp) + +LOCAL_C_INCLUDES := \ + $(MFX_INCLUDES_INTERNAL_HW) \ + $(MFX_HOME)/_studio/mfx_lib/cmrt_cross_platform/include \ + $(MFX_HOME)/_studio/mfx_lib/ext/genx/asc/isa + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -msse4.1 \ + -Wno-error \ + -Wno-unused-parameter + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libmfx_asc_sse4 +include $(BUILD_STATIC_LIBRARY) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +ASC_SRC_FILES := $(addprefix src/, \ + asc.cpp \ + asc_c_impl.cpp \ + iofunctions.cpp \ + motion_estimation_engine.cpp \ + tree.cpp) + +LOCAL_SRC_FILES := $(ASC_SRC_FILES) + +LOCAL_C_INCLUDES := \ + $(MFX_INCLUDES_INTERNAL_HW) \ + $(MFX_HOME)/_studio/mfx_lib/cmrt_cross_platform/include \ + $(MFX_HOME)/_studio/mfx_lib/ext/genx/asc/isa + +LOCAL_STATIC_LIBRARIES := \ + libmfx_asc_avx2 \ + libmfx_asc_sse4 + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -msse4.1 \ + -Wno-error \ + -Wno-unused-parameter + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_WHOLE_STATIC_LIBRARIES := $(LOCAL_STATIC_LIBRARIES) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libmfx_asc + +include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/shared/include/mfx_config.h b/_studio/shared/include/mfx_config.h index 2bab8e13..fa35c62c 100644 --- a/_studio/shared/include/mfx_config.h +++ b/_studio/shared/include/mfx_config.h @@ -29,9 +29,15 @@ #define UMC_VA_LINUX -// mfx_features.h is auto-generated file containing mediasdk per-component -// enable defines -#include "mfx_features.h" +#if defined(ANDROID) + // we don't support config auto-generation on Android and have hardcoded + // definition instead + #include "mfx_android_defs.h" +#else + // mfxconfig.h is auto-generated file containing mediasdk per-component + // enable defines + #include "mfx_features.h" +#endif #define SYNCHRONIZATION_BY_VA_MAP_BUFFER #if !defined(SYNCHRONIZATION_BY_VA_SYNC_SURFACE) diff --git a/_studio/shared/mfx_logging/Android.mk b/_studio/shared/mfx_logging/Android.mk new file mode 100644 index 00000000..93f6fc38 --- /dev/null +++ b/_studio/shared/mfx_logging/Android.mk @@ -0,0 +1,24 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(addprefix src/, $(notdir $(wildcard $(LOCAL_PATH)/src/*.cpp))) + +LOCAL_C_INCLUDES := \ + $(MFX_INCLUDES_INTERNAL_HW) \ + $(MFX_HOME)/api/mediasdk_structures + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -Wno-error \ + -Wno-unused-parameter + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libmfx_logging + +include $(BUILD_STATIC_LIBRARY) + diff --git a/_studio/shared/mfx_trace/Android.mk b/_studio/shared/mfx_trace/Android.mk new file mode 100644 index 00000000..93c71ffd --- /dev/null +++ b/_studio/shared/mfx_trace/Android.mk @@ -0,0 +1,23 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(addprefix src/, $(notdir $(wildcard $(LOCAL_PATH)/src/*.cpp))) + +LOCAL_C_INCLUDES := \ + $(MFX_INCLUDES_INTERNAL_HW) \ + $(MFX_HOME)/api/mediasdk_structures + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -Wno-error \ + -Wno-unused-parameter + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libmfx_gen_trace + +include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/shared/src/libmfx_core_vaapi.cpp b/_studio/shared/src/libmfx_core_vaapi.cpp index fd5fc269..6c95c79f 100644 --- a/_studio/shared/src/libmfx_core_vaapi.cpp +++ b/_studio/shared/src/libmfx_core_vaapi.cpp @@ -44,7 +44,7 @@ #include "va/va.h" #include -#include "va/va_drm.h" +#include "va/drm/va_drm.h" #include #include diff --git a/_studio/shared/umc/Android.mk b/_studio/shared/umc/Android.mk new file mode 100644 index 00000000..86c9b78c --- /dev/null +++ b/_studio/shared/umc/Android.mk @@ -0,0 +1,3 @@ +# Recursively call sub-folder Android.mk + +include $(call all-subdir-makefiles) \ No newline at end of file diff --git a/_studio/shared/umc/codec/Android.mk b/_studio/shared/umc/codec/Android.mk new file mode 100644 index 00000000..7e4cf270 --- /dev/null +++ b/_studio/shared/umc/codec/Android.mk @@ -0,0 +1,83 @@ +LOCAL_PATH:= $(call my-dir) + +# Setting subdirectories to march thru +MFX_CODEC_LOCAL_DIRS := \ + vc1_common \ + jpeg_common \ + color_space_converter \ + mpeg2_dec \ + h265_dec \ + h264_dec \ + vc1_dec \ + jpeg_dec \ + vp9_dec \ + av1_dec + +MFX_CODEC_LOCAL_SRC_FILES := \ + $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_CODEC_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp))) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := \ + brc/src/umc_brc.cpp \ + brc/src/umc_h264_brc.cpp \ + brc/src/umc_mpeg2_brc.cpp \ + brc/src/umc_video_brc.cpp + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/brc/include \ + $(MFX_INCLUDES_INTERNAL_HW) + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -Wno-error \ + -Wno-unused-parameter \ + -Wno-deprecated-declarations + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_SHARED_LIBRARIES := liblog libcutils + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libumc_brc + +include $(BUILD_STATIC_LIBRARY) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(MFX_CODEC_LOCAL_SRC_FILES) + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/av1_dec/include \ + $(LOCAL_PATH)/color_space_converter/include \ + $(LOCAL_PATH)/h264_dec/include \ + $(LOCAL_PATH)/h265_dec/include \ + $(LOCAL_PATH)/jpeg_common/include \ + $(LOCAL_PATH)/jpeg_dec/include \ + $(LOCAL_PATH)/mpeg2_dec/include \ + $(LOCAL_PATH)/vc1_common/include \ + $(LOCAL_PATH)/vc1_dec/include \ + $(LOCAL_PATH)/vp9_dec/include \ + $(MFX_INCLUDES_INTERNAL_HW) + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -Wno-error \ + -Wno-unused-parameter + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_SHARED_LIBRARIES := liblog libcutils + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libumc_codecs_hw + +include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/shared/umc/core/Android.mk b/_studio/shared/umc/core/Android.mk new file mode 100644 index 00000000..aedbfe82 --- /dev/null +++ b/_studio/shared/umc/core/Android.mk @@ -0,0 +1,40 @@ +LOCAL_PATH:= $(call my-dir) + +# Setting subdirectories to march thru +MFX_LOCAL_DIRS := \ + vm \ + vm_plus \ + umc + +MFX_LOCAL_SRC_FILES := \ + $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.c))) \ + $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp))) + +MFX_LOCAL_INCLUDES := \ + $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/include)) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES) + +LOCAL_C_INCLUDES := \ + $(MFX_LOCAL_INCLUDES) \ + $(MFX_INCLUDES_INTERNAL_HW) + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -Wno-error \ + -Wno-unused-parameter + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_STATIC_LIBRARIES += libmfx_logging + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libumc_core_hw + +include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/shared/umc/io/Android.mk b/_studio/shared/umc/io/Android.mk new file mode 100644 index 00000000..0baf70d8 --- /dev/null +++ b/_studio/shared/umc/io/Android.mk @@ -0,0 +1,35 @@ +LOCAL_PATH:= $(call my-dir) + +MFX_LOCAL_DIRS_HW := \ + umc_va + +MFX_LOCAL_SRC_FILES_HW := \ + $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp))) + +MFX_LOCAL_INCLUDES_HW := \ + $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/$(dir)/include)) + +# ============================================================================= + +include $(CLEAR_VARS) +include $(MFX_HOME)/android/mfx_defs.mk + +LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES_HW) + +LOCAL_C_INCLUDES := \ + $(MFX_LOCAL_INCLUDES_HW) \ + $(MFX_INCLUDES_INTERNAL_HW) + +LOCAL_CFLAGS := \ + $(MFX_CFLAGS_INTERNAL_HW) \ + -Wno-error \ + -Wno-unused-parameter \ + -Wno-implicit-fallthrough + +LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) +LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := libumc_va + +include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/android/Android.bp b/android/Android.bp new file mode 100644 index 00000000..746bac2f --- /dev/null +++ b/android/Android.bp @@ -0,0 +1,10 @@ + +cc_library_headers { + + name: "libmfx_android_headers", + export_include_dirs: [ + "include", + ], + + vendor: true, +} \ No newline at end of file diff --git a/android/Android.mk b/android/Android.mk new file mode 100644 index 00000000..579d3285 --- /dev/null +++ b/android/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libmfx_gen_headers +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(MFX_HOME)/api/vpl \ + $(MFX_HOME)/api/vpl/private \ + $(MFX_HOME)/api/mediasdk_structures \ + $(MFX_HOME)/android/include + +include $(BUILD_HEADER_LIBRARY) \ No newline at end of file diff --git a/android/include/mfx_android_config.h b/android/include/mfx_android_config.h new file mode 100644 index 00000000..1ee3135b --- /dev/null +++ b/android/include/mfx_android_config.h @@ -0,0 +1,24 @@ +/******************************************************************************** + +INTEL CORPORATION PROPRIETARY INFORMATION +This software is supplied under the terms of a license agreement or nondisclosure +agreement with Intel Corporation and may not be copied or disclosed except in +accordance with the terms of that agreement +Copyright(c) 2011-2018 Intel Corporation. All Rights Reserved. + +*********************************************************************************/ + +#ifndef __MFX_CONFIG_H__ +#define __MFX_CONFIG_H__ + +/* Google versions of Android */ +#define MFX_O 0x06 +#define MFX_O_MR1 0x07 +#define MFX_P 0x08 +#define MFX_Q 0x09 +#define MFX_R 0x0a +#define MFX_S 0x0b +#define MFX_T 0x0c +#define MFX_U 0x0d + +#endif // #ifndef __MFX_CONFIG_H__ diff --git a/android/include/mfx_android_defs.h b/android/include/mfx_android_defs.h new file mode 100644 index 00000000..7052485a --- /dev/null +++ b/android/include/mfx_android_defs.h @@ -0,0 +1,57 @@ +// Copyright (c) 2017-2018 Intel Corporation +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#ifndef __MFX_ANDROID_DEFS_H__ +#define __MFX_ANDROID_DEFS_H__ + + #define MFX_ENABLE_ASC + #define MFX_ENABLE_CPLIB + + #define MFX_ENABLE_VPP + + #define MFX_ENABLE_VC1_VIDEO_DECODE + + #define MFX_ENABLE_H265_VIDEO_DECODE + #define MFX_ENABLE_H265_VIDEO_ENCODE + + #define MFX_ENABLE_H264_VIDEO_DECODE + #define MFX_ENABLE_H264_VIDEO_ENCODE + + #define MFX_ENABLE_MJPEG_VIDEO_DECODE + #define MFX_ENABLE_MJPEG_VIDEO_ENCODE + + #define MFX_ENABLE_MPEG2_VIDEO_ENCODE + #define MFX_ENABLE_MPEG2_VIDEO_DECODE + + #define MFX_ENABLE_VP8_VIDEO_DECODE + + #define MFX_ENABLE_VP9_VIDEO_DECODE + #define MFX_ENABLE_VP9_VIDEO_ENCODE + + #define MFX_ENABLE_AV1_VIDEO_DECODE + #define MFX_ENABLE_AV1_VIDEO_ENCODE + + #define MFX_ENABLE_EXT + +#if MFX_ANDROID_VERSION >= MFX_P + #define MFX_ENABLE_KERNELS +#endif + +#endif // #ifndef __MFX_ANDROID_DEFS_H__ diff --git a/android/mfx_defs.mk b/android/mfx_defs.mk new file mode 100644 index 00000000..bf103599 --- /dev/null +++ b/android/mfx_defs.mk @@ -0,0 +1,115 @@ +# Purpose: +# Defines include paths, compilation flags, etc. to build Media SDK targets. +# +# Defined variables: +# MFX_CFLAGS - common flags for all targets +# MFX_CFLAGS_LIBVA - LibVA support flags (to build apps with or without LibVA support) +# MFX_INCLUDES - common include paths for all targets +# libva_headers - include paths to LibVA headers +# MFX_LDFLAGS - common link flags for all targets + +# ============================================================================= +# Common definitions + +MFX_CFLAGS := -DANDROID + +#Media Version +MEDIA_VERSION := 24.1.5 +MEDIA_VERSION_EXTRA := "" +MEDIA_VERSION_ALL := $(MEDIA_VERSION).pre$(MEDIA_VERSION_EXTRA) + +MFX_CFLAGS += -DMEDIA_VERSION_STR=\"\\\"${MEDIA_VERSION}\\\"\" +MFX_CFLAGS += -DONEVPL_EXPERIMENTAL + +# Android version preference: +ifneq ($(filter 14 14.% U% ,$(PLATFORM_VERSION)),) + MFX_ANDROID_VERSION:= MFX_U +endif +ifneq ($(filter 13 13.% T% ,$(PLATFORM_VERSION)),) + MFX_ANDROID_VERSION:= MFX_T +endif +ifneq ($(filter 12 12.% S ,$(PLATFORM_VERSION)),) + MFX_ANDROID_VERSION:= MFX_S +endif +ifneq ($(filter 11 11.% R ,$(PLATFORM_VERSION)),) + MFX_ANDROID_VERSION:= MFX_R +endif +ifneq ($(filter 10 10.% Q ,$(PLATFORM_VERSION)),) + MFX_ANDROID_VERSION:= MFX_Q +endif +ifneq ($(filter 9 9.% P ,$(PLATFORM_VERSION)),) + MFX_ANDROID_VERSION:= MFX_P +endif +ifneq ($(filter 8.% O ,$(PLATFORM_VERSION)),) + ifneq ($(filter 8.0.%,$(PLATFORM_VERSION)),) + MFX_ANDROID_VERSION:= MFX_O + else + MFX_ANDROID_VERSION:= MFX_O_MR1 + endif +endif + +# Passing Android-dependency information to the code +MFX_CFLAGS += \ + -DMFX_ANDROID_VERSION=$(MFX_ANDROID_VERSION) \ + -include mfx_android_config.h + +MFX_CFLAGS += \ + -DMFX_VERSION=2009 + +MFX_CFLAGS += \ + -DMFX_FILE_VERSION=\"`echo $(MFX_VERSION) | cut -f 1 -d.``date +.%-y.%-m.%-d`\" \ + -DMFX_PRODUCT_VERSION=\"$(MFX_VERSION)\" + +# Security +MFX_CFLAGS += \ + -fstack-protector \ + -fPIE -fPIC -pie \ + -O2 -D_FORTIFY_SOURCE=2 \ + -Wformat -Wformat-security \ + -fexceptions -frtti -msse4.1 \ + -Wno-non-virtual-dtor \ + -Wunused-command-line-argument \ + -mavx2 + +# Enable feature with output decoded frames without latency regarding +# SPS.VUI.max_num_reorder_frames +ifeq ($(ENABLE_MAX_NUM_REORDER_FRAMES_OUTPUT),) + ENABLE_MAX_NUM_REORDER_FRAMES_OUTPUT:= true +endif + +ifeq ($(ENABLE_MAX_NUM_REORDER_FRAMES_OUTPUT),true) + MFX_CFLAGS += -DENABLE_MAX_NUM_REORDER_FRAMES_OUTPUT +endif + +# LibVA support. +MFX_CFLAGS_LIBVA := -DLIBVA_SUPPORT -DLIBVA_ANDROID_SUPPORT + +ifneq ($(filter $(MFX_ANDROID_VERSION), MFX_O),) + MFX_CFLAGS_LIBVA += -DANDROID_O +endif + +# Setting usual paths to include files +MFX_INCLUDES := $(LOCAL_PATH)/include + +LOCAL_HEADER_LIBRARIES := libmfx_gen_headers libva_headers + +# Setting usual link flags +MFX_LDFLAGS := \ + -z noexecstack \ + -z relro -z now + +# Setting vendor +LOCAL_MODULE_OWNER := intel + +# Moving executables to proprietary location +LOCAL_PROPRIETARY_MODULE := true + +LOCAL_CPPFLAGS := -Wno-deprecated-declarations \ + -Wno-missing-field-initializers \ + -Wno-implicit-fallthrough + + +# ============================================================================= + +# Definitions specific to Media SDK internal things (do not apply for samples) +include $(MFX_HOME)/android/mfx_defs_internal.mk diff --git a/android/mfx_defs_internal.mk b/android/mfx_defs_internal.mk new file mode 100644 index 00000000..334d2cbb --- /dev/null +++ b/android/mfx_defs_internal.mk @@ -0,0 +1,51 @@ +# Purpose: +# Defines include paths, compilation flags, etc. to build Media SDK +# internal targets (libraries, test applications, etc.). +# +# Defined variables: +# MFX_CFLAGS_INTERNAL - all flags needed to build MFX targets +# MFX_CFLAGS_INTERNAL_HW - all flags needed to build MFX HW targets +# MFX_INCLUDES_INTERNAL - all include paths needed to build MFX targets +# MFX_INCLUDES_INTERNAL_HW - all include paths needed to build MFX HW targets + +MFX_CFLAGS_INTERNAL := $(MFX_CFLAGS) +MFX_CFLAGS_INTERNAL_HW := \ + $(MFX_CFLAGS_INTERNAL) \ + -DMFX_VA \ + -DMFX_ONEVPL \ + -DMFX_VERSION_USE_LATEST \ + -DMFX_DEPRECATED_OFF \ + -DONEVPL_EXPERIMENTAL \ + -DSYNCHRONIZATION_BY_VA_SYNC_SURFACE \ + -D_FILE_OFFSET_BITS=64 \ + -D__USE_LARGEFILE64 \ + -DMFX_GIT_COMMIT=\"c6573984\" \ + -DMFX_API_VERSION=\"2.9+\" \ + -DNDEBUG \ + -DMSDK_BUILD=\"\" + +MFX_CFLAGS_INTERNAL_32 := -DLINUX32 +MFX_CFLAGS_INTERNAL_64 := -DLINUX32 -DLINUX64 + +MFX_INCLUDES_INTERNAL := \ + $(MFX_INCLUDES) \ + $(MFX_HOME)/_studio/shared/include \ + $(MFX_HOME)/_studio/shared/umc/codec/av1_dec/include \ + $(MFX_HOME)/_studio/shared/umc/codec/h265_dec/include \ + $(MFX_HOME)/_studio/shared/umc/codec/h264_dec/include \ + $(MFX_HOME)/_studio/shared/umc/codec/vp9_dec/include \ + $(MFX_HOME)/_studio/shared/umc/core/umc/include \ + $(MFX_HOME)/_studio/shared/umc/core/vm/include \ + $(MFX_HOME)/_studio/shared/umc/core/vm_plus/include \ + $(MFX_HOME)/_studio/shared/umc/io/umc_va/include \ + $(MFX_HOME)/_studio/shared/mfx_logging/include \ + $(MFX_HOME)/_studio/shared/mfx_trace/include \ + $(MFX_HOME)/_studio/shared/mfx_trace/include/sys \ + $(MFX_HOME)/_studio/mfx_lib/shared/include \ + $(MFX_HOME)/_studio/shared/include \ + $(MFX_HOME)/_studio/enctools/aenc/include \ + $(MFX_HOME)/_studio/enctools/include \ + $(MFX_HOME)/contrib/ipp/include + +MFX_INCLUDES_INTERNAL_HW := \ + $(MFX_INCLUDES_INTERNAL) \ From eeadd67acc565ee40a6e07fe85c3e67c40721bf3 Mon Sep 17 00:00:00 2001 From: sjshweta Date: Wed, 8 May 2024 12:56:00 +0530 Subject: [PATCH 4/5] Added github workflows for CI --- .github/ISSUE_TEMPLATE/1-bug.yml | 83 ------ .github/ISSUE_TEMPLATE/2-feature.yml | 46 ---- .github/workflows/run_ci_checks.yaml | 15 ++ .github/workflows/ubuntu.yml | 363 --------------------------- 4 files changed, 15 insertions(+), 492 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/1-bug.yml delete mode 100644 .github/ISSUE_TEMPLATE/2-feature.yml create mode 100644 .github/workflows/run_ci_checks.yaml delete mode 100644 .github/workflows/ubuntu.yml diff --git a/.github/ISSUE_TEMPLATE/1-bug.yml b/.github/ISSUE_TEMPLATE/1-bug.yml deleted file mode 100644 index d3e19d8a..00000000 --- a/.github/ISSUE_TEMPLATE/1-bug.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Bug Issue -description: Use template to submit a Bug -title: "[Bug]: " -assignees: - - yefeizhou -body: -- type: dropdown - id: component - attributes: - label: Which component impacted? - multiple: true - options: - - Decode - - Encode - - Video Processing - - Build - - Not sure -- type: dropdown - id: regression - attributes: - label: Is it regression? Good in old configuration? - multiple: false - options: - - Yes, it's good in old version - - No, this issue exist a long time -- type: textarea - attributes: - label: What happened? - description: | - Please provide reproduce steps and sample cmdline if possible which help us to debug it. - If it's regression, please provide good/bad commit/configuration. - placeholder: | - 1. In Linux or Windows or Browser or Applications... - 2. With libva/libva-utils/gmmlib/media-driver version... - 3. Run '...' - 4. See error... - validations: - required: true -- type: dropdown - id: usage - attributes: - label: What's the usage scenario when you are seeing the problem? - multiple: true - options: - - Transcode for media delivery - - Playback - - Web browser - - Cloud Gaming - - Video Analytics - - Video Conference - - Immersive Media - - Content Creation - - Game Streaming - - Others - validations: - required: true -- type: textarea - attributes: - label: What impacted? - description: Any program or milestone would be impacted if issue yet resolved? Please provide the information as detail as possible to help us understand and prioritize the issues. - placeholder: If you select "Others" for above usage, please describe your usage scenario here to help us understand the impact. - validations: - required: false -- type: textarea - attributes: - label: Debug Information - description: | - Please provide debug information as detail as possible to accelerate issue resolved. - 1. What's libva/libva-utils/gmmlib/media-driver version? - 2. Could you confirm whether GPU hardware exist or not by `ls /dev/dri`? - 3. Could you provide vainfo log by `vainfo >vainfo.log 2>&1`? - 4. Could you provide libva trace log? Run cmd `export LIBVA_TRACE=/tmp/libva_trace.log` first then execute the case. - 5. Could you attach dmesg log if GPU hang by `dmesg >dmesg.log 2>&1`? - validations: - required: false -- type: dropdown - id: contribute - attributes: - label: Do you want to contribute a patch to fix the issue? - multiple: false - options: - - Yes, I'm glad to submit a patch to fix it - - No. diff --git a/.github/ISSUE_TEMPLATE/2-feature.yml b/.github/ISSUE_TEMPLATE/2-feature.yml deleted file mode 100644 index 9812490e..00000000 --- a/.github/ISSUE_TEMPLATE/2-feature.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Feature Request -description: Use template to request a new feature -title: "[Feature]: " -labels: ["Feature Request"] -assignees: - - yefeizhou -body: -- type: textarea - attributes: - label: What Feature? - description: Please describe what feature you request and more background why you need this feature. - validations: - required: true -- type: dropdown - id: usage - attributes: - label: What's the usage scenario would be benifited? - multiple: true - options: - - Transcode for media delivery - - Playback - - Web browser - - Cloud Gaming - - Video Analytics - - Video Conference - - Immersive Media - - Content Creation - - Game Streaming - - Others - validations: - required: true -- type: textarea - attributes: - label: What impacted? - description: Any program or milestone would be benifited once the feature is enabled. Please provide the information as detail as possible to help us understand and prioritize the feature request. - placeholder: If you select "Others" for above usage, please describe your usage scenario here to help us understand the impact. - validations: - required: false -- type: dropdown - id: contribute - attributes: - label: Do you want to contribute a patch to develop this feature? - multiple: false - options: - - Yes, I'm glad to submit a patch for it - - No. \ No newline at end of file diff --git a/.github/workflows/run_ci_checks.yaml b/.github/workflows/run_ci_checks.yaml new file mode 100644 index 00000000..30c59f16 --- /dev/null +++ b/.github/workflows/run_ci_checks.yaml @@ -0,0 +1,15 @@ +--- +name: Run CI checks +on: + pull_request: + types: "**" + branches: "**" + pull_request_review: + types: "**" + branches: "**" +permissions: read-all +jobs: + TriggerWorkfows: + uses: projectceladon/celadonworkflows/.github/workflows/trigger_ci.yml@v1.0 + with: + EVENT: ${{ toJSON(github.event) }} \ No newline at end of file diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 7191349a..00000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,363 +0,0 @@ -name: ci - -on: [ push, pull_request ] - -env: - CFLAGS: -O2 -Wformat -Wformat-security -Wall -Werror -D_FORTIFY_SOURCE=2 -fstack-protector-strong - LDFLAGS: -Wl,--as-needed - -jobs: - clang14: - runs-on: ubuntu-22.04 - env: - CC: /usr/bin/clang-14 - CXX: /usr/bin/clang++-14 - ASM: /usr/bin/clang-14 - steps: - - name: checkout libmfxgen - uses: actions/checkout@v2 - with: - path: libmfxgen - - name: checkout libva - uses: actions/checkout@v2 - with: - repository: intel/libva - path: libva - - name: install toolchain - run: | - if [[ -e $CC && -e $CXX ]]; then \ - echo "clang-14 already presents in the image"; \ - else \ - echo "clang-14 missed in the image, installing from llvm"; \ - echo "deb [trusted=yes] https://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main" | sudo tee -a /etc/apt/sources.list; \ - sudo apt-get update; \ - sudo apt-get install -y --no-install-recommends clang-14; \ - fi - - name: install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - cmake \ - libdrm-dev \ - libegl1-mesa-dev \ - libgl1-mesa-dev \ - libx11-dev \ - libx11-xcb-dev \ - libxcb-dri3-dev \ - libxcb-present-dev \ - libxext-dev \ - libxfixes-dev \ - libwayland-dev \ - ninja-build \ - make - - name: print tools versions - run: | - cmake --version - $CC --version - $CXX --version - - name: build libva - run: | - cd libva - ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu - make -j$(nproc) - sudo make install - - name: build libmfxgen - run: | - cd libmfxgen - mkdir build && cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DMFX_ENABLE_PXP=ON -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" -DCMAKE_CXX_FLAGS_RELEASE="$CFLAGS" .. - ninja - sudo ninja install - - clang14-enctools-full: - runs-on: ubuntu-22.04 - env: - CC: /usr/bin/clang-14 - CXX: /usr/bin/clang++-14 - ASM: /usr/bin/clang-14 - steps: - - name: checkout libmfxgen - uses: actions/checkout@v2 - with: - path: libmfxgen - - name: checkout libva - uses: actions/checkout@v2 - with: - repository: intel/libva - path: libva - - name: install toolchain - run: | - if [[ -e $CC && -e $CXX ]]; then \ - echo "clang-14 already presents in the image"; \ - else \ - echo "clang-14 missed in the image, installing from llvm"; \ - echo "deb [trusted=yes] https://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main" | sudo tee -a /etc/apt/sources.list; \ - sudo apt-get update; \ - sudo apt-get install -y --no-install-recommends clang-14; \ - fi - - name: install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - cmake \ - libdrm-dev \ - libegl1-mesa-dev \ - libgl1-mesa-dev \ - libx11-dev \ - libx11-xcb-dev \ - libxcb-dri3-dev \ - libxcb-present-dev \ - libxext-dev \ - libxfixes-dev \ - libwayland-dev \ - ninja-build \ - make - - name: print tools versions - run: | - cmake --version - $CC --version - $CXX --version - - name: build libva - run: | - cd libva - ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu - make -j$(nproc) - sudo make install - - name: build libmfxgen - run: | - cd libmfxgen - mkdir build && cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" -DCMAKE_CXX_FLAGS_RELEASE="$CFLAGS" \ - -DMFX_ENABLE_USER_ENCTOOLS=ON -DMFX_ENABLE_AENC=ON -DMFX_ENABLE_PXP=ON \ - .. - ninja - sudo ninja install - - clang14-enctools-noaenc: - runs-on: ubuntu-22.04 - env: - CC: /usr/bin/clang-14 - CXX: /usr/bin/clang++-14 - ASM: /usr/bin/clang-14 - steps: - - name: checkout libmfxgen - uses: actions/checkout@v2 - with: - path: libmfxgen - - name: checkout libva - uses: actions/checkout@v2 - with: - repository: intel/libva - path: libva - - name: install toolchain - run: | - if [[ -e $CC && -e $CXX ]]; then \ - echo "clang-14 already presents in the image"; \ - else \ - echo "clang-14 missed in the image, installing from llvm"; \ - echo "deb [trusted=yes] https://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main" | sudo tee -a /etc/apt/sources.list; \ - sudo apt-get update; \ - sudo apt-get install -y --no-install-recommends clang-14; \ - fi - - name: install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - cmake \ - libdrm-dev \ - libegl1-mesa-dev \ - libgl1-mesa-dev \ - libx11-dev \ - libx11-xcb-dev \ - libxcb-dri3-dev \ - libxcb-present-dev \ - libxext-dev \ - libxfixes-dev \ - libwayland-dev \ - ninja-build \ - make - - name: print tools versions - run: | - cmake --version - $CC --version - $CXX --version - - name: build libva - run: | - cd libva - ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu - make -j$(nproc) - sudo make install - - name: build libmfxgen - run: | - cd libmfxgen - mkdir build && cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" -DCMAKE_CXX_FLAGS_RELEASE="$CFLAGS" \ - -DMFX_ENABLE_USER_ENCTOOLS=ON -DMFX_ENABLE_AENC=OFF -DMFX_ENABLE_PXP=ON \ - .. - ninja - sudo ninja install - - clang12: - runs-on: ubuntu-20.04 - env: - CC: /usr/bin/clang-12 - CXX: /usr/bin/clang++-12 - ASM: /usr/bin/clang-12 - steps: - - name: checkout libmfxgen - uses: actions/checkout@v2 - with: - path: libmfxgen - - name: checkout libva - uses: actions/checkout@v2 - with: - repository: intel/libva - path: libva - - name: install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - cmake \ - libdrm-dev \ - libegl1-mesa-dev \ - libgl1-mesa-dev \ - libx11-dev \ - libx11-xcb-dev \ - libxcb-dri3-dev \ - libxcb-present-dev \ - libxext-dev \ - libxfixes-dev \ - libwayland-dev \ - ninja-build \ - make - - name: print tools versions - run: | - cmake --version - $CC --version - $CXX --version - - name: build libva - run: | - cd libva - ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu - make -j$(nproc) - sudo make install - - name: build libmfxgen - run: | - cd libmfxgen - mkdir build && cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DMFX_ENABLE_PXP=ON -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" -DCMAKE_CXX_FLAGS_RELEASE="$CFLAGS" .. - ninja - sudo ninja install - - gcc11: - runs-on: ubuntu-22.04 - env: - CC: /usr/bin/gcc-11 - CXX: /usr/bin/g++-11 - ASM: /usr/bin/gcc-11 - # TODO: mind no -Werror - # We stepped into https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366 - # gcc-11 throws -Wstringop-overflow on some std:: operations - CFLAGS: -O2 -Wformat -Wformat-security -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong - steps: - - name: checkout libmfxgen - uses: actions/checkout@v2 - with: - path: libmfxgen - - name: checkout libva - uses: actions/checkout@v2 - with: - repository: intel/libva - path: libva - - name: install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - automake \ - cmake \ - gcc \ - g++ \ - libtool \ - libdrm-dev \ - libegl1-mesa-dev \ - libgl1-mesa-dev \ - libx11-dev \ - libx11-xcb-dev \ - libxcb-dri3-dev \ - libxcb-present-dev \ - libxext-dev \ - libxfixes-dev \ - libwayland-dev \ - ninja-build \ - pkg-config \ - make - - name: print tools versions - run: | - cmake --version - $CC --version - $CXX --version - - name: build libva - run: | - cd libva - ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu - make -j$(nproc) - sudo make install - - name: build libmfxgen - run: | - cd libmfxgen - mkdir build && cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DMFX_ENABLE_PXP=ON -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" -DCMAKE_CXX_FLAGS_RELEASE="$CFLAGS" .. - ninja - sudo ninja install - - gcc10: - runs-on: ubuntu-20.04 - env: - CC: /usr/bin/gcc-10 - CXX: /usr/bin/g++-10 - ASM: /usr/bin/gcc-10 - steps: - - name: checkout libmfxgen - uses: actions/checkout@v2 - with: - path: libmfxgen - - name: checkout libva - uses: actions/checkout@v2 - with: - repository: intel/libva - path: libva - - name: install prerequisites - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - cmake \ - libdrm-dev \ - libegl1-mesa-dev \ - libgl1-mesa-dev \ - libx11-dev \ - libx11-xcb-dev \ - libxcb-dri3-dev \ - libxcb-present-dev \ - libxext-dev \ - libxfixes-dev \ - libwayland-dev \ - ninja-build \ - make - - name: print tools versions - run: | - cmake --version - $CC --version - $CXX --version - - name: build libva - run: | - cd libva - ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu - make -j$(nproc) - sudo make install - - name: build libmfxgen - run: | - cd libmfxgen - mkdir build && cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DMFX_ENABLE_PXP=ON -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" -DCMAKE_CXX_FLAGS_RELEASE="$CFLAGS" .. - ninja - sudo ninja install From 942b9207ef2ddf73bfdc42469227d5c621101e9e Mon Sep 17 00:00:00 2001 From: "zhepeng.xu" Date: Wed, 15 May 2024 23:41:31 +0800 Subject: [PATCH 5/5] Convert cmake to Andorid.bp using Python script Convert cmake into an android.bp file using Python conversion scripts to assist with future upgrades of onevpl runtime Test Done: run following commands to build Onevpl GPU Runtime: -cd onevpl-gpu -mkdir build && cd build -cmake .. -make Generate bp file -cd scripts && python vplruntimegenerator.py Tracked-On:OAM-118713 Signed-off-by: zhepeng.xu --- Android.bp | 91 +++++++ Android.mk | 4 - _studio/Android.mk | 3 - _studio/enctools/aenc/Android.mk | 26 -- _studio/mfx_lib/Android.mk | 343 -------------------------- _studio/shared/Android.mk | 3 - _studio/shared/asc/Android.mk | 92 ------- _studio/shared/mfx_logging/Android.mk | 24 -- _studio/shared/mfx_trace/Android.mk | 23 -- _studio/shared/umc/Android.mk | 3 - _studio/shared/umc/codec/Android.mk | 83 ------- _studio/shared/umc/core/Android.mk | 40 --- _studio/shared/umc/io/Android.mk | 35 --- asc.bp | 91 +++++++ bp/defaults.tpl | 49 ++++ bp/onevpl-runtime.tpl | 77 ++++++ decode_hw.bp | 197 +++++++++++++++ encode_hw.bp | 194 +++++++++++++++ libumc_codecs.bp | 70 ++++++ mfx_common_hw.bp | 99 ++++++++ mfx_ext.bp | 102 ++++++++ mfx_logging.bp | 77 ++++++ mfx_trace.bp | 78 ++++++ scripts/androidbpgenerator.py | 312 +++++++++++++++++++++++ scripts/cleanvplruntimegenerator.py | 50 ++++ scripts/vplruntimegenerator.py | 175 +++++++++++++ umc_va_hw.bp | 68 +++++ vpp.bp | 98 ++++++++ 28 files changed, 1828 insertions(+), 679 deletions(-) create mode 100644 Android.bp delete mode 100644 Android.mk delete mode 100644 _studio/Android.mk delete mode 100644 _studio/enctools/aenc/Android.mk delete mode 100644 _studio/mfx_lib/Android.mk delete mode 100644 _studio/shared/Android.mk delete mode 100644 _studio/shared/asc/Android.mk delete mode 100644 _studio/shared/mfx_logging/Android.mk delete mode 100644 _studio/shared/mfx_trace/Android.mk delete mode 100644 _studio/shared/umc/Android.mk delete mode 100644 _studio/shared/umc/codec/Android.mk delete mode 100644 _studio/shared/umc/core/Android.mk delete mode 100644 _studio/shared/umc/io/Android.mk create mode 100644 asc.bp create mode 100644 bp/defaults.tpl create mode 100644 bp/onevpl-runtime.tpl create mode 100644 decode_hw.bp create mode 100644 encode_hw.bp create mode 100644 libumc_codecs.bp create mode 100644 mfx_common_hw.bp create mode 100644 mfx_ext.bp create mode 100644 mfx_logging.bp create mode 100644 mfx_trace.bp create mode 100755 scripts/androidbpgenerator.py create mode 100755 scripts/cleanvplruntimegenerator.py create mode 100755 scripts/vplruntimegenerator.py create mode 100644 umc_va_hw.bp create mode 100644 vpp.bp diff --git a/Android.bp b/Android.bp new file mode 100644 index 00000000..a49fa245 --- /dev/null +++ b/Android.bp @@ -0,0 +1,91 @@ +cc_defaults { + name: "vpl-runtime-defaults", + + vendor: true, + + cflags: [ + "-Wno-non-virtual-dtor", + "-fexceptions", + "-msse4.1", + "-fstack-protector", + "-fPIE", + "-fPIC", + "-pie", + "-O2", + "-D_FORTIFY_SOURCE=2", + "-Wformat", + "-Wformat-security", + "-fexceptions", + "-frtti", + "-Wno-unused-command-line-argument", + "-mavx2", + "-fexceptions", + "-Wall", + "-Werror", + "-Wextra", + "-Wno-unused-parameter", + "-Wno-macro-redefined", + "-Wno-unused-parameter", + ], + rtti: true, + cppflags: [ + "-Wno-error", + "-fexceptions", + "-msse4.2", + "-mavx2", + "-D__AVX2__", + "-mretpoline", + "-Wshorten-64-to-32", + "-Wno-extern-c-compat", + "-Wno-instantiation-after-specialization", + "-DSANITIZER_BUILD", + "-Wno-deprecated-register", + "-Wno-deprecated-copy", + "-Wno-deprecated-declarations", + "-Wno-missing-field-initializers", + "-Wno-implicit-fallthrough", + "-DMFX_ONEVPL", + "-DMFX_VA", + "-DMFX_VERSION_USE_LATEST", + "-DMFX_DEPRECATED_OFF", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + "-DMFX_GIT_COMMIT=c6573984", + "-DMFX_API_VERSION=2.10", + "-DNDEBUG", + "-DMSDK_BUILD=", + "-Wno-unused-command-line-argument", + "-frtti", + ], + include_dirs: [ + "hardware/intel/external/libva", + "vendor/intel/external/onevpl-intel-gpu/android/include/", + ], + shared_libs: [ + "libgmm_umd", + "libva", + "libcutils", + "libdrm", + ], + + static_libs: [ + + ], + +} + + +build = [ + "mfx_logging.bp", + "mfx_trace.bp", + "asc.bp", + "umc_va_hw.bp", + "libumc_codecs.bp", + "vpp.bp", + "mfx_common_hw.bp", + "mfx_ext.bp", + "encode_hw.bp", + "decode_hw.bp", +] \ No newline at end of file diff --git a/Android.mk b/Android.mk deleted file mode 100644 index bfaab8be..00000000 --- a/Android.mk +++ /dev/null @@ -1,4 +0,0 @@ -MFX_HOME:= $(call my-dir) - -# Recursively call sub-folder Android.mk -include $(call all-subdir-makefiles) diff --git a/_studio/Android.mk b/_studio/Android.mk deleted file mode 100644 index 86c9b78c..00000000 --- a/_studio/Android.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Recursively call sub-folder Android.mk - -include $(call all-subdir-makefiles) \ No newline at end of file diff --git a/_studio/enctools/aenc/Android.mk b/_studio/enctools/aenc/Android.mk deleted file mode 100644 index 0642b0dc..00000000 --- a/_studio/enctools/aenc/Android.mk +++ /dev/null @@ -1,26 +0,0 @@ -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(addprefix src/, aenc.cpp \ - hevc_asc_apq_tree.cpp \ - av1_asc_agop_tree.cpp \ - av1_asc_tree.cpp \ - hevc_asc_agop_tree.cpp \ - av1_asc.cpp) - -LOCAL_C_INCLUDES := \ - $(MFX_INCLUDES_INTERNAL_HW) \ - $(MFX_HOME)/_studio/enctools/aenc/include/ - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -mavx2 \ - -Wno-error \ - -Wno-unused-parameter - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx_aenc -include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/mfx_lib/Android.mk b/_studio/mfx_lib/Android.mk deleted file mode 100644 index 74faa19d..00000000 --- a/_studio/mfx_lib/Android.mk +++ /dev/null @@ -1,343 +0,0 @@ - -LOCAL_PATH:= $(MFX_HOME)/_studio - -# ============================================================================= - -MFX_LOCAL_DECODERS := h265 h264 vc1 mjpeg vp8 vp9 av1 -MFX_LOCAL_ENCODERS := h264 mpeg2 mjpeg vp9 - -# Setting subdirectories to march thru -MFX_LOCAL_DIRS := \ - scheduler/linux \ - -MFX_LOCAL_DIRS_IMPL := \ - $(addprefix decode/, $(MFX_LOCAL_DECODERS)) \ - vpp - -MFX_LOCAL_DIRS_HW := \ - $(addprefix encode_hw/, $(MFX_LOCAL_ENCODERS)) \ - mctf_package/mctf \ - cmrt_cross_platform - -#scheduler/linux/src -MFX_LOCAL_SRC_FILES := \ - $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp))) - -#decode/h265 h264 vc1 mjpeg vp8 vp9 av1/src -MFX_LOCAL_SRC_FILES_IMPL := \ - $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp))) - -#encode_hw/h264 mpeg2 mjpeg vp9/src -MFX_LOCAL_SRC_FILES_HW := \ - $(MFX_LOCAL_SRC_FILES_IMPL) \ - $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/src/*.cpp))) - -#mpeg2 hw decoder -MFX_LOCAL_SRC_FILES_HW += $(addprefix mfx_lib/decode/mpeg2/hw/src/, \ - mfx_mpeg2_decode.cpp) - -MFX_LOCAL_SRC_FILES_HW += $(addprefix mfx_lib/ext/genx/h264_encode/isa/, \ - genx_simple_me_gen12lp_isa.cpp \ - genx_histogram_gen12lp_isa.cpp) - -MFX_LOCAL_SRC_FILES_HW += \ - mfx_lib/encode_hw/av1/av1ehw_disp.cpp \ - mfx_lib/encode_hw/av1/agnostic/av1ehw_base.cpp \ - mfx_lib/encode_hw/av1/linux/base/av1ehw_base_lin.cpp \ - mfx_lib/encode_hw/av1/linux/base/av1ehw_base_va_lin.cpp \ - mfx_lib/encode_hw/av1/linux/base/av1ehw_base_va_packer_lin.cpp \ - mfx_lib/encode_hw/av1/linux/base/av1ehw_base_max_frame_size_lin.cpp \ - mfx_lib/encode_hw/av1/agnostic/Xe_HPM/av1ehw_xe_hpm_segmentation.cpp \ - mfx_lib/encode_hw/av1/linux/Xe_HPM/av1ehw_xe_hpm_lin.cpp \ - mfx_lib/encode_hw/av1/linux/Xe_LPM_plus/av1ehw_xe_lpm_plus_lin.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_alloc.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_constraints.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_qmatrix.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools_com.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_general.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_general_defaults.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_impl.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_packer.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_query_impl_desc.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_segmentation.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_task.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_tile.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_encoded_frame_info.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_max_frame_size.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools.cpp \ - mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_hdr.cpp \ - -MFX_LOCAL_SRC_FILES_HW += \ - mfx_lib/encode_hw/hevc/hevcehw_disp.cpp \ - mfx_lib/encode_hw/hevc/agnostic/hevcehw_base.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_impl.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_alloc.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools_com.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_constraints.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_dirty_rect.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_encoded_frame_info.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_encode_stats.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_ext_brc.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_hdr_sei.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_hrd.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_scc.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_interlace.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_legacy.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_legacy_defaults.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_max_frame_size.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_packer.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_parser.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_recon_info.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_rext.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_roi.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_task.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_query_impl_desc.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_weighted_prediction.cpp \ - mfx_lib/encode_hw/hevc/agnostic/g12/hevcehw_g12_caps.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_interlace_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_dirty_rect_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_max_frame_size_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_enctools_qmatrix_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_roi_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_rext_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_qp_modulation_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_weighted_prediction_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/g12/hevcehw_g12_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/xe_hpm/hevcehw_xe_hpm_lin.cpp \ - mfx_lib/encode_hw/hevc/linux/xe_lpm_plus/hevcehw_xe_lpm_plus_lin.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_extddi.cpp \ - mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_caps.cpp \ - mfx_lib/encode_hw/shared/ehw_resources_pool.cpp \ - mfx_lib/encode_hw/shared/ehw_task_manager.cpp \ - mfx_lib/encode_hw/shared/ehw_device_vaapi.cpp \ - mfx_lib/encode_hw/shared/ehw_utils_vaapi.cpp \ - mfx_lib/ext/cmrt_cross_platform/src/cm_mem_copy.cpp \ - mfx_lib/ext/cmrt_cross_platform/src/cmrt_cross_platform.cpp \ - mfx_lib/ext/cmrt_cross_platform/src/cmrt_utility.cpp \ - mfx_lib/ext/asc/src/asc_cm.cpp \ - mfx_lib/ext/genx/h264_encode/src/genx_simple_me_proto.cpp \ - -#scheduler/linux/include -MFX_LOCAL_INCLUDES := \ - $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include)) - -#decode/h265 h264 vc1 mjpeg vp8 vp9 av1/include -MFX_LOCAL_INCLUDES_IMPL := \ - $(MFX_LOCAL_INCLUDES) \ - $(foreach dir, $(MFX_LOCAL_DIRS_IMPL), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include)) - -#decode/mpeg2/hw/include -MFX_LOCAL_INCLUDES_IMPL += \ - $(MFX_HOME)/_studio/mfx_lib/decode/mpeg2/hw/include - -#encode_hw/h264 mpeg2 mjpeg vp9/include -MFX_LOCAL_INCLUDES_IMPL += \ - $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/mfx_lib/$(dir)/include)) - -MFX_LOCAL_INCLUDES_HW := \ - $(MFX_LOCAL_INCLUDES_IMPL) \ - $(MFX_HOME)/_studio/mfx_lib/ext/asc/include \ - $(MFX_HOME)/_studio/mfx_lib/ext/genx/h264_encode/isa \ - $(MFX_HOME)/_studio/mfx_lib/ext/genx/field_copy/isa \ - $(MFX_HOME)/_studio/mfx_lib/ext/genx/copy_kernels/isa \ - $(MFX_HOME)/_studio/mfx_lib/ext/cmrt_cross_platform/include \ - $(MFX_HOME)/_studio/mfx_lib/ext/genx/mctf/isa \ - $(MFX_HOME)/_studio/mfx_lib/ext/genx/asc/isa \ - $(MFX_HOME)/_studio/mfx_lib/ext/h264/include \ - $(MFX_HOME)/_studio/mfx_lib/ext/mpeg2/include \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1 \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/agnostic \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/agnostic/base \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/agnostic/Xe_HPM \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/agnostic/Xe_LPM_plus \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/linux \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/linux/base \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/linux/Xe_HPM \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/av1/linux/Xe_LPM_plus \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/agnostic \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/agnostic/base \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/agnostic/g12 \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux/base \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux/g12 \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux/xe_hpm \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/hevc/linux/xe_lpm_plus \ - $(MFX_HOME)/_studio/mfx_lib/encode_hw/shared \ - $(MFX_HOME)/_studio/mfx_lib/shared/include/feature_blocks \ - $(MFX_HOME)/_studio/mfx_lib/scheduler/linux/include \ - $(MFX_HOME)/_studio/shared/asc/include - -MFX_LOCAL_STATIC_LIBRARIES_HW := \ - libmfx_core_hw \ - libumc_codecs_hw \ - libumc_brc \ - libumc_va \ - libumc_core_hw \ - libmfx_gen_trace \ - libmfx_asc \ - libmfx_logging - -MFX_LOCAL_LDFLAGS_HW := \ - $(MFX_LDFLAGS) \ - -Wl,--version-script=$(LOCAL_PATH)/mfx_lib/libmfx-gen.map - -# ============================================================================= - -UMC_DIRS := \ - h264_enc \ - brc - -UMC_DIRS_IMPL := \ - h265_dec h264_dec mpeg2_dec vc1_dec jpeg_dec vp9_dec av1_dec \ - vc1_common jpeg_common color_space_converter - -UMC_LOCAL_INCLUDES := \ - $(foreach dir, $(UMC_DIRS), $(wildcard $(MFX_HOME)/_studio/shared/umc/codec/$(dir)/include)) - -UMC_LOCAL_INCLUDES_IMPL := \ - $(UMC_LOCAL_INCLUDES) \ - $(foreach dir, $(UMC_DIRS_IMPL), $(wildcard $(MFX_HOME)/_studio/shared/umc/codec/$(dir)/include)) - -UMC_LOCAL_INCLUDES_HW := \ - $(UMC_LOCAL_INCLUDES_IMPL) - -# ============================================================================= - -MFX_SHARED_FILES_IMPL := $(addprefix mfx_lib/shared/src/, \ - mfx_feature_blocks_base.cpp \ - mfx_brc_common.cpp \ - mfx_common_decode_int.cpp \ - mfx_common_int.cpp \ - mfx_enc_common.cpp \ - mfx_log.cpp \ - mfx_enc_enctools_common.cpp \ - mfx_mpeg2_dec_common.cpp \ - mfx_vc1_dec_common.cpp \ - mfx_ddi_enc_dump.cpp \ - mfx_vpx_dec_common.cpp) - -MFX_SHARED_FILES_HW := \ - $(MFX_SHARED_FILES_IMPL) - -MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/genx/asc/isa/, \ - genx_scd_gen12lp_isa.cpp) - -MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/genx/copy_kernels/isa/, \ - genx_copy_kernel_gen12lp_isa.cpp) - -MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/genx/field_copy/isa/, \ - genx_fcopy_gen12lp_isa.cpp) - -MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/genx/mctf/isa/, \ - genx_me_gen12lp_isa.cpp \ - genx_mc_gen12lp_isa.cpp \ - genx_sd_gen12lp_isa.cpp) - -MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/mpeg2/src/, \ - mfx_mpeg2_encode_debug_hw.cpp \ - mfx_mpeg2_encode_full_hw.cpp \ - mfx_mpeg2_encode_hw.cpp \ - mfx_mpeg2_encode_utils_hw.cpp \ - mfx_mpeg2_encode_vaapi.cpp \ - mfx_mpeg2_encode_factory.cpp \ - mfx_mpeg2_enc_common_hw.cpp) - -MFX_SHARED_FILES_HW += $(addprefix mfx_lib/ext/h264/src/, \ - mfx_h264_encode_cm.cpp) - -MFX_LIB_SHARED_FILES_1 := $(addprefix mfx_lib/shared/src/, \ - libmfxsw.cpp \ - libmfxsw_async.cpp \ - libmfxsw_decode.cpp \ - libmfxsw_decode_vp.cpp \ - libmfxsw_functions.cpp \ - libmfxsw_enc.cpp \ - libmfxsw_encode.cpp \ - libmfxsw_pak.cpp \ - libmfxsw_plugin.cpp \ - libmfxsw_query.cpp \ - libmfxsw_session.cpp \ - libmfxsw_vpp.cpp \ - mfx_session.cpp \ - mfx_critical_error_handler.cpp) - -MFX_LIB_SHARED_FILES_2 := $(addprefix shared/src/, \ - fast_copy.cpp \ - fast_copy_c_impl.cpp \ - fast_copy_sse4_impl.cpp \ - mfx_vpp_vaapi.cpp \ - mfx_vpp_helper.cpp \ - libmfx_allocator.cpp \ - libmfx_allocator_vaapi.cpp \ - libmfx_core.cpp \ - libmfx_core_hw.cpp \ - libmfx_core_factory.cpp \ - libmfx_core_vaapi.cpp \ - mfx_umc_alloc_wrapper.cpp \ - mfx_umc_mjpeg_vpp.cpp) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := \ - $(MFX_LOCAL_SRC_FILES) \ - $(MFX_LOCAL_SRC_FILES_HW) \ - $(MFX_SHARED_FILES_HW) - -LOCAL_C_INCLUDES := \ - $(MFX_LOCAL_INCLUDES_HW) \ - $(UMC_LOCAL_INCLUDES_HW) \ - $(MFX_INCLUDES_INTERNAL_HW) - -LOCAL_CPPFLAGS += -std=c++14 - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -Wno-error -Wno-unused-parameter -Wno-implicit-fallthrough - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx_core_hw -LOCAL_SHARED_LIBRARIES := liblog libcutils - -include $(BUILD_STATIC_LIBRARY) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(MFX_LIB_SHARED_FILES_1) $(MFX_LIB_SHARED_FILES_2) - -LOCAL_C_INCLUDES := \ - $(MFX_LOCAL_INCLUDES_HW) \ - $(UMC_LOCAL_INCLUDES_HW) \ - $(MFX_INCLUDES_INTERNAL_HW) - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -Wno-error -Wno-unused-parameter -Wno-implicit-fallthrough - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_LDFLAGS := $(MFX_LOCAL_LDFLAGS_HW) - -LOCAL_CPPFLAGS += -std=c++14 - -LOCAL_WHOLE_STATIC_LIBRARIES := $(MFX_LOCAL_STATIC_LIBRARIES_HW) -LOCAL_SHARED_LIBRARIES := libva liblog libcutils libdrm - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx-gen - -include $(BUILD_SHARED_LIBRARY) diff --git a/_studio/shared/Android.mk b/_studio/shared/Android.mk deleted file mode 100644 index 86c9b78c..00000000 --- a/_studio/shared/Android.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Recursively call sub-folder Android.mk - -include $(call all-subdir-makefiles) \ No newline at end of file diff --git a/_studio/shared/asc/Android.mk b/_studio/shared/asc/Android.mk deleted file mode 100644 index 03c8063a..00000000 --- a/_studio/shared/asc/Android.mk +++ /dev/null @@ -1,92 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(addprefix src/, asc_avx2_impl.cpp) - -LOCAL_C_INCLUDES := \ - $(MFX_INCLUDES_INTERNAL_HW) \ - $(MFX_HOME)/_studio/mfx_lib/cmrt_cross_platform/include \ - $(MFX_HOME)/_studio/mfx_lib/ext/genx/asc/isa - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -mavx2 \ - -Wno-error \ - -Wno-unused-parameter - -LOCAL_CFLAGS += -I $(MFX_HOME)/_studio/shared/asc/include/ - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx_asc_avx2 -include $(BUILD_STATIC_LIBRARY) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(addprefix src/, asc_sse4_impl.cpp) - -LOCAL_C_INCLUDES := \ - $(MFX_INCLUDES_INTERNAL_HW) \ - $(MFX_HOME)/_studio/mfx_lib/cmrt_cross_platform/include \ - $(MFX_HOME)/_studio/mfx_lib/ext/genx/asc/isa - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -msse4.1 \ - -Wno-error \ - -Wno-unused-parameter - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx_asc_sse4 -include $(BUILD_STATIC_LIBRARY) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -ASC_SRC_FILES := $(addprefix src/, \ - asc.cpp \ - asc_c_impl.cpp \ - iofunctions.cpp \ - motion_estimation_engine.cpp \ - tree.cpp) - -LOCAL_SRC_FILES := $(ASC_SRC_FILES) - -LOCAL_C_INCLUDES := \ - $(MFX_INCLUDES_INTERNAL_HW) \ - $(MFX_HOME)/_studio/mfx_lib/cmrt_cross_platform/include \ - $(MFX_HOME)/_studio/mfx_lib/ext/genx/asc/isa - -LOCAL_STATIC_LIBRARIES := \ - libmfx_asc_avx2 \ - libmfx_asc_sse4 - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -msse4.1 \ - -Wno-error \ - -Wno-unused-parameter - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_WHOLE_STATIC_LIBRARIES := $(LOCAL_STATIC_LIBRARIES) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx_asc - -include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/shared/mfx_logging/Android.mk b/_studio/shared/mfx_logging/Android.mk deleted file mode 100644 index 93f6fc38..00000000 --- a/_studio/shared/mfx_logging/Android.mk +++ /dev/null @@ -1,24 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(addprefix src/, $(notdir $(wildcard $(LOCAL_PATH)/src/*.cpp))) - -LOCAL_C_INCLUDES := \ - $(MFX_INCLUDES_INTERNAL_HW) \ - $(MFX_HOME)/api/mediasdk_structures - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -Wno-error \ - -Wno-unused-parameter - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx_logging - -include $(BUILD_STATIC_LIBRARY) - diff --git a/_studio/shared/mfx_trace/Android.mk b/_studio/shared/mfx_trace/Android.mk deleted file mode 100644 index 93c71ffd..00000000 --- a/_studio/shared/mfx_trace/Android.mk +++ /dev/null @@ -1,23 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(addprefix src/, $(notdir $(wildcard $(LOCAL_PATH)/src/*.cpp))) - -LOCAL_C_INCLUDES := \ - $(MFX_INCLUDES_INTERNAL_HW) \ - $(MFX_HOME)/api/mediasdk_structures - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -Wno-error \ - -Wno-unused-parameter - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libmfx_gen_trace - -include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/shared/umc/Android.mk b/_studio/shared/umc/Android.mk deleted file mode 100644 index 86c9b78c..00000000 --- a/_studio/shared/umc/Android.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Recursively call sub-folder Android.mk - -include $(call all-subdir-makefiles) \ No newline at end of file diff --git a/_studio/shared/umc/codec/Android.mk b/_studio/shared/umc/codec/Android.mk deleted file mode 100644 index 7e4cf270..00000000 --- a/_studio/shared/umc/codec/Android.mk +++ /dev/null @@ -1,83 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Setting subdirectories to march thru -MFX_CODEC_LOCAL_DIRS := \ - vc1_common \ - jpeg_common \ - color_space_converter \ - mpeg2_dec \ - h265_dec \ - h264_dec \ - vc1_dec \ - jpeg_dec \ - vp9_dec \ - av1_dec - -MFX_CODEC_LOCAL_SRC_FILES := \ - $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_CODEC_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp))) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := \ - brc/src/umc_brc.cpp \ - brc/src/umc_h264_brc.cpp \ - brc/src/umc_mpeg2_brc.cpp \ - brc/src/umc_video_brc.cpp - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/brc/include \ - $(MFX_INCLUDES_INTERNAL_HW) - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -Wno-error \ - -Wno-unused-parameter \ - -Wno-deprecated-declarations - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_SHARED_LIBRARIES := liblog libcutils - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libumc_brc - -include $(BUILD_STATIC_LIBRARY) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(MFX_CODEC_LOCAL_SRC_FILES) - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/av1_dec/include \ - $(LOCAL_PATH)/color_space_converter/include \ - $(LOCAL_PATH)/h264_dec/include \ - $(LOCAL_PATH)/h265_dec/include \ - $(LOCAL_PATH)/jpeg_common/include \ - $(LOCAL_PATH)/jpeg_dec/include \ - $(LOCAL_PATH)/mpeg2_dec/include \ - $(LOCAL_PATH)/vc1_common/include \ - $(LOCAL_PATH)/vc1_dec/include \ - $(LOCAL_PATH)/vp9_dec/include \ - $(MFX_INCLUDES_INTERNAL_HW) - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -Wno-error \ - -Wno-unused-parameter - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_SHARED_LIBRARIES := liblog libcutils - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libumc_codecs_hw - -include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/shared/umc/core/Android.mk b/_studio/shared/umc/core/Android.mk deleted file mode 100644 index aedbfe82..00000000 --- a/_studio/shared/umc/core/Android.mk +++ /dev/null @@ -1,40 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Setting subdirectories to march thru -MFX_LOCAL_DIRS := \ - vm \ - vm_plus \ - umc - -MFX_LOCAL_SRC_FILES := \ - $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.c))) \ - $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp))) - -MFX_LOCAL_INCLUDES := \ - $(foreach dir, $(MFX_LOCAL_DIRS), $(wildcard $(LOCAL_PATH)/$(dir)/include)) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES) - -LOCAL_C_INCLUDES := \ - $(MFX_LOCAL_INCLUDES) \ - $(MFX_INCLUDES_INTERNAL_HW) - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -Wno-error \ - -Wno-unused-parameter - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_STATIC_LIBRARIES += libmfx_logging - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libumc_core_hw - -include $(BUILD_STATIC_LIBRARY) diff --git a/_studio/shared/umc/io/Android.mk b/_studio/shared/umc/io/Android.mk deleted file mode 100644 index 0baf70d8..00000000 --- a/_studio/shared/umc/io/Android.mk +++ /dev/null @@ -1,35 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -MFX_LOCAL_DIRS_HW := \ - umc_va - -MFX_LOCAL_SRC_FILES_HW := \ - $(patsubst $(LOCAL_PATH)/%, %, $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/$(dir)/src/*.cpp))) - -MFX_LOCAL_INCLUDES_HW := \ - $(foreach dir, $(MFX_LOCAL_DIRS_HW), $(wildcard $(LOCAL_PATH)/$(dir)/include)) - -# ============================================================================= - -include $(CLEAR_VARS) -include $(MFX_HOME)/android/mfx_defs.mk - -LOCAL_SRC_FILES := $(MFX_LOCAL_SRC_FILES_HW) - -LOCAL_C_INCLUDES := \ - $(MFX_LOCAL_INCLUDES_HW) \ - $(MFX_INCLUDES_INTERNAL_HW) - -LOCAL_CFLAGS := \ - $(MFX_CFLAGS_INTERNAL_HW) \ - -Wno-error \ - -Wno-unused-parameter \ - -Wno-implicit-fallthrough - -LOCAL_CFLAGS_32 := $(MFX_CFLAGS_INTERNAL_32) -LOCAL_CFLAGS_64 := $(MFX_CFLAGS_INTERNAL_64) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libumc_va - -include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/asc.bp b/asc.bp new file mode 100644 index 00000000..75eca22a --- /dev/null +++ b/asc.bp @@ -0,0 +1,91 @@ +cc_library_static { + name: "asc", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/shared/asc/src/asc.cpp", + "_studio/shared/asc/src/asc_c_impl.cpp", + "_studio/shared/asc/src/iofunctions.cpp", + "_studio/shared/asc/src/tree.cpp", + "_studio/shared/asc/src/asc_sse4_impl.cpp", + "_studio/shared/asc/src/motion_estimation_engine.cpp", + "_studio/shared/asc/src/asc_avx2_impl.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/shared/asc/include", + "_studio/shared/include", + "_studio/mfx_lib/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/vm_plus/include", + "_studio/mfx_lib/ext/genx/asc/isa", + "_studio/mfx_lib/ext/genx/copy_kernels/isa", + "_studio/mfx_lib/ext/genx/field_copy/isa", + "_studio/mfx_lib/ext/genx/h264_encode/isa", + "_studio/mfx_lib/ext/genx/mctf/isa", + "_studio/mfx_lib/ext/mctf_package/mctf/include", + "_studio/mfx_lib/ext/h264/include", + "_studio/shared/umc/codec/brc/include", + "_studio/mfx_lib/encode_hw/h264/include", + "_studio/mfx_lib/ext/mpeg2/include", + "_studio/shared/enctools/include", + "_studio/mfx_lib/ext/asc/include", + "_studio/mfx_lib/ext/cmrt_cross_platform/include", + "_studio/shared/umc/codec/h265_dec/include", + "_studio/shared/umc/codec/h264_dec/include", + "_studio/shared/umc/codec/av1_dec/include", + "_studio/shared/umc/codec/vp9_dec/include", + "_studio/shared/umc/io/umc_va/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/bp/defaults.tpl b/bp/defaults.tpl new file mode 100644 index 00000000..92ec35e3 --- /dev/null +++ b/bp/defaults.tpl @@ -0,0 +1,49 @@ +# Copyright(c) 2019 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files(the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and / or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +cc_defaults { + name: "@name", + + vendor: true, + + cflags: [ +@cflags + ], + rtti: true, + cppflags: [ +@cppflags + ], + include_dirs: [ +@include_dirs + ], + shared_libs: [ +@shared_libs + ], + + static_libs: [ +@static_libs + ], + +} + + +build = [ +@build +] diff --git a/bp/onevpl-runtime.tpl b/bp/onevpl-runtime.tpl new file mode 100644 index 00000000..c5c5a76e --- /dev/null +++ b/bp/onevpl-runtime.tpl @@ -0,0 +1,77 @@ +# Copyright(c) 2019 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files(the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and / or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# library_static, library_shared, binary +cc_@module { + name: "@name", + + vendor: true, + + defaults: [ +@defaults + ], + + srcs: [ +@srcs + ], + + cflags: [ +@cflags + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ +@local_include_dirs + ], + + shared_libs: [ +@shared_libs + ], + + static_libs: [ +@static_libs + ], + +} diff --git a/decode_hw.bp b/decode_hw.bp new file mode 100644 index 00000000..d24be9e0 --- /dev/null +++ b/decode_hw.bp @@ -0,0 +1,197 @@ +cc_library_static { + name: "decode_hw", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/mfx_lib/decode/h264/src/mfx_h264_dec_decode.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_au_splitter.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_dec_bitstream_headers.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_dec_debug.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_dec_defs_yuv.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_dec_mfx.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_dec_slice_decoder_decode_pic.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_frame.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_frame_list.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_heap.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_mfx_supplier.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_nal_spl.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_segment_decoder_dxva.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_slice_decoding.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_task_broker.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_task_supplier.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_va_packer.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h264_dec/src/umc_h264_va_supplier.cpp", + "_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_au_splitter.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_bitstream_headers.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_debug.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_frame.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_frame_info.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_frame_list.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_heap.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_mfx_supplier.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_nal_spl.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_scaling_list.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_segment_decoder_dxva.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_sei.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_slice_decoding.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_tables.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_task_broker.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_task_supplier.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_va_packer.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_va_packer_vaapi.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_va_packer_ms.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_va_packer_intel.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_va_supplier.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_yuv.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp", + "_studio/mfx_lib/decode/mjpeg/src/mfx_mjpeg_dec_decode.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_common/src/bitstreamin.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_common/src/bitstreamout.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_common/src/colorcomp.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_common/src/jpegbase.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_common/src/membuffin.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_common/src/membuffout.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/dechtbl.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/decqtbl.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/jpegdec.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/jpegdec_base.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/mfx_mjpeg_task.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/umc_jpeg_frame_constructor.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode_base.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/jpeg_dec/src/umc_mjpeg_mfx_decode_hw.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/color_space_converter/src/umc_video_processing.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/color_space_converter/src/umc_video_resizing.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/color_space_converter/src/umc_color_space_conversion.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/color_space_converter/src/umc_deinterlacing.cpp", + "_studio/mfx_lib/decode/mpeg2/hw/src/mfx_mpeg2_decode.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/mpeg2_dec/src/umc_mpeg2_bitstream.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/mpeg2_dec/src/umc_mpeg2_decoder.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/mpeg2_dec/src/umc_mpeg2_decoder_va.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/mpeg2_dec/src/umc_mpeg2_frame.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/mpeg2_dec/src/umc_mpeg2_slice.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/mpeg2_dec/src/umc_mpeg2_splitter.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/mpeg2_dec/src/umc_mpeg2_utils.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/mpeg2_dec/src/umc_mpeg2_va_packer.cpp", + "_studio/mfx_lib/decode/vc1/src/mfx_vc1_decode.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_common/src/umc_vc1_common.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_common/src/umc_vc1_common_tables.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_common/src/umc_vc1_common_tables_adv.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_common/src/umc_vc1_spl_frame_constr.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_common/src/umc_vc1_spl_tbl.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_huffman.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_bitplane.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_bpic.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_bpic_adv.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_frame_descr.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_frame_va.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_ipic.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_ipic_adv.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_pic_com.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_pic_com_adv.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_ppic.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_ppic_adv.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_seq.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_skipping.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_task_store.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_dec_vopdq.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_video_decoder.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vc1_dec/src/umc_vc1_video_decoder_hw.cpp", + "_studio/mfx_lib/decode/vp8/src/mfx_vp8_dec_decode_common.cpp", + "_studio/mfx_lib/decode/vp8/src/mfx_vp8_dec_decode_tables.cpp", + "_studio/mfx_lib/decode/vp8/src/mfx_vp8_dec_decode_hw.cpp", + "_studio/mfx_lib/decode/vp8/src/mfx_vp8_dec_decode_hw_vaapi.cpp", + "_studio/mfx_lib/decode/vp9/src/mfx_vp9_dec_decode.cpp", + "_studio/mfx_lib/decode/vp9/src/mfx_vp9_dec_decode_hw.cpp", + "_studio/mfx_lib/decode/vp9/src/mfx_vp9_dec_decode_utils.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vp9_dec/src/umc_vp9_bitstream.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vp9_dec/src/umc_vp9_utils.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/vp9_dec/src/umc_vp9_va_packer.cpp", + "_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/av1_dec/src/umc_av1_decoder.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/av1_dec/src/umc_av1_decoder_va.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/av1_dec/src/umc_av1_frame.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/av1_dec/src/umc_av1_utils.cpp", + "_studio/mfx_lib/decode/../../shared/umc/codec/av1_dec/src/umc_av1_va_packer_vaapi.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/shared/umc/codec/h264_dec/include", + "_studio/mfx_lib/decode/h264/include", + "_studio/shared/umc/codec/h265_dec/include", + "_studio/mfx_lib/decode/h265/include", + "_studio/shared/umc/codec/jpeg_dec/include", + "_studio/shared/umc/codec/jpeg_common/include", + "_studio/mfx_lib/vpp/include", + "_studio/shared/umc/codec/color_space_converter/include", + "_studio/mfx_lib/decode/mjpeg/include", + "_studio/shared/umc/codec/mpeg2_dec/include", + "_studio/mfx_lib/decode/mpeg2/hw/include", + "_studio/shared/umc/codec/vc1_common/include", + "_studio/shared/umc/codec/vc1_dec/include", + "_studio/mfx_lib/decode/vc1/include", + "_studio/mfx_lib/decode/vp8/include", + "_studio/shared/umc/codec/vp9_dec/include", + "_studio/mfx_lib/decode/vp9/include", + "_studio/shared/umc/codec/av1_dec/include", + "_studio/mfx_lib/decode/av1/include", + "_studio/shared/umc/io/umc_va/include", + "_studio/shared/include", + "_studio/mfx_lib/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/vm_plus/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/encode_hw.bp b/encode_hw.bp new file mode 100644 index 00000000..4d9c7ef5 --- /dev/null +++ b/encode_hw.bp @@ -0,0 +1,194 @@ +cc_library_static { + name: "encode_hw", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp", + "_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw_utils.cpp", + "_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw_utils_new.cpp", + "_studio/mfx_lib/encode_hw/h264/src/mfx_h264_enc_common_hw.cpp", + "_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_factory.cpp", + "_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_vaapi.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools_com.cpp", + "_studio/mfx_lib/encode_hw/hevc/hevcehw_disp.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/hevcehw_base.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_alloc.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_constraints.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_dirty_rect.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_encode_stats.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_encoded_frame_info.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_ext_brc.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_hdr_sei.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_hrd.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_interlace.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_impl.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_legacy.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_legacy_defaults.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_max_frame_size.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_packer.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_parser.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_recon_info.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_query_impl_desc.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_roi.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_task.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_weighted_prediction.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_rext.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_scc.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_extddi.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_caps.cpp", + "_studio/mfx_lib/encode_hw/hevc/agnostic/g12/hevcehw_g12_caps.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_interlace_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_roi_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_va_packer_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_weighted_prediction_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_enctools_qmatrix_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_max_frame_size_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_dirty_rect_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_rext_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/base/hevcehw_base_qp_modulation_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/g12/hevcehw_g12_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/xe_hpm/hevcehw_xe_hpm_lin.cpp", + "_studio/mfx_lib/encode_hw/hevc/linux/xe_lpm_plus/hevcehw_xe_lpm_plus_lin.cpp", + "_studio/mfx_lib/encode_hw/av1/av1ehw_disp.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/av1ehw_base.cpp", + "_studio/mfx_lib/encode_hw/av1/linux/base/av1ehw_base_lin.cpp", + "_studio/mfx_lib/encode_hw/av1/linux/base/av1ehw_base_va_lin.cpp", + "_studio/mfx_lib/encode_hw/av1/linux/base/av1ehw_base_va_packer_lin.cpp", + "_studio/mfx_lib/encode_hw/av1/linux/base/av1ehw_base_max_frame_size_lin.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_alloc.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_constraints.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_qmatrix.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_general.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_general_defaults.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_impl.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_packer.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_query_impl_desc.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_segmentation.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_task.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_tile.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_encoded_frame_info.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_max_frame_size.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_hdr.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools_com.cpp", + "_studio/mfx_lib/encode_hw/av1/agnostic/Xe_HPM/av1ehw_xe_hpm_segmentation.cpp", + "_studio/mfx_lib/encode_hw/av1/linux/Xe_HPM/av1ehw_xe_hpm_lin.cpp", + "_studio/mfx_lib/encode_hw/av1/linux/Xe_LPM_plus/av1ehw_xe_lpm_plus_lin.cpp", + "_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_factory.cpp", + "_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw.cpp", + "_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_hw_utils.cpp", + "_studio/mfx_lib/encode_hw/mjpeg/src/mfx_mjpeg_encode_vaapi.cpp", + "_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw.cpp", + "_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_ddi.cpp", + "_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_par.cpp", + "_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_utils.cpp", + "_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_vaapi.cpp", + "_studio/mfx_lib/encode_hw/shared/ehw_resources_pool.cpp", + "_studio/mfx_lib/encode_hw/shared/ehw_task_manager.cpp", + "_studio/mfx_lib/encode_hw/shared/ehw_device_vaapi.cpp", + "_studio/mfx_lib/encode_hw/shared/ehw_utils_vaapi.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/mfx_lib/encode_hw/h264/include", + "_studio/mfx_lib/encode_hw/hevc", + "_studio/mfx_lib/encode_hw/hevc/agnostic", + "_studio/mfx_lib/encode_hw/hevc/agnostic/base", + "_studio/mfx_lib/encode_hw/hevc/agnostic/g12", + "_studio/mfx_lib/encode_hw/hevc/linux", + "_studio/mfx_lib/encode_hw/hevc/linux/g12", + "_studio/mfx_lib/encode_hw/hevc/linux/base", + "_studio/mfx_lib/encode_hw/hevc/linux/xe_hpm", + "_studio/mfx_lib/encode_hw/hevc/linux/xe_lpm_plus", + "_studio/mfx_lib/encode_hw/av1", + "_studio/mfx_lib/encode_hw/av1/agnostic", + "_studio/mfx_lib/encode_hw/av1/agnostic/base", + "_studio/mfx_lib/encode_hw/av1/linux", + "_studio/mfx_lib/encode_hw/av1/linux/base", + "_studio/mfx_lib/encode_hw/av1/agnostic/Xe_HPM", + "_studio/mfx_lib/encode_hw/av1/linux/Xe_HPM", + "_studio/mfx_lib/encode_hw/av1/agnostic/Xe_LPM_plus", + "_studio/mfx_lib/encode_hw/av1/linux/Xe_LPM_plus", + "_studio/mfx_lib/encode_hw/mjpeg/include", + "_studio/shared/umc/codec/jpeg_common/include", + "_studio/mfx_lib/encode_hw/vp9/include", + "_studio/mfx_lib/encode_hw/shared", + "_studio/shared/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/umc/codec/brc/include", + "_studio/shared/umc/codec/color_space_converter/include", + "_studio/shared/enctools/include", + "_studio/mfx_lib/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/io/umc_va/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/vm_plus/include", + "_studio/shared/asc/include", + "_studio/shared/umc/codec/h265_dec/include", + "_studio/shared/umc/codec/h264_dec/include", + "_studio/shared/umc/codec/av1_dec/include", + "_studio/shared/umc/codec/vp9_dec/include", + "_studio/mfx_lib/ext/genx/asc/isa", + "_studio/mfx_lib/ext/genx/copy_kernels/isa", + "_studio/mfx_lib/ext/genx/field_copy/isa", + "_studio/mfx_lib/ext/genx/h264_encode/isa", + "_studio/mfx_lib/ext/genx/mctf/isa", + "_studio/mfx_lib/ext/mctf_package/mctf/include", + "_studio/mfx_lib/ext/h264/include", + "_studio/mfx_lib/ext/mpeg2/include", + "_studio/mfx_lib/ext/asc/include", + "_studio/mfx_lib/ext/cmrt_cross_platform/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/libumc_codecs.bp b/libumc_codecs.bp new file mode 100644 index 00000000..13527d1f --- /dev/null +++ b/libumc_codecs.bp @@ -0,0 +1,70 @@ +cc_library_static { + name: "libumc_codecs", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/shared/umc/codec/brc/src/umc_brc.cpp", + "_studio/shared/umc/codec/brc/src/umc_h264_brc.cpp", + "_studio/shared/umc/codec/brc/src/umc_mpeg2_brc.cpp", + "_studio/shared/umc/codec/brc/src/umc_video_brc.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/shared/umc/core/umc/include", + "_studio/shared/umc/codec/brc/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/include", + "_studio/mfx_lib/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/vm_plus/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/mfx_common_hw.bp b/mfx_common_hw.bp new file mode 100644 index 00000000..0efd15cd --- /dev/null +++ b/mfx_common_hw.bp @@ -0,0 +1,99 @@ +cc_library_static { + name: "mfx_common_hw", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/mfx_lib/shared/src/mfx_feature_blocks_base.cpp", + "_studio/mfx_lib/shared/src/mfx_brc_common.cpp", + "_studio/mfx_lib/shared/src/mfx_common_decode_int.cpp", + "_studio/mfx_lib/shared/src/mfx_common_int.cpp", + "_studio/mfx_lib/shared/src/mfx_enc_common.cpp", + "_studio/mfx_lib/shared/src/mfx_log.cpp", + "_studio/mfx_lib/shared/src/mfx_enc_enctools_common.cpp", + "_studio/mfx_lib/shared/src/mfx_mpeg2_dec_common.cpp", + "_studio/mfx_lib/shared/src/mfx_vc1_dec_common.cpp", + "_studio/mfx_lib/shared/src/mfx_critical_error_handler.cpp", + "_studio/mfx_lib/shared/src/mfx_ddi_enc_dump.cpp", + "_studio/mfx_lib/shared/src/mfx_vpx_dec_common.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/mfx_lib/shared/include", + "_studio/mfx_lib/shared/include/feature_blocks", + "_studio/shared/umc/codec/brc/include", + "_studio/shared/umc/codec/vc1_common/include", + "_studio/shared/umc/codec/vc1_dec/include", + "_studio/shared/asc/include", + "_studio/shared/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/enctools/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/io/umc_va/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/vm_plus/include", + "_studio/shared/umc/codec/h265_dec/include", + "_studio/shared/umc/codec/h264_dec/include", + "_studio/shared/umc/codec/av1_dec/include", + "_studio/shared/umc/codec/vp9_dec/include", + "_studio/mfx_lib/ext/genx/asc/isa", + "_studio/mfx_lib/ext/genx/copy_kernels/isa", + "_studio/mfx_lib/ext/genx/field_copy/isa", + "_studio/mfx_lib/ext/genx/h264_encode/isa", + "_studio/mfx_lib/ext/genx/mctf/isa", + "_studio/mfx_lib/ext/mctf_package/mctf/include", + "_studio/mfx_lib/ext/h264/include", + "_studio/mfx_lib/encode_hw/h264/include", + "_studio/mfx_lib/ext/mpeg2/include", + "_studio/mfx_lib/ext/asc/include", + "_studio/mfx_lib/ext/cmrt_cross_platform/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/mfx_ext.bp b/mfx_ext.bp new file mode 100644 index 00000000..b69faab6 --- /dev/null +++ b/mfx_ext.bp @@ -0,0 +1,102 @@ +cc_library_static { + name: "mfx_ext", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/mfx_lib/ext/genx/asc/isa/genx_scd_gen12lp_isa.cpp", + "_studio/mfx_lib/ext/genx/copy_kernels/isa/genx_copy_kernel_gen12lp_isa.cpp", + "_studio/mfx_lib/ext/genx/field_copy/isa/genx_fcopy_gen12lp_isa.cpp", + "_studio/mfx_lib/ext/genx/h264_encode/src/genx_simple_me_proto.cpp", + "_studio/mfx_lib/ext/genx/h264_encode/isa/genx_simple_me_gen12lp_isa.cpp", + "_studio/mfx_lib/ext/genx/h264_encode/isa/genx_histogram_gen12lp_isa.cpp", + "_studio/mfx_lib/ext/genx/mctf/isa/genx_mc_gen12lp_isa.cpp", + "_studio/mfx_lib/ext/genx/mctf/isa/genx_me_gen12lp_isa.cpp", + "_studio/mfx_lib/ext/genx/mctf/isa/genx_sd_gen12lp_isa.cpp", + "_studio/mfx_lib/ext/mctf_package/mctf/src/mctf_common.cpp", + "_studio/mfx_lib/ext/h264/src/mfx_h264_encode_cm.cpp", + "_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_debug_hw.cpp", + "_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_full_hw.cpp", + "_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_hw.cpp", + "_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_utils_hw.cpp", + "_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_vaapi.cpp", + "_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_encode_factory.cpp", + "_studio/mfx_lib/ext/mpeg2/src/mfx_mpeg2_enc_common_hw.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/mfx_lib/ext/genx/asc/isa", + "_studio/mfx_lib/ext/genx/copy_kernels/isa", + "_studio/mfx_lib/ext/genx/field_copy/isa", + "_studio/mfx_lib/ext/genx/h264_encode/isa", + "_studio/mfx_lib/ext/genx/mctf/isa", + "_studio/mfx_lib/ext/mctf_package/mctf/include", + "_studio/mfx_lib/ext/h264/include", + "_studio/shared/umc/codec/brc/include", + "_studio/mfx_lib/encode_hw/h264/include", + "_studio/mfx_lib/ext/mpeg2/include", + "_studio/mfx_lib/shared/include", + "_studio/shared/enctools/include", + "_studio/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/mfx_lib/ext/asc/include", + "_studio/mfx_lib/ext/cmrt_cross_platform/include", + "_studio/shared/asc/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/umc/core/vm_plus/include", + "_studio/shared/umc/codec/h265_dec/include", + "_studio/shared/umc/codec/h264_dec/include", + "_studio/shared/umc/codec/av1_dec/include", + "_studio/shared/umc/codec/vp9_dec/include", + "_studio/shared/umc/io/umc_va/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/mfx_logging.bp b/mfx_logging.bp new file mode 100644 index 00000000..f716b0a3 --- /dev/null +++ b/mfx_logging.bp @@ -0,0 +1,77 @@ +cc_library_static { + name: "mfx_logging", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/shared/mfx_logging/src/mfx_utils_logging.cpp", + "_studio/shared/mfx_logging/src/mfx_utils_perf.cpp", + "_studio/shared/mfx_logging/src/mfx_unified_decode_logging.cpp", + "_studio/shared/mfx_logging/src/mfx_unified_h265d_logging.cpp", + "_studio/shared/mfx_logging/src/mfx_unified_h264d_logging.cpp", + "_studio/shared/mfx_logging/src/mfx_unified_av1d_logging.cpp", + "_studio/shared/mfx_logging/src/mfx_unified_vp9d_logging.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/shared/mfx_logging/include", + "_studio/shared/umc/codec/h265_dec/include", + "_studio/shared/umc/codec/h264_dec/include", + "_studio/shared/umc/codec/av1_dec/include", + "_studio/shared/umc/codec/vp9_dec/include", + "_studio/shared/umc/io/umc_va/include", + "_studio/shared/include", + "_studio/mfx_lib/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/umc/core/vm_plus/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/mfx_trace.bp b/mfx_trace.bp new file mode 100644 index 00000000..07f6de97 --- /dev/null +++ b/mfx_trace.bp @@ -0,0 +1,78 @@ +cc_library_static { + name: "mfx_trace", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/shared/mfx_trace/src/mfx_trace.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_ftrace.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_itt.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_ir.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_stat.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_textlog.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_utils.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_utils_linux.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_dump.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_dump_common.cpp", + "_studio/shared/mfx_trace/src/mfx_trace_dump_structures.cpp", + "_studio/shared/mfx_trace/src/mfx_reflect.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/shared/mfx_trace/include", + "_studio/shared/include", + "_studio/mfx_lib/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/umc/core/vm_plus/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/scripts/androidbpgenerator.py b/scripts/androidbpgenerator.py new file mode 100755 index 00000000..331a8e59 --- /dev/null +++ b/scripts/androidbpgenerator.py @@ -0,0 +1,312 @@ +#! /usr/bin/env python3 +""" +* Copyright (c) 2019, Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +""" + +import os +import os.path as path +import re + + +INDENT = " " +BUILD_DIR = "onevpl-intel-gpu/build" +TEMPLATE_DIR = "bp" +NOVERBOSE = " > /dev/null 2>&1;" + + +def remove(f): + cmd = "rm -f " + f + NOVERBOSE + os.system(cmd) + + +class CCDefaults: + # constructor + def __init__(self, proj, defname, cflags = [], cppflags = [], + include_dirs = [], shared_libs = [], static_libs = [], bpfiles = []): + self.templ = path.join(proj, TEMPLATE_DIR) + self.proj = proj + self.default_name = defname + self.c_flag = cflags + self.cpp_flag = cppflags + self.include_dir = include_dirs + self.shared_lib = shared_libs + self.static_lib = static_libs + self.bp_file = bpfiles + + def getBpFilePath(self): + return path.join(self.proj, "Android.bp") + + #major function + def generate(self): + if path.exists(self.proj) == False: + raise Exception(self.proj + " not existed") + # read template + with open(path.join(self.templ, "defaults.tpl")) as f: + tpl = f.read() + # remove all comment + tpl = re.sub("#.*\n", "", tpl).strip() + # replacement + tpl = tpl.replace("@name", self.default_name) + tpl = tpl.replace("@cflags", self.convertList2Str(self.c_flag)) + tpl = tpl.replace("@cppflags", self.convertList2Str(self.cpp_flag)) + tpl = tpl.replace("@include_dirs", self.convertList2Str(self.include_dir)) + tpl = tpl.replace("@shared_libs", self.convertList2Str(self.shared_lib)) + tpl = tpl.replace("@static_libs", self.convertList2Str(self.static_lib)) + tpl = tpl.replace("@build", self.convertList2Str(self.bp_file, indent_num = 1)) + + return tpl + + def convertList2Str(self, itemlist, indent_num = 2): + str = "" + + for i, t in enumerate(itemlist): + if 0 == len(t): + continue + str += INDENT * indent_num + "\"" + t + "\",\n" + + return INDENT * indent_num + "".join(str).strip() + + +class ModuleInfo: + # constructor + def __init__(self, modulename, bpfilename, cmakedir, moduletype, defaults, + middledir = "", addsrc = [], addflags = [], addstatic = [], addshared = [], + updateflags = {}, updatestatic = {}, updateshared = {}): + self.Module_Name = modulename # name of module + self.Bp_File_Name = bpfilename # BP file name + self.Mid_Dir = middledir # some middle directory + self.Build_Make = middledir + cmakedir + "build.make" # building file in directory generated by cmake + self.Flags_Make = middledir + cmakedir + "flags.make" # flag-file in directory generated by cmake + self.Module_Type = moduletype # support: cc_library_shared, cc_library_static + self.Defaults = INDENT * 2 + "\"" + defaults + "\"," + self.Add_Src = addsrc # some additional source files + self.Add_Flags = addflags # some additional cflags/cppflags + self.Add_Static = addstatic # some additional static library + self.Add_Shared = addshared # some additional shared library + self.Update_Flags = updateflags # update some cflags/cppflags + self.Update_Static = updatestatic # update the dependent static libraries + self.Update_Shared = updateshared # update the dependent static libraries + + +class Generator: + # constructor + def __init__(self, src, root): + # where is the major source file, and the directory to where *.bp should be put + self.src = src + # where to put build file and template + self.build = path.join(root, BUILD_DIR) + """where to put the template""" + self.templ = path.join(src, TEMPLATE_DIR) + # all submodule's info + self.allmoduleinfo = {} + # + # self.allmoduledefaults = CCDefaults(...) + + #major function + def generate(self, to_cmake = False, to_make = False): + if path.exists(self.src) == False: + raise Exception(self.src + " not existed") + + if to_cmake: + self.generateMakefile(make = to_make) + + self.adjustFiles() + + allBPs = {} + # sub-module" .bp + for k in list(self.allmoduleinfo.keys()): + # the path of Android.bp + bp = path.normpath(path.join(self.src, self.allmoduleinfo[k].Bp_File_Name)) + # read template + with open(self.getTemplatePath()) as f: + tpl = f.read() + # remove all comment + tpl = re.sub("#.*\n", "", tpl).strip() + # an Android.bp is related to some module + if bp in list(allBPs.keys()): + allBPs[bp] += "\n\n" + self.replaceTemplate(k, tpl) + else: + allBPs[bp] = self.replaceTemplate(k, tpl) + # Android.bp + allBPs[self.allmoduledefaults.getBpFilePath()] = self.allmoduledefaults.generate() + + for bp in list(allBPs.keys()): + # remove old Android.bp + remove(bp) + # create new Android.bp + with open(bp, "w") as f: + f.write(allBPs[bp]) + print((bp + " has been generated.")) + + #virtuall functions + def getTemplate(self): + raise Exception("pure virtul function") + + def replaceTemplate(self, mode, tpl): + tpl = tpl.replace("@module", self.allmoduleinfo[mode].Module_Type) + tpl = tpl.replace("@name", self.allmoduleinfo[mode].Module_Name) + tpl = tpl.replace("@defaults", self.allmoduleinfo[mode].Defaults) + tpl = tpl.replace("@srcs", self.getSources(mode)) + tpl = tpl.replace("@cflags", self.adjustFlags(mode, INDENT * 2 + "".join(self.getDefines(mode, "C_FLAGS") + self.getDefines(mode, "C_DEFINES")).strip(), is_add = False)) + tpl = tpl.replace("@cppflags", self.adjustFlags(mode, INDENT * 2 + "".join(self.getDefines(mode, "CXX_FLAGS") + self.getDefines(mode, "CXX_DEFINES")).strip())) + tpl = tpl.replace("@local_include_dirs", INDENT * 2 + "".join(self.getIncludes(mode, "C_INCLUDES") + "\n" + self.getIncludes(mode, "CXX_INCLUDES")).strip()) + tpl = tpl.replace("@shared_libs", INDENT * 2 + "".join(self.adjustLibrary(mode, self.getLibrary(mode, ".*?\\.so[.\d]*\\n", "\\.so)[.\d]*\\n", "\\.so[.\d]*"), False).strip())) + tpl = tpl.replace("@static_libs", INDENT * 2 + "".join(self.adjustLibrary(mode, self.getLibrary(mode, ".*?\\.a\\n", "\\.a)\\n", "\\.a")).strip())) + + return tpl + + def getName(self): + return self.getTemplate().split(".")[0] + + def getTemplatePath(self): + return path.join(self.templ, self.getTemplate()) + + def getBuildDir(self): + #return path.join(self.build, self.getName()) + return self.build + + def adjustSources(self, mode, all_sources): + return all_sources + + def adjustIncludes(self, mode, all_includes): + return all_includes + + def adjustFlags(self, mode, all_flags, is_add = True): + return all_flags + + def adjustLibrary(self, mode, all_libs, is_static = True): + return all_libs + + def adjustFiles(self): + return + + def getCmakeCmd(self): + return "cmake -DCMAKE_BUILD_TYPE=Release -DNEO_SKIP_UNIT_TESTS=1 -DBUILD_WITH_L0=OFF -DDISABLE_WDDM_LINUX=TRUE " + self.src + + def generateMakefile(self, debug=False, make=False): + #windows can help us debug the script and we do not want generate makefile on widnows + if os.name == "nt": + return + + verbose = ";" if debug else NOVERBOSE + builddir = self.getBuildDir() + # make quickly, but can't clear old makefile + cmd = "rm " + path.join(builddir, "CMakeCache.txt") + verbose + # clear old makefile, but need to cost some time + #cmd = "rm -rf " + builddir + verbose + cmd += "mkdir -p " + builddir + verbose + cmd += "cd " + builddir + " && " + self.getCmakeCmd() + verbose + # need to make this project + if make: + print(("It is making: " + self.src)) + cmd += "make -j$(nproc)" + + os.system(cmd) + + def getIncludes(self, mode, title): + includestext = self.getDefines(mode, title) + if (0 == len(includestext)): + return "" + + lines = includestext.split("\n") + includesfile = [] + + for l in lines: + if 0 == len(l): + continue + #normpath will make sure we did not refer outside. + p = path.normpath(l) + j = p.find(self.src) + # + if 0 <= j: + # check this path of include is existed, or not. + k = p[j:].find('"') + if (0 <= k) and (True == path.isdir(p[j : (j + k)])): + includesfile.append(p[j:].replace(self.src, INDENT * 2 + "\"")) + + return "\n".join(includesfile) if includesfile else "" + + def getDefines(self, mode, title): + if not mode in list(self.allmoduleinfo.keys()): + raise Exception("Invalid index of module info") + + flagsfile = path.join(self.getBuildDir(), self.allmoduleinfo[mode].Flags_Make) + with open(flagsfile) as f: + text = f.read() + + lines = re.findall(title + " =.*\n", text) + if (0 == len(lines)): + return "" + + all_defines = "" + + for i, l in enumerate(lines): + # 'strip' to remove the beginning and ending space + l = l.replace(title + " = ", "").strip() + if (0 == len(l)): + continue + + all_defines += INDENT * 2 + "\"" + re.sub(r"[ ]+", "\",\n" + INDENT * 2 + "\"", re.sub("=\"\"", "=", l)) + "\",\n" + + return all_defines + + def getSources(self, mode): + if not mode in list(self.allmoduleinfo.keys()): + raise Exception("Invalid index of module info") + + buildfile = path.join(self.getBuildDir(), self.allmoduleinfo[mode].Build_Make) + with open(buildfile) as f: + text = f.read() + + lines = re.findall(".*?: .*?CMakeFiles/.*?\\.dir/.*?\\.o\\n", text) + lines = [l.replace(".o", "\",") for l in lines] + + self.adjustSources(mode, lines) + + #make source pretty + return INDENT * 2 + "".join(lines).strip() + + def getLibrary(self, mode, reg1, reg2, reg3): + if not mode in list(self.allmoduleinfo.keys()): + raise Exception("Invalid index of module info") + + buildfile = path.join(self.getBuildDir(), self.allmoduleinfo[mode].Build_Make) + with open(buildfile) as f: + text = f.read() + + lines = re.findall(reg1, text) + if (0 == len(lines)): + return "" + + all_lib = "" + for i, l in enumerate(lines): + if 0 == len(l) or re.search("(?<=" + self.allmoduleinfo[mode].Module_Name + reg2, l): + continue + + j = l.rfind(": ") + if 0 > j: + continue + + l = l[(j + 2):] + j = l.rfind('/') + all_lib += INDENT * 2 + "\"" + re.sub(reg3, "\",", l[(j + 1):] if 0 <= j else l) + + return all_lib \ No newline at end of file diff --git a/scripts/cleanvplruntimegenerator.py b/scripts/cleanvplruntimegenerator.py new file mode 100755 index 00000000..3a881b78 --- /dev/null +++ b/scripts/cleanvplruntimegenerator.py @@ -0,0 +1,50 @@ +#! /usr/bin/env python3 +""" +* Copyright (c) 2019, Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +""" + +import os +import os.path as path +from androidbpgenerator import BUILD_DIR, NOVERBOSE + + +class Main: + + def run(self): + script = path.dirname(__file__) + root = path.abspath(path.join(script, "../..")) + + print(("script = " + script)) + print(("root = " + root)) + + # remove all intermediate files and building directories + print("It is removing building directories and intermediate files for onevpl-runtime ... ") + cmd = "rm -rf " + path.join(script, "__pycache__") + NOVERBOSE + #cmd += "rm -rf " + path.join(script, "../device/") + NOVERBOSE + cmd += "rm -rf " + path.join(root, BUILD_DIR) + NOVERBOSE + #cmd += "find " + path.join(script, "..") + " -name '*\.bp' -type f -delete" + NOVERBOSE + os.system(cmd) + + print("Done ! ") + + +m = Main() +m.run() diff --git a/scripts/vplruntimegenerator.py b/scripts/vplruntimegenerator.py new file mode 100755 index 00000000..330852d9 --- /dev/null +++ b/scripts/vplruntimegenerator.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +""" +* Copyright (c) 2019, Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +""" + +import os +import os.path as path +import re +from androidbpgenerator import INDENT, CCDefaults, ModuleInfo, Generator, NOVERBOSE + +RUN_CALLABLE = True + + +class VplRuntimeGenerator(Generator): + def __init__(self, root): + self.proj = path.join(root, "onevpl-intel-gpu/") + super(VplRuntimeGenerator, self).__init__(self.proj, root) + self.root = root + + self.allmoduleinfo[1] = ModuleInfo("mfx_logging", "mfx_logging.bp", + "_studio/shared/mfx_logging/CMakeFiles/mfx_logging.dir/", "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + self.allmoduleinfo[2] = ModuleInfo("mfx_trace", "mfx_trace.bp", + "_studio/shared/mfx_trace/CMakeFiles/mfx_trace.dir/", "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + self.allmoduleinfo[3] = ModuleInfo("asc", "asc.bp", "_studio/shared/asc/CMakeFiles/asc.dir/", + "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + + self.allmoduleinfo[4] = ModuleInfo("umc_va_hw", "umc_va_hw.bp", "_studio/shared/umc/CMakeFiles/umc_va_hw.dir/", + "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + self.allmoduleinfo[5] = ModuleInfo("libumc_codecs", "libumc_codecs.bp", "_studio/shared/umc/CMakeFiles/bitrate_control.dir/", + "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + self.allmoduleinfo[6] = ModuleInfo("vpp", "vpp.bp", "_studio/mfx_lib/vpp/CMakeFiles/vpp_hw.dir/", + "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + self.allmoduleinfo[7] = ModuleInfo("mfx_common_hw", "mfx_common_hw.bp", "_studio/mfx_lib/shared/CMakeFiles/mfx_common_hw.dir/", + "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + self.allmoduleinfo[8] = ModuleInfo("mfx_ext", "mfx_ext.bp", "_studio/mfx_lib/ext/CMakeFiles/mfx_ext.dir/", + "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + self.allmoduleinfo[9] = ModuleInfo("encode_hw", "encode_hw.bp", "_studio/mfx_lib/encode_hw/CMakeFiles/encode_hw.dir/", + "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + self.allmoduleinfo[10] = ModuleInfo("decode_hw", "decode_hw.bp", "_studio/mfx_lib/decode/CMakeFiles/decode_hw.dir/", + "library_static", "vpl-runtime-defaults", + # updateflags = {"-Wclobbered" : "", "-Werror" : "", "-mindirect-branch-register" : "", "-Wimplicit-fallthrough=4" : "", "-Wno-noexcept-type" : "", + # "-Wno-unused-but-set-variable" : "", }, + ) + + + self.allmoduledefaults = CCDefaults(self.proj, "vpl-runtime-defaults", + cflags = ["-Wno-non-virtual-dtor","-fexceptions","-msse4.1","-fstack-protector","-fPIE","-fPIC","-pie","-O2","-D_FORTIFY_SOURCE=2","-Wformat","-Wformat-security", + "-fexceptions","-frtti","-Wno-unused-command-line-argument","-mavx2","-fexceptions","-Wall","-Werror","-Wextra","-Wno-unused-parameter","-Wno-macro-redefined","-Wno-unused-parameter"], + cppflags = ["-Wno-error", "-fexceptions", "-msse4.2", "-mavx2", "-D__AVX2__", "-mretpoline", + "-Wshorten-64-to-32", "-Wno-extern-c-compat", "-Wno-instantiation-after-specialization", "-DSANITIZER_BUILD", "-Wno-deprecated-register", "-Wno-deprecated-copy", + "-Wno-deprecated-declarations","-Wno-missing-field-initializers","-Wno-implicit-fallthrough","-DMFX_ONEVPL","-DMFX_VA","-DMFX_VERSION_USE_LATEST","-DMFX_DEPRECATED_OFF", + "-DONEVPL_EXPERIMENTAL","-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE","-D_FILE_OFFSET_BITS=64","-D__USE_LARGEFILE64","-DMFX_GIT_COMMIT=c6573984","-DMFX_API_VERSION=2.10","-DNDEBUG", + "-DMSDK_BUILD=","-Wno-unused-command-line-argument","-frtti"], + include_dirs = ["hardware/intel/external/libva", + "vendor/intel/external/onevpl-intel-gpu/android/include/"], + shared_libs = ["libgmm_umd","libva","libcutils","libdrm"], + bpfiles = [ + "mfx_logging.bp", + "mfx_trace.bp", + "asc.bp", + "umc_va_hw.bp", + "libumc_codecs.bp", + "vpp.bp", + "mfx_common_hw.bp", + "mfx_ext.bp", + "encode_hw.bp", + "decode_hw.bp", + ], ) + + def getTemplate(self): + return "onevpl-runtime.tpl" + + def adjustSources(self, mode, all_sources): + for i, l in enumerate(all_sources): + all_sources[i] = INDENT * 2 + "\"" + re.sub(r".*?: " + self.allmoduleinfo[mode].Mid_Dir, "", + re.sub("CMakeFiles/.*?\\.dir/", "", l.replace("__/", "../"))) + + def adjustFlags(self, mode, all_flags, is_add = True): + update_flags = self.allmoduleinfo[mode].Update_Flags + add_flags = self.allmoduleinfo[mode].Add_Flags + + for i, f in enumerate(update_flags): + all_flags = re.sub(INDENT * 2 + "\"" + f + "\",\n", update_flags[f], all_flags) + + if is_add: + all_flags += "\n" + + for i, f in enumerate(add_flags): + all_flags += INDENT * 2 + "\"" + f + "\",\n" + + return all_flags + + def adjustFiles(self): + print("It is adjusting some files for vpl-runtime ... ") + build_dir = self.getBuildDir() + cmd = "mkdir -p " + path.join(self.proj, "device/include/") + NOVERBOSE + cmd += "mkdir -p " + path.join(self.proj, "device/built_ins/x64/gen12lp/") + NOVERBOSE + cmd += "mkdir -p " + path.join(self.proj, "device/built_ins/x64/xe_hpc_core/") + NOVERBOSE + cmd += "mkdir -p " + path.join(self.proj, "device/built_ins/x64/xe_hpg_core/") + NOVERBOSE + cmd += "cp -f " + path.join(build_dir, "*.h") + " " + path.join(self.proj, "device/include/") + NOVERBOSE + cmd += "cp -f " + path.join(build_dir, "bin/built_ins/x64/gen12lp/*.cpp") + " " + path.join(self.proj, "device/built_ins/x64/gen12lp/") + NOVERBOSE + cmd += "cp -f " + path.join(build_dir, "bin/built_ins/x64/xe_hpc_core/*.cpp") + " " + path.join(self.proj, "device/built_ins/x64/xe_hpc_core/") + NOVERBOSE + cmd += "cp -f " + path.join(build_dir, "bin/built_ins/x64/xe_hpg_core/*.cpp") + " " + path.join(self.proj, "device/built_ins/x64/xe_hpg_core/") + NOVERBOSE + os.system(cmd) + +class Main: + + def run(self): + script = path.dirname(__file__) + print(path) + root = path.abspath(path.join(script, "../..")) + + print(("script = " + script)) + print(("root = " + root)) + + VplRuntimeGenerator(root).generate(to_make = False) + + +if RUN_CALLABLE: + m = Main() + m.run() diff --git a/umc_va_hw.bp b/umc_va_hw.bp new file mode 100644 index 00000000..39e6eeb7 --- /dev/null +++ b/umc_va_hw.bp @@ -0,0 +1,68 @@ +cc_library_static { + name: "umc_va_hw", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/shared/umc/io/umc_va/src/umc_va_linux.cpp", + "_studio/shared/umc/io/umc_va/src/umc_va_video_processing.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/shared/umc/io/umc_va/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/include", + "_studio/mfx_lib/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/vm_plus/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file diff --git a/vpp.bp b/vpp.bp new file mode 100644 index 00000000..a9cf517d --- /dev/null +++ b/vpp.bp @@ -0,0 +1,98 @@ +cc_library_static { + name: "vpp", + + vendor: true, + + defaults: [ + "vpl-runtime-defaults", + ], + + srcs: [ + "_studio/mfx_lib/vpp/src/mfx_denoise_vpp.cpp", + "_studio/mfx_lib/vpp/src/mfx_detail_enhancement_vpp.cpp", + "_studio/mfx_lib/vpp/src/mfx_frame_rate_conversion_vpp.cpp", + "_studio/mfx_lib/vpp/src/mfx_perc_enc_vpp.cpp", + "_studio/mfx_lib/vpp/src/mfx_procamp_vpp.cpp", + "_studio/mfx_lib/vpp/src/mfx_vpp_factory.cpp", + "_studio/mfx_lib/vpp/src/mfx_vpp_hw.cpp", + "_studio/mfx_lib/vpp/src/mfx_vpp_main.cpp", + "_studio/mfx_lib/vpp/src/mfx_vpp_mvc.cpp", + "_studio/mfx_lib/vpp/src/mfx_vpp_sw_core.cpp", + "_studio/mfx_lib/vpp/src/mfx_vpp_sw_internal.cpp", + "_studio/mfx_lib/vpp/src/mfx_vpp_utils.cpp", + "_studio/mfx_lib/vpp/src/mfx_vpp_jpeg.cpp", + ], + + cflags: [ + + ], + + cppflags: [ + "-O3", + "-DNDEBUG", + "-fPIC", + "-Wno-deprecated-declarations", + "-Wno-unknown-pragmas", + "-Wno-unused", + "-std=gnu++14", + "-DLINUX", + "-DLINUX32", + "-DLINUX64", + "-DMEDIA_VERSION_STR=24.1.5", + "-DMFX_API_VERSION=2.9+", + "-DMFX_BUILD_INFO=Ubuntu | GNU 11.4.0 | glibc 2.35", + "-DMFX_DEPRECATED_OFF", + "-DMFX_GIT_COMMIT=9c1340b5", + "-DMFX_ONEVPL", + "-DMFX_VERSION_USE_LATEST", + "-DMSDK_BUILD=", + "-DNDEBUG", + "-DONEVPL_EXPERIMENTAL", + "-DSYNCHRONIZATION_BY_VA_SYNC_SURFACE", + "-D_FILE_OFFSET_BITS=64", + "-D__USE_LARGEFILE64", + ], + + local_include_dirs: [ + "_studio/mfx_lib/vpp/include", + "_studio/shared/include", + "_studio/mfx_lib/shared/include", + "build", + "api/vpl", + "api/mediasdk_structures", + "api/vpl/private", + "contrib/ipp/include", + "_studio/shared/umc/io/umc_va/include", + "_studio/shared/umc/core/umc/include", + "_studio/shared/mfx_logging/include", + "_studio/shared/umc/core/vm/include", + "_studio/shared/umc/core/vm_plus/include", + "_studio/shared/asc/include", + "_studio/mfx_lib/ext/genx/asc/isa", + "_studio/mfx_lib/ext/genx/copy_kernels/isa", + "_studio/mfx_lib/ext/genx/field_copy/isa", + "_studio/mfx_lib/ext/genx/h264_encode/isa", + "_studio/mfx_lib/ext/genx/mctf/isa", + "_studio/mfx_lib/ext/mctf_package/mctf/include", + "_studio/mfx_lib/ext/h264/include", + "_studio/shared/umc/codec/brc/include", + "_studio/mfx_lib/encode_hw/h264/include", + "_studio/mfx_lib/ext/mpeg2/include", + "_studio/shared/enctools/include", + "_studio/mfx_lib/ext/asc/include", + "_studio/mfx_lib/ext/cmrt_cross_platform/include", + "_studio/shared/umc/codec/h265_dec/include", + "_studio/shared/umc/codec/h264_dec/include", + "_studio/shared/umc/codec/av1_dec/include", + "_studio/shared/umc/codec/vp9_dec/include", + ], + + shared_libs: [ + + ], + + static_libs: [ + + ], + +} \ No newline at end of file