FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
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"

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)   (FFABS(el) < (lim) ? 3 : 1)
 
#define CLIP_SYMM(a, b)   av_clip(a, -(b), 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, 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, 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 int mvinfo_valid (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 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][3][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 97 of file rv60dec.c.

◆ CUR_PIC

#define CUR_PIC   0

Definition at line 194 of file rv60dec.c.

◆ LAST_PIC

#define LAST_PIC   1

Definition at line 195 of file rv60dec.c.

◆ NEXT_PIC

#define NEXT_PIC   2

Definition at line 196 of file rv60dec.c.

◆ 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; \
}

Definition at line 764 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; \
if (b.x < c.x) \
ret->x = a.x < c.x ? a.x : c.x; \
else \
ret->x = b.x; \

◆ 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

Definition at line 1242 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 1250 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 1258 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;

Definition at line 1266 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) \
}

Definition at line 1273 of file rv60dec.c.

◆ STRENGTH

#define STRENGTH (   el,
  lim 
)    (FFABS(el) < (lim) ? 3 : 1)

Definition at line 1980 of file rv60dec.c.

◆ CLIP_SYMM

#define CLIP_SYMM (   a,
  b 
)    av_clip(a, -(b), b)

Definition at line 1981 of file rv60dec.c.

Enumeration Type Documentation

◆ CUType

enum CUType
Enumerator
CU_INTRA 
CU_INTER_MV 
CU_SKIP 
CU_INTER 

Definition at line 38 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 45 of file rv60dec.c.

◆ IntraMode

enum IntraMode
Enumerator
INTRAMODE_INDEX 
INTRAMODE_DC64 
INTRAMODE_PLANE64 
INTRAMODE_MODE 

Definition at line 56 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 63 of file rv60dec.c.

◆ anonymous enum

anonymous enum
Enumerator
TRANSFORM_NONE 
TRANSFORM_16X16 
TRANSFORM_8X8 
TRANSFORM_4X4 

Definition at line 77 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 101 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 122 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 134 of file rv60dec.c.

Referenced by rv60_decode_init().

◆ progress_init()

static int progress_init ( RV60Context s,
unsigned  count 
)
static

Definition at line 231 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 253 of file rv60dec.c.

◆ update_dimensions_clear_info()

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

Definition at line 275 of file rv60dec.c.

Referenced by rv60_decode_frame().

◆ read_code012()

static int read_code012 ( GetBitContext gb)
static

Definition at line 335 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 342 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 390 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 416 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 427 of file rv60dec.c.

Referenced by fill_mv_skip_cand(), 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 432 of file rv60dec.c.

Referenced by fill_mv_skip_cand(), 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 437 of file rv60dec.c.

Referenced by fill_mv_skip_cand(), and 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 447 of file rv60dec.c.

Referenced by fill_mv_skip_cand(), and populate_ipred().

◆ ipred_init()

static void ipred_init ( IntraPredContext i)
static

Definition at line 481 of file rv60dec.c.

Referenced by populate_ipred().

◆ populate_ipred()

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

Definition at line 488 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 532 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 563 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 595 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 603 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 613 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 634 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 654 of file rv60dec.c.

Referenced by decode_cu_r().

◆ pu_is_intra()

static int pu_is_intra ( const PUInfo pu)
static

Definition at line 754 of file rv60dec.c.

Referenced by reconstruct_intra().

◆ ipm_compar()

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

Definition at line 759 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 792 of file rv60dec.c.

Referenced by reconstruct().

◆ get_skip_mv_index()

static int get_skip_mv_index ( enum MVRefEnum  mvref)
static

Definition at line 855 of file rv60dec.c.

Referenced by reconstruct().

◆ mvinfo_valid()

static int mvinfo_valid ( const MVInfo mvi)
static

Definition at line 865 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 870 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 918 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 955 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 960 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 965 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 974 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 994 of file rv60dec.c.

Referenced by mvinfo_matches_forward().

◆ mv_is_forward()

static int mv_is_forward ( enum MVRefEnum  mvref)
static

Definition at line 999 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 1004 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 1009 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 1014 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 1019 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 1040 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 1058 of file rv60dec.c.

Referenced by reconstruct().

◆ reconstruct()

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

Definition at line 1150 of file rv60dec.c.

Referenced by decode_cu_r().

◆ read_mv()

static void read_mv ( GetBitContext gb,
MV mv 
)
static

