[FFmpeg-devel] New to the list

Jason Garrett-Glaser darkshikari
Tue Sep 23 09:06:31 CEST 2008

On Mon, Sep 22, 2008 at 11:47 PM, Stefan Gehrer <stefan.gehrer at gmx.de> wrote:
> Jason Garrett-Glaser wrote:
>> On Mon, Sep 22, 2008 at 1:36 PM, Stefan Gehrer <stefan.gehrer at gmx.de> wrote:
>>> Jason Garrett-Glaser wrote:
>>>> 5.  Port any number of algorithmic encoding improvements pioneered by
>>>> x264 into libavcodec to improve the encoding of older formats.
>>> This made me curious, could you elaborate or point to a source
>>> what these improvements are? I saw you blogging about Psy-RDO,
>>> any other big topics?
>> 1.  A useful adaptive quantization method (the current ones in lavc
>> are, last I checked, not just bad but actually broken to some extent).
>>  This should be trivial to port; I literally ported it to Xvid in less
>> than 20 minutes without any prior knowledge of the Xvid code.  Its
>> design wasn't ideal, but at least it worked.
> By adaptive quantization do you mean varying the qp value on a
> macroblock basis?


> If so, is the quantizer of the macroblock dependent
> on its content or found before encoding the macroblock by some
> ratecontrol mechanism?

Its based on the content, but the real answer is both.  If you feel
like making ratecontrol scream (like the original x264 AQ code did),
you can vary the QPs *after* ratecontrol has been applied.  If you
want to make ratecontrol less angry at you, you can vary them before
ratecontrol is applied, and have ratecontrol take the overall change
in QPs into account when doing its math, making it a bit less likely
to mispredict in VBV mode.

The AQ formula is in ac_energy_mb and x264_adaptive_quant_frame, in
encoder/ratecontrol.c in x264.

Dark Shikari

More information about the ffmpeg-devel mailing list