Merge commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7'

* commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7':
  hevc: 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:49:09 -03:00
commit 1e18548826
3 changed files with 15 additions and 15 deletions

View File

@ -1283,11 +1283,11 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
HEVCLocalContext *lc = s->HEVClc; HEVCLocalContext *lc = s->HEVClc;
GetBitContext gb; GetBitContext gb;
int cb_size = 1 << log2_cb_size; 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)]; 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)]; 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)]; 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 + 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 || if (x_off < QPEL_EXTRA_BEFORE || y_off < QPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - QPEL_EXTRA_AFTER || x_off >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off >= pic_height - block_h - 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 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); 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 || if (x_off0 < QPEL_EXTRA_BEFORE || y_off0 < QPEL_EXTRA_AFTER ||
x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER || x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off0 >= pic_height - block_h - 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 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); 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 || if (x_off1 < QPEL_EXTRA_BEFORE || y_off1 < QPEL_EXTRA_AFTER ||
x_off1 >= pic_width - block_w - QPEL_EXTRA_AFTER || x_off1 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off1 >= pic_height - block_h - 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 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); int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);

View File

@ -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, 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; 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, static void copy_vert(uint8_t *dst, const uint8_t *src,
int pixel_shift, int height, int pixel_shift, int height,
int stride_dst, int stride_src) ptrdiff_t stride_dst, ptrdiff_t stride_src)
{ {
int i; int i;
if (pixel_shift == 0) { 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, 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 c_idx, int x_ctb, int y_ctb)
{ {
int sh = s->ps.sps->pixel_shift; 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++) { 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 x0 = x >> s->ps.sps->hshift[c_idx];
int y0 = y >> s->ps.sps->vshift[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_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 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 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 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]; 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)]; 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; uint8_t *dst;
switch (sao->type_idx[c_idx]) { switch (sao->type_idx[c_idx]) {

View File

@ -393,8 +393,8 @@ static void FUNC(sao_edge_restore_0)(uint8_t *_dst, uint8_t *_src,
} }
if (borders[3]) { if (borders[3]) {
int offset_val = sao_offset_val[0]; int offset_val = sao_offset_val[0];
int y_stride_dst = stride_dst * (height - 1); ptrdiff_t y_stride_dst = stride_dst * (height - 1);
int y_stride_src = stride_src * (height - 1); ptrdiff_t y_stride_src = stride_src * (height - 1);
for (x = init_x; x < width; x++) for (x = init_x; x < width; x++)
dst[x + y_stride_dst] = av_clip_pixel(src[x + y_stride_src] + offset_val); dst[x + y_stride_dst] = av_clip_pixel(src[x + y_stride_src] + offset_val);
height--; height--;
@ -444,8 +444,8 @@ static void FUNC(sao_edge_restore_1)(uint8_t *_dst, uint8_t *_src,
} }
if (borders[3]) { if (borders[3]) {
int offset_val = sao_offset_val[0]; int offset_val = sao_offset_val[0];
int y_stride_dst = stride_dst * (height - 1); ptrdiff_t y_stride_dst = stride_dst * (height - 1);
int y_stride_src = stride_src * (height - 1); ptrdiff_t y_stride_src = stride_src * (height - 1);
for (x = init_x; x < width; x++) for (x = init_x; x < width; x++)
dst[x + y_stride_dst] = av_clip_pixel(src[x + y_stride_src] + offset_val); dst[x + y_stride_dst] = av_clip_pixel(src[x + y_stride_src] + offset_val);
height--; height--;