30 #define BITSTREAM_READER_LE
38 #define FORMAT_SIMPLE 1
39 #define FORMAT_ENCRYPTED 2
75 0x00000001, 0x00000002, 0x00000004, 0x00000008,
76 0x00000010, 0x00000020, 0x00000040, 0x00000080,
77 0x00000100, 0x00000200, 0x00000400, 0x00000800,
78 0x00001000, 0x00002000, 0x00004000, 0x00008000,
79 0x00010000, 0x00020000, 0x00040000, 0x00080000,
80 0x00100000, 0x00200000, 0x00400000, 0x00800000,
81 0x01000000, 0x02000000, 0x04000000, 0x08000000,
82 0x10000000, 0x20000000, 0x40000000, 0x80000000,
83 0x80000000, 0x80000000, 0x80000000, 0x80000000,
84 0x80000000, 0x80000000, 0x80000000, 0x80000000
120 sum += *dl++ * *qm, qm++;
121 sum += *dl++ * *qm, qm++;
122 sum += *dl++ * *qm, qm++;
123 sum += *dl++ * *qm, qm++;
124 sum += *dl++ * *qm, qm++;
125 sum += *dl++ * *qm, qm++;
126 sum += *dl++ * *qm, qm++;
127 sum += *dl++ * *qm, qm++;
129 }
else if(c->
error < 0) {
130 sum += *dl++ * (*qm -= *dx++), qm++;
131 sum += *dl++ * (*qm -= *dx++), qm++;
132 sum += *dl++ * (*qm -= *dx++), qm++;
133 sum += *dl++ * (*qm -= *dx++), qm++;
134 sum += *dl++ * (*qm -= *dx++), qm++;
135 sum += *dl++ * (*qm -= *dx++), qm++;
136 sum += *dl++ * (*qm -= *dx++), qm++;
137 sum += *dl++ * (*qm -= *dx++), qm++;
139 sum += *dl++ * (*qm += *dx++), qm++;
140 sum += *dl++ * (*qm += *dx++), qm++;
141 sum += *dl++ * (*qm += *dx++), qm++;
142 sum += *dl++ * (*qm += *dx++), qm++;
143 sum += *dl++ * (*qm += *dx++), qm++;
144 sum += *dl++ * (*qm += *dx++), qm++;
145 sum += *dl++ * (*qm += *dx++), qm++;
146 sum += *dl++ * (*qm += *dx++), qm++;
149 *(dx-0) = ((*(dl-1) >> 30) | 1) << 2;
150 *(dx-1) = ((*(dl-2) >> 30) | 1) << 1;
151 *(dx-2) = ((*(dl-3) >> 30) | 1) << 1;
152 *(dx-3) = ((*(dl-4) >> 30) | 1);
155 *in += (sum >> c->
shift);
158 *(dl-1) = *dl - *(dl-1);
159 *(dl-2) = *(dl-1) - *(dl-2);
160 *(dl-3) = *(dl-2) - *(dl-3);
190 if (CRC != (crc ^ 0xFFFFFFFFU)) {
313 int *got_frame_ptr,
AVPacket *avpkt)
316 int buf_size = avpkt->
size;
352 uint32_t unary, depth, k;
383 rice->
sum1 += value - (rice->
sum1 >> 4);
390 rice->
sum0 += value - (rice->
sum0 >> 4);
398 *p = 1 + ((value >> 1) ^ ((value & 1) - 1));
404 #define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k)
406 case 1: *p +=
PRED(*predictor, 4);
break;
408 case 3: *p +=
PRED(*predictor, 5);
break;
409 case 4: *p += *predictor;
break;
420 for (*p += *r / 2; r > p - s->
channels; r--)
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
static int tta_check_crc(TTAContext *s, const uint8_t *buf, int buf_size)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static void rice_init(TTARice *c, uint32_t k0, uint32_t k1)
This structure describes decoded (raw) audio or video data.
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static void skip_bits_long(GetBitContext *s, int n)
AVFrame * coded_frame
the picture in the bitstream
static av_cold int tta_decode_init(AVCodecContext *avctx)
static int tta_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
static void align_get_bits(GetBitContext *s)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int tta_get_unary(GetBitContext *gb)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
struct TTAFilter TTAFilter
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
static av_cold int tta_decode_close(AVCodecContext *avctx)
static const uint32_t *const shift_16
enum AVSampleFormat sample_fmt
audio sample format
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
bitstream reader API header.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
static int init(AVCodecParserContext *s)
static int get_bits_left(GetBitContext *gb)
static const uint32_t shift_1[]
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
struct TTAContext TTAContext
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
struct TTAChannel TTAChannel
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
static void ttafilter_init(TTAFilter *c, int32_t shift)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
Get a buffer for a frame.
static void ttafilter_process(TTAFilter *c, int32_t *in)
static void memshl(register int32_t *a, register int32_t *b)
int sample_rate
samples per second
main external API structure.
static void close(AVCodecParserContext *s)
static unsigned int get_bits1(GetBitContext *s)
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
void av_log_missing_feature(void *avc, const char *feature, int want_sample)
Log a generic warning message about a missing feature.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static const int32_t ttafilter_configs[4]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
#define AVERROR_INVALIDDATA
#define AVERROR_PATCHWELCOME
int channels
number of audio channels
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
if(!(ptr_align%ac->ptr_align)&&samples_align >=aligned_len)