git: 645419c8e465 - main - multimedia/x265: upgrade to 3.5. Finally...

From: Mikhail Teterin <mi_at_FreeBSD.org>
Date: Fri, 15 Dec 2023 21:14:23 UTC
The branch main has been updated by mi:

URL: https://cgit.FreeBSD.org/ports/commit/?id=645419c8e46533e7e9953a432fa02dc7c140b63c

commit 645419c8e46533e7e9953a432fa02dc7c140b63c
Author:     Mikhail Teterin <mi@FreeBSD.org>
AuthorDate: 2023-12-15 21:12:58 +0000
Commit:     Mikhail Teterin <mi@FreeBSD.org>
CommitDate: 2023-12-15 21:12:58 +0000

    multimedia/x265: upgrade to 3.5. Finally...
    
    PR:     274526
    Submitted by:   takefu
    Release Notes:
            https://x265.readthedocs.io/en/master/releasenotes.html#version-3-5
---
 multimedia/x265/Makefile                           |  16 +-
 multimedia/x265/distinfo                           |   8 +-
 multimedia/x265/files/patch-md5                    |  51 ++++++
 multimedia/x265/files/patch-source_CMakeLists.txt  |  12 +-
 .../files/patch-source_cmake_Findsvthevc.cmake     |   8 +-
 .../x265/files/patch-source_common_version.cpp     |  11 +-
 multimedia/x265/files/patch-source_encoder_api.cpp |  19 +-
 multimedia/x265/files/patch-source_x265.h          |   8 +-
 multimedia/x265/files/patch-warnings               | 201 +++++++++++++++++++++
 multimedia/x265/pkg-plist                          |   2 +-
 10 files changed, 296 insertions(+), 40 deletions(-)

diff --git a/multimedia/x265/Makefile b/multimedia/x265/Makefile
index 59275b34e4bc..a6e5db162104 100644
--- a/multimedia/x265/Makefile
+++ b/multimedia/x265/Makefile
@@ -1,9 +1,11 @@
 PORTNAME=	x265
-PORTVERSION=	3.4
-PORTREVISION=	3
+PORTVERSION=	3.5
 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
+
 MAINTAINER=	mi@aldan.algebra.com
 COMMENT=	H.265/High Efficiency Video Coding (HEVC) format
 WWW=		https://www.x265.org/
@@ -13,9 +15,9 @@ LICENSE_FILE=	${WRKSRC:H}/COPYING
 
 USES=		cmake compiler:c++14-lang cpe pathfix dos2unix
 
-CPE_VENDOR=		multicorewareinc
+CPE_VENDOR=	multicorewareinc
 
-BB_TAG=	25b2c07035ff	# Top of the Release_3.4 branch at this time
+BB_TAG=		Release_${DISTVERSION}
 
 OPTIONS_DEFINE=		DEBUG OPTIMIZED_FLAGS VMAF
 OPTIONS_DEFAULT=	OPTIMIZED_FLAGS HI8P HI10P HI12P
@@ -30,7 +32,7 @@ OPTIONS_DEFAULT_powerpc64le=	ASM
 OPTIONS_MULTI=		PixelWidth
 OPTIONS_MULTI_PixelWidth=HI8P HI10P HI12P
 
-DOS2UNIX_FILES=		abrEncApp.cpp
+DOS2UNIX_FILES=		common/scaler.cpp
 DEBUG_PREVENTS=		OPTIMIZED_FLAGS
 DEBUG_PREVENTS_MSG=	Optimizations are incompatible with debugging code
 DEBUG_CMAKE_ON=		-DCMAKE_ASM_NASM_FLAGS:STRING="-g -O0"
@@ -41,7 +43,7 @@ SVTHEVC_CMAKE_ON=	-DSVT_HEVC_INCLUDE_DIR:PATH="${LOCALBASE}/include/svt-hevc"
 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"
+VMAF_CMAKE_ON=		-DVMAF_INCLUDE_DIR:PATH="${LOCALBASE}/include/libvmaf"
 
 DEBUG_DESC=	Enable debugging
 HI8P_DESC=	Enable 8-bit pixel-width (you, probably, want this)
