ptrdiff_t is the correct type for array strides and similar.
Unified · Split
| @@ -77,7 +77,7 @@ typedef struct UtvideoContext { · 76 unmodified lines | |||
| 77 | int interlaced; | 77 | int interlaced; |
| 78 | int frame_pred; | 78 | int frame_pred; |
| 79 | 79 | ||
| 80 | int slice_stride; | 80 | ptrdiff_t slice_stride; |
| 81 | uint8_t *slice_bits, *slice_buffer[4]; | 81 | uint8_t *slice_bits, *slice_buffer[4]; |
| 82 | int slice_bits_size; | 82 | int slice_bits_size; |
| 83 | } UtvideoContext; | 83 | } UtvideoContext; |
| @@ -78,7 +78,7 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym) · 77 unmodified lines | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | static int decode_plane(UtvideoContext *c, int plane_no, | 80 | static int decode_plane(UtvideoContext *c, int plane_no, |
| 81 | uint8_t *dst, int step, int stride, | 81 | uint8_t *dst, int step, ptrdiff_t stride, |
| 82 | int width, int height, | 82 | int width, int height, |
| 83 | const uint8_t *src, int use_pred) | 83 | const uint8_t *src, int use_pred) |
| 84 | { | 84 | { |
| @@ -182,8 +182,8 @@ fail: · 97 unmodified lines | |||
| 182 | return AVERROR_INVALIDDATA; | 182 | return AVERROR_INVALIDDATA; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | static void restore_rgb_planes(uint8_t *src, int step, int stride, int width, | 185 | static void restore_rgb_planes(uint8_t *src, int step, ptrdiff_t stride, |
| 186 | int height) | 186 | int width, int height) |
| 187 | { | 187 | { |
| 188 | int i, j; | 188 | int i, j; |
| 189 | uint8_t r, g, b; | 189 | uint8_t r, g, b; |
| @@ -200,7 +200,7 @@ static void restore_rgb_planes(uint8_t *src, int step, int stride, int width, · 10 unmodified lines | |||
| 200 | } | 200 | } |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | static void restore_median(uint8_t *src, int step, int stride, | 203 | static void restore_median(uint8_t *src, int step, ptrdiff_t stride, |
| 204 | int width, int height, int slices, int rmode) | 204 | int width, int height, int slices, int rmode) |
| 205 | { | 205 | { |
| 206 | int i, j, slice; | 206 | int i, j, slice; |
| @@ -256,7 +256,7 @@ static void restore_median(uint8_t *src, int step, int stride, · 49 unmodified lines | |||
| 256 | * so restoring function should take care of possible padding between | 256 | * so restoring function should take care of possible padding between |
| 257 | * two parts of the same "line". | 257 | * two parts of the same "line". |
| 258 | */ | 258 | */ |
| 259 | static void restore_median_il(uint8_t *src, int step, int stride, | 259 | static void restore_median_il(uint8_t *src, int step, ptrdiff_t stride, |
| 260 | int width, int height, int slices, int rmode) | 260 | int width, int height, int slices, int rmode) |
| 261 | { | 261 | { |
| 262 | int i, j, slice; | 262 | int i, j, slice; |
| @@ -264,7 +264,7 @@ static void restore_median_il(uint8_t *src, int step, int stride, · 1 unmodified line | |||
| 264 | uint8_t *bsrc; | 264 | uint8_t *bsrc; |
| 265 | int slice_start, slice_height; | 265 | int slice_start, slice_height; |
| 266 | const int cmask = ~(rmode ? 3 : 1); | 266 | const int cmask = ~(rmode ? 3 : 1); |
| 267 | const int stride2 = stride << 1; | 267 | const ptrdiff_t stride2 = stride << 1; |
| 268 | 268 | ||
| 269 | for (slice = 0; slice < slices; slice++) { | 269 | for (slice = 0; slice < slices; slice++) { |
| 270 | slice_start = ((slice * height) / slices) & cmask; | 270 | slice_start = ((slice * height) / slices) & cmask; |
| @@ -234,8 +234,9 @@ FF_ENABLE_DEPRECATION_WARNINGS · 233 unmodified lines | |||
| 234 | return 0; | 234 | return 0; |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | static void mangle_rgb_planes(uint8_t *dst[4], int dst_stride, uint8_t *src, | 237 | static void mangle_rgb_planes(uint8_t *dst[4], ptrdiff_t dst_stride, |
| 238 | int step, int stride, int width, int height) | 238 | uint8_t *src, int step, ptrdiff_t stride, |
| 239 | int width, int height) | ||
| 239 | { | 240 | { |
| 240 | int i, j; | 241 | int i, j; |
| 241 | int k = 2 * dst_stride; | 242 | int k = 2 * dst_stride; |
| @@ -268,7 +269,7 @@ static void mangle_rgb_planes(uint8_t *dst[4], int dst_stride, uint8_t *src, · 26 unmodified lines | |||
| 268 | } | 269 | } |
| 269 | 270 | ||
| 270 | /* Write data to a plane with left prediction */ | 271 | /* Write data to a plane with left prediction */ |
| 271 | static void left_predict(uint8_t *src, uint8_t *dst, int stride, | 272 | static void left_predict(uint8_t *src, uint8_t *dst, ptrdiff_t stride, |
| 272 | int width, int height) | 273 | int width, int height) |
| 273 | { | 274 | { |
| 274 | int i, j; | 275 | int i, j; |
| @@ -285,8 +286,8 @@ static void left_predict(uint8_t *src, uint8_t *dst, int stride, · 10 unmodified lines | |||
| 285 | } | 286 | } |
| 286 | 287 | ||
| 287 | /* Write data to a plane with median prediction */ | 288 | /* Write data to a plane with median prediction */ |
| 288 | static void median_predict(UtvideoContext *c, uint8_t *src, uint8_t *dst, int stride, | 289 | static void median_predict(UtvideoContext *c, uint8_t *src, uint8_t *dst, |
| 289 | int width, int height) | 290 | ptrdiff_t stride, int width, int height) |
| 290 | { | 291 | { |
| 291 | int i, j; | 292 | int i, j; |
| 292 | int A, B; | 293 | int A, B; |
| @@ -387,7 +388,7 @@ static int write_huff_codes(uint8_t *src, uint8_t *dst, int dst_size, · 94 unmodified lines | |||
| 387 | } | 388 | } |
| 388 | 389 | ||
| 389 | static int encode_plane(AVCodecContext *avctx, uint8_t *src, | 390 | static int encode_plane(AVCodecContext *avctx, uint8_t *src, |
| 390 | uint8_t *dst, int stride, | 391 | uint8_t *dst, ptrdiff_t stride, |
| 391 | int width, int height, PutByteContext *pb) | 392 | int width, int height, PutByteContext *pb) |
| 392 | { | 393 | { |
| 393 | UtvideoContext *c = avctx->priv_data; | 394 | UtvideoContext *c = avctx->priv_data; |