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

Function write_streaminfo

libavcodec/flacenc.c:138–158  ·  view source on GitHub ↗

* Write streaminfo metadata block to byte array. */

Source from the content-addressed store, hash-verified

136 * Write streaminfo metadata block to byte array.
137 */
138static void write_streaminfo(FlacEncodeContext *s, uint8_t *header)
139{
140 PutBitContext pb;
141
142 memset(header, 0, FLAC_STREAMINFO_SIZE);
143 init_put_bits(&pb, header, FLAC_STREAMINFO_SIZE);
144
145 /* streaminfo metadata block */
146 put_bits(&pb, 16, s->max_blocksize);
147 put_bits(&pb, 16, s->max_blocksize);
148 put_bits(&pb, 24, s->min_framesize);
149 put_bits(&pb, 24, s->max_framesize);
150 put_bits(&pb, 20, s->samplerate);
151 put_bits(&pb, 3, s->channels-1);
152 put_bits(&pb, 5, s->avctx->bits_per_raw_sample - 1);
153 /* write 36-bit sample count in 2 put_bits() calls */
154 put_bits(&pb, 24, (s->sample_count & 0xFFFFFF000LL) >> 12);
155 put_bits(&pb, 12, s->sample_count & 0x000000FFFLL);
156 flush_put_bits(&pb);
157 memcpy(&header[18], s->md5sum, 16);
158}
159
160
161/**

Callers 2

flac_encode_initFunction · 0.70
flac_encode_frameFunction · 0.70

Calls 3

init_put_bitsFunction · 0.85
flush_put_bitsFunction · 0.85
put_bitsFunction · 0.70

Tested by

no test coverage detected