chromium/third_party/ffmpeg/libavcodec/vlc.c

/*
 * API for creating VLC trees
 * Copyright (c) 2000, 2001 Fabrice Bellard
 * Copyright (c) 2002-2004 Michael Niedermayer <[email protected]>
 * Copyright (c) 2010 Loren Merritt
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/error.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/qsort.h"
#include "libavutil/reverse.h"
#include "vlc.h"

#define GET_DATA(v, table, i, wrap, size)


static int alloc_table(VLC *vlc, int size, int use_static)
{}

#define LOCALBUF_ELEMS

static av_always_inline uint32_t bitswap_32(uint32_t x)
{}

VLCcode;

static int vlc_common_init(VLC *vlc, int nb_bits, int nb_codes,
                           VLCcode **buf, int flags)
{}

static int compare_vlcspec(const void *a, const void *b)
{}

/**
 * Build VLC decoding tables suitable for use with get_vlc().
 *
 * @param vlc            the context to be initialized
 *
 * @param table_nb_bits  max length of vlc codes to store directly in this table
 *                       (Longer codes are delegated to subtables.)
 *
 * @param nb_codes       number of elements in codes[]
 *
 * @param codes          descriptions of the vlc codes
 *                       These must be ordered such that codes going into the same subtable are contiguous.
 *                       Sorting by VLCcode.code is sufficient, though not necessary.
 */
static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
                       VLCcode *codes, int flags)
{}

static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes,
                          int flags, VLCcode localbuf[LOCALBUF_ELEMS])
{}

int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes,
                       const void *bits, int bits_wrap, int bits_size,
                       const void *codes, int codes_wrap, int codes_size,
                       const void *symbols, int symbols_wrap, int symbols_size,
                       int flags)
{}

int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes,
                             const int8_t *lens, int lens_wrap,
                             const void *symbols, int symbols_wrap, int symbols_size,
                             int offset, int flags, void *logctx)
{}

av_cold void ff_vlc_init_table_from_lengths(VLCElem table[], int table_size,
                                            int nb_bits, int nb_codes,
                                            const int8_t *lens, int lens_wrap,
                                            const void *symbols, int symbols_wrap, int symbols_size,
                                            int offset, int flags)
{}

av_cold const VLCElem *ff_vlc_init_tables_from_lengths(VLCInitState *state,
                                                       int nb_bits, int nb_codes,
                                                       const int8_t *lens, int lens_wrap,
                                                       const void *symbols, int symbols_wrap, int symbols_size,
                                                       int offset, int flags)
{}

av_cold void ff_vlc_init_table_sparse(VLCElem table[], int table_size,
                                      int nb_bits, int nb_codes,
                                      const void *bits, int bits_wrap, int bits_size,
                                      const void *codes, int codes_wrap, int codes_size,
                                      const void *symbols, int symbols_wrap, int symbols_size,
                                      int flags)
{}

av_cold const VLCElem *ff_vlc_init_tables_sparse(VLCInitState *state,
                                                 int nb_bits, int nb_codes,
                                                 const void *bits, int bits_wrap, int bits_size,
                                                 const void *codes, int codes_wrap, int codes_size,
                                                 const void *symbols, int symbols_wrap, int symbols_size,
                                                 int flags)
{}

static void add_level(VLC_MULTI_ELEM *table, const int is16bit,
                      const int num, const int numbits,
                      const VLCcode *buf,
                      uint32_t curcode, int curlen,
                      int curlimit, int curlevel,
                      const int minlen, const int max,
                      unsigned* levelcnt, VLC_MULTI_ELEM info)
{}

static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single,
                         const int is16bit, const int nb_codes, const int numbits,
                         VLCcode *buf, void *logctx)
{}

int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems,
                                   int nb_codes, const int8_t *lens, int lens_wrap,
                                   const void *symbols, int symbols_wrap, int symbols_size,
                                   int offset, int flags, void *logctx)
{}

void ff_vlc_free_multi(VLC_MULTI *vlc)
{}

void ff_vlc_free(VLC *vlc)
{}