[FFmpeg-devel] [PATCH 1/2] Optimization of AC3 floating point decoder for MIPS

Michael Niedermayer michaelni at gmx.at
Sat Jul 7 23:32:13 CEST 2012


On Tue, Jun 26, 2012 at 01:13:20PM +0200, Nedeljko Babic wrote:
> FFT in MIPS implementation is working iteratively instead
>  of "recursively" calling functions for smaller FFT sizes.
> Some of DSP and format convert utils functions are also optimized.
[...]
> diff --git a/libavcodec/mips/fmtconvert_mips.c b/libavcodec/mips/fmtconvert_mips.c
> new file mode 100644
> index 0000000..9e45ba1
> --- /dev/null
> +++ b/libavcodec/mips/fmtconvert_mips.c
> @@ -0,0 +1,336 @@
> +/*
> + * Format Conversion Utils for MIPS
> + *
> + * Copyright (c) 2012
> + *      MIPS Technologies, Inc., California.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *    notice, this list of conditions and the following disclaimer in the
> + *    documentation and/or other materials provided with the distribution.
> + * 3. Neither the name of the MIPS Technologies, Inc., nor the names of is
> + *    contributors may be used to endorse or promote products derived from
> + *    this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + *
> + * Author:  Zoran Lukic (zoranl at mips.com)
> + * Author:  Nedeljko Babic (nbabic at mips.com)
> + *
> + * 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
> + */
> +#include "config.h"
> +#include "libavcodec/avcodec.h"
> +#include "libavcodec/fmtconvert.h"
> +
> +#if HAVE_INLINE_ASM

if all code in the whole file depends on HAVE_INLINE_ASM then it
would be easiest to change the Makefile to only compile it in that
case instead of the #ifs


> +static void float_to_int16_mips(int16_t *dst, const float *src, long len) {

you might want to look at libswresample/audioconvert
as well as libswresample/x86/audio_convert.asm (which is the x86
optimized variant of it)

libswresample is what ffmpeg primarely uses to convert between
sample formats and packings (as well as sample rates & channel layouts)
the fmtconvert code is likely going to be used less and might totally
disappear as codecs should read & write their "native" format and
not convert internally ...

except these, the fmtconvert changes look good to me

thanks

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20120707/cf1513ce/attachment.asc>


More information about the ffmpeg-devel mailing list