]> git.videolan.org Git - x264.git/commitdiff
fix bitstream writer on bigendian 64bit (regression in r903)
authorLoren Merritt <pengvado@akuvian.org>
Sat, 20 Sep 2008 14:41:17 +0000 (08:41 -0600)
committerLoren Merritt <pengvado@akuvian.org>
Sun, 28 Sep 2008 05:45:57 +0000 (23:45 -0600)
common/bs.h

index c8edbdc5fba2015e453e15c82646ce297fbd0f9d..d963dc7a73d18efd40a8b53ca3d6a26aac7e8329 100644 (file)
@@ -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;
         }