x264 struct 學習

x264_t結構體維護著CODEC的諸多重要信息

?

其中成員frames是一個指示和控制幀編碼過程的結構。其中current是已經準備就緒可以編碼的幀,其類型已經確定;next是尚未確定類型的幀;unused用于回收不使用的frame結構體以備今后再次使用。

structx264_t?????????????????????????????????

{

???

???unsigned int??cpu;

???

???struct

???{

???????int????????i_nal;????????//定義一個網絡提取層//

???????x264_nal_t?nal[3];????????

???????int????????i_bitstream;???

???????uint8_t????*p_bitstream;??

???????bs_t???????bs;

???} out;

???

???x264_param_t???param;

???

???int????????????i_frame;???????????//一個指示和控制幀編碼過程的結構

???int????????????i_poc;

???int????????????i_frame_offset;

???int????????????i_frame_num;???

???int????????????i_poc_msb;?????

???int????????????i_poc_lsb;?????

???

???x264_sps_t?????sps_array[32];

???x264_sps_t?????*sps;

???x264_pps_t?????pps_array[256];

???x264_pps_t?????*pps;

???int????????????i_idr_pic_id;

???

???x264_slice_header_t sh;
???

???x264_cabac_t???cabac;

???

???x264_picture_t? *picture;

???

???x264_frame_t???*bframe_current[X264_BFRAME_MAX];

???x264_frame_t???*frame_next[X264_BFRAME_MAX+1];??這個是定義下一個幀,但不一定是B幀

???x264_frame_t???*frame_unused[X264_BFRAME_MAX+1];

???

???x264_frame_t???*fdec;

???

???struct

???{

???????DECLARE_ALIGNED( int, luma16×16_dc[16], 16 );

???????DECLARE_ALIGNED( int, chroma_dc[2][4], 16 );//色度

???????struct

???????{

???????????DECLARE_ALIGNED( int, residual_ac[15], 16 );

???????????DECLARE_ALIGNED( int, luma4×4[16], 16 );

???????} block[16+8];16*8的宏快的取用情況

???} dct;離散余弦變換

???

???struct

???{

???????

???????int????i_mb_stride;

?

???????

???????int????i_mb_x;

???????int????i_mb_y;

???????int????i_mb_xy;

???????unsigned int i_neighbour;

???????

???????int8_t?*type;?????????????????????

???????int8_t?*qp;???????????????????????

???????int16_t*cbp;??????????????????????

???????int8_t?(*intra4×4_pred_mode)[7];??

???????uint8_t (*non_zero_count)[16+4+4];?

???????int8_t?*chroma_pred_mode;?????????

???????int16_t(*mv[2])[2];???????????????

???????int16_t(*mvd[2])[2];??????????????

???????int8_t??*ref[2];??????????????????

???????

???????int????i_type;

???????int???i_partition;

???????int????i_sub_partition[4];

???????int????i_cbp_luma;

???????int????i_cbp_chroma;

???????int????i_intra16×16_pred_mode;

???????int????i_chroma_pred_mode;

???????struct

???????{

???????????

???????????uint8_t *p_img[3];

???????????int?????i_img[3];

?

???????????

???????????uint8_t *p_fdec[3];

???????????uint8_t*p_fref[2][16][3];

???????????int????i_fdec[3];

???????} pic;

???????

???????struct

???????{

???????????

???????????int????intra4×4_pred_mode[X264_SCAN8_SIZE];色度預測模式

???????????

???????????int????non_zero_count[X264_SCAN8_SIZE];

???????????

???????????int8_t ref[2][X264_SCAN8_SIZE];

???????????

???????????int16_t mv[2][X264_SCAN8_SIZE][2];

???????????int16_t mvd[2][X264_SCAN8_SIZE][2];運動矢量與真實值之間的差

???????} cache;

???????

???????int????i_last_qp;

???????int????i_last_dqp;

?
???} mb;宏快的預測以及運動補償和運動估計

???

???x264_frame_t?????*freference[16+1];?

???int??????????????i_ref0; 參考幀列表一(定義為lsit0意為向前預測編碼)

???x264_frame_t?????*fref0[16];??????

???int??????????????i_ref1;參考幀列表二(定義為lsit1意為向后預測編碼)

???x264_frame_t?????*fref1[16];??????

???

???x264_ratecontrol_t *rc;

???

???struct

???{

???????

???????int??i_slice_count[5];

???????int??i_slice_size[5];

???????float f_psnr_y[5];

???????float f_psnr_u[5];

???????float f_psnr_v[5];

???????int??i_mb_count[5][18];

???} stat;聲明每一片的參數變量

???

???x264_predict_t?????predict_16×16[4+3];

???x264_predict_t?????predict_8×8[4+3];

???x264_predict_t?????predict_4×4[9+3];

???x264_pixel_function_t pixf;

???x264_mc_function_t???mc[2];

???x264_dct_function_t??dctf;

???

???x264_vlc_table_t *x264_coeff_token_lookup[5];

???x264_vlc_table_t *x264_level_prefix_lookup;

???x264_vlc_table_t *x264_total_zeros_lookup[15];

???x264_vlc_table_t *x264_total_zeros_dc_lookup[3];

???x264_vlc_table_t *x264_run_before_lookup[7];

};

