FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
iff.c File Reference
#include <inttypes.h>
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
#include "id3v2.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  IffDemuxContext
 
struct  DSDLayoutDesc
 

Macros

#define ID_8SVX   MKTAG('8','S','V','X')
 
#define ID_16SV   MKTAG('1','6','S','V')
 
#define ID_MAUD   MKTAG('M','A','U','D')
 
#define ID_MHDR   MKTAG('M','H','D','R')
 
#define ID_MDAT   MKTAG('M','D','A','T')
 
#define ID_VHDR   MKTAG('V','H','D','R')
 
#define ID_ATAK   MKTAG('A','T','A','K')
 
#define ID_RLSE   MKTAG('R','L','S','E')
 
#define ID_CHAN   MKTAG('C','H','A','N')
 
#define ID_PBM   MKTAG('P','B','M',' ')
 
#define ID_ILBM   MKTAG('I','L','B','M')
 
#define ID_BMHD   MKTAG('B','M','H','D')
 
#define ID_DGBL   MKTAG('D','G','B','L')
 
#define ID_CAMG   MKTAG('C','A','M','G')
 
#define ID_CMAP   MKTAG('C','M','A','P')
 
#define ID_ACBM   MKTAG('A','C','B','M')
 
#define ID_DEEP   MKTAG('D','E','E','P')
 
#define ID_RGB8   MKTAG('R','G','B','8')
 
#define ID_RGBN   MKTAG('R','G','B','N')
 
#define ID_DSD   MKTAG('D','S','D',' ')
 
#define ID_DST   MKTAG('D','S','T',' ')
 
#define ID_DSTC   MKTAG('D','S','T','C')
 
#define ID_DSTF   MKTAG('D','S','T','F')
 
#define ID_FRTE   MKTAG('F','R','T','E')
 
#define ID_ANIM   MKTAG('A','N','I','M')
 
#define ID_ANHD   MKTAG('A','N','H','D')
 
#define ID_DLTA   MKTAG('D','L','T','A')
 
#define ID_DPAN   MKTAG('D','P','A','N')
 
#define ID_FORM   MKTAG('F','O','R','M')
 
#define ID_FRM8   MKTAG('F','R','M','8')
 
#define ID_ANNO   MKTAG('A','N','N','O')
 
#define ID_AUTH   MKTAG('A','U','T','H')
 
#define ID_CHRS   MKTAG('C','H','R','S')
 
#define ID_COPYRIGHT   MKTAG('(','c',')',' ')
 
#define ID_CSET   MKTAG('C','S','E','T')
 
#define ID_FVER   MKTAG('F','V','E','R')
 
#define ID_NAME   MKTAG('N','A','M','E')
 
#define ID_TEXT   MKTAG('T','E','X','T')
 
#define ID_ABIT   MKTAG('A','B','I','T')
 
#define ID_BODY   MKTAG('B','O','D','Y')
 
#define ID_DBOD   MKTAG('D','B','O','D')
 
#define ID_DPEL   MKTAG('D','P','E','L')
 
#define ID_DLOC   MKTAG('D','L','O','C')
 
#define ID_TVDC   MKTAG('T','V','D','C')
 
#define LEFT   2
 
#define RIGHT   4
 
#define STEREO   6
 
#define IFF_EXTRA_VIDEO_SIZE   41
 This number of bytes if added at the beginning of each AVPacket which contain additional information about video properties which has to be shared between demuxer and decoder. More...
 
#define DSD_SLFT   MKTAG('S','L','F','T')
 
#define DSD_SRGT   MKTAG('S','R','G','T')
 
#define DSD_MLFT   MKTAG('M','L','F','T')
 
#define DSD_MRGT   MKTAG('M','R','G','T')
 
#define DSD_C   MKTAG('C',' ',' ',' ')
 
#define DSD_LS   MKTAG('L','S',' ',' ')
 
