FFmpeg
Macros | Functions | Variables
ffv1dec.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/crc.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "get_bits.h"
#include "rangecoder.h"
#include "golomb.h"
#include "mathops.h"
#include "ffv1.h"
#include "thread.h"
#include "threadframe.h"
#include "ffv1dec_template.c"

Go to the source code of this file.

Macros

#define TYPE   int16_t
 
#define RENAME(name)   name
 
#define TYPE   int32_t
 
#define RENAME(name)   name ## 32
 

Functions

static av_flatten int get_symbol_inline (RangeCoder *c, uint8_t *state, int is_signed)
 
static av_noinline int get_symbol (RangeCoder *c, uint8_t *state, int is_signed)
 
static int get_vlc_symbol (GetBitContext *gb, VlcState *const state, int bits)
 
static int is_input_end (FFV1Context *s)
 
static int decode_plane (FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index, int pixel_stride)
 
static int decode_slice_header (const FFV1Context *f, FFV1Context *fs)
 
static int decode_slice (AVCodecContext *c, void *arg)
 
static int read_quant_table (RangeCoder *c, int16_t *quant_table, int scale)
 
static int read_quant_tables (RangeCoder *c, int16_t quant_table[MAX_CONTEXT_INPUTS][256])
 
static int read_extra_header (FFV1Context *f)
 
static int read_header (FFV1Context *f)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
static void copy_fields (FFV1Context *fsdst, const FFV1Context *fssrc, const FFV1Context *fsrc)
 
static av_cold int ffv1_decode_close (AVCodecContext *avctx)
 

Variables

const FFCodec ff_ffv1_decoder
 

Detailed Description

FF Video Codec 1 (a lossless codec) decoder

Definition in file ffv1dec.c.

Macro Definition Documentation

◆ TYPE [1/2]

#define TYPE   int16_t

Definition at line 116 of file ffv1dec.c.

◆ RENAME [1/2]

#define RENAME (   name)    name

Definition at line 117 of file ffv1dec.c.

◆ TYPE [2/2]

#define TYPE   int32_t

Definition at line 116 of file ffv1dec.c.

◆ RENAME [2/2]

#define RENAME (   name)    name ## 32

Definition at line 117 of file ffv1dec.c.

Function Documentation

◆ get_symbol_inline()

static av_flatten int get_symbol_inline ( RangeCoder c,
uint8_t *  state,
int  is_signed 
)
inlinestatic

Definition at line 43 of file ffv1dec.c.

Referenced by decode_line(), and get_symbol().

◆ get_symbol()

static av_noinline int get_symbol ( RangeCoder c,
uint8_t *  state,
int  is_signed 
)
static

◆ get_vlc_symbol()

static int get_vlc_symbol ( GetBitContext gb,
VlcState *const  state,
int  bits 
)
inlinestatic

Definition at line 72 of file ffv1dec.c.

Referenced by decode_line().

◆ is_input_end()

static int is_input_end ( FFV1Context s)
static

Definition at line 97 of file ffv1dec.c.

Referenced by decode_line().

◆ decode_plane()

static int decode_plane ( FFV1Context s,
uint8_t *  src,
int  w,
int  h,
int  stride,
int  plane_index,
int  pixel_stride 
)
static

Definition at line 120 of file ffv1dec.c.

Referenced by decode_slice().

◆ decode_slice_header()

static int decode_slice_header ( const FFV1Context f,
FFV1Context fs 
)
static

Definition at line 166 of file ffv1dec.c.

Referenced by decode_slice().

◆ decode_slice()

static int decode_slice ( AVCodecContext c,
void *  arg 
)
static

Definition at line 255 of file ffv1dec.c.

Referenced by decode_frame(), and dxtory_decode_v2().

◆ read_quant_table()

static int read_quant_table ( RangeCoder c,
int16_t *  quant_table,
int  scale 
)
static

Definition at line 378 of file ffv1dec.c.

Referenced by read_quant_tables().

◆ read_quant_tables()

static int read_quant_tables ( RangeCoder c,
int16_t  quant_table[MAX_CONTEXT_INPUTS][256] 
)
static

Definition at line 405 of file ffv1dec.c.

Referenced by read_extra_header(), and read_header().

◆ read_extra_header()

static int read_extra_header ( FFV1Context f)
static

Definition at line 423 of file ffv1dec.c.

Referenced by decode_init().

◆ read_header()

static int read_header ( FFV1Context f)
static

Definition at line 540 of file ffv1dec.c.

Referenced by decode_frame(), and mjpegb_decode_frame().

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 832 of file ffv1dec.c.

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 854 of file ffv1dec.c.

◆ copy_fields()

static void copy_fields ( FFV1Context fsdst,
const FFV1Context fssrc,
const FFV1Context fsrc 
)
static

Definition at line 1016 of file ffv1dec.c.

◆ ffv1_decode_close()

static av_cold int ffv1_decode_close ( AVCodecContext avctx)
static

Definition at line 1090 of file ffv1dec.c.

Variable Documentation

◆ ff_ffv1_decoder

const FFCodec ff_ffv1_decoder
Initial value:

Definition at line 1106 of file ffv1dec.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
ffv1_decode_close
static av_cold int ffv1_decode_close(AVCodecContext *avctx)
Definition: ffv1dec.c:1090
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:298
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: ffv1dec.c:854
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:363
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:264
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:113
UPDATE_THREAD_CONTEXT
#define UPDATE_THREAD_CONTEXT(func)
Definition: codec_internal.h:273
AV_CODEC_ID_FFV1
@ AV_CODEC_ID_FFV1
Definition: codec_id.h:85
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
FF_CODEC_CAP_ALLOCATE_PROGRESS
#define FF_CODEC_CAP_ALLOCATE_PROGRESS
Definition: codec_internal.h:69
AV_CODEC_CAP_SLICE_THREADS
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition: codec.h:117
update_thread_context
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 update_thread_context() run it in the next thread. 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
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: ffv1dec.c:832
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FFV1Context
Definition: ffv1.h:73