~ubuntu-branches/ubuntu/lucid/ffmpeg/lucid-updates

« back to all changes in this revision

Viewing changes to libavcodec/adpcm.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-01-20 17:51:19 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120175119-gu6kw1arv5tmf1vr
Tags: 3:0.svn20090119-1ubuntu1+unstripped1
* merge with the ubuntu.jaunty branch
* reenable x264 LP: #303537
* build against vdpau
* enable xvmc support

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
 
154
154
/* XXX: implement encoding */
155
155
 
156
 
#ifdef CONFIG_ENCODERS
 
156
#if CONFIG_ENCODERS
157
157
static int adpcm_encode_init(AVCodecContext *avctx)
158
158
{
159
159
    if (avctx->channels > 2)
1131
1131
            *samples++ = c->status[0].predictor - c->status[1].predictor;
1132
1132
        }
1133
1133
        break;
 
1134
    case CODEC_ID_ADPCM_IMA_ISS:
 
1135
        c->status[0].predictor  = (int16_t)AV_RL16(src + 0);
 
1136
        c->status[0].step_index = src[2];
 
1137
        src += 4;
 
1138
        if(st) {
 
1139
            c->status[1].predictor  = (int16_t)AV_RL16(src + 0);
 
1140
            c->status[1].step_index = src[2];
 
1141
            src += 4;
 
1142
        }
 
1143
 
 
1144
        while (src < buf + buf_size) {
 
1145
 
 
1146
            if (st) {
 
1147
                *samples++ = adpcm_ima_expand_nibble(&c->status[0],
 
1148
                    src[0] >> 4  , 3);
 
1149
                *samples++ = adpcm_ima_expand_nibble(&c->status[1],
 
1150
                    src[0] & 0x0F, 3);
 
1151
            } else {
 
1152
                *samples++ = adpcm_ima_expand_nibble(&c->status[0],
 
1153
                    src[0] & 0x0F, 3);
 
1154
                *samples++ = adpcm_ima_expand_nibble(&c->status[0],
 
1155
                    src[0] >> 4  , 3);
 
1156
            }
 
1157
 
 
1158
            src++;
 
1159
        }
 
1160
        break;
1134
1161
    case CODEC_ID_ADPCM_IMA_WS:
1135
1162
        /* no per-block initialization; just start decoding the data */
1136
1163
        while (src < buf + buf_size) {
1589
1616
 
1590
1617
 
1591
1618
 
1592
 
#ifdef CONFIG_ENCODERS
 
1619
#if CONFIG_ENCODERS
1593
1620
#define ADPCM_ENCODER(id,name,long_name_)       \
1594
1621
AVCodec name ## _encoder = {                    \
1595
1622
    #name,                                      \
1607
1634
#define ADPCM_ENCODER(id,name,long_name_)
1608
1635
#endif
1609
1636
 
1610
 
#ifdef CONFIG_DECODERS
 
1637
#if CONFIG_DECODERS
1611
1638
#define ADPCM_DECODER(id,name,long_name_)       \
1612
1639
AVCodec name ## _decoder = {                    \
1613
1640
    #name,                                      \
1641
1668
ADPCM_DECODER(CODEC_ID_ADPCM_IMA_DK4, adpcm_ima_dk4, "IMA Duck DK4 ADPCM");
1642
1669
ADPCM_DECODER(CODEC_ID_ADPCM_IMA_EA_EACS, adpcm_ima_ea_eacs, "IMA Electronic Arts EACS ADPCM");
1643
1670
ADPCM_DECODER(CODEC_ID_ADPCM_IMA_EA_SEAD, adpcm_ima_ea_sead, "IMA Electronic Arts SEAD ADPCM");
 
1671
ADPCM_DECODER(CODEC_ID_ADPCM_IMA_ISS, adpcm_ima_iss, "IMA Funcom ISS ADPCM");
1644
1672
ADPCM_CODEC  (CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, "IMA QuickTime ADPCM");
1645
1673
ADPCM_DECODER(CODEC_ID_ADPCM_IMA_SMJPEG, adpcm_ima_smjpeg, "IMA Loki SDL MJPEG ADPCM");
1646
1674
ADPCM_CODEC  (CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, "IMA Wav ADPCM");