comparison mpegvideo.h @ 1950:a3c60fa850dc libavcodec

motion estimation cleanup replace ugly macros by always_inline functions, that way its much more readable and flexible as always_inline can simply be removed while the macros couldnt be about 0.5 % speedup with default parameters
author michael
date Thu, 22 Apr 2004 03:31:29 +0000
parents 32f68745c431
children 19c2344e800a
comparison
equal deleted inserted replaced
1949:66215baae7b9 1950:a3c60fa850dc
198 typedef struct MotionEstContext{ 198 typedef struct MotionEstContext{
199 int skip; ///< set if ME is skiped for the current MB 199 int skip; ///< set if ME is skiped for the current MB
200 int co_located_mv[4][2]; ///< mv from last p frame for direct mode ME 200 int co_located_mv[4][2]; ///< mv from last p frame for direct mode ME
201 int direct_basis_mv[4][2]; 201 int direct_basis_mv[4][2];
202 uint8_t *scratchpad; ///< data area for the me algo, so that the ME doesnt need to malloc/free 202 uint8_t *scratchpad; ///< data area for the me algo, so that the ME doesnt need to malloc/free
203 uint8_t *best_mb;
204 uint8_t *temp_mb[2];
205 uint8_t *temp;
206 int best_bits;
203 uint32_t *map; ///< map to avoid duplicate evaluations 207 uint32_t *map; ///< map to avoid duplicate evaluations
204 uint32_t *score_map; ///< map to store the scores 208 uint32_t *score_map; ///< map to store the scores
205 int map_generation; 209 int map_generation;
206 int pre_penalty_factor; 210 int pre_penalty_factor;
207 int penalty_factor; 211 int penalty_factor;
208 int sub_penalty_factor; 212 int sub_penalty_factor;
209 int mb_penalty_factor; 213 int mb_penalty_factor;
214 int flags;
215 int sub_flags;
216 int mb_flags;
210 int pre_pass; ///< = 1 for the pre pass 217 int pre_pass; ///< = 1 for the pre pass
211 int dia_size; 218 int dia_size;
212 int xmin; 219 int xmin;
213 int xmax; 220 int xmax;
214 int ymin; 221 int ymin;
215 int ymax; 222 int ymax;
223 int pred_x;
224 int pred_y;
225 uint8_t *src[4][4];
226 uint8_t *ref[4][4];
227 int stride;
228 int uvstride;
229 /* cmp, chroma_cmp;*/
230 op_pixels_func (*hpel_put)[4];
231 op_pixels_func (*hpel_avg)[4];
232 op_pixels_func (*chroma_hpel_put)[4];
233 qpel_mc_func (*qpel_put)[16];
234 qpel_mc_func (*qpel_avg)[16];
216 uint8_t (*mv_penalty)[MAX_MV*2+1]; ///< amount of bits needed to encode a MV 235 uint8_t (*mv_penalty)[MAX_MV*2+1]; ///< amount of bits needed to encode a MV
236 uint8_t *current_mv_penalty;
217 int (*sub_motion_search)(struct MpegEncContext * s, 237 int (*sub_motion_search)(struct MpegEncContext * s,
218 int *mx_ptr, int *my_ptr, int dmin, 238 int *mx_ptr, int *my_ptr, int dmin,
219 int pred_x, int pred_y, uint8_t *src_data[3], 239 int src_index, int ref_index,
220 uint8_t *ref_data[6], int stride, int uvstride, 240 int size, int h);
221 int size, int h, uint8_t * const mv_penalty);
222 int (*motion_search[7])(struct MpegEncContext * s,
223 int *mx_ptr, int *my_ptr,
224 int P[10][2], int pred_x, int pred_y, uint8_t *src_data[3],
225 uint8_t *ref_data[6], int stride, int uvstride, int16_t (*last_mv)[2],
226 int ref_mv_scale, uint8_t * const mv_penalty);
227 int (*pre_motion_search)(struct MpegEncContext * s,
228 int *mx_ptr, int *my_ptr,
229 int P[10][2], int pred_x, int pred_y, uint8_t *src_data[3],
230 uint8_t *ref_data[6], int stride, int uvstride, int16_t (*last_mv)[2],
231 int ref_mv_scale, uint8_t * const mv_penalty);
232 int (*get_mb_score)(struct MpegEncContext * s, int mx, int my, int pred_x, int pred_y, uint8_t *src_data[3],
233 uint8_t *ref_data[6], int stride, int uvstride,
234 uint8_t * const mv_penalty);
235 }MotionEstContext; 241 }MotionEstContext;
236 242
237 /** 243 /**
238 * MpegEncContext. 244 * MpegEncContext.
239 */ 245 */