diff options
Diffstat (limited to 'apps/codecs/libwmapro/wma.c')
-rw-r--r-- | apps/codecs/libwmapro/wma.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/apps/codecs/libwmapro/wma.c b/apps/codecs/libwmapro/wma.c index b1b1268eea..b606f59dbf 100644 --- a/apps/codecs/libwmapro/wma.c +++ b/apps/codecs/libwmapro/wma.c | |||
@@ -469,62 +469,6 @@ unsigned int ff_wma_get_large_val(GetBitContext* gb) | |||
469 | */ | 469 | */ |
470 | int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb, | 470 | int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb, |
471 | VLC *vlc, | 471 | VLC *vlc, |
472 | const float *level_table, const uint16_t *run_table, | ||
473 | int version, WMACoef *ptr, int offset, | ||
474 | int num_coefs, int block_len, int frame_len_bits, | ||
475 | int coef_nb_bits) | ||
476 | { | ||
477 | int code, level, sign; | ||
478 | const uint32_t *ilvl = (const uint32_t*)level_table; | ||
479 | uint32_t *iptr = (uint32_t*)ptr; | ||
480 | const unsigned int coef_mask = block_len - 1; | ||
481 | for (; offset < num_coefs; offset++) { | ||
482 | code = get_vlc2(gb, vlc->table, VLCBITS, VLCMAX); | ||
483 | if (code > 1) { | ||
484 | /** normal code */ | ||
485 | offset += run_table[code]; | ||
486 | sign = get_bits1(gb) - 1; | ||
487 | iptr[offset & coef_mask] = ilvl[code] ^ sign<<31; | ||
488 | } else if (code == 1) { | ||
489 | /** EOB */ | ||
490 | break; | ||
491 | } else { | ||
492 | /** escape */ | ||
493 | if (!version) { | ||
494 | level = get_bits(gb, coef_nb_bits); | ||
495 | /** NOTE: this is rather suboptimal. reading | ||
496 | block_len_bits would be better */ | ||
497 | offset += get_bits(gb, frame_len_bits); | ||
498 | } else { | ||
499 | level = ff_wma_get_large_val(gb); | ||
500 | /** escape decode */ | ||
501 | if (get_bits1(gb)) { | ||
502 | if (get_bits1(gb)) { | ||
503 | if (get_bits1(gb)) { | ||
504 | av_log(avctx,AV_LOG_ERROR, | ||
505 | "broken escape sequence\n"); | ||
506 | return -1; | ||
507 | } else | ||
508 | offset += get_bits(gb, frame_len_bits) + 4; | ||
509 | } else | ||
510 | offset += get_bits(gb, 2) + 1; | ||
511 | } | ||
512 | } | ||
513 | sign = get_bits1(gb) - 1; | ||
514 | ptr[offset & coef_mask] = (level^sign) - sign; | ||
515 | } | ||
516 | } | ||
517 | /** NOTE: EOB can be omitted */ | ||
518 | if (offset > num_coefs) { | ||
519 | av_log(avctx, AV_LOG_ERROR, "overflow in spectral RLE, ignoring\n"); | ||
520 | return -1; | ||
521 | } | ||
522 | |||
523 | return 0; | ||
524 | } | ||
525 | |||
526 | int ff_wma_fix_run_level_decode(AVCodecContext* avctx, GetBitContext* gb, | ||
527 | VLC *vlc, | ||
528 | const int32_t *level_table, const uint16_t *run_table, | 472 | const int32_t *level_table, const uint16_t *run_table, |
529 | int version, int32_t *ptr, int offset, | 473 | int version, int32_t *ptr, int offset, |
530 | int num_coefs, int block_len, int frame_len_bits, | 474 | int num_coefs, int block_len, int frame_len_bits, |