svq3.c File Reference

svq3 decoder. More...

#include "internal.h"
#include "avcodec.h"
#include "mpegvideo.h"
#include "h264.h"
#include "h264data.h"
#include "h264_mvpred.h"
#include "golomb.h"
#include "hpeldsp.h"
#include "rectangle.h"
#include "vdpau_internal.h"
#include "svq1.h"
#include "svq3.h"
Include dependency graph for svq3.c:

Go to the source code of this file.

Data Structures

struct  SVQ3Context
 

Macros

#define FULLPEL_MODE   1
 
#define HALFPEL_MODE   2
 
#define THIRDPEL_MODE   3
 
#define PREDICT_MODE   4
 
#define stride   16
 

Functions

void ff_svq3_luma_dc_dequant_idct_c (int16_t *output, int16_t *input, int qp)
 
void ff_svq3_add_idct_c (uint8_t *dst, int16_t *block, int stride, int qp, int dc)
 
static int svq3_decode_block (GetBitContext *gb, int16_t *block, int index, const int type)
 
static void svq3_mc_dir_part (SVQ3Context *s, int x, int y, int width, int height, int mx, int my, int dxy, int thirdpel, int dir, int avg)
 
static int svq3_mc_dir (SVQ3Context *s, int size, int mode, int dir, int avg)
 
static int svq3_decode_mb (SVQ3Context *s, unsigned int mb_type)
 
static int svq3_decode_slice_header (AVCodecContext *avctx)
 
static av_cold int svq3_decode_init (AVCodecContext *avctx)
 
static void free_picture (AVCodecContext *avctx, Picture *pic)
 
static int get_buffer (AVCodecContext *avctx, Picture *pic)
 
static int svq3_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static int svq3_decode_end (AVCodecContext *avctx)
 

Variables

static const uint8_t svq3_scan [16]
 
static const uint8_t svq3_pred_0 [25][2]
 
static const int8_t svq3_pred_1 [6][6][5]
 
struct {
   uint8_t   run
 