#define DSD_RS   MKTAG('R','S',' ',' ')
 
#define DSD_LFE   MKTAG('L','F','E',' ')
 

Enumerations

enum  svx8_compression_type { COMP_NONE, COMP_FIB, COMP_EXP }
 

Functions

static int get_metadata (AVFormatContext *s, const char *const tag, const unsigned data_size)
 
static int iff_probe (const AVProbeData *p)
 
static int parse_dsd_diin (AVFormatContext *s, AVStream *st, uint64_t eof)
 
static int parse_dsd_prop (AVFormatContext *s, AVStream *st, uint64_t eof)
 
static int read_dst_frame (AVFormatContext *s, AVPacket *pkt)
 
static int iff_read_header (AVFormatContext *s)
 
static unsigned get_anim_duration (uint8_t *buf, int size)
 
static int iff_read_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVCodecTag dsd_codec_tags []
 
static const uint32_t dsd_stereo [] = { DSD_SLFT, DSD_SRGT }
 
static const uint32_t dsd_5point0 [] = { DSD_MLFT, DSD_MRGT, DSD_C, DSD_LS, DSD_RS }
 
static const uint32_t dsd_5point1 [] = { DSD_MLFT, DSD_MRGT, DSD_C, DSD_LFE, DSD_LS, DSD_RS }
 
static const DSDLayoutDesc dsd_channel_layout []
 
static const uint64_t dsd_loudspeaker_config []
 
static const char * dsd_source_comment []
 
static const char * dsd_history_comment []
 
static const uint8_t deep_rgb24 [] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8}
 
static const uint8_t deep_rgba [] = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8}
 
static const uint8_t deep_bgra [] = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8}
 
static const uint8_t deep_argb [] = {0, 0, 0, 4, 0,17, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8}
 
static const uint8_t deep_abgr [] = {0, 0, 0, 4, 0,17, 0, 8, 0, 3, 0, 8, 0, 2, 0, 8}
 
const AVInputFormat ff_iff_demuxer
 

Detailed Description

IFF file demuxer by Jaikrishnan Menon for more information on the .iff file format, visit: http://wiki.multimedia.cx/index.php?title=IFF

Definition in file iff.c.

Macro Definition Documentation

◆ ID_8SVX

#define ID_8SVX   MKTAG('8','S','V','X')

Definition at line 42 of file iff.c.

◆ ID_16SV

#define ID_16SV   MKTAG('1','6','S','V')

Definition at line 43 of file iff.c.

◆ ID_MAUD

#define ID_MAUD   MKTAG('M','A','U','D')

Definition at line 44 of file iff.c.

◆ ID_MHDR

#define ID_MHDR   MKTAG('M','H','D','R')

Definition at line 45 of file iff.c.

◆ ID_MDAT

#define ID_MDAT   MKTAG('M','D','A','T')

Definition at line 46 of file iff.c.

◆ ID_VHDR

#define ID_VHDR   MKTAG('V','H','D','R')

Definition at line 47 of file iff.c.

◆ ID_ATAK

#define ID_ATAK   MKTAG('A','T','A','K')

Definition at line 48 of file iff.c.

◆ ID_RLSE

#define ID_RLSE   MKTAG('R','L','S','E')

Definition at line 49 of file iff.c.

◆ ID_CHAN

#define ID_CHAN   MKTAG('C','H','A','N')

Definition at line 50 of file iff.c.

◆ ID_PBM

#define ID_PBM   MKTAG('P','B','M',' ')

Definition at line 51 of file iff.c.

◆ ID_ILBM

#define ID_ILBM   MKTAG('I','L','B','M')

Definition at line 52 of file iff.c.

◆ ID_BMHD

#define ID_BMHD   MKTAG('B','M','H','D')

Definition at line 53 of file iff.c.

◆ ID_DGBL

#define ID_DGBL   MKTAG('D','G','B','L')

Definition at line 54 of file iff.c.

