MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / MPA_encode_frame

Function MPA_encode_frame

libavcodec/mpegaudioenc.c:755–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755static int MPA_encode_frame(AVCodecContext *avctx,
756 unsigned char *frame, int buf_size, void *data)
757{
758 MpegAudioContext *s = avctx->priv_data;
759 short *samples = data;
760 short smr[MPA_MAX_CHANNELS][SBLIMIT];
761 unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT];
762 int padding, i;
763
764 for(i=0;i<s->nb_channels;i++) {
765 filter(s, i, samples + i, s->nb_channels);
766 }
767
768 for(i=0;i<s->nb_channels;i++) {
769 compute_scale_factors(s->scale_code[i], s->scale_factors[i],
770 s->sb_samples[i], s->sblimit);
771 }
772 for(i=0;i<s->nb_channels;i++) {
773 psycho_acoustic_model(s, smr[i]);
774 }
775 compute_bit_allocation(s, smr, bit_alloc, &padding);
776
777 init_put_bits(&s->pb, frame, MPA_MAX_CODED_FRAME_SIZE);
778
779 encode_frame(s, bit_alloc, padding);
780
781 s->nb_samples += MPA_FRAME_SIZE;
782 return put_bits_ptr(&s->pb) - s->pb.buf;
783}
784
785static av_cold int MPA_encode_close(AVCodecContext *avctx)
786{

Callers

nothing calls this directly

Calls 7

filterFunction · 0.85
compute_scale_factorsFunction · 0.85
psycho_acoustic_modelFunction · 0.85
init_put_bitsFunction · 0.85
put_bits_ptrFunction · 0.85
compute_bit_allocationFunction · 0.70
encode_frameFunction · 0.70

Tested by

no test coverage detected