46typedef struct TsccContext {
67 const uint8_t *buf = avpkt->
data;
68 int buf_size = avpkt->
size;
70 z_stream *
const zstream = &
c->zstream.zstream;
73 int palette_has_changed = 0;
79 ret = inflateReset(zstream);
84 zstream->next_in = buf;
85 zstream->avail_in = buf_size;
86 zstream->next_out =
c->decomp_buf;
87 zstream->avail_out =
c->decomp_size;
88 ret =
inflate(zstream, Z_FINISH);
90 if (ret == Z_DATA_ERROR && !palette_has_changed) {
94 if ((ret != Z_OK) && (ret != Z_STREAM_END) && (ret != Z_DATA_ERROR)) {
102 if (ret != Z_DATA_ERROR) {
104 c->decomp_size - zstream->avail_out);
141 c->decomp_size = (((avctx->
width *
c->bpp + 7) >> 3) + 3 * avctx->
width + 2) * avctx->
height + 2;
144 if (
c->decomp_size) {
145 if (!(
c->decomp_buf =
av_malloc(
c->decomp_size))) {
170 .p.name =
"camtasia",
const FFCodec ff_tscc_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#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_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
int ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
Check whether the side-data of src contains a palette of size AVPALETTE_SIZE; if so,...
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 AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the 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.
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)
Memory handling functions.
int ff_msrle_decode(AVCodecContext *avctx, AVFrame *pic, int depth, GetByteContext *gb)
Decode stream in MS RLE format into frame.
#define AV_PIX_FMT_0RGB32
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
#define AV_PIX_FMT_RGB555
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
unsigned char * decomp_buf
static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
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().