+
+typedef struct ScanTable{
+ const UINT8 *scantable;
+ UINT8 permutated[64];
+ UINT8 raster_end[64];
+#ifdef ARCH_POWERPC
+ /* Used by dct_quantise_alitvec to find last-non-zero */
+ UINT8 __align8 inverse[64];
+#endif
+} ScanTable;
+
+typedef struct Picture{
+ FF_COMMON_FRAME
+
+ int mb_var_sum; /* sum of MB variance for current frame */
+ int mc_mb_var_sum; /* motion compensated MB variance for current frame */
+ uint16_t *mb_var; /* Table for MB variances */
+ uint16_t *mc_mb_var; /* Table for motion compensated MB variances */
+ uint8_t *mb_mean; /* Table for MB luminance */
+ int b_frame_score; /* */
+} Picture;
+
+typedef struct ParseContext{
+ UINT8 *buffer;
+ int index;
+ int last_index;
+ int buffer_size;
+ int state;
+ int frame_start_found;
+} ParseContext;
+
+struct MpegEncContext;
+
+typedef struct MotionEstContext{
+ int skip; /* set if ME is skiped for the current MB */
+ int co_located_mv[4][2]; /* mv from last p frame for direct mode ME */
+ int direct_basis_mv[4][2];
+ uint8_t *scratchpad; /* data area for the me algo, so that the ME doesnt need to malloc/free */
+ uint32_t *map; /* map to avoid duplicate evaluations */
+ uint32_t *score_map; /* map to store the scores */
+ int map_generation;
+ int pre_penalty_factor;
+ int penalty_factor;
+ int sub_penalty_factor;
+ int pre_pass; /* = 1 for the pre pass */
+ int dia_size;
+ UINT16 (*mv_penalty)[MAX_MV*2+1]; /* amount of bits needed to encode a MV */
+ int (*sub_motion_search)(struct MpegEncContext * s,
+ int *mx_ptr, int *my_ptr, int dmin,
+ int xmin, int ymin, int xmax, int ymax,
+ int pred_x, int pred_y, Picture *ref_picture,
+ int n, int size, uint16_t * const mv_penalty);
+ int (*motion_search[7])(struct MpegEncContext * s, int block,
+ int *mx_ptr, int *my_ptr,
+ int P[10][2], int pred_x, int pred_y,
+ int xmin, int ymin, int xmax, int ymax, Picture *ref_picture, int16_t (*last_mv)[2],
+ int ref_mv_scale, uint16_t * const mv_penalty);
+ int (*pre_motion_search)(struct MpegEncContext * s, int block,
+ int *mx_ptr, int *my_ptr,
+ int P[10][2], int pred_x, int pred_y,
+ int xmin, int ymin, int xmax, int ymax, Picture *ref_picture, int16_t (*last_mv)[2],
+ int ref_mv_scale, uint16_t * const mv_penalty);
+}MotionEstContext;