FFmpeg
Loading...
Searching...
No Matches
rv60dec.c File Reference
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "golomb.h"
#include "libavutil/mem.h"
#include "rv60data.h"
#include "rv60dsp.h"
#include "rv60vlcs.h"
#include "threadprogress.h"
#include "unary.h"
#include "videodsp.h"
#include "libavutil/attributes.h"

Go to the source code of this file.

Data Structures

struct  CoeffVLCs
 
struct  Slice
 
struct  ThreadContext
 
struct  MV
 
struct  MVInfo
 
struct  BlockInfo
 
struct  PUInfo
 
struct  RV60Context
 
struct  IntraPredContext
 
struct  CUContext
 
struct  Dimensions
 

Macros

#define MAX_VLC_SIZE   864
 
#define CUR_PIC   0
 
#define LAST_PIC   1
 
#define NEXT_PIC   2
 
#define MK_UNIQUELIST(name, type, max_size)
 
#define MEDIAN(x)
 
#define FILTER1(src, src_stride, src_y_ofs, step)
 
#define FILTER2(src, src_stride, src_y_ofs, step)
 
#define FILTER3(src, src_stride, src_y_ofs, step)
 
#define FILTER_CASE(idx, dst, dst_stride, filter, w, h)
 
#define FILTER_BLOCK(dst, dst_stride, src, src_stride, src_y_ofs, w, h, cond, step)
 
#define STRENGTH(el, lim)
 
#define CLIP_SYMM(a, b)
 

Enumerations

enum  CUType { CU_INTRA = 0 , CU_INTER_MV , CU_SKIP , CU_INTER }
 
enum  PUType {
  PU_FULL = 0 , PU_N2HOR , PU_N2VER , PU_QUARTERS ,
  PU_N4HOR , PU_N34HOR , PU_N4VER , PU_N34VER
}
 
enum  IntraMode { INTRAMODE_INDEX = 0 , INTRAMODE_DC64 , INTRAMODE_PLANE64 , INTRAMODE_MODE }
 
enum  MVRefEnum {
  MVREF_NONE = 0 , MVREF_REF0 , MVREF_REF1 , MVREF_BREF ,
  MVREF_REF0ANDBREF , MVREF_SKIP0 , MVREF_SKIP1 , MVREF_SKIP2 ,
  MVREF_SKIP3
}
 
enum  { TRANSFORM_NONE = 0 , TRANSFORM_16X16 , TRANSFORM_8X8 , TRANSFORM_4X4 }
 

Functions

static const VLCElemgen_vlc (const uint8_t *bits, int size, VLCInitState *state)
 
static void build_coeff_vlc (const CoeffLens *lens, CoeffVLCs *vlc, int count, VLCInitState *state)
 
static av_cold void rv60_init_static_data (void)
 
static int progress_init (RV60Context *s, unsigned count)
 
static av_cold int rv60_decode_init (AVCodecContext *avctx)
 
static int update_dimensions_clear_info (RV60Context *s, int width, int height)
 
static int read_code012 (GetBitContext *gb)
 
static int read_frame_header (RV60Context *s, GetBitContext *gb, int *width, int *height)
 
static int read_slice_sizes (RV60Context *s, GetBitContext *gb)
 
static int read_intra_mode (GetBitContext *gb, int *param)
 
static int has_top_block (const RV60Context *s, int xpos, int ypos, int dx, int dy, int size)
 
static int has_left_block (const RV60Context *s, int xpos, int ypos, int dx, int dy, int size)
 
static int has_top_right_block (const RV60Context *s, int xpos, int ypos, int dx, int dy, int size)
 
static int has_left_down_block (const RV60Context *s, int xpos, int ypos, int dx, int dy, int size)
 
static void ipred_init (IntraPredContext *i)
 
static void populate_ipred (const RV60Context *s, CUContext *cu, const uint8_t *src, int stride, int xoff, int yoff, int size, int is_luma)
 
static void pred_plane (const IntraPredContext *p, uint8_t *dst, int stride, int size)
 
static void pred_dc (const IntraPredContext *p, uint8_t *dst, int stride, int size, int filter)
 
static void filter_weak (uint8_t *dst, const uint8_t *src, int size)
 
static void filter_bilin32 (uint8_t *dst, int v0, int v1, int size)
 
static void pred_hor_angle (uint8_t *dst, int stride, int size, int weight, const uint8_t *src)
 
static void pred_ver_angle (uint8_t *dst, int stride, int size, int weight, const uint8_t *src)
 
static int pred_angle (const IntraPredContext *p, uint8_t *dst, int stride, int size, int imode, int filter)
 
static int pu_is_intra (const PUInfo *pu)
 
static int ipm_compar (const void *a, const void *b)
 
static int reconstruct_intra (const RV60Context *s, const CUContext *cu, int size, int sub)
 
static int get_skip_mv_index (enum MVRefEnum mvref)
 
static void add_if_valid (unique_list_mvinfo *skip_cand, const MVInfo *mvi)
 
static void fill_mv_skip_cand (RV60Context *s, const CUContext *cu, unique_list_mvinfo *skip_cand, int size)
 
static void get_mv_dimensions (Dimensions *dim, enum PUType pu_type, int part_no, int size)
 
