ReactOS 0.4.15-dev-7942-gd23573b
decode.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OUT_FORMATS   4 /* Basic output formats: 16bit, 8bit, real and s32 */
 
#define OUT_16   0
 
#define OUT_8   1
 
#define OUT_REAL   2 /* Write a floating point sample (that is, one matching the internal real type). */
 
#define OUT_S32   3
 
#define NTOM_MAX   8 /* maximum allowed factor for upsampling */
 
#define NTOM_MAX_FREQ   96000 /* maximum frequency to upsample to / downsample from */
 
#define NTOM_MUL   (32768)
 

Functions

void ntom_set_ntom (mpg123_handle *fr, off_t num)
 
int synth_1to1 (real *, int, mpg123_handle *, int)
 
int synth_1to1_dither (real *, int, mpg123_handle *, int)
 
int synth_1to1_i386 (real *, int, mpg123_handle *, int)
 
int synth_1to1_i586 (real *, int, mpg123_handle *, int)
 
int synth_1to1_i586_dither (real *, int, mpg123_handle *, int)
 
int synth_1to1_mmx (real *, int, mpg123_handle *, int)
 
int synth_1to1_3dnow (real *, int, mpg123_handle *, int)
 
int synth_1to1_sse (real *, int, mpg123_handle *, int)
 
int synth_1to1_stereo_sse (real *, real *, mpg123_handle *)
 
int synth_1to1_3dnowext (real *, int, mpg123_handle *, int)
 
int synth_1to1_altivec (real *, int, mpg123_handle *, int)
 
int synth_1to1_stereo_altivec (real *, real *, mpg123_handle *)
 
int synth_1to1_x86_64 (real *, int, mpg123_handle *, int)
 
int synth_1to1_stereo_x86_64 (real *, real *, mpg123_handle *)
 
int synth_1to1_avx (real *, int, mpg123_handle *, int)
 
int synth_1to1_stereo_avx (real *, real *, mpg123_handle *)
 
int synth_1to1_arm (real *, int, mpg123_handle *, int)
 
int synth_1to1_neon (real *, int, mpg123_handle *, int)
 
int synth_1to1_stereo_neon (real *, real *, mpg123_handle *)
 
int synth_1to1_neon64 (real *, int, mpg123_handle *, int)
 
int synth_1to1_stereo_neon64 (real *, real *, mpg123_handle *)
 
int absynth_1to1_i486 (real *, int, mpg123_handle *, int)
 
int synth_1to1_mono (real *, mpg123_handle *)
 
int synth_1to1_m2s (real *, mpg123_handle *)
 
int synth_2to1 (real *, int, mpg123_handle *, int)
 
int synth_2to1_dither (real *, int, mpg123_handle *, int)
 
int synth_2to1_i386 (real *, int, mpg123_handle *, int)
 
int synth_2to1_mono (real *, mpg123_handle *)
 
int synth_2to1_m2s (real *, mpg123_handle *)
 
int synth_4to1 (real *, int, mpg123_handle *, int)
 
int synth_4to1_dither (real *, int, mpg123_handle *, int)
 
int synth_4to1_i386 (real *, int, mpg123_handle *, int)
 
int synth_4to1_mono (real *, mpg123_handle *)
 
int synth_4to1_m2s (real *, mpg123_handle *)
 
int synth_ntom (real *, int, mpg123_handle *, int)
 
int synth_ntom_mono (real *, mpg123_handle *)
 
int synth_ntom_m2s (real *, mpg123_handle *)
 
int synth_1to1_8bit (real *, int, mpg123_handle *, int)
 
int synth_1to1_8bit_i386 (real *, int, mpg123_handle *, int)
 
int synth_1to1_8bit_wrap (real *, int, mpg123_handle *, int)
 
int synth_1to1_8bit_mono (real *, mpg123_handle *)
 
int synth_1to1_8bit_m2s (real *, mpg123_handle *)
 
int synth_1to1_8bit_wrap_mono (real *, mpg123_handle *)
 
int synth_1to1_8bit_wrap_m2s (real *, mpg123_handle *)
 
int synth_2to1_8bit (real *, int, mpg123_handle *, int)
 
int synth_2to1_8bit_i386 (real *, int, mpg123_handle *, int)
 
int synth_2to1_8bit_mono (real *, mpg123_handle *)
 
int synth_2to1_8bit_m2s (real *, mpg123_handle *)
 
int synth_4to1_8bit (real *, int, mpg123_handle *, int)
 
int synth_4to1_8bit_i386 (real *, int, mpg123_handle *, int)
 
int synth_4to1_8bit_mono (real *, mpg123_handle *)
 
int synth_4to1_8bit_m2s (real *, mpg123_handle *)
 
int synth_ntom_8bit (real *, int, mpg123_handle *, int)
 
int synth_ntom_8bit_mono (real *, mpg123_handle *)
 
int synth_ntom_8bit_m2s (real *, mpg123_handle *)
 
int synth_1to1_real (real *, int, mpg123_handle *, int)
 
int synth_1to1_real_i386 (real *, int, mpg123_handle *, int)
 
int synth_1to1_real_sse (real *, int, mpg123_handle *, int)
 
int synth_1to1_real_stereo_sse (real *, real *, mpg123_handle *)
 
int synth_1to1_real_x86_64 (real *, int, mpg123_handle *, int)
 
int synth_1to1_real_stereo_x86_64 (real *, real *, mpg123_handle *)
 
int synth_1to1_real_avx (real *, int, mpg123_handle *, int)
 
int synth_1to1_fltst_avx (real *, real *, mpg123_handle *)
 
int synth_1to1_real_altivec (real *, int, mpg123_handle *, int)
 
int synth_1to1_fltst_altivec (real *, real *, mpg123_handle *)
 
int synth_1to1_real_neon (real *, int, mpg123_handle *, int)
 
int synth_1to1_real_stereo_neon (real *, real *, mpg123_handle *)
 
int synth_1to1_real_neon64 (real *, int, mpg123_handle *, int)
 
int synth_1to1_fltst_neon64 (real *, real *, mpg123_handle *)
 
int synth_1to1_real_mono (real *, mpg123_handle *)
 
int synth_1to1_real_m2s (real *, mpg123_handle *)
 
int synth_2to1_real (real *, int, mpg123_handle *, int)
 
int synth_2to1_real_i386 (real *, int, mpg123_handle *, int)
 
int synth_2to1_real_mono (real *, mpg123_handle *)
 
int synth_2to1_real_m2s (real *, mpg123_handle *)
 
int synth_4to1_real (real *, int, mpg123_handle *, int)
 
int synth_4to1_real_i386 (real *, int, mpg123_handle *, int)
 
int synth_4to1_real_mono (real *, mpg123_handle *)
 
int synth_4to1_real_m2s (real *, mpg123_handle *)
 
int synth_ntom_real (real *, int, mpg123_handle *, int)
 
int synth_ntom_real_mono (real *, mpg123_handle *)
 
int synth_ntom_real_m2s (real *, mpg123_handle *)
 
int synth_1to1_s32 (real *, int, mpg123_handle *, int)
 
int synth_1to1_s32_i386 (real *, int, mpg123_handle *, int)
 
int synth_1to1_s32_sse (real *, int, mpg123_handle *, int)
 
int synth_1to1_s32_stereo_sse (real *, real *, mpg123_handle *)
 
int synth_1to1_s32_x86_64 (real *, int, mpg123_handle *, int)
 
int synth_1to1_s32_stereo_x86_64 (real *, real *, mpg123_handle *)
 
int synth_1to1_s32_avx (real *, int, mpg123_handle *, int)
 
int synth_1to1_s32_stereo_avx (real *, real *, mpg123_handle *)
 
int synth_1to1_s32_altivec (real *, int, mpg123_handle *, int)
 
int synth_1to1_s32_stereo_altivec (real *, real *, mpg123_handle *)
 
int synth_1to1_s32_neon (real *, int, mpg123_handle *, int)
 
int synth_1to1_s32_stereo_neon (real *, real *, mpg123_handle *)
 
int synth_1to1_s32_neon64 (real *, int, mpg123_handle *, int)
 
int synth_1to1_s32st_neon64 (real *, real *, mpg123_handle *)
 
int synth_1to1_s32_mono (real *, mpg123_handle *)
 
int synth_1to1_s32_m2s (real *, mpg123_handle *)
 
int synth_2to1_s32 (real *, int, mpg123_handle *, int)
 
int synth_2to1_s32_i386 (real *, int, mpg123_handle *, int)
 
int synth_2to1_s32_mono (real *, mpg123_handle *)
 
int synth_2to1_s32_m2s (real *, mpg123_handle *)
 
int synth_4to1_s32 (real *, int, mpg123_handle *, int)
 
int synth_4to1_s32_i386 (real *, int, mpg123_handle *, int)
 
int synth_4to1_s32_mono (real *, mpg123_handle *)
 
int synth_4to1_s32_m2s (real *, mpg123_handle *)
 
int synth_ntom_s32 (real *, int, mpg123_handle *, int)
 
int synth_ntom_s32_mono (real *, mpg123_handle *)
 
int synth_ntom_s32_m2s (real *, mpg123_handle *)
 
void dct64 (real *, real *, real *)
 
void dct64_i386 (real *, real *, real *)
 
void dct64_altivec (real *, real *, real *)
 
void dct64_i486 (int *, int *, real *)
 
void dct36 (real *, real *, real *, real *, real *)
 
void dct36_3dnow (real *, real *, real *, real *, real *)
 
void dct36_3dnowext (real *, real *, real *, real *, real *)
 
void dct36_x86_64 (real *, real *, real *, real *, real *)
 
void dct36_sse (real *, real *, real *, real *, real *)
 
void dct36_avx (real *, real *, real *, real *, real *)
 
void dct36_neon (real *, real *, real *, real *, real *)
 
void dct36_neon64 (real *, real *, real *, real *, real *)
 
int synth_ntom_set_step (mpg123_handle *fr)
 
unsigned long ntom_val (mpg123_handle *fr, off_t frame)
 
off_t ntom_frame_outsamples (mpg123_handle *fr)
 
off_t ntom_frmouts (mpg123_handle *fr, off_t frame)
 
off_t ntom_ins2outs (mpg123_handle *fr, off_t ins)
 
off_t ntom_frameoff (mpg123_handle *fr, off_t soff)
 
void init_layer3 (void)
 
real init_layer3_gainpow2 (mpg123_handle *fr, int i)
 
void init_layer3_stuff (mpg123_handle *fr, real(*gainpow2)(mpg123_handle *fr, int i))
 
void init_layer12 (void)
 
realinit_layer12_table (mpg123_handle *fr, real *table, int m)
 
void init_layer12_stuff (mpg123_handle *fr, real *(*init_table)(mpg123_handle *fr, real *table, int m))
 
void prepare_decode_tables (void)
 
void make_decode_tables (mpg123_handle *fr)
 
int make_conv16to8_table (mpg123_handle *fr)
 
int do_layer3 (mpg123_handle *fr)
 
int do_layer2 (mpg123_handle *fr)
 
int do_layer1 (mpg123_handle *fr)
 
void do_equalizer (real *bandPtr, int channel, real equalizer[2][32])
 

Variables

realpnts [5]
 

Macro Definition Documentation

◆ NTOM_MAX

#define NTOM_MAX   8 /* maximum allowed factor for upsampling */

Definition at line 30 of file decode.h.

◆ NTOM_MAX_FREQ

#define NTOM_MAX_FREQ   96000 /* maximum frequency to upsample to / downsample from */

Definition at line 31 of file decode.h.

◆ NTOM_MUL

#define NTOM_MUL   (32768)

Definition at line 32 of file decode.h.

◆ OUT_16

#define OUT_16   0

Definition at line 21 of file decode.h.

◆ OUT_8

#define OUT_8   1

Definition at line 22 of file decode.h.

◆ OUT_FORMATS

#define OUT_FORMATS   4 /* Basic output formats: 16bit, 8bit, real and s32 */

Definition at line 16 of file decode.h.

◆ OUT_REAL

#define OUT_REAL   2 /* Write a floating point sample (that is, one matching the internal real type). */

Definition at line 24 of file decode.h.

◆ OUT_S32

#define OUT_S32   3

Definition at line 25 of file decode.h.

Function Documentation

◆ absynth_1to1_i486()

int absynth_1to1_i486 ( real bandPtr,
int  channel,
mpg123_handle fr,
int  nb_blocks 
)

Definition at line 108 of file synth_i486.c.

109{
110 short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
111 int *b0,**buf;
112 int clip = 0;
113 int block,b,bo_start;
114
115 /* samples address */
116 samples+=channel;
117
118 bo_start=fr->i486bo[channel];
119 buf = fr->int_buffs[channel];
120
121 b=bo_start;
122 for(block=0;block<nb_blocks;block++) {
123
124 /* FIR offset */
125 b++;
126 if (b >= FIR_BUFFER_SIZE) {
127 int *p,*q;
128 int c,i,j;
129
130 /* we shift the buffers */
131 for(c=0;c<2;c++) {
132 p=&buf[c][0]+1;
133 q=p+(FIR_BUFFER_SIZE-FIR_SIZE);
134 for(i=0;i<17;i++) {
135 for(j=0;j<FIR_SIZE-1;j++) p[j]=q[j];
136 p+=FIR_BUFFER_SIZE;
137 q+=FIR_BUFFER_SIZE;
138 }
139 }
140 /* we update 'bo' accordingly */
141 b=fr->i486bo[channel]=FIR_SIZE;
142 }
143
144 if(b & 1) {
145 dct64_i486(buf[1]+b,buf[0]+b,bandPtr);
146 } else {
147 dct64_i486(buf[0]+b,buf[1]+b,bandPtr);
148 }
149 bandPtr+=32;
150 }
151 fr->i486bo[channel]=b;
152
153 /* filter bank: part 1 */
154 b=bo_start;
155 for(block=0;block<nb_blocks;block++) {
156 b++;
157 if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
158 if(b & 1) {
159 b0 = buf[0] + b - (FIR_SIZE-1);
160 } else {
161 b0 = buf[1] + b - (FIR_SIZE-1);
162 }
163
164 FIR16_1(0,-7,53,-114,509,-1288,1643,-9372,18759,9372,1643,1288,509,114,53,7,0);
165 FIR16_2(1,-6,52,-100,515,-1197,1783,-8910,18748,9834,1489,1379,500,129,54,7,0,
166 31,0,-7,54,-129,500,-1379,1489,-9834,18748,8910,1783,1197,515,100,52,6);
167 FIR16_2(2,-6,50,-86,520,-1106,1910,-8447,18714,10294,1322,1469,488,145,55,8,0,
168 30,0,-8,55,-145,488,-1469,1322,-10294,18714,8447,1910,1106,520,86,50,6);
169 FIR16_2(3,-5,49,-73,521,-1015,2023,-7986,18657,10751,1140,1559,473,161,56,9,0,
170 29,0,-9,56,-161,473,-1559,1140,-10751,18657,7986,2023,1015,521,73,49,5);
171 samples+=64;
172 }
173 samples-=64*nb_blocks;
174
175 /* filter bank: part 2 */
176
177 b=bo_start;
178 for(block=0;block<nb_blocks;block++) {
179 b++;
180 if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
181 if(b & 1) {
182 b0 = buf[0] + b - (FIR_SIZE-1) + 4*FIR_BUFFER_SIZE;
183 } else {
184 b0 = buf[1] + b - (FIR_SIZE-1) + 4*FIR_BUFFER_SIZE;
185 }
186
187 FIR16_2(4,-4,47,-61,521,-926,2123,-7528,18578,11205,944,1647,455,177,56,10,0,
188 28,0,-10,56,-177,455,-1647,944,-11205,18578,7528,2123,926,521,61,47,4);
189 FIR16_2(5,-4,45,-49,518,-837,2210,-7072,18477,11654,733,1733,434,194,57,11,0,
190 27,0,-11,57,-194,434,-1733,733,-11654,18477,7072,2210,837,518,49,45,4);
191 FIR16_2(6,-4,44,-38,514,-751,2284,-6620,18353,12097,509,1817,411,212,57,12,0,
192 26,0,-12,57,-212,411,-1817,509,-12097,18353,6620,2284,751,514,38,44,4);
193 FIR16_2(7,-3,42,-27,508,-665,2347,-6173,18208,12534,270,1899,383,229,56,13,0,
194 25,0,-13,56,-229,383,-1899,270,-12534,18208,6173,2347,665,508,27,42,3);
195
196 samples+=64;
197 }
198 samples-=64*nb_blocks;
199
200 /* filter bank: part 3 */
201
202 b=bo_start;
203 for(block=0;block<nb_blocks;block++) {
204 b++;
205 if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
206 if(b & 1) {
207 b0 = buf[0] + b - (FIR_SIZE-1) + 8*FIR_BUFFER_SIZE;
208 } else {
209 b0 = buf[1] + b - (FIR_SIZE-1) + 8*FIR_BUFFER_SIZE;
210 }
211
212 FIR16_2(8,-3,40,-18,500,-582,2398,-5732,18042,12963,17,1977,353,247,56,14,0,
213 24,0,-14,56,-247,353,-1977,17,-12963,18042,5732,2398,582,500,18,40,3);
214 FIR16_2(9,-2,38,-9,490,-501,2437,-5297,17855,13383,-249,2052,320,266,55,15,0,
215 23,0,-15,55,-266,320,-2052,-249,-13383,17855,5297,2437,501,490,9,38,2);
216 FIR16_2(10,-2,36,0,479,-423,2465,-4869,17647,13794,-530,2122,282,284,53,17,0,
217 22,0,-17,53,-284,282,-2122,-530,-13794,17647,4869,2465,423,479,0,36,2);
218 FIR16_2(11,-2,34,7,467,-347,2483,-4449,17419,14194,-825,2188,242,302,52,18,0,
219 21,0,-18,52,-302,242,-2188,-825,-14194,17419,4449,2483,347,467,-7,34,2);
220
221 samples+=64;
222 }
223 samples-=64*nb_blocks;
224
225 /* filter bank: part 4 */
226
227 b=bo_start;
228 for(block=0;block<nb_blocks;block++) {
229 b++;
230 if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
231 if(b & 1) {
232 b0 = buf[0] + b - (FIR_SIZE-1) + 12*FIR_BUFFER_SIZE;
233 } else {
234 b0 = buf[1] + b - (FIR_SIZE-1) + 12*FIR_BUFFER_SIZE;
235 }
236
237 FIR16_2(12,-2,33,14,454,-273,2491,-4038,17173,14583,-1133,2249,198,320,50,19,0,
238 20,0,-19,50,-320,198,-2249,-1133,-14583,17173,4038,2491,273,454,-14,33,2);
239 FIR16_2(13,-1,31,20,439,-203,2489,-3637,16907,14959,-1454,2304,151,339,47,21,-1,
240 19,-1,-21,47,-339,151,-2304,-1454,-14959,16907,3637,2489,203,439,-20,31,1);
241 FIR16_2(14,-1,29,26,424,-136,2479,-3245,16623,15322,-1788,2354,100,357,44,22,-1,
242 18,-1,-22,44,-357,100,-2354,-1788,-15322,16623,3245,2479,136,424,-26,29,1);
243 FIR16_2(15,-1,27,31,408,-72,2459,-2863,16322,15671,-2135,2396,46,374,40,24,-1,
244 17,-1,-24,40,-374,46,-2396,-2135,-15671,16322,2863,2459,72,408,-31,27,1);
245 FIR16_1(16,-1,0,36,0,-11,0,-2493,0,16004,0,2431,0,391,0,26,0);
246
247 samples+=64;
248 }
249
250 return clip;
251}
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLsizei samples
Definition: glext.h:7006
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define dct64_i486
Definition: intsym.h:145
#define c
Definition: ke_i.h:80
#define b
Definition: ke_i.h:79
struct outbuffer buffer
Definition: frame.h:267
#define FIR16_1(pos, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15)
Definition: synth_i486.c:27
#define FIR16_2(pos1, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, pos2, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15)
Definition: synth_i486.c:41
static unsigned int block
Definition: xmlmemory.c:101

◆ dct36()

void dct36 ( real inbuf,
real o1,
real o2,
real wintab,
real tsbuf 
)

Definition at line 1554 of file layer3.c.

1555{
1556#ifdef NEW_DCT9
1557 real tmp[18];
1558#endif
1559
1560 {
1561 register real *in = inbuf;
1562
1563 in[17]+=in[16]; in[16]+=in[15]; in[15]+=in[14];
1564 in[14]+=in[13]; in[13]+=in[12]; in[12]+=in[11];
1565 in[11]+=in[10]; in[10]+=in[9]; in[9] +=in[8];
1566 in[8] +=in[7]; in[7] +=in[6]; in[6] +=in[5];
1567 in[5] +=in[4]; in[4] +=in[3]; in[3] +=in[2];
1568 in[2] +=in[1]; in[1] +=in[0];
1569
1570 in[17]+=in[15]; in[15]+=in[13]; in[13]+=in[11]; in[11]+=in[9];
1571 in[9] +=in[7]; in[7] +=in[5]; in[5] +=in[3]; in[3] +=in[1];
1572
1573
1574#ifdef NEW_DCT9
1575#if 1
1576 {
1577 real t3;
1578 {
1579 real t0, t1, t2;
1580
1581 t0 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4]));
1582 t1 = REAL_MUL(COS6_2, in[12]);
1583
1584 t3 = in[0];
1585 t2 = t3 - t1 - t1;
1586 tmp[1] = tmp[7] = t2 - t0;
1587 tmp[4] = t2 + t0 + t0;
1588 t3 += t1;
1589
1590 t2 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2]));
1591 tmp[1] -= t2;
1592 tmp[7] += t2;
1593 }
1594 {
1595 real t0, t1, t2;
1596
1597 t0 = REAL_MUL(cos9[0], (in[4] + in[8] ));
1598 t1 = REAL_MUL(cos9[1], (in[8] - in[16]));
1599 t2 = REAL_MUL(cos9[2], (in[4] + in[16]));
1600
1601 tmp[2] = tmp[6] = t3 - t0 - t2;
1602 tmp[0] = tmp[8] = t3 + t0 + t1;
1603 tmp[3] = tmp[5] = t3 - t1 + t2;
1604 }
1605 }
1606 {
1607 real t1, t2, t3;
1608
1609 t1 = REAL_MUL(cos18[0], (in[2] + in[10]));
1610 t2 = REAL_MUL(cos18[1], (in[10] - in[14]));
1611 t3 = REAL_MUL(COS6_1, in[6]);
1612
1613 {
1614 real t0 = t1 + t2 + t3;
1615 tmp[0] += t0;
1616 tmp[8] -= t0;
1617 }
1618
1619 t2 -= t3;
1620 t1 -= t3;
1621
1622 t3 = REAL_MUL(cos18[2], (in[2] + in[14]));
1623
1624 t1 += t3;
1625 tmp[3] += t1;
1626 tmp[5] -= t1;
1627
1628 t2 -= t3;
1629 tmp[2] += t2;
1630 tmp[6] -= t2;
1631 }
1632
1633#else
1634 {
1635 real t0, t1, t2, t3, t4, t5, t6, t7;
1636
1637 t1 = REAL_MUL(COS6_2, in[12]);
1638 t2 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4]));
1639
1640 t3 = in[0] + t1;
1641 t4 = in[0] - t1 - t1;
1642 t5 = t4 - t2;
1643 tmp[4] = t4 + t2 + t2;
1644
1645 t0 = REAL_MUL(cos9[0], (in[4] + in[8]));
1646 t1 = REAL_MUL(cos9[1], (in[8] - in[16]));
1647
1648 t2 = REAL_MUL(cos9[2], (in[4] + in[16]));
1649
1650 t6 = t3 - t0 - t2;
1651 t0 += t3 + t1;
1652 t3 += t2 - t1;
1653
1654 t2 = REAL_MUL(cos18[0], (in[2] + in[10]));
1655 t4 = REAL_MUL(cos18[1], (in[10] - in[14]));
1656 t7 = REAL_MUL(COS6_1, in[6]);
1657
1658 t1 = t2 + t4 + t7;
1659 tmp[0] = t0 + t1;
1660 tmp[8] = t0 - t1;
1661 t1 = REAL_MUL(cos18[2], (in[2] + in[14]));
1662 t2 += t1 - t7;
1663
1664 tmp[3] = t3 + t2;
1665 t0 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2]));
1666 tmp[5] = t3 - t2;
1667
1668 t4 -= t1 + t7;
1669
1670 tmp[1] = t5 - t0;
1671 tmp[7] = t5 + t0;
1672 tmp[2] = t6 + t4;
1673 tmp[6] = t6 - t4;
1674 }
1675#endif
1676
1677 {
1678 real t0, t1, t2, t3, t4, t5, t6, t7;
1679
1680 t1 = REAL_MUL(COS6_2, in[13]);
1681 t2 = REAL_MUL(COS6_2, (in[9] + in[17] - in[5]));
1682
1683 t3 = in[1] + t1;
1684 t4 = in[1] - t1 - t1;
1685 t5 = t4 - t2;
1686
1687 t0 = REAL_MUL(cos9[0], (in[5] + in[9]));
1688 t1 = REAL_MUL(cos9[1], (in[9] - in[17]));
1689
1690 tmp[13] = REAL_MUL((t4 + t2 + t2), tfcos36[17-13]);
1691 t2 = REAL_MUL(cos9[2], (in[5] + in[17]));
1692
1693 t6 = t3 - t0 - t2;
1694 t0 += t3 + t1;
1695 t3 += t2 - t1;
1696
1697 t2 = REAL_MUL(cos18[0], (in[3] + in[11]));
1698 t4 = REAL_MUL(cos18[1], (in[11] - in[15]));
1699 t7 = REAL_MUL(COS6_1, in[7]);
1700
1701 t1 = t2 + t4 + t7;
1702 tmp[17] = REAL_MUL((t0 + t1), tfcos36[17-17]);
1703 tmp[9] = REAL_MUL((t0 - t1), tfcos36[17-9]);
1704 t1 = REAL_MUL(cos18[2], (in[3] + in[15]));
1705 t2 += t1 - t7;
1706
1707 tmp[14] = REAL_MUL((t3 + t2), tfcos36[17-14]);
1708 t0 = REAL_MUL(COS6_1, (in[11] + in[15] - in[3]));
1709 tmp[12] = REAL_MUL((t3 - t2), tfcos36[17-12]);
1710
1711 t4 -= t1 + t7;
1712
1713 tmp[16] = REAL_MUL((t5 - t0), tfcos36[17-16]);
1714 tmp[10] = REAL_MUL((t5 + t0), tfcos36[17-10]);
1715 tmp[15] = REAL_MUL((t6 + t4), tfcos36[17-15]);
1716 tmp[11] = REAL_MUL((t6 - t4), tfcos36[17-11]);
1717 }
1718
1719#define MACRO(v) { \
1720 real tmpval; \
1721 tmpval = tmp[(v)] + tmp[17-(v)]; \
1722 out2[9+(v)] = REAL_MUL(tmpval, w[27+(v)]); \
1723 out2[8-(v)] = REAL_MUL(tmpval, w[26-(v)]); \
1724 tmpval = tmp[(v)] - tmp[17-(v)]; \
1725 ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(tmpval, w[8-(v)]); \
1726 ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(tmpval, w[9+(v)]); }
1727
1728 {
1729 register real *out2 = o2;
1730 register real *w = wintab;
1731 register real *out1 = o1;
1732 register real *ts = tsbuf;
1733
1734 MACRO(0);
1735 MACRO(1);
1736 MACRO(2);
1737 MACRO(3);
1738 MACRO(4);
1739 MACRO(5);
1740 MACRO(6);
1741 MACRO(7);
1742 MACRO(8);
1743 }
1744
1745#else
1746
1747 {
1748
1749#define MACRO0(v) { \
1750 real tmp; \
1751 out2[9+(v)] = REAL_MUL((tmp = sum0 + sum1), w[27+(v)]); \
1752 out2[8-(v)] = REAL_MUL(tmp, w[26-(v)]); } \
1753 sum0 -= sum1; \
1754 ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(sum0, w[8-(v)]); \
1755 ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(sum0, w[9+(v)]);
1756#define MACRO1(v) { \
1757 real sum0,sum1; \
1758 sum0 = tmp1a + tmp2a; \
1759 sum1 = REAL_MUL((tmp1b + tmp2b), tfcos36[(v)]); \
1760 MACRO0(v); }
1761#define MACRO2(v) { \
1762 real sum0,sum1; \
1763 sum0 = tmp2a - tmp1a; \
1764 sum1 = REAL_MUL((tmp2b - tmp1b), tfcos36[(v)]); \
1765 MACRO0(v); }
1766
1767 register const real *c = COS9;
1768 register real *out2 = o2;
1769 register real *w = wintab;
1770 register real *out1 = o1;
1771 register real *ts = tsbuf;
1772
1773 real ta33,ta66,tb33,tb66;
1774
1775 ta33 = REAL_MUL(in[2*3+0], c[3]);
1776 ta66 = REAL_MUL(in[2*6+0], c[6]);
1777 tb33 = REAL_MUL(in[2*3+1], c[3]);
1778 tb66 = REAL_MUL(in[2*6+1], c[6]);
1779
1780 {
1781 real tmp1a,tmp2a,tmp1b,tmp2b;
1782 tmp1a = REAL_MUL(in[2*1+0], c[1]) + ta33 + REAL_MUL(in[2*5+0], c[5]) + REAL_MUL(in[2*7+0], c[7]);
1783 tmp1b = REAL_MUL(in[2*1+1], c[1]) + tb33 + REAL_MUL(in[2*5+1], c[5]) + REAL_MUL(in[2*7+1], c[7]);
1784 tmp2a = REAL_MUL(in[2*2+0], c[2]) + REAL_MUL(in[2*4+0], c[4]) + ta66 + REAL_MUL(in[2*8+0], c[8]);
1785 tmp2b = REAL_MUL(in[2*2+1], c[2]) + REAL_MUL(in[2*4+1], c[4]) + tb66 + REAL_MUL(in[2*8+1], c[8]);
1786
1787 MACRO1(0);
1788 MACRO2(8);
1789 }
1790
1791 {
1792 real tmp1a,tmp2a,tmp1b,tmp2b;
1793 tmp1a = REAL_MUL(( in[2*1+0] - in[2*5+0] - in[2*7+0] ), c[3]);
1794 tmp1b = REAL_MUL(( in[2*1+1] - in[2*5+1] - in[2*7+1] ), c[3]);
1795 tmp2a = REAL_MUL(( in[2*2+0] - in[2*4+0] - in[2*8+0] ), c[6]) - in[2*6+0] + in[2*0+0];
1796 tmp2b = REAL_MUL(( in[2*2+1] - in[2*4+1] - in[2*8+1] ), c[6]) - in[2*6+1] + in[2*0+1];
1797
1798 MACRO1(1);
1799 MACRO2(7);
1800 }
1801
1802 {
1803 real tmp1a,tmp2a,tmp1b,tmp2b;
1804 tmp1a = REAL_MUL(in[2*1+0], c[5]) - ta33 - REAL_MUL(in[2*5+0], c[7]) + REAL_MUL(in[2*7+0], c[1]);
1805 tmp1b = REAL_MUL(in[2*1+1], c[5]) - tb33 - REAL_MUL(in[2*5+1], c[7]) + REAL_MUL(in[2*7+1], c[1]);
1806 tmp2a = - REAL_MUL(in[2*2+0], c[8]) - REAL_MUL(in[2*4+0], c[2]) + ta66 + REAL_MUL(in[2*8+0], c[4]);
1807 tmp2b = - REAL_MUL(in[2*2+1], c[8]) - REAL_MUL(in[2*4+1], c[2]) + tb66 + REAL_MUL(in[2*8+1], c[4]);
1808
1809 MACRO1(2);
1810 MACRO2(6);
1811 }
1812
1813 {
1814 real tmp1a,tmp2a,tmp1b,tmp2b;
1815 tmp1a = REAL_MUL(in[2*1+0], c[7]) - ta33 + REAL_MUL(in[2*5+0], c[1]) - REAL_MUL(in[2*7+0], c[5]);
1816 tmp1b = REAL_MUL(in[2*1+1], c[7]) - tb33 + REAL_MUL(in[2*5+1], c[1]) - REAL_MUL(in[2*7+1], c[5]);
1817 tmp2a = - REAL_MUL(in[2*2+0], c[4]) + REAL_MUL(in[2*4+0], c[8]) + ta66 - REAL_MUL(in[2*8+0], c[2]);
1818 tmp2b = - REAL_MUL(in[2*2+1], c[4]) + REAL_MUL(in[2*4+1], c[8]) + tb66 - REAL_MUL(in[2*8+1], c[2]);
1819
1820 MACRO1(3);
1821 MACRO2(5);
1822 }
1823
1824 {
1825 real sum0,sum1;
1826 sum0 = in[2*0+0] - in[2*2+0] + in[2*4+0] - in[2*6+0] + in[2*8+0];
1827 sum1 = REAL_MUL((in[2*0+1] - in[2*2+1] + in[2*4+1] - in[2*6+1] + in[2*8+1] ), tfcos36[4]);
1828 MACRO0(4);
1829 }
1830 }
1831#endif
1832
1833 }
1834}
static int inbuf
Definition: adnsresfilter.c:73
GLuint in
Definition: glext.h:9616
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define tfcos36
Definition: intsym.h:7
#define COS9
Definition: intsym.h:6
static real COS6_2
static real COS6_1
#define MACRO(v)
#define REAL_MUL(x, y)
#define real

◆ dct36_3dnow()

void dct36_3dnow ( real ,
real ,
real ,
real ,
real  
)

◆ dct36_3dnowext()

void dct36_3dnowext ( real ,
real ,
real ,
real ,
real  
)

◆ dct36_avx()

void dct36_avx ( real ,
real ,
real ,
real ,
real  
)

◆ dct36_neon()

void dct36_neon ( real ,
real ,
real ,
real ,
real  
)

◆ dct36_neon64()

void dct36_neon64 ( real ,
real ,
real ,
real ,
real  
)

◆ dct36_sse()

void dct36_sse ( real ,
real ,
real ,
real ,
real  
)

◆ dct36_x86_64()

void dct36_x86_64 ( real ,
real ,
real ,
real ,
real  
)

◆ dct64()

void dct64 ( real out0,
real out1,
real samples 
)

Definition at line 22 of file dct64.c.

