* @author Denes Balatoni ( dbalatoni programozo hu )
*/
-#define BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "get_bits.h"
+#include "libavutil/common.h"
+#include "avcodec.h"
#include "vorbis.h"
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
{
uint32_t exit_at_level[33] = { 404 };
-
unsigned i, j, p, code;
-#ifdef DEBUG
- GetBitContext gb;
-#endif
-
for (p = 0; (bits[p] == 0) && (p < num); ++p)
;
if (p == num)
for (i = 0; i < bits[p]; ++i)
exit_at_level[i+1] = 1 << i;
-#ifdef DEBUG
- av_log(NULL, AV_LOG_INFO, " %u. of %u code len %d code %d - ", p, num, bits[p], codes[p]);
- init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
- for (i = 0; i < bits[p]; ++i)
- av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
- av_log(NULL, AV_LOG_INFO, "\n");
-#endif
-
++p;
for (i = p; (bits[i] == 0) && (i < num); ++i)
for (j = i + 1 ;j <= bits[p]; ++j)
exit_at_level[j] = code + (1 << (j - 1));
codes[p] = code;
-
-#ifdef DEBUG
- av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
- init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
- for (i = 0; i < bits[p]; ++i)
- av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
- av_log(NULL, AV_LOG_INFO, "\n");
-#endif
-
}
//no exits should be left (underspecified tree - ie. unused valid vlcs - not allowed by SPEC)