aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-03-21 15:57:07 -0300
committerJames Almer <jamrial@gmail.com>2017-03-21 15:57:07 -0300
commita0478341f34be544e28b83ecfd768922de309416 (patch)
treeb9fd46671cb8d9f8a1e752d33b56506d8eef6b62 /libavcodec
parentb16752f694a5b580a8188fa2ef428a6afbb229d7 (diff)
parent15b4f494fc6bddb8178fdb5aed18b420efc75e22 (diff)
downloadffmpeg-a0478341f34be544e28b83ecfd768922de309416.tar.gz
Merge commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22'
* commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22': mss*: Change type of array stride parameters to ptrdiff_t Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mss12.c15
-rw-r--r--libavcodec/mss12.h6
-rw-r--r--libavcodec/mss2.c6
-rw-r--r--libavcodec/mss2dsp.c28
-rw-r--r--libavcodec/mss2dsp.h22
-rw-r--r--libavcodec/mss3.c12
-rw-r--r--libavcodec/mss34dsp.c2
-rw-r--r--libavcodec/mss34dsp.h3
-rw-r--r--libavcodec/mss4.c2
9 files changed, 50 insertions, 46 deletions
diff --git a/libavcodec/mss12.c b/libavcodec/mss12.c
index d42093b0a3..3b1a3029e0 100644
--- a/libavcodec/mss12.c
+++ b/libavcodec/mss12.c
@@ -197,7 +197,7 @@ static av_always_inline int decode_pixel(ArithCoder *acoder, PixContext *pctx,
}
static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx,
- uint8_t *src, int stride, int x, int y,
+ uint8_t *src, ptrdiff_t stride, int x, int y,
int has_right)
{
uint8_t neighbours[4];
@@ -290,8 +290,9 @@ static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx,
}
static int decode_region(ArithCoder *acoder, uint8_t *dst, uint8_t *rgb_pic,
- int x, int y, int width, int height, int stride,
- int rgb_stride, PixContext *pctx, const uint32_t *pal)
+ int x, int y, int width, int height, ptrdiff_t stride,
+ ptrdiff_t rgb_stride, PixContext *pctx,
+ const uint32_t *pal)
{
int i, j, p;
uint8_t *rgb_dst = rgb_pic + x * 3 + y * rgb_stride;
@@ -368,8 +369,8 @@ static int motion_compensation(MSS12Context const *c,
}
static int decode_region_masked(MSS12Context const *c, ArithCoder *acoder,
- uint8_t *dst, int stride, uint8_t *mask,
- int mask_stride, int x, int y,
+ uint8_t *dst, ptrdiff_t stride, uint8_t *mask,
+ ptrdiff_t mask_stride, int x, int y,
int width, int height,
PixContext *pctx)
{
@@ -466,8 +467,8 @@ static int decode_region_intra(SliceContext *sc, ArithCoder *acoder,
if (!mode) {
int i, j, pix, rgb_pix;
- int stride = c->pal_stride;
- int rgb_stride = c->rgb_stride;
+ ptrdiff_t stride = c->pal_stride;
+ ptrdiff_t rgb_stride = c->rgb_stride;
uint8_t *dst = c->pal_pic + x + y * stride;
uint8_t *rgb_dst = c->rgb_pic + x * 3 + y * rgb_stride;
diff --git a/libavcodec/mss12.h b/libavcodec/mss12.h
index f953167389..45c4074652 100644
--- a/libavcodec/mss12.h
+++ b/libavcodec/mss12.h
@@ -77,12 +77,12 @@ typedef struct MSS12Context {
uint32_t pal[256];
uint8_t *pal_pic;
uint8_t *last_pal_pic;
- int pal_stride;
+ ptrdiff_t pal_stride;
uint8_t *mask;
- int mask_stride;
+ ptrdiff_t mask_stride;
uint8_t *rgb_pic;
uint8_t *last_rgb_pic;
- int rgb_stride;
+ ptrdiff_t rgb_stride;
int free_colours;
int keyframe;
int mvX, mvY;
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 581865b0b1..9e7cc466de 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -174,7 +174,7 @@ static int decode_pal_v2(MSS12Context *ctx, const uint8_t *buf, int buf_size)
return 1 + ncol * 3;
}
-static int decode_555(GetByteContext *gB, uint16_t *dst, int stride,
+static int decode_555(GetByteContext *gB, uint16_t *dst, ptrdiff_t stride,
int keyframe, int w, int h)
{
int last_symbol = 0, repeat = 0, prev_avail = 0;
@@ -237,8 +237,8 @@ static int decode_555(GetByteContext *gB, uint16_t *dst, int stride,
return 0;
}
-static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, int pal_stride,
- uint8_t *rgb_dst, int rgb_stride, uint32_t *pal,
+static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride,
+ uint8_t *rgb_dst, ptrdiff_t rgb_stride, uint32_t *pal,
int keyframe, int kf_slipt, int slice, int w, int h)
{
uint8_t bits[270] = { 0 };
diff --git a/libavcodec/mss2dsp.c b/libavcodec/mss2dsp.c
index c5fc1f8dcf..cc39dd637f 100644
--- a/libavcodec/mss2dsp.c
+++ b/libavcodec/mss2dsp.c
@@ -27,17 +27,17 @@
#include "libavutil/common.h"
static av_always_inline void mss2_blit_wmv9_template(uint8_t *dst,
- int dst_stride,
+ ptrdiff_t dst_stride,
int gray,
int use_mask,
int maskcolor,
const uint8_t *mask,
- int mask_stride,
+ ptrdiff_t mask_stride,
const uint8_t *srcy,
- int srcy_stride,
+ ptrdiff_t srcy_stride,
const uint8_t *srcu,
const uint8_t *srcv,
- int srcuv_stride,
+ ptrdiff_t srcuv_stride,
int w, int h)
{
int i, j, k, r = -1;
@@ -64,10 +64,10 @@ static av_always_inline void mss2_blit_wmv9_template(uint8_t *dst,
}
}
-static void mss2_blit_wmv9_c(uint8_t *dst, int dst_stride,
- const uint8_t *srcy, int srcy_stride,
+static void mss2_blit_wmv9_c(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *srcy, ptrdiff_t srcy_stride,
const uint8_t *srcu, const uint8_t *srcv,
- int srcuv_stride, int w, int h)
+ ptrdiff_t srcuv_stride, int w, int h)
{
mss2_blit_wmv9_template(dst, dst_stride, 0, 0,
0, NULL, 0,
@@ -76,12 +76,12 @@ static void mss2_blit_wmv9_c(uint8_t *dst, int dst_stride,
w, h);
}
-static void mss2_blit_wmv9_masked_c(uint8_t *dst, int dst_stride,
+static void mss2_blit_wmv9_masked_c(uint8_t *dst, ptrdiff_t dst_stride,
int maskcolor, const uint8_t *mask,
- int mask_stride,
- const uint8_t *srcy, int srcy_stride,
+ ptrdiff_t mask_stride,
+ const uint8_t *srcy, ptrdiff_t srcy_stride,
const uint8_t *srcu, const uint8_t *srcv,
- int srcuv_stride, int w, int h)
+ ptrdiff_t srcuv_stride, int w, int h)
{
mss2_blit_wmv9_template(dst, dst_stride, 0, 1,
maskcolor, mask, mask_stride,
@@ -90,9 +90,9 @@ static void mss2_blit_wmv9_masked_c(uint8_t *dst, int dst_stride,
w, h);
}
-static void mss2_gray_fill_masked_c(uint8_t *dst, int dst_stride,
+static void mss2_gray_fill_masked_c(uint8_t *dst, ptrdiff_t dst_stride,
int maskcolor, const uint8_t *mask,
- int mask_stride, int w, int h)
+ ptrdiff_t mask_stride, int w, int h)
{
mss2_blit_wmv9_template(dst, dst_stride, 1, 1,
maskcolor, mask, mask_stride,
@@ -101,7 +101,7 @@ static void mss2_gray_fill_masked_c(uint8_t *dst, int dst_stride,
w, h);
}
-static void upsample_plane_c(uint8_t *plane, int plane_stride, int w, int h)
+static void upsample_plane_c(uint8_t *plane, ptrdiff_t plane_stride, int w, int h)
{
uint8_t *src1, *src2, *dst1, *dst2, *p, a, b;
int i, j;
diff --git a/libavcodec/mss2dsp.h b/libavcodec/mss2dsp.h
index 7368abb581..e44c9ab527 100644
--- a/libavcodec/mss2dsp.h
+++ b/libavcodec/mss2dsp.h
@@ -26,23 +26,25 @@
#ifndef AVCODEC_MSS2DSP_H
#define AVCODEC_MSS2DSP_H
+#include <stddef.h>
#include <stdint.h>
typedef struct MSS2DSPContext {
- void (*mss2_blit_wmv9)(uint8_t *dst, int dst_stride,
- const uint8_t *srcy, int srcy_stride,
+ void (*mss2_blit_wmv9)(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *srcy, ptrdiff_t srcy_stride,
const uint8_t *srcu, const uint8_t *srcv,
- int srcuv_stride, int w, int h);
- void (*mss2_blit_wmv9_masked)(uint8_t *dst, int dst_stride,
+ ptrdiff_t srcuv_stride, int w, int h);
+ void (*mss2_blit_wmv9_masked)(uint8_t *dst, ptrdiff_t dst_stride,
int maskcolor, const uint8_t *mask,
- int mask_stride,
- const uint8_t *srcy, int srcy_stride,
+ ptrdiff_t mask_stride,
+ const uint8_t *srcy, ptrdiff_t srcy_stride,
const uint8_t *srcu, const uint8_t *srcv,
- int srcuv_stride, int w, int h);
- void (*mss2_gray_fill_masked)(uint8_t *dst, int dst_stride,
+ ptrdiff_t srcuv_stride, int w, int h);
+ void (*mss2_gray_fill_masked)(uint8_t *dst, ptrdiff_t dst_stride,
int maskcolor, const uint8_t *mask,
- int mask_stride, int w, int h);
- void (*upsample_plane)(uint8_t *plane, int plane_stride, int w, int h);
+ ptrdiff_t mask_stride, int w, int h);
+ void (*upsample_plane)(uint8_t *plane, ptrdiff_t plane_stride,
+ int w, int h);
} MSS2DSPContext;
void ff_mss2dsp_init(MSS2DSPContext *dsp);
diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
index 01941967a5..7f3801774a 100644
--- a/libavcodec/mss3.c
+++ b/libavcodec/mss3.c
@@ -91,7 +91,7 @@ typedef struct ImageBlockCoder {
typedef struct DCTBlockCoder {
int *prev_dc;
- int prev_dc_stride;
+ ptrdiff_t prev_dc_stride;
int prev_dc_height;
int quality;
uint16_t qmat[64];
@@ -450,7 +450,7 @@ static int decode_coeff(RangeCoder *c, Model *m)
}
static void decode_fill_block(RangeCoder *c, FillBlockCoder *fc,
- uint8_t *dst, int stride, int block_size)
+ uint8_t *dst, ptrdiff_t stride, int block_size)
{
int i;
@@ -461,7 +461,7 @@ static void decode_fill_block(RangeCoder *c, FillBlockCoder *fc,
}
static void decode_image_block(RangeCoder *c, ImageBlockCoder *ic,
- uint8_t *dst, int stride, int block_size)
+ uint8_t *dst, ptrdiff_t stride, int block_size)
{
int i, j;
int vec_size;
@@ -557,7 +557,7 @@ static int decode_dct(RangeCoder *c, DCTBlockCoder *bc, int *block,
}
static void decode_dct_block(RangeCoder *c, DCTBlockCoder *bc,
- uint8_t *dst, int stride, int block_size,
+ uint8_t *dst, ptrdiff_t stride, int block_size,
int *block, int mb_x, int mb_y)
{
int i, j;
@@ -580,8 +580,8 @@ static void decode_dct_block(RangeCoder *c, DCTBlockCoder *bc,
}
static void decode_haar_block(RangeCoder *c, HaarBlockCoder *hc,
- uint8_t *dst, int stride, int block_size,
- int *block)
+ uint8_t *dst, ptrdiff_t stride,
+ int block_size, int *block)
{
const int hsize = block_size >> 1;
int A, B, C, D, t1, t2, t3, t4;
diff --git a/libavcodec/mss34dsp.c b/libavcodec/mss34dsp.c
index 0397add17d..36e69db8cc 100644
--- a/libavcodec/mss34dsp.c
+++ b/libavcodec/mss34dsp.c
@@ -87,7 +87,7 @@ void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma)
#define SOP_ROW(a) (((a) << 16) + 0x2000)
#define SOP_COL(a) (((a) + 32) << 16)
-void ff_mss34_dct_put(uint8_t *dst, int stride, int *block)
+void ff_mss34_dct_put(uint8_t *dst, ptrdiff_t stride, int *block)
{
int i, j;
int *ptr;
diff --git a/libavcodec/mss34dsp.h b/libavcodec/mss34dsp.h
index 2f9827d3e5..29c61e34f3 100644
--- a/libavcodec/mss34dsp.h
+++ b/libavcodec/mss34dsp.h
@@ -22,6 +22,7 @@
#ifndef AVCODEC_MSS34DSP_H
#define AVCODEC_MSS34DSP_H
+#include <stddef.h>
#include <stdint.h>
/**
@@ -40,6 +41,6 @@ void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma);
* @param stride output plane stride
* @param block block to transform and output
*/
-void ff_mss34_dct_put(uint8_t *dst, int stride, int *block);
+void ff_mss34_dct_put(uint8_t *dst, ptrdiff_t stride, int *block);
#endif /* AVCODEC_MSS34DSP_H */
diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index 9639fc820e..b58c21be93 100644
--- a/libavcodec/mss4.c
+++ b/libavcodec/mss4.c
@@ -136,7 +136,7 @@ typedef struct MSS4Context {
uint16_t quant_mat[2][64];
int *prev_dc[3];
- int dc_stride[3];
+ ptrdiff_t dc_stride[3];
int dc_cache[4][4];
int prev_vec[3][4];