aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-03-21 15:49:09 -0300
committerJames Almer <jamrial@gmail.com>2017-03-21 15:49:09 -0300
commit1e185488269fd5639bc4fe826c8cd53c3e45c047 (patch)
treeec799bf3c66f06a8091067ba83a68b12224d72d0 /libavcodec
parenta8474df9447d6466c77d3ec8f414cda2662f057b (diff)
parentba479f3daafc7e4359ec1212164569ebe59f0bb7 (diff)
downloadffmpeg-1e185488269fd5639bc4fe826c8cd53c3e45c047.tar.gz
Merge commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7'
* commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7': hevc: Change type of array stride parameters to ptrdiff_t Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/hevc.c12
-rw-r--r--libavcodec/hevc_filter.c10
-rw-r--r--libavcodec/hevcdsp_template.c8
3 files changed, 15 insertions, 15 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 505249e6b5..0b4a719fe7 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1283,11 +1283,11 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
HEVCLocalContext *lc = s->HEVClc;
GetBitContext gb;
int cb_size = 1 << log2_cb_size;
- int stride0 = s->frame->linesize[0];
+ ptrdiff_t stride0 = s->frame->linesize[0];
+ ptrdiff_t stride1 = s->frame->linesize[1];
+ ptrdiff_t stride2 = s->frame->linesize[2];
uint8_t *dst0 = &s->frame->data[0][y0 * stride0 + (x0 << s->ps.sps->pixel_shift)];
- int stride1 = s->frame->linesize[1];
uint8_t *dst1 = &s->frame->data[1][(y0 >> s->ps.sps->vshift[1]) * stride1 + ((x0 >> s->ps.sps->hshift[1]) << s->ps.sps->pixel_shift)];
- int stride2 = s->frame->linesize[2];
uint8_t *dst2 = &s->frame->data[2][(y0 >> s->ps.sps->vshift[2]) * stride2 + ((x0 >> s->ps.sps->hshift[2]) << s->ps.sps->pixel_shift)];
int length = cb_size * cb_size * s->ps.sps->pcm.bit_depth +
@@ -1357,7 +1357,7 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
if (x_off < QPEL_EXTRA_BEFORE || y_off < QPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off >= pic_height - block_h - QPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
int offset = QPEL_EXTRA_BEFORE * srcstride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
@@ -1423,7 +1423,7 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
if (x_off0 < QPEL_EXTRA_BEFORE || y_off0 < QPEL_EXTRA_AFTER ||
x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off0 >= pic_height - block_h - QPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
int offset = QPEL_EXTRA_BEFORE * src0stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
@@ -1440,7 +1440,7 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
if (x_off1 < QPEL_EXTRA_BEFORE || y_off1 < QPEL_EXTRA_AFTER ||
x_off1 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off1 >= pic_height - block_h - QPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
int offset = QPEL_EXTRA_BEFORE * src1stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c
index 6918a553f2..fe520f45b2 100644
--- a/libavcodec/hevc_filter.c
+++ b/libavcodec/hevc_filter.c
@@ -139,7 +139,7 @@ static int get_qPy(HEVCContext *s, int xC, int yC)
}
static void copy_CTB(uint8_t *dst, const uint8_t *src, int width, int height,
- intptr_t stride_dst, intptr_t stride_src)
+ ptrdiff_t stride_dst, ptrdiff_t stride_src)
{
int i, j;
@@ -170,7 +170,7 @@ static void copy_pixel(uint8_t *dst, const uint8_t *src, int pixel_shift)
static void copy_vert(uint8_t *dst, const uint8_t *src,
int pixel_shift, int height,
- int stride_dst, int stride_src)
+ ptrdiff_t stride_dst, ptrdiff_t stride_src)
{
int i;
if (pixel_shift == 0) {
@@ -189,7 +189,7 @@ static void copy_vert(uint8_t *dst, const uint8_t *src,
}
static void copy_CTB_to_hv(HEVCContext *s, const uint8_t *src,
- int stride_src, int x, int y, int width, int height,
+ ptrdiff_t stride_src, int x, int y, int width, int height,
int c_idx, int x_ctb, int y_ctb)
{
int sh = s->ps.sps->pixel_shift;
@@ -306,14 +306,14 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
for (c_idx = 0; c_idx < (s->ps.sps->chroma_format_idc ? 3 : 1); c_idx++) {
int x0 = x >> s->ps.sps->hshift[c_idx];
int y0 = y >> s->ps.sps->vshift[c_idx];
- int stride_src = s->frame->linesize[c_idx];
+ ptrdiff_t stride_src = s->frame->linesize[c_idx];
int ctb_size_h = (1 << (s->ps.sps->log2_ctb_size)) >> s->ps.sps->hshift[c_idx];
int ctb_size_v = (1 << (s->ps.sps->log2_ctb_size)) >> s->ps.sps->vshift[c_idx];
int width = FFMIN(ctb_size_h, (s->ps.sps->width >> s->ps.sps->hshift[c_idx]) - x0);
int height = FFMIN(ctb_size_v, (s->ps.sps->height >> s->ps.sps->vshift[c_idx]) - y0);
int tab = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
uint8_t *src = &s->frame->data[c_idx][y0 * stride_src + (x0 << s->ps.sps->pixel_shift)];
- int stride_dst;
+ ptrdiff_t stride_dst;
uint8_t *dst;
switch (sao->type_idx[c_idx]) {
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index b95984f1eb..2b06dc5cba 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -393,8 +393,8 @@ static void FUNC(sao_edge_restore_0)(uint8_t *_dst, uint8_t *_src,
}
if (borders[3]) {
int offset_val = sao_offset_val[0];
- int y_stride_dst = stride_dst * (height - 1);
- int y_stride_src = stride_src * (height - 1);
+ ptrdiff_t y_stride_dst = stride_dst * (height - 1);
+ ptrdiff_t y_stride_src = stride_src * (height - 1);
for (x = init_x; x < width; x++)
dst[x + y_stride_dst] = av_clip_pixel(src[x + y_stride_src] + offset_val);
height--;
@@ -444,8 +444,8 @@ static void FUNC(sao_edge_restore_1)(uint8_t *_dst, uint8_t *_src,
}
if (borders[3]) {
int offset_val = sao_offset_val[0];
- int y_stride_dst = stride_dst * (height - 1);
- int y_stride_src = stride_src * (height - 1);
+ ptrdiff_t y_stride_dst = stride_dst * (height - 1);
+ ptrdiff_t y_stride_src = stride_src * (height - 1);
for (x = init_x; x < width; x++)
dst[x + y_stride_dst] = av_clip_pixel(src[x + y_stride_src] + offset_val);
height--;