diff options
Diffstat (limited to 'libavcodec/ppc/fmtconvert_altivec.c')
-rw-r--r-- | libavcodec/ppc/fmtconvert_altivec.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/libavcodec/ppc/fmtconvert_altivec.c b/libavcodec/ppc/fmtconvert_altivec.c index 129891ad9b..bad3b45b1b 100644 --- a/libavcodec/ppc/fmtconvert_altivec.c +++ b/libavcodec/ppc/fmtconvert_altivec.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * 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. * - * Libav is distributed in the hope that it will be useful, + * 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 Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -86,16 +86,27 @@ static void float_to_int16_altivec(int16_t *dst, const float *src, long len) static void float_to_int16_stride_altivec(int16_t *dst, const float *src, long len, int stride) { - int i, j; + int i; vector signed short d, s; for (i = 0; i < len - 7; i += 8) { d = float_to_int16_one_altivec(src + i); - for (j = 0; j < 8; j++) { - s = vec_splat(d, j); - vec_ste(s, 0, dst); - dst += stride; - } + +#define ASSIGN_S_VEC_SPLAT_D(j) \ + s = vec_splat(d, j); \ + vec_ste(s, 0, dst); \ + dst += stride + + ASSIGN_S_VEC_SPLAT_D(0); + ASSIGN_S_VEC_SPLAT_D(1); + ASSIGN_S_VEC_SPLAT_D(2); + ASSIGN_S_VEC_SPLAT_D(3); + ASSIGN_S_VEC_SPLAT_D(4); + ASSIGN_S_VEC_SPLAT_D(5); + ASSIGN_S_VEC_SPLAT_D(6); + ASSIGN_S_VEC_SPLAT_D(7); + +#undef ASSIGN_S_VEC_SPLAT_D } } |