]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/g722enc.c
Merge commit '0f532fd3f9b9ca974cea0feb8ddcaf4a7f3b23c5'
[ffmpeg] / libavcodec / g722enc.c
index 17dde9ec809837f0d0cd290885fef23dd897257d..5a7bfb25fed3697dd5cd80de82329d1bb2ab5a6f 100644 (file)
@@ -120,6 +120,8 @@ static av_cold int g722_encode_init(AVCodecContext * avctx)
         }
     }
 
+    ff_g722dsp_init(&c->dsp);
+
     return 0;
 error:
     g722_encode_close(avctx);
@@ -136,12 +138,12 @@ static const int16_t low_quant[33] = {
 static inline void filter_samples(G722Context *c, const int16_t *samples,
                                   int *xlow, int *xhigh)
 {
-    int xout1, xout2;
+    int xout[2];
     c->prev_samples[c->prev_samples_pos++] = samples[0];
     c->prev_samples[c->prev_samples_pos++] = samples[1];
-    ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);
-    *xlow  = xout1 + xout2 >> 14;
-    *xhigh = xout1 - xout2 >> 14;
+    c->dsp.apply_qmf(c->prev_samples + c->prev_samples_pos - 24, xout);
+    *xlow  = xout[0] + xout[1] >> 14;
+    *xhigh = xout[0] - xout[1] >> 14;
     if (c->prev_samples_pos >= PREV_SAMPLES_BUF_SIZE) {
         memmove(c->prev_samples,
                 c->prev_samples + c->prev_samples_pos - 22,