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
105 static inline void memshl(
register int32_t *
a,
register int32_t *
b) {
119 register int32_t *dl = c->
dl, *qm = c->
qm, *dx = c->
dx, sum = c->
round;
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++;
128 sum += *dl++ * *qm, qm++;
129 sum += *dl++ * *qm, qm++;
131 }
else if(c->
error < 0) {
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++;
138 sum += *dl++ * (*qm -= *dx++), qm++;
139 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++;
147 sum += *dl++ * (*qm += *dx++), qm++;
148 sum += *dl++ * (*qm += *dx++), qm++;
151 *(dx-0) = ((*(dl-1) >> 30) | 1) << 2;
152 *(dx-1) = ((*(dl-2) >> 30) | 1) << 1;
153 *(dx-2) = ((*(dl-3) >> 30) | 1) << 1;
154 *(dx-3) = ((*(dl-4) >> 30) | 1);
159 *in -= (sum >> c->
shift);
163 *in += (sum >> c->
shift);
168 *(dl-1) = *dl - *(dl-1);
169 *(dl-2) = *(dl-1) - *(dl-2);
170 *(dl-3) = *(dl-2) - *(dl-3);
201 if (CRC != (crc ^ 0xFFFFFFFFU)) {
324 int *got_frame_ptr,
AVPacket *avpkt)
326 const uint8_t *buf = avpkt->
data;
327 int buf_size = avpkt->
size;
367 uint32_t unary,
depth, k;
394 rice->
sum1 += value - (rice->
sum1 >> 4);
401 rice->
sum0 += value - (rice->
sum0 >> 4);
409 #define UNFOLD(x) (((x)&1) ? (++(x)>>1) : (-(x)>>1))
416 #define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k)
418 case 1: *p +=
PRED(*predictor, 4);
break;
420 case 3: *p +=
PRED(*predictor, 5);
break;
421 case 4: *p += *predictor;
break;
432 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_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static void rice_init(TTARice *c, uint32_t k0, uint32_t k1)
static const int32_t ttafilter_configs[4][2]
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)
#define AV_LOG_WARNING
Something somehow does not look correct.
static int tta_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
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)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
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(). ...
static void ttafilter_process(TTAFilter *c, int32_t *in, int32_t mode)
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, int32_t mode)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
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)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static unsigned int get_bits1(GetBitContext *s)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
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.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int channels
number of audio channels
void avcodec_get_frame_defaults(AVFrame *pic)
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.
int nb_samples
number of audio samples (per channel) described by this frame