|
|
|
@ -57,7 +57,7 @@ static void add_8x8basis_c(int16_t rem[64], const int16_t basis[64], int scale) |
|
|
|
|
(BASIS_SHIFT - RECON_SHIFT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static int pix_sum_c(const uint8_t *pix, int line_size) |
|
|
|
|
static int pix_sum_c(const uint8_t *pix, ptrdiff_t line_size) |
|
|
|
|
{ |
|
|
|
|
int s = 0, i, j; |
|
|
|
|
|
|
|
|
@ -78,7 +78,7 @@ static int pix_sum_c(const uint8_t *pix, int line_size) |
|
|
|
|
return s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static int pix_norm1_c(const uint8_t *pix, int line_size) |
|
|
|
|
static int pix_norm1_c(const uint8_t *pix, ptrdiff_t line_size) |
|
|
|
|
{ |
|
|
|
|
int s = 0, i, j; |
|
|
|
|
const uint32_t *sq = ff_square_tab + 256; |
|
|
|
@ -114,7 +114,7 @@ static int pix_norm1_c(const uint8_t *pix, int line_size) |
|
|
|
|
return s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static av_always_inline void draw_edges_lr(uint8_t *ptr, int wrap, int width, int height, int w) |
|
|
|
|
static av_always_inline void draw_edges_lr(uint8_t *ptr, ptrdiff_t wrap, int width, int height, int w) |
|
|
|
|
{ |
|
|
|
|
for (int i = 0; i < height; i++) { |
|
|
|
|
memset(ptr - w, ptr[0], w); |
|
|
|
@ -125,7 +125,7 @@ static av_always_inline void draw_edges_lr(uint8_t *ptr, int wrap, int width, in |
|
|
|
|
|
|
|
|
|
/* draw the edges of width 'w' of an image of size width, height */ |
|
|
|
|
// FIXME: Check that this is OK for MPEG-4 interlaced.
|
|
|
|
|
static void draw_edges_8_c(uint8_t *buf, int wrap, int width, int height, |
|
|
|
|
static void draw_edges_8_c(uint8_t *buf, ptrdiff_t wrap, int width, int height, |
|
|
|
|
int w, int h, int sides) |
|
|
|
|
{ |
|
|
|
|
uint8_t *last_line; |
|
|
|
@ -154,9 +154,18 @@ static void draw_edges_8_c(uint8_t *buf, int wrap, int width, int height, |
|
|
|
|
memcpy(last_line + (i + 1) * wrap, last_line, width + w + w); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* This wrapper function only serves to convert the stride parameters
|
|
|
|
|
* from ptrdiff_t to int for av_image_copy_plane(). */ |
|
|
|
|
static void copy_plane_wrapper(uint8_t *dst, ptrdiff_t dst_wrap, |
|
|
|
|
const uint8_t *src, ptrdiff_t src_wrap, |
|
|
|
|
int width, int height) |
|
|
|
|
{ |
|
|
|
|
av_image_copy_plane(dst, dst_wrap, src, src_wrap, width, height); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* 2x2 -> 1x1 */ |
|
|
|
|
static void shrink22(uint8_t *dst, int dst_wrap, |
|
|
|
|
const uint8_t *src, int src_wrap, |
|
|
|
|
static void shrink22(uint8_t *dst, ptrdiff_t dst_wrap, |
|
|
|
|
const uint8_t *src, ptrdiff_t src_wrap, |
|
|
|
|
int width, int height) |
|
|
|
|
{ |
|
|
|
|
int w; |
|
|
|
@ -188,8 +197,8 @@ static void shrink22(uint8_t *dst, int dst_wrap, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* 4x4 -> 1x1 */ |
|
|
|
|
static void shrink44(uint8_t *dst, int dst_wrap, |
|
|
|
|
const uint8_t *src, int src_wrap, |
|
|
|
|
static void shrink44(uint8_t *dst, ptrdiff_t dst_wrap, |
|
|
|
|
const uint8_t *src, ptrdiff_t src_wrap, |
|
|
|
|
int width, int height) |
|
|
|
|
{ |
|
|
|
|
int w; |
|
|
|
@ -219,8 +228,8 @@ static void shrink44(uint8_t *dst, int dst_wrap, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* 8x8 -> 1x1 */ |
|
|
|
|
static void shrink88(uint8_t *dst, int dst_wrap, |
|
|
|
|
const uint8_t *src, int src_wrap, |
|
|
|
|
static void shrink88(uint8_t *dst, ptrdiff_t dst_wrap, |
|
|
|
|
const uint8_t *src, ptrdiff_t src_wrap, |
|
|
|
|
int width, int height) |
|
|
|
|
{ |
|
|
|
|
int w, i; |
|
|
|
@ -247,7 +256,7 @@ av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, |
|
|
|
|
c->try_8x8basis = try_8x8basis_c; |
|
|
|
|
c->add_8x8basis = add_8x8basis_c; |
|
|
|
|
|
|
|
|
|
c->shrink[0] = av_image_copy_plane; |
|
|
|
|
c->shrink[0] = copy_plane_wrapper; |
|
|
|
|
c->shrink[1] = shrink22; |
|
|
|
|
c->shrink[2] = shrink44; |
|
|
|
|
c->shrink[3] = shrink88; |
|
|
|
|