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

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

?? cabac.c

?? TML的參考源代碼
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
 * \brief
 *    This function is used to arithmetically decode the delta qp
 *     of a given MB.
 ************************************************************************
 */
void readDquantFromBuffer_CABAC(SyntaxElement *se,
                                struct inp_par *inp,
                                struct img_par *img,
                                DecodingEnvironmentPtr dep_dp)
{
  MotionInfoContexts *ctx = img->currentSlice->mot_ctx;
  Macroblock *currMB = &img->mb_data[img->current_mb_nr];

  int act_ctx;
  int act_sym;
  int dquant;

  if (currMB->mb_available[1][0] == NULL)
    act_ctx = 0;
  else
    act_ctx = ( ((currMB->mb_available[1][0])->delta_quant != 0) ? 1 : 0);

  act_sym = biari_decode_symbol(dep_dp,ctx->delta_qp_contexts + act_ctx );
  if (act_sym != 0)
  {
    act_ctx = 2;
    act_sym = unary_bin_decode(dep_dp,ctx->delta_qp_contexts+act_ctx,1);
    act_sym++;
  }

  dquant = (act_sym+1)/2;
  if((act_sym & 0x01)==0)                           // lsb is signed bit
    dquant = -dquant;
  se->value1 = dquant;

#if TRACE
  fprintf(p_trace, "@%d%s\t\t\t%d\n",symbolCount++, se->tracestring, se->value1);
  fflush(p_trace);
#endif
}

/*!
 ************************************************************************
 * \brief
 *    This function is used to arithmetically decode the coded
 *    block pattern of a given MB.
 ************************************************************************
 */
void readCBPFromBuffer_CABAC(SyntaxElement *se,
                             struct inp_par *inp,
                             struct img_par *img,
                             DecodingEnvironmentPtr dep_dp)
{
  TextureInfoContexts *ctx = img->currentSlice->tex_ctx;
  Macroblock *currMB = &img->mb_data[img->current_mb_nr];

  int mb_x, mb_y;
  int a, b;
  int curr_cbp_ctx, curr_cbp_idx;
  int cbp = 0;
  int cbp_bit;
    int mask;

  if ( se->type == SE_CBP_INTRA )
    curr_cbp_idx = 0;
  else
    curr_cbp_idx = 1;

  //  coding of luma part (bit by bit)
  for (mb_y=0; mb_y < 4; mb_y += 2)
  {
    for (mb_x=0; mb_x < 4; mb_x += 2)
    {

      if (mb_y == 0)
      {
        if (currMB->mb_available[0][1] == NULL)
          b = 0;
        else
          b = (( ((currMB->mb_available[0][1])->cbp & (1<<(2+mb_x/2))) == 0) ? 1 : 0);
      }
      else
        b = ( ((cbp & (1<<(mb_x/2))) == 0) ? 1: 0);

      if (mb_x == 0)
      {
        if (currMB->mb_available[1][0] == NULL)
          a = 0;
        else
          a = (( ((currMB->mb_available[1][0])->cbp & (1<<(mb_y+1))) == 0) ? 1 : 0);
      }
      else
        a = ( ((cbp & (1<<mb_y)) == 0) ? 1: 0);

      curr_cbp_ctx = a+2*b;
      mask = (1<<(mb_y+mb_x/2));
            cbp_bit = biari_decode_symbol(dep_dp, ctx->cbp_contexts[curr_cbp_idx][0] + curr_cbp_ctx );
            if (cbp_bit) cbp += mask;
    }
  }

  // coding of chroma part
  b = 0;
  if (currMB->mb_available[0][1] != NULL)
    b = ((currMB->mb_available[0][1])->cbp > 15) ? 1 : 0;

  a = 0;
  if (currMB->mb_available[1][0] != NULL)
    a = ((currMB->mb_available[1][0])->cbp > 15) ? 1 : 0;

  curr_cbp_ctx = a+2*b;
  cbp_bit = biari_decode_symbol(dep_dp, ctx->cbp_contexts[curr_cbp_idx][1] + curr_cbp_ctx );

  if (cbp_bit) // set the chroma bits
  {
    b = 0;
    if (currMB->mb_available[0][1] != NULL)
      if ((currMB->mb_available[0][1])->cbp > 15)
        b = (( ((currMB->mb_available[0][1])->cbp >> 4) == 2) ? 1 : 0);

    a = 0;
    if (currMB->mb_available[1][0] != NULL)
      if ((currMB->mb_available[1][0])->cbp > 15)
        a = (( ((currMB->mb_available[1][0])->cbp >> 4) == 2) ? 1 : 0);

    curr_cbp_ctx = a+2*b;
    cbp_bit = biari_decode_symbol(dep_dp, ctx->cbp_contexts[curr_cbp_idx][2] + curr_cbp_ctx );
    cbp += (cbp_bit == 1) ? 32 : 16;
  }

  se->value1 = cbp;

#if TRACE
  fprintf(p_trace, "@%d      %s\t\t\t%3d\n",symbolCount++, se->tracestring, se->value1);
  fflush(p_trace);
#endif
}

