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)

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th April 2018, 23:28   #6021  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 9,242
Quote:
Originally Posted by Stephen R. Savage View Post
To be fair, the AVX2 speedup is still larger than the frequency penalty, so it made sense.
It is now, because they reigned in AVX2 use in some irrelevant functions with minimal speedups to reduce the effect of downclocks. They even had a presentation about that "adventure" and their findings on some conference once
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is online now   Reply With Quote
Old 13th April 2018, 15:43   #6022  |  Link
RieGo
Registered User
 
Join Date: Nov 2009
Posts: 38
no AVX512:
encoded 1780 frames in 169.38s (10.51 fps), 2541.97 kb/s, Avg QP:20.40
AVX512:
encoded 1780 frames in 161.94s (10.99 fps), 2541.97 kb/s, Avg QP:20.40

makes a ~5% speed increase
considering avx512 encode was almost 10C cooler, so maybe i can get away with +100MHz. i like it
RieGo is offline   Reply With Quote
Old 13th April 2018, 17:15   #6023  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,531
okay, so nice, but not worth buying a new cpu because of it.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 14th April 2018, 03:01   #6024  |  Link
Xizer
Registered User
 
Join Date: Sep 2008
Posts: 4
Is anyone else having problems with getting it to work on Skylake Xeons?

x265 crashes on my Xeon Platinum 8176 server when I start it with the --asm avx512 flag.

Quote:
Error: fwrite() call failed when writing frame: 3, plane: 2, errno: 32
Output 80 frames in 13.46 fps (5.90 fps)
It'll work fine on the Xeon Platinum machine as soon as I remove the avx512 flag.

And it works on my i9 7940X with the avx512 flag.
Xizer is offline   Reply With Quote
Old 14th April 2018, 03:30   #6025  |  Link
WhatZit
Registered User
 
Join Date: Aug 2016
Posts: 54
Quote:
Originally Posted by Selur View Post
okay, so nice, but not worth buying a new cpu because of it.
Not until the i7-9700K shows up (November 2018?).
WhatZit is offline   Reply With Quote
Old 14th April 2018, 08:41   #6026  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 290
Quote:
Originally Posted by Xizer View Post
x265 crashes on my Xeon Platinum 8176 server when I start it with the --asm avx512 flag.
One bug that can lead to crash is fixed in version 2.7+338 so please do not use older versions. Which version do you use?
Ma is offline   Reply With Quote
Old 14th April 2018, 10:59   #6027  |  Link
RieGo
Registered User
 
Join Date: Nov 2009
Posts: 38
i'm seeing very inconsistent results

CRF-20 preset-"medium"
--------------------
Run1:
encoded 1128 frames in 27.42s (41.14 fps), 3355.47 kb/s, Avg QP:20.21
Run2 (AVX512):
encoded 1128 frames in 30.23s (37.32 fps), 3355.47 kb/s, Avg QP:20.21
Run3:
encoded 1128 frames in 27.77s (40.62 fps), 3355.47 kb/s, Avg QP:20.21
Run4 (AVX512):
encoded 1128 frames in 27.04s (41.71 fps), 3355.47 kb/s, Avg QP:20.21

but temps are still very low on avx512. i didn't expect this. probably x265 just uses very little avx512 and that's why we don't see much improvement - if any - running on lowered frequency.
maybe we can run at default speed without getting too much heat/power, if we only use it on x265... i'll give it a try

btw: i agree that avx512 is not worth getting a new cpu
RieGo is offline   Reply With Quote
Old 14th April 2018, 22:54   #6028  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,312
x265 2.7+340-aa9102400f24

remove unused asmname from x265_param; added a newline in the help
(fixed VMAF warning not applicable under Windows)
__________________

German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid

Last edited by LigH; 15th April 2018 at 18:37. Reason: Not the fixed version yet
LigH is offline   Reply With Quote
Old 15th April 2018, 18:31   #6029  |  Link
Xizer
Registered User
 
Join Date: Sep 2008
Posts: 4
Quote:
Originally Posted by LigH View Post
x265 2.7+340-aa9102400f24

remove unused asmname from x265_param (may fix some crashes on Xeons); added a newline in the help
(fixed VMAF warning not applicable under Windows)
2.7+340 is the version I'm using when it crashes.
Attached Images
 
