FFmpeg
Macros | Enumerations | Functions | Variables
rv40.c File Reference
#include "config.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "golomb.h"
#include "rv34.h"
#include "rv40vlc2.h"
#include "rv40data.h"

Go to the source code of this file.

Macros

#define MASK_CUR   0x0001
 
#define MASK_RIGHT   0x0008
 
#define MASK_BOTTOM   0x0010
 
#define MASK_TOP   0x1000
 
#define MASK_Y_TOP_ROW   0x000F
 
#define MASK_Y_LAST_ROW   0xF000
 
#define MASK_Y_LEFT_COL   0x1111
 
#define MASK_Y_RIGHT_COL   0x8888
 
#define MASK_C_TOP_ROW   0x0003
 
#define MASK_C_LAST_ROW   0x000C
 
#define MASK_C_LEFT_COL   0x0005
 
#define MASK_C_RIGHT_COL   0x000A
 

Enumerations

enum  RV40BlockPos { POS_CUR, POS_TOP, POS_LEFT, POS_BOTTOM }
 

Functions

static av_cold void rv40_init_table (VLC *vlc, unsigned *offset, int nb_bits, int nb_codes, const uint8_t(*tab)[2])
 
static av_cold void rv40_init_tables (void)
 Initialize all tables. More...
 
static int get_dimension (GetBitContext *gb, const int *dim)
 Get stored dimension from bitstream. More...
 
static void rv40_parse_picture_size (GetBitContext *gb, int *w, int *h)
 Get encoded picture size - usually this is called from rv40_parse_slice_header. More...
 
