[x264-devel] ppc64: versions of x264 post r901 generate wrong output

Loren Merritt lorenm at u.washington.edu
Sat Sep 20 16:42:03 CEST 2008


On Sat, 20 Sep 2008, Guillaume POIRIER wrote:
>
> I was able to reproduce the problem on Linux/PPC64, but not on
> Darwin/PPC32. I don't know why yet though. I'll look into it.

That was just the information I needed.
Does this help?

--Loren Merritt
-------------- next part --------------
diff --git a/common/bs.h b/common/bs.h
index c8edbdc..d963dc7 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;
         }


More information about the x264-devel mailing list