[FFmpeg-devel] [PATCH 1/3] Move lpc_compute_autocorr() from DSPContext to a new struct LPCContext.
Michael Niedermayer
michaelni
Fri Jan 21 05:03:24 CET 2011
On Fri, Jan 21, 2011 at 03:48:30AM +0000, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
>
> > On Fri, Jan 21, 2011 at 02:31:06AM +0000, M?ns Rullg?rd wrote:
> >> Luca Barbato <lu_zero at gentoo.org> writes:
> >>
> >> > On 01/21/2011 02:03 AM, Michael Niedermayer wrote:
> >> >> Dont you think that the code that contains these offsets would
> >> >> benefit more from cleanup to not break when random structs change
> >> >> than regularly waiting for failure and then find someone with an
> >> >> ARM build env to fix?
> >> >
> >> > It had been discussed a bit in the past. There isn't a portable way to
> >> > get those offsets automatically given the field of use (arm is mostly
> >> > cross-built, more than often with exotic toolchain).
> >>
> >> A different approach would be to group the handful of field into a
> >> sub-struct and pass a pointer to that instead of the MpegEncContext
> >> pointer. However, given the general appearance of MpegEncContext,
> >> doing this can seem a bit scary.
> >
> > simply moving the affected fields close together and passing a
> > pointer to the first seems easiest,
>
> This is also unreliable. Consider this struct:
>
> struct foo {
> char a;
> int b;
> };
>
> Here the offset from &a to &b is 4 (assuming a typical ABI). Now add
> a member to the struct:
>
> struct foo {
> char x;
> char a;
> int b;
> };
>
> After this change the offset from &a to &b is 3. MpegEncContext is
> full of padding holes, so effects like this are likely to arise with
> any modification.
>
> I'm as keen as anyone to find a better solution, but going from one
> fragile method to another is pointless.
its not pointless its an improvment besides what i meant is
sort from field needing most alignment to least.
and btw, iam just helping because it was obvious when reading that and iam
too much a geek to not help in such cases i havnt forgotten what happened
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110121/bfbaac46/attachment.pgp>
More information about the ffmpeg-devel
mailing list