29 #define BITSTREAM_READER_LE
43 #define CODE_VLC_BITS 14
67 if (out + c*2 > width)
69 for (i = 0; i < c * 2; i++)
74 dst[out++] = table[c * 2];
75 dst[out++] = table[(c * 2) + 1];
80 for (j = 1; j <
height; j++) {
88 if (out + c*2 > width)
90 for (i = 0; i < c * 2; i++) {
91 dst[
out] = dst[out - pitch];
98 t = dst[out - pitch] + (table[c * 2] - 128);
102 t = dst[out - pitch] + (table[(c * 2) + 1] - 128);
103 t = av_clip_uint8(t);
124 for (j = 0; j <
height; j++) {
128 while (out < width) {
136 t = dst[
out] + (((table[c * 2] - 128)*3) >> 2);
137 t = av_clip_uint8(t);
140 t = dst[
out] + (((table[(c * 2) + 1] - 128)*3) >> 2);
141 t = av_clip_uint8(t);
152 void *
data,
int *got_frame,
157 int buf_size = avpkt->
size;
168 if (start >= buf_size) {
176 #ifndef BITSTREAM_READER_LE
177 for (i = 0; i < buf_size; i++)
184 ltab = buf[0x22] & 3;
185 ctab = buf[0x22] >> 2;
246 #ifdef BITSTREAM_READER_LE
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int ir2_get_code(GetBitContext *gb)
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static av_cold int init(AVCodecContext *avctx)
const uint8_t ff_reverse[256]
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Macro definitions for various function/variable attributes.
static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst, int pitch, const uint8_t *table)
AVCodec ff_indeo2_decoder
static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst, int pitch, const uint8_t *table)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
bitstream reader API header.
static av_cold int ir2_decode_init(AVCodecContext *avctx)
static int get_bits_left(GetBitContext *gb)
#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)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
static const struct endianess table[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
static av_cold int ir2_decode_end(AVCodecContext *avctx)
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buf...
int width
picture width / height.
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Libavcodec external API header.
static int ir2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static VLC_TYPE vlc_tables[VLC_TABLES_SIZE][2]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
#define INIT_VLC_USE_NEW_STATIC
VLC_TYPE(* table)[2]
code, bits
static const uint8_t ir2_delta_table[4][256]
static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static const uint16_t ir2_codes[IR2_CODES][2]