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

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

?? cabac.c

?? 網(wǎng)絡(luò)MPEG4IP流媒體開發(fā)源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/************************************************************************* COPYRIGHT AND WARRANTY INFORMATION** Copyright 2001, International Telecommunications Union, Geneva** DISCLAIMER OF WARRANTY** These software programs are available to the user without any* license fee or royalty on an "as is" basis. The ITU disclaims* any and all warranties, whether express, implied, or* statutory, including any implied warranties of merchantability* or of fitness for a particular purpose.  In no event shall the* contributor or the ITU be liable for any incidental, punitive, or* consequential damages of any kind whatsoever arising from the* use of these programs.** This disclaimer of warranty extends to the user of these programs* and user's customers, employees, agents, transferees, successors,* and assigns.** The ITU does not represent or warrant that the programs furnished* hereunder are free of infringement of any third-party patents.* Commercial implementations of ITU-T Recommendations, including* shareware, may be subject to royalty fees to patent holders.* Information regarding the ITU-T patent policy is available from* the ITU Web site at http://www.itu.int.** THIS IS NOT A GRANT OF PATENT RIGHTS - SEE THE ITU-T PATENT POLICY.*************************************************************************//*! ************************************************************************************* * \file cabac.c * * \brief *    CABAC entropy coding routines * * \author *    Main contributors (see contributors.h for copyright, address and affiliation details) *    - Detlev Marpe                    <marpe@hhi.de> ************************************************************************************** */#include <stdlib.h>#include <math.h>#include <memory.h>#include "cabac.h"/*! ************************************************************************ * \brief *    Allocation of contexts models for the motion info *    used for arithmetic encoding ************************************************************************ */MotionInfoContexts* create_contexts_MotionInfo(void){  int j;  MotionInfoContexts *enco_ctx;  enco_ctx = (MotionInfoContexts*) calloc(1, sizeof(MotionInfoContexts) );  if( enco_ctx == NULL )    no_mem_exit("create_contexts_MotionInfo: enco_ctx");  for (j=0; j<2; j++)  {    enco_ctx->mb_type_contexts[j] = (BiContextTypePtr) malloc(NUM_MB_TYPE_CTX  * sizeof( BiContextType ) );    if( enco_ctx->mb_type_contexts[j] == NULL )      no_mem_exit("create_contexts_MotionInfo: enco_ctx->mb_type_contexts");    enco_ctx->mv_res_contexts[j] = (BiContextTypePtr) malloc(NUM_MV_RES_CTX  * sizeof( BiContextType ) );    if( enco_ctx->mv_res_contexts[j] == NULL )      no_mem_exit("create_contexts_MotionInfo: enco_ctx->mv_res_contexts");  }  enco_ctx->ref_no_contexts = (BiContextTypePtr) malloc(NUM_REF_NO_CTX * sizeof( BiContextType ) );  if( enco_ctx->ref_no_contexts == NULL )    no_mem_exit("create_contexts_MotionInfo: enco_ctx->ref_no_contexts");  enco_ctx->delta_qp_contexts = (BiContextTypePtr) malloc(NUM_DELTA_QP_CTX * sizeof( BiContextType ) );  if( enco_ctx->delta_qp_contexts == NULL )    no_mem_exit("create_contexts_MotionInfo: enco_ctx->delta_qp_contexts");  return enco_ctx;}/*! ************************************************************************ * \brief *    Allocates of contexts models for the texture info *    used for arithmetic encoding ************************************************************************ */TextureInfoContexts* create_contexts_TextureInfo(void){  int j,k;  TextureInfoContexts *enco_ctx;  enco_ctx = (TextureInfoContexts*) calloc(1, sizeof(TextureInfoContexts) );  if( enco_ctx == NULL )    no_mem_exit("create_contexts_TextureInfo: enco_ctx");  for (j=0; j < 6; j++)  {    enco_ctx->ipr_contexts[j] = (BiContextTypePtr) malloc(NUM_IPR_CTX  * sizeof( BiContextType ) );    if( enco_ctx->ipr_contexts[j] == NULL )      no_mem_exit("create_contexts_TextureInfo: enco_ctx->ipr_contexts");  }  for (k=0; k<2; k++)    for (j=0; j<3; j++)    {      enco_ctx->cbp_contexts[k][j] = (BiContextTypePtr) malloc(NUM_CBP_CTX  * sizeof( BiContextType ) );      if( enco_ctx->cbp_contexts[k][j] == NULL )        no_mem_exit("create_contexts_TextureInfo: enco_ctx->cbp_contexts");    }  for (j=0; j < NUM_TRANS_TYPE; j++)  {    enco_ctx->level_context[j] = (BiContextTypePtr) malloc(NUM_LEVEL_CTX  * sizeof( BiContextType ) );    if( enco_ctx->level_context[j] == NULL )      no_mem_exit("create_contexts_TextureInfo: enco_ctx->level_context");    enco_ctx->run_context[j] = (BiContextTypePtr) malloc(NUM_RUN_CTX  * sizeof( BiContextType ) );    if( enco_ctx->run_context[j] == NULL )      no_mem_exit("create_contexts_TextureInfo: enco_ctx->run_context");  }  return enco_ctx;}/*! ************************************************************************ * \brief *    Initializes an array of contexts models with some pre-defined *    counts (ini_flag = 1) or with a flat histogram (ini_flag = 0) ************************************************************************ */void init_contexts_MotionInfo(MotionInfoContexts *enco_ctx, int ini_flag){  int i,j;  int scale_factor;  int qp_factor;  int ini[3];  if ( (img->width*img->height) <=  (IMG_WIDTH * IMG_HEIGHT) ) //  format <= QCIF    scale_factor=1;  else    scale_factor=2;  if(img->qp <= 10)    qp_factor=0;  else    qp_factor=img->qp-10;  for (j=0; j<2; j++)  {    if (ini_flag)    {      for (i=0; i < NUM_MB_TYPE_CTX; i++)      {        ini[0] = MB_TYPE_Ini[j][i][0]+(MB_TYPE_Ini[j][i][3]*qp_factor)/10;        ini[1] = MB_TYPE_Ini[j][i][1]+(MB_TYPE_Ini[j][i][4]*qp_factor)/10;        ini[2] = MB_TYPE_Ini[j][i][2]*scale_factor;        biari_init_context(enco_ctx->mb_type_contexts[j] + i,ini[0],ini[1],ini[2]);      }    }    else    {      for (i=0; i < NUM_MB_TYPE_CTX; i++)        biari_init_context(enco_ctx->mb_type_contexts[j] + i,1,1,100);    }    if (ini_flag)    {      for (i=0; i < NUM_MV_RES_CTX; i++)        biari_init_context(enco_ctx->mv_res_contexts[j] + i,MV_RES_Ini[j][i][0]*scale_factor,MV_RES_Ini[j][i][1]*scale_factor,MV_RES_Ini[j][i][2]*scale_factor);    }    else    {      for (i=0; i < NUM_MV_RES_CTX; i++)        biari_init_context(enco_ctx->mv_res_contexts[j] + i,1,1,1000);    }  }  if (ini_flag)  {    for (i=0; i < NUM_REF_NO_CTX; i++)      biari_init_context(enco_ctx->ref_no_contexts + i,REF_NO_Ini[i][0]*scale_factor,REF_NO_Ini[i][1]*scale_factor,REF_NO_Ini[i][2]*scale_factor);  }  else  {    for (i=0; i < NUM_REF_NO_CTX; i++)      biari_init_context(enco_ctx->ref_no_contexts + i,1,1,1000);  }  if (ini_flag)  {    for (i=0; i < NUM_DELTA_QP_CTX; i++)      biari_init_context(enco_ctx->delta_qp_contexts + i,DELTA_QP_Ini[i][0]*scale_factor,DELTA_QP_Ini[i][1]*scale_factor,DELTA_QP_Ini[i][2]*scale_factor);  }  else  {    for (i=0; i < NUM_DELTA_QP_CTX; i++)      biari_init_context(enco_ctx->delta_qp_contexts + i,1,1,1000);  }}/*! ************************************************************************ * \brief *    Initializes an array of contexts models with some pre-defined *    counts (ini_flag = 1) or with a flat histogram (ini_flag = 0) ************************************************************************ */void init_contexts_TextureInfo(TextureInfoContexts *enco_ctx, int ini_flag){  int i,j,k;  int scale_factor;  int qp_factor;  int ini[3];  if ( (img->width*img->height) <=  (IMG_WIDTH * IMG_HEIGHT) ) //  format <= QCIF   scale_factor=1;  else   scale_factor=2;  if(img->qp <= 10)    qp_factor=0;  else    qp_factor=img->qp-10;  for (j=0; j < 6; j++)  {    if (ini_flag)    {      for (i=0; i < NUM_IPR_CTX; i++)        biari_init_context(enco_ctx->ipr_contexts[j] + i,IPR_Ini[j][i][0]*scale_factor,IPR_Ini[j][i][1]*scale_factor,IPR_Ini[j][i][2]*scale_factor);    }    else    {      for (i=0; i < NUM_IPR_CTX; i++)        biari_init_context(enco_ctx->ipr_contexts[j] + i,2,1,50);    }  }  for (k=0; k<2; k++)    for (j=0; j<3; j++)    {      if (ini_flag)      {        for (i=0; i < NUM_CBP_CTX; i++)        {          ini[0] = CBP_Ini[k][j][i][0]+(CBP_Ini[k][j][i][3]*qp_factor)/10;          ini[1] = CBP_Ini[k][j][i][1]+(CBP_Ini[k][j][i][4]*qp_factor)/10;          ini[2] = CBP_Ini[k][j][i][2]*scale_factor;          biari_init_context(enco_ctx->cbp_contexts[k][j] + i,ini[0],ini[1],ini[2]);        }      }      else      {        for (i=0; i < NUM_CBP_CTX; i++)          biari_init_context(enco_ctx->cbp_contexts[k][j] + i,1,1,100);      }    }  for (j=0; j < NUM_TRANS_TYPE; j++)  {    if (ini_flag)    {      for (i=0; i < NUM_LEVEL_CTX; i++)      {        ini[0] = (Level_Ini[j][i][0]+(Level_Ini[j][i][3]*qp_factor)/10)*scale_factor;        ini[1] = (Level_Ini[j][i][1]+(Level_Ini[j][i][4]*qp_factor)/10)*scale_factor;        ini[2] = Level_Ini[j][i][2]*scale_factor;        biari_init_context(enco_ctx->level_context[j] + i,ini[0],ini[1],ini[2]);      }    }    else    {      for (i=0; i < NUM_LEVEL_CTX; i++)        biari_init_context(enco_ctx->level_context[j] + i,1,1,100);    }    if (ini_flag)    {      for (i=0; i < NUM_RUN_CTX; i++)      {        ini[0] = Run_Ini[j][i][0]*scale_factor;        ini[1] = Run_Ini[j][i][1]*scale_factor;        ini[2] = Run_Ini[j][i][2]*scale_factor;        biari_init_context(enco_ctx->run_context[j] + i,ini[0],ini[1],ini[2]);      }    }    else    {      for (i=0; i < NUM_RUN_CTX; i++)        biari_init_context(enco_ctx->run_context[j] + i,1,1,100);    }  }}/*! ************************************************************************ * \brief *    Frees the memory of the contexts models *    used for arithmetic encoding of the motion info. ************************************************************************ */void delete_contexts_MotionInfo(MotionInfoContexts *enco_ctx){  int j;  if( enco_ctx == NULL )    return;  for (j=0; j<2; j++)  {    if (enco_ctx->mb_type_contexts[j] != NULL)      free(enco_ctx->mb_type_contexts[j] );    if (enco_ctx->mv_res_contexts[j]  != NULL)      free(enco_ctx->mv_res_contexts[j] );  }  if (enco_ctx->ref_no_contexts != NULL)    free(enco_ctx->ref_no_contexts);  if (enco_ctx->delta_qp_contexts != NULL)    free(enco_ctx->delta_qp_contexts);  free( enco_ctx );  return;}/*! ************************************************************************ * \brief *    Frees the memory of the contexts models *    used for arithmetic encoding of the texture info. ************************************************************************ */void delete_contexts_TextureInfo(TextureInfoContexts *enco_ctx){  int j,k;  if( enco_ctx == NULL )    return;  for (j=0; j < 6; j++)  {    if (enco_ctx->ipr_contexts[j] != NULL)      free(enco_ctx->ipr_contexts[j]);  }  for (k=0; k<2; k++)    for (j=0; j<3; j++)    {      if (enco_ctx->cbp_contexts[k][j] != NULL)        free(enco_ctx->cbp_contexts[k][j]);    }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合免费观看高清完整版| 欧美日韩国产首页| 国模娜娜一区二区三区| 免费高清成人在线| 久久国产尿小便嘘嘘| 久久精品99国产国产精| 九一久久久久久| 韩国女主播成人在线| 国产一区二区不卡| 成人av小说网| 欧美少妇bbb| 7777精品伊人久久久大香线蕉完整版 | 国产成人丝袜美腿| 粉嫩av一区二区三区在线播放 | 五月婷婷综合网| 日本在线不卡视频| 激情国产一区二区| 国产不卡视频在线观看| 99久久精品一区| 欧美嫩在线观看| 精品处破学生在线二十三| 久久精品视频在线免费观看 | 欧美亚洲一区三区| 日韩欧美国产麻豆| 欧美激情在线免费观看| 亚洲美女在线一区| 蜜桃久久久久久久| 99久久精品国产一区| 欧美性极品少妇| 精品成a人在线观看| 亚洲婷婷国产精品电影人久久| 五月激情综合色| 国产在线日韩欧美| 欧美自拍丝袜亚洲| 久久综合九色欧美综合狠狠| 亚洲免费视频中文字幕| 男女性色大片免费观看一区二区| 国产成人av一区| 欧美男男青年gay1069videost | 另类中文字幕网| 色综合久久66| 日韩免费视频线观看| 综合中文字幕亚洲| 国产一区在线看| 欧洲色大大久久| 久久久综合激的五月天| 亚洲自拍另类综合| 国产成人精品一区二区三区四区| 91久久精品午夜一区二区| 久久精品一区二区三区不卡| 亚洲成av人影院| 91色在线porny| 久久久久久久综合色一本| 天天免费综合色| 一本一道综合狠狠老| 国产日韩亚洲欧美综合| 日产欧产美韩系列久久99| 色伊人久久综合中文字幕| 国产欧美日韩久久| 黑人精品欧美一区二区蜜桃| 欧美人动与zoxxxx乱| 一区二区三区在线观看网站| 高清av一区二区| 国产网站一区二区| 国产一区二区三区电影在线观看 | 97久久精品人人做人人爽50路| 久久久综合激的五月天| 另类小说欧美激情| 欧美大片拔萝卜| 蜜臀久久99精品久久久久宅男| 欧美日韩综合在线| 一区二区三区欧美久久| 91福利社在线观看| 亚洲最新视频在线播放| 日本电影欧美片| 亚洲综合色噜噜狠狠| 在线观看免费一区| 亚洲成人7777| 欧美一区二区三区系列电影| 亚洲.国产.中文慕字在线| 欧美日韩精品三区| 日韩福利视频网| 日韩三级av在线播放| 久久 天天综合| 国产日产欧美一区二区三区| 国产91丝袜在线播放0| 久久久国产精华| aaa国产一区| 亚洲第一会所有码转帖| 日本道精品一区二区三区| 亚洲第一主播视频| 日韩一区二区在线看| 国内久久精品视频| 中文av字幕一区| 在线视频观看一区| 视频一区欧美精品| 久久蜜臀精品av| 91久久免费观看| 奇米精品一区二区三区四区| 久久综合久久综合亚洲| 99久久综合色| 亚洲国产一区二区视频| 日韩视频一区在线观看| 国产精品18久久久久| 亚洲视频香蕉人妖| 日韩免费高清av| 99久久久无码国产精品| 日本不卡123| 欧美国产成人在线| 欧美久久久久久久久中文字幕| 久久不见久久见免费视频1| 国产精品免费视频观看| 欧美一区二区三区公司| 成a人片亚洲日本久久| 日韩精品午夜视频| 国产精品家庭影院| 欧美一区二区黄| 91在线视频播放地址| 蜜桃免费网站一区二区三区| 亚洲欧美日韩精品久久久久| 欧美不卡一区二区三区四区| 9久草视频在线视频精品| 日韩和欧美的一区| 亚洲欧美国产毛片在线| 久久综合999| 91精品国产入口在线| 色八戒一区二区三区| 国产一区二区日韩精品| 日韩av在线发布| 亚洲一卡二卡三卡四卡| 国产精品久久久久精k8| 精品日韩在线观看| 欧美电影一区二区| 在线视频综合导航| 成人国产视频在线观看| 久久精品国产第一区二区三区| 一区二区三区欧美在线观看| 国产精品久久看| 国产欧美综合在线观看第十页| 欧美一区二区福利在线| 欧美精品日日鲁夜夜添| 精品视频全国免费看| 91猫先生在线| 91香蕉国产在线观看软件| 成人午夜伦理影院| 成人性视频免费网站| 国产精品一区久久久久| 激情av综合网| 精品无人区卡一卡二卡三乱码免费卡| 午夜精品福利视频网站| 亚洲sss视频在线视频| 一区二区三区在线视频观看| 一区二区三区资源| 亚洲综合免费观看高清在线观看| 亚洲精品中文字幕乱码三区| 亚洲人吸女人奶水| 亚洲人xxxx| 亚洲精品视频在线看| 一区二区三区国产豹纹内裤在线| 亚洲精品乱码久久久久久久久| 亚洲欧洲成人av每日更新| 亚洲日本乱码在线观看| 亚洲欧美日韩久久精品| 亚洲一区二区三区影院| 午夜av电影一区| 久久er99精品| 99视频精品免费视频| 色呦呦国产精品| 欧美精品在线一区二区| 日韩精品一区二区三区在线观看| 精品毛片乱码1区2区3区| 亚洲精品一线二线三线无人区| 久久人人爽人人爽| 国产精品久久久久天堂| 亚洲乱码国产乱码精品精小说| 亚洲电影你懂得| 精品在线观看视频| 99久久综合狠狠综合久久| 在线免费观看日本欧美| 日韩午夜精品视频| 国产精品美女www爽爽爽| 亚洲一区二区三区在线看| 另类小说视频一区二区| 99在线精品观看| 91麻豆精品国产91久久久使用方法| 精品精品国产高清a毛片牛牛 | 欧美亚洲丝袜传媒另类| 日韩女优电影在线观看| 亚洲日穴在线视频| 免费在线观看不卡| 91一区在线观看| 欧美大片在线观看一区二区| 亚洲蜜桃精久久久久久久| 久久综合综合久久综合| 91福利小视频| 国产精品理论片在线观看| 日本不卡一区二区| 在线视频综合导航| 国产精品色在线观看| 激情伊人五月天久久综合|