#include "mpg123lib_intern.h"
#include "getbits.h"
#include "debug.h"
Go to the source code of this file.
◆ MINUS_SHIFT
◆ NEED_BITS
Value: if((fr)->bits_avail <
num) \
{ \
error2(
"%u bits needed, %li available",
num, (fr)->bits_avail); \
return -1; \
} \
Definition at line 37 of file layer1.c.
◆ check_balloc()
Definition at line 24 of file layer1.c.
25{
26 unsigned int *ba;
27 for(ba=balloc; ba !=
end; ++ba)
28 if(*ba == 15)
29 {
31 return -1;
32 }
33
34 return 0;
35}
Referenced by I_step_one().
◆ do_layer1()
Definition at line 211 of file layer1.c.
212{
213 int clip=0;
215 unsigned int balloc[2*
SBLIMIT];
216 unsigned int scale_index[2][
SBLIMIT];
219
221
224
226 {
228 error(
"Aborting layer I decoding after step one.");
229 return clip;
230 }
231
233 {
234 if(
I_step_two(fraction,balloc,scale_index,fr))
235 {
237 error(
"Aborting layer I decoding after step two.");
238 return clip;
239 }
240
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}
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
static int I_step_two(real fraction[2][SBLIMIT], unsigned int balloc[2 *SBLIMIT], unsigned int scale_index[2][SBLIMIT], mpg123_handle *fr)
static int I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT], mpg123_handle *fr)
#define MPG_MD_JOINT_STEREO
func_synth_mono synth_mono
func_synth_stereo synth_stereo
struct mpg123_handle_struct::@3460 layer1
◆ I_step_one()
Definition at line 45 of file layer1.c.
46{
47 unsigned int *ba=balloc;
48 unsigned int *sca = (unsigned int *) scale_index;
49
51 {
54 unsigned int needbits = jsbound*2*4 + (
SBLIMIT-jsbound)*4;
55
57 needbits = 0;
58 for(
i=0;
i<jsbound;
i++)
59 {
62 needbits += ((ba[0]?1:0)+(ba[1]?1:0))*6;
63 ba+=2;
64 }
66 {
68 needbits += (*ba?1:0)*12;
69 ++ba;
70 }
71
73
74 ba = balloc;
76 for(
i=0;
i<jsbound;
i++)
77 {
78 if ((*ba++))
80 if ((*ba++))
82 }
84 {
87 }
88 }
89 else
90 {
92 unsigned int needbits =
SBLIMIT*4;
93
95 needbits = 0;
97 {
99 needbits += (*ba?1:0)*6;
100 ++ba;
101 }
102
104
105 ba = balloc;
108 if ((*ba++))
110 }
111
112 return 0;
113}
#define getbits_fast(fr, nob)
#define NEED_BITS(fr, num)
static int check_balloc(mpg123_handle *fr, unsigned int *balloc, unsigned int *end)
Referenced by do_layer1().
◆ I_step_two()
Definition at line 118 of file layer1.c.
119{
122 int *sample;
123 register unsigned int *ba;
124 register unsigned int *sca = (unsigned int *) scale_index;
125
127 {
128 unsigned int needbits = 0;
130 register real *f0 = fraction[0];
131 register real *
f1 = fraction[1];
132
133 ba = balloc;
134 for(sample=smpb,
i=0;
i<jsbound;
i++)
135 {
140 }
145
146 ba = balloc;
147 for(sample=smpb,
i=0;
i<jsbound;
i++)
148 {
149 if((
n = *ba++)) *sample++ =
getbits(fr,
n+1);
150
151 if((
n = *ba++)) *sample++ =
getbits(fr,
n+1);
152 }
156
157 ba = balloc;
158 for(sample=smpb,
i=0;
i<jsbound;
i++)
159 {
163
167 }
169 {
171 {
175 }
177 }
179 fraction[0][
i] = fraction[1][
i] = 0.0;
180 }
181 else
182 {
183 unsigned int needbits = 0;
184 register real *f0 = fraction[0];
185
186 ba = balloc;
191
192 ba = balloc;
196
197
198 ba = balloc;
200 {
204 }
207 }
208 return 0;
209}
static unsigned int getbits(mpg123_handle *fr, int number_of_bits)
#define REAL_MUL_SCALE_LAYER12(x, y)
#define DOUBLE_TO_REAL_15(x)
#define DOUBLE_TO_REAL(x)
Referenced by do_layer1().