View Single Post
Old 27th September 2016, 19:47   #4275  |  Link
brumsky
Registered User
 
Join Date: Jun 2016
Posts: 116
My Little Test

Thanks for the reply and info Jawed. I did watch that video when it was released. Based on your suggestion, I decided to take a 30 second clip with high motion and a significant amount of rain then encode it using different settings.

The main goal of this was to determine the extra encoding time required for a variety of settings. This is by no means an exhaustive analysis of all the settings - just a select few.

Please note that I am comparing the additional settings against my base config - see below.

Code:
 --profile main10 --output-depth 10 --crf 22 --ctu 32 --bframes 6 --bframe-bias 5 --rc-lookahead 40 --scenecut 40 --ref 5 --limit-refs 3 --me 3 --merange 26 --subme 3 --no-rect --no-amp
 --limit-modes --max-merge 4 --no-early-skip --b-intra --no-sao --signhide --weightp --weightb --aq-mode 1 --aq-strength 1
 --cutree --rd 4  --tu-intra-depth 3 --tu-inter-depth 1 --psy-rd 1 --psy-rdoq 1 --rdoq-level 2 --qcomp 0.65 --no-strong-intra-smoothing --qg-size 16
Using the settings above I began making the following changes then running the encode, and documenting the results.

Here is the link to my dropbox folder, it contains all the videos, images, and excel doc I used.

I will only post a few select images, if you wish to see them all please download from dropbox.

https://www.dropbox.com/sh/mv9jhnoez...7v60IVlZa?dl=0

First off I'd like to say that I selected this clip for two reasons.
  1. It was the best clip I had at the time.
  2. I wanted a clip that would be difficult to encode, lots of motion and rain. The idea being to try and kick x265 in the pants.

Before I post the images I'd like to mention I couldn't tell the difference between any of the encodes when watching the video. The only way I could see a difference was to go frame by frame.

I'd suggest playing the encodes at random to see if you can see a difference.

Source:


My settings: 4.8 FPS - 2:25 encoding time


My settings plus RD 6: 3.135 FPS, 3:42 encoding time


Slow: 2.513 FPS, 4:37 encoding time


Very Slow: 0.919 FPS, 12:37 encoding time


Placebo: 0.250 FPS, 46:24 encoding time



If you look closely at the highlighted areas below you can see the areas I was specifically comparing.



Using my default settings you will see that the areas are less crisp and generally fussy. Especially the hair I highlighted. It has noticeable more distortion then any of the other encodes. The only way I was able to get rid of the distortion was by enabling RD6 - yes 5 & 6 are the same right now. With the exception of preset slow, which is RD 4.

I was actually quiet puzzled by this, I tried adding rect & amp or tu-inter-depth 3 & rect to remove the distortion. Neither of them worked, the images and videos are in dropbox for those encodes. I'm guessing at this point that since the slow preset uses SAO and strong-intra-smoothing, those are responsible for the reduced distortion observed.

It shouldn't be a surprise that the higher the settings used the better the quality. The question is, is the extra encoding time worth the extra quality?

I'd suggest downloading the excel doc now to view all of the results.

Taking the encoding time into account, my opinion is that adding RD 6 gives the best quality increase per extra encoding time. That single option was able to remove a significant amount of the distortion I mentioned above with the smallest increase in encoding time. If you're looking at the doc the column Magnitude difference, for the life of me I couldn't think of a better term, shows the multiple/factor of encoding time increase. Meaning if you take your FPS and divide it by the corresponding value, it should give you a reasonable idea of your fps rate.

Yes I know it will vary, the point is it will at least give you a good ballpark range.

I've decided to have a bit of a rolling scale. Meaning if a particular video is less important to me I'll use by default settings. As the importance of the content increases so will my settings.

On a scale of 1 - 10:
1-4 - my default settings
5-7 - Add RD6
8-10 - add RD 6 rect & amp

Adding at least rect gives the benefit of tu-inter-depth 2 for at least the blocks that use rect or amp, per the docs.

With all of that said, I don't think I'll ever use Placebo or Very Slow presets. Placebo is up to 19x slower than my settings and Very Slow is over 5X slower. While they did produce better encodes, obviously, the increased quality wasn't enough to justify the encode times...

Now if you've actually looked at the excel doc you'll notice I ran the encodes on two different systems. One with AVX2 and one without.

Please Note: I only ran the tests once, so YMMV.

System A:
Dual E5-2670 v1 8c/16t 2.6GHz @ 2.9Ghz No AVX2
This is a Sandy Bridge chip and thus does not down clock when running AVX instructions. This means it can run at the 2.9GHZ all core turbo setting.

System B:
Single E5-2683 v4 16c/32t 2.0GHz @ 1.9Ghz With AVX2.
This is a Broadwell chip and does down clock when running AVX2 instructions.

Despite the 1GHZ difference in clock speed when encoding, the Broadwell chip is up to 25% faster depending upon the settings. If you are running CTU 64 it is up to 25% faster. With CTU 32 it is approximately equal.

At first glance this may not appear that impressive but keep in mind we are comparing two 115 watt chips versus a single 120 watt chip. At the vary least they are equal in speed for approximately half the power usage and heat generated - up 25% faster with CTU 64!!

EDIT:

I forgot to mention that to-intra-depth has little to no impact on performance. My default settings now include --tu-intra-depth 4.

Last edited by brumsky; 27th September 2016 at 20:33.
brumsky is offline   Reply With Quote