• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/ffmpeg/libavcodec/

Lines Matching refs:hdr

37 int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
41 memset(hdr, 0, sizeof(*hdr));
43 hdr->sync_word = get_bits(gbc, 16);
44 if(hdr->sync_word != 0x0B77)
48 hdr->bitstream_id = show_bits_long(gbc, 29) & 0x1F;
49 if(hdr->bitstream_id > 16)
52 hdr->num_blocks = 6;
55 hdr->center_mix_level = 1; // -4.5dB
56 hdr->surround_mix_level = 1; // -6.0dB
58 if(hdr->bitstream_id <= 10) {
60 hdr->crc1 = get_bits(gbc, 16);
61 hdr->sr_code = get_bits(gbc, 2);
62 if(hdr->sr_code == 3)
72 hdr->channel_mode = get_bits(gbc, 3);
74 if(hdr->channel_mode == AC3_CHMODE_STEREO) {
77 if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO)
78 hdr->center_mix_level = get_bits(gbc, 2);
79 if(hdr->channel_mode & 4)
80 hdr->surround_mix_level = get_bits(gbc, 2);
82 hdr->lfe_on = get_bits1(gbc);
84 hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8;
85 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift;
86 hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift;
87 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
88 hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2;
89 hdr->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT; //EAC3_FRAME_TYPE_INDEPENDENT;
90 hdr->substreamid = 0;
93 hdr->crc1 = 0;
94 hdr->frame_type = get_bits(gbc, 2);
95 if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED)
98 hdr->substreamid = get_bits(gbc, 3);
100 hdr->frame_size = (get_bits(gbc, 11) + 1) << 1;
101 if(hdr->frame_size < AC3_HEADER_SIZE)
104 hdr->sr_code = get_bits(gbc, 2);
105 if (hdr->sr_code == 3) {
109 hdr->sample_rate = ff_ac3_sample_rate_tab[sr_code2] / 2;
110 hdr->sr_shift = 1;
112 hdr->num_blocks = eac3_blocks[get_bits(gbc, 2)];
113 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code];
114 hdr->sr_shift = 0;
117 hdr->channel_mode = get_bits(gbc, 3);
118 hdr->lfe_on = get_bits1(gbc);
120 hdr->bit_rate = (uint32_t)(8.0 * hdr->frame_size * hdr->sample_rate /
121 (hdr->num_blocks * 256.0));
122 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
124 hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode];
125 if (hdr->lfe_on)
126 hdr->channel_layout |= CH_LOW_FREQUENCY;
131 int ff_ac3_parse_header_full(GetBitContext *gbc, AC3HeaderInfo *hdr){
133 ret = ff_ac3_parse_header(gbc, hdr);
135 if(hdr->bitstream_id>10){
140 for (i = 0; i < (hdr->channel_mode ? 1 : 2); i++) {
147 if (hdr->frame_type == EAC3_FRAME_TYPE_DEPENDENT && get_bits1(gbc)) {
148 hdr->channel_map = get_bits(gbc, 16); //custom channel map
153 hdr->channel_map = ff_eac3_default_chmap[hdr->channel_mode];
154 if(hdr->lfe_on)
155 hdr->channel_map |= AC3_CHMAP_LFE;
168 AC3HeaderInfo hdr;
172 err = ff_ac3_parse_header(&gbc, &hdr);
177 hdr_info->sample_rate = hdr.sample_rate;
178 hdr_info->bit_rate = hdr.bit_rate;
179 hdr_info->channels = hdr.channels;
180 hdr_info->channel_layout = hdr.channel_layout;
181 hdr_info->samples = hdr.num_blocks * 256;
182 if(hdr.bitstream_id>10)
187 *need_next_header = (hdr.frame_type != EAC3_FRAME_TYPE_AC3_CONVERT);
188 *new_frame_start = (hdr.frame_type != EAC3_FRAME_TYPE_DEPENDENT);
189 return hdr.frame_size;