mirror of https://git.ffmpeg.org/ffmpeg.git
dsputil: Merge variable declarations and initializations
This commit is contained in:
parent
bb12c2e9c0
commit
635ec127d4
|
@ -106,21 +106,18 @@ static const uint8_t idct_sse2_row_perm[8] = { 0, 4, 1, 5, 2, 6, 3, 7 };
|
||||||
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st,
|
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st,
|
||||||
const uint8_t *src_scantable)
|
const uint8_t *src_scantable)
|
||||||
{
|
{
|
||||||
int i;
|
int i, end;
|
||||||
int end;
|
|
||||||
|
|
||||||
st->scantable = src_scantable;
|
st->scantable = src_scantable;
|
||||||
|
|
||||||
for (i = 0; i < 64; i++) {
|
for (i = 0; i < 64; i++) {
|
||||||
int j;
|
int j = src_scantable[i];
|
||||||
j = src_scantable[i];
|
|
||||||
st->permutated[i] = permutation[j];
|
st->permutated[i] = permutation[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
end = -1;
|
end = -1;
|
||||||
for (i = 0; i < 64; i++) {
|
for (i = 0; i < 64; i++) {
|
||||||
int j;
|
int j = st->permutated[i];
|
||||||
j = st->permutated[i];
|
|
||||||
if (j > end)
|
if (j > end)
|
||||||
end = j;
|
end = j;
|
||||||
st->raster_end[i] = end;
|
st->raster_end[i] = end;
|
||||||
|
@ -165,9 +162,8 @@ av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation,
|
||||||
|
|
||||||
static int pix_sum_c(uint8_t *pix, int line_size)
|
static int pix_sum_c(uint8_t *pix, int line_size)
|
||||||
{
|
{
|
||||||
int s, i, j;
|
int s = 0, i, j;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
for (j = 0; j < 16; j += 8) {
|
for (j = 0; j < 16; j += 8) {
|
||||||
s += pix[0];
|
s += pix[0];
|
||||||
|
@ -187,10 +183,9 @@ static int pix_sum_c(uint8_t *pix, int line_size)
|
||||||
|
|
||||||
static int pix_norm1_c(uint8_t *pix, int line_size)
|
static int pix_norm1_c(uint8_t *pix, int line_size)
|
||||||
{
|
{
|
||||||
int s, i, j;
|
int s = 0, i, j;
|
||||||
uint32_t *sq = ff_squareTbl + 256;
|
uint32_t *sq = ff_squareTbl + 256;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
for (j = 0; j < 16; j += 8) {
|
for (j = 0; j < 16; j += 8) {
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -259,10 +254,9 @@ static void bswap16_buf(uint16_t *dst, const uint16_t *src, int len)
|
||||||
|
|
||||||
static int sse4_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
|
static int sse4_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
uint32_t *sq = ff_squareTbl + 256;
|
uint32_t *sq = ff_squareTbl + 256;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += sq[pix1[0] - pix2[0]];
|
s += sq[pix1[0] - pix2[0]];
|
||||||
s += sq[pix1[1] - pix2[1]];
|
s += sq[pix1[1] - pix2[1]];
|
||||||
|
@ -276,10 +270,9 @@ static int sse4_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
|
||||||
|
|
||||||
static int sse8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
|
static int sse8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
uint32_t *sq = ff_squareTbl + 256;
|
uint32_t *sq = ff_squareTbl + 256;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += sq[pix1[0] - pix2[0]];
|
s += sq[pix1[0] - pix2[0]];
|
||||||
s += sq[pix1[1] - pix2[1]];
|
s += sq[pix1[1] - pix2[1]];
|
||||||
|
@ -297,10 +290,9 @@ static int sse8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
|
||||||
|
|
||||||
static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
|
static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
uint32_t *sq = ff_squareTbl + 256;
|
uint32_t *sq = ff_squareTbl + 256;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += sq[pix1[0] - pix2[0]];
|
s += sq[pix1[0] - pix2[0]];
|
||||||
s += sq[pix1[1] - pix2[1]];
|
s += sq[pix1[1] - pix2[1]];
|
||||||
|
@ -498,12 +490,12 @@ void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
|
||||||
vx = ox;
|
vx = ox;
|
||||||
vy = oy;
|
vy = oy;
|
||||||
for (x = 0; x < 8; x++) { // FIXME: optimize
|
for (x = 0; x < 8; x++) { // FIXME: optimize
|
||||||
int src_x, src_y, frac_x, frac_y, index;
|
int index;
|
||||||
|
int src_x = vx >> 16;
|
||||||
|
int src_y = vy >> 16;
|
||||||
|
int frac_x = src_x & (s - 1);
|
||||||
|
int frac_y = src_y & (s - 1);
|
||||||
|
|
||||||
src_x = vx >> 16;
|
|
||||||
src_y = vy >> 16;
|
|
||||||
frac_x = src_x & (s - 1);
|
|
||||||
frac_y = src_y & (s - 1);
|
|
||||||
src_x >>= shift;
|
src_x >>= shift;
|
||||||
src_y >>= shift;
|
src_y >>= shift;
|
||||||
|
|
||||||
|
@ -1644,9 +1636,8 @@ static void put_mspel8_mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||||
static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
int line_size, int h)
|
int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += abs(pix1[0] - pix2[0]);
|
s += abs(pix1[0] - pix2[0]);
|
||||||
s += abs(pix1[1] - pix2[1]);
|
s += abs(pix1[1] - pix2[1]);
|
||||||
|
@ -1673,9 +1664,8 @@ static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
static int pix_abs16_x2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
static int pix_abs16_x2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
int line_size, int h)
|
int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
|
s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
|
||||||
s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
|
s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
|
||||||
|
@ -1702,10 +1692,9 @@ static int pix_abs16_x2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
int line_size, int h)
|
int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
uint8_t *pix3 = pix2 + line_size;
|
uint8_t *pix3 = pix2 + line_size;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
|
s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
|
||||||
s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
|
s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
|
||||||
|
@ -1733,10 +1722,9 @@ static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
int line_size, int h)
|
int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
uint8_t *pix3 = pix2 + line_size;
|
uint8_t *pix3 = pix2 + line_size;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
|
s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
|
||||||
s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
|
s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
|
||||||
|
@ -1764,9 +1752,8 @@ static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
static inline int pix_abs8_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
static inline int pix_abs8_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
int line_size, int h)
|
int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += abs(pix1[0] - pix2[0]);
|
s += abs(pix1[0] - pix2[0]);
|
||||||
s += abs(pix1[1] - pix2[1]);
|
s += abs(pix1[1] - pix2[1]);
|
||||||
|
@ -1785,9 +1772,8 @@ static inline int pix_abs8_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
static int pix_abs8_x2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
static int pix_abs8_x2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
int line_size, int h)
|
int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
|
s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
|
||||||
s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
|
s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
|
||||||
|
@ -1806,10 +1792,9 @@ static int pix_abs8_x2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
int line_size, int h)
|
int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
uint8_t *pix3 = pix2 + line_size;
|
uint8_t *pix3 = pix2 + line_size;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
|
s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
|
||||||
s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
|
s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
|
||||||
|
@ -1829,10 +1814,9 @@ static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
int line_size, int h)
|
int line_size, int h)
|
||||||
{
|
{
|
||||||
int s, i;
|
int s = 0, i;
|
||||||
uint8_t *pix3 = pix2 + line_size;
|
uint8_t *pix3 = pix2 + line_size;
|
||||||
|
|
||||||
s = 0;
|
|
||||||
for (i = 0; i < h; i++) {
|
for (i = 0; i < h; i++) {
|
||||||
s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
|
s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
|
||||||
s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
|
s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
|
||||||
|
@ -1852,9 +1836,7 @@ static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2,
|
||||||
static int nsse16_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h)
|
static int nsse16_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h)
|
||||||
{
|
{
|
||||||
MpegEncContext *c = v;
|
MpegEncContext *c = v;
|
||||||
int score1 = 0;
|
int score1 = 0, score2 = 0, x, y;
|
||||||
int score2 = 0;
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
for (y = 0; y < h; y++) {
|
for (y = 0; y < h; y++) {
|
||||||
for (x = 0; x < 16; x++)
|
for (x = 0; x < 16; x++)
|
||||||
|
@ -1879,9 +1861,7 @@ static int nsse16_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h)
|
||||||
static int nsse8_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h)
|
static int nsse8_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h)
|
||||||
{
|
{
|
||||||
MpegEncContext *c = v;
|
MpegEncContext *c = v;
|
||||||
int score1 = 0;
|
int score1 = 0, score2 = 0, x, y;
|
||||||
int score2 = 0;
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
for (y = 0; y < h; y++) {
|
for (y = 0; y < h; y++) {
|
||||||
for (x = 0; x < 8; x++)
|
for (x = 0; x < 8; x++)
|
||||||
|
@ -2109,12 +2089,7 @@ static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src,
|
||||||
int w, int *red, int *green,
|
int w, int *red, int *green,
|
||||||
int *blue, int *alpha)
|
int *blue, int *alpha)
|
||||||
{
|
{
|
||||||
int i;
|
int i, r = *red, g = *green, b = *blue, a = *alpha;
|
||||||
int r, g, b, a;
|
|
||||||
r = *red;
|
|
||||||
g = *green;
|
|
||||||
b = *blue;
|
|
||||||
a = *alpha;
|
|
||||||
|
|
||||||
for (i = 0; i < w; i++) {
|
for (i = 0; i < w; i++) {
|
||||||
b += src[4 * i + B];
|
b += src[4 * i + B];
|
||||||
|
@ -2156,9 +2131,7 @@ static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src,
|
||||||
static int hadamard8_diff8x8_c(/* MpegEncContext */ void *s, uint8_t *dst,
|
static int hadamard8_diff8x8_c(/* MpegEncContext */ void *s, uint8_t *dst,
|
||||||
uint8_t *src, int stride, int h)
|
uint8_t *src, int stride, int h)
|
||||||
{
|
{
|
||||||
int i;
|
int i, temp[64], sum = 0;
|
||||||
int temp[64];
|
|
||||||
int sum = 0;
|
|
||||||
|
|
||||||
assert(h == 8);
|
assert(h == 8);
|
||||||
|
|
||||||
|
@ -2210,9 +2183,7 @@ static int hadamard8_diff8x8_c(/* MpegEncContext */ void *s, uint8_t *dst,
|
||||||
static int hadamard8_intra8x8_c(/* MpegEncContext */ void *s, uint8_t *src,
|
static int hadamard8_intra8x8_c(/* MpegEncContext */ void *s, uint8_t *src,
|
||||||
uint8_t *dummy, int stride, int h)
|
uint8_t *dummy, int stride, int h)
|
||||||
{
|
{
|
||||||
int i;
|
int i, temp[64], sum = 0;
|
||||||
int temp[64];
|
|
||||||
int sum = 0;
|
|
||||||
|
|
||||||
assert(h == 8);
|
assert(h == 8);
|
||||||
|
|
||||||
|
@ -2308,8 +2279,7 @@ static int dct264_sad8x8_c(/* MpegEncContext */ void *c, uint8_t *src1,
|
||||||
{
|
{
|
||||||
MpegEncContext *const s = (MpegEncContext *) c;
|
MpegEncContext *const s = (MpegEncContext *) c;
|
||||||
int16_t dct[8][8];
|
int16_t dct[8][8];
|
||||||
int i;
|
int i, sum = 0;
|
||||||
int sum = 0;
|
|
||||||
|
|
||||||
s->dsp.diff_pixels(dct[0], src1, src2, stride);
|
s->dsp.diff_pixels(dct[0], src1, src2, stride);
|
||||||
|
|
||||||
|
@ -2384,8 +2354,7 @@ static int rd8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, uint8_t *src2,
|
||||||
LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]);
|
LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]);
|
||||||
int i, last, run, bits, level, distortion, start_i;
|
int i, last, run, bits, level, distortion, start_i;
|
||||||
const int esc_length = s->ac_esc_length;
|
const int esc_length = s->ac_esc_length;
|
||||||
uint8_t *length;
|
uint8_t *length, *last_length;
|
||||||
uint8_t *last_length;
|
|
||||||
|
|
||||||
assert(h == 8);
|
assert(h == 8);
|
||||||
|
|
||||||
|
@ -2461,8 +2430,7 @@ static int bit8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, uint8_t *src2,
|
||||||
LOCAL_ALIGNED_16(int16_t, temp, [64]);
|
LOCAL_ALIGNED_16(int16_t, temp, [64]);
|
||||||
int i, last, run, bits, level, start_i;
|
int i, last, run, bits, level, start_i;
|
||||||
const int esc_length = s->ac_esc_length;
|
const int esc_length = s->ac_esc_length;
|
||||||
uint8_t *length;
|
uint8_t *length, *last_length;
|
||||||
uint8_t *last_length;
|
|
||||||
|
|
||||||
assert(h == 8);
|
assert(h == 8);
|
||||||
|
|
||||||
|
@ -2521,8 +2489,7 @@ static int vsad_intra ## size ## _c(/* MpegEncContext */ void *c, \
|
||||||
uint8_t *s, uint8_t *dummy, \
|
uint8_t *s, uint8_t *dummy, \
|
||||||
int stride, int h) \
|
int stride, int h) \
|
||||||
{ \
|
{ \
|
||||||
int score = 0; \
|
int score = 0, x, y; \
|
||||||
int x, y; \
|
|
||||||
\
|
\
|
||||||
for (y = 1; y < h; y++) { \
|
for (y = 1; y < h; y++) { \
|
||||||
for (x = 0; x < size; x += 4) { \
|
for (x = 0; x < size; x += 4) { \
|
||||||
|
@ -2542,8 +2509,7 @@ VSAD_INTRA(16)
|
||||||
static int vsad16_c(/* MpegEncContext */ void *c, uint8_t *s1, uint8_t *s2,
|
static int vsad16_c(/* MpegEncContext */ void *c, uint8_t *s1, uint8_t *s2,
|
||||||
int stride, int h)
|
int stride, int h)
|
||||||
{
|
{
|
||||||
int score = 0;
|
int score = 0, x, y;
|
||||||
int x, y;
|
|
||||||
|
|
||||||
for (y = 1; y < h; y++) {
|
for (y = 1; y < h; y++) {
|
||||||
for (x = 0; x < 16; x++)
|
for (x = 0; x < 16; x++)
|
||||||
|
@ -2561,8 +2527,7 @@ static int vsse_intra ## size ## _c(/* MpegEncContext */ void *c, \
|
||||||
uint8_t *s, uint8_t *dummy, \
|
uint8_t *s, uint8_t *dummy, \
|
||||||
int stride, int h) \
|
int stride, int h) \
|
||||||
{ \
|
{ \
|
||||||
int score = 0; \
|
int score = 0, x, y; \
|
||||||
int x, y; \
|
|
||||||
\
|
\
|
||||||
for (y = 1; y < h; y++) { \
|
for (y = 1; y < h; y++) { \
|
||||||
for (x = 0; x < size; x += 4) { \
|
for (x = 0; x < size; x += 4) { \
|
||||||
|
@ -2582,8 +2547,7 @@ VSSE_INTRA(16)
|
||||||
static int vsse16_c(/* MpegEncContext */ void *c, uint8_t *s1, uint8_t *s2,
|
static int vsse16_c(/* MpegEncContext */ void *c, uint8_t *s1, uint8_t *s2,
|
||||||
int stride, int h)
|
int stride, int h)
|
||||||
{
|
{
|
||||||
int score = 0;
|
int score = 0, x, y;
|
||||||
int x, y;
|
|
||||||
|
|
||||||
for (y = 1; y < h; y++) {
|
for (y = 1; y < h; y++) {
|
||||||
for (x = 0; x < 16; x++)
|
for (x = 0; x < 16; x++)
|
||||||
|
@ -2598,8 +2562,7 @@ static int vsse16_c(/* MpegEncContext */ void *c, uint8_t *s1, uint8_t *s2,
|
||||||
static int ssd_int8_vs_int16_c(const int8_t *pix1, const int16_t *pix2,
|
static int ssd_int8_vs_int16_c(const int8_t *pix1, const int16_t *pix2,
|
||||||
int size)
|
int size)
|
||||||
{
|
{
|
||||||
int score = 0;
|
int score = 0, i;
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
score += (pix1[i] - pix2[i]) * (pix1[i] - pix2[i]);
|
score += (pix1[i] - pix2[i]) * (pix1[i] - pix2[i]);
|
||||||
|
|
|
@ -36,11 +36,10 @@ static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, i
|
||||||
{
|
{
|
||||||
pixel *buf = (pixel*)_buf;
|
pixel *buf = (pixel*)_buf;
|
||||||
int wrap = _wrap / sizeof(pixel);
|
int wrap = _wrap / sizeof(pixel);
|
||||||
pixel *ptr, *last_line;
|
pixel *ptr = buf, *last_line;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* left and right */
|
/* left and right */
|
||||||
ptr = buf;
|
|
||||||
for(i=0;i<height;i++) {
|
for(i=0;i<height;i++) {
|
||||||
memset(ptr - w, ptr[0], w);
|
memset(ptr - w, ptr[0], w);
|
||||||
memset(ptr + width, ptr[width-1], w);
|
memset(ptr + width, ptr[width-1], w);
|
||||||
|
|
Loading…
Reference in New Issue