]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/motion_est_template.c
alignment 10l
[ffmpeg] / libavcodec / motion_est_template.c
index f393fd88a96976e86944acec0ddf1c7b7d6269b4..db51d676db6aae0bb5309c0a7faf12189c805c2b 100644 (file)
@@ -43,8 +43,8 @@
     op_pixels_func (*chroma_hpel_put)[4];\
     qpel_mc_func (*qpel_put)[16];\
     qpel_mc_func (*qpel_avg)[16]= &s->dsp.avg_qpel_pixels_tab[size];\
-    const __attribute__((unused)) int unu= time_pp + time_pb + (int)src_u + (int)src_v + (int)ref_u + (int)ref_v\
-                                           + (int)ref2_y + (int)hpel_avg + (int)qpel_avg + (int)score_map;\
+    const __attribute__((unused)) int unu= time_pp + time_pb + (size_t)src_u + (size_t)src_v + (size_t)ref_u + (size_t)ref_v\
+                                           + (size_t)ref2_y + (size_t)hpel_avg + (size_t)qpel_avg + (size_t)score_map;\
     if(s->no_rounding /*FIXME b_type*/){\
         hpel_put= &s->dsp.put_no_rnd_pixels_tab[size];\
         chroma_hpel_put= &s->dsp.put_no_rnd_pixels_tab[size+1];\
@@ -72,7 +72,7 @@ static int RENAME(hpel_motion_search)(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 n, int size, uint8_t * const mv_penalty)
 {
     const int xx = 16 * s->mb_x + 8*(n&1);
     const int yy = 16 * s->mb_y + 8*(n>>1);
@@ -141,7 +141,7 @@ static int RENAME(hpel_motion_search)(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 n, int size, uint8_t * const mv_penalty)
 {
     const int xx = 16 * s->mb_x + 8*(n&1);
     const int yy = 16 * s->mb_y + 8*(n>>1);
@@ -186,7 +186,9 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
 #if 1
         int key;
         int map_generation= s->me.map_generation;
+#ifndef NDEBUG
         uint32_t *map= s->me.map;
+#endif
         key= ((my-1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
         assert(map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
         key= ((my+1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
@@ -246,7 +248,7 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
 #endif
 
 static int RENAME(hpel_get_mb_score)(MpegEncContext * s, int mx, int my, int pred_x, int pred_y, Picture *ref_picture, 
-                                  uint16_t * const mv_penalty)
+                                  uint8_t * const mv_penalty)
 {
 //    const int check_luma= s->dsp.me_sub_cmp != s->dsp.mb_cmp;
     const int size= 0;
@@ -295,7 +297,7 @@ static int RENAME(qpel_motion_search)(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 n, int size, uint8_t * const mv_penalty)
 {
     const int xx = 16 * s->mb_x + 8*(n&1);
     const int yy = 16 * s->mb_y + 8*(n>>1);
@@ -513,7 +515,7 @@ static int RENAME(qpel_motion_search)(MpegEncContext * s,
 }
 
 static int RENAME(qpel_get_mb_score)(MpegEncContext * s, int mx, int my, int pred_x, int pred_y, Picture *ref_picture, 
-                                  uint16_t * const mv_penalty)
+                                  uint8_t * const mv_penalty)
 {
     const int size= 0;
     const int xx = 16 * s->mb_x;
@@ -598,7 +600,7 @@ static inline int RENAME(small_diamond_search)(MpegEncContext * s, int *best, in
                                        Picture *ref_picture,
                                        int const pred_x, int const pred_y, int const penalty_factor,
                                        int const xmin, int const ymin, int const xmax, int const ymax, int const shift,
-                                       uint32_t *map, int map_generation, int size, uint16_t * const mv_penalty
+                                       uint32_t *map, int map_generation, int size, uint8_t * const mv_penalty
                                        )
 {
     me_cmp_func cmp, chroma_cmp;
@@ -640,7 +642,7 @@ static inline int RENAME(funny_diamond_search)(MpegEncContext * s, int *best, in
                                        Picture *ref_picture,
                                        int const pred_x, int const pred_y, int const penalty_factor,
                                        int const xmin, int const ymin, int const xmax, int const ymax, int const shift,
-                                       uint32_t *map, int map_generation, int size, uint16_t * const mv_penalty
+                                       uint32_t *map, int map_generation, int size, uint8_t * const mv_penalty
                                        )
 {
     me_cmp_func cmp, chroma_cmp;
@@ -731,7 +733,7 @@ static inline int RENAME(sab_diamond_search)(MpegEncContext * s, int *best, int
                                        Picture *ref_picture,
                                        int const pred_x, int const pred_y, int const penalty_factor,
                                        int const xmin, int const ymin, int const xmax, int const ymax, int const shift,
-                                       uint32_t *map, int map_generation, int size, uint16_t * const mv_penalty
+                                       uint32_t *map, int map_generation, int size, uint8_t * const mv_penalty
                                        )
 {
     me_cmp_func cmp, chroma_cmp;
@@ -811,7 +813,7 @@ static inline int RENAME(var_diamond_search)(MpegEncContext * s, int *best, int
                                        Picture *ref_picture,
                                        int const pred_x, int const pred_y, int const penalty_factor,
                                        int const xmin, int const ymin, int const xmax, int const ymax, int const shift,
-                                       uint32_t *map, int map_generation, int size, uint16_t * const mv_penalty
+                                       uint32_t *map, int map_generation, int size, uint8_t * const mv_penalty
                                        )
 {
     me_cmp_func cmp, chroma_cmp;
@@ -888,7 +890,7 @@ static int RENAME(epzs_motion_search)(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 ref_mv_scale, uint8_t * const mv_penalty)
 {
     int best[2]={0, 0};
     int d, dmin; 
@@ -897,8 +899,8 @@ static int RENAME(epzs_motion_search)(MpegEncContext * s, int block,
     int map_generation;
     const int penalty_factor= s->me.penalty_factor;
     const int size=0;
-    const int ref_mv_stride= s->mb_width+2;
-    const int ref_mv_xy= 1 + s->mb_x + (s->mb_y + 1)*ref_mv_stride;
+    const int ref_mv_stride= s->mb_stride;
+    const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride;
     me_cmp_func cmp, chroma_cmp;
     LOAD_COMMON(s->mb_x*16, s->mb_y*16);
     
@@ -1000,7 +1002,7 @@ static int RENAME(epzs_motion_search4)(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 ref_mv_scale, uint8_t * const mv_penalty)
 {
     int best[2]={0, 0};
     int d, dmin; 
@@ -1009,8 +1011,8 @@ static int RENAME(epzs_motion_search4)(MpegEncContext * s, int block,
     int map_generation;
     const int penalty_factor= s->me.penalty_factor;
     const int size=1;
-    const int ref_mv_stride= s->mb_width+2;
-    const int ref_mv_xy= 1 + s->mb_x + (s->mb_y + 1)*ref_mv_stride;
+    const int ref_mv_stride= s->mb_stride;
+    const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
     me_cmp_func cmp, chroma_cmp;
     LOAD_COMMON((s->mb_x*2 + (block&1))*8, (s->mb_y*2 + (block>>1))*8);