#endif

給出編碼過程中的各個參數的初始化

x264_param_t

typedef struct

{

???

???unsigned int cpu;

???

???int????????i_width;

???int????????i_height;

???struct

???{

???????

???????int????????i_sar_height;

???????int????????i_sar_width;

???} vui;?

???float??????f_fps;

???

???int????????i_frame_reference;?

???int????????i_idrframe;

???int????????i_iframe;??

???int????????i_bframe;??

???int????????b_deblocking_filter;

???int????????b_cabac;

???int????????i_cabac_init_idc;給出熵編碼初始化時表格的選擇

???int????????i_qp_constant;?

???int????????i_bitrate;?????

???

???struct

???{

???????unsigned intintra;???

???????unsigned intinter;???

???} analyse;

?

}
x264_param_t給出編碼過程中的各個參數的初始化

?

sps序列參數集

typedef struct

{

???int i_id;
?
???int i_profile_idc;指明所用profile

???int i_level_idc; 指明所用level

????int b_constraint_set0;

???int b_constraint_set1;

???int b_constraint_set2; 當他們值等于1時,表示必須遵守某些制約條件

???int i_log2_max_frame_num;表示圖像解碼順序的最大取值
?
???inti_poc_type;???

???inti_log2_max_poc_lsb;???

???intb_delta_pic_order_always_zero;其值等于一時句法元素delta_pic_order_cnt[0]和delta_pic_order_cnt[1]不再片頭出現,且他們的默認值都為0。為0時上述則出現。

???int i_offset_for_non_ref_pic;用來計算非參考幀或場的picture order count,其值應在[-2e31,2e31-1]

???int i_offset_for_top_to_bottom_field; 用來計算幀的底場的picture order count其值應在[-2e31,2e31-1]

???int i_num_ref_frames_in_poc_cycle;用來解碼picture order count取值應在[0,255]之間

???int i_offset_for_ref_frame[256]; 當picture order counttype=1時用來解碼poc,這句語法對循環num_ref_frames_in_poc_cycle中的每一個元素指定了一個偏移
?
???int i_num_ref_frames;指定參考幀隊列的最大長度 h264規定最多可為16個參考幀

???int b_gaps_in_frame_num_value_allowed;值為1時表示允許句法frame_num可以不連續

???int i_mb_width;

???int i_mb_height;

???int b_frame_mbs_only;

???int b_mb_adaptive_frame_field;

???int b_direct8×8_inference;指明b片的直接和skip模式下運動矢量的預測方法
???
???int b_crop;

???struct

???{

???????int i_left;

???????int i_right;

???????int i_top;

???????int i_bottom;

???} crop;圖像剪彩后輸出的參數

?

???int b_vui;

???struct

???{

???????int i_sar_width;

???????int i_sar_height;

???????

???} vui;

?

}
x264_sps_t定義序列參考隊列的參數以及初始化

?

pps圖像參數集

typedef struct