/*!
 ************************************************************************
 * \brief
 *    This function is used to arithmetically decode level and
 *    run of a given MB.
 ************************************************************************
 */
void readRunLevelFromBuffer_CABAC(SyntaxElement *se,
                                  struct inp_par *inp,
                                  struct img_par *img,
                                  DecodingEnvironmentPtr dep_dp)
{
  int level;
  int run=0;
  const int curr_ctx_idx = se->context;
  int curr_level_ctx;
  int sign_of_level;
  int max_run;

  TextureInfoContexts *ctx = img->currentSlice->tex_ctx;
  // Macroblock *currMB = &img->mb_data[img->current_mb_nr];

  level = unary_level_decode(dep_dp,ctx->level_context[curr_ctx_idx]);

  if (level!=0)
  {
    curr_level_ctx = 3;
    sign_of_level = biari_decode_symbol(dep_dp, ctx->level_context[curr_ctx_idx] + curr_level_ctx );
    if (sign_of_level) level = (-1)*level;
      if (curr_ctx_idx != 0 && curr_ctx_idx != 6 && curr_ctx_idx != 5) // not double scan and not DC-chroma
        run = unary_bin_decode(dep_dp,ctx->run_context[curr_ctx_idx],1);
      else
      {
        max_run =  (curr_ctx_idx == 0) ? 7 : 3;  // if double scan max_run = 7; if DC-chroma max_run = 3;
        run = unary_bin_max_decode(dep_dp,ctx->run_context[curr_ctx_idx],1,max_run);
      }
  }
  se->value1 = level;
  se->value2 = run;


#if TRACE
  fprintf(p_trace, "@%d%s\t\t\t%3d \n",symbolCount++, se->tracestring, se->value1);
  fflush(p_trace);
#endif

}

/*!
 ************************************************************************
 * \brief
 *    arithmetic decoding
 ************************************************************************
 */
int readSyntaxElement_CABAC(SyntaxElement *se, struct img_par *img, struct inp_par *inp, DataPartition *this_dataPart)
{
  int curr_len;
  DecodingEnvironmentPtr dep_dp = &(this_dataPart->de_cabac);

  curr_len = arideco_bits_read(dep_dp);

  // perform the actual decoding by calling the appropriate method
  se->reading(se, inp, img, dep_dp);

  return (se->len = (arideco_bits_read(dep_dp) - curr_len));
}

/*!
 ************************************************************************
 * \brief
 *    get slice and header
 ************************************************************************
 */
