MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / mad_synth_frame

Function mad_synth_frame

modules/data/mp3/libmad/synth.c:873–900  ·  view source on GitHub ↗

NAME: synth->frame() DESCRIPTION: perform PCM synthesis of frame subband samples */

Source from the content-addressed store, hash-verified

871 DESCRIPTION: perform PCM synthesis of frame subband samples
872*/
873enum 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

Callers 2

xs_mp3_decodeFunction · 0.85
run_syncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected