[FFmpeg-devel] [PATCH] dstdec: big-endian compatiblity
Peter Ross
pross at xvid.org
Sun Jan 6 13:12:42 EET 2019
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190106/df7f6331/attachment.sig>
More information about the ffmpeg-devel
mailing list