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

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

?? cabac.c

?? 一個簡單的視頻會議VC++MFC工程文件
?? C
?? 第 1 頁 / 共 4 頁
字號:
  act_sym = biari_decode_symbol(dep_dp,ctx->ref_no_contexts[addctx] + act_ctx );

  if (act_sym != 0)
  {
    act_ctx = 4;
    act_sym = unary_bin_decode(dep_dp,ctx->ref_no_contexts[addctx]+act_ctx,1);
    act_sym++;
  }
  se->value1 = act_sym;

#if TRACE
  fprintf(p_trace, "@%d %s\t\t\t%d \n",symbolCount++, se->tracestring, se->value1);
//  fprintf(p_trace," c: %d :%d \n",ctx->ref_no_contexts[addctx][act_ctx].cum_freq[0],ctx->ref_no_contexts[addctx][act_ctx].cum_freq[1]);
  fflush(p_trace);
#endif
}


/*!
 ************************************************************************
 * \brief
 *    This function is used to arithmetically decode the delta qp
 *     of a given MB.
 ************************************************************************
 */
void readDquant_CABAC( SyntaxElement *se,
                       struct inp_par *inp,
                       struct img_par *img,
                       DecodingEnvironmentPtr dep_dp)
{
  MotionInfoContexts *ctx = img->currentSlice->mot_ctx;

  int act_ctx;
  int act_sym;
  int dquant;

  act_ctx = ( (last_dquant != 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;

  last_dquant = 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 readCBP_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;
  PixelPos block_a;

  //  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 (currMB->b8mode[mb_y+(mb_x/2)]==IBLOCK)
        curr_cbp_idx = 0;
      else
        curr_cbp_idx = 1;

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

      }
      else
        b = ( ((cbp & (1<<(mb_x/2))) == 0) ? 1: 0);

      if (mb_x == 0)
      {
        getLuma4x4Neighbour(img->current_mb_nr, mb_x, mb_y, -1, 0, &block_a);
        if (block_a.available)
        {
          {
            if(img->mb_data[block_a.mb_addr].mb_type==IPCM)
              a=0;
            else
              a = (( (img->mb_data[block_a.mb_addr].cbp & (1<<(2*(block_a.y/2)+1))) == 0) ? 1 : 0);
          }
          
        }
        else
          a=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[0] + curr_cbp_ctx );
      if (cbp_bit) cbp += mask;
    }
  }


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

  // coding of chroma part
  // CABAC decoding for BinIdx 0
  b = 0;
  if (currMB->mb_available_up != NULL)
  {
    if((currMB->mb_available_up)->mb_type==IPCM)
      b=1;
    else
      b = ((currMB->mb_available_up)->cbp > 15) ? 1 : 0;
  }


  a = 0;
  if (currMB->mb_available_left != NULL)
  {
    if((currMB->mb_available_left)->mb_type==IPCM)
      a=1;
    else
      a = ((currMB->mb_available_left)->cbp > 15) ? 1 : 0;
  }


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

  // CABAC decoding for BinIdx 1 
  if (cbp_bit) // set the chroma bits
  {
    b = 0;
    if (currMB->mb_available_up != NULL)
    {
      if((currMB->mb_available_up)->mb_type==IPCM)
        b=1;
      else
        if ((currMB->mb_available_up)->cbp > 15)
          b = (( ((currMB->mb_available_up)->cbp >> 4) == 2) ? 1 : 0);
    }


    a = 0;
    if (currMB->mb_available_left != NULL)
    {
      if((currMB->mb_available_left)->mb_type==IPCM)
        a=1;
      else
        if ((currMB->mb_available_left)->cbp > 15)
          a = (( ((currMB->mb_available_left)->cbp >> 4) == 2) ? 1 : 0);
    }
    

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

  se->value1 = cbp;

  if (!cbp)
  {
    last_dquant=0;
  }

#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 chroma
 *    intra prediction mode of a given MB.
 ************************************************************************
 */  //GB
void readCIPredMode_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                 act_ctx,a,b;
  int                 act_sym  = se->value1;

  if (currMB->mb_available_up == NULL) b = 0;
  else
  {
    if( (currMB->mb_available_up)->mb_type==IPCM)
      b=0;
    else
      b = ( ((currMB->mb_available_up)->c_ipred_mode != 0) ? 1 : 0);
  }


  if (currMB->mb_available_left == NULL) a = 0;
  else
  {
    if( (currMB->mb_available_left)->mb_type==IPCM)
      a=0;
    else
      a = ( ((currMB->mb_available_left)->c_ipred_mode != 0) ? 1 : 0);
  }


  act_ctx = a+b;

  act_sym = biari_decode_symbol(dep_dp, ctx->cipr_contexts + act_ctx );

  if (act_sym!=0) 
    act_sym = unary_bin_max_decode(dep_dp,ctx->cipr_contexts+3,0,2)+1;


  se->value1 = act_sym;


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

}


static const int maxpos       [] = {16, 15, 64, 32, 32, 16,  4, 15};
static const int c1isdc       [] = { 1,  0,  1,  1,  1,  1,  1,  0};

static const int type2ctx_bcbp[] = { 0,  1,  2,  2,  3,  4,  5,  6}; // 7
static const int type2ctx_map [] = { 0,  1,  2,  3,  4,  5,  6,  7}; // 8
static const int type2ctx_last[] = { 0,  1,  2,  3,  4,  5,  6,  7}; // 8
static const int type2ctx_one [] = { 0,  1,  2,  3,  3,  4,  5,  6}; // 7
static const int type2ctx_abs [] = { 0,  1,  2,  3,  3,  4,  5,  6}; // 7




/*!
 ************************************************************************
 * \brief
 *    Read CBP4-BIT
 ************************************************************************
 */
int read_and_store_CBP_block_bit (Macroblock              *currMB,
                                  DecodingEnvironmentPtr  dep_dp,
                                  struct img_par          *img,
                                  int                     type)
{
#define BIT_SET(x,n)  ((int)(((x)&(1<<(n)))>>(n)))

  int y_ac        = (type==LUMA_16AC || type==LUMA_8x8 || type==LUMA_8x4 || type==LUMA_4x8 || type==LUMA_4x4);
  int y_dc        = (type==LUMA_16DC);
  int u_ac        = (type==CHROMA_AC && !img->is_v_block);
  int v_ac        = (type==CHROMA_AC &&  img->is_v_block);
  int u_dc        = (type==CHROMA_DC && !img->is_v_block);
  int v_dc        = (type==CHROMA_DC &&  img->is_v_block);
  int j           = (y_ac || u_ac || v_ac ? img->subblock_y : 0);
  int i           = (y_ac || u_ac || v_ac ? img->subblock_x : 0);
  int bit         = (y_dc ? 0 : y_ac ? 1 : u_dc ? 17 : v_dc ? 18 : u_ac ? 19 : 23);
  int default_bit = (img->is_intra_block ? 1 : 0);
  int upper_bit   = default_bit;
  int left_bit    = default_bit;
  int cbp_bit     = 1;  // always one for 8x8 mode
  int ctx;
  int bit_pos_a   = 0;
  int bit_pos_b   = 0;

  PixelPos block_a, block_b;
  if (y_ac || y_dc)
  {
    getLuma4x4Neighbour(img->current_mb_nr, i, j, -1,  0, &block_a);
    getLuma4x4Neighbour(img->current_mb_nr, i, j,  0, -1, &block_b);
    if (y_ac)
    {
      if (block_a.available)
        bit_pos_a = 4*block_a.y + block_a.x;
      if (block_b.available)
        bit_pos_b = 4*block_b.y + block_b.x;
    }
  }
  else
  {
    getChroma4x4Neighbour(img->current_mb_nr, i, j, -1,  0, &block_a);
    getChroma4x4Neighbour(img->current_mb_nr, i, j,  0, -1, &block_b);
    if (u_ac||v_ac)
    {
      if (block_a.available)
        bit_pos_a = 2*block_a.y + block_a.x;
      if (block_b.available)
        bit_pos_b = 2*block_b.y + block_b.x;
    }
  }

  if (type!=LUMA_8x8)
  {
    //--- get bits from neighbouring blocks ---
    if (block_b.available)
    {
      if(img->mb_data[block_b.mb_addr].mb_type==IPCM)
        upper_bit=1;
      else
        upper_bit = BIT_SET(img->mb_data[block_b.mb_addr].cbp_bits,bit+bit_pos_b);
    }

    
    if (block_a.available)
    {
      if(img->mb_data[block_a.mb_addr].mb_type==IPCM)
        left_bit=1;
      else
        left_bit = BIT_SET(img->mb_data[block_a.mb_addr].cbp_bits,bit+bit_pos_a);
    }

    
    ctx = 2*upper_bit+left_bit;


    //===== encode symbol =====
    cbp_bit = biari_decode_symbol (dep_dp, img->currentSlice->tex_ctx->bcbp_contexts[type2ctx_bcbp[type]] + ctx);
  }
  
  //--- set bits for current block ---
  bit         = (y_dc ? 0 : y_ac ? 1+4*j+i : u_dc ? 17 : v_dc ? 18 : u_ac ? 19+2*j+i : 23+2*j+i);
  
  if (cbp_bit)
  {
    if (type==LUMA_8x8)
    {
      currMB->cbp_bits   |= (1<< bit   );
      currMB->cbp_bits   |= (1<<(bit+1));
      currMB->cbp_bits   |= (1<<(bit+4));
      currMB->cbp_bits   |= (1<<(bit+5));
    }
    else if (type==LUMA_8x4)
    {
      currMB->cbp_bits   |= (1<< bit   );
      currMB->cbp_bits   |= (1<<(bit+1));
    }
    else if (type==LUMA_4x8)
    {
      currMB->cbp_bits   |= (1<< bit   );
      currMB->cbp_bits   |= (1<<(bit+4));
    }
    else
    {
      currMB->cbp_bits   |= (1<<bit);
    }
  }

  return cbp_bit;
}





