Log in

View Full Version : HEVC-newbie questions :)


gamebox
16th April 2016, 10:20
Hello all. :) I've finally managed to upgrade my PC with a quad-core CPU (which I consider the bare minimum for HEVC encoding), and I already ran some tests to make myself familiar with HEVC options. I already have some questions:

- first, is it possible to switch off cutree but keep the AQ on? In x264 I was able to encode without mbtree but with Auto Variance AQ, and when I try the same in x265 it seems the AQ completely switches off.

- second, why the HEVC standard accepts only up to 6 reference frames? In x264 I encoded 720p using 9 references, as that was the maximum number that Level 4.1 decoder chips could handle - why the new format steps back here? To make it clear- my aim always is to encode using all the options mainstream video decoder chips (will) support, for maximum compression efficiency and video quality.

- third, is Slower x265 preset roughly comparable to Very Slow in x264? I want to encode using maximum "non-brute-force" (non-placebo) profile, and me Star and subme 7 to me seem the most complex "geometrical" motion search patterns available.

- fourth, how the deblock filter in x265 compares to x264? In x264 I typically set deblock to -1,-1 for general use and -2,-2 when transcoding very high quality sources using CRF16. In x265 deblock 0 results in too much blocking during fades etc, and deblock 1 already seems too strong and washes away some details.

- fifth, how quantizers and CRF in H.265 compare to H.264? Quant of 22 in H.264 was generally the last "fully acceptable" one for me, and 23 was usually the boundary where details start to blur too much. CRF 18 in x264 usually resulted in quants up to these values and I used it regularly, choosing CRF 16 only for very high quality sources. What are the approximate quants and CRF I should choose in x.265 to achieve similar results?

- sixth, is quad-core CPU (AMD Phenom II X4) with 2.7 GHz per core, 2MB L2 and 6MB L3 cache, really not sufficient for real-time decoding of 1080p HEVC? I still get "choppy" movement (as if the decoder skips B-frames) although all 4 cores get decent saturation of 60-70 %. My previous CPU (AMD Athlon II X2 at 2.7 GHz per core and 2MB L2) performed virtually identically using only 2 cores with approximately the same saturation. The decoding is done through relatively recent LAV filters.

And I want to say a big THANK YOU to Lord Mulder, whose wonderful Simple x264/x265 launcher saved me the trouble of upgrading the OS. :) Your software is one of the rare encoders that works on Windows XP, and it seems to work fairly well, as (for instance) MediaCoder kept crashing after I try to resume encoding after many hours (the problem seems system-time related). Besides, when transcoding using avs script as the source, Simple x264/x265 launcher occupies significantly less RAM on my system than AVS Proxy GUI + AVIDemux previously did.

Thanks for your time and patience, I'm eager to find out more about HEVC and resolve these issues I have at the moment. :)

JohnLai
16th April 2016, 13:31
Second ; Maybe B-Frame need to be taken into account? It is 4 B-Frame with default preset?

Fifth ; Documentation from https://trac.ffmpeg.org/wiki/Encode/H.265 said "CRF of 28 should visually correspond to libx264 video at CRF 23, but result in about half the file size."
So, mathematically ;
28 = 23
X = 16 (your best quality x264 crf 16?)
Find X: (28 x 16)/23 = 19.47826
Just a rough approximation.

Sixth, AMD Phenom II X4 for decoding 1080p HEVC? Lack of SSE4.1 and AVX/AVX2......so, what is your HEVC video bitrate? Maybe the bitrate too high? What is the video renderer being used? Madvr? EVRCP?

gamebox
16th April 2016, 15:31
@JohnLai
- second: I used 6 reference frames as recommended, but set 9 B-frames manually, as I thought it won't break any "limits" but would just give the encoder some freedom to put more B-frames in sequence. Some of the videos I encoded in x264 used up to 6-7 B-frames (9 reference frames) in some scenes
- fifth: I tried various CRF settings in x265, and I think the biggest issue for me remained the 32x32 block smoothing. That area looks like an x264 video that got compressed too much. Switching it off leaves too many distracting artifacts
- sixth: Phenom is paired up with 1066MHz DDR2 ram. Video bitrate is very low - 1,5-2 Mbps for 1080p. Video renderer is whatever Media Player Classic 1.6.8 uses - I set it to Overlay Mixer Renderer to enable DXVA GPU decoding for h.264

nevcairiel
16th April 2016, 15:39
- second, why the HEVC standard accepts only up to 6 reference frames? In x264 I encoded 720p using 9 references, as that was the maximum number that Level 4.1 decoder chips could handle - why the new format steps back here? To make it clear- my aim always is to encode using all the options mainstream video decoder chips (will) support, for maximum compression efficiency and video quality.

Because a high number of reference frames have only had an extremely miniscule improvement in quality, if any at all, at a high complexity cost. Which means HEVC is limited to 8 references overall, 2 of which can be used for B-Pyramid if enabled, hence a setting of 6 in such cases.

JohnLai
16th April 2016, 15:45
Hmm......

Second and fifth : I propose you to read @littlepox@ discussion on x265 options (as well as b-frame discussion) http://forum.doom9.org/showthread.php?t=172458

Sixth : Time to download new mpc-hc v1.7.10 (https://mpc-hc.org/downloads/ ) and update your lavfilter ( https://github.com/Nevcairiel/LAVFilters/releases )

I suspect you are using extremely old version of lavfilter seeing your mpc 1.6.8 was from June 2013........

EDIT: And change the renderer to Video Mixing Renderer 9 (Renderless) (who still use WinXP these day?)

Mahi
17th April 2016, 08:56
i know a little !!. If i use megui 265 default profile its level is 3.1.. how can i change it to 4.1.



default settings-

<TempComplexityBlur>20</TempComplexityBlur>
<TempQuanBlurCC>0.5</TempQuanBlurCC>
<SCDSensitivity>40</SCDSensitivity>
<BframeBias>0</BframeBias>
<PsyRDO>1.0</PsyRDO>
<PsyTrellis>0</PsyTrellis>
<Deblock>true</Deblock>
<Cabac>true</Cabac>
<UseQPFile>false</UseQPFile>
<WeightedBPrediction>true</WeightedBPrediction>
<WeightedPPrediction>2</WeightedPPrediction>
<NewAdaptiveBFrames>1</NewAdaptiveBFrames>
<x265BFramePyramid>2</x265BFramePyramid>
<x265GOPCalculation>1</x265GOPCalculation>
<ChromaME>true</ChromaME>
<MacroBlockOptions>3</MacroBlockOptions>
<P8x8mv>true</P8x8mv>
<B8x8mv>true</B8x8mv>
<I4x4mv>true</I4x4mv>
<I8x8mv>true</I8x8mv>
<P4x4mv>false</P4x4mv>
<AdaptiveDCT>false</AdaptiveDCT>
<SSIMCalculation>false</SSIMCalculation>
<StitchAble>false</StitchAble>
<QuantizerMatrix>Flat (none)</QuantizerMatrix>
<QuantizerMatrixType>0</QuantizerMatrixType>
<DeadZoneInter>21</DeadZoneInter>
<DeadZoneIntra>11</DeadZoneIntra>
<OpenGop>False</OpenGop>
<SampleAR>0</SampleAR>
<ColorMatrix>0</ColorMatrix>
<ColorPrim>0</ColorPrim>
<Transfer>0</Transfer>
<AQmode>1</AQmode>
<AQstrength>1.0</AQstrength>
<QPFile />
<Range>auto</Range>
<x265AdvancedSettings>false</x265AdvancedSettings>
<Lookahead>40</Lookahead>
<NoMBTree>true</NoMBTree>
<ThreadInput>true</ThreadInput>
<NoPsy>false</NoPsy>
<Scenecut>true</Scenecut>
<Nalhrd>0</Nalhrd>
<PicStruct>false</PicStruct>
<FakeInterlaced>false</FakeInterlaced>
<NonDeterministic>false</NonDeterministic>
<SlicesNb>0</SlicesNb>
<MaxSliceSyzeBytes>0</MaxSliceSyzeBytes>
<MaxSliceSyzeMBs>0</MaxSliceSyzeMBs>
<Profile>3</Profile>
<Level>migrated</Level>
<AVCLevel>L_UNRESTRICTED</AVCLevel>
<TuneFastDecode>false</TuneFastDecode>
<TuneZeroLatency>false</TuneZeroLatency>
</Settings>
</GenericProfileOfx265Settings>

thanks :)

