]> git.sesse.net Git - nageru/blobdiff - h264encode.cpp
Fix a bunch of colorspace issues, after practical testing. There is still some left...
[nageru] / h264encode.cpp
index 55ed9a18caa362264e836f161645e8cfad33c601..d63fe896e5efebfaf717e368226fca20c7a5c6c5 100644 (file)
@@ -340,7 +340,17 @@ static void sps_rbsp(bitstream *bs)
         bitstream_put_ui(bs, 1, 1); /* vui_parameters_present_flag */
         bitstream_put_ui(bs, 0, 1); /* aspect_ratio_info_present_flag */
         bitstream_put_ui(bs, 0, 1); /* overscan_info_present_flag */
-        bitstream_put_ui(bs, 0, 1); /* video_signal_type_present_flag */
+        bitstream_put_ui(bs, 1, 1); /* video_signal_type_present_flag */
+        {
+            bitstream_put_ui(bs, 5, 3);  /* video_format (5 = Unspecified) */
+            bitstream_put_ui(bs, 0, 1);  /* video_full_range_flag */
+            bitstream_put_ui(bs, 1, 1);  /* colour_description_present_flag */
+            {
+                bitstream_put_ui(bs, 1, 8);  /* colour_primaries (1 = BT.709) */
+                bitstream_put_ui(bs, 1, 8);  /* transfer_characteristics (1 = BT.709) */
+                bitstream_put_ui(bs, 1, 8);  /* matrix_coefficients (1 = BT.709) */
+            }
+        }
         bitstream_put_ui(bs, 0, 1); /* chroma_loc_info_present_flag */
         bitstream_put_ui(bs, 1, 1); /* timing_info_present_flag */
         {