47 static const int shift1[6] = { 0, 8, 8, 8, 4, 4 };
48 static const int shift2[6] = { 0, 0, 8, 4, 0, 4 };
52 uint8_t *code, *
data, *
mv, *msk, *tmp, *tmp2;
54 int type, x, y, d, d2;
59 data = code + ((avctx->
width * avctx->
height) >> 4);
63 for(j = 0; j < avctx->
height; j += 4){
64 for(i = 0; i < avctx->
width; i += 4){
70 x = (*mv) >> 4;
if(x & 8) x = 8 - x;
71 y = (*mv++) & 0xF;
if(y & 8) y = 8 - y;
75 for(y = 0; y < 4; y++){
93 mask = ((msk[0] & 0xF0) <<
shift1[type]) | ((msk[0] & 0xF) <<
shift2[type]);
96 for(y = 0; y < 4; y++){
97 for(x = 0; x < 4; x++){
98 tmp[x] = (mask & 0x8000) ? *data++ : tmp2[x];
106 for(y = 0; y < 4; y++){
107 memset(tmp, data[0], 4);
113 for(y = 0; y < 4; y++){
114 memcpy(tmp, data, 4);
121 for(k = 0; k < 4; k++){
122 d = ((k & 1) << 1) + ((k & 2) * stride);
123 d2 = ((k & 1) << 1) + ((k & 2) * stride);
127 x = (*mv) >> 4;
if(x & 8) x = 8 - x;
128 y = (*mv++) & 0xF;
if(y & 8) y = 8 - y;
131 tmp[d + 0 ] = tmp2[0];
132 tmp[d + 1 ] = tmp2[1];
137 tmp[d + 0 ] = data[0];
138 tmp[d + 1 ] = data[0];
139 tmp[d + 0 +
stride] = data[0];
140 tmp[d + 1 +
stride] = data[0];
144 tmp[d + 0 ] = *data++;
145 tmp[d + 1 ] = *data++;
146 tmp[d + 0 +
stride] = *data++;
147 tmp[d + 1 +
stride] = *data++;
156 for(y = 0; y < 4; y++){
157 for(x = 0; x < 4; x++){
158 tmp[x] = data[mask & 1];
170 for(y = 0; y < 4; y++){
171 for(x = 0; x < 4; x++){
172 tmp[x] = data[mask & 3];
193 const uint8_t *buf = avpkt->
data;
194 int buf_size = avpkt->
size;
196 uint8_t *outptr, *srcptr, *tmpptr;
200 int orig_buf_size = buf_size;
204 if(buf[0]==
'C' && buf[1]==
'M' && buf[2]==
'A' && buf[3]==
'P'){
208 for(i = 0; i < 256; i++){
212 c->
pal[i] = (r << 16) | (g << 8) |
b;
230 if(buf[0]==
'N' && buf[1]==
'U' && buf[2]==
'L' && buf[3]==
'L')
236 if((compr != 4 && compr != -1) && uncompress(c->
decomp_buf, &dsize, buf + 9, buf_size - 9) != Z_OK){
264 for(j = 0; j < avctx->
height; j++){
266 for(i = 0; i < avctx->
width; i++)
267 outptr[i] = srcptr[i] ^ tmpptr[i];
270 memcpy(outptr, srcptr, avctx->
width);
272 srcptr += avctx->
width;
294 return orig_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.
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_WB24 AV_RB16
AV_WL32 AV_WL24 AV_WL16 AV_RB32
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static av_cold int decode_end(AVCodecContext *avctx)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
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.
static const int shift1[6]
static const uint16_t mask[17]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
struct AVFrame AVFrame
Audio Video Frame.
static const int8_t mv[256][2]
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.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int palette_has_changed
Tell user application that palette has changed from previous frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static av_cold int decode_init(AVCodecContext *avctx)
static const int shift2[6]
8 bit with PIX_FMT_RGB32 palette
static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t *dst, uint8_t *src, uint8_t *ref)
struct DxaDecContext DxaDecContext
int key_frame
1 -> keyframe, 0-> not
#define FFSWAP(type, a, b)