44 #define OFFSET(x) offsetof(G722Context, x)
45 #define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
47 {
"bits_per_codeword",
"Bits per G722 codeword",
OFFSET(bits_per_codeword),
AV_OPT_TYPE_INT, { .i64 = 8 }, 6, 8,
AD },
76 -35, -35, -2919, -2195, -1765, -1458, -1219, -1023,
77 -858, -714, -587, -473, -370, -276, -190, -110,
78 2919, 2195, 1765, 1458, 1219, 1023, 858, 714,
79 587, 473, 370, 276, 190, 110, 35, -35
101 out_buf = (int16_t *)frame->
data[0];
105 for (j = 0; j < avpkt->
size; j++) {
106 int ilow, ihigh, rlow, rhigh, dhigh;
113 rlow = av_clip_intp2((c->
band[0].
scale_factor * quantizer_table[ilow] >> 10)
126 *out_buf++ = av_clip_int16(xout[0] >> 11);
127 *out_buf++ = av_clip_int16(xout[1] >> 11);
149 .priv_class = &g722_decoder_class,
const int16_t ff_g722_low_inv_quant4[16]
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
void(* apply_qmf)(const int16_t *prev_samples, int xout[2])
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
AVCodec ff_adpcm_g722_decoder
static av_cold int g722_decode_init(AVCodecContext *avctx)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
enum AVSampleFormat sample_fmt
audio sample format
#define PREV_SAMPLES_BUF_SIZE
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
bitstream reader API header.
static const AVClass g722_decoder_class
const int16_t ff_g722_low_inv_quant6[64]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int16_t prev_samples[PREV_SAMPLES_BUF_SIZE]
memory of past decoded samples
const char * name
Name of the codec implementation.
av_cold void ff_g722dsp_init(G722DSPContext *c)
static const int16_t *const low_inv_quants[3]
Libavcodec external API header.
uint64_t channel_layout
Audio channel layout.
struct G722Context::G722Band band[2]
audio channel layout utility functions
static const AVOption options[]
void ff_g722_update_low_predictor(struct G722Band *band, const int ilow)
static const int16_t low_inv_quant5[32]
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Describe the class of an AVClass context structure.
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
common internal api header.
int prev_samples_pos
the number of values in prev_samples
static int g722_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
const int16_t ff_g722_high_inv_quant[4]
int channels
number of audio channels
int16_t s_predictor
predictor output value
void ff_g722_update_high_predictor(struct G722Band *band, const int dhigh, const int ihigh)
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int16_t scale_factor
delayed quantizer scale factor
int nb_samples
number of audio samples (per channel) described by this frame