Go to the documentation of this file.
45 for (
int i = 0;
i <
len;
i++) {
46 for (
int j = 0; j < 8; j++) {
49 int v = *(inbuf++) - 128;
51 int t = (v >
state->q || (v ==
state->q && v == 127) ? 127 : -128);
58 if(nq ==
state->q && nq != t)
59 nq += (t == 127 ? 1 : -1);
63 st = (t !=
state->lt ? 0 : 1023);
66 ns += (st != 0 ? 1 : -1);
87 ctx->bits_per_coded_sample = 1;
This structure describes decoded (raw) audio or video data.
static void au_compress(DFPWMState *state, int len, uint8_t *outbuf, const uint8_t *inbuf)
int nb_channels
Number of channels in this layout.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec p
The public AVCodec.
static int dfpwm_enc_frame(struct AVCodecContext *ctx, struct AVPacket *packet, const struct AVFrame *frame, int *got_packet)
AVChannelLayout ch_layout
Channel layout of the audio data.
#define FF_CODEC_ENCODE_CB(func)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define CODEC_LONG_NAME(str)
static av_cold int dfpwm_enc_init(struct AVCodecContext *ctx)
#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE
Audio encoder supports receiving a different number of samples in each call.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define ns(max_value, name, subs,...)
int nb_samples
number of audio samples (per channel) described by this frame
#define i(width, name, range_min, range_max)
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
AVSampleFormat
Audio sample formats.
enum AVPacketSideDataType packet
const char * name
Name of the codec implementation.
main external API structure.
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
const FFCodec ff_dfpwm_encoder
This structure stores compressed data.
void * priv_data
Format private data.