static int has_hor_split (enum PUType pu_type)
 
static int has_ver_split (enum PUType pu_type)
 
static int pu_type_num_parts (enum PUType pu_type)
 
static void get_next_mv (const RV60Context *s, const Dimensions *dim, enum PUType pu_type, int part_no, int *mv_pos, int *mv_x, int *mv_y)
 
static int mv_is_ref0 (enum MVRefEnum mvref)
 
static int mv_is_forward (enum MVRefEnum mvref)
 
static int mv_is_backward (enum MVRefEnum mvref)
 
static int mvinfo_matches_forward (const MVInfo *a, const MVInfo *b)
 
static int mvinfo_matches_backward (const MVInfo *a, const MVInfo *b)
 
static int mvinfo_is_deblock_cand (const MVInfo *a, const MVInfo *b)
 
static void mv_pred (MV *ret, MV a, MV b, MV c)
 
static void predict_mv (const RV60Context *s, MVInfo *dst, int mv_x, int mv_y, int mv_w, const MVInfo *src)
 
static void reconstruct (RV60Context *s, const CUContext *cu, int size)
 
static void read_mv (GetBitContext *gb, MV *mv)
 
static void read_mv_info (RV60Context *s, GetBitContext *gb, MVInfo *mvinfo, int size, enum PUType pu_type)
 
static void luma_mc (uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h, int cx, int cy)
 
static void chroma_mc (uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h, int x, int y)
 
static int check_pos (int x, int y, int cw, int ch, int w, int h, int dx, int dy, int e0, int e1, int e2, int e3)
 
static void mc (RV60Context *s, uint8_t *frame_data[3], int frame_linesize[3], const AVFrame *ref, int x, int y, int w, int h, MV mv, int avg)
 
static void avg_plane (uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
 
static void avg (AVFrame *frame, uint8_t *prev_frame_data[3], int prev_frame_linesize[3], int x, int y, int w, int h)
 
static int get_c4x4_set (int qp, int is_intra)
 
static int quant (int v, int q)
 
static int decode_coeff (GetBitContext *gb, const CoeffVLCs *vlcs, int inval, int val)
 
static void decode_2x2_dc (GetBitContext *gb, const CoeffVLCs *vlcs, int16_t *coeffs, int stride, int block2, int dsc, int q_dc, int q_ac)
 
static void decode_2x2 (GetBitContext *gb, const CoeffVLCs *vlcs, int16_t *coeffs, int stride, int block2, int dsc, int q_ac)
 
static void decode_4x4_block_dc (GetBitContext *gb, const CoeffVLCs *vlcs, int is_luma, int16_t *coeffs, int stride, int q_dc, int q_ac)
 
static void decode_4x4_block (GetBitContext *gb, const CoeffVLCs *vlcs, int is_luma, int16_t *coeffs, int stride, int q_ac)
 
static void decode_cu_4x4in16x16 (GetBitContext *gb, int is_intra, int qp, int sel_qp, int16_t *y_coeffs, int16_t *u_coeffs, int16_t *v_coeffs, int cbp)
 
static int decode_cbp8 (GetBitContext *gb, int subset, int qp)
 
static void decode_cu_8x8 (GetBitContext *gb, int is_intra, int qp, int sel_qp, int16_t *y_coeffs, int16_t *u_coeffs, int16_t *v_coeffs, int ccbp, int mode4x4)
 
static void decode_cu_16x16 (GetBitContext *gb, int is_intra, int qp, int sel_qp, int16_t *y_coeffs, int16_t *u_coeffs, int16_t *v_coeffs, int ccbp)
 
static int decode_super_cbp (GetBitContext *gb, const VLCElem *vlc[4])
 
static int decode_cbp16 (GetBitContext *gb, int subset, int qp)
 
static int decode_cu_r (RV60Context *s, AVFrame *frame, ThreadContext *thread, GetBitContext *gb, int xpos, int ypos, int log_size, int qp, int sel_qp)
 
static int deblock_get_pos (RV60Context *s, int xpos, int ypos)
 
static void deblock_set_strength (RV60Context *s, int xpos, int ypos, int size, int q, int strength)
 
static int deblock_get_top_strength (const RV60Context *s, int pos)
 
static int deblock_get_left_strength (const RV60Context *s, int pos)
 
static void deblock_set_top_strength (RV60Context *s, int pos, int strength)
 
static void deblock_set_left_strength (RV60Context *s, int pos, int strength)
 
static void derive_deblock_strength (RV60Context *s, int xpos, int ypos, int size)
 
static void filter_luma_edge (uint8_t *dst, int step, int stride, int mode1, int mode2, int lim1, int lim2)
 
static void filter_chroma_edge (uint8_t *dst, int step, int stride, int mode1, int mode2, int lim1, int lim2)
 
static void deblock_edge_ver (AVFrame *frame, int xpos, int ypos, int dblk_l, int dblk_r, int deblock_chroma)
 
static void deblock_edge_hor (AVFrame *frame, int xpos, int ypos, int dblk_t, int dblk_d, int deblock_chroma)
 
static void deblock8x8 (const RV60Context *s, AVFrame *frame, int xpos, int ypos, int dblkpos)
 
static void deblock (const RV60Context *s, AVFrame *frame, int xpos, int ypos, int size, int dpos)
 
static void deblock_cu_r (RV60Context *s, AVFrame *frame, ThreadContext *thread, int xpos, int ypos, int log_size, int qp)
 
static int read_qp_offset (GetBitContext *gb, int qp_off_type)
 
static int calc_sel_qp (int osvquant, int qp)
 
static int decode_slice (AVCodecContext *avctx, void *tdata, int cu_y, int threadnr)
 
static int rv60_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
static av_cold void rv60_flush (AVCodecContext *avctx)
 
static av_cold int rv60_decode_end (AVCodecContext *avctx)
 

Variables

static const int8_t frame_types [4] = {AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_NONE}
 
static const uint8_t skip_mv_ref [4] = {MVREF_SKIP0, MVREF_SKIP1, MVREF_SKIP2, MVREF_SKIP3}
 
static const VLCElemcbp8_vlc [7][4]
 
static const VLCElemcbp16_vlc [7][4][4]
 
static CoeffVLCs intra_coeff_vlc [5]
 
static CoeffVLCs inter_coeff_vlc [7]
 
static VLCElem table_data [129148]
 
const FFCodec ff_rv60_decoder
 

Macro Definition Documentation

◆ MAX_VLC_SIZE

#define MAX_VLC_SIZE   864

Definition at line 99 of file rv60dec.c.

◆ CUR_PIC

#define CUR_PIC   0

Definition at line 196 of file rv60dec.c.

Referenced by rv60_decode_frame().

◆ LAST_PIC

#define LAST_PIC   1

Definition at line 197 of file rv60dec.c.

Referenced by decode_cu_r(), and rv60_decode_frame().

◆ NEXT_PIC

#define NEXT_PIC   2

Definition at line 198 of file rv60dec.c.

Referenced by decode_cu_r(), and rv60_decode_frame().

◆ MK_UNIQUELIST

#define MK_UNIQUELIST ( name,
type,
max_size )
Value:
typedef struct { \
type list[max_size]; \
int size; \
} unique_list_##name; \
\
static void unique_list_##name##_init(unique_list_##name * s) \
{ \
memset(s->list, 0, sizeof(s->list)); \
s->size = 0; \
} \
\
static void unique_list_##name##_add(unique_list_##name * s, type cand) \
{ \
if (s->size == max_size) \
return; \
\
for (int i = 0; i < s->size; i++) { \
if (!memcmp(&s->list[i], &cand, sizeof(type))) { \
return; \
} \
} \
s->list[s->size++] = cand; \
}
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
cl_device_type type
const char * name
Definition qsvenc.c:142
int size

