Go to the documentation of this file.
35 const uint8_t *buf, *bufp;
37 int markers[4*16] = {0};
38 int exss_markers = 0, exss_nextpos = 0;
45 int marker, wide_hdr, hdr_size, framesize;
50 state = (
state << 16) | bytestream_get_be16(&bufp);
61 if (
pos < exss_nextpos)
68 hdr_size =
get_bits(&gb, 8 + 4 * wide_hdr) + 1;
69 framesize =
get_bits(&gb, 16 + 4 * wide_hdr) + 1;
70 if (hdr_size & 3 || framesize & 3)
72 if (hdr_size < 16 || framesize < hdr_size)
79 if (
pos == exss_nextpos)
82 exss_markers =
FFMAX(1, exss_markers - 1);
83 exss_nextpos =
pos + framesize;
89 (bytestream_get_be16(&bufp) & 0xFC00) == 0xFC00)
92 (bytestream_get_be16(&bufp) & 0x00FC) == 0x00FC)
97 (bytestream_get_be16(&bufp) & 0xFFF0) == 0x07F0)
102 (bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007)
113 marker += 4 *
h.sr_code;
118 if (exss_markers > 3)
124 if (markers[
max] < markers[
i])
129 markers[
max] * 4 > sum * 3 &&
130 diff / diffcount > 600)
140 .p.extensions =
"dts",
const FFInputFormat ff_dts_demuxer
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
#define DCA_SYNCWORD_CORE_14B_BE
static int dts_probe(const AVProbeData *p)
int buf_size
Size of buf except extra allocated bytes.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, int max_size)
Convert bitstream to one representation based on sync marker.
#define FF_ARRAY_ELEMS(a)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static unsigned int get_bits1(GetBitContext *s)
This structure contains the data a format has to probe a file.
#define DCA_SYNCWORD_CORE_BE
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define DCA_SYNCWORD_CORE_14B_LE
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
#define i(width, name, range_min, range_max)
#define DCA_SYNCWORD_SUBSTREAM
#define DCA_CORE_FRAME_HEADER_SIZE
#define AV_INPUT_BUFFER_PADDING_SIZE
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
#define DCA_SYNCWORD_CORE_LE
int avpriv_dca_parse_core_frame_header(DCACoreFrameHeader *h, const uint8_t *buf, int size)
Parse and validate core frame header.