Go to the documentation of this file.
42 uint8_t *outbuf,
const uint8_t *inbuf)
45 for (
int i = 0;
i <
len;
i++) {
48 for (
int j = 0; j < 8; j++) {
49 int nq, lq, st,
ns, ov;
51 int t = ((d&1) ? 127 : -128);
56 if(nq ==
state->q && nq != t)
57 nq += (t == 127 ? 1 : -1);
62 st = (t !=
state->lt ? 0 : 1023);
65 ns += (st != 0 ? 1 : -1);
70 ov = (t !=
state->lt ? (nq+lq+1)>>1 : nq);
77 *(outbuf++) = ov + 128;
94 ctx->bits_per_raw_sample = 8;
100 int *got_frame,
struct AVPacket *packet)
105 if (packet->
size * 8LL %
ctx->ch_layout.nb_channels)
108 frame->nb_samples = packet->
size * 8LL /
ctx->ch_layout.nb_channels;
109 if (
frame->nb_samples <= 0) {
This structure describes decoded (raw) audio or video data.
const FFCodec ff_dfpwm_decoder
AVCodec p
The public AVCodec.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_CODEC_DECODE_CB(func)
static void au_decompress(DFPWMState *state, int fs, int len, uint8_t *outbuf, const uint8_t *inbuf)
#define CODEC_LONG_NAME(str)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define fs(width, name, subs,...)
static int dfpwm_dec_frame(struct AVCodecContext *ctx, AVFrame *frame, int *got_frame, struct AVPacket *packet)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
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,...)
#define i(width, name, range_min, range_max)
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
const char * name
Name of the codec implementation.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
static av_cold int dfpwm_dec_init(struct AVCodecContext *ctx)
main external API structure.
This structure stores compressed data.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void * priv_data
Format private data.