Bug 83143 - [SNB|IVB|HSW][Media][Encode] CBR mode H264 encoding is broken while providing PackedSliceHeaders from upper layer
Summary: [SNB|IVB|HSW][Media][Encode] CBR mode H264 encoding is broken while providing...
Status: RESOLVED FIXED
Alias: None
Product: libva
Classification: Unclassified
Component: intel (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: haihao
QA Contact: Sean V Kelley
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-27 12:36 UTC by sreerenj
Modified: 2014-11-13 08:39 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Fix the incorrect QP setting under CBR when slice_header info is passed (7.50 KB, patch)
2014-08-29 05:29 UTC, ykzhao
Details | Splinter Review

Description sreerenj 2014-08-27 12:36:31 UTC
In Constant Bitrate  Mode encoding, the driver is calculating the qp value dynamically and filling the slice_qp_delta. This won't work if upper layer 
provides the PackedSliceHeaders since it doesn't know about the qp values which
are finding out inside the driver.

How to reproduce the bug?: Explained here: https://bugzilla.gnome.org/show_bug.cgi?id=734992

There were discussion about this sometimes before but not yet implemented in driver.Copy&past from,
http://lists.freedesktop.org/archives/libva/2014-May/002193.html

""
> Another thing is for CBR, the QP might be changed per frame in the
> driver and app/middleware doesn't not know the final QP. How does app
> get the right slice_qp_delta to build the right packed slice header ?
> does app always use a fixed slice_qp_delta ?

AFAIK, slice_qp_delta does not really matter. You can start off QP =
26 (defaults with pic_init_qp_minus26 = 0 + slice_qp_delta = 0), and
the driver can still generate per-MB QP that fits. i.e. you have an
additional delta at the macroblock layer IIRC. That should fit most
purposes.
""

Note: The "avcenc"  is working fine with CBR because it is not providing the packed slice headers, and the driver itself is inserting those.
Comment 1 ykzhao 2014-08-29 05:29:23 UTC
Created attachment 105407 [details] [review]
Fix the incorrect QP setting under CBR when slice_header info is passed

Hi, Screenj

    Will you please try the attached patch and see whether the issue is resolved?

Thanks.
   Yakui
Comment 2 sreerenj 2014-08-29 09:56:39 UTC
(In reply to comment #1)
> Created attachment 105407 [details] [review] [review]
> Fix the incorrect QP setting under CBR when slice_header info is passed
> 
> Hi, Screenj
> 
>     Will you please try the attached patch and see whether the issue is
> resolved?
> 
> Thanks.
>    Yakui

Did some quick tests and seems to be fine.
Thanks Yakui.
Comment 3 ykzhao 2014-09-01 07:50:34 UTC
Thanks for your testing and verification.

I will send it to libva@lists.freedesktop.org

Thanks.
   Yakui
Comment 4 ykzhao 2014-09-02 01:23:06 UTC
Now the patch is already pushed to the master/staging branch.

Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.