for the '127-bit shift left' algorithm to work as intended, little-endian reads and writes must be used.
libavcodec/dstdec.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c
index 511861f4d2..e9653edc9f 100644
--- a/libavcodec/dstdec.c
+++ b/libavcodec/dstdec.c
@@ -343,8 +343,15 @@ static int decode_frame(AVCodecContext *avctx, void *data,
v = ((predict >> 15) ^ residual) & 1;
dsd[((i >> 3) * channels + ch) << 2] |= v << (7 - (i & 0x7 ));
- AV_WN64A(status + 8, (AV_RN64A(status + 8) << 1) |
((AV_RN64A(status) >> 63) & 1));
- AV_WN64A(status, (AV_RN64A(status) << 1) | v);
+#if HAVE_BIGENDIAN
+#define RL64A AV_RL64
+#define WL64A AV_WL64
+#else
+#define RL64A AV_RN64A
+#define WL64A AV_WN64A
+#endif
+ WL64A(status + 8, (RL64A(status + 8) << 1) | ((RL64A(status) >>
63) & 1));
+ WL64A(status, (RL64A(status) << 1) | v);
}
}
--
2.17.1
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
