Browse code

Merge commit '6b52762951fa138eef59e2628dabb389e0500e40'

* commit '6b52762951fa138eef59e2628dabb389e0500e40':
error_resilience: Change type of array stride parameters to ptrdiff_t

Merged-by: Clément Bœsch <u@pkh.me>

Clément Bœsch authored on 2017/03/20 19:10:46
Showing 2 changed files
... ...
@@ -42,7 +42,7 @@
42 42
  * @param stride the number of MVs to get to the next row
43 43
  * @param mv_step the number of MVs per row or column in a macroblock
44 44
  */
45
-static void set_mv_strides(ERContext *s, int *mv_step, int *stride)
45
+static void set_mv_strides(ERContext *s, ptrdiff_t *mv_step, ptrdiff_t *stride)
46 46
 {
47 47
     if (s->avctx->codec_id == AV_CODEC_ID_H264) {
48 48
         av_assert0(s->quarter_sample);
... ...
@@ -95,7 +95,7 @@ static void put_dc(ERContext *s, uint8_t *dest_y, uint8_t *dest_cb,
95 95
     }
96 96
 }
97 97
 
98
-static void filter181(int16_t *data, int width, int height, int stride)
98
+static void filter181(int16_t *data, int width, int height, ptrdiff_t stride)
99 99
 {
100 100
     int x, y;
101 101
 
... ...
@@ -137,7 +137,7 @@ static void filter181(int16_t *data, int width, int height, int stride)
137 137
  * @param h     height in 8 pixel blocks
138 138
  */
139 139
 static void guess_dc(ERContext *s, int16_t *dc, int w,
140
-                     int h, int stride, int is_luma)
140
+                     int h, ptrdiff_t stride, int is_luma)
141 141
 {
142 142
     int b_x, b_y;
143 143
     int16_t  (*col )[4] = av_malloc_array(stride, h*sizeof( int16_t)*4);
... ...
@@ -240,9 +240,10 @@ fail:
240 240
  * @param h     height in 8 pixel blocks
241 241
  */
242 242
 static void h_block_filter(ERContext *s, uint8_t *dst, int w,
243
-                           int h, int stride, int is_luma)
243
+                           int h, ptrdiff_t stride, int is_luma)
244 244
 {
245
-    int b_x, b_y, mvx_stride, mvy_stride;
245
+    int b_x, b_y;
246
+    ptrdiff_t mvx_stride, mvy_stride;
246 247
     const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
247 248
     set_mv_strides(s, &mvx_stride, &mvy_stride);
248 249
     mvx_stride >>= is_luma;
... ...
@@ -308,9 +309,10 @@ static void h_block_filter(ERContext *s, uint8_t *dst, int w,
308 308
  * @param h     height in 8 pixel blocks
309 309
  */
310 310
 static void v_block_filter(ERContext *s, uint8_t *dst, int w, int h,
311
-                           int stride, int is_luma)
311
+                           ptrdiff_t stride, int is_luma)
312 312
 {
313
-    int b_x, b_y, mvx_stride, mvy_stride;
313
+    int b_x, b_y;
314
+    ptrdiff_t mvx_stride, mvy_stride;
314 315
     const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
315 316
     set_mv_strides(s, &mvx_stride, &mvy_stride);
316 317
     mvx_stride >>= is_luma;
... ...
@@ -390,11 +392,12 @@ static void guess_mv(ERContext *s)
390 390
 {
391 391
     int (*blocklist)[2], (*next_blocklist)[2];
392 392
     uint8_t *fixed;
393
-    const int mb_stride = s->mb_stride;
393
+    const ptrdiff_t mb_stride = s->mb_stride;
394 394
     const int mb_width  = s->mb_width;
395 395
     int mb_height = s->mb_height;
396 396
     int i, depth, num_avail;
397
-    int mb_x, mb_y, mot_step, mot_stride;
397
+    int mb_x, mb_y;
398
+    ptrdiff_t mot_step, mot_stride;
398 399
     int blocklist_length, next_blocklist_length;
399 400
 
400 401
     if (s->last_pic.f && s->last_pic.f->data[0])
... ...
@@ -57,8 +57,8 @@ typedef struct ERContext {
57 57
     int *mb_index2xy;
58 58
     int mb_num;
59 59
     int mb_width, mb_height;
60
-    int mb_stride;
61
-    int b8_stride;
60
+    ptrdiff_t mb_stride;
61
+    ptrdiff_t b8_stride;
62 62
 
63 63
     volatile int error_count;
64 64
     int error_occurred;