Home | History | Annotate | Download | only in sbc

Lines Matching refs:hdr

64 static int calc_frame_len(struct sbc_frame_hdr *hdr)
68 nrof_subbands = (hdr->subbands + 1) * 4;
69 nrof_blocks = (hdr->blocks + 1) * 4;
71 switch (hdr->channel_mode) {
74 tmp = nrof_blocks * hdr->bitpool;
77 tmp = nrof_blocks * hdr->bitpool * 2;
80 tmp = nrof_blocks * hdr->bitpool;
83 tmp = nrof_blocks * hdr->bitpool + nrof_subbands;
92 static double calc_bit_rate(struct sbc_frame_hdr *hdr)
97 nrof_subbands = (hdr->subbands + 1) * 4;
98 nrof_blocks = (hdr->blocks + 1) * 4;
100 switch (hdr->sampling_frequency) {
117 return ((8 * (calc_frame_len(hdr) + 4) * f) /
173 struct sbc_frame_hdr hdr;
193 len = __read(fd, &hdr, sizeof(hdr));
194 if (len != sizeof(hdr) || hdr.syncword != 0x9c) {
199 subbands = (hdr.subbands + 1) * 4;
200 blocks = (hdr.blocks + 1) * 4;
201 freq = hdr.sampling_frequency;
202 method = hdr.allocation_method;
204 count = calc_frame_len(&hdr);
206 bitpool[0] = hdr.bitpool;
216 rate = calc_bit_rate(&hdr);
230 len = __read(fd, &hdr, sizeof(hdr));
240 if ((size_t) len < sizeof(hdr) || hdr.syncword != 0x9c) {
243 len, hdr.syncword);
247 count = calc_frame_len(&hdr);
253 if (p1 < 0 && (bitpool[n] == 0 || bitpool[n] == hdr.bitpool))
259 bitpool[p1] = hdr.bitpool;
276 rate += calc_bit_rate(&hdr);
283 printf("Channel mode\t\t%s\n", mode2str(hdr.channel_mode));