From d1c869d2c0d0e6fb5efcb1cb1558ea0fac2aa7a1 Mon Sep 17 00:00:00 2001 From: "Jerome Blanchi aka d.j.a.y" Date: Wed, 29 May 2019 01:30:38 +0200 Subject: [PATCH] Indenting corrections --- .../veejay-server/libvje/effects/flip.c | 158 +++++++++--------- .../veejay-server/libvje/effects/raster.c | 52 +++--- 2 files changed, 105 insertions(+), 105 deletions(-) diff --git a/veejay-current/veejay-server/libvje/effects/flip.c b/veejay-current/veejay-server/libvje/effects/flip.c index b12d11ed..c5a563d9 100644 --- a/veejay-current/veejay-server/libvje/effects/flip.c +++ b/veejay-current/veejay-server/libvje/effects/flip.c @@ -63,50 +63,50 @@ vj_effect *flip_init(int w, int h) **********************************************************************************************/ static void flip_x_yuvdata(VJFrame *frame) { - unsigned int y = frame->height, x, x2; - unsigned int pos = 0; - const unsigned int w2 = frame->width >> 1; + unsigned int y = frame->height, x, x2; + unsigned int pos = 0; + const unsigned int w2 = frame->width >> 1; const unsigned int w3 = frame->width - 1; - uint8_t temp; - const unsigned int uv_width = frame->uv_width -1; - unsigned int uy = frame->uv_height; - const unsigned int uw2 = w2 >> frame->shift_h; - uint8_t *Y = frame->data[0]; - uint8_t *Cb = frame->data[1]; - uint8_t *Cr = frame->data[2]; + uint8_t temp; + const unsigned int uv_width = frame->uv_width -1; + unsigned int uy = frame->uv_height; + const unsigned int uw2 = w2 >> frame->shift_h; + uint8_t *Y = frame->data[0]; + uint8_t *Cb = frame->data[1]; + uint8_t *Cr = frame->data[2]; - /* Luminance */ - do { - x = w2; + /* Luminance */ + do { + x = w2; x2 = w3; - do { - temp = Y[pos + x2]; - Y[pos + x2] = Y[pos + w3 - x2]; - Y[pos + w3 - x2] = temp; + do { + temp = Y[pos + x2]; + Y[pos + x2] = Y[pos + w3 - x2]; + Y[pos + w3 - x2] = temp; --x2; - } while (x--); + } while (x--); // Y[pos]=255; - pos += frame->width; - } while (--y); + pos += frame->width; + } while (--y); - pos = 0; + pos = 0; - /* Chrominance */ - do { - x = uw2; + /* Chrominance */ + do { + x = uw2; x2 = uv_width; - do { - temp = Cb[pos + x2]; - Cb[pos + x2] = Cb[pos + uv_width - x2]; - Cb[pos + uv_width - x2] = temp; - temp = Cr[pos + x2]; - Cr[pos + x2] = Cr[pos + uv_width - x2]; - Cr[pos + uv_width - x2] = temp; + do { + temp = Cb[pos + x2]; + Cb[pos + x2] = Cb[pos + uv_width - x2]; + Cb[pos + uv_width - x2] = temp; + temp = Cr[pos + x2]; + Cr[pos + x2] = Cr[pos + uv_width - x2]; + Cr[pos + uv_width - x2] = temp; --x2; - } while (x--); + } while (x--); - pos += frame->uv_width; - } while (--uy); + pos += frame->uv_width; + } while (--uy); } @@ -118,49 +118,49 @@ static void flip_x_yuvdata(VJFrame *frame) **********************************************************************************************/ static void flip_y_yuvdata(VJFrame *frame) { - unsigned int x, pos_a = 0, pos_b; - uint8_t temp; - unsigned int w1 = frame->width - 1; - unsigned int y = frame->height >> 1; - unsigned int uy = y >> frame->shift_v; - const unsigned int uv_height = frame->uv_height; - const unsigned int uv_width = frame->uv_width; - const unsigned int uw1 = ( frame->width >> frame->shift_h ) - 1; - uint8_t *Y = frame->data[0]; - uint8_t *Cb = frame->data[1]; - uint8_t *Cr = frame->data[2]; + unsigned int x, pos_a = 0, pos_b; + uint8_t temp; + unsigned int w1 = frame->width - 1; + unsigned int y = frame->height >> 1; + unsigned int uy = y >> frame->shift_v; + const unsigned int uv_height = frame->uv_height; + const unsigned int uv_width = frame->uv_width; + const unsigned int uw1 = ( frame->width >> frame->shift_h ) - 1; + uint8_t *Y = frame->data[0]; + uint8_t *Cb = frame->data[1]; + uint8_t *Cr = frame->data[2]; - /* Luminance */ - pos_b = (frame->height ) * frame->width; - do { - x = w1; - do { - temp = Y[pos_a + x]; - Y[pos_a + x] = Y[pos_b + x]; - Y[pos_b + x] = temp; - } while (x--); - pos_a += frame->width; - pos_b -= frame->width; - } while (--y); + /* Luminance */ + pos_b = (frame->height ) * frame->width; + do { + x = w1; + do { + temp = Y[pos_a + x]; + Y[pos_a + x] = Y[pos_b + x]; + Y[pos_b + x] = temp; + } while (x--); + pos_a += frame->width; + pos_b -= frame->width; + } while (--y); - /* Chrominance */ - pos_a = 0; - pos_b = (uv_height ) * uv_width; - do { - x = uw1; - do { - temp = Cb[pos_a + x]; - Cb[pos_a + x] = Cb[pos_b + x]; - Cb[pos_b + x] = temp; + /* Chrominance */ + pos_a = 0; + pos_b = (uv_height ) * uv_width; + do { + x = uw1; + do { + temp = Cb[pos_a + x]; + Cb[pos_a + x] = Cb[pos_b + x]; + Cb[pos_b + x] = temp; - temp = Cr[pos_a + x]; - Cr[pos_a + x] = Cr[pos_b + x]; - Cr[pos_b + x] = temp; - - } while (x--); - pos_a += uv_width; - pos_b -= uv_width; - } while (--uy); + temp = Cr[pos_a + x]; + Cr[pos_a + x] = Cr[pos_b + x]; + Cr[pos_b + x] = temp; + + } while (x--); + pos_a += uv_width; + pos_b -= uv_width; + } while (--uy); } /********************************************************************************************** @@ -170,16 +170,16 @@ static void flip_y_yuvdata(VJFrame *frame) **********************************************************************************************/ void flip_both_yuvdata(VJFrame *frame) { - uint8_t temp; - uint8_t *Y = frame->data[0]; - uint8_t *Cb = frame->data[1]; - uint8_t *Cr = frame->data[2]; + uint8_t temp; + uint8_t *Y = frame->data[0]; + uint8_t *Cb = frame->data[1]; + uint8_t *Cr = frame->data[2]; const unsigned int h2 = (frame->height >> 1); unsigned int x, y, pos_a, pos_b; pos_a = 0; pos_b = (frame->height * frame->width)-1; - /* Luminance & Chrominance*/ + /* Luminance & Chrominance*/ for (y = 0 ; y < h2 ; y++) { for (x = 0 ; x < frame->width ; x++ ) diff --git a/veejay-current/veejay-server/libvje/effects/raster.c b/veejay-current/veejay-server/libvje/effects/raster.c index 6c537a77..f1c2712c 100644 --- a/veejay-current/veejay-server/libvje/effects/raster.c +++ b/veejay-current/veejay-server/libvje/effects/raster.c @@ -29,23 +29,23 @@ vj_effect *raster_init(int w, int h) vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); ve->num_params = 2; - ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */ - ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */ - ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */ + ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */ + ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */ + ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */ ve->limits[0][0] = 4; ve->limits[1][0] = h/4; ve->limits[0][1] = 0; ve->limits[1][1] = 1; ve->defaults[0] = 4; ve->defaults[1] = 1; - ve->description = "Grid"; + ve->description = "Grid"; ve->sub_format = 1; ve->extra_frame = 0; - ve->has_user = 0; - ve->param_description = vje_build_param_list( ve->num_params, "Grid size", "Mode"); + ve->has_user = 0; + ve->param_description = vje_build_param_list( ve->num_params, "Grid size", "Mode"); - ve->hints = vje_init_value_hint_list( ve->num_params ); - vje_build_value_hint_list( ve->hints, ve->limits[1][1], 1,"Black", "White" ); + ve->hints = vje_init_value_hint_list( ve->num_params ); + vje_build_value_hint_list( ve->hints, ve->limits[1][1], 1,"Black", "White" ); return ve; } @@ -65,31 +65,31 @@ void raster_free() void raster_apply(VJFrame *frame, int val, int mode) { - int x,y, yval; - uint8_t *Y = frame->data[0]; - uint8_t *Cb= frame->data[1]; - uint8_t *Cr= frame->data[2]; - const unsigned int width = frame->width; - const unsigned int height = frame->height; + int x,y, yval; + uint8_t *Y = frame->data[0]; + uint8_t *Cb= frame->data[1]; + uint8_t *Cr= frame->data[2]; + const unsigned int width = frame->width; + const unsigned int height = frame->height; - if(val == 0 ) - return; + if(val == 0 ) + return; for(x=0; x < width; x++) { xval[x] = x%val; } - uint8_t pixel_color = mode ? pixel_Y_hi_ : pixel_Y_lo_; + uint8_t pixel_color = mode ? pixel_Y_hi_ : pixel_Y_lo_; - for(y=0; y < height; y++) - { + for(y=0; y < height; y++) + { yval = y%val; - for(x=0; x < width; x++) - { - Y[y*width+x] = ((xval[x]>1)? ((yval>1) ? Y[y*width+x]: pixel_color):pixel_color); - Cb[y*width+x] = ((xval[x]>1)? ((yval>1) ? Cb[y*width+x]:128):128); - Cr[y*width+x] = ((xval[x]>1)? ((yval>1) ? Cr[y*width+x]:128):128); - } - } + for(x=0; x < width; x++) + { + Y[y*width+x] = ((xval[x]>1)? ((yval>1) ? Y[y*width+x]: pixel_color):pixel_color); + Cb[y*width+x] = ((xval[x]>1)? ((yval>1) ? Cb[y*width+x]:128):128); + Cr[y*width+x] = ((xval[x]>1)? ((yval>1) ? Cr[y*width+x]:128):128); + } + } }