1 /*
2 * WBMP (Wireless Application Protocol Bitmap) image
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
25
26 static void putv(uint8_t ** bufp,
unsigned int v)
27 {
28 unsigned int vv = 0;
29 int n = 0;
30
31 while (vv != v)
32 vv += v & (0x7F << 7 * n++);
33
34 while (--n > 0)
35 bytestream_put_byte(bufp, 0x80 | (v & (0x7F << 7 * n)) >> 7 * n);
36
37 bytestream_put_byte(bufp, v & 0x7F);
38 }
39
41 {
42 int wpad = (
width + 7) / 8;
43 for (
int j = 0; j <
height; j++) {
44 memcpy(*bufp,
src, wpad);
45 *bufp += wpad;
47 }
48 }
49
52 {
54 uint8_t *buf;
56
59
61
63 bytestream_put_byte(&buf, 0);
66
69 else
71
73
74 *got_packet = 1;
75 return 0;
76 }
77
89 },
90 };