Definition at line 771 of file rv60dec.c.

◆ MEDIAN

#define MEDIAN ( x)
Value:
if (a.x < b.x) \
if (b.x < c.x) \
ret->x = b.x; \
else \
ret->x = a.x < c.x ? c.x : a.x; \
else \
if (b.x < c.x) \
ret->x = a.x < c.x ? a.x : c.x; \
else \
ret->x = b.x; \
int a
#define b
Definition input.c:43
static double c[64]

Referenced by config_input(), config_input(), decode_init(), decode_slice(), encode_frame(), encode_init(), filter_frame(), magy_decode_slice(), magy_decode_slice10(), magy_encode_init(), and mv_pred().

◆ FILTER1

#define FILTER1 ( src,
src_stride,
src_y_ofs,
step )
Value:
( (src)[(y + src_y_ofs)*(src_stride) + x - 2*step] \
- 5 * (src)[(y + src_y_ofs)*(src_stride) + x - 1*step] \
+52 * (src)[(y + src_y_ofs)*(src_stride) + x ] \
+20 * (src)[(y + src_y_ofs)*(src_stride) + x + 1*step] \
- 5 * (src)[(y + src_y_ofs)*(src_stride) + x + 2*step] \
+ (src)[(y + src_y_ofs)*(src_stride) + x + 3*step] + 32) >> 6
#define src
Definition vp8dsp.c:248

Definition at line 1229 of file rv60dec.c.

◆ FILTER2

#define FILTER2 ( src,
src_stride,
src_y_ofs,
step )
Value:
( (src)[(y + src_y_ofs)*(src_stride) + x - 2*step] \
- 5 * (src)[(y + src_y_ofs)*(src_stride) + x - 1*step] \
+20 * (src)[(y + src_y_ofs)*(src_stride) + x ] \
+20 * (src)[(y + src_y_ofs)*(src_stride) + x + 1*step] \
- 5 * (src)[(y + src_y_ofs)*(src_stride) + x + 2*step] \
+ (src)[(y + src_y_ofs)*(src_stride) + x + 3*step] + 16) >> 5

Definition at line 1237 of file rv60dec.c.

◆ FILTER3

#define FILTER3 ( src,
src_stride,
src_y_ofs,
step )
Value:
( (src)[(y + src_y_ofs)*(src_stride) + x - 2*step] \
- 5 * (src)[(y + src_y_ofs)*(src_stride) + x - 1*step] \
+20 * (src)[(y + src_y_ofs)*(src_stride) + x ] \
+52 * (src)[(y + src_y_ofs)*(src_stride) + x + 1*step] \
- 5 * (src)[(y + src_y_ofs)*(src_stride) + x + 2*step] \
+ (src)[(y + src_y_ofs)*(src_stride) + x + 3*step] + 32) >> 6

