Go to the documentation of this file.
50 int num_lens, num_codes, num_codes_sum, prefix;
66 for (
i = 0;
i < num_lens;
i++) {
68 num_codes_sum += num_codes;
70 if (num_codes_sum > 256) {
74 "Too many VLCs (%d) to be read.\n", num_codes_sum);
78 for (j = 0; j < num_codes; j++) {
81 codes[
count] = prefix++;
85 if (prefix > (65535 - 256)/2) {
94 codes, 2, 2, symbols, 1, 1, 0);
112 pred[0] = top_left[0];
113 pred[1] = top_left[1];
114 pred[2] = top_left[2];
115 pred[3] = top_left[3];
117 for (
i = 0;
i <
ctx->avctx->width;
i++) {
158 top_left[0] = outbuf[0];
162 top_left[1] = outbuf[1];
163 top_left[2] = outbuf[2];
164 top_left[3] = outbuf[3];
183 for (
i = 0;
i <
ctx->avctx->width;
i++) {
195 *top_left = outbuf[0];
212 for (
i = 0;
i <
ctx->avctx->width >> is_chroma;
i++) {
223 *top_left = outbuf[0];
247 for (
i = 0;
i < 4;
i++) {
250 for (j = 0; j <=
i; j++)
254 "Could not read code table %d.\n",
i);
266 for (
i = 0;
i < 4;
i++)
290 for (
i = 0;
i < 3;
i++) {
293 for (j = 0; j <=
i; j++)
297 "Could not read code table %d.\n",
i);
304 for (j = 0; j < 3; j++)
310 for (
i = 0;
i < 3;
i++)
330 dst[0] = pic->
data[0];
331 dst[1] = pic->
data[1];
332 dst[2] = pic->
data[2];
343 for (
i = 0;
i < 2;
i++) {
346 for (j = 0; j <=
i; j++)
350 "Could not read code table %d.\n",
i);
361 for (j = 0; j < 3; j++)
365 for (
i = 0;
i < 2;
i++)
372 int *got_picture_ptr,
AVPacket *avpkt)
378 uint32_t info_tag, info_offset;
381 int coding_type,
ret;
383 if (avpkt->
size < 4 + 4) {
390 if (info_tag ==
MKTAG(
'I',
'N',
'F',
'O')) {
392 if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->
size) {
394 "Invalid INFO header offset: 0x%08"PRIX32
" is too large.\n",
404 data_size = (avpkt->
size - info_offset) & ~1;
408 &
ctx->swapped_buf_size, data_size);
409 if (!
ctx->swapped_buf) {
415 ctx->bdsp.bswap16_buf((uint16_t *)
ctx->swapped_buf, (uint16_t *)
src,
435 switch (coding_type) {
481 *got_picture_ptr = 1;
493 ctx->swapped_buf_size = 0;
515 ctx->swapped_buf_size = 0;
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static av_cold int init(AVCodecContext *avctx)
static int get_bits_left(GetBitContext *gb)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int read_yuv_component_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf, int is_chroma)
#define MKTAG(a, b, c, d)
#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.
This structure describes decoded (raw) audio or video data.
static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
static const uint16_t table[]
#define UPDATE_CACHE(name, gb)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static void skip_bits(GetBitContext *s, int n)
static int read_rgb24_component_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
int ff_canopus_parse_info_tag(AVCodecContext *avctx, const uint8_t *src, size_t size)
int key_frame
1 -> keyframe, 0-> not
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
#define CLOSE_READER(name, gb)
static av_cold int cllc_decode_close(AVCodecContext *avctx)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void ff_free_vlc(VLC *vlc)
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
@ AV_PICTURE_TYPE_I
Intra.
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
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)
static int cllc_decode_frame(AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
enum AVPictureType pict_type
Picture type of the frame.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have add an init_thread_copy() which re-allocates them for other threads. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. If there are inter-frame dependencies
#define OPEN_READER(name, gb)
static av_cold int cllc_decode_init(AVCodecContext *avctx)
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
#define i(width, name, range_min, range_max)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
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...
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static const float pred[4]
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
main external API structure.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
#define avpriv_request_sample(...)
This structure stores compressed data.
int width
picture width / height.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
The exact code depends on how similar the blocks are and how related they are to the block
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
VLC_TYPE(* table)[2]
code, bits