[x265] Fix bug that over-writing PPS QP cause inconsisent output and optimise this method.

xuefeng xuefeng at multicorewareinc.com
Wed Oct 12 11:46:30 CEST 2016


All,

I fix bug that over-writing PPS QP cause inconsisent output and optimise this method.

1) It's wrong to use condition "if( m_iFrameNum >= m_param->frameNumThreads )". If we set different frame threads, the output would inconsisent.  I change it to "if( m_iFrameNum > 0 )" for each keyframe. 

2)  If last slice Qp is close to (26 + m_iPPSQpMinus26) ,  we don't need to change m_iPPSQpMinus26. Because slice Qp in the next GOP would be close to (26 + m_iPPSQpMinus26), it would cost bits to use last GOP's best  PPS QP.   For example, sliceQP in a GOP is like "47 45  45  43……28  27 26 26", the best PPS QP is about 30 by statistic. But the slice in next GOP is about" 26 25  26  26  26……26 25 26 26“,  it will cost more bits for PPS QP = 30.  

3) If outputs is all I-frame video,  we don't need to change m_iPPSQpMinus26.  Because each keyframe follows a m_iPPSQpMinus26 like pps by codePPS(),  changing m_iPPSQpMinus26 would cost some bits as to change sliceQpDelta for saving bits. 

My test command is like this:
--repeat-headers -F4 --preset fast --crf 40 --input-res 1280x720 --keyint 30 --min-keyint 30 --input "E:\video\x264 source\FromNet\Johnny_1280x720_60.y4m" --fps 30 --output "test.mp4"

The attachment is the patch and output result by HM decoder.




Regards,
 
             Xuefeng Jiang
 
xuefeng at multicorewareinc.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20161012/64ddb6c8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265_11611.patch
Type: application/octet-stream
Size: 2609 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20161012/64ddb6c8/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: decode information by HM.rar
Type: application/octet-stream
Size: 13633 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20161012/64ddb6c8/attachment-0003.obj>


More information about the x265-devel mailing list