Xizer is offline   Reply With Quote
Old 15th April 2018, 18:36   #6030  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,312
Sorry to hear ... so the fix is not yet committed, only proposed?
__________________

German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 15th April 2018, 19:33   #6031  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 290
Quote:
Originally Posted by Xizer View Post
2.7+340 is the version I'm using when it crashes.
Thanks for more info. It looks like more serious bug (x265 works for a while). The error message is probably from decoding app that writes graphics data via pipe to x265.

There are many possible reasons for the crash, one of them is the OS (and msvcrt.dll file in your OS). Could you test VS 2015 and VS 2017 x265 binaries? They are not based on msvcrt.dll.
Ma is offline   Reply With Quote
Old 15th April 2018, 20:22   #6032  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,312
I don't have such compilers installed; someone else may have to build them.
__________________

German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 15th April 2018, 21:24   #6033  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,277
x265-2.7+336-07defe235cde.7z VS 17 x64, crt is statically linked so no install needed. Debug pdbs included.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 15th April 2018, 22:03   #6034  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 290
Bisection is one of the most common method of finding bugs.
In source file common/x86/asm-primitives.cpp it is function pointers assignment with avx512 code -- from line # 4696 to 5385.
We can turn off (comment) first half of this functions (x265-1.exe) and then second half (x265-2.exe).
You can download avx512-bisect1.7z VS 2015 binaries with diff files -- if x265.exe (from clean sources) hangs, please try x265-1.exe and then x265-2.exe -- it should be that one of them hangs and second not.
Please report back the results (which from the 3 binaries hangs and which not).
Ma is offline   Reply With Quote
Old 15th April 2018, 22:38   #6035  |  Link
Xizer
Registered User
 
Join Date: Sep 2008
Posts: 4
Quote:
Originally Posted by Ma View Post
Bisection is one of the most common method of finding bugs.
In source file common/x86/asm-primitives.cpp it is function pointers assignment with avx512 code -- from line # 4696 to 5385.
We can turn off (comment) first half of this functions (x265-1.exe) and then second half (x265-2.exe).
You can download avx512-bisect1.7z VS 2015 binaries with diff files -- if x265.exe (from clean sources) hangs, please try x265-1.exe and then x265-2.exe -- it should be that one of them hangs and second not.
Please report back the results (which from the 3 binaries hangs and which not).
All three binaries crash with the avx512 flag I'm afraid.

Is there additional information that can be provided for debug?
Attached Files
File Type: txt DxDiag.txt (75.4 KB, 3 views)
Xizer is offline   Reply With Quote
Old 15th April 2018, 22:56   #6036  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 290
Quote:
Originally Posted by Xizer View Post
All three binaries crash with the avx512 flag I'm afraid.

Is there additional information that can be provided for debug?
Thanks for the info.

