[Mplayer-cvslog] CVS: main/libvo mga_common.c,1.4,1.5 video_out.c,1.6,1.7 vo_mga.c,1.5,1.6 vo_x11.c,1.2,1.3 vo_xmga.c,1.7,1.8
GEREOFFY
arpi_esp at users.sourceforge.net
Sat Mar 24 05:35:47 CET 2001
Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv28371
Modified Files:
mga_common.c video_out.c vo_mga.c vo_x11.c vo_xmga.c
Log Message:
grey+alpha rendering support (for .sub)
Index: mga_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/mga_common.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** mga_common.c 2001/03/08 01:06:03 1.4
--- mga_common.c 2001/03/24 04:35:45 1.5
***************
*** 8,70 ****
static int f;
! static void
! write_frame_g200(uint8_t *y,uint8_t *cr, uint8_t *cb)
! {
! uint8_t *dest;
! uint32_t bespitch,h,w;
! dest = vid_data;
! bespitch = (mga_vid_config.src_width + 31) & ~31;
! for(h=0; h < mga_vid_config.src_height; h++)
! {
! memcpy(dest, y, mga_vid_config.src_width);
! y += mga_vid_config.src_width;
! dest += bespitch;
! }
- for(h=0; h < mga_vid_config.src_height/2; h++)
- {
- for(w=0; w < mga_vid_config.src_width/2; w++)
- {
- *dest++ = *cb++;
- *dest++ = *cr++;
- }
- dest += bespitch - mga_vid_config.src_width;
- }
}
- static void
- write_frame_g400(uint8_t *y,uint8_t *cr, uint8_t *cb)
- {
- uint8_t *dest;
- uint32_t bespitch,h;
- dest = vid_data;
- bespitch = (mga_vid_config.src_width + 31) & ~31;
-
- for(h=0; h < mga_vid_config.src_height; h++)
- {
- memcpy(dest, y, mga_vid_config.src_width);
- y += mga_vid_config.src_width;
- dest += bespitch;
- }
-
- for(h=0; h < mga_vid_config.src_height/2; h++)
- {
- memcpy(dest, cb, mga_vid_config.src_width/2);
- cb += mga_vid_config.src_width/2;
- dest += bespitch/2;
- }
-
- for(h=0; h < mga_vid_config.src_height/2; h++)
- {
- memcpy(dest, cr, mga_vid_config.src_width/2);
- cr += mga_vid_config.src_width/2;
- dest += bespitch/2;
- }
- }
-
//static void
//write_slice_g200(uint8_t *y,uint8_t *cr, uint8_t *cb,uint32_t slice_num)
--- 8,46 ----
static int f;
+ static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+ int x,y;
+ uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31;
+
+ if (mga_vid_config.format==MGA_VID_FORMAT_YV12){
+
+ for(y=0;y<h;y++){
+ uint8_t *dst = vid_data + bespitch * (y0+y) + x0;
+ for(x=0;x<w;x++){
+ // dst[x]=(dst[x]*srca[x]+src[x]*(srca[x]^255))>>8;
+ if(srca[x])
+ dst[x]=(dst[x]*(srca[x]^255)+src[x]*(srca[x]))>>8;
+ }
+ src+=stride;
+ srca+=stride;
+ }
! } else {
! for(y=0;y<h;y++){
! uint8_t *dst = vid_data + 2*(bespitch * (y0+y) + x0);
! for(x=0;x<w;x++){
! // dst[x]=(dst[x]*srca[x]+src[x]*(srca[x]^255))>>8;
! if(srca[x])
! dst[2*x]=(dst[2*x]*(srca[x]^255)+src[x]*(srca[x]))>>8;
! }
! src+=stride;
! srca+=stride;
! }
! }
}
//static void
//write_slice_g200(uint8_t *y,uint8_t *cr, uint8_t *cb,uint32_t slice_num)
***************
*** 201,211 ****
if (mga_vid_config.format==MGA_VID_FORMAT_YUY2)
write_frame_yuy2(src[0]);
- else
- if (mga_vid_config.card_type == MGA_G200)
- write_frame_g200(src[0], src[2], src[1]);
- else
- write_frame_g400(src[0], src[2], src[1]);
-
- //flip_page();
return 0;
}
--- 177,180 ----
Index: video_out.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** video_out.c 2001/03/08 01:06:03 1.6
--- video_out.c 2001/03/24 04:35:45 1.7
***************
*** 88,90 ****
};
!
--- 88,90 ----
};
! #include "sub.c"
Index: vo_mga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_mga.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** vo_mga.c 2001/03/22 19:28:58 1.5
--- vo_mga.c 2001/03/24 04:35:45 1.6
***************
*** 106,109 ****
--- 106,110 ----
static void flip_page(void)
{
+ vo_draw_text(draw_alpha);
vo_mga_flip_page();
}
Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** vo_x11.c 2001/03/03 21:46:39 1.2
--- vo_x11.c 2001/03/24 04:35:45 1.3
***************
*** 329,333 ****
--- 329,356 ----
}
+ static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+ int dbpp=( bpp+7 )/8;
+ int x,y;
+
+ for(y=0;y<h;y++){
+ uint8_t *dst = ImageData+ dbpp*((y+y0)*image_width+x0);
+ for(x=0;x<w;x++){
+ // dst[x]=(dst[x]*srca[x]+src[x]*(srca[x]^255))>>8;
+ if(srca[x]){
+ dst[0]=(dst[0]*(srca[x]^255)+src[x]*(srca[x]))>>8;
+ dst[1]=(dst[1]*(srca[x]^255)+src[x]*(srca[x]))>>8;
+ dst[2]=(dst[2]*(srca[x]^255)+src[x]*(srca[x]))>>8;
+ }
+ dst+=dbpp;
+ }
+ src+=stride;
+ srca+=stride;
+ }
+
+ }
+
+
static void flip_page( void ){
+ vo_draw_text(draw_alpha);
check_events();
Display_Image( myximage,ImageData );
Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** vo_xmga.c 2001/03/21 19:10:55 1.7
--- vo_xmga.c 2001/03/24 04:35:45 1.8
***************
*** 151,154 ****
--- 151,156 ----
timer=t;
#endif
+
+ vo_draw_text(draw_alpha);
check_events();
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
More information about the MPlayer-cvslog
mailing list