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

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

?? parset.c

?? h264標(biāo)準(zhǔn)的VC實現(xiàn)
?? C
?? 第 1 頁 / 共 3 頁
字號:

/*!
 **************************************************************************************
 * \file
 *    parset.c
 * \brief
 *    Picture and Sequence Parameter set generation and handling
 *  \date 25 November 2002
 * \author
 *    Main contributors (see contributors.h for copyright, address and affiliation details) 
 *      - Stephan Wenger        <stewe@cs.tu-berlin.de>
 *
 **************************************************************************************
 */

#include <stdlib.h>
#include <assert.h>
 
#include "global.h"

#include "contributors.h"
#include "mbuffer.h"
#include "parset.h"
#include "vlc.h"

// Local helpers
static int IdentifyProfile();
static int IdentifyLevel();
static int IdentifyNumRefFrames();
static int GenerateVUISequenceParameters();

extern ColocatedParams *Co_located;


/*! 
 *************************************************************************************
 * \brief
 *    generates a sequence and picture parameter set and stores these in global
 *    active_sps and active_pps
 *
 * \return
 *    A NALU containing the Sequence ParameterSet
 *
 *************************************************************************************
*/
void GenerateParameterSets ()
{
  seq_parameter_set_rbsp_t *sps = NULL; 
  pic_parameter_set_rbsp_t *pps = NULL;

  sps = AllocSPS();
  pps = AllocPPS();

  FillParameterSetStructures (sps, pps);
  
  active_sps = sps;
  active_pps = pps;
}

/*! 
*************************************************************************************
* \brief
*    frees global parameter sets active_sps and active_pps
*
* \return
*    A NALU containing the Sequence ParameterSet
*
*************************************************************************************
*/
void FreeParameterSets ()
{
  FreeSPS (active_sps);
  FreePPS (active_pps);
}

/*! 
*************************************************************************************
* \brief
*    int GenerateSeq_parameter_set_NALU ();
*
* \note
*    Uses the global variables through FillParameterSetStructures()
*
* \return
*    A NALU containing the Sequence ParameterSet
*
*************************************************************************************
*/

NALU_t *GenerateSeq_parameter_set_NALU ()
{
  NALU_t *n = AllocNALU(64000);
  int RBSPlen = 0;
  int NALUlen;
  byte rbsp[MAXRBSPSIZE];

  RBSPlen = GenerateSeq_parameter_set_rbsp (active_sps, rbsp);
  NALUlen = RBSPtoNALU (rbsp, n, RBSPlen, NALU_TYPE_SPS, NALU_PRIORITY_HIGHEST, 0, 1);
  n->startcodeprefix_len = 4;

  return n;
}


/*! 
*************************************************************************************
* \brief
*    NALU_t *GeneratePic_parameter_set_NALU ();
*
* \note
*    Uses the global variables through FillParameterSetStructures()
*
* \return
*    A NALU containing the Picture Parameter Set
*
*************************************************************************************
*/

NALU_t *GeneratePic_parameter_set_NALU()
{
  NALU_t *n = AllocNALU(64000);
  int RBSPlen = 0;
  int NALUlen;
  byte rbsp[MAXRBSPSIZE];

  RBSPlen = GeneratePic_parameter_set_rbsp (active_pps, rbsp);
  NALUlen = RBSPtoNALU (rbsp, n, RBSPlen, NALU_TYPE_PPS, NALU_PRIORITY_HIGHEST, 0, 1);
  n->startcodeprefix_len = 4;

  return n;
}

