26 #define BITSTREAM_READER_LE
39 #define CODE_VLC_BITS 14
67 for (i = 0; i < c * 2; i++)
70 dst[out++] = table[c * 2];
71 dst[out++] = table[(c * 2) + 1];
76 for (j = 1; j <
height; j++){
84 for (i = 0; i < c * 2; i++) {
85 dst[out] = dst[out -
stride];
89 t = dst[out -
stride] + (table[c * 2] - 128);
93 t = dst[out -
stride] + (table[(c * 2) + 1] - 128);
105 const uint8_t *table)
115 for (j = 0; j <
height; j++){
123 t = dst[out] + (((table[c * 2] - 128)*3) >> 2);
127 t = dst[out] + (((table[(c * 2) + 1] - 128)*3) >> 2);
139 void *
data,
int *data_size,
142 const uint8_t *buf = avpkt->
data;
143 int buf_size = avpkt->
size;
161 if (start >= buf_size) {
169 #ifndef BITSTREAM_READER_LE
170 for (i = 0; i < buf_size; i++)
210 #ifdef BITSTREAM_READER_LE
const uint8_t av_reverse[256]
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int ir2_get_code(GetBitContext *gb)
#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.
four components are given, that's all.
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
AVCodec ff_indeo2_decoder
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
bitstream reader API header.
static av_cold int ir2_decode_init(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.
#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 Ir2Context Ir2Context
static av_cold int ir2_decode_end(AVCodecContext *avctx)
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.
#define INIT_VLC_USE_NEW_STATIC
#define FF_BUFFER_HINTS_REUSABLE
static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride, const uint8_t *table)
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride, const uint8_t *table)
#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)
#define FF_BUFFER_HINTS_PRESERVE
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static VLC_TYPE vlc_tables[VLC_TABLES_SIZE][2]
static const uint8_t ir2_luma_table[256]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal and external API header
VLC_TYPE(* table)[2]
code, bits
static int ir2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static const uint16_t ir2_codes[IR2_CODES][2]