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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cabac.c

?? H264解碼器,本解碼器實現了圖像的264解碼
?? 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本到不卡免费一区二区| 欧美久久久久免费| 日本欧美一区二区在线观看| 国产日韩精品一区二区三区 | 国产综合色视频| 亚洲免费在线观看视频| 欧美精品一区二区三区久久久| 色综合天天综合网天天看片| 精品一区二区国语对白| 亚洲激情图片小说视频| 国产人伦精品一区二区| 欧美一二三四区在线| 91免费观看视频在线| 成人小视频免费在线观看| 精久久久久久久久久久| 日韩制服丝袜av| 亚洲综合免费观看高清完整版| 久久精品视频一区二区三区| 在线播放一区二区三区| 色综合久久88色综合天天6| 国产白丝精品91爽爽久久| 久久99国产精品麻豆| 丝袜诱惑制服诱惑色一区在线观看| 亚洲图片激情小说| 综合在线观看色| 国产精品毛片久久久久久久| 久久久久久一二三区| 精品国产伦一区二区三区观看体验 | 色哟哟欧美精品| 91香蕉视频污在线| 91伊人久久大香线蕉| 成人性生交大片免费看在线播放| 国产剧情av麻豆香蕉精品| 黄页网站大全一区二区| 久久99九九99精品| 九九视频精品免费| 精品一二线国产| 精品亚洲国内自在自线福利| 成人性生交大片免费看中文| 亚洲精品日日夜夜| 国产精品亲子乱子伦xxxx裸| 国产欧美一区二区三区网站| 精品女同一区二区| 精品伦理精品一区| www亚洲一区| 久久午夜羞羞影院免费观看| 欧美变态tickle挠乳网站| 日韩欧美不卡在线观看视频| 欧美www视频| 久久午夜国产精品| 久久蜜桃av一区二区天堂| 国产蜜臀av在线一区二区三区| 国产精品美女一区二区三区 | 亚洲成人精品影院| 首页欧美精品中文字幕| 日本人妖一区二区| 黄网站免费久久| 成人免费看视频| 色哟哟在线观看一区二区三区| 在线中文字幕不卡| 欧美一区二区成人6969| 久久综合色鬼综合色| 亚洲国产精品高清| 亚洲自拍偷拍av| 另类小说一区二区三区| 成人黄色综合网站| 在线观看三级视频欧美| 91精品国产综合久久香蕉麻豆| 精品国产一区二区三区久久久蜜月 | 欧美日韩国产免费一区二区| 91麻豆精品国产综合久久久久久 | 国产精品婷婷午夜在线观看| 一区二区三区中文在线观看| 免费成人在线观看| 99麻豆久久久国产精品免费优播| 在线观看日韩电影| 久久久久久久久久久黄色| 中文字幕一区视频| 蜜桃av一区二区三区| 高清不卡在线观看av| 欧美色图一区二区三区| 精品国产a毛片| 亚洲精品视频在线观看免费| 蜜乳av一区二区三区| 成人av在线一区二区三区| 9191久久久久久久久久久| 国产区在线观看成人精品| 午夜精品福利视频网站| 国产黄色91视频| 欧美酷刑日本凌虐凌虐| 中文字幕日韩精品一区| 日韩国产在线一| 91在线观看免费视频| 欧美va亚洲va在线观看蝴蝶网| 最新日韩在线视频| 久久99精品国产麻豆婷婷| 色www精品视频在线观看| 精品国产区一区| 午夜精品成人在线视频| 白白色亚洲国产精品| 欧美一区二区三区在线视频| 综合自拍亚洲综合图不卡区| 激情五月婷婷综合| 91精品免费在线| 亚洲综合色噜噜狠狠| 福利一区福利二区| 日韩欧美的一区二区| 亚洲国产人成综合网站| 99视频一区二区三区| xnxx国产精品| 日本不卡在线视频| 欧美性感一类影片在线播放| 中文字幕在线不卡国产视频| 国产一区二区三区免费看| 91精品国产综合久久精品app| 亚洲精品视频一区二区| 成人av网址在线观看| 欧美精品一区二区三区在线| 婷婷六月综合亚洲| 欧美日韩激情一区二区| 亚洲精品免费在线| aa级大片欧美| 国产精品久线观看视频| 国产.欧美.日韩| 国产日韩欧美电影| 国产黄色成人av| 欧美国产激情二区三区| 国产一区二区在线免费观看| 精品国内片67194| 精品中文字幕一区二区小辣椒 | 精品国产凹凸成av人导航| 蜜桃传媒麻豆第一区在线观看| 4438成人网| 人人超碰91尤物精品国产| 欧美肥妇毛茸茸| 天天综合网天天综合色| 制服.丝袜.亚洲.中文.综合| 青草av.久久免费一区| 日韩色视频在线观看| 美国一区二区三区在线播放| 日韩视频一区二区在线观看| 日本不卡1234视频| 日韩精品一区二区三区中文精品 | 免费在线看一区| 日韩欧美国产系列| 精品亚洲porn| 亚洲国产成人私人影院tom| 成人av影视在线观看| 亚洲精品久久久久久国产精华液| 在线观看一区二区精品视频| 亚洲1区2区3区4区| 日韩欧美一级二级三级| 激情欧美一区二区| 日韩理论片中文av| 欧美三级中文字幕| 理论片日本一区| 久久在线观看免费| av男人天堂一区| 一区二区三区在线视频观看58 | 中文字幕欧美国产| 在线中文字幕一区二区| 青青草原综合久久大伊人精品优势| 欧美电影免费观看完整版| 国产91精品精华液一区二区三区| 中文字幕五月欧美| 欧美日韩国产免费一区二区| 久久精品免费看| 国产午夜久久久久| 91久久香蕉国产日韩欧美9色| 调教+趴+乳夹+国产+精品| 精品少妇一区二区三区在线播放 | 久久精品99国产精品日本| 国产日韩欧美精品一区| 在线亚洲精品福利网址导航| 日韩精品视频网| 国产精品视频看| 欧美男男青年gay1069videost | 欧美日韩中字一区| 国内精品伊人久久久久av一坑| 中文字幕一区二区三区不卡 | 成人综合婷婷国产精品久久免费| 亚洲精品高清视频在线观看| 欧美电视剧在线观看完整版| 成人手机电影网| 日韩av中文在线观看| 国产精品电影一区二区三区| 3atv一区二区三区| jlzzjlzz亚洲女人18| 秋霞电影网一区二区| 亚洲欧美日韩在线| 精品久久国产字幕高潮| 欧美自拍丝袜亚洲| 国产精品一线二线三线| 亚洲国产aⅴ天堂久久| 国产精品嫩草久久久久| 欧美成人官网二区| 欧美日产国产精品| 91视频免费播放| 国产一区二区不卡在线| 日韩av一二三|