Logo Search packages:      
Sourcecode: blender version File versions  Download package

cook.c File Reference

Detailed Description

Cook compatible decoder. This decoder handles RealNetworks, RealAudio G2 data. Cook is identified by the codec name cook in RM files.

To use this decoder, a calling application must supply the extradata bytes provided from the RM container; 8+ bytes for mono streams and 16+ for stereo streams (maybe more).

Codec technicalities (all this assume a buffer length of 1024): Cook works with several different techniques to achieve its compression. In the timedomain the buffer is divided into 8 pieces and quantized. If two neighboring pieces have different quantization index a smooth quantization curve is used to get a smooth overlap between the different pieces. To get to the transformdomain Cook uses a modulated lapped transform. The transform domain has 50 subbands with 20 elements each. This means only a maximum of 50*20=1000 coefficients are used out of the 1024 available.

Definition in file cook.c.

#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
#include "cookdata.h"

Go to the source code of this file.


struct  COOKContext
struct  COOKgain


#define JOINT_STEREO   0x1000003
#define MC_COOK   0x2000000
#define MONO_COOK1   0x1000001
#define MONO_COOK2   0x1000002
#define SUBBAND_SIZE   20


struct __attribute__ ((__packed__))
static void categorize (COOKContext *q, int *quant_index_table, int *category, int *category_index)
static int cook_decode_close (AVCodecContext *avctx)
static int cook_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static int cook_decode_init (AVCodecContext *avctx)
static void cook_imlt (COOKContext *q, float *inbuffer, float *outbuffer, float *mlt_tmp)
static void decode_bytes (uint8_t *inbuffer, uint8_t *out, int bytes)
static void decode_envelope (COOKContext *q, int *quant_index_table)
static void decode_gain_info (GetBitContext *gb, COOKgain *gaininfo)
static int decode_subpacket (COOKContext *q, uint8_t *inbuffer, int sub_packet_size, int16_t *outbuffer)
static void decode_vectors (COOKContext *q, int *category, float *quant_value_table, float *mlt_buffer)
static void decouple_info (COOKContext *q, int *decouple_tab)
static void dequant_envelope (COOKContext *q, int *quant_index_table, float *quant_value_table)
static void expand_category (COOKContext *q, int *category, int *category_index)
static void gain_compensate (COOKContext *q, float *buffer, COOKgain *gain_now, COOKgain *gain_previous, float *previous_buffer)
static void gain_window (COOKContext *q, float *buffer, COOKgain *gain_now, COOKgain *gain_previous)
static int init_cook_mlt (COOKContext *q)
static int init_cook_vlc_tables (COOKContext *q)
static void init_gain_table (COOKContext *q)
static void init_pow2table (COOKContext *q)
static void init_rootpow2table (COOKContext *q)
static void interpolate (COOKContext *q, float *buffer, int gain_index, int gain_index_next)
static void joint_decode (COOKContext *q, float *mlt_buffer1, float *mlt_buffer2)
static void mono_decode (COOKContext *q, float *mlt_buffer)
static void scalar_dequant (COOKContext *q, int index, int band, float *quant_value_table, int *subband_coef_index, int *subband_coef_noise, float *mlt_buffer)
static int unpack_SQVH (COOKContext *q, int category, int *subband_coef_index, int *subband_coef_noise)


AVCodec cook_decoder

Generated by  Doxygen 1.6.0   Back to index