◆ ID_CAMG

#define ID_CAMG   MKTAG('C','A','M','G')

Definition at line 55 of file iff.c.

◆ ID_CMAP

#define ID_CMAP   MKTAG('C','M','A','P')

Definition at line 56 of file iff.c.

◆ ID_ACBM

#define ID_ACBM   MKTAG('A','C','B','M')

Definition at line 57 of file iff.c.

◆ ID_DEEP

#define ID_DEEP   MKTAG('D','E','E','P')

Definition at line 58 of file iff.c.

◆ ID_RGB8

#define ID_RGB8   MKTAG('R','G','B','8')

Definition at line 59 of file iff.c.

◆ ID_RGBN

#define ID_RGBN   MKTAG('R','G','B','N')

Definition at line 60 of file iff.c.

◆ ID_DSD

#define ID_DSD   MKTAG('D','S','D',' ')

Definition at line 61 of file iff.c.

◆ ID_DST

#define ID_DST   MKTAG('D','S','T',' ')

Definition at line 62 of file iff.c.

◆ ID_DSTC

#define ID_DSTC   MKTAG('D','S','T','C')

Definition at line 63 of file iff.c.

◆ ID_DSTF

#define ID_DSTF   MKTAG('D','S','T','F')

Definition at line 64 of file iff.c.

◆ ID_FRTE

#define ID_FRTE   MKTAG('F','R','T','E')

Definition at line 65 of file iff.c.

◆ ID_ANIM

#define ID_ANIM   MKTAG('A','N','I','M')

Definition at line 66 of file iff.c.

◆ ID_ANHD

#define ID_ANHD   MKTAG('A','N','H','D')

Definition at line 67 of file iff.c.

◆ ID_DLTA

#define ID_DLTA   MKTAG('D','L','T','A')

Definition at line 68 of file iff.c.

◆ ID_DPAN

#define ID_DPAN   MKTAG('D','P','A','N')

Definition at line 69 of file iff.c.

◆ ID_FORM

#define ID_FORM   MKTAG('F','O','R','M')

Definition at line 71 of file iff.c.

◆ ID_FRM8

#define ID_FRM8   MKTAG('F','R','M','8')

Definition at line 72 of file iff.c.

◆ ID_ANNO

#define ID_ANNO   MKTAG('A','N','N','O')

Definition at line 73 of file iff.c.

◆ ID_AUTH

#define ID_AUTH   MKTAG('A','U','T','H')

Definition at line 74 of file iff.c.

◆ ID_CHRS

#define ID_CHRS   MKTAG('C','H','R','S')

Definition at line 75 of file iff.c.

◆ ID_COPYRIGHT

#define ID_COPYRIGHT   MKTAG('(','c',')',' ')

Definition at line 76 of file iff.c.

◆ ID_CSET

#define ID_CSET   MKTAG('C','S','E','T')

Definition at line 77 of file iff.c.

◆ ID_FVER

#define ID_FVER   MKTAG('F','V','E','R')

Definition at line 78 of file iff.c.

◆ ID_NAME

#define ID_NAME   MKTAG('N','A','M','E')

Definition at line 79 of file iff.c.

◆ ID_TEXT

#define ID_TEXT   MKTAG('T','E','X','T')

Definition at line 80 of file iff.c.

◆ ID_ABIT

#define ID_ABIT   MKTAG('A','B','I','T')

Definition at line 81 of file iff.c.

◆ ID_BODY

#define ID_BODY   MKTAG('B','O','D','Y')

Definition at line 82 of file iff.c.

◆ ID_DBOD

#define ID_DBOD   MKTAG('D','B','O','D')

Definition at line 83 of file iff.c.

◆ ID_DPEL

#define ID_DPEL   MKTAG('D','P','E','L')

Definition at line 84 of file iff.c.

◆ ID_DLOC

#define ID_DLOC   MKTAG('D','L','O','C')

