00001
00024 #ifndef AVCODEC_VP56DATA_H
00025 #define AVCODEC_VP56DATA_H
00026
00027 #include "libavutil/common.h"
00028
00029 typedef enum {
00030 VP56_FRAME_NONE =-1,
00031 VP56_FRAME_CURRENT = 0,
00032 VP56_FRAME_PREVIOUS = 1,
00033 VP56_FRAME_GOLDEN = 2,
00034 VP56_FRAME_GOLDEN2 = 3,
00035 VP56_FRAME_UNUSED = 4,
00036 VP56_FRAME_UNUSED2 = 5,
00037 } VP56Frame;
00038
00039 typedef enum {
00040 VP56_MB_INTER_NOVEC_PF = 0,
00041 VP56_MB_INTRA = 1,
00042 VP56_MB_INTER_DELTA_PF = 2,
00043 VP56_MB_INTER_V1_PF = 3,
00044 VP56_MB_INTER_V2_PF = 4,
00045 VP56_MB_INTER_NOVEC_GF = 5,
00046 VP56_MB_INTER_DELTA_GF = 6,
00047 VP56_MB_INTER_4V = 7,
00048 VP56_MB_INTER_V1_GF = 8,
00049 VP56_MB_INTER_V2_GF = 9,
00050 } VP56mb;
00051
00052 typedef struct {
00053 int8_t val;
00054 int8_t prob_idx;
00055 } VP56Tree;
00056
00057 extern const uint8_t vp56_b2p[];
00058 extern const uint8_t vp56_b6to4[];
00059 extern const uint8_t vp56_coeff_parse_table[6][11];
00060 extern const uint8_t vp56_def_mb_types_stats[3][10][2];
00061 extern const VP56Tree vp56_pva_tree[];
00062 extern const VP56Tree vp56_pc_tree[];
00063 extern const uint8_t vp56_coeff_bias[];
00064 extern const uint8_t vp56_coeff_bit_length[];
00065
00066 static const VP56Frame vp56_reference_frame[] = {
00067 VP56_FRAME_PREVIOUS,
00068 VP56_FRAME_CURRENT,
00069 VP56_FRAME_PREVIOUS,
00070 VP56_FRAME_PREVIOUS,
00071 VP56_FRAME_PREVIOUS,
00072 VP56_FRAME_GOLDEN,
00073 VP56_FRAME_GOLDEN,
00074 VP56_FRAME_PREVIOUS,
00075 VP56_FRAME_GOLDEN,
00076 VP56_FRAME_GOLDEN,
00077 };
00078
00079 static const uint8_t vp56_ac_dequant[64] = {
00080 94, 92, 90, 88, 86, 82, 78, 74,
00081 70, 66, 62, 58, 54, 53, 52, 51,
00082 50, 49, 48, 47, 46, 45, 44, 43,
00083 42, 40, 39, 37, 36, 35, 34, 33,
00084 32, 31, 30, 29, 28, 27, 26, 25,
00085 24, 23, 22, 21, 20, 19, 18, 17,
00086 16, 15, 14, 13, 12, 11, 10, 9,
00087 8, 7, 6, 5, 4, 3, 2, 1,
00088 };
00089
00090 static const uint8_t vp56_dc_dequant[64] = {
00091 47, 47, 47, 47, 45, 43, 43, 43,
00092 43, 43, 42, 41, 41, 40, 40, 40,
00093 40, 35, 35, 35, 35, 33, 33, 33,
00094 33, 32, 32, 32, 27, 27, 26, 26,
00095 25, 25, 24, 24, 23, 23, 19, 19,
00096 19, 19, 18, 18, 17, 16, 16, 16,
00097 16, 16, 15, 11, 11, 11, 10, 10,
00098 9, 8, 7, 5, 3, 3, 2, 2,
00099 };
00100
00101 static const uint8_t vp56_pre_def_mb_type_stats[16][3][10][2] = {
00102 { { { 9, 15 }, { 32, 25 }, { 7, 19 }, { 9, 21 }, { 1, 12 },
00103 { 14, 12 }, { 3, 18 }, { 14, 23 }, { 3, 10 }, { 0, 4 }, },
00104 { { 41, 22 }, { 1, 0 }, { 1, 31 }, { 0, 0 }, { 0, 0 },
00105 { 0, 1 }, { 1, 7 }, { 0, 1 }, { 98, 25 }, { 4, 10 }, },
00106 { { 2, 3 }, { 2, 3 }, { 0, 2 }, { 0, 2 }, { 0, 0 },
00107 { 11, 4 }, { 1, 4 }, { 0, 2 }, { 3, 2 }, { 0, 4 }, }, },
00108 { { { 48, 39 }, { 1, 2 }, { 11, 27 }, { 29, 44 }, { 7, 27 },
00109 { 1, 4 }, { 0, 3 }, { 1, 6 }, { 1, 2 }, { 0, 0 }, },
00110 { { 123, 37 }, { 6, 4 }, { 1, 27 }, { 0, 0 }, { 0, 0 },
00111 { 5, 8 }, { 1, 7 }, { 0, 1 }, { 12, 10 }, { 0, 2 }, },
00112 { { 49, 46 }, { 3, 4 }, { 7, 31 }, { 42, 41 }, { 0, 0 },
00113 { 2, 6 }, { 1, 7 }, { 1, 4 }, { 2, 4 }, { 0, 1 }, }, },
00114 { { { 21, 32 }, { 1, 2 }, { 4, 10 }, { 32, 43 }, { 6, 23 },
00115 { 2, 3 }, { 1, 19 }, { 1, 6 }, { 12, 21 }, { 0, 7 }, },
00116 { { 26, 14 }, { 14, 12 }, { 0, 24 }, { 0, 0 }, { 0, 0 },
00117 { 55, 17 }, { 1, 9 }, { 0, 36 }, { 5, 7 }, { 1, 3 }, },
00118 { { 26, 25 }, { 1, 1 }, { 2, 10 }, { 67, 39 }, { 0, 0 },
00119 { 1, 1 }, { 0, 14 }, { 0, 2 }, { 31, 26 }, { 1, 6 }, }, },
00120 { { { 69, 83 }, { 0, 0 }, { 0, 2 }, { 10, 29 }, { 3, 12 },
00121 { 0, 1 }, { 0, 3 }, { 0, 3 }, { 2, 2 }, { 0, 0 }, },
00122 { { 209, 5 }, { 0, 0 }, { 0, 27 }, { 0, 0 }, { 0, 0 },
00123 { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, },
00124 { { 103, 46 }, { 1, 2 }, { 2, 10 }, { 33, 42 }, { 0, 0 },
00125 { 1, 4 }, { 0, 3 }, { 0, 1 }, { 1, 3 }, { 0, 0 }, }, },
00126 { { { 11, 20 }, { 1, 4 }, { 18, 36 }, { 43, 48 }, { 13, 35 },
00127 { 0, 2 }, { 0, 5 }, { 3, 12 }, { 1, 2 }, { 0, 0 }, },
00128 { { 2, 5 }, { 4, 5 }, { 0, 121 }, { 0, 0 }, { 0, 0 },
00129 { 0, 3 }, { 2, 4 }, { 1, 4 }, { 2, 2 }, { 0, 1 }, },
00130 { { 14, 31 }, { 9, 13 }, { 14, 54 }, { 22, 29 }, { 0, 0 },
00131 { 2, 6 }, { 4, 18 }, { 6, 13 }, { 1, 5 }, { 0, 1 }, }, },
00132 { { { 70, 44 }, { 0, 1 }, { 2, 10 }, { 37, 46 }, { 8, 26 },
00133 { 0, 2 }, { 0, 2 }, { 0, 2 }, { 0, 1 }, { 0, 0 }, },
00134 { { 175, 5 }, { 0, 1 }, { 0, 48 }, { 0, 0 }, { 0, 0 },
00135 { 0, 2 }, { 0, 1 }, { 0, 2 }, { 0, 1 }, { 0, 0 }, },
00136 { { 85, 39 }, { 0, 0 }, { 1, 9 }, { 69, 40 }, { 0, 0 },
00137 { 0, 1 }, { 0, 3 }, { 0, 1 }, { 2, 3 }, { 0, 0 }, }, },
00138 { { { 8, 15 }, { 0, 1 }, { 8, 21 }, { 74, 53 }, { 22, 42 },
00139 { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 2 }, { 0, 0 }, },
00140 { { 83, 5 }, { 2, 3 }, { 0, 102 }, { 0, 0 }, { 0, 0 },
00141 { 1, 3 }, { 0, 2 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, },
00142 { { 31, 28 }, { 0, 0 }, { 3, 14 }, { 130, 34 }, { 0, 0 },
00143 { 0, 1 }, { 0, 3 }, { 0, 1 }, { 3, 3 }, { 0, 1 }, }, },
00144 { { { 141, 42 }, { 0, 0 }, { 1, 4 }, { 11, 24 }, { 1, 11 },
00145 { 0, 1 }, { 0, 1 }, { 0, 2 }, { 0, 0 }, { 0, 0 }, },
00146 { { 233, 6 }, { 0, 0 }, { 0, 8 }, { 0, 0 }, { 0, 0 },
00147 { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 1 }, { 0, 0 }, },
00148 { { 171, 25 }, { 0, 0 }, { 1, 5 }, { 25, 21 }, { 0, 0 },
00149 { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
00150 { { { 8, 19 }, { 4, 10 }, { 24, 45 }, { 21, 37 }, { 9, 29 },
00151 { 0, 3 }, { 1, 7 }, { 11, 25 }, { 0, 2 }, { 0, 1 }, },
00152 { { 34, 16 }, { 112, 21 }, { 1, 28 }, { 0, 0 }, { 0, 0 },
00153 { 6, 8 }, { 1, 7 }, { 0, 3 }, { 2, 5 }, { 0, 2 }, },
00154 { { 17, 21 }, { 68, 29 }, { 6, 15 }, { 13, 22 }, { 0, 0 },
00155 { 6, 12 }, { 3, 14 }, { 4, 10 }, { 1, 7 }, { 0, 3 }, }, },
00156 { { { 46, 42 }, { 0, 1 }, { 2, 10 }, { 54, 51 }, { 10, 30 },
00157 { 0, 2 }, { 0, 2 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, },
00158 { { 159, 35 }, { 2, 2 }, { 0, 25 }, { 0, 0 }, { 0, 0 },
00159 { 3, 6 }, { 0, 5 }, { 0, 1 }, { 4, 4 }, { 0, 1 }, },
00160 { { 51, 39 }, { 0, 1 }, { 2, 12 }, { 91, 44 }, { 0, 0 },
00161 { 0, 2 }, { 0, 3 }, { 0, 1 }, { 2, 3 }, { 0, 1 }, }, },
00162 { { { 28, 32 }, { 0, 0 }, { 3, 10 }, { 75, 51 }, { 14, 33 },
00163 { 0, 1 }, { 0, 2 }, { 0, 1 }, { 1, 2 }, { 0, 0 }, },
00164 { { 75, 39 }, { 5, 7 }, { 2, 48 }, { 0, 0 }, { 0, 0 },
00165 { 3, 11 }, { 2, 16 }, { 1, 4 }, { 7, 10 }, { 0, 2 }, },
00166 { { 81, 25 }, { 0, 0 }, { 2, 9 }, { 106, 26 }, { 0, 0 },
00167 { 0, 1 }, { 0, 1 }, { 0, 1 }, { 1, 1 }, { 0, 0 }, }, },
00168 { { { 100, 46 }, { 0, 1 }, { 3, 9 }, { 21, 37 }, { 5, 20 },
00169 { 0, 1 }, { 0, 2 }, { 1, 2 }, { 0, 1 }, { 0, 0 }, },
00170 { { 212, 21 }, { 0, 1 }, { 0, 9 }, { 0, 0 }, { 0, 0 },
00171 { 1, 2 }, { 0, 2 }, { 0, 0 }, { 2, 2 }, { 0, 0 }, },
00172 { { 140, 37 }, { 0, 1 }, { 1, 8 }, { 24, 33 }, { 0, 0 },
00173 { 1, 2 }, { 0, 2 }, { 0, 1 }, { 1, 2 }, { 0, 0 }, }, },
00174 { { { 27, 29 }, { 0, 1 }, { 9, 25 }, { 53, 51 }, { 12, 34 },
00175 { 0, 1 }, { 0, 3 }, { 1, 5 }, { 0, 2 }, { 0, 0 }, },
00176 { { 4, 2 }, { 0, 0 }, { 0, 172 }, { 0, 0 }, { 0, 0 },
00177 { 0, 1 }, { 0, 2 }, { 0, 0 }, { 2, 0 }, { 0, 0 }, },
00178 { { 14, 23 }, { 1, 3 }, { 11, 53 }, { 90, 31 }, { 0, 0 },
00179 { 0, 3 }, { 1, 5 }, { 2, 6 }, { 1, 2 }, { 0, 0 }, }, },
00180 { { { 80, 38 }, { 0, 0 }, { 1, 4 }, { 69, 33 }, { 5, 16 },
00181 { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 1 }, { 0, 0 }, },
00182 { { 187, 22 }, { 1, 1 }, { 0, 17 }, { 0, 0 }, { 0, 0 },
00183 { 3, 6 }, { 0, 4 }, { 0, 1 }, { 4, 4 }, { 0, 1 }, },
00184 { { 123, 29 }, { 0, 0 }, { 1, 7 }, { 57, 30 }, { 0, 0 },
00185 { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, }, },
00186 { { { 16, 20 }, { 0, 0 }, { 2, 8 }, { 104, 49 }, { 15, 33 },
00187 { 0, 1 }, { 0, 1 }, { 0, 1 }, { 1, 1 }, { 0, 0 }, },
00188 { { 133, 6 }, { 1, 2 }, { 1, 70 }, { 0, 0 }, { 0, 0 },
00189 { 0, 2 }, { 0, 4 }, { 0, 3 }, { 1, 1 }, { 0, 0 }, },
00190 { { 13, 14 }, { 0, 0 }, { 4, 20 }, { 175, 20 }, { 0, 0 },
00191 { 0, 1 }, { 0, 1 }, { 0, 1 }, { 1, 1 }, { 0, 0 }, }, },
00192 { { { 194, 16 }, { 0, 0 }, { 1, 1 }, { 1, 9 }, { 1, 3 },
00193 { 0, 0 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, },
00194 { { 251, 1 }, { 0, 0 }, { 0, 2 }, { 0, 0 }, { 0, 0 },
00195 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, },
00196 { { 202, 23 }, { 0, 0 }, { 1, 3 }, { 2, 9 }, { 0, 0 },
00197 { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, }, },
00198 };
00199
00200 static const uint8_t vp56_filter_threshold[] = {
00201 14, 14, 13, 13, 12, 12, 10, 10,
00202 10, 10, 8, 8, 8, 8, 8, 8,
00203 8, 8, 8, 8, 8, 8, 8, 8,
00204 8, 8, 8, 8, 8, 8, 8, 8,
00205 8, 8, 8, 8, 7, 7, 7, 7,
00206 7, 7, 6, 6, 6, 6, 6, 6,
00207 5, 5, 5, 5, 4, 4, 4, 4,
00208 4, 4, 4, 3, 3, 3, 3, 2,
00209 };
00210
00211 static const uint8_t vp56_mb_type_model_model[] = {
00212 171, 83, 199, 140, 125, 104,
00213 };
00214
00215 static const VP56Tree vp56_pmbtm_tree[] = {
00216 { 4, 0},
00217 { 2, 1}, {-8}, {-4},
00218 { 8, 2},
00219 { 6, 3},
00220 { 4, 4},
00221 { 2, 5}, {-24}, {-20}, {-16}, {-12}, {-0},
00222 };
00223
00224 static const VP56Tree vp56_pmbt_tree[] = {
00225 { 8, 1},
00226 { 4, 2},
00227 { 2, 4}, {-VP56_MB_INTER_NOVEC_PF}, {-VP56_MB_INTER_DELTA_PF},
00228 { 2, 5}, {-VP56_MB_INTER_V1_PF}, {-VP56_MB_INTER_V2_PF},
00229 { 4, 3},
00230 { 2, 6}, {-VP56_MB_INTRA}, {-VP56_MB_INTER_4V},
00231 { 4, 7},
00232 { 2, 8}, {-VP56_MB_INTER_NOVEC_GF}, {-VP56_MB_INTER_DELTA_GF},
00233 { 2, 9}, {-VP56_MB_INTER_V1_GF}, {-VP56_MB_INTER_V2_GF},
00234 };
00235
00236
00237 static const int8_t vp56_candidate_predictor_pos[12][2] = {
00238 { 0, -1 },
00239 { -1, 0 },
00240 { -1, -1 },
00241 { 1, -1 },
00242 { 0, -2 },
00243 { -2, 0 },
00244 { -2, -1 },
00245 { -1, -2 },
00246 { 1, -2 },
00247 { 2, -1 },
00248 { -2, -2 },
00249 { 2, -2 },
00250 };
00251
00252 #endif