[Ffmpeg-devel] Equivalence between MPEG4 and H264 settings...

Luca Abeni lucabe72
Fri Feb 3 12:44:23 CET 2006

Hi all,

I am using libavcodec in one of my programs, and I am trying to compare
the results obtained with MPEG4 and H264 (using x264).

As a test, I am encoding video from a video card, at 352x288; my target
bitrate is 400kbps, with a maximum bitrate of 500kbps (and buffer size
I am not using B frames (yet).
When I use MPEG4, I can obtain a decent video quality by setting
gop_size = 25
me_method = ME_EPZS
mb_decision = FF_MB_DECISION_RD
noise_reduction = 250
pre_me = 0

In particular, the mb_decision setting gives me a great quality

Now, I'd like to adjust x264 parameters to have equivalent settings...
If I use the same AVCodecContext settings, I get a quality comparable
with the MPEG4 quality without setting "mb_decision =
So, I looked at libavcodec/x264.c and I see that it does not handle
mb_decision nor noise_reduction. Doesn't x264 support anything similar
to such parameters?

I know very few details about the encoding algorithms, so maybe my
question does not make any sense, but: is it possible to find some kind
of mapping between ffmpeg's MPEG4 parameters and x264 ones? My dream
would be to be able to simply change codec_id in AVCodecContext (without
changing any other parameters) to use different codecs with equivalent

For example: it seems to me (please, correct me if I am wrong) that
x264.c uses AVCodecContext.cqp (not used by any other codec) instead of
AVCodecContext.global_quality (setting CODEC_FLAG_QSCALE), which is used
by all the other codecs for apparently the same purpose. Or am I wrong?
And maybe this happens for other AVCodecContext fields too? Because of
this, every time that I change the codec I have to fill a different set
of fields :(

Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !

 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 Prova GRATIS per 15 giorni! DVDNetRent e ricevi a casa 3 film. Puoi scegliere tra migliaia di titoli
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=4632&d=3-2

More information about the ffmpeg-devel mailing list