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