49 int num_lens, num_codes, num_codes_sum;
62 for (
i = 0;
i < num_lens;
i++) {
64 num_codes_sum += num_codes;
66 if (num_codes_sum > 256) {
68 "Too many VLCs (%d) to be read.\n", num_codes_sum);
72 for (j = 0; j < num_codes; j++) {
81 symbols, 1, 1, 0, 0,
ctx->avctx);
99 pred[0] = top_left[0];
100 pred[1] = top_left[1];
101 pred[2] = top_left[2];
102 pred[3] = top_left[3];
104 for (
i = 0;
i <
ctx->avctx->width;
i++) {
145 top_left[0] = outbuf[0];
149 top_left[1] = outbuf[1];
150 top_left[2] = outbuf[2];
151 top_left[3] = outbuf[3];
170 for (
i = 0;
i <
ctx->avctx->width;
i++) {
182 *top_left = outbuf[0];
199 for (
i = 0;
i <
ctx->avctx->width >> is_chroma;
i++) {
210 *top_left = outbuf[0];
234 for (
i = 0;
i < 4;
i++) {
237 for (j = 0; j <
i; j++)
241 "Could not read code table %d.\n",
i);
253 for (
i = 0;
i < 4;
i++)
277 for (
i = 0;
i < 3;
i++) {
280 for (j = 0; j <
i; j++)
284 "Could not read code table %d.\n",
i);
291 for (j = 0; j < 3; j++)
297 for (
i = 0;
i < 3;
i++)
317 dst[0] = pic->
data[0];
318 dst[1] = pic->
data[1];
319 dst[2] = pic->
data[2];
330 for (
i = 0;
i < 2;
i++) {
333 for (j = 0; j <
i; j++)
337 "Could not read code table %d.\n",
i);
348 for (j = 0; j < 3; j++)
352 for (
i = 0;
i < 2;
i++)
359 int *got_picture_ptr,
AVPacket *avpkt)
365 uint32_t info_tag, info_offset;
368 int coding_type, ret;
370 if (avpkt->
size < 4 + 4) {
377 if (info_tag ==
MKTAG(
'I',
'N',
'F',
'O')) {
379 if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->
size) {
381 "Invalid INFO header offset: 0x%08"PRIX32
" is too large.\n",
391 data_size = (avpkt->
size - info_offset) & ~1;
395 &
ctx->swapped_buf_size, data_size);
396 if (!
ctx->swapped_buf) {
402 ctx->bdsp.bswap16_buf((uint16_t *)
ctx->swapped_buf, (uint16_t *)
src,
422 switch (coding_type) {
468 *got_picture_ptr = 1;
489 ctx->swapped_buf_size = 0;
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
void ff_free_vlc(VLC *vlc)
int ff_init_vlc_from_lengths(VLC *vlc_arg, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx)
Build VLC decoding tables suitable for use with get_vlc2()
int ff_canopus_parse_info_tag(AVCodecContext *avctx, const uint8_t *src, size_t size)
static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
static int read_yuv_component_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf, int is_chroma)
static int read_rgb24_component_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
static av_cold int cllc_decode_close(AVCodecContext *avctx)
static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
static av_cold int cllc_decode_init(AVCodecContext *avctx)
static int cllc_decode_frame(AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
#define MKTAG(a, b, c, d)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
bitstream reader API header.
#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.
#define CLOSE_READER(name, gb)
static int get_bits_left(GetBitContext *gb)
#define OPEN_READER(name, gb)
static void skip_bits(GetBitContext *s, int n)
#define UPDATE_CACHE(name, gb)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
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...
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PICTURE_TYPE_I
Intra.
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
static const uint16_t table[]
FF_ENABLE_DEPRECATION_WARNINGS int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
static const float pred[4]
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int key_frame
1 -> keyframe, 0-> not
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
enum AVPictureType pict_type
Picture type of the frame.
This structure stores compressed data.
VLC_TYPE(* table)[2]
code, bits
#define avpriv_request_sample(...)