Go to the documentation of this file.
42 int ret,
i, last_offset = 0;
45 int substream_bytes = 0;
58 if (in_size < 4 || in_size >
pkt->
size) {
78 for (
i = 0;
i <
s->hdr.num_substreams;
i++) {
79 for (
int j = 0; j < 4; j++)
84 last_offset = units[
i].
offset * 2;
88 if (units[
i].
bits[0]) {
98 int bpos = 0, reduce =
end - have_header * 28 - substream_bytes;
125 for (
i = 0;
i <
FFMIN(
s->hdr.num_substreams, 3);
i++) {
126 uint16_t substr_hdr = 0;
128 substr_hdr |= (units[
i].
bits[0] << 15);
129 substr_hdr |= (units[
i].
bits[1] << 14);
130 substr_hdr |= (units[
i].
bits[2] << 13);
131 substr_hdr |= (units[
i].
bits[3] << 12);
136 parity_nibble ^= substr_hdr;
139 if (units[
i].
bits[0]) {
147 parity_nibble ^= parity_nibble >> 8;
148 parity_nibble ^= parity_nibble >> 4;
149 parity_nibble &= 0xF;
151 auheader = (parity_nibble ^ 0xF) << 12;
152 auheader |= (
out_size / 2) & 0x0fff;
169 memset(&
s->hdr, 0,
sizeof(
s->hdr));
177 .
name =
"truehd_core",
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
static void truehd_core_flush(AVBSFContext *ctx)
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
static int get_bits_count(const GetBitContext *s)
static av_cold int end(AVCodecContext *avctx)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
The bitstream filter state.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static void flush(AVCodecContext *avctx)
static unsigned int get_bits1(GetBitContext *s)
AVCodecID
Identify the syntax and semantics of the bitstream.
static int truehd_core_filter(AVBSFContext *ctx, AVPacket *pkt)
#define MAX_SUBSTREAMS
Maximum number of substreams that can be decoded.
static const uint8_t header[24]
int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
Read a major sync info header - contains high level information about the stream - sample rate,...
#define i(width, name, range_min, range_max)
const AVBitStreamFilter ff_truehd_core_bsf
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
int av_packet_make_writable(AVPacket *pkt)
Create a writable reference for the data described by a given packet, avoiding data copy if possible.
This structure stores compressed data.
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static enum AVCodecID codec_ids[]
void * priv_data
Format private data.
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