23{
24 real bufs[64];
25
26 {
27 register int i,j;
28 register real *b1,*b2,*bs,*costab;
29
30 b1 = samples;
31 bs = bufs;
32 costab = pnts[0]+16;
33 b2 = b1 + 32;
34
35 for(i=15;i>=0;i--)
36 *bs++ = (*b1++ + *--b2);
37 for(i=15;i>=0;i--)
38 *bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
39
40 b1 = bufs;
41 costab = pnts[1]+8;
42 b2 = b1 + 16;
43
44 {
45 for(i=7;i>=0;i--)
46 *bs++ = (*b1++ + *--b2);
47 for(i=7;i>=0;i--)
48 *bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
49 b2 += 32;
50 costab += 8;
51 for(i=7;i>=0;i--)
52 *bs++ = (*b1++ + *--b2);
53 for(i=7;i>=0;i--)
54 *bs++ = REAL_MUL((*b1++ - *--b2), *--costab);
55 b2 += 32;
56 }
57
58 bs = bufs;
59 costab = pnts[2];
60 b2 = b1 + 8;
61
62 for(j=2;j;j--)
63 {
64 for(i=3;i>=0;i--)
65 *bs++ = (*b1++ + *--b2);
66 for(i=3;i>=0;i--)
67 *bs++ = REAL_MUL((*--b2 - *b1++), costab[i]);
68 b2 += 16;
69 for(i=3;i>=0;i--)
70 *bs++ = (*b1++ + *--b2);
71 for(i=3;i>=0;i--)
72 *bs++ = REAL_MUL((*b1++ - *--b2), costab[i]);
73 b2 += 16;
74 }
75
76 b1 = bufs;
77 costab = pnts[3];
78 b2 = b1 + 4;
79
80 for(j=4;j;j--)
81 {
82 *bs++ = (*b1++ + *--b2);
83 *bs++ = (*b1++ + *--b2);
84 *bs++ = REAL_MUL((*--b2 - *b1++), costab[1]);
85 *bs++ = REAL_MUL((*--b2 - *b1++), costab[0]);
86 b2 += 8;
87 *bs++ = (*b1++ + *--b2);
88 *bs++ = (*b1++ + *--b2);
89 *bs++ = REAL_MUL((*b1++ - *--b2), costab[1]);
90 *bs++ = REAL_MUL((*b1++ - *--b2), costab[0]);
91 b2 += 8;
92 }
93 bs = bufs;
94 costab = pnts[4];
95
96 for(j=8;j;j--)
97 {
98 real v0,v1;
99 v0=*b1++; v1 = *b1++;
100 *bs++ = (v0 + v1);
101 *bs++ = REAL_MUL((v0 - v1), (*costab));
102 v0=*b1++; v1 = *b1++;
103 *bs++ = (v0 + v1);
104 *bs++ = REAL_MUL((v1 - v0), (*costab));
105 }
106
107 }
108
109
110 {
111 register real *b1;
112 register int i;
113
114 for(b1=bufs,i=8;i;i--,b1+=4)
115 b1[2] += b1[3];
116
117 for(b1=bufs,i=4;i;i--,b1+=8)
118 {
119 b1[4] += b1[6];
120 b1[6] += b1[5];
121 b1[5] += b1[7];
122 }
123
124 for(b1=bufs,i=2;i;i--,b1+=16)
125 {
126 b1[8] += b1[12];
127 b1[12] += b1[10];
128 b1[10] += b1[14];
129 b1[14] += b1[9];
130 b1[9] += b1[13];
131 b1[13] += b1[11];
132 b1[11] += b1[15];
133 }
134 }
135
136
137 out0[0x10*16] = REAL_SCALE_DCT64(bufs[0]);
138 out0[0x10*15] = REAL_SCALE_DCT64(bufs[16+0] + bufs[16+8]);
139 out0[0x10*14] = REAL_SCALE_DCT64(bufs[8]);
140 out0[0x10*13] = REAL_SCALE_DCT64(bufs[16+8] + bufs[16+4]);
141 out0[0x10*12] = REAL_SCALE_DCT64(bufs[4]);
142 out0[0x10*11] = REAL_SCALE_DCT64(bufs[16+4] + bufs[16+12]);
143 out0[0x10*10] = REAL_SCALE_DCT64(bufs[12]);
144 out0[0x10* 9] = REAL_SCALE_DCT64(bufs[16+12] + bufs[16+2]);
145 out0[0x10* 8] = REAL_SCALE_DCT64(bufs[2]);
146 out0[0x10* 7] = REAL_SCALE_DCT64(bufs[16+2] + bufs[16+10]);
147 out0[0x10* 6] = REAL_SCALE_DCT64(bufs[10]);
148 out0[0x10* 5] = REAL_SCALE_DCT64(bufs[16+10] + bufs[16+6]);
149 out0[0x10* 4] = REAL_SCALE_DCT64(bufs[6]);
150 out0[0x10* 3] = REAL_SCALE_DCT64(bufs[16+6] + bufs[16+14]);
151 out0[0x10* 2] = REAL_SCALE_DCT64(bufs[14]);
152 out0[0x10* 1] = REAL_SCALE_DCT64(bufs[16+14] + bufs[16+1]);
153 out0[0x10* 0] = REAL_SCALE_DCT64(bufs[1]);
154
155 out1[0x10* 0] = REAL_SCALE_DCT64(bufs[1]);
156 out1[0x10* 1] = REAL_SCALE_DCT64(bufs[16+1] + bufs[16+9]);
157 out1[0x10* 2] = REAL_SCALE_DCT64(bufs[9]);
158 out1[0x10* 3] = REAL_SCALE_DCT64(bufs[16+9] + bufs[16+5]);
159 out1[0x10* 4] = REAL_SCALE_DCT64(bufs[5]);
160 out1[0x10* 5] = REAL_SCALE_DCT64(bufs[16+5] + bufs[16+13]);
161 out1[0x10* 6] = REAL_SCALE_DCT64(bufs[13]);
162 out1[0x10* 7] = REAL_SCALE_DCT64(bufs[16+13] + bufs[16+3]);
163 out1[0x10* 8] = REAL_SCALE_DCT64(bufs[3]);
164 out1[0x10* 9] = REAL_SCALE_DCT64(bufs[16+3] + bufs[16+11]);
165 out1[0x10*10] = REAL_SCALE_DCT64(bufs[11]);
166 out1[0x10*11] = REAL_SCALE_DCT64(bufs[16+11] + bufs[16+7]);
167 out1[0x10*12] = REAL_SCALE_DCT64(bufs[7]);
168 out1[0x10*13] = REAL_SCALE_DCT64(bufs[16+7] + bufs[16+15]);
169 out1[0x10*14] = REAL_SCALE_DCT64(bufs[15]);
170 out1[0x10*15] = REAL_SCALE_DCT64(bufs[16+15]);
171
172}
const GLenum * bufs
Definition: glext.h:6026
GLfloat v0
Definition: glext.h:6061
GLfloat GLfloat v1
Definition: glext.h:6062
#define pnts
Definition: intsym.h:8
static struct msdos_boot_sector bs
Definition: mkdosfs.c:539
static CRYPT_DATA_BLOB b2[]
Definition: msg.c:582
static CRYPT_DATA_BLOB b1[]
Definition: msg.c:573
#define REAL_SCALE_DCT64(x)

◆ dct64_altivec()

void dct64_altivec ( real out0,
real out1,
real samples 
)

Definition at line 27 of file dct64_altivec.c.

28{
29 ALIGNED(16) real bufs[32];
30
31 {
32 register real *b1,*costab;
33
34 vector unsigned char vinvert,vperm1,vperm2,vperm3,vperm4;
35 vector float v1,v2,v3,v4,v5,v6,v7,v8;
36 vector float vbs1,vbs2,vbs3,vbs4,vbs5,vbs6,vbs7,vbs8;
37 vector float vbs9,vbs10,vbs11,vbs12,vbs13,vbs14,vbs15,vbs16;
38 vector float vzero;
39 b1 = samples;
40 costab = pnts[0];
41
42 vzero = vec_xor(vzero,vzero);
43#ifdef __APPLE__
44 vinvert = (vector unsigned char)(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3);
45#else
46 vinvert = (vector unsigned char){12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3};
47#endif
48 vperm1 = vec_lvsl(0,b1);
49 vperm2 = vec_perm(vperm1,vperm1,vinvert);
50
51 v1 = vec_ld(0,b1);
52 v2 = vec_ld(16,b1);
53 v3 = vec_ld(112,b1);
54 v4 = vec_ld(127,b1);
55 v5 = vec_perm(v1,v2,vperm1); /* b1[0,1,2,3] */
56 v6 = vec_perm(v3,v4,vperm2); /* b1[31,30,29,28] */
57
58 vbs1 = vec_add(v5,v6);
59 vbs8 = vec_sub(v5,v6);
60
61 v1 = vec_ld(32,b1);
62 v4 = vec_ld(96,b1);
63 v5 = vec_perm(v2,v1,vperm1); /* b1[4,5,6,7] */
64 v6 = vec_perm(v4,v3,vperm2); /* b1[27,26,25,24] */
65
66 vbs2 = vec_add(v5,v6);
67 vbs7 = vec_sub(v5,v6);
68
69 v2 = vec_ld(48,b1);
70 v3 = vec_ld(80,b1);
71 v5 = vec_perm(v1,v2,vperm1); /* b1[8,9,10,11] */
72 v6 = vec_perm(v3,v4,vperm2); /* b1[23,22,21,20] */
73
74 vbs3 = vec_add(v5,v6);
75 vbs6 = vec_sub(v5,v6);
76
77 v1 = vec_ld(64,b1);
78 v5 = vec_perm(v2,v1,vperm1); /* b1[12,13,14,15] */
79 v6 = vec_perm(v1,v3,vperm2); /* b1[19,18,17,16] */
80
81 vbs4 = vec_add(v5,v6);
82 vbs5 = vec_sub(v5,v6);
83
84 v1 = vec_ld(0,costab);
85 vbs8 = vec_madd(vbs8,v1,vzero);
86 v2 = vec_ld(16,costab);
87 vbs7 = vec_madd(vbs7,v2,vzero);
88 v3 = vec_ld(32,costab);
89 vbs6 = vec_madd(vbs6,v3,vzero);
90 v4 = vec_ld(48,costab);
91 vbs5 = vec_madd(vbs5,v4,vzero);
92 vbs6 = vec_perm(vbs6,vbs6,vinvert);
93 vbs5 = vec_perm(vbs5,vbs5,vinvert);
94
95
96 costab = pnts[1];
97
98 v1 = vec_perm(vbs4,vbs4,vinvert);
99 vbs9 = vec_add(vbs1,v1);
100 v3 = vec_sub(vbs1,v1);
101 v5 = vec_ld(0,costab);
102 v2 = vec_perm(vbs3,vbs3,vinvert);
103 vbs10 = vec_add(vbs2,v2);
104 v4 = vec_sub(vbs2,v2);
105 v6 = vec_ld(16,costab);
106 vbs12 = vec_madd(v3,v5,vzero);
107 vbs11 = vec_madd(v4,v6,vzero);
108
109 v7 = vec_sub(vbs7,vbs6);
110 v8 = vec_sub(vbs8,vbs5);
111 vbs13 = vec_add(vbs5,vbs8);
112 vbs14 = vec_add(vbs6,vbs7);
113 vbs15 = vec_madd(v7,v6,vzero);
114 vbs16 = vec_madd(v8,v5,vzero);
115
116
117 costab = pnts[2];
118
119 v1 = vec_perm(vbs10,vbs10,vinvert);
120 v5 = vec_perm(vbs14,vbs14,vinvert);
121 vbs1 = vec_add(v1,vbs9);
122 vbs5 = vec_add(v5,vbs13);
123 v2 = vec_sub(vbs9,v1);
124 v6 = vec_sub(vbs13,v5);
125 v3 = vec_ld(0,costab);
126 vbs11 = vec_perm(vbs11,vbs11,vinvert);
127 vbs15 = vec_perm(vbs15,vbs15,vinvert);
128 vbs3 = vec_add(vbs11,vbs12);
129 vbs7 = vec_add(vbs15,vbs16);
130 v4 = vec_sub(vbs12,vbs11);
131 v7 = vec_sub(vbs16,vbs15);
132 vbs2 = vec_madd(v2,v3,vzero);
133 vbs4 = vec_madd(v4,v3,vzero);
134 vbs6 = vec_madd(v6,v3,vzero);
135 vbs8 = vec_madd(v7,v3,vzero);
136
137 vbs2 = vec_perm(vbs2,vbs2,vinvert);
138 vbs4 = vec_perm(vbs4,vbs4,vinvert);
139 vbs6 = vec_perm(vbs6,vbs6,vinvert);
140 vbs8 = vec_perm(vbs8,vbs8,vinvert);
141
142
143 costab = pnts[3];
144
145#ifdef __APPLE__
146 vperm1 = (vector unsigned char)(0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);
147 vperm2 = (vector unsigned char)(12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27);
148 vperm3 = (vector unsigned char)(0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19);
149#else
150 vperm1 = (vector unsigned char){0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23};
151 vperm2 = (vector unsigned char){12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27};
152 vperm3 = (vector unsigned char){0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19};
153#endif
154 vperm4 = vec_add(vperm3,vec_splat_u8(8));
155
156 v1 = vec_ld(0,costab);
157 v2 = vec_splat(v1,0);
158 v3 = vec_splat(v1,1);
159 v1 = vec_mergeh(v2,v3);
160
161 v2 = vec_perm(vbs1,vbs3,vperm1);
162 v3 = vec_perm(vbs2,vbs4,vperm1);
163 v4 = vec_perm(vbs1,vbs3,vperm2);
164 v5 = vec_perm(vbs2,vbs4,vperm2);
165 v6 = vec_sub(v2,v4);
166 v7 = vec_sub(v3,v5);
167 v2 = vec_add(v2,v4);
168 v3 = vec_add(v3,v5);
169 v4 = vec_madd(v6,v1,vzero);
170 v5 = vec_nmsub(v7,v1,vzero);
171 vbs9 = vec_perm(v2,v4,vperm3);
172 vbs11 = vec_perm(v2,v4,vperm4);
173 vbs10 = vec_perm(v3,v5,vperm3);
174 vbs12 = vec_perm(v3,v5,vperm4);
175
176 v2 = vec_perm(vbs5,vbs7,vperm1);
177 v3 = vec_perm(vbs6,vbs8,vperm1);
178 v4 = vec_perm(vbs5,vbs7,vperm2);
179 v5 = vec_perm(vbs6,vbs8,vperm2);
180 v6 = vec_sub(v2,v4);
181 v7 = vec_sub(v3,v5);
182 v2 = vec_add(v2,v4);
183 v3 = vec_add(v3,v5);
184 v4 = vec_madd(v6,v1,vzero);
185 v5 = vec_nmsub(v7,v1,vzero);
186 vbs13 = vec_perm(v2,v4,vperm3);
187 vbs15 = vec_perm(v2,v4,vperm4);
188 vbs14 = vec_perm(v3,v5,vperm3);
189 vbs16 = vec_perm(v3,v5,vperm4);
190
191
192 costab = pnts[4];
193
194 v1 = vec_lde(0,costab);
195#ifdef __APPLE__
196 v2 = (vector float)(1.0f,-1.0f,1.0f,-1.0f);
197#else
198 v2 = (vector float){1.0f,-1.0f,1.0f,-1.0f};
199#endif
200 v3 = vec_splat(v1,0);
201 v1 = vec_madd(v2,v3,vzero);
202
203 v2 = vec_mergeh(vbs9,vbs10);
204 v3 = vec_mergel(vbs9,vbs10);
205 v4 = vec_mergeh(vbs11,vbs12);
206 v5 = vec_mergel(vbs11,vbs12);
207 v6 = vec_mergeh(v2,v3);
208 v7 = vec_mergel(v2,v3);
209 v2 = vec_mergeh(v4,v5);
210 v3 = vec_mergel(v4,v5);
211 v4 = vec_sub(v6,v7);
212 v5 = vec_sub(v2,v3);
213 v6 = vec_add(v6,v7);
214 v7 = vec_add(v2,v3);
215 v2 = vec_madd(v4,v1,vzero);
216 v3 = vec_madd(v5,v1,vzero);
217 vbs1 = vec_mergeh(v6,v2);
218 vbs2 = vec_mergel(v6,v2);
219 vbs3 = vec_mergeh(v7,v3);
220 vbs4 = vec_mergel(v7,v3);
221
222 v2 = vec_mergeh(vbs13,vbs14);
223 v3 = vec_mergel(vbs13,vbs14);
224 v4 = vec_mergeh(vbs15,vbs16);
225 v5 = vec_mergel(vbs15,vbs16);
226 v6 = vec_mergeh(v2,v3);
227 v7 = vec_mergel(v2,v3);
228 v2 = vec_mergeh(v4,v5);
229 v3 = vec_mergel(v4,v5);
230 v4 = vec_sub(v6,v7);
231 v5 = vec_sub(v2,v3);
232 v6 = vec_add(v6,v7);
233 v7 = vec_add(v2,v3);
234 v2 = vec_madd(v4,v1,vzero);
235 v3 = vec_madd(v5,v1,vzero);
236 vbs5 = vec_mergeh(v6,v2);
237 vbs6 = vec_mergel(v6,v2);
238 vbs7 = vec_mergeh(v7,v3);
239 vbs8 = vec_mergel(v7,v3);
240
241 vec_st(vbs1,0,bufs);
242 vec_st(vbs2,16,bufs);
243 vec_st(vbs3,32,bufs);
244 vec_st(vbs4,48,bufs);
245 vec_st(vbs5,64,bufs);
246 vec_st(vbs6,80,bufs);
247 vec_st(vbs7,96,bufs);
248 vec_st(vbs8,112,bufs);
249 }
250
251 {
252 register real *b1;
253 register int i;
254
255 for(b1=bufs,i=8;i;i--,b1+=4)
256 b1[2] += b1[3];
257
258 for(b1=bufs,i=4;i;i--,b1+=8)
259 {
260 b1[4] += b1[6];
261 b1[6] += b1[5];
262 b1[5] += b1[7];
263 }
264
265 for(b1=bufs,i=2;i;i--,b1+=16)
266 {
267 b1[8] += b1[12];
268 b1[12] += b1[10];
269 b1[10] += b1[14];
270 b1[14] += b1[9];
271 b1[9] += b1[13];
272 b1[13] += b1[11];
273 b1[11] += b1[15];
274 }
275 }
276
277
278 out0[0x10*16] = bufs[0];
279 out0[0x10*15] = bufs[16+0] + bufs[16+8];
280 out0[0x10*14] = bufs[8];
281 out0[0x10*13] = bufs[16+8] + bufs[16+4];
282 out0[0x10*12] = bufs[4];
283 out0[0x10*11] = bufs[16+4] + bufs[16+12];
284 out0[0x10*10] = bufs[12];
285 out0[0x10* 9] = bufs[16+12] + bufs[16+2];
286 out0[0x10* 8] = bufs[2];
287 out0[0x10* 7] = bufs[16+2] + bufs[16+10];
288 out0[0x10* 6] = bufs[10];
289 out0[0x10* 5] = bufs[16+10] + bufs[16+6];
290 out0[0x10* 4] = bufs[6];
291 out0[0x10* 3] = bufs[16+6] + bufs[16+14];
292 out0[0x10* 2] = bufs[14];
293 out0[0x10* 1] = bufs[16+14] + bufs[16+1];
294 out0[0x10* 0] = bufs[1];
295
296 out1[0x10* 0] = bufs[1];
297 out1[0x10* 1] = bufs[16+1] + bufs[16+9];
298 out1[0x10* 2] = bufs[9];
299 out1[0x10* 3] = bufs[16+9] + bufs[16+5];
300 out1[0x10* 4] = bufs[5];
301 out1[0x10* 5] = bufs[16+5] + bufs[16+13];
302 out1[0x10* 6] = bufs[13];
303 out1[0x10* 7] = bufs[16+13] + bufs[16+3];
304 out1[0x10* 8] = bufs[3];
305 out1[0x10* 9] = bufs[16+3] + bufs[16+11];
306 out1[0x10*10] = bufs[11];
307 out1[0x10*11] = bufs[16+11] + bufs[16+7];
308 out1[0x10*12] = bufs[7];
309 out1[0x10*13] = bufs[16+7] + bufs[16+15];
310 out1[0x10*14] = bufs[15];
311 out1[0x10*15] = bufs[16+15];
312
313}
unsigned char
Definition: typeof.h:29
GLfloat GLfloat GLfloat GLfloat v3
Definition: glext.h:6064
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
static float(__cdecl *square_half_float)(float x
#define ALIGNED(a)
Definition: optimize.h:190

◆ dct64_i386()

void dct64_i386 ( real a,
real b,
real c 
)

Definition at line 331 of file dct64_i386.c.

332{
333 real bufs[0x40];
334 dct64_1(a,b,bufs,bufs+0x20,c);
335}
static void dct64_1(real *out0, real *out1, real *b1, real *b2, real *samples)
Definition: dct64_i386.c:19
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ dct64_i486()

void dct64_i486 ( int a,
int b,
real samples 
)

Definition at line 320 of file dct64_i486.c.

321{
322 int bufs[64];
323 int i;
324
325#ifdef REAL_IS_FIXED
326#define TOINT(a) ((a) * 32768 / (int)REAL_FACTOR)
327
328 for(i=0;i<32;i++) {
329 bufs[i]=TOINT(samples[i]);
330 }
331#else
332 int *p = bufs;
333 register double const scale = ((65536.0 * 32) + 1) * 65536.0;
334
335 for(i=0;i<32;i++) {
336 *((double *) (p++)) = scale + *samples++; /* beware on bufs overrun: 8B store from x87 */
337 }
338#endif
339
340 dct64_1_486(a,b,bufs+32,bufs);
341}
void dct64_1_486(int *out0, int *out1, int *b1, int *b2)
Definition: dct64_i486.c:67
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032

◆ do_equalizer()

void do_equalizer ( real bandPtr,
int  channel,
real  equalizer[2][32] 
)

Definition at line 12 of file equalizer.c.

13{
14 int i;
15 for(i=0;i<32;i++)
16 bandPtr[i] = REAL_MUL(bandPtr[i], equalizer[channel][i]);
17}

◆ do_layer1()

int do_layer1 ( mpg123_handle fr)

Definition at line 211 of file layer1.c.

212{
213 int clip=0;
214 int i,stereo = fr->stereo;
215 unsigned int balloc[2*SBLIMIT];
216 unsigned int scale_index[2][SBLIMIT];
217 real (*fraction)[SBLIMIT] = fr->layer1.fraction; /* fraction[2][SBLIMIT] */
218 int single = fr->single;
219
220 fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : 32;
221
222 if(stereo == 1 || single == SINGLE_MIX) /* I don't see mixing handled here */
224
225 if(I_step_one(balloc,scale_index,fr))
226 {
227 if(NOQUIET)
228 error("Aborting layer I decoding after step one.");
229 return clip;
230 }
231
232 for(i=0;i<SCALE_BLOCK;i++)
233 {
234 if(I_step_two(fraction,balloc,scale_index,fr))
235 {
236 if(NOQUIET)
237 error("Aborting layer I decoding after step two.");
238 return clip;
239 }
240
241 if(single != SINGLE_STEREO)
242 clip += (fr->synth_mono)(fraction[single], fr);
243 else
244 clip += (fr->synth_stereo)(fraction[0], fraction[1], fr);
245 }
246
247 return clip;
248}
#define SINGLE_LEFT
Definition: frame.h:189
#define SINGLE_STEREO
Definition: frame.h:188
#define SINGLE_MIX
Definition: frame.h:191
static int I_step_two(real fraction[2][SBLIMIT], unsigned int balloc[2 *SBLIMIT], unsigned int scale_index[2][SBLIMIT], mpg123_handle *fr)
Definition: layer1.c:118
static int I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT], mpg123_handle *fr)
Definition: layer1.c:45
#define error(str)
Definition: mkdosfs.c:1605
#define SBLIMIT
#define NOQUIET
#define MPG_MD_JOINT_STEREO
#define SCALE_BLOCK
float single
Definition: msinkaut.idl:29
func_synth_mono synth_mono
Definition: frame.h:182
func_synth_stereo synth_stereo
Definition: frame.h:181
struct mpg123_handle_struct::@3463 layer1

