Lines Matching defs:state
63 static void deinterleave_int (STATE * state) ;
64 static void deinterleave_double (STATE * state) ;
68 { STATE *state = NULL ;
80 state = calloc (1, sizeof (*state)) ;
81 if (!state)
87 if ((state->infile = sf_open (argv [1], SFM_READ, &sfinfo)) == NULL)
104 state->channels = sfinfo.channels ;
122 for (ch = 0 ; ch < state->channels ; ch++)
132 if ((state->outfile [ch] = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL)
153 deinterleave_double (state) ;
155 deinterleave_int (state) ;
161 if (state != NULL)
162 { sf_close (state->infile) ;
164 if (state->outfile [ch] != NULL)
165 sf_close (state->outfile [ch]) ;
168 free (state) ;
189 deinterleave_int (STATE * state)
194 { read_len = (int) sf_readf_int (state->infile, state->din.i, BUFFER_LEN) ;
196 for (ch = 0 ; ch < state->channels ; ch ++)
198 state->dout.i [k] = state->din.i [k * state->channels + ch] ;
199 sf_write_int (state->outfile [ch], state->dout.i, read_len) ;
207 deinterleave_double (STATE * state)
212 { read_len = (int) sf_readf_double (state->infile, state->din.d, BUFFER_LEN) ;
214 for (ch = 0 ; ch < state->channels ; ch ++)
216 state->dout.d [k] = state->din.d [k * state->channels + ch] ;
217 sf_write_double (state->outfile [ch], state->dout.d, read_len) ;