MoonchildProductions/UXP#2897: Fix ffvpx build on loongarch64

This commit is contained in:
Basilisk-Dev 2026-01-07 17:49:32 -05:00 committed by ownedbywuigi
commit d7963fcc9e
18 changed files with 3559 additions and 23 deletions

View file

@ -28,6 +28,20 @@
#elif defined(XP_DARWIN)
#include "config_darwin64.h"
#elif defined(XP_UNIX)
<<<<<<< HEAD
=======
#if defined(__aarch64__)
#include "config_unix_aarch64.h"
#elif defined(__alpha) || defined(__alpha__)
#include "config_unix_alpha.h"
#elif defined(__powerpc__)
#include "config_unix_ppc.h"
#elif defined(__sparcv9) || defined(__sparcv9__)
#include "config_unix_sparc64.h"
#elif defined(__loongarch64)
#include "config_unix_loongarch64.h"
#else
>>>>>>> fb438829b5 (MoonchildProductions/UXP#2897: Fix ffvpx build on loongarch64)
#if defined(HAVE_64BIT_BUILD)
#include "config_unix64.h"
#else

View file

@ -0,0 +1,769 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "--disable-all --enable-avcodec --enable-decoder='vp8,vp9,' --enable-parser='vp8,vp9' --disable-static --enable-shared --disable-autodetect"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2025
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
#define CC_IDENT "gcc 14.2.0 (GCC)"
#define OS_NAME linux
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
#define BUILDSUF ""
#define SLIBSUF ".so"
#define HAVE_MMX2 HAVE_MMXEXT
#define SWS_MAX_FILTER_SIZE 256
#define ARCH_AARCH64 0
#define ARCH_ALPHA 0
#define ARCH_ARM 0
#define ARCH_AVR32 0
#define ARCH_AVR32_AP 0
#define ARCH_AVR32_UC 0
#define ARCH_BFIN 0
#define ARCH_IA64 0
#define ARCH_LOONGARCH 1
#define ARCH_LOONGARCH32 0
#define ARCH_LOONGARCH64 1
#define ARCH_M68K 0
#define ARCH_MIPS 0
#define ARCH_MIPS64 0
#define ARCH_PARISC 0
#define ARCH_PPC 0
#define ARCH_PPC64 0
#define ARCH_RISCV 0
#define ARCH_S390 0
#define ARCH_SH4 0
#define ARCH_SPARC 0
#define ARCH_SPARC64 0
#define ARCH_TILEGX 0
#define ARCH_TILEPRO 0
#define ARCH_X86 0
#define ARCH_X86_32 0
#define ARCH_X86_64 0
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
#define HAVE_ARMV8 0
#define HAVE_DOTPROD 0
#define HAVE_I8MM 0
#define HAVE_NEON 0
#define HAVE_VFP 0
#define HAVE_VFPV3 0
#define HAVE_SETEND 0
#define HAVE_ALTIVEC 0
#define HAVE_DCBZL 0
#define HAVE_LDBRX 0
#define HAVE_POWER8 0
#define HAVE_PPC4XX 0
#define HAVE_VEC_XL 0
#define HAVE_VSX 0
#define HAVE_RV 0
#define HAVE_RVV 0
#define HAVE_AESNI 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
#define HAVE_AVX 0
#define HAVE_AVX2 0
#define HAVE_AVX512 0
#define HAVE_AVX512ICL 0
#define HAVE_FMA3 0
#define HAVE_FMA4 0
#define HAVE_MMX 0
#define HAVE_MMXEXT 0
#define HAVE_SSE 0
#define HAVE_SSE2 0
#define HAVE_SSE3 0
#define HAVE_SSE4 0
#define HAVE_SSE42 0
#define HAVE_SSSE3 0
#define HAVE_XOP 0
#define HAVE_CPUNOP 0
#define HAVE_I686 0
#define HAVE_MIPSFPU 0
#define HAVE_MIPS32R2 0
#define HAVE_MIPS32R5 0
#define HAVE_MIPS64R2 0
#define HAVE_MIPS32R6 0
#define HAVE_MIPS64R6 0
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
#define HAVE_LSX 0
#define HAVE_LASX 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
#define HAVE_ARMV8_EXTERNAL 0
#define HAVE_DOTPROD_EXTERNAL 0
#define HAVE_I8MM_EXTERNAL 0
#define HAVE_NEON_EXTERNAL 0
#define HAVE_VFP_EXTERNAL 0
#define HAVE_VFPV3_EXTERNAL 0
#define HAVE_SETEND_EXTERNAL 0
#define HAVE_ALTIVEC_EXTERNAL 0
#define HAVE_DCBZL_EXTERNAL 0
#define HAVE_LDBRX_EXTERNAL 0
#define HAVE_POWER8_EXTERNAL 0
#define HAVE_PPC4XX_EXTERNAL 0
#define HAVE_VEC_XL_EXTERNAL 0
#define HAVE_VSX_EXTERNAL 0
#define HAVE_RV_EXTERNAL 0
#define HAVE_RVV_EXTERNAL 0
#define HAVE_AESNI_EXTERNAL 0
#define HAVE_AMD3DNOW_EXTERNAL 0
#define HAVE_AMD3DNOWEXT_EXTERNAL 0
#define HAVE_AVX_EXTERNAL 0
#define HAVE_AVX2_EXTERNAL 0
#define HAVE_AVX512_EXTERNAL 0
#define HAVE_AVX512ICL_EXTERNAL 0
#define HAVE_FMA3_EXTERNAL 0
#define HAVE_FMA4_EXTERNAL 0
#define HAVE_MMX_EXTERNAL 0
#define HAVE_MMXEXT_EXTERNAL 0
#define HAVE_SSE_EXTERNAL 0
#define HAVE_SSE2_EXTERNAL 0
#define HAVE_SSE3_EXTERNAL 0
#define HAVE_SSE4_EXTERNAL 0
#define HAVE_SSE42_EXTERNAL 0
#define HAVE_SSSE3_EXTERNAL 0
#define HAVE_XOP_EXTERNAL 0
#define HAVE_CPUNOP_EXTERNAL 0
#define HAVE_I686_EXTERNAL 0
#define HAVE_MIPSFPU_EXTERNAL 0
#define HAVE_MIPS32R2_EXTERNAL 0
#define HAVE_MIPS32R5_EXTERNAL 0
#define HAVE_MIPS64R2_EXTERNAL 0
#define HAVE_MIPS32R6_EXTERNAL 0
#define HAVE_MIPS64R6_EXTERNAL 0
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
#define HAVE_LSX_EXTERNAL 0
#define HAVE_LASX_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
#define HAVE_ARMV8_INLINE 0
#define HAVE_DOTPROD_INLINE 0
#define HAVE_I8MM_INLINE 0
#define HAVE_NEON_INLINE 0
#define HAVE_VFP_INLINE 0
#define HAVE_VFPV3_INLINE 0
#define HAVE_SETEND_INLINE 0
#define HAVE_ALTIVEC_INLINE 0
#define HAVE_DCBZL_INLINE 0
#define HAVE_LDBRX_INLINE 0
#define HAVE_POWER8_INLINE 0
#define HAVE_PPC4XX_INLINE 0
#define HAVE_VEC_XL_INLINE 0
#define HAVE_VSX_INLINE 0
#define HAVE_RV_INLINE 0
#define HAVE_RVV_INLINE 0
#define HAVE_AESNI_INLINE 0
#define HAVE_AMD3DNOW_INLINE 0
#define HAVE_AMD3DNOWEXT_INLINE 0
#define HAVE_AVX_INLINE 0
#define HAVE_AVX2_INLINE 0
#define HAVE_AVX512_INLINE 0
#define HAVE_AVX512ICL_INLINE 0
#define HAVE_FMA3_INLINE 0
#define HAVE_FMA4_INLINE 0
#define HAVE_MMX_INLINE 0
#define HAVE_MMXEXT_INLINE 0
#define HAVE_SSE_INLINE 0
#define HAVE_SSE2_INLINE 0
#define HAVE_SSE3_INLINE 0
#define HAVE_SSE4_INLINE 0
#define HAVE_SSE42_INLINE 0
#define HAVE_SSSE3_INLINE 0
#define HAVE_XOP_INLINE 0
#define HAVE_CPUNOP_INLINE 0
#define HAVE_I686_INLINE 0
#define HAVE_MIPSFPU_INLINE 0
#define HAVE_MIPS32R2_INLINE 0
#define HAVE_MIPS32R5_INLINE 0
#define HAVE_MIPS64R2_INLINE 0
#define HAVE_MIPS32R6_INLINE 0
#define HAVE_MIPS64R6_INLINE 0
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
#define HAVE_LSX_INLINE 0
#define HAVE_LASX_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
#define HAVE_FAST_CMOV 0
#define HAVE_FAST_FLOAT16 0
#define HAVE_LOCAL_ALIGNED 1
#define HAVE_SIMD_ALIGN_16 0
#define HAVE_SIMD_ALIGN_32 1
#define HAVE_SIMD_ALIGN_64 0
#define HAVE_ATOMIC_CAS_PTR 0
#define HAVE_MACHINE_RW_BARRIER 0
#define HAVE_MEMORYBARRIER 0
#define HAVE_MM_EMPTY 0
#define HAVE_RDTSC 0
#define HAVE_SEM_TIMEDWAIT 1
#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_INLINE_ASM 1
#define HAVE_SYMVER 1
#define HAVE_X86ASM 0
#define HAVE_BIGENDIAN 0
#define HAVE_FAST_UNALIGNED 1
#define HAVE_ARPA_INET_H 1
#define HAVE_ASM_TYPES_H 1
#define HAVE_CDIO_PARANOIA_H 0
#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
#define HAVE_CUDA_H 0
#define HAVE_DISPATCH_DISPATCH_H 0
#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
#define HAVE_DEV_IC_BT8XX_H 0
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
#define HAVE_DIRENT_H 1
#define HAVE_DXGIDEBUG_H 0
#define HAVE_DXVA_H 0
#define HAVE_ES2_GL_H 0
#define HAVE_GSM_H 0
#define HAVE_IO_H 0
#define HAVE_LINUX_DMA_BUF_H 0
#define HAVE_LINUX_PERF_EVENT_H 1
#define HAVE_MACHINE_IOCTL_BT848_H 0
#define HAVE_MACHINE_IOCTL_METEOR_H 0
#define HAVE_MALLOC_H 1
#define HAVE_OPENCV2_CORE_CORE_C_H 0
#define HAVE_OPENGL_GL3_H 0
#define HAVE_POLL_H 1
#define HAVE_PTHREAD_NP_H 0
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SOUNDCARD_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_UN_H 1
#define HAVE_SYS_VIDEOIO_H 0
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
#define HAVE_VALGRIND_VALGRIND_H 1
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
#define HAVE_HYPOT 1
#define HAVE_ISFINITE 1
#define HAVE_ISINF 1
#define HAVE_ISNAN 1
#define HAVE_LDEXPF 1
#define HAVE_LLRINT 1
#define HAVE_LLRINTF 1
#define HAVE_LOG2 1
#define HAVE_LOG2F 1
#define HAVE_LOG10F 1
#define HAVE_LRINT 1
#define HAVE_LRINTF 1
#define HAVE_POWF 1
#define HAVE_RINT 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SINF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_DOS_PATHS 0
#define HAVE_LIBC_MSVCRT 0
#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0
#define HAVE_SECTION_DATA_REL_RO 1
#define HAVE_THREADS 1
#define HAVE_UWP 0
#define HAVE_WINRT 0
#define HAVE_ACCESS 1
#define HAVE_ALIGNED_MALLOC 0
#define HAVE_ARC4RANDOM_BUF 0
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOSESOCKET 0
#define HAVE_COMMANDLINETOARGVW 0
#define HAVE_FCNTL 1
#define HAVE_GETADDRINFO 1
#define HAVE_GETAUXVAL 1
#define HAVE_GETENV 1
#define HAVE_GETHRTIME 0
#define HAVE_GETOPT 1
#define HAVE_GETMODULEHANDLE 0
#define HAVE_GETPROCESSAFFINITYMASK 0
#define HAVE_GETPROCESSMEMORYINFO 0
#define HAVE_GETPROCESSTIMES 0
#define HAVE_GETRUSAGE 1
#define HAVE_GETSTDHANDLE 0
#define HAVE_GETSYSTEMTIMEASFILETIME 0
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GLOB 1
#define HAVE_GLXGETPROCADDRESS 0
#define HAVE_GMTIME_R 1
#define HAVE_INET_ATON 1
#define HAVE_ISATTY 1
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
#define HAVE_MEMALIGN 1
#define HAVE_MKSTEMP 1
#define HAVE_MMAP 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
#define HAVE_PEEKNAMEDPIPE 0
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_PRCTL 1
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_PTHREAD_SET_NAME_NP 0
#define HAVE_PTHREAD_SETNAME_NP 0
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SECITEMIMPORT 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETDLLDIRECTORY 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
#define HAVE_STRERROR_R 1
#define HAVE_SYSCONF 1
#define HAVE_SYSCTL 0
#define HAVE_SYSCTLBYNAME 0
#define HAVE_USLEEP 1
#define HAVE_UTGETOSTYPEFROMSTRING 0
#define HAVE_VIRTUALALLOC 0
#define HAVE_WGLGETPROCADDRESS 0
#define HAVE_BCRYPT 0
#define HAVE_VAAPI_DRM 0
#define HAVE_VAAPI_X11 0
#define HAVE_VAAPI_WIN32 0
#define HAVE_VDPAU_X11 0
#define HAVE_PTHREADS 1
#define HAVE_OS2THREADS 0
#define HAVE_W32THREADS 0
#define HAVE_AS_ARCH_DIRECTIVE 0
#define HAVE_AS_ARCHEXT_DOTPROD_DIRECTIVE 0
#define HAVE_AS_ARCHEXT_I8MM_DIRECTIVE 0
#define HAVE_AS_DN_DIRECTIVE 0
#define HAVE_AS_FPU_DIRECTIVE 0
#define HAVE_AS_FUNC 0
#define HAVE_AS_OBJECT_ARCH 0
#define HAVE_ASM_MOD_Q 0
#define HAVE_BLOCKS_EXTENSION 0
#define HAVE_EBP_AVAILABLE 0
#define HAVE_EBX_AVAILABLE 0
#define HAVE_GNU_AS 0
#define HAVE_GNU_WINDRES 0
#define HAVE_IBM_ASM 0
#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
#define HAVE_INLINE_ASM_LABELS 1
#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
#define HAVE_PRAGMA_DEPRECATED 1
#define HAVE_RSYNC_CONTIMEOUT 1
#define HAVE_SYMVER_ASM_LABEL 0
#define HAVE_SYMVER_GNU_ASM 1
#define HAVE_VFP_ARGS 0
#define HAVE_XFORM_ASM 0
#define HAVE_XMM_CLOBBERS 0
#define HAVE_DPI_AWARENESS_CONTEXT 0
#define HAVE_IDXGIOUTPUT5 0
#define HAVE_KCMVIDEOCODECTYPE_HEVC 0
#define HAVE_KCMVIDEOCODECTYPE_HEVCWITHALPHA 0
#define HAVE_KCMVIDEOCODECTYPE_VP9 0
#define HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_422YPCBCR8BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_422YPCBCR10BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_422YPCBCR16BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_444YPCBCR8BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_444YPCBCR10BIPLANARVIDEORANGE 0
#define HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_LINEAR 0
#define HAVE_KCVIMAGEBUFFERYCBCRMATRIX_ITU_R_2020 0
#define HAVE_KCVIMAGEBUFFERCOLORPRIMARIES_ITU_R_2020 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2020 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_428_1 0
#define HAVE_SOCKLEN_T 1
#define HAVE_STRUCT_ADDRINFO 1
#define HAVE_STRUCT_GROUP_SOURCE_REQ 1
#define HAVE_STRUCT_IP_MREQ_SOURCE 1
#define HAVE_STRUCT_IPV6_MREQ 1
#define HAVE_STRUCT_MSGHDR_MSG_FLAGS 1
#define HAVE_STRUCT_POLLFD 1
#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
#define HAVE_STRUCT_SOCKADDR_IN6 1
#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
#define HAVE_GZIP 1
#define HAVE_LIBDRM_GETFB2 0
#define HAVE_MAKEINFO 1
#define HAVE_MAKEINFO_HTML 1
#define HAVE_OPENCL_D3D11 0
#define HAVE_OPENCL_DRM_ARM 0
#define HAVE_OPENCL_DRM_BEIGNET 0
#define HAVE_OPENCL_DXVA2 0
#define HAVE_OPENCL_VAAPI_BEIGNET 0
#define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_POSIX_IOCTL 0
#define HAVE_TEXI2HTML 0
#define HAVE_XMLLINT 1
#define HAVE_ZLIB_GZIP 0
#define HAVE_OPENVINO2 0
#define CONFIG_DOC 0
#define CONFIG_HTMLPAGES 1
#define CONFIG_MANPAGES 1
#define CONFIG_PODPAGES 1
#define CONFIG_TXTPAGES 1
#define CONFIG_AVIO_HTTP_SERVE_FILES_EXAMPLE 1
#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
#define CONFIG_AVIO_READ_CALLBACK_EXAMPLE 1
#define CONFIG_DECODE_AUDIO_EXAMPLE 1
#define CONFIG_DECODE_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_DECODE_FILTER_VIDEO_EXAMPLE 0
#define CONFIG_DECODE_VIDEO_EXAMPLE 1
#define CONFIG_DEMUX_DECODE_EXAMPLE 0
#define CONFIG_ENCODE_AUDIO_EXAMPLE 1
#define CONFIG_ENCODE_VIDEO_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 0
#define CONFIG_FILTER_AUDIO_EXAMPLE 0
#define CONFIG_HW_DECODE_EXAMPLE 0
#define CONFIG_MUX_EXAMPLE 0
#define CONFIG_QSV_DECODE_EXAMPLE 0
#define CONFIG_REMUX_EXAMPLE 0
#define CONFIG_RESAMPLE_AUDIO_EXAMPLE 0
#define CONFIG_SCALE_VIDEO_EXAMPLE 0
#define CONFIG_SHOW_METADATA_EXAMPLE 0
#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
#define CONFIG_TRANSCODE_EXAMPLE 0
#define CONFIG_VAAPI_ENCODE_EXAMPLE 0
#define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0
#define CONFIG_QSV_TRANSCODE_EXAMPLE 0
#define CONFIG_AVISYNTH 0
#define CONFIG_FREI0R 0
#define CONFIG_LIBCDIO 0
#define CONFIG_LIBDAVS2 0
#define CONFIG_LIBRUBBERBAND 0
#define CONFIG_LIBVIDSTAB 0
#define CONFIG_LIBX264 0
#define CONFIG_LIBX265 0
#define CONFIG_LIBXAVS 0
#define CONFIG_LIBXAVS2 0
#define CONFIG_LIBXVID 0
#define CONFIG_DECKLINK 0
#define CONFIG_LIBFDK_AAC 0
#define CONFIG_LIBTLS 0
#define CONFIG_GMP 0
#define CONFIG_LIBARIBB24 0
#define CONFIG_LIBLENSFUN 0
#define CONFIG_LIBOPENCORE_AMRNB 0
#define CONFIG_LIBOPENCORE_AMRWB 0
#define CONFIG_LIBVO_AMRWBENC 0
#define CONFIG_MBEDTLS 0
#define CONFIG_RKMPP 0
#define CONFIG_LIBSMBCLIENT 0
#define CONFIG_CHROMAPRINT 0
#define CONFIG_GCRYPT 0
#define CONFIG_GNUTLS 0
#define CONFIG_JNI 0
#define CONFIG_LADSPA 0
#define CONFIG_LCMS2 0
#define CONFIG_LIBAOM 0
#define CONFIG_LIBARIBCAPTION 0
#define CONFIG_LIBASS 0
#define CONFIG_LIBBLURAY 0
#define CONFIG_LIBBS2B 0
#define CONFIG_LIBCACA 0
#define CONFIG_LIBCELT 0
#define CONFIG_LIBCODEC2 0
#define CONFIG_LIBDAV1D 0
#define CONFIG_LIBDC1394 0
#define CONFIG_LIBDRM 0
#define CONFIG_LIBFLITE 0
#define CONFIG_LIBFONTCONFIG 0
#define CONFIG_LIBFREETYPE 0
#define CONFIG_LIBFRIBIDI 0
#define CONFIG_LIBHARFBUZZ 0
#define CONFIG_LIBGLSLANG 0
#define CONFIG_LIBGME 0
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
#define CONFIG_LIBJACK 0
#define CONFIG_LIBJXL 0
#define CONFIG_LIBKLVANC 0
#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
#define CONFIG_LIBMYSOFA 0
#define CONFIG_LIBOPENCV 0
#define CONFIG_LIBOPENH264 0
#define CONFIG_LIBOPENJPEG 0
#define CONFIG_LIBOPENMPT 0
#define CONFIG_LIBOPENVINO 0
#define CONFIG_LIBOPUS 0
#define CONFIG_LIBPLACEBO 0
#define CONFIG_LIBPULSE 0
#define CONFIG_LIBRABBITMQ 0
#define CONFIG_LIBRAV1E 0
#define CONFIG_LIBRIST 0
#define CONFIG_LIBRSVG 0
#define CONFIG_LIBRTMP 0
#define CONFIG_LIBSHADERC 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSRT 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSVTAV1 0
#define CONFIG_LIBTENSORFLOW 0
#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUAVS3D 0
#define CONFIG_LIBV4L2 0
#define CONFIG_LIBVMAF 0
#define CONFIG_LIBVORBIS 0
#define CONFIG_LIBVPX 0
#define CONFIG_LIBWEBP 0
#define CONFIG_LIBXML2 0
#define CONFIG_LIBZIMG 0
#define CONFIG_LIBZMQ 0
#define CONFIG_LIBZVBI 0
#define CONFIG_LV2 0
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
#define CONFIG_OPENSSL 0
#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
#define CONFIG_AVFOUNDATION 0
#define CONFIG_BZLIB 0
#define CONFIG_COREIMAGE 0
#define CONFIG_ICONV 1
#define CONFIG_LIBXCB 0
#define CONFIG_LIBXCB_SHM 0
#define CONFIG_LIBXCB_SHAPE 0
#define CONFIG_LIBXCB_XFIXES 0
#define CONFIG_LZMA 0
#define CONFIG_MEDIAFOUNDATION 0
#define CONFIG_METAL 0
#define CONFIG_SCHANNEL 0
#define CONFIG_SDL2 0
#define CONFIG_SECURETRANSPORT 0
#define CONFIG_SNDIO 0
#define CONFIG_XLIB 0
#define CONFIG_ZLIB 0
#define CONFIG_CUDA_NVCC 0
#define CONFIG_CUDA_SDK 0
#define CONFIG_LIBNPP 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBVPL 0
#define CONFIG_MMAL 0
#define CONFIG_OMX 0
#define CONFIG_OPENCL 0
#define CONFIG_AMF 0
#define CONFIG_AUDIOTOOLBOX 0
#define CONFIG_CRYSTALHD 0
#define CONFIG_CUDA 0
#define CONFIG_CUDA_LLVM 0
#define CONFIG_CUVID 0
#define CONFIG_D3D11VA 0
#define CONFIG_DXVA2 0
#define CONFIG_FFNVCODEC 0
#define CONFIG_NVDEC 0
#define CONFIG_NVENC 0
#define CONFIG_VAAPI 0
#define CONFIG_VDPAU 0
#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_VULKAN 0
#define CONFIG_V4L2_M2M 0
#define CONFIG_FTRAPV 0
#define CONFIG_GRAY 0
#define CONFIG_HARDCODED_TABLES 0
#define CONFIG_OMX_RPI 0
#define CONFIG_RUNTIME_CPUDETECT 1
#define CONFIG_SAFE_BITSTREAM_READER 1
#define CONFIG_SHARED 1
#define CONFIG_SMALL 0
#define CONFIG_STATIC 0
#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
#define CONFIG_VERSION3 0
#define CONFIG_AVDEVICE 0
#define CONFIG_AVFILTER 0
#define CONFIG_SWSCALE 0
#define CONFIG_POSTPROC 0
#define CONFIG_AVFORMAT 0
#define CONFIG_AVCODEC 1
#define CONFIG_SWRESAMPLE 0
#define CONFIG_AVUTIL 1
#define CONFIG_FFPLAY 0
#define CONFIG_FFPROBE 0
#define CONFIG_FFMPEG 0
#define CONFIG_DWT 0
#define CONFIG_ERROR_RESILIENCE 0
#define CONFIG_FAAN 1
#define CONFIG_FAST_UNALIGNED 1
#define CONFIG_LSP 0
#define CONFIG_PIXELUTILS 0
#define CONFIG_NETWORK 0
#define CONFIG_AUTODETECT 0
#define CONFIG_FONTCONFIG 0
#define CONFIG_LARGE_TESTS 1
#define CONFIG_LINUX_PERF 0
#define CONFIG_MACOS_KPERF 0
#define CONFIG_MEMORY_POISONING 0
#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_OSSFUZZ 0
#define CONFIG_PIC 1
#define CONFIG_PTX_COMPRESSION 0
#define CONFIG_THUMB 0
#define CONFIG_VALGRIND_BACKTRACE 0
#define CONFIG_XMM_CLOBBER_TEST 0
#define CONFIG_BSFS 0
#define CONFIG_DECODERS 1
#define CONFIG_ENCODERS 0
#define CONFIG_HWACCELS 0
#define CONFIG_PARSERS 1
#define CONFIG_INDEVS 0
#define CONFIG_OUTDEVS 0
#define CONFIG_FILTERS 0
#define CONFIG_DEMUXERS 0
#define CONFIG_MUXERS 0
#define CONFIG_PROTOCOLS 0
#define CONFIG_AANDCTTABLES 0
#define CONFIG_AC3DSP 0
#define CONFIG_ADTS_HEADER 0
#define CONFIG_ATSC_A53 0
#define CONFIG_AUDIO_FRAME_QUEUE 0
#define CONFIG_AUDIODSP 0
#define CONFIG_BLOCKDSP 0
#define CONFIG_BSWAPDSP 0
#define CONFIG_CABAC 0
#define CONFIG_CBS 0
#define CONFIG_CBS_AV1 0
#define CONFIG_CBS_H264 0
#define CONFIG_CBS_H265 0
#define CONFIG_CBS_H266 0
#define CONFIG_CBS_JPEG 0
#define CONFIG_CBS_MPEG2 0
#define CONFIG_CBS_VP9 0
#define CONFIG_DEFLATE_WRAPPER 0
#define CONFIG_DIRAC_PARSE 0
#define CONFIG_DNN 0
#define CONFIG_DOVI_RPU 0
#define CONFIG_DVPROFILE 0
#define CONFIG_EVCPARSE 0
#define CONFIG_EXIF 0
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
#define CONFIG_G722DSP 0
#define CONFIG_GOLOMB 0
#define CONFIG_GPLV3 0
#define CONFIG_H263DSP 0
#define CONFIG_H264CHROMA 0
#define CONFIG_H264DSP 0
#define CONFIG_H264PARSE 0
#define CONFIG_H264PRED 1
#define CONFIG_H264QPEL 0
#define CONFIG_H264_SEI 0
#define CONFIG_HEVCPARSE 0
#define CONFIG_HEVC_SEI 0
#define CONFIG_HPELDSP 0
#define CONFIG_HUFFMAN 0
#define CONFIG_HUFFYUVDSP 0
#define CONFIG_HUFFYUVENCDSP 0
#define CONFIG_IDCTDSP 1
#define CONFIG_IIRFILTER 0
#define CONFIG_INFLATE_WRAPPER 0
#define CONFIG_INTRAX8 0
#define CONFIG_ISO_MEDIA 0
#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
#define CONFIG_LGPLV3 0
#define CONFIG_LIBX262 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LLVIDENCDSP 0
#define CONFIG_LPC 0
#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGAUDIOHEADER 0
#define CONFIG_MPEG4AUDIO 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEODEC 0
#define CONFIG_MPEGVIDEOENC 0
#define CONFIG_MSMPEG4DEC 0
#define CONFIG_MSMPEG4ENC 0
#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
#define CONFIG_QSVDEC 0
#define CONFIG_QSVENC 0
#define CONFIG_QSVVPP 0
#define CONFIG_RANGECODER 0
#define CONFIG_RIFFDEC 0
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
#define CONFIG_RV34DSP 0
#define CONFIG_SCENE_SAD 0
#define CONFIG_SINEWIN 0
#define CONFIG_SNAPPY 0
#define CONFIG_SRTP 0
#define CONFIG_STARTCODE 0
#define CONFIG_TEXTUREDSP 0
#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VAAPI_1 0
#define CONFIG_VAAPI_ENCODE 0
#define CONFIG_VC1DSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 0
#define CONFIG_VP56DSP 0
#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
#define CONFIG_WMV2DSP 0
#endif /* FFMPEG_CONFIG_H */

View file

@ -0,0 +1,66 @@
/*
* Copyright (c) 2021 Loongson Technology Corporation Limited
* Contributed by Hao Chen <chenhao@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/loongarch/cpu.h"
#include "libavcodec/h264pred.h"
#include "h264_intrapred_loongarch.h"
av_cold void ff_h264_pred_init_loongarch(H264PredContext *h, int codec_id,
const int bit_depth,
const int chroma_format_idc)
{
int cpu_flags = av_get_cpu_flags();
if (bit_depth == 8) {
if (have_lsx(cpu_flags)) {
if (chroma_format_idc <= 1) {
}
if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {
} else {
if (chroma_format_idc <= 1) {
}
if (codec_id == AV_CODEC_ID_SVQ3) {
h->pred16x16[PLANE_PRED8x8] = ff_h264_pred16x16_plane_svq3_8_lsx;
} else if (codec_id == AV_CODEC_ID_RV40) {
h->pred16x16[PLANE_PRED8x8] = ff_h264_pred16x16_plane_rv40_8_lsx;
} else {
h->pred16x16[PLANE_PRED8x8] = ff_h264_pred16x16_plane_h264_8_lsx;
}
}
}
if (have_lasx(cpu_flags)) {
if (chroma_format_idc <= 1) {
}
if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {
} else {
if (chroma_format_idc <= 1) {
}
if (codec_id == AV_CODEC_ID_SVQ3) {
h->pred16x16[PLANE_PRED8x8] = ff_h264_pred16x16_plane_svq3_8_lasx;
} else if (codec_id == AV_CODEC_ID_RV40) {
h->pred16x16[PLANE_PRED8x8] = ff_h264_pred16x16_plane_rv40_8_lasx;
} else {
h->pred16x16[PLANE_PRED8x8] = ff_h264_pred16x16_plane_h264_8_lasx;
}
}
}
}
}

View file

@ -0,0 +1,35 @@
/*
* Copyright (c) 2023 Loongson Technology Corporation Limited
* Contributed by Hao Chen <chenhao@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_LOONGARCH_H264_INTRAPRED_LOONGARCH_H
#define AVCODEC_LOONGARCH_H264_INTRAPRED_LOONGARCH_H
#include "libavcodec/avcodec.h"
void ff_h264_pred16x16_plane_h264_8_lsx(uint8_t *src, ptrdiff_t stride);
void ff_h264_pred16x16_plane_rv40_8_lsx(uint8_t *src, ptrdiff_t stride);
void ff_h264_pred16x16_plane_svq3_8_lsx(uint8_t *src, ptrdiff_t stride);
void ff_h264_pred16x16_plane_h264_8_lasx(uint8_t *src, ptrdiff_t stride);
void ff_h264_pred16x16_plane_rv40_8_lasx(uint8_t *src, ptrdiff_t stride);
void ff_h264_pred16x16_plane_svq3_8_lasx(uint8_t *src, ptrdiff_t stride);
#endif // #ifndef AVCODEC_LOONGARCH_H264_INTRAPRED_LOONGARCH_H

View file

@ -0,0 +1,15 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
SOURCES += [
'h264_intrapred_init_loongarch.c',
'videodsp_init.c',
'vp8dsp_init_loongarch.c',
'vp9dsp_init_loongarch.c',
]
FINAL_LIBRARY = 'mozavcodec'
include('/media/ffvpx/ffvpxcommon.mozbuild')

View file

@ -0,0 +1,45 @@
/*
* Copyright (c) 2021 Loongson Technology Corporation Limited
* Contributed by Xiwei Gu <guxiwei-hf@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavcodec/videodsp.h"
#include "libavutil/attributes.h"
static void prefetch_loongarch(const uint8_t *mem, ptrdiff_t stride, int h)
{
register const uint8_t *p = mem;
__asm__ volatile (
"1: \n\t"
"preld 0, %[p], 0 \n\t"
"preld 0, %[p], 32 \n\t"
"addi.d %[h], %[h], -1 \n\t"
"add.d %[p], %[p], %[stride] \n\t"
"blt $r0, %[h], 1b \n\t"
: [p] "+r" (p), [h] "+r" (h)
: [stride] "r" (stride)
);
}
av_cold void ff_videodsp_init_loongarch(VideoDSPContext *ctx, int bpc)
{
ctx->prefetch = prefetch_loongarch;
}

View file

@ -0,0 +1,63 @@
/*
* Copyright (c) 2021 Loongson Technology Corporation Limited
* Contributed by Hecai Yuan <yuanhecai@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* VP8 compatible video decoder
*/
#include "libavutil/loongarch/cpu.h"
#include "libavcodec/vp8dsp.h"
#include "libavutil/attributes.h"
#include "vp8dsp_loongarch.h"
#define VP8_MC_LOONGARCH_FUNC(IDX, SIZE) \
dsp->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel##SIZE##_h6_lsx; \
dsp->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel##SIZE##_v4_lsx; \
dsp->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel##SIZE##_h6v4_lsx; \
dsp->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel##SIZE##_v6_lsx; \
dsp->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel##SIZE##_h4v6_lsx; \
dsp->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel##SIZE##_h6v6_lsx;
#define VP8_MC_LOONGARCH_COPY(IDX, SIZE) \
dsp->put_vp8_epel_pixels_tab[IDX][0][0] = ff_put_vp8_pixels##SIZE##_lsx; \
dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = ff_put_vp8_pixels##SIZE##_lsx;
av_cold void ff_vp8dsp_init_loongarch(VP8DSPContext *dsp)
{
int cpu_flags = av_get_cpu_flags();
if (have_lsx(cpu_flags)) {
VP8_MC_LOONGARCH_FUNC(0, 16);
VP8_MC_LOONGARCH_FUNC(1, 8);
VP8_MC_LOONGARCH_COPY(0, 16);
VP8_MC_LOONGARCH_COPY(1, 8);
dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_lsx;
dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_lsx;
dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_lsx;
dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_lsx;
dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_lsx;
dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_lsx;
}
}

View file

@ -0,0 +1,90 @@
/*
* Copyright (c) 2021 Loongson Technology Corporation Limited
* Contributed by Hecai Yuan <yuanhecai@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_LOONGARCH_VP8DSP_LOONGARCH_H
#define AVCODEC_LOONGARCH_VP8DSP_LOONGARCH_H
#include "libavcodec/vp8dsp.h"
void ff_put_vp8_pixels8_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int x, int y);
void ff_put_vp8_pixels16_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int x, int y);
void ff_put_vp8_epel16_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
/* loop filter */
void ff_vp8_v_loop_filter16_inner_lsx(uint8_t *dst, ptrdiff_t stride,
int32_t e, int32_t i, int32_t h);
void ff_vp8_h_loop_filter16_inner_lsx(uint8_t *src, ptrdiff_t stride,
int32_t e, int32_t i, int32_t h);
void ff_vp8_v_loop_filter16_lsx(uint8_t *dst, ptrdiff_t stride,
int flim_e, int flim_i, int hev_thresh);
void ff_vp8_h_loop_filter16_lsx(uint8_t *dst, ptrdiff_t stride,
int flim_e, int flim_i, int hev_thresh);
void ff_vp8_h_loop_filter8uv_lsx(uint8_t *dst_u, uint8_t *dst_v,
ptrdiff_t stride,
int flim_e, int flim_i, int hev_thresh);
void ff_vp8_v_loop_filter8uv_lsx(uint8_t *dst_u, uint8_t *dst_v,
ptrdiff_t stride,
int flim_e, int flim_i, int hev_thresh);
#endif // #ifndef AVCODEC_LOONGARCH_VP8DSP_LOONGARCH_H

View file

@ -0,0 +1,130 @@
/*
* Copyright (c) 2021 Loongson Technology Corporation Limited
* Contributed by Hao Chen <chenhao@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/loongarch/cpu.h"
#include "libavutil/attributes.h"
#include "libavcodec/vp9dsp.h"
#include "vp9dsp_loongarch.h"
#define init_subpel1(idx1, idx2, idxh, idxv, sz, dir, type) \
dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][idxh][idxv] = \
ff_##type##_8tap_smooth_##sz##dir##_lsx; \
dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][idxh][idxv] = \
ff_##type##_8tap_regular_##sz##dir##_lsx; \
dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][idxh][idxv] = \
ff_##type##_8tap_sharp_##sz##dir##_lsx;
#define init_subpel2(idx, idxh, idxv, dir, type) \
init_subpel1(0, idx, idxh, idxv, 64, dir, type); \
init_subpel1(1, idx, idxh, idxv, 32, dir, type); \
init_subpel1(2, idx, idxh, idxv, 16, dir, type); \
init_subpel1(3, idx, idxh, idxv, 8, dir, type); \
init_subpel1(4, idx, idxh, idxv, 4, dir, type);
#define init_subpel3(idx, type) \
init_subpel2(idx, 1, 0, h, type); \
init_subpel2(idx, 0, 1, v, type); \
init_subpel2(idx, 1, 1, hv, type);
#define init_fpel(idx1, idx2, sz, type) \
dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][0][0] = ff_##type##sz##_lsx; \
dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][0][0] = ff_##type##sz##_lsx; \
dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][0][0] = ff_##type##sz##_lsx; \
dsp->mc[idx1][FILTER_BILINEAR ][idx2][0][0] = ff_##type##sz##_lsx;
#define init_copy(idx, sz) \
init_fpel(idx, 0, sz, copy); \
init_fpel(idx, 1, sz, avg);
#define init_intra_pred1_lsx(tx, sz) \
dsp->intra_pred[tx][VERT_PRED] = ff_vert_##sz##_lsx; \
dsp->intra_pred[tx][HOR_PRED] = ff_hor_##sz##_lsx; \
dsp->intra_pred[tx][DC_PRED] = ff_dc_##sz##_lsx; \
dsp->intra_pred[tx][LEFT_DC_PRED] = ff_dc_left_##sz##_lsx; \
dsp->intra_pred[tx][TOP_DC_PRED] = ff_dc_top_##sz##_lsx; \
dsp->intra_pred[tx][DC_128_PRED] = ff_dc_128_##sz##_lsx; \
dsp->intra_pred[tx][DC_127_PRED] = ff_dc_127_##sz##_lsx; \
dsp->intra_pred[tx][DC_129_PRED] = ff_dc_129_##sz##_lsx; \
dsp->intra_pred[tx][TM_VP8_PRED] = ff_tm_##sz##_lsx; \
#define init_intra_pred2_lsx(tx, sz) \
dsp->intra_pred[tx][DC_PRED] = ff_dc_##sz##_lsx; \
dsp->intra_pred[tx][LEFT_DC_PRED] = ff_dc_left_##sz##_lsx; \
dsp->intra_pred[tx][TOP_DC_PRED] = ff_dc_top_##sz##_lsx; \
dsp->intra_pred[tx][TM_VP8_PRED] = ff_tm_##sz##_lsx; \
#define init_idct(tx, nm) \
dsp->itxfm_add[tx][DCT_DCT] = \
dsp->itxfm_add[tx][ADST_DCT] = \
dsp->itxfm_add[tx][DCT_ADST] = \
dsp->itxfm_add[tx][ADST_ADST] = nm##_add_lsx;
#define init_itxfm(tx, sz) \
dsp->itxfm_add[tx][DCT_DCT] = ff_idct_idct_##sz##_add_lsx;
av_cold void ff_vp9dsp_init_loongarch(VP9DSPContext *dsp, int bpp)
{
int cpu_flags = av_get_cpu_flags();
if (have_lsx(cpu_flags))
if (bpp == 8) {
init_subpel3(0, put);
init_subpel3(1, avg);
init_copy(0, 64);
init_copy(1, 32);
init_copy(2, 16);
init_copy(3, 8);
init_intra_pred1_lsx(TX_16X16, 16x16);
init_intra_pred1_lsx(TX_32X32, 32x32);
init_intra_pred2_lsx(TX_4X4, 4x4);
init_intra_pred2_lsx(TX_8X8, 8x8);
init_itxfm(TX_8X8, 8x8);
init_itxfm(TX_16X16, 16x16);
init_idct(TX_32X32, ff_idct_idct_32x32);
dsp->loop_filter_8[0][0] = ff_loop_filter_h_4_8_lsx;
dsp->loop_filter_8[0][1] = ff_loop_filter_v_4_8_lsx;
dsp->loop_filter_8[1][0] = ff_loop_filter_h_8_8_lsx;
dsp->loop_filter_8[1][1] = ff_loop_filter_v_8_8_lsx;
dsp->loop_filter_8[2][0] = ff_loop_filter_h_16_8_lsx;
dsp->loop_filter_8[2][1] = ff_loop_filter_v_16_8_lsx;
dsp->loop_filter_16[0] = ff_loop_filter_h_16_16_lsx;
dsp->loop_filter_16[1] = ff_loop_filter_v_16_16_lsx;
dsp->loop_filter_mix2[0][0][0] = ff_loop_filter_h_44_16_lsx;
dsp->loop_filter_mix2[0][0][1] = ff_loop_filter_v_44_16_lsx;
dsp->loop_filter_mix2[0][1][0] = ff_loop_filter_h_48_16_lsx;
dsp->loop_filter_mix2[0][1][1] = ff_loop_filter_v_48_16_lsx;
dsp->loop_filter_mix2[1][0][0] = ff_loop_filter_h_84_16_lsx;
dsp->loop_filter_mix2[1][0][1] = ff_loop_filter_v_84_16_lsx;
dsp->loop_filter_mix2[1][1][0] = ff_loop_filter_h_88_16_lsx;
dsp->loop_filter_mix2[1][1][1] = ff_loop_filter_v_88_16_lsx;
}
}
#undef init_subpel1
#undef init_subpel2
#undef init_subpel3
#undef init_copy
#undef init_fpel
#undef init_intra_pred1_lsx
#undef init_intra_pred2_lsx
#undef init_idct
#undef init_itxfm

View file

@ -0,0 +1,185 @@
/*
* Copyright (c) 2021 Loongson Technology Corporation Limited
* Contributed by Hao Chen <chenhao@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_LOONGARCH_VP9DSP_LOONGARCH_H
#define AVCODEC_LOONGARCH_VP9DSP_LOONGARCH_H
#include <stddef.h>
#include <stdint.h>
#define VP9_8TAP_LOONGARCH_LSX_FUNC(SIZE, type, type_idx) \
void ff_put_8tap_##type##_##SIZE##h_lsx(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my); \
\
void ff_put_8tap_##type##_##SIZE##v_lsx(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my); \
\
void ff_put_8tap_##type##_##SIZE##hv_lsx(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my); \
\
void ff_avg_8tap_##type##_##SIZE##h_lsx(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my); \
\
void ff_avg_8tap_##type##_##SIZE##v_lsx(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my); \
\
void ff_avg_8tap_##type##_##SIZE##hv_lsx(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my);
#define VP9_COPY_LOONGARCH_LSX_FUNC(SIZE) \
void ff_copy##SIZE##_lsx(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, ptrdiff_t srcstride, \
int h, int mx, int my); \
\
void ff_avg##SIZE##_lsx(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, ptrdiff_t srcstride, \
int h, int mx, int my);
VP9_8TAP_LOONGARCH_LSX_FUNC(64, regular, FILTER_8TAP_REGULAR);
VP9_8TAP_LOONGARCH_LSX_FUNC(32, regular, FILTER_8TAP_REGULAR);
VP9_8TAP_LOONGARCH_LSX_FUNC(16, regular, FILTER_8TAP_REGULAR);
VP9_8TAP_LOONGARCH_LSX_FUNC(8, regular, FILTER_8TAP_REGULAR);
VP9_8TAP_LOONGARCH_LSX_FUNC(4, regular, FILTER_8TAP_REGULAR);
VP9_8TAP_LOONGARCH_LSX_FUNC(64, sharp, FILTER_8TAP_SHARP);
VP9_8TAP_LOONGARCH_LSX_FUNC(32, sharp, FILTER_8TAP_SHARP);
VP9_8TAP_LOONGARCH_LSX_FUNC(16, sharp, FILTER_8TAP_SHARP);
VP9_8TAP_LOONGARCH_LSX_FUNC(8, sharp, FILTER_8TAP_SHARP);
VP9_8TAP_LOONGARCH_LSX_FUNC(4, sharp, FILTER_8TAP_SHARP);
VP9_8TAP_LOONGARCH_LSX_FUNC(64, smooth, FILTER_8TAP_SMOOTH);
VP9_8TAP_LOONGARCH_LSX_FUNC(32, smooth, FILTER_8TAP_SMOOTH);
VP9_8TAP_LOONGARCH_LSX_FUNC(16, smooth, FILTER_8TAP_SMOOTH);
VP9_8TAP_LOONGARCH_LSX_FUNC(8, smooth, FILTER_8TAP_SMOOTH);
VP9_8TAP_LOONGARCH_LSX_FUNC(4, smooth, FILTER_8TAP_SMOOTH);
VP9_COPY_LOONGARCH_LSX_FUNC(64);
VP9_COPY_LOONGARCH_LSX_FUNC(32);
VP9_COPY_LOONGARCH_LSX_FUNC(16);
VP9_COPY_LOONGARCH_LSX_FUNC(8);
#undef VP9_8TAP_LOONGARCH_LSX_FUNC
#undef VP9_COPY_LOONGARCH_LSX_FUNC
void ff_vert_16x16_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_vert_32x32_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_hor_16x16_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_hor_32x32_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_4x4_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_8x8_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_16x16_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_32x32_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_left_4x4_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_left_8x8_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_left_16x16_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_left_32x32_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_top_4x4_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_top_8x8_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_dc_top_16x16_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_top_32x32_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_128_16x16_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_128_32x32_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_127_16x16_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_127_32x32_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_129_16x16_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_dc_129_32x32_lsx(uint8_t *dst, ptrdiff_t stride,
const uint8_t *left, const uint8_t *top);
void ff_tm_4x4_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_tm_8x8_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_tm_16x16_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_tm_32x32_lsx(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
const uint8_t *top);
void ff_loop_filter_h_16_8_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_v_16_8_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_h_4_8_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_v_4_8_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_h_44_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_v_44_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_h_8_8_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_v_8_8_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_h_88_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_v_88_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_h_84_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_v_84_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_h_48_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_v_48_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_h_16_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_loop_filter_v_16_16_lsx(uint8_t *dst, ptrdiff_t stride, int32_t e,
int32_t i, int32_t h);
void ff_idct_idct_8x8_add_lsx(uint8_t *dst, ptrdiff_t stride,
int16_t *block, int eob);
void ff_idct_idct_16x16_add_lsx(uint8_t *dst, ptrdiff_t stride,
int16_t *block, int eob);
void ff_idct_idct_32x32_add_lsx(uint8_t *dst, ptrdiff_t stride,
int16_t *block, int eob);
#endif /* AVCODEC_LOONGARCH_VP9DSP_LOONGARCH_H */

View file

@ -8,7 +8,16 @@
if CONFIG['FFVPX_ASFLAGS']:
DIRS += ['x86']
<<<<<<< HEAD
# 'dummy_funcs.c',
=======
if CONFIG['CPU_ARCH'] == 'aarch64':
DIRS += ['aarch64']
elif CONFIG['CPU_ARCH'].startswith('ppc'):
DIRS += ['ppc']
elif CONFIG['CPU_ARCH'].startswith('loongarch64'):
DIRS += ['loongarch']
>>>>>>> fb438829b5 (MoonchildProductions/UXP#2897: Fix ffvpx build on loongarch64)
SharedLibrary('mozavcodec')
SOURCES += [

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2020 Loongson Technology Corporation Limited
* Contributed by Shiyou Yin <yinshiyou-hf@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
#include "cpu.h"
#include <sys/auxv.h>
#define LA_HWCAP_LSX (1<<4)
#define LA_HWCAP_LASX (1<<5)
static int cpu_flags_getauxval(void)
{
int flags = 0;
int flag = (int)getauxval(AT_HWCAP);
if (flag & LA_HWCAP_LSX)
flags |= AV_CPU_FLAG_LSX;
if (flag & LA_HWCAP_LASX)
flags |= AV_CPU_FLAG_LASX;
return flags;
}
int ff_get_cpu_flags_loongarch(void)
{
#if defined __linux__
return cpu_flags_getauxval();
#else
/* Assume no SIMD ASE supported */
return 0;
#endif
}
size_t ff_get_cpu_max_align_loongarch(void)
{
int flags = av_get_cpu_flags();
if (flags & AV_CPU_FLAG_LASX)
return 32;
if (flags & AV_CPU_FLAG_LSX)
return 16;
return 8;
}

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2020 Loongson Technology Corporation Limited
* Contributed by Shiyou Yin <yinshiyou-hf@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_LOONGARCH_CPU_H
#define AVUTIL_LOONGARCH_CPU_H
#include "libavutil/cpu.h"
#include "libavutil/cpu_internal.h"
#define have_lsx(flags) CPUEXT(flags, LSX)
#define have_lasx(flags) CPUEXT(flags, LASX)
#endif /* AVUTIL_LOONGARCH_CPU_H */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
SOURCES += [
'cpu.c',
]
FINAL_LIBRARY = 'mozavutil'
include('/media/ffvpx/ffvpxcommon.mozbuild')

View file

@ -0,0 +1,48 @@
/*
* Copyright (c) 2023 Loongson Technology Corporation Limited
* Contributed by Hecai Yuan <yuanhecai@loongson.cn>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_LOONGARCH_TIMER_H
#define AVUTIL_LOONGARCH_TIMER_H
#include <stdint.h>
#include "config.h"
#if HAVE_INLINE_ASM
#define AV_READ_TIME read_time
static inline uint64_t read_time(void)
{
#if ARCH_LOONGARCH64
uint64_t a, id;
__asm__ volatile ( "rdtime.d %0, %1" : "=r"(a), "=r"(id) :: );
return a;
#else
uint32_t a, id;
__asm__ volatile ( "rdtimel.w %0, %1" : "=r"(a), "=r"(id) :: );
return (uint64_t)a;
#endif
}
#endif /* HAVE_INLINE_ASM */
#endif /* AVUTIL_LOONGARCH_TIMER_H */

View file

@ -6,7 +6,21 @@
# Due to duplicate file names, we compile libavutil/x86 in its own
# moz.build file.
if CONFIG['FFVPX_ASFLAGS']:
<<<<<<< HEAD
DIRS += ['x86']
=======
if CONFIG['CPU_ARCH'].startswith('x86'):
DIRS += ['x86']
elif CONFIG['CPU_ARCH'].startswith('arm'):
DIRS += ['arm']
if CONFIG['CPU_ARCH'] == 'aarch64':
DIRS += ['aarch64']
elif CONFIG['CPU_ARCH'].startswith('ppc'):
DIRS += ['ppc']
elif CONFIG['CPU_ARCH'].startswith('loongarch64'):
DIRS += ['loongarch']
>>>>>>> fb438829b5 (MoonchildProductions/UXP#2897: Fix ffvpx build on loongarch64)
SharedLibrary('mozavutil')

View file

@ -1,5 +1,6 @@
/*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2023 Loongson Technology Corporation Limited
* Contributed by Hecai Yuan <yuanhecai@loongson.cn>
*
* This file is part of FFmpeg.
*
@ -18,30 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* high precision timer, useful to profile code
*/
#ifndef AVUTIL_TIMER_H
#define AVUTIL_TIMER_H
#ifndef AVUTIL_LOONGARCH_TIMER_H
#define AVUTIL_LOONGARCH_TIMER_H
#include <stdint.h>
#include "config.h"
#if CONFIG_LINUX_PERF
# ifndef _GNU_SOURCE
# define _GNU_SOURCE
# endif
# include <unistd.h> // read(3)
# include <sys/ioctl.h>
# include <asm/unistd.h>
# include <linux/perf_event.h>
#endif
#if HAVE_INLINE_ASM
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#define AV_READ_TIME read_time
<<<<<<< HEAD
#if HAVE_MACH_MACH_TIME_H
#include <mach/mach_time.h>
#endif
@ -133,9 +121,22 @@
#define STOP_TIMER(id) \
tend = AV_READ_TIME(); \
TIMER_REPORT(id, tend - tstart)
#else
#define START_TIMER
#define STOP_TIMER(id) { }
#endif
=======
static inline uint64_t read_time(void)
{
#endif /* AVUTIL_TIMER_H */
#if ARCH_LOONGARCH64
uint64_t a, id;
__asm__ volatile ( "rdtime.d %0, %1" : "=r"(a), "=r"(id) :: );
return a;
>>>>>>> fb438829b5 (MoonchildProductions/UXP#2897: Fix ffvpx build on loongarch64)
#else
uint32_t a, id;
__asm__ volatile ( "rdtimel.w %0, %1" : "=r"(a), "=r"(id) :: );
return (uint64_t)a;
#endif
}
#endif /* HAVE_INLINE_ASM */
#endif /* AVUTIL_LOONGARCH_TIMER_H */