diff libavcodec/arm/aac.h @ 2:897f711a7157

rearrange to work with autoconf
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Tue, 25 Sep 2012 15:55:33 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libavcodec/arm/aac.h	Tue Sep 25 15:55:33 2012 +0200
     1.3 @@ -0,0 +1,137 @@
     1.4 +/*
     1.5 + * Copyright (c) 2010 Mans Rullgard <mans@mansr.com>
     1.6 + *
     1.7 + * This file is part of FFmpeg.
     1.8 + *
     1.9 + * FFmpeg is free software; you can redistribute it and/or
    1.10 + * modify it under the terms of the GNU Lesser General Public
    1.11 + * License as published by the Free Software Foundation; either
    1.12 + * version 2.1 of the License, or (at your option) any later version.
    1.13 + *
    1.14 + * FFmpeg is distributed in the hope that it will be useful,
    1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.17 + * Lesser General Public License for more details.
    1.18 + *
    1.19 + * You should have received a copy of the GNU Lesser General Public
    1.20 + * License along with FFmpeg; if not, write to the Free Software
    1.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
    1.22 + */
    1.23 +
    1.24 +#ifndef AVCODEC_ARM_AAC_H
    1.25 +#define AVCODEC_ARM_AAC_H
    1.26 +
    1.27 +#include "config.h"
    1.28 +
    1.29 +#if HAVE_NEON && HAVE_INLINE_ASM
    1.30 +
    1.31 +#define VMUL2 VMUL2
    1.32 +static inline float *VMUL2(float *dst, const float *v, unsigned idx,
    1.33 +                           const float *scale)
    1.34 +{
    1.35 +    unsigned v0, v1;
    1.36 +    __asm__ volatile ("ubfx     %0,  %4,  #0, #4      \n\t"
    1.37 +                      "ubfx     %1,  %4,  #4, #4      \n\t"
    1.38 +                      "ldr      %0,  [%3, %0, lsl #2] \n\t"
    1.39 +                      "ldr      %1,  [%3, %1, lsl #2] \n\t"
    1.40 +                      "vld1.32  {d1[]},   [%5,:32]    \n\t"
    1.41 +                      "vmov     d0,  %0,  %1          \n\t"
    1.42 +                      "vmul.f32 d0,  d0,  d1          \n\t"
    1.43 +                      "vst1.32  {d0},     [%2,:64]!   \n\t"
    1.44 +                      : "=&r"(v0), "=&r"(v1), "+r"(dst)
    1.45 +                      : "r"(v), "r"(idx), "r"(scale)
    1.46 +                      : "d0", "d1");
    1.47 +    return dst;
    1.48 +}
    1.49 +
    1.50 +#define VMUL4 VMUL4
    1.51 +static inline float *VMUL4(float *dst, const float *v, unsigned idx,
    1.52 +                           const float *scale)
    1.53 +{
    1.54 +    unsigned v0, v1, v2, v3;
    1.55 +    __asm__ volatile ("ubfx     %0,  %6,  #0, #2      \n\t"
    1.56 +                      "ubfx     %1,  %6,  #2, #2      \n\t"
    1.57 +                      "ldr      %0,  [%5, %0, lsl #2] \n\t"
    1.58 +                      "ubfx     %2,  %6,  #4, #2      \n\t"
    1.59 +                      "ldr      %1,  [%5, %1, lsl #2] \n\t"
    1.60 +                      "ubfx     %3,  %6,  #6, #2      \n\t"
    1.61 +                      "ldr      %2,  [%5, %2, lsl #2] \n\t"
    1.62 +                      "vmov     d0,  %0,  %1          \n\t"
    1.63 +                      "ldr      %3,  [%5, %3, lsl #2] \n\t"
    1.64 +                      "vld1.32  {d2[],d3[]},[%7,:32]  \n\t"
    1.65 +                      "vmov     d1,  %2,  %3          \n\t"
    1.66 +                      "vmul.f32 q0,  q0,  q1          \n\t"
    1.67 +                      "vst1.32  {q0},     [%4,:128]!  \n\t"
    1.68 +                      : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst)
    1.69 +                      : "r"(v), "r"(idx), "r"(scale)
    1.70 +                      : "d0", "d1", "d2", "d3");
    1.71 +    return dst;
    1.72 +}
    1.73 +
    1.74 +#define VMUL2S VMUL2S
    1.75 +static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
    1.76 +                            unsigned sign, const float *scale)
    1.77 +{
    1.78 +    unsigned v0, v1, v2, v3;
    1.79 +    __asm__ volatile ("ubfx     %0,  %6,  #0, #4      \n\t"
    1.80 +                      "ubfx     %1,  %6,  #4, #4      \n\t"
    1.81 +                      "ldr      %0,  [%5, %0, lsl #2] \n\t"
    1.82 +                      "lsl      %2,  %8,  #30         \n\t"
    1.83 +                      "ldr      %1,  [%5, %1, lsl #2] \n\t"
    1.84 +                      "lsl      %3,  %8,  #31         \n\t"
    1.85 +                      "vmov     d0,  %0,  %1          \n\t"
    1.86 +                      "bic      %2,  %2,  #1<<30      \n\t"
    1.87 +                      "vld1.32  {d1[]},   [%7,:32]    \n\t"
    1.88 +                      "vmov     d2,  %2,  %3          \n\t"
    1.89 +                      "veor     d0,  d0,  d2          \n\t"
    1.90 +                      "vmul.f32 d0,  d0,  d1          \n\t"
    1.91 +                      "vst1.32  {d0},     [%4,:64]!   \n\t"
    1.92 +                      : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst)
    1.93 +                      : "r"(v), "r"(idx), "r"(scale), "r"(sign)
    1.94 +                      : "d0", "d1", "d2");
    1.95 +    return dst;
    1.96 +}
    1.97 +
    1.98 +#define VMUL4S VMUL4S
    1.99 +static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
   1.100 +                            unsigned sign, const float *scale)
   1.101 +{
   1.102 +    unsigned v0, v1, v2, v3, nz;
   1.103 +    __asm__ volatile ("vld1.32  {d2[],d3[]},[%9,:32]  \n\t"
   1.104 +                      "ubfx     %0,  %8,  #0, #2      \n\t"
   1.105 +                      "ubfx     %1,  %8,  #2, #2      \n\t"
   1.106 +                      "ldr      %0,  [%7, %0, lsl #2] \n\t"
   1.107 +                      "ubfx     %2,  %8,  #4, #2      \n\t"
   1.108 +                      "ldr      %1,  [%7, %1, lsl #2] \n\t"
   1.109 +                      "ubfx     %3,  %8,  #6, #2      \n\t"
   1.110 +                      "ldr      %2,  [%7, %2, lsl #2] \n\t"
   1.111 +                      "vmov     d0,  %0,  %1          \n\t"
   1.112 +                      "ldr      %3,  [%7, %3, lsl #2] \n\t"
   1.113 +                      "lsr      %6,  %8,  #12         \n\t"
   1.114 +                      "rbit     %6,  %6               \n\t"
   1.115 +                      "vmov     d1,  %2,  %3          \n\t"
   1.116 +                      "lsls     %6,  %6,  #1          \n\t"
   1.117 +                      "and      %0,  %5,  #1<<31      \n\t"
   1.118 +                      "lslcs    %5,  %5,  #1          \n\t"
   1.119 +                      "lsls     %6,  %6,  #1          \n\t"
   1.120 +                      "and      %1,  %5,  #1<<31      \n\t"
   1.121 +                      "lslcs    %5,  %5,  #1          \n\t"
   1.122 +                      "lsls     %6,  %6,  #1          \n\t"
   1.123 +                      "and      %2,  %5,  #1<<31      \n\t"
   1.124 +                      "lslcs    %5,  %5,  #1          \n\t"
   1.125 +                      "vmov     d4,  %0,  %1          \n\t"
   1.126 +                      "and      %3,  %5,  #1<<31      \n\t"
   1.127 +                      "vmov     d5,  %2,  %3          \n\t"
   1.128 +                      "veor     q0,  q0,  q2          \n\t"
   1.129 +                      "vmul.f32 q0,  q0,  q1          \n\t"
   1.130 +                      "vst1.32  {q0},     [%4,:128]!  \n\t"
   1.131 +                      : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
   1.132 +                        "+r"(sign), "=r"(nz)
   1.133 +                      : "r"(v), "r"(idx), "r"(scale)
   1.134 +                      : "d0", "d1", "d2", "d3", "d4", "d5");
   1.135 +    return dst;
   1.136 +}
   1.137 +
   1.138 +#endif /* HAVE_NEON && HAVE_INLINE_ASM */
   1.139 +
   1.140 +#endif /* AVCODEC_ARM_AAC_H */