static int rv40_parse_slice_header (RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
 
static int rv40_decode_intra_types (RV34DecContext *r, GetBitContext *gb, int8_t *dst)
 Decode 4x4 intra types array. More...
 
static int rv40_decode_mb_info (RV34DecContext *r)
 Decode macroblock information. More...
 
static void rv40_adaptive_loop_filter (RV34DSPContext *rdsp, uint8_t *src, int stride, int dmode, int lim_q1, int lim_p1, int alpha, int beta, int beta2, int chroma, int edge, int dir)
 
static void rv40_loop_filter (RV34DecContext *r, int row)
 RV40 loop filtering function. More...
 
static av_cold int rv40_decode_init (AVCodecContext *avctx)
 Initialize decoder. More...
 

Variables

static VLC aic_top_vlc
 
static VLC aic_mode1_vlc [AIC_MODE1_NUM]
 
static VLC aic_mode2_vlc [AIC_MODE2_NUM]
 
static VLC ptype_vlc [NUM_PTYPE_VLCS]
 
static VLC btype_vlc [NUM_BTYPE_VLCS]
 
static const int neighbour_offs_x [4] = { 0, 0, -1, 0 }
 
static const int neighbour_offs_y [4] = { 0, -1, 0, 1 }
 
const AVCodec ff_rv40_decoder
 

Detailed Description

RV40 decoder

Definition in file rv40.c.

Macro Definition Documentation

◆ MASK_CUR

#define MASK_CUR   0x0001

Definition at line 293 of file rv40.c.

◆ MASK_RIGHT

#define MASK_RIGHT   0x0008

Definition at line 294 of file rv40.c.

◆ MASK_BOTTOM

#define MASK_BOTTOM   0x0010

Definition at line 295 of file rv40.c.

◆ MASK_TOP

#define MASK_TOP   0x1000

Definition at line 296 of file rv40.c.

◆ MASK_Y_TOP_ROW

#define MASK_Y_TOP_ROW   0x000F

Definition at line 297 of file rv40.c.

◆ MASK_Y_LAST_ROW

#define MASK_Y_LAST_ROW   0xF000

Definition at line 298 of file rv40.c.

◆ MASK_Y_LEFT_COL

#define MASK_Y_LEFT_COL   0x1111

Definition at line 299 of file rv40.c.

◆ MASK_Y_RIGHT_COL

#define MASK_Y_RIGHT_COL   0x8888

Definition at line 300 of file rv40.c.

◆ MASK_C_TOP_ROW

#define MASK_C_TOP_ROW   0x0003

Definition at line 301 of file rv40.c.

◆ MASK_C_LAST_ROW

#define MASK_C_LAST_ROW   0x000C

Definition at line 302 of file rv40.c.

◆ MASK_C_LEFT_COL

#define MASK_C_LEFT_COL   0x0005

Definition at line 303 of file rv40.c.

◆ MASK_C_RIGHT_COL

#define MASK_C_RIGHT_COL   0x000A

Definition at line 304 of file rv40.c.

Enumeration Type Documentation

◆ RV40BlockPos

Enumerator
POS_CUR 
POS_TOP 
POS_LEFT 
POS_BOTTOM 

Definition at line 286 of file rv40.c.

Function Documentation

◆ rv40_init_table()

static av_cold void rv40_init_table ( VLC vlc,
unsigned *  offset,
int  nb_bits,
int  nb_codes,
const uint8_t(*)  tab[2] 
)
static

Definition at line 44 of file rv40.c.

Referenced by rv40_init_tables().

◆ rv40_init_tables()

static av_cold void rv40_init_tables ( void  )
static

Initialize all tables.

Definition at line 61 of file rv40.c.

Referenced by rv40_decode_init().

◆ get_dimension()

static int get_dimension ( GetBitContext gb,
const int dim 
)
static

Get stored dimension from bitstream.

If the width/height is the standard one then it's coded as a 3-bit index. Otherwise it is coded as escaped 8-bit portions.

Definition at line 108 of file rv40.c.

Referenced by rv40_parse_picture_size().

◆ rv40_parse_picture_size()

static void rv40_parse_picture_size ( GetBitContext gb,
int w,
int h 
)
static

Get encoded picture size - usually this is called from rv40_parse_slice_header.

Definition at line 128 of file rv40.c.

Referenced by rv40_parse_slice_header().

◆ rv40_parse_slice_header()

static int rv40_parse_slice_header ( RV34DecContext r,
GetBitContext gb,
SliceInfo si 
)
static

Definition at line 134 of file rv40.c.

Referenced by rv40_decode_init().

◆ rv40_decode_intra_types()

static int rv40_decode_intra_types ( RV34DecContext r,
GetBitContext gb,
int8_t *  dst 
)
static

Decode 4x4 intra types array.

Definition at line 168 of file rv40.c.

Referenced by rv40_decode_init().

◆ rv40_decode_mb_info()

static int rv40_decode_mb_info ( RV34DecContext r)
static

Decode macroblock information.

Definition at line 230 of file rv40.c.

Referenced by rv40_decode_init().

◆ rv40_adaptive_loop_filter()

static void rv40_adaptive_loop_filter ( RV34DSPContext rdsp,
uint8_t *  src,
int  stride,
int  dmode,
int  lim_q1,
int  lim_p1,
int  alpha,
int  beta,
int  beta2,
int  chroma,
int  edge,
int  dir 
)
static

Definition at line 309 of file rv40.c.

Referenced by rv40_loop_filter().

◆ rv40_loop_filter()

static void rv40_loop_filter ( RV34DecContext r,
int  row 
)
static

RV40 loop filtering function.

< current macroblock and its neighbours types

flags indicating that macroblock can be filtered with strong filter it is set only for intra coded MB and MB with DCs coded separately

< MB filter clipping value calculated from filtering strength

coded block patterns for luma part of current macroblock and its neighbours Format: LSB corresponds to the top left block, each nibble represents one row of subblocks.

coded block patterns for chroma part of current macroblock and its neighbours Format is the same as for luma with two subblocks in a row.

This mask represents the pattern of luma subblocks that should be filtered in addition to the coded ones because they lie at the edge of 8x8 block with different enough motion vectors

Definition at line 340 of file rv40.c.

Referenced by rv40_decode_init().

◆ rv40_decode_init()

static av_cold int rv40_decode_init ( AVCodecContext avctx)
static

Initialize decoder.

Definition at line 554 of file rv40.c.

Variable Documentation

◆ aic_top_vlc

VLC aic_top_vlc
static

Definition at line 40 of file rv40.c.

Referenced by rv40_decode_init(), rv40_decode_intra_types(), and rv40_init_tables().

◆ aic_mode1_vlc

VLC aic_mode1_vlc[AIC_MODE1_NUM]
static

Definition at line 41 of file rv40.c.

Referenced by rv40_decode_intra_types(), and rv40_init_tables().

◆ aic_mode2_vlc

VLC aic_mode2_vlc[AIC_MODE2_NUM]
static

Definition at line 41 of file rv40.c.

Referenced by rv40_decode_intra_types(), and rv40_init_tables().

◆ ptype_vlc

VLC ptype_vlc[NUM_PTYPE_VLCS]
static

Definition at line 42 of file rv40.c.

Referenced by rv40_decode_mb_info(), and rv40_init_tables().

◆ btype_vlc

VLC btype_vlc[NUM_BTYPE_VLCS]
static

Definition at line 42 of file rv40.c.

Referenced by rv40_decode_mb_info(), and rv40_init_tables().

◆ neighbour_offs_x

const int neighbour_offs_x[4] = { 0, 0, -1, 0 }
static

Definition at line 306 of file rv40.c.

Referenced by rv40_loop_filter().

◆ neighbour_offs_y

const int neighbour_offs_y[4] = { 0, -1, 0, 1 }
static

Definition at line 307 of file rv40.c.

Referenced by rv40_loop_filter().

◆ ff_rv40_decoder

const AVCodec ff_rv40_decoder
Initial value:

Definition at line 574 of file rv40.c.

RV34DecContext
decoder context
Definition: rv34.h:86
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
ff_rv34_decode_end
av_cold int ff_rv34_decode_end(AVCodecContext *avctx)
Definition: rv34.c:1807
ff_rv34_decode_update_thread_context
int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
Definition: rv34.c:1516
rv40_decode_init
static av_cold int rv40_decode_init(AVCodecContext *avctx)
Initialize decoder.
Definition: rv40.c:554
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:290
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:108
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:592
ff_rv34_decode_frame
int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
Definition: rv34.c:1597
ONLY_IF_THREADS_ENABLED
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:156
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
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:117
ff_mpeg_flush
void ff_mpeg_flush(AVCodecContext *avctx)
Definition: mpegvideo.c:2300
AV_CODEC_ID_RV40
@ AV_CODEC_ID_RV40
Definition: codec_id.h:119
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:77
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FF_CODEC_CAP_ALLOCATE_PROGRESS
#define FF_CODEC_CAP_ALLOCATE_PROGRESS
Definition: internal.h:76