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

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

?? header.c

?? jm_frext22.ZIP的壓縮文件,主要用于嵌入式系統(tǒng)圖象的編解碼的開(kāi)發(fā).
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):

/*!
 *************************************************************************************
 * \file header.c
 *
 * \brief
 *    H.264 Slice headers
 *
 *************************************************************************************
 */

#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>

#include "global.h"
#include "elements.h"
#include "defines.h"
#include "fmo.h"
#include "vlc.h"
#include "mbuffer.h"
#include "header.h"

#include "ctx_tables.h"

extern StorablePicture *dec_picture;

#if TRACE
#define SYMTRACESTRING(s) strncpy(sym.tracestring,s,TRACESTRING_SIZE)
#else
#define SYMTRACESTRING(s) // to nothing
#endif

extern int UsedBits;

static void ref_pic_list_reordering();
static void pred_weight_table();


/*!
 ************************************************************************
 * \brief
 *    calculate Ceil(Log2(uiVal))
 ************************************************************************
 */
unsigned CeilLog2( unsigned uiVal)
{
  unsigned uiTmp = uiVal-1;
  unsigned uiRet = 0;

  while( uiTmp != 0 )
  {
    uiTmp >>= 1;
    uiRet++;
  }
  return uiRet;
}


/*!
 ************************************************************************
 * \brief
 *    read the first part of the header (only the pic_parameter_set_id)
 * \return
 *    Length of the first part of the slice header (in bits)
 ************************************************************************
 */
int FirstPartOfSliceHeader()
{
  Slice *currSlice = img->currentSlice;
  int dP_nr = assignSE2partition[currSlice->dp_mode][SE_HEADER];
  DataPartition *partition = &(currSlice->partArr[dP_nr]);
  Bitstream *currStream = partition->bitstream;
  int tmp;

  UsedBits= partition->bitstream->frame_bitoffset; // was hardcoded to 31 for previous start-code. This is better.

  // Get first_mb_in_slice
  currSlice->start_mb_nr = ue_v ("SH: first_mb_in_slice", currStream);

  tmp = ue_v ("SH: slice_type", currStream);
  
  if (tmp>4) tmp -=5;

  img->type = currSlice->picture_type = (SliceType) tmp;

  currSlice->pic_parameter_set_id = ue_v ("SH: pic_parameter_set_id", currStream);
  
  return UsedBits;
}

/*!
 ************************************************************************
 * \brief
 *    read the scond part of the header (without the pic_parameter_set_id 
 * \return
 *    Length of the second part of the Slice header in bits
 ************************************************************************
 */
int RestOfSliceHeader()
{
  Slice *currSlice = img->currentSlice;
  int dP_nr = assignSE2partition[currSlice->dp_mode][SE_HEADER];
  DataPartition *partition = &(currSlice->partArr[dP_nr]);
  Bitstream *currStream = partition->bitstream;

  int val, len;

  img->frame_num = u_v (active_sps->log2_max_frame_num_minus4 + 4, "SH: frame_num", currStream);

  /* Tian Dong: frame_num gap processing, if found */
  if (img->idr_flag)
  {
    img->pre_frame_num = img->frame_num;
    assert(img->frame_num == 0);
  }

  if (active_sps->frame_mbs_only_flag)
  {
    img->structure = FRAME;
    img->field_pic_flag=0;
  }
  else
  {
    // field_pic_flag   u(1)
    img->field_pic_flag = u_1("SH: field_pic_flag", currStream);
    if (img->field_pic_flag)
    {
      // bottom_field_flag  u(1)
      img->bottom_field_flag = u_1("SH: bottom_field_flag", currStream);

      img->structure = img->bottom_field_flag ? BOTTOM_FIELD : TOP_FIELD;
    }
    else
    {
      img->structure = FRAME;
      img->bottom_field_flag=0;
    }
  }

  currSlice->structure = img->structure;

  img->MbaffFrameFlag=(active_sps->mb_adaptive_frame_field_flag && (img->field_pic_flag==0));

  if (img->structure == FRAME       ) assert (img->field_pic_flag == 0);
  if (img->structure == TOP_FIELD   ) assert (img->field_pic_flag == 1 && img->bottom_field_flag == 0);
  if (img->structure == BOTTOM_FIELD) assert (img->field_pic_flag == 1 && img->bottom_field_flag == 1);

  if (img->idr_flag)
  {
    img->idr_pic_id = ue_v("SH: idr_pic_id", currStream);
  }

  if (active_sps->pic_order_cnt_type == 0)
  {
    img->pic_order_cnt_lsb = u_v(active_sps->log2_max_pic_order_cnt_lsb_minus4 + 4, "SH: pic_order_cnt_lsb", currStream);
    if( active_pps->pic_order_present_flag  ==  1 &&  !img->field_pic_flag )
      img->delta_pic_order_cnt_bottom = se_v("SH: delta_pic_order_cnt_bottom", currStream);
    else
      img->delta_pic_order_cnt_bottom = 0;  
  }
  if( active_sps->pic_order_cnt_type == 1 && !active_sps->delta_pic_order_always_zero_flag ) 
  {
    img->delta_pic_order_cnt[ 0 ] = se_v("SH: delta_pic_order_cnt[0]", currStream);
    if( active_pps->pic_order_present_flag  ==  1  &&  !img->field_pic_flag )
      img->delta_pic_order_cnt[ 1 ] = se_v("SH: delta_pic_order_cnt[1]", currStream);
  }else
  {
    if (active_sps->pic_order_cnt_type == 1)
    {
      img->delta_pic_order_cnt[ 0 ] = 0;
      img->delta_pic_order_cnt[ 1 ] = 0;
    }
  }
  
  //! redundant_pic_cnt is missing here
  if (active_pps->redundant_pic_cnt_present_flag)
  {
    img->redundant_pic_cnt = ue_v ("SH: redundant_pic_cnt", currStream);
  }

  if(img->type==B_SLICE)
  {
    img->direct_type = u_1 ("SH: direct_spatial_mv_pred_flag", currStream);
  }

  img->num_ref_idx_l0_active = active_pps->num_ref_idx_l0_active_minus1 + 1;
  img->num_ref_idx_l1_active = active_pps->num_ref_idx_l1_active_minus1 + 1;

  if(img->type==P_SLICE || img->type == SP_SLICE || img->type==B_SLICE)
  {
    val = u_1 ("SH: num_ref_idx_override_flag", currStream);
    if (val)
    {
      img->num_ref_idx_l0_active = 1 + ue_v ("SH: num_ref_idx_l0_active_minus1", currStream);
      
      if(img->type==B_SLICE)
      {
        img->num_ref_idx_l1_active = 1 + ue_v ("SH: num_ref_idx_l1_active_minus1", currStream);
      }
    }
  }
  if (img->type!=B_SLICE)
  {
    img->num_ref_idx_l1_active = 0;
  }

  ref_pic_list_reordering();

  img->apply_weights = ((active_pps->weighted_pred_flag && (currSlice->picture_type == P_SLICE || currSlice->picture_type == SP_SLICE) )
          || ((active_pps->weighted_bipred_idc > 0 ) && (currSlice->picture_type == B_SLICE)));

  if ((active_pps->weighted_pred_flag&&(img->type==P_SLICE|| img->type == SP_SLICE))||
      (active_pps->weighted_bipred_idc==1 && (img->type==B_SLICE)))
  {
    pred_weight_table();
  }

  if (img->nal_reference_idc)
    dec_ref_pic_marking(currStream);

  if (active_pps->entropy_coding_mode_flag && img->type!=I_SLICE && img->type!=SI_SLICE)
  {
    img->model_number = ue_v("SH: cabac_init_idc", currStream);
  }
  else 
  {
    img->model_number = 0;
  }

  val = se_v("SH: slice_qp_delta", currStream);
  currSlice->qp = img->qp = 26 + active_pps->pic_init_qp_minus26 + val;

  if(img->type==SP_SLICE || img->type == SI_SLICE) 
  {
    if(img->type==SP_SLICE)
    {
      img->sp_switch = u_1 ("SH: sp_for_switch_flag", currStream);
    }
    val = se_v("SH: slice_qs_delta", currStream);
    img->qpsp = 26 + active_pps->pic_init_qs_minus26 + val;
  }

  if (active_pps->deblocking_filter_control_present_flag)
  {
    currSlice->LFDisableIdc = ue_v ("SH: disable_deblocking_filter_idc", currStream);

    if (currSlice->LFDisableIdc!=1)
    {
      currSlice->LFAlphaC0Offset = 2 * se_v("SH: slice_alpha_c0_offset_div2", currStream);
      currSlice->LFBetaOffset = 2 * se_v("SH: slice_beta_offset_div2", currStream);
    }
    else
    {
      currSlice->LFAlphaC0Offset = currSlice->LFBetaOffset = 0;
    }
  }
  else 
  {
    currSlice->LFDisableIdc = currSlice->LFAlphaC0Offset = currSlice->LFBetaOffset = 0;
  }

  if (active_pps->num_slice_groups_minus1>0 && active_pps->slice_group_map_type>=3 &&
      active_pps->slice_group_map_type<=5)
  {
    len = (active_sps->pic_height_in_map_units_minus1+1)*(active_sps->pic_width_in_mbs_minus1+1)/ 
          (active_pps->slice_group_change_rate_minus1+1);
    if (((active_sps->pic_height_in_map_units_minus1+1)*(active_sps->pic_width_in_mbs_minus1+1))% 
          (active_pps->slice_group_change_rate_minus1+1))
          len +=1;

    len = CeilLog2(len+1);

    img->slice_group_change_cycle = u_v (len, "SH: slice_group_change_cycle", currStream);
  }
  img->PicHeightInMbs = img->FrameHeightInMbs / ( 1 + img->field_pic_flag );
  img->PicSizeInMbs   = img->PicWidthInMbs * img->PicHeightInMbs;
  img->FrameSizeInMbs = img->PicWidthInMbs * img->FrameHeightInMbs;

  return UsedBits;
}