Could you post results of the command
x265 -V && x265 --asm avx2 -V && x265 --asm avx512 -V
For example in my system it looks like
Code:
F:\x265p\ma\avx512>x265 -V && x265 --asm avx2 -V && x265 --asm avx512 -V
x265 [info]: HEVC encoder version 2.7+340-aa9102400f24
x265 [info]: build info [Windows][MSVC 1900][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: HEVC encoder version 2.7+340-aa9102400f24
x265 [info]: build info [Windows][MSVC 1900][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: HEVC encoder version 2.7+340-aa9102400f24
x265 [info]: build info [Windows][MSVC 1900][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
This bug could be not related directly to avx512 code -- could you check if it hangs if you use '--asm avx2' instead of '--asm avx512' (it is important to use --asm avx2 option).
------------------------------------------------------
Your OS is Win 8.1 that do not support avx512. This bug in x265 is not technical but conceptual -- avx512 is not auto recognized by default so option '--asm avx512' should not turn on avx512 without any check.
You can test file avx512-patch.7z with x265 that check what is supported by CPU & OS up to avx512 if option '--asm avx512' is used.
On Win 8.1 it should work with '--asm avx512' exactly like without this option, on Win 10 it should turn on avx512 if you have CPU with avx512 and you use option '--asm avx512'.

Last edited by Ma; 15th April 2018 at 23:58.
Ma is offline   Reply With Quote
Old 17th April 2018, 07:31   #6037  |  Link
Bhavnahari
Registered User
 
Join Date: Nov 2016
Posts: 3
Quote:
Originally Posted by jlpsvk View Post
any suggested quality wise settings recommendation for 4K HDR encoding? with CRF ie 17?
If the data that is being reused comes from encoding a downscaled video (scale-factor=2), it does not make a lot of sense to use intra/inter refinement levels 0/1 as levels 0 and 1 reuse most of the information from the previous pass with no or minimal re-evaluation of analysis information. This can have a huge impact on the quality of the encode.

We have observed that --refine-inter=3 and --refine-intra=4 gives the best quality, even better than standalone x265 encodes in some cases, with a performance gain of up to 1.8X.

For 4K HDR content, you will have to modify the display settings based on the monitor. Please refer the docs for more information - http://x265.readthedocs.io/en/defaul...mation-options
Bhavnahari is offline   Reply With Quote
Old 18th April 2018, 19:48   #6038  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 162
Quote:
Originally Posted by Bhavnahari View Post
If the data that is being reused comes from encoding a downscaled video (scale-factor=2),
it does not make a lot of sense to use intra/inter refinement levels 0/1 as levels 0 and 1 reuse most of the information from
the previous pass with no or minimal re-evaluation of analysis information. This can have a huge impact on the quality of the encode.

We have observed that --refine-inter=3 and --refine-intra=4 gives the best quality, even better than standalone x265 encodes in some cases,
with a performance gain of up to 1.8X.
My settings then...

Code:
--crf 17 --profile main10 --level-idc 5.1 --output-depth 10 --ctu 32 --amp --vbv-bufsize 160000 --vbv-maxrate 160000 --me star
--max-merge 5 --rc-lookahead 40 --lookahead-slices 4 --gop-lookahead 34 --ref 5 --hdr --hdr-opt --repeat-headers --no-info --no-deblock
--no-sao --no-strong-intra-smoothing --high-tier --refine-inter 3 --refine-intra 4
Of course, display settings are entered too...

Warning:
Code:
x265 [warning]: Intra refinement requires analysis load, analysis-reuse-level 10, scale factor. Disabling intra refine.
x265 [warning]: Inter refinement requires analysis load, analysis-reuse-level 10, scale factor. Disabling inter refine.
Can it be used with CRF? Or? Some parameters missing?

Last edited by jlpsvk; 18th April 2018 at 20:10.
jlpsvk is offline   Reply With Quote
Old 18th April 2018, 21:47   #6039  |  Link
Loomes
Registered User
 
Join Date: Nov 2003
Location: Germany, Berlin
Posts: 38
So far no success for me running the avx512 option on my 7820x on Windows 10 64it. I tried
Code:
ffmpeg -i source.mkv -f yuv4mpegpipe - | x265.exe --preset slow --asm avx512 --crf 21 --y4m - -o dest.h265
which crashes immediately. Using --asm avx2 works fine.

I ran
Code:
x265.exe -V && x265.exe --asm avx2 -V && x265.exe --asm avx512 -V
and it showed
Code:
x265 [info]: HEVC encoder version 2.7+340-aa9102400f24
x265 [info]: build info [Windows][MSVC 1900][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: HEVC encoder version 2.7+340-aa9102400f24
x265 [info]: build info [Windows][MSVC 1900][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: HEVC encoder version 2.7+340-aa9102400f24
x265 [info]: build info [Windows][MSVC 1900][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
Quote:
Originally Posted by Ma View Post
You can test file avx512-patch.7z with x265 that check what is supported by CPU & OS up to avx512 if option '--asm avx512' is used.
I tried from that package x265.exe, x265-1.exe and x265-2.exe. All of them crashed immediately. I am using the latest nightly version of ffmpeg.
Am I missing something?

Last edited by Loomes; 18th April 2018 at 22:16.
Loomes is offline   Reply With Quote
Old 18th April 2018, 22:45   #6040  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 3,074
Quote:
Originally Posted by Loomes View Post
I tried from that package x265.exe, x265-1.exe and x265-2.exe. All of them crashed immediately. I am using the latest nightly version of ffmpeg.
Am I missing something?
I had crashes using the builds foxyshadis posted but I was successful using LigH's build from this post. Win10 and an i9-7900X. Have you tried them?
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 19:40.


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