@@ -54,7 +56,7 @@ VMAF_DESC=	Per frame and aggregate VMAF score
 USE_LDCONFIG=	yes
 CMAKE_ARGS=	-DENABLE_TESTS=on -DENABLE_HDR10_PLUS:BOOL=true
 LDFLAGS_i386=	-Wl,-znotext
-EXTRACT_AFTER_ARGS+=	--exclude compat --strip-components=1
+EXTRACT_AFTER_ARGS+=	--exclude compat --exclude md5\.* --strip-components=1
 PATCH_WRKSRC=	${WRKSRC:H}
 WRKSRC=		${WRKDIR}/source
 
diff --git a/multimedia/x265/distinfo b/multimedia/x265/distinfo
index cec36bc8e5d6..48150a37f61e 100644
--- a/multimedia/x265/distinfo
+++ b/multimedia/x265/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1600662771
-SHA256 (x265-3.4.tar.gz) = 01f17d94689ef79807fa2b4bd7f5f58bb18416e72a135c7f56c30162a980cfb8
-SIZE (x265-3.4.tar.gz) = 1532396
+TIMESTAMP = 1698027802
+SHA256 (x265-3.5.tar.gz) = 8a5fcfddb3e2db520b637e475a507fb00117d554bdb3204c5828626d888c306a
+SIZE (x265-3.5.tar.gz) = 1538610
+SHA256 (x265-asm-warnings.patch) = 0faa3278887a47ed8c968c994e4cc71a2921aac38f5d560dae898124f806871d
+SIZE (x265-asm-warnings.patch) = 4526
diff --git a/multimedia/x265/files/patch-md5 b/multimedia/x265/files/patch-md5
new file mode 100644
index 000000000000..7bc99e1423a3
--- /dev/null
+++ b/multimedia/x265/files/patch-md5
@@ -0,0 +1,51 @@
+--- source/common/picyuv.h	2023-06-27 10:11:49.000000000 -0400
++++ source/common/picyuv.h	2023-10-22 21:14:09.423270000 -0400
+@@ -26,5 +26,5 @@ 
+ 
+ #include "common.h"
+-#include "md5.h"
++#include <md5.h>
+ #include "x265.h"
+ struct x265_picyuv {};
+--- source/encoder/frameencoder.h	2023-06-27 10:11:49.000000000 -0400
++++ source/encoder/frameencoder.h	2023-10-22 21:14:52.414503000 -0400
+@@ -31,5 +31,4 @@ 
+ #include "frame.h"
+ #include "picyuv.h"
+-#include "md5.h"
+ 
+ #include "analysis.h"
+--- source/encoder/sei.h	2023-06-27 10:11:49.000000000 -0400
++++ source/encoder/sei.h	2023-10-22 21:15:50.862452000 -0400
+@@ -29,5 +29,5 @@ 
+ #include "slice.h"
+ #include "nal.h"
+-#include "md5.h"
++#include <md5.h>
+ 
+ namespace X265_NS {
+--- source/encoder/frameencoder.cpp	2023-06-27 10:11:49.000000000 -0400
++++ source/encoder/frameencoder.cpp	2023-10-22 21:27:55.363979000 -0400
+@@ -426,5 +426,5 @@ 
+         m_seiReconPictureDigest.m_method = SEIDecodedPictureHash::MD5;
+         for (int i = 0; i < planes; i++)
+-            MD5Final(&m_seiReconPictureDigest.m_state[i], m_seiReconPictureDigest.m_digest[i]);
++            MD5Final(m_seiReconPictureDigest.m_digest[i], &m_seiReconPictureDigest.m_state[i]);
+         payloadSize = 1 + 16 * planes;
+     }
+--- source/CMakeLists.txt	2023-06-27 10:11:49.000000000 -0400
++++ source/CMakeLists.txt	2023-10-22 21:54:36.900303000 -0400
+@@ -96,4 +96,5 @@ 
+ if(UNIX)
+     list(APPEND PLATFORM_LIBS pthread)
++    list(APPEND PLATFORM_LIBS md)
+     find_library(LIBRT rt)
+     if(LIBRT)
+--- source/common/CMakeLists.txt	2023-06-27 10:11:49.000000000 -0400
++++ source/common/CMakeLists.txt	2023-10-22 21:21:56.177834000 -0400
+@@ -156,5 +156,4 @@ 
+     threadpool.cpp threadpool.h
+     wavefront.h wavefront.cpp
+-    md5.cpp md5.h
+     bitstream.h bitstream.cpp
+     yuv.cpp yuv.h
diff --git a/multimedia/x265/files/patch-source_CMakeLists.txt b/multimedia/x265/files/patch-source_CMakeLists.txt
index 19fa130e3b0e..5a3fdb3cca3d 100644
--- a/multimedia/x265/files/patch-source_CMakeLists.txt
+++ b/multimedia/x265/files/patch-source_CMakeLists.txt
@@ -1,6 +1,6 @@
---- source/CMakeLists.txt.orig	2021-10-31 01:46:10 UTC
-+++ source/CMakeLists.txt
-@@ -43,7 +43,7 @@ set(X86_ALIASES x86 i386 i686 x86_64 amd64)
+--- 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)
  list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
  list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
