44 if (!
s->previous_frame)
64 AVFrame *prev_frame =
s->previous_frame;
65 z_stream *
const zstream = &
s->zstream.zstream;
66 uint8_t *
dst, *prev = prev_frame->
data[0];
74 zret = inflateReset(zstream);
86 zstream->next_in = avpkt->
data;
87 zstream->avail_in = avpkt->
size;
91 zstream->next_out =
dst;
92 zstream->avail_out = (avctx->
width + 7) >> 3;
94 zret =
inflate(zstream, Z_SYNC_FLUSH);
95 if (zret != Z_OK && zret != Z_STREAM_END) {
97 "Inflate failed with return code: %d.\n", zret);
102 for (
int j = 0; j < (avctx->
width + 7) >> 3; j++)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static av_cold void decode_flush(AVCodecContext *avctx)
const FFCodec ff_pdv_decoder
Libavcodec external API header.
#define i(width, name, range_min, range_max)
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
@ AVDISCARD_ALL
discard all
@ AVDISCARD_NONINTRA
discard all non intra frames
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int av_frame_replace(AVFrame *dst, const AVFrame *src)
Ensure the destination frame refers to the same data described by the source frame,...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
static av_cold void decode_flush(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
Macro definitions for various function/variable attributes.
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
enum AVDiscard skip_frame
Skip decoding for selected frames.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
static void inflate(uint8_t *dst, const uint8_t *p1, int width, int threshold, const uint8_t *coordinates[], int coord, int maxc)
void ff_inflate_end(FFZStream *zstream)
Wrapper around inflateEnd().
int ff_inflate_init(FFZStream *zstream, void *logctx)
Wrapper around inflateInit().