26 #define MAX_HUFF_CODES 16
55 int w4 = (avctx->
width + 3) & ~3;
56 int h4 = (avctx->
height + 3) & ~3;
72 int offset, w, h,
color = 0, x, y, i;
90 for (i = 0; i < w; ++i)
176 while (x < mp->avctx->width) {
183 for (i = (x + 3) & ~3; i < x + w; i += 4) {
193 p.
y = av_clip(p.
y, 0, 31);
197 p.
v = av_clip(p.
v, -32, 31);
199 p.
u = av_clip(p.
u, -32, 31);
223 p.
y = av_clip(p.
y, 0, 31);
226 p.
v = av_clip(p.
v, -32, 31);
228 p.
u = av_clip(p.
u, -32, 31);
234 for (y0 = 0; y0 < 2; ++y0)
240 void *
data,
int *data_size,
243 const uint8_t *buf = avpkt->
data;
244 int buf_size = avpkt->
size;
247 int i, count1, count2, sz;
262 memcpy(mp->
bswapbuf + (buf_size & ~3), buf + (buf_size & ~3), buf_size & 3);
267 for (i = !(avctx->
extradata[1] & 2); i < 2; ++i) {
318 .
name =
"motionpixels",
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
static int mp_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
#define FF_BUFFER_HINTS_VALID
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.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVCodec ff_motionpixels_decoder
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer, reusing the given one if large enough.
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
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)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static YuvPixel mp_get_yuv_from_rgb(MotionPixelsContext *mp, int x, int y)
bitstream reader API header.
av_cold void dsputil_init(DSPContext *c, AVCodecContext *avctx)
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.
void(* bswap_buf)(uint32_t *dst, const uint32_t *src, int w)
#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.
struct MotionPixelsContext MotionPixelsContext
static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb)
int width
picture width / height.
struct AVFrame AVFrame
Audio Video Frame.
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
#define FF_BUFFER_HINTS_REUSABLE
static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb)
static av_cold int mp_decode_init(AVCodecContext *avctx)
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
HuffCode codes[MAX_HUFF_CODES]
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define init_vlc(vlc, nb_bits, nb_codes,bits, bits_wrap, bits_size,codes, codes_wrap, codes_size,flags)
static unsigned int get_bits1(GetBitContext *s)
#define FF_BUFFER_HINTS_PRESERVE
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static int mp_gradient(MotionPixelsContext *mp, int component, int v)
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *gb)
uint8_t gradient_scale[3]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static void mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size, int code)
static void mp_decode_line(MotionPixelsContext *mp, GetBitContext *gb, int y)
static void mp_read_changes_map(MotionPixelsContext *mp, GetBitContext *gb, int count, int bits_len, int read_color)
static const uint8_t color[]
static void mp_set_rgb_from_yuv(MotionPixelsContext *mp, int x, int y, const YuvPixel *p)
static av_cold int mp_decode_end(AVCodecContext *avctx)
VLC_TYPE(* table)[2]
code, bits
static YuvPixel mp_rgb_yuv_table[1<< 15]
static void mp_read_codes_table(MotionPixelsContext *mp, GetBitContext *gb)
static void motionpixels_tableinit(void)
void ff_free_vlc(VLC *vlc)