Unified · Split
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | #ifndef AVCODEC_BYTESTREAM_H | 23 | #ifndef AVCODEC_BYTESTREAM_H |
| 24 | #define AVCODEC_BYTESTREAM_H | 24 | #define AVCODEC_BYTESTREAM_H |
| 25 | 25 | ||
| 26 | #include <stdint.h> | ||
| 26 | #include <string.h> | 27 | #include <string.h> |
| 27 | 28 | ||
| 28 | #include "libavutil/common.h" | 29 | #include "libavutil/common.h" |
| @@ -37,7 +38,7 @@ typedef struct { · 8 unmodified lines | |||
| 37 | int eof; | 38 | int eof; |
| 38 | } PutByteContext; | 39 | } PutByteContext; |
| 39 | 40 | ||
| 40 | #define DEF_T(type, name, bytes, read, write) \ | 41 | #define DEF(type, name, bytes, read, write) \ |
| 41 | static av_always_inline type bytestream_get_ ## name(const uint8_t **b) \ | 42 | static av_always_inline type bytestream_get_ ## name(const uint8_t **b) \ |
| 42 | { \ | 43 | { \ |
| 43 | (*b) += bytes; \ | 44 | (*b) += bytes; \ |
| @@ -80,24 +81,15 @@ static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ · 36 unmodified lines | |||
| 80 | return read(g->buffer); \ | 81 | return read(g->buffer); \ |
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | #define DEF(name, bytes, read, write) \ | 84 | DEF(uint64_t, le64, 8, AV_RL64, AV_WL64) |
| 84 | DEF_T(unsigned int, name, bytes, read, write) | 85 | DEF(unsigned int, le32, 4, AV_RL32, AV_WL32) |
| 85 | #define DEF64(name, bytes, read, write) \ | 86 | DEF(unsigned int, le24, 3, AV_RL24, AV_WL24) |
| 86 | DEF_T(uint64_t, name, bytes, read, write) | 87 | DEF(unsigned int, le16, 2, AV_RL16, AV_WL16) |
| 87 | 88 | DEF(uint64_t, be64, 8, AV_RB64, AV_WB64) | |
| 88 | DEF64(le64, 8, AV_RL64, AV_WL64) | 89 | DEF(unsigned int, be32, 4, AV_RB32, AV_WB32) |
| 89 | DEF (le32, 4, AV_RL32, AV_WL32) | 90 | DEF(unsigned int, be24, 3, AV_RB24, AV_WB24) |
| 90 | DEF (le24, 3, AV_RL24, AV_WL24) | 91 | DEF(unsigned int, be16, 2, AV_RB16, AV_WB16) |
| 91 | DEF (le16, 2, AV_RL16, AV_WL16) | 92 | DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8) |
| 92 | DEF64(be64, 8, AV_RB64, AV_WB64) | ||
| 93 | DEF (be32, 4, AV_RB32, AV_WB32) | ||
| 94 | DEF (be24, 3, AV_RB24, AV_WB24) | ||
| 95 | DEF (be16, 2, AV_RB16, AV_WB16) | ||
| 96 | DEF (byte, 1, AV_RB8 , AV_WB8 ) | ||
| 97 | |||
| 98 | #undef DEF | ||
| 99 | #undef DEF64 | ||
| 100 | #undef DEF_T | ||
| 101 | 93 | ||
| 102 | #if HAVE_BIGENDIAN | 94 | #if HAVE_BIGENDIAN |
| 103 | # define bytestream2_get_ne16 bytestream2_get_be16 | 95 | # define bytestream2_get_ne16 bytestream2_get_be16 |