53 #define HUFFMAN_TABLE_SIZE 64 * 1024
54 #define HUF_TOKENS 256
55 #define PALETTE_COUNT 256
69 const unsigned char *
buf;
90 for(i = 0; i < num_hnodes; i++) {
95 if(hnodes[i].count < best) {
96 best = hnodes[i].
count;
103 hnodes[best_node].
used = 1;
117 hnode *node, *hnodes;
126 node = &hnodes[num_hnodes];
149 int i, j, histogram_index = 0;
150 unsigned char *histograms;
163 for (i = 0; i < 256; i++) {
180 int bit_pos, node_num, dat_pos;
182 prev = bit_pos = dat_pos = 0;
191 if(dat_pos >= s->
size) {
196 v = s->
buf[dat_pos++];
199 node_num = hnodes[node_num].
children[v & 0x01];
211 void *
data,
int *data_size,
214 const uint8_t *buf = avpkt->
data;
215 int buf_size = avpkt->
size;
257 .
name =
"idcinvideo",
static av_cold int idcin_decode_end(AVCodecContext *avctx)
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
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.
hnode huff_nodes[256][HUF_TOKENS *2]
static int init(AVCodecParserContext *s)
struct IdcinContext IdcinContext
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static int huff_smallest_node(hnode *hnodes, int num_hnodes)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define HUFFMAN_TABLE_SIZE
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static void idcin_decode_vlcs(IdcinContext *s)
int width
picture width / height.
struct AVFrame AVFrame
Audio Video Frame.
static av_cold void huff_build_tree(IdcinContext *s, int prev)
const unsigned char * buf
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
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 idcin_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int palette_has_changed
Tell user application that palette has changed from previous frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
8 bit with PIX_FMT_RGB32 palette
static av_cold int idcin_decode_init(AVCodecContext *avctx)