/*!
 ************************************************************************
 * \brief
 *    read the reference picture reordering information
 ************************************************************************
 */
static void ref_pic_list_reordering()
{
  Slice *currSlice = img->currentSlice;
  int dP_nr = assignSE2partition[currSlice->dp_mode][SE_HEADER];
  DataPartition *partition = &(currSlice->partArr[dP_nr]);
  Bitstream *currStream = partition->bitstream;
  int i, val;

  alloc_ref_pic_list_reordering_buffer(currSlice);
  
  if (img->type!=I_SLICE && img->type!=SI_SLICE)
  {
    val = currSlice->ref_pic_list_reordering_flag_l0 = u_1 ("SH: ref_pic_list_reordering_flag_l0", currStream);
    
    if (val)
    {
      i=0;
      do
      {
        val = currSlice->remapping_of_pic_nums_idc_l0[i] = ue_v("SH: remapping_of_pic_nums_idc_l0", currStream);
        if (val==0 || val==1)
        {
          currSlice->abs_diff_pic_num_minus1_l0[i] = ue_v("SH: abs_diff_pic_num_minus1_l0", currStream);
        }
        else
        {
          if (val==2)
          {
            currSlice->long_term_pic_idx_l0[i] = ue_v("SH: long_term_pic_idx_l0", currStream);
          }
        }
        i++;
        // assert (i>img->num_ref_idx_l0_active);
      } while (val != 3);
    }
  }

  if (img->type==B_SLICE)
  {
    val = currSlice->ref_pic_list_reordering_flag_l1 = u_1 ("SH: ref_pic_list_reordering_flag_l1", currStream);
    
    if (val)
    {
      i=0;
      do
      {
        val = currSlice->remapping_of_pic_nums_idc_l1[i] = ue_v("SH: remapping_of_pic_nums_idc_l1", currStream);
        if (val==0 || val==1)
        {
          currSlice->abs_diff_pic_num_minus1_l1[i] = ue_v("SH: abs_diff_pic_num_minus1_l1", currStream);
        }
        else
        {
          if (val==2)
          {
            currSlice->long_term_pic_idx_l1[i] = ue_v("SH: long_term_pic_idx_l1", currStream);
          }
        }
        i++;
        // assert (i>img->num_ref_idx_l1_active);
      } while (val != 3);
    }
  }
}

/*!
 ************************************************************************
 * \brief
 *    read the weighted prediction tables
 ************************************************************************
 */