//===== position -> ctx for MAP =====
//--- zig-zag scan ----
static const int  pos2ctx_map8x8 [] = { 0,  1,  2,  3,  4,  5,  5,  4,  4,  3,  3,  4,  4,  4,  5,  5,
                                        4,  4,  4,  4,  3,  3,  6,  7,  7,  7,  8,  9, 10,  9,  8,  7,
                                        7,  6, 11, 12, 13, 11,  6,  7,  8,  9, 14, 10,  9,  8,  6, 11,
                                       12, 13, 11,  6,  9, 14, 10,  9, 11, 12, 13, 11 ,14, 10, 12, 14}; // 15 CTX
static const int  pos2ctx_map8x4 [] = { 0,  1,  2,  3,  4,  5,  7,  8,  9, 10, 11,  9,  8,  6,  7,  8,
                                        9, 10, 11,  9,  8,  6, 12,  8,  9, 10, 11,  9, 13, 13, 14, 14}; // 15 CTX
static const int  pos2ctx_map4x4 [] = { 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 14}; // 15 CTX
static const int* pos2ctx_map    [] = {pos2ctx_map4x4, pos2ctx_map4x4, pos2ctx_map8x8, pos2ctx_map8x4,
                                       pos2ctx_map8x4, pos2ctx_map4x4, pos2ctx_map4x4, pos2ctx_map4x4};
//--- interlace scan ----
static const int  pos2ctx_map8x8i[] = { 0,  1,  1,  2,  2,  3,  3,  4,  5,  6,  7,  7,  7,  8,  4,  5,
                                        6,  9, 10, 10,  8, 11, 12, 11,  9,  9, 10, 10,  8, 11, 12, 11,
                                        9,  9, 10, 10,  8, 11, 12, 11,  9,  9, 10, 10,  8, 13, 13,  9,
                                        9, 10, 10,  8, 13, 13,  9,  9, 10, 10, 14, 14, 14, 14, 14, 14}; // 15 CTX
static const int  pos2ctx_map8x4i[] = { 0,  1,  2,  3,  4,  5,  6,  3,  4,  5,  6,  3,  4,  7,  6,  8,
                                        9,  7,  6,  8,  9, 10, 11, 12, 12, 10, 11, 13, 13, 14, 14, 14}; // 15 CTX
