LAME: A Case Research in Mathematical Programming


That is the second in a collection of articles on mathematical programming beginning with The Scope of Mathematical Programming Tasks. This text discusses LAME (LAME Ain’t an MP3 Encoder), a broadly used free open-source MP3 (MPEG Layer 3) audio encoder. MP3 might be essentially the most broadly used audio compression file format. It’s a part of the MPEG (Transferring or Movement Footage Knowledgeable Group) audio/video household of audio/video compression and transmission codecs. MPEG is organized beneath the auspices of ISO (the Worldwide Group for Standardization). Regardless of appearances, ISO shouldn’t be an acronym.

3.98.4 2010-04-14 1,221,748 downloads
3.98.2 2008-09-22 2,055,166 downloads
3.98 2008-07-03 443,886 downloads
3.97 2006-09-24 2,541,738 downloads
3.97beta3 2006-08-20 193,458 downloads
3.97beta2 2005-11-28 261,121 downloads
3.97beta 2005-09-18 94,215 downloads
3.96.1 2004-07-25 680,257 downloads
3.96 2004-04-11 148,512 downloads
3.95.1 2004-01-12 118,610 downloads
3.95 2004-01-11 15,134 downloads
3.94beta 2003-12-18 16,485 downloads
3.93.1 2002-12-01 262,901 downloads
3.93 2002-11-17 30,596 downloads
3.92 2002-04-15 213,508 downloads
3.91 2001-12-29 164,299 downloads
3.90.1 2001-12-22 19,157 downloads
3.90 2001-12-21 26,509 downloads
3.70 2001-09-12 88,364 downloads
3.88beta 2001-09-12 13,523 downloads
3.89beta 2001-09-12 58,914 downloads

Desk 1: Downloads of the LAME MP3 Audio Encoder from SourceForge

LAME might be most generally used as a plug-in so as to add MP3 encoding to the broadly used free open-source Audacity audio participant and editor. By default, on account of MP3 patent and licensing points, Audacity can import however not export MP3 audio recordsdata. LAME could be put in as a shared library of dynamically linked library which provides MP3 encoding to Audacity and different applications on a pc. LAME is chosen for this case research as a result of it’s a profitable, widely-used, free open supply mathematical programming venture which can be comparatively easy. A variety of profitable free open supply mathematical programming initiatives are toolkits or libraries of many features and algorithms, typically incorporating different free open supply initiatives as parts. LAME is basically a self-contained implementation of the MP3 audio compression algorithm; it does incorporate elements of the free open-source mpg123 MP3 audio decoder participant and decoder library.

LAME is chosen partly as a result of it’s of top quality and clearly corresponding to profitable prime quality industrial mathematical programming merchandise. Certainly, it’s most likely extra broadly used than many industrial merchandise. Mathematical programming initiatives are usually parts comparable to shared libraries or dynamic linked libraries which are integrated inside different methods. From a usability viewpoint, one often needs to cover complicated arithmetic from most finish customers. Exceptions are specialised technical instruments the place the supposed finish customers are technically subtle: engineers, scientists, mathematicians, and so forth. Examples are mathematical prototyping and improvement instruments comparable to Mathematica and MATLAB. Comparable free open supply examples embody Octave, Scilab, SAGE, R, and related instruments. This text seeks to handle the query of what’s the precise scope, price, schedule, high quality, efficiency, and danger stage of profitable mathematical programming initiatives.

On this article, mathematical programming refers to programming largely consisting of superior arithmetic past the fundamental arithmetic utilized in, for instance, bookkeeping and bookkeeping software program. Some programming comparable to person interface software program makes little or no use of even primary arithmetic. Many enterprise purposes actually make heavy use of primary arithmetic. Programming initiatives that contain extra superior arithmetic are extra the exception than the rule, particularly within the industrial world. On this article, particular mathematical strategies referred to by mathematical programming embody calculus, analytic geometry, linear algebra, transforms such because the Fourier remodel, and so forth. In observe, mathematical programming initiatives sometimes use mathematical strategies taught in late highschool (11/twelfth grade) and the primary two years of an excellent faculty or a college in the USA. One sometimes encounters extra superior mathematical strategies. Particular purposes embody picture, audio, and video compression, speech recognition, the International Positioning System (GPS), danger fashions in insurance coverage and different monetary fields, and lots of different specialised technical purposes.

Within the writer’s expertise, it’s fairly widespread to come across extraordinarily optimistic concepts in regards to the scope of mathematical programming initiatives and mathematical analysis and improvement. At present, in sensible and utilized initiatives, mathematical programming and analysis and improvement often overlap an amazing deal. One might encounter expectations {that a} venture could be accomplished in a couple of weeks or at most three calendar months, a fiscal quarter, that previous expertise would point out is prone to take wherever from six months to a number of years, or are even technically inconceivable. To the extent that initiatives of this kind are literally funded and undertaken, they most likely typically finish badly with a lot wasted effort, time, cash, and frustration. These fantasy initiatives might crowd out funding and help for extra sensible efforts, whether or not quick time period options extra acceptable for organizations with restricted assets or time scales, or long term initiatives which are more likely to succeed.

Let or not it’s clear—and it is a judgment which the Members of the Congress should lastly make—let or not it’s clear that I’m asking the Congress and the nation to simply accept a agency dedication to a brand new plan of action—a course which is able to final for a few years and carry very heavy prices: 531 million {dollars} in fiscal ’62—an estimated seven to 9 billion {dollars} further over the subsequent 5 years. If we’re to go solely half means, or scale back our sights within the face of problem, in my judgment it could be higher to not go in any respect.

from the speech

The Objective of Sending a Man to the Moon (Might
25, 1961)

John Fitzgerald Kennedy

Whereas mathematical programming initiatives are typically a lot smaller in greenback price than the profitable Apollo Moon program, it’s price recalling President Kennedy’s phrases. Severe profitable mathematical programming initiatives have a tendency, with some exceptions, to take a big period of time: six months to a number of years. In addition they typically contain massive quantities of particularly nit-picky painstaking debugging. With no agency dedication based mostly on sensible expectations, they’re prone to fail and it’s most likely higher to not begin.

With the widespread adoption of highly effective computer systems, mathematical programming is turning into extra widespread. Mathematical programming might allow us to harness the huge energy of contemporary computer systems to unravel a variety of urgent issues starting from most cancers to vitality shortages. Remarkably the associated fee to society of unrealistic concepts about mathematical programming and analysis and improvement might already run into the trillions of {dollars} as a result of sizable contribution of inaccurate fashions of the worth of mortgage backed securities within the present financial downturn.

The Improvement of LAME

In response to the LAME venture website, LAME was initially developed by Mike Cheng from 1998 to 1999. After he retied, Mark Taylor maintained the venture till early 2003. The venture was then taken over by a crew of builders who’ve maintained and expanded LAME. It is a checklist of the builders and a few of their contributions from the LAME website:

Main builders:

Robert Hegemann Tuning, optimizations,

Alexander Leidinger Multiplatform
configuration, libraries dealing with, launch administration…

Rogério Brito Debian packaging,

Main builders – Retired:

Gabriel Bouvigne Tuning, optimizations,

Takehiro Tominaga Psychoacoustics,
bitstream, optimizations, meeting code…

Mike Cheng Maintainer of LAME v2.x.

Frank Klemm Psychoacoustics,

Naoki Shibata Psychoacoustics (NSPsytune
mannequin, NSSafeJoint).

Mark Taylor Maintainer of LAME v3.x,
preliminary implementer of GPsycho psychoacoustic mannequin.

Further builders:

Roberto Amorim Internet pages and

John Dahlstrom Adaptive ATH.

John Dee LAME prolonged VBR header.

Dominique Duvivier Pace optimizations.

Albert Faber Creator of CDex and

Joseph Flynn LAME DirectShow Filter.

Peter Gubanov LAME DirectShow Filter.

Guillaume Lessard

Steve Lhomme LAME ACM codec.

Don Melton id3v1 and v2 code.

Darin Morrison Presets tuning.

Josep Maria Antolín Segura Documentation.

Kyle VanderBeek Python bindings, web site

LAME is now hosted by sourceforge. The earliest launch accessible on the sourceforge web site is LAME 3.70 from October, 2001. The next desk lists the dimensions and scope of most main releases of LAME from 3.70 to the current.

Launch Date Traces of Code (LOC) Legendary Man Months
Notional Greenback Value
3.70 18,573 51.4 $410,990
3.90 2001-12-21 49,897 145.3 $1,162,000
3.92 55,998 164.3 $1,314,900
3.93.1 61,249 179.8 $1,438,500
3.95.1 80,046 239.0 $1,912,300
3.96.1 81,336 243.1 $1,944,900
3.97 2006-09-24 84,907 254.4 $2,035,400
3.98.4 87,694 263.3 $2,106,000

Desk 2: Measurement and Scope of the LAME MP3 Audio Encoder Releases