/*!
 ************************************************************************
 * \brief
 *    FillParameterSetStructures: extracts info from global variables and
 *    generates a picture and sequence parameter set structure
 *
 * \param sps
 *    Sequence parameter set to be filled
 * \param pps
 *    Picture parameter set to be filled
 * \par
 *    Function reads all kinds of values from several global variables,
 *    including input-> and image-> and fills in the sps and pps.  Many
 *    values are current hard-coded to defaults, especially most of the
 *    VUI stuff.  Currently, the sps and pps structures are fixed length
 *    with the exception of the fully flexible FMO map (mode 6).  This
 *    mode is not supported.  Hence, the function does not need to
 *    allocate memory for the FMOmap, the pointer slice_group_id is
 *    always NULL.  If one wants to implement FMO mode 6, one would need
 *    to malloc the memory for the map here, and the caller would need
 *    to free it after use.
 *
 * \par 
 *    Limitations
 *    Currently, the encoder does not support multiple parameter sets,
 *    primarily because the config file does not support it.  Hence the
 *    pic_parameter_set_id and the seq_parameter_set_id are always zero.
 *    If one day multiple parameter sets are implemented, it would
 *    make sense to break this function into two, one for the picture and
 *    one for the sequence.
 *    Currently, FMO is not supported
 *    The following pps and sps elements seem not to be used in the encoder 
 *    or decoder and, hence, a guessed default value is conveyed:
 *
 *    pps->num_ref_idx_l0_active_minus1 = img->num_ref_pic_active_fwd_minus1;
 *    pps->num_ref_idx_l1_active_minus1 = img->num_ref_pic_active_bwd_minus1;
 *    pps->chroma_qp_index_offset = 0;
 *    sps->required_frame_num_update_behaviour_flag = FALSE;
 *    sps->direct_temporal_constrained_flag = FALSE;
 *
 * \par
 *    Regarding the QP
 *    The previous software versions coded the absolute QP only in the 
 *    slice header.  This is kept, and the offset in the PPS is coded 
 *    even if we could save bits by intelligently using this field.
 *
 ************************************************************************
 */