gamebox
17th April 2016, 10:25
Ok, so I've decided to use up to 6 reference frames, left B-frames at 9. My goal is to make video streams that are very likely to decode on low-cost mass-produced mainstream HEVC decoder chips, such as those that will be a part of some future GPUs, Media Players, Set Top Boxes for digital television, and TVs themselves.

Read a lot of tutorials and understood deblocking and cutree options. Now I set deblock at -1,-1 (similar to what I used in x264), disabled cutree (not appropriate for my encodes as backgrounds are mostly irrelevant), enabled AQ (as I mistakenly set it to 0 the first time I chose the parameters). That answers my first and fourth question.

Will update MPC. I used version 1.6.8 as newer ones (with built-in LAV Filters) caused some problems I don't remember at the moment. I selected Overlay Mixer for video output as it responded somewhat faster than Video Mixing Renderer 9 when playing h264 videos through DXVA, and decoding was more stable and responsive when jumping to different positions in video.

Why Windows XP? It makes my computer fly. :) Fully booted and functional it occupies only 170MB of RAM for active and background processes. That enables me to work rather comfortably with just 2GB of RAM (and have several active or paused encoding tasks in the background at all times). Also, CPU has to deal with minimum additional tasks - less background processes, simpler graphics and effects. The system is primarily used as HTPC/Internet access terminal.

lvqcl
17th April 2016, 13:16
- sixth, is quad-core CPU (AMD Phenom II X4) with 2.7 GHz per core, 2MB L2 and 6MB L3 cache, really not sufficient for real-time decoding of 1080p HEVC? I still get "choppy" movement (as if the decoder skips B-frames) although all 4 cores get decent saturation of 60-70 %. My previous CPU (AMD Athlon II X2 at 2.7 GHz per core and 2MB L2) performed virtually identically using only 2 cores with approximately the same saturation. The decoding is done through relatively recent LAV filters.

Do you use 32-bit WinXP? Try Lentiod HEVC decoder then. HEVC decoder in 32-bit LAVFilters is quite slow compared to Lentoid or to 64-bit LAVFilters.

Video renderer is whatever Media Player Classic 1.6.8 uses - I set it to Overlay Mixer Renderer to enable DXVA GPU decoding for h.264

Will update MPC. I used version 1.6.8 as newer ones (with built-in LAV Filters) caused some problems I don't remember at the moment. I selected Overlay Mixer for video output as it responded somewhat faster than Video Mixing Renderer 9 when playing h264 videos through DXVA

Just remember that LAVFilters don't support DXVA1, and DXVA2 support under WinXP is problematic (http://forum.doom9.org/showthread.php?p=1760350#post1760350).

gamebox
17th April 2016, 19:30
Thanks lvqcl

Yes, it is the 32-bit Windows XP. 64-bit version gave me compatibility headaches with some of the software and hardware I need, so I chose not to keep it.

Downloaded Lentoid, it might be just what I need. Installing/testing will be done in a few days, after I backup my current system, that is - after I first finish current x265 encoding task that is preventing me from reboot. It gets only 8 hrs of CPU time daily. What is the status of Lentoid's decoder - freeware, trial, requires payment to use?

If I remember correctly, LAV Filters wouldn't install on my system as it was SP2 XP, and hence the newer MPC versions refused to work as well. I sorted it some time ago by applying SP3. DXVA works perfectly through Overlay Mixer, but decodes somewhat jerky, with tearing etc, on VMR9 when I jump back and forth through video. It also keeps the CPU somewhat more busy than Overlay does.