comparison eac3dec.c @ 8281:f93efc084e41 libavcodec

Make av_log_missing_feature an internal function, and change its name to ff_log_missing_feature.
author stefano
date Mon, 08 Dec 2008 21:21:38 +0000
parents 55aba5d428f3
children a5402e89a80c
comparison
equal deleted inserted replaced
8280:63aba08af550 8281:f93efc084e41
19 * License along with FFmpeg; if not, write to the Free Software 19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */ 21 */
22 22
23 #include "avcodec.h" 23 #include "avcodec.h"
24 #include "internal.h"
24 #include "ac3.h" 25 #include "ac3.h"
25 #include "ac3_parser.h" 26 #include "ac3_parser.h"
26 #include "ac3dec.h" 27 #include "ac3dec.h"
27 #include "ac3dec_data.h" 28 #include "ac3dec_data.h"
28 29
180 181
181 /* An E-AC-3 stream can have multiple independent streams which the 182 /* An E-AC-3 stream can have multiple independent streams which the
182 application can select from. each independent stream can also contain 183 application can select from. each independent stream can also contain
183 dependent streams which are used to add or replace channels. */ 184 dependent streams which are used to add or replace channels. */
184 if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) { 185 if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
185 av_log_missing_feature(s->avctx, "Dependent substream decoding", 1); 186 ff_log_missing_feature(s->avctx, "Dependent substream decoding", 1);
186 return AC3_PARSE_ERROR_FRAME_TYPE; 187 return AC3_PARSE_ERROR_FRAME_TYPE;
187 } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) { 188 } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
188 av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n"); 189 av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
189 return AC3_PARSE_ERROR_FRAME_TYPE; 190 return AC3_PARSE_ERROR_FRAME_TYPE;
190 } 191 }
192 /* The substream id indicates which substream this frame belongs to. each 193 /* The substream id indicates which substream this frame belongs to. each
193 independent stream has its own substream id, and the dependent streams 194 independent stream has its own substream id, and the dependent streams
194 associated to an independent stream have matching substream id's. */ 195 associated to an independent stream have matching substream id's. */
195 if (s->substreamid) { 196 if (s->substreamid) {
196 /* only decode substream with id=0. skip any additional substreams. */ 197 /* only decode substream with id=0. skip any additional substreams. */
197 av_log_missing_feature(s->avctx, "Additional substreams", 1); 198 ff_log_missing_feature(s->avctx, "Additional substreams", 1);
198 return AC3_PARSE_ERROR_FRAME_TYPE; 199 return AC3_PARSE_ERROR_FRAME_TYPE;
199 } 200 }
200 201
201 if (s->bit_alloc_params.sr_code == EAC3_SR_CODE_REDUCED) { 202 if (s->bit_alloc_params.sr_code == EAC3_SR_CODE_REDUCED) {
202 /* The E-AC-3 specification does not tell how to handle reduced sample 203 /* The E-AC-3 specification does not tell how to handle reduced sample
203 rates in bit allocation. The best assumption would be that it is 204 rates in bit allocation. The best assumption would be that it is
204 handled like AC-3 DolbyNet, but we cannot be sure until we have a 205 handled like AC-3 DolbyNet, but we cannot be sure until we have a
205 sample which utilizes this feature. */ 206 sample which utilizes this feature. */
206 av_log_missing_feature(s->avctx, "Reduced sampling rates", 1); 207 ff_log_missing_feature(s->avctx, "Reduced sampling rates", 1);
207 return -1; 208 return -1;
208 } 209 }
209 skip_bits(gbc, 5); // skip bitstream id 210 skip_bits(gbc, 5); // skip bitstream id
210 211
211 /* volume control params */ 212 /* volume control params */
458 } 459 }
459 } 460 }
460 461
461 /* spectral extension attenuation data */ 462 /* spectral extension attenuation data */
462 if (parse_spx_atten_data) { 463 if (parse_spx_atten_data) {
463 av_log_missing_feature(s->avctx, "Spectral extension attenuation", 1); 464 ff_log_missing_feature(s->avctx, "Spectral extension attenuation", 1);
464 for (ch = 1; ch <= s->fbw_channels; ch++) { 465 for (ch = 1; ch <= s->fbw_channels; ch++) {
465 if (get_bits1(gbc)) { // channel has spx attenuation 466 if (get_bits1(gbc)) { // channel has spx attenuation
466 skip_bits(gbc, 5); // skip spx attenuation code 467 skip_bits(gbc, 5); // skip spx attenuation code
467 } 468 }
468 } 469 }
474 nblkstrtbits = (numblks - 1) * (4 + ceiling(log2(words_per_frame))) 475 nblkstrtbits = (numblks - 1) * (4 + ceiling(log2(words_per_frame)))
475 The spec does not say what this data is or what it's used for. 476 The spec does not say what this data is or what it's used for.
476 It is likely the offset of each block within the frame. */ 477 It is likely the offset of each block within the frame. */
477 int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2)); 478 int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2));
478 skip_bits_long(gbc, block_start_bits); 479 skip_bits_long(gbc, block_start_bits);
479 av_log_missing_feature(s->avctx, "Block start info", 1); 480 ff_log_missing_feature(s->avctx, "Block start info", 1);
480 } 481 }
481 482
482 /* syntax state initialization */ 483 /* syntax state initialization */
483 for (ch = 1; ch <= s->fbw_channels; ch++) { 484 for (ch = 1; ch <= s->fbw_channels; ch++) {
484 s->first_cpl_coords[ch] = 1; 485 s->first_cpl_coords[ch] = 1;