3 * copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@free.fr>
5 * This file is part of FFmpeg.
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef FFMPEG_BYTESTREAM_H
23 #define FFMPEG_BYTESTREAM_H
25 static always_inline unsigned int bytestream_get_le32(uint8_t **b)
31 static always_inline unsigned int bytestream_get_le16(uint8_t **b)
37 static always_inline unsigned int bytestream_get_byte(uint8_t **b)
43 static always_inline unsigned int bytestream_get_buffer(uint8_t **b, uint8_t *dst, unsigned int size)
45 memcpy(dst, *b, size);
50 static always_inline void bytestream_put_be32(uint8_t **b, const unsigned int value)
52 *(*b)++ = value >> 24;
53 *(*b)++ = value >> 16;
58 static always_inline void bytestream_put_be16(uint8_t **b, const unsigned int value)
64 static always_inline void bytestream_put_le32(uint8_t **b, const unsigned int value)
68 *(*b)++ = value >> 16;
69 *(*b)++ = value >> 24;
72 static always_inline void bytestream_put_le16(uint8_t **b, const unsigned int value)
78 static always_inline void bytestream_put_byte(uint8_t **b, const unsigned int value)
83 static always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
85 memcpy(*b, src, size);
89 #endif /* FFMPEG_BYTESTREAM_H */