[FFmpeg-devel] [PATCH] Do not assume long is same width as x86 register in swscale.

Michael Niedermayer michaelni
Wed Mar 18 18:45:34 CET 2009


On Wed, Mar 18, 2009 at 02:26:30PM -0300, Ramiro Polla wrote:
> Hi
> 
> On Wed, Mar 18, 2009 at 5:12 AM, Reimar D?ffinger
> <Reimar.Doeffinger at gmx.de> wrote:
> > On Wed, Mar 18, 2009 at 06:27:08AM +0100, Michael Niedermayer wrote:
> >> On Tue, Mar 17, 2009 at 09:30:06PM -0300, Ramiro Polla wrote:
> >> > On Tue, Mar 17, 2009 at 8:51 PM, Diego Biurrun <diego at biurrun.de> wrote:
> >> > > On Tue, Mar 17, 2009 at 07:23:18PM -0300, Ramiro Polla wrote:
> >> > >>
> >> > >> swscale_funnycode2.diff checks for VirtualAlloc in windows.h (os/2
> >> > >> could also use something similar then).
> >> > >>
> >> > >> --- a/configure
> >> > >> +++ b/configure
> >> > >
> >> > > OK
> >> > >
> >> > >> --- a/swscale.c
> >> > >> +++ b/swscale.c
> >> > >> @@ -68,6 +68,10 @@ untested special converters
> >> > >> ?#define MAP_ANONYMOUS MAP_ANON
> >> > >> ?#endif
> >> > >> ?#endif
> >> > >> +#ifdef HAVE_VIRTUALALLOC
> >> > >
> >> > > #if
> >> >
> >> > Ah, I had forgotten about the switch to #if
> >> >
> >> > >> +#define WIN32_LEAN_AND_MEAN
> >> > >
> >> > > Is this necessary?
> >> >
> >> > It's a good idea, like Reimar pointed out.
> >> >
> >> > >> @@ -2513,6 +2517,9 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
> >> > >> +#elif defined(HAVE_VIRTUALALLOC)
> >> > >
> >> > > Leave out the 'defined'.
> >> > >
> >> > >> @@ -3161,6 +3168,9 @@ void sws_freeContext(SwsContext *c){
> >> > >> +#elif defined(HAVE_VIRTUALALLOC)
> >> > >
> >> > > ditto
> >> >
> >> > Updated patch attached.
> >> [...]
> >>
> >> > @@ -2513,6 +2517,9 @@
> >> > ?#ifdef MAP_ANONYMOUS
> >> > ? ? ? ? ? ? ?c->funnyYCode = (uint8_t*)mmap(NULL, MAX_FUNNY_CODE_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
> >> > ? ? ? ? ? ? ?c->funnyUVCode = (uint8_t*)mmap(NULL, MAX_FUNNY_CODE_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
> >> > +#elif HAVE_VIRTUALALLOC
> >> > + ? ? ? ? ? ?c->funnyYCode = (uint8_t*)VirtualAlloc(NULL, MAX_FUNNY_CODE_SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
> >> > + ? ? ? ? ? ?c->funnyUVCode = (uint8_t*)VirtualAlloc(NULL, MAX_FUNNY_CODE_SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
> >>
> >> vertical align
> >
> > That applies to the existing code, as well as the useless cast. IMO just
> > fix them all together in one cosmetic patch.
> 
> first funnycode_align.diff to align and remove the (uint8_t*) casts,
> then funnycode_virtualalloc.diff

the parts i maintain look ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090318/91073693/attachment.pgp>



More information about the ffmpeg-devel mailing list