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) {
191 switch (bits_per_color) {
193 stride = avctx->
width * elements;
200 stride = (avctx->
width * elements + 2) / 3 * 4;
207 stride = 2 * avctx->
width * elements;
210 stride = 2 * avctx->
width * elements;
225 need_align =
FFALIGN(stride, 4);
226 if (need_align*avctx->
height + (int64_t)offset > avpkt->
size) {
228 if (stride*avctx->
height + (int64_t)offset > avpkt->
size) {
237 need_align -= stride;
241 switch (1000 * descriptor + 10 * bits_per_color + endian) {
313 switch (bits_per_color) {
315 for (x = 0; x < avctx->
height; x++) {
316 uint16_t *dst[3] = {(uint16_t*)ptr[0],
319 for (y = 0; y < avctx->
width; y++) {
332 for (i = 0; i < 3; i++)
337 for (x = 0; x < avctx->
height; x++) {
338 uint16_t *dst[3] = {(uint16_t*)ptr[0],
341 for (y = 0; y < avctx->
width; y++) {
342 *dst[2] =
read16(&buf, endian) >> 4;
344 *dst[0] =
read16(&buf, endian) >> 4;
346 *dst[1] =
read16(&buf, endian) >> 4;
354 for (i = 0; i < 3; i++)
363 for (x = 0; x < avctx->
height; x++) {
368 for (y = 0; y < avctx->
width; y++) {