[MPlayer-dev-eng] Re: [MPlayer-users] color of subtitles

Michael Niedermayer michaelni at gmx.at
Sun Nov 3 12:30:34 CET 2002


Hi

On Sunday 03 November 2002 11:11, Jindrich Makovicka wrote:
> Michael Niedermayer wrote:
> >>no, just forget it :) i'll try to rewrite it to truecolor.
> >>
> >:)))
> >
> >if u need any help, just ask
>
> ok:
>
> 1) what is the "canonical" way of converting rgb->yuy2? using
> rgb24toyv12 & yv12toyuy2 ?
int lumStride= (width+7)&~7;
int chromStride= (width/2+7)&~7;
uint8_t ytmp= memalign(8, lumStride*height);
uint8_t utmp= memalign(8, chromStride*height/2);
uint8_t vtmp= memalign(8, chromStride*height/2);
rgb24toyv12(
   src, ytmp, utmp, vtmp, width, height, lumStride, chromStride, srcStride);
yv12toyuy2(
   ytmp, utmp, vtmp, dst, width, height, lumStride, chromStride, dstStride);
------- or -------
SwsContext *s= getSwsContext(width, height, IMGFMT_BGR24, width, height, 
IMGFMT_YUY2, 0, NULL, NULL);
s->swScale(s, src, srcStride, 0, height, dst, dstStride);

both untested, and u obviously should avoid reallocating the buffer or 
swsContext if possible as its a time waste


> 2) how should sub.c get the information on which format is used (i.e.
> which one to convert to) ? should I add some function which will be
> called from vo_*::config with the chosen IMGFMT as an argument?
hmm, i guess so, but i am not a VO expert, perhaps someone else wants to 
comment ...

Michael



More information about the MPlayer-dev-eng mailing list