72 for (y = 0; y <
height; y += 4) {
73 for (x = 0; x <
width; x += 4) {
77 mask = bytestream2_get_be16u(gb);
78 v[0] = bytestream2_get_be16u(gb);
79 v[1] = bytestream2_get_be16u(gb);
80 if ((v[0] & 0x8000)) {
85 for (i = 2; i < 8; i++)
86 v[i] = bytestream2_get_be16u(gb);
88 v[2] = v[4] = v[6] = v[0];
89 v[3] = v[5] = v[7] = v[1];
92 #define PIX16(target, true, false) \
93 i = (mask & target) ? true : false; \
94 AV_WN16A(dst, v[i] & 0x7FFF); \
97 #define ROW16(row, a1, a0, b1, b0) \
98 dst = dst_start + (y + row) * linesize + x * 2; \
99 PIX16(1 << (row * 4), a1, a0) \
100 PIX16(1 << (row * 4 + 1), a1, a0) \
101 PIX16(1 << (row * 4 + 2), b1, b0) \
102 PIX16(1 << (row * 4 + 3), b1, b0)
104 ROW16(0, 0, 1, 2, 3);
105 ROW16(1, 0, 1, 2, 3);
106 ROW16(2, 4, 5, 6, 7);
107 ROW16(3, 4, 5, 6, 7);
116 for (j = 0; j < 4; j++)
117 for (i = 0; i < 4; i++)
118 AV_WN32A(dst + j * linesize + i * 4, pixel);
121 #define PIX32(target, true, false) \
122 AV_WN32A(dst, (mask & target) ? v[true] : v[false]); \
125 #define ROW32(row, a1, a0, b1, b0) \
126 dst = dst_start + (y + row) * linesize + x * 4; \
127 PIX32(1 << (row * 4), a1, a0) \
128 PIX32(1 << (row * 4 + 1), a1, a0) \
129 PIX32(1 << (row * 4 + 2), b1, b0) \
130 PIX32(1 << (row * 4 + 3), b1, b0)
133 ROW32(0, 1, 0, 3, 2); \
134 ROW32(1, 1, 0, 3, 2); \
135 ROW32(2, 5, 4, 7, 6); \
136 ROW32(3, 5, 4, 7, 6);
140 int linesize,
int vflip)
143 uint32_t
color[128],
v[8];
144 int w, h, nb_colors, i, x,
y, p0, p1,
mask;
149 w = bytestream2_get_be16u(gb);
150 h = bytestream2_get_be16u(gb);
151 if ((w & ~3) != width || (h & ~3) != height)
154 if (bytestream2_get_byteu(gb)) {
159 nb_colors = bytestream2_get_byteu(gb);
162 for (i = 0; i <
FFMIN(nb_colors, 128); i++)
163 color[i] = 0xFF000000 | bytestream2_get_be24u(gb);
168 dst_start += (height - 1) * linesize;
169 linesize = -linesize;
173 p0 = bytestream2_get_byteu(gb);
177 p0 = (p0 << 2) | (p0 >> 4);
179 0xFF000000 | (p0 << 16) | (p0 << 8) | p0);
183 p0 = (p0 << 2) | (p0 >> 4);
186 g = bytestream2_get_byteu(gb);
187 r = bytestream2_get_byteu(gb);
189 0xFF000000 | (r << 16) | (g << 8) | p0);
194 p1 = bytestream2_get_byteu(gb);
196 if ((p0 & 0x7F) == (p1 & 0x7F)) {
202 v[0] = v[2] = v[4] = v[6] = color[p0 & 0x7F];
203 v[1] = v[3] = v[5] = v[7] = color[p1 & 0x7F];
204 mask = bytestream2_get_le16u(gb);
210 v[0] = color[p0 & 0x7F];
211 v[1] = color[p1 & 0x7F];
212 for (i = 2; i < 8; i++)
213 v[i] = color[bytestream2_get_byteu(gb) & 0x7F];
214 mask = bytestream2_get_le16u(gb);
267 #if CONFIG_MVC1_DECODER
281 #if CONFIG_MVC2_DECODER