Definition at line 1245 of file rv60dec.c.

◆ FILTER_CASE

#define FILTER_CASE ( idx,
dst,
dst_stride,
filter,
w,
h )
Value:
case idx: \
for (int y = 0; y < h; y++) \
for (int x = 0; x < w; x++) \
(dst)[y*dst_stride + x] = av_clip_uint8(filter); \
break;
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
#define av_clip_uint8
Definition common.h:106
uint8_t w
Definition llvidencdsp.c:39
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
Definition h263dsp.c:29

Definition at line 1253 of file rv60dec.c.

◆ FILTER_BLOCK

#define FILTER_BLOCK ( dst,
dst_stride,
src,
src_stride,
src_y_ofs,
w,
h,
cond,
step )
Value:
switch (cond) { \
FILTER_CASE(1, dst, dst_stride, FILTER1(src, src_stride, src_y_ofs, step), w, h) \
FILTER_CASE(2, dst, dst_stride, FILTER2(src, src_stride, src_y_ofs, step), w, h) \
FILTER_CASE(3, dst, dst_stride, FILTER3(src, src_stride, src_y_ofs, step), w, h) \
}
int(* cond)(enum AVPixelFormat pix_fmt)
#define FILTER3(src, src_stride, src_y_ofs, step)
Definition rv60dec.c:1245
#define FILTER2(src, src_stride, src_y_ofs, step)
Definition rv60dec.c:1237
#define FILTER1(src, src_stride, src_y_ofs, step)
Definition rv60dec.c:1229

Definition at line 1260 of file rv60dec.c.

Referenced by luma_mc().

◆ STRENGTH

#define STRENGTH ( el,
lim )
Value:
(FFABS(el) < (lim) ? 3 : 1)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition common.h:74

Definition at line 1975 of file rv60dec.c.

Referenced by filter_chroma_edge(), and filter_luma_edge().

◆ CLIP_SYMM

#define CLIP_SYMM ( a,
b )
Value:
av_clip(a, -(b), b)
#define av_clip
Definition common.h:100

Definition at line 1976 of file rv60dec.c.

Referenced by filter_chroma_edge(), and filter_luma_edge().

Enumeration Type Documentation

◆ CUType

enum CUType
Enumerator
CU_INTRA 
CU_INTER_MV 
CU_SKIP 
CU_INTER 

Definition at line 40 of file rv60dec.c.

◆ PUType

enum PUType
Enumerator
PU_FULL 
PU_N2HOR 
PU_N2VER 
PU_QUARTERS 
PU_N4HOR 
PU_N34HOR 
PU_N4VER 
PU_N34VER 

Definition at line 47 of file rv60dec.c.

◆ IntraMode

enum IntraMode
Enumerator
INTRAMODE_INDEX 
INTRAMODE_DC64 
INTRAMODE_PLANE64 
INTRAMODE_MODE 

Definition at line 58 of file rv60dec.c.

◆ MVRefEnum

enum MVRefEnum
Enumerator
MVREF_NONE 
MVREF_REF0 
MVREF_REF1 
MVREF_BREF 
MVREF_REF0ANDBREF 
MVREF_SKIP0 
MVREF_SKIP1 
MVREF_SKIP2 
MVREF_SKIP3 

Definition at line 65 of file rv60dec.c.

◆ anonymous enum

anonymous enum
Enumerator
TRANSFORM_NONE 
TRANSFORM_16X16 
TRANSFORM_8X8 
TRANSFORM_4X4 

Definition at line 79 of file rv60dec.c.

Function Documentation

◆ gen_vlc()

static const VLCElem * gen_vlc ( const uint8_t * bits,
int size,
VLCInitState * state )
static

Definition at line 103 of file rv60dec.c.

Referenced by build_coeff_vlc(), and rv60_init_static_data().

◆ build_coeff_vlc()

static void build_coeff_vlc ( const CoeffLens * lens,
CoeffVLCs * vlc,
int count,
VLCInitState * state )
static

Definition at line 124 of file rv60dec.c.

Referenced by rv60_init_static_data().

◆ rv60_init_static_data()

static av_cold void rv60_init_static_data ( void )
static

Definition at line 136 of file rv60dec.c.

Referenced by rv60_decode_init().

◆ progress_init()

static int progress_init ( RV60Context * s,
unsigned count )
static

Definition at line 233 of file rv60dec.c.

Referenced by rv60_decode_frame().

◆ rv60_decode_init()

static av_cold int rv60_decode_init ( AVCodecContext * avctx)
static

Definition at line 255 of file rv60dec.c.

◆ update_dimensions_clear_info()

static int update_dimensions_clear_info ( RV60Context * s,
int width,
int height )
static

Definition at line 277 of file rv60dec.c.

Referenced by rv60_decode_frame().

◆ read_code012()

static int read_code012 ( GetBitContext * gb)
static

Definition at line 340 of file rv60dec.c.

Referenced by read_frame_header(), read_intra_mode(), and read_qp_offset().

◆ read_frame_header()

static int read_frame_header ( RV60Context * s,
GetBitContext * gb,
int * width,
int * height )
static

Definition at line 347 of file rv60dec.c.

Referenced by rv60_decode_frame().

◆ read_slice_sizes()

static int read_slice_sizes ( RV60Context * s,
GetBitContext * gb )
static

Definition at line 395 of file rv60dec.c.

Referenced by rv60_decode_frame().

◆ read_intra_mode()

static int read_intra_mode ( GetBitContext * gb,
int * param )
static

Definition at line 423 of file rv60dec.c.

Referenced by decode_cu_r().

◆ has_top_block()

static int has_top_block ( const RV60Context * s,
int xpos,
int ypos,
int dx,
int dy,
int size )
static

Definition at line 434 of file rv60dec.c.

Referenced by has_top_right_block(), predict_mv(), and reconstruct_intra().

◆ has_left_block()

static int has_left_block ( const RV60Context * s,
int xpos,
int ypos,
int dx,
int dy,
int size )
static

Definition at line 439 of file rv60dec.c.

Referenced by has_left_down_block(), and reconstruct_intra().

◆ has_top_right_block()

static int has_top_right_block ( const RV60Context * s,
int xpos,
int ypos,
int dx,
int dy,
int size )
static

Definition at line 444 of file rv60dec.c.

Referenced by populate_ipred().

◆ has_left_down_block()

static int has_left_down_block ( const RV60Context * s,
int xpos,
int ypos,
int dx,
int dy,
int size )
static

Definition at line 454 of file rv60dec.c.

Referenced by populate_ipred().

◆ ipred_init()

static void ipred_init ( IntraPredContext * i)
static

Definition at line 488 of file rv60dec.c.

Referenced by populate_ipred().

◆ populate_ipred()

static void populate_ipred ( const RV60Context * s,
CUContext * cu,
const uint8_t * src,
int stride,
int xoff,
int yoff,
int size,
int is_luma )
static

Definition at line 495 of file rv60dec.c.

Referenced by decode_cu_r().

◆ pred_plane()

static void pred_plane ( const IntraPredContext * p,
uint8_t * dst,
int stride,
int size )
static

Definition at line 539 of file rv60dec.c.

Referenced by pred_angle().

◆ pred_dc()

static void pred_dc ( const IntraPredContext * p,
uint8_t * dst,
int stride,
int size,
int filter )
static

Definition at line 570 of file rv60dec.c.

Referenced by pred_angle().

◆ filter_weak()

static void filter_weak ( uint8_t * dst,
const uint8_t * src,
int size )
static

Definition at line 602 of file rv60dec.c.

Referenced by pred_angle().

◆ filter_bilin32()

static void filter_bilin32 ( uint8_t * dst,
int v0,
int v1,
int size )
static

Definition at line 610 of file rv60dec.c.

Referenced by pred_angle().

◆ pred_hor_angle()

static void pred_hor_angle ( uint8_t * dst,
int stride,
int size,
int weight,
const uint8_t * src )
static

Definition at line 620 of file rv60dec.c.

Referenced by pred_angle().

◆ pred_ver_angle()

static void pred_ver_angle ( uint8_t * dst,
int stride,
int size,
int weight,
const uint8_t * src )
static

Definition at line 641 of file rv60dec.c.

Referenced by pred_angle().

◆ pred_angle()

static int pred_angle ( const IntraPredContext * p,
uint8_t * dst,
int stride,
int size,
int imode,
int filter )
static

Definition at line 661 of file rv60dec.c.

Referenced by decode_cu_r().

◆ pu_is_intra()

static int pu_is_intra ( const PUInfo * pu)
static

Definition at line 761 of file rv60dec.c.

Referenced by reconstruct_intra().

◆ ipm_compar()

static int ipm_compar ( const void * a,
const void * b )
static

Definition at line 766 of file rv60dec.c.

Referenced by reconstruct_intra().

◆ reconstruct_intra()

static int reconstruct_intra ( const RV60Context * s,
const CUContext * cu,
int size,
int sub )
static

Definition at line 799 of file rv60dec.c.

Referenced by reconstruct(), and reconstruct_intra().

◆ get_skip_mv_index()

static int get_skip_mv_index ( enum MVRefEnum mvref)
static

Definition at line 862 of file rv60dec.c.

Referenced by reconstruct().

◆ add_if_valid()

static void add_if_valid ( unique_list_mvinfo * skip_cand,
const MVInfo * mvi )
static

Definition at line 872 of file rv60dec.c.

Referenced by fill_mv_skip_cand().

◆ fill_mv_skip_cand()

static void fill_mv_skip_cand ( RV60Context * s,
const CUContext * cu,
unique_list_mvinfo * skip_cand,
int size )
static

Definition at line 878 of file rv60dec.c.

Referenced by reconstruct().

◆ get_mv_dimensions()

static void get_mv_dimensions ( Dimensions * dim,
enum PUType pu_type,
int part_no,
int size )
static

Definition at line 905 of file rv60dec.c.

Referenced by decode_cu_r(), and reconstruct().

◆ has_hor_split()

static int has_hor_split ( enum PUType pu_type)
static

Definition at line 942 of file rv60dec.c.

Referenced by get_next_mv().

◆ has_ver_split()

static int has_ver_split ( enum PUType pu_type)
static

Definition at line 947 of file rv60dec.c.

Referenced by get_next_mv().

◆ pu_type_num_parts()

static int pu_type_num_parts ( enum PUType pu_type)
static

Definition at line 952 of file rv60dec.c.

Referenced by decode_cu_r(), and reconstruct().

◆ get_next_mv()

static void get_next_mv ( const RV60Context * s,
const Dimensions * dim,
enum PUType pu_type,
int part_no,
int * mv_pos,
int * mv_x,
int * mv_y )
static

Definition at line 961 of file rv60dec.c.

Referenced by decode_cu_r(), and reconstruct().

◆ mv_is_ref0()

static int mv_is_ref0 ( enum MVRefEnum mvref)
static

Definition at line 981 of file rv60dec.c.

Referenced by mvinfo_matches_forward().

◆ mv_is_forward()

static int mv_is_forward ( enum MVRefEnum mvref)
static

Definition at line 986 of file rv60dec.c.

Referenced by mvinfo_is_deblock_cand(), and predict_mv().

◆ mv_is_backward()

static int mv_is_backward ( enum MVRefEnum mvref)
static

Definition at line 991 of file rv60dec.c.

Referenced by mvinfo_is_deblock_cand(), mvinfo_matches_backward(), and predict_mv().

◆ mvinfo_matches_forward()

static int mvinfo_matches_forward ( const MVInfo * a,
const MVInfo * b )
static

Definition at line 996 of file rv60dec.c.

Referenced by predict_mv().

◆ mvinfo_matches_backward()

static int mvinfo_matches_backward ( const MVInfo * a,
const MVInfo * b )
static

Definition at line 1001 of file rv60dec.c.

Referenced by predict_mv().

◆ mvinfo_is_deblock_cand()

static int mvinfo_is_deblock_cand ( const MVInfo * a,
const MVInfo * b )
static

Definition at line 1006 of file rv60dec.c.

Referenced by derive_deblock_strength().

◆ mv_pred()

static void mv_pred ( MV * ret,
MV a,
MV b,
MV c )
static

Definition at line 1027 of file rv60dec.c.

Referenced by predict_mv().

◆ predict_mv()

static void predict_mv ( const RV60Context * s,
MVInfo * dst,
int mv_x,
int mv_y,
int mv_w,
const MVInfo * src )
static

Definition at line 1045 of file rv60dec.c.

Referenced by reconstruct().

◆ reconstruct()

static void reconstruct ( RV60Context * s,
const CUContext * cu,
int size )
static

Definition at line 1137 of file rv60dec.c.

Referenced by decode_cu_r().

◆ read_mv()

static void read_mv ( GetBitContext * gb,
MV * mv )
static

Definition at line 1195 of file rv60dec.c.

Referenced by read_mv_info().

◆ read_mv_info()

static void read_mv_info ( RV60Context * s,
GetBitContext * gb,
MVInfo * mvinfo,
int size,
enum PUType pu_type )
static

Definition at line 1201 of file rv60dec.c.

Referenced by decode_cu_r().

◆ luma_mc()

static void luma_mc ( uint8_t * dst,
int dst_stride,
const uint8_t * src,
int src_stride,
int w,
int h,
int cx,
int cy )
static

Definition at line 1267 of file rv60dec.c.

Referenced by mc().

◆ chroma_mc()

static void chroma_mc ( uint8_t * dst,
int dst_stride,
const uint8_t * src,
int src_stride,
int w,
int h,
int x,
int y )
static

Definition at line 1291 of file rv60dec.c.

◆ check_pos()

static int check_pos ( int x,
int y,
int cw,
int ch,
int w,
int h,
int dx,
int dy,
int e0,
int e1,
int e2,
int e3 )
static

Definition at line 1325 of file rv60dec.c.

Referenced by mc().

◆ mc()

static void mc ( RV60Context * s,
uint8_t * frame_data[3],
int frame_linesize[3],
const AVFrame * ref,
int x,
int y,
int w,
int h,
MV mv,
int avg )
static

Definition at line 1332 of file rv60dec.c.

◆ avg_plane()

static void avg_plane ( uint8_t * dst,
int dst_stride,
const uint8_t * src,
int src_stride,
int w,
int h )
static

Definition at line 1400 of file rv60dec.c.

Referenced by avg().

◆ avg()

static void avg ( AVFrame * frame,
uint8_t * prev_frame_data[3],
int prev_frame_linesize[3],
int x,
int y,
int w,
int h )
static

Definition at line 1407 of file rv60dec.c.

◆ get_c4x4_set()

static int get_c4x4_set ( int qp,
int is_intra )
static

Definition at line 1417 of file rv60dec.c.

Referenced by decode_cu_16x16(), decode_cu_4x4in16x16(), and decode_cu_8x8().

◆ quant()

static int quant ( int v,
int q )
static

Definition at line 1425 of file rv60dec.c.

◆ decode_coeff()

static int decode_coeff ( GetBitContext * gb,
const CoeffVLCs * vlcs,
int inval,
int val )
static

Definition at line 1430 of file rv60dec.c.

Referenced by decode_2x2(), and decode_2x2_dc().

◆ decode_2x2_dc()

static void decode_2x2_dc ( GetBitContext * gb,
const CoeffVLCs * vlcs,
int16_t * coeffs,
int stride,
int block2,
int dsc,
int q_dc,
int q_ac )
static

Definition at line 1447 of file rv60dec.c.

Referenced by decode_4x4_block_dc().

◆ decode_2x2()

static void decode_2x2 ( GetBitContext * gb,
const CoeffVLCs * vlcs,
int16_t * coeffs,
int stride,
int block2,
int dsc,
int q_ac )
static

Definition at line 1466 of file rv60dec.c.

Referenced by decode_4x4_block(), and decode_4x4_block_dc().

◆ decode_4x4_block_dc()

static void decode_4x4_block_dc ( GetBitContext * gb,
const CoeffVLCs * vlcs,
int is_luma,
int16_t * coeffs,
int stride,
int q_dc,
int q_ac )
static

Definition at line 1485 of file rv60dec.c.

Referenced by decode_cu_16x16(), decode_cu_4x4in16x16(), and decode_cu_8x8().

◆ decode_4x4_block()

static void decode_4x4_block ( GetBitContext * gb,
const CoeffVLCs * vlcs,
int is_luma,
int16_t * coeffs,
int stride,
int q_ac )
static

Definition at line 1507 of file rv60dec.c.

Referenced by decode_cu_16x16(), decode_cu_4x4in16x16(), and decode_cu_8x8().

◆ decode_cu_4x4in16x16()

static void decode_cu_4x4in16x16 ( GetBitContext * gb,
int is_intra,
int qp,
int sel_qp,
int16_t * y_coeffs,
int16_t * u_coeffs,
int16_t * v_coeffs,
int cbp )
static

Definition at line 1529 of file rv60dec.c.

Referenced by decode_cu_r().

◆ decode_cbp8()

static int decode_cbp8 ( GetBitContext * gb,
int subset,
int qp )
static

Definition at line 1553 of file rv60dec.c.

Referenced by decode_cu_r().

◆ decode_cu_8x8()

static void decode_cu_8x8 ( GetBitContext * gb,
int is_intra,
int qp,
int sel_qp,
int16_t * y_coeffs,
int16_t * u_coeffs,
int16_t * v_coeffs,
int ccbp,
int mode4x4 )
static

Definition at line 1559 of file rv60dec.c.

Referenced by decode_cu_r().

◆ decode_cu_16x16()

static void decode_cu_16x16 ( GetBitContext * gb,
int is_intra,
int qp,
int sel_qp,
int16_t * y_coeffs,
int16_t * u_coeffs,
int16_t * v_coeffs,
int ccbp )
static

Definition at line 1593 of file rv60dec.c.

Referenced by decode_cu_r().

◆ decode_super_cbp()

static int decode_super_cbp ( GetBitContext * gb,
const VLCElem * vlc[4] )
static

Definition at line 1629 of file rv60dec.c.

Referenced by decode_cbp16().

◆ decode_cbp16()

static int decode_cbp16 ( GetBitContext * gb,
int subset,
int qp )
static

Definition at line 1654 of file rv60dec.c.

Referenced by decode_cu_r().

◆ decode_cu_r()

static int decode_cu_r ( RV60Context * s,
AVFrame * frame,
ThreadContext * thread,
GetBitContext * gb,
int xpos,
int ypos,
int log_size,
int qp,
int sel_qp )
static

Definition at line 1660 of file rv60dec.c.

Referenced by decode_cu_r(), and decode_slice().

◆ deblock_get_pos()

static int deblock_get_pos ( RV60Context * s,
int xpos,
int ypos )
static

Definition at line 1919 of file rv60dec.c.

Referenced by deblock_cu_r(), deblock_set_strength(), and derive_deblock_strength().

◆ deblock_set_strength()

static void deblock_set_strength ( RV60Context * s,
int xpos,
int ypos,
int size,
int q,
int strength )
static

Definition at line 1924 of file rv60dec.c.

Referenced by deblock_cu_r().

◆ deblock_get_top_strength()

static int deblock_get_top_strength ( const RV60Context * s,
int pos )
static

Definition at line 1941 of file rv60dec.c.

Referenced by derive_deblock_strength().

◆ deblock_get_left_strength()

static int deblock_get_left_strength ( const RV60Context * s,
int pos )
static

Definition at line 1946 of file rv60dec.c.

Referenced by derive_deblock_strength().

◆ deblock_set_top_strength()

static void deblock_set_top_strength ( RV60Context * s,
int pos,
int strength )
static

Definition at line 1951 of file rv60dec.c.

Referenced by derive_deblock_strength().

◆ deblock_set_left_strength()

static void deblock_set_left_strength ( RV60Context * s,
int pos,
int strength )
static

Definition at line 1956 of file rv60dec.c.

Referenced by derive_deblock_strength().

◆ derive_deblock_strength()

static void derive_deblock_strength ( RV60Context * s,
int xpos,
int ypos,
int size )
static

Definition at line 1961 of file rv60dec.c.

Referenced by deblock_cu_r().

◆ filter_luma_edge()

static void filter_luma_edge ( uint8_t * dst,
int step,
int stride,
int mode1,
int mode2,
int lim1,
int lim2 )
static

Definition at line 1978 of file rv60dec.c.

Referenced by deblock_edge_hor(), and deblock_edge_ver().

◆ filter_chroma_edge()

static void filter_chroma_edge ( uint8_t * dst,
int step,
int stride,
int mode1,
int mode2,
int lim1,
int lim2 )
static

Definition at line 2034 of file rv60dec.c.

Referenced by deblock_edge_hor(), and deblock_edge_ver().

◆ deblock_edge_ver()

static void deblock_edge_ver ( AVFrame * frame,
int xpos,
int ypos,
int dblk_l,
int dblk_r,
int deblock_chroma )
static

Definition at line 2072 of file rv60dec.c.

Referenced by deblock8x8().

◆ deblock_edge_hor()

static void deblock_edge_hor ( AVFrame * frame,
int xpos,
int ypos,
int dblk_t,
int dblk_d,
int deblock_chroma )
static

Definition at line 2091 of file rv60dec.c.

Referenced by deblock8x8().

◆ deblock8x8()

static void deblock8x8 ( const RV60Context * s,
AVFrame * frame,
int xpos,
int ypos,
int dblkpos )
static

Definition at line 2110 of file rv60dec.c.

Referenced by deblock().

◆ deblock()

static void deblock ( const RV60Context * s,
AVFrame * frame,
int xpos,
int ypos,
int size,
int dpos )
static

Definition at line 2154 of file rv60dec.c.

Referenced by AVFILTER_DEFINE_CLASS(), ctu_nz_tl_init(), deblock_cu_r(), generate(), and X264_init().

◆ deblock_cu_r()

static void deblock_cu_r ( RV60Context * s,
AVFrame * frame,
ThreadContext * thread,
int xpos,
int ypos,
int log_size,
int qp )
static

Definition at line 2163 of file rv60dec.c.

Referenced by deblock_cu_r(), and decode_slice().

◆ read_qp_offset()

static int read_qp_offset ( GetBitContext * gb,
int qp_off_type )
static

Definition at line 2210 of file rv60dec.c.

Referenced by decode_slice().

◆ calc_sel_qp()

static int calc_sel_qp ( int osvquant,
int qp )
static

Definition at line 2231 of file rv60dec.c.

Referenced by decode_slice().

◆ decode_slice()

static int decode_slice ( AVCodecContext * avctx,
void * tdata,
int cu_y,
int threadnr )
static

Definition at line 2246 of file rv60dec.c.

◆ rv60_decode_frame()

static int rv60_decode_frame ( AVCodecContext * avctx,
AVFrame * frame,
int * got_frame,
AVPacket * avpkt )
static

Definition at line 2296 of file rv60dec.c.

◆ rv60_flush()

static av_cold void rv60_flush ( AVCodecContext * avctx)
static

Definition at line 2402 of file rv60dec.c.

◆ rv60_decode_end()

static av_cold int rv60_decode_end ( AVCodecContext * avctx)
static

Definition at line 2410 of file rv60dec.c.

Variable Documentation

◆ frame_types

Definition at line 38 of file rv60dec.c.

Referenced by read_frame_header(), and xvid_ff_2pass_after().

◆ skip_mv_ref

const uint8_t skip_mv_ref[4] = {MVREF_SKIP0, MVREF_SKIP1, MVREF_SKIP2, MVREF_SKIP3}
static

Definition at line 77 of file rv60dec.c.

Referenced by decode_cu_r().

◆ cbp8_vlc

const VLCElem* cbp8_vlc[7][4]
static

Definition at line 86 of file rv60dec.c.

Referenced by decode_cbp8(), and rv60_init_static_data().

◆ cbp16_vlc

const VLCElem* cbp16_vlc[7][4][4]
static

Definition at line 87 of file rv60dec.c.

Referenced by decode_cbp16(), and rv60_init_static_data().

◆ intra_coeff_vlc

CoeffVLCs intra_coeff_vlc[5]
static

◆ inter_coeff_vlc

CoeffVLCs inter_coeff_vlc[7]
static

◆ table_data

VLCElem table_data[129148]
static

Definition at line 100 of file rv60dec.c.

◆ ff_rv60_decoder

const FFCodec ff_rv60_decoder
Initial value:
= {
.p.name = "rv60",
CODEC_LONG_NAME("RealVideo 6.0"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(RV60Context),
.flush = rv60_flush,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#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...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#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:79
#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
@ AV_CODEC_ID_RV60
Definition codec_id.h:321
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int rv60_decode_end(AVCodecContext *avctx)
Definition rv60dec.c:2410
static av_cold void rv60_flush(AVCodecContext *avctx)
Definition rv60dec.c:2402
static av_cold int rv60_decode_init(AVCodecContext *avctx)
Definition rv60dec.c:255
static int rv60_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition rv60dec.c:2296

Definition at line 2430 of file rv60dec.c.