int readSliceCABAC(struct img_par *img, struct inp_par *inp)
{
  Slice *currSlice = img->currentSlice;
  Bitstream *currStream = currSlice->partArr[0].bitstream;
  unsigned char *code_buffer = currStream->streamBuffer;
  int *read_len = &(currStream->read_len);
  DecodingEnvironmentPtr dep = &((currSlice->partArr[0]).de_cabac);
  int current_header;
  int BitstreamLengthInBytes;
  int info;
  int BitsUsedByHeader = 0, ByteStartPosition;
  int newframe = 0;   //WYK: Oct. 8, 2001, change the method to find a new frame

  currStream->frame_bitoffset =0;

  memset (code_buffer, 0xff, MAX_CODED_FRAME_SIZE);   // this prevents a buffer full with zeros
  BitstreamLengthInBytes = currStream->bitstream_length = GetOneSliceIntoSourceBitBuffer(img, inp, code_buffer);

  // Here we are ready to interpret the picture and slice headers.  Since
  // SliceHeader() gets the data out of the UVLC's len/info
  // array, we need to convert the start of our slice to such a format.


  if (BitstreamLengthInBytes < 4)
    return EOS;

  // Now we have the bits between the current startcode (inclusive) and the
  // next start code in code_buffer.  Now decode the start codes and the headers
  if (31 != GetVLCSymbol (code_buffer, 0, &info, BitstreamLengthInBytes))
  {
    snprintf (errortext, ET_SIZE, "readSliceCABAC: Panic, expected start code symbol, found wrong len");
    error(errortext, 600);
  }
  currStream->frame_bitoffset +=31;
  BitsUsedByHeader+=SliceHeader(img, inp);

  //WYK: Oct. 8, 2001, change the method to find a new frame
  if(img->tr != img->tr_old)
    newframe = 1;
  else 
    newframe = 0;
  img->tr_old = img->tr;
    
  // if the TR of current slice is not identical to the TR of previous received slice, we have a new frame
  if(newframe)
    current_header = SOP;
  else
    current_header = SOS;

  ByteStartPosition = currStream->frame_bitoffset/8;
  if ((currStream->frame_bitoffset)%8 != 0)
    ByteStartPosition++;
  arideco_start_decoding(dep, code_buffer, ByteStartPosition, read_len);


  currSlice->picture_id = img->tr;
  return current_header;

}

/*!
 ************************************************************************
 * \brief
 *    decoding of unary binarization using one or 2 distinct
 *    models for the first and all remaining bins; no terminating
 *    "0" for max_symbol
 ***********************************************************************
 */
unsigned int unary_bin_max_decode(DecodingEnvironmentPtr dep_dp,
                                  BiContextTypePtr ctx,
                                  int ctx_offset,
                                  unsigned int max_symbol)
{
  unsigned int l;
  unsigned int symbol;
  BiContextTypePtr ictx;

  symbol =  biari_decode_symbol(dep_dp, ctx );

  if (symbol==0)
    return 0;
  else
  {
    symbol=0;
    ictx=ctx+ctx_offset;
    do
    {
      l=biari_decode_symbol(dep_dp, ictx);
      symbol++;
    }
    while( (l!=0) && (symbol<max_symbol-1) );
    if ((l!=0) && (symbol==max_symbol-1))
      symbol++;
    return symbol;
  }

}

/*!
 ************************************************************************
 * \brief
 *    decoding of unary binarization of the absolute value
 *    of a level using 3 distinct models by separating the first,
 *    the second and all remaining bins
 ***********************************************************************
 */
unsigned int unary_level_decode(DecodingEnvironmentPtr dep_dp,
                                BiContextTypePtr ctx)
{
  unsigned int l;
  unsigned int symbol;
  int bin=1;
  BiContextTypePtr ictx=ctx;

  symbol = biari_decode_symbol(dep_dp, ictx );

  if (symbol==0)
    return 0;
  else
  {
    symbol=0;
    ictx++;
    do
    {
      l=biari_decode_symbol(dep_dp, ictx  );
      if ((++bin)==2) ictx++;
      symbol++;
    }
    while (l!=0);
    return symbol;
  }
}

/*!
 ************************************************************************
 * \brief
 *    decoding of unary binarization using one or 2 distinct
 *    models for the first and all remaining bins
 ***********************************************************************
 */
unsigned int unary_bin_decode(DecodingEnvironmentPtr dep_dp,
                              BiContextTypePtr ctx,
                              int ctx_offset)
{
  unsigned int l;
  unsigned int symbol;
  BiContextTypePtr ictx;

  symbol = biari_decode_symbol(dep_dp, ctx );

  if (symbol==0)
    return 0;
  else
  {
    symbol=0;
    ictx=ctx+ctx_offset;
    do
    {
      l=biari_decode_symbol(dep_dp, ictx);
      symbol++;
    }
    while( l!=0 );
    return symbol;
  }
}

