2 * Copyright (C) 2017-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
13 class CBitstreamWriter
16 CBitstreamWriter(uint8_t *buffer
, unsigned int buffer_size
, int writer_le
);
17 void WriteBits(int n
, unsigned int value
);
25 uint8_t *buf
, *buf_ptr
;
28 ////////////////////////////////////////////////////////////////////////////////////////////
29 //! @todo refactor this so as not to need these ffmpeg routines.
30 //! These are not exposed in ffmpeg's API so we dupe them here.
33 * AVC helper functions for muxers
34 * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@smartjog.com>
35 * This is part of FFmpeg
37 * SPDX-License-Identifier: LGPL-2.1-or-later
38 * See LICENSES/README.md for more information.
40 #define BS_WB32(p, d) { \
41 ((uint8_t*)(p))[3] = (d); \
42 ((uint8_t*)(p))[2] = (d) >> 8; \
43 ((uint8_t*)(p))[1] = (d) >> 16; \
44 ((uint8_t*)(p))[0] = (d) >> 24; }
46 #define BS_WL32(p, d) { \
47 ((uint8_t*)(p))[0] = (d); \
48 ((uint8_t*)(p))[1] = (d) >> 8; \
49 ((uint8_t*)(p))[2] = (d) >> 16; \
50 ((uint8_t*)(p))[3] = (d) >> 24; }