63 const unsigned char *src,
int src_stride,
65 int xoffset,
int yoffset,
72 if (i+xoffset>=0 && i+xoffset<width &&
73 j+yoffset>=0 && j+yoffset<height) {
74 dst[j*dst_stride + i] = src[(j+yoffset)*src_stride + i+xoffset];
76 dst[j*dst_stride + i] = 0;
87 for(x=0; x<s->
avctx->
width/4 && buf_end - buf > i; x++) {
90 if (raw+16<buf_end && *raw==0xFF) {
97 }
else if(raw<buf_end) {
98 int xoffset = (*raw & 0xF) - 7;
99 int yoffset = ((*raw >> 4)) - 7;
107 int xoffset = (buf[i] & 0xF) - 7;
108 int yoffset = ((buf[i] >> 4)) - 7;
120 int pal_start, pal_count, i;
122 if(buf_end - buf < 16) {
139 for (i=pal_start; i<pal_start+pal_count && i<
AVPALETTE_COUNT && buf_end - buf >= 3; i++) {
145 #define EA_PREAMBLE_SIZE 8
146 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h')
149 void *
data,
int *data_size,
152 const uint8_t *buf = avpkt->
data;
153 int buf_size = avpkt->
size;
155 const uint8_t *buf_end = buf + buf_size;
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define FF_BUFFER_HINTS_VALID
AV_WL32 AV_WL24 AV_WL16 AV_RB32
int buffer_hints
codec suggestion on buffer type if != 0
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
#define AV_LOG_WARNING
Something somehow does not look correct.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
unsigned int palette[AVPALETTE_COUNT]
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int reference
is this picture used as reference The values for this are the same as the MpegEncContext.picture_structure variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
struct CmvContext CmvContext
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static av_cold int cmv_decode_init(AVCodecContext *avctx)
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
struct AVFrame AVFrame
Audio Video Frame.
static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
static void cmv_motcomp(unsigned char *dst, int dst_stride, const unsigned char *src, int src_stride, int x, int y, int xoffset, int yoffset, int width, int height)
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
AVFrame last2_frame
second-last
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void cmv_decode_inter(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_RB24
static void cmv_decode_intra(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
8 bit with PIX_FMT_RGB32 palette
static int cmv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
int key_frame
1 -> keyframe, 0-> not
#define FFSWAP(type, a, b)
static av_cold int cmv_decode_end(AVCodecContext *avctx)