chromium/third_party/ffmpeg/libavcodec/vorbisdec.c

/**
 * @file
 * Vorbis I decoder
 * @author Denes Balatoni  ( dbalatoni programozo hu )
 *
 * 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
 */

/**
 * @file
 * Vorbis I decoder
 * @author Denes Balatoni  ( dbalatoni programozo hu )
 */

#include <inttypes.h>
#include <math.h>

#include "libavutil/avassert.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mem.h"
#include "libavutil/tx.h"

#define BITSTREAM_READER_LE
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "internal.h"
#include "vorbis.h"
#include "vorbisdsp.h"
#include "vorbis_data.h"
#include "xiph.h"

#define V_NB_BITS
#define V_NB_BITS2
#define V_MAX_VLCS
#define V_MAX_PARTITIONS

vorbis_codebook;

vorbis_floor_data;
vorbis_floor0;
vorbis_floor1;
struct vorbis_context_s;
vorbis_floor_decode_func;
vorbis_floor;

vorbis_residue;

vorbis_mapping;

vorbis_mode;

vorbis_context;

/* Helper functions */

#define BARK(x)

static const char idx_err_str[] =;
#define VALIDATE_INDEX(idx, limit)
#define GET_VALIDATED_INDEX(idx, bits, limit)

static float vorbisfloat2float(unsigned val)
{}


// Free all allocated memory -----------------------------------------

static void vorbis_free(vorbis_context *vc)
{}

// Parse setup header -------------------------------------------------

// Process codebooks part

static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
{}

// Process time domain transforms part (unused in Vorbis I)

static int vorbis_parse_setup_hdr_tdtransforms(vorbis_context *vc)
{}

// Process floors part

static int vorbis_floor0_decode(vorbis_context *vc,
                                vorbis_floor_data *vfu, float *vec);
static int create_map(vorbis_context *vc, unsigned floor_number);
static int vorbis_floor1_decode(vorbis_context *vc,
                                vorbis_floor_data *vfu, float *vec);
static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
{}

// Process residues part

static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
{}

// Process mappings part

static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
{}

// Process modes part

static int create_map(vorbis_context *vc, unsigned floor_number)
{}

static int vorbis_parse_setup_hdr_modes(vorbis_context *vc)
{}

// Process the whole setup header using the functions above

static int vorbis_parse_setup_hdr(vorbis_context *vc)
{}

// Process the identification header

static int vorbis_parse_id_hdr(vorbis_context *vc)
{}

// Process the extradata using the functions above (identification header, setup header)

static av_cold int vorbis_decode_init(AVCodecContext *avctx)
{}

// Decode audiopackets -------------------------------------------------

// Read and decode floor

static int vorbis_floor0_decode(vorbis_context *vc,
                                vorbis_floor_data *vfu, float *vec)
{}

static int vorbis_floor1_decode(vorbis_context *vc,
                                vorbis_floor_data *vfu, float *vec)
{}

static av_always_inline int setup_classifs(vorbis_context *vc,
                                           vorbis_residue *vr,
                                           uint8_t *do_not_decode,
                                           unsigned ch_used,
                                           int partition_count,
                                           int ptns_to_read
                                          )
{}
// Read and decode residue

static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
                                                           vorbis_residue *vr,
                                                           unsigned ch,
                                                           uint8_t *do_not_decode,
                                                           float *vec,
                                                           unsigned vlen,
                                                           unsigned ch_left,
                                                           int vr_type)
{}

static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
                                        unsigned ch,
                                        uint8_t *do_not_decode,
                                        float *vec, unsigned vlen,
                                        unsigned ch_left)
{}

// Decode the audio packet using the functions above

static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
{}

// Return the decoded audio packet through the standard api

static int vorbis_decode_frame(AVCodecContext *avctx, AVFrame *frame,
                               int *got_frame_ptr, AVPacket *avpkt)
{}

// Close decoder

static av_cold int vorbis_decode_close(AVCodecContext *avctx)
{}

static av_cold void vorbis_decode_flush(AVCodecContext *avctx)
{}

const FFCodec ff_vorbis_decoder =;