Mercurial > libavcodec.hg
comparison alac.c @ 5366:59a9c1e471fc libavcodec
Yet more cosmetics
author | vitor |
---|---|
date | Wed, 18 Jul 2007 14:36:30 +0000 |
parents | 8feb956bdbee |
children | 1a1f93a4e726 |
comparison
equal
deleted
inserted
replaced
5365:8feb956bdbee | 5366:59a9c1e471fc |
---|---|
319 if (predictor_coef_num > 0) | 319 if (predictor_coef_num > 0) |
320 for (i = 0; i < predictor_coef_num; i++) { | 320 for (i = 0; i < predictor_coef_num; i++) { |
321 int32_t val; | 321 int32_t val; |
322 | 322 |
323 val = buffer_out[i] + error_buffer[i+1]; | 323 val = buffer_out[i] + error_buffer[i+1]; |
324 | |
325 val = SIGN_EXTENDED32(val, readsamplesize); | 324 val = SIGN_EXTENDED32(val, readsamplesize); |
326 | |
327 buffer_out[i+1] = val; | 325 buffer_out[i+1] = val; |
328 } | 326 } |
329 | 327 |
330 #if 0 | 328 #if 0 |
331 /* 4 and 8 are very common cases (the only ones i've seen). these | 329 /* 4 and 8 are very common cases (the only ones i've seen). these |
339 if (predictor_coef_table == 8) { | 337 if (predictor_coef_table == 8) { |
340 /* FIXME: optimised general case */ | 338 /* FIXME: optimised general case */ |
341 return; | 339 return; |
342 } | 340 } |
343 #endif | 341 #endif |
344 | |
345 | 342 |
346 /* general case */ | 343 /* general case */ |
347 if (predictor_coef_num > 0) { | 344 if (predictor_coef_num > 0) { |
348 for (i = predictor_coef_num + 1; i < output_size; i++) { | 345 for (i = predictor_coef_num + 1; i < output_size; i++) { |
349 int j; | 346 int j; |
559 predictor_coef_table[chan], | 556 predictor_coef_table[chan], |
560 predictor_coef_num[chan], | 557 predictor_coef_num[chan], |
561 prediction_quantitization[chan]); | 558 prediction_quantitization[chan]); |
562 } else { | 559 } else { |
563 av_log(avctx, AV_LOG_ERROR, "FIXME: unhandled prediction type: %i\n", prediction_type[chan]); | 560 av_log(avctx, AV_LOG_ERROR, "FIXME: unhandled prediction type: %i\n", prediction_type[chan]); |
564 /* i think the only other prediction type (or perhaps this is just a | 561 /* I think the only other prediction type (or perhaps this is |
565 * boolean?) runs adaptive fir twice.. like: | 562 * just a boolean?) runs adaptive fir twice.. like: |
566 * predictor_decompress_fir_adapt(predictor_error, tempout, ...) | 563 * predictor_decompress_fir_adapt(predictor_error, tempout, ...) |
567 * predictor_decompress_fir_adapt(predictor_error, outputsamples ...) | 564 * predictor_decompress_fir_adapt(predictor_error, outputsamples ...) |
568 * little strange.. | 565 * little strange.. |
569 */ | 566 */ |
570 } | 567 } |
571 } | 568 } |
572 } else { | 569 } else { |
573 /* not compressed, easy case */ | 570 /* not compressed, easy case */ |
574 if (alac->setinfo_sample_size <= 16) { | 571 if (alac->setinfo_sample_size <= 16) { |
575 int i, chan; | 572 int i, chan; |
576 for (chan = 0; chan < channels; chan++) { | 573 for (chan = 0; chan < channels; chan++) |
577 for (i = 0; i < outputsamples; i++) { | 574 for (i = 0; i < outputsamples; i++) { |
578 int32_t audiobits; | 575 int32_t audiobits; |
579 | 576 |
580 audiobits = get_bits(&alac->gb, alac->setinfo_sample_size); | 577 audiobits = get_bits(&alac->gb, alac->setinfo_sample_size); |
581 audiobits = SIGN_EXTENDED32(audiobits, readsamplesize); | 578 audiobits = SIGN_EXTENDED32(audiobits, readsamplesize); |
582 | 579 |
583 alac->outputsamples_buffer[chan][i] = audiobits; | 580 alac->outputsamples_buffer[chan][i] = audiobits; |
584 } | 581 } |
585 } | |
586 } else { | 582 } else { |
587 int i, chan; | 583 int i, chan; |
588 for (chan = 0; chan < channels; chan++) { | 584 for (chan = 0; chan < channels; chan++) |
589 for (i = 0; i < outputsamples; i++) { | 585 for (i = 0; i < outputsamples; i++) { |
590 int32_t audiobits; | 586 int32_t audiobits; |
591 | 587 |
592 audiobits = get_bits(&alac->gb, 16); | 588 audiobits = get_bits(&alac->gb, 16); |
593 /* special case of sign extension.. | 589 /* special case of sign extension.. |
596 audiobits = audiobits >> (32 - alac->setinfo_sample_size); | 592 audiobits = audiobits >> (32 - alac->setinfo_sample_size); |
597 audiobits |= get_bits(&alac->gb, alac->setinfo_sample_size - 16); | 593 audiobits |= get_bits(&alac->gb, alac->setinfo_sample_size - 16); |
598 | 594 |
599 alac->outputsamples_buffer[chan][i] = audiobits; | 595 alac->outputsamples_buffer[chan][i] = audiobits; |
600 } | 596 } |
601 } | |
602 } | 597 } |
603 /* wasted_bytes = 0; */ | 598 /* wasted_bytes = 0; */ |
604 interlacing_shift = 0; | 599 interlacing_shift = 0; |
605 interlacing_leftweight = 0; | 600 interlacing_leftweight = 0; |
606 } | 601 } |