mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 06:10:01 +01:00
remove compile warnings, remove unused code
This commit is contained in:
@@ -122,86 +122,6 @@ static void split_fib_downscaleb(VJFrame *frame, int width, int height)
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
unsigned int x, y, y1;
|
||||
@@ -398,18 +279,13 @@ static void split_corner_framedata_ur(VJFrame *frame, VJFrame *frame2,
|
||||
y1 = width * y;
|
||||
for (x = w_len; x < width; 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++) {
|
||||
y1 = uv_width * y;
|
||||
for (x = uv_wlen; x < uv_width; x++) {
|
||||
// Y[y1 + x] = Y2[y1 + x];
|
||||
Cb[y1 + x] = Cb2[y1 + x];
|
||||
Cr[y1 + x] = Cr2[y1 + x];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,8 +314,6 @@ static void split_corner_framedata_dl(VJFrame *frame, VJFrame *frame2,
|
||||
y1 = width * y;
|
||||
for (x = 0; x < w_len; 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++) {
|
||||
@@ -476,8 +350,6 @@ static void split_corner_framedata_dr(VJFrame *frame, VJFrame *frame2,
|
||||
y1 = width * y;
|
||||
for (x = w_len; x < width; 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++) {
|
||||
@@ -510,8 +382,6 @@ static void split_v_first_halfs(VJFrame *frame, VJFrame *frame2, int width,
|
||||
for (r = 0; r < (width * height); r += width) {
|
||||
for (c = width / 2; c < width; c++) {
|
||||
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) {
|
||||
@@ -541,15 +411,12 @@ static void split_v_second_half(VJFrame *frame, VJFrame *frame2, int width,
|
||||
for (r = 0; r < (width * height); r += width) {
|
||||
for (c = width / 2; c < width; c++) {
|
||||
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 (c = uv_width / 2; c < uv_width; c++) {
|
||||
// Y[c + r] = Y2[c + r];
|
||||
Cb[c + r] = Cb2[c + r];
|
||||
Cr[c + r] = Cr2[c + r];
|
||||
}
|
||||
@@ -575,14 +442,11 @@ static void split_v_first_half(VJFrame *frame, VJFrame *frame2, int width,
|
||||
for (r = 0; r < (width * height); r += width) {
|
||||
for (c = 0; c < width / 2; c++) {
|
||||
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 (c = 0; c < uv_width / 2; c++) {
|
||||
// Y[c + r] = Y2[c + r];
|
||||
Cb[c + r] = Cb2[c + r];
|
||||
Cr[c + r] = Cr2[c + r];
|
||||
}
|
||||
@@ -611,14 +475,11 @@ static void split_v_second_halfs(VJFrame *frame, VJFrame *frame2, int width,
|
||||
for (r = 0; r < len; r += width) {
|
||||
for (c = 0; c < lw; c++) {
|
||||
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 (c = 0; c < (uv_width/2); c++) {
|
||||
// Y[c + r] = Y2[(width - c) + r];
|
||||
Cb[c + r] = Cb2[(width - c) + r];
|
||||
Cr[c + r] = Cr2[(width - c) + r];
|
||||
}
|
||||
@@ -672,13 +533,9 @@ void split_apply(VJFrame *frame, VJFrame *frame2, int n, int swap)
|
||||
split_h_first_half(frame, frame2, frame->width, frame->height);
|
||||
break;
|
||||
case 1:
|
||||
//if (swap)
|
||||
// split_push_downscale_lh(frame2, frame->width, frame->height);
|
||||
split_h_second_half(frame, frame2, frame->width, frame->height);
|
||||
break;
|
||||
case 2:
|
||||
//if (swap)
|
||||
// split_push_downscale_lh(frame2, frame->width, frame->height);
|
||||
/**/ split_h_first_halfs(frame, frame2, frame->width, frame->height);
|
||||
break;
|
||||
case 3:
|
||||
@@ -703,9 +560,9 @@ void split_apply(VJFrame *frame, VJFrame *frame2, int n, int swap)
|
||||
break;
|
||||
|
||||
case 7:
|
||||
//if (swap)
|
||||
if (swap)
|
||||
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;
|
||||
case 8:
|
||||
if (swap)
|
||||
|
||||
@@ -114,25 +114,6 @@ static int get_cache_line_size()
|
||||
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()
|
||||
{
|
||||
return CACHE_LINE_SIZE;
|
||||
|
||||
@@ -576,13 +576,13 @@ int vj_client_send(vj_client *v, int sock_type,unsigned char *buf) {
|
||||
|
||||
int len = strlen( (const char*)buf);
|
||||
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) {
|
||||
veejay_msg(0, "Out of memory" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
sprintf( blob, "V%03dD", len );
|
||||
sprintf( (char*) blob, "V%03dD", len );
|
||||
memcpy( blob + HDR_LEN, buf, len );
|
||||
|
||||
if( v->mcast ) {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <libvjnet/vj-client.h>
|
||||
#include <veejay/vj-share.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 );
|
||||
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];
|
||||
vj_client *c = vj_share_connect( master_host, master_port );
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
#ifndef 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_start_slave( char *host, int port, int shm_id);
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ void *vj_shm_new_master( const char *homedir, VJFrame *frame)
|
||||
|
||||
pthread_rwlockattr_t rw_lock_attr;
|
||||
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 *U = Y + frame->len;
|
||||
|
||||
Reference in New Issue
Block a user