Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd March 2023, 15:33   #1  |  Link
ghostshadow
Registered User
 
Join Date: Jan 2020
Posts: 34
build x265 for Ryzen

Hi, are there any options to enable when compiling x265 sources to optimize for Ryzen 5xxx CPUs.
Ditto for the Intel 13xxx series.
THANKS
ghostshadow is offline   Reply With Quote
Old 3rd March 2023, 16:11   #2  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
if using GCC, add -mtune=znver3
for Intel, add -mtune=alderlake
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 3rd March 2023, 19:36   #3  |  Link
ghostshadow
Registered User
 
Join Date: Jan 2020
Posts: 34
thanks, but i am using visual studio 2019
ghostshadow is offline   Reply With Quote
Old 3rd March 2023, 22:43   #4  |  Link
john33
Registered User
 
Join Date: Apr 2002
Location: UK
Posts: 68
'Enable Enhanced Instruction Set' Intel(R) Advanced Vector Extensions 2 (/arch:CORE-AVX2)
john33 is offline   Reply With Quote
Old 4th March 2023, 09:19   #5  |  Link
ghostshadow
Registered User
 
Join Date: Jan 2020
Posts: 34
OK thanks.
Another question :
To compile x264 this time but with the libraries libswsale, libavformat, ffmpegsource and lsmash how do we do it?
I'm using msys64 on windows to compile the x264.
Thanks in advance

Last edited by ghostshadow; 4th March 2023 at 09:49.
ghostshadow is offline   Reply With Quote
Old 4th March 2023, 10:07   #6  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
You might want to look at https://github.com/m-ab-s/media-autobuild_suite it does compile x264 and x265 with all those dependencies.
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 4th March 2023 at 10:13.
Selur is offline   Reply With Quote
Old 4th March 2023, 20:29   #7  |  Link
ghostshadow
Registered User
 
Join Date: Jan 2020
Posts: 34
Quote:
Originally Posted by Selur View Post
You might want to look at https://github.com/m-ab-s/media-autobuild_suite it does compile x264 and x265 with all those dependencies.
Thanks the auto script 'media-autobuild_suite.bat' works fine.
But if I want to make my build from a source that I download (git of x264 mod), I find myself in the same situation.

In the source folder of x264 I type this :

./configure --build=$MINGW_CHOST --host=$MINGW_CHOST --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-video --enable-static --enable-pic --extra-cflags="-I/c/media-autobuild_suite-master/local64/include" --extra-ldflags=-L/c/media-autobuild_suite-master/local64/lib

But the result is not good, it does not integrate me libswsale, libavformat etc ..

./configure --build=$MINGW_CHOST --host=$MINGW_CHOST --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-video --enable-static --enable-pic --extra-cflags="-I/c/media-autobuild_suite-master/local64/include" --extra-ldflags=-L/c/media-autobuild_suite-master/local64/lib
Unknown option --build=x86_64-w64-mingw32, ignored
platform: X86_64
byte order: little-endian
system: WINDOWS
cli: yes
libx264: internal
shared: no
static: yes
bashcompletion: no
asm: yes
interlaced: yes
avs: yes
lavf: no
ffms: no
mp4: no
gpl: yes
thread: win32
opencl: yes
filters: resize crop select_every
lto: no
debug: no
gprof: no
strip: no
PIC: yes
bit depth: all
chroma format: all

thanks

Last edited by ghostshadow; 4th March 2023 at 20:35.
ghostshadow is offline   Reply With Quote
Old 4th March 2023, 21:06   #8  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
Try with --enable-lavf
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 4th March 2023, 21:09   #9  |  Link
ghostshadow
Registered User
 
Join Date: Jan 2020
Posts: 34
Quote:
Originally Posted by microchip8 View Post
Try with --enable-lavf
Thank but this is not good :

./configure --build=$MINGW_CHOST --host=$MINGW_CHOST --prefix=$LOCALDESTDIR --bindir=$LOCALDESTDIR/bin-video --enable-static --enable-pic --enable-lavf --extra-cflags="-I/c/media-autobuild_suite-master/local64/include" --extra-ldflags=-L/c/media-autobuild_suite-master/local64/lib
Unknown option --build=x86_64-w64-mingw32, ignored
Unknown option --enable-lavf, ignored
ghostshadow is offline   Reply With Quote
Old 9th March 2023, 19:11   #10  |  Link
ghostshadow
Registered User
 
