FFmpeg
Loading...
Searching...
No Matches
audiodsp_vsx.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007 Luca Barbato <lu_zero@gentoo.org>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "config.h"
22
25
26#include "libavcodec/audiodsp.h"
27
28#include "audiodsp_vsx.h"
29
30static int32_t scalarproduct_int16_vsx(const int16_t *v1, const int16_t *v2, int order)
31{
32 int i;
34 register vec_s16 vec1;
35 register vec_s32 res = vec_splat_s32(0), t;
36 int32_t ires;
37
38 for (i = 0; i < order; i += 8) {
39 vec1 = vec_vsx_ld(0, v1);
40 t = vec_msum(vec1, vec_ld(0, v2), zero_s32v);
41 res = vec_sums(t, res);
42 v1 += 8;
43 v2 += 8;
44 }
45 res = vec_splat(res, 3);
46 vec_ste(res, 0, &ires);
47
48 return ires;
49}
50
52{
53 c->scalarproduct_int16 = scalarproduct_int16_vsx;
54}
int32_t
static int32_t scalarproduct_int16_vsx(const int16_t *v1, const int16_t *v2, int order)
av_cold void ff_audiodsp_init_vsx(AudioDSPContext *c)
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
Macro definitions for various function/variable attributes.
#define av_cold
Definition attributes.h:117
Contains misc utility macros and inline functions.
#define vec_s16
#define LOAD_ZERO
#define zero_s32v
#define vec_s32
static double c[64]