[Ffmpeg-devel] [PATCH] Chinese AVS video decoder

Stefan Gehrer stefan.gehrer
Mon Jul 3 21:51:55 CEST 2006


Von: "M?ns Rullg?rd"

> "Stefan Gehrer" <stefan.gehrer at gmx.de> writes:
> 
> > Von: "M?ns Rullg?rd"
> >
> >> These will cause alignment problems on non-x86 machines.
> >> 
> >> > +static void intra_pred_vert(uint8_t *d,uint8_t *top,uint8_t
> *left,int
> >> stride) {
> >> > +    int y;
> >> > +    uint64_t a = *((uint64_t *)(&top[1]));
> >> > +    for(y=0;y<8;y++) {
> >> > +        *((uint64_t *)(d+y*stride)) = a;
> >> > +    }
> >> > +}
> >
> > Just realised that this thing is still in the code and top[1] is very
> > likely not on a word boundary, but I do not know how to fix this nicely.
> > Suggestions?
> 
> Big endian:
> uint64_t a = ((*(uint64_t*)top) << 8) | top[7];
> 
> Little endian:
> uint64_t a = ((*(uint64_t*)top) >> 8) | ((uint64_t)top[7] << 56);

Unfortunately, top[0] is also not aligned. It could be on a multiple of
10 bytes within h->top_border_u/v.

LE_64(&top[1]) ?

Regards
Stefan Gehrer
-- 


Echte DSL-Flatrate dauerhaft f?r 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl




More information about the ffmpeg-devel mailing list