Definition at line 1208 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 1214 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 1280 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 1304 of file rv60dec.c.

Referenced by mc().

◆ 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 1338 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 1345 of file rv60dec.c.

Referenced by decode_cu_r().

◆ 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 1413 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 1420 of file rv60dec.c.

Referenced by decode_cu_r(), and mc().

◆ get_c4x4_set()

static int get_c4x4_set ( int  qp,
int  is_intra 
)
static

Definition at line 1430 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 1438 of file rv60dec.c.

Referenced by decode_2x2(), and decode_2x2_dc().

◆ decode_coeff()

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

Definition at line 1443 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 1460 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 1479 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 1498 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 1520 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 1542 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 1566 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 1572 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 1606 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 1642 of file rv60dec.c.

Referenced by decode_cbp16().

◆ decode_cbp16()

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

Definition at line 1667 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 1676 of file rv60dec.c.

Referenced by decode_slice().

◆ deblock_get_pos()

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

Definition at line 1924 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 1929 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 1946 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 1951 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 1956 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 1961 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 1966 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 1983 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 2039 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 2077 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 2096 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 2115 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 2159 of file rv60dec.c.

Referenced by 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 2168 of file rv60dec.c.

Referenced by decode_slice().

◆ read_qp_offset()

static int read_qp_offset ( GetBitContext gb,
int  qp_off_type 
)
static

Definition at line 2215 of file rv60dec.c.

Referenced by decode_slice().

◆ calc_sel_qp()

static int calc_sel_qp ( int  osvquant,
int  qp 
)
static

Definition at line 2236 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 2251 of file rv60dec.c.

Referenced by rv60_decode_frame().

◆ 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 void rv60_flush ( AVCodecContext avctx)
static

Definition at line 2397 of file rv60dec.c.

◆ rv60_decode_end()

static av_cold int rv60_decode_end ( AVCodecContext avctx)
static

Definition at line 2405 of file rv60dec.c.

Variable Documentation

◆ frame_types

Definition at line 36 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 75 of file rv60dec.c.

Referenced by decode_cu_r().

◆ cbp8_vlc

const VLCElem* cbp8_vlc[7][4]
static

Definition at line 84 of file rv60dec.c.

Referenced by decode_cbp16(), decode_cbp8(), and rv60_init_static_data().

◆ cbp16_vlc

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

Definition at line 85 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 98 of file rv60dec.c.

Referenced by rv60_init_static_data().

◆ 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),
.close = rv60_decode_end,
.flush = rv60_flush,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 2425 of file rv60dec.c.

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
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:43
rv60_flush
static void rv60_flush(AVCodecContext *avctx)
Definition: rv60dec.c:2397
AV_CODEC_ID_RV60
@ AV_CODEC_ID_RV60
Definition: codec_id.h:330
step
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
Definition: rate_distortion.txt:58
w
uint8_t w
Definition: llviddspenc.c:38
b
#define b
Definition: input.c:41
filter
void(* filter)(uint8_t *src, int stride, int qscale)
Definition: h263dsp.c:29
FILTER2
#define FILTER2(src, src_stride, src_y_ofs, step)
Definition: rv60dec.c:1250
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
s
#define s(width, name)
Definition: cbs_vp9.c:198
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
if
if(ret)
Definition: filter_design.txt:179
list
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
Definition: filter_design.txt:25
RV60Context
Definition: rv60dec.c:190
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
rv60_decode_frame
static int rv60_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: rv60dec.c:2296
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
size
int size
Definition: twinvq_data.h:10344
rv60_decode_end
static av_cold int rv60_decode_end(AVCodecContext *avctx)
Definition: rv60dec.c:2405
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
AV_CODEC_CAP_SLICE_THREADS
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition: codec.h:114
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
FILTER1
#define FILTER1(src, src_stride, src_y_ofs, step)
Definition: rv60dec.c:1242
rv60_decode_init
static av_cold int rv60_decode_init(AVCodecContext *avctx)
Definition: rv60dec.c:253
FILTER3
#define FILTER3(src, src_stride, src_y_ofs, step)
Definition: rv60dec.c:1258
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
av_clip_uint8
#define av_clip_uint8
Definition: common.h:106
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
h
h
Definition: vp9dsp_template.c:2070
cond
int(* cond)(enum AVPixelFormat pix_fmt)
Definition: pixdesc_query.c:28
src
#define src
Definition: vp8dsp.c:248