Could someone please explain the arguments sent to draw_alpha for me? Iive on #MPlayerDEV tried two times but I still didn't get it. For one thing, if src is an 8bpp grayscale then why would you need a srcstride? Etc, need to know so I can start using spuenc... //David Holm
David Holm writes:
Could someone please explain the arguments sent to draw_alpha for me? Iive on #MPlayerDEV tried two times but I still didn't get it. For one thing, if src is an 8bpp grayscale then why would you need a srcstride? Etc, need to know so I can start using spuenc...
Here is what I understood from it. void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) The first four arguments are quite clear: they define the video output area that will be drawn into. The fifth (src) is the color plane (always 1 byte per pixel?) to use for drawing. The sixth (srca) is the corresponding alpha value plane¹. The seventh (stride) argument is the amount of bytes you have to skip in the color and alpha planes to get to the next line (that is first line of data is at src, second line is at src+stride, Nth line is at (src+stride*(N-1)) etc...) I am not sure why it needs a stride argument, but I think it is meant for OSD fonts where fonts are just small rectangular are in a bigger image, in which you need the extra information (the width if the bigger picture) to know how to get to the next line. BTW I wrote most of spudec (is that what you meant when you wrote spuenc?) so if you need more info about it just go ahead. While on the subject of spudec, I just came across a DVD (Fargo) that uses 0x7 control code... Does anybody know how to interpret them? I can't view subtitles on it :-( Kim-Minh. ¹ A few weird rules about alpha values: - The sum of color+alpha has to be less than 256. - If alpha is 0 then nothing is drawn. Otherwise the smaller the value the more opaque the point.
Kim Minh Kaplan wrote:
David Holm writes:
Could someone please explain the arguments sent to draw_alpha for me? Iive on #MPlayerDEV tried two times but I still didn't get it. For one thing, if src is an 8bpp grayscale then why would you need a srcstride? Etc, need to know so I can start using spuenc...
Here is what I understood from it.
void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)
The first four arguments are quite clear: they define the video output area that will be drawn into. The fifth (src) is the color plane (always 1 byte per pixel?) to use for drawing. The sixth (srca) is the corresponding alpha value plane¹. The seventh (stride) argument is the amount of bytes you have to skip in the color and alpha planes to get to the next line (that is first line of data is at src, second line is at src+stride, Nth line is at (src+stride*(N-1)) etc...)
I am not sure why it needs a stride argument, but I think it is meant for OSD fonts where fonts are just small rectangular are in a bigger image, in which you need the extra information (the width if the bigger picture) to know how to get to the next line.
BTW I wrote most of spudec (is that what you meant when you wrote spuenc?) so if you need more info about it just go ahead.
While on the subject of spudec, I just came across a DVD (Fargo) that uses 0x7 control code... Does anybody know how to interpret them? I can't view subtitles on it :-(
Kim-Minh.
¹ A few weird rules about alpha values: - The sum of color+alpha has to be less than 256. - If alpha is 0 then nothing is drawn. Otherwise the smaller the value the more opaque the point. _______________________________________________ MPlayer-dev-eng mailing list MPlayer-dev-eng@mplayerhq.hu http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
Thanks, this outta help me out =D... No, I'm talking about spuenc, it was derived from spudec by someone who's domain is long gone. I need a spu encoder to use the spu channel of the dxr3 for osd. regarding 0x7, check this page: http://members.aol.com/mpucoder/DVD/spu.html //David Holm
David Holm writes:
regarding 0x7, check this page: http://members.aol.com/mpucoder/DVD/spu.html
Great! I'll try and implement that. Thank you. Kim Minh.
participants (2)
-
David Holm -
Kim Minh Kaplan