FFmpeg
Classes | Macros | Typedefs | Variables
cook.c File Reference

Cook compatible decoder. More...

#include "libavutil/channel_layout.h"
#include "libavutil/lfg.h"
#include "audiodsp.h"
#include "avcodec.h"
#include "get_bits.h"
#include "bytestream.h"
#include "fft.h"
#include "internal.h"
#include "sinewin.h"
#include "unary.h"
#include "cookdata.h"

Classes

struct  cook_gains
 
struct  COOKSubpacket
 
struct  cook
 

Macros

#define MONO   0x1000001
 
#define STEREO   0x1000002
 
#define JOINT_STEREO   0x1000003
 
#define MC_COOK   0x2000000
 
#define SUBBAND_SIZE   20
 
#define MAX_SUBPACKETS   5
 
#define DECODE_BYTES_PAD1(bytes)   (3 - ((bytes) + 3) % 4)
 
#define DECODE_BYTES_PAD2(bytes)   ((bytes) % 4 + DECODE_BYTES_PAD1(2 * (bytes)))
 
#define PRINT(a, b)   ff_dlog(q->avctx, " %s = %d\n", a, b);
 

Typedefs

typedef struct cook_gains cook_gains
 
typedef struct COOKSubpacket COOKSubpacket
 
typedef struct cook COOKContext
 

Variables

AVCodec ff_cook_decoder
 

Detailed Description

Cook compatible decoder.

Bastardization of the G.722.1 standard. 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.

Variable Documentation

§ ff_cook_decoder

AVCodec ff_cook_decoder
Initial value:
= {
.name = "cook",
.long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_COOK,
.priv_data_size = sizeof(COOKContext),
.init = cook_decode_init,
.close = cook_decode_close,
.decode = cook_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
}
float, planar
Definition: samplefmt.h:69
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959
Definition: cook.c:102