From mahesh at multicorewareinc.com Sat Apr 1 04:31:46 2023 From: mahesh at multicorewareinc.com (Mahesh Pittala) Date: Sat, 1 Apr 2023 10:01:46 +0530 Subject: [x265] [PATCH] Fix build error in MacOS aarch64 Message-ID: >From 36785eac984d808d69b5221e84db29103d0b8048 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Sat, 1 Apr 2023 09:11:08 +0530 Subject: [PATCH] Fix build error in MacOS aarch64 tested on mac2.metal aws instance Signed-off-by: maheshpittala --- source/common/aarch64/asm.S | 5 +++++ source/common/aarch64/pixel-util.S | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/common/aarch64/asm.S b/source/common/aarch64/asm.S index 2506f50aa..cff069058 100644 --- a/source/common/aarch64/asm.S +++ b/source/common/aarch64/asm.S @@ -64,6 +64,11 @@ #endif #endif +#define GLUE(a, b) a ## b +#define JOIN(a, b) GLUE(a, b) + +#define PFX_C(name) JOIN(JOIN(JOIN(EXTERN_ASM, X265_NS), _), name) + #ifdef __APPLE__ .macro endfunc ELF .size \name, . - \name diff --git a/source/common/aarch64/pixel-util.S b/source/common/aarch64/pixel-util.S index fba9a90d5..0e85c8792 100644 --- a/source/common/aarch64/pixel-util.S +++ b/source/common/aarch64/pixel-util.S @@ -2407,7 +2407,7 @@ function PFX(costCoeffNxN_neon) // x5 - scanFlagMask // x6 - baseCtx mov x0, #0 - movrel x1, x265_entropyStateBits + movrel x1, PFX_C(entropyStateBits) mov x4, #0 mov x11, #0 movi v31.16b, #0 -- 2.23.0.windows.1 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aarch64-macos-builderror-fix.diff Type: application/octet-stream Size: 1390 bytes Desc: not available URL: From mahesh at multicorewareinc.com Sat Apr 1 04:33:19 2023 From: mahesh at multicorewareinc.com (Mahesh Pittala) Date: Sat, 1 Apr 2023 10:03:19 +0530 Subject: [x265] [PATCH] add MacOS aarch64 build support Message-ID: >From 753305affb093ae15d5e4b333125267b16258c21 Mon Sep 17 00:00:00 2001 From: Barath Nithish Date: Sat, 1 Apr 2023 09:55:13 +0530 Subject: [PATCH] add MacOS aarch64 build support Signed-off-by: maheshpittala --- build/aarch64-darwin/crosscompile.cmake | 15 +++++++++++++++ build/aarch64-darwin/make-Makefiles.bash | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 build/aarch64-darwin/crosscompile.cmake create mode 100644 build/aarch64-darwin/make-Makefiles.bash diff --git a/build/aarch64-darwin/crosscompile.cmake b/build/aarch64-darwin/crosscompile.cmake new file mode 100644 index 000000000..c35f73dc4 --- /dev/null +++ b/build/aarch64-darwin/crosscompile.cmake @@ -0,0 +1,15 @@ +# CMake toolchain file for cross compiling x265 for aarch64 +# This feature is only supported as experimental. Use with caution. +# Please report bugs on bitbucket +# Run cmake with: cmake -DCMAKE_TOOLCHAIN_FILE=crosscompile.cmake -G "Unix Makefiles" ../../source && ccmake ../../source + +set(CROSS_COMPILE_ARM64 1) +set(CMAKE_SYSTEM_NAME Darwin) +set(CMAKE_SYSTEM_PROCESSOR aarch64) + +# specify the cross compiler +set(CMAKE_C_COMPILER gcc-12) +set(CMAKE_CXX_COMPILER g++-12) + +# specify the target environment +SET(CMAKE_FIND_ROOT_PATH /opt/homebrew/bin/) diff --git a/build/aarch64-darwin/make-Makefiles.bash b/build/aarch64-darwin/make-Makefiles.bash new file mode 100644 index 000000000..c9582da0a --- /dev/null +++ b/build/aarch64-darwin/make-Makefiles.bash @@ -0,0 +1,4 @@ +#!/bin/bash +# Run this from within a bash shell + +cmake -DCMAKE_TOOLCHAIN_FILE="crosscompile.cmake" -G "Unix Makefiles" ../../source && ccmake ../../source -- 2.23.0.windows.1 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aarch64-macos-build-support.diff Type: application/octet-stream Size: 1741 bytes Desc: not available URL: From mahesh at multicorewareinc.com Mon Apr 3 06:34:44 2023 From: mahesh at multicorewareinc.com (Mahesh Pittala) Date: Mon, 3 Apr 2023 12:04:44 +0530 Subject: [x265] [PATCH] Fix build error in MacOS aarch64 In-Reply-To: References: Message-ID: pushed to master branch On Sat, Apr 1, 2023 at 10:01?AM Mahesh Pittala wrote: > From 36785eac984d808d69b5221e84db29103d0b8048 Mon Sep 17 00:00:00 2001 > From: Min Chen > Date: Sat, 1 Apr 2023 09:11:08 +0530 > Subject: [PATCH] Fix build error in MacOS aarch64 > > tested on mac2.metal aws instance > > Signed-off-by: maheshpittala > --- > source/common/aarch64/asm.S | 5 +++++ > source/common/aarch64/pixel-util.S | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/source/common/aarch64/asm.S b/source/common/aarch64/asm.S > index 2506f50aa..cff069058 100644 > --- a/source/common/aarch64/asm.S > +++ b/source/common/aarch64/asm.S > @@ -64,6 +64,11 @@ > #endif > #endif > > +#define GLUE(a, b) a ## b > +#define JOIN(a, b) GLUE(a, b) > + > +#define PFX_C(name) JOIN(JOIN(JOIN(EXTERN_ASM, X265_NS), _), name) > + > #ifdef __APPLE__ > .macro endfunc > ELF .size \name, . - \name > diff --git a/source/common/aarch64/pixel-util.S > b/source/common/aarch64/pixel-util.S > index fba9a90d5..0e85c8792 100644 > --- a/source/common/aarch64/pixel-util.S > +++ b/source/common/aarch64/pixel-util.S > @@ -2407,7 +2407,7 @@ function PFX(costCoeffNxN_neon) > // x5 - scanFlagMask > // x6 - baseCtx > mov x0, #0 > - movrel x1, x265_entropyStateBits > + movrel x1, PFX_C(entropyStateBits) > mov x4, #0 > mov x11, #0 > movi v31.16b, #0 > -- > 2.23.0.windows.1 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mahesh at multicorewareinc.com Mon Apr 3 06:35:42 2023 From: mahesh at multicorewareinc.com (Mahesh Pittala) Date: Mon, 3 Apr 2023 12:05:42 +0530 Subject: [x265] [PATCH] add MacOS aarch64 build support In-Reply-To: References: Message-ID: pushed to master branch On Sat, Apr 1, 2023 at 10:03?AM Mahesh Pittala wrote: > From 753305affb093ae15d5e4b333125267b16258c21 Mon Sep 17 00:00:00 2001 > From: Barath Nithish > Date: Sat, 1 Apr 2023 09:55:13 +0530 > Subject: [PATCH] add MacOS aarch64 build support > > Signed-off-by: maheshpittala > --- > build/aarch64-darwin/crosscompile.cmake | 15 +++++++++++++++ > build/aarch64-darwin/make-Makefiles.bash | 4 ++++ > 2 files changed, 19 insertions(+) > create mode 100644 build/aarch64-darwin/crosscompile.cmake > create mode 100644 build/aarch64-darwin/make-Makefiles.bash > > diff --git a/build/aarch64-darwin/crosscompile.cmake > b/build/aarch64-darwin/crosscompile.cmake > new file mode 100644 > index 000000000..c35f73dc4 > --- /dev/null > +++ b/build/aarch64-darwin/crosscompile.cmake > @@ -0,0 +1,15 @@ > +# CMake toolchain file for cross compiling x265 for aarch64 > +# This feature is only supported as experimental. Use with caution. > +# Please report bugs on bitbucket > +# Run cmake with: cmake -DCMAKE_TOOLCHAIN_FILE=crosscompile.cmake -G > "Unix Makefiles" ../../source && ccmake ../../source > + > +set(CROSS_COMPILE_ARM64 1) > +set(CMAKE_SYSTEM_NAME Darwin) > +set(CMAKE_SYSTEM_PROCESSOR aarch64) > + > +# specify the cross compiler > +set(CMAKE_C_COMPILER gcc-12) > +set(CMAKE_CXX_COMPILER g++-12) > + > +# specify the target environment > +SET(CMAKE_FIND_ROOT_PATH /opt/homebrew/bin/) > diff --git a/build/aarch64-darwin/make-Makefiles.bash > b/build/aarch64-darwin/make-Makefiles.bash > new file mode 100644 > index 000000000..c9582da0a > --- /dev/null > +++ b/build/aarch64-darwin/make-Makefiles.bash > @@ -0,0 +1,4 @@ > +#!/bin/bash > +# Run this from within a bash shell > + > +cmake -DCMAKE_TOOLCHAIN_FILE="crosscompile.cmake" -G "Unix Makefiles" > ../../source && ccmake ../../source > -- > 2.23.0.windows.1 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at comstyle.com Sun Apr 16 00:48:06 2023 From: brad at comstyle.com (Brad Smith) Date: Sat, 15 Apr 2023 20:48:06 -0400 Subject: [x265] [PATCH] Fix building checkasm on i386 when building with PIE Message-ID: Make sure the i386 assembly code calls libc functions through the PLT such that it can be used to build with PIE. diff --git a/source/test/checkasm-a.asm b/source/test/checkasm-a.asm index a69a666ac..dcfe36a57 100644 --- a/source/test/checkasm-a.asm +++ b/source/test/checkasm-a.asm @@ -202,7 +202,11 @@ cglobal checkasm_call, 1,7 mov r4, edx lea r1, [error_message] push r1 +%if FORMAT_ELF + call puts wrt ..plt +%else call puts +%endif add esp, 4 mov r1, r1m mov dword [r1], 0 From yaswanth.sastry at multicorewareinc.com Thu Apr 27 12:24:51 2023 From: yaswanth.sastry at multicorewareinc.com (Yaswanth Sastry) Date: Thu, 27 Apr 2023 17:54:51 +0530 Subject: [x265] [PATCH] Reflect Zonefile Parameters inside Lookahead. Message-ID: >From 888cebaee5ca1d003234ce92225f018e4ab1689e Mon Sep 17 00:00:00 2001 From: yaswanthsastry Date: Wed, 26 Apr 2023 15:29:31 +0530 Subject: [PATCH] Reflect Zonefile Parameters inside Lookahead. --- source/encoder/slicetype.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/encoder/slicetype.cpp b/source/encoder/slicetype.cpp index 550cc1872..450f998f6 100644 --- a/source/encoder/slicetype.cpp +++ b/source/encoder/slicetype.cpp @@ -1466,6 +1466,14 @@ void Lookahead::slicetypeDecide() Frame *curFrame = m_inputQueue.first(); int j; + if (m_param->bResetZoneConfig) + { + for (int i = 0; i < m_param->rc.zonefileCount; i++) + { + if (m_param->rc.zones[i].startFrame == curFrame->m_poc) + m_param = m_param->rc.zones[i].zoneParam; + } + } for (j = 0; j < m_param->bframes + 2; j++) { if (!curFrame) break; -- 2.37.3.windows.1 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: patch.diff Type: application/octet-stream Size: 959 bytes Desc: not available URL: From mahesh at multicorewareinc.com Fri Apr 28 17:31:13 2023 From: mahesh at multicorewareinc.com (Mahesh Pittala) Date: Fri, 28 Apr 2023 23:01:13 +0530 Subject: [x265] [PATCH] Reflect Zonefile Parameters inside Lookahead. In-Reply-To: References: Message-ID: pushed to the master and Release_3.5 branches. On Thu, Apr 27, 2023 at 5:55?PM Yaswanth Sastry < yaswanth.sastry at multicorewareinc.com> wrote: > From 888cebaee5ca1d003234ce92225f018e4ab1689e Mon Sep 17 00:00:00 2001 > From: yaswanthsastry > Date: Wed, 26 Apr 2023 15:29:31 +0530 > Subject: [PATCH] Reflect Zonefile Parameters inside Lookahead. > > --- > source/encoder/slicetype.cpp | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/source/encoder/slicetype.cpp b/source/encoder/slicetype.cpp > index 550cc1872..450f998f6 100644 > --- a/source/encoder/slicetype.cpp > +++ b/source/encoder/slicetype.cpp > @@ -1466,6 +1466,14 @@ void Lookahead::slicetypeDecide() > > Frame *curFrame = m_inputQueue.first(); > int j; > + if (m_param->bResetZoneConfig) > + { > + for (int i = 0; i < m_param->rc.zonefileCount; i++) > + { > + if (m_param->rc.zones[i].startFrame == curFrame->m_poc) > + m_param = m_param->rc.zones[i].zoneParam; > + } > + } > for (j = 0; j < m_param->bframes + 2; j++) > { > if (!curFrame) break; > -- > 2.37.3.windows.1 > > > _______________________________________________ > x265-devel mailing list > x265-devel at videolan.org > https://mailman.videolan.org/listinfo/x265-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karam.singh at multicorewareinc.com Sat Apr 29 10:45:20 2023 From: karam.singh at multicorewareinc.com (Karam Singh) Date: Sat, 29 Apr 2023 16:15:20 +0530 Subject: [x265] [PATCH] Fix Extra IDR issue in zonefile feature when total number of frames unknown (live). Message-ID: >From 049f6d903d1f7cf400d75c48bdcf0462002f499f Mon Sep 17 00:00:00 2001 From: Karam Singh Date: Thu, 27 Apr 2023 18:15:28 +0530 Subject: [PATCH] Fix Extra IDR issue in zonefile feature when total number of frames unknown (live) --- source/common/param.cpp | 1 + source/encoder/slicetype.cpp | 2 ++ source/x265.h | 1 + source/x265cli.cpp | 3 +++ 4 files changed, 7 insertions(+) diff --git a/source/common/param.cpp b/source/common/param.cpp index e9ca077d7..58ba49793 100644 --- a/source/common/param.cpp +++ b/source/common/param.cpp @@ -2594,6 +2594,7 @@ void x265_copy_params(x265_param* dst, x265_param* src) for (int i = 0; i < src->rc.zonefileCount; i++) { dst->rc.zones[i].startFrame = src->rc.zones[i].startFrame; + dst->rc.zones[0].keyframeMax = src->rc.zones[0].keyframeMax; memcpy(dst->rc.zones[i].zoneParam, src->rc.zones[i].zoneParam, sizeof(x265_param)); } } diff --git a/source/encoder/slicetype.cpp b/source/encoder/slicetype.cpp index 550cc1872..2cfb39620 100644 --- a/source/encoder/slicetype.cpp +++ b/source/encoder/slicetype.cpp @@ -1958,6 +1958,8 @@ void Lookahead::slicetypeAnalyse(Lowres **frames, bool bKeyframe) nextZoneStart += (i + 1 < m_param->rc.zonefileCount) ? m_param->rc.zones[i + 1].startFrame + m_param->rc.zones[i + 1].zoneParam->radl : m_param->totalFrames; if (curZoneStart <= frames[0]->frameNum && nextZoneStart > frames[0]->frameNum) m_param->keyframeMax = nextZoneStart - curZoneStart; + if ((i + 1 == m_param->rc.zonefileCount) && nextZoneStart == 0) + m_param->keyframeMax = m_param->rc.zones[0].keyframeMax; } } int keylimit = m_param->keyframeMax; diff --git a/source/x265.h b/source/x265.h index d621e4394..06f61aa5d 100644 --- a/source/x265.h +++ b/source/x265.h @@ -711,6 +711,7 @@ struct x265_param; typedef struct x265_zone { int startFrame, endFrame; /* range of frame numbers */ + int keyframeMax; /* it store the default/user defined keyframeMax value*/ int bForceQp; /* whether to use qp vs bitrate factor */ int qp; float bitrateFactor; diff --git a/source/x265cli.cpp b/source/x265cli.cpp index 120a6706d..8c550550f 100755 --- a/source/x265cli.cpp +++ b/source/x265cli.cpp @@ -490,6 +490,9 @@ namespace X265_NS { memcpy(globalParam->rc.zones[zonefileCount].zoneParam, globalParam, sizeof(x265_param)); + if (zonefileCount == 0) + globalParam->rc.zones[zonefileCount].keyframeMax = globalParam->keyframeMax; + for (optind = 0;;) { int long_options_index = -1; -- 2.36.0.windows.1 Karam Singh Senior Video Codec Engineer MulticoreWare, India -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Fix_Extra_IDR_issue_in_zonefile_feature_live_case.diff Type: application/octet-stream Size: 2793 bytes Desc: not available URL: