[FFmpeg-devel] [PATCH] lavc: add fixed point mp2 encoder

Michael Niedermayer michaelni at gmx.at
Fri Aug 3 17:17:08 CEST 2012


On Fri, Aug 03, 2012 at 02:15:30PM +0000, Paul B Mahol wrote:
> On 8/3/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Fri, Aug 03, 2012 at 03:07:39AM +0000, Paul B Mahol wrote:
> >> On 8/3/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> > On Mon, Jul 30, 2012 at 03:02:20PM +0000, Paul B Mahol wrote:
> >> > [...]
> >> >> diff --git a/libavcodec/mpegaudioenc_fixed.c
> >> >> b/libavcodec/mpegaudioenc_fixed.c
> >> >> new file mode 100644
> >> >> index 0000000..fdcaa78
> >> >> --- /dev/null
> >> >> +++ b/libavcodec/mpegaudioenc_fixed.c
> >> >> @@ -0,0 +1,39 @@
> >> >> +/*
> >> >> + * Fixed point MPEG Audio layer 2 encoder
> >> >> + *
> >> >> + * This file is part of FFmpeg.
> >> >> + *
> >> >> + * FFmpeg is free software; you can redistribute it and/or
> >> >> + * modify it under the terms of the GNU Lesser General Public
> >> >> + * License as published by the Free Software Foundation; either
> >> >> + * version 2.1 of the License, or (at your option) any later version.
> >> >> + *
> >> >> + * FFmpeg is distributed in the hope that it will be useful,
> >> >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> >> >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> >> >> + * Lesser General Public License for more details.
> >> >> + *
> >> >> + * You should have received a copy of the GNU Lesser General Public
> >> >> + * License along with FFmpeg; if not, write to the Free Software
> >> >> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> >> >> 02110-1301 USA
> >> >> + */
> >> >> +
> >> >> +#define USE_FLOATS 0
> >> >> +#include "mpegaudioenc.c"
> >> >
> >> > the code uses #ifdef USE_FLOATS, thus this wont work
> >> > also what speed and quality difference is there between the 2 ?
> >>
> >> There is already integer and float version of decoder.
> >
> > yes, but it appeared that your patch would change the default from
> > float to fixed
> 
> "Default" decoder is fixed so i really do not see any "real" problem.

well, no not a "real" problem
just that the default decoder needs:
real    0m0.480s
while mp3float needs:
real    0m0.324s

at the same time the later is likely more accurate
so IMHO on modern hardware that have working FPUs (some embeded hw
does not fall in this category)
mp3float should be default and similarly for the encoder side.

I mean there could be a mp2fixed and a mp2float and a mp2 and the
last would be either mp2fixed or float depending on the cpu its
compiled for.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120803/287140b1/attachment.asc>


More information about the ffmpeg-devel mailing list