◆ do_layer2()

int do_layer2 ( mpg123_handle fr)

Definition at line 369 of file layer2.c.

370{
371 int clip=0;
372 int i,j;
373 int stereo = fr->stereo;
374 /* pick_table clears unused subbands */
375 /* replacement for real fraction[2][4][SBLIMIT], needs alignment. */
376 real (*fraction)[4][SBLIMIT] = fr->layer2.fraction;
377 unsigned int bit_alloc[64];
378 int scale[192];
379 int single = fr->single;
380
381 II_select_table(fr);
382 fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit;
383
384 if(fr->jsbound > fr->II_sblimit)
385 {
386 fprintf(stderr, "Truncating stereo boundary to sideband limit.\n");
387 fr->jsbound=fr->II_sblimit;
388 }
389
390 /* TODO: What happens with mono mixing, actually? */
391 if(stereo == 1 || single == SINGLE_MIX) /* also, mix not really handled */
393
394 if(II_step_one(bit_alloc, scale, fr))
395 {
396 if(NOQUIET)
397 error("first step of layer I decoding failed");
398 return clip;
399 }
400
401 for(i=0;i<SCALE_BLOCK;i++)
402 {
403 II_step_two(bit_alloc,fraction,scale,fr,i>>2);
404 if(fr->bits_avail < 0)
405 {
406 if(NOQUIET)
407 error("missing bits in layer II step two");
408 return clip;
409 }
410 for(j=0;j<3;j++)
411 {
412 if(single != SINGLE_STEREO)
413 clip += (fr->synth_mono)(fraction[single][j], fr);
414 else
415 clip += (fr->synth_stereo)(fraction[0][j], fraction[1][j], fr);
416 }
417 }
418
419 return clip;
420}
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
static int II_step_one(unsigned int *bit_alloc, int *scale, mpg123_handle *fr)
Definition: layer2.c:117
static void II_select_table(mpg123_handle *fr)
Definition: layer2.c:336
static void II_step_two(unsigned int *bit_alloc, real fraction[2][4][SBLIMIT], int *scale, mpg123_handle *fr, int x1)
Definition: layer2.c:230
struct mpg123_handle_struct::@3464 layer2

◆ do_layer3()

int do_layer3 ( mpg123_handle fr)

Definition at line 2099 of file layer3.c.

2100{
2101 int gr, ch, ss,clip=0;
2102 int scalefacs[2][39]; /* max 39 for short[13][3] mode, mixed: 38, long: 22 */
2103 struct III_sideinfo sideinfo;
2104 int stereo = fr->stereo;
2105 int single = fr->single;
2106 int ms_stereo,i_stereo;
2107 int sfreq = fr->sampling_frequency;
2108 int stereo1,granules;
2109
2110 if(stereo == 1)
2111 { /* stream is mono */
2112 stereo1 = 1;
2114 }
2115 else if(single != SINGLE_STEREO) /* stream is stereo, but force to mono */
2116 stereo1 = 1;
2117 else
2118 stereo1 = 2;
2119
2120 if(fr->mode == MPG_MD_JOINT_STEREO)
2121 {
2122 ms_stereo = (fr->mode_ext & 0x2)>>1;
2123 i_stereo = fr->mode_ext & 0x1;
2124 }
2125 else ms_stereo = i_stereo = 0;
2126
2127 granules = fr->lsf ? 1 : 2;
2128
2129 /* quick hack to keep the music playing */
2130 /* after having seen this nasty test file... */
2131 if(III_get_side_info(fr, &sideinfo,stereo,ms_stereo,sfreq,single))
2132 {
2133 if(NOQUIET) error("bad frame - unable to get valid sideinfo");
2134 return clip;
2135 }
2136
2137 set_pointer(fr, 1, sideinfo.main_data_begin);
2138#ifndef NO_MOREINFO
2139 if(fr->pinfo)
2140 {
2141 fr->pinfo->maindata = sideinfo.main_data_begin;
2142 fr->pinfo->padding = fr->padding;
2143 }
2144#endif
2145 for(gr=0;gr<granules;gr++)
2146 {
2147 /* hybridIn[2][SBLIMIT][SSLIMIT] */
2148 real (*hybridIn)[SBLIMIT][SSLIMIT] = fr->layer3.hybrid_in;
2149 /* hybridOut[2][SSLIMIT][SBLIMIT] */
2150 real (*hybridOut)[SSLIMIT][SBLIMIT] = fr->layer3.hybrid_out;
2151
2152 {
2153 struct gr_info_s *gr_info = &(sideinfo.ch[0].gr[gr]);
2154 long part2bits;
2155 if(gr_info->part2_3_length > fr->bits_avail)
2156 {
2157 if(NOQUIET)
2158 error2(
2159 "part2_3_length (%u) too large for available bit count (%li)"
2160 , gr_info->part2_3_length, fr->bits_avail );
2161 return clip;
2162 }
2163 if(fr->lsf)
2164 part2bits = III_get_scale_factors_2(fr, scalefacs[0],gr_info,0);
2165 else
2166 part2bits = III_get_scale_factors_1(fr, scalefacs[0],gr_info,0,gr);
2167
2168 if(part2bits < 0)
2169 {
2170 if(VERBOSE2)
2171 error("not enough bits for scale factors");
2172 return clip;
2173 }
2174
2175#ifndef NO_MOREINFO
2176 if(fr->pinfo)
2177 {
2178 int i;
2179 fr->pinfo->sfbits[gr][0] = part2bits;
2180 for(i=0; i<39; ++i)
2181 fr->pinfo->sfb_s[gr][0][i] = scalefacs[0][i];
2182 }
2183#endif
2184
2185 if(III_dequantize_sample(fr, hybridIn[0], scalefacs[0],gr_info,sfreq,part2bits))
2186 {
2187 if(NOQUIET)
2188 error("dequantization failed!");
2189 return clip;
2190 }
2191 if(fr->bits_avail < 0)
2192 {
2193 if(NOQUIET)
2194 error("bit deficit after dequant");
2195 return clip;
2196 }
2197 }
2198
2199 if(stereo == 2)
2200 {
2201 struct gr_info_s *gr_info = &(sideinfo.ch[1].gr[gr]);
2202 long part2bits;
2203 if(fr->lsf)
2204 part2bits = III_get_scale_factors_2(fr, scalefacs[1],gr_info,i_stereo);
2205 else
2206 part2bits = III_get_scale_factors_1(fr, scalefacs[1],gr_info,1,gr);
2207
2208 if(part2bits < 0)
2209 {
2210 if(VERBOSE2)
2211 error("not enough bits for scale factors");
2212 return clip;
2213 }
2214
2215#ifndef NO_MOREINFO
2216 if(fr->pinfo)
2217 {
2218 int i;
2219 fr->pinfo->sfbits[gr][1] = part2bits;
2220 for(i=0; i<39; ++i)
2221 fr->pinfo->sfb_s[gr][1][i] = scalefacs[1][i];
2222 }
2223#endif
2224
2225 if(III_dequantize_sample(fr, hybridIn[1],scalefacs[1],gr_info,sfreq,part2bits))
2226 {
2227 if(NOQUIET)
2228 error("dequantization failed!");
2229 return clip;
2230 }
2231 if(fr->bits_avail < 0)
2232 {
2233 if(NOQUIET)
2234 error("bit deficit after dequant");
2235 return clip;
2236 }
2237
2238 if(ms_stereo)
2239 {
2240 int i;
2241 unsigned int maxb = sideinfo.ch[0].gr[gr].maxb;
2242 if(sideinfo.ch[1].gr[gr].maxb > maxb) maxb = sideinfo.ch[1].gr[gr].maxb;
2243
2244 for(i=0;i<SSLIMIT*(int)maxb;i++)
2245 {
2246 real tmp0 = ((real *)hybridIn[0])[i];
2247 real tmp1 = ((real *)hybridIn[1])[i];
2248 ((real *)hybridIn[0])[i] = tmp0 + tmp1;
2249 ((real *)hybridIn[1])[i] = tmp0 - tmp1;
2250 }
2251 }
2252
2253 if(i_stereo) III_i_stereo(hybridIn,scalefacs[1],gr_info,sfreq,ms_stereo,fr->lsf);
2254
2255 if(ms_stereo || i_stereo || (single == SINGLE_MIX) )
2256 {
2257 if(gr_info->maxb > sideinfo.ch[0].gr[gr].maxb)
2258 sideinfo.ch[0].gr[gr].maxb = gr_info->maxb;
2259 else
2260 gr_info->maxb = sideinfo.ch[0].gr[gr].maxb;
2261 }
2262
2263 switch(single)
2264 {
2265 case SINGLE_MIX:
2266 {
2267 register int i;
2268 register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1];
2269 for(i=0;i<SSLIMIT*(int)gr_info->maxb;i++,in0++)
2270 *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */
2271 }
2272 break;
2273 case SINGLE_RIGHT:
2274 {
2275 register int i;
2276 register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1];
2277 for(i=0;i<SSLIMIT*(int)gr_info->maxb;i++)
2278 *in0++ = *in1++;
2279 }
2280 break;
2281 }
2282 }
2283
2284#ifndef NO_MOREINFO
2285 if(fr->pinfo)
2286 fill_pinfo_side(fr, &sideinfo, gr, stereo1);
2287#endif
2288
2289 for(ch=0;ch<stereo1;ch++)
2290 {
2291 struct gr_info_s *gr_info = &(sideinfo.ch[ch].gr[gr]);
2292 III_antialias(hybridIn[ch],gr_info);
2293 III_hybrid(hybridIn[ch], hybridOut[ch], ch,gr_info, fr);
2294 }
2295
2296#ifdef OPT_I486
2297 if(single != SINGLE_STEREO || fr->af.encoding != MPG123_ENC_SIGNED_16 || fr->down_sample != 0)
2298 {
2299#endif
2300 for(ss=0;ss<SSLIMIT;ss++)
2301 {
2302 if(single != SINGLE_STEREO)
2303 clip += (fr->synth_mono)(hybridOut[0][ss], fr);
2304 else
2305 clip += (fr->synth_stereo)(hybridOut[0][ss], hybridOut[1][ss], fr);
2306
2307 }
2308#ifdef OPT_I486
2309 } else
2310 {
2311 /* Only stereo, 16 bits benefit from the 486 optimization. */
2312 ss=0;
2313 while(ss < SSLIMIT)
2314 {
2315 int n;
2316 n=(fr->buffer.size - fr->buffer.fill) / (2*2*32);
2317 if(n > (SSLIMIT-ss)) n=SSLIMIT-ss;
2318
2319 /* Clip counting makes no sense with this function. */
2320 absynth_1to1_i486(hybridOut[0][ss], 0, fr, n);
2321 absynth_1to1_i486(hybridOut[1][ss], 1, fr, n);
2322 ss+=n;
2323 fr->buffer.fill+=(2*2*32)*n;
2324 }
2325 }
2326#endif
2327 }
2328
2329 return clip;
2330}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define SINGLE_RIGHT
Definition: frame.h:190
GLdouble n
Definition: glext.h:7729
@ MPG123_ENC_SIGNED_16
Definition: fmt123.h:58
#define ss
Definition: i386-dis.c:441
#define set_pointer
Definition: intsym.h:242
#define absynth_1to1_i486
Definition: intsym.h:54
static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT], real tsOut[SSLIMIT][SBLIMIT], int ch, struct gr_info_s *gr_info, mpg123_handle *fr)
Definition: layer3.c:1975
static int III_get_scale_factors_2(mpg123_handle *fr, int *scf, struct gr_info_s *gr_info, int i_stereo)
Definition: layer3.c:684
static int III_dequantize_sample(mpg123_handle *fr, real xr[SBLIMIT][SSLIMIT], int *scf, struct gr_info_s *gr_info, int sfreq, int part2bits)
Definition: layer3.c:795
static void III_antialias(real xr[SBLIMIT][SSLIMIT], struct gr_info_s *gr_info)
Definition: layer3.c:1482
static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT], int *scalefac, struct gr_info_s *gr_info, int sfreq, int ms_stereo, int lsf)
Definition: layer3.c:1310
static void fill_pinfo_side(mpg123_handle *fr, struct III_sideinfo *si, int gr, int stereo1)
Definition: layer3.c:2031
static int III_get_scale_factors_1(mpg123_handle *fr, int *scf, struct gr_info_s *gr_info, int ch, int gr)
Definition: layer3.c:585
static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si, int stereo, int ms_stereo, long sfreq, int single)
Definition: layer3.c:405
#define VERBOSE2
#define SSLIMIT
#define error2(s, a, b)
Definition: debug.h:126
struct gr_info_s gr[2]
Definition: layer3.c:83
int sampling_frequency
Definition: frame.h:205
struct mpg123_moreinfo * pinfo
Definition: frame.h:343
struct mpg123_handle_struct::@3465 layer3
struct audioformat af
Definition: frame.h:268

