vout_glide.c: donne une taille correcte a l'affichage (800x600)

yuvmmx: conv. Y4Gray16, les autres sont a venir
parent d102c574
......@@ -46,8 +46,8 @@
#include "intf_msg.h"
#include "main.h"
#define WIDTH 640
#define HEIGHT 480
#define WIDTH 800
#define HEIGHT 600
#define BITS_PER_PLANE 16
#define BYTES_PER_PIXEL 2
......@@ -168,7 +168,7 @@ static int GlideOpenDisplay( vout_thread_t *p_vout )
{
static char version[80];
GrHwConfiguration hwconfig;
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
GrScreenResolution_t resolution = GR_RESOLUTION_800x600;
GrLfbInfo_t p_front_buffer_info; /* front buffer info */
p_vout->i_width = WIDTH;
......
......@@ -296,12 +296,12 @@ void SetYUV( vout_thread_t *p_vout )
p_vout->yuv.p_Convert444 = (vout_yuv_convert_t *) ConvertY4Gray16;
break;
case 3:
p_vout->yuv.p_Convert420 = (vout_yuv_convert_t *) ConvertY4Gray24;
p_vout->yuv.p_Convert420 = (vout_yuv_convert_t *) ConvertYUV420RGB24;
p_vout->yuv.p_Convert422 = (vout_yuv_convert_t *) ConvertY4Gray24;
p_vout->yuv.p_Convert444 = (vout_yuv_convert_t *) ConvertY4Gray24;
break;
case 4:
p_vout->yuv.p_Convert420 = (vout_yuv_convert_t *) ConvertY4Gray32;
p_vout->yuv.p_Convert420 = (vout_yuv_convert_t *) ConvertYUV420RGB32;
p_vout->yuv.p_Convert422 = (vout_yuv_convert_t *) ConvertY4Gray32;
p_vout->yuv.p_Convert444 = (vout_yuv_convert_t *) ConvertY4Gray32;
break;
......
......@@ -52,7 +52,57 @@
*****************************************************************************/
void ConvertY4Gray16( YUV_ARGS_16BPP )
{
intf_ErrMsg( "yuvmmx error: unhandled function, grayscale, bpp = 16\n" );
boolean_t b_horizontal_scaling; /* horizontal scaling type */
int i_vertical_scaling; /* vertical scaling type */
int i_x, i_y; /* horizontal and vertical indexes */
int i_scale_count; /* scale modulo counter */
int i_chroma_width; /* chroma width */
u16 * p_pic_start; /* beginning of the current line for copy */
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 */
/*
* Initialize some values - i_pic_line_width will store the line skip
*/
i_pic_line_width -= i_pic_width;
i_chroma_width = i_width / 2;
p_buffer_start = p_vout->yuv.p_buffer;
p_offset_start = p_vout->yuv.p_offset;
SetOffset( i_width, i_height, i_pic_width, i_pic_height,
&b_horizontal_scaling, &i_vertical_scaling, p_offset_start, 0 );
/*
* Perform conversion
*/
i_scale_count = ( i_vertical_scaling == 1 ) ? i_pic_height : i_height;
for( i_y = 0; i_y < i_height; i_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;
for ( i_x = i_width / 8; i_x--; )
{
__asm__( MMX_INIT_16_GRAY
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
__asm__( ".align 8"
MMX_YUV_GRAY
MMX_UNPACK_16_GRAY
: : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
p_y += 8;
p_u += 4;
p_v += 4;
p_buffer += 8;
}
SCALE_WIDTH;
SCALE_HEIGHT( 420, 2 );
}
}
/*****************************************************************************
......
......@@ -51,6 +51,12 @@ movq (%0), %%mm6 # Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 \n\
#movl $0, (%3) # cache preload for image \n\
"
#define MMX_INIT_16_GRAY " \n\
\n\
movq (%0), %%mm6 # Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 \n\
#movl $0, (%3) # cache preload for image \n\
"
#define MMX_INIT_32 " \n\
\n\
movd (%1), %%mm0 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\
......@@ -133,6 +139,49 @@ punpcklbw %%mm4, %%mm1 # R7 R6 R5 R4 R3 R2 R1 R0 \n\
punpcklbw %%mm5, %%mm2 # G7 G6 G5 G4 G3 G2 G1 G0 \n\
"
/*
* Grayscale case, only use Y
*/
#define MMX_YUV_GRAY " \n\
\n\
# convert the luma part \n\
psubusb mmx_10w, %%mm6 \n\
movq %%mm6, %%mm7 \n\
pand mmx_00ffw, %%mm6 \n\
psrlw $8, %%mm7 \n\
psllw $3, %%mm6 \n\
psllw $3, %%mm7 \n\
pmulhw mmx_Y_coeff, %%mm6 \n\
pmulhw mmx_Y_coeff, %%mm7 \n\
packuswb %%mm6, %%mm6 \n\
packuswb %%mm7, %%mm7 \n\
punpcklbw %%mm7, %%mm6 \n\
"
#define MMX_UNPACK_16_GRAY " \n\
movq %%mm6, %%mm5 \n\
pand mmx_redmask, %%mm6 \n\
pand mmx_grnmask, %%mm5 \n\
movq %%mm6, %%mm7 \n\
psrlw mmx_blueshift, %%mm7 \n\
pxor %%mm3, %%mm3 \n\
movq %%mm7, %%mm2 \n\
movq %%mm5, %%mm0 \n\
punpcklbw %%mm3, %%mm5 \n\
punpcklbw %%mm6, %%mm7 \n\
psllw mmx_blueshift, %%mm5 \n\
por %%mm5, %%mm7 \n\
movq %%mm7, (%3) \n\
punpckhbw %%mm3, %%mm0 \n\
punpckhbw %%mm6, %%mm2 \n\
psllw mmx_blueshift, %%mm0 \n\
movq 8(%0), %%mm6 \n\
por %%mm0, %%mm2 \n\
movq %%mm2, 8(%3) \n\
"
/*
* convert RGB plane to RGB 16 bits,
* mm0 -> B, mm1 -> R, mm2 -> G,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment