remove compile warnings, remove unused code

This commit is contained in:
c0ntrol
2018-09-22 20:59:49 +02:00
parent f5d242f15f
commit f08c29b5ec
6 changed files with 79 additions and 241 deletions

View File

@@ -79,10 +79,10 @@ static void split_fib_downscale(VJFrame *frame, int width, int height)
{ {
for (x = 0; x < width; x++) for (x = 0; x < width; x++)
{ {
i++; i++;
f = (i + 1) + (i - 1); f = (i + 1) + (i - 1);
if( f >= ilen ) break; if( f >= ilen ) break;
Y[y + x] = Y[f]; Y[y + x] = Y[f];
} }
} }
@@ -92,11 +92,11 @@ static void split_fib_downscale(VJFrame *frame, int width, int height)
for (y = 0; y < uv_len; y += uv_width) for (y = 0; y < uv_len; y += uv_width)
{ {
for (x = 0; x < uv_width; x++) { for (x = 0; x < uv_width; x++) {
i++; i++;
f = (i + 1) + (i - 1); f = (i + 1) + (i - 1);
if( f >= uv_len ) break; if( f >= uv_len ) break;
Cb[y + x] = Cb[f]; Cb[y + x] = Cb[f];
Cr[y + x] = Cr[f]; Cr[y + x] = Cr[f];
} }
} }
@@ -117,91 +117,11 @@ static void split_fib_downscaleb(VJFrame *frame, int width, int height)
Y + len, Y + len,
Cb + uv_len, Cb + uv_len,
Cr + uv_len, Cr + uv_len,
NULL }; NULL };
vj_frame_copy( frame->data, output, strides ); vj_frame_copy( frame->data, output, strides );
} }
static void dosquarefib(VJFrame *frame, int width, int height)
{
int i, len = frame->len / 2;
int f;
int x, y, y1, y2;
int uv_len = frame->uv_len;
int uv_width = frame->uv_width;
const unsigned int uv_height = frame->uv_height;
unsigned int w3 = width >> 2;
const unsigned int u_w3 = w3 >> frame->shift_h;
const unsigned int muv_len = frame->uv_len;
uint8_t *Y = frame->data[0];
uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2];
i = 0;
for (y = 0; y < len; y += width)
{
for (x = 0; x < width; x++) {
i++;
f = (i + 1) + (i - 1);
split_buf[0][y + x] = Y[f];
}
}
i = 0;
for (y = 0; y < uv_len; y += uv_width) {
for (x = 0; x < uv_width; x++) {
i++;
f = (i + 1) + (i - 1);
if(f > muv_len) break;
// split_buf[0][y + x] = Y[f];
split_buf[1][y + x] = Cb[f];
split_buf[2][y + x] = Cr[f];
}
}
len = len >> 1;
width = width >> 1;
for (y = 0; y < len; y += width) {
for (x = 0; x < width; x++) {
i++;
f = (i + 1) + (i - 1);
split_buf[0][y + x] = split_buf[0][f];
// split_buf[0][y + x] = split_buf[1][f];
// split_buf[0][y + x] = split_buf[2][f];
}
}
uv_len = uv_len >> 1;
uv_width = uv_width >> 1;
for (y = 0; y < uv_len; y += uv_width) {
for (x = 0; x < uv_width; x++) {
i++;
f = (i + 1) + (i - 1);
if(f > muv_len) break;
split_buf[1][y + x] = split_buf[1][f];
split_buf[2][y + x] = split_buf[2][f];
}
}
for (y = 0; y < height; y++) {
y1 = (y * width) >> 1;
y2 = y * width;
for (i = 0; i < 4; i++)
for (x = 0; x < w3; x++) {
Y[y2 + x + (i * w3)] = split_buf[0][y1 + x];
}
}
for (y = 0; y < uv_height; y++) {
y1 = (y * uv_width) >> 1;
y2 = y * uv_width;
for (i = 0; i < 4; i++)
for (x = 0; x < u_w3; x++) {
Y[y2 + x + (i * u_w3)] = split_buf[0][y1 + x];
}
}
}
static void split_push_downscale_uh(VJFrame *frame, int width, int height) static void split_push_downscale_uh(VJFrame *frame, int width, int height)
{ {
int len = frame->len/2; int len = frame->len/2;
@@ -210,45 +130,6 @@ static void split_push_downscale_uh(VJFrame *frame, int width, int height)
} }
static void split_push_downscale_lh(VJFrame *frame, int width, int height)
{
unsigned int x, y, y1, y2, j = 0;
int hlen = height / 2;
const int uv_width = frame->uv_width;
const int uv_height = frame->uv_height;
const int uv_hlen = frame->uv_len / 2;
uint8_t *Y = frame->data[0];
uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2];
for (y = 0; y < height; y+=2)
{
j++;
y2 = j * width;
y1 = y * width;
for (x = 0; x < width; x++) {
split_buf[0][y2 + x] = Y[y1 + x];
}
}
j = 0;
for (y = 0; y < uv_height; y+=2) {
j++;
y2 = j * uv_width;
y1 = y * uv_width;
for (x = 0; x < uv_width; x++) {
split_buf[1][y2 + x] = Cb[y1 + x];
split_buf[2][y2 + x] = Cr[y1 + x];
}
}
int strides[4] = { hlen, uv_hlen, uv_hlen,0 };
uint8_t *input[4] = { Y + hlen, Cb + uv_hlen, Cr + uv_hlen, NULL };
vj_frame_copy( split_buf, input, strides );
}
static void split_push_vscale_left(VJFrame *frame, int width, int height) static void split_push_vscale_left(VJFrame *frame, int width, int height)
{ {
unsigned int x, y, y1; unsigned int x, y, y1;
@@ -266,7 +147,7 @@ static void split_push_vscale_left(VJFrame *frame, int width, int height)
y1 = y * width; y1 = y * width;
for (x = 0; x < wlen; x++) for (x = 0; x < wlen; x++)
{ {
split_buf[0][y1 + x] = Y[y1 + (x << 1)]; split_buf[0][y1 + x] = Y[y1 + (x << 1)];
} }
} }
@@ -275,8 +156,8 @@ static void split_push_vscale_left(VJFrame *frame, int width, int height)
y1 = y * uv_width; y1 = y * uv_width;
for (x = 0; x < uv_wlen; x++) for (x = 0; x < uv_wlen; x++)
{ {
split_buf[1][y1 + x] = Cb[y1 + (x << 1)]; split_buf[1][y1 + x] = Cb[y1 + (x << 1)];
split_buf[2][y1 + x] = Cr[y1 + (x << 1)]; split_buf[2][y1 + x] = Cr[y1 + (x << 1)];
} }
} }
@@ -286,15 +167,15 @@ static void split_push_vscale_left(VJFrame *frame, int width, int height)
y1 = y * width; y1 = y * width;
for (x = 0; x < wlen; x++) for (x = 0; x < wlen; x++)
{ {
Y[y1 + x] = split_buf[0][y1 + x]; Y[y1 + x] = split_buf[0][y1 + x];
} }
} }
for (y = 0; y < uv_height; y++) { for (y = 0; y < uv_height; y++) {
y1 = y * uv_width; y1 = y * uv_width;
for (x = 0; x < uv_wlen; x++) { for (x = 0; x < uv_wlen; x++) {
Cb[y1 + x] = split_buf[1][y1 + x]; Cb[y1 + x] = split_buf[1][y1 + x];
Cr[y1 + x] = split_buf[2][y1 + x]; Cr[y1 + x] = split_buf[2][y1 + x];
} }
} }
@@ -316,35 +197,35 @@ static void split_push_vscale_right(VJFrame *frame, int width, int height)
for (y = 0; y < height; y++) { for (y = 0; y < height; y++) {
y1 = y * width; y1 = y * width;
for (x = 0; x < wlen; x++) { for (x = 0; x < wlen; x++) {
split_buf[0][y1 + x] = Y[y1 + (x * 2)]; split_buf[0][y1 + x] = Y[y1 + (x * 2)];
} }
} }
for (y = 0; y < uv_height; y++) { for (y = 0; y < uv_height; y++) {
y1 = y * uv_width; y1 = y * uv_width;
for (x = 0; x < uv_wlen; x++) { for (x = 0; x < uv_wlen; x++) {
split_buf[1][y1 + x] = Cb[y1 + (x * 2)]; split_buf[1][y1 + x] = Cb[y1 + (x * 2)];
split_buf[2][y1 + x] = Cr[y1 + (x * 2)]; split_buf[2][y1 + x] = Cr[y1 + (x * 2)];
} }
} }
for (y = 0; y < height; y++) { for (y = 0; y < height; y++) {
y1 = y * width; y1 = y * width;
for (x = 0; x < wlen; x++) { for (x = 0; x < wlen; x++) {
Y[y1 + x + wlen] = split_buf[0][y1 + x]; Y[y1 + x + wlen] = split_buf[0][y1 + x];
} }
} }
for (y = 0; y < uv_height; y++) { for (y = 0; y < uv_height; y++) {
y1 = y * uv_width; y1 = y * uv_width;
for (x = 0; x < uv_wlen; x++) { for (x = 0; x < uv_wlen; x++) {
Cb[y1 + x + uv_wlen] = split_buf[1][y1 + x]; Cb[y1 + x + uv_wlen] = split_buf[1][y1 + x];
Cr[y1 + x + uv_wlen] = split_buf[2][y1 + x]; Cr[y1 + x + uv_wlen] = split_buf[2][y1 + x];
} }
} }
} }
static void split_corner_framedata_ul(VJFrame *frame, VJFrame *frame2, static void split_corner_framedata_ul(VJFrame *frame, VJFrame *frame2,
int width, int height) int width, int height)
{ {
unsigned int w_len = width / 2; unsigned int w_len = width / 2;
unsigned int h_len = height / 2; unsigned int h_len = height / 2;
@@ -357,20 +238,20 @@ static void split_corner_framedata_ul(VJFrame *frame, VJFrame *frame2,
uint8_t *Cb= frame->data[1]; uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2]; uint8_t *Cr= frame->data[2];
uint8_t *Y2 = frame2->data[0]; uint8_t *Y2 = frame2->data[0];
uint8_t *Cb2= frame2->data[1]; uint8_t *Cb2= frame2->data[1];
uint8_t *Cr2= frame2->data[2]; uint8_t *Cr2= frame2->data[2];
for (y = 0; y < h_len; y++) { for (y = 0; y < h_len; y++) {
y1 = width * y; y1 = width * y;
for (x = 0; x < w_len; x++) { for (x = 0; x < w_len; x++) {
Y[y1 + x] = Y2[y1 + x]; Y[y1 + x] = Y2[y1 + x];
} }
} }
for (y = 0; y < uv_hlen; y++) { for (y = 0; y < uv_hlen; y++) {
y1 = uv_width * y; y1 = uv_width * y;
for (x = 0; x < uv_wlen; x++) { for (x = 0; x < uv_wlen; x++) {
Cb[y1 + x] = Cb2[y1 + x]; Cb[y1 + x] = Cb2[y1 + x];
Cr[y1 + x] = Cr2[y1 + x]; Cr[y1 + x] = Cr2[y1 + x];
} }
} }
@@ -378,7 +259,7 @@ static void split_corner_framedata_ul(VJFrame *frame, VJFrame *frame2,
} }
static void split_corner_framedata_ur(VJFrame *frame, VJFrame *frame2, static void split_corner_framedata_ur(VJFrame *frame, VJFrame *frame2,
int width, int height) int width, int height)
{ {
unsigned int w_len = width / 2; unsigned int w_len = width / 2;
unsigned int h_len = height / 2; unsigned int h_len = height / 2;
@@ -387,36 +268,31 @@ static void split_corner_framedata_ur(VJFrame *frame, VJFrame *frame2,
const int uv_width = frame->uv_width; const int uv_width = frame->uv_width;
const int uv_wlen = frame->uv_width / 2; const int uv_wlen = frame->uv_width / 2;
const int uv_hlen = frame->uv_height / 2; const int uv_hlen = frame->uv_height / 2;
uint8_t *Y = frame->data[0]; uint8_t *Y = frame->data[0];
uint8_t *Cb= frame->data[1]; uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2]; uint8_t *Cr= frame->data[2];
uint8_t *Y2 = frame2->data[0]; uint8_t *Y2 = frame2->data[0];
uint8_t *Cb2= frame2->data[1]; uint8_t *Cb2= frame2->data[1];
uint8_t *Cr2= frame2->data[2]; uint8_t *Cr2= frame2->data[2];
for (y = 0; y < h_len; y++) { for (y = 0; y < h_len; y++) {
y1 = width * y; y1 = width * y;
for (x = w_len; x < width; x++) { for (x = w_len; x < width; x++) {
Y[y1 + x] = Y2[y1 + x]; Y[y1 + x] = Y2[y1 + x];
// Cb[y1 + x] = Cb2[y1 + x];
// Cr[y1 + x] = Cr2[y1 + x];
} }
} }
for (y = 0; y < uv_hlen; y++) { for (y = 0; y < uv_hlen; y++) {
y1 = uv_width * y; y1 = uv_width * y;
for (x = uv_wlen; x < uv_width; x++) { for (x = uv_wlen; x < uv_width; x++) {
// Y[y1 + x] = Y2[y1 + x]; Cb[y1 + x] = Cb2[y1 + x];
Cb[y1 + x] = Cb2[y1 + x]; Cr[y1 + x] = Cr2[y1 + x];
Cr[y1 + x] = Cr2[y1 + x];
} }
} }
} }
static void split_corner_framedata_dl(VJFrame *frame, VJFrame *frame2, static void split_corner_framedata_dl(VJFrame *frame, VJFrame *frame2,
int width, int height) int width, int height)
{ {
unsigned int w_len = width / 2; unsigned int w_len = width / 2;
unsigned int h_len = height / 2; unsigned int h_len = height / 2;
@@ -430,23 +306,21 @@ static void split_corner_framedata_dl(VJFrame *frame, VJFrame *frame2,
uint8_t *Cb= frame->data[1]; uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2]; uint8_t *Cr= frame->data[2];
uint8_t *Y2 = frame2->data[0]; uint8_t *Y2 = frame2->data[0];
uint8_t *Cb2= frame2->data[1]; uint8_t *Cb2= frame2->data[1];
uint8_t *Cr2= frame2->data[2]; uint8_t *Cr2= frame2->data[2];
for (y = h_len; y < height; y++) { for (y = h_len; y < height; y++) {
y1 = width * y; y1 = width * y;
for (x = 0; x < w_len; x++) { for (x = 0; x < w_len; x++) {
Y[y1 + x] = Y2[y1 + x]; Y[y1 + x] = Y2[y1 + x];
// Cb[y1 + x] = Cb2[y1 + x];
// Cr[y1 + x] = Cr2[y1 + x];
} }
} }
for (y = uv_hlen; y < uv_height; y++) { for (y = uv_hlen; y < uv_height; y++) {
y1 = uv_width * y; y1 = uv_width * y;
for (x = 0; x < uv_wlen; x++) { for (x = 0; x < uv_wlen; x++) {
Cb[y1 + x] = Cb2[y1 + x]; Cb[y1 + x] = Cb2[y1 + x];
Cr[y1 + x] = Cr2[y1 + x]; Cr[y1 + x] = Cr2[y1 + x];
} }
} }
@@ -454,7 +328,7 @@ static void split_corner_framedata_dl(VJFrame *frame, VJFrame *frame2,
static void split_corner_framedata_dr(VJFrame *frame, VJFrame *frame2, static void split_corner_framedata_dr(VJFrame *frame, VJFrame *frame2,
int width, int height) int width, int height)
{ {
unsigned int w_len = width / 2; unsigned int w_len = width / 2;
unsigned int h_len = height / 2; unsigned int h_len = height / 2;
@@ -464,27 +338,25 @@ static void split_corner_framedata_dr(VJFrame *frame, VJFrame *frame2,
const int uv_width = frame->uv_width; const int uv_width = frame->uv_width;
const int uv_wlen = frame->uv_width / 2; const int uv_wlen = frame->uv_width / 2;
const int uv_hlen = frame->uv_height / 2; const int uv_hlen = frame->uv_height / 2;
uint8_t *Y = frame->data[0]; uint8_t *Y = frame->data[0];
uint8_t *Cb= frame->data[1]; uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2]; uint8_t *Cr= frame->data[2];
uint8_t *Y2 = frame2->data[0]; uint8_t *Y2 = frame2->data[0];
uint8_t *Cb2= frame2->data[1]; uint8_t *Cb2= frame2->data[1];
uint8_t *Cr2= frame2->data[2]; uint8_t *Cr2= frame2->data[2];
for (y = h_len; y < height; y++) { for (y = h_len; y < height; y++) {
y1 = width * y; y1 = width * y;
for (x = w_len; x < width; x++) { for (x = w_len; x < width; x++) {
Y[y1 + x] = Y2[y1 + x]; Y[y1 + x] = Y2[y1 + x];
// Cb[y1 + x] = Cb2[y1 + x];
// Cr[y1 + x] = Cr2[y1 + x];
} }
} }
for (y = uv_hlen; y < uv_height; y++) { for (y = uv_hlen; y < uv_height; y++) {
y1 = uv_width * y; y1 = uv_width * y;
for (x = uv_wlen; x < uv_width; x++) { for (x = uv_wlen; x < uv_width; x++) {
Cb[y1 + x] = Cb2[y1 + x]; Cb[y1 + x] = Cb2[y1 + x];
Cr[y1 + x] = Cr2[y1 + x]; Cr[y1 + x] = Cr2[y1 + x];
} }
} }
@@ -503,21 +375,19 @@ static void split_v_first_halfs(VJFrame *frame, VJFrame *frame2, int width,
uint8_t *Cb= frame->data[1]; uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2]; uint8_t *Cr= frame->data[2];
uint8_t *Y2 = frame2->data[0]; uint8_t *Y2 = frame2->data[0];
uint8_t *Cb2= frame2->data[1]; uint8_t *Cb2= frame2->data[1];
uint8_t *Cr2= frame2->data[2]; uint8_t *Cr2= frame2->data[2];
for (r = 0; r < (width * height); r += width) { for (r = 0; r < (width * height); r += width) {
for (c = width / 2; c < width; c++) { for (c = width / 2; c < width; c++) {
Y[c + r] = Y2[(width - c) + r]; Y[c + r] = Y2[(width - c) + r];
// Cb[c + r] = Cb2[(width - c) + r];
// Cr[c + r] = Cr2[(width - c) + r];
} }
} }
for (r = 0; r < uv_len; r += uv_width) { for (r = 0; r < uv_len; r += uv_width) {
for (c = uv_width/2; c < uv_width; c++) { for (c = uv_width/2; c < uv_width; c++) {
Cb[c + r] = Cb2[(uv_width - c) + r]; Cb[c + r] = Cb2[(uv_width - c) + r];
Cr[c + r] = Cr2[(uv_width - c) + r]; Cr[c + r] = Cr2[(uv_width - c) + r];
} }
} }
@@ -540,18 +410,15 @@ static void split_v_second_half(VJFrame *frame, VJFrame *frame2, int width,
for (r = 0; r < (width * height); r += width) { for (r = 0; r < (width * height); r += width) {
for (c = width / 2; c < width; c++) { for (c = width / 2; c < width; c++) {
Y[c + r] = Y2[c + r]; Y[c + r] = Y2[c + r];
// Cb[c + r] = Cb2[c + r];
// Cr[c + r] = Cr2[c + r];
} }
} }
for (r = 0; r < uv_len; r += uv_width) { for (r = 0; r < uv_len; r += uv_width) {
for (c = uv_width / 2; c < uv_width; c++) { for (c = uv_width / 2; c < uv_width; c++) {
// Y[c + r] = Y2[c + r]; Cb[c + r] = Cb2[c + r];
Cb[c + r] = Cb2[c + r]; Cr[c + r] = Cr2[c + r];
Cr[c + r] = Cr2[c + r];
} }
} }
} }
@@ -568,23 +435,20 @@ static void split_v_first_half(VJFrame *frame, VJFrame *frame2, int width,
uint8_t *Cb= frame->data[1]; uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2]; uint8_t *Cr= frame->data[2];
uint8_t *Y2 = frame2->data[0]; uint8_t *Y2 = frame2->data[0];
uint8_t *Cb2= frame2->data[1]; uint8_t *Cb2= frame2->data[1];
uint8_t *Cr2= frame2->data[2]; uint8_t *Cr2= frame2->data[2];
for (r = 0; r < (width * height); r += width) { for (r = 0; r < (width * height); r += width) {
for (c = 0; c < width / 2; c++) { for (c = 0; c < width / 2; c++) {
Y[c + r] = Y2[c + r]; Y[c + r] = Y2[c + r];
// Cb[c + r] = Cb2[c + r];
// Cr[c + r] = Cr2[c + r];
} }
} }
for (r = 0; r < uv_len; r += uv_width) { for (r = 0; r < uv_len; r += uv_width) {
for (c = 0; c < uv_width / 2; c++) { for (c = 0; c < uv_width / 2; c++) {
// Y[c + r] = Y2[c + r]; Cb[c + r] = Cb2[c + r];
Cb[c + r] = Cb2[c + r]; Cr[c + r] = Cr2[c + r];
Cr[c + r] = Cr2[c + r];
} }
} }
@@ -604,23 +468,20 @@ static void split_v_second_halfs(VJFrame *frame, VJFrame *frame2, int width,
uint8_t *Cb= frame->data[1]; uint8_t *Cb= frame->data[1];
uint8_t *Cr= frame->data[2]; uint8_t *Cr= frame->data[2];
uint8_t *Y2 = frame2->data[0]; uint8_t *Y2 = frame2->data[0];
uint8_t *Cb2= frame2->data[1]; uint8_t *Cb2= frame2->data[1];
uint8_t *Cr2= frame2->data[2]; uint8_t *Cr2= frame2->data[2];
for (r = 0; r < len; r += width) { for (r = 0; r < len; r += width) {
for (c = 0; c < lw; c++) { for (c = 0; c < lw; c++) {
Y[c + r] = Y2[(width - c) + r]; Y[c + r] = Y2[(width - c) + r];
// Cb[c + r] = Cb2[(width - c) + r];
// Cr[c + r] = Cr2[(width - c) + r];
} }
} }
for (r = 0; r < uv_len; r += uv_width) { for (r = 0; r < uv_len; r += uv_width) {
for (c = 0; c < (uv_width/2); c++) { for (c = 0; c < (uv_width/2); c++) {
// Y[c + r] = Y2[(width - c) + r]; Cb[c + r] = Cb2[(width - c) + r];
Cb[c + r] = Cb2[(width - c) + r]; Cr[c + r] = Cr2[(width - c) + r];
Cr[c + r] = Cr2[(width - c) + r];
} }
} }
@@ -629,8 +490,8 @@ static void split_v_second_halfs(VJFrame *frame, VJFrame *frame2, int width,
static void split_h_first_half(VJFrame *frame, VJFrame *frame2, int width, static void split_h_first_half(VJFrame *frame, VJFrame *frame2, int width,
int height) int height)
{ {
const int len = frame->len / 2; const int len = frame->len / 2;
const int uv_len = frame->uv_len / 2; const int uv_len = frame->uv_len / 2;
int strides[4] = { len,uv_len,uv_len, 0 }; int strides[4] = { len,uv_len,uv_len, 0 };
vj_frame_copy( frame2->data, frame->data, strides ); vj_frame_copy( frame2->data, frame->data, strides );
@@ -668,63 +529,59 @@ void split_apply(VJFrame *frame, VJFrame *frame2, int n, int swap)
switch (n) { switch (n) {
case 0: case 0:
if (swap) if (swap)
split_push_downscale_uh(frame2, frame->width, frame->height); split_push_downscale_uh(frame2, frame->width, frame->height);
split_h_first_half(frame, frame2, frame->width, frame->height); split_h_first_half(frame, frame2, frame->width, frame->height);
break; break;
case 1: case 1:
//if (swap)
// split_push_downscale_lh(frame2, frame->width, frame->height);
split_h_second_half(frame, frame2, frame->width, frame->height); split_h_second_half(frame, frame2, frame->width, frame->height);
break; break;
case 2: case 2:
//if (swap)
// split_push_downscale_lh(frame2, frame->width, frame->height);
/**/ split_h_first_halfs(frame, frame2, frame->width, frame->height); /**/ split_h_first_halfs(frame, frame2, frame->width, frame->height);
break; break;
case 3: case 3:
if (swap) if (swap)
split_push_downscale_uh(frame2, frame->width, frame->height); split_push_downscale_uh(frame2, frame->width, frame->height);
/**/ split_h_second_halfs(frame, frame2, frame->width, frame->height); /**/ split_h_second_halfs(frame, frame2, frame->width, frame->height);
break; break;
case 4: case 4:
if (swap) if (swap)
split_push_vscale_left(frame2, frame->width, frame->height); split_push_vscale_left(frame2, frame->width, frame->height);
/**/ split_v_first_half(frame, frame2, frame->width, frame->height); /**/ split_v_first_half(frame, frame2, frame->width, frame->height);
break; break;
case 5: case 5:
if (swap) if (swap)
split_push_vscale_right(frame2, frame->width, frame->height); split_push_vscale_right(frame2, frame->width, frame->height);
/**/ split_v_second_half(frame, frame2, frame->width, frame->height); /**/ split_v_second_half(frame, frame2, frame->width, frame->height);
break; break;
case 6: case 6:
if (swap) if (swap)
split_push_vscale_left(frame2, frame->width, frame->height); split_push_vscale_left(frame2, frame->width, frame->height);
/**/ split_v_first_halfs(frame, frame2, frame->width, frame->height); /**/ split_v_first_halfs(frame, frame2, frame->width, frame->height);
break; break;
case 7: case 7:
//if (swap) if (swap)
split_push_vscale_right(frame2, frame->width, frame->height); split_push_vscale_right(frame2, frame->width, frame->height);
// split_v_second_halfs(frame, frame2, frame->width, frame->height); split_v_second_halfs(frame, frame2, frame->width, frame->height);
break; break;
case 8: case 8:
if (swap) if (swap)
split_fib_downscale(frame2, frame->width, frame->height); split_fib_downscale(frame2, frame->width, frame->height);
split_corner_framedata_ul(frame, frame2, frame->width, frame->height); split_corner_framedata_ul(frame, frame2, frame->width, frame->height);
break; break;
case 9: case 9:
if (swap) if (swap)
split_fib_downscale(frame2, frame->width, frame->height); split_fib_downscale(frame2, frame->width, frame->height);
split_corner_framedata_ur(frame, frame2, frame->width, frame->height); split_corner_framedata_ur(frame, frame2, frame->width, frame->height);
break; break;
case 10: case 10:
if (swap) if (swap)
split_fib_downscaleb(frame2, frame->width, frame->height); split_fib_downscaleb(frame2, frame->width, frame->height);
split_corner_framedata_dr(frame, frame2, frame->width, frame->height); split_corner_framedata_dr(frame, frame2, frame->width, frame->height);
break; break;
case 11: case 11:
if (swap) if (swap)
split_fib_downscaleb(frame2, frame->width, frame->height); split_fib_downscaleb(frame2, frame->width, frame->height);
/**/ split_corner_framedata_dl(frame, frame2, frame->width, frame->height); /**/ split_corner_framedata_dl(frame, frame2, frame->width, frame->height);
break; break;
case 12: case 12:

View File

@@ -114,25 +114,6 @@ static int get_cache_line_size()
return ret; return ret;
} }
#ifdef ARCH_X86
static void mymemset_generic(void * s, char c,size_t count)
{
int d0, d1;
__asm__ __volatile__(
"rep\n\t"
"stosb"
: "=&c" (d0), "=&D" (d1)
:"a" (c),"1" (s),"0" (count)
:"memory");
}
#else
static void mymemset_generic(void *s, char c, size_t cc )
{
memset(s,c,cc);
}
#endif
int cpu_cache_size() int cpu_cache_size()
{ {
return CACHE_LINE_SIZE; return CACHE_LINE_SIZE;

View File

@@ -576,13 +576,13 @@ int vj_client_send(vj_client *v, int sock_type,unsigned char *buf) {
int len = strlen( (const char*)buf); int len = strlen( (const char*)buf);
int ret = -1; int ret = -1;
char *blob = (char*) vj_malloc(sizeof(char) * (len + HDR_LEN)); unsigned char *blob = (unsigned char*) vj_malloc(sizeof(unsigned char) * (len + HDR_LEN));
if(!blob) { if(!blob) {
veejay_msg(0, "Out of memory" ); veejay_msg(0, "Out of memory" );
return -1; return -1;
} }
sprintf( blob, "V%03dD", len ); sprintf( (char*) blob, "V%03dD", len );
memcpy( blob + HDR_LEN, buf, len ); memcpy( blob + HDR_LEN, buf, len );
if( v->mcast ) { if( v->mcast ) {

View File

@@ -31,7 +31,7 @@
#include <libvjnet/vj-client.h> #include <libvjnet/vj-client.h>
#include <veejay/vj-share.h> #include <veejay/vj-share.h>
#include <veejay/vj-shm.h> #include <veejay/vj-shm.h>
static vj_client *vj_share_connect(const char *hostname, int port) static vj_client *vj_share_connect(char *hostname, int port)
{ {
vj_client *c = vj_client_alloc( 0,0,0 ); vj_client *c = vj_client_alloc( 0,0,0 );
if(!c) return NULL; if(!c) return NULL;
@@ -79,7 +79,7 @@ static void vj_flush(vj_client *sayvims,int frames) {
} }
} }
int32_t vj_share_pull_master( void *shm, const char *master_host, int master_port ) int32_t vj_share_pull_master( void *shm, char *master_host, int master_port )
{ {
char tmp[64]; char tmp[64];
vj_client *c = vj_share_connect( master_host, master_port ); vj_client *c = vj_share_connect( master_host, master_port );

View File

@@ -18,7 +18,7 @@
*/ */
#ifndef VJSHARE #ifndef VJSHARE
#define VJSHARE #define VJSHARE
int32_t vj_share_pull_master( void *shm, const char *master_host, int master_port ); int32_t vj_share_pull_master( void *shm, char *master_host, int master_port );
int vj_share_get_info( char *host, int port, int *width, int *height, int *format, int *key, int screen_id ); int vj_share_get_info( char *host, int port, int *width, int *height, int *format, int *key, int screen_id );
int vj_share_start_slave( char *host, int port, int shm_id); int vj_share_start_slave( char *host, int port, int shm_id);

View File

@@ -364,7 +364,7 @@ void *vj_shm_new_master( const char *homedir, VJFrame *frame)
pthread_rwlockattr_t rw_lock_attr; pthread_rwlockattr_t rw_lock_attr;
veejay_memset( v->sms, 0, size ); veejay_memset( v->sms, 0, size );
uint8_t *sms_addr = (const uint8_t*) v->sms; uint8_t *sms_addr = (uint8_t*) v->sms;
uint8_t *Y = sms_addr + HEADER_LENGTH; uint8_t *Y = sms_addr + HEADER_LENGTH;
uint8_t *U = Y + frame->len; uint8_t *U = Y + frame->len;