FFmpeg
Data Structures | Macros | Functions | Variables
rv10.c File Reference
#include <inttypes.h>
#include "libavutil/imgutils.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "error_resilience.h"
#include "h263.h"
#include "h263data.h"
#include "h263dec.h"
#include "mpeg_er.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpegvideodec.h"
#include "mpeg4video.h"
#include "mpegvideodata.h"
#include "rv10dec.h"

Go to the source code of this file.

Data Structures

struct  RVDecContext
 

Macros

#define RV_GET_MAJOR_VER(x)   ((x) >> 28)
 
#define RV_GET_MINOR_VER(x)   (((x) >> 20) & 0xFF)
 
#define RV_GET_MICRO_VER(x)   (((x) >> 12) & 0xFF)
 
#define MAX_VLC_ENTRIES   1023
 
#define DC_VLC_BITS   9
 
#define ERROR_SKIP_FRAME   -123
 

Functions

int ff_rv_decode_dc (MpegEncContext *s, int n)
 
static int rv10_decode_picture_header (MpegEncContext *s)
 
static int rv20_decode_picture_header (RVDecContext *rv, int whole_size)
 
static av_cold void rv10_build_vlc (VLC *vlc, const uint16_t len_count[15], const uint8_t sym_rl[][2], int sym_rl_elems)
 
static av_cold void rv10_init_static (void)
 
static av_cold int rv10_decode_init (AVCodecContext *avctx)
 
static av_cold int rv10_decode_end (AVCodecContext *avctx)
 
static int rv10_decode_packet (AVCodecContext *avctx, const uint8_t *buf, int buf_size, int buf_size2, int whole_size)
 
static int get_slice_offset (AVCodecContext *avctx, const uint8_t *buf, int n)
 
static int rv10_decode_frame (AVCodecContext *avctx, AVFrame *pict, int *got_frame, AVPacket *avpkt)
 

Variables

static const uint8_t rv_sym_run_len [][2]
 
static const uint16_t rv_lum_len_count [15]
 
static const uint16_t rv_chrom_len_count [15]
 
static VLC rv_dc_lum
 
static VLC rv_dc_chrom
 
const FFCodec ff_rv10_decoder
 
const FFCodec ff_rv20_decoder
 

Detailed Description

RV10/RV20 decoder

Definition in file rv10.c.

Macro Definition Documentation

◆ RV_GET_MAJOR_VER

#define RV_GET_MAJOR_VER (   x)    ((x) >> 28)

Definition at line 48 of file rv10.c.

◆ RV_GET_MINOR_VER

#define RV_GET_MINOR_VER (   x)    (((x) >> 20) & 0xFF)

Definition at line 49 of file rv10.c.

◆ RV_GET_MICRO_VER

#define RV_GET_MICRO_VER (   x)    (((x) >> 12) & 0xFF)

Definition at line 50 of file rv10.c.

◆ MAX_VLC_ENTRIES

#define MAX_VLC_ENTRIES   1023

Definition at line 52 of file rv10.c.

◆ DC_VLC_BITS

#define DC_VLC_BITS   9

Definition at line 53 of file rv10.c.

◆ ERROR_SKIP_FRAME

#define ERROR_SKIP_FRAME   -123

Function Documentation

◆ ff_rv_decode_dc()

int ff_rv_decode_dc ( MpegEncContext s,
int  n 
)

Definition at line 84 of file rv10.c.

Referenced by h263_decode_block().

◆ rv10_decode_picture_header()

static int rv10_decode_picture_header ( MpegEncContext s)
static

Definition at line 101 of file rv10.c.

Referenced by rv10_decode_packet().

◆ rv20_decode_picture_header()

static int rv20_decode_picture_header ( RVDecContext rv,
int  whole_size 
)
static

Definition at line 159 of file rv10.c.

Referenced by rv10_decode_packet().

◆ rv10_build_vlc()

static av_cold void rv10_build_vlc ( VLC vlc,
const uint16_t  len_count[15],
const uint8_t  sym_rl[][2],
int  sym_rl_elems 
)
static

Definition at line 320 of file rv10.c.

Referenced by rv10_init_static().

◆ rv10_init_static()

static av_cold void rv10_init_static ( void  )
static

Definition at line 341 of file rv10.c.

