27 #define BITSTREAM_READER_LE
42 #define CODE_VLC_BITS 14
66 if (out + c*2 > width)
68 for (i = 0; i < c * 2; i++)
71 dst[out++] = table[c * 2];
72 dst[out++] = table[(c * 2) + 1];
77 for (j = 1; j <
height; j++) {
83 if (out + c*2 > width)
85 for (i = 0; i < c * 2; i++) {
86 dst[
out] = dst[out - pitch];
90 int t = dst[out - pitch] + (table[c * 2] - 128);
94 t = dst[out - pitch] + (table[(c * 2) + 1] - 128);
116 for (j = 0; j <
height; j++) {
118 while (out < width) {
124 t = dst[
out] + (((table[c * 2] - 128)*3) >> 2);
125 t = av_clip_uint8(t);
128 t = dst[
out] + (((table[(c * 2) + 1] - 128)*3) >> 2);
129 t = av_clip_uint8(t);
140 void *
data,
int *got_frame,
145 int buf_size = avpkt->
size;
156 if (start >= buf_size) {
164 #ifndef BITSTREAM_READER_LE
165 for (i = 0; i < buf_size; i++)
172 ltab = buf[0x22] & 3;
173 ctab = buf[0x22] >> 2;
228 #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)
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)
#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 uint8_t ff_reverse[256]
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.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
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]
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]