]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ra144.h
amrwbdec: set channels, channel_layout, and sample_rate
[ffmpeg] / libavcodec / ra144.h
index bffa8b337a2a0d4dad0e7bf85b1cc0961288875c..73f83f08654bdef4bcba67fc65abe477b6c957a8 100644 (file)
@@ -2,20 +2,20 @@
  * Real Audio 1.0 (14.4K)
  * Copyright (c) 2003 the ffmpeg project
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define AVCODEC_RA144_H
 
 #include <stdint.h>
+#include "lpc.h"
+#include "audio_frame_queue.h"
 
 #define NBLOCKS         4       ///< number of subblocks within a block
 #define BLOCKSIZE       40      ///< subblock size in 16-bit words
 #define BUFFERSIZE      146     ///< the size of the adaptive codebook
+#define FIXED_CB_SIZE   128     ///< size of fixed codebooks
+#define FRAMESIZE       20      ///< size of encoded frame
+#define LPC_ORDER       10      ///< order of LPC filter
 
-typedef struct {
+typedef struct RA144Context {
     AVCodecContext *avctx;
+    AVFrame frame;
+    LPCContext lpc_ctx;
+    AudioFrameQueue afq;
+    int last_frame;
 
     unsigned int     old_energy;        ///< previous frame energy
 
@@ -41,6 +50,8 @@ typedef struct {
 
     unsigned int     lpc_refl_rms[2];
 
+    int16_t curr_block[NBLOCKS * BLOCKSIZE];
+
     /** The current subblock padded by the last 10 values of the previous one. */
     int16_t curr_sblock[50];
 
@@ -49,8 +60,6 @@ typedef struct {
     uint16_t adapt_cb[146+2];
 } RA144Context;
 
-void ff_add_wav(int16_t *dest, int n, int skip_first, int *m, const int16_t *s1,
-                const int8_t *s2, const int8_t *s3);
 void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset);
 int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx);
 void ff_eval_coefs(int *coefs, const int *refl);