changeset 9853:ae38e13a63d6 libavcodec

G.729 decoder initialization routine (skeleton)
author voroshil
date Sun, 14 Jun 2009 02:31:06 +0000
parents af3cc583501e
children 2428d32533f6
files g729dec.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/g729dec.c	Sun Jun 14 02:29:39 2009 +0000
+++ b/g729dec.c	Sun Jun 14 02:31:06 2009 +0000
@@ -97,11 +97,19 @@
    return (0x6996966996696996ULL >> (value >> 2)) & 1;
 }
 
+static av_cold int decoder_init(AVCodecContext * avctx)
+{
     if (avctx->channels != 1) {
         av_log(avctx, AV_LOG_ERROR, "Only mono sound is supported (requested channels: %d).\n", avctx->channels);
         return AVERROR_NOFMT;
     }
 
+    /* Both 8kbit/s and 6.4kbit/s modes uses two subframes per frame. */
+    avctx->frame_size = SUBFRAME_SIZE << 1;
+
+    return 0;
+}
+
         ff_acelp_weighted_vector_sum(fc + pitch_delay_int[i],
                                      fc + pitch_delay_int[i],
                                      fc, 1 << 14,