Go to the documentation of this file.
34 const uint8_t *buf, *bufp;
36 int markers[4*16] = {0};
37 int exss_markers = 0, exss_nextpos = 0;
44 int marker, wide_hdr, hdr_size, framesize;
49 state = (
state << 16) | bytestream_get_be16(&bufp);
60 if (
pos < exss_nextpos)
67 hdr_size =
get_bits(&gb, 8 + 4 * wide_hdr) + 1;
68 framesize =
get_bits(&gb, 16 + 4 * wide_hdr) + 1;
69 if (hdr_size & 3 || framesize & 3)
71 if (hdr_size < 16 || framesize < hdr_size)
78 if (
pos == exss_nextpos)
81 exss_markers =
FFMAX(1, exss_markers - 1);
82 exss_nextpos =
pos + framesize;
88 (bytestream_get_be16(&bufp) & 0xFC00) == 0xFC00)
91 (bytestream_get_be16(&bufp) & 0x00FC) == 0x00FC)
96 (bytestream_get_be16(&bufp) & 0xFFF0) == 0x07F0)
101 (bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007)
112 marker += 4 *
h.sr_code;
117 if (exss_markers > 3)
123 if (markers[
max] < markers[
i])
128 markers[
max] * 4 > sum * 3 &&
129 diff / diffcount > 600)
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.
const AVInputFormat ff_dts_demuxer