/*
- * Copyright (C) 2009-2010 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2009 Andre Noll <maan@tuebingen.mpg.de>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file wma_common.c Functions used by both the WMA afh and decoder. */
-#include <inttypes.h>
#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
#include "para.h"
#include "error.h"
* \param pattern_len The length of the pattern in bytes.
* \param buf The buffer to search for the pattern.
* \param buf_size The number of bytes in \a buf.
+ *
+ * \return A pointer into \a buf or \p NULL if the pattern was not found.
*/
const char *search_pattern(const char *pattern, int pattern_len,
const char *buf, int buf_size)
ahi->flags1 = read_u32(start + 56);
ahi->flags2 = read_u16(start + 60);
- PARA_INFO_LOG("read_asf_header: flags1: %d, flag2: %d\n",
+ PARA_INFO_LOG("read_asf_header: flags1: %d, flags2: %d\n",
ahi->flags1, ahi->flags2);
+ ahi->use_exp_vlc = ahi->flags2 & 0x0001;
+ ahi->use_bit_reservoir = ahi->flags2 & 0x0002;
+ ahi->use_variable_block_len = ahi->flags2 & 0x0004;
return 1;
}
-const uint8_t log2_tab[256] = {
+static const uint8_t log2_tab[256] = {
0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
*
* \return An integer approximation of log2(v).
*/
-int wma_log2(unsigned int v)
+__a_const int wma_log2(unsigned int v)
{
int n = 0;
if (v & 0xffff0000) {