30 #include "libavutil/common.h"
31 #include "libavutil/intreadwrite.h"
48 static const int shift1[6] = { 0, 8, 8, 8, 4, 4 };
49 static const int shift2[6] = { 0, 0, 8, 4, 0, 4 };
56 int type, x, y, d, d2;
60 data = code + ((avctx->
width * avctx->
height) >> 4);
64 for(j = 0; j < avctx->
height; j += 4){
65 for(i = 0; i < avctx->
width; i += 4){
71 x = (*mv) >> 4;
if(x & 8) x = 8 - x;
72 y = (*mv++) & 0xF;
if(y & 8) y = 8 - y;
76 for(y = 0; y < 4; y++){
94 mask = ((msk[0] & 0xF0) <<
shift1[type]) | ((msk[0] & 0xF) <<
shift2[type]);
97 for(y = 0; y < 4; y++){
98 for(x = 0; x < 4; x++){
99 tmp[x] = (mask & 0x8000) ? *data++ : tmp2[x];
107 for(y = 0; y < 4; y++){
108 memset(tmp, data[0], 4);
114 for(y = 0; y < 4; y++){
115 memcpy(tmp, data, 4);
122 for(k = 0; k < 4; k++){
123 d = ((k & 1) << 1) + ((k & 2) * stride);
124 d2 = ((k & 1) << 1) + ((k & 2) * stride);
128 x = (*mv) >> 4;
if(x & 8) x = 8 - x;
129 y = (*mv++) & 0xF;
if(y & 8) y = 8 - y;
132 tmp[d + 0 ] = tmp2[0];
133 tmp[d + 1 ] = tmp2[1];
138 tmp[d + 0 ] = data[0];
139 tmp[d + 1 ] = data[0];
140 tmp[d + 0 +
stride] = data[0];
141 tmp[d + 1 +
stride] = data[0];
145 tmp[d + 0 ] = *data++;
146 tmp[d + 1 ] = *data++;
147 tmp[d + 0 +
stride] = *data++;
148 tmp[d + 1 +
stride] = *data++;
157 for(y = 0; y < 4; y++){
158 for(x = 0; x < 4; x++){
159 tmp[x] = data[mask & 1];
171 for(y = 0; y < 4; y++){
172 for(x = 0; x < 4; x++){
173 tmp[x] = data[mask & 3];
196 int buf_size = avpkt->
size;
198 uint8_t *outptr, *srcptr, *tmpptr;
200 int i, j, compr, ret;
202 int orig_buf_size = buf_size;
206 if(buf[0]==
'C' && buf[1]==
'M' && buf[2]==
'A' && buf[3]==
'P'){
210 for(i = 0; i < 256; i++){
214 c->
pal[i] = (r << 16) | (g << 8) |
b;
227 outptr = frame->
data[0];
232 if(buf[0]==
'N' && buf[1]==
'U' && buf[2]==
'L' && buf[3]==
'L')
238 if((compr != 4 && compr != -1) && uncompress(c->
decomp_buf, &dsize, buf + 9, buf_size - 9) != Z_OK){
258 for (j = 0; j < avctx->
height; j++) {
259 memcpy(outptr, srcptr, avctx->
width);
261 srcptr += avctx->
width;
272 for (j = 0; j < avctx->
height; j++) {
273 for (i = 0; i < avctx->
width; i++)
274 outptr[i] = srcptr[i] ^ tmpptr[i];
277 srcptr += avctx->
width;
298 return orig_buf_size;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int decode_end(AVCodecContext *avctx)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
void av_freep(void *ptr)
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)
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const int shift1[6]
static const uint16_t mask[17]
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t *dst, int stride, uint8_t *src, uint8_t *ref)
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
8 bit with PIX_FMT_RGB32 palette
static const int8_t mv[256][2]
main external API structure.
static void close(AVCodecParserContext *s)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int palette_has_changed
Tell user application that palette has changed from previous frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
common internal api header.
static av_cold int decode_init(AVCodecContext *avctx)
static const int shift2[6]
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
static av_cold int init(AVCodecParserContext *s)
int key_frame
1 -> keyframe, 0-> not
This structure stores compressed data.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.