Haswell Quicksync lookahead?

Haswell Quicksync lookahead?

http://newsroom.intel.com/servlet/JiveServlet/previewBody/3880-102-1-689...

I'm curious about the lookahead feature from Haswell. Is that a driver feature or it requires encoder integration for existing software? What encoder did Intel use in their comparison? It's not clear to me if I can use let's say MediaEspresso and lookahead is enabled or not.

28 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Can anyone describe in more detail what the 'lookahead' feature is (in terms of video coding)? The linked white paper does not detail it. I can imagine a few things but it would be nice with an explanation.

Thanks.

 - Jay

Lookahead:
•Before encoding the current frame, encoder pre-analyzes (look ahead) certain number of future frames to collect the statistics of those frames and understand the complexity of those frames. Based on the statistics, encoder can intelligently decide frame level bit allocation to improve overall quality, especially for video sequences that contain a lot of scene change. The number of future frames to look ahead can be adjusted by application.

Source: http://intelnewsroom.hosted.jivesoftware.com/servlet/JiveServlet/downloa...

Does it help?

Thank you Michael for the linked slides with the 'lookadhead' explanation.

 - Jay

Hi Jay and Michael,

The look ahead feature will be available as part of an Intel HD Graphics driver update, expected to be available shortly.

Existing Media SDK enabled applications, such as Media Espresso, does not support Look ahead. Future product revisions may add support for the feature as it becomes available.

Additionally. We will release a new Media SDK revision (2013 R2) a few weeks from now. The new release will provide details about the look ahead feature and how to enable it via Media SDK API.

Regards,
Petter 

This explains it. I have searched through the current SDK but couldn't found anything about lookahead. It might also explain some odd behaviour with current encoder on quality preset with Haswell. In most videos quality preset is twice as slow as balanced preset, also twice as slow as Ivy Bridge on quality preset. On Haswell I couldn't really notice quality differences between balanced and quality preset. Twice the encoding time without image quality improvements makes no sense. Current encoder/SDK is not optimized for Haswell usage I guess.

I see there is R2 available with lookahead. Does this work with the driver on Intels page?

Not yet.  I believe its coming shortly.   The implementation details are in the R2 dev guide doc.

-Eric  

I know a QS encoder with lookahed support, two other are in the works. That said, without a driver it can't work. The current obviously don't support it.

I know a QS encoder with lookahed support, two other are in the works. That said, without a driver it can't work. The current obviously don't support it.

15.33.64.3214: http://downloadmirror.intel.com/22935/a08/Win64_1533b.zip

Is this driver with lookahead support?

Hi Michael,

That is/was a "Beta" driver for Windows 8.1 and it does not contain support for MediaSDK API 1.7 (lookahead).  A public 'production' driver will be posted very soon.  Thanks for your patience.

-Tony

In almost all my test cases lookahead is superior to VBR and CQP. I just found a video where lookahead produces abnormal bad quality. CQP does much better in this video which is very dubious. I don't think this is the expected behavior. Can you check what is wrong with the video and lookahead? You can download from here: http://www.fileplanet.com/224115/220000/fileinfo/The-Hobbit:-An-Unexpect...

In Handbrake I use this settings: lookahead=1:gop-ref-dist=3:gop-pic-size=0:target-usage=4:mbbrc=1:lookahead-depth=40

Slightly different with CQP obviously. Bitrate ~3 Mbps. I made two screenshots to give you examples.

CQP:
http://imageshack.us/a/img829/4979/uxel.png

http://imageshack.us/a/img189/7838/38zm.png

Lookahead:
http://imageshack.us/a/img593/6636/w9e9.png

http://imageshack.us/a/img689/5188/0rau.png

Detail preservation is much better with CQP. This is an unexpected abnormal result compared to my other tests.

Hi Michael,

I can see the slight difference in quality between the encoded frames your provided.

Could you please provide more details about the exact configuration (preferably via Media SDK trace logs) you are using for both the LA and the CQP case? 

