55 #define HUFFMAN_TABLE_SIZE 64 * 1024 56 #define HUF_TOKENS 256 57 #define PALETTE_COUNT 256 70 const unsigned char *
buf;
91 for(i = 0; i < num_hnodes; i++) {
96 if(hnodes[i].count < best) {
97 best = hnodes[i].
count;
104 hnodes[best_node].
used = 1;
118 hnode *node, *hnodes;
127 node = &hnodes[num_hnodes];
150 int i, j, histogram_index = 0;
151 unsigned char *histograms;
164 for (i = 0; i < 256; i++) {
179 int bit_pos, node_num, dat_pos;
181 prev = bit_pos = dat_pos = 0;
190 if(dat_pos >= s->
size) {
195 v = s->
buf[dat_pos++];
198 node_num = hnodes[node_num].
children[v & 0x01];
203 frame->
data[0][x] = node_num;
210 void *
data,
int *got_frame,
214 int buf_size = avpkt->
size;
244 .
name =
"idcinvideo",
This structure describes decoded (raw) audio or video data.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
static void idcin_decode_vlcs(IdcinContext *s, AVFrame *frame)
8 bit with PIX_FMT_RGB32 palette
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
hnode huff_nodes[256][HUF_TOKENS *2]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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.
common internal API header
int width
picture width / height.
static av_cold void huff_build_tree(IdcinContext *s, int prev)
const unsigned char * buf
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
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.
common internal api header.
static av_cold int idcin_decode_init(AVCodecContext *avctx)
static av_cold int init(AVCodecParserContext *s)
static int idcin_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
This structure stores compressed data.