Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 4, 2025

Plan for VP8 Dual-Octet Picture ID Implementation

Based on PR #4515, I have applied the following minimal changes:

  • Add picture_id field to pjmedia_vpx_packetizer struct in vpx_packetizer.c
  • Update payload descriptor size from 1 to 4 bytes for VP8 in vpx_packetizer.c
  • Set X bit (0x80) to indicate extended control bits present for VP8
  • Set S bit when starting a new partition and increment picture_id
  • Set Extended Control Bits ILTK (I bit: 0x80)
  • Add dual-octet picture_id to payload descriptor
  • Update payload_desc_size in vpx.c for VP8 codec
  • Build and test the changes to ensure no regressions
  • Address review comments: Update references to Add dual-octet vp8 pictureId to vp8 payload descriptor #4659 and fix formatting

Reference: #4659 (formerly #4515)

Changes Made:

  1. vpx_packetizer.c:

    • Added unsigned int picture_id field to pjmedia_vpx_packetizer struct
    • Changed payload_desc_size to conditionally use 4 bytes for VP8 and 1 byte for VP9
    • Set X bit (0x80) to indicate extended control bits
    • Set S bit and increment picture_id when starting new partition
    • Set I bit in Extended Control Bits (0x80)
    • Added dual-octet picture ID encoding with M bit set
    • Fixed comment from H.264 to vpx
  2. vpx.c:

    • Updated payload_desc_size to be 4 for VP8 and 1 for VP9

Review Comments Addressed:

Validation Results:

The implementation follows RFC 7741 section 4.2 for the dual-octet PictureID format.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add dual-octet vp8 pictureId to vp8 payload descriptor</issue_title>
<issue_description>### Describe the feature

This feature modifies the vp8 packetization method to add the dual-octet picture id to the payload descriptor header. In our usage of vp8, certain systems required this to correctly decode our vp8 media.

Summary of changes:

  • We added a picture_id field to the pjmedia_vpx_packetizer struct.
  • We increased the size of the vp8 payload descriptor to 4 bytes.
  • We increment the picture_id when the S-bit is present
  • We set the ILTK Extended Control Bits
  • We added the picture id to the two pictureID octets

See https://datatracker.ietf.org/doc/rfc7741/

4.2.  VP8 Payload Descriptor

   The first octets after the RTP header are the VP8 payload descriptor,
   with the following structure.  The single-octet version of the
   PictureID is illustrated to the left (M bit set to 0), while the
   dual-octet version (M bit set to 1) is shown to the right.

         0 1 2 3 4 5 6 7                      0 1 2 3 4 5 6 7
        +-+-+-+-+-+-+-+-+                   +-+-+-+-+-+-+-+-+
        |X|R|N|S|R| PID | (REQUIRED)        |X|R|N|S|R| PID | (REQUIRED)
        +-+-+-+-+-+-+-+-+                   +-+-+-+-+-+-+-+-+
   X:   |I|L|T|K| RSV   | (OPTIONAL)   X:   |I|L|T|K| RSV   | (OPTIONAL)
        +-+-+-+-+-+-+-+-+                   +-+-+-+-+-+-+-+-+
   I:   |M| PictureID   | (OPTIONAL)   I:   |M| PictureID   | (OPTIONAL)
        +-+-+-+-+-+-+-+-+                   +-+-+-+-+-+-+-+-+
   L:   |   TL0PICIDX   | (OPTIONAL)        |   PictureID   |
        +-+-+-+-+-+-+-+-+                   +-+-+-+-+-+-+-+-+
   T/K: |TID|Y| KEYIDX  | (OPTIONAL)   L:   |   TL0PICIDX   | (OPTIONAL)
        +-+-+-+-+-+-+-+-+                   +-+-+-+-+-+-+-+-+
                                       T/K: |TID|Y| KEYIDX  | (OPTIONAL)
                                            +-+-+-+-+-+-+-+-+

The structure modified is shown in the right-hand bit diagram above.

Caveats and limitations

  • We did not implmenet the single-octet picture_id format

Contributors:

Zurab Tutberidze (optime.dev)
Tornike Kutchukhidze (optime.dev)
Sergii Lovygin (Trembit)
Jonathan Knowles (Equiti Health)

Describe alternatives you've considered

No response

Additional context

No response</issue_description>

<agent_instructions>Use the patch in #4515.
You must NOT make any modifications other than the reference to the PR number.
</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add dual-octet vp8 pictureId to payload descriptor Add dual-octet VP8 picture ID to payload descriptor Nov 4, 2025
Copilot finished work on behalf of sauwming November 4, 2025 03:22
Copilot AI requested a review from sauwming November 4, 2025 03:22
Copilot AI requested a review from sauwming November 4, 2025 05:13
Copilot finished work on behalf of sauwming November 4, 2025 05:13
@sauwming sauwming marked this pull request as ready for review November 4, 2025 05:27
@sauwming sauwming requested a review from nanangizz November 4, 2025 07:12
@sauwming sauwming added this to the release-2.16 milestone Nov 4, 2025
@sauwming sauwming merged commit 40470cf into master Nov 11, 2025
87 of 88 checks passed
@sauwming sauwming deleted the copilot/add-dual-octet-picture-id branch November 11, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dual-octet vp8 pictureId to vp8 payload descriptor

3 participants