@@ -9,7 +9,7 @@
  list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH)
  if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
      set(X86 1)
-@@ -121,6 +121,7 @@ if(UNIX)
+@@ -122,6 +122,7 @@
      option(ENABLE_LIBVMAF "Enable VMAF" OFF)
      if(ENABLE_LIBVMAF)
          add_definitions(-DENABLE_LIBVMAF)
@@ -17,7 +17,7 @@
      endif()
  endif(UNIX)
  
-@@ -592,12 +593,6 @@ if(ENABLE_HDR10_PLUS)
+@@ -593,12 +594,6 @@
          ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
  endif()
  
@@ -30,7 +30,7 @@
  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)
-@@ -649,7 +644,10 @@ if(ENABLE_SHARED)
+@@ -650,7 +645,10 @@
      if(EXTRA_LIB)
          target_link_libraries(x265-shared ${EXTRA_LIB})
      endif()
diff --git a/multimedia/x265/files/patch-source_cmake_Findsvthevc.cmake b/multimedia/x265/files/patch-source_cmake_Findsvthevc.cmake
index 4c6029d4213e..dcd80ad6f2e0 100644
--- a/multimedia/x265/files/patch-source_cmake_Findsvthevc.cmake
+++ b/multimedia/x265/files/patch-source_cmake_Findsvthevc.cmake
@@ -1,6 +1,7 @@
---- source/cmake/Findsvthevc.cmake	2020-05-29 17:39:35.000000000 +0000
-+++ source/cmake/Findsvthevc.cmake	2020-08-07 02:26:55.307048000 +0000
-@@ -39,9 +39,5 @@
+--- source/cmake/Findsvthevc.cmake.orig	2023-05-08 09:43:31 UTC
++++ source/cmake/Findsvthevc.cmake
+@@ -38,11 +38,7 @@ if(SVT_HEVC_INCLUDE_DIR)
+         string(REGEX MATCH "SVT_VERSION_PATCHLEVEL  \\(([0-9]*)\\)" _ ${version})
          set(SVT_VERSION_PATCHLEVEL ${CMAKE_MATCH_1})
  
 -        if(NOT ${SVT_VERSION_MAJOR} EQUAL "1" OR NOT ${SVT_VERSION_MINOR} EQUAL "4" OR NOT ${SVT_VERSION_PATCHLEVEL} EQUAL "1")
@@ -11,3 +12,4 @@
 +        message(STATUS "-- Found SVT-HEVC Lib Version: ${SVT_VERSION_MAJOR}.${SVT_VERSION_MINOR}.${SVT_VERSION_PATCHLEVEL}")
      else()
          message (SEND_ERROR "-- Required version of SVT-HEVC Lib: ${SVT_VERSION_MAJOR_REQUIRED}.${SVT_VERSION_MINOR_REQUIRED}.${SVT_VERSION_PATCHLEVEL_REQUIRED}; Aborting configure  ")
+     endif()
diff --git a/multimedia/x265/files/patch-source_common_version.cpp b/multimedia/x265/files/patch-source_common_version.cpp
index ef813a02d684..0210f5f77d83 100644
--- a/multimedia/x265/files/patch-source_common_version.cpp
+++ b/multimedia/x265/files/patch-source_common_version.cpp
@@ -1,4 +1,4 @@
---- source/common/version.cpp.orig	2020-05-29 17:39:35 UTC
+--- source/common/version.cpp.orig	2023-06-27 14:11:49 UTC
 +++ source/common/version.cpp
 @@ -63,6 +63,8 @@
  #define ONOS    "[Linux]"
