FFmpeg
Loading...
Searching...
No Matches
ffv1dec.c File Reference

FF Video Codec 1 (a lossless codec) decoder. More...

#include "libavutil/avassert.h"
#include "libavutil/crc.h"
#include "libavutil/mem.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 "progressframe.h"
#include "libavutil/refstruct.h"
#include "thread.h"
#include "decode.h"
#include "hwconfig.h"
#include "hwaccel_internal.h"
#include "config_components.h"
#include "ffv1dec_template.c"

Go to the source code of this file.

Macros

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

Functions

static int get_vlc_symbol (GetBitContext *gb, VlcState *const state, int bits)
 
static int is_input_end (RangeCoder *c, GetBitContext *gb, int ac)
 
static int decode_plane (FFV1Context *f, FFV1SliceContext *sc, GetBitContext *gb, uint8_t *src, int w, int h, int stride, int plane_index, int remap_index, int pixel_stride, int ac)
 
static int decode_slice_header (const FFV1Context *f, FFV1SliceContext *sc, AVFrame *frame)
 
static void slice_set_damaged (FFV1Context *f, FFV1SliceContext *sc)
 
static int decode_current_mul (RangeCoder *rc, uint8_t state[32], int *mul, int mul_count, int64_t i)
 
static int decode_remap (FFV1Context *f, FFV1SliceContext *sc)
 
static int decode_bayer_frame (FFV1Context *f, FFV1SliceContext *sc, GetBitContext *gb, uint8_t *src, int w, int h, int stride)
 
static int decode_slice (AVCodecContext *c, void *arg)
 
static enum AVPixelFormat get_pixel_format (FFV1Context *f)
 
static int read_header (FFV1Context *f, RangeCoder *c)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static int find_next_slice (AVCodecContext *avctx, uint8_t *buf, uint8_t *buf_end, int idx, uint8_t **pos, uint32_t *len)
 
static int decode_header (AVCodecContext *avctx, RangeCoder *c, uint8_t *buf, size_t buf_size)
 
static int decode_slices (AVCodecContext *avctx, RangeCoder c, AVPacket *avpkt)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
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]

◆ RENAME [1/2]

#define RENAME ( name)
Value:
const char * name
Definition qsvenc.c:142

Definition at line 91 of file ffv1dec.c.

Referenced by decode_bayer_frame().

◆ TYPE [2/2]

#define TYPE   int32_t

Definition at line 90 of file ffv1dec.c.

◆ RENAME [2/2]

#define RENAME ( name)
Value:
name ## 32

Definition at line 91 of file ffv1dec.c.

Function Documentation

◆ get_vlc_symbol()

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

Definition at line 48 of file ffv1dec.c.

Referenced by decode_line_TMPL().

◆ is_input_end()

static int is_input_end ( RangeCoder * c,
GetBitContext * gb,
int ac )
static

Definition at line 78 of file ffv1dec.c.

Referenced by decode_line_TMPL().

◆ decode_plane()

static int decode_plane ( FFV1Context * f,
FFV1SliceContext * sc,
GetBitContext * gb,
uint8_t * src,
int w,
int h,
int stride,
int plane_index,
int remap_index,
int pixel_stride,
int ac )
static

Definition at line 100 of file ffv1dec.c.

Referenced by decode_slice().

◆ decode_slice_header()

static int decode_slice_header ( const FFV1Context * f,
FFV1SliceContext * sc,
AVFrame * frame )
static

Definition at line 176 of file ffv1dec.c.

Referenced by decode_slice().

◆ slice_set_damaged()

static void slice_set_damaged ( FFV1Context * f,
FFV1SliceContext * sc )
static

Definition at line 279 of file ffv1dec.c.

Referenced by decode_slice(), and decode_slices().

◆ decode_current_mul()

static int decode_current_mul ( RangeCoder * rc,
uint8_t state[32],
int * mul,
int mul_count,
int64_t i )
static

Definition at line 289 of file ffv1dec.c.

Referenced by decode_remap().

◆ decode_remap()

static int decode_remap ( FFV1Context * f,
FFV1SliceContext * sc )
static

Definition at line 300 of file ffv1dec.c.

Referenced by decode_slice().

◆ decode_bayer_frame()

static int decode_bayer_frame ( FFV1Context * f,
FFV1SliceContext * sc,
GetBitContext * gb,
uint8_t * src,
int w,
int h,
int stride )
static

Definition at line 379 of file ffv1dec.c.

Referenced by decode_slice().

◆ decode_slice()

◆ get_pixel_format()

static enum AVPixelFormat get_pixel_format ( FFV1Context * f)
static

Definition at line 565 of file ffv1dec.c.

Referenced by read_header().

◆ read_header()

static int read_header ( FFV1Context * f,
RangeCoder * c )
static

Definition at line 578 of file ffv1dec.c.

Referenced by decode_header(), and mjpegb_decode_frame().

◆ decode_init()

static av_cold int decode_init ( AVCodecContext * avctx)
static

Definition at line 695 of file ffv1dec.c.

◆ find_next_slice()

static int find_next_slice ( AVCodecContext * avctx,
uint8_t * buf,
uint8_t * buf_end,
int idx,
uint8_t ** pos,
uint32_t * len )
static

Definition at line 715 of file ffv1dec.c.

Referenced by decode_frame(), and decode_slices().

◆ decode_header()

static int decode_header ( AVCodecContext * avctx,
RangeCoder * c,
uint8_t * buf,
size_t buf_size )
static

Definition at line 747 of file ffv1dec.c.

Referenced by decode_frame().

◆ decode_slices()

static int decode_slices ( AVCodecContext * avctx,
RangeCoder c,
AVPacket * avpkt )
static

Definition at line 791 of file ffv1dec.c.

Referenced by decode_frame(), and decode_frame().

◆ decode_frame()

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

Definition at line 881 of file ffv1dec.c.

◆ ffv1_decode_close()

static av_cold int ffv1_decode_close ( AVCodecContext * avctx)
static

Definition at line 1057 of file ffv1dec.c.

Variable Documentation

◆ ff_ffv1_decoder

const FFCodec ff_ffv1_decoder
Initial value:
= {
.p.name = "ffv1",
CODEC_LONG_NAME("FFmpeg video codec #1"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(FFV1Context),
UPDATE_THREAD_CONTEXT(update_thread_context),
.p.capabilities = AV_CODEC_CAP_DR1 |
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP |
.hw_configs = (const AVCodecHWConfigInternal *const []) {
},
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define UPDATE_THREAD_CONTEXT(func)
#define FF_CODEC_CAP_USES_PROGRESSFRAMES
The decoder might make use of the ProgressFrame API.
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define NULL
Definition coverity.c:32
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static av_cold int ffv1_decode_close(AVCodecContext *avctx)
Definition ffv1dec.c:1057
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition codec.h:102
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition codec.h:98
@ AV_CODEC_ID_FFV1
Definition codec_id.h:83
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int decode_init(AVCodecContext *avctx)
Definition 4xm.c:998
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition 4xm.c:837

Definition at line 1072 of file ffv1dec.c.