Join Date: Jan 2020
Posts: 34
it's good I managed to make my codecs by modifying the script of media-autobuild_suite-master.
On the other hand, on my x265 codec where I integrated avisynth, I can't use my bat script that I had when I used avs2yuv64.exe
Quote:
@echo off
echo Encoding movie
echo debut encodage %date% %time%
@echo on
cd /D "C:\Program Files\CreaVideo\proEncod"
start "" /b x265-x64-v3.5+20+10-aMod-gcc12.2.0 --pass 1 --bitrate 35303 --stats "D:\Log265\TestQP.stats" --output-depth 10 --profile main10 --no-slow-firstpass --level-idc 5.1 --high-tier --rd 5 --rskip 2 --sao --limit-sao --selective-sao 4 --cutree --qpstep 4 --ctu 64 --deblock -3:-3 --min-cu-size 8 --bframes 9 --b-adapt 2 --rc-lookahead 60 --lookahead-slices 1 --hist-scenecut --hist-threshold 0.03 --ref 5 --limit-refs 2 --merange 57 --subme 7 --rect --amp --max-merge 5 --aq-mode 4 --aq-strength 0.90 --tu-intra 4 --tu-inter 4 --limit-tu 4 --me 3 --hdr10 --hdr10-opt --master-display G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,0) --min-luma 0 --max-luma 1023 --max-cll 1000,638 --gop-lookahead 0 --weightp --weightb --repeat-headers --aud --hrd --qcomp 0.60 --rdoq-level 2 --qblur 0.6 --psy-rd 2.10 --psy-rdoq 1.35 --vbv-maxrate 160000 --vbv-bufsize 160000 --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --output NUL "C:\AVS265\TestQP.avs" - 2> "D:\Log265\TestQP.log"
echo fin encodage %date% %time%
timeout 30
exit
I have an error : x265 [warning]: extra unused command arguments given <->
ghostshadow is offline   Reply With Quote
Old 15th March 2023, 03:57   #11  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
Quote:
Originally Posted by microchip8 View Post
if using GCC, add -mtune=znver3
for Intel, add -mtune=alderlake
Just wondering, what exactly does this do? Would this work on other x265 encoding platforms like Handbrake or Vidcoder, for instance?
Does this take advantage of more hardware options?
HD MOVIE SOURCE is offline   Reply With Quote
Old 15th March 2023, 07:17   #12  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
Quote:
Originally Posted by HD MOVIE SOURCE View Post
Just wondering, what exactly does this do? Would this work on other x265 encoding platforms like Handbrake or Vidcoder, for instance?
Does this take advantage of more hardware options?
it optimizes code, where possible, for the specific CPU architecture. Most of the time, this results in slightly faster program compared to a generic compiled one.

yes, it does work with other programs. It's just an optimization.
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 16th March 2023, 18:47   #13  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
Quote:
Originally Posted by microchip8 View Post
it optimizes code, where possible, for the specific CPU architecture. Most of the time, this results in slightly faster program compared to a generic compiled one.

yes, it does work with other programs. It's just an optimization.
Okay, good to know, thanks for the response. I have an AMD CPU, how do I know which version I'm using like 1,2 or 3?
HD MOVIE SOURCE is offline   Reply With Quote
Old 16th March 2023, 20:58   #14  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
Quote:
Originally Posted by HD MOVIE SOURCE View Post
Okay, good to know, thanks for the response. I have an AMD CPU, how do I know which version I'm using like 1,2 or 3?
Ryzen 1xxx is znver1
Ryzen 2xxx / 3xxx is znver2
Ryzen 5xxx is znver3

Or read the man page of GCC.
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 16th March 2023, 22:07   #15  |  Link
ghostshadow
Registered User
 
Join Date: Jan 2020
Posts: 34
Hello, for me I won on alderlake on laptop 0.5 fps in x264 with avs denoise filter.( 6.15 fps)
For the ryzen3 I gain between 0.5 and 0.8 fps in x265 on pc. (5.2 fps)
to compile you have to put: -march=znver3 -mtune=znver3 to compile with all the zen3 architecture for example.
But in this case the codec will only work with ryzen 3.
If you put that -mtune=znver3 he compiler does not generate any code that cannot run on the default machine
ghostshadow is offline   Reply With Quote
Old 17th March 2023, 21:39   #16  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
i have ryzen 7900x, which version should i use? and what is the best website for it?

any cli command to use which increases performance?
~ VEGETA ~ is offline   Reply With Quote
Old 17th March 2023, 22:11   #17  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
Quote:
Originally Posted by ~ VEGETA ~ View Post
i have ryzen 7900x, which version should i use? and what is the best website for it?

any cli command to use which increases performance?
-mtune=znver4

it is only present in GCC 13 and above
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 17th March 2023, 22:56   #18  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
Quote:
Originally Posted by microchip8 View Post
-mtune=znver4

it is only present in GCC 13 and above
can you point me to the website page where i can download such version?
~ VEGETA ~ is offline   Reply With Quote
Old 17th March 2023, 23:29   #19  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
Quote:
Originally Posted by ~ VEGETA ~ View Post
can you point me to the website page where i can download such version?
I can point you to the site of GCC but it only offers raw code. You'll have to compile it yourself. I do not know who offers Windows/MinGW binaries for GCC. There are some here on this forum
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 18th March 2023, 01:05   #20  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by ~ VEGETA ~ View Post
can you point me to the website page where i can download such version?
http://www.msystem.waw.pl/x265/

NOTICE: experimental stuff.

Play at your own risk :-/
__________________
«Your software patents have expired.»
filler56789 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.