aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-03-19 15:30:13 -0300
committerJames Almer <jamrial@gmail.com>2017-03-19 15:30:13 -0300
commit663640d745279a272398283d8dca7efa356c8fe8 (patch)
tree6a12837dd212c0d46423a5d7a77d6658136ebaa6
parentaec42ebc27c46625fb7fac9d5717056044ecac92 (diff)
parent3fd22538bc0e0de84b31335266b4b1577d3d609e (diff)
downloadffmpeg-663640d745279a272398283d8dca7efa356c8fe8.tar.gz
Merge commit '3fd22538bc0e0de84b31335266b4b1577d3d609e'
* commit '3fd22538bc0e0de84b31335266b4b1577d3d609e': prores: Change type of stride parameters to ptrdiff_t Merged-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/proresdsp.c6
-rw-r--r--libavcodec/proresdsp.h3
-rw-r--r--libavcodec/proresenc_kostya.c19
-rw-r--r--libavcodec/x86/proresdsp_init.c4
-rw-r--r--libavcodec/x86/simple_idct10_template.asm2
5 files changed, 18 insertions, 16 deletions
diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
index 82d6009b58..5b5ada21fe 100644
--- a/libavcodec/proresdsp.c
+++ b/libavcodec/proresdsp.c
@@ -36,11 +36,11 @@
/**
* Add bias value, clamp and output pixels of a slice
*/
-static void put_pixels(uint16_t *dst, int stride, const int16_t *in)
+static void put_pixels(uint16_t *dst, ptrdiff_t linesize, const int16_t *in)
{
int x, y, src_offset, dst_offset;
- for (y = 0, dst_offset = 0; y < 8; y++, dst_offset += stride) {
+ for (y = 0, dst_offset = 0; y < 8; y++, dst_offset += linesize) {
for (x = 0; x < 8; x++) {
src_offset = (y << 3) + x;
@@ -49,7 +49,7 @@ static void put_pixels(uint16_t *dst, int stride, const int16_t *in)
}
}
-static void prores_idct_put_c(uint16_t *out, int linesize, int16_t *block, const int16_t *qmat)
+static void prores_idct_put_c(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat)
{
ff_prores_idct(block, qmat);
put_pixels(out, linesize >> 1, block);
diff --git a/libavcodec/proresdsp.h b/libavcodec/proresdsp.h
index 159862ec3d..558fae53bf 100644
--- a/libavcodec/proresdsp.h
+++ b/libavcodec/proresdsp.h
@@ -23,6 +23,7 @@
#ifndef AVCODEC_PRORESDSP_H
#define AVCODEC_PRORESDSP_H
+#include <stddef.h>
#include <stdint.h>
#include "avcodec.h"
@@ -31,7 +32,7 @@
typedef struct ProresDSPContext {
int idct_permutation_type;
uint8_t idct_permutation[64];
- void (* idct_put) (uint16_t *out, int linesize, int16_t *block, const int16_t *qmat);
+ void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);
} ProresDSPContext;
void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx);
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index 3bc1d5d772..090dfa5c0a 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -196,7 +196,7 @@ typedef struct ProresContext {
const uint8_t *scantable;
void (*fdct)(FDCTDSPContext *fdsp, const uint16_t *src,
- int linesize, int16_t *block);
+ ptrdiff_t linesize, int16_t *block);
FDCTDSPContext fdsp;
const AVFrame *pic;
@@ -227,13 +227,13 @@ typedef struct ProresContext {
} ProresContext;
static void get_slice_data(ProresContext *ctx, const uint16_t *src,
- int linesize, int x, int y, int w, int h,
+ ptrdiff_t linesize, int x, int y, int w, int h,
int16_t *blocks, uint16_t *emu_buf,
int mbs_per_slice, int blocks_per_mb, int is_chroma)
{
const uint16_t *esrc;
const int mb_width = 4 * blocks_per_mb;
- int elinesize;
+ ptrdiff_t elinesize;
int i, j, k;
for (i = 0; i < mbs_per_slice; i++, src += mb_width) {
@@ -298,7 +298,7 @@ static void get_slice_data(ProresContext *ctx, const uint16_t *src,
}
static void get_alpha_data(ProresContext *ctx, const uint16_t *src,
- int linesize, int x, int y, int w, int h,
+ ptrdiff_t linesize, int x, int y, int w, int h,
int16_t *blocks, int mbs_per_slice, int abits)
{
const int slice_width = 16 * mbs_per_slice;
@@ -421,7 +421,7 @@ static void encode_acs(PutBitContext *pb, int16_t *blocks,
}
static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb,
- const uint16_t *src, int linesize,
+ const uint16_t *src, ptrdiff_t linesize,
int mbs_per_slice, int16_t *blocks,
int blocks_per_mb, int plane_size_factor,
const int16_t *qmat)
@@ -514,7 +514,8 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
int total_size = 0;
const uint16_t *src;
int slice_width_factor = av_log2(mbs_per_slice);
- int num_cblocks, pwidth, linesize, line_add;
+ int num_cblocks, pwidth, line_add;
+ ptrdiff_t linesize;
int plane_factor, is_chroma;
uint16_t *qmat;
@@ -670,7 +671,7 @@ static int estimate_acs(int *error, int16_t *blocks, int blocks_per_slice,
}
static int estimate_slice_plane(ProresContext *ctx, int *error, int plane,
- const uint16_t *src, int linesize,
+ const uint16_t *src, ptrdiff_t linesize,
int mbs_per_slice,
int blocks_per_mb, int plane_size_factor,
const int16_t *qmat, ProresThreadData *td)
@@ -703,7 +704,7 @@ static int est_alpha_diff(int cur, int prev, int abits)
}
static int estimate_alpha_plane(ProresContext *ctx, int *error,
- const uint16_t *src, int linesize,
+ const uint16_t *src, ptrdiff_t linesize,
int mbs_per_slice, int quant,
int16_t *blocks)
{
@@ -1103,7 +1104,7 @@ static av_cold int encode_close(AVCodecContext *avctx)
}
static void prores_fdct(FDCTDSPContext *fdsp, const uint16_t *src,
- int linesize, int16_t *block)
+ ptrdiff_t linesize, int16_t *block)
{
int x, y;
const uint16_t *tsrc = src;
diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c
index ead11ae9c1..8ca4d4d9b3 100644
--- a/libavcodec/x86/proresdsp_init.c
+++ b/libavcodec/x86/proresdsp_init.c
@@ -25,9 +25,9 @@
#include "libavcodec/idctdsp.h"
#include "libavcodec/proresdsp.h"
-void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
+void ff_prores_idct_put_10_sse2(uint16_t *dst, ptrdiff_t linesize,
int16_t *block, const int16_t *qmat);
-void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize,
+void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize,
int16_t *block, const int16_t *qmat);
av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
diff --git a/libavcodec/x86/simple_idct10_template.asm b/libavcodec/x86/simple_idct10_template.asm
index e5deb0f2e2..9d323d99b3 100644
--- a/libavcodec/x86/simple_idct10_template.asm
+++ b/libavcodec/x86/simple_idct10_template.asm
@@ -211,7 +211,7 @@
SUMSUB_SHPK m2, m3, m4, m5, m6, m7, %2
%endmacro
-; void ff_prores_idct_put_10_<opt>(uint8_t *pixels, int stride,
+; void ff_prores_idct_put_10_<opt>(uint8_t *pixels, ptrdiff_t stride,
; int16_t *block, const int16_t *qmat);
; %1 = row shift