@@ -9,12 +9,3 @@
  #elif  __CYGWIN__
  #define ONOS    "[Cygwin]"
  #elif __APPLE__
-@@ -71,7 +73,7 @@
- #define ONOS    "[Unk-OS]"
- #endif
- 
--#if X86_64
-+#if defined(X86_64) || X265_ARCH_ARM64
- #define BITS    "[64 bit]"
- #else
- #define BITS    "[32 bit]"
diff --git a/multimedia/x265/files/patch-source_encoder_api.cpp b/multimedia/x265/files/patch-source_encoder_api.cpp
index f355b828a4c3..dcd29b667096 100644
--- a/multimedia/x265/files/patch-source_encoder_api.cpp
+++ b/multimedia/x265/files/patch-source_encoder_api.cpp
@@ -8,9 +8,10 @@ See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248479
 
 	-mi
 
---- source/encoder/api.cpp	2020-05-29 13:39:35.000000000 -0400
-+++ source/encoder/api.cpp	2020-08-06 22:51:30.227635000 -0400
-@@ -451,5 +451,7 @@
+--- 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)
@@ -18,7 +19,8 @@ See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248479
 +#endif
                      memcpy(inputData->dolbyVisionRpu.payload, pic_in->rpu.payload, pic_in->rpu.payloadSize);
                      inputData->dolbyVisionRpu.payloadSize = pic_in->rpu.payloadSize;
-@@ -458,5 +460,7 @@
+                     inputData->dolbyVisionRpu.payloadType = NAL_UNIT_UNSPECIFIED;
+                 }
                  else
                  {
 +#if ! SVT_CHECK_VERSION(1, 5, 0)
@@ -26,7 +28,9 @@ See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248479
 +#endif
                      inputData->dolbyVisionRpu.payloadSize = 0;
                  }
-@@ -696,5 +700,7 @@
+ 
+@@ -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)
@@ -34,7 +38,9 @@ See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248479
 +#endif
  
              X265_FREE(inputData);
-@@ -2052,5 +2058,7 @@
+             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)
@@ -42,3 +48,4 @@ See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248479
 +#endif
      inputData->dolbyVisionRpu.payloadSize = 0;
  
+ 
diff --git a/multimedia/x265/files/patch-source_x265.h b/multimedia/x265/files/patch-source_x265.h
index 1fee612613ad..688edb23a552 100644
--- a/multimedia/x265/files/patch-source_x265.h
+++ b/multimedia/x265/files/patch-source_x265.h
@@ -1,13 +1,13 @@
 https://github.com/Netflix/vmaf/commit/122089fa3d23
 
---- source/x265.h.orig	2020-09-16 15:52:49 UTC
+--- source/x265.h.orig	2023-06-27 14:11:49 UTC
 +++ source/x265.h
-@@ -733,7 +733,7 @@ typedef struct x265_vmaf_commondata
+@@ -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 } };
  
- /* x265 input parameters
-  *
+ typedef struct x265_temporal_layer {
+     int poc_offset;      /* POC offset */
diff --git a/multimedia/x265/files/patch-warnings b/multimedia/x265/files/patch-warnings
new file mode 100644
index 000000000000..1f94ec5094bb
--- /dev/null
+++ b/multimedia/x265/files/patch-warnings
@@ -0,0 +1,201 @@
+--- 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 @@ 
+     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 @@ 
+                 }
+                 WRITE_FLAG(!!wp[0].wtPresent, "luma_weight_lX_flag");
++#if CHECKED_BUILD || _DEBUG
+                 totalSignalledWeightFlags += wp[0].wtPresent;
++#endif
+             }
+ 
+@@ -1393,5 +1397,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 @@ 
+ 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)
+         {
diff --git a/multimedia/x265/pkg-plist b/multimedia/x265/pkg-plist
index 36d6f89c2fd5..33c170ed4109 100644
--- a/multimedia/x265/pkg-plist
+++ b/multimedia/x265/pkg-plist
@@ -6,5 +6,5 @@ lib/libhdr10plus.a
 lib/libhdr10plus.so
 lib/libx265.a
 lib/libx265.so
-lib/libx265.so.192
+lib/libx265.so.200
 libdata/pkgconfig/x265.pc