]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/truespeech.c
Drop some pointless #ifdefs.
[ffmpeg] / libavcodec / truespeech.c
index 524884ddf54a17a08fc4df20b233bdeddb8df2b7..bf83f531450cd9b8787747b6418160a461e68a9d 100644 (file)
@@ -37,7 +37,7 @@ typedef struct {
     AVFrame frame;
     DSPContext dsp;
     /* input data */
-    uint8_t buffer[32];
+    DECLARE_ALIGNED(16, uint8_t, buffer)[32];
     int16_t vector[8];  ///< input vector: 5/5/4/4/4/3/3/3
     int offset1[2];     ///< 8-bit value, used in one copying offset
     int offset2[4];     ///< 7-bit value, encodes offsets for copying and for two-point filter
@@ -68,7 +68,7 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
 
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
 
-    dsputil_init(&c->dsp, avctx);
+    ff_dsputil_init(&c->dsp, avctx);
 
     avcodec_get_frame_defaults(&c->frame);
     avctx->coded_frame = &c->frame;
@@ -179,6 +179,7 @@ static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
     for(i = 0; i < 146; i++)
         tmp[i] = dec->filtbuf[i];
     off = (t / 25) + dec->offset1[quart >> 1] + 18;
+    off = av_clip(off, 0, 145);
     ptr0 = tmp + 145 - off;
     ptr1 = tmp + 146;
     filter = (const int16_t*)ts_order2_coeffs + (t % 25) * 2;
@@ -364,5 +365,5 @@ AVCodec ff_truespeech_decoder = {
     .init           = truespeech_decode_init,
     .decode         = truespeech_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
-    .long_name = NULL_IF_CONFIG_SMALL("DSP Group TrueSpeech"),
+    .long_name      = NULL_IF_CONFIG_SMALL("DSP Group TrueSpeech"),
 };