Regards,
Petter 

It's quite a big difference imho. Trace logs? If you tell me how to do. There is not much special about the configuration. Here my Handbrake settings for lookahead:
http://s14.directupload.net/images/130729/yqvhwocf.png

http://s1.directupload.net/images/130729/4rzreabl.png

For CQP you have to use factor 23 to get ~3100 Kbps and lookahead=0 in the advanced query field. Driver version I'm using is 15.31.16.64.3234 with a i5-4670 on Windows 7 x64 SP1. If you need additional infos let me know.

Hi Michael,

Thanks for the screenshots. The tool I'm referring to is the Media SDK trace tool (mediasdk_tracer), located in the the tools folder of the Media SDK package.

To capture a log, start up the trace tool and start capture, then start your workload. After the workload is complete, stop capture and gather the trace log file.

Regards,
Petter 

I've attached the log from a lookahead run.

Attachments: 

AttachmentSize
Downloadapplication/octet-stream analyzer.log728.76 KB

Hi Michael,

can you also please share the corresponding CQP trace log so that we can explore the exact config for both workloads.

Regards,
Petter 

Here is the corresponding CQP run from this video. 

Attachments: 

AttachmentSize
Downloadapplication/octet-stream analyzer.log728.96 KB

VBR+mbbrc looks worse than lookahead in this video but VBR+extbrc does even better than CQP, albeit at a much slower encoding pace.

Appreciate it Michael for your linked slides with the 'lookadhead' explanatio

my blog

Hi again Michael,

Regarding the quality discrepancy between QCP and LA you reported. Our encoder experts have explored this further and acknowledge that LA result in lower quality vs. CQP for this content, partially due to LA's obligation to maintain a local bitrate. 

We do not have any immediate plans to address this specific scenario by changes to LA. But we will explore possible ways of improving future revisions of LA to handle this content and others better.

Regards,
Petter 

Recently I use sample_encode. exe has carried on the test of LookAhead, I downloaded the latest Intel SDK, and tested on the latest machinery, CPU: i7-4770, Os: Windows 7, Graphics Devices: HD 4600 Graphics, but I found that using the LookAhead get worse picture quality than without using LookAhead,the following is my command line arguments:

Use LookAhead:sample_encode.exe h264 -i C:\yuv.yuv -o C:\test_la.264 -w 720 -h 576 -hw -d3d -f 25 -b 1000 -u quality -la -lad 30 

not use LookAhead:sample_encode.exe h264 -i C:\yuv.yuv -o C:\test.264 -w 720 -h 576 -hw -d3d -f 25 -b 1000 -u quality 

the yuv.yuv is 720*576

Hi Cao,

Can you please share with us the graphics driver version you are using.

Also, if possible, please share your raw input YUV file since the quality looks the be dependent on content in your case,

Regards,
Petter 

Hi Petter,

First of all, thank you for your reply,my graphics driver is 15.31.17.64.3257, and the color of the YUV file is YUV420, width is 720 * 576, the original rate is 8000,I intercepted three images as the result of the experiment.And second ,i want to know that how to get better quality In the hardware encoding mode. 

Attachments: 

AttachmentSize
Downloadimage/png yuv.png730.66 KB
Downloadimage/png test_la.png558.59 KB
Downloadimage/png test.png554.68 KB

Hi Cao,

There is a more recent driver available from some sources that have known issues with LA, but the driver you are using is good for LA usages. 

Your input content seems to be from a deinterlaced source with lots of jagged artifacts. It may be that the LA algorithm has some trouble with such content. Again, if you can please share the exact raw data (or part it) it would help us reproduce on our side.

Regards,
Petter 

Hi Petter,

This is the part of YUV file.

Attachments: 

AttachmentSize
Downloadapplication/zip yuv.zip201.06 MB

Hi Petter,

The Yuv file you  can download frow here  http://yunpan.cn/QbiCJC9PyVraf

Leave a Comment

Please sign in to add a comment. Not a member? Join today