54 int * n_datum,
int is_big,
int shift)
59 *lbuf =
read32(ptr, is_big);
63 *lbuf = *lbuf << 10 | *lbuf >> shift & 0x3FFFFF;
69 int * n_datum,
int is_big)
74 *lbuf =
read32(ptr, is_big);
79 case 7:
return *lbuf & 0xFFF;
80 case 6:
return (*lbuf >> 12) & 0xFFF;
82 uint32_t
c = *lbuf >> 24;
83 *lbuf =
read32(ptr, is_big);
87 case 4:
return (*lbuf >> 4) & 0xFFF;
88 case 3:
return (*lbuf >> 16) & 0xFFF;
90 uint32_t
c = *lbuf >> 28;
91 *lbuf =
read32(ptr, is_big);
95 case 1:
return (*lbuf >> 8) & 0xFFF;
96 default:
return *lbuf >> 20;
106 int buf_size = avpkt->
size;
111 int magic_num, endian;
113 int w,
h, bits_per_color, descriptor,
elements, packing;
114 int encoding, need_align = 0;
116 unsigned int rgbBuffer = 0;
119 if (avpkt->
size <= 1634) {
129 if (magic_num ==
AV_RL32(
"SDPX")) {
131 }
else if (magic_num ==
AV_RB32(
"SDPX")) {
138 offset =
read32(&buf, endian);
139 if (avpkt->
size <= offset) {
145 buf = avpkt->
data + 660;
146 ret =
read32(&buf, endian);
147 if (ret != 0xFFFFFFFF) {
150 "not properly decode.\n");
154 buf = avpkt->
data + 0x304;
168 bits_per_color = buf[0];
170 packing =
read16(&buf, endian);
171 encoding =
read16(&buf, endian);
188 if (offset >= 1724 + 4) {
189 buf = avpkt->
data + 1724;
193 if (q.
num > 0 && q.
den > 0)
198 switch (descriptor) {
219 switch (bits_per_color) {
228 stride = (avctx->
width * elements + 2) / 3 * 4;
260 need_align =
FFALIGN(stride, 4);
261 if (need_align*avctx->
height + (int64_t)offset > avpkt->
size) {
263 if (stride*avctx->
height + (int64_t)offset > avpkt->
size) {
276 switch (1000 * descriptor + 10 * bits_per_color + endian) {
356 switch (bits_per_color) {
358 for (x = 0; x < avctx->
height; x++) {
359 uint16_t *dst[4] = {(uint16_t*)ptr[0],
363 int shift = packing == 1 ? 22 : 20;
364 for (y = 0; y < avctx->
width; y++) {
366 &n_datum, endian, shift);
368 &n_datum, endian, shift);
370 &n_datum, endian, shift);
374 &n_datum, endian, shift);
382 for (x = 0; x < avctx->
height; x++) {
383 uint16_t *dst[4] = {(uint16_t*)ptr[0],
387 int shift = packing == 1 ? 4 : 0;
388 for (y = 0; y < avctx->
width; y++) {
391 *dst[2]++ =
read16(&buf, endian) >> shift & 0xFFF;
392 *dst[0]++ =
read16(&buf, endian) >> shift & 0xFFF;
394 *dst[1]++ =
read16(&buf, endian) >> shift & 0xFFF;
396 *dst[3]++ =
read16(&buf, endian) >> shift & 0xFFF;
423 for (x = 0; x < avctx->
height; x++) {
428 for (y = 0; y < avctx->
width; y++) {
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_NUM_DATA_POINTERS
static int shift(int a, int b)
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
#define AV_PIX_FMT_GBRAP10
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
packed RGB 8:8:8, 24bpp, RGBRGB...
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
#define AV_PIX_FMT_GBRP10
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
#define AV_PIX_FMT_GRAY12
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
static unsigned int read16(const uint8_t **ptr, int is_big)
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
static uint16_t read10in32(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big, int shift)
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
static unsigned int read32(const uint8_t **ptr, int is_big)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_PIX_FMT_GBRAP12
const char * name
Name of the codec implementation.
static const uint8_t offset[127][2]
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
static uint16_t read12in32(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big)
int width
picture width / height.
static const ElemCat * elements[ELEMENT_COUNT]
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AV_LOG_INFO
Standard information.
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Rational number (pair of numerator and denominator).
#define AV_PIX_FMT_GBRP12
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
common internal api header.
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Y , 16bpp, little-endian.
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...