Commit bb3ad401 authored by Clément Bœsch's avatar Clément Bœsch

Merge commit '746c56b7'

* commit '746c56b7':
  indeo: Change type of array pitch parameters to ptrdiff_t
Merged-by: 's avatarClément Bœsch <u@pkh.me>
parents 38352832 746c56b7
......@@ -66,7 +66,7 @@ typedef struct Plane {
uint8_t *pixels[2]; ///< pointer to the actual pixel data of the buffers above
uint32_t width;
uint32_t height;
uint32_t pitch;
ptrdiff_t pitch;
} Plane;
#define CELL_STACK_MAX 20
......@@ -166,7 +166,8 @@ static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
AVCodecContext *avctx, int luma_width, int luma_height)
{
int p, chroma_width, chroma_height;
int luma_pitch, chroma_pitch, luma_size, chroma_size;
int luma_size, chroma_size;
ptrdiff_t luma_pitch, chroma_pitch;
if (luma_width < 16 || luma_width > 640 ||
luma_height < 16 || luma_height > 480 ||
......@@ -425,7 +426,7 @@ if (*data_ptr >= last_ptr) \
static int decode_cell_data(Indeo3DecodeContext *ctx, Cell *cell,
uint8_t *block, uint8_t *ref_block,
int pitch, int h_zoom, int v_zoom, int mode,
ptrdiff_t row_offset, int h_zoom, int v_zoom, int mode,
const vqEntry *delta[2], int swap_quads[2],
const uint8_t **data_ptr, const uint8_t *last_ptr)
{
......@@ -436,9 +437,8 @@ static int decode_cell_data(Indeo3DecodeContext *ctx, Cell *cell,
unsigned int dyad1, dyad2;
uint64_t pix64;
int skip_flag = 0, is_top_of_cell, is_first_row = 1;
int row_offset, blk_row_offset, line_offset;
int blk_row_offset, line_offset;
row_offset = pitch;
blk_row_offset = (row_offset << (2 + v_zoom)) - (cell->width << 2);
line_offset = v_zoom ? row_offset : 0;
......@@ -1025,11 +1025,11 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
* @param[in] dst_height output plane height
*/
static void output_plane(const Plane *plane, int buf_sel, uint8_t *dst,
int dst_pitch, int dst_height)
ptrdiff_t dst_pitch, int dst_height)
{
int x,y;
const uint8_t *src = plane->pixels[buf_sel];
uint32_t pitch = plane->pitch;
ptrdiff_t pitch = plane->pitch;
dst_height = FFMIN(dst_height, plane->height);
for (y = 0; y < dst_height; y++) {
......
......@@ -74,10 +74,10 @@ static VLC ivi_mb_vlc_tabs [8]; ///< static macroblock Huffman tables
static VLC ivi_blk_vlc_tabs[8]; ///< static block Huffman tables
typedef void (*ivi_mc_func) (int16_t *buf, const int16_t *ref_buf,
uint32_t pitch, int mc_type);
ptrdiff_t pitch, int mc_type);
typedef void (*ivi_mc_avg_func) (int16_t *buf, const int16_t *ref_buf1,
const int16_t *ref_buf2,
uint32_t pitch, int mc_type, int mc_type2);
ptrdiff_t pitch, int mc_type, int mc_type2);
static int ivi_mc(IVIBandDesc *band, ivi_mc_func mc, ivi_mc_avg_func mc_avg,
int offs, int mv_x, int mv_y, int mv_x2, int mv_y2,
......@@ -903,11 +903,11 @@ static uint16_t ivi_calc_band_checksum(IVIBandDesc *band)
* @param[out] dst pointer to the buffer receiving converted pixels
* @param[in] dst_pitch pitch for moving to the next y line
*/
static void ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch)
static void ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, ptrdiff_t dst_pitch)
{
int x, y;
const int16_t *src = plane->bands[0].buf;
uint32_t pitch = plane->bands[0].pitch;
ptrdiff_t pitch = plane->bands[0].pitch;
if (!src)
return;
......
......@@ -87,8 +87,8 @@ extern const uint8_t ff_ivi_direct_scan_4x4[16];
/**
* Declare inverse transform function types
*/
typedef void (InvTransformPtr)(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
typedef void (DCTransformPtr) (const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
typedef void (InvTransformPtr)(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags);
typedef void (DCTransformPtr) (const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size);
/**
......@@ -153,7 +153,7 @@ typedef struct IVIBandDesc {
int16_t *ref_buf; ///< pointer to the reference frame buffer (for motion compensation)
int16_t *b_ref_buf; ///< pointer to the second reference frame buffer (for motion compensation)
int16_t *bufs[4]; ///< array of pointers to the band buffers
int pitch; ///< pitch associated with the buffers above
ptrdiff_t pitch; ///< pitch associated with the buffers above
int is_empty; ///< = 1 if this band doesn't contain any data
int mb_size; ///< macroblock size
int blk_size; ///< block size
......
......@@ -31,13 +31,13 @@
#include "ivi_dsp.h"
void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
const int dst_pitch)
const ptrdiff_t dst_pitch)
{
int x, y, indx;
int32_t p0, p1, p2, p3, tmp0, tmp1, tmp2;
int32_t b0_1, b0_2, b1_1, b1_2, b1_3, b2_1, b2_2, b2_3, b2_4, b2_5, b2_6;
int32_t b3_1, b3_2, b3_3, b3_4, b3_5, b3_6, b3_7, b3_8, b3_9;
int32_t pitch, back_pitch;
ptrdiff_t pitch, back_pitch;
const short *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
const int num_bands = 4;
......@@ -188,11 +188,11 @@ void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
}
void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
const int dst_pitch)
const ptrdiff_t dst_pitch)
{
int x, y, indx, b0, b1, b2, b3, p0, p1, p2, p3;
const short *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
int32_t pitch;
ptrdiff_t pitch;
/* all bands should have the same pitch */
pitch = plane->bands[0].pitch;
......@@ -267,7 +267,7 @@ void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
d3 = COMPENSATE(t2);\
d4 = COMPENSATE(t3); }
void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch,
const uint8_t *flags)
{
int i, shift, sp1, sp2, sp3, sp4;
......@@ -322,7 +322,7 @@ void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
#undef COMPENSATE
}
void ff_ivi_row_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_row_haar8(const int32_t *in, int16_t *out, ptrdiff_t pitch,
const uint8_t *flags)
{
int i;
......@@ -347,7 +347,7 @@ void ff_ivi_row_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
#undef COMPENSATE
}
void ff_ivi_col_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_col_haar8(const int32_t *in, int16_t *out, ptrdiff_t pitch,
const uint8_t *flags)
{
int i;
......@@ -376,7 +376,7 @@ void ff_ivi_col_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
#undef COMPENSATE
}
void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, ptrdiff_t pitch,
const uint8_t *flags)
{
int i, shift, sp1, sp2;
......@@ -423,7 +423,7 @@ void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
#undef COMPENSATE
}
void ff_ivi_row_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_row_haar4(const int32_t *in, int16_t *out, ptrdiff_t pitch,
const uint8_t *flags)
{
int i;
......@@ -445,7 +445,7 @@ void ff_ivi_row_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
#undef COMPENSATE
}
void ff_ivi_col_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_col_haar4(const int32_t *in, int16_t *out, ptrdiff_t pitch,
const uint8_t *flags)
{
int i;
......@@ -469,7 +469,7 @@ void ff_ivi_col_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
#undef COMPENSATE
}
void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, ptrdiff_t pitch,
int blk_size)
{
int x, y;
......@@ -533,7 +533,7 @@ void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
d3 = COMPENSATE(t3);\
d4 = COMPENSATE(t4);}
void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
{
int i;
const int32_t *src;
......@@ -573,7 +573,7 @@ void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, c
#undef COMPENSATE
}
void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
{
int i;
const int32_t *src;
......@@ -613,7 +613,7 @@ void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, c
#undef COMPENSATE
}
void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
{
int x, y;
int16_t dc_coeff;
......@@ -626,7 +626,7 @@ void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk
}
}
void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
void ff_ivi_row_slant8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
{
int i;
int t0, t1, t2, t3, t4, t5, t6, t7, t8;
......@@ -646,7 +646,7 @@ void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const ui
#undef COMPENSATE
}
void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
{
int x, y;
int16_t dc_coeff;
......@@ -664,7 +664,7 @@ void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int bl
}
}
void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
void ff_ivi_col_slant8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
{
int i, row2, row4, row8;
int t0, t1, t2, t3, t4, t5, t6, t7, t8;
......@@ -691,7 +691,7 @@ void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const ui
#undef COMPENSATE
}
void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
{
int x, y;
int16_t dc_coeff;
......@@ -705,7 +705,7 @@ void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int bl
}
}
void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
void ff_ivi_row_slant4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
{
int i;
int t0, t1, t2, t3, t4;
......@@ -725,7 +725,7 @@ void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const ui
#undef COMPENSATE
}
void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
void ff_ivi_col_slant4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
{
int i, row2;
int t0, t1, t2, t3, t4;
......@@ -748,7 +748,7 @@ void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const ui
#undef COMPENSATE
}
void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch,
const uint8_t *flags)
{
int x, y;
......@@ -758,7 +758,7 @@ void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
out[x] = in[x];
}
void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch,
int blk_size)
{
int y;
......@@ -773,9 +773,9 @@ void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
#define IVI_MC_TEMPLATE(size, suffix, OP) \
static void ivi_mc_ ## size ##x## size ## suffix(int16_t *buf, \
uint32_t dpitch, \
ptrdiff_t dpitch, \
const int16_t *ref_buf, \
uint32_t pitch, int mc_type) \
ptrdiff_t pitch, int mc_type) \
{ \
int i, j; \
const int16_t *wptr; \
......@@ -809,7 +809,7 @@ static void ivi_mc_ ## size ##x## size ## suffix(int16_t *buf, \
} \
\
void ff_ivi_mc_ ## size ##x## size ## suffix(int16_t *buf, const int16_t *ref_buf, \
uint32_t pitch, int mc_type) \
ptrdiff_t pitch, int mc_type) \
{ \
ivi_mc_ ## size ##x## size ## suffix(buf, pitch, ref_buf, pitch, mc_type); \
} \
......@@ -818,7 +818,7 @@ void ff_ivi_mc_ ## size ##x## size ## suffix(int16_t *buf, const int16_t *ref_bu
void ff_ivi_mc_avg_ ## size ##x## size ## suffix(int16_t *buf, \
const int16_t *ref_buf, \
const int16_t *ref_buf2, \
uint32_t pitch, \
ptrdiff_t pitch, \
int mc_type, int mc_type2) \
{ \
int16_t tmp[size * size]; \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment