54 int * n_datum,
int is_big)
59 *lbuf =
read32(ptr, is_big);
63 *lbuf = (*lbuf << 10) | (*lbuf >> 22);
74 int buf_size = avpkt->
size;
79 int magic_num, endian;
81 int w, h, bits_per_color, descriptor, elements, packing;
82 int encoding, need_align = 0;
84 unsigned int rgbBuffer = 0;
87 if (avpkt->
size <= 1634) {
97 if (magic_num ==
AV_RL32(
"SDPX")) {
99 }
else if (magic_num ==
AV_RB32(
"SDPX")) {
106 offset =
read32(&buf, endian);
107 if (avpkt->
size <= offset) {
113 buf = avpkt->
data + 660;
114 ret =
read32(&buf, endian);
115 if (ret != 0xFFFFFFFF) {
118 "not properly decode.\n");
122 buf = avpkt->
data + 0x304;
136 bits_per_color = buf[0];
138 packing =
read16(&buf, endian);
139 encoding =
read16(&buf, endian);
160 if (offset >= 1724 + 4) {
161 buf = avpkt->
data + 1724;
165 if (q.
num > 0 && q.
den > 0)
170 switch (descriptor) {
186 switch (bits_per_color) {
188 stride = avctx->
width * elements;
195 stride = (avctx->
width * elements + 2) / 3 * 4;
202 stride = 2 * avctx->
width * elements;
205 stride = 2 * avctx->
width * elements;
220 need_align =
FFALIGN(stride, 4);
221 if (need_align*avctx->
height + (int64_t)offset > avpkt->
size) {
223 if (stride*avctx->
height + (int64_t)offset > avpkt->
size) {
232 need_align -= stride;
236 switch (1000 * descriptor + 10 * bits_per_color + endian) {
299 switch (bits_per_color) {
301 for (x = 0; x < avctx->
height; x++) {
302 uint16_t *dst[3] = {(uint16_t*)ptr[0],
305 for (y = 0; y < avctx->
width; y++) {
318 for (i = 0; i < 3; i++)
323 for (x = 0; x < avctx->
height; x++) {
324 uint16_t *dst[3] = {(uint16_t*)ptr[0],
327 for (y = 0; y < avctx->
width; y++) {
328 *dst[2] =
read16(&buf, endian) >> 4;
330 *dst[0] =
read16(&buf, endian) >> 4;
332 *dst[1] =
read16(&buf, endian) >> 4;
340 for (i = 0; i < 3; i++)