Definition at line 85 of file iff.c.

◆ ID_TVDC

#define ID_TVDC   MKTAG('T','V','D','C')

Definition at line 86 of file iff.c.

◆ LEFT

#define LEFT   2

Definition at line 88 of file iff.c.

◆ RIGHT

#define RIGHT   4

Definition at line 89 of file iff.c.

◆ STEREO

#define STEREO   6

Definition at line 90 of file iff.c.

◆ IFF_EXTRA_VIDEO_SIZE

#define IFF_EXTRA_VIDEO_SIZE   41

This number of bytes if added at the beginning of each AVPacket which contain additional information about video properties which has to be shared between demuxer and decoder.

This number may change between frames, e.g. the demuxer might set it to smallest possible size of 2 to indicate that there's no extradata changing in this frame.

Definition at line 100 of file iff.c.

◆ DSD_SLFT

#define DSD_SLFT   MKTAG('S','L','F','T')

Definition at line 172 of file iff.c.

◆ DSD_SRGT

#define DSD_SRGT   MKTAG('S','R','G','T')

Definition at line 173 of file iff.c.

◆ DSD_MLFT

#define DSD_MLFT   MKTAG('M','L','F','T')

Definition at line 174 of file iff.c.

◆ DSD_MRGT

#define DSD_MRGT   MKTAG('M','R','G','T')

Definition at line 175 of file iff.c.

◆ DSD_C

#define DSD_C   MKTAG('C',' ',' ',' ')

Definition at line 176 of file iff.c.

◆ DSD_LS

#define DSD_LS   MKTAG('L','S',' ',' ')

Definition at line 177 of file iff.c.

◆ DSD_RS

#define DSD_RS   MKTAG('R','S',' ',' ')

Definition at line 178 of file iff.c.

◆ DSD_LFE

#define DSD_LFE   MKTAG('L','F','E',' ')

Definition at line 179 of file iff.c.

Enumeration Type Documentation

◆ svx8_compression_type

Enumerator
COMP_NONE 
COMP_FIB 
COMP_EXP 

Definition at line 102 of file iff.c.

Function Documentation

◆ get_metadata()

static int get_metadata ( AVFormatContext s,
const char *const  tag,
const unsigned  data_size 
)
static

Definition at line 127 of file iff.c.

Referenced by iff_read_header(), and parse_dsd_diin().

◆ iff_probe()

static int iff_probe ( const AVProbeData p)
static

Definition at line 145 of file iff.c.

◆ parse_dsd_diin()

static int parse_dsd_diin ( AVFormatContext s,
AVStream st,
uint64_t  eof 
)
static

Definition at line 216 of file iff.c.

Referenced by iff_read_header().

◆ parse_dsd_prop()

static int parse_dsd_prop ( AVFormatContext s,
AVStream st,
uint64_t  eof 
)
static

Definition at line 249 of file iff.c.

Referenced by iff_read_header().

◆ read_dst_frame()

static int read_dst_frame ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 353 of file iff.c.

Referenced by iff_read_header(), and iff_read_packet().

◆ iff_read_header()

static int iff_read_header ( AVFormatContext s)
static

Definition at line 416 of file iff.c.

◆ get_anim_duration()

static unsigned get_anim_duration ( uint8_t *  buf,
int  size 
)
static

Definition at line 805 of file iff.c.

Referenced by iff_read_packet().

◆ iff_read_packet()

static int iff_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 827 of file iff.c.

Variable Documentation

◆ dsd_codec_tags

const AVCodecTag dsd_codec_tags[]
static
Initial value:

Definition at line 165 of file iff.c.

Referenced by parse_dsd_prop().

◆ dsd_stereo

const uint32_t dsd_stereo[] = { DSD_SLFT, DSD_SRGT }
static

Definition at line 181 of file iff.c.

◆ dsd_5point0

const uint32_t dsd_5point0[] = { DSD_MLFT, DSD_MRGT, DSD_C, DSD_LS, DSD_RS }
static

