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

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.

             Xuefeng Jiang

Attachment: x265_11611.patch
Description: Binary data

Attachment: decode information by HM.rar
Description: Binary data

x265-devel mailing list

Reply via email to