#include "common.h"#include "dsputil.h"#include "avcodec.h"#include "mpegvideo.h"#include "vc9data.h"#include <assert.h>

Go to the source code of this file.
TODO: most AP stuff, optimize, most of MB layer, transform, filtering and motion compensation, etc TODO: use MPV_ !!
Definition in file vc9.c.
| #define BI_TYPE 7 |
One more frame type
Definition at line 133 of file vc9.c.
Referenced by decode_b_picture_primary_header(), standard_decode_mbs(), standard_decode_picture_primary_header(), standard_decode_picture_secondary_header(), vc9_decode_frame(), and vc9_pred_dc().
| #define BMV_TYPE_BACKWARD 0 |
| #define BMV_TYPE_INTERPOLATED 3 |
| #define DQDOUBLE_BEDGE_TOPLEFT 0 |
| #define DQPROFILE_ALL_MBS 3 |
| #define DQPROFILE_DOUBLE_EDGES 1 |
| #define DQPROFILE_SINGLE_EDGE 2 |
| #define INIT_VLC | ( | vlc, | |||
| nb_bits, | |||||
| nb_codes, | |||||
| bits, | |||||
| bits_wrap, | |||||
| bits_size, | |||||
| codes, | |||||
| codes_wrap, | |||||
| codes_size, | |||||
| use_static | ) |
Value:
if (init_vlc(vlc, nb_bits, nb_codes, bits, bits_wrap, bits_size, \ codes, codes_wrap, codes_size, use_static) < 0) \ { \ av_log(v->s.avctx, AV_LOG_ERROR, "Error for " # vlc " (%i)\n", i); \ return -1; \ }
Definition at line 53 of file vc9.c.
Referenced by vc9_init_common().
| #define MV_PMODE_1MV 1 |
| #define MV_PMODE_INTENSITY_COMP 4 |
Definition at line 115 of file vc9.c.
Referenced by decode_p_picture_primary_header(), and decode_p_picture_secondary_header().
| #define MV_PMODE_MIXED_MV 3 |
Definition at line 114 of file vc9.c.
Referenced by decode_b_picture_secondary_header(), decode_p_picture_secondary_header(), and vc9_decode_p_mb().
| #define PROFILE_ADVANCED 3 |
Definition at line 72 of file vc9.c.
Referenced by decode_b_picture_primary_header(), decode_i_picture_primary_header(), decode_i_picture_secondary_header(), decode_p_picture_primary_header(), decode_sequence_header(), vc9_decode_frame(), and vc9_decode_init().
| #define PROFILE_SIMPLE 0 |
Available Profiles
Definition at line 69 of file vc9.c.
Referenced by decode_b_picture_primary_header(), and decode_sequence_header().
| #define QUANT_FRAME_EXPLICIT 1 |
Explicitly specified at frame level.
Definition at line 78 of file vc9.c.
Referenced by decode_b_picture_primary_header(), decode_i_picture_primary_header(), and decode_p_picture_primary_header().
| #define QUANT_FRAME_IMPLICIT 0 |
Implicitly specified at frame level.
Sequence quantizer mode
Definition at line 77 of file vc9.c.
Referenced by decode_b_picture_primary_header(), decode_i_picture_primary_header(), and decode_p_picture_primary_header().
| #define QUANT_NON_UNIFORM 2 |
| #define VC9_4MV_BLOCK_PATTERN_VLC_BITS 6 |
| #define VC9_BFRACTION_VLC_BITS 7 |
Definition at line 156 of file vc9.c.
Referenced by decode_b_picture_primary_header(), and vc9_init_common().
| #define VC9_CBPCY_P_VLC_BITS 9 |
| #define VC9_IMODE_VLC_BITS 4 |
| #define VC9_MV_DIFF_VLC_BITS 9 |
| #define VC9_NORM2_VLC_BITS 3 |
| #define VC9_NORM6_VLC_BITS 9 |
| #define VC9_SUBBLKPAT_VLC_BITS 6 |
| #define VC9_TTBLK_VLC_BITS 5 |
| #define VC9_TTMB_VLC_BITS 9 |
Definition at line 165 of file vc9.c.
Referenced by vc9_decode_b_mb(), vc9_decode_p_mb(), and vc9_init_common().
| static int decode_sequence_header | ( | AVCodecContext * | avctx, | |
| GetBitContext * | gb | |||
| ) | [static] |
Decode Simple/Main Profiles sequence header
| avctx | Codec context | |
| gb | GetBit context initialized from Codec context extra_data |
Definition at line 706 of file vc9.c.
References av_log(), AV_LOG_DEBUG, AV_LOG_ERROR, AV_LOG_INFO, VC9Context::bitrtq_postproc, VC9Context::dquant, VC9Context::extended_mv, VC9Context::fastuvmc, VC9Context::finterpflag, VC9Context::frmrtq_postproc, get_bits(), MpegEncContext::loop_filter, AVCodecContext::max_b_frames, MpegEncContext::max_b_frames, VC9Context::multires, VC9Context::overlap, AVCodecContext::priv_data, VC9Context::profile, PROFILE_ADVANCED, PROFILE_SIMPLE, VC9Context::quantizer_mode, VC9Context::rangered, VC9Context::res_fasttx, VC9Context::res_rtm_flag, VC9Context::res_sm, VC9Context::res_transtab, VC9Context::res_x8, MpegEncContext::resync_marker, VC9Context::s, show_bits(), and VC9Context::vstransform.
Referenced by vc9_decode_frame(), and vc9_decode_init().

| static int get_prefix | ( | GetBitContext * | gb, | |
| int | stop, | |||
| int | len | |||
| ) | [static] |
Get unary code of limited length FIXME Slow and ugly
| gb | GetBitContext | |
| [in] | stop | The bitstop value (unary code of 1's or 0's) |
| [in] | len | Maximum length |
Definition at line 341 of file vc9.c.
References buf, CLOSE_READER, get_bits(), GET_CACHE, LAST_SKIP_BITS, OPEN_READER, and UPDATE_CACHE.
Referenced by decode_b_picture_primary_header(), and decode_p_picture_primary_header().

| static int vc9_decode_end | ( | AVCodecContext * | avctx | ) | [static] |
Close a VC9/WMV3 decoder
Definition at line 2637 of file vc9.c.
References av_freep(), VC9Context::direct_mb_plane, free_bitplane(), MPV_common_end(), VC9Context::mv_type_mb_plane, AVCodecContext::priv_data, VC9Context::s, and VC9Context::skip_mb_plane.

| static int vc9_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Decode a VC9/WMV3 frame
Definition at line 2423 of file vc9.c.
References av_log(), AV_LOG_DEBUG, AV_LOG_ERROR, av_mallocz(), MpegEncContext::avctx, avpicture_fill(), avpicture_get_size(), B_TYPE, BI_TYPE, MpegEncContext::bitstream_buffer_size, AVCodecContext::codec_id, CODEC_ID_VC9, MpegEncContext::context_initialized, MpegEncContext::current_picture, MpegEncContext::current_picture_ptr, decode_sequence_header(), MpegEncContext::dropable, ff_er_frame_end(), ff_er_frame_start(), ff_find_unused_picture(), ff_print_debug_info(), AVCodecContext::flags, MpegEncContext::flags, AVCodecContext::flags2, MpegEncContext::flags2, AVCodecContext::frame_number, FRAME_SKIPPED, MpegEncContext::gb, get_bits_count(), AVCodecContext::height, AVCodecContext::hurry_up, I_TYPE, init_get_bits(), MpegEncContext::last_picture, MpegEncContext::last_picture_ptr, MpegEncContext::low_delay, MPV_common_init(), MPV_frame_end(), MPV_frame_start(), VC9Context::multires, MpegEncContext::next_p_frame_damaged, MpegEncContext::next_picture_ptr, NULL, P_TYPE, MpegEncContext::pict_type, MpegEncContext::picture, MpegEncContext::picture_number, AVCodecContext::pix_fmt, AVCodecContext::priv_data, VC9Context::profile, PROFILE_ADVANCED, VC9Context::s, standard_decode_mbs(), standard_decode_picture_primary_header(), standard_decode_picture_secondary_header(), and AVCodecContext::width.

| static int vc9_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Initialize a VC9/WMV3 decoder
Definition at line 2344 of file vc9.c.
References alloc_bitplane(), av_log(), AV_LOG_INFO, av_malloc(), MpegEncContext::avctx, AVCodecContext::codec_id, CODEC_ID_WMV3, AVCodecContext::coded_height, AVCodecContext::coded_width, decode_sequence_header(), VC9Context::direct_mb_plane, AVCodecContext::extradata, AVCodecContext::extradata_size, ff_h263_decode_init(), get_bits(), get_bits_count(), AVCodecContext::has_b_frames, AVCodecContext::height, init_get_bits(), AVCodecContext::max_b_frames, MpegEncContext::mb_height, MpegEncContext::mb_stride, MpegEncContext::mb_width, VC9Context::mv_type_mb_plane, AVCodecContext::pix_fmt, PIX_FMT_YUV420P, VC9Context::previous_line_cbpcy, AVCodecContext::priv_data, VC9Context::profile, PROFILE_ADVANCED, VC9Context::s, VC9Context::skip_mb_plane, vc9_init_common(), and AVCodecContext::width.

| static int vc9_init_common | ( | VC9Context * | v | ) | [static] |
Init VC-9 specific tables and VC9Context members
| v | The VC9Context to initialize |
Definition at line 380 of file vc9.c.
References av_log(), AV_LOG_DEBUG, VC9Context::direct_mb_plane, INIT_VLC, VC9Context::mv_type_mb_plane, VC9Context::mvrange, NULL, VC9Context::pq, VC9Context::skip_mb_plane, vc9_4mv_block_pattern_bits, vc9_4mv_block_pattern_codes, VC9_4MV_BLOCK_PATTERN_VLC_BITS, vc9_bfraction_bits, vc9_bfraction_codes, VC9_BFRACTION_VLC_BITS, vc9_cbpcy_p_bits, vc9_cbpcy_p_codes, VC9_CBPCY_P_VLC_BITS, vc9_imode_bits, vc9_imode_codes, VC9_IMODE_VLC_BITS, vc9_mv_diff_bits, vc9_mv_diff_codes, VC9_MV_DIFF_VLC_BITS, vc9_norm2_bits, vc9_norm2_codes, VC9_NORM2_VLC_BITS, vc9_norm6_bits, vc9_norm6_codes, vc9_norm6_spec, VC9_NORM6_VLC_BITS, vc9_subblkpat_bits, vc9_subblkpat_codes, VC9_SUBBLKPAT_VLC_BITS, vc9_ttblk_bits, vc9_ttblk_codes, VC9_TTBLK_VLC_BITS, vc9_ttmb_bits, vc9_ttmb_codes, and VC9_TTMB_VLC_BITS.
Referenced by vc9_decode_init().

| static int vop_dquant_decoding | ( | VC9Context * | v | ) | [static] |
VOP Dquant decoding
| v | VC9 Context |
Definition at line 1125 of file vc9.c.
References VC9Context::altpq, VC9Context::dqbilevel, VC9Context::dqprofile, DQPROFILE_ALL_MBS, DQPROFILE_DOUBLE_EDGES, DQPROFILE_SINGLE_EDGE, VC9Context::dqsbedge, VC9Context::dquant, VC9Context::dquantfrm, MpegEncContext::gb, get_bits(), VC9Context::pq, and VC9Context::s.
Referenced by decode_b_picture_secondary_header(), and decode_p_picture_secondary_header().

| const uint32_t ff_table0_dc_chroma[120][2] |
Definition at line 97 of file msmpeg4data.h.
Referenced by ff_msmpeg4_decode_init(), and msmpeg4_encode_dc().
| const uint32_t ff_table0_dc_lum[120][2] |
Definition at line 64 of file msmpeg4data.h.
Referenced by ff_msmpeg4_decode_init(), and msmpeg4_encode_dc().
| const uint32_t ff_table1_dc_chroma[120][2] |
Definition at line 165 of file msmpeg4data.h.
Referenced by ff_msmpeg4_decode_init(), and msmpeg4_encode_dc().
| const uint32_t ff_table1_dc_lum[120][2] |
Definition at line 132 of file msmpeg4data.h.
Referenced by ff_msmpeg4_decode_init(), and msmpeg4_encode_dc().
const uint8_t mv_pmode_table[2][5] [static] |
Initial value:
{
{ MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_MIXED_MV, MV_PMODE_INTENSITY_COMP },
{ MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_INTENSITY_COMP }
}
Definition at line 127 of file vc9.c.
Referenced by decode_p_picture_primary_header().
const uint8_t pquant_table[3][32] [static] |
Initial value:
{
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29, 31
},
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
},
{
0, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31
}
}
Definition at line 137 of file vc9.c.
Referenced by decode_b_picture_primary_header(), decode_i_picture_primary_header(), and decode_p_picture_primary_header().
const uint16_t table_mb_intra[64][2] [static] |
VLC vc9_4mv_block_pattern_vlc[4] [static] |
VLC vc9_bfraction_vlc [static] |
VLC vc9_cbpcy_p_vlc[4] [static] |
Initial value:
{
"vc9",
CODEC_TYPE_VIDEO,
CODEC_ID_VC9,
sizeof(VC9Context),
vc9_decode_init,
NULL,
vc9_decode_end,
vc9_decode_frame,
CODEC_CAP_DELAY,
NULL
}
Definition at line 2652 of file vc9.c.
Referenced by avcodec_register_all().
VLC vc9_imode_vlc [static] |
VLC vc9_mv_diff_vlc[4] [static] |
VLC vc9_norm2_vlc [static] |
VLC vc9_norm6_vlc [static] |
VLC vc9_subblkpat_vlc[3] [static] |
VLC vc9_ttblk_vlc[3] [static] |
VLC vc9_ttmb_vlc[3] [static] |