Add prefix to some variables for consistency

Originally committed as revision 8916 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Kostya Shishkov 18 years ago
parent 986a865fc0
commit 660e83f815
  1. 30
      libavcodec/vc1.c
  2. 14
      libavcodec/vc1data.c
  3. 12
      libavcodec/vc1data.h

@ -1012,8 +1012,8 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
nr = get_bits(gb, 8);
dr = get_bits(gb, 4);
if(nr && nr < 8 && dr && dr < 3){
v->s.avctx->time_base.num = fps_dr[dr - 1];
v->s.avctx->time_base.den = fps_nr[nr - 1] * 1000;
v->s.avctx->time_base.num = vc1_fps_dr[dr - 1];
v->s.avctx->time_base.den = vc1_fps_nr[nr - 1] * 1000;
}
}
}
@ -1124,9 +1124,9 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
/* Quantizer stuff */
pqindex = get_bits(gb, 5);
if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
v->pq = pquant_table[0][pqindex];
v->pq = vc1_pquant_table[0][pqindex];
else
v->pq = pquant_table[1][pqindex];
v->pq = vc1_pquant_table[1][pqindex];
v->pquantizer = 1;
if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
@ -1166,11 +1166,11 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
else v->tt_index = 2;
lowquant = (v->pq > 12) ? 0 : 1;
v->mv_mode = mv_pmode_table[lowquant][get_prefix(gb, 1, 4)];
v->mv_mode = vc1_mv_pmode_table[lowquant][get_prefix(gb, 1, 4)];
if (v->mv_mode == MV_PMODE_INTENSITY_COMP)
{
int scale, shift, i;
v->mv_mode2 = mv_pmode_table2[lowquant][get_prefix(gb, 1, 3)];
v->mv_mode2 = vc1_mv_pmode_table2[lowquant][get_prefix(gb, 1, 3)];
v->lumscale = get_bits(gb, 6);
v->lumshift = get_bits(gb, 6);
v->use_ic = 1;
@ -1236,7 +1236,7 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
v->ttmbf = get_bits(gb, 1);
if (v->ttmbf)
{
v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
v->ttfrm = vc1_ttfrm_to_tt[get_bits(gb, 2)];
}
} else {
v->ttmbf = 1;
@ -1277,7 +1277,7 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
v->ttmbf = get_bits(gb, 1);
if (v->ttmbf)
{
v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
v->ttfrm = vc1_ttfrm_to_tt[get_bits(gb, 2)];
}
} else {
v->ttmbf = 1;
@ -1358,9 +1358,9 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
pqindex = get_bits(gb, 5);
v->pqindex = pqindex;
if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
v->pq = pquant_table[0][pqindex];
v->pq = vc1_pquant_table[0][pqindex];
else
v->pq = pquant_table[1][pqindex];
v->pq = vc1_pquant_table[1][pqindex];
v->pquantizer = 1;
if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
@ -1408,11 +1408,11 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
else v->tt_index = 2;
lowquant = (v->pq > 12) ? 0 : 1;
v->mv_mode = mv_pmode_table[lowquant][get_prefix(gb, 1, 4)];
v->mv_mode = vc1_mv_pmode_table[lowquant][get_prefix(gb, 1, 4)];
if (v->mv_mode == MV_PMODE_INTENSITY_COMP)
{
int scale, shift, i;
v->mv_mode2 = mv_pmode_table2[lowquant][get_prefix(gb, 1, 3)];
v->mv_mode2 = vc1_mv_pmode_table2[lowquant][get_prefix(gb, 1, 3)];
v->lumscale = get_bits(gb, 6);
v->lumshift = get_bits(gb, 6);
/* fill lookup tables for intensity compensation */
@ -1477,7 +1477,7 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v->ttmbf = get_bits(gb, 1);
if (v->ttmbf)
{
v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
v->ttfrm = vc1_ttfrm_to_tt[get_bits(gb, 2)];
}
} else {
v->ttmbf = 1;
@ -1527,7 +1527,7 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v->ttmbf = get_bits(gb, 1);
if (v->ttmbf)
{
v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
v->ttfrm = vc1_ttfrm_to_tt[get_bits(gb, 2)];
}
} else {
v->ttmbf = 1;
@ -2951,7 +2951,7 @@ static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n, int mquan
int ttblk = ttmb & 7;
if(ttmb == -1) {
ttblk = ttblk_to_tt[v->tt_index][get_vlc2(gb, vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1)];
ttblk = vc1_ttblk_to_tt[v->tt_index][get_vlc2(gb, vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1)];
}
if(ttblk == TT_4X4) {
subblkpat = ~(get_vlc2(gb, vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1) + 1);

@ -30,27 +30,27 @@
#include "vc1data.h"
/** Table for conversion between TTBLK and TTMB */
const int ttblk_to_tt[3][8] = {
const int vc1_ttblk_to_tt[3][8] = {
{ TT_8X4, TT_4X8, TT_8X8, TT_4X4, TT_8X4_TOP, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT },
{ TT_8X8, TT_4X8_RIGHT, TT_4X8_LEFT, TT_4X4, TT_8X4, TT_4X8, TT_8X4_BOTTOM, TT_8X4_TOP },
{ TT_8X8, TT_4X8, TT_4X4, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT, TT_8X4, TT_8X4_TOP }
};
const int ttfrm_to_tt[4] = { TT_8X8, TT_8X4, TT_4X8, TT_4X4 };
const int vc1_ttfrm_to_tt[4] = { TT_8X8, TT_8X4, TT_4X8, TT_4X4 };
/** MV P mode - the 5th element is only used for mode 1 */
const uint8_t mv_pmode_table[2][5] = {
const uint8_t vc1_mv_pmode_table[2][5] = {
{ MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_MIXED_MV },
{ MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_1MV_HPEL_BILIN }
};
const uint8_t mv_pmode_table2[2][4] = {
const uint8_t vc1_mv_pmode_table2[2][4] = {
{ MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_MIXED_MV },
{ MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_1MV_HPEL_BILIN }
};
const int fps_nr[5] = { 24, 25, 30, 50, 60 },
fps_dr[2] = { 1000, 1001 };
const uint8_t pquant_table[3][32] = {
const int vc1_fps_nr[5] = { 24, 25, 30, 50, 60 },
vc1_fps_dr[2] = { 1000, 1001 };
const uint8_t vc1_pquant_table[3][32] = {
{ /* Implicit quantizer */
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

@ -29,16 +29,16 @@
#define VC1DATA_H
/** Table for conversion between TTBLK and TTMB */
extern const int ttblk_to_tt[3][8];
extern const int vc1_ttblk_to_tt[3][8];
extern const int ttfrm_to_tt[4];
extern const int vc1_ttfrm_to_tt[4];
/** MV P mode - the 5th element is only used for mode 1 */
extern const uint8_t mv_pmode_table[2][5];
extern const uint8_t mv_pmode_table2[2][4];
extern const uint8_t vc1_mv_pmode_table[2][5];
extern const uint8_t vc1_mv_pmode_table2[2][4];
extern const int fps_nr[5], fps_dr[2];
extern const uint8_t pquant_table[3][32];
extern const int vc1_fps_nr[5], vc1_fps_dr[2];
extern const uint8_t vc1_pquant_table[3][32];
/** @name VC-1 VLC tables and defines
* @todo TODO move this into the context

Loading…
Cancel
Save