chromium/third_party/ffmpeg/libavcodec/flacdec.c

/*
 * FLAC (Free Lossless Audio Codec) decoder
 * Copyright (c) 2003 Alex Beregszaszi
 *
 * 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
 * FLAC (Free Lossless Audio Codec) decoder
 * @author Alex Beregszaszi
 * @see http://flac.sourceforge.net/
 *
 * This decoder can be used in 1 of 2 ways: Either raw FLAC data can be fed
 * through, starting from the initial 'fLaC' signature; or by passing the
 * 34-byte streaminfo structure through avctx->extradata[_size] followed
 * by data starting with the 0xFFF8 marker.
 */

#include <limits.h>

#include "libavutil/avassert.h"
#include "libavutil/crc.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "get_bits.h"
#include "golomb.h"
#include "flac.h"
#include "flacdsp.h"
#include "flac_parse.h"
#include "thread.h"
#include "unary.h"


FLACContext;

static int allocate_buffers(FLACContext *s);

static void flac_set_bps(FLACContext *s)
{}

static av_cold int flac_decode_init(AVCodecContext *avctx)
{}

static void dump_headers(AVCodecContext *avctx, FLACStreaminfo *s)
{}

static int allocate_buffers(FLACContext *s)
{}

/**
 * Parse the STREAMINFO from an inline header.
 * @param s the flac decoding context
 * @param buf input buffer, starting with the "fLaC" marker
 * @param buf_size buffer size
 * @return non-zero if metadata is invalid
 */
static int parse_streaminfo(FLACContext *s, const uint8_t *buf, int buf_size)
{}

/**
 * Determine the size of an inline header.
 * @param buf input buffer, starting with the "fLaC" marker
 * @param buf_size buffer size
 * @return number of bytes in the header, or 0 if more data is needed
 */
static int get_metadata_size(const uint8_t *buf, int buf_size)
{}

static int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order)
{}

static int decode_subframe_fixed(FLACContext *s, int32_t *decoded,
                                 int pred_order, int bps)
{}

#define DECODER_SUBFRAME_FIXED_WIDE(residual)

static int decode_subframe_fixed_wide(FLACContext *s, int32_t *decoded,
                                      int pred_order, int bps)
{}


static int decode_subframe_fixed_33bps(FLACContext *s, int64_t *decoded,
                                       int32_t *residual, int pred_order)
{}

static void lpc_analyze_remodulate(SUINT32 *decoded, const int coeffs[32],
                                   int order, int qlevel, int len, int bps)
{}

static int decode_subframe_lpc(FLACContext *s, int32_t *decoded, int pred_order,
                               int bps)
{}

static int decode_subframe_lpc_33bps(FLACContext *s, int64_t *decoded,
                                     int32_t *residual, int pred_order)
{}

static inline int decode_subframe(FLACContext *s, int channel)
{}

static int decode_frame(FLACContext *s)
{}

static void decorrelate_33bps(int ch_mode, int32_t **decoded, int64_t *decoded_33bps, int len)
{}

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

static av_cold int flac_decode_close(AVCodecContext *avctx)
{}

static const AVOption options[] =;

static const AVClass flac_decoder_class =;

const FFCodec ff_flac_decoder =;