49 int num_lens, num_codes, num_codes_sum, prefix;
65 for (i = 0; i < num_lens; i++) {
67 num_codes_sum += num_codes;
69 if (num_codes_sum > 256) {
73 "Too many VLCs (%d) to be read.\n", num_codes_sum);
77 for (j = 0; j < num_codes; j++) {
80 codes[
count] = prefix++;
84 if (prefix > (65535 - 256)/2) {
93 codes, 2, 2, symbols, 1, 1, 0);
111 pred[0] = top_left[0];
112 pred[1] = top_left[1];
113 pred[2] = top_left[2];
114 pred[3] = top_left[3];
157 top_left[0] = outbuf[0];
161 top_left[1] = outbuf[1];
162 top_left[2] = outbuf[2];
163 top_left[3] = outbuf[3];
194 *top_left = outbuf[0];
211 for (i = 0; i < ctx->
avctx->
width >> is_chroma; i++) {
222 *top_left = outbuf[0];
246 for (i = 0; i < 4; i++) {
249 for (j = 0; j <= i; j++)
253 "Could not read code table %d.\n", i);
259 for (i = 0; i < avctx->
height; i++) {
265 for (i = 0; i < 4; i++)
289 for (i = 0; i < 3; i++) {
292 for (j = 0; j <= i; j++)
296 "Could not read code table %d.\n", i);
302 for (i = 0; i < avctx->
height; i++) {
303 for (j = 0; j < 3; j++)
309 for (i = 0; i < 3; i++)
329 dst[0] = pic->
data[0];
330 dst[1] = pic->
data[1];
331 dst[2] = pic->
data[2];
342 for (i = 0; i < 2; i++) {
345 for (j = 0; j <= i; j++)
349 "Could not read code table %d.\n", i);
355 for (i = 0; i < avctx->
height; i++) {
360 for (j = 0; j < 3; j++)
364 for (i = 0; i < 2; i++)
371 int *got_picture_ptr,
AVPacket *avpkt)
376 uint32_t info_tag, info_offset;
379 int coding_type, ret;
381 if (avpkt->
size < 4 + 4) {
388 if (info_tag ==
MKTAG(
'I',
'N',
'F',
'O')) {
389 info_offset =
AV_RL32(src + 4);
390 if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->
size) {
392 "Invalid INFO header offset: 0x%08"PRIX32
" is too large.\n",
402 data_size = (avpkt->
size - info_offset) & ~1;
427 coding_type = (
AV_RL32(src) >> 8) & 0xFF;
430 switch (coding_type) {
476 *got_picture_ptr = 1;
static int read_rgb24_component_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
packed RGB 8:8:8, 24bpp, RGBRGB...
void(* bswap16_buf)(uint16_t *dst, const uint16_t *src, int len)
static av_cold int init(AVCodecContext *avctx)
int ff_canopus_parse_info_tag(AVCodecContext *avctx, const uint8_t *src, size_t size)
int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end w...
static int cllc_decode_frame(AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
bitstream reader API header.
static av_cold int cllc_decode_close(AVCodecContext *avctx)
static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
#define UPDATE_CACHE(name, gb)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const struct endianess table[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const char * name
Name of the codec implementation.
#define CLOSE_READER(name, gb)
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
#define GET_VLC(code, name, gb, table, bits, max_depth)
If the vlc code is invalid and max_depth=1, then no bits will be removed.
static const float pred[4]
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Libavcodec external API header.
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.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define OPEN_READER(name, gb)
static void skip_bits(GetBitContext *s, int n)
static int read_yuv_component_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf, int is_chroma)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static av_cold int cllc_decode_init(AVCodecContext *avctx)
common internal api header.
static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
VLC_TYPE(* table)[2]
code, bits
int key_frame
1 -> keyframe, 0-> not
static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
#define MKTAG(a, b, c, d)
static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.
void ff_free_vlc(VLC *vlc)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.