{

???int i_id;

???int i_sps_id;

???int b_cabac;

???int b_pic_order;

???int i_num_slice_groups; 加一表示圖像中片組的個數

?

??
inti_slice_group_map_type;片組分割類型???

???int i_run_length[256];?指明片組類型為2時每個片組連續的map_units的個數???

???

???inti_top_left[256];???????

???inti_bottom_right[256];???

???

???int b_slice_group_change_direction; 當類型為345時與下句語法一起指明片組分割方法

???inti_slice_group_change_rate;???

???int i_pic_size_in_map_units;類型為6時指明圖像以map_units為單位的大小
???
???int i_slice_group_id[256];?指明map_units屬于哪個片組

???int i_num_ref_idx_l0_active;加1為參考幀隊列的長度 此為list0

???int i_num_ref_idx_l1_active;此為list1

???int b_weighted_pred;用以指明是否允許P和SP片的加權預測
???
???int b_weighted_bipred; 用以指明是否允許B片的加權預測

????int i_pic_init_qp;加26后用以指明亮度分量的量化參數的初始值

???int i_pic_init_qs;同上只是用于SP和SI

???int i_chroma_qp_index_offset;指明計算使用時用到的參數

???int b_deblocking_filter_control;

???int b_constrained_intra_pred;控制PB幀的幀內編碼

???int b_redundant_pic_cnt;是否出現redundant_pic_cnt句法元素

} x264_pps_t

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/254681.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/254681.shtml
英文地址,請注明出處:http://en.pswp.cn/news/254681.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

單例模式的新實現

單例模式的新實現 jdk1.5 之前 單例模式的兩種方式,兩種方法都是要把構造器保持私有的,并導出公有的靜態成員,以便允許客戶端能夠訪問該類的唯一實例。 第一種方法中,公有的靜態成員是個final域: //Singleton with public final f…

有關莫比烏斯反演

對于兩個定義域為整數的函數F(x)和f(x); 若有: 然后F(x)可以快速求出; 如何用F求解f呢? 莫比烏斯反演: 對于兩個定義域為整數的函數F(x)和f(x); 若有: 則有: 其中μ(x)為莫比烏斯函數,其定義為: 對于&#…

(原創)JS點擊事件——Uncaught TypeError: Cannot set property 'onclick' of null

html部分代碼&#xff1a; JS部分代碼&#xff1a; 需要實現的效果&#xff1a;點擊圖片&#xff0c;來回相互切換。 我開始的錯誤做法&#xff1a;代碼如上圖所示&#xff08;邏輯上看起來是沒有錯誤的&#xff09; 嘗試過程&#xff1a;把JS代碼放在</body>閉合標簽之前…

事務傳播機制/數據庫異常解析——2016-8-13分享總結

一. 事務的傳播機制&#xff0f;required 跟 required new 的使用與區別 基礎回顧 1.1 事務的隔離級別&#xff1a; ISOLATION_READ_UNCOMMITTED&#xff08;讀未提交&#xff09; ISOLATION_READ_COMMITTED&#xff08;讀已提交&#xff09; ISOLATION_REPEATABLE_READ&#x…

console類詳細解釋

console類詳細解釋 微軟鏈接https://docs.microsoft.com/zh-cn/dotnet/api/system.console?viewnetframework-4.8 C#中沒有標準輸入輸出關鍵字&#xff0c;要調用console類下的方法。 練習與解釋代碼 using System; using System.Collections.Generic; using System.Linq; …

VC下調用x264進行視頻編碼,

