#include "avcodec.h"
#include "get_bits.h"
#include "put_bits.h"
#include "bytestream.h"
#include "adpcm.h"
#include "adpcm_data.h"
#include "internal.h"
Go to the source code of this file.
Data Structures | |
| struct | TrellisPath |
| struct | TrellisNode |
| struct | ADPCMEncodeContext |
Defines | |
| #define | FREEZE_INTERVAL 128 |
| #define | STORE_NODE(NAME, STEP_INDEX) |
| #define | LOOP_NODES(NAME, STEP_TABLE, STEP_INDEX) |
| #define | ADPCM_ENCODER(id_, name_, long_name_) |
Functions | |
| static av_cold int | adpcm_encode_close (AVCodecContext *avctx) |
| static av_cold int | adpcm_encode_init (AVCodecContext *avctx) |
| static uint8_t | adpcm_ima_compress_sample (ADPCMChannelStatus *c, int16_t sample) |
| static uint8_t | adpcm_ima_qt_compress_sample (ADPCMChannelStatus *c, int16_t sample) |
| static uint8_t | adpcm_ms_compress_sample (ADPCMChannelStatus *c, int16_t sample) |
| static uint8_t | adpcm_yamaha_compress_sample (ADPCMChannelStatus *c, int16_t sample) |
| static void | adpcm_compress_trellis (AVCodecContext *avctx, const int16_t *samples, uint8_t *dst, ADPCMChannelStatus *c, int n) |
| static int | adpcm_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) |
| ADPCM_ENCODER (AV_CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt,"ADPCM IMA QuickTime") | |
| ADPCM_ENCODER (AV_CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav,"ADPCM IMA WAV") | |
| ADPCM_ENCODER (AV_CODEC_ID_ADPCM_MS, adpcm_ms,"ADPCM Microsoft") | |
| ADPCM_ENCODER (AV_CODEC_ID_ADPCM_SWF, adpcm_swf,"ADPCM Shockwave Flash") | |
| ADPCM_ENCODER (AV_CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha,"ADPCM Yamaha") | |
Variables | |
| static enum AVSampleFormat | sample_fmts [] |
See ADPCM decoder reference documents for codec information.
Definition in file adpcmenc.c.
| #define ADPCM_ENCODER | ( | id_, | |||
| name_, | |||||
| long_name_ | ) |
Value:
AVCodec ff_ ## name_ ## _encoder = { \ .name = #name_, \ .type = AVMEDIA_TYPE_AUDIO, \ .id = id_, \ .priv_data_size = sizeof(ADPCMEncodeContext), \ .init = adpcm_encode_init, \ .encode2 = adpcm_encode_frame, \ .close = adpcm_encode_close, \ .sample_fmts = sample_fmts, \ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ }
Definition at line 710 of file adpcmenc.c.
| #define FREEZE_INTERVAL 128 |
Definition at line 60 of file adpcmenc.c.
Referenced by adpcm_compress_trellis(), adpcm_encode_init(), g722_encode_init(), and g722_encode_trellis().
| #define LOOP_NODES | ( | NAME, | |||
| STEP_TABLE, | |||||
| STEP_INDEX | ) |
Value:
const int predictor = nodes[j]->sample1;\ const int div = (sample - predictor) * 4 / STEP_TABLE;\ int nmin = av_clip(div - range, -7, 6);\ int nmax = av_clip(div + range, -6, 7);\ if (nmin <= 0)\ nmin--; /* distinguish -0 from +0 */\ if (nmax < 0)\ nmax--;\ for (nidx = nmin; nidx <= nmax; nidx++) {\ const int nibble = nidx < 0 ? 7 - nidx : nidx;\ int dec_sample = predictor +\ (STEP_TABLE *\ ff_adpcm_yamaha_difflookup[nibble]) / 8;\ STORE_NODE(NAME, STEP_INDEX);\ }
Referenced by adpcm_compress_trellis().
| #define STORE_NODE | ( | NAME, | |||
| STEP_INDEX | ) |
Referenced by adpcm_compress_trellis(), and g722_encode_trellis().
| static void adpcm_compress_trellis | ( | AVCodecContext * | avctx, | |
| const int16_t * | samples, | |||
| uint8_t * | dst, | |||
| ADPCMChannelStatus * | c, | |||
| int | n | |||
| ) | [static] |
Definition at line 275 of file adpcmenc.c.
| static av_cold int adpcm_encode_close | ( | AVCodecContext * | avctx | ) | [static] |
| static int adpcm_encode_frame | ( | AVCodecContext * | avctx, | |
| AVPacket * | avpkt, | |||
| const AVFrame * | frame, | |||
| int * | got_packet_ptr | |||
| ) | [static] |
Definition at line 466 of file adpcmenc.c.
| static av_cold int adpcm_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 64 of file adpcmenc.c.
| ADPCM_ENCODER | ( | AV_CODEC_ID_ADPCM_YAMAHA | , | |
| adpcm_yamaha | , | |||
| "ADPCM Yamaha" | ||||
| ) |
| ADPCM_ENCODER | ( | AV_CODEC_ID_ADPCM_SWF | , | |
| adpcm_swf | , | |||
| "ADPCM Shockwave Flash" | ||||
| ) |
| ADPCM_ENCODER | ( | AV_CODEC_ID_ADPCM_MS | , | |
| adpcm_ms | , | |||
| "ADPCM Microsoft" | ||||
| ) |
| ADPCM_ENCODER | ( | AV_CODEC_ID_ADPCM_IMA_WAV | , | |
| adpcm_ima_wav | , | |||
| "ADPCM IMA WAV" | ||||
| ) |
| ADPCM_ENCODER | ( | AV_CODEC_ID_ADPCM_IMA_QT | , | |
| adpcm_ima_qt | , | |||
| "ADPCM IMA QuickTime" | ||||
| ) |
| static uint8_t adpcm_ima_compress_sample | ( | ADPCMChannelStatus * | c, | |
| int16_t | sample | |||
| ) | [inline, static] |
Definition at line 174 of file adpcmenc.c.
| static uint8_t adpcm_ima_qt_compress_sample | ( | ADPCMChannelStatus * | c, | |
| int16_t | sample | |||
| ) | [inline, static] |
Definition at line 187 of file adpcmenc.c.
| static uint8_t adpcm_ms_compress_sample | ( | ADPCMChannelStatus * | c, | |
| int16_t | sample | |||
| ) | [inline, static] |
Definition at line 224 of file adpcmenc.c.
| static uint8_t adpcm_yamaha_compress_sample | ( | ADPCMChannelStatus * | c, | |
| int16_t | sample | |||
| ) | [inline, static] |
Definition at line 253 of file adpcmenc.c.
enum AVSampleFormat sample_fmts[] [static] |
Initial value:
Definition at line 706 of file adpcmenc.c.
Referenced by av_abuffersink_params_alloc(), configure_output_audio_filter(), init_filters(), lavfi_read_header(), new_audio_stream(), print_codec(), and query_formats().
1.5.8