Notes: The realease quantity and date are from the SourceForge obtain web page. The strains of code is the full variety of strains of code returned by operating the free open supply CLOC (Depend Traces of Code) utility on the complete LAME launch. The “legendary man-months” is the variety of man-months of estimated precise effort utilizing the “natural” versoin of the Primary COCOMO (Constructive Value Mannequin) software program estimation mannequin. Each the full strains of code and COCOMO are very tough methods of measuring the dimensions and energy of a software program venture. The Notional Greenback Value is computed by assuming {that a} “legendary man month” from COCOMO is 160 hours of paid effort at a charge of $50 per hour ($8,000 per thirty days). Word that the strains of code, legendary man-months, and notional price are basically cumulative numbers because the begin of the venture, which should embody the mpg123 venture from which a few of the code is derived.

The full strains of code reported by the CLOC utlity combines strains of code in all programming languages: C, C++, assembler, HTML, the Bourne shell, and so forth. The precise MP3 encoder algorithm in LAME is carried out within the C programming language (largely) and C++. A lot of the code in releaes 3.70 and three.90 is code of this kind. The quantity of C/C++ code elevated dramatically from model 3.70 to model 3.90. Since then, a lot of the precise code improvement is within the Bourne shell, particularly the Unix configure script for constructing and putting in the LAME package deal.

A pc program is analagous in operate to a mechanical clockwork gadget. In truth, clockmakers up to now constructed programmable robots and automatons comparable in operate to easy digital and computational units. A line of code in a pc program is corresponding to a transferring half in a mechanical clockwork gadget, an engine, or one thing related. Creating a pc program with 80,000 strains of code is corresponding to designing a clockwork gadget or machine with 80,000 transferring elements. A pc program of this dimension might be extra complicated than a twentieth century vehicle with no embeded computer systems and software program.

Detailed Outcomes of CLOC for the most recent model of

C:Paperwork and SettingsJohn F. McGowanDesktop>cloc lame-3.98.4

     320 textual content recordsdata.

     306 distinctive recordsdata.

     124 recordsdata ignored.

https://cloc.sourceforge.web v 1.53  T=34.0 s (5.6 recordsdata/s, 3510.5 strains/s)


Language                     recordsdata          clean        remark           code


Bourne Shell                    10           4308           5015          34297

C                               49           5837           5359          28421

m4                               2            809             58           7085

C++                             17           1904           2269           6969

HTML                            11           1172             11           5264

C/C++ Header                    67           1509           2835           4455

make                            24            161             50            542

Teamcenter def                   4             89              0            285

Pascal                           1             50             75            178

Visible Primary                     1             19             53             86

DOS Batch                        3             11             45             45

Perl                             1              5             17             33

CSS                              1              3              0             21

XML                              1              0              0             13


SUM:                           192          15877          15787          87694


One can see that the quantity of Bourne Shell code now really exceeds the strains of C code. LAME may be very straightforward to put in on Unix, Macintosh, and Home windows computer systems. That is vital for a profitable broadly used product.


The LAME MP3 audio encoder venture has taken a number of calendar years. A lot of the work seems to have been accomplished between 1998 and 2004 (launch 3.95.1). This contains each improvement and implementation of the core algorithm and a considerable quantity of labor on packaging and putting in the encoder. It’s troublesome to estimate the precise effort (e.g. hours really labored) of an open supply venture. Many initiatives are volunteer or partially volunteer. Some contributors might contribute extra than full time, e.g. a pupil working 80 hours per week, whereas others may go work just a few hours per calendar week and even much less.

Nonetheless, it’s fairly clear that LAME in its present broadly used, profitable type is a considerable effort. It nearly actually couldn’t be produced in a calendar quarter or much less. A full time paid crew {of professional} software program builders would most likely take wherever from six months (a really aggressive goal) to a couple years to provide a comparable MP3 audio encoder from scratch.

© 2011 John F. McGowan

In regards to the Creator

John F. McGowan, Ph.D. is a software program developer, analysis scientist, and advisor. He works primarily within the space of complicated algorithms that embody superior mathematical and logical ideas, together with speech recognition and video compression applied sciences. He has intensive expertise creating software program in C, C++, Visible Primary, Mathematica, MATLAB, and lots of different programming languages. He’s most likely greatest recognized for his AVI Overview, an Web FAQ (Ceaselessly Requested Questions) on the Microsoft AVI (Audio Video Interleave) file format. He has labored as a contractor at NASA Ames Analysis Middle concerned within the analysis and improvement of picture and video processing algorithms and expertise. He has printed articles on the origin and evolution of life, the exploration of Mars (anticipating the invention of methane on Mars), and low cost entry to area. He has a Ph.D. in physics from the College of Illinois at Urbana-Champaign and a B.S. in physics from the California Institute of Expertise (Caltech). He could be reached at [email protected].

Sponsor’s message: Math Higher Defined is an insightful e-book and screencast collection that can enable you to deeply perceive elementary mathematical ideas, and see math in a brand new mild. Get it right here.