Lines Matching refs:header
219 FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWriter *bw)
232 if(!FLAC__bitwriter_write_raw_uint32(bw, (header->number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER)? 0 : 1, FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN))
235 FLAC__ASSERT(header->blocksize > 0 && header->blocksize <= FLAC__MAX_BLOCK_SIZE);
236 /* when this assertion holds true, any legal blocksize can be expressed in the frame header */
239 switch(header->blocksize) {
254 if(header->blocksize <= 0x100)
263 FLAC__ASSERT(FLAC__format_sample_rate_is_valid(header->sample_rate));
265 switch(header->sample_rate) {
278 if(header->sample_rate <= 255000 && header->sample_rate % 1000 == 0)
280 else if(header->sample_rate % 10 == 0)
282 else if(header->sample_rate <= 0xffff)
291 FLAC__ASSERT(header->channels > 0 && header->channels <= (1u << FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN) && header->channels <= FLAC__MAX_CHANNELS);
292 switch(header->channel_assignment) {
294 u = header->channels - 1;
297 FLAC__ASSERT(header->channels == 2);
301 FLAC__ASSERT(header->channels == 2);
305 FLAC__ASSERT(header->channels == 2);
314 FLAC__ASSERT(header->bits_per_sample > 0 && header->bits_per_sample <= (1u << FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN));
315 switch(header->bits_per_sample) {
329 if(header->number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER) {
330 if(!FLAC__bitwriter_write_utf8_uint32(bw, header->number.frame_number))
334 if(!FLAC__bitwriter_write_utf8_uint64(bw, header->number.sample_number))
339 if(!FLAC__bitwriter_write_raw_uint32(bw, header->blocksize-1, (blocksize_hint==6)? 8:16))
344 if(!FLAC__bitwriter_write_raw_uint32(bw, header->sample_rate / 1000, 8))
348 if(!FLAC__bitwriter_write_raw_uint32(bw, header->sample_rate, 16))
352 if(!FLAC__bitwriter_write_raw_uint32(bw, header->sample_rate / 10, 16))