亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? vlc.c

?? G729、h263、h264、MPEG4四種最流行的音頻和視頻標準的壓縮和解壓算法的源代碼.rar
?? C
?? 第 1 頁 / 共 3 頁
字號:

/*!
 ************************************************************************
 * \file vlc.c
 *
 * \brief
 *    VLC support functions
 *
 * \author
 *    Main contributors (see contributors.h for copyright, address and affiliation details)
 *    - Inge Lille-Lang鴜               <inge.lille-langoy@telenor.com>
 *    - Detlev Marpe                    <marpe@hhi.de>
 *    - Gabi Blaettermann               <blaetter@hhi.de>
 ************************************************************************
 */
#include "contributors.h"

#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <assert.h>

#include "global.h"
#include "vlc.h"
#include "elements.h"


// A little trick to avoid those horrible #if TRACE all over the source code
#if TRACE
#define SYMTRACESTRING(s) strncpy(sym->tracestring,s,TRACESTRING_SIZE)
#else
#define SYMTRACESTRING(s) // do nothing
#endif

extern void tracebits(const char *trace_str,  int len,  int info,int value1);


int UsedBits;      // for internal statistics, is adjusted by se_v, ue_v, u_1

// Note that all NA values are filled with 0

//! for the linfo_levrun_inter routine
const byte NTAB1[4][8][2] =
{
  {{1,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
  {{1,1},{1,2},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
  {{2,0},{1,3},{1,4},{1,5},{0,0},{0,0},{0,0},{0,0}},
  {{3,0},{2,1},{2,2},{1,6},{1,7},{1,8},{1,9},{4,0}},
};
const byte LEVRUN1[16]=
{
  4,2,2,1,1,1,1,1,1,1,0,0,0,0,0,0,
};


const byte NTAB2[4][8][2] =
{
  {{1,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
  {{1,1},{2,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
  {{1,2},{3,0},{4,0},{5,0},{0,0},{0,0},{0,0},{0,0}},
  {{1,3},{1,4},{2,1},{3,1},{6,0},{7,0},{8,0},{9,0}},
};

//! for the linfo_levrun__c2x2 routine
const byte LEVRUN3[4] =
{
  2,1,0,0
};
const byte NTAB3[2][2][2] =
{
  {{1,0},{0,0}},
  {{2,0},{1,1}},
};

/*! 
 *************************************************************************************
 * \brief
 *    ue_v, reads an ue(v) syntax element, the length in bits is stored in 
 *    the global UsedBits variable
 *
 * \param tracestring
 *    the string for the trace file
 *
 * \param bitstream
 *    the stream to be read from
 *
 * \return
 *    the value of the coded syntax element
 *
 *************************************************************************************
 */
int ue_v (char *tracestring, Bitstream *bitstream)
{
  SyntaxElement symbol, *sym=&symbol;

  assert (bitstream->streamBuffer != NULL);
  sym->type = SE_HEADER;
  sym->mapping = linfo_ue;   // Mapping rule
  SYMTRACESTRING(tracestring);
  readSyntaxElement_VLC (sym, bitstream);
  UsedBits+=sym->len;
  return sym->value1;
}


/*! 
 *************************************************************************************
 * \brief
 *    ue_v, reads an se(v) syntax element, the length in bits is stored in 
 *    the global UsedBits variable
 *
 * \param tracestring
 *    the string for the trace file
 *
 * \param bitstream
 *    the stream to be read from
 *
 * \return
 *    the value of the coded syntax element
 *
 *************************************************************************************
 */
int se_v (char *tracestring, Bitstream *bitstream)
{
  SyntaxElement symbol, *sym=&symbol;

  assert (bitstream->streamBuffer != NULL);
  sym->type = SE_HEADER;
  sym->mapping = linfo_se;   // Mapping rule: signed integer
  SYMTRACESTRING(tracestring);
  readSyntaxElement_VLC (sym, bitstream);
  UsedBits+=sym->len;
  return sym->value1;
}


/*! 
 *************************************************************************************
 * \brief
 *    ue_v, reads an u(v) syntax element, the length in bits is stored in 
 *    the global UsedBits variable
 *
 * \param LenInBits
 *    length of the syntax element
 *
 * \param tracestring
 *    the string for the trace file
 *
 * \param bitstream
 *    the stream to be read from
 *
 * \return
 *    the value of the coded syntax element
 *
 *************************************************************************************
 */
int u_v (int LenInBits, char*tracestring, Bitstream *bitstream)
{
  SyntaxElement symbol, *sym=&symbol;

  assert (bitstream->streamBuffer != NULL);
  sym->type = SE_HEADER;
  sym->mapping = linfo_ue;   // Mapping rule
  sym->len = LenInBits;
  SYMTRACESTRING(tracestring);
  readSyntaxElement_FLC (sym, bitstream);
  UsedBits+=sym->len;
  return sym->inf;
};

                
/*! 
 *************************************************************************************
 * \brief
 *    ue_v, reads an u(1) syntax element, the length in bits is stored in 
 *    the global UsedBits variable
 *
 * \param tracestring
 *    the string for the trace file
 *
 * \param bitstream
 *    the stream to be read from
 *
 * \return
 *    the value of the coded syntax element
 *
 *************************************************************************************
 */
int u_1 (char *tracestring, Bitstream *bitstream)
{
  return u_v (1, tracestring, bitstream);
}



/*!
 ************************************************************************
 * \brief
 *    mapping rule for ue(v) syntax elements
 * \par Input:
 *    lenght and info
 * \par Output:
 *    number in the code table
 ************************************************************************
 */
void linfo_ue(int len, int info, int *value1, int *dummy)
{
  *value1 = (int)pow(2,(len/2))+info-1; // *value1 = (int)(2<<(len>>1))+info-1;
}

/*!
 ************************************************************************
 * \brief
 *    mapping rule for se(v) syntax elements
 * \par Input:
 *    lenght and info
 * \par Output:
 *    signed mvd
 ************************************************************************
 */
void linfo_se(int len,  int info, int *value1, int *dummy)
{
  int n;
  n = (int)pow(2,(len/2))+info-1;
  *value1 = (n+1)/2;
  if((n & 0x01)==0)                           // lsb is signed bit
    *value1 = -*value1;
}


/*!
 ************************************************************************
 * \par Input:
 *    lenght and info
 * \par Output:
 *    cbp (intra)
 ************************************************************************
 */
void linfo_cbp_intra(int len,int info,int *cbp, int *dummy)
{
  extern const byte NCBP[48][2];
    int cbp_idx;
  linfo_ue(len,info,&cbp_idx,dummy);
    *cbp=NCBP[cbp_idx][0];
}

/*!
 ************************************************************************
 * \par Input:
 *    lenght and info
 * \par Output:
 *    cbp (inter)
 ************************************************************************
 */
void linfo_cbp_inter(int len,int info,int *cbp, int *dummy)
{
  extern const byte NCBP[48][2];
  int cbp_idx;
  linfo_ue(len,info,&cbp_idx,dummy);
    *cbp=NCBP[cbp_idx][1];
}

/*!
 ************************************************************************
 * \par Input:
 *    lenght and info
 * \par Output:
 *    level, run
 ************************************************************************
 */
void linfo_levrun_inter(int len, int info, int *level, int *irun)
{
  int l2;
  int inf;
  if (len<=9)
  {
    l2=max(0,len/2-1);
    inf=info/2;
    *level=NTAB1[l2][inf][0];
    *irun=NTAB1[l2][inf][1];
    if ((info&0x01)==1)
      *level=-*level;                   // make sign
  }
  else                                  // if len > 9, skip using the array
  {
    *irun=(info&0x1e)>>1;
    *level = LEVRUN1[*irun] + info/32 + (int)pow(2,len/2 - 5);
    if ((info&0x01)==1)
      *level=-*level;
  }
    if (len == 1) // EOB
        *level = 0;
}


/*!
 ************************************************************************
 * \par Input:
 *    lenght and info
 * \par Output:
 *    level, run
 ************************************************************************
 */
void linfo_levrun_c2x2(int len, int info, int *level, int *irun)
{
  int l2;
  int inf;

  if (len<=5)
  {
    l2=max(0,len/2-1);
    inf=info/2;
    *level=NTAB3[l2][inf][0];
    *irun=NTAB3[l2][inf][1];
    if ((info&0x01)==1)
      *level=-*level;                 // make sign
  }
  else                                  // if len > 5, skip using the array
  {
    *irun=(info&0x06)>>1;
    *level = LEVRUN3[*irun] + info/8 + (int)pow(2,len/2 - 3);
    if ((info&0x01)==1)
      *level=-*level;
  }
  if (len == 1) // EOB
    *level = 0;
}

/*!
 ************************************************************************
 * \brief
 *    read next UVLC codeword from UVLC-partition and
 *    map it to the corresponding syntax element
 ************************************************************************
 */
int readSyntaxElement_VLC(SyntaxElement *sym, Bitstream *currStream)
{
  int frame_bitoffset = currStream->frame_bitoffset;
  byte *buf = currStream->streamBuffer;
  int BitstreamLengthInBytes = currStream->bitstream_length;

  sym->len =  GetVLCSymbol (buf, frame_bitoffset, &(sym->inf), BitstreamLengthInBytes);
  if (sym->len == -1)
    return -1;
  currStream->frame_bitoffset += sym->len;
  sym->mapping(sym->len,sym->inf,&(sym->value1),&(sym->value2));

#if TRACE
  tracebits(sym->tracestring, sym->len, sym->inf, sym->value1);
#endif

  return 1;
}


/*!
 ************************************************************************
 * \brief
 *    read next UVLC codeword from UVLC-partition and
 *    map it to the corresponding syntax element
 ************************************************************************
 */
int readSyntaxElement_UVLC(SyntaxElement *sym, struct img_par *img, struct inp_par *inp, struct datapartition *dP)
{
  Bitstream   *currStream = dP->bitstream;

  return (readSyntaxElement_VLC(sym, currStream));
}

/*!
 ************************************************************************
 * \brief
 *    read next VLC codeword for 4x4 Intra Prediction Mode and
 *    map it to the corresponding Intra Prediction Direction
 ************************************************************************
 */
int readSyntaxElement_Intra4x4PredictionMode(SyntaxElement *sym, struct img_par *img, struct inp_par *inp, struct datapartition *dP)
{
  Bitstream   *currStream            = dP->bitstream;
  int         frame_bitoffset        = currStream->frame_bitoffset;
  byte        *buf                   = currStream->streamBuffer;
  int         BitstreamLengthInBytes = currStream->bitstream_length;

  sym->len = GetVLCSymbol_IntraMode (buf, frame_bitoffset, &(sym->inf), BitstreamLengthInBytes);

  if (sym->len == -1)
    return -1;

  currStream->frame_bitoffset += sym->len;
  sym->value1                  = sym->len == 1 ? -1 : sym->inf;

#if TRACE
  tracebits2(sym->tracestring, sym->len, sym->value1);
#endif

  return 1;
}

int GetVLCSymbol_IntraMode (byte buffer[],int totbitoffset,int *info, int bytecount)
{

  register int inf;
  long byteoffset;      // byte from start of buffer
  int bitoffset;      // bit from start of byte
  int ctr_bit=0;      // control bit for current bit posision
  int bitcounter=1;
  int len;
  int info_bit;

  byteoffset = totbitoffset/8;
  bitoffset  = 7-(totbitoffset%8);
  ctr_bit    = (buffer[byteoffset] & (0x01<<bitoffset));   // set up control bit
  len        = 1;

  //First bit
  if (ctr_bit)
  {
    *info = 0;
    return bitcounter;
  }
  else
    len=4;

  // make infoword
  inf=0;                          // shortest possible code is 1, then info is always 0
  for(info_bit=0;(info_bit<(len-1)); info_bit++)
  {
    bitcounter++;
    bitoffset-=1;
    if (bitoffset<0)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区在线观看视频| 国产99久久久久| 九九**精品视频免费播放| 国产美女视频91| 99视频有精品| 精品欧美一区二区在线观看 | 国产精华液一区二区三区| 91视频国产资源| 欧美一级日韩免费不卡| 亚洲色图在线播放| 国产精品白丝av| 欧美丰满嫩嫩电影| 亚洲色图在线看| 国产一区二区三区日韩| 欧美日韩专区在线| 国产精品成人在线观看| 精品一区二区av| 56国语精品自产拍在线观看| 亚洲欧美欧美一区二区三区| 白白色亚洲国产精品| 91精品国产色综合久久ai换脸| 亚洲同性同志一二三专区| 国产精品88888| 精品国产一区二区三区久久影院| 一区二区三区国产精华| 成人福利在线看| 国产亚洲自拍一区| 韩国女主播成人在线| 在线不卡欧美精品一区二区三区| 亚洲免费毛片网站| 白白色 亚洲乱淫| 国产精品久久综合| 国产成人av在线影院| 欧美精品一区二区三区四区| 另类专区欧美蜜桃臀第一页| 91精品国产综合久久久久久漫画 | 亚洲最大的成人av| 一本一道波多野结衣一区二区| 国产欧美视频一区二区| 国产精品白丝jk白祙喷水网站| 日韩免费看的电影| 麻豆91精品91久久久的内涵| 欧美一区二区黄色| 久久99精品久久久久| 欧美一级午夜免费电影| 免费日韩伦理电影| 欧美大片一区二区三区| 免费不卡在线视频| 精品电影一区二区| 国产东北露脸精品视频| 国产精品午夜电影| 91免费视频大全| 亚洲国产综合在线| 欧美一级片在线观看| 久久99精品国产麻豆婷婷洗澡| www一区二区| 成人久久久精品乱码一区二区三区| 国产精品日日摸夜夜摸av| 色综合色综合色综合| 亚洲精品一卡二卡| 欧美一区二区三区视频在线观看| 麻豆一区二区在线| 国产亚洲制服色| 在线观看视频一区二区欧美日韩| 亚洲mv大片欧洲mv大片精品| 欧美一二三区在线| 成人午夜伦理影院| 亚洲国产wwwccc36天堂| 精品嫩草影院久久| 99久久婷婷国产综合精品 | 亚洲欧美日韩在线| 69久久夜色精品国产69蝌蚪网| 麻豆视频一区二区| 国产精品福利一区二区| 制服丝袜中文字幕一区| 国产高清在线精品| 亚洲妇熟xx妇色黄| 国产日韩欧美a| 欧美人狂配大交3d怪物一区| 国产自产视频一区二区三区| 亚洲蜜臀av乱码久久精品| 欧美成人bangbros| 色婷婷激情综合| 精品一区二区三区在线播放 | 国产日韩欧美精品一区| 欧美裸体bbwbbwbbw| 国产超碰在线一区| 三级欧美韩日大片在线看| 国产精品蜜臀在线观看| 欧美一级欧美三级| 91黄色在线观看| 成人h动漫精品一区二| 青青青爽久久午夜综合久久午夜| 中文字幕亚洲成人| 久久久久综合网| 日韩欧美在线123| 在线观看视频一区| 成人三级伦理片| 狠狠色狠狠色综合系列| 亚洲午夜激情网站| **性色生活片久久毛片| 久久久久久免费网| 欧美va亚洲va在线观看蝴蝶网| 欧美性大战xxxxx久久久| 成人高清av在线| 在线观看免费亚洲| 成人免费高清在线| 国产成人av网站| 另类小说一区二区三区| 污片在线观看一区二区| 玉米视频成人免费看| 国产精品久久久久影院老司| 国产女人aaa级久久久级 | 色婷婷久久久久swag精品| 丁香婷婷综合色啪| 国产精品夜夜嗨| 国产精品自在在线| 国产麻豆视频一区二区| 九九视频精品免费| 国产一区二区精品久久| 国产在线不卡视频| 国产在线看一区| 国产伦精品一区二区三区在线观看| 日本不卡一区二区三区高清视频| 亚洲亚洲精品在线观看| 亚洲一区在线免费观看| 一区二区不卡在线播放 | 91精品国产综合久久蜜臀| 538prom精品视频线放| 欧美日韩中字一区| 宅男在线国产精品| 精品日产卡一卡二卡麻豆| 精品久久人人做人人爱| 国产午夜精品一区二区三区视频| 久久综合久久久久88| 中文一区二区在线观看| 国产精品久久久久久久久图文区| 国产精品美女久久久久久久网站| 日韩美女啊v在线免费观看| 夜夜操天天操亚洲| 日韩精品乱码av一区二区| 韩国欧美国产1区| 成人开心网精品视频| 91高清在线观看| 日韩一区二区三区av| 久久久噜噜噜久噜久久综合| 亚洲欧美中日韩| 亚洲成av人片在线观看| 久久av资源网| 91在线国产观看| 欧美国产精品专区| 亚洲人成精品久久久久| 日韩影院免费视频| 国产成人亚洲精品狼色在线| 色哟哟国产精品| 日韩一级完整毛片| 亚洲欧洲日韩女同| 丝袜亚洲另类欧美综合| 国产高清久久久久| 欧美日韩在线不卡| 国产午夜一区二区三区| 亚洲1区2区3区视频| 国产在线观看免费一区| 欧美午夜免费电影| 久久综合成人精品亚洲另类欧美 | 欧美电影精品一区二区| 一区免费观看视频| 蜜臀久久99精品久久久画质超高清 | 国内成人自拍视频| 91豆麻精品91久久久久久| 精品国产一区二区三区四区四| 亚洲免费av观看| 国产精品一级在线| 欧美日韩国产高清一区二区| 欧美激情一区三区| 日本系列欧美系列| 91在线观看一区二区| 欧美变态凌虐bdsm| 亚洲国产美国国产综合一区二区| 丁香婷婷综合色啪| 欧美精品一区二区久久久| 亚洲一区二区三区视频在线播放| 国产91精品在线观看| 91精品国产综合久久久久久久| 国产精品久久久一区麻豆最新章节| 麻豆国产欧美一区二区三区| 欧美日韩国产成人在线91| ●精品国产综合乱码久久久久| av成人动漫在线观看| 亚洲精品一区二区三区四区高清| 亚洲成人午夜电影| 在线观看免费亚洲| 中文字幕色av一区二区三区| 国产精品羞羞答答xxdd| 日韩欧美二区三区| 美女任你摸久久| 欧美一卡二卡三卡四卡| 亚洲www啪成人一区二区麻豆| 91老师片黄在线观看| 亚洲欧洲成人自拍|