static void pred_weight_table()
{
  Slice *currSlice = img->currentSlice;
  int dP_nr = assignSE2partition[currSlice->dp_mode][SE_HEADER];
  DataPartition *partition = &(currSlice->partArr[dP_nr]);
  Bitstream *currStream = partition->bitstream;
  int luma_weight_flag_l0, luma_weight_flag_l1, chroma_weight_flag_l0, chroma_weight_flag_l1;
  int i,j;

  img->luma_log2_weight_denom = ue_v ("SH: luma_log2_weight_denom", currStream);
  img->wp_round_luma = img->luma_log2_weight_denom ? 1<<(img->luma_log2_weight_denom - 1): 0;
  
  img->chroma_log2_weight_denom = ue_v ("SH: chroma_log2_weight_denom", currStream);
  img->wp_round_chroma = img->chroma_log2_weight_denom ? 1<<(img->chroma_log2_weight_denom - 1): 0;

  reset_wp_params(img);

  for (i=0; i<img->num_ref_idx_l0_active; i++)
  {
    luma_weight_flag_l0 = u_1("SH: luma_weight_flag_l0", currStream);
    
    if (luma_weight_flag_l0)
    {
      img->wp_weight[0][i][0] = se_v ("SH: luma_weight_l0", currStream);
      img->wp_offset[0][i][0] = se_v ("SH: luma_offset_l0", currStream);
    }
    else
    {
      img->wp_weight[0][i][0] = 1<<img->luma_log2_weight_denom;
      img->wp_offset[0][i][0] = 0;
    }
    
    chroma_weight_flag_l0 = u_1 ("SH: chroma_weight_flag_l0", currStream);
    
    for (j=1; j<3; j++)
    {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人精品福利| 777色狠狠一区二区三区| 一本大道av一区二区在线播放| 亚洲精品国产精品乱码不99| av电影一区二区| 日韩中文字幕区一区有砖一区| 国产欧美一区二区三区在线看蜜臀| 精品午夜一区二区三区在线观看| 亚洲人成亚洲人成在线观看图片| 精品粉嫩超白一线天av| 欧美三级日韩三级国产三级| k8久久久一区二区三区| 亚洲少妇最新在线视频| 色综合激情五月| 亚洲高清免费视频| 国产精品国产三级国产专播品爱网| 99精品视频在线免费观看| 日韩美女久久久| 国产欧美一区二区三区网站| 91麻豆精品国产无毒不卡在线观看| 91免费版pro下载短视频| 国产精品一区二区在线播放| 国产精品久久久久久久久动漫| 91首页免费视频| 国产a精品视频| 国产一区高清在线| 国产精品五月天| 欧美网站一区二区| 久久99国产精品久久99| 国产午夜精品久久久久久免费视| 日韩欧美中文一区| 成人欧美一区二区三区白人 | 日韩欧美一级特黄在线播放| 蜜桃免费网站一区二区三区| 亚洲国产经典视频| 国产欧美1区2区3区| 国产色婷婷亚洲99精品小说| 国产午夜精品美女毛片视频| 欧美在线你懂的| 国产高清在线观看免费不卡| 激情文学综合网| 国产精品一区久久久久| 国产成人综合自拍| 成人免费视频播放| 日韩电影在线观看网站| 中文字幕精品—区二区四季| 久久久国产精华| 中文字幕巨乱亚洲| 国产精品久久久久婷婷| 在线观看视频一区二区 | 91免费在线看| 久久国产生活片100| 亚洲欧洲精品成人久久奇米网 | 日本大胆欧美人术艺术动态| 亚洲国产精品二十页| 中文字幕va一区二区三区| 国产精品美女久久久久av爽李琼 | 蓝色福利精品导航| 国产专区综合网| 成人高清伦理免费影院在线观看| 天天综合天天综合色| 亚洲国产成人午夜在线一区| 国产精品视频一二三区| 欧美日韩国产综合草草| 91精品国产手机| 欧美国产精品v| 一区二区不卡在线播放 | 91亚洲国产成人精品一区二三| 欧洲视频一区二区| 日韩欧美电影一区| 欧美探花视频资源| 精品国产人成亚洲区| 亚洲三级在线播放| 久久精品国产一区二区| 亚洲大型综合色站| 伊人色综合久久天天人手人婷| 亚洲五月六月丁香激情| 国内精品伊人久久久久av一坑| av在线播放不卡| 日韩一级片网址| 欧美一区二区视频在线观看2020 | 亚洲精品视频在线观看网站| 久久久久久亚洲综合影院红桃 | 欧美mv日韩mv国产网站app| 国产精品久线观看视频| 国产日韩欧美激情| 午夜在线电影亚洲一区| 一区二区三区在线免费| 极品少妇一区二区三区精品视频 | 在线不卡中文字幕播放| 国产欧美综合在线观看第十页| 久久嫩草精品久久久久| 亚洲第一久久影院| 99精品久久99久久久久| 精品福利av导航| 日韩高清中文字幕一区| 色综合天天综合在线视频| 欧美精品一区二区久久婷婷| 久久人人爽人人爽| 日日噜噜夜夜狠狠视频欧美人 | 不卡av在线免费观看| 日韩久久久久久| 亚洲一区二区三区国产| 成人性视频网站| 99精品欧美一区二区蜜桃免费| 91视频.com| 欧美日韩高清影院| 亚洲麻豆国产自偷在线| 亚洲永久精品国产| 天堂精品中文字幕在线| 色老汉av一区二区三区| 国产视频一区二区三区在线观看| 国产精品天天看| 国产一区二区在线电影| 日韩午夜激情免费电影| 亚洲成人av在线电影| av中文字幕一区| 国产精品久久久久久久久免费丝袜 | 99麻豆久久久国产精品免费优播| 国产精品123| 色8久久人人97超碰香蕉987| 欧美日韩一二区| 亚洲精品视频在线| 蜜桃视频一区二区三区在线观看| 欧美吞精做爰啪啪高潮| 亚洲精品免费一二三区| 婷婷久久综合九色综合绿巨人 | 五月婷婷色综合| 色成年激情久久综合| 亚洲人成网站在线| 91免费国产视频网站| 欧美国产日韩亚洲一区| 国产精品一区二区视频| 99精品在线免费| 1024成人网| 色哟哟日韩精品| 一区二区三区中文免费| 免费观看日韩av| 欧美成人在线直播| 一区二区在线观看视频| 91蜜桃网址入口| 亚洲免费观看高清完整版在线 | 欧美精品一区二区三区蜜臀| 国产尤物一区二区在线| 91免费观看视频在线| 欧美成人欧美edvon| 亚洲欧美日韩成人高清在线一区| 成人av动漫网站| 亚洲最大成人网4388xx| 国产成人午夜电影网| 中文字幕不卡在线播放| 99精品视频在线观看免费| 亚洲自拍偷拍综合| 欧美伦理影视网| 国产老肥熟一区二区三区| 国产精品不卡视频| 欧美性大战久久| 美女视频黄 久久| 国产欧美一区二区精品忘忧草| 成人晚上爱看视频| 一区二区三区四区av| 日韩欧美一区中文| 成人中文字幕电影| 亚洲图片欧美色图| 精品免费国产二区三区| 91在线国产观看| 日韩电影在线观看电影| 欧美色中文字幕| 日韩专区欧美专区| 日本一二三四高清不卡| 欧美午夜精品电影| 韩国成人福利片在线播放| 自拍偷拍亚洲综合| 日韩一区二区不卡| 91热门视频在线观看| 久久狠狠亚洲综合| 亚洲男人都懂的| 久久久久高清精品| 欧美视频在线一区| 成人av在线电影| 中文字幕 久热精品 视频在线| 精品一区二区三区在线观看国产 | 一区二区三区在线免费视频 | 精品区一区二区| 日本电影亚洲天堂一区| 最新欧美精品一区二区三区| 欧美乱妇15p| av一区二区三区四区| 美腿丝袜一区二区三区| 欧美不卡一区二区三区四区| 色综合网色综合| 亚洲一级二级三级在线免费观看| 久久综合九色综合欧美98| 色噜噜夜夜夜综合网| 精品一区二区综合| 亚洲电影第三页| 亚洲欧洲av另类| 久久蜜桃香蕉精品一区二区三区| 欧美色综合久久| 日韩影院免费视频|