FFmpeg
Data Structures | Macros | Functions | Variables
cllc.c File Reference
#include <inttypes.h>
#include "libavutil/intreadwrite.h"
#include "bswapdsp.h"
#include "canopus.h"
#include "get_bits.h"
#include "avcodec.h"
#include "internal.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  CLLCContext
 

Macros

#define VLC_BITS   7
 
#define VLC_DEPTH   2
 

Functions

static int read_code_table (CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
 
static int read_argb_line (CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
 
static int read_rgb24_component_line (CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
 
static int read_yuv_component_line (CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf, int is_chroma)
 
static int decode_argb_frame (CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
 
static int decode_rgb24_frame (CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
 
static int decode_yuv_frame (CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
 
static int cllc_decode_frame (AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
 
static av_cold int cllc_decode_close (AVCodecContext *avctx)
 
static av_cold int cllc_decode_init (AVCodecContext *avctx)
 

Variables

AVCodec ff_cllc_decoder
 

Macro Definition Documentation

◆ VLC_BITS

#define VLC_BITS   7

Definition at line 33 of file cllc.c.

◆ VLC_DEPTH

#define VLC_DEPTH   2

Definition at line 34 of file cllc.c.

Function Documentation

◆ read_code_table()

static int read_code_table ( CLLCContext ctx,
GetBitContext gb,
VLC vlc 
)
static

Definition at line 45 of file cllc.c.

Referenced by decode_argb_frame(), decode_rgb24_frame(), and decode_yuv_frame().

◆ read_argb_line()

static int read_argb_line ( CLLCContext ctx,
GetBitContext gb,
int top_left,
VLC vlc,
uint8_t outbuf 
)
static

Definition at line 101 of file cllc.c.

Referenced by decode_argb_frame().

◆ read_rgb24_component_line()

static int read_rgb24_component_line ( CLLCContext ctx,
GetBitContext gb,
int top_left,
VLC vlc,
uint8_t outbuf 
)
static

Definition at line 170 of file cllc.c.

Referenced by decode_rgb24_frame().

◆ read_yuv_component_line()

static int read_yuv_component_line ( CLLCContext ctx,
GetBitContext gb,
int top_left,
VLC vlc,
uint8_t outbuf,
int  is_chroma 
)
static

Definition at line 200 of file cllc.c.

Referenced by decode_yuv_frame().

◆ decode_argb_frame()

static int decode_argb_frame ( CLLCContext ctx,
GetBitContext gb,
AVFrame pic 
)
static

Definition at line 228 of file cllc.c.

Referenced by cllc_decode_frame().

◆ decode_rgb24_frame()

static int decode_rgb24_frame ( CLLCContext ctx,
GetBitContext gb,
AVFrame pic 
)
static

Definition at line 272 of file cllc.c.

Referenced by cllc_decode_frame().

◆ decode_yuv_frame()

static int decode_yuv_frame ( CLLCContext ctx,
GetBitContext gb,
AVFrame pic 
)
static

Definition at line 316 of file cllc.c.

Referenced by cllc_decode_frame().

◆ cllc_decode_frame()

static int cllc_decode_frame ( AVCodecContext avctx,
void *  data,
int got_picture_ptr,
AVPacket avpkt 
)
static

Definition at line 371 of file cllc.c.

◆ cllc_decode_close()

static av_cold int cllc_decode_close ( AVCodecContext avctx)
static

Definition at line 499 of file cllc.c.

◆ cllc_decode_init()

static av_cold int cllc_decode_init ( AVCodecContext avctx)
static

Definition at line 508 of file cllc.c.

Variable Documentation

◆ ff_cllc_decoder

AVCodec ff_cllc_decoder
Initial value:
= {
.name = "cllc",
.long_name = NULL_IF_CONFIG_SMALL("Canopus Lossless Codec"),
.priv_data_size = sizeof(CLLCContext),
.init_thread_copy = ONLY_IF_THREADS_ENABLED(cllc_init_thread_copy),
.decode = cllc_decode_frame,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 522 of file cllc.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:40
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
cllc_decode_close
static av_cold int cllc_decode_close(AVCodecContext *avctx)
Definition: cllc.c:499
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1037
ONLY_IF_THREADS_ENABLED
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:227
cllc_decode_frame
static int cllc_decode_frame(AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
Definition: cllc.c:371
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
init_thread_copy
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
cllc_decode_init
static av_cold int cllc_decode_init(AVCodecContext *avctx)
Definition: cllc.c:508
AV_CODEC_ID_CLLC
@ AV_CODEC_ID_CLLC
Definition: avcodec.h:384
CLLCContext
Definition: cllc.c:37
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201