Log in

View Full Version : x264 suggestion


redfordxx
10th August 2006, 10:04
Hi,

I have no idea whether it is crazy or already implemented because I know nothing about x264 development:

How about not doing CABAC encoding in first pass? Could that speed up things?

By
R.

Zero1
10th August 2006, 10:14
It may speed things up, but could affect quality if you are using the same target bitrate in the first and second pass. If you were to raise the target bitrate of the first pass by around 10%, you may compensate for CABAC being disabled (10% is a loose approximation of what CABAC can save).

Also you can already disable this yourself. CAVLC is used instead.

redfordxx
10th August 2006, 10:31
Originally, I mean not using CAVLC either.
With option not writing the first pass, x264 would write stats file only. It would know for instance that typically CABAC makes x% compression (not compared to CAVLC but in total)and simulate that in first pass.

So, for example:
I enter target size 700MB
x264 knows CABAC gains x% size
The first pass encode would be done like for 700MB / (1-x%) and immediately thrown away
Second pass already done properly

Sharktooth
10th August 2006, 14:27
Predicting cabac compression is not so easy... but it could be worth trying.

akupenguin
10th August 2006, 18:13
Better: x264 already has an internal "stub" of CABAC (used for RDO), which calculates exactly how many bits it will need, but is faster because it doesn't actually generate the bits. It would be possible to run the 1st pass using that.