mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-17 13:20:01 +01:00
fix many compile warnings
This commit is contained in:
@@ -132,6 +132,7 @@ uint64_t AVI_MAX_LEN = (UINT_MAX-(1<<20)*16-HEADERBYTES);
|
||||
uint64_t AVI_set_MAX_LEN( uint64_t n )
|
||||
{
|
||||
AVI_MAX_LEN = n;
|
||||
return n;
|
||||
}
|
||||
|
||||
uint64_t AVI_get_MAX_LEN()
|
||||
@@ -1041,7 +1042,7 @@ static int valid_info_tag(char *c)
|
||||
// returns the length of written stream (-1 on error)
|
||||
static int avi_parse_comments (int fd, char *buf, int space_left)
|
||||
{
|
||||
int len=0, readlen=0, k;
|
||||
int len=0, k;
|
||||
char *data, *c, *d;
|
||||
struct stat st;
|
||||
|
||||
@@ -1060,8 +1061,9 @@ static int avi_parse_comments (int fd, char *buf, int space_left)
|
||||
return -1;
|
||||
}
|
||||
|
||||
readlen = avi_read ( fd, data, st.st_size);
|
||||
|
||||
int readlen = avi_read ( fd, data, st.st_size);
|
||||
if( readlen < 0 )
|
||||
return -1;
|
||||
//printf("Read %d bytes from %d\n", readlen, fd);
|
||||
|
||||
c = data;
|
||||
|
||||
@@ -678,7 +678,6 @@ int lav_write_frame(lav_file_t *lav_file, uint8_t *buff, long size, long count)
|
||||
|
||||
int lav_write_audio(lav_file_t *lav_file, uint8_t *buff, long samps)
|
||||
{
|
||||
int res;
|
||||
#ifdef HAVE_LIBQUICKTIME
|
||||
int i, j;
|
||||
int16_t *qt_audio = (int16_t *)buff, **qt_audion;
|
||||
|
||||
@@ -1208,7 +1208,6 @@ int vj_el_get_video_frame(editlist *el, long nframe, uint8_t *dst[3])
|
||||
uint8_t *data = ( in_cache == NULL ? d->tmp_buffer: in_cache );
|
||||
int inter = 0;
|
||||
int got_picture = 0;
|
||||
int in_uv_len = 0;
|
||||
uint8_t *in[3] = { NULL,NULL,NULL };
|
||||
int strides[4] = { el_len_, el_uv_len_, el_uv_len_ ,0};
|
||||
uint8_t *dataplanes[3] = { data , data + el_len_, data + el_len_ + el_uv_len_ };
|
||||
@@ -1398,9 +1397,6 @@ int detect_pixel_format_with_ffmpeg( const char *filename )
|
||||
AVCodec *codec = NULL;
|
||||
AVCodecContext *codec_ctx = NULL;
|
||||
AVFormatContext *avformat_ctx = NULL;
|
||||
AVStream *avformat_stream = NULL;
|
||||
AVInputFormat *av_input_format = NULL;
|
||||
AVFrame *av_frame = NULL;
|
||||
AVPacket pkt;
|
||||
#if LIBAVCODEC_BUILD > 5400
|
||||
int err = avformat_open_input( &avformat_ctx, filename, NULL, NULL );
|
||||
@@ -1493,7 +1489,6 @@ further:
|
||||
}
|
||||
|
||||
codec_ctx = avformat_ctx->streams[vi]->codec;
|
||||
avformat_stream=avformat_ctx->streams[vi];
|
||||
#if LIBAVCODEC_BUILD > 5400
|
||||
if ( avcodec_open2( codec_ctx, codec, NULL ) < 0 )
|
||||
#else
|
||||
@@ -1507,7 +1502,6 @@ further:
|
||||
|
||||
veejay_memset( &pkt, 0, sizeof(AVPacket));
|
||||
AVFrame *f = avcodec_alloc_frame();
|
||||
int input_pix_fmt = -1;
|
||||
|
||||
int got_picture = 0;
|
||||
while( (av_read_frame(avformat_ctx, &pkt) >= 0 ) ) {
|
||||
@@ -1694,7 +1688,6 @@ int test_video_frame( lav_file_t *lav,int out_pix_fmt)
|
||||
|
||||
int vj_el_get_audio_frame(editlist *el, uint32_t nframe, uint8_t *dst)
|
||||
{
|
||||
long pos, asize;
|
||||
int ret = 0;
|
||||
uint64_t n;
|
||||
int ns0, ns1;
|
||||
@@ -1726,9 +1719,6 @@ int vj_el_get_audio_frame(editlist *el, uint32_t nframe, uint8_t *dst)
|
||||
ns1 = (double) (N_EL_FRAME(n) + 1) * el->audio_rate / el->video_fps;
|
||||
ns0 = (double) N_EL_FRAME(n) * el->audio_rate / el->video_fps;
|
||||
|
||||
//asize = el->audio_rate / el->video_fps;
|
||||
pos = nframe * asize;
|
||||
|
||||
ret = lav_set_audio_position(el->lav_fd[N_EL_FILE(n)], ns0);
|
||||
|
||||
if (ret < 0)
|
||||
@@ -1790,7 +1780,6 @@ int vj_el_init_422_frame(editlist *el, VJFrame *frame)
|
||||
int vj_el_get_audio_frame_at(editlist *el, uint32_t nframe, uint8_t *dst, int num )
|
||||
{
|
||||
// get audio from current frame + n frames
|
||||
long pos, asize;
|
||||
int ret = 0;
|
||||
uint64_t n;
|
||||
int ns0, ns1;
|
||||
@@ -1816,7 +1805,6 @@ int vj_el_get_audio_frame_at(editlist *el, uint32_t nframe, uint8_t *dst, int nu
|
||||
ns0 = (double) N_EL_FRAME(n) * el->audio_rate / el->video_fps;
|
||||
|
||||
//asize = el->audio_rate / el->video_fps;
|
||||
pos = nframe * asize;
|
||||
ret = lav_set_audio_position(el->lav_fd[N_EL_FILE(n)], ns0);
|
||||
|
||||
if (ret < 0)
|
||||
|
||||
@@ -63,7 +63,6 @@ int is_mapped( mmap_region_t *map, int offset, int size )
|
||||
{
|
||||
// check if memory is in mapped region
|
||||
off_t real_offset = PADDED( offset, map );
|
||||
size_t padding = offset % map->page_size;
|
||||
|
||||
long rel_o = (map->mem_offset > 0 ? offset - map->mem_offset : offset );
|
||||
|
||||
@@ -129,7 +128,6 @@ int munmap_file( mmap_region_t *map )
|
||||
|
||||
int mmap_read( mmap_region_t *map,int offset, int bytes, uint8_t *buf )
|
||||
{
|
||||
size_t padding = offset % map->page_size;
|
||||
if( !is_mapped( map, offset, bytes ))
|
||||
{
|
||||
remap_file( map, offset );
|
||||
|
||||
@@ -68,6 +68,8 @@ void lzo_print_buf( uint8_t *buf, int len )
|
||||
printf("\n");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
static int lzo_verify_compression(uint8_t *in, int in_len, uint8_t *out , lzo_uint *out_lenptr, uint8_t *wrkmem)
|
||||
{
|
||||
lzo_uint out_len = 0;
|
||||
@@ -99,7 +101,7 @@ static int lzo_verify_compression(uint8_t *in, int in_len, uint8_t *out , lzo_ui
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
#define LZO_ALIGN_SIZE(size) \
|
||||
( ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ) * sizeof(lzo_align_t)
|
||||
|
||||
@@ -171,7 +173,6 @@ static uint32_t str2ulong(unsigned char *str)
|
||||
|
||||
long lzo_compress( void *lzo, uint8_t *src, uint8_t *plane, unsigned int *size, int ilen )
|
||||
{
|
||||
lzo_uint out_len =0;
|
||||
lzo_uint src_len = ilen;
|
||||
lzot *l = (lzot*) lzo;
|
||||
lzo_bytep dst = plane;
|
||||
@@ -195,7 +196,6 @@ long lzo_decompress_el( void *lzo, uint8_t *linbuf, int linbuf_len, uint8_t *ds
|
||||
{
|
||||
unsigned int i;
|
||||
lzo_uint len[3] = { 0,0,0};
|
||||
unsigned int mode = 0;
|
||||
unsigned int sum = 0;
|
||||
lzot *l = (lzot*) lzo;
|
||||
lzo_uint result_len = 0;
|
||||
|
||||
@@ -909,8 +909,6 @@ storage_put_atom_value(__vevo_port_t * port, void *src, int n,
|
||||
static void
|
||||
storage_put_atom_func(__vevo_port_t * port, void (*set_func)(),int (*get_func)(), vevo_storage_t * d, int v)
|
||||
{
|
||||
int i;
|
||||
|
||||
if( set_func == NULL && get_func == NULL )
|
||||
{
|
||||
vevo_free_atom(port,d->elements.atom);
|
||||
@@ -1073,13 +1071,6 @@ int vevo_property_atom_type(vevo_port_t * p, const char *key)
|
||||
|
||||
|
||||
static int vevo_storage_size( vevo_storage_t *stor ) {
|
||||
int atom_type; /*!< atom type */
|
||||
union { /*! \union elements one or more atoms */
|
||||
atom_t *atom;
|
||||
atom_t **array;
|
||||
} elements;
|
||||
int num_elements; /*!< number of atoms */
|
||||
|
||||
int i;
|
||||
if( stor->num_elements == 0 )
|
||||
return 0;
|
||||
@@ -2690,7 +2681,6 @@ static void vevo_port_recurse_free( vevo_port_t *sorted_port, vevo_port_t *p )
|
||||
|
||||
static int vevo_port_ref_verify( vevo_port_t *p)
|
||||
{
|
||||
int err = 0;
|
||||
/*
|
||||
#ifdef STRICT_CHECKING
|
||||
char **item = NULL;
|
||||
@@ -2779,7 +2769,6 @@ static char *vevo_format_inline_property( vevo_port_t *port, int n_elem, int typ
|
||||
{
|
||||
int len = n_elem * strlen(token) + 1;
|
||||
res = (char*) calloc(1, sizeof(char) * len );
|
||||
int i;
|
||||
/*for( i =0; i < n_elem; i ++ ) {
|
||||
while( *res ) *res ++;
|
||||
while( *res++ = *token++ );
|
||||
@@ -3172,7 +3161,6 @@ char *vevo_sprintf_property_value( vevo_port_t *port, const char *key)
|
||||
}
|
||||
|
||||
int i;
|
||||
int size = 0;
|
||||
int atom = vevo_property_atom_type( port , key );
|
||||
|
||||
memset(tmp,0,sizeof(tmp));
|
||||
@@ -3617,7 +3605,6 @@ vevo_property_del(vevo_port_t * p,
|
||||
if( idxkey == hash_key ) {
|
||||
//node at beginning of list?
|
||||
if( node == list ) {
|
||||
port_index_t *start = list;
|
||||
port->index = NULL;
|
||||
if( node->next != NULL )
|
||||
port->index = node->next;
|
||||
@@ -3988,7 +3975,6 @@ void vevo_dom_dump( void *p, FILE *file )
|
||||
|
||||
int vevo_write_xml( vevo_port_t *root, const char *destination, char *hiearchy[] )
|
||||
{
|
||||
char *encoding = "UTF-8";
|
||||
char **properties = vevo_list_properties( root );
|
||||
if( properties == NULL )
|
||||
return 0;
|
||||
|
||||
@@ -114,7 +114,6 @@ void bathroom_hori_apply(VJFrame *frame, int width, int height, int val)
|
||||
unsigned int i;
|
||||
unsigned int len = (width * height);
|
||||
unsigned int y_val = val;
|
||||
unsigned int tmp = 0;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
|
||||
@@ -58,7 +58,7 @@ int bgsubtract_malloc(int width, int height)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void bgsubtract_free(void *d)
|
||||
void bgsubtract_free()
|
||||
{
|
||||
if( static_bg )
|
||||
free(static_bg );
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *bgsubtract_init(int width, int height);
|
||||
void bgsubtract_free(void *d);
|
||||
void bgsubtract_free();
|
||||
int bgsubtract_malloc(int w, int h);
|
||||
int bgsubtract_prepare(uint8_t *map[3], int w, int h);
|
||||
void bgsubtract_apply(VJFrame *frame,int width,int height,int mode, int threshold);
|
||||
|
||||
@@ -112,7 +112,6 @@ static void blob_init_( blob_t *b , int w , int h)
|
||||
int blob_malloc(int w, int h)
|
||||
{
|
||||
int j,i;
|
||||
double frac;
|
||||
int dist_sqrt;
|
||||
|
||||
if(blob_radius_ <= 0)
|
||||
@@ -141,7 +140,6 @@ int blob_malloc(int w, int h)
|
||||
dist_sqrt = i * i + j * j;
|
||||
if( dist_sqrt < blob_sradius_ )
|
||||
{
|
||||
frac = (double) (sqrt(dist_sqrt)) / (double) blob_sradius_;
|
||||
blob_[i + blob_radius_][j + blob_radius_] = 0xff;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -143,7 +143,6 @@ void cali_apply(void *ed, VJFrame *frame, int w, int h,int mode, int full)
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *U = frame->data[1];
|
||||
uint8_t *V = frame->data[2];
|
||||
const int min_Y = get_pixel_range_min_Y();
|
||||
const int chroma = 127;
|
||||
const int uv_len = frame->uv_len;
|
||||
int p,i;
|
||||
@@ -213,7 +212,7 @@ void cali_apply(void *ed, VJFrame *frame, int w, int h,int mode, int full)
|
||||
for( i = 0; i <(w*h); i ++ ) {
|
||||
p = ( Y[i] - by[i] );
|
||||
if( p < 0 )
|
||||
Y[i] = 0;
|
||||
Y[i] = pixel_Y_lo_;
|
||||
else
|
||||
Y[i] = p;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,6 @@ static void drawDisappearing(VJFrame *src, VJFrame *dest)
|
||||
|
||||
void chameleon_apply( VJFrame *frame, int width, int height, int mode)
|
||||
{
|
||||
unsigned int i;
|
||||
const int len = (width * height);
|
||||
VJFrame source;
|
||||
int strides[4] = { len, len, len, 0 };
|
||||
@@ -248,7 +247,6 @@ void chameleon_apply( VJFrame *frame, int width, int height, int mode)
|
||||
source.data[1] = tmpimage[1];
|
||||
source.data[2] = tmpimage[2];
|
||||
|
||||
int interpolate = 0;
|
||||
uint32_t activity = 0;
|
||||
int auto_switch = 0;
|
||||
int tmp1,tmp2;
|
||||
|
||||
@@ -232,9 +232,6 @@ static void drawDisappearing(VJFrame *src, VJFrame *dest)
|
||||
|
||||
void chameleonblend_apply( VJFrame *frame, VJFrame *source, int width, int height, int mode )
|
||||
{
|
||||
unsigned int i;
|
||||
const int len = (width * height);
|
||||
int interpolate = 0;
|
||||
uint32_t activity = 0;
|
||||
int auto_switch = 0;
|
||||
int tmp1,tmp2;
|
||||
|
||||
@@ -216,7 +216,7 @@ void chromamagic_selectdiffneg(VJFrame *frame, VJFrame *frame2,
|
||||
uint8_t *Cb2 = frame2->data[1];
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
int a, b,c;
|
||||
int a, b;
|
||||
const int op_b = 255 - op_a;
|
||||
for (i = 0; i < len; i++) {
|
||||
a = (Y[i] * op_a) >> 8;
|
||||
@@ -241,7 +241,7 @@ void chromamagic_selectunfreeze(VJFrame *frame, VJFrame *frame2,
|
||||
uint8_t *Cb2 = frame2->data[1];
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
int c, a, b;
|
||||
int a, b;
|
||||
const int op_b = 255 - op_a;
|
||||
for (i = 0; i < len; i++) {
|
||||
a = (Y[i] * op_a) >> 8;
|
||||
@@ -267,7 +267,7 @@ void chromamagic_addlum(VJFrame *frame, VJFrame *frame2, int width,
|
||||
uint8_t *Cb2 = frame2->data[1];
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
int c, a, b;
|
||||
int a, b;
|
||||
const int op_b = 255 - op_a;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
@@ -290,8 +290,6 @@ void chromamagic_exclusive(VJFrame *frame, VJFrame *frame2, int width, int heigh
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
int a=0, b=0, c=0;
|
||||
const unsigned int o1 = op_a;
|
||||
const unsigned int o2 = 255 - a;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
a = Y[i];
|
||||
@@ -325,7 +323,7 @@ void chromamagic_diffnegate(VJFrame *frame, VJFrame *frame2, int width, int heig
|
||||
uint8_t *Cb2 = frame2->data[1];
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
int a,b,c,d;
|
||||
int a,b,d;
|
||||
const unsigned int o1 = op_a;
|
||||
const unsigned int o2 = 255 - o1;
|
||||
#define MAGIC_THRESHOLD 40
|
||||
@@ -364,7 +362,7 @@ void chromamagic_additive(VJFrame *frame, VJFrame *frame2, int width,
|
||||
uint8_t *Cb2 = frame2->data[1];
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
int a,b,c;
|
||||
int a,b;
|
||||
const unsigned int o1 = op_a;
|
||||
const unsigned int o2 = 255 - op_a;
|
||||
for(i=0; i < len; i++) {
|
||||
@@ -481,7 +479,7 @@ void chromamagic_unfreeze( VJFrame *frame, VJFrame *frame2, int w, int h, int op
|
||||
uint8_t *Cb2 = frame2->data[1];
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
int a,b,c;
|
||||
int a,b;
|
||||
|
||||
for(i=0; i < len; i++) {
|
||||
a = Y[i];
|
||||
@@ -589,7 +587,7 @@ void chromamagic_divide(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a
|
||||
uint8_t *Cb2 = frame2->data[1];
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
int a,b,c;
|
||||
int a,b;
|
||||
const unsigned int o1 = op_a;
|
||||
|
||||
for(i=0; i < len; i++) {
|
||||
|
||||
@@ -63,7 +63,6 @@ static int color_delay_ = 0;
|
||||
static int delay_ = 0;
|
||||
void colflash_apply( VJFrame *frame, int width, int height, int f,int r, int g, int b, int d)
|
||||
{
|
||||
unsigned int i, op0, op1;
|
||||
unsigned int len = frame->len;
|
||||
unsigned int uv_len = frame->uv_len;
|
||||
|
||||
|
||||
@@ -103,8 +103,7 @@ void colmorphology_apply( VJFrame *frame, int width, int height, int threshold,
|
||||
{
|
||||
unsigned int i,x,y;
|
||||
int len = (width * height);
|
||||
int c = 0,t=0,k=0;
|
||||
uint8_t pixel;
|
||||
int t=0;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
|
||||
@@ -61,7 +61,7 @@ void colormap_apply( VJFrame *frame, int width, int height, int r, int g, int b)
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
uint8_t dummy = 0;
|
||||
int dummy = 0;
|
||||
for(i = 1; i < 256; i ++ )
|
||||
{
|
||||
COLOR_rgb2yuv( (r % i),(g % i),(b % i), dummy, u_[i-1],v_[i-1]);
|
||||
|
||||
@@ -35,7 +35,6 @@ extern void veejay_msg(int type, const char format[], ...);
|
||||
char **vje_build_param_list( int num, ... )
|
||||
{
|
||||
va_list args;
|
||||
char buf[1024];
|
||||
char **list;
|
||||
char *tmp = NULL;
|
||||
list = (char**) vj_malloc(sizeof(char*) * (num+1) );
|
||||
@@ -796,7 +795,7 @@ uint8_t bl_pix_difference_Y(uint8_t y1, uint8_t y2)
|
||||
|
||||
uint8_t bl_pix_diffnegate_Y(uint8_t y1, uint8_t y2)
|
||||
{
|
||||
uint8_t a, b, new_Y;
|
||||
uint8_t a, b;
|
||||
a = 0xff - y1;
|
||||
b = y2;
|
||||
return ( 0xff - abs(a - b) );
|
||||
@@ -1093,9 +1092,7 @@ uint8_t bl_pix_add_distorted_C(uint8_t y1, uint8_t y2)
|
||||
|
||||
uint8_t bl_pix_sub_distorted_Y(uint8_t y1, uint8_t y2)
|
||||
{
|
||||
uint8_t new_Y, a, b;
|
||||
a = y1;
|
||||
b = y2;
|
||||
uint8_t new_Y;
|
||||
new_Y = y1 - y2;
|
||||
new_Y -= y2;
|
||||
return new_Y;
|
||||
@@ -1436,9 +1433,8 @@ static uint32_t veejay_histogram_median( uint32_t *h )
|
||||
|
||||
static void build_histogram_rgb( uint8_t *rgb, histogram_t *h, VJFrame *f)
|
||||
{
|
||||
unsigned int i,j, len;
|
||||
unsigned int i,j;
|
||||
uint32_t *Hr,*Hb,*Hg;
|
||||
uint8_t *p;
|
||||
|
||||
Hr = h->hR;
|
||||
Hg = h->hG;
|
||||
@@ -1649,7 +1645,7 @@ void veejay_histogram_equalize( void *his, VJFrame *f , int intensity, int stren
|
||||
histogram_t *h = (histogram_t*) his;
|
||||
uint32_t LUT[256];
|
||||
unsigned int i;
|
||||
uint8_t *u,*v,*y;
|
||||
uint8_t *y;
|
||||
unsigned int len;
|
||||
|
||||
len = f->len;
|
||||
|
||||
@@ -53,7 +53,6 @@ vj_effect *complexsync_init(int width, int height)
|
||||
|
||||
int complexsync_malloc(int width, int height)
|
||||
{
|
||||
int i;
|
||||
c_outofsync_buffer[0] = (uint8_t*) vj_malloc( sizeof(uint8_t) * RUP8(width*height*3) );
|
||||
c_outofsync_buffer[1] = c_outofsync_buffer[0] + RUP8(width*height);
|
||||
c_outofsync_buffer[2] = c_outofsync_buffer[1] + RUP8(width*height);
|
||||
@@ -77,9 +76,6 @@ void complexsync_apply(VJFrame *frame, VJFrame *frame2, int width, int height, i
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
uint8_t *Cb2 = frame2->data[1];
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
|
||||
const unsigned int region = width * val;
|
||||
int strides[4] = { region, region, region, 0 };
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include "softblur.h"
|
||||
static uint8_t *static_bg = NULL;
|
||||
static int *dt_map = NULL;
|
||||
static uint32_t *dt_map = NULL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -214,7 +214,7 @@ void diff_apply(void *ed, VJFrame *frame,
|
||||
} else if ( dt_map[i] == 1 ) {
|
||||
Y[i] = 0xff;
|
||||
} else {
|
||||
Y[i] = 0; //@ black (background)
|
||||
Y[i] = pixel_Y_lo_; //@ black (background)
|
||||
}
|
||||
Cb[i] = 128;
|
||||
Cr[i] = 128;
|
||||
@@ -223,7 +223,6 @@ void diff_apply(void *ed, VJFrame *frame,
|
||||
}
|
||||
|
||||
//@ process dt map
|
||||
uint8_t *bin = ud->data;
|
||||
for( i = 0; i < len ;i ++ )
|
||||
{
|
||||
if( dt_map[ i ] >= feather )
|
||||
@@ -234,7 +233,7 @@ void diff_apply(void *ed, VJFrame *frame,
|
||||
}
|
||||
else
|
||||
{
|
||||
Y[i] = 0;
|
||||
Y[i] = pixel_Y_lo_;
|
||||
Cb[i] = 128;
|
||||
Cr[i] = 128;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,6 @@ void differencemap_apply( VJFrame *frame, VJFrame *frame2,int width, int height,
|
||||
uint8_t *Cr2=frame2->data[2];
|
||||
|
||||
const uint8_t kernel[9] = { 1,1,1, 1,1,1, 1,1,1 };
|
||||
uint8_t *bmap = binary_img;
|
||||
|
||||
// morph_func p = _dilate_kernel3x3;
|
||||
uint8_t *previous_img = binary_img + len;
|
||||
@@ -246,31 +245,6 @@ void differencemap_apply( VJFrame *frame, VJFrame *frame2,int width, int height,
|
||||
softblur_apply( &tmp, width,height,0 );
|
||||
|
||||
binarify( binary_img,previous_img,threshold,reverse, width,height);
|
||||
/*
|
||||
|
||||
#ifdef HAVE_ASM_MMX
|
||||
int work = (width*height)>>3;
|
||||
load_chroma( 128 );
|
||||
for( y = 0 ; y < work; y ++ )
|
||||
{
|
||||
load_binary_map( bmap );
|
||||
map_luma(Y , Y2 );
|
||||
map_chroma( Cb, Cb2 );
|
||||
map_chroma( Cr, Cr2 );
|
||||
//@ we could mmx-ify dilation
|
||||
Y += 8;
|
||||
Y2 += 8;
|
||||
Cb += 8;
|
||||
Cb2 += 8;
|
||||
Cr += 8;
|
||||
Cr2 +=8;
|
||||
bmap += 8;
|
||||
}
|
||||
|
||||
__asm__ __volatile__ ( _EMMS:::"memory");
|
||||
#else
|
||||
*/
|
||||
|
||||
//@ clear image
|
||||
|
||||
if(show)
|
||||
|
||||
@@ -46,7 +46,7 @@ vj_effect *emboss_init(int w, int h)
|
||||
void simpleedge_framedata(VJFrame *frame, int width, int height)
|
||||
{
|
||||
unsigned int x, y;
|
||||
uint8_t a1, a2, a3, b1, b2, b3, c1, c2, c3;
|
||||
uint8_t a1, a2, a3, b1, b2, b3, c1, c2;
|
||||
uint8_t *Y = frame->data[0];
|
||||
for (y = 1; y < (height-1); y++) {
|
||||
for (x = 1; x < (width-1); x++) {
|
||||
@@ -58,7 +58,6 @@ void simpleedge_framedata(VJFrame *frame, int width, int height)
|
||||
b3 = Y[y * width + (x + 1)];
|
||||
c1 = Y[(y + 1) * width + (x - 1)];
|
||||
c2 = Y[(y + 1) * width + x];
|
||||
c3 = Y[(y + 1) * width + (x + 1)];
|
||||
if (b2 > a1 && b2 > a2 && b2 > a3 &&
|
||||
b2 > b1 && b2 > b3 && b3 > c1 && b2 > c2 && b2 > c2)
|
||||
Y[y * width + x] = pixel_Y_hi_;
|
||||
|
||||
@@ -50,7 +50,7 @@ vj_effect *ghost_init(int w, int h)
|
||||
int ghost_malloc(int w, int h)
|
||||
{
|
||||
const int len = (w * h );
|
||||
int i;
|
||||
|
||||
|
||||
ghost_buf[0] = vj_malloc( sizeof(uint8_t) * RUP8(len*3));
|
||||
ghost_buf[1] = ghost_buf[0] + RUP8(len);
|
||||
@@ -82,7 +82,7 @@ void ghost_apply(VJFrame *frame,
|
||||
int width, int height, int opacity)
|
||||
{
|
||||
register int q,z=0;
|
||||
int x,y,i,tmp;
|
||||
int x,y,i;
|
||||
const int len = frame->len;
|
||||
const unsigned int op_a = opacity;
|
||||
const unsigned int op_b = 255 - op_a;
|
||||
|
||||
@@ -63,8 +63,7 @@ void greyselect_apply( VJFrame *frame, int width,
|
||||
int b)
|
||||
{
|
||||
|
||||
uint8_t *fg_y, *fg_cb, *fg_cr;
|
||||
uint8_t *bg_y, *bg_cb, *bg_cr;
|
||||
uint8_t *fg_cb, *fg_cr;
|
||||
int accept_angle_tg, accept_angle_ctg, one_over_kc;
|
||||
int kfgy_scale, kg;
|
||||
int cb, cr;
|
||||
@@ -95,14 +94,9 @@ void greyselect_apply( VJFrame *frame, int width,
|
||||
kg = kg1;
|
||||
|
||||
/* intialize pointers */
|
||||
fg_y = Y;
|
||||
fg_cb = Cb;
|
||||
fg_cr = Cr;
|
||||
|
||||
bg_y = Y;
|
||||
bg_cb = Cb;
|
||||
bg_cr = Cr;
|
||||
|
||||
for (pos = (width * height); pos != 0; pos--) {
|
||||
short xx, yy;
|
||||
xx = (((fg_cb[pos]) * cb) + ((fg_cr[pos]) * cr)) >> 7;
|
||||
|
||||
@@ -57,7 +57,6 @@ void iris_apply( VJFrame *frame, VJFrame *frame2, int width, int height, int val
|
||||
{
|
||||
int i,j,k=0;
|
||||
int len = (width * height);
|
||||
int uv_len = frame->uv_len;
|
||||
|
||||
uint8_t *Y0 = frame->data[0];
|
||||
uint8_t *Cb0 = frame->data[1];
|
||||
|
||||
@@ -139,7 +139,7 @@ void keyselect_apply( VJFrame *frame, VJFrame *frame2, int width,
|
||||
{
|
||||
|
||||
uint8_t *fg_y, *fg_cb, *fg_cr;
|
||||
uint8_t *bg_y, *bg_cb, *bg_cr;
|
||||
uint8_t *bg_y;
|
||||
int accept_angle_tg, accept_angle_ctg, one_over_kc;
|
||||
int kfgy_scale, kg;
|
||||
int cb, cr;
|
||||
@@ -182,8 +182,6 @@ void keyselect_apply( VJFrame *frame, VJFrame *frame2, int width,
|
||||
fg_cr = Cr;
|
||||
/* 2005: swap these !! */
|
||||
bg_y = Y2;
|
||||
bg_cb = Cb2;
|
||||
bg_cr = Cr2;
|
||||
|
||||
for (pos = (width * height); pos != 0; pos--) {
|
||||
short xx, yy;
|
||||
|
||||
@@ -235,7 +235,7 @@ void _lumamagick_divide(VJFrame *frame, VJFrame *frame2, int width,
|
||||
{
|
||||
unsigned int i;
|
||||
const unsigned int len = width * height;
|
||||
int a, b, c;
|
||||
int b, c;
|
||||
const double opacity_a = op_a * 0.01;
|
||||
const double opacity_b = op_b * 0.01;
|
||||
uint8_t *Y = frame->data[0];
|
||||
|
||||
@@ -55,8 +55,8 @@ void _overlaymagic_adddistorted(VJFrame *frame, VJFrame *frame2,
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int len = width * height;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
int a, b, c;
|
||||
@@ -74,7 +74,7 @@ void _overlaymagic_add_distorted(VJFrame *frame, VJFrame *frame2,
|
||||
{
|
||||
|
||||
unsigned int i;
|
||||
uint8_t y1, y2, cb, cr;
|
||||
uint8_t y1, y2;
|
||||
unsigned int len = width * height;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
@@ -93,11 +93,10 @@ void _overlaymagic_subdistorted(VJFrame *frame, VJFrame *frame2,
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int len = width * height;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
uint8_t y1, y2, cb, cr;
|
||||
uint8_t y1, y2;
|
||||
for (i = 0; i < len; i++) {
|
||||
y1 = Y[i];
|
||||
y2 = Y2[i];
|
||||
@@ -112,11 +111,10 @@ void _overlaymagic_sub_distorted(VJFrame *frame, VJFrame *frame2,
|
||||
|
||||
unsigned int i ;
|
||||
unsigned int len = width * height;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
uint8_t y1, y2, cb, cr;
|
||||
uint8_t y1, y2;
|
||||
for (i = 0; i < len; i++) {
|
||||
y1 = Y[i];
|
||||
y2 = Y2[i];
|
||||
@@ -187,7 +185,6 @@ void _overlaymagic_substractive(VJFrame *frame, VJFrame *frame2,
|
||||
{
|
||||
|
||||
unsigned int i;
|
||||
int a;
|
||||
unsigned int len = width * height;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
@@ -277,7 +274,7 @@ void _overlaymagic_mulsub(VJFrame *frame, VJFrame *frame2, int width,
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
int a, b, c;
|
||||
int a, b;
|
||||
for (i = 0; i < len; i++) {
|
||||
a = Y[i];
|
||||
b = 255 - Y2[i];
|
||||
@@ -343,11 +340,10 @@ void _overlaymagic_exclusive(VJFrame *frame, VJFrame *frame2,
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int len = width * height;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
int a,b,c;
|
||||
int c;
|
||||
for (i = 0; i < len; i++) {
|
||||
c = Y[i] + (2 * Y2[i]) - 255;
|
||||
Y[i] = CLAMP_Y(c - (( Y[i] * Y2[i] ) >> 8 ));
|
||||
@@ -380,7 +376,7 @@ void _overlaymagic_freeze(VJFrame *frame, VJFrame *frame2, int width,
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
int a, b, c;
|
||||
int a, b;
|
||||
for (i = 0; i < len; i++) {
|
||||
a = Y[i];
|
||||
b = Y2[i];
|
||||
@@ -397,7 +393,7 @@ void _overlaymagic_unfreeze(VJFrame *frame, VJFrame *frame2,
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
int a, b, c;
|
||||
int a, b;
|
||||
for (i = 0; i < len; i++) {
|
||||
a = Y[i];
|
||||
b = Y2[i];
|
||||
@@ -465,7 +461,6 @@ void _overlaymagic_relativeadd(VJFrame *frame, VJFrame *frame2,
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int len = width * height;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
@@ -484,7 +479,6 @@ void _overlaymagic_relativesub(VJFrame *frame, VJFrame *frame2,
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int len = width * height;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
@@ -611,7 +605,6 @@ void _overlaymagic_addtest2(VJFrame *frame, VJFrame *frame2,
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int len = width * height;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
|
||||
@@ -632,7 +625,7 @@ void _overlaymagic_addtest4(VJFrame *frame, VJFrame *frame2,
|
||||
unsigned int len = width * height;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y2 = frame2->data[0];
|
||||
int c, a, b;
|
||||
int a, b;
|
||||
for (i = 0; i < len; i++) {
|
||||
a = Y[i];
|
||||
b = Y2[i];
|
||||
|
||||
@@ -104,8 +104,6 @@ void magicscratcher_apply(VJFrame *frame,
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb= frame->data[1];
|
||||
uint8_t *Cr= frame->data[2];
|
||||
int uv_width = frame->uv_width;
|
||||
int uv_height = frame->uv_height;
|
||||
/* param 6 is cool ,8,7,10,13,15, ,9,11,12,14,
|
||||
|
||||
16 voor default ?, 17 (!),18,19, 20(!), 21, 24,,25,30 */
|
||||
|
||||
@@ -45,10 +45,6 @@ vj_effect *medianfilter_init(int w, int h)
|
||||
|
||||
void medianfilter_apply( VJFrame *frame, int width, int height, int val)
|
||||
{
|
||||
int i;
|
||||
int len = (width * height);
|
||||
int uv_len = frame->uv_len;
|
||||
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
|
||||
@@ -101,9 +101,8 @@ void morphology_apply( VJFrame *frame, int width, int height, int threshold, int
|
||||
{
|
||||
unsigned int i,x,y;
|
||||
int len = (width * height);
|
||||
int c = 0,t=0,k=0;
|
||||
int t=0;
|
||||
int uv_len = frame->uv_len;
|
||||
uint8_t pixel;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
|
||||
@@ -88,7 +88,6 @@ static uint8_t *previous_img = NULL;
|
||||
static uint32_t histogram_[HIS_LEN];
|
||||
static uint8_t *large_buf = NULL;
|
||||
static uint32_t nframe_ =0;
|
||||
static uint32_t activity_total_ = 0;
|
||||
static uint32_t max_d = ACT_TOP;
|
||||
static int current_his_len = HIS_DEFAULT;
|
||||
static uint32_t key1_ = 0, key2_ = 0, keyv_ = 0, keyp_ = 0;
|
||||
@@ -150,13 +149,11 @@ void motionmap_free(void)
|
||||
static void update_bgmask( uint8_t *dst,uint8_t *in, uint8_t *src, int len, int threshold )
|
||||
{
|
||||
int i;
|
||||
unsigned int op0,op1;
|
||||
for( i =0; i < len ; i ++ )
|
||||
{
|
||||
if( abs(in[i] - src[i]) > threshold )
|
||||
{
|
||||
dst[i] = 0xff;
|
||||
//in[i] = (in[i] + src[i])>>1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -281,9 +278,8 @@ static int stop_capture_ = 0;
|
||||
static int reaction_ready_ = 0;
|
||||
void motionmap_apply( VJFrame *frame, int width, int height, int threshold, int reverse, int draw, int history, int capbuf )
|
||||
{
|
||||
unsigned int i,x,y;
|
||||
unsigned int i,y;
|
||||
int len = (width * height);
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
if(!have_bg) {
|
||||
|
||||
@@ -76,25 +76,22 @@ void mtracer_apply( VJFrame *frame, VJFrame *frame2,
|
||||
VJFrame m;
|
||||
unsigned int len = frame->len;
|
||||
unsigned int uv_len = frame->uv_len;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb= frame->data[1];
|
||||
uint8_t *Cr= frame->data[2];
|
||||
int strides[4] = { len, uv_len, uv_len, 0 };
|
||||
|
||||
memcpy( &m, frame, sizeof(VJFrame ));
|
||||
|
||||
if (mtrace_counter == 0) {
|
||||
overlaymagic_apply(frame, frame2, width, height, mode,0);
|
||||
vj_frame_copy1( mtrace_buffer[0], frame->data[0], len );
|
||||
vj_frame_copy1( mtrace_buffer[1], frame->data[1], uv_len );
|
||||
vj_frame_copy1( mtrace_buffer[2], frame->data[2], uv_len );
|
||||
overlaymagic_apply(frame, frame2, width, height, mode,0);
|
||||
vj_frame_copy1( mtrace_buffer[0], frame->data[0], len );
|
||||
vj_frame_copy1( mtrace_buffer[1], frame->data[1], uv_len );
|
||||
vj_frame_copy1( mtrace_buffer[2], frame->data[2], uv_len );
|
||||
} else {
|
||||
overlaymagic_apply(frame, frame2, width, height, mode,0);
|
||||
m.data[0] = mtrace_buffer[0];
|
||||
m.data[1] = mtrace_buffer[1];
|
||||
m.data[2] = mtrace_buffer[2];
|
||||
overlaymagic_apply( &m, frame2, width,height, mode, 0 );
|
||||
vj_frame_copy( mtrace_buffer,frame->data, strides );
|
||||
overlaymagic_apply(frame, frame2, width, height, mode,0);
|
||||
m.data[0] = mtrace_buffer[0];
|
||||
m.data[1] = mtrace_buffer[1];
|
||||
m.data[2] = mtrace_buffer[2];
|
||||
overlaymagic_apply( &m, frame2, width,height, mode, 0 );
|
||||
vj_frame_copy( mtrace_buffer,frame->data, strides );
|
||||
}
|
||||
|
||||
mtrace_counter++;
|
||||
|
||||
@@ -174,7 +174,7 @@ void opacity_applyN( VJFrame *frame, VJFrame *frame2, int width,
|
||||
if( vj_task_available() ) {
|
||||
vj_task_set_from_frame( frame );
|
||||
vj_task_set_int( opacity );
|
||||
vj_task_run( frame->data, frame2->data, NULL, NULL, 3, &opacity_apply_job );
|
||||
vj_task_run( frame->data, frame2->data, NULL, NULL, 3, (performer_job_routine) &opacity_apply_job );
|
||||
} else {
|
||||
opacity_apply1( frame,frame2,width,height,opacity );
|
||||
}
|
||||
@@ -203,7 +203,7 @@ void opacity_blend_apply( uint8_t *src1[3], uint8_t *src2[3], int len, int uv_le
|
||||
if( vj_task_available() ) {
|
||||
vj_task_set_from_args( len,uv_len );
|
||||
vj_task_set_int( opacity );
|
||||
vj_task_run( src1, src2, NULL, NULL, 3, &opacity_apply_job );
|
||||
vj_task_run( src1, src2, NULL, NULL, 3, (performer_job_routine) &opacity_apply_job );
|
||||
} else {
|
||||
opacity_blend_apply1( src1,src2,len,uv_len,opacity );
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ void radcor_apply( VJFrame *frame, int width, int height, int alpaX, int alpaY,
|
||||
{
|
||||
int i,j;
|
||||
int len = (width * height);
|
||||
int i2,j2,ii,jj,aacount;
|
||||
int i2,j2;
|
||||
double x,y,x2,x3,y2,y3,r;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
|
||||
@@ -76,7 +76,6 @@ static int buf_height = 0;
|
||||
static int buf_area = 0;
|
||||
static int buf_margin_left = 0;
|
||||
static int buf_margin_right = 0;
|
||||
static void *convert_rgb = NULL;
|
||||
static int first_frame=0;
|
||||
static int last_mode=0;
|
||||
static float ratio_ = 0.95;
|
||||
@@ -231,7 +230,7 @@ void radioactivetv_apply( VJFrame *frame, VJFrame *blue, int width, int height,
|
||||
uint8_t *dstY = lum;
|
||||
uint8_t *dstU = frame->data[1];
|
||||
uint8_t *dstV = frame->data[2];
|
||||
uint8_t *p, *src = lum;
|
||||
uint8_t *p;
|
||||
uint8_t *blueY = blue->data[0];
|
||||
uint8_t *blueU = blue->data[1];
|
||||
uint8_t *blueV = blue->data[2];
|
||||
|
||||
@@ -131,20 +131,16 @@ void scratcher_apply(VJFrame *src,
|
||||
int no_reverse)
|
||||
{
|
||||
|
||||
unsigned int x,len = src->len;
|
||||
unsigned int len = src->len;
|
||||
unsigned int op1 = (opacity > 255) ? 255 : opacity;
|
||||
unsigned int op0 = 255 - op1;
|
||||
int offset = len * nframe;
|
||||
int uv_len = src->uv_len;
|
||||
int uv_offset = uv_len * nframe;
|
||||
uint8_t *Y = src->data[0];
|
||||
uint8_t *Cb = src->data[1];
|
||||
uint8_t *Cr = src->data[2];
|
||||
VJFrame copy;
|
||||
|
||||
if (nframe== 0) {
|
||||
int strides[4] = { len, uv_len, uv_len, 0 };
|
||||
vj_frame_copy( src->data, frame, strides );
|
||||
int strides[4] = { len, uv_len, uv_len, 0 };
|
||||
vj_frame_copy( src->data, frame, strides );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -154,19 +150,6 @@ void scratcher_apply(VJFrame *src,
|
||||
srcB.data[1] = frame[1] + uv_offset;
|
||||
srcB.data[2] = frame[2] + uv_offset;
|
||||
opacity_applyN( src, &srcB, src->width,src->height, opacity );
|
||||
/* for (x = 0; x < len; x++) {
|
||||
Y[x] =
|
||||
((op0 * Y[x]) + (op1 * frame[0][offset + x])) >> 8;
|
||||
}
|
||||
|
||||
for(x=0; x < uv_len; x++) {
|
||||
Cr[x] =
|
||||
((op0 * Cr[x]) + (op1 * frame[2][uv_offset + x])) >> 8;
|
||||
|
||||
Cb[x] =
|
||||
((op0 * Cb[x]) + (op1 * frame[1][uv_offset + x])) >> 8;
|
||||
}
|
||||
*/
|
||||
copy.uv_len = src->uv_len;
|
||||
copy.data[0] = frame[0];
|
||||
copy.data[1] = frame[1];
|
||||
|
||||
@@ -33,8 +33,6 @@ static recalc(int w, int h , uint8_t *Yin, int v1, int v2 )
|
||||
unsigned int l = w * h;
|
||||
unsigned int valx = (w / 100.0) * v1;
|
||||
unsigned int valy = (h / 100.0) * v1;
|
||||
unsigned int modx = (w / 100.0) * v2;
|
||||
unsigned int mody = (h / 100.0) * v2;
|
||||
for(x = dx = 0; x < w; x++)
|
||||
{
|
||||
p = 0 + (int)( l * (rand()/RAND_MAX + 0.0) );
|
||||
|
||||
@@ -68,7 +68,7 @@ static void _smear_apply_x(VJFrame *frame, int width, int height, int val)
|
||||
}
|
||||
static void _smear_apply_x_avg(VJFrame *frame, int width, int height, int val)
|
||||
{
|
||||
unsigned int i,j;
|
||||
unsigned int j;
|
||||
unsigned int x,y;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
|
||||
@@ -200,12 +200,7 @@ void dosquarefib(VJFrame *frame, int width, int height)
|
||||
|
||||
void split_push_downscale_uh(VJFrame *frame, int width, int height)
|
||||
{
|
||||
|
||||
unsigned int len = frame->len/2;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb= frame->data[1];
|
||||
uint8_t *Cr= frame->data[2];
|
||||
|
||||
unsigned int len = frame->len/2;
|
||||
int strides[4] = { len,len,len ,0};
|
||||
vj_frame_copy( frame->data, split_fixme,strides );
|
||||
|
||||
|
||||
@@ -215,8 +215,7 @@ static void binarify( uint8_t *dst, uint8_t *src, int threshold,int reverse, int
|
||||
|
||||
void threshold_apply( VJFrame *frame, VJFrame *frame2,int width, int height, int threshold, int reverse )
|
||||
{
|
||||
unsigned int i,x,y;
|
||||
int len = (width * height);
|
||||
unsigned int y;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
@@ -224,11 +223,8 @@ void threshold_apply( VJFrame *frame, VJFrame *frame2,int width, int height, int
|
||||
uint8_t *Cb2=frame2->data[1];
|
||||
uint8_t *Cr2=frame2->data[2];
|
||||
|
||||
const uint8_t kernel[9] = { 1,1,1, 1,1,1, 1,1,1 };
|
||||
uint8_t *bmap = binary_img;
|
||||
|
||||
// morph_func p = _dilate_kernel3x3;
|
||||
|
||||
softblur_apply( frame, width,height,0 );
|
||||
|
||||
binarify( binary_img,Y,threshold,reverse, width,height);
|
||||
|
||||
@@ -144,7 +144,6 @@ void timedistort_apply( VJFrame *frame, int width, int height, int val)
|
||||
int interpolate = 1;
|
||||
int motion = 0;
|
||||
int tmp1,tmp2;
|
||||
int stor_local = 0;
|
||||
if(motionmap_active()) //@ use motion mapping frame
|
||||
{
|
||||
motionmap_scale_to( 255,255,1,1,&tmp1,&tmp2, &n__,&N__ );
|
||||
|
||||
@@ -498,7 +498,6 @@ void water_apply(void *user_data, VJFrame *frame, VJFrame *frame2, int width, in
|
||||
signed char *vp;
|
||||
uint8_t *src,*dest;
|
||||
const int len = frame->len;
|
||||
int dummy = 0;
|
||||
water_t *w = (water_t*) user_data;
|
||||
|
||||
if(w->last_fresh_rate != fresh_rate)
|
||||
|
||||
@@ -44,7 +44,6 @@ static const int point = 16;
|
||||
static const int impact = 2;
|
||||
//static const int decay = 8;
|
||||
//static const int loopnum = 2;
|
||||
static int bgIsSet = 0;
|
||||
static int tick = 0;
|
||||
|
||||
/* from EffecTV:
|
||||
|
||||
@@ -68,7 +68,6 @@ static int bar_bot_vert = 0;
|
||||
void vbar_apply(VJFrame *frame, VJFrame *frame2, int width, int height,int divider, int top_y, int bot_y, int top_x, int bot_x ) {
|
||||
|
||||
//int top_width = width; /* frame in frame destination area */
|
||||
int top_height = height/(divider);
|
||||
|
||||
int top_width = width/divider;
|
||||
int bottom_width = width - top_width;
|
||||
|
||||
@@ -169,6 +169,7 @@
|
||||
#include "effects/diffmap.h"
|
||||
#include "effects/picinpic.h"
|
||||
#include "effects/cali.h"
|
||||
#include "effects/bgsubtract.h"
|
||||
#include <libplugger/plugload.h>
|
||||
#include <veejay/vims.h>
|
||||
|
||||
@@ -192,8 +193,6 @@ void set_pixel_range(uint8_t Yhi,uint8_t Uhi, uint8_t Ylo, uint8_t Ulo)
|
||||
pixel_Y_lo_ = Ulo;
|
||||
}
|
||||
|
||||
static void *__plugin_ref = NULL;
|
||||
|
||||
static struct
|
||||
{
|
||||
int (*mem_init)(int width, int height);
|
||||
@@ -772,7 +771,6 @@ int vj_effect_real_to_sequence(int effect_id)
|
||||
{
|
||||
if( effect_id >= VJ_EXT_EFFECT )
|
||||
{
|
||||
int n = effect_id;
|
||||
effect_id -= VJ_EXT_EFFECT;
|
||||
effect_id += MAX_EFFECTS;
|
||||
return effect_id;
|
||||
|
||||
@@ -759,7 +759,7 @@ int vj_effect_apply( VJFrame **frames, VJFrameInfo *frameinfo, vjp_kf *kf, int s
|
||||
if( isP > 1 )
|
||||
vj_task_set_overlap( frames[0]->width );
|
||||
|
||||
vj_task_run( frames[0]->data,frames[1]->data, NULL, NULL, 3, &vj_effman_apply_job );
|
||||
vj_task_run( frames[0]->data,frames[1]->data, NULL, NULL, 3, (performer_job_routine) &vj_effman_apply_job );
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
@@ -1115,7 +1115,6 @@ void find_best_memcpy()
|
||||
|
||||
int c = MAX_WORKERS;
|
||||
int k;
|
||||
unsigned long long int statistics[c];
|
||||
for( k = 0; k < c; k ++ ) {
|
||||
for (i=1; memcpy_method[i].name; i++) {
|
||||
t = rdtsc();
|
||||
@@ -1268,7 +1267,7 @@ void vj_frame_slow_threaded( uint8_t **p0_buffer, uint8_t **p1_buffer, uint8_t *
|
||||
vj_task_run( p0_buffer, img, p1_buffer,strides, 4,(performer_job_routine) &vj_frame_slow_job );
|
||||
|
||||
} else {
|
||||
int i,j;
|
||||
int i;
|
||||
if( uv_len != len ) {
|
||||
for( i = 0; i < len ; i ++ ) {
|
||||
img[0][i] = p0_buffer[0][i] + ( frac * (p1_buffer[0][i] - p0_buffer[0][i]));
|
||||
@@ -1348,9 +1347,7 @@ int find_best_threaded_memcpy(int w, int h)
|
||||
long c = 100;
|
||||
|
||||
long k;
|
||||
int j;
|
||||
unsigned long long stats[c];
|
||||
unsigned long long best_avg[c];
|
||||
|
||||
task_init();
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y)
|
||||
return x->tv_sec < y->tv_sec;
|
||||
}
|
||||
|
||||
static void veejay_addr2line_bt( int n, void *addr, char *sym )
|
||||
static void veejay_addr2line_bt( int n, void *addr, void *sym )
|
||||
{
|
||||
int res;
|
||||
Dl_info info;
|
||||
@@ -137,7 +137,6 @@ static void veejay_addr2line_bt( int n, void *addr, char *sym )
|
||||
char cmd[1024];
|
||||
char line[1024], *line_ptr, *line_pos;
|
||||
char func_name[1024];
|
||||
int line_no;
|
||||
|
||||
res = dladdr( addr, &info );
|
||||
if( (res == 0) || !info.dli_fname || !info.dli_fname[0] ) {
|
||||
@@ -155,12 +154,11 @@ static void veejay_addr2line_bt( int n, void *addr, char *sym )
|
||||
snprintf( cmd,sizeof(cmd), "addr2line --functions --demangle -e $(which %s) %p", info.dli_fname, address);
|
||||
out = popen( cmd, "r");
|
||||
if(!out) {
|
||||
veejay_msg(VEEJAY_MSG_INFO, "\t%d %s (addr2line error)", n, sym );
|
||||
veejay_msg(VEEJAY_MSG_INFO, "\t%d %p (addr2line error)", n, sym );
|
||||
return;
|
||||
}
|
||||
|
||||
func_name[0] = '\0';
|
||||
line_no = 0;
|
||||
|
||||
while( !feof(out)) {
|
||||
line_ptr = fgets(line,sizeof(line)-1,out);
|
||||
@@ -169,7 +167,6 @@ static void veejay_addr2line_bt( int n, void *addr, char *sym )
|
||||
if( line_pos )
|
||||
line_pos[0] = '\0';
|
||||
if( strchr( line_ptr, ':' )) {
|
||||
line_no = 1;
|
||||
veejay_msg(VEEJAY_MSG_INFO, "\t%d %s %s (@%x)",
|
||||
n,
|
||||
line_ptr,
|
||||
@@ -194,8 +191,6 @@ void veejay_print_backtrace()
|
||||
size_t i,s;
|
||||
char **strings;
|
||||
|
||||
int i_size = sizeof(void*);
|
||||
|
||||
s = backtrace( space, 100 );
|
||||
strings = backtrace_symbols(space,s);
|
||||
|
||||
@@ -243,17 +238,17 @@ void veejay_backtrace_handler(int n , void *dist, void *x)
|
||||
|
||||
#if defined(SIGSEGV_STACK_IA64) || defined(SIGSEGV_STACK_X86)
|
||||
#if defined(SIGSEGV_STACK_X86)
|
||||
veejay_msg(VEEJAY_MSG_INFO,"(%s) invalid access to %p at %x",
|
||||
veejay_msg(VEEJAY_MSG_INFO,"(%s) invalid access to %p at %08x",
|
||||
strerr,ist->si_addr, puc->uc_mcontext.gregs[REG_EIP]);
|
||||
veejay_addr2line_bt( 0, puc->uc_mcontext.gregs[REG_EIP] , puc->uc_mcontext.gregs[REG_EIP] );
|
||||
veejay_addr2line_bt( 0, (void*) puc->uc_mcontext.gregs[REG_EIP] , (void*) puc->uc_mcontext.gregs[REG_EIP] );
|
||||
#elif defined(SIGSEGV_STACK_IA64)
|
||||
veejay_msg(VEEJAY_MSG_INFO,"(%s) invalid access to %p at %x",
|
||||
veejay_msg(VEEJAY_MSG_INFO,"(%s) invalid access to %p at %08x",
|
||||
strerr,ist->si_addr, puc->uc_mcontext.gregs[REG_RIP]);
|
||||
veejay_addr2line_bt( 0, puc->uc_mcontext.gregs[REG_RIP], puc->uc_mcontext.gregs[REG_RIP] );
|
||||
veejay_addr2line_bt( 0, (void*) puc->uc_mcontext.gregs[REG_RIP], (void*) puc->uc_mcontext.gregs[REG_RIP] );
|
||||
#endif
|
||||
#endif
|
||||
for( i = 0; i < NGREG; i ++ ) {
|
||||
veejay_msg(VEEJAY_MSG_INFO, "\tregister [%2d]\t=%x",i,puc->uc_mcontext.gregs[i]);
|
||||
veejay_msg(VEEJAY_MSG_INFO, "\tregister [%2d]\t=%08x",i,puc->uc_mcontext.gregs[i]);
|
||||
}
|
||||
|
||||
while( bp && ip ) {
|
||||
@@ -348,10 +343,7 @@ void veejay_msg(int type, const char format[], ...)
|
||||
char buf[1024];
|
||||
va_list args;
|
||||
int line = 0;
|
||||
struct timeval timenow;
|
||||
FILE *out = (_no_msg ? stderr: stdout );
|
||||
char tmbuf[64];
|
||||
char timebuf[64];
|
||||
if( type != VEEJAY_MSG_ERROR && _no_msg )
|
||||
return;
|
||||
|
||||
|
||||
@@ -253,7 +253,6 @@ void sock_t_set_timeout( vj_sock_t *s, int t )
|
||||
|
||||
int sock_t_recv( vj_sock_t *s, void *dst, int len )
|
||||
{
|
||||
int done = 0;
|
||||
int bytes_left = len;
|
||||
int n;
|
||||
int bytes_done = 0;
|
||||
@@ -287,10 +286,8 @@ int sock_t_send( vj_sock_t *s, unsigned char *buf, int len )
|
||||
{
|
||||
int n;
|
||||
int length = len;
|
||||
int bw = 0;
|
||||
int done = 0;
|
||||
while( length > 0 ) {
|
||||
bw = length;
|
||||
n = send( s->sock_fd, buf, length , MSG_NOSIGNAL );
|
||||
if( n == -1 ) {
|
||||
#ifdef STRICT_CHECKING
|
||||
|
||||
@@ -43,11 +43,6 @@
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
static void print_error(char *msg)
|
||||
{
|
||||
veejay_msg(VEEJAY_MSG_ERROR,"%s: %s\n", msg,strerror(errno));
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
packet_header_t hdr;
|
||||
@@ -174,31 +169,6 @@ int mcast_poll( mcast_receiver *v )
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int mcast_poll_timeout( mcast_receiver *v, long timeout )
|
||||
{
|
||||
fd_set fds;
|
||||
struct timeval tv;
|
||||
int n = 0;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = timeout; // 0.05 seconds
|
||||
FD_ZERO( &fds );
|
||||
FD_SET( v->sock_fd, &fds );
|
||||
|
||||
if( timeout == 0 )
|
||||
n = select( v->sock_fd + 1, &fds, NULL,NULL, NULL );
|
||||
else
|
||||
n = select( v->sock_fd + 1, &fds, 0,0, &tv );
|
||||
if(n == -1)
|
||||
veejay_msg(0, "Multicast receiver select error: %s", strerror(errno));
|
||||
|
||||
if( n <= 0)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int mcast_recv( mcast_receiver *v, void *buf, int len )
|
||||
{
|
||||
int n = recv( v->sock_fd, buf, len, 0 );
|
||||
|
||||
@@ -167,7 +167,6 @@ int mcast_send_frame( mcast_sender *v, const VJFrame *frame,
|
||||
{
|
||||
int n_chunks = total_len / CHUNK_SIZE;
|
||||
int i;
|
||||
int tb = 0;
|
||||
packet_header_t header = packet_construct_header( 1 );
|
||||
frame_info_t info;
|
||||
info.fmt = frame->format;
|
||||
|
||||
@@ -78,7 +78,6 @@ int packet_get_data(packet_header_t *h, const void *data, uint8_t *plane )
|
||||
|
||||
int packet_get_info(frame_info_t *i, const void *data )
|
||||
{
|
||||
size_t len = sizeof(packet_header_t);
|
||||
veejay_memcpy(i, data + sizeof(packet_header_t), sizeof(frame_info_t));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -417,7 +417,6 @@ int vj_server_send( vj_server *vje, int link_id, uint8_t *buf, int len )
|
||||
{
|
||||
unsigned int total = 0;
|
||||
unsigned int bytes_left = len;
|
||||
int n;
|
||||
#ifdef STRICT_CHECKING
|
||||
assert( vje->send_size > 0 );
|
||||
assert( len > 0 );
|
||||
@@ -498,8 +497,6 @@ int vj_server_link_can_read( vj_server *vje, int link_id)
|
||||
static int vj_server_send_frame_now( vj_server *vje, int link_id, uint8_t *buf, int len )
|
||||
{
|
||||
unsigned int total = 0;
|
||||
unsigned int bytes_left = len;
|
||||
int n;
|
||||
#ifdef STRICT_CHECKING
|
||||
assert( vje->send_size > 0 );
|
||||
assert( len > 0 );
|
||||
@@ -993,7 +990,6 @@ int vj_server_update( vj_server *vje, int id )
|
||||
int max = vje->recv_bufsize;
|
||||
int bytes_left = 1;
|
||||
char *ptr = vje->recv_buf;
|
||||
int readmore = 0;
|
||||
|
||||
n = recv( sock_fd, ptr, 1, 0 );
|
||||
if( n != 1 ) {
|
||||
|
||||
@@ -465,24 +465,6 @@ VJFrame *yuv_rgb_template( uint8_t *rgb_buffer, int w, int h, int fmt )
|
||||
#define ru4(num) (((num)+3)&~3)
|
||||
|
||||
|
||||
static struct
|
||||
{
|
||||
int ffmpeg;
|
||||
int aclib;
|
||||
} ffmpegaclib[] =
|
||||
{
|
||||
{ PIX_FMT_YUV420P, IMG_YUV420P },
|
||||
{ PIX_FMT_YUV422P, IMG_YUV422P },
|
||||
{ PIX_FMT_YUV444P, IMG_YUV444P },
|
||||
{ PIX_FMT_RGB24, IMG_RGB24 },
|
||||
{ PIX_FMT_BGR24, IMG_BGR24 },
|
||||
{ PIX_FMT_RGB32, IMG_ARGB32 },
|
||||
{ PIX_FMT_RGBA, IMG_RGBA32 },
|
||||
{ PIX_FMT_RGB32_1, IMG_RGBA32 },
|
||||
{ PIX_FMT_GRAY8, IMG_GRAY8 },
|
||||
{ -1, -1},
|
||||
};
|
||||
|
||||
void yuv_convert_any_ac_packed( VJFrame *src, uint8_t *dst, int src_fmt, int dst_fmt )
|
||||
{
|
||||
#ifdef STRICT_CHECKING
|
||||
@@ -580,8 +562,7 @@ void *yuv_fx_context_create( VJFrame *src, VJFrame *dst, int src_fmt, int dst_fm
|
||||
|
||||
void yuv_fx_context_process( void *ctx, VJFrame *src, VJFrame *dst )
|
||||
{
|
||||
//FIXME
|
||||
sws_scale( (struct SwsContext*) ctx, src->data, src->stride,0,src->height,dst->data,dst->stride );
|
||||
sws_scale( (struct SwsContext*) ctx,(const uint8_t * const*) src->data, src->stride,0,src->height,(uint8_t * const*) dst->data,dst->stride );
|
||||
}
|
||||
|
||||
void yuv_fx_context_destroy( void *ctx )
|
||||
@@ -608,7 +589,7 @@ void yuv_convert_any3( void *scaler, VJFrame *src, int src_stride[3], VJFrame *d
|
||||
|
||||
if(s->sws) {
|
||||
int dst_stride[3] = { ru4(dst->width),ru4(dst->uv_width),ru4(dst->uv_width) };
|
||||
sws_scale( s->sws, src->data, src_stride, 0, src->height, dst->data, dst_stride);
|
||||
sws_scale( s->sws,(const uint8_t * const*) src->data, src_stride, 0, src->height,(uint8_t * const*) dst->data, dst_stride);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1017,7 +998,6 @@ void* yuv_init_swscaler(VJFrame *src, VJFrame *dst, sws_template *tmpl, int cpu_
|
||||
if(!s)
|
||||
return NULL;
|
||||
|
||||
int sws_type = 0;
|
||||
int cpu_flags = 0;
|
||||
|
||||
#ifdef STRICT_CHECKING
|
||||
@@ -1109,7 +1089,6 @@ void* yuv_init_swscaler(VJFrame *src, VJFrame *dst, sws_template *tmpl, int cpu_
|
||||
|
||||
static void *yuv_init_sws_cached_context(vj_sws *s, VJFrame *src, VJFrame *dst, sws_template *tmpl, int cpu_flagss)
|
||||
{
|
||||
int sws_type = 0;
|
||||
int cpu_flags = 0;
|
||||
|
||||
#ifdef STRICT_CHECKING
|
||||
@@ -1235,13 +1214,6 @@ void yuv_crop(VJFrame *src, VJFrame *dst, VJRectangle *rect )
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
uint8_t *sy = src->data[0];
|
||||
uint8_t *su = src->data[1];
|
||||
uint8_t *sv = src->data[2];
|
||||
|
||||
uint8_t *dstY = dst->data[0];
|
||||
uint8_t *dstU = dst->data[1];
|
||||
uint8_t *dstV = dst->data[2];
|
||||
int i = 0;
|
||||
|
||||
for( i = 0 ; i < 3 ; i ++ )
|
||||
@@ -1306,11 +1278,10 @@ void yuv_free_swscaler(void *sws)
|
||||
void yuv_convert_and_scale_gray_rgb(void *sws,VJFrame *src, VJFrame *dst)
|
||||
{
|
||||
vj_sws *s = (vj_sws*) sws;
|
||||
int src_stride[3] = { src->width,0,0 };
|
||||
int dst_stride[3] = { src->width * 3, 0,0 };
|
||||
const int src_stride[3] = { src->width,0,0 };
|
||||
const int dst_stride[3] = { src->width * 3, 0,0 };
|
||||
|
||||
sws_scale( s->sws, src->data,src_stride, 0,src->height,
|
||||
dst->data, dst_stride );
|
||||
sws_scale( s->sws,(const uint8_t * const*) src->data,src_stride, 0,src->height,(uint8_t * const*)dst->data, dst_stride );
|
||||
}
|
||||
void yuv_convert_and_scale_from_rgb(void *sws , VJFrame *src, VJFrame *dst)
|
||||
{
|
||||
@@ -1318,11 +1289,10 @@ void yuv_convert_and_scale_from_rgb(void *sws , VJFrame *src, VJFrame *dst)
|
||||
int n = 3;
|
||||
if( src->format == PIX_FMT_RGBA || src->format == PIX_FMT_BGRA || src->format == PIX_FMT_ARGB || src->format == PIX_FMT_BGR32 || src->format == PIX_FMT_RGB32 )
|
||||
n = 4;
|
||||
int src_stride[3] = { src->width*n,0,0};
|
||||
int dst_stride[3] = { dst->width,dst->uv_width,dst->uv_width };
|
||||
const int src_stride[3] = { src->width*n,0,0};
|
||||
const int dst_stride[3] = { dst->width,dst->uv_width,dst->uv_width };
|
||||
|
||||
sws_scale( s->sws, src->data, src_stride, 0, src->height,
|
||||
dst->data, dst_stride );
|
||||
sws_scale( s->sws,(const uint8_t * const*) src->data, src_stride, 0, src->height, (uint8_t * const*)dst->data, dst_stride );
|
||||
}
|
||||
|
||||
void yuv_convert_and_scale_rgb(void *sws , VJFrame *src, VJFrame *dst)
|
||||
@@ -1333,17 +1303,16 @@ void yuv_convert_and_scale_rgb(void *sws , VJFrame *src, VJFrame *dst)
|
||||
dst->format == PIX_FMT_RGB32 || dst->format == PIX_FMT_BGR32 )
|
||||
n = 4;
|
||||
|
||||
int src_stride[3] = { src->width,src->uv_width,src->uv_width };
|
||||
int dst_stride[3] = { dst->width*n,0,0 };
|
||||
const int src_stride[3] = { src->width,src->uv_width,src->uv_width };
|
||||
const int dst_stride[3] = { dst->width*n,0,0 };
|
||||
|
||||
sws_scale( s->sws, src->data, src_stride, 0, src->height,
|
||||
dst->data, dst_stride );
|
||||
sws_scale( s->sws,(const uint8_t * const*) src->data, src_stride, 0, src->height,(uint8_t * const*) dst->data, dst_stride );
|
||||
}
|
||||
void yuv_convert_and_scale(void *sws , VJFrame *src, VJFrame *dst)
|
||||
{
|
||||
vj_sws *s = (vj_sws*) sws;
|
||||
int src_stride[3] = { src->width,0,0 };
|
||||
int dst_stride[3] = { dst->width,0,0 };
|
||||
// const int src_stride[3] = { src->width,0,0 };
|
||||
// const int dst_stride[3] = { dst->width,0,0 };
|
||||
/*
|
||||
int n = 0;
|
||||
if( src->format == PIX_FMT_RGBA || src->format == PIX_FMT_BGRA || src->format == PIX_FMT_ARGB ||
|
||||
@@ -1367,26 +1336,23 @@ void yuv_convert_and_scale(void *sws , VJFrame *src, VJFrame *dst)
|
||||
dst_stride[1] = dst->uv_width;
|
||||
dst_stride[2] = dst->uv_width;
|
||||
*/
|
||||
sws_scale( s->sws, src->data, src->stride, 0, src->height,
|
||||
dst->data, dst->stride );
|
||||
sws_scale( s->sws,(const uint8_t * const*) src->data, src->stride, 0, src->height,(uint8_t * const*)dst->data, dst->stride );
|
||||
}
|
||||
void yuv_convert_and_scale_grey(void *sws , VJFrame *src, VJFrame *dst)
|
||||
{
|
||||
vj_sws *s = (vj_sws*) sws;
|
||||
int src_stride[3] = { src->width,0,0 };
|
||||
int dst_stride[3] = { dst->width,0,0 };
|
||||
const int src_stride[3] = { src->width,0,0 };
|
||||
const int dst_stride[3] = { dst->width,0,0 };
|
||||
|
||||
sws_scale( s->sws, src->data, src_stride, 0, src->height,
|
||||
dst->data, dst_stride );
|
||||
sws_scale( s->sws,(const uint8_t * const*) src->data, src_stride, 0, src->height,(uint8_t * const*) dst->data, dst_stride );
|
||||
}
|
||||
void yuv_convert_and_scale_packed(void *sws , VJFrame *src, VJFrame *dst)
|
||||
{
|
||||
vj_sws *s = (vj_sws*) sws;
|
||||
int src_stride[3] = { src->width,src->uv_width,src->uv_width };
|
||||
int dst_stride[3] = { dst->width * 2,0,0 };
|
||||
const int src_stride[3] = { src->width,src->uv_width,src->uv_width };
|
||||
const int dst_stride[3] = { dst->width * 2,0,0 };
|
||||
|
||||
sws_scale( s->sws, src->data, src_stride, 0, src->height,
|
||||
dst->data, dst_stride );
|
||||
sws_scale( s->sws,(const uint8_t * const*) src->data, src_stride, 0, src->height,(uint8_t * const*)dst->data, dst_stride );
|
||||
}
|
||||
|
||||
int yuv_sws_get_cpu_flags(void)
|
||||
@@ -1597,7 +1563,7 @@ void yuy2_scale_pixels_from_yuv( uint8_t *plane, int len )
|
||||
if(vj_task_available() ) {
|
||||
uint8_t *in[4] = { plane,NULL,NULL,NULL };
|
||||
int strides[4] = { len * 2, 0, 0, 0 };
|
||||
vj_task_run( in,in,NULL, strides, 1, &yuy2_scale_pixels_from_yuv_job );
|
||||
vj_task_run( in,in,NULL, strides, 1, (performer_job_routine) &yuy2_scale_pixels_from_yuv_job );
|
||||
}
|
||||
else {
|
||||
unsigned int rlen = 2 * len ;
|
||||
@@ -1630,7 +1596,7 @@ void yuy2_scale_pixels_from_ycbcr( uint8_t *plane, int len )
|
||||
if(vj_task_available() ) {
|
||||
uint8_t *in[4] = { plane,NULL,NULL,NULL };
|
||||
int strides[4] = { len * 2, 0, 0, 0 };
|
||||
vj_task_run( in,in,NULL, strides, 1, &yuy2_scale_pixels_from_ycbcr_job );
|
||||
vj_task_run( in,in,NULL, strides, 1, (performer_job_routine) &yuy2_scale_pixels_from_ycbcr_job );
|
||||
}
|
||||
else {
|
||||
unsigned int rlen = 2 * len ;
|
||||
|
||||
@@ -764,7 +764,6 @@ static int veejay_start_playing_sample( veejay_t *info, int sample_id )
|
||||
#endif
|
||||
if(info->composite )
|
||||
{
|
||||
int cur_composite = info->settings->composite;
|
||||
info->settings->composite = sample_load_composite_config( info->composite , sample_id );
|
||||
void *cur = sample_get_composite_view(sample_id);
|
||||
switch(info->settings->composite) {
|
||||
@@ -836,7 +835,6 @@ static int veejay_start_playing_stream(veejay_t *info, int stream_id )
|
||||
info->uc->sample_id = stream_id;
|
||||
if(info->composite )
|
||||
{
|
||||
int cur_composite = info->settings->composite;
|
||||
info->settings->composite = vj_tag_load_composite_config( info->composite , stream_id );
|
||||
void *cur =vj_tag_get_composite_view(stream_id);
|
||||
switch(info->settings->composite) {
|
||||
@@ -1069,7 +1067,9 @@ void veejay_stop_sampling(veejay_t * info)
|
||||
static int veejay_screen_update(veejay_t * info )
|
||||
{
|
||||
uint8_t *frame[3];
|
||||
#ifdef HAVE_DIRECTFB
|
||||
uint8_t *c_frame[3];
|
||||
#endif
|
||||
int i = 0;
|
||||
int skip_update = 0;
|
||||
|
||||
@@ -1307,7 +1307,6 @@ void veejay_pipe_write_status(veejay_t * info)
|
||||
video_playback_setup *settings =
|
||||
(video_playback_setup *) info->settings;
|
||||
int d_len = 0;
|
||||
int res = 0;
|
||||
int pm = info->uc->playback_mode;
|
||||
int total_slots = sample_size()-1;
|
||||
int tags = vj_tag_true_size() -1;
|
||||
@@ -1736,7 +1735,6 @@ static void veejay_event_handle(veejay_t *info)
|
||||
|
||||
static void *veejay_geo_stat_thread(void *arg)
|
||||
{
|
||||
veejay_t *info = (veejay_t *) arg;
|
||||
/* Allow easy shutting down by other processes... */
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
||||
@@ -2021,7 +2019,6 @@ int veejay_init(veejay_t * info, int x, int y,char *arg, int def_tags, int gen_t
|
||||
available_diskspace();
|
||||
|
||||
int id=0;
|
||||
int mode=0;
|
||||
int has_config = 0;
|
||||
|
||||
if(info->load_action_file)
|
||||
@@ -2392,7 +2389,6 @@ int veejay_init(veejay_t * info, int x, int y,char *arg, int def_tags, int gen_t
|
||||
if(def_tags && id <= 0)
|
||||
{
|
||||
char vidfile[1024];
|
||||
int n = vj_tag_num_devices();
|
||||
int default_chan = 1;
|
||||
char *chanid = getenv("VEEJAY_DEFAULT_CHANNEL");
|
||||
if(chanid != NULL )
|
||||
@@ -2497,9 +2493,9 @@ int veejay_init(veejay_t * info, int x, int y,char *arg, int def_tags, int gen_t
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sched_ncpus() {
|
||||
/*static int sched_ncpus() {
|
||||
return sysconf( _SC_NPROCESSORS_ONLN );
|
||||
}
|
||||
}*/
|
||||
|
||||
static void veejay_schedule_fifo(veejay_t *info, int pid )
|
||||
{
|
||||
@@ -3173,7 +3169,6 @@ veejay_t *veejay_malloc()
|
||||
|
||||
int status = 0;
|
||||
int acj = 0;
|
||||
int tl = 0;
|
||||
char *interpolate_chroma = getenv("VEEJAY_INTERPOLATE_CHROMA");
|
||||
if( interpolate_chroma ) {
|
||||
sscanf( interpolate_chroma, "%d", &status );
|
||||
@@ -3406,7 +3401,7 @@ int veejay_edit_copy(veejay_t * info, editlist *el, long start, long end)
|
||||
}
|
||||
editlist *veejay_edit_copy_to_new(veejay_t * info, editlist *el, long start, long end)
|
||||
{
|
||||
uint64_t k, i;
|
||||
uint64_t i;
|
||||
uint64_t n1 = (uint64_t) start;
|
||||
uint64_t n2 = (uint64_t) end;
|
||||
|
||||
@@ -3448,9 +3443,6 @@ editlist *veejay_edit_copy_to_new(veejay_t * info, editlist *el, long start, lon
|
||||
return NULL;
|
||||
}
|
||||
|
||||
k = 0;
|
||||
|
||||
|
||||
//veejay_msg(0, "start of framelist: %p, end = %p", &(el->frame_list[n1]), &(el->frame_list[n2+1]) );
|
||||
//veejay_msg(0, "memcpy %p, %p", el->frame_list + n1, el->frame_list + n1 + len );
|
||||
veejay_memcpy( new_el->frame_list , el->frame_list + n1, sizeof(uint64_t) * len );
|
||||
|
||||
@@ -140,9 +140,7 @@ static long vj_font_timecode_to_pos( vj_font_t *font, const char *tc );
|
||||
static srt_seq_t *vj_font_new_srt_sequence(vj_font_t *font, int id,char *text, long lo, long hi );
|
||||
static void vj_font_del_srt_sequence( vj_font_t *f, int seq_id );
|
||||
static void vj_font_store_srt_sequence( vj_font_t *f, srt_seq_t *s );
|
||||
static int font_selector( const struct dirent *dir );
|
||||
static int find_fonts(vj_font_t *ec, char *path);
|
||||
static void print_fonts(vj_font_t *ec);
|
||||
static char *select_font( vj_font_t *ec, int id );
|
||||
static void vj_font_substract_timecodes( vj_font_t *font, const char *tc_srt, long *lo, long *hi );
|
||||
static char *vj_font_split_strd( const char *str );
|
||||
@@ -151,8 +149,6 @@ static char *vj_font_split_str( const char *str );
|
||||
static char *get_font_name( vj_font_t *f,const char *font, int id );
|
||||
static int get_default_font( vj_font_t *f );
|
||||
|
||||
static int test_font( vj_font_t *f , const char *font, int id);
|
||||
|
||||
static void font_lock(vj_font_t *f)
|
||||
{
|
||||
pthread_mutex_lock( &(f->mutex) );
|
||||
@@ -1019,15 +1015,6 @@ char **vj_font_get_all_fonts( void *font )
|
||||
return res;
|
||||
}
|
||||
|
||||
static int font_selector( const struct dirent *dir )
|
||||
{
|
||||
if(strstr(dir->d_name, ".ttf" )) return 1;
|
||||
if(strstr(dir->d_name, ".TTF" )) return 1;
|
||||
// if(strstr(dir->d_name, ".pfa" )) return 1;
|
||||
// if(strstr(dir->d_name, ".pcf.gz" )) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dir_selector( const struct dirent *dir )
|
||||
{
|
||||
return 1;
|
||||
@@ -1229,118 +1216,6 @@ static char *get_font_name( vj_font_t *f,const char *font, int id )
|
||||
return fontName;
|
||||
}
|
||||
|
||||
static int test_font( vj_font_t *f , const char *font, int id)
|
||||
{
|
||||
char name[1024];
|
||||
FT_Face face;
|
||||
int error;
|
||||
FT_SfntName sn,qn,zn;
|
||||
FT_SfntName sname;
|
||||
FT_UInt snamei,snamec;
|
||||
char *name1 = NULL;
|
||||
char *name2 = NULL;
|
||||
|
||||
if ( (error = FT_New_Face( f->library, font, 0, &face )) != 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset( &qn, 0,sizeof( FT_SfntName ) );
|
||||
memset( &zn, 0, sizeof( FT_SfntName ));
|
||||
memset( &sn, 0, sizeof( FT_SfntName ));
|
||||
|
||||
// FT_Get_Sfnt_Name( face, TT_NAME_ID_FONT_FAMILY, &qn );
|
||||
|
||||
snamec = FT_Get_Sfnt_Name_Count(face);
|
||||
|
||||
for(snamei=0;snamei<snamec;snamei++) {
|
||||
|
||||
if(FT_Get_Sfnt_Name(face,snamei,&qn) != 0 )
|
||||
continue;
|
||||
|
||||
if(strlen(qn.string) == 0 )
|
||||
continue;
|
||||
|
||||
/* if( qn.platform_id == TT_PLATFORM_MICROSOFT &&
|
||||
( qn.encoding_id==TT_MS_ID_SYMBOL_CS || qn.encoding_id==TT_MS_ID_UNICODE_CS) &&
|
||||
( qn.language_id &0xff ) == 0x9) {
|
||||
*/
|
||||
switch(qn.name_id) {
|
||||
case TT_NAME_ID_FONT_FAMILY:
|
||||
if( name1 ) free(name1);
|
||||
name1=strndup(qn.string,qn.string_len);
|
||||
break;
|
||||
case TT_NAME_ID_PS_NAME:
|
||||
if(name1==NULL)
|
||||
name1=strndup(qn.string,qn.string_len);
|
||||
break;
|
||||
case TT_NAME_ID_FONT_SUBFAMILY:
|
||||
if(name2) free(name2);
|
||||
name2=strndup(qn.string,qn.string_len);
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
// }
|
||||
}
|
||||
FT_Get_Sfnt_Name( face, TT_NAME_ID_FONT_SUBFAMILY, &zn );
|
||||
|
||||
|
||||
if( !zn.string || !qn.string || qn.string_len <= 0 || zn.string_len <= 0 )
|
||||
{
|
||||
FT_Done_Face(face);
|
||||
if(name1 != NULL )
|
||||
free(name1);
|
||||
if(name2 != NULL )
|
||||
free(name2);
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
char *name1 = strndup( qn.string, qn.string_len );
|
||||
char *name2 = strndup( zn.string, zn.string_len );
|
||||
*/
|
||||
|
||||
|
||||
if(name1 == NULL || name2 == NULL ) {
|
||||
FT_Done_Face(face);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int n1 = strlen(name1);
|
||||
int n2 = n1 + strlen(name2);
|
||||
|
||||
if( n2 <= 2 || (n2+n1) > 150)
|
||||
{
|
||||
FT_Done_Face(face);
|
||||
free(name1);
|
||||
free(name2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
snprintf( name,1024,"%s (%s)", name1, name2);
|
||||
|
||||
f->font_list[id] = strdup( name );
|
||||
|
||||
free(name1);
|
||||
free(name2);
|
||||
|
||||
FT_Done_Face( face );
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void print_fonts(vj_font_t *ec)
|
||||
{
|
||||
int i;
|
||||
for(i =0 ; i < ec->font_index ; i ++ )
|
||||
{
|
||||
veejay_msg(VEEJAY_MSG_DEBUG, "[%03d] : [%s]",
|
||||
i, ec->font_list[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void vj_font_set_outline_and_border( void *font, int outline, int border)
|
||||
{
|
||||
vj_font_t *ff = (vj_font_t*) font;
|
||||
@@ -1772,7 +1647,6 @@ void *vj_font_init( int w, int h, float fps, int is_osd )
|
||||
// f->text_buffer = (srt_cycle_t*)
|
||||
// vj_calloc(sizeof(srt_cycle_t) * (sizeof(srt_cycle_t)*22500));
|
||||
// f->text_max_size = 22500;
|
||||
//print_fonts(f);
|
||||
|
||||
pthread_mutex_init( &(f->mutex), NULL );
|
||||
|
||||
@@ -1860,7 +1734,6 @@ void *vj_font_single_init( int w, int h, float fps,char *path )
|
||||
// f->text_buffer = (srt_cycle_t*)
|
||||
// vj_calloc(sizeof(srt_cycle_t) * (sizeof(srt_cycle_t)*22500));
|
||||
// f->text_max_size = 22500;
|
||||
//print_fonts(f);
|
||||
|
||||
pthread_mutex_init( &(f->mutex), NULL );
|
||||
|
||||
|
||||
@@ -736,9 +736,6 @@ int vj_perform_init(veejay_t * info)
|
||||
|
||||
lzo_ = lzo_new();
|
||||
|
||||
int vp = 0; int frontback = 0;
|
||||
int pvp = 0;
|
||||
|
||||
veejay_memset( &pvar_, 0, sizeof( varcache_t));
|
||||
|
||||
return 1;
|
||||
@@ -1251,11 +1248,6 @@ void vj_perform_get_output_frame_420p( veejay_t *info, uint8_t **frame, int w, i
|
||||
|
||||
if( video_output_buffer_convert == 0 )
|
||||
{
|
||||
uint8_t *src_frame[3];
|
||||
src_frame[0] = video_output_buffer[0]->Y;
|
||||
src_frame[1] = video_output_buffer[0]->Cb;
|
||||
src_frame[2] = video_output_buffer[0]->Cr;
|
||||
|
||||
VJFrame *srci = yuv_yuv_template( video_output_buffer[0]->Y, video_output_buffer[0]->Cb,
|
||||
video_output_buffer[0]->Cr, w, h,
|
||||
get_ffmpeg_pixfmt(info->pixel_format));
|
||||
|
||||
@@ -57,7 +57,9 @@ static void vj_flush(vj_client *sayvims,int frames) {
|
||||
char sta_len[6];
|
||||
bzero(sta_len, 6 );
|
||||
int nb = vj_client_read( sayvims, V_STATUS, sta_len, 5 );
|
||||
if(sta_len[0] == 'V' )
|
||||
if( nb <= 0 )
|
||||
break;
|
||||
if(sta_len[0] == 'V' )
|
||||
{
|
||||
int bytes = 0;
|
||||
sscanf( sta_len + 1, "%03d", &bytes );
|
||||
@@ -69,8 +71,8 @@ static void vj_flush(vj_client *sayvims,int frames) {
|
||||
{
|
||||
frames -- ;
|
||||
}
|
||||
if( n<= 0)
|
||||
break;
|
||||
if( n<= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
|
||||
#ifndef VJTASK_H
|
||||
#define VJTASK_H
|
||||
typedef void *(*performer_job_routine)(void *);
|
||||
//typedef void *(*performer_job_routine)(void *);
|
||||
|
||||
typedef void *(*performer_job_routine)(void(*)(void*));
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user