[x265] [PATCH] vps: vps_timing_info is always present

deepthi at multicorewareinc.com deepthi at multicorewareinc.com
Tue Sep 9 10:51:07 CEST 2014


# HG changeset patch
# User Deepthi Nandakumar <deepthi at multicorewareinc.com>
# Date 1410252483 -19800
#      Tue Sep 09 14:18:03 2014 +0530
# Node ID d99e907272bf16c4b59ca020e97fe44586762d45
# Parent  44cb33846e0ed693966cb15c1e86a702647cfa4a
vps: vps_timing_info is always present

diff -r 44cb33846e0e -r d99e907272bf source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Tue Sep 09 10:39:52 2014 +0530
+++ b/source/encoder/encoder.cpp	Tue Sep 09 14:18:03 2014 +0530
@@ -1030,7 +1030,7 @@
 
     /* headers for start of bitstream */
     bs.resetBits();
-    sbacCoder.codeVPS(&m_vps);
+    sbacCoder.codeVPS(&m_vps, &m_sps.vuiParameters.timingInfo);
     bs.writeByteAlignment();
     list.serialize(NAL_UNIT_VPS, bs);
 
diff -r 44cb33846e0e -r d99e907272bf source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Tue Sep 09 10:39:52 2014 +0530
+++ b/source/encoder/entropy.cpp	Tue Sep 09 14:18:03 2014 +0530
@@ -39,7 +39,7 @@
     X265_CHECK(sizeof(m_contextState) >= sizeof(m_contextState[0]) * MAX_OFF_CTX_MOD, "context state table is too small\n");
 }
 
-void Entropy::codeVPS(VPS* vps)
+void Entropy::codeVPS(VPS* vps, TimingInfo* timingInfo)
 {
     WRITE_CODE(0,       4, "vps_video_parameter_set_id");
     WRITE_CODE(3,       2, "vps_reserved_three_2bits");
@@ -53,11 +53,18 @@
     WRITE_FLAG(true, "vps_sub_layer_ordering_info_present_flag");
     WRITE_UVLC(vps->maxDecPicBuffering - 1, "vps_max_dec_pic_buffering_minus1[i]");
     WRITE_UVLC(vps->numReorderPics,         "vps_num_reorder_pics[i]");
-
     WRITE_UVLC(0,    "vps_max_latency_increase_plus1[i]");
+    
     WRITE_CODE(0, 6, "vps_max_nuh_reserved_zero_layer_id");
     WRITE_UVLC(0,    "vps_max_op_sets_minus1");
-    WRITE_FLAG(0,    "vps_timing_info_present_flag"); /* we signal timing info in SPS-VUI */
+    
+    WRITE_FLAG(1,    "vps_timing_info_present_flag");
+    WRITE_CODE(timingInfo->numUnitsInTick, 32, "vps_num_units_in_tick");
+    WRITE_CODE(timingInfo->timeScale, 32, "vps_time_scale");
+    WRITE_FLAG(0, "vps_poc_proportional_to_timing_flag");
+    /* Only timing info is written into VPS, HRD parameters are signalled in the VUI */
+    WRITE_UVLC(0, "vps_num_hrd_parameters");
+    
     WRITE_FLAG(0,    "vps_extension_flag");
 }
 
diff -r 44cb33846e0e -r d99e907272bf source/encoder/entropy.h
--- a/source/encoder/entropy.h	Tue Sep 09 10:39:52 2014 +0530
+++ b/source/encoder/entropy.h	Tue Sep 09 14:18:03 2014 +0530
@@ -136,7 +136,7 @@
     void loadContexts(Entropy& src)    { copyContextsFrom(src); }
     void copyState(Entropy& other);
 
-    void codeVPS(VPS* vps);
+    void codeVPS(VPS* vps, TimingInfo* timingInfo);
     void codeSPS(SPS* sps, ScalingList *scalingList, ProfileTierLevel *ptl);
     void codePPS(PPS* pps);
     void codeVUI(VUI* vui);


More information about the x265-devel mailing list