static const int  pos2ctx_map4x8i[] = { 0,  1,  1,  1,  2,  3,  3,  4,  4,  4,  5,  6,  2,  7,  7,  8,
                                        8,  8,  5,  6,  9, 10, 10, 11, 11, 11, 12, 13, 13, 14, 14, 14}; // 15 CTX
static const int* pos2ctx_map_int[] = {pos2ctx_map4x4, pos2ctx_map4x4, pos2ctx_map8x8i,pos2ctx_map8x4i,
                                       pos2ctx_map4x8i,pos2ctx_map4x4, pos2ctx_map4x4, pos2ctx_map4x4};


//===== position -> ctx for LAST =====
static const int  pos2ctx_last8x8 [] = { 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
                                         2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
                                         3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,  4,  4,  4,  4,  4,
                                         5,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8}; //  9 CTX
static const int  pos2ctx_last8x4 [] = { 0,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,  2,  2,
                                         3,  3,  3,  3,  4,  4,  4,  4,  5,  5,  6,  6,  7,  7,  8,  8}; //  9 CTX

static const int  pos2ctx_last4x4 [] = { 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15}; // 15 CTX
static const int* pos2ctx_last    [] = {pos2ctx_last4x4, pos2ctx_last4x4, pos2ctx_last8x8, pos2ctx_last8x4,
                                        pos2ctx_last8x4, pos2ctx_last4x4, pos2ctx_last4x4, pos2ctx_last4x4};





/*!
 ************************************************************************
 * \brief
 *    Read Significance MAP

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品香蕉一区二区三区| 日韩写真欧美这视频| 国产日韩精品一区二区三区| 日本一不卡视频| 成人免费视频一区二区| 精品盗摄一区二区三区| 美女视频黄频大全不卡视频在线播放| 一本一本大道香蕉久在线精品 | youjizz久久| 国产精品国产三级国产有无不卡 | 久久国产精品72免费观看| 欧美日本一道本在线视频| 午夜视频在线观看一区| 欧美精品123区| 国产乱码精品一区二区三| 国产精品剧情在线亚洲| 欧美三级在线看| 国内不卡的二区三区中文字幕 | a在线欧美一区| 亚洲亚洲精品在线观看| 91精品国产入口| 风流少妇一区二区| 亚洲日本免费电影| 7777精品伊人久久久大香线蕉的| 蜜臀av国产精品久久久久| 国产亚洲精久久久久久| 在线免费观看成人短视频| 久久精品国产免费| 亚洲欧美色综合| 精品久久久久久久久久久久久久久 | 欧美精品一二三| 成人av在线播放网站| 蜜臀av一区二区在线观看| 亚洲精品亚洲人成人网| 精品国精品国产| 欧洲一区在线电影| 91免费视频网址| 国产一区二区看久久| 蜜臀av国产精品久久久久| 一区二区在线看| 亚洲欧美综合在线精品| 久久亚洲私人国产精品va媚药| 欧美性受xxxx| 91福利国产精品| 在线观看视频一区| 欧美性猛片aaaaaaa做受| 粉嫩一区二区三区性色av| 国产一区二区三区四 | 久久久影视传媒| 精品国产乱码91久久久久久网站| 在线电影一区二区三区| 欧美疯狂性受xxxxx喷水图片| 在线观看免费成人| 91久久精品日日躁夜夜躁欧美| 不卡免费追剧大全电视剧网站| 国产精品自产自拍| av资源网一区| 欧美午夜在线一二页| 欧美日韩国产综合一区二区| 欧美一区二区三区四区高清| 日韩精品中午字幕| 久久精品一区四区| 中文字幕在线播放不卡一区| 亚洲欧美日本韩国| 亚洲成人精品影院| 久久精品国产精品青草| 成人精品小蝌蚪| 欧洲精品一区二区| 精品动漫一区二区三区在线观看| 亚洲国产成人午夜在线一区| 日韩美女视频一区二区 | www.亚洲国产| 91精品国产91久久久久久一区二区 | 久久亚洲一级片| 一区二区三区在线观看视频| 免费观看成人鲁鲁鲁鲁鲁视频| 国产精品一区二区在线观看网站| bt欧美亚洲午夜电影天堂| 欧美一二三四在线| 国产欧美精品一区| 免费观看一级特黄欧美大片| 99麻豆久久久国产精品免费优播| 欧美一级日韩免费不卡| 欧美国产综合色视频| 久久不见久久见中文字幕免费| 99久久精品国产观看| 精品国产一区二区精华| 亚洲va在线va天堂| 欧美在线视频你懂得| 最好看的中文字幕久久| 国产激情精品久久久第一区二区| 欧美日韩成人高清| 亚洲第一激情av| 色综合天天综合狠狠| 亚洲欧美中日韩| 成人免费高清在线| 国产精品女主播在线观看| 国产一区福利在线| 国产网站一区二区| 韩国女主播一区二区三区| 欧美成人精精品一区二区频| 蜜桃精品在线观看| 日韩欧美在线影院| 国产麻豆午夜三级精品| 久久精品视频免费观看| 国产成人亚洲综合a∨婷婷 | 日韩一区二区三区av| 日本成人中文字幕| 欧美成人vr18sexvr| 国产美女视频91| 亚洲毛片av在线| 欧美二区乱c少妇| 国产在线播放一区三区四| 欧美美女bb生活片| 日本不卡视频在线| 中文字幕日韩一区| 欧美日韩一卡二卡三卡 | 欧美日韩和欧美的一区二区| 久久精品av麻豆的观看方式| 久久精品男人天堂av| 91国产丝袜在线播放| 韩国精品免费视频| 亚洲一区二区三区四区的| 久久人人超碰精品| 日本二三区不卡| 国产精品综合av一区二区国产馆| 一区二区三区在线不卡| 精品国产凹凸成av人网站| 91色乱码一区二区三区| 国产麻豆精品在线| 亚洲成av人片在线观看无码| 久久精品亚洲国产奇米99| 欧美亚洲综合在线| 99久久777色| 国产激情91久久精品导航| 日韩av中文字幕一区二区三区| 国产精品成人午夜| 久久久久久久久97黄色工厂| 欧美男人的天堂一二区| 色综合网站在线| 高清beeg欧美| 国产麻豆一精品一av一免费| 天堂va蜜桃一区二区三区漫画版| 最好看的中文字幕久久| 欧美激情在线观看视频免费| 欧美成人精品福利| 日韩免费高清av| 久久亚洲捆绑美女| 26uuu精品一区二区在线观看| 日韩一级完整毛片| 6080yy午夜一二三区久久| 欧美无乱码久久久免费午夜一区 | 一级中文字幕一区二区| 亚洲色图视频网| 亚洲图片激情小说| 亚洲线精品一区二区三区八戒| 一区二区三区中文字幕| 亚洲风情在线资源站| 五月婷婷久久丁香| 国内精品国产成人国产三级粉色| 麻豆91在线看| av在线播放成人| 欧美日韩亚洲综合一区| 欧美精品一区二区三区蜜臀| 国产欧美日韩视频一区二区| 国产精品国产三级国产普通话蜜臀| 中文字幕第一区| 婷婷中文字幕综合| 久久国产人妖系列| 97se亚洲国产综合自在线| 日韩一二三区视频| 中文字幕不卡的av| 日韩精品成人一区二区三区| 国产美女精品人人做人人爽| 在线免费视频一区二区| 欧美成人精品二区三区99精品| 亚洲天天做日日做天天谢日日欢| 亚洲福利一二三区| 99精品视频一区二区| 欧美男同性恋视频网站| 亚洲人成人一区二区在线观看| 丝袜美腿成人在线| 欧美午夜一区二区| 国产精品久久久久久久久搜平片 | 国内精品在线播放| 欧美一区二区三区在| 亚洲国产日韩a在线播放| 岛国精品在线播放| 久久久亚洲综合| 老司机午夜精品| 日韩视频不卡中文| 日本vs亚洲vs韩国一区三区二区 | 欧美亚洲综合在线| 亚洲欧美二区三区| 欧美性猛交xxxxxxxx| 久久精品夜色噜噜亚洲aⅴ| 亚洲成a人片在线观看中文| 狠狠色丁香久久婷婷综合_中 | 欧美一区二区在线看| 国产亲近乱来精品视频|