[x265] A patch for ABR of x265

idxa at sina.com idxa at sina.com
Mon Oct 28 14:12:13 CET 2013


Hi,

 
The reason for more fluctuation of PSNR is  that the value of cfg->param.rc.rateTolerance has been set too small. And I try testing with -F 1, the result is same, maybe it depends on video context.
 
I have written a patch to fix some bugs of ABR,  
1. modify rateTolerance from 0.1 to 1.0, in order to allow the final bitrate to fluctuate more(CBR to ABR)
2. the value of ncu in initialization of ratecontrol has been set according to 16x16 block size which is same to x264, for corresponding empirical formula in x264 is for 16x16 block3. do more modification to make ratecontrol algorithm of x265 more similar to x264, for x264 has been developed for about 10 years and is very mature , it is reasonale to take its methods first. The result is good,  red line is old version and blue line is new version with patch.   I am not familar with HG, would you please give some suggestion of how to update a patch, thanks a lot! thanks,idxa
 
 
Interesting! There is more fluctuation in the psnr, the overflow/underflow must have been excess and when rate control corrects it abruptly, there is a sharper psnr drop or peak..I am guessing the extent of psnr fluctuation are mainly due to the lambda tables that we have currently. 
Can you try if it persists when we run it with 1 frame Thread instead of 4. I took a file dump of the psnr , the fluctuation wasn't quite bad when -F1.. 



On Fri, Oct 25, 2013 at 4:48 PM, <idxa at sina.com> wrote:


I tested with the following steps,

1.encoding a clip with qp=34(crf maybe better), and getting bitrate of the output file(is 490Kb/s)
x265.exe --input source\NBA.yuv -o output_test\NBA_qp_34.hevc --recon output_test\NBA_recon_qp_34.yuv --fps 30 --input-res 640x360 --keyint 300 --frames 300 --rd 1 --qp 34 -F 4

2. using the bitrate(=490Kb/s) which is got frome the previous step to encode the same video with ABR method 
x265.exe --input source\NBA.yuv -o output_test\NBA_bitrate_490.hevc --recon output_test\NBA_recon_bitrate_490.yuv --fps 30 --input-res 640x360 --keyint 300 --frames 300 --rd 1 --bitrate 490 -F 

3.Compare PSNR of the two output files. 
Here using MSU VQM to calculate PSNR, and the following graph shows the result, red line is ABR and blue line is CQP, and ABR is of big fluctuation.

 


 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131028/79de80e1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ??1.jpg
Type: image/jpeg
Size: 106895 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131028/79de80e1/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ??1.jpg
Type: image/jpeg
Size: 109875 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131028/79de80e1/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4702.patch
Type: application/octet-stream
Size: 5241 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131028/79de80e1/attachment-0001.obj>


More information about the x265-devel mailing list