Merge commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22'

* commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22':
  mss*: Change type of array stride parameters to ptrdiff_t

Merged-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2017-03-21 15:57:07 -03:00
commit a0478341f3
9 changed files with 50 additions and 46 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 };

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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 */

View File

@ -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];