Skip to content

Commit

Permalink
avcodec/vp3data: use more compact data types
Browse files Browse the repository at this point in the history
Reviewed-by: Paul B Mahol <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Aug 30, 2014
1 parent e16b733 commit 1402873
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions libavcodec/vp3data.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/* these coefficients dequantize intraframe Y plane coefficients
* (note: same as JPEG) */
static const int16_t vp31_intra_y_dequant[64] = {
static const int8_t vp31_intra_y_dequant[64] = {
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
Expand All @@ -39,7 +39,7 @@ static const int16_t vp31_intra_y_dequant[64] = {

/* these coefficients dequantize intraframe C plane coefficients
* (note: same as JPEG) */
static const int16_t vp31_intra_c_dequant[64] = {
static const int8_t vp31_intra_c_dequant[64] = {
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
Expand All @@ -51,7 +51,7 @@ static const int16_t vp31_intra_c_dequant[64] = {
};

/* these coefficients dequantize interframe coefficients (all planes) */
static const int16_t vp31_inter_dequant[64] = {
static const int8_t vp31_inter_dequant[64] = {
16, 16, 16, 20, 24, 28, 32, 40,
16, 16, 20, 24, 28, 32, 40, 48,
16, 20, 24, 28, 32, 40, 48, 64,
Expand All @@ -62,7 +62,7 @@ static const int16_t vp31_inter_dequant[64] = {
40, 48, 64, 64, 64, 96, 128, 128
};

static const int16_t vp31_dc_scale_factor[64] = {
static const uint8_t vp31_dc_scale_factor[64] = {
220, 200, 190, 180, 170, 170, 160, 160,
150, 150, 140, 140, 130, 130, 120, 120,
110, 110, 100, 100, 90, 90, 90, 80,
Expand Down Expand Up @@ -176,7 +176,7 @@ static const uint8_t motion_vector_vlc_table[63][2] = {
{ 0xFC, 8 }, { 0xFD, 8 }, { 0xFE, 8 }, { 0xFF, 8 }
};

static const int motion_vector_table[63] = {
static const int8_t motion_vector_table[63] = {
0, 1, -1,
2, -2,
3, -3,
Expand All @@ -198,29 +198,29 @@ static const int8_t fixed_motion_vector_table[64] = {
};

/* only tokens 0..6 indicate eob runs */
static const int eob_run_base[7] = {
static const uint8_t eob_run_base[7] = {
1, 2, 3, 4, 8, 16, 0
};
static const int eob_run_get_bits[7] = {
static const uint8_t eob_run_get_bits[7] = {
0, 0, 0, 2, 3, 4, 12
};

static const int zero_run_base[32] = {
static const uint8_t zero_run_base[32] = {
0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
0, 0, /* 7..8 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */
1, 2, 3, 4, 5, /* 23..27 */
6, 10, 1, 2 /* 28..31 */
};
static const int zero_run_get_bits[32] = {
static const uint8_t zero_run_get_bits[32] = {
0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
3, 6, /* 7..8 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */
0, 0, 0, 0, 0, /* 23..27 */
2, 3, 0, 1 /* 28..31 */
};

static const int coeff_get_bits[32] = {
static const uint8_t coeff_get_bits[32] = {
0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
0, 0, 0, 0, 0, 0, /* 7..12 use constant coeffs */
1, 1, 1, 1, /* 13..16 are constants but still need sign bit */
Expand Down

0 comments on commit 1402873

Please sign in to comment.