diff --git a/multimedia/x265/Makefile b/multimedia/x265/Makefile index c37f1d7885a9..46d4550d1123 100644 --- a/multimedia/x265/Makefile +++ b/multimedia/x265/Makefile @@ -1,168 +1,155 @@ PORTNAME= x265 -PORTVERSION= 3.5 -PORTREVISION= 3 +PORTVERSION= 3.6 CATEGORIES= multimedia -MASTER_SITES= https://bitbucket.org/multicoreware/x265_git/get/${BB_TAG}.tar.gz?meow=/ - -PATCH_SITES= https://bitbucket.org/multicoreware/x265_git/commits/8f18e3ad32684eee95e885e718655f93951128c3/raw/ -PATCHFILES+= x265-asm-warnings.patch:-p1 +MASTER_SITES= https://bitbucket.org/multicoreware/x265_git/downloads/ \ + http://ftp.videolan.org/pub/videolan/x265/ +DISTNAME= ${PORTNAME}_${PORTVERSION} MAINTAINER= ports@virtual-estates.net COMMENT= H.265/High Efficiency Video Coding (HEVC) format WWW= https://www.x265.org/ LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC:H}/COPYING USES= cmake compiler:c++14-lang cpe pathfix dos2unix CPE_VENDOR= multicorewareinc DOS2UNIX_FILES= common/scaler.cpp USE_LDCONFIG= yes CMAKE_ARGS= -DENABLE_TESTS=on -DGIT_ARCHETYPE=1 CMAKE_ON= ENABLE_HDR10_PLUS LDFLAGS_i386= -Wl,-znotext EXTRACT_AFTER_ARGS+= --exclude compat --exclude md5\.* --strip-components=1 PATCH_WRKSRC= ${WRKSRC:H} WRKSRC= ${WRKDIR}/source BB_TAG= Release_${DISTVERSION} -OPTIONS_DEFINE= DEBUG OPTIMIZED_FLAGS VMAF -OPTIONS_DEFINE_aarch64= ASM -OPTIONS_DEFINE_amd64= ASM SVTHEVC -OPTIONS_DEFINE_i386= ASM -OPTIONS_DEFINE_powerpc64= ASM -OPTIONS_DEFINE_powerpc64le= ASM +OPTIONS_DEFINE= VMAF +OPTIONS_DEFINE_amd64= SVTHEVC OPTIONS_DEFAULT= HI10P HI12P HI8P OPTIMIZED_FLAGS -OPTIONS_DEFAULT_amd64= ASM -OPTIONS_DEFAULT_powerpc64le= ASM OPTIONS_MULTI= PIXELWIDTH OPTIONS_MULTI_PIXELWIDTH= HI10P HI12P HI8P +OPTIONS_RADIO= OPTIMIZATION +OPTIONS_RADIO_OPTIMIZATION= DEBUG OPTIMIZED_FLAGS -DEBUG_DESC= Enable debugging +DEBUG_DESC= Enable debugging (and -O0 -g) HI10P_DESC= Enable 10-bit pixels (may break on i386) HI12P_DESC= Enable 12-bit pixels (may break on i386) HI8P_DESC= Enable 8-bit pixel-width (you, probably, want this) OPTIMIZED_FLAGS_DESC= Enable O3 optimization SVTHEVC_DESC= HEVC encoding via SVT-HEVC -VMAF_DESC= Per frame and aggregate VMAF score +VMAF_DESC= VMAF scores (broken: needs older VMAF) +VMAF_USES= localbase:ldflags -DEBUG_PREVENTS= OPTIMIZED_FLAGS -DEBUG_PREVENTS_MSG= Optimizations are incompatible with debugging code DEBUG_CMAKE_ON= -DCMAKE_ASM_NASM_FLAGS:STRING="-g -O0" -OPTIMIZED_FLAGS_CFLAGS= -O3 SVTHEVC_LIB_DEPENDS= libSvtHevcEnc.so:multimedia/svt-hevc -SVTHEVC_CMAKE_BOOL= ENABLE_SVT_HEVC SVTHEVC_CMAKE_ON= -DSVT_HEVC_INCLUDE_DIR:PATH="${LOCALBASE}/include/svt-hevc" +SVTHEVC_CMAKE_BOOL= ENABLE_SVT_HEVC +VMAF_CMAKE_ON= -DVMAF_INCLUDE_DIR:PATH="${LOCALBASE}/include/libvmaf" VMAF_LIB_DEPENDS= libvmaf.so:multimedia/vmaf -VMAF_USES= localbase:ldflags VMAF_CMAKE_BOOL= ENABLE_LIBVMAF -VMAF_CMAKE_ON= -DVMAF_INCLUDE_DIR:PATH="${LOCALBASE}/include/libvmaf" .include -.if ${ARCH} == aarch64 && ${PORT_OPTIONS:MASM} -BUILD_DEPENDS= as:devel/binutils -USE_GCC= yes -.endif - -.if ${ARCH:Mpowerpc64*} && ${PORT_OPTIONS:MASM} +.if ${ARCH:Mpowerpc64*} CMAKE_ARGS+= -DCPU_POWER8=ON \ -DENABLE_ALTIVEC=ON .endif -.if ${ARCH} != aarch64 && !${ARCH:Mpowerpc64*} && ${PORT_OPTIONS:MASM} +.if !${ARCH:Mpowerpc64*} && !${ARCH:Marmv7} BUILD_DEPENDS= nasm:devel/nasm .endif DEFAULT_DEPTH= ${PORT_OPTIONS:MHI*P:O:ts/:T} OTHER_DEPTHS= ${PORT_OPTIONS:MHI*P:N${DEFAULT_DEPTH}} .if "${DEFAULT_DEPTH}" == "HI12P" CMAKE_ARGS+= -DMAIN12:BOOL=true .endif .if "${DEFAULT_DEPTH}" != "HI8P" CMAKE_ARGS+= -DHIGH_BIT_DEPTH:BOOL=true .endif CMAKE_OTHER_ARGS= ${CMAKE_ARGS:C/.*-D_END_CUSTOM_OPTIONS=1 +//W} .if ${PORT_OPTIONS:MDEBUG} CFLAGS:= ${CFLAGS:N-O*} -O0 -g .endif +.if ${PORT_OPTIONS:MOPTIMIZED_FLAGS} +CFLAGS:= ${CFLAGS:N-O*} -O3 +.endif + .for b in ${OTHER_DEPTHS:C/HI([0-9]+)P/\1/} EXTRA_LINK_FLAGS+= -L${WRKSRC:H}/${b}bit .if ${ARCH:Mpowerpc64*} -.if ${b} != 8 || ! ${PORT_OPTIONS:MASM} +.if ${b} != 8 ASSEMBLY= false .else ASSEMBLY= true .endif -.if ${PORT_OPTIONS:MASM} -POWER8= true -.else -POWER8= false -.endif +post-patch: + ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/x265.h pre-build:: @${ECHO_MSG} "---> Building the ${b}-bit library ---" ${MKDIR} ${WRKSRC:H}/${b}bit ${CMAKE_BIN} -S ${WRKSRC} -B ${WRKSRC:H}/${b}bit \ ${CMAKE_OTHER_ARGS} ${b:C/1./-DHIGH_BIT_DEPTH:BOOL=true/} \ - -DMAIN${b}:BOOL=true -DENABLE_ALTIVEC=${ASSEMBLY} -DCPU_POWER8=${POWER8} \ + -DMAIN${b}:BOOL=true -DENABLE_ALTIVEC=${ASSEMBLY} -DCPU_POWER8=true \ -DEXPORT_C_API:BOOL=false -DENABLE_CLI=false ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${WRKSRC:H}/${b}bit ${MAKE_ARGS} ${LN} -f ${WRKSRC:H}/${b}bit/libx265.a ${WRKSRC:H}/${b}bit/libx265_${b}bit.a ${ECHO_MSG} "---> Built the ${b}-bit library ---" .else -.if ${ARCH} == i386 && ${b} != 8 || ! ${PORT_OPTIONS:MASM} +.if (${ARCH} == i386 || ${ARCH} == armv7) && $b != 8 ASSEMBLY= false .else ASSEMBLY= true .endif pre-build:: @${ECHO_MSG} "---> Building the ${b}-bit library ---" ${MKDIR} ${WRKSRC:H}/${b}bit ${CMAKE_BIN} -S ${WRKSRC} -B ${WRKSRC:H}/${b}bit \ ${CMAKE_OTHER_ARGS} ${b:C/1./-DHIGH_BIT_DEPTH:BOOL=true/} \ -DMAIN${b}:BOOL=true -DENABLE_ASSEMBLY:BOOL=${ASSEMBLY} \ -DEXPORT_C_API:BOOL=false -DENABLE_CLI=false ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${WRKSRC:H}/${b}bit ${MAKE_ARGS} ${LN} -f ${WRKSRC:H}/${b}bit/libx265.a ${WRKSRC:H}/${b}bit/libx265_${b}bit.a ${ECHO_MSG} "---> Built the ${b}-bit library ---" .endif .endfor .if "${EXTRA_LINK_FLAGS}" CMAKE_ARGS+= -DEXTRA_LINK_FLAGS:STRING="${EXTRA_LINK_FLAGS}" CMAKE_ARGS+= -DEXTRA_LIB="${OTHER_DEPTHS:C/HI([0-9]+)P/x265_\1bit/:C/ /;/gW}" CMAKE_ARGS+= ${OTHER_DEPTHS:C/HI([0-9]+)P/-DLINKED_\1BIT:BOOL=true/} .endif CMAKE_ARGS+= -DENABLE_SHARED:BOOL=true -.if ${ARCH} == i386 && ${DEFAULT_DEPTH} != "HI8P" || ! ${PORT_OPTIONS:MASM} +.if ${ARCH} == i386 && ${DEFAULT_DEPTH} != "HI8P" CMAKE_ARGS+= -DENABLE_ASSEMBLY:BOOL=false .else .if !${ARCH:Mpowerpc64*} CMAKE_ARGS+= -DENABLE_ASSEMBLY:BOOL=true .else CMAKE_ARGS+= -DCPU_POWER8=ON \ -DENABLE_ALTIVEC=ON .endif do-test: ${WRKDIR}/.build/test/TestBench .endif CMAKE_ARGS+= -D_END_CUSTOM_OPTIONS=1 CMAKE_ARGS+= -DENABLE_PIC:BOOL=true .include diff --git a/multimedia/x265/distinfo b/multimedia/x265/distinfo index f52b46a4fd2b..7e5f3d943d14 100644 --- a/multimedia/x265/distinfo +++ b/multimedia/x265/distinfo @@ -1,5 +1,3 @@ -TIMESTAMP = 1726840725 -SHA256 (x265-3.5.tar.gz) = 8a5fcfddb3e2db520b637e475a507fb00117d554bdb3204c5828626d888c306a -SIZE (x265-3.5.tar.gz) = 1538610 -SHA256 (x265-asm-warnings.patch) = 9c3fd7fb00d535cf5cb57be5ccecd73731aba883059291b5d0da8501a15cf253 -SIZE (x265-asm-warnings.patch) = 4526 +TIMESTAMP = 1727555881 +SHA256 (x265_3.6.tar.gz) = 663531f341c5389f460d730e62e10a4fcca3428ca2ca109693867bc5fe2e2807 +SIZE (x265_3.6.tar.gz) = 1655889 diff --git a/multimedia/x265/files/patch-arm-assembly b/multimedia/x265/files/patch-arm-assembly new file mode 100644 index 000000000000..e481269c43f0 --- /dev/null +++ b/multimedia/x265/files/patch-arm-assembly @@ -0,0 +1,117 @@ +--- source/common/arm/blockcopy8.S 2024-09-30 08:38:43.172350000 +0200 ++++ source/common/arm/blockcopy8.S 2024-09-30 09:13:08.635457000 +0200 +@@ -833,5 +833,5 @@ + vmov.u32 r0, d0[0] + uasx r0, r0, r0 +- mov r0, r0, lsr 16 ++ lsr r0, r0, #16 + rsb r0, #1024 + bx lr +--- source/common/arm/asm.S 2024-04-04 11:39:50.000000000 +0200 ++++ source/common/arm/asm.S 2024-09-30 19:45:33.295896000 +0200 +@@ -85,4 +85,9 @@ + .endm + ++.macro MYADRLSUB reg:req, label:req ++sub \reg, pc, #((. - \label) & 0xff00) ++sub \reg, \reg, #((. - \label) - ((. - \label) & 0xff00)) + 4 ++.endm ++ + .macro movrel rd, val + #if HAVE_ARMV6T2 && !defined(PIC) +@@ -90,5 +95,5 @@ + movt \rd, #:upper16:\val + #else +- ldr \rd, =\val ++ MYADRLSUB \rd, \val + #endif + .endm +--- source/common/arm/ipfilter8.S 2024-04-04 11:39:50.000000000 +0200 ++++ source/common/arm/ipfilter8.S 2024-09-30 19:48:31.490019000 +0200 +@@ -26,5 +26,5 @@ + #include "asm.S" + +-.section .rodata ++.text + .align 4 + +@@ -43,7 +43,4 @@ + .word -2, -2, 16, 16, 54, 54, -4 ,-4 + .word -2, -2, 10, 10, 58, 58, -2, -2 +- +- +-.text + + // filterPixelToShort(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride) +--- source/common/arm/sad-a.S 2024-04-04 11:39:50.000000000 +0200 ++++ source/common/arm/sad-a.S 2024-09-30 19:49:06.534263000 +0200 +@@ -26,11 +26,9 @@ + #include "asm.S" + +-.section .rodata ++.text + + .align 4 + sad12_mask: + .byte 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0 +- +-.text + + /* sad4x4(pixel* dst, intptr_t dstStride, const pixel* src, intptr_t srcStride) +--- source/test/checkasm-arm.S 2024-04-04 11:39:50.000000000 +0200 ++++ source/test/checkasm-arm.S 2024-10-01 02:51:29.815273000 +0200 +@@ -27,5 +27,5 @@ + #include "../common/arm/asm.S" + +-.section .rodata ++.text + .align 4 + register_init: +@@ -41,6 +41,4 @@ + error_message: + .asciz "failed to preserve register" +- +-.text + + @ max number of args used by any x265 asm function. +--- source/common/cpu.cpp 2024-04-04 11:39:50.000000000 +0200 ++++ source/common/cpu.cpp 2024-10-01 02:56:32.094316000 +0200 +@@ -339,6 +339,6 @@ + + extern "C" { +-void PFX(cpu_neon_test)(void); +-int PFX(cpu_fast_neon_mrc_test)(void); ++void x265_cpu_neon_test(void); ++int x265_cpu_fast_neon_mrc_test(void); + } + +@@ -361,5 +361,5 @@ + + canjump = 1; +- PFX(cpu_neon_test)(); ++ x265_cpu_neon_test(); + canjump = 0; + signal(SIGILL, oldsig); +@@ -377,5 +377,5 @@ + // right now Apple does not seem to support performance counters for this test + #ifndef __MACH__ +- flags |= PFX(cpu_fast_neon_mrc_test)() ? X265_CPU_FAST_NEON_MRC : 0; ++ flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0; + #endif + // TODO: write dual issue test? currently it's A8 (dual issue) vs. A9 (fast mrc) +--- source/test/testharness.h 2024-04-04 11:39:50.000000000 +0200 ++++ source/test/testharness.h 2024-10-01 03:05:54.786008000 +0200 +@@ -83,9 +83,12 @@ + asm volatile("rdtsc" : "=a" (a) ::"edx"); + #elif X265_ARCH_ARM ++ struct timeval tv; ++ gettimeofday(&tv, nullptr); ++ return static_cast(tv.tv_sec) * 1000000 + tv.tv_usec; + // TOD-DO: verify following inline asm to get cpu Timestamp Counter for ARM arch + // asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(a)); + + // TO-DO: replace clock() function with appropriate ARM cpu instructions +- a = clock(); ++ // a = clock(); + #elif X265_ARCH_ARM64 + asm volatile("mrs %0, cntvct_el0" : "=r"(a)); diff --git a/multimedia/x265/files/patch-source_CMakeLists.txt b/multimedia/x265/files/patch-source_CMakeLists.txt index 8026004c5378..962a2a7a58d1 100644 --- a/multimedia/x265/files/patch-source_CMakeLists.txt +++ b/multimedia/x265/files/patch-source_CMakeLists.txt @@ -1,53 +1,51 @@ --- source/CMakeLists.txt 2023-10-22 22:08:10.704150000 -0400 +++ source/CMakeLists.txt 2023-10-22 22:10:02.947579000 -0400 -@@ -43,7 +43,7 @@ - set(ARM_ALIASES armv6l armv7l aarch64) +@@ -45,5 +45,5 @@ + endif() + set(X86_ALIASES x86 i386 i686 x86_64 amd64) +-set(ARM_ALIASES armv6l armv7l) ++set(ARM_ALIASES armv6l armv7l armv7) + set(ARM64_ALIASES arm64 arm64e aarch64) list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) - list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH) --set(POWER_ALIASES ppc64 ppc64le) -+set(POWER_ALIASES powerpc64 powerpc64le ppc64 ppc64le) - list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH) - if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1") - set(X86 1) @@ -122,6 +122,7 @@ option(ENABLE_LIBVMAF "Enable VMAF" OFF) if(ENABLE_LIBVMAF) add_definitions(-DENABLE_LIBVMAF) + include_directories(${VMAF_INCLUDE_DIR}) endif() endif(UNIX) @@ -474,7 +475,7 @@ if(POWER) # IBM Power8 option(ENABLE_ALTIVEC "Enable ALTIVEC profiling instrumentation" ON) if(ENABLE_ALTIVEC) - add_definitions(-DHAVE_ALTIVEC=1 -maltivec -mabi=altivec) + add_definitions(-DHAVE_ALTIVEC=1 -maltivec) add_definitions(-flax-vector-conversions -fpermissive) else() add_definitions(-DHAVE_ALTIVEC=0) @@ -593,12 +594,6 @@ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) endif() -if(SVTHEVC_FOUND) - install(FILES "${SVT_HEVC_INCLUDE_DIR}/EbApi.h" DESTINATION include) - install(FILES "${SVT_HEVC_INCLUDE_DIR}/EbErrorCodes.h" DESTINATION include) - install(FILES "${SVT_HEVC_LIBRARY}" DESTINATION ${LIB_INSTALL_DIR}) -endif() - install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include) if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED)) if(MSVC_IDE) @@ -650,7 +645,10 @@ if(EXTRA_LIB) target_link_libraries(x265-shared ${EXTRA_LIB}) endif() - target_link_libraries(x265-shared ${PLATFORM_LIBS}) + if(ENABLE_LIBVMAF) + target_link_libraries(x265-shared ${VMAF}) + endif() + target_link_libraries(x265-shared ${PLATFORM_LIBS}) if(SVTHEVC_FOUND) target_link_libraries(x265-shared ${SVT_HEVC_LIBRARY}) endif(SVTHEVC_FOUND) diff --git a/multimedia/x265/files/patch-source_common_ppc_intrapred__altivec.cpp b/multimedia/x265/files/patch-source_common_ppc_intrapred__altivec.cpp deleted file mode 100644 index b7b6cbcbcaf4..000000000000 --- a/multimedia/x265/files/patch-source_common_ppc_intrapred__altivec.cpp +++ /dev/null @@ -1,14 +0,0 @@ ---- source/common/ppc/intrapred_altivec.cpp.orig 2021-11-16 17:20:04 UTC -+++ source/common/ppc/intrapred_altivec.cpp -@@ -27,7 +27,11 @@ - #include - #include - #include -+#ifdef __linux__ - #include -+#else -+#include -+#endif - #include - #include - #include diff --git a/multimedia/x265/files/patch-source_encoder_api.cpp b/multimedia/x265/files/patch-source_encoder_api.cpp index dcd29b667096..ed77a79d7aa3 100644 --- a/multimedia/x265/files/patch-source_encoder_api.cpp +++ b/multimedia/x265/files/patch-source_encoder_api.cpp @@ -1,51 +1,51 @@ -In svt-hevc 1.5.0, they payload-array (1024 bytes) is part of the structure, +In svt-hevc 1.5.0, the payload-array (1024 bytes) is part of the structure, rather than a pointer to be allocated separately. This patch should allow compiling x265 against both older (1.4.x) and 1.5.x versions of the dependency. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248479 -mi --- source/encoder/api.cpp.orig 2023-06-27 14:11:49 UTC +++ source/encoder/api.cpp @@ -449,14 +449,18 @@ int x265_encoder_encode(x265_encoder *enc, x265_nal ** if (pic_in->rpu.payloadSize) { +#if ! SVT_CHECK_VERSION(1, 5, 0) inputData->dolbyVisionRpu.payload = X265_MALLOC(uint8_t, 1024); +#endif memcpy(inputData->dolbyVisionRpu.payload, pic_in->rpu.payload, pic_in->rpu.payloadSize); inputData->dolbyVisionRpu.payloadSize = pic_in->rpu.payloadSize; inputData->dolbyVisionRpu.payloadType = NAL_UNIT_UNSPECIFIED; } else { +#if ! SVT_CHECK_VERSION(1, 5, 0) inputData->dolbyVisionRpu.payload = NULL; +#endif inputData->dolbyVisionRpu.payloadSize = 0; } @@ -702,7 +706,9 @@ void x265_encoder_close(x265_encoder *enc) svt_print_summary(enc); EB_H265_ENC_INPUT *inputData = (EB_H265_ENC_INPUT*)encoder->m_svtAppData->inputPictureBuffer->pBuffer; +#if ! SVT_CHECK_VERSION(1, 5, 0) if (inputData->dolbyVisionRpu.payload) X265_FREE(inputData->dolbyVisionRpu.payload); +#endif X265_FREE(inputData); X265_FREE(encoder->m_svtAppData->inputPictureBuffer); @@ -2063,7 +2069,9 @@ int svt_initialise_input_buffer(x265_encoder *enc) inputPtr->pBuffer = (unsigned char*)x265_malloc(sizeof(EB_H265_ENC_INPUT)); EB_H265_ENC_INPUT *inputData = (EB_H265_ENC_INPUT*)inputPtr->pBuffer; +#if ! SVT_CHECK_VERSION(1, 5, 0) inputData->dolbyVisionRpu.payload = NULL; +#endif inputData->dolbyVisionRpu.payloadSize = 0; diff --git a/multimedia/x265/files/patch-source_x265.h b/multimedia/x265/files/patch-source_x265.h deleted file mode 100644 index 688edb23a552..000000000000 --- a/multimedia/x265/files/patch-source_x265.h +++ /dev/null @@ -1,13 +0,0 @@ -https://github.com/Netflix/vmaf/commit/122089fa3d23 - ---- source/x265.h.orig 2023-06-27 14:11:49 UTC -+++ source/x265.h -@@ -753,7 +753,7 @@ typedef struct x265_vmaf_commondata - int enable_conf_interval; - }x265_vmaf_commondata; - --static const x265_vmaf_commondata vcd[] = { { NULL, (char *)"/usr/local/share/model/vmaf_v0.6.1.pkl", NULL, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 1, 0 } }; -+static const x265_vmaf_commondata vcd[] = { { NULL, (char *)"/usr/local/share/model/vmaf_v0.6.1.json", NULL, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 1, 0 } }; - - typedef struct x265_temporal_layer { - int poc_offset; /* POC offset */ diff --git a/multimedia/x265/files/patch-warnings b/multimedia/x265/files/patch-warnings index 1f94ec5094bb..e1a65940be2e 100644 --- a/multimedia/x265/files/patch-warnings +++ b/multimedia/x265/files/patch-warnings @@ -1,201 +1,342 @@ ---- source/encoder/entropy.cpp 2023-06-27 10:11:49.000000000 -0400 -+++ source/encoder/entropy.cpp 2023-10-22 21:00:30.522586000 -0400 -@@ -1362,5 +1362,7 @@ +--- source/encoder/entropy.cpp 2024-09-13 09:02:55.000000000 -0400 ++++ source/encoder/entropy.cpp 2024-09-24 00:56:25.162151000 -0400 +@@ -1758,5 +1762,7 @@ bool bDenomCoded = false; int numRefDirs = slice.m_sliceType == B_SLICE ? 2 : 1; +#if CHECKED_BUILD || _DEBUG uint32_t totalSignalledWeightFlags = 0; +#endif if ((slice.m_sliceType == P_SLICE && slice.m_pps->bUseWeightPred) || -@@ -1384,5 +1386,7 @@ +@@ -1784,5 +1790,7 @@ } WRITE_FLAG(!!wp[0].wtPresent, "luma_weight_lX_flag"); +#if CHECKED_BUILD || _DEBUG totalSignalledWeightFlags += wp[0].wtPresent; +#endif } -@@ -1393,5 +1397,7 @@ +@@ -1797,5 +1805,7 @@ wp = slice.m_weightPredTable[list][ref]; WRITE_FLAG(!!wp[1].wtPresent, "chroma_weight_lX_flag"); +#if CHECKED_BUILD || _DEBUG totalSignalledWeightFlags += 2 * wp[1].wtPresent; +#endif } } --- source/encoder/sao.cpp 2023-06-27 10:11:49.000000000 -0400 +++ source/encoder/sao.cpp 2023-10-22 21:03:08.008923000 -0400 @@ -740,5 +740,4 @@ const pixel* fenc0 = m_frame->m_fencPic->getPlaneAddr(plane, addr); const pixel* rec0 = reconPic->getPlaneAddr(plane, addr); - const pixel* fenc; const pixel* rec; intptr_t stride = plane ? reconPic->m_strideC : reconPic->m_stride; @@ -870,5 +869,4 @@ } - fenc = fenc0; rec = rec0; @@ -880,5 +878,4 @@ if (startY) { - fenc += stride; rec += stride; } @@ -895,5 +892,4 @@ skipR = 5; } - fenc = fenc0; rec = rec0; startX = !lpelx; @@ -905,5 +901,4 @@ if (startY) { - fenc += stride; rec += stride; } --- source/test/pixelharness.cpp 2023-06-27 10:11:49.000000000 -0400 +++ source/test/pixelharness.cpp 2023-10-22 21:37:53.184785000 -0400 @@ -999,5 +999,4 @@ bool PixelHarness::check_pixel_var(var_t ref, var_t opt) { - int j = 0; intptr_t stride = STRIDE; @@ -1012,5 +1011,4 @@ reportfail(); - j += INCR; } @@ -1352,6 +1350,4 @@ int8_t _upBuff1_vec[MAX_CU_SIZE + 2], *upBuff1_vec = _upBuff1_vec + 1; - int j = 0; - for (int i = 0; i < ITERS; i++) { @@ -1380,5 +1376,4 @@ reportfail(); - j += INCR; } @@ -1400,6 +1395,4 @@ int8_t _upBufft_vec[MAX_CU_SIZE + 2], *upBufft_vec = _upBufft_vec + 1; - int j = 0; - // NOTE: verify more times since our asm is NOT exact match to C, the output of upBuff* will be DIFFERENT for (int i = 0; i < ITERS * 10; i++) @@ -1434,5 +1427,4 @@ reportfail(); - j += INCR; } @@ -1452,6 +1444,4 @@ int8_t _upBuff1_vec[MAX_CU_SIZE + 2], *upBuff1_vec = _upBuff1_vec + 1; - int j = 0; - // (const pixel *fenc, const pixel *rec, intptr_t stride, int8_t *upBuff1, int endX, int endY, int32_t *stats, int32_t *count) for (int i = 0; i < ITERS; i++) @@ -1483,5 +1473,4 @@ reportfail(); - j += INCR; } @@ -1736,5 +1725,4 @@ uint16_t ref_coeffFlag[MLS_GRP_NUM], opt_coeffFlag[MLS_GRP_NUM]; // bit mask map for non-zero coeff - int totalCoeffs = 0; for (int i = 0; i < 32 * 32; i++) { @@ -1748,5 +1736,4 @@ if ((rand() % 10) < 8) ref_src[i] *= -1; - totalCoeffs += (ref_src[i] != 0); } @@ -1873,5 +1860,4 @@ memset(opt_absCoeff, 0xCD, sizeof(opt_absCoeff)); - int totalCoeffs = 0; for (int i = 0; i < 32 * 32; i++) { @@ -1885,5 +1871,4 @@ if ((rand() % 10) < 8) ref_src[i] *= -1; - totalCoeffs += (ref_src[i] != 0); } @@ -2230,5 +2215,4 @@ { intptr_t srcStep = 64; - int j = 0; uint32_t dst_ref[BUFFSIZE] = { 0 }; uint32_t dst_opt[BUFFSIZE] = { 0 }; @@ -2260,6 +2244,5 @@ return false; - reportfail() - j += INCR; + reportfail(); } return true; @@ -2272,5 +2255,4 @@ * where data movement in AVX2 is 8 elements at a time */ intptr_t srcStep[2] = { 56, 64 }; - int j = 0; uint32_t dst_ref[BUFFSIZE] = { 0 }; uint32_t dst_opt[BUFFSIZE] = { 0 }; @@ -2290,6 +2272,5 @@ return false; - reportfail() - j += INCR; + reportfail(); } } --- source/common/scaler.cpp 2023-06-27 10:11:49.000000000 -0400 +++ source/common/scaler.cpp 2023-10-22 21:43:05.304243000 -0400 @@ -512,8 +512,5 @@ int srcVCrPos; int dstVCrPos; - int dst_stride = SCALER_ALIGN(dstW * sizeof(int16_t) + 66, 16); m_bitDepth = dstVideoDesc->m_inputDepth; - if (m_bitDepth == 16) - dst_stride <<= 1; m_algorithmFlags = algorithmFlags; ---- source/encoder/ratecontrol.cpp 2023-08-24 07:11:18.000000000 -0400 -+++ source/encoder/ratecontrol.cpp 2023-10-22 22:12:33.546126000 -0400 -@@ -580,5 +580,4 @@ - /* read stats */ - p = statsIn; -- double totalQpAq = 0; - for (int i = 0; i < m_numEntries; i++) - { -@@ -645,5 +644,4 @@ - } - rce->qScale = rce->newQScale = x265_qp2qScale(qpRc); -- totalQpAq += qpAq; - rce->qpNoVbv = qNoVbv; - rce->qpaRc = qpRc; -@@ -999,5 +997,5 @@ +--- source/encoder/ratecontrol.cpp 2024-09-13 09:02:55.000000000 -0400 ++++ source/encoder/ratecontrol.cpp 2024-09-23 23:12:11.531124000 -0400 +@@ -661,5 +661,4 @@ + /* read stats */ + p = statsIn; +- double totalQpAq = 0; + for (int i = 0; i < m_numEntries; i++) + { +@@ -726,5 +725,4 @@ + } + rce->qScale = rce->newQScale = x265_qp2qScale(qpRc); +- totalQpAq += qpAq; + rce->qpNoVbv = qNoVbv; + rce->qpaRc = qpRc; +@@ -1105,5 +1103,5 @@ bool RateControl::initPass2() { - uint64_t allConstBits = 0, allCodedBits = 0; + uint64_t allConstBits = 0; uint64_t allAvailableBits = uint64_t(m_param->rc.bitrate * 1000. * m_numEntries * m_frameDuration); - int startIndex, framesCount, endIndex; -@@ -1010,5 +1008,4 @@ - { - allConstBits += m_rce2Pass[endIndex].miscBits; -- allCodedBits += m_rce2Pass[endIndex].coeffBits + m_rce2Pass[endIndex].mvBits; - if (m_param->rc.rateControlMode == X265_RC_CRF) + int startIndex, endIndex; +@@ -1124,5 +1122,4 @@ { + allConstBits += m_rce2Pass[endIndex].miscBits; +- allCodedBits += m_rce2Pass[endIndex].coeffBits + m_rce2Pass[endIndex].mvBits; + } + +@@ -1222,5 +1219,5 @@ + double qScaleMin = x265_qp2qScale(m_param->rc.qpMin); + double qScaleMax = x265_qp2qScale(m_param->rc.qpMax); +- int iterations = 0 , adjMin, adjMax; ++ int adjMin, adjMax; + CHECKED_MALLOC(fills, double, m_numEntries + 1); + fills++; +@@ -1229,5 +1226,4 @@ + do + { +- iterations++; + prevBits = expectedBits; + +--- source/encoder/search.cpp 2024-09-13 09:02:55.000000000 -0400 ++++ source/encoder/search.cpp 2024-09-23 23:37:29.009223000 -0400 +@@ -277,5 +277,4 @@ + } + +- uint32_t tuDepthC = tuDepth; + uint32_t log2TrSizeC = log2TrSize - m_hChromaShift; + +@@ -286,5 +285,4 @@ + return; + log2TrSizeC = 2; +- tuDepthC--; + } + +@@ -5706,10 +5708,8 @@ + uint32_t log2TrSizeC = log2TrSize - m_hChromaShift; + uint32_t codeChroma = (m_csp != X265_CSP_I400 && m_frame->m_fencPic->m_picCsp != X265_CSP_I400) ? 1 : 0; +- uint32_t tuDepthC = tuDepth; + if (log2TrSizeC < 2) + { + X265_CHECK(log2TrSize == 2 && m_csp != X265_CSP_I444 && tuDepth, "invalid tuDepth\n"); + log2TrSizeC = 2; +- tuDepthC--; + codeChroma &= !(absPartIdx & 3); + } +--- source/dynamicHDR10/json11/json11.cpp 2024-09-13 09:02:55.000000000 -0400 ++++ source/dynamicHDR10/json11/json11.cpp 2024-09-23 23:43:58.447286000 -0400 +@@ -158,5 +158,5 @@ + // Constructors + explicit Value(const T &value) : m_value(value) {} +- explicit Value(T &&value) : m_value(move(value)) {} ++ explicit Value(T &&value) : m_value(std::move(value)) {} + + // Get type tag +@@ -205,5 +205,5 @@ + public: + explicit JsonString(const string &value) : Value(value) {} +- explicit JsonString(string &&value) : Value(move(value)) {} ++ explicit JsonString(string &&value) : Value(std::move(value)) {} + }; + +@@ -213,5 +213,5 @@ + public: + explicit JsonArray(const Json::array &value) : Value(value) {} +- explicit JsonArray(Json::array &&value) : Value(move(value)) {} ++ explicit JsonArray(Json::array &&value) : Value(std::move(value)) {} + }; + +@@ -221,5 +221,5 @@ + public: + explicit JsonObject(const Json::object &value) : Value(value) {} +- explicit JsonObject(Json::object &&value) : Value(move(value)) {} ++ explicit JsonObject(Json::object &&value) : Value(std::move(value)) {} + }; + +@@ -263,10 +263,10 @@ + Json::Json(bool value) : m_ptr(value ? statics().t : statics().f) {} + Json::Json(const string &value) : m_ptr(make_shared(value)) {} +-Json::Json(string &&value) : m_ptr(make_shared(move(value))) {} ++Json::Json(string &&value) : m_ptr(make_shared(std::move(value))) {} + Json::Json(const char * value) : m_ptr(make_shared(value)) {} + Json::Json(const Json::array &values) : m_ptr(make_shared(values)) {} +-Json::Json(Json::array &&values) : m_ptr(make_shared(move(values))) {} ++Json::Json(Json::array &&values) : m_ptr(make_shared(std::move(values))) {} + Json::Json(const Json::object &values) : m_ptr(make_shared(values)) {} +-Json::Json(Json::object &&values) : m_ptr(make_shared(move(values))) {} ++Json::Json(Json::object &&values) : m_ptr(make_shared(std::move(values))) {} + + /* * * * * * * * * * * * * * * * * * * * +@@ -362,5 +362,5 @@ + */ + Json fail(string &&msg) { +- return fail(move(msg), Json()); ++ return fail(std::move(msg), Json()); + } + +--- source/encoder/slicetype.cpp 2024-09-13 09:02:55.000000000 -0400 ++++ source/encoder/slicetype.cpp 2024-09-23 23:46:16.350590000 -0400 +@@ -1455,5 +1455,4 @@ + uint32_t variance; + +- uint64_t blockXY = 0; + pixel* src = curFrame->m_fencPic->m_picOrg[0]; + +@@ -1471,5 +1470,4 @@ + + rowVariance += variance; +- blockXY++; + } + picTotVariance += (uint16_t)(rowVariance / maxCol); +@@ -1502,5 +1500,4 @@ + + rowVariance += variance; +- blockXY++; + } + picTotVariance += (uint16_t)(rowVariance / maxColChroma); +@@ -1526,5 +1523,4 @@ + + rowVariance += variance; +- blockXY++; + } + picTotVariance += (uint16_t)(rowVariance / maxColChroma); +--- source/common/param.cpp 2024-09-13 09:02:55.000000000 -0400 ++++ source/common/param.cpp 2024-09-23 23:52:41.800395000 -0400 +@@ -871,10 +871,13 @@ + bool bExtraParams = false; + char nameBuf[64]; +- static int count; + + if (!name) + return X265_PARAM_BAD_NAME; + ++#ifdef SVT_HEVC ++ static int count; + count++; ++#endif ++ + // skip -- prefix if provided + if (name[0] == '-' && name[1] == '-') +--- source/common/cudata.cpp 2024-09-13 09:02:55.000000000 -0400 ++++ source/common/cudata.cpp 2024-09-24 00:04:19.872724000 -0400 +@@ -74,5 +74,5 @@ + inline bool isEqualRowOrCol(int addrA, int addrB) + { +- return isEqualCol(addrA, addrB) | isEqualRow(addrA, addrB); ++ return isEqualCol(addrA, addrB) || isEqualRow(addrA, addrB); + } + diff --git a/multimedia/x265/pkg-plist b/multimedia/x265/pkg-plist index 33c170ed4109..25e1a71607c4 100644 --- a/multimedia/x265/pkg-plist +++ b/multimedia/x265/pkg-plist @@ -1,10 +1,10 @@ bin/x265 include/hdr10plus.h include/x265.h include/x265_config.h lib/libhdr10plus.a lib/libhdr10plus.so lib/libx265.a lib/libx265.so -lib/libx265.so.200 +lib/libx265.so.209 libdata/pkgconfig/x265.pc