Mercurial > libavcodec.hg
comparison aac.c @ 10848:b4aca3bfff0f libavcodec
AAC: escape_sequence is 21 bits max
The maximum length of escape_sequence is 21 bits, so adjust limit in
code to match this. Also fix the comment.
author | mru |
---|---|
date | Mon, 11 Jan 2010 18:02:00 +0000 |
parents | 3d011a01a6a0 |
children | e8f4b9e41b7a |
comparison
equal
deleted
inserted
replaced
10847:177ebc61c3d6 | 10848:b4aca3bfff0f |
---|---|
940 if (cur_band_type == ESC_BT) { | 940 if (cur_band_type == ESC_BT) { |
941 for (j = 0; j < 2; j++) { | 941 for (j = 0; j < 2; j++) { |
942 if (vq_ptr[j] == 64.0f) { | 942 if (vq_ptr[j] == 64.0f) { |
943 int n = 4; | 943 int n = 4; |
944 /* The total length of escape_sequence must be < 22 bits according | 944 /* The total length of escape_sequence must be < 22 bits according |
945 to the specification (i.e. max is 11111111110xxxxxxxxxx). */ | 945 to the specification (i.e. max is 111111110xxxxxxxxxxxx). */ |
946 while (get_bits1(gb) && n < 15) n++; | 946 while (get_bits1(gb) && n < 13) n++; |
947 if (n == 15) { | 947 if (n == 13) { |
948 av_log(ac->avccontext, AV_LOG_ERROR, "error in spectral data, ESC overflow\n"); | 948 av_log(ac->avccontext, AV_LOG_ERROR, "error in spectral data, ESC overflow\n"); |
949 return -1; | 949 return -1; |
950 } | 950 } |
951 n = (1 << n) + get_bits(gb, n); | 951 n = (1 << n) + get_bits(gb, n); |
952 coef[coef_tmp_idx + j] *= cbrtf(n) * n; | 952 coef[coef_tmp_idx + j] *= cbrtf(n) * n; |