[FFmpeg-devel] Lib lame mp3 and quality setting

Michael Niedermayer michaelni
Tue Feb 5 17:28:52 CET 2008

On Tue, Feb 05, 2008 at 05:11:54PM +0100, christophelorenz wrote:
> While there's some discussions about mp3 ;-)
> Looking at lame mp3 code, I found this
>     /* lame 3.91 dies on quality != 5 */
>     lame_set_quality(s->gfp, 5);
>     /* lame 3.91 doesn't work in mono */
>     lame_set_mode(s->gfp, JOINT_STEREO);
> It is present since the first appearance of the source file on svn...
> Lame mp3 is now at 3.97 and I haven't noticed any problem with quality 
> != 5. (not yet tried mono mode)
> Wouldn't it be interresting to enhance quality of the encoding following 
> the -aq value ?
> The the audio quality value is already used in the codec to switch on 
> VBR encoding (and VBR quality)
> I see three possible ways of having control over this :
> -Use negative values for VBR encoding, and positive for CBR. (But that 
> differs from the 0-1 range the doc defines.)
> -Add a flag to enable VBR audio and control quality with -aq.
> -Change the range of -aq so that :
>    0->0.4999 is VBR quality 0->5
>    5->1 is CBR quality 5->lowest quality.

We have parameters in the context for min, max, and average bitrate as well
as quality.
A patch which uses them is welcome. Hacks misusing existing fields in a way
violating the API will be rejected with no further comments.
The -aq setting must mean the same no matter if the codec implementation is
lame, a native adpcm encoder or faac.

If the existing fields are insufficent they can be extended but their meaning
must always be codec implementation independant.


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080205/362dd84a/attachment.pgp>

More information about the ffmpeg-devel mailing list