Mercurial > libavcodec.hg
comparison vp56.h @ 5711:dae0f80edbb3 libavcodec
move all model related tables into their own struct
author | aurel |
---|---|
date | Mon, 24 Sep 2007 22:29:11 +0000 |
parents | 8f52599c4c6c |
children | 314be1cfdcb0 |
comparison
equal
deleted
inserted
replaced
5710:74e4be2d2f22 | 5711:dae0f80edbb3 |
---|---|
67 typedef struct { | 67 typedef struct { |
68 uint8_t type; | 68 uint8_t type; |
69 vp56_mv_t mv; | 69 vp56_mv_t mv; |
70 } vp56_macroblock_t; | 70 } vp56_macroblock_t; |
71 | 71 |
72 typedef struct { | |
73 uint8_t coeff_reorder[64]; /* used in vp6 only */ | |
74 uint8_t coeff_index_to_pos[64]; /* used in vp6 only */ | |
75 uint8_t vector_sig[2]; /* delta sign */ | |
76 uint8_t vector_dct[2]; /* delta coding types */ | |
77 uint8_t vector_pdi[2][2]; /* predefined delta init */ | |
78 uint8_t vector_pdv[2][7]; /* predefined delta values */ | |
79 uint8_t vector_fdv[2][8]; /* 8 bit delta value definition */ | |
80 uint8_t coeff_dccv[2][11]; /* DC coeff value */ | |
81 uint8_t coeff_ract[2][3][6][11]; /* Run/AC coding type and AC coeff value */ | |
82 uint8_t coeff_acct[2][3][3][6][5];/* vp5 only AC coding type for coding group < 3 */ | |
83 uint8_t coeff_dcct[2][36][5]; /* DC coeff coding type */ | |
84 uint8_t coeff_runv[2][14]; /* run value (vp6 only) */ | |
85 uint8_t mb_type[3][10][10]; /* model for decoding MB type */ | |
86 uint8_t mb_types_stats[3][10][2];/* contextual, next MB type stats */ | |
87 } vp56_model_t; | |
88 | |
72 struct vp56_context { | 89 struct vp56_context { |
73 AVCodecContext *avctx; | 90 AVCodecContext *avctx; |
74 DSPContext dsp; | 91 DSPContext dsp; |
75 ScanTable scantable; | 92 ScanTable scantable; |
76 AVFrame frames[3]; | 93 AVFrame frames[3]; |
101 | 118 |
102 /* blocks / macroblock */ | 119 /* blocks / macroblock */ |
103 vp56_mb_t mb_type; | 120 vp56_mb_t mb_type; |
104 vp56_macroblock_t *macroblocks; | 121 vp56_macroblock_t *macroblocks; |
105 DECLARE_ALIGNED_16(DCTELEM, block_coeff[6][64]); | 122 DECLARE_ALIGNED_16(DCTELEM, block_coeff[6][64]); |
106 uint8_t coeff_reorder[64]; /* used in vp6 only */ | |
107 uint8_t coeff_index_to_pos[64]; /* used in vp6 only */ | |
108 | 123 |
109 /* motion vectors */ | 124 /* motion vectors */ |
110 vp56_mv_t mv[6]; /* vectors for each block in MB */ | 125 vp56_mv_t mv[6]; /* vectors for each block in MB */ |
111 vp56_mv_t vector_candidate[2]; | 126 vp56_mv_t vector_candidate[2]; |
112 int vector_candidate_pos; | 127 int vector_candidate_pos; |
117 int filter_selection; | 132 int filter_selection; |
118 int filter_mode; | 133 int filter_mode; |
119 int max_vector_length; | 134 int max_vector_length; |
120 int sample_variance_threshold; | 135 int sample_variance_threshold; |
121 | 136 |
122 /* AC models */ | |
123 uint8_t vector_model_sig[2]; /* delta sign */ | |
124 uint8_t vector_model_dct[2]; /* delta coding types */ | |
125 uint8_t vector_model_pdi[2][2]; /* predefined delta init */ | |
126 uint8_t vector_model_pdv[2][7]; /* predefined delta values */ | |
127 uint8_t vector_model_fdv[2][8]; /* 8 bit delta value definition */ | |
128 uint8_t mb_type_model[3][10][10]; /* model for decoding MB type */ | |
129 uint8_t coeff_model_dccv[2][11]; /* DC coeff value */ | |
130 uint8_t coeff_model_ract[2][3][6][11]; /* Run/AC coding type and AC coeff value */ | |
131 uint8_t coeff_model_acct[2][3][3][6][5];/* vp5 only AC coding type for coding group < 3 */ | |
132 uint8_t coeff_model_dcct[2][36][5]; /* DC coeff coding type */ | |
133 uint8_t coeff_model_runv[2][14]; /* run value (vp6 only) */ | |
134 uint8_t mb_types_stats[3][10][2]; /* contextual, next MB type stats */ | |
135 uint8_t coeff_ctx[4][64]; /* used in vp5 only */ | 137 uint8_t coeff_ctx[4][64]; /* used in vp5 only */ |
136 uint8_t coeff_ctx_last[4]; /* used in vp5 only */ | 138 uint8_t coeff_ctx_last[4]; /* used in vp5 only */ |
137 | 139 |
138 /* upside-down flipping hints */ | 140 /* upside-down flipping hints */ |
139 int flip; /* are we flipping ? */ | 141 int flip; /* are we flipping ? */ |
148 vp56_parse_coeff_t parse_coeff; | 150 vp56_parse_coeff_t parse_coeff; |
149 vp56_default_models_init_t default_models_init; | 151 vp56_default_models_init_t default_models_init; |
150 vp56_parse_vector_models_t parse_vector_models; | 152 vp56_parse_vector_models_t parse_vector_models; |
151 vp56_parse_coeff_models_t parse_coeff_models; | 153 vp56_parse_coeff_models_t parse_coeff_models; |
152 vp56_parse_header_t parse_header; | 154 vp56_parse_header_t parse_header; |
155 | |
156 vp56_model_t *modelp; | |
157 vp56_model_t models; | |
153 }; | 158 }; |
154 | 159 |
155 | 160 |
156 void vp56_init(AVCodecContext *avctx, int flip); | 161 void vp56_init(AVCodecContext *avctx, int flip); |
157 int vp56_free(AVCodecContext *avctx); | 162 int vp56_free(AVCodecContext *avctx); |