◆ init_layer12()

void init_layer12 ( void  )

Definition at line 39 of file layer2.c.

40{
41 const int base[3][9] =
42 {
43 { 1 , 0, 2 , } ,
44 { 17, 18, 0 , 19, 20 , } ,
45 { 21, 1, 22, 23, 0, 24, 25, 2, 26 }
46 };
47 int i,j,k,l,len;
48 const int tablen[3] = { 3 , 5 , 9 };
49 int *itable;
50 int *tables[3] = { grp_3tab , grp_5tab , grp_9tab };
51
52 for(i=0;i<3;i++)
53 {
54 itable = tables[i];
55 len = tablen[i];
56 for(j=0;j<len;j++)
57 for(k=0;k<len;k++)
58 for(l=0;l<len;l++)
59 {
60 *itable++ = base[i][l];
61 *itable++ = base[i][k];
62 *itable++ = base[i][j];
63 }
64 }
65}
r l[0]
Definition: byte_order.h:168
struct nls_table * tables
Definition: nls_base.c:22
GLenum GLsizei len
Definition: glext.h:6722
static int grp_3tab[32 *3]
Definition: layer2.c:21
static int grp_9tab[1024 *3]
Definition: layer2.c:23
static int grp_5tab[128 *3]
Definition: layer2.c:22
int k
Definition: mpi.c:3369

◆ init_layer12_stuff()