4.X264.c中,h x264_encoder_open( param ) )是用來復制參數并驗證參數的有效性,在CCS下應該是不需要驗證參數的(參數都是在程序中設置好的),因此此處只作復制參數param和初始化X264_T h的操作.(VC下程序修改記錄080106下午)修改COMMON.C中的void x264_param_default( x264_…

UploadRTOS.exe

UploadRTOS.exe類似于一個啟動并為VxWin運行做準備的工具程序。VxWin安裝之后&#xff0c;可以使用 上傳工具程序 啟動實時操作系統。 利用命令行參數,您可以使它執行不同的功能。該 上傳工具程序 包含兩個文件: UploadRTOS.exe (命令行程序) UploadR…

20155307 2016-2017 《Java程序設計》第三次實驗報告

&#xff08;一&#xff09;敏捷開發與XP 敏捷開發是一種以人為核心、迭代、循序漸進的開發方法。“敏捷流程”是一系列價值觀和方法論的集合。從2001年開始&#xff0c;一些軟件界的專家開始倡導“敏捷”的價值觀和流程&#xff0c;他們肯定了流行做法的價值&#xff0c;但是強…

ElasticSearch創建、修改、獲取、刪除、索引Indice mapping和Index Template案例

為什么80%的碼農都做不了架構師&#xff1f;>>> The best elasticsearch highlevel java rest api-----bboss ElasticSearch客戶端框架bboss的ClientInterface 接口提供了創建/修改、獲取、刪除索引Indice和IndexTemplate的方法&#xff0c;本文舉例說明其使用方法…

ASCII碼與string的相互轉換

ASCII碼與string的相互轉換 思路&#xff1a; 1&#xff09;ASCII碼轉string&#xff1a;把字符&#xff08;串&#xff09;直接轉換為int類型&#xff0c;即可得到ASCII碼&#xff1b; 2&#xff09;string轉ASCII碼&#xff1a;將數字轉換為字符串轉出&#xff1b; {//將字…

X264代碼中一些參數的意義

Main&#xff08;int argc&#xff0c;char *argv[]&#xff09;; 為了方便起見&#xff0c;不妨改寫為&#xff1a; Main(void){ ...... intargc5; char*argv[]{ "main","-o","test.264","foreman.yuv","352x288" }; …

spring mvc注解@RequestMapping

1、url路徑映射 基本功能 2、窄化請求映射 根路徑子路徑 注意setViewName的路徑。 3、限制http請求方法 get和 post 如果是get 轉載于:https://www.cnblogs.com/jway1101/p/5773923.html

Start application automatically during controller boot-up

&#xfeff;&#xfeff; Tip English ?German Start application automatically during controller boot-up Description It is possible to start any program automatically during the boot-up procedure of the KR C4 controller. Precondition ?User group “Exper…

C#using static

平常用法&#xff1a; using 命名空間&#xff1b; using System; Console.WriteLine("Hello&#xff0c;World&#xff01;");using static用法&#xff1a; C#6中支持這種寫法&#xff0c;這樣定義后可以可以訪問類的靜態成員 WriteLine是Console類的靜態函數&am…

redis數據遷移

一&#xff1a;AOF方式 需求&#xff1a; 一個沒有數據的redis。 清空redis數據方法 bash> echo "keys *" | redis-cli --raw -p 6378 |sed -r s/(.*)/redis-cli --raw -p 6378 del \1 /g |bash 1.備份 bash> redis-cli --raw -p 6378 redis> config get di…

阿里云OSS 上傳文件SDK

Aliyun OSS SDK for C# 上傳文件 另外&#xff1a;查找的其他實現C#上傳文件功能例子&#xff1a; 1、WPF用流的方式上傳/顯示/下載圖片文件(保存在數據庫) &#xff08;文末有案例下載鏈接&#xff09; 2、WPF中利用WebClient向服務器上傳文件 3、C#文件上傳的簡單實現 4、C#實…

關于level_idc和Profile_IDC的解釋

2010-01-21 15:51:40| 分類&#xff1a; windows mobile開 |字號 訂閱 Description: Set bitstream Profile IDC. Default is 88. Note: Some profiles cannot support certain features. See MPEG-4 AVC for supported features for each profile. Reference software may…

老婆的駕照要下來了,形容下我此刻的心情

&#xfeff;&#xfeff; 老婆的駕照要下來了&#xff0c;形容下我此刻的心情&#xff1a; 路上遇到的女人&#xff0c;大部分是不用眼睛和腦子開車的&#xff0c;完全是憑自己的感覺開車。凡是看到前車奇慢、路口猶豫不決、不打燈緩慢變線、不該…

ADO.NET改進防注入

static void Main1(string[] args) { //用戶輸入一個需要查詢的條件 car表 Console.WriteLine("請輸入"); string code Console.ReadLine(); SqlConnection conn new SqlConnection("server.;databasemydb;usersa;pwd100867"); SqlCommand cmd conn.Crea…

poj 2139

Floyd-Warshall模板題&#xff0c;我才剛學最短路。。。。 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; const int maxn30050; int d[maxn][maxn]; int v,m,n; int a[maxn]; const int inf0…