Go to the documentation of this file.
55 int *n_datum,
int is_big,
int shift)
62 *lbuf =
read32(ptr, is_big);
73 int *n_datum,
int is_big,
int shift)
78 *lbuf =
read32(ptr, is_big);
82 *lbuf = *lbuf << 10 | *lbuf >>
shift & 0x3FFFFF;
88 int *n_datum,
int is_big)
93 *lbuf =
read32(ptr, is_big);
98 case 7:
return *lbuf & 0xFFF;
99 case 6:
return (*lbuf >> 12) & 0xFFF;
101 uint32_t
c = *lbuf >> 24;
102 *lbuf =
read32(ptr, is_big);
106 case 4:
return (*lbuf >> 4) & 0xFFF;
107 case 3:
return (*lbuf >> 16) & 0xFFF;
109 uint32_t
c = *lbuf >> 28;
110 *lbuf =
read32(ptr, is_big);
114 case 1:
return (*lbuf >> 8) & 0xFFF;
115 default:
return *lbuf >> 20;
125 int buf_size = avpkt->
size;
128 uint32_t header_version,
version = 0;
130 char input_device[33];
133 int magic_num, endian;
135 int w,
h, bits_per_color, descriptor,
elements, packing;
136 int encoding, need_align = 0;
138 unsigned int rgbBuffer = 0;
141 if (avpkt->
size <= 1634) {
151 if (magic_num ==
AV_RL32(
"SDPX")) {
153 }
else if (magic_num ==
AV_RB32(
"SDPX")) {
166 header_version =
read32(&buf, 0);
167 if (header_version ==
MKTAG(
'V',
'1',
'.',
'0'))
169 if (header_version ==
MKTAG(
'V',
'2',
'.',
'0'))
176 buf = avpkt->
data + 660;
178 if (
ret != 0xFFFFFFFF) {
181 "not properly decode.\n");
185 buf = avpkt->
data + 0x304;
199 bits_per_color = buf[0];
201 packing =
read16(&buf, endian);
202 encoding =
read16(&buf, endian);
209 if (bits_per_color > 32)
223 buf = avpkt->
data + 1724;
227 if (q.
num > 0 && q.
den > 0)
232 switch (descriptor) {
253 switch (bits_per_color) {
310 switch (1000 * descriptor + 10 * bits_per_color + endian) {
393 input_device[32] =
'\0';
402 switch (bits_per_color) {
404 for (x = 0; x < avctx->
height; x++) {
405 uint16_t *dst[4] = {(uint16_t*)ptr[0],
409 int shift =
elements > 1 ? packing == 1 ? 22 : 20 : packing == 1 ? 2 : 0;
410 for (y = 0; y < avctx->
width; y++) {
413 &n_datum, endian,
shift);
416 &n_datum, endian,
shift);
419 &n_datum, endian,
shift);
422 &n_datum, endian,
shift);
426 &n_datum, endian,
shift);
428 if (memcmp(input_device,
"Scanity", 7))
435 for (x = 0; x < avctx->
height; x++) {
436 uint16_t *dst[4] = {(uint16_t*)ptr[0],
440 int shift = packing == 1 ? 4 : 0;
441 for (y = 0; y < avctx->
width; y++) {
476 for (x = 0; x < avctx->
height; x++) {
481 for (y = 0; y < avctx->
width; y++) {
#define AV_LOG_WARNING
Something somehow does not look correct.
static const ElemCat * elements[ELEMENT_COUNT]
#define MKTAG(a, b, c, d)
This structure describes decoded (raw) audio or video data.
@ AV_PIX_FMT_RGBA64BE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
static uint16_t read10in32_gray(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big, int shift)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
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.
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
#define AV_PIX_FMT_GBRP10
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 AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP12
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_RL16
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define AV_PIX_FMT_GRAY10
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Rational number (pair of numerator and denominator).
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static uint16_t read12in32(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_NUM_DATA_POINTERS
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
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
#define AV_LOG_INFO
Standard information.
static unsigned int read16(const uint8_t **ptr, int is_big)
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
#define i(width, name, range_min, range_max)
static uint16_t read10in32(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big, int shift)
#define AV_PIX_FMT_GBRP12
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
main external API structure.
AVDictionary * metadata
metadata.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static int shift(int a, int b)
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
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.
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int width
picture width / height.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static unsigned int read32(const uint8_t **ptr, int is_big)
#define AV_PIX_FMT_GRAY12
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
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
#define av_fourcc2str(fourcc)