/*!
 ************************************************************************
 * \brief
 *    decoding of unary binarization of the absolute value of a
 *    mv component using 4 distinct models by separating the first,
 *    the second, intermediate and all remaining bins
 ***********************************************************************
 */
unsigned int unary_mv_decode(DecodingEnvironmentPtr dep_dp,
                             BiContextTypePtr ctx,
                             unsigned int max_bin)
{
  unsigned int l;
  unsigned int bin=1;
  unsigned int symbol;

  BiContextTypePtr ictx=ctx;

  symbol = biari_decode_symbol(dep_dp, ictx );

  if (symbol==0)
    return 0;
  else
  {
    symbol=0;
    ictx++;
    do
    {
      l=biari_decode_symbol(dep_dp, ictx  );
      if ((++bin)==2) ictx++;
      if (bin==max_bin) ictx++;
      symbol++;
    }
    while (l!=0);
    return symbol;
  }
}

/*!
 ************************************************************************
 * \brief
 *    finding end of a slice in case this is not the end of a frame
 ************************************************************************
 */
int cabac_startcode_follows(struct img_par *img, struct inp_par *inp)
{
  Slice *currSlice = img->currentSlice;
  if (img->current_mb_nr == currSlice->last_mb_nr)
    return TRUE;
  return FALSE;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色伊人亚洲综合成人| 亚洲综合久久久久| 日韩精品一二三| 国产91精品一区二区麻豆亚洲| 欧美色图激情小说| 国产精品视频九色porn| 美女视频黄频大全不卡视频在线播放| 99久久久国产精品| 国产亚洲欧美色| 麻豆成人久久精品二区三区红 | 亚洲风情在线资源站| 粉嫩av一区二区三区粉嫩| 欧美成人一区二区三区在线观看| 亚洲国产一区视频| 99视频超级精品| 久久久久久久综合色一本| 日本不卡在线视频| 在线精品视频小说1| 国产人成亚洲第一网站在线播放 | 亚洲欧美电影院| 国产传媒久久文化传媒| 久久综合成人精品亚洲另类欧美| 欧美aa在线视频| 欧美老肥妇做.爰bbww| 亚洲国产欧美在线| 色视频一区二区| 亚洲欧美电影院| 色天天综合色天天久久| 亚洲欧美日韩在线播放| av综合在线播放| 国产精品无圣光一区二区| 国产成人亚洲综合色影视| 亚洲精品一区二区三区影院| 日韩精品免费视频人成| 在线电影欧美成精品| 亚洲成人av一区二区三区| 欧美日韩一级片在线观看| 亚洲福利视频导航| 欧美日韩国产三级| 日韩国产一二三区| 日韩欧美国产综合| 久久精品久久精品| 亚洲你懂的在线视频| 成人午夜av电影| 国产精品久久久爽爽爽麻豆色哟哟| 成人爱爱电影网址| 一区免费观看视频| 色菇凉天天综合网| 午夜精品成人在线视频| 欧美高清精品3d| 美女视频网站黄色亚洲| 久久久久免费观看| 高清成人免费视频| 最新国产成人在线观看| 色激情天天射综合网| 亚洲成人自拍一区| 日韩一区二区三区电影在线观看 | 亚洲国产综合视频在线观看| 在线观看av不卡| 视频一区视频二区中文字幕| 欧美一级久久久久久久大片| 国内精品免费在线观看| 国产精品网站在线| 色呦呦日韩精品| 日韩国产精品久久久| 精品粉嫩aⅴ一区二区三区四区| 国产不卡在线视频| 一区二区三区不卡在线观看| 555夜色666亚洲国产免| 国产一区二区在线影院| 成人欧美一区二区三区黑人麻豆| 在线视频亚洲一区| 日韩av网站在线观看| 久久这里只有精品6| 99视频精品在线| 丝瓜av网站精品一区二区| 久久欧美一区二区| 91在线观看免费视频| 天堂av在线一区| 国产日韩精品一区| 欧美偷拍一区二区| 另类成人小视频在线| 中文字幕成人av| 欧美剧情片在线观看| 国产精品一二三在| 一区二区三区中文字幕| 精品国产乱码久久久久久图片 | 成人毛片老司机大片| 亚洲蜜桃精久久久久久久| 日韩欧美一级二级三级久久久| 成人免费毛片片v| 亚洲网友自拍偷拍| 国产亚洲综合av| 欧美日韩aaaaa| 粉嫩av亚洲一区二区图片| 国产成人精品午夜视频免费| 亚洲大型综合色站| 国产无人区一区二区三区| 欧美女孩性生活视频| 成人av一区二区三区| 日韩主播视频在线| 中文字幕中文乱码欧美一区二区| 91精品国产乱| 色综合久久久久综合99| 精久久久久久久久久久| 亚洲国产va精品久久久不卡综合| 中文字幕欧美三区| 日韩精品中文字幕一区二区三区 | 粉嫩嫩av羞羞动漫久久久| 午夜精品成人在线视频| 国产精品国产三级国产aⅴ入口 | eeuss鲁片一区二区三区在线看| 日韩电影一区二区三区| 亚洲私人影院在线观看| 久久午夜免费电影| 欧美精选在线播放| 91一区二区三区在线播放| 国产在线看一区| 视频一区视频二区在线观看| 亚洲色图19p| 日本一区二区动态图| 日韩精品在线看片z| 欧美色网站导航| 成人动漫在线一区| 国产一区二区电影| 蜜桃久久久久久久| 亚洲一级二级三级在线免费观看| 综合久久久久综合| 亚洲国产高清不卡| 国产性天天综合网| 精品日韩一区二区| 在线电影国产精品| 欧美日韩一区小说| 日本道精品一区二区三区| 不卡一区二区中文字幕| 国产91在线观看| 国产精品中文字幕欧美| 韩国中文字幕2020精品| 捆绑调教美女网站视频一区| 日韩电影免费一区| 日韩在线播放一区二区| 午夜av电影一区| 亚洲电影一级黄| 亚洲国产一区视频| 亚洲一二三区不卡| 亚洲午夜av在线| 亚洲大尺度视频在线观看| 亚洲高清免费观看高清完整版在线观看| 亚洲精品伦理在线| 亚洲视频在线观看三级| 1区2区3区精品视频| 国产精品萝li| 亚洲少妇屁股交4| 中文字幕一区二区三区av | 中文字幕精品—区二区四季| 2020国产精品| 欧美激情资源网| 中文一区一区三区高中清不卡| 国产精品丝袜一区| 国产精品网站在线播放| 专区另类欧美日韩| 亚洲精品成人精品456| 一区二区三区色| 亚洲福利视频三区| 日韩综合一区二区| 久久国产精品区| 国产麻豆9l精品三级站| 国产成人精品免费网站| av动漫一区二区| 欧美自拍丝袜亚洲| 69堂国产成人免费视频| 欧美va亚洲va| 国产婷婷色一区二区三区在线| 中文一区二区在线观看| 亚洲精品中文在线观看| 亚洲一区二区视频在线观看| 婷婷六月综合亚洲| 精品一区二区三区视频| 高清不卡一二三区| 91蜜桃在线免费视频| 欧美午夜片在线看| 欧美一卡二卡三卡四卡| 国产亚洲美州欧州综合国| 国产精品国产三级国产aⅴ无密码| 一区二区三区四区视频精品免费| 亚洲1区2区3区视频| 另类欧美日韩国产在线| 国产成人av一区二区三区在线观看| 91在线观看污| 欧美区视频在线观看| 久久综合久久99| 亚洲蜜臀av乱码久久精品蜜桃| 日本在线不卡视频| 成人一级片网址| 欧美三级日本三级少妇99| 日韩精品中文字幕在线一区| 中文字幕色av一区二区三区| 亚洲电影你懂得| 国产精品66部| 欧美日韩日日夜夜|