38 #define MM_PREAMBLE_SIZE 6
40 #define MM_TYPE_INTER 0x5
41 #define MM_TYPE_INTRA 0x8
42 #define MM_TYPE_INTRA_HH 0xc
43 #define MM_TYPE_INTER_HH 0xd
44 #define MM_TYPE_INTRA_HHV 0xe
45 #define MM_TYPE_INTER_HHV 0xf
46 #define MM_TYPE_PALETTE 0x31
80 for (i = 0; i < 128; i++) {
81 s->
palette[i] = bytestream2_get_be24(&s->
gb);
98 int run_length,
color;
103 color = bytestream2_get_byte(&s->
gb);
107 run_length = (color & 0x7f) + 2;
108 color = bytestream2_get_byte(&s->
gb);
136 int data_off = bytestream2_get_le16(&s->
gb), y;
145 int length = bytestream2_get_byte(&s->
gb);
146 int x = bytestream2_get_byte(&s->
gb) + ((length & 0x80) << 1);
157 for(i=0; i<length; i++) {
158 int replace_array = bytestream2_get_byte(&s->
gb);
160 int replace = (replace_array >> (7-j)) & 1;
164 int color = bytestream2_get_byte(&data_ptr);
185 void *
data,
int *data_size,
188 const uint8_t *buf = avpkt->
data;
189 int buf_size = avpkt->
size;
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int mm_decode_pal(MmContext *s)
static int mm_decode_intra(MmContext *s, int half_horiz, int half_vert)
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int palette[AVPALETTE_COUNT]
static int mm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
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.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
static av_cold int mm_decode_end(AVCodecContext *avctx)
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
int width
picture width / height.
struct AVFrame AVFrame
Audio Video Frame.
#define MM_TYPE_INTRA_HHV
AVCodec ff_mmvideo_decoder
static int mm_decode_inter(MmContext *s, int half_horiz, int half_vert)
struct MmContext MmContext
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int mm_decode_init(AVCodecContext *avctx)
const uint8_t * buffer_start
#define MM_TYPE_INTER_HHV
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
8 bit with PIX_FMT_RGB32 palette
static const uint8_t color[]