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++)
72 dst[out++] = table[c * 2];
73 dst[out++] = table[(c * 2) + 1];
78 for (j = 1; j <
height; j++) {
84 if (out + c*2 > width)
86 for (i = 0; i < c * 2; i++) {
87 dst[
out] = dst[out - pitch];
91 int t = dst[out - pitch] + (table[c * 2] - 128);
95 t = dst[out - pitch] + (table[(c * 2) + 1] - 128);
117 for (j = 0; j <
height; j++) {
119 while (out < width) {
125 t = dst[
out] + (((table[c * 2] - 128)*3) >> 2);
126 t = av_clip_uint8(t);
129 t = dst[
out] + (((table[(c * 2) + 1] - 128)*3) >> 2);
130 t = av_clip_uint8(t);
141 void *
data,
int *got_frame,
146 int buf_size = avpkt->
size;
157 if (start >= buf_size) {
165 #ifndef BITSTREAM_READER_LE
166 for (i = 0; i < buf_size; i++)
173 ltab = buf[0x22] & 3;
174 ctab = buf[0x22] >> 2;
235 #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.
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]