[FFmpeg-devel] [PATCH] fix H.264 decoding on big-endian

Reimar Döffinger Reimar.Doeffinger
Sun Feb 14 21:21:10 CET 2010


Hello,
no idea what I am doing, but this seems to work:
Index: libavcodec/h264_direct.c
===================================================================
--- libavcodec/h264_direct.c	(revision 21784)
+++ libavcodec/h264_direct.c	(working copy)
@@ -237,8 +237,13 @@
 
                 int match_count= (left_ref==ref[list]) + (top_ref==ref[list]) + (refc==ref[list]);
                 if(match_count > 1){ //most common
+#if HAVE_BIGENDIAN
+                    mv[list]= (mid_pred(A[0], B[0], C[0])<<16)
+                             +(mid_pred(A[1], B[1], C[1])&0xFFFF);
+#else
                     mv[list]= (mid_pred(A[0], B[0], C[0])&0xFFFF)
                              +(mid_pred(A[1], B[1], C[1])<<16);
+#endif
                 }else {
                     assert(match_count==1);
                     if(left_ref==ref[list]){




More information about the ffmpeg-devel mailing list