libavcodec/arm/ac3dsp_init_arm.c
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
00003  *
00004  * This file is part of FFmpeg.
00005  *
00006  * FFmpeg 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  * FFmpeg 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 FFmpeg; 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 #include "libavutil/attributes.h"
00023 #include "libavcodec/ac3dsp.h"
00024 #include "config.h"
00025 
00026 void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
00027 int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len);
00028 void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift);
00029 void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift);
00030 void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len);
00031 void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
00032 void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4],
00033                                             const int32_t *coef0,
00034                                             const int32_t *coef1,
00035                                             int len);
00036 void ff_ac3_sum_square_butterfly_float_neon(float sum[4],
00037                                             const float *coef0,
00038                                             const float *coef1,
00039                                             int len);
00040 
00041 void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd,
00042                                      int start, int end,
00043                                      int snr_offset, int floor,
00044                                      const uint8_t *bap_tab, uint8_t *bap);
00045 
00046 void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len);
00047 
00048 av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
00049 {
00050     c->update_bap_counts         = ff_ac3_update_bap_counts_arm;
00051 
00052     if (HAVE_ARMV6) {
00053         c->bit_alloc_calc_bap    = ff_ac3_bit_alloc_calc_bap_armv6;
00054     }
00055 
00056     if (HAVE_NEON) {
00057         c->ac3_exponent_min      = ff_ac3_exponent_min_neon;
00058         c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
00059         c->ac3_lshift_int16      = ff_ac3_lshift_int16_neon;
00060         c->ac3_rshift_int32      = ff_ac3_rshift_int32_neon;
00061         c->float_to_fixed24      = ff_float_to_fixed24_neon;
00062         c->extract_exponents     = ff_ac3_extract_exponents_neon;
00063         c->sum_square_butterfly_int32 = ff_ac3_sum_square_butterfly_int32_neon;
00064         c->sum_square_butterfly_float = ff_ac3_sum_square_butterfly_float_neon;
00065     }
00066 }