Quicksync inappropriate default settings?
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.
*******************************
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.
*******************************
Quicksync inappropriate default settings?
Default advanced settings from Handbrake:
gop-ref-dist=4:gop-pic-size=32:async-depth=4
Screenshots: http://img21.imageshack.us/img21/1430/s500.png
http://img19.imageshack.us/img19/3738/6vb2.png
Tweaked settings:
gop-ref-dist=8:gop-pic-size=64:async-depth=4:num-ref-frame=2
Screenshots: http://img545.imageshack.us/img545/6904/hl3.png
http://img18.imageshack.us/img18/6168/1bxz.png
Apart from the settings above everything the same. Output bitrate the
same. Encoding time the same. Doubling gop-pic-size, gop-ref-dist and using manual
num-ref-frame made a huge difference in Handbrake. Much more details
can be seen. Looks like default settings are struggling in Handbrake with Haswell.
gop-ref-dist=4:gop-pic-size=32:async-depth=4
Screenshots: http://img21.imageshack.us/img21/1430/s500.png
http://img19.imageshack.us/img19/3738/6vb2.png
Tweaked settings:
gop-ref-dist=8:gop-pic-size=64:async-depth=4:num-ref-frame=2
Screenshots: http://img545.imageshack.us/img545/6904/hl3.png
http://img18.imageshack.us/img18/6168/1bxz.png
Apart from the settings above everything the same. Output bitrate the
same. Encoding time the same. Doubling gop-pic-size, gop-ref-dist and using manual
num-ref-frame made a huge difference in Handbrake. Much more details
can be seen. Looks like default settings are struggling in Handbrake with Haswell.
Re: Quicksync inappropriate default settings?
I've seen cases where doubling gop-ref-dist has an effect on encoding speed, though it doesn't happen with all sources.
The default gop-pic-size will be 5*framerate+1 in the next build, except for CQP where it will remain 32 (don't ask me why, this may change in a later build).
I'll revisit default settings and Haswell-specific issues after the next build is out.
The default gop-pic-size will be 5*framerate+1 in the next build, except for CQP where it will remain 32 (don't ask me why, this may change in a later build).
I'll revisit default settings and Haswell-specific issues after the next build is out.
Re: Quicksync inappropriate default settings?
I tested even higher gop-pic-size values but it lowered the image quality. 64 was the sweetspot. My test video has 24 fps. num-ref-frame=2 is also a bit strange. The encoder already uses 2 or 3 ref frames automatically but when I set 2 or 3 manually in Handbrake I get better image quality, at least in my test video I used. Makes no sense but this is what I get.
Re: Quicksync inappropriate default settings?
I have tried your 5*framerate+1 formula and it's brilliant. Even better than gop 64.
gop-ref-dist=9:gop-pic-size=121:async-depth=4:num-ref-frame=2:mbbrc=1
http://img842.imageshack.us/img842/84/2qah.png
http://img11.imageshack.us/img11/5572/2wvr.png
First picture maybe not better but the second is way better than before. Compared to default Handbrake a huge difference.
I also tried a 60 fps video where 5*framerate+1 works best.
default: gop-ref-dist=4:gop-pic-size=32:async-depth=4= http://img841.imageshack.us/img841/6636/1jbw.png
modded: gop-ref-dist=4:gop-pic-size=301:async-depth=4:num-ref-frame=2= http://img96.imageshack.us/img96/8562/w2x.png
gop-ref-dist=4 worked better than 8 or 9 in this video. Do you have a formula for gop-ref-dist?
gop-ref-dist=9:gop-pic-size=121:async-depth=4:num-ref-frame=2:mbbrc=1
http://img842.imageshack.us/img842/84/2qah.png
http://img11.imageshack.us/img11/5572/2wvr.png
First picture maybe not better but the second is way better than before. Compared to default Handbrake a huge difference.
I also tried a 60 fps video where 5*framerate+1 works best.
default: gop-ref-dist=4:gop-pic-size=32:async-depth=4= http://img841.imageshack.us/img841/6636/1jbw.png
modded: gop-ref-dist=4:gop-pic-size=301:async-depth=4:num-ref-frame=2= http://img96.imageshack.us/img96/8562/w2x.png
gop-ref-dist=4 worked better than 8 or 9 in this video. Do you have a formula for gop-ref-dist?
Re: Quicksync inappropriate default settings?
Was recommended by someone at Intel.gmb wrote:I have tried your 5*framerate+1 formula and it's brilliant. Even better than gop 64.
One thing you could try, is to use the formula but then round the framerate to a multiple of gop-ref-dist (e.g. with gop-ref-dist=8, 5*24+1 = 121, round to 128). On Haswell, this should enable B-pyramid (depending on gop-ref-dist, see below), which may improve the results somewhat (haven't done extensive testing yet).
All I know from testing is that B-pyramid seems to get enabled by powers of 2 (4, 8, 16, etc.). 16 does seem to cause some hangs when we decode with QSV, though, so I'd recommend 4 or 8 for know (obviously we'd like to get the hang fixed eventually).gmb wrote:gop-ref-dist=4 worked better than 8 or 9 in this video. Do you have a formula for gop-ref-dist?
Re: Quicksync inappropriate default settings?
I had playback glitches with high gop-ref-dist values like 16 or more. Test video 1 worked best with 8 and 9 (slightly better with 9). Test video 2 worked best with 4, looks like it is video dependent. 4 or 8/9 gop-ref-dist maybe the best depending on the input video. I think I tried 128 gop-pic-size already for my 24 fps video, it was quite good too. But wait I did use 9 gop-ref-dist, I should try 129 gop-pic-size then.
Re: Quicksync inappropriate default settings?
The math doesn't seem to add up here. 129 is not a multiple of 9, but 126 is. Also, 9 is not a power of 2, so B-pyramid won't get enabled (at least not with the driver I've been testing, and I don't think it varies much if at all with other drivers).gmb wrote:But wait I did use 9 gop-ref-dist, I should try 129 gop-pic-size then.
Re: Quicksync inappropriate default settings?
FWIW, the next build will use the keyframe intervals described above (5*fps+1, or 32 for CQP). But eventually we will probably automatically adjust it so that it's a multiple of gop-ref-dist - since it hasn't been extensively tested yet, we're going with Intel's recommendation for now.
Re: Quicksync inappropriate default settings?
Rodeo wrote:The math doesn't seem to add up here. 129 is not a multiple of 9, but 126 is. Also, 9 is not a power of 2, so B-pyramid won't get enabled (at least not with the driver I've been testing, and I don't think it varies much if at all with other drivers).gmb wrote:But wait I did use 9 gop-ref-dist, I should try 129 gop-pic-size then.
gop-ref-dist=9 looks better than gop-ref-dist=8 at the same bitrate in my two test videos. Video 1 is 24 fps and video 2 60 fps. First is the Intel formula and second the multiple of x. Are these pic-size numbers correct?
Video 1
gop-ref-dist=4:gop-pic-size=121
gop-ref-dist=4:gop-pic-size=120/124
gop-ref-dist=8:gop-pic-size=121
gop-ref-dist=8:gop-pic-size=128
gop-ref-dist=9:gop-pic-size=121
gop-ref-dist=9:gop-pic-size=126
Video 2
gop-ref-dist=4:gop-pic-size=301
gop-ref-dist=4:gop-pic-size=304/300?
gop-ref-dist=8:gop-pic-size=301
gop-ref-dist=8:gop-pic-size=304
gop-ref-dist=9:gop-pic-size=301
gop-ref-dist=9:gop-pic-size=306
Last edited by gmb on Sat Jul 20, 2013 1:03 pm, edited 1 time in total.
Re: Quicksync inappropriate default settings?
Nope, that doesn't look right.gmb wrote:Are these pic-size numbers correct?
Video 1
gop-ref-dist=4:gop-pic-size=121
gop-ref-dist=4:gop-pic-size=304
Looks OK, but having gop-pic-isze be a multiple of gop-ref-dist is irrelevant is gop-ref-dist is not a power of 2, as B-pyramid won't get enabled. I suppose it doesn't hurt though.gmb wrote:gop-ref-dist=8:gop-pic-size=121
gop-ref-dist=8:gop-pic-size=128
gop-ref-dist=9:gop-pic-size=121
gop-ref-dist=9:gop-pic-size=126
Re: Quicksync inappropriate default settings?
I have tested all the listed variants above. Bitrate etc the same, only the gop values are different. First video 1 (24 fps).
gop-ref-dist=4:gop-pic-size=121
http://imageshack.us/a/img203/3505/zsqu.png
http://imageshack.us/a/img203/4466/6rwd.png
gop-ref-dist=4:gop-pic-size=120
http://imageshack.us/a/img69/4862/4baf.png
http://imageshack.us/a/img191/7296/in4z.png
gop-ref-dist=4:gop-pic-size=124
http://imageshack.us/a/img833/5334/kum9.png
http://imageshack.us/a/img832/8969/b36b.png
gop-ref-dist=8:gop-pic-size=121
http://imageshack.us/a/img43/2331/s7i.png
http://imageshack.us/a/img11/843/5s00.png
gop-ref-dist=8:gop-pic-size=128
http://imageshack.us/a/img713/3469/ohfk.png
http://img835.imageshack.us/img835/4229/3hz.png
gop-ref-dist=9:gop-pic-size=121
http://imageshack.us/a/img542/7610/lw38.png
http://imageshack.us/a/img839/9996/fzqz.png
gop-ref-dist=9:gop-pic-size=126
http://imageshack.us/a/img836/5864/l9n.png
http://imageshack.us/a/img854/7972/0kww.png
The best for me is gop-ref-dist=9:gop-pic-size=121
gop-ref-dist=4:gop-pic-size=121
http://imageshack.us/a/img203/3505/zsqu.png
http://imageshack.us/a/img203/4466/6rwd.png
gop-ref-dist=4:gop-pic-size=120
http://imageshack.us/a/img69/4862/4baf.png
http://imageshack.us/a/img191/7296/in4z.png
gop-ref-dist=4:gop-pic-size=124
http://imageshack.us/a/img833/5334/kum9.png
http://imageshack.us/a/img832/8969/b36b.png
gop-ref-dist=8:gop-pic-size=121
http://imageshack.us/a/img43/2331/s7i.png
http://imageshack.us/a/img11/843/5s00.png
gop-ref-dist=8:gop-pic-size=128
http://imageshack.us/a/img713/3469/ohfk.png
http://img835.imageshack.us/img835/4229/3hz.png
gop-ref-dist=9:gop-pic-size=121
http://imageshack.us/a/img542/7610/lw38.png
http://imageshack.us/a/img839/9996/fzqz.png
gop-ref-dist=9:gop-pic-size=126
http://imageshack.us/a/img836/5864/l9n.png
http://imageshack.us/a/img854/7972/0kww.png
The best for me is gop-ref-dist=9:gop-pic-size=121
Re: Quicksync inappropriate default settings?
It seems the rounded method stutters a bit with lookahead, so I would stay with Intels recommendation which runs fine with lookahead. Could be a QSTranscode issue though. The question about the optimal gop-ref-dist remains. I will do a second test with another video.
Re: Quicksync inappropriate default settings?
30 fps video. reft-dist 4 really suffers in the first screenshot. It's a scene change, obviously much better handled by the higher ref-dist values.
gop-ref-dist=4:gop-pic-size=151
http://imageshack.us/a/img850/4450/2qd.png
http://imageshack.us/a/img826/651/ciw.png
http://img856.imageshack.us/img856/2158/xrc.png
gop-ref-dist=6:gop-pic-size=151
http://imageshack.us/a/img541/6575/vce.png
http://imageshack.us/a/img62/8117/vmej.png
http://imageshack.us/a/img27/8281/20j.png
gop-ref-dist=8:gop-pic-size=151
http://imageshack.us/a/img7/9950/lmyu.png
http://imageshack.us/a/img28/4346/gceh.png
http://img812.imageshack.us/img812/1686/pxru.png
gop-ref-dist=9:gop-pic-size=151
http://imageshack.us/a/img40/8369/m95f.png
http://imageshack.us/a/img812/3900/wibd.png
http://img827.imageshack.us/img827/2605/s5a8.png
gop-ref-dist=4:gop-pic-size=151
http://imageshack.us/a/img850/4450/2qd.png
http://imageshack.us/a/img826/651/ciw.png
http://img856.imageshack.us/img856/2158/xrc.png
gop-ref-dist=6:gop-pic-size=151
http://imageshack.us/a/img541/6575/vce.png
http://imageshack.us/a/img62/8117/vmej.png
http://imageshack.us/a/img27/8281/20j.png
gop-ref-dist=8:gop-pic-size=151
http://imageshack.us/a/img7/9950/lmyu.png
http://imageshack.us/a/img28/4346/gceh.png
http://img812.imageshack.us/img812/1686/pxru.png
gop-ref-dist=9:gop-pic-size=151
http://imageshack.us/a/img40/8369/m95f.png
http://imageshack.us/a/img812/3900/wibd.png
http://img827.imageshack.us/img827/2605/s5a8.png
Re: Quicksync inappropriate default settings?
Are 23.976 fps rounded to 24 and then 5*framerate+1=121?
Because with 23*5+1 goppicsize 116 it stutters and encoding time is longer. 23.976 videos should be rounded to 24 for the formula.
Because with 23*5+1 goppicsize 116 it stutters and encoding time is longer. 23.976 videos should be rounded to 24 for the formula.
Re: Quicksync inappropriate default settings?
I found small glitches with higher gop-ref-dist values like 6 and 8 in some videos. It seems SDK uses by default 3. Why does Handbrake enforce it to 4? Is this recommended by Intel? I did some comparisons and 3 looked better.
Re: Quicksync inappropriate default settings?
Not sure why we default to 4, but it does allow for up to 3 consecutive B-frames, which matches the x264 default.
Re: Quicksync inappropriate default settings?
But Intels SDK uses 3 by default. I will do some more comparisons with 4.
Re: Quicksync inappropriate default settings?
First example from the Avatar trailer.
Original
http://s14.directupload.net/images/130724/twuqtf4b.png
gop-ref-dist=3
http://s7.directupload.net/images/130724/c3cq5kyl.png
gop-ref-dist=4
http://s1.directupload.net/images/130724/f5rfm5zp.png
dist4 has distorted colours and detail preservation is worse.
Original
http://s14.directupload.net/images/130724/twuqtf4b.png
gop-ref-dist=3
http://s7.directupload.net/images/130724/c3cq5kyl.png
gop-ref-dist=4
http://s1.directupload.net/images/130724/f5rfm5zp.png
dist4 has distorted colours and detail preservation is worse.
Re: Quicksync inappropriate default settings?
Original
http://s7.directupload.net/images/130724/o4463fgm.png
gop-ref-dist=3
http://s1.directupload.net/images/130724/z3ab79k4.png
gop-ref-dist=4
http://s14.directupload.net/images/130724/xskkanjq.png
Better detail preservation from dist3 which also results in a bigger screenshot size. I'm worried about the colour distortion, that's a no-go for a default value. I think there is a reason why Intel uses dist3 as default.
http://s7.directupload.net/images/130724/o4463fgm.png
gop-ref-dist=3
http://s1.directupload.net/images/130724/z3ab79k4.png
gop-ref-dist=4
http://s14.directupload.net/images/130724/xskkanjq.png
Better detail preservation from dist3 which also results in a bigger screenshot size. I'm worried about the colour distortion, that's a no-go for a default value. I think there is a reason why Intel uses dist3 as default.
Re: Quicksync inappropriate default settings?
It's either an encoding bug or a decoding bug. What did you use for capturing those screenshots? What gop-pic-size did you use?
Re: Quicksync inappropriate default settings?
Bug or not bug, default SDK value don't suffer. It's very similar with QSTranscode so it shouldn't be a Handbrake exclusive issue. As for the gopsize I used Intels formula.
Re: Quicksync inappropriate default settings?
Another one.
Original
http://s7.directupload.net/images/130724/yhtbdl2q.png
dist3
http://s7.directupload.net/images/130724/zalau5zf.png
dist4
http://s7.directupload.net/images/130724/bfg3q9d5.png
And here is a surprise, both gop values SDK default:
http://s1.directupload.net/images/130724/2m54pebf.png
Gop4 is crap here.
Original
http://s7.directupload.net/images/130724/yhtbdl2q.png
dist3
http://s7.directupload.net/images/130724/zalau5zf.png
dist4
http://s7.directupload.net/images/130724/bfg3q9d5.png
And here is a surprise, both gop values SDK default:
http://s1.directupload.net/images/130724/2m54pebf.png
Gop4 is crap here.
Re: Quicksync inappropriate default settings?
I would go with SDK default as a default setting for both gop, means dist=1 size=1. There are some odd issues.