NAME: synth->frame() DESCRIPTION: perform PCM synthesis of frame subband samples */
| 871 | DESCRIPTION: perform PCM synthesis of frame subband samples |
| 872 | */ |
| 873 | enum mad_flow mad_synth_frame(struct mad_synth *synth, struct mad_frame const *frame, enum mad_flow (*output_func)(void *s, struct mad_header const *, struct mad_pcm *), void *cbdata) |
| 874 | //void mad_synth_frame(struct mad_synth *synth, struct mad_frame const *frame) |
| 875 | { |
| 876 | unsigned int nch, ns; |
| 877 | enum mad_flow (*synth_frame)(struct mad_synth *, struct mad_frame const *, unsigned int, unsigned int, unsigned int, enum mad_flow (*output_func)(), void *); |
| 878 | |
| 879 | nch = MAD_NCHANNELS(&frame->header); |
| 880 | ns = MAD_NSBSAMPLES(&frame->header); |
| 881 | |
| 882 | synth->pcm.samplerate = frame->header.samplerate; |
| 883 | synth->pcm.channels = nch; |
| 884 | synth->pcm.length = 32;// * ns; |
| 885 | |
| 886 | synth_frame = synth_full; |
| 887 | |
| 888 | if (frame->options & MAD_OPTION_HALFSAMPLERATE) { |
| 889 | synth->pcm.samplerate /= 2; |
| 890 | synth->pcm.length /= 2; |
| 891 | |
| 892 | synth_frame = synth_half; |
| 893 | } |
| 894 | |
| 895 | enum mad_flow ret = synth_frame(synth, frame, nch, 0, ns, output_func, cbdata); |
| 896 | |
| 897 | synth->phase = (synth->phase + ns) % 16; |
| 898 | |
| 899 | return ret; |
| 900 | } |
| 901 | |
| 902 | // Synthesize a single NS of the frame, return in the synth->pcm.samples |
| 903 | // Up to caller to increment synth->phase, only call proper # of ns |
no outgoing calls
no test coverage detected