void init_layer12_stuff ( mpg123_handle fr,
real *(*)(mpg123_handle *fr, real *table, int m init_table 
)

Definition at line 67 of file layer2.c.

68{
69 int k;
70 real *table;
71 for(k=0;k<27;k++)
72 {
73 table = init_table(fr, fr->muls[k], k);
74 *table++ = 0.0;
75 }
76}
real muls[27][64]
Definition: frame.h:145

◆ init_layer12_table()

real * init_layer12_table ( mpg123_handle fr,
real table,
int  m 
)

Definition at line 78 of file layer2.c.

79{
80#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES)
81 int i;
82 for(i=0;i<63;i++)
83 *table++ = layer12_table[m][i];
84#else
85 int i,j;
86 for(j=3,i=0;i<63;i++,j--)
87 *table++ = DOUBLE_TO_REAL_SCALE_LAYER12(mulmul[m] * pow(2.0,(double) j / 3.0));
88#endif
89
90 return table;
91}
double pow(double x, double y)
Definition: freeldr.c:112
const GLfloat * m
Definition: glext.h:10848
static const real layer12_table[27][64]
static const double mulmul[27]
Definition: layer2.c:28
#define DOUBLE_TO_REAL_SCALE_LAYER12(x)

◆ init_layer3()

void init_layer3 ( void  )

Definition at line 183 of file layer3.c.

184{
185 int i,j,k,l;
186
187#if !defined(REAL_IS_FIXED) || !defined(PRECALC_TABLES)
188 for(i=0;i<8207;i++)
189 ispow[i] = DOUBLE_TO_REAL_POW43(pow((double)i,(double)4.0/3.0));
190
191 for(i=0;i<8;i++)
192 {
193 const double Ci[8] = {-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037};
194 double sq = sqrt(1.0+Ci[i]*Ci[i]);
195 aa_cs[i] = DOUBLE_TO_REAL(1.0/sq);
196 aa_ca[i] = DOUBLE_TO_REAL(Ci[i]/sq);
197 }
198
199 for(i=0;i<18;i++)
200 {
201 win[0][i] = win[1][i] =
202 DOUBLE_TO_REAL( 0.5*sin(M_PI/72.0 * (double)(2*(i+0) +1)) / cos(M_PI * (double)(2*(i+0) +19) / 72.0) );
203 win[0][i+18] = win[3][i+18] =
204 DOUBLE_TO_REAL( 0.5*sin(M_PI/72.0 * (double)(2*(i+18)+1)) / cos(M_PI * (double)(2*(i+18)+19) / 72.0) );
205 }
206 for(i=0;i<6;i++)
207 {
208 win[1][i+18] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (2*(i+18)+19) / 72.0 ));
209 win[3][i+12] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (2*(i+12)+19) / 72.0 ));
210 win[1][i+24] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+13) ) / cos ( M_PI * (double) (2*(i+24)+19) / 72.0 ));
211 win[1][i+30] = win[3][i] = DOUBLE_TO_REAL(0.0);
212 win[3][i+6 ] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+1 ) ) / cos ( M_PI * (double) (2*(i+6 )+19) / 72.0 ));
213 }
214
215 for(i=0;i<9;i++)
216 COS9[i] = DOUBLE_TO_REAL(cos( M_PI / 18.0 * (double) i));
217
218 for(i=0;i<9;i++)
219 tfcos36[i] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (i*2+1) / 36.0 ));
220
221 for(i=0;i<3;i++)
222 tfcos12[i] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (i*2+1) / 12.0 ));
223
224 COS6_1 = DOUBLE_TO_REAL(cos( M_PI / 6.0 * (double) 1));
225 COS6_2 = DOUBLE_TO_REAL(cos( M_PI / 6.0 * (double) 2));
226
227#ifdef NEW_DCT9
228 cos9[0] = DOUBLE_TO_REAL(cos(1.0*M_PI/9.0));
229 cos9[1] = DOUBLE_TO_REAL(cos(5.0*M_PI/9.0));
230 cos9[2] = DOUBLE_TO_REAL(cos(7.0*M_PI/9.0));
231 cos18[0] = DOUBLE_TO_REAL(cos(1.0*M_PI/18.0));
232 cos18[1] = DOUBLE_TO_REAL(cos(11.0*M_PI/18.0));
233 cos18[2] = DOUBLE_TO_REAL(cos(13.0*M_PI/18.0));
234#endif
235
236 for(i=0;i<12;i++)
237 {
238 win[2][i] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+1) ) / cos ( M_PI * (double) (2*i+7) / 24.0 ));
239 }
240
241 for(i=0;i<16;i++)
242 {
243 double t = tan( (double) i * M_PI / 12.0 );
244 tan1_1[i] = DOUBLE_TO_REAL_15(t / (1.0+t));
245 tan2_1[i] = DOUBLE_TO_REAL_15(1.0 / (1.0 + t));
246 tan1_2[i] = DOUBLE_TO_REAL_15(M_SQRT2 * t / (1.0+t));
247 tan2_2[i] = DOUBLE_TO_REAL_15(M_SQRT2 / (1.0 + t));
248 }
249
250 for(i=0;i<32;i++)
251 {
252 for(j=0;j<2;j++)
253 {
254 double base = pow(2.0,-0.25*(j+1.0));
255 double p1=1.0,p2=1.0;
256 if(i > 0)
257 {
258 if( i & 1 ) p1 = pow(base,(i+1.0)*0.5);
259 else p2 = pow(base,i*0.5);
260 }
261 pow1_1[j][i] = DOUBLE_TO_REAL_15(p1);
262 pow2_1[j][i] = DOUBLE_TO_REAL_15(p2);
263 pow1_2[j][i] = DOUBLE_TO_REAL_15(M_SQRT2 * p1);
264 pow2_2[j][i] = DOUBLE_TO_REAL_15(M_SQRT2 * p2);
265 }
266 }
267#endif
268
269 for(j=0;j<4;j++)
270 {
271 const int len[4] = { 36,36,12,36 };
272 for(i=0;i<len[j];i+=2) win1[j][i] = + win[j][i];
273
274 for(i=1;i<len[j];i+=2) win1[j][i] = - win[j][i];
275 }
276
277 for(j=0;j<9;j++)
278 {
279 const struct bandInfoStruct *bi = &bandInfo[j];
280 int *mp;
281 int cb,lwin;
282 const unsigned char *bdf;
283 int switch_idx;
284
285 mp = map[j][0] = mapbuf0[j];
286 bdf = bi->longDiff;
287 switch_idx = (j < 3) ? 8 : 6;
288 for(i=0,cb = 0; cb < switch_idx ; cb++,i+=*bdf++)
289 {
290 *mp++ = (*bdf) >> 1;
291 *mp++ = i;
292 *mp++ = 3;
293 *mp++ = cb;
294 }
295 bdf = bi->shortDiff+3;
296 for(cb=3;cb<13;cb++)
297 {
298 int l = (*bdf++) >> 1;
299 for(lwin=0;lwin<3;lwin++)
300 {
301 *mp++ = l;
302 *mp++ = i + lwin;
303 *mp++ = lwin;
304 *mp++ = cb;
305 }
306 i += 6*l;
307 }
308 mapend[j][0] = mp;
309
310 mp = map[j][1] = mapbuf1[j];
311 bdf = bi->shortDiff+0;
312 for(i=0,cb=0;cb<13;cb++)
313 {
314 int l = (*bdf++) >> 1;
315 for(lwin=0;lwin<3;lwin++)
316 {
317 *mp++ = l;
318 *mp++ = i + lwin;
319 *mp++ = lwin;
320 *mp++ = cb;
321 }
322 i += 6*l;
323 }
324 mapend[j][1] = mp;
325
326 mp = map[j][2] = mapbuf2[j];
327 bdf = bi->longDiff;
328 for(cb = 0; cb < 22 ; cb++)
329 {
330 *mp++ = (*bdf++) >> 1;
331 *mp++ = cb;
332 }
333 mapend[j][2] = mp;
334 }
335
336 /* Now for some serious loopings! */
337 for(i=0;i<5;i++)
338 for(j=0;j<6;j++)
339 for(k=0;k<6;k++)
340 {
341 int n = k + j * 6 + i * 36;
342 i_slen2[n] = i|(j<<3)|(k<<6)|(3<<12);
343 }
344 for(i=0;i<4;i++)
345 for(j=0;j<4;j++)
346 for(k=0;k<4;k++)
347 {
348 int n = k + j * 4 + i * 16;
349 i_slen2[n+180] = i|(j<<3)|(k<<6)|(4<<12);
350 }
351 for(i=0;i<4;i++)
352 for(j=0;j<3;j++)
353 {
354 int n = j + i * 3;
355 i_slen2[n+244] = i|(j<<3) | (5<<12);
356 n_slen2[n+500] = i|(j<<3) | (2<<12) | (1<<15);
357 }
358 for(i=0;i<5;i++)
359 for(j=0;j<5;j++)
360 for(k=0;k<4;k++)
361 for(l=0;l<4;l++)
362 {
363 int n = l + k * 4 + j * 16 + i * 80;
364 n_slen2[n] = i|(j<<3)|(k<<6)|(l<<9)|(0<<12);
365 }
366 for(i=0;i<5;i++)
367 for(j=0;j<5;j++)
368 for(k=0;k<4;k++)
369 {
370 int n = k + j * 4 + i * 20;
371 n_slen2[n+400] = i|(j<<3)|(k<<6)|(1<<12);
372 }
373}
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL tan(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
Definition: _map.h:48
GLdouble GLdouble t
Definition: gl.h:2047
static real win1[4][36]
static real win[4][36]
static real tfcos12[3]
static int * mapend[9][3]
Definition: layer3.c:157
static int mapbuf0[9][152]
Definition: layer3.c:153
static int mapbuf1[9][156]
Definition: layer3.c:154
static real aa_cs[8]
Definition: layer3.c:39
static unsigned int i_slen2[256]
Definition: layer3.c:160
static real aa_ca[8]
Definition: layer3.c:39
static unsigned int n_slen2[512]
Definition: layer3.c:159
static const struct bandInfoStruct bandInfo[9]
Definition: layer3.c:95
static real ispow[8207]
Definition: layer3.c:38
static int mapbuf2[9][44]
Definition: layer3.c:155
#define M_PI
Definition: macros.h:263
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define DOUBLE_TO_REAL_15(x)
#define DOUBLE_TO_REAL_POW43(x)
#define M_SQRT2
#define DOUBLE_TO_REAL(x)
unsigned char longDiff[22]
Definition: layer3.c:89
unsigned char shortDiff[13]
Definition: layer3.c:91

◆ init_layer3_gainpow2()

real init_layer3_gainpow2 ( mpg123_handle fr,
int  i 
)

Definition at line 172 of file layer3.c.

173{
174#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES)
175 return gainpow2[i+256];
176#else
177 return DOUBLE_TO_REAL_SCALE_LAYER3(pow((double)2.0,-0.25 * (double) (i+210)),i+256);
178#endif
179}
#define DOUBLE_TO_REAL_SCALE_LAYER3(x, y)

◆ init_layer3_stuff()

void init_layer3_stuff ( mpg123_handle fr,
real(*)(mpg123_handle *fr, int i gainpow2 
)

Definition at line 376 of file layer3.c.

377{
378 int i,j;
379
380 for(i=-256;i<118+4;i++) fr->gainpow2[i+256] = gainpow2(fr,i);
381
382 for(j=0;j<9;j++)
383 {
384 for(i=0;i<23;i++)
385 {
386 fr->longLimit[j][i] = (bandInfo[j].longIdx[i] - 1 + 8) / 18 + 1;
387 if(fr->longLimit[j][i] > (fr->down_sample_sblimit) )
388 fr->longLimit[j][i] = fr->down_sample_sblimit;
389 }
390 for(i=0;i<14;i++)
391 {
392 fr->shortLimit[j][i] = (bandInfo[j].shortIdx[i] - 1) / 18 + 1;
393 if(fr->shortLimit[j][i] > (fr->down_sample_sblimit) )
394 fr->shortLimit[j][i] = fr->down_sample_sblimit;
395 }
396 }
397}
int longLimit[9][23]
Definition: frame.h:140
int down_sample_sblimit
Definition: frame.h:194
int shortLimit[9][14]
Definition: frame.h:141
real gainpow2[256+118+4]
Definition: frame.h:142

◆ make_conv16to8_table()

int make_conv16to8_table ( mpg123_handle fr)

Definition at line 277 of file tabinit.c.

278{
279 int i;
280 int mode = fr->af.dec_enc;
281
282 /*
283 * ????: 8.0 is right but on SB cards '2.0' is a better value ???
284 */
285 const double mul = 8.0;
286
287 if(!fr->conv16to8_buf){
288 fr->conv16to8_buf = (unsigned char *) malloc(8192);
289 if(!fr->conv16to8_buf) {
291 if(NOQUIET) error("Can't allocate 16 to 8 converter table!");
292 return -1;
293 }
294 fr->conv16to8 = fr->conv16to8_buf + 4096;
295 }
296
297 switch(mode)
298 {
300 {
301 double m=127.0 / log(256.0);
302 int c1;
303
304 for(i=-4096;i<4096;i++)
305 {
306 /* dunno whether this is a valid transformation rule ?!?!? */
307 if(i < 0)
308 c1 = 127 - (int) (log( 1.0 - 255.0 * (double) i*mul / 32768.0 ) * m);
309 else
310 c1 = 255 - (int) (log( 1.0 + 255.0 * (double) i*mul / 32768.0 ) * m);
311 if(c1 < 0 || c1 > 255)
312 {
313 if(NOQUIET) error2("Converror %d %d",i,c1);
314 return -1;
315 }
316 if(c1 == 0)
317 c1 = 2;
318 fr->conv16to8[i] = (unsigned char) c1;
319 }
320 }
321 break;
323 for(i=-4096;i<4096;i++)
324 fr->conv16to8[i] = i>>5;
325 break;
327 for(i=-4096;i<4096;i++)
328 fr->conv16to8[i] = (i>>5)+128;
329 break;
331 {
332 /*
333 Let's believe Wikipedia (http://en.wikipedia.org/wiki/G.711) that this
334 is the correct table:
335
336 s0000000wxyza... n000wxyz [0-31] -> [0-15]
337 s0000001wxyza... n001wxyz [32-63] -> [16-31]
338 s000001wxyzab... n010wxyz [64-127] -> [32-47]
339 s00001wxyzabc... n011wxyz [128-255] -> [48-63]
340 s0001wxyzabcd... n100wxyz [256-511] -> [64-79]
341 s001wxyzabcde... n101wxyz [512-1023] -> [80-95]
342 s01wxyzabcdef... n110wxyz [1024-2047] -> [96-111]
343 s1wxyzabcdefg... n111wxyz [2048-4095] -> [112-127]
344
345 Let's extend to -4096, too.
346 Also, bytes are xored with 0x55 for transmission.
347
348 Since it sounds OK, I assume it is fine;-)
349 */
350 for(i=0; i<64; ++i)
351 fr->conv16to8[i] = ((unsigned int)i)>>1;
352 for(i=64; i<128; ++i)
353 fr->conv16to8[i] = ((((unsigned int)i)>>2) & 0xf) | (2<<4);
354 for(i=128; i<256; ++i)
355 fr->conv16to8[i] = ((((unsigned int)i)>>3) & 0xf) | (3<<4);
356 for(i=256; i<512; ++i)
357 fr->conv16to8[i] = ((((unsigned int)i)>>4) & 0xf) | (4<<4);
358 for(i=512; i<1024; ++i)
359 fr->conv16to8[i] = ((((unsigned int)i)>>5) & 0xf) | (5<<4);
360 for(i=1024; i<2048; ++i)
361 fr->conv16to8[i] = ((((unsigned int)i)>>6) & 0xf) | (6<<4);
362 for(i=2048; i<4096; ++i)
363 fr->conv16to8[i] = ((((unsigned int)i)>>7) & 0xf) | (7<<4);
364
365 for(i=-4095; i<0; ++i)
366 fr->conv16to8[i] = fr->conv16to8[-i] | 0x80;
367
368 fr->conv16to8[-4096] = fr->conv16to8[-4095];
369
370 for(i=-4096;i<4096;i++)
371 {
372 /* fr->conv16to8[i] = - i>>5; */
373 /* fprintf(stderr, "table %i %i\n", i<<AUSHIFT, fr->conv16to8[i]); */
374 fr->conv16to8[i] ^= 0x55;
375 }
376 }
377 break;
378 default:
380 if(NOQUIET) error("Unknown 8 bit encoding choice.");
381 return -1;
382 break;
383 }
384
385 return 0;
386}
#define malloc
Definition: debug_ros.c:4
GLenum mode
Definition: glext.h:6217
@ MPG123_ENC_ULAW_8
Definition: fmt123.h:66
@ MPG123_ENC_SIGNED_8
Definition: fmt123.h:64
@ MPG123_ENC_ALAW_8
Definition: fmt123.h:68
@ MPG123_ENC_UNSIGNED_8
Definition: fmt123.h:62
@ MPG123_ERR_16TO8TABLE
Definition: mpg123.h:387
#define mul(aa, bb)
Definition: mvAesAlg.c:25
#define log(outFile, fmt,...)
Definition: util.h:15
unsigned char * conv16to8_buf
Definition: frame.h:134
unsigned char * conv16to8
Definition: frame.h:135

◆ make_decode_tables()

void make_decode_tables ( mpg123_handle fr)

Definition at line 181 of file tabinit.c.

182{
183 int i,j;
184 int idx = 0;
185 double scaleval;
186#ifdef REAL_IS_FIXED
187 real scaleval_long;
188#endif
189 /* Scale is always based on 1.0 . */
190 scaleval = -0.5*(fr->lastscale < 0 ? fr->p.outscale : fr->lastscale);
191 debug1("decode tables with scaleval %g", scaleval);
192#ifdef REAL_IS_FIXED
193 scaleval_long = DOUBLE_TO_REAL_15(scaleval);
194 debug1("decode table with fixed scaleval %li", (long)scaleval_long);
195 if(scaleval_long > 28618 || scaleval_long < -28618)
196 {
197 /* TODO: Limit the scaleval itself or limit the multiplication afterwards?
198 The former basically disables significant amplification for fixed-point
199 decoders, but avoids (possibly subtle) distortion. */
200 /* This would limit the amplification instead:
201 scaleval_long = scaleval_long < 0 ? -28618 : 28618; */
202 if(NOQUIET) warning("Desired amplification may introduce distortion.");
203 }
204#endif
205 for(i=0,j=0;i<256;i++,j++,idx+=32)
206 {
207 if(idx < 512+16)
208#ifdef REAL_IS_FIXED
209 fr->decwin[idx+16] = fr->decwin[idx] =
210 REAL_SCALE_WINDOW(sat_mul32(intwinbase[j],scaleval_long));
211#else
212 fr->decwin[idx+16] = fr->decwin[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
213#endif
214
215 if(i % 32 == 31)
216 idx -= 1023;
217 if(i % 64 == 63)
218#ifdef REAL_IS_FIXED
219 scaleval_long = - scaleval_long;
220#else
221 scaleval = - scaleval;
222#endif
223 }
224
225 for( /* i=256 */ ;i<512;i++,j--,idx+=32)
226 {
227 if(idx < 512+16)
228#ifdef REAL_IS_FIXED
229 fr->decwin[idx+16] = fr->decwin[idx] =
230 REAL_SCALE_WINDOW(sat_mul32(intwinbase[j],scaleval_long));
231#else
232 fr->decwin[idx+16] = fr->decwin[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
233#endif
234
235 if(i % 32 == 31)
236 idx -= 1023;
237 if(i % 64 == 63)
238#ifdef REAL_IS_FIXED
239 scaleval_long = - scaleval_long;
240#else
241 scaleval = - scaleval;
242#endif
243 }
244#if defined(OPT_X86_64) || defined(OPT_ALTIVEC) || defined(OPT_SSE) || defined(OPT_SSE_VINTAGE) || defined(OPT_ARM) || defined(OPT_NEON) || defined(OPT_NEON64) || defined(OPT_AVX)
245 if( fr->cpu_opts.type == x86_64
246 || fr->cpu_opts.type == altivec
247 || fr->cpu_opts.type == sse
248 || fr->cpu_opts.type == sse_vintage
249 || fr->cpu_opts.type == arm
250 || fr->cpu_opts.type == neon
251 || fr->cpu_opts.type == neon64
252 || fr->cpu_opts.type == avx )
253 { /* for float SSE / AltiVec / ARM decoder */
254 for(i=512; i<512+32; i++)
255 {
256 fr->decwin[i] = (i&1) ? fr->decwin[i] : 0;
257 }
258 for(i=0; i<512; i++)
259 {
260 fr->decwin[512+32+i] = -fr->decwin[511-i];
261 }
262#if defined(OPT_NEON) || defined(OPT_NEON64)
263 if(fr->cpu_opts.type == neon || fr->cpu_opts.type == neon64)
264 {
265 for(i=0; i<512; i+=2)
266 {
267 fr->decwin[i] = -fr->decwin[i];
268 }
269 }
270#endif
271 }
272#endif
273 debug("decode tables done");
274}
unsigned int idx
Definition: utils.c:41
#define debug(msg)
Definition: key_call.c:71
@ avx
Definition: optimize.h:112
@ x86_64
Definition: optimize.h:108
@ neon64
Definition: optimize.h:111
@ sse_vintage
Definition: optimize.h:115
@ altivec
Definition: optimize.h:106
@ arm
Definition: optimize.h:109
@ sse
Definition: optimize.h:107
@ neon
Definition: optimize.h:110
#define debug1(s, a)
Definition: debug.h:61
#define warning(s)
Definition: debug.h:83
struct mpg123_pars_struct p
Definition: frame.h:289
double lastscale
Definition: frame.h:237
struct mpg123_handle_struct::@3461 cpu_opts
static long intwinbase[]
Definition: tabinit.c:48

◆ ntom_frame_outsamples()

off_t ntom_frame_outsamples ( mpg123_handle fr)

Definition at line 73 of file ntom.c.

74{
75 /* The do this before decoding the separate channels, so there is only one common ntom value. */
76 int ntm = fr->ntom_val[0];
77 ntm += fr->spf*fr->ntom_step;
78 return ntm/NTOM_MUL;
79}
#define NTOM_MUL
Definition: decode.h:32
unsigned long ntom_step
Definition: frame.h:150
unsigned long ntom_val[2]
Definition: frame.h:149

◆ ntom_frameoff()

off_t ntom_frameoff ( mpg123_handle fr,
off_t  soff 
)

Definition at line 130 of file ntom.c.

131{
132 off_t ioff = 0; /* frames or samples */
133 off_t ntm = ntom_val(fr,0);
134#ifdef SAFE_NTOM
135 if(soff <= 0) return 0;
136 for(ioff=0; 1; ++ioff)
137 {
138 ntm += fr->spf*fr->ntom_step;
139 if(ntm/NTOM_MUL > soff) break;
140 soff -= ntm/NTOM_MUL;
141 ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
142 }
143 return ioff;
144#else
145 ioff = (soff*(off_t)NTOM_MUL-ntm)/(off_t)fr->ntom_step;
146 return ioff/(off_t)fr->spf;
147#endif
148}
#define off_t
Definition: dosfsck.h:5
__kernel_off_t off_t
Definition: linux.h:201
#define ntom_val
Definition: intsym.h:155

◆ ntom_frmouts()

off_t ntom_frmouts ( mpg123_handle fr,
off_t  frame 
)

Definition at line 82 of file ntom.c.

83{
84#ifdef SAFE_NTOM
85 off_t f;
86#endif
87 off_t soff = 0;
88 off_t ntm = ntom_val(fr,0);
89#ifdef SAFE_NTOM
90 if(frame <= 0) return 0;
91 for(f=0; f<frame; ++f)
92 {
93 ntm += fr->spf*fr->ntom_step;
94 soff += ntm/NTOM_MUL;
95 ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
96 }
97#else
98 soff = (ntm + frame*(off_t)fr->spf*(off_t)fr->ntom_step)/(off_t)NTOM_MUL;
99#endif
100 return soff;
101}
GLfloat f
Definition: glext.h:7540
#define f
Definition: ke_i.h:83

◆ ntom_ins2outs()

off_t ntom_ins2outs ( mpg123_handle fr,
off_t  ins 
)

Definition at line 104 of file ntom.c.

105{
106 off_t soff = 0;
107 off_t ntm = ntom_val(fr,0);
108#ifdef SAFE_NTOM
109 {
110 off_t block = fr->spf;
111 if(ins <= 0) return 0;
112 do
113 {
114 off_t nowblock = ins > block ? block : ins;
115 ntm += nowblock*fr->ntom_step;
116 soff += ntm/NTOM_MUL;
117 ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
118 ins -= nowblock;
119 } while(ins > 0);
120 }
121#else
122 /* Beware of overflows: when off_t is 32bits, the multiplication blows too easily.
123 Of course, it blows for 64bits, too, in theory, but that's for _really_ large files. */
124 soff = ((off_t)ntm + (off_t)ins*(off_t)fr->ntom_step)/(off_t)NTOM_MUL;
125#endif
126 return soff;
127}

◆ ntom_set_ntom()

void ntom_set_ntom ( mpg123_handle fr,
off_t  num 
)

Definition at line 66 of file ntom.c.

67{
68 fr->ntom_val[1] = fr->ntom_val[0] = ntom_val(fr, num);
69}
GLuint GLuint num
Definition: glext.h:9618

◆ ntom_val()

unsigned long ntom_val ( mpg123_handle fr,
off_t  frame 
)

Definition at line 46 of file ntom.c.

47{
48 off_t ntm;
49#ifdef SAFE_NTOM /* Carry out the loop, without the threatening integer overflow. */
50 off_t f;
51 ntm = NTOM_MUL>>1; /* for frame 0 */
52 for(f=0; f<frame; ++f) /* for frame > 0 */
53 {
54 ntm += fr->spf*fr->ntom_step;
55 ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
56 }
57#else /* Just make one computation with overall sample offset. */
58 ntm = (NTOM_MUL>>1) + fr->spf*frame*fr->ntom_step;
59 ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
60#endif
61 return (unsigned long) ntm;
62}

◆ prepare_decode_tables()

void prepare_decode_tables ( void  )

Definition at line 76 of file tabinit.c.

77{
78#if !defined(REAL_IS_FIXED) || !defined(PRECALC_TABLES)
79 int i,k,kr,divv;
80 real *costab;
81
82 for(i=0;i<5;i++)
83 {
84 kr=0x10>>i; divv=0x40>>i;
85 costab = pnts[i];
86 for(k=0;k<kr;k++)
87 costab[k] = DOUBLE_TO_REAL(1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv)));
88 }
89#endif
90}
real * pnts[]
Definition: tabinit.c:45

◆ synth_1to1()

int synth_1to1 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_3dnow()

int synth_1to1_3dnow ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_3dnowext()

int synth_1to1_3dnowext ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_8bit()

int synth_1to1_8bit ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_8bit_i386()

int synth_1to1_8bit_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_8bit_m2s()

int synth_1to1_8bit_m2s ( real ,
mpg123_handle  
)

◆ synth_1to1_8bit_mono()

int synth_1to1_8bit_mono ( real ,
mpg123_handle  
)

◆ synth_1to1_8bit_wrap()

int synth_1to1_8bit_wrap ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_8bit_wrap_m2s()

int synth_1to1_8bit_wrap_m2s ( real ,
mpg123_handle  
)

◆ synth_1to1_8bit_wrap_mono()

int synth_1to1_8bit_wrap_mono ( real ,
mpg123_handle  
)

◆ synth_1to1_altivec()

int synth_1to1_altivec ( real bandPtr,
int  channel,
mpg123_handle fr,
int  final 
)

Definition at line 258 of file synth_altivec.c.

259{
260 short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
261
262 real *b0, **buf;
263 int clip;
264 int bo1;
265#ifndef NO_EQUALIZER
266 if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
267#endif
268 if(!channel)
269 {
270 fr->bo--;
271 fr->bo &= 0xf;
272 buf = fr->real_buffs[0];
273 }
274 else
275 {
276 samples++;
277 buf = fr->real_buffs[1];
278 }
279
280 if(fr->bo & 0x1)
281 {
282 b0 = buf[0];
283 bo1 = fr->bo;
284 dct64_altivec(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
285 }
286 else
287 {
288 b0 = buf[1];
289 bo1 = fr->bo+1;
290 dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
291 }
292
293
294 {
295 register int j;
296 real *window = fr->decwin + 16 - bo1;
297
298 ALIGNED(16) int clip_tmp[4];
299 vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
300 vector unsigned char vperm1,vperm2,vperm3,vperm4;
301 vector float vsum,vsum2,vsum3,vsum4,vmin,vmax,vzero;
302 vector signed int vclip;
303 vector signed short vsample1,vsample2;
304 vector unsigned int vshift;
305 vclip = vec_xor(vclip,vclip);
306 vzero = vec_xor(vzero,vzero);
307 vshift = vec_splat_u32(-1); /* 31 */
308#ifdef __APPLE__
309 vmax = (vector float)(32767.0f);
310 vmin = (vector float)(-32768.0f);
311 vperm4 = (vector unsigned char)(0,1,18,19,2,3,22,23,4,5,26,27,6,7,30,31);
312#else
313 vmax = (vector float){32767.0f,32767.0f,32767.0f,32767.0f};
314 vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
315 vperm4 = (vector unsigned char){0,1,18,19,2,3,22,23,4,5,26,27,6,7,30,31};
316#endif
317
318 vperm1 = vec_lvsl(0,window);
319 vperm2 = vec_lvsl(0,samples);
320 vperm3 = vec_lvsr(0,samples);
321 for (j=4;j;j--)
322 {
323 SYNTH_ALTIVEC(16);
324
325 vsum = vec_sub(v5,v6);
326 v9 = vec_sub(v7,v8);
327 vsum = vec_add(vsum,v9);
328
329 v3 = vec_round(vsum);
330 v3 = (vector float)vec_cts(v3,0);
331 v1 = (vector float)vec_cmpgt(vsum,vmax);
332 v2 = (vector float)vec_cmplt(vsum,vmin);
333 vsample1 = vec_ld(0,samples);
334 vsample2 = vec_ld(15,samples);
335 v3 = (vector float)vec_packs((vector signed int)v3,(vector signed int)v3);
336 v4 = (vector float)vec_perm(vsample1,vsample2,vperm2);
337 v5 = (vector float)vec_perm(v3,v4,vperm4);
338 v6 = (vector float)vec_perm(vsample2,vsample1,vperm2);
339 v7 = (vector float)vec_perm(v5,v6,vperm3);
340 v8 = (vector float)vec_perm(v6,v5,vperm3);
341 vec_st((vector signed short)v7,15,samples);
342 vec_st((vector signed short)v8,0,samples);
343 samples += 8;
344
345 v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
346 v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
347 v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
348 vclip = vec_sums((vector signed int)v1,vclip);
349 }
350
351 for (j=4;j;j--)
352 {
353 SYNTH_ALTIVEC(-16);
354
355 vsum = vec_add(v5,v6);
356 v9 = vec_add(v7,v8);
357 vsum = vec_add(vsum,v9);
358
359 v3 = vec_round(vsum);
360 v3 = (vector float)vec_cts(v3,0);
361 v1 = (vector float)vec_cmpgt(vsum,vmax);
362 v2 = (vector float)vec_cmplt(vsum,vmin);
363 vsample1 = vec_ld(0,samples);
364 vsample2 = vec_ld(15,samples);
365 v3 = (vector float)vec_packs((vector signed int)v3,(vector signed int)v3);
366 v4 = (vector float)vec_perm(vsample1,vsample2,vperm2);
367 v5 = (vector float)vec_perm(v3,v4,vperm4);
368 v6 = (vector float)vec_perm(vsample2,vsample1,vperm2);
369 v7 = (vector float)vec_perm(v5,v6,vperm3);
370 v8 = (vector float)vec_perm(v6,v5,vperm3);
371 vec_st((vector signed short)v7,15,samples);
372 vec_st((vector signed short)v8,0,samples);
373 samples += 8;
374
375 v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
376 v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
377 v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
378 vclip = vec_sums((vector signed int)v1,vclip);
379 }
380
381 vec_st(vclip,0,clip_tmp);
382 clip = clip_tmp[3];
383 }
384 if(final) fr->buffer.fill += 128;
385
386 return clip;
387}
#define dct64_altivec
Definition: intsym.h:144
#define do_equalizer
Definition: intsym.h:175
static IHTMLWindow2 * window
Definition: events.c:77
real * real_buffs[2][2]
Definition: frame.h:106
real equalizer[2][32]
Definition: frame.h:127
#define SYNTH_ALTIVEC(B0STEP)
Definition: synth_altivec.c:17

◆ synth_1to1_arm()

int synth_1to1_arm ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_avx()

int synth_1to1_avx ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_dither()

int synth_1to1_dither ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_fltst_altivec()

int synth_1to1_fltst_altivec ( real bandPtr_l,
real bandPtr_r,
mpg123_handle fr 
)

Definition at line 656 of file synth_altivec.c.

657{
658 real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
659
660 real *b0l, *b0r, **bufl, **bufr;
661 int bo1;
662#ifndef NO_EQUALIZER
663 if(fr->have_eq_settings)
664 {
665 do_equalizer(bandPtr_l,0,fr->equalizer);
666 do_equalizer(bandPtr_r,1,fr->equalizer);
667 }
668#endif
669 fr->bo--;
670 fr->bo &= 0xf;
671 bufl = fr->real_buffs[0];
672 bufr = fr->real_buffs[1];
673
674 if(fr->bo & 0x1)
675 {
676 b0l = bufl[0];
677 b0r = bufr[0];
678 bo1 = fr->bo;
679 dct64_altivec(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
680 dct64_altivec(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
681 }
682 else
683 {
684 b0l = bufl[1];
685 b0r = bufr[1];
686 bo1 = fr->bo+1;
687 dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
688 dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
689 }
690
691
692 {
693 register int j;
694 real *window = fr->decwin + 16 - bo1;
695
696 vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
697 vector unsigned char vperm1,vperm2;
698 vector float vsum,vsum2,vsum3,vsum4,vsum5,vsum6,vsum7,vsum8,vscale,vzero;
699 vector float vprev;
700 vzero = vec_xor(vzero,vzero);
701#ifdef __APPLE__
702 vscale = (vector float)(1.0f/32768.0f);
703#else
704 vscale = (vector float){1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f};
705#endif
706
707 vperm1 = vec_lvsl(0,window);
708 vperm2 = vec_lvsr(0,samples);
709 vprev = vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
710 for (j=4;j;j--)
711 {
713
714 vsum = vec_sub(vsum,vsum2);
715 vsum2 = vec_sub(vsum5,vsum6);
716 vsum3 = vec_sub(vsum3,vsum4);
717 vsum4 = vec_sub(vsum7,vsum8);
718 vsum = vec_add(vsum,vsum3);
719 vsum2 = vec_add(vsum2,vsum4);
720 vsum = vec_madd(vsum, vscale, vzero);
721 vsum2 = vec_madd(vsum2, vscale, vzero);
722
723 v1 = vec_mergeh(vsum, vsum2);
724 v2 = vec_mergel(vsum, vsum2);
725 v3 = vec_perm(vprev,v1,vperm2);
726 v4 = vec_perm(v1,v2,vperm2);
727 vprev = v2;
728 vec_st(v3,0,samples);
729 vec_st(v4,16,samples);
730 samples += 8;
731 }
732
733 for (j=4;j;j--)
734 {
736
737 vsum = vec_add(vsum,vsum2);
738 vsum2 = vec_add(vsum5,vsum6);
739 vsum3 = vec_add(vsum3,vsum4);
740 vsum4 = vec_add(vsum7,vsum8);
741 vsum = vec_add(vsum,vsum3);
742 vsum2 = vec_add(vsum2,vsum4);
743 vsum = vec_madd(vsum, vscale, vzero);
744 vsum2 = vec_madd(vsum2, vscale, vzero);
745
746 v1 = vec_mergeh(vsum, vsum2);
747 v2 = vec_mergel(vsum, vsum2);
748 v3 = vec_perm(vprev,v1,vperm2);
749 v4 = vec_perm(v1,v2,vperm2);
750 vprev = v2;
751 vec_st(v3,0,samples);
752 vec_st(v4,16,samples);
753 samples += 8;
754 }
755
756 if((size_t)samples & 0xf)
757 {
758 v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
759 v2 = (vector float)vec_perm(vprev,v1,vperm2);
760 vec_st(v2,0,samples);
761 }
762 }
763 fr->buffer.fill += 256;
764
765 return 0;
766}
#define SYNTH_STEREO_ALTIVEC(B0STEP)

◆ synth_1to1_fltst_avx()

int synth_1to1_fltst_avx ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_fltst_neon64()

int synth_1to1_fltst_neon64 ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_i386()

int synth_1to1_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_i586()

int synth_1to1_i586 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_i586_dither()

int synth_1to1_i586_dither ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_m2s()

int synth_1to1_m2s ( real ,
mpg123_handle  
)

◆ synth_1to1_mmx()

int synth_1to1_mmx ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_mono()

int synth_1to1_mono ( real ,
mpg123_handle  
)

◆ synth_1to1_neon()

int synth_1to1_neon ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_neon64()

int synth_1to1_neon64 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_real()

int synth_1to1_real ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_real_altivec()

int synth_1to1_real_altivec ( real bandPtr,
int  channel,
mpg123_handle fr,
int  final 
)

Definition at line 540 of file synth_altivec.c.

541{
542 real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
543
544 real *b0, **buf;
545 int bo1;
546#ifndef NO_EQUALIZER
547 if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
548#endif
549 if(!channel)
550 {
551 fr->bo--;
552 fr->bo &= 0xf;
553 buf = fr->real_buffs[0];
554 }
555 else
556 {
557 samples++;
558 buf = fr->real_buffs[1];
559 }
560
561 if(fr->bo & 0x1)
562 {
563 b0 = buf[0];
564 bo1 = fr->bo;
565 dct64_altivec(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
566 }
567 else
568 {
569 b0 = buf[1];
570 bo1 = fr->bo+1;
571 dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
572 }
573
574
575 {
576 register int j;
577 real *window = fr->decwin + 16 - bo1;
578
579 vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
580 vector unsigned char vperm1,vperm2,vperm3,vperm4, vperm5;
581 vector float vsum,vsum2,vsum3,vsum4,vscale,vzero;
582 vector float vsample1,vsample2,vsample3;
583 vzero = vec_xor(vzero, vzero);
584#ifdef __APPLE__
585 vscale = (vector float)(1.0f/32768.0f);
586 vperm4 = (vector unsigned char)(0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31);
587 vperm5 = (vector unsigned char)(8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31);
588#else
589 vscale = (vector float){1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f};
590 vperm4 = (vector unsigned char){0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31};
591 vperm5 = (vector unsigned char){8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31};
592#endif
593
594 vperm1 = vec_lvsl(0,window);
595 vperm2 = vec_lvsl(0,samples);
596 vperm3 = vec_lvsr(0,samples);
597 for (j=4;j;j--)
598 {
599 SYNTH_ALTIVEC(16);
600
601 vsum = vec_sub(v5,v6);
602 v9 = vec_sub(v7,v8);
603 vsum = vec_add(vsum,v9);
604 vsum = vec_madd(vsum, vscale, vzero);
605
606 vsample1 = vec_ld(0,samples);
607 vsample2 = vec_ld(16,samples);
608 vsample3 = vec_ld(31,samples);
609 v1 = vec_perm(vsample1, vsample2, vperm2);
610 v2 = vec_perm(vsample2, vsample3, vperm2);
611 v1 = vec_perm(vsum, v1, vperm4);
612 v2 = vec_perm(vsum, v2, vperm5);
613 v3 = vec_perm(vsample3, vsample2, vperm2);
614 v4 = vec_perm(vsample2, vsample1, vperm2);
615 v5 = vec_perm(v2, v3, vperm3);
616 v6 = vec_perm(v1, v2, vperm3);
617 v7 = vec_perm(v4, v1, vperm3);
618 vec_st(v5,31,samples);
619 vec_st(v6,16,samples);
620 vec_st(v7,0,samples);
621 samples += 8;
622 }
623
624 for (j=4;j;j--)
625 {
626 SYNTH_ALTIVEC(-16);
627
628 vsum = vec_add(v5,v6);
629 v9 = vec_add(v7,v8);
630 vsum = vec_add(vsum,v9);
631 vsum = vec_madd(vsum, vscale, vzero);
632
633 vsample1 = vec_ld(0,samples);
634 vsample2 = vec_ld(16,samples);
635 vsample3 = vec_ld(31,samples);
636 v1 = vec_perm(vsample1, vsample2, vperm2);
637 v2 = vec_perm(vsample2, vsample3, vperm2);
638 v1 = vec_perm(vsum, v1, vperm4);
639 v2 = vec_perm(vsum, v2, vperm5);
640 v3 = vec_perm(vsample3, vsample2, vperm2);
641 v4 = vec_perm(vsample2, vsample1, vperm2);
642 v5 = vec_perm(v2, v3, vperm3);
643 v6 = vec_perm(v1, v2, vperm3);
644 v7 = vec_perm(v4, v1, vperm3);
645 vec_st(v5,31,samples);
646 vec_st(v6,16,samples);
647 vec_st(v7,0,samples);
648 samples += 8;
649 }
650 }
651 if(final) fr->buffer.fill += 256;
652
653 return 0;
654}

◆ synth_1to1_real_avx()

int synth_1to1_real_avx ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_real_i386()

int synth_1to1_real_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_real_m2s()

int synth_1to1_real_m2s ( real ,
mpg123_handle  
)

◆ synth_1to1_real_mono()

int synth_1to1_real_mono ( real ,
mpg123_handle  
)

◆ synth_1to1_real_neon()

int synth_1to1_real_neon ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_real_neon64()

int synth_1to1_real_neon64 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_real_sse()

int synth_1to1_real_sse ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_real_stereo_neon()

int synth_1to1_real_stereo_neon ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_real_stereo_sse()

int synth_1to1_real_stereo_sse ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_real_stereo_x86_64()

int synth_1to1_real_stereo_x86_64 ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_real_x86_64()

int synth_1to1_real_x86_64 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_s32()

int synth_1to1_s32 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_s32_altivec()

int synth_1to1_s32_altivec ( real bandPtr,
int  channel,
mpg123_handle fr,
int  final 
)

Definition at line 768 of file synth_altivec.c.

769{
770 int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
771
772 real *b0, **buf;
773 int clip;
774 int bo1;
775#ifndef NO_EQUALIZER
776 if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
777#endif
778 if(!channel)
779 {
780 fr->bo--;
781 fr->bo &= 0xf;
782 buf = fr->real_buffs[0];
783 }
784 else
785 {
786 samples++;
787 buf = fr->real_buffs[1];
788 }
789
790 if(fr->bo & 0x1)
791 {
792 b0 = buf[0];
793 bo1 = fr->bo;
794 dct64_altivec(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
795 }
796 else
797 {
798 b0 = buf[1];
799 bo1 = fr->bo+1;
800 dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
801 }
802
803
804 {
805 register int j;
806 real *window = fr->decwin + 16 - bo1;
807
808 ALIGNED(16) int clip_tmp[4];
809 vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
810 vector unsigned char vperm1,vperm2,vperm3,vperm4,vperm5;
811 vector float vsum,vsum2,vsum3,vsum4,vmax,vmin,vzero;
812 vector signed int vsample1,vsample2,vsample3;
813 vector unsigned int vshift;
814 vector signed int vclip;
815 vzero = vec_xor(vzero, vzero);
816 vclip = vec_xor(vclip, vclip);
817 vshift = vec_splat_u32(-1); /* 31 */
818#ifdef __APPLE__
819 vmax = (vector float)(32767.999f);
820 vmin = (vector float)(-32768.0f);
821 vperm4 = (vector unsigned char)(0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31);
822 vperm5 = (vector unsigned char)(8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31);
823#else
824 vmax = (vector float){32767.999f,32767.999f,32767.999f,32767.999f};
825 vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
826 vperm4 = (vector unsigned char){0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31};
827 vperm5 = (vector unsigned char){8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31};
828#endif
829
830 vperm1 = vec_lvsl(0,window);
831 vperm2 = vec_lvsl(0,samples);
832 vperm3 = vec_lvsr(0,samples);
833 for (j=4;j;j--)
834 {
835 SYNTH_ALTIVEC(16);
836
837 vsum = vec_sub(v5,v6);
838 v9 = vec_sub(v7,v8);
839 v1 = vec_add(vsum,v9);
840 vsum = (vector float)vec_cts(v1,16);
841 v8 = (vector float)vec_cmpgt(v1,vmax);
842 v9 = (vector float)vec_cmplt(v1,vmin);
843
844 vsample1 = vec_ld(0,samples);
845 vsample2 = vec_ld(16,samples);
846 vsample3 = vec_ld(31,samples);
847 v1 = (vector float)vec_perm(vsample1, vsample2, vperm2);
848 v2 = (vector float)vec_perm(vsample2, vsample3, vperm2);
849 v1 = vec_perm(vsum, v1, vperm4);
850 v2 = vec_perm(vsum, v2, vperm5);
851 v3 = (vector float)vec_perm(vsample3, vsample2, vperm2);
852 v4 = (vector float)vec_perm(vsample2, vsample1, vperm2);
853 v5 = vec_perm(v2, v3, vperm3);
854 v6 = vec_perm(v1, v2, vperm3);
855 v7 = vec_perm(v4, v1, vperm3);
856 vec_st((vector signed int)v5,31,samples);
857 vec_st((vector signed int)v6,16,samples);
858 vec_st((vector signed int)v7,0,samples);
859 samples += 8;
860
861 v1 = (vector float)vec_sr((vector unsigned int)v8, vshift);
862 v2 = (vector float)vec_sr((vector unsigned int)v9, vshift);
863 v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
864 vclip = vec_sums((vector signed int)v1,vclip);
865 }
866
867 for (j=4;j;j--)
868 {
869 SYNTH_ALTIVEC(-16);
870
871 vsum = vec_add(v5,v6);
872 v9 = vec_add(v7,v8);
873 v1 = vec_add(vsum,v9);
874 vsum = (vector float)vec_cts(v1,16);
875 v8 = (vector float)vec_cmpgt(v1,vmax);
876 v9 = (vector float)vec_cmplt(v1,vmin);
877
878 vsample1 = vec_ld(0,samples);
879 vsample2 = vec_ld(16,samples);
880 vsample3 = vec_ld(31,samples);
881 v1 = (vector float)vec_perm(vsample1, vsample2, vperm2);
882 v2 = (vector float)vec_perm(vsample2, vsample3, vperm2);
883 v1 = vec_perm(vsum, v1, vperm4);
884 v2 = vec_perm(vsum, v2, vperm5);
885 v3 = (vector float)vec_perm(vsample3, vsample2, vperm2);
886 v4 = (vector float)vec_perm(vsample2, vsample1, vperm2);
887 v5 = vec_perm(v2, v3, vperm3);
888 v6 = vec_perm(v1, v2, vperm3);
889 v7 = vec_perm(v4, v1, vperm3);
890 vec_st((vector signed int)v5,31,samples);
891 vec_st((vector signed int)v6,16,samples);
892 vec_st((vector signed int)v7,0,samples);
893 samples += 8;
894
895 v1 = (vector float)vec_sr((vector unsigned int)v8, vshift);
896 v2 = (vector float)vec_sr((vector unsigned int)v9, vshift);
897 v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
898 vclip = vec_sums((vector signed int)v1,vclip);
899 }
900
901 vec_st(vclip,0,clip_tmp);
902 clip = clip_tmp[3];
903 }
904 if(final) fr->buffer.fill += 256;
905
906 return clip;
907}
INT32 int32_t
Definition: types.h:71

◆ synth_1to1_s32_avx()

int synth_1to1_s32_avx ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_s32_i386()

int synth_1to1_s32_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_s32_m2s()

int synth_1to1_s32_m2s ( real ,
mpg123_handle  
)

◆ synth_1to1_s32_mono()

int synth_1to1_s32_mono ( real ,
mpg123_handle  
)

◆ synth_1to1_s32_neon()

int synth_1to1_s32_neon ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_s32_neon64()

int synth_1to1_s32_neon64 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_s32_sse()

int synth_1to1_s32_sse ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_s32_stereo_altivec()

int synth_1to1_s32_stereo_altivec ( real bandPtr_l,
real bandPtr_r,
mpg123_handle fr 
)

Definition at line 910 of file synth_altivec.c.

911{
912 int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
913
914 real *b0l, *b0r, **bufl, **bufr;
915 int clip;
916 int bo1;
917#ifndef NO_EQUALIZER
918 if(fr->have_eq_settings)
919 {
920 do_equalizer(bandPtr_l,0,fr->equalizer);
921 do_equalizer(bandPtr_r,1,fr->equalizer);
922 }
923#endif
924 fr->bo--;
925 fr->bo &= 0xf;
926 bufl = fr->real_buffs[0];
927 bufr = fr->real_buffs[1];
928
929 if(fr->bo & 0x1)
930 {
931 b0l = bufl[0];
932 b0r = bufr[0];
933 bo1 = fr->bo;
934 dct64_altivec(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
935 dct64_altivec(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
936 }
937 else
938 {
939 b0l = bufl[1];
940 b0r = bufr[1];
941 bo1 = fr->bo+1;
942 dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
943 dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
944 }
945
946
947 {
948 register int j;
949 real *window = fr->decwin + 16 - bo1;
950
951 ALIGNED(16) int clip_tmp[4];
952 vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
953 vector unsigned char vperm1,vperm2;
954 vector float vsum,vsum2,vsum3,vsum4,vsum5,vsum6,vsum7,vsum8,vmax,vmin,vzero;
955 vector float vprev;
956 vector unsigned int vshift;
957 vector signed int vclip;
958 vzero = vec_xor(vzero, vzero);
959 vclip = vec_xor(vclip, vclip);
960 vshift = vec_splat_u32(-1); /* 31 */
961#ifdef __APPLE__
962 vmax = (vector float)(32767.999f);
963 vmin = (vector float)(-32768.0f);
964#else
965 vmax = (vector float){32767.999f,32767.999f,32767.999f,32767.999f};
966 vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
967#endif
968
969 vperm1 = vec_lvsl(0,window);
970 vperm2 = vec_lvsr(0,samples);
971 vprev = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
972 for (j=4;j;j--)
973 {
975
976 vsum = vec_sub(vsum,vsum2);
977 vsum2 = vec_sub(vsum5,vsum6);
978 vsum3 = vec_sub(vsum3,vsum4);
979 vsum4 = vec_sub(vsum7,vsum8);
980 v1 = vec_add(vsum,vsum3);
981 v2 = vec_add(vsum2,vsum4);
982 vsum = (vector float)vec_cts(v1,16);
983 vsum2 = (vector float)vec_cts(v2,16);
984 v5 = (vector float)vec_cmpgt(v1,vmax);
985 v6 = (vector float)vec_cmplt(v1,vmin);
986 v7 = (vector float)vec_cmpgt(v2,vmax);
987 v8 = (vector float)vec_cmplt(v2,vmin);
988
989 v1 = vec_mergeh(vsum, vsum2);
990 v2 = vec_mergel(vsum, vsum2);
991 v3 = vec_perm(vprev,v1,vperm2);
992 v4 = vec_perm(v1,v2,vperm2);
993 vprev = v2;
994 vec_st((vector signed int)v3,0,samples);
995 vec_st((vector signed int)v4,16,samples);
996 samples += 8;
997
998 v1 = (vector float)vec_sr((vector unsigned int)v5, vshift);
999 v2 = (vector float)vec_sr((vector unsigned int)v6, vshift);
1000 v3 = (vector float)vec_sr((vector unsigned int)v7, vshift);
1001 v4 = (vector float)vec_sr((vector unsigned int)v8, vshift);
1002 v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
1003 v2 = (vector float)vec_add((vector unsigned int)v3,(vector unsigned int)v4);
1004 vclip = vec_sums((vector signed int)v1,vclip);
1005 vclip = vec_sums((vector signed int)v2,vclip);
1006 }
1007
1008 for (j=4;j;j--)
1009 {
1011
1012 vsum = vec_add(vsum,vsum2);
1013 vsum2 = vec_add(vsum5,vsum6);
1014 vsum3 = vec_add(vsum3,vsum4);
1015 vsum4 = vec_add(vsum7,vsum8);
1016 v1 = vec_add(vsum,vsum3);
1017 v2 = vec_add(vsum2,vsum4);
1018 vsum = (vector float)vec_cts(v1,16);
1019 vsum2 = (vector float)vec_cts(v2,16);
1020 v5 = (vector float)vec_cmpgt(v1,vmax);
1021 v6 = (vector float)vec_cmplt(v1,vmin);
1022 v7 = (vector float)vec_cmpgt(v2,vmax);
1023 v8 = (vector float)vec_cmplt(v2,vmin);
1024
1025 v1 = vec_mergeh(vsum, vsum2);
1026 v2 = vec_mergel(vsum, vsum2);
1027 v3 = vec_perm(vprev,v1,vperm2);
1028 v4 = vec_perm(v1,v2,vperm2);
1029 vprev = v2;
1030 vec_st((vector signed int)v3,0,samples);
1031 vec_st((vector signed int)v4,16,samples);
1032 samples += 8;
1033
1034 v1 = (vector float)vec_sr((vector unsigned int)v5, vshift);
1035 v2 = (vector float)vec_sr((vector unsigned int)v6, vshift);
1036 v3 = (vector float)vec_sr((vector unsigned int)v7, vshift);
1037 v4 = (vector float)vec_sr((vector unsigned int)v8, vshift);
1038 v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
1039 v2 = (vector float)vec_add((vector unsigned int)v3,(vector unsigned int)v4);
1040 vclip = vec_sums((vector signed int)v1,vclip);
1041 vclip = vec_sums((vector signed int)v2,vclip);
1042 }
1043
1044 if((size_t)samples & 0xf)
1045 {
1046 v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
1047 v2 = (vector float)vec_perm(vprev,v1,vperm2);
1048 vec_st((vector signed int)v2,0,samples);
1049 }
1050
1051 vec_st(vclip,0,clip_tmp);
1052 clip = clip_tmp[3];
1053 }
1054 fr->buffer.fill += 256;
1055
1056 return clip;
1057}

◆ synth_1to1_s32_stereo_avx()

int synth_1to1_s32_stereo_avx ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_s32_stereo_neon()

int synth_1to1_s32_stereo_neon ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_s32_stereo_sse()

int synth_1to1_s32_stereo_sse ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_s32_stereo_x86_64()

int synth_1to1_s32_stereo_x86_64 ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_s32_x86_64()

int synth_1to1_s32_x86_64 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_s32st_neon64()

int synth_1to1_s32st_neon64 ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_sse()

int synth_1to1_sse ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_1to1_stereo_altivec()

int synth_1to1_stereo_altivec ( real bandPtr_l,
real bandPtr_r,
mpg123_handle fr 
)

Definition at line 389 of file synth_altivec.c.

390{
391 short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
392
393 real *b0l, *b0r, **bufl, **bufr;
394 int clip;
395 int bo1;
396#ifndef NO_EQUALIZER
397 if(fr->have_eq_settings)
398 {
399 do_equalizer(bandPtr_l,0,fr->equalizer);
400 do_equalizer(bandPtr_r,1,fr->equalizer);
401 }
402#endif
403 fr->bo--;
404 fr->bo &= 0xf;
405 bufl = fr->real_buffs[0];
406 bufr = fr->real_buffs[1];
407
408 if(fr->bo & 0x1)
409 {
410 b0l = bufl[0];
411 b0r = bufr[0];
412 bo1 = fr->bo;
413 dct64_altivec(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
414 dct64_altivec(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
415 }
416 else
417 {
418 b0l = bufl[1];
419 b0r = bufr[1];
420 bo1 = fr->bo+1;
421 dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
422 dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
423 }
424
425
426 {
427 register int j;
428 real *window = fr->decwin + 16 - bo1;
429
430 ALIGNED(16) int clip_tmp[4];
431 vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
432 vector unsigned char vperm1,vperm2;
433 vector float vsum,vsum2,vsum3,vsum4,vsum5,vsum6,vsum7,vsum8,vmin,vmax,vzero;
434 vector signed int vclip;
435 vector unsigned int vshift;
436 vector signed short vprev;
437 vclip = vec_xor(vclip,vclip);
438 vzero = vec_xor(vzero,vzero);
439 vshift = vec_splat_u32(-1); /* 31 */
440#ifdef __APPLE__
441 vmax = (vector float)(32767.0f);
442 vmin = (vector float)(-32768.0f);
443#else
444 vmax = (vector float){32767.0f,32767.0f,32767.0f,32767.0f};
445 vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
446#endif
447
448 vperm1 = vec_lvsl(0,window);
449 vperm2 = vec_lvsr(0,samples);
450 vprev = vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
451 for (j=4;j;j--)
452 {
454
455 vsum = vec_sub(vsum,vsum2);
456 vsum2 = vec_sub(vsum5,vsum6);
457 vsum3 = vec_sub(vsum3,vsum4);
458 vsum4 = vec_sub(vsum7,vsum8);
459 vsum = vec_add(vsum,vsum3);
460 vsum2 = vec_add(vsum2,vsum4);
461
462 v1 = vec_round(vsum);
463 v2 = vec_round(vsum2);
464 v1 = (vector float)vec_cts(v1,0);
465 v2 = (vector float)vec_cts(v2,0);
466 v3 = vec_mergeh(v1, v2);
467 v4 = vec_mergel(v1, v2);
468 v5 = (vector float)vec_packs((vector signed int)v3,(vector signed int)v4);
469 v6 = (vector float)vec_perm(vprev,(vector signed short)v5,vperm2);
470 vprev = (vector signed short)v5;
471 v1 = (vector float)vec_cmpgt(vsum,vmax);
472 v2 = (vector float)vec_cmplt(vsum,vmin);
473 v3 = (vector float)vec_cmpgt(vsum2,vmax);
474 v4 = (vector float)vec_cmplt(vsum2,vmin);
475 vec_st((vector signed short)v6,0,samples);
476 samples += 8;
477
478 v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
479 v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
480 v3 = (vector float)vec_sr((vector unsigned int)v3, vshift);
481 v4 = (vector float)vec_sr((vector unsigned int)v4, vshift);
482 v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
483 v2 = (vector float)vec_add((vector unsigned int)v3,(vector unsigned int)v4);
484 vclip = vec_sums((vector signed int)v1,vclip);
485 vclip = vec_sums((vector signed int)v2,vclip);
486 }
487
488 for (j=4;j;j--)
489 {
491
492 vsum = vec_add(vsum,vsum2);
493 vsum2 = vec_add(vsum5,vsum6);
494 vsum3 = vec_add(vsum3,vsum4);
495 vsum4 = vec_add(vsum7,vsum8);
496 vsum = vec_add(vsum,vsum3);
497 vsum2 = vec_add(vsum2,vsum4);
498
499 v1 = vec_round(vsum);
500 v2 = vec_round(vsum2);
501 v1 = (vector float)vec_cts(v1,0);
502 v2 = (vector float)vec_cts(v2,0);
503 v3 = vec_mergeh(v1, v2);
504 v4 = vec_mergel(v1, v2);
505 v5 = (vector float)vec_packs((vector signed int)v3,(vector signed int)v4);
506 v6 = (vector float)vec_perm(vprev,(vector signed short)v5,vperm2);
507 vprev = (vector signed short)v5;
508 v1 = (vector float)vec_cmpgt(vsum,vmax);
509 v2 = (vector float)vec_cmplt(vsum,vmin);
510 v3 = (vector float)vec_cmpgt(vsum2,vmax);
511 v4 = (vector float)vec_cmplt(vsum2,vmin);
512 vec_st((vector signed short)v6,0,samples);
513 samples += 8;
514
515 v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
516 v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
517 v3 = (vector float)vec_sr((vector unsigned int)v3, vshift);
518 v4 = (vector float)vec_sr((vector unsigned int)v4, vshift);
519 v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
520 v2 = (vector float)vec_add((vector unsigned int)v3,(vector unsigned int)v4);
521 vclip = vec_sums((vector signed int)v1,vclip);
522 vclip = vec_sums((vector signed int)v2,vclip);
523 }
524
525 if((size_t)samples & 0xf)
526 {
527 v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
528 v2 = (vector float)vec_perm(vprev,(vector signed short)v1,vperm2);
529 vec_st((vector signed short)v2,0,samples);
530 }
531
532 vec_st(vclip,0,clip_tmp);
533 clip = clip_tmp[3];
534 }
535 fr->buffer.fill += 128;
536
537 return clip;
538}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94

◆ synth_1to1_stereo_avx()

int synth_1to1_stereo_avx ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_stereo_neon()

int synth_1to1_stereo_neon ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_stereo_neon64()

int synth_1to1_stereo_neon64 ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_stereo_sse()

int synth_1to1_stereo_sse ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_stereo_x86_64()

int synth_1to1_stereo_x86_64 ( real ,
real ,
mpg123_handle  
)

◆ synth_1to1_x86_64()

int synth_1to1_x86_64 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1()

int synth_2to1 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_8bit()

int synth_2to1_8bit ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_8bit_i386()

int synth_2to1_8bit_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_8bit_m2s()

int synth_2to1_8bit_m2s ( real ,
mpg123_handle  
)

◆ synth_2to1_8bit_mono()

int synth_2to1_8bit_mono ( real ,
mpg123_handle  
)

◆ synth_2to1_dither()

int synth_2to1_dither ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_i386()

int synth_2to1_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_m2s()

int synth_2to1_m2s ( real ,
mpg123_handle  
)

◆ synth_2to1_mono()

int synth_2to1_mono ( real ,
mpg123_handle  
)

◆ synth_2to1_real()

int synth_2to1_real ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_real_i386()

int synth_2to1_real_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_real_m2s()

int synth_2to1_real_m2s ( real ,
mpg123_handle  
)

◆ synth_2to1_real_mono()

int synth_2to1_real_mono ( real ,
mpg123_handle  
)

◆ synth_2to1_s32()

int synth_2to1_s32 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_s32_i386()

int synth_2to1_s32_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_2to1_s32_m2s()

int synth_2to1_s32_m2s ( real ,
mpg123_handle  
)

◆ synth_2to1_s32_mono()

int synth_2to1_s32_mono ( real ,
mpg123_handle  
)

◆ synth_4to1()

int synth_4to1 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_8bit()

int synth_4to1_8bit ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_8bit_i386()

int synth_4to1_8bit_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_8bit_m2s()

int synth_4to1_8bit_m2s ( real ,
mpg123_handle  
)

◆ synth_4to1_8bit_mono()

int synth_4to1_8bit_mono ( real ,
mpg123_handle  
)

◆ synth_4to1_dither()

int synth_4to1_dither ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_i386()

int synth_4to1_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_m2s()

int synth_4to1_m2s ( real ,
mpg123_handle  
)

◆ synth_4to1_mono()

int synth_4to1_mono ( real ,
mpg123_handle  
)

◆ synth_4to1_real()

int synth_4to1_real ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_real_i386()

int synth_4to1_real_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_real_m2s()

int synth_4to1_real_m2s ( real ,
mpg123_handle  
)

◆ synth_4to1_real_mono()

int synth_4to1_real_mono ( real ,
mpg123_handle  
)

◆ synth_4to1_s32()

int synth_4to1_s32 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_s32_i386()

int synth_4to1_s32_i386 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_4to1_s32_m2s()

int synth_4to1_s32_m2s ( real ,
mpg123_handle  
)

◆ synth_4to1_s32_mono()

int synth_4to1_s32_mono ( real ,
mpg123_handle  
)

◆ synth_ntom()

int synth_ntom ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_ntom_8bit()

int synth_ntom_8bit ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_ntom_8bit_m2s()

int synth_ntom_8bit_m2s ( real ,
mpg123_handle  
)

◆ synth_ntom_8bit_mono()

int synth_ntom_8bit_mono ( real ,
mpg123_handle  
)

◆ synth_ntom_m2s()

int synth_ntom_m2s ( real ,
mpg123_handle  
)

◆ synth_ntom_mono()

int synth_ntom_mono ( real ,
mpg123_handle  
)

◆ synth_ntom_real()

int synth_ntom_real ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_ntom_real_m2s()

int synth_ntom_real_m2s ( real ,
mpg123_handle  
)

◆ synth_ntom_real_mono()

int synth_ntom_real_mono ( real ,
mpg123_handle  
)

◆ synth_ntom_s32()

int synth_ntom_s32 ( real ,
int  ,
mpg123_handle ,
int   
)

◆ synth_ntom_s32_m2s()

int synth_ntom_s32_m2s ( real ,
mpg123_handle  
)

◆ synth_ntom_s32_mono()

int synth_ntom_s32_mono ( real ,
mpg123_handle  
)

◆ synth_ntom_set_step()

int synth_ntom_set_step ( mpg123_handle fr)

Definition at line 13 of file ntom.c.

14{
15 long m,n;
16 m = frame_freq(fr);
17 n = fr->af.rate;
18 if(VERBOSE2)
19 fprintf(stderr,"Init rate converter: %ld->%ld\n",m,n);
20
21 if(n > NTOM_MAX_FREQ || m > NTOM_MAX_FREQ || m <= 0 || n <= 0) {
22 if(NOQUIET) error("NtoM converter: illegal rates");
23 fr->err = MPG123_BAD_RATE;
24 return -1;
25 }
26
27 n *= NTOM_MUL;
28 fr->ntom_step = (unsigned long) n / m;
29
30 if(fr->ntom_step > (unsigned long)NTOM_MAX*NTOM_MUL) {
31 if(NOQUIET) error3("max. 1:%i conversion allowed (%lu vs %lu)!", NTOM_MAX, fr->ntom_step, (unsigned long)8*NTOM_MUL);
32 fr->err = MPG123_BAD_RATE;
33 return -1;
34 }
35
36 fr->ntom_val[0] = fr->ntom_val[1] = ntom_val(fr, fr->num);
37 return 0;
38}
#define NTOM_MAX_FREQ
Definition: decode.h:31
#define NTOM_MAX
Definition: decode.h:30
@ MPG123_BAD_RATE
Definition: mpg123.h:386
#define frame_freq
Definition: intsym.h:239
#define long
Definition: qsort.c:33
#define error3(s, a, b, c)
Definition: debug.h:127

Variable Documentation

◆ pnts

real* pnts[5]
extern

Definition at line 45 of file tabinit.c.

Referenced by prepare_decode_tables().