void FillParameterSetStructures (seq_parameter_set_rbsp_t *sps, 
                                 pic_parameter_set_rbsp_t *pps)
{
  unsigned i;
  int frext_profile = ((IdentifyProfile()==FREXT_HP) || 
                      (IdentifyProfile()==FREXT_Hi10P) ||
                      (IdentifyProfile()==FREXT_Hi422) ||
                      (IdentifyProfile()==FREXT_Hi444));

  // *************************************************************************
  // Sequence Parameter Set
  // *************************************************************************
  assert (sps != NULL);
  assert (pps != NULL);
  // Profile and Level should be calculated using the info from the config
  // file.  Calculation is hidden in IndetifyProfile() and IdentifyLevel()
  sps->profile_idc = IdentifyProfile();
  sps->level_idc = IdentifyLevel();

  // needs to be set according to profile
  sps->constrained_set0_flag = 0;
  sps->constrained_set1_flag = 0;
  sps->constrained_set2_flag = 0;
  sps->constrained_set3_flag = 0;

  // Parameter Set ID hard coded to zero
  sps->seq_parameter_set_id = 0;

  // Fidelity Range Extensions stuff
  sps->bit_depth_luma_minus8   = input->BitDepthLuma - 8;
  sps->bit_depth_chroma_minus8 = input->BitDepthChroma - 8;
  img->lossless_qpprime_flag = input->lossless_qpprime_y_zero_flag & (sps->profile_idc==FREXT_Hi444);
  img->residue_transform_flag = input->residue_transform_flag;
  
  //! POC stuff:
  //! The following values are hard-coded in init_poc().  Apparently,
  //! the poc implementation covers only a subset of the poc functionality.
  //! Here, the same subset is implemented.  Changes in the POC stuff have
  //! also to be reflected here
  sps->log2_max_frame_num_minus4 = log2_max_frame_num_minus4;
  sps->log2_max_pic_order_cnt_lsb_minus4 = log2_max_pic_order_cnt_lsb_minus4;
  
  sps->pic_order_cnt_type = input->pic_order_cnt_type;
  sps->num_ref_frames_in_pic_order_cnt_cycle = img->num_ref_frames_in_pic_order_cnt_cycle;
  sps->delta_pic_order_always_zero_flag = img->delta_pic_order_always_zero_flag;
  sps->offset_for_non_ref_pic = img->offset_for_non_ref_pic;
  sps->offset_for_top_to_bottom_field = img->offset_for_top_to_bottom_field;

  for (i=0; i<img->num_ref_frames_in_pic_order_cnt_cycle; i++)
  {
    sps->offset_for_ref_frame[i] = img->offset_for_ref_frame[i];
  }
  // End of POC stuff

  // Number of Reference Frames
  sps->num_ref_frames = IdentifyNumRefFrames();

  //required_frame_num_update_behaviour_flag hardcoded to zero
  sps->gaps_in_frame_num_value_allowed_flag = FALSE;    // double check

  sps->frame_mbs_only_flag = !(input->PicInterlace || input->MbInterlace);

  // Picture size, finally a simple one :-)
  sps->pic_width_in_mbs_minus1 = (input->img_width/16) -1;
  sps->pic_height_in_map_units_minus1 = ((input->img_height/16)/ (2 - sps->frame_mbs_only_flag)) - 1;

  // a couple of flags, simple
  sps->mb_adaptive_frame_field_flag = (FRAME_CODING != input->MbInterlace);
  sps->direct_8x8_inference_flag = input->directInferenceFlag;
  
  // Sequence VUI not implemented, signalled as not present
  sps->vui_parameters_present_flag = (input->rgb_input_flag && input->yuv_format==3);

  {
    int PicWidthInMbs, PicHeightInMapUnits, FrameHeightInMbs;
    int width, height;
    PicWidthInMbs = (sps->pic_width_in_mbs_minus1 +1);
    PicHeightInMapUnits = (sps->pic_height_in_map_units_minus1 +1);
    FrameHeightInMbs = ( 2 - sps->frame_mbs_only_flag ) * PicHeightInMapUnits;
    
    width = PicWidthInMbs * MB_BLOCK_SIZE;
    height = FrameHeightInMbs * MB_BLOCK_SIZE;
    
    Co_located = alloc_colocated (width, height,sps->mb_adaptive_frame_field_flag);
    
  }
  // *************************************************************************
  // Picture Parameter Set 
  // *************************************************************************

  pps->seq_parameter_set_id = 0;
  pps->pic_parameter_set_id = 0;
  pps->entropy_coding_mode_flag = (input->symbol_mode==UVLC?0:1);

  // Fidelity Range Extensions stuff
  if(frext_profile)
  {
    pps->transform_8x8_mode_flag = input->AllowTransform8x8 ? 1:0;

    sps->seq_scaling_matrix_present_flag = (input->ScalingMatrixPresentFlag&1);
    for(i=0; i<8; i++)
    {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人久久18免费网站麻豆| 一本大道av一区二区在线播放| 国产成人av一区二区| 色就色 综合激情| 久久久无码精品亚洲日韩按摩| 亚洲人成影院在线观看| 久久99久久99| 欧美日韩一卡二卡三卡| 亚洲欧洲一区二区在线播放| 国产在线一区二区综合免费视频| 欧美影院一区二区三区| 亚洲欧美一区二区在线观看| 国产精品影视在线观看| 欧美一区永久视频免费观看| 樱桃视频在线观看一区| 成人一二三区视频| 久久久久久9999| 久国产精品韩国三级视频| 欧美精品一级二级| 亚洲一区二区免费视频| 色狠狠色噜噜噜综合网| 18涩涩午夜精品.www| 成人深夜福利app| 国产日韩欧美在线一区| 国产一区二区伦理| 欧美xxxxx牲另类人与| 奇米精品一区二区三区四区 | 亚洲日韩欧美一区二区在线| 国产精品99精品久久免费| 精品国精品国产尤物美女| 麻豆一区二区99久久久久| 91麻豆精品国产自产在线| 午夜精品成人在线视频| 欧美日韩在线免费视频| 香蕉成人伊视频在线观看| 精品污污网站免费看| 婷婷开心激情综合| 欧美电影一区二区三区| 免费一级片91| 精品国产凹凸成av人导航| 激情综合网av| 国产午夜精品久久久久久久 | 国产日韩精品一区| 粉嫩aⅴ一区二区三区四区| 中文字幕av免费专区久久| youjizz久久| 一区二区国产视频| 91精品婷婷国产综合久久竹菊| 日韩电影在线观看一区| 精品国产免费人成在线观看| 国产成a人亚洲精品| 亚洲激情图片一区| 欧美一区二区免费| 国产精品一区二区果冻传媒| 国产精品素人一区二区| 欧洲精品一区二区| 麻豆精品国产传媒mv男同| 久久九九全国免费| 日本国产一区二区| 另类成人小视频在线| 国产精品麻豆视频| 欧美丰满一区二区免费视频 | 色中色一区二区| 日韩成人免费看| 欧美激情一区二区在线| 在线观看亚洲精品视频| 激情综合色播五月| 亚洲欧美日韩一区二区三区在线观看| 欧美日韩亚洲综合一区二区三区| 久久国产婷婷国产香蕉| 中文字幕在线播放不卡一区| 777xxx欧美| 99国内精品久久| 毛片不卡一区二区| 亚洲一级在线观看| 国产精品嫩草影院com| 欧美日韩高清在线播放| 成人亚洲一区二区一| 午夜激情久久久| 日本一区二区电影| 欧美大片一区二区| 欧美性猛片aaaaaaa做受| 国产成人免费视频一区| 日本最新不卡在线| 亚洲综合色视频| 国产精品三级久久久久三级| 日韩一区二区三区电影在线观看 | 亚洲尤物在线视频观看| 久久久久97国产精华液好用吗| 欧美日韩高清一区| 色先锋aa成人| 成人动漫精品一区二区| 久久国产精品99精品国产| 亚洲午夜一区二区三区| 亚洲图片欧美激情| 国产精品欧美一级免费| 日韩丝袜美女视频| 欧美乱熟臀69xxxxxx| 色综合色狠狠综合色| 成人免费av在线| 国产福利一区二区| 久久精品二区亚洲w码| 免费的成人av| 蜜臀av一区二区在线观看| 午夜亚洲福利老司机| 亚洲一区免费在线观看| 亚洲免费在线播放| 亚洲天堂av老司机| 国产精品久久久久久久第一福利| 久久久99精品免费观看| 国产日韩三级在线| 欧美激情综合五月色丁香小说| 久久久久国产精品麻豆| 久久日韩精品一区二区五区| 欧美成人精品1314www| 制服丝袜亚洲网站| 欧美xingq一区二区| 久久午夜免费电影| 久久久久99精品国产片| 欧美国产一区二区在线观看| 欧美激情一区二区三区不卡| 国产精品伦理在线| 亚洲视频一二区| 亚洲国产一区二区三区青草影视| 亚洲成人7777| 麻豆精品精品国产自在97香蕉| 久久福利视频一区二区| 国产一区视频导航| av日韩在线网站| 91国偷自产一区二区使用方法| 欧美日韩一级片在线观看| 日韩欧美卡一卡二| 亚洲国产电影在线观看| 亚洲精品乱码久久久久久| 亚洲国产精品久久不卡毛片| 日本不卡中文字幕| 国产精品一区专区| 色综合久久久久网| 欧美一区二区三区思思人| 精品国产乱码久久久久久久久 | 偷拍一区二区三区| 国产一区二区免费看| av网站免费线看精品| 欧美日韩和欧美的一区二区| 日韩视频永久免费| 国产精品久久久久9999吃药| 一区二区三区日韩欧美| 免费高清不卡av| 99久久久久久| 欧美大胆一级视频| 中文字幕一区二区三区在线不卡| 亚洲成人精品一区二区| 久久97超碰色| 91国产视频在线观看| 26uuu精品一区二区在线观看| 国产精品国产成人国产三级| 日韩av网站在线观看| 99久久伊人久久99| 欧美电影免费观看高清完整版在线观看| 国产女主播视频一区二区| 亚洲成国产人片在线观看| 成人激情午夜影院| 日韩三级在线免费观看| 亚洲精品国产无天堂网2021| 国产毛片一区二区| 欧美精品视频www在线观看| 国产精品久久99| 国内精品国产三级国产a久久| 在线观看视频91| 中文字幕免费观看一区| 看电视剧不卡顿的网站| 欧美视频一区二区三区在线观看| 久久久国际精品| 久久99久久久久| 欧美另类高清zo欧美| 亚洲精品国久久99热| 成人av在线一区二区三区| 精品国免费一区二区三区| 视频在线观看一区二区三区| 91免费观看视频| 国产精品理论在线观看| 国产成人在线观看免费网站| 日韩一卡二卡三卡国产欧美| 亚洲一区二区三区四区在线免费观看 | 精品亚洲欧美一区| 91超碰这里只有精品国产| 一区二区视频在线| 99久久免费精品高清特色大片| 久久久久久久网| 国产主播一区二区三区| 26uuu国产电影一区二区| 日本成人中文字幕| 日韩视频在线观看一区二区| 视频一区二区欧美| 欧美肥胖老妇做爰| 日本欧美一区二区在线观看| 777午夜精品视频在线播放| 奇米精品一区二区三区在线观看| 91精品国产一区二区| 美女视频黄频大全不卡视频在线播放|