diff options
author | Paul B Mahol | 2012-02-17 17:01:22 +0000 |
---|---|---|
committer | Justin Ruggles | 2012-02-17 13:38:09 -0500 |
commit | 323b9da9691acfac5dbd5c13f99f8010a882003e (patch) | |
tree | 20f9641aa56ebc5539152729111cbd58464bf4b8 /libavcodec/tta.c | |
parent | 1bab6f852c7ca433285d19f65c701885fa69cc57 (diff) |
ttadec: remove dead code
The unused code being removed is for encoding only and therefore is not needed
by the decoder.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavcodec/tta.c')
-rw-r--r-- | libavcodec/tta.c | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 688c88d2f9..db9c1b288e 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -39,7 +39,7 @@ #define MAX_ORDER 16 typedef struct TTAFilter { - int32_t shift, round, error, mode; + int32_t shift, round, error; int32_t qm[MAX_ORDER]; int32_t dx[MAX_ORDER]; int32_t dl[MAX_ORDER]; @@ -84,19 +84,18 @@ static const uint32_t shift_1[] = { static const uint32_t * const shift_16 = shift_1 + 4; -static const int32_t ttafilter_configs[4][2] = { - {10, 1}, - {9, 1}, - {10, 1}, - {12, 0} +static const int32_t ttafilter_configs[4] = { + 10, + 9, + 10, + 12 }; -static void ttafilter_init(TTAFilter *c, int32_t shift, int32_t mode) { +static void ttafilter_init(TTAFilter *c, int32_t shift) { memset(c, 0, sizeof(TTAFilter)); c->shift = shift; c->round = shift_1[shift-1]; // c->round = 1 << (shift - 1); - c->mode = mode; } // FIXME: copy paste from original @@ -111,9 +110,8 @@ static inline void memshl(register int32_t *a, register int32_t *b) { *a = *b; } -// FIXME: copy paste from original -// mode=1 encoder, mode=0 decoder -static inline void ttafilter_process(TTAFilter *c, int32_t *in, int32_t mode) { +static inline void ttafilter_process(TTAFilter *c, int32_t *in) +{ register int32_t *dl = c->dl, *qm = c->qm, *dx = c->dx, sum = c->round; if (!c->error) { @@ -151,22 +149,13 @@ static inline void ttafilter_process(TTAFilter *c, int32_t *in, int32_t mode) { *(dx-2) = ((*(dl-3) >> 30) | 1) << 1; *(dx-3) = ((*(dl-4) >> 30) | 1); - // compress - if (mode) { - *dl = *in; - *in -= (sum >> c->shift); - c->error = *in; - } else { - c->error = *in; - *in += (sum >> c->shift); - *dl = *in; - } + c->error = *in; + *in += (sum >> c->shift); + *dl = *in; - if (c->mode) { - *(dl-1) = *dl - *(dl-1); - *(dl-2) = *(dl-1) - *(dl-2); - *(dl-3) = *(dl-2) - *(dl-3); - } + *(dl-1) = *dl - *(dl-1); + *(dl-2) = *(dl-1) - *(dl-2); + *(dl-3) = *(dl-2) - *(dl-3); memshl(c->dl, c->dl + 1); memshl(c->dx, c->dx + 1); @@ -353,7 +342,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data, // init per channel states for (i = 0; i < s->channels; i++) { s->ch_ctx[i].predictor = 0; - ttafilter_init(&s->ch_ctx[i].filter, ttafilter_configs[s->bps-1][0], ttafilter_configs[s->bps-1][1]); + ttafilter_init(&s->ch_ctx[i].filter, ttafilter_configs[s->bps-1]); rice_init(&s->ch_ctx[i].rice, 10, 10); } @@ -411,7 +400,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data, *p = UNFOLD(value); // run hybrid filter - ttafilter_process(filter, p, 0); + ttafilter_process(filter, p); // fixed order prediction #define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k) |