]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'b74b88f30da2389f333a31815d8326d5576d3331'
authorHendrik Leppkes <h.leppkes@gmail.com>
Mon, 7 Dec 2015 13:58:38 +0000 (14:58 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Mon, 7 Dec 2015 13:58:38 +0000 (14:58 +0100)
* commit 'b74b88f30da2389f333a31815d8326d5576d3331':
  g723_1: Handle values at the ends of the table in lsp2lpc()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavcodec/g723_1_data.h

index db7f6e4d3cdf5ea4a5bc3cfdc2fbe7ddbab3a577,c4c4d77a6203dc2894768f86519709aea3887d47..41ec341d6c0c90878555e6001573f5a0791b3241
  #define GAIN_LEVELS     24
  #define COS_TBL_SIZE    512
  
 +/**
 + * G723.1 frame types
 + */
 +typedef enum FrameType {
 +    ACTIVE_FRAME,        ///< Active speech
 +    SID_FRAME,           ///< Silence Insertion Descriptor frame
 +    UNTRANSMITTED_FRAME
 +} FrameType;
 +
  static const uint8_t frame_size[4] = { 24, 20, 4, 1 };
  
 -/* Postfilter gain weighting factors scaled by 2^15 */
 -static const int16_t ppf_gain_weight[2] = { 0x1800, 0x2000 };
 +typedef enum Rate {
 +    RATE_6300,
 +    RATE_5300
 +} Rate;
 +
 +/**
 + * G723.1 unpacked data subframe
 + */
 +typedef struct G723_1_Subframe {
 +    int ad_cb_lag;     ///< adaptive codebook lag
 +    int ad_cb_gain;
 +    int dirac_train;
 +    int pulse_sign;
 +    int grid_index;
 +    int amp_index;
 +    int pulse_pos;
 +} G723_1_Subframe;
 +
 +/**
 + * Pitch postfilter parameters
 + */
 +typedef struct PPFParam {
 +    int     index;    ///< postfilter backward/forward lag
 +    int16_t opt_gain; ///< optimal gain
 +    int16_t sc_gain;  ///< scaling gain
 +} PPFParam;
 +
 +/**
 + * Harmonic filter parameters
 + */
 +typedef struct HFParam {
 +    int index;
 +    int gain;
 +} HFParam;
  
 -/* LSP DC component */
 +/**
 + * Optimized fixed codebook excitation parameters
 + */
 +typedef struct FCBParam {
 +    int min_err;
 +    int amp_index;
 +    int grid_index;
 +    int dirac_train;
 +    int pulse_pos[PULSE_MAX];
 +    int pulse_sign[PULSE_MAX];
 +} FCBParam;
 +
 +/**
 + * Postfilter gain weighting factors scaled by 2^15
 + */
 +static const int16_t ppf_gain_weight[2] = {0x1800, 0x2000};
 +
 +/**
 + * LSP DC component
 + */
  static const int16_t dc_lsp[LPC_ORDER] = {
 -    0x0c3b, 0x1271, 0x1e0a, 0x2a36, 0x3630,
 -    0x406f, 0x4d28, 0x56f4, 0x638c, 0x6c46
 +    0x0c3b,
 +    0x1271,
 +    0x1e0a,
 +    0x2a36,
 +    0x3630,
 +    0x406f,
 +    0x4d28,
 +    0x56f4,
 +    0x638c,
 +    0x6c46
  };
  
- /**
-  * Cosine table scaled by 2^14
-  */
- static const int16_t cos_tab[COS_TBL_SIZE+1] = {
+ /* Cosine table scaled by 2^14 */
+ static const int16_t cos_tab[COS_TBL_SIZE + 1] = {
      16384,  16383,  16379,  16373,  16364,  16353,  16340,  16324,
      16305,  16284,  16261,  16235,  16207,  16176,  16143,  16107,
      16069,  16029,  15986,  15941,  15893,  15843,  15791,  15736,