   uint8_t   level
 
svq3_dct_tables [2][16]
 
static const uint32_t svq3_dequant_coeff [32]
 
AVCodec ff_svq3_decoder
 

Detailed Description

svq3 decoder.

Definition in file svq3.c.

Macro Definition Documentation

#define FULLPEL_MODE   1

Definition at line 87 of file svq3.c.

Referenced by svq3_decode_mb().

#define HALFPEL_MODE   2

Definition at line 88 of file svq3.c.

Referenced by svq3_decode_mb(), and svq3_mc_dir().

#define PREDICT_MODE   4

Definition at line 90 of file svq3.c.

Referenced by svq3_decode_mb(), and svq3_mc_dir().

#define stride   16
#define THIRDPEL_MODE   3

Definition at line 89 of file svq3.c.

Referenced by svq3_decode_mb(), and svq3_mc_dir().

Function Documentation

void ff_svq3_add_idct_c ( uint8_t dst,
int16_t *  block,
int  stride,
int  qp,
int  dc 
)

Definition at line 187 of file svq3.c.

Referenced by hl_decode_mb(), hl_decode_mb_idct_luma(), and hl_decode_mb_predict_luma().

void ff_svq3_luma_dc_dequant_idct_c ( int16_t *  output,
int16_t *  input,
int  qp 
)

Definition at line 152 of file svq3.c.

Referenced by hl_decode_mb_predict_luma().

static void free_picture ( AVCodecContext avctx,
Picture pic 
)
static

Definition at line 1027 of file svq3.c.

Referenced by get_buffer(), and svq3_decode_end().

static int get_buffer ( AVCodecContext avctx,
Picture pic 
)
static

Definition at line 1039 of file svq3.c.

Referenced by svq3_decode_frame().

static int svq3_decode_block ( GetBitContext gb,
int16_t *  block,
int  index,
const int  type 
)
inlinestatic

Definition at line 227 of file svq3.c.

Referenced by svq3_decode_mb().

static int svq3_decode_end ( AVCodecContext avctx)
static

Definition at line 1313 of file svq3.c.

static int svq3_decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 1091 of file svq3.c.

static av_cold int svq3_decode_init ( AVCodecContext avctx)
static

Definition at line 851 of file svq3.c.

static int svq3_decode_mb ( SVQ3Context s,
unsigned int  mb_type 
)
static

Definition at line 471 of file svq3.c.

Referenced by svq3_decode_frame().

static int svq3_decode_slice_header ( AVCodecContext avctx)
static

Definition at line 760 of file svq3.c.

Referenced by svq3_decode_frame().

static int svq3_mc_dir ( SVQ3Context s,
int  size,
int  mode,
int  dir,
int  avg 
)
inlinestatic

Definition at line 357 of file svq3.c.

Referenced by svq3_decode_mb().

static void svq3_mc_dir_part ( SVQ3Context s,
int  x,
int  y,
int  width,
int  height,
int  mx,
int  my,
int  dxy,
int  thirdpel,
int  dir,
int  avg 
)
inlinestatic

Definition at line 285 of file svq3.c.

Referenced by svq3_decode_mb(), and svq3_mc_dir().

Variable Documentation

AVCodec ff_svq3_decoder
Initial value:
= {
.name = "svq3",
.priv_data_size = sizeof(SVQ3Context),
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND |
.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
Definition: pixfmt.h:80
static int svq3_decode_end(AVCodecContext *avctx)
Definition: svq3.c:1313
static av_cold int svq3_decode_init(AVCodecContext *avctx)
Definition: svq3.c:851
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868
AVPixelFormat
Pixel format.
Definition: pixfmt.h:66
static int svq3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: svq3.c:1091

Definition at line 1336 of file svq3.c.

uint8_t level

Definition at line 137 of file svq3.c.

Referenced by svq3_decode_block().

uint8_t run

Definition at line 136 of file svq3.c.

Referenced by bink_decode_plane(), binkb_decode_plane(), bit8x8_c(), dct_quantize_refine(), dct_quantize_trellis_c(), dct_single_coeff_elimination(), decode_ac_coeffs(), decode_block_intra(), decode_block_progressive(), decode_block_refinement(), decode_coeffs(), decode_frame(), decode_group3_1d_line(), decode_group3_2d_line(), decode_residual_block(), decode_rle(), dnxhd_init_vlc(), dv_decode_ac(), dv_rl2vlc(), dv_rl2vlc_size(), encode_ac_coeffs(), encode_acs(), encode_block(), encode_subband_c0run(), estimate_acs(), ff_dvvideo_init(), ff_init_rl(), ff_init_vlc_rl(), ff_msmpeg4_decode_block(), ff_msmpeg4_encode_block(), ff_msmpeg4_encode_init(), find_best_tables(), fix_coding_method_array(), get_rl_index(), get_size_of_code(), h261_decode_block(), h261_encode_block(), h263_decode_block(), h263_encode_block(), init_2d_vlc_rl(), init_quantized_coeffs_elem0(), init_uni_ac_vlc(), init_uni_h263_rl_tab(), init_uni_mpeg4_rl_tab(), ivi_decode_blocks(), ls_encode_line(), mdec_decode_block_intra(), mpeg1_decode_block_inter(), mpeg1_decode_block_intra(), mpeg1_encode_block(), mpeg1_fast_decode_block_inter(), mpeg2_decode_block_intra(), mpeg2_decode_block_non_intra(), mpeg2_fast_decode_block_intra(), mpeg2_fast_decode_block_non_intra(), mpeg4_decode_block(), mpeg4_encode_block(), mpeg4_get_block_length(), pcx_rle_decode(), picmemset_8bpp(), process_subpacket_9(), put_bits_left(), put_line(), qpeg_decode_intra(), rd8x8_c(), read_block_types(), sunrast_decode_frame(), sunrast_image_write_image(), svq3_decode_block(), synthfilt_build_sb_samples(), unpack(), unpack_coeffs(), vc1_decode_ac_coeff(), vp6_parse_coeff(), vp6_parse_coeff_huffman(), and x8_decode_intra_mb().

const { ... } svq3_dct_tables[2][16]
Initial value:
= {
{ { 0, 0 }, { 0, 1 }, { 1, 1 }, { 2, 1 }, { 0, 2 }, { 3, 1 }, { 4, 1 }, { 5, 1 },
{ 0, 3 }, { 1, 2 }, { 2, 2 }, { 6, 1 }, { 7, 1 }, { 8, 1 }, { 9, 1 }, { 0, 4 } },
{ { 0, 0 }, { 0, 1 }, { 1, 1 }, { 0, 2 }, { 2, 1 }, { 0, 3 }, { 0, 4 }, { 0, 5 },
{ 3, 1 }, { 4, 1 }, { 1, 2 }, { 1, 3 }, { 0, 6 }, { 0, 7 }, { 0, 8 }, { 0, 9 } }
}

Referenced by svq3_decode_block().

const uint32_t svq3_dequant_coeff[32]
static
Initial value:
= {
3881, 4351, 4890, 5481, 6154, 6914, 7761, 8718,
9781, 10987, 12339, 13828, 15523, 17435, 19561, 21873,
24552, 27656, 30847, 34870, 38807, 43747, 49103, 54683,
61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533
}

Definition at line 145 of file svq3.c.

Referenced by ff_svq3_add_idct_c(), and ff_svq3_luma_dc_dequant_idct_c().

const uint8_t svq3_pred_0[25][2]
static
Initial value:
= {
{ 0, 0 },
{ 1, 0 }, { 0, 1 },
{ 0, 2 }, { 1, 1 }, { 2, 0 },
{ 3, 0 }, { 2, 1 }, { 1, 2 }, { 0, 3 },
{ 0, 4 }, { 1, 3 }, { 2, 2 }, { 3, 1 }, { 4, 0 },
{ 4, 1 }, { 3, 2 }, { 2, 3 }, { 1, 4 },
{ 2, 4 }, { 3, 3 }, { 4, 2 },
{ 4, 3 }, { 3, 4 },
{ 4, 4 }
}

Definition at line 108 of file svq3.c.

Referenced by svq3_decode_mb().

const int8_t svq3_pred_1[6][6][5]
static
Initial value:
= {
{ { 2, -1, -1, -1, -1 }, { 2, 1, -1, -1, -1 }, { 1, 2, -1, -1, -1 },
{ 2, 1, -1, -1, -1 }, { 1, 2, -1, -1, -1 }, { 1, 2, -1, -1, -1 } },
{ { 0, 2, -1, -1, -1 }, { 0, 2, 1, 4, 3 }, { 0, 1, 2, 4, 3 },
{ 0, 2, 1, 4, 3 }, { 2, 0, 1, 3, 4 }, { 0, 4, 2, 1, 3 } },
{ { 2, 0, -1, -1, -1 }, { 2, 1, 0, 4, 3 }, { 1, 2, 4, 0, 3 },
{ 2, 1, 0, 4, 3 }, { 2, 1, 4, 3, 0 }, { 1, 2, 4, 0, 3 } },
{ { 2, 0, -1, -1, -1 }, { 2, 0, 1, 4, 3 }, { 1, 2, 0, 4, 3 },
{ 2, 1, 0, 4, 3 }, { 2, 1, 3, 4, 0 }, { 2, 4, 1, 0, 3 } },
{ { 0, 2, -1, -1, -1 }, { 0, 2, 1, 3, 4 }, { 1, 2, 3, 0, 4 },
{ 2, 0, 1, 3, 4 }, { 2, 1, 3, 0, 4 }, { 2, 0, 4, 3, 1 } },
{ { 0, 2, -1, -1, -1 }, { 0, 2, 4, 1, 3 }, { 1, 4, 2, 0, 3 },
{ 4, 2, 0, 1, 3 }, { 2, 0, 1, 4, 3 }, { 4, 2, 1, 0, 3 } },
}

Definition at line 120 of file svq3.c.

Referenced by svq3_decode_mb().

const uint8_t svq3_scan[16]
static
Initial value:
= {
0 + 0 * 4, 1 + 0 * 4, 2 + 0 * 4, 2 + 1 * 4,
2 + 2 * 4, 3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4,
0 + 1 * 4, 0 + 2 * 4, 1 + 1 * 4, 1 + 2 * 4,
0 + 3 * 4, 1 + 3 * 4, 2 + 3 * 4, 3 + 3 * 4,
}

Definition at line 101 of file svq3.c.

Referenced by svq3_decode_block().