Referenced by rv10_decode_init().

◆ rv10_decode_init()

static av_cold int rv10_decode_init ( AVCodecContext avctx)
static

Definition at line 367 of file rv10.c.

◆ rv10_decode_end()

static av_cold int rv10_decode_end ( AVCodecContext avctx)
static

Definition at line 435 of file rv10.c.

◆ rv10_decode_packet()

static int rv10_decode_packet ( AVCodecContext avctx,
const uint8_t *  buf,
int  buf_size,
int  buf_size2,
int  whole_size 
)
static

Definition at line 443 of file rv10.c.

Referenced by rv10_decode_frame().

◆ get_slice_offset()

static int get_slice_offset ( AVCodecContext avctx,
const uint8_t *  buf,
int  n 
)
static

Definition at line 588 of file rv10.c.

Referenced by rv10_decode_frame().

◆ rv10_decode_frame()

static int rv10_decode_frame ( AVCodecContext avctx,
AVFrame pict,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 596 of file rv10.c.

Variable Documentation

◆ rv_sym_run_len

const uint8_t rv_sym_run_len[][2]
static
Initial value:
= {
{ 0, 0 }, { 1, 0 }, { 255, 0 }, { 3, 1 }, { 254, 1 },
{ 7, 3 }, { 252, 3 }, { 15, 7 }, { 248, 7 }, { 31, 15 },
{ 240, 15 }, { 63, 31 }, { 224, 31 }, { 127, 63 }, { 192, 63 },
{ 255, 127 }, { 128, 127 }, { 127, 255 }, { 128, 255 },
}

Definition at line 65 of file rv10.c.

Referenced by rv10_init_static().

◆ rv_lum_len_count

const uint16_t rv_lum_len_count[15]
static
Initial value:
= {
1, 0, 2, 4, 8, 16, 32, 0, 64, 0, 128, 0, 256, 0, 512,
}

Definition at line 74 of file rv10.c.

Referenced by rv10_init_static().

◆ rv_chrom_len_count

const uint16_t rv_chrom_len_count[15]
static
Initial value:
= {
1, 2, 4, 0, 8, 0, 16, 0, 32, 0, 64, 0, 128, 0, 256,
}

Definition at line 78 of file rv10.c.

Referenced by rv10_init_static().

◆ rv_dc_lum

VLC rv_dc_lum
static

Definition at line 82 of file rv10.c.

Referenced by ff_rv_decode_dc(), and rv10_init_static().

◆ rv_dc_chrom

VLC rv_dc_chrom
static

Definition at line 82 of file rv10.c.

Referenced by ff_rv_decode_dc(), and rv10_init_static().

◆ ff_rv10_decoder

const FFCodec ff_rv10_decoder
Initial value:
= {
.p.name = "rv10",
CODEC_LONG_NAME("RealVideo 1.0"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(RVDecContext),
.close = rv10_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.p.max_lowres = 3,
.p.pix_fmts = (const enum AVPixelFormat[]) {
},
}

Definition at line 684 of file rv10.c.

◆ ff_rv20_decoder

const FFCodec ff_rv20_decoder
Initial value:
= {
.p.name = "rv20",
CODEC_LONG_NAME("RealVideo 2.0"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(RVDecContext),
.close = rv10_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = ff_mpeg_flush,
.p.max_lowres = 3,
.p.pix_fmts = (const enum AVPixelFormat[]) {
},
}

Definition at line 701 of file rv10.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
RVDecContext
Definition: rv10.c:55
rv10_decode_end
static av_cold int rv10_decode_end(AVCodecContext *avctx)
Definition: rv10.c:435
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
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
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
rv10_decode_frame
static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, int *got_frame, AVPacket *avpkt)
Definition: rv10.c:596
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_mpeg_flush
void ff_mpeg_flush(AVCodecContext *avctx)
Definition: mpegvideo_dec.c:544
AV_CODEC_ID_RV10
@ AV_CODEC_ID_RV10
Definition: codec_id.h:57
AV_CODEC_ID_RV20
@ AV_CODEC_ID_RV20
Definition: codec_id.h:58
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:76
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
rv10_decode_init
static av_cold int rv10_decode_init(AVCodecContext *avctx)
Definition: rv10.c:367