summaryrefslogtreecommitdiffstats
path: root/libavcodec/adpcm.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2008-07-11 21:38:42 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2008-07-11 21:38:42 +0000
commitddcf031f3b8241aa16726cac2e3761b22c4d591d (patch)
tree989946d6ce1448705dc88404075c0fd2341942aa /libavcodec/adpcm.c
parent4972a2464bc1d87bb8a1f12f588e94bfcaaeae3e (diff)
downloadffmpeg-streaming-ddcf031f3b8241aa16726cac2e3761b22c4d591d.zip
ffmpeg-streaming-ddcf031f3b8241aa16726cac2e3761b22c4d591d.tar.gz
Change MS ADPCM table so they fit into int8_t and change array type.
Originally committed as revision 14173 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index f4ca273..06dfdcc 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -85,12 +85,12 @@ static const int AdaptationTable[] = {
768, 614, 512, 409, 307, 230, 230, 230
};
-static const int AdaptCoeff1[] = {
- 256, 512, 0, 192, 240, 460, 392
+static const int8_t AdaptCoeff1[] = {
+ 64, 128, 0, 48, 60, 115, 98
};
-static const int AdaptCoeff2[] = {
- 0, -256, 0, 64, 0, -208, -232
+static const int8_t AdaptCoeff2[] = {
+ 0, -64, 0, 16, 0, -52, -58
};
/* These are for CD-ROM XA ADPCM */
@@ -226,7 +226,7 @@ static inline unsigned char adpcm_ms_compress_sample(ADPCMChannelStatus *c, shor
{
int predictor, nibble, bias;
- predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 256;
+ predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 64;
nibble= sample - predictor;
if(nibble>=0) bias= c->idelta/2;
@@ -330,7 +330,7 @@ static void adpcm_compress_trellis(AVCodecContext *avctx, const short *samples,
const int step = nodes[j]->step;
int nidx;
if(version == CODEC_ID_ADPCM_MS) {
- const int predictor = ((nodes[j]->sample1 * c->coeff1) + (nodes[j]->sample2 * c->coeff2)) / 256;
+ const int predictor = ((nodes[j]->sample1 * c->coeff1) + (nodes[j]->sample2 * c->coeff2)) / 64;
const int div = (sample - predictor) / step;
const int nmin = av_clip(div-range, -8, 6);
const int nmax = av_clip(div+range, -7, 7);
OpenPOWER on IntegriCloud