comparison ac3_parser.c @ 6002:29635f7c3d9c libavcodec

cosmetics: rename ac3 tables
author jbr
date Sun, 09 Dec 2007 03:21:33 +0000
parents ced30500e2b1
children 608c8e9ac412
comparison
equal deleted inserted replaced
6001:f4859c13426b 6002:29635f7c3d9c
74 hdr->dsurmod = get_bits(&gbc, 2); 74 hdr->dsurmod = get_bits(&gbc, 2);
75 } 75 }
76 hdr->lfeon = get_bits1(&gbc); 76 hdr->lfeon = get_bits1(&gbc);
77 77
78 hdr->halfratecod = FFMAX(hdr->bsid, 8) - 8; 78 hdr->halfratecod = FFMAX(hdr->bsid, 8) - 8;
79 hdr->sample_rate = ff_ac3_freqs[hdr->fscod] >> hdr->halfratecod; 79 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->fscod] >> hdr->halfratecod;
80 hdr->bit_rate = (ff_ac3_bitratetab[hdr->frmsizecod>>1] * 1000) >> hdr->halfratecod; 80 hdr->bit_rate = (ff_ac3_bitrate_tab[hdr->frmsizecod>>1] * 1000) >> hdr->halfratecod;
81 hdr->channels = ff_ac3_channels[hdr->acmod] + hdr->lfeon; 81 hdr->channels = ff_ac3_channels_tab[hdr->acmod] + hdr->lfeon;
82 hdr->frame_size = ff_ac3_frame_sizes[hdr->frmsizecod][hdr->fscod] * 2; 82 hdr->frame_size = ff_ac3_frame_size_tab[hdr->frmsizecod][hdr->fscod] * 2;
83 83
84 return 0; 84 return 0;
85 } 85 }
86 86
87 static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate, 87 static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate,
123 numblkscod = 3; 123 numblkscod = 3;
124 124
125 if(fscod2 == 3) 125 if(fscod2 == 3)
126 return 0; 126 return 0;
127 127
128 *sample_rate = ff_ac3_freqs[fscod2] / 2; 128 *sample_rate = ff_ac3_sample_rate_tab[fscod2] / 2;
129 } else { 129 } else {
130 numblkscod = get_bits(&bits, 2); 130 numblkscod = get_bits(&bits, 2);
131 131
132 *sample_rate = ff_ac3_freqs[fscod]; 132 *sample_rate = ff_ac3_sample_rate_tab[fscod];
133 } 133 }
134 134
135 acmod = get_bits(&bits, 3); 135 acmod = get_bits(&bits, 3);
136 lfeon = get_bits1(&bits); 136 lfeon = get_bits1(&bits);
137 137
138 *samples = eac3_blocks[numblkscod] * 256; 138 *samples = eac3_blocks[numblkscod] * 256;
139 *bit_rate = frmsiz * (*sample_rate) * 16 / (*samples); 139 *bit_rate = frmsiz * (*sample_rate) * 16 / (*samples);
140 *channels = ff_ac3_channels[acmod] + lfeon; 140 *channels = ff_ac3_channels_tab[acmod] + lfeon;
141 141
142 return frmsiz * 2; 142 return frmsiz * 2;
143 } 143 }
144 144
145 /* Unsupported bitstream version */ 145 /* Unsupported bitstream version */