Libav 0.7.1
libavcodec/arm/fmtconvert_init_arm.c
Go to the documentation of this file.
00001 /*
00002  * ARM optimized Format Conversion Utils
00003  *
00004  * This file is part of Libav.
00005  *
00006  * Libav is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * Libav is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with Libav; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00019  */
00020 
00021 #include <stdint.h>
00022 
00023 #include "libavcodec/avcodec.h"
00024 #include "libavcodec/fmtconvert.h"
00025 
00026 void ff_int32_to_float_fmul_scalar_neon(float *dst, const int *src,
00027                                         float mul, int len);
00028 
00029 void ff_float_to_int16_neon(int16_t *dst, const float *src, long len);
00030 void ff_float_to_int16_interleave_neon(int16_t *, const float **, long, int);
00031 
00032 void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len);
00033 
00034 void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx)
00035 {
00036     if (HAVE_ARMVFP && HAVE_ARMV6) {
00037         c->float_to_int16 = ff_float_to_int16_vfp;
00038     }
00039 
00040     if (HAVE_NEON) {
00041         c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon;
00042 
00043         if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
00044             c->float_to_int16            = ff_float_to_int16_neon;
00045             c->float_to_int16_interleave = ff_float_to_int16_interleave_neon;
00046         }
00047     }
00048 }