Go to the documentation of this file.
55 #define HUFFMAN_TABLE_SIZE 64 * 1024
56 #define HUF_TOKENS 256
57 #define PALETTE_COUNT 256
69 const unsigned char *
buf;
90 for(
i = 0;
i < num_hnodes;
i++) {
95 if(hnodes[
i].count < best) {
103 hnodes[best_node].
used = 1;
117 hnode *node, *hnodes;
121 hnodes =
s->huff_nodes[prev];
126 node = &hnodes[num_hnodes];
143 s->num_huff_nodes[prev] = num_hnodes - 1;
149 int i, j, histogram_index = 0;
150 unsigned char *histograms;
162 histograms = (
unsigned char *)
s->avctx->extradata;
163 for (
i = 0;
i < 256;
i++) {
165 s->huff_nodes[
i][j].count = histograms[histogram_index++];
178 int bit_pos, node_num, dat_pos;
180 prev = bit_pos = dat_pos = 0;
183 for (x = y; x < y +
s->avctx->width; x++) {
184 node_num =
s->num_huff_nodes[prev];
185 hnodes =
s->huff_nodes[prev];
189 if(dat_pos >=
s->size) {
194 v =
s->buf[dat_pos++];
197 node_num = hnodes[node_num].
children[v & 0x01];
213 const uint8_t *buf = avpkt->
data;
214 int buf_size = avpkt->
size;
227 #if FF_API_PALETTE_HAS_CHANGED
232 #if FF_API_PALETTE_HAS_CHANGED
245 {
"max_pixels",
"320*240" },
250 .
p.
name =
"idcinvideo",
#define FF_ENABLE_DEPRECATION_WARNINGS
attribute_deprecated int palette_has_changed
Tell user application that palette has changed from previous frame.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec p
The public AVCodec.
const unsigned char * buf
hnode huff_nodes[256][HUF_TOKENS *2]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold void huff_build_tree(IdcinContext *s, int prev)
#define FF_CODEC_DECODE_CB(func)
int(* init)(AVBSFContext *ctx)
const FFCodec ff_idcin_decoder
#define CODEC_LONG_NAME(str)
static int huff_smallest_node(hnode *hnodes, int num_hnodes)
Find the lowest probability node in a Huffman table, and mark it as being assigned to a higher probab...
#define HUFFMAN_TABLE_SIZE
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
static int idcin_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
#define i(width, name, range_min, range_max)
static const FFCodecDefault idcin_defaults[]
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
main external API structure.
static av_cold int idcin_decode_init(AVCodecContext *avctx)
#define FF_DISABLE_DEPRECATION_WARNINGS
This structure stores compressed data.
static int idcin_decode_vlcs(IdcinContext *s, AVFrame *frame)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
Check whether the side-data of src contains a palette of size AVPALETTE_SIZE; if so,...