diff --git a/README.md b/README.md index 3737e04..06891de 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,9 @@ This module parses the H.264/AVC syntax needed by Vulkan Video applications: NAL headers, sequence and picture parameter sets (SPS/PPS), video usability -information (VUI), and slice headers. +information (VUI) and slice headers. -It is **not** a video decoder: it does not perform entropy decoding, motion -compensation, inverse transforms, or produce pixels. The +It is **not** a video decoder: it does not perform entropy decoding, motion compensation or inverse transforms, and it does not produce pixels. The [`v_vulkan_video`](https://github.com/antono2/v_vulkan_video) player uses these parsed structures to prepare hardware decode operations. @@ -39,7 +38,7 @@ assert header.type == .sps `Bitstream.init()` expects raw RBSP/NAL bytes in memory. Container extraction, length prefixes or Annex-B start codes, emulation-prevention removal, frame -reordering, and decoded-picture management remain the caller's responsibility. +reordering and decoded-picture management remain the caller's responsibility. ## Parsing order and caller responsibilities @@ -64,7 +63,7 @@ bytes available and unchanged while parsing, and give concurrent parses separate cursors and output structures. Parameter-set readers consume trailing RBSP bits; the slice-header reader leaves the remaining coded slice data for the decoder. Returned fields retain their H.264 syntax encodings rather than -being normalized into dimensions, frame rates, or decoder operations. +being normalized into dimensions, frame rates or decoder operations. ## Safety and supported scope @@ -75,7 +74,7 @@ boundaries before parsing them. The implementation covers the syntax exercised by the Vulkan Video H.264 player and is not yet a claim of complete support for every profile, extension, -bit depth, chroma format, or interlaced stream. +bit depth, chroma format or interlaced stream. ## Tests @@ -91,9 +90,9 @@ v -cc msvc test . ``` They cover fixed-width and Exp-Golomb bit reading, truncated input behavior, -NAL headers, RBSP look-ahead, integer bit widths, and representative +NAL headers, RBSP look-ahead, integer bit widths and representative High-profile SPS/PPS parsing used by the player. HRD buffering syntax tests cover -one, two, and the maximum 32 CPB entries, including alignment of the following +one, two and the maximum 32 CPB entries, including alignment of the following delay fields. Counts beyond 32 entries are rejected by an assertion. CI also runs strict V3 with TinyCC on Linux, using a pinned compiler snapshot. diff --git a/h264.v b/h264.v index ff44f33..053e28b 100644 --- a/h264.v +++ b/h264.v @@ -1,6 +1,6 @@ module h264 -// Parses H.264 NAL headers, parameter sets, and slice metadata for decoder setup. +// Parses H.264 NAL headers, parameter sets and slice metadata for decoder setup. // Callers supply bounded, unescaped NAL/RBSP bytes and manage decoded pictures; // this module neither extracts container data nor decodes pixels. // Syntax reference: Rec. ITU-T H.264 (08/2021). @@ -440,7 +440,7 @@ pub fn (mut b Bitstream) read_rbsp_trailing_bits() { } } -// read_vui_parameters consumes optional display, timing, and buffering syntax. +// read_vui_parameters consumes optional display, timing and buffering syntax. // Normally called by read_sps when the VUI presence flag is set. pub fn (mut sps SequenceParameterSet) read_vui_parameters(mut b Bitstream) { sps.vui.aspect_ratio_info_present_flag = b.u1() diff --git a/h264_test.v b/h264_test.v index 762a85c..34d2e8c 100644 --- a/h264_test.v +++ b/h264_test.v @@ -1,4 +1,4 @@ -// Exercises bit reads, NAL headers, and parameter-set parsing without a decoder or GPU. +// Exercises bit reads, NAL headers and parameter-set parsing without a decoder or GPU. // Includes scaling-list regressions and checks for EOF and cursor-preserving look-ahead. module h264 diff --git a/hrd_test.v b/hrd_test.v index 15feb7f..9491b88 100644 --- a/hrd_test.v +++ b/hrd_test.v @@ -5,7 +5,7 @@ import encoding.hex fn test_hrd_reads_all_cpb_entries() { // H.264 E.1.2 encodes count minus one. Fixtures contain 1, 2 and 32 CPBs, - // distinct entry values, four delay widths, and an 0xa5 cursor sentinel. + // distinct entry values, four delay widths and an 0xa5 cursor sentinel. for count, encoded in { 1: '9a30208a63a294' 2: '468c08220102531d14a0'