]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/g729dec.c
pcm: switch to ff_alloc_packet2().
[ffmpeg] / libavcodec / g729dec.c
index 191794b6e71e33e9e9038b20ce06ef55ca46d73f..2f70115814cd562714cbc4b95b2d5544ec923267 100644 (file)
@@ -333,12 +333,12 @@ static int16_t g729d_voice_decision(int onset, int prev_voice_decision, const in
     return voice_decision;
 }
 
-static int32_t scalarproduct_int16_c(const int16_t * v1, const int16_t * v2, int order, int shift)
+static int32_t scalarproduct_int16_c(const int16_t * v1, const int16_t * v2, int order)
 {
     int res = 0;
 
     while (order--)
-        res += (*v1++ * *v2++) >> shift;
+        res += *v1++ * *v2++;
 
     return res;
 }
@@ -378,7 +378,7 @@ static av_cold int decoder_init(AVCodecContext * avctx)
     for(i=0; i<4; i++)
         ctx->quant_energy[i] = -14336; // -14 in (5.10)
 
-    dsputil_init(&ctx->dsp, avctx);
+    ff_dsputil_init(&ctx->dsp, avctx);
     ctx->dsp.scalarproduct_int16 = scalarproduct_int16_c;
 
     avcodec_get_frame_defaults(&ctx->frame);
@@ -420,7 +420,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;
     }
-    out_frame= ctx->frame.data[0];
+    out_frame = (int16_t*) ctx->frame.data[0];
 
     if (buf_size == 10) {
         packet_type = FORMAT_G729_8K;
@@ -622,7 +622,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
             1,
             0,
             0x800))
-            /* Overflow occured, downscale excitation signal... */
+            /* Overflow occurred, downscale excitation signal... */
             for (j = 0; j < 2 * SUBFRAME_SIZE + PITCH_DELAY_MAX + INTERPOL_LEN; j++)
                 ctx->exc_base[j] >>= 2;