Definition at line 182 of file iff.c.

◆ dsd_5point1

const uint32_t dsd_5point1[] = { DSD_MLFT, DSD_MRGT, DSD_C, DSD_LFE, DSD_LS, DSD_RS }
static

Definition at line 183 of file iff.c.

◆ dsd_channel_layout

const DSDLayoutDesc dsd_channel_layout[]
static
Initial value:

Definition at line 190 of file iff.c.

Referenced by parse_dsd_prop().

◆ dsd_loudspeaker_config

const uint64_t dsd_loudspeaker_config[]
static
Initial value:

Definition at line 196 of file iff.c.

Referenced by parse_dsd_prop().

◆ dsd_source_comment

const char* dsd_source_comment[]
static
Initial value:
= {
"dsd_source_comment",
"analogue_source_comment",
"pcm_source_comment",
}

Definition at line 202 of file iff.c.

Referenced by iff_read_header().

◆ dsd_history_comment

const char* dsd_history_comment[]
static
Initial value:
= {
"general_remark",
"operator_name",
"creating_machine",
"timezone",
"file_revision"
}

Definition at line 208 of file iff.c.

Referenced by iff_read_header().

◆ deep_rgb24

const uint8_t deep_rgb24[] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8}
static

Definition at line 410 of file iff.c.

Referenced by iff_read_header().

◆ deep_rgba

const uint8_t deep_rgba[] = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8}
static

Definition at line 411 of file iff.c.

Referenced by iff_read_header().

◆ deep_bgra

const uint8_t deep_bgra[] = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8}
static

Definition at line 412 of file iff.c.

Referenced by iff_read_header().

◆ deep_argb

const uint8_t deep_argb[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8}
static

Definition at line 413 of file iff.c.

Referenced by iff_read_header().

◆ deep_abgr

const uint8_t deep_abgr[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 3, 0, 8, 0, 2, 0, 8}
static

Definition at line 414 of file iff.c.

Referenced by iff_read_header().

◆ ff_iff_demuxer

const AVInputFormat ff_iff_demuxer
Initial value:
= {
.name = "iff",
.long_name = NULL_IF_CONFIG_SMALL("IFF (Interchange File Format)"),
.priv_data_size = sizeof(IffDemuxContext),
}

Definition at line 899 of file iff.c.

AVFMT_NO_BYTE_SEEK
#define AVFMT_NO_BYTE_SEEK
Format does not allow seeking by bytes.
Definition: avformat.h:475
AVFMT_GENERIC_INDEX
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:468
AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_STEREO
Definition: channel_layout.h:91
iff_read_header
static int iff_read_header(AVFormatContext *s)
Definition: iff.c:416
iff_read_packet
static int iff_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: iff.c:827
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:527
AV_CODEC_ID_DST
@ AV_CODEC_ID_DST
Definition: codec_id.h:503
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
AV_CH_LAYOUT_5POINT1
#define AV_CH_LAYOUT_5POINT1
Definition: channel_layout.h:101
IffDemuxContext
Definition: iff.c:108
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
iff_probe
static int iff_probe(const AVProbeData *p)
Definition: iff.c:145
AV_CODEC_ID_DSD_MSBF
@ AV_CODEC_ID_DSD_MSBF
Definition: codec_id.h:496
AV_CH_LAYOUT_5POINT0
#define AV_CH_LAYOUT_5POINT0
Definition: channel_layout.h:100
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:48
ID_DST
#define ID_DST
Definition: iff.c:62
ID_DSD
#define ID_DSD
Definition: iff.c:61
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
dsd_5point1
static const uint32_t dsd_5point1[]
Definition: iff.c:183
dsd_5point0
static const uint32_t dsd_5point0[]
Definition: iff.c:182
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
dsd_stereo
static const uint32_t dsd_stereo[]
Definition: iff.c:181