Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
ff794171
Commit
ff794171
authored
Feb 01, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not cast const away.
Originally committed as revision 11707 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
b1f5712e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
37 deletions
+37
-37
intreadwrite.h
libavutil/intreadwrite.h
+37
-37
No files found.
libavutil/intreadwrite.h
View file @
ff794171
...
@@ -38,9 +38,9 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
...
@@ -38,9 +38,9 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#else
/* __GNUC__ */
#else
/* __GNUC__ */
#define AV_RN16(a) (*((uint16_t*)(a)))
#define AV_RN16(a) (*((
const
uint16_t*)(a)))
#define AV_RN32(a) (*((uint32_t*)(a)))
#define AV_RN32(a) (*((
const
uint32_t*)(a)))
#define AV_RN64(a) (*((uint64_t*)(a)))
#define AV_RN64(a) (*((
const
uint64_t*)(a)))
#define AV_WN16(a, b) *((uint16_t*)(a)) = (b)
#define AV_WN16(a, b) *((uint16_t*)(a)) = (b)
#define AV_WN32(a, b) *((uint32_t*)(a)) = (b)
#define AV_WN32(a, b) *((uint32_t*)(a)) = (b)
...
@@ -49,7 +49,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
...
@@ -49,7 +49,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#endif
/* !__GNUC__ */
#endif
/* !__GNUC__ */
/* endian macros */
/* endian macros */
#define AV_RB8(x) (((uint8_t*)(x))[0])
#define AV_RB8(x) (((
const
uint8_t*)(x))[0])
#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0)
#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0)
#define AV_RL8(x) AV_RB8(x)
#define AV_RL8(x) AV_RB8(x)
...
@@ -70,29 +70,29 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
...
@@ -70,29 +70,29 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
# define AV_WL16(p, d) AV_WN16(p, d)
# define AV_WL16(p, d) AV_WN16(p, d)
# endif
# endif
#else
/* HAVE_FAST_UNALIGNED */
#else
/* HAVE_FAST_UNALIGNED */
#define AV_RB16(x) ((((
uint8_t*)(x))[0] << 8) | ((
uint8_t*)(x))[1])
#define AV_RB16(x) ((((
const uint8_t*)(x))[0] << 8) | ((const
uint8_t*)(x))[1])
#define AV_WB16(p, d) do { \
#define AV_WB16(p, d) do { \
((uint8_t*)(p))[1] = (d); \
((uint8_t*)(p))[1] = (d); \
((uint8_t*)(p))[0] = (d)>>8; } while(0)
((uint8_t*)(p))[0] = (d)>>8; } while(0)
#define AV_RL16(x) ((((uint8_t*)(x))[1] << 8) | \
#define AV_RL16(x) ((((
const
uint8_t*)(x))[1] << 8) | \
((uint8_t*)(x))[0])
((
const
uint8_t*)(x))[0])
#define AV_WL16(p, d) do { \
#define AV_WL16(p, d) do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; } while(0)
((uint8_t*)(p))[1] = (d)>>8; } while(0)
#endif
#endif
#define AV_RB24(x) ((((uint8_t*)(x))[0] << 16) | \
#define AV_RB24(x) ((((
const
uint8_t*)(x))[0] << 16) | \
(((uint8_t*)(x))[1] << 8) | \
(((
const
uint8_t*)(x))[1] << 8) | \
((uint8_t*)(x))[2])
((
const
uint8_t*)(x))[2])
#define AV_WB24(p, d) do { \
#define AV_WB24(p, d) do { \
((uint8_t*)(p))[2] = (d); \
((uint8_t*)(p))[2] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[0] = (d)>>16; } while(0)
((uint8_t*)(p))[0] = (d)>>16; } while(0)
#define AV_RL24(x) ((((uint8_t*)(x))[2] << 16) | \
#define AV_RL24(x) ((((
const
uint8_t*)(x))[2] << 16) | \
(((uint8_t*)(x))[1] << 8) | \
(((
const
uint8_t*)(x))[1] << 8) | \
((uint8_t*)(x))[0])
((
const
uint8_t*)(x))[0])
#define AV_WL24(p, d) do { \
#define AV_WL24(p, d) do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[1] = (d)>>8; \
...
@@ -113,20 +113,20 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
...
@@ -113,20 +113,20 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
# define AV_WL32(p, d) AV_WN32(p, d)
# define AV_WL32(p, d) AV_WN32(p, d)
# endif
# endif
#else
/* HAVE_FAST_UNALIGNED */
#else
/* HAVE_FAST_UNALIGNED */
#define AV_RB32(x) ((((uint8_t*)(x))[0] << 24) | \
#define AV_RB32(x) ((((
const
uint8_t*)(x))[0] << 24) | \
(((uint8_t*)(x))[1] << 16) | \
(((
const
uint8_t*)(x))[1] << 16) | \
(((uint8_t*)(x))[2] << 8) | \
(((
const
uint8_t*)(x))[2] << 8) | \
((uint8_t*)(x))[3])
((
const
uint8_t*)(x))[3])
#define AV_WB32(p, d) do { \
#define AV_WB32(p, d) do { \
((uint8_t*)(p))[3] = (d); \
((uint8_t*)(p))[3] = (d); \
((uint8_t*)(p))[2] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>8; \
((uint8_t*)(p))[1] = (d)>>16; \
((uint8_t*)(p))[1] = (d)>>16; \
((uint8_t*)(p))[0] = (d)>>24; } while(0)
((uint8_t*)(p))[0] = (d)>>24; } while(0)
#define AV_RL32(x) ((((uint8_t*)(x))[3] << 24) | \
#define AV_RL32(x) ((((
const
uint8_t*)(x))[3] << 24) | \
(((uint8_t*)(x))[2] << 16) | \
(((
const
uint8_t*)(x))[2] << 16) | \
(((uint8_t*)(x))[1] << 8) | \
(((
const
uint8_t*)(x))[1] << 8) | \
((uint8_t*)(x))[0])
((
const
uint8_t*)(x))[0])
#define AV_WL32(p, d) do { \
#define AV_WL32(p, d) do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[1] = (d)>>8; \
...
@@ -149,14 +149,14 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
...
@@ -149,14 +149,14 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
# define AV_WL64(p, d) AV_WN64(p, d)
# define AV_WL64(p, d) AV_WN64(p, d)
# endif
# endif
#else
/* HAVE_FAST_UNALIGNED */
#else
/* HAVE_FAST_UNALIGNED */
#define AV_RB64(x) (((uint64_t)((uint8_t*)(x))[0] << 56) | \
#define AV_RB64(x) (((uint64_t)((
const
uint8_t*)(x))[0] << 56) | \
((uint64_t)((uint8_t*)(x))[1] << 48) | \
((uint64_t)((
const
uint8_t*)(x))[1] << 48) | \
((uint64_t)((uint8_t*)(x))[2] << 40) | \
((uint64_t)((
const
uint8_t*)(x))[2] << 40) | \
((uint64_t)((uint8_t*)(x))[3] << 32) | \
((uint64_t)((
const
uint8_t*)(x))[3] << 32) | \
((uint64_t)((uint8_t*)(x))[4] << 24) | \
((uint64_t)((
const
uint8_t*)(x))[4] << 24) | \
((uint64_t)((uint8_t*)(x))[5] << 16) | \
((uint64_t)((
const
uint8_t*)(x))[5] << 16) | \
((uint64_t)((uint8_t*)(x))[6] << 8) | \
((uint64_t)((
const
uint8_t*)(x))[6] << 8) | \
(uint64_t)((uint8_t*)(x))[7])
(uint64_t)((
const
uint8_t*)(x))[7])
#define AV_WB64(p, d) do { \
#define AV_WB64(p, d) do { \
((uint8_t*)(p))[7] = (d); \
((uint8_t*)(p))[7] = (d); \
((uint8_t*)(p))[6] = (d)>>8; \
((uint8_t*)(p))[6] = (d)>>8; \
...
@@ -167,14 +167,14 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
...
@@ -167,14 +167,14 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
((uint8_t*)(p))[1] = (d)>>48; \
((uint8_t*)(p))[1] = (d)>>48; \
((uint8_t*)(p))[0] = (d)>>56; } while(0)
((uint8_t*)(p))[0] = (d)>>56; } while(0)
#define AV_RL64(x) (((uint64_t)((uint8_t*)(x))[7] << 56) | \
#define AV_RL64(x) (((uint64_t)((
const
uint8_t*)(x))[7] << 56) | \
((uint64_t)((uint8_t*)(x))[6] << 48) | \
((uint64_t)((
const
uint8_t*)(x))[6] << 48) | \
((uint64_t)((uint8_t*)(x))[5] << 40) | \
((uint64_t)((
const
uint8_t*)(x))[5] << 40) | \
((uint64_t)((uint8_t*)(x))[4] << 32) | \
((uint64_t)((
const
uint8_t*)(x))[4] << 32) | \
((uint64_t)((uint8_t*)(x))[3] << 24) | \
((uint64_t)((
const
uint8_t*)(x))[3] << 24) | \
((uint64_t)((uint8_t*)(x))[2] << 16) | \
((uint64_t)((
const
uint8_t*)(x))[2] << 16) | \
((uint64_t)((uint8_t*)(x))[1] << 8) | \
((uint64_t)((
const
uint8_t*)(x))[1] << 8) | \
(uint64_t)((uint8_t*)(x))[0])
(uint64_t)((
const
uint8_t*)(x))[0])
#define AV_WL64(p, d) do { \
#define AV_WL64(p, d) do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[1] = (d)>>8; \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment