From 0a16e81deca325ee7d9e636b75b53b2cdb9dd7fd Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 6 Feb 2000 15:48:53 +0000 Subject: [PATCH] =?utf8?q?=20.=20yuv=20pour=20le=208=20bits=20noir=20et=20?= =?utf8?q?blanc=20=20.=20yuv=208=20bits=20couleur=20(bon=20c'est=20moche?= =?utf8?q?=20pour=20le=20moment,=20mais=20=EF=BF=BDa=20vient)=20=20.=20cor?= =?utf8?q?rection=20de=20"convertion"=20en=20"conversion"=20un=20peu=20par?= =?utf8?q?tout=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit � faire encore : allouer dynamiquement la lookup table pour la YUV 8 bits, parce que directement dans p_vout �a pue un peu, faire le changement de palette qui va bien au passage couleur / n&b. --- include/video_output.h | 5 +- include/vpar_synchro.h | 2 + src/video_output/video_fb.c | 107 ++++++++++++++- src/video_output/video_yuv.c | 223 +++++++++++++++++--------------- src/video_parser/vpar_synchro.c | 2 +- 5 files changed, 229 insertions(+), 110 deletions(-) diff --git a/include/video_output.h b/include/video_output.h index 5ee33da9e2..00a56b74fe 100644 --- a/include/video_output.h +++ b/include/video_output.h @@ -117,12 +117,15 @@ typedef struct vout_thread_s int i_green_lshift, i_green_rshift; /* green shifts */ int i_blue_lshift, i_blue_rshift; /* blue shifts */ - /* Usefull pre-calculated pixel values - these are not supposed to be + /* Useful pre-calculated pixel values - these are not supposed to be * accurate values, but rather values looking nice, given their usage. */ u32 i_white_pixel; /* white */ u32 i_black_pixel; /* black */ u32 i_gray_pixel; /* gray */ u32 i_blue_pixel; /* blue */ + + /* Palette */ + u8 lookup[1377]; /* lookup table for 8 bpp palette */ /* Pictures and rendering properties */ boolean_t b_grayscale; /* color or grayscale display */ diff --git a/include/vpar_synchro.h b/include/vpar_synchro.h index 96c911ca07..e01589d4e0 100644 --- a/include/vpar_synchro.h +++ b/include/vpar_synchro.h @@ -15,6 +15,8 @@ * "video_fifo.h" *****************************************************************************/ +#define SAM_SYNCHRO + /***************************************************************************** * video_synchro_t and video_synchro_tab_s : timers for the video synchro *****************************************************************************/ diff --git a/src/video_output/video_fb.c b/src/video_output/video_fb.c index a003f56760..0a14d11f9a 100644 --- a/src/video_output/video_fb.c +++ b/src/video_output/video_fb.c @@ -31,6 +31,9 @@ #include "intf_msg.h" #include "main.h" +#define RGB_MIN -24 +#define RGB_MAX 283 + /****************************************************************************** * vout_sys_t: video output framebuffer method descriptor ****************************************************************************** @@ -46,6 +49,10 @@ typedef struct vout_sys_s /* Video memory */ byte_t * p_video; /* base adress */ size_t i_page_size; /* page size */ + + struct fb_cmap fb_cmap; /* original colormap */ + unsigned short *fb_palette; /* original palette */ + } vout_sys_t; /****************************************************************************** @@ -53,6 +60,8 @@ typedef struct vout_sys_s ******************************************************************************/ static int FBOpenDisplay ( vout_thread_t *p_vout ); static void FBCloseDisplay ( vout_thread_t *p_vout ); +static void FBInitBWPalette ( vout_thread_t *p_vout ); +static void FBInitRGBPalette( vout_thread_t *p_vout ); /****************************************************************************** * vout_SysCreate: allocates FB video thread output method @@ -149,7 +158,7 @@ static int FBOpenDisplay( vout_thread_t *p_vout ) { char *psz_device; /* framebuffer device path */ struct fb_fix_screeninfo fix_info; /* framebuffer fix information */ - + /* framebuffer palette information */ /* Open framebuffer device */ psz_device = main_GetPszVariable( VOUT_FB_DEV_VAR, VOUT_FB_DEV_DEFAULT ); p_vout->p_sys->i_fb_dev = open( psz_device, O_RDWR); @@ -203,6 +212,20 @@ static int FBOpenDisplay( vout_thread_t *p_vout ) switch( p_vout->i_screen_depth ) { case 8: /* 8 bpp */ + p_vout->p_sys->fb_palette = malloc( 8 * 256 * sizeof(unsigned short) ); + p_vout->p_sys->fb_cmap.start = 0; + p_vout->p_sys->fb_cmap.len = 256; + p_vout->p_sys->fb_cmap.red = p_vout->p_sys->fb_palette; + p_vout->p_sys->fb_cmap.green = p_vout->p_sys->fb_palette + 256 * sizeof(unsigned short); + p_vout->p_sys->fb_cmap.blue = p_vout->p_sys->fb_palette + 2 * 256 * sizeof(unsigned short); + p_vout->p_sys->fb_cmap.transp = p_vout->p_sys->fb_palette + 3 * 256 * sizeof(unsigned short); + + ioctl( p_vout->p_sys->i_fb_dev, FBIOGETCMAP, &p_vout->p_sys->fb_cmap ); + + /* initializes black & white palette */ + //FBInitBWPalette( p_vout ); + FBInitRGBPalette( p_vout ); + p_vout->i_bytes_per_pixel = 1; p_vout->i_bytes_per_line = p_vout->i_width; break; @@ -260,7 +283,89 @@ static int FBOpenDisplay( vout_thread_t *p_vout ) ******************************************************************************/ static void FBCloseDisplay( vout_thread_t *p_vout ) { + /* Restore palette */ + if( p_vout->i_screen_depth == 8 ); + { + ioctl( p_vout->p_sys->i_fb_dev, FBIOPUTCMAP, &p_vout->p_sys->fb_cmap ); + free( p_vout->p_sys->fb_palette ); + } + // Destroy window and close display close( p_vout->p_sys->i_fb_dev ); } +/***************************************************************************** + * FBInitRGBPalette: initialize color palette for 8 bpp + *****************************************************************************/ +static void FBInitRGBPalette( vout_thread_t *p_vout ) +{ + int y,u,v; + float r,g,b; + unsigned int counter = 0; + unsigned int allocated = 0; + unsigned int lastallocated = 0; + unsigned short red[256], green[256], blue[256], transp[256]; + struct fb_cmap cmap = { 0, 256, red, green, blue, transp }; + + for ( y = 0; y <= 256; y += 16 ) + for ( u = -256; u <= 256; u += 64 ) + for ( v = -256; v <= 256; v += 64 ) + { + r = (0.99 * y + 1.0 * u - 0.01 * v); + g = (1.005085 * y - 0.508475 * u - 0.181356 * v); + b = (1.0 * y + 1.0 * v); + + if( r > RGB_MIN && g > RGB_MIN && b > RGB_MIN + && r < RGB_MAX && g < RGB_MAX && b < RGB_MAX ) + { + if(allocated == 256) { fprintf(stderr, "sorry, no colors left\n"); exit(1); } + if(r<0) r=0; + if(g<0) g=0; + if(b<0) b=0; + if(r>255) r=255; + if(g>255) g=255; + if(b>255) b=255; + + red[allocated] = (int)r << 8; + green[allocated] = (int)g << 8; + blue[allocated] = (int)b << 8; + transp[allocated] = 0; + + u += 256; + v += 256; + //printf("%x (%i:%i:%i) %i %i %i\n", (y>>4)*81 + (u>>6)*9 + (v>>6), y>>4, u>>6, v>>6, (int)r, (int)g, (int)b); + //printf("%i %i\n", counter, (y>>4)*81 + (u>>6)*9 + (v>>6) ); + + u -= 256; + v -= 256; + /* allocate color */ + p_vout->lookup[counter] = allocated; + allocated++; + /* set last allocated index */ + lastallocated = allocated - 1; + } + else p_vout->lookup[counter] = lastallocated; + + counter++; + } + + ioctl( p_vout->p_sys->i_fb_dev, FBIOPUTCMAP, &cmap ); +} + +/***************************************************************************** + * FBInitBWPalette: initialize grayscale palette for 8 bpp + *****************************************************************************/ +static void FBInitBWPalette( vout_thread_t *p_vout ) +{ + unsigned int i; + unsigned short gamma[256], transp[256]; + struct fb_cmap cmap = { 0, 256, gamma, gamma, gamma, transp }; + + for( i=0; i<256; i++ ) + { + gamma[i] = i << 8; + transp[i] = 0; + } + + ioctl( p_vout->p_sys->i_fb_dev, FBIOPUTCMAP, &cmap ); +} diff --git a/src/video_output/video_yuv.c b/src/video_output/video_yuv.c index c67ee33840..4937367c11 100644 --- a/src/video_output/video_yuv.c +++ b/src/video_output/video_yuv.c @@ -61,9 +61,9 @@ const int MATRIX_COEFFICIENTS_TABLE[8][4] = {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */ }; -/* Margins and offsets in convertion tables - Margins are used in case a RGB - * RGB convertion would give a value outside the 0-255 range. Offsets have been - * calculated to avoid using the same cache line for 2 tables. Convertion tables +/* Margins and offsets in conversion tables - Margins are used in case a RGB + * RGB conversion would give a value outside the 0-255 range. Offsets have been + * calculated to avoid using the same cache line for 2 tables. conversion tables * are 2*MARGIN + 256 long and stores pixels.*/ #define RED_MARGIN 178 #define GREEN_MARGIN 135 @@ -141,10 +141,10 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data int i_matrix_coefficients ); /***************************************************************************** - * CONVERT_YUV_PIXEL, CONVERT_Y_PIXEL: pixel convertion blocks + * CONVERT_YUV_PIXEL, CONVERT_Y_PIXEL: pixel conversion blocks ***************************************************************************** - * These convertion routines are used by YUV convertion functions. - * Convertion are made from p_y, p_u, p_v, which are modified, to p_buffer, + * These conversion routines are used by YUV conversion functions. + * conversion are made from p_y, p_u, p_v, which are modified, to p_buffer, * which is also modified. *****************************************************************************/ #define CONVERT_Y_PIXEL( BPP ) \ @@ -172,7 +172,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data #define SCALE_WIDTH \ if( b_horizontal_scaling ) \ { \ - /* Horizontal scaling, convertion has been done to buffer. \ + /* Horizontal scaling, conversion has been done to buffer. \ * Rewind buffer and offset, then copy and scale line */ \ p_buffer = p_buffer_start; \ p_offset = p_offset_start; \ @@ -199,7 +199,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data } \ else \ { \ - /* No scaling, convertion has been done directly in picture memory. \ + /* No scaling, conversion has been done directly in picture memory. \ * Increment of picture pointer to end of line is still needed */ \ p_pic += i_pic_width + i_pic_line_width; \ } \ @@ -208,7 +208,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data * SCALE_HEIGHT: handle vertical scaling ***************************************************************************** * This macro handle vertical scaling for a picture. CHROMA may be 420, 422 or - * 444 for RGB convertion, or 400 for gray convertion. It works for 1, 2, 3 + * 444 for RGB conversion, or 400 for gray convertion. It works for 1, 2, 3 * and 4 Bpp. *****************************************************************************/ #define SCALE_HEIGHT( CHROMA, BPP ) \ @@ -312,7 +312,7 @@ int vout_InitYUV( vout_thread_t *p_vout ) return( 1 ); } - /* Allocate memory for convertion buffer and offset array */ + /* Allocate memory for conversion buffer and offset array */ p_vout->yuv.p_buffer = malloc( VOUT_MAX_WIDTH * p_vout->i_bytes_per_pixel ); if( p_vout->yuv.p_buffer == NULL ) { @@ -578,9 +578,9 @@ static void SetYUV( vout_thread_t *p_vout ) } /***************************************************************************** - * SetOffset: build offset array for convertion functions + * SetOffset: build offset array for conversion functions ***************************************************************************** - * This function will build an offset array used in later convertion functions. + * This function will build an offset array used in later conversion functions. * It will also set horizontal and vertical scaling indicators. *****************************************************************************/ static void SetOffset( int i_width, int i_height, int i_pic_width, int i_pic_height, @@ -625,7 +625,7 @@ static void SetOffset( int i_width, int i_height, int i_pic_width, int i_pic_hei } else { - /* No horizontal scaling: YUV convertion is done directly to picture */ + /* No horizontal scaling: YUV conversion is done directly to picture */ *pb_h_scaling = 0; } @@ -659,10 +659,10 @@ static void ConvertY4Gray8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_y, int i_x, i_y; /* horizontal and vertical indexes */ int i_scale_count; /* scale modulo counter */ int i_chroma_width; /* chroma width, not used */ - u8 * p_gray; /* base convertion table */ + u8 * p_gray; /* base conversion table */ u8 * p_pic_start; /* beginning of the current line for copy */ - u8 * p_buffer_start; /* convertion buffer start */ - u8 * p_buffer; /* convertion buffer pointer */ + u8 * p_buffer_start; /* conversion buffer start */ + u8 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -677,7 +677,7 @@ static void ConvertY4Gray8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_y, &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -685,28 +685,28 @@ static void ConvertY4Gray8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_y, /* Mark beginnning of line for possible later line copy, and initialize * buffer */ p_pic_start = p_pic; - p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; + p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; - *p_buffer++ = p_gray[ *p_y++ ]; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; + *p_buffer++ = *p_y++; } /* Do horizontal and vertical scaling */ @@ -727,10 +727,10 @@ static void ConvertY4Gray16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t *p_y int i_x, i_y; /* horizontal and vertical indexes */ int i_scale_count; /* scale modulo counter */ int i_chroma_width; /* chroma width, not used */ - u16 * p_gray; /* base convertion table */ + u16 * p_gray; /* base conversion table */ u16 * p_pic_start; /* beginning of the current line for copy */ - u16 * p_buffer_start; /* convertion buffer start */ - u16 * p_buffer; /* convertion buffer pointer */ + u16 * p_buffer_start; /* conversion buffer start */ + u16 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -745,7 +745,7 @@ static void ConvertY4Gray16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t *p_y &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -755,7 +755,7 @@ static void ConvertY4Gray16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t *p_y p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -805,10 +805,10 @@ static void ConvertY4Gray32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t *p_y int i_x, i_y; /* horizontal and vertical indexes */ int i_scale_count; /* scale modulo counter */ int i_chroma_width; /* chroma width, not used */ - u32 * p_gray; /* base convertion table */ + u32 * p_gray; /* base conversion table */ u32 * p_pic_start; /* beginning of the current line for copy */ - u32 * p_buffer_start; /* convertion buffer start */ - u32 * p_buffer; /* convertion buffer pointer */ + u32 * p_buffer_start; /* conversion buffer start */ + u32 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -823,7 +823,7 @@ static void ConvertY4Gray32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t *p_y &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -833,7 +833,7 @@ static void ConvertY4Gray32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t *p_y p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -875,11 +875,12 @@ static void ConvertYUV420RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width */ - u8 * p_yuv; /* base convertion table */ - u8 * p_ybase; /* Y dependant convertion table */ + u8 * p_yuv; /* base conversion table */ + u8 * p_ybase; /* Y dependant conversion table */ u8 * p_pic_start; /* beginning of the current line for copy */ - u8 * p_buffer_start; /* convertion buffer start */ - u8 * p_buffer; /* convertion buffer pointer */ + u8 * p_buffer_start; /* conversion buffer start */ + u8 * p_buffer; /* conversion buffer pointer */ + u8 * p_foo; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -895,7 +896,7 @@ static void ConvertYUV420RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -905,18 +906,26 @@ static void ConvertYUV420RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { - CONVERT_YUV_PIXEL(1); CONVERT_Y_PIXEL(1); - CONVERT_YUV_PIXEL(1); CONVERT_Y_PIXEL(1); - CONVERT_YUV_PIXEL(1); CONVERT_Y_PIXEL(1); - CONVERT_YUV_PIXEL(1); CONVERT_Y_PIXEL(1); - CONVERT_YUV_PIXEL(1); CONVERT_Y_PIXEL(1); - CONVERT_YUV_PIXEL(1); CONVERT_Y_PIXEL(1); - CONVERT_YUV_PIXEL(1); CONVERT_Y_PIXEL(1); - CONVERT_YUV_PIXEL(1); CONVERT_Y_PIXEL(1); + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u) >> 5) * 9 + ((*p_v) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u++) >> 5) * 9 + ((*p_v++) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u) >> 5) * 9 + ((*p_v) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u++) >> 5) * 9 + ((*p_v++) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u) >> 5) * 9 + ((*p_v) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u++) >> 5) * 9 + ((*p_v++) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u) >> 5) * 9 + ((*p_v) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u++) >> 5) * 9 + ((*p_v++) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u) >> 5) * 9 + ((*p_v) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u++) >> 5) * 9 + ((*p_v++) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u) >> 5) * 9 + ((*p_v) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u++) >> 5) * 9 + ((*p_v++) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u) >> 5) * 9 + ((*p_v) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u++) >> 5) * 9 + ((*p_v++) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u) >> 5) * 9 + ((*p_v) >> 5) ]; + *p_buffer++ = p_vout->lookup[ ((*p_y++ - 8) >> 4) * 81 + ((*p_u++) >> 5) * 9 + ((*p_v++) >> 5) ]; } /* Do horizontal and vertical scaling */ @@ -939,11 +948,11 @@ static void ConvertYUV422RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width */ - u8 * p_yuv; /* base convertion table */ - u8 * p_ybase; /* Y dependant convertion table */ + u8 * p_yuv; /* base conversion table */ + u8 * p_ybase; /* Y dependant conversion table */ u8 * p_pic_start; /* beginning of the current line for copy */ - u8 * p_buffer_start; /* convertion buffer start */ - u8 * p_buffer; /* convertion buffer pointer */ + u8 * p_buffer_start; /* conversion buffer start */ + u8 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -959,7 +968,7 @@ static void ConvertYUV422RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -969,7 +978,7 @@ static void ConvertYUV422RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -1003,11 +1012,11 @@ static void ConvertYUV444RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width, not used */ - u8 * p_yuv; /* base convertion table */ - u8 * p_ybase; /* Y dependant convertion table */ + u8 * p_yuv; /* base conversion table */ + u8 * p_ybase; /* Y dependant conversion table */ u8 * p_pic_start; /* beginning of the current line for copy */ - u8 * p_buffer_start; /* convertion buffer start */ - u8 * p_buffer; /* convertion buffer pointer */ + u8 * p_buffer_start; /* conversion buffer start */ + u8 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -1022,7 +1031,7 @@ static void ConvertYUV444RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -1032,7 +1041,7 @@ static void ConvertYUV444RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -1077,11 +1086,11 @@ static void ConvertYUV420RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width */ - u16 * p_yuv; /* base convertion table */ - u16 * p_ybase; /* Y dependant convertion table */ + u16 * p_yuv; /* base conversion table */ + u16 * p_ybase; /* Y dependant conversion table */ u16 * p_pic_start; /* beginning of the current line for copy */ - u16 * p_buffer_start; /* convertion buffer start */ - u16 * p_buffer; /* convertion buffer pointer */ + u16 * p_buffer_start; /* conversion buffer start */ + u16 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -1097,7 +1106,7 @@ static void ConvertYUV420RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -1107,7 +1116,7 @@ static void ConvertYUV420RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -1141,11 +1150,11 @@ static void ConvertYUV422RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width */ - u16 * p_yuv; /* base convertion table */ - u16 * p_ybase; /* Y dependant convertion table */ + u16 * p_yuv; /* base conversion table */ + u16 * p_ybase; /* Y dependant conversion table */ u16 * p_pic_start; /* beginning of the current line for copy */ - u16 * p_buffer_start; /* convertion buffer start */ - u16 * p_buffer; /* convertion buffer pointer */ + u16 * p_buffer_start; /* conversion buffer start */ + u16 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -1161,7 +1170,7 @@ static void ConvertYUV422RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -1171,7 +1180,7 @@ static void ConvertYUV422RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -1205,11 +1214,11 @@ static void ConvertYUV444RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width, not used */ - u16 * p_yuv; /* base convertion table */ - u16 * p_ybase; /* Y dependant convertion table */ + u16 * p_yuv; /* base conversion table */ + u16 * p_ybase; /* Y dependant conversion table */ u16 * p_pic_start; /* beginning of the current line for copy */ - u16 * p_buffer_start; /* convertion buffer start */ - u16 * p_buffer; /* convertion buffer pointer */ + u16 * p_buffer_start; /* conversion buffer start */ + u16 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -1224,7 +1233,7 @@ static void ConvertYUV444RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -1234,7 +1243,7 @@ static void ConvertYUV444RGB16( p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t * p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -1298,11 +1307,11 @@ static void ConvertYUV420RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width */ - u32 * p_yuv; /* base convertion table */ - u32 * p_ybase; /* Y dependant convertion table */ + u32 * p_yuv; /* base conversion table */ + u32 * p_ybase; /* Y dependant conversion table */ u32 * p_pic_start; /* beginning of the current line for copy */ - u32 * p_buffer_start; /* convertion buffer start */ - u32 * p_buffer; /* convertion buffer pointer */ + u32 * p_buffer_start; /* conversion buffer start */ + u32 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -1318,7 +1327,7 @@ static void ConvertYUV420RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -1328,7 +1337,7 @@ static void ConvertYUV420RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -1362,11 +1371,11 @@ static void ConvertYUV422RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width */ - u32 * p_yuv; /* base convertion table */ - u32 * p_ybase; /* Y dependant convertion table */ + u32 * p_yuv; /* base conversion table */ + u32 * p_ybase; /* Y dependant conversion table */ u32 * p_pic_start; /* beginning of the current line for copy */ - u32 * p_buffer_start; /* convertion buffer start */ - u32 * p_buffer; /* convertion buffer pointer */ + u32 * p_buffer_start; /* conversion buffer start */ + u32 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -1382,7 +1391,7 @@ static void ConvertYUV422RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -1392,7 +1401,7 @@ static void ConvertYUV422RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { @@ -1426,11 +1435,11 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * int i_uval, i_vval; /* U and V samples */ int i_red, i_green, i_blue; /* U and V modified samples */ int i_chroma_width; /* chroma width, not used */ - u32 * p_yuv; /* base convertion table */ - u32 * p_ybase; /* Y dependant convertion table */ + u32 * p_yuv; /* base conversion table */ + u32 * p_ybase; /* Y dependant conversion table */ u32 * p_pic_start; /* beginning of the current line for copy */ - u32 * p_buffer_start; /* convertion buffer start */ - u32 * p_buffer; /* convertion buffer pointer */ + u32 * p_buffer_start; /* conversion buffer start */ + u32 * p_buffer; /* conversion buffer pointer */ int * p_offset_start; /* offset array start */ int * p_offset; /* offset array pointer */ @@ -1445,7 +1454,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * &b_horizontal_scaling, &i_vertical_scaling, p_offset_start ); /* - * Perform convertion + * Perform conversion */ i_scale_count = i_pic_height; for( i_y = 0; i_y < i_height; i_y++ ) @@ -1455,7 +1464,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t * p_pic_start = p_pic; p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic; - /* Do YUV convertion to buffer - YUV picture is always formed of 16 + /* Do YUV conversion to buffer - YUV picture is always formed of 16 * pixels wide blocks */ for( i_x = i_width / 16; i_x--; ) { diff --git a/src/video_parser/vpar_synchro.c b/src/video_parser/vpar_synchro.c index 7c51d2e536..6b5e49aa38 100644 --- a/src/video_parser/vpar_synchro.c +++ b/src/video_parser/vpar_synchro.c @@ -515,4 +515,4 @@ void vpar_SynchroKludge( vpar_thread_t * p_vpar, mtime_t date ) p_vpar->synchro.kludge_level = p_vpar->synchro.kludge_nbb + p_vpar->synchro.kludge_nbp; } -#endif \ No newline at end of file +#endif -- 2.39.5