Home | History | Annotate | Download | only in source
      1 /*
      2  *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 /*
     12  * arith_routines.h
     13  *
     14  * Functions for arithmetic coding.
     15  *
     16  */
     17 
     18 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ARITH_ROUTINES_H_
     19 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ARITH_ROUTINES_H_
     20 
     21 #include "structs.h"
     22 
     23 
     24 int WebRtcIsac_EncLogisticMulti2(
     25     Bitstr *streamdata,              /* in-/output struct containing bitstream */
     26     WebRtc_Word16 *dataQ7,           /* input: data vector */
     27     const WebRtc_UWord16 *env,       /* input: side info vector defining the width of the pdf */
     28     const int N,                     /* input: data vector length */
     29     const WebRtc_Word16 isSWB12kHz); /* if the codec is working in 12kHz bandwidth */
     30 
     31 /* returns the number of bytes in the stream */
     32 int WebRtcIsac_EncTerminate(Bitstr *streamdata); /* in-/output struct containing bitstream */
     33 
     34 /* returns the number of bytes in the stream so far */
     35 int WebRtcIsac_DecLogisticMulti2(
     36     WebRtc_Word16 *data,             /* output: data vector */
     37     Bitstr *streamdata,              /* in-/output struct containing bitstream */
     38     const WebRtc_UWord16 *env,       /* input: side info vector defining the width of the pdf */
     39     const WebRtc_Word16 *dither,     /* input: dither vector */
     40     const int N,                     /* input: data vector length */
     41     const WebRtc_Word16 isSWB12kHz); /* if the codec is working in 12kHz bandwidth */
     42 
     43 void WebRtcIsac_EncHistMulti(
     44     Bitstr *streamdata,         /* in-/output struct containing bitstream */
     45     const int *data,            /* input: data vector */
     46     const WebRtc_UWord16 **cdf, /* input: array of cdf arrays */
     47     const int N);               /* input: data vector length */
     48 
     49 int WebRtcIsac_DecHistBisectMulti(
     50     int *data,                      /* output: data vector */
     51     Bitstr *streamdata,             /* in-/output struct containing bitstream */
     52     const WebRtc_UWord16 **cdf,     /* input: array of cdf arrays */
     53     const WebRtc_UWord16 *cdf_size, /* input: array of cdf table sizes+1 (power of two: 2^k) */
     54     const int N);                   /* input: data vector length */
     55 
     56 int WebRtcIsac_DecHistOneStepMulti(
     57     int *data,                       /* output: data vector */
     58     Bitstr *streamdata,              /* in-/output struct containing bitstream */
     59     const WebRtc_UWord16 **cdf,      /* input: array of cdf arrays */
     60     const WebRtc_UWord16 *init_index,/* input: vector of initial cdf table search entries */
     61     const int N);                    /* input: data vector length */
     62 
     63 #endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ARITH_ROUTINES_H_ */
     64