25 #include "libavutil/intreadwrite.h"
44 int num_lens, num_codes, num_codes_sum, prefix;
53 for (i = 0; i < num_lens; i++) {
55 num_codes_sum += num_codes;
57 if (num_codes_sum > 256) {
61 "Too many VLCs (%d) to be read.\n", num_codes_sum);
65 for (j = 0; j < num_codes; j++) {
68 codes[count] = prefix++;
77 codes, 2, 2, symbols, 1, 1, 0);
95 pred[0] = top_left[0];
96 pred[1] = top_left[1];
97 pred[2] = top_left[2];
98 pred[3] = top_left[3];
141 top_left[0] = outbuf[0];
145 top_left[1] = outbuf[1];
146 top_left[2] = outbuf[2];
147 top_left[3] = outbuf[3];
178 *top_left = outbuf[0];
195 for (i = 0; i < ctx->
avctx->
width >> is_chroma; i++) {
206 *top_left = outbuf[0];
230 for (i = 0; i < 4; i++) {
233 for (j = 0; j <= i; j++)
237 "Could not read code table %d.\n", i);
243 for (i = 0; i < avctx->
height; i++) {
249 for (i = 0; i < 4; i++)
273 for (i = 0; i < 3; i++) {
276 for (j = 0; j <= i; j++)
280 "Could not read code table %d.\n", i);
286 for (i = 0; i < avctx->
height; i++) {
287 for (j = 0; j < 3; j++)
293 for (i = 0; i < 3; i++)
313 dst[0] = pic->
data[0];
314 dst[1] = pic->
data[1];
315 dst[2] = pic->
data[2];
326 for (i = 0; i < 2; i++) {
329 for (j = 0; j <= i; j++)
333 "Could not read code table %d.\n", i);
339 for (i = 0; i < avctx->
height; i++) {
344 for (j = 0; j < 3; j++)
348 for (i = 0; i < 2; i++)
355 int *got_picture_ptr,
AVPacket *avpkt)
360 uint32_t info_tag, info_offset;
363 int coding_type, ret;
368 if (info_tag ==
MKTAG(
'I',
'N',
'F',
'O')) {
369 info_offset =
AV_RL32(src + 4);
370 if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->
size) {
372 "Invalid INFO header offset: 0x%08"PRIX32
" is too large.\n",
383 data_size = (avpkt->
size - info_offset) & ~1;
407 coding_type = (
AV_RL32(src) >> 8) & 0xFF;
410 switch (coding_type) {
465 *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.
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
void(* bswap16_buf)(uint16_t *dst, const uint16_t *src, int len)
packed RGB 8:8:8, 24bpp, RGBRGB...
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
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)
Allocate a buffer with padding, reusing the given one if large enough.
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 av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
int ff_init_vlc_sparse(VLC *vlc, 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)
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
bitstream reader API header.
static av_cold int cllc_decode_close(AVCodecContext *avctx)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
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.
#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.
#define CLOSE_READER(name, gb)
Libavcodec external API header.
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
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 Libav, patches welcome.
main external API structure.
static void close(AVCodecParserContext *s)
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)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
#define MKTAG(a, b, c, d)
static av_cold int cllc_decode_init(AVCodecContext *avctx)
common internal api header.
static av_cold int init(AVCodecParserContext *s)
static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
VLC_TYPE(* table)[2]
code, bits
int key_frame
1 -> keyframe, 0-> not
static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
This structure stores compressed data.
void ff_free_vlc(VLC *vlc)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.