Commit b4e6d1f5 authored by Peter Ross's avatar Peter Ross

intreadwrite: add AV_RL64A, AV_WL64A

macros for reading and writing 64-bit aligned little-endian values.

these macros are used by the DST decoder and give a performance boost
on platforms that where the compiler must guard against unaligned
memory access.
parent c563513f
...@@ -542,6 +542,21 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; ...@@ -542,6 +542,21 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
# define AV_WN64A(p, v) AV_WNA(64, p, v) # define AV_WN64A(p, v) AV_WNA(64, p, v)
#endif #endif
#if AV_HAVE_BIGENDIAN
# define AV_RLA(s, p) av_bswap##s(AV_RN##s##A(p))
# define AV_WLA(s, p, v) AV_WN##s##A(p, av_bswap##s(v))
#else
# define AV_RLA(s, p) AV_RN##s##A(p)
# define AV_WLA(s, p, v) AV_WN##s##A(p, v)
#endif
#ifndef AV_RL64A
# define AV_RL64A(p) AV_RLA(64, p)
#endif
#ifndef AV_WL64A
# define AV_WL64A(p, v) AV_WLA(64, p, v)
#endif
/* /*
* The AV_COPYxxU macros are suitable for copying data to/from unaligned * The AV_COPYxxU macros are suitable for copying data to/from unaligned
* memory locations. * memory locations.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment