Showing the changes to libavcodec/aac/aacdec_float.c (1 of 10 files). Show all
Unified · Split
| @@ -38,6 +38,7 @@ · 37 unmodified lines | ||
| 38 | 38 | #include "libavcodec/aactab.h" |
| 39 | 39 | #include "libavcodec/sinewin.h" |
| 40 | 40 | #include "libavcodec/kbdwin.h" |
| 41 | +#include "libavcodec/cbrt_data.h" | |
| 41 | 42 | |
| 42 | 43 | DECLARE_ALIGNED(32, static float, sine_120)[120]; |
| 43 | 44 | DECLARE_ALIGNED(32, static float, sine_960)[960]; |
| @@ -63,4 +64,77 @@ static void init_tables(void) · 19 unmodified lines | ||
| 63 | 64 | ff_thread_once(&init_float_once, init_tables_float_fn); |
| 64 | 65 | } |
| 65 | 66 | |
| 67 | +/** Dequantization-related **/ | |
| 68 | +#include "aacdec_tab.h" | |
| 69 | +#include "libavutil/intfloat.h" | |
| 70 | + | |
| 71 | +#ifndef VMUL2 | |
| 72 | +static inline float *VMUL2(float *dst, const float *v, unsigned idx, | |
| 73 | + const float *scale) | |
| 74 | +{ | |
| 75 | + float s = *scale; | |
| 76 | + *dst++ = v[idx & 15] * s; | |
| 77 | + *dst++ = v[idx>>4 & 15] * s; | |
| 78 | + return dst; | |
| 79 | +} | |
| 80 | +#endif | |
| 81 | + | |
| 82 | +#ifndef VMUL4 | |
| 83 | +static inline float *VMUL4(float *dst, const float *v, unsigned idx, | |
| 84 | + const float *scale) | |
| 85 | +{ | |
| 86 | + float s = *scale; | |
| 87 | + *dst++ = v[idx & 3] * s; | |
| 88 | + *dst++ = v[idx>>2 & 3] * s; | |
| 89 | + *dst++ = v[idx>>4 & 3] * s; | |
| 90 | + *dst++ = v[idx>>6 & 3] * s; | |
| 91 | + return dst; | |
| 92 | +} | |
| 93 | +#endif | |
| 94 | + | |
| 95 | +#ifndef VMUL2S | |
| 96 | +static inline float *VMUL2S(float *dst, const float *v, unsigned idx, | |
| 97 | + unsigned sign, const float *scale) | |
| 98 | +{ | |
| 99 | + union av_intfloat32 s0, s1; | |
| 100 | + | |
| 101 | + s0.f = s1.f = *scale; | |
| 102 | + s0.i ^= sign >> 1 << 31; | |
| 103 | + s1.i ^= sign << 31; | |
| 104 | + | |
| 105 | + *dst++ = v[idx & 15] * s0.f; | |
| 106 | + *dst++ = v[idx>>4 & 15] * s1.f; | |
| 107 | + | |
| 108 | + return dst; | |
| 109 | +} | |
| 110 | +#endif | |
| 111 | + | |
| 112 | +#ifndef VMUL4S | |
| 113 | +static inline float *VMUL4S(float *dst, const float *v, unsigned idx, | |
| 114 | + unsigned sign, const float *scale) | |
| 115 | +{ | |
| 116 | + unsigned nz = idx >> 12; | |
| 117 | + union av_intfloat32 s = { .f = *scale }; | |
| 118 | + union av_intfloat32 t; | |
| 119 | + | |
| 120 | + t.i = s.i ^ (sign & 1U<<31); | |
| 121 | + *dst++ = v[idx & 3] * t.f; | |
| 122 | + | |
| 123 | + sign <<= nz & 1; nz >>= 1; | |
| 124 | + t.i = s.i ^ (sign & 1U<<31); | |
| 125 | + *dst++ = v[idx>>2 & 3] * t.f; | |
| 126 | + | |
| 127 | + sign <<= nz & 1; nz >>= 1; | |
| 128 | + t.i = s.i ^ (sign & 1U<<31); | |
| 129 | + *dst++ = v[idx>>4 & 3] * t.f; | |
| 130 | + | |
| 131 | + sign <<= nz & 1; | |
| 132 | + t.i = s.i ^ (sign & 1U<<31); | |
| 133 | + *dst++ = v[idx>>6 & 3] * t.f; | |
| 134 | + | |
| 135 | + return dst; | |
| 136 | +} | |
| 137 | +#endif | |
| 138 | + | |
| 66 | 139 | #include "aacdec_dsp_template.c" |
| 140 | +#include "aacdec_proc_template.c" | |