59#define CFA_TLGRAY 0x80000000U
60#define CFA_TRGRAY 0x40000000U
61#define CFA_BLGRAY 0x20000000U
62#define CFA_BRGRAY 0x10000000U
67 if (p->buf[0] ==
'C' && p->buf[1] ==
'I' &&
68 (HeaderSize =
AV_RL16(p->buf + 2)) >= 0x2C &&
72 AV_RL32(p->buf + 24) >= HeaderSize &&
73 AV_RL32(p->buf + 28) >= HeaderSize &&
74 AV_RL32(p->buf + 32) >= HeaderSize)
81 if (
value || allow_zero) {
89 if (
value != 0 || allow_zero) {
101 unsigned int version, compression, offImageHeader, offSetup, offImageOffsets, biBitCount, length, CFA;
142 if (biBitCount != 8 && biBitCount != 16 && biBitCount != 24 && biBitCount != 48) {
168 if (length < 0x163C) {
207 if (compression ==
CC_RGB) {
208 if (biBitCount == 8) {
210 }
else if (biBitCount == 16) {
212 }
else if (biBitCount == 24) {
214 }
else if (biBitCount == 48) {
220 }
else if (compression ==
CC_UNINT) {
221 switch (CFA & 0xFFFFFF) {
223 if (biBitCount == 8) {
225 }
else if (biBitCount == 16) {
233 if (biBitCount == 8) {
235 }
else if (biBitCount == 16) {
243 if (biBitCount == 8) {
245 }
else if (biBitCount == 16) {
253 if (biBitCount == 8) {
255 }
else if (biBitCount == 16) {
277#define DESCRIPTION_SIZE 4096
298 avio_seek(pb, offImageOffsets, SEEK_SET);
344 pkt->stream_index = 0;
359 cine->
pts = timestamp;
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
unsigned int avio_rl16(AVIOContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rl32(AVIOContext *s)
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
uint64_t avio_rl64(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
static int cine_read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
static int set_metadata_float(AVDictionary **dict, const char *key, float value, int allow_zero)
static int cine_read_probe(const AVProbeData *p)
@ CC_UNINT
Uninterpolated color image (CFA field indicates color ordering)
static int set_metadata_int(AVDictionary **dict, const char *key, int value, int allow_zero)
static int cine_read_packet(AVFormatContext *avctx, AVPacket *pkt)
static int cine_read_header(AVFormatContext *avctx)
static int read_header(FFV1Context *f, RangeCoder *c)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
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 av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set() that converts the value to a string and stores it.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
#define MKTAG(a, b, c, d)
Memory handling functions.
@ AV_PIX_FMT_BAYER_GBRG8
bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples
@ AV_PIX_FMT_BAYER_GRBG16LE
bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_BAYER_RGGB16LE
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian
@ AV_PIX_FMT_BAYER_GRBG8
bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples
@ AV_PIX_FMT_BGR48LE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
@ AV_PIX_FMT_BAYER_GBRG16LE
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BAYER_BGGR16LE
bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian
@ AV_PIX_FMT_BAYER_RGGB8
bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples
@ AV_PIX_FMT_BAYER_BGGR8
bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples
int extradata_size
Size of the extradata content in bytes.
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVIOContext * pb
I/O context.
void * priv_data
Format private data.
AVStream ** streams
A list of all streams in the file.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t duration
Decoding: duration of the stream, in stream time base.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
#define avpriv_request_sample(...)