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) {
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++) {
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
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
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
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...
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)
#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. ...
const char * name
Name of the codec implementation.
static const uint8_t offset[127][2]
Libavcodec external API header.
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
int width
picture width / height.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AV_LOG_INFO
Standard information.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static uint16_t read10in32(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big)
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 numerator/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.
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...