#include <unistd.h>
#include "avcodec.h"
-#include "dsputil.h"
typedef struct {
typedef struct CinepakContext {
AVCodecContext *avctx;
- DSPContext dsp;
AVFrame frame;
- unsigned char *data;
+ const unsigned char *data;
int size;
int width, height;
} CinepakContext;
static void cinepak_decode_codebook (cvid_codebook_t *codebook,
- int chunk_id, int size, uint8_t *data)
+ int chunk_id, int size, const uint8_t *data)
{
- uint8_t *eod = (data + size);
+ const uint8_t *eod = (data + size);
uint32_t flag, mask;
int i, n;
}
static int cinepak_decode_vectors (CinepakContext *s, cvid_strip_t *strip,
- int chunk_id, int size, uint8_t *data)
+ int chunk_id, int size, const uint8_t *data)
{
- uint8_t *eod = (data + size);
+ const uint8_t *eod = (data + size);
uint32_t flag, mask;
cvid_codebook_t *codebook;
unsigned int x, y;
}
static int cinepak_decode_strip (CinepakContext *s,
- cvid_strip_t *strip, uint8_t *data, int size)
+ cvid_strip_t *strip, const uint8_t *data, int size)
{
- uint8_t *eod = (data + size);
+ const uint8_t *eod = (data + size);
int chunk_id, chunk_size;
/* coordinate sanity checks */
static int cinepak_decode (CinepakContext *s)
{
- uint8_t *eod = (s->data + s->size);
+ const uint8_t *eod = (s->data + s->size);
int i, result, strip_size, frame_flags, num_strips;
int y0 = 0;
int encoded_buf_size;
return 0;
}
-static int cinepak_decode_init(AVCodecContext *avctx)
+static av_cold int cinepak_decode_init(AVCodecContext *avctx)
{
CinepakContext *s = avctx->priv_data;
avctx->pix_fmt = PIX_FMT_PAL8;
}
- dsputil_init(&s->dsp, avctx);
-
s->frame.data[0] = NULL;
return 0;
static int cinepak_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- uint8_t *buf, int buf_size)
+ const uint8_t *buf, int buf_size)
{
CinepakContext *s = avctx->priv_data;
return buf_size;
}
-static int cinepak_decode_end(AVCodecContext *avctx)
+static av_cold int cinepak_decode_end(AVCodecContext *avctx)
{
CinepakContext *s = avctx->priv_data;
cinepak_decode_end,
cinepak_decode_frame,
CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("Cinepak"),
};