From: Loren Merritt Date: Sat, 20 Sep 2008 14:41:17 +0000 (-0600) Subject: fix bitstream writer on bigendian 64bit (regression in r903) X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=972814a9c76c8d718063e27a15328fa638e92c61;p=x264.git fix bitstream writer on bigendian 64bit (regression in r903) --- diff --git a/common/bs.h b/common/bs.h index c8edbdc5..d963dc7a 100644 --- a/common/bs.h +++ b/common/bs.h @@ -76,7 +76,11 @@ static inline void bs_write( bs_t *s, int i_count, uint32_t i_bits ) s->i_left -= i_count; if( s->i_left <= 32 ) { +#ifdef WORDS_BIGENDIAN + *(uint32_t*)s->p = s->cur_bits >> (32 - s->i_left); +#else *(uint32_t*)s->p = endian_fix( s->cur_bits << s->i_left ); +#endif s->i_left += 32; s->p += 4; }