Re: [AVTCORE] [payload] Clarifying the H.265 RTP payload format specification's text on when to set the RTP "M" bit

"Wang, Ye-Kui" <yekuiw@qti.qualcomm.com> Sat, 10 August 2013 14:25 UTC

Return-Path: <yekuiw@qti.qualcomm.com>
X-Original-To: avt@ietfa.amsl.com
Delivered-To: avt@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3C43E11E8102; Sat, 10 Aug 2013 07:25:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.598
X-Spam-Level:
X-Spam-Status: No, score=-102.598 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3rVb2xeyizpO; Sat, 10 Aug 2013 07:25:38 -0700 (PDT)
Received: from sabertooth02.qualcomm.com (sabertooth02.qualcomm.com [65.197.215.38]) by ietfa.amsl.com (Postfix) with ESMTP id 5AC3721F9DAA; Sat, 10 Aug 2013 07:16:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1376144207; x=1407680207; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=iCUKa4gDTQFRPQYaGSZMr0Czbf73tZVUzI6EPBnyRBE=; b=N4HFosWf0tisriscPhyLEl3scuHEq78OfzxbZlHqWffzphJg6iHCZxyB 4ft7xCXrl7iJqdCPOtPVreSVDIWwLlF01wqJb2pOudZCr7BD4PjELR2UD nCpYcpqNlRBvn+779ENcc68eyiDM3UdXcwf+fHV7T214P8dpTZ+ei1yzI I=;
X-IronPort-AV: E=Sophos; i="4.89,851,1367996400"; d="scan'208,217"; a="49336497"
Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by sabertooth02.qualcomm.com with ESMTP; 10 Aug 2013 07:16:47 -0700
Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 10 Aug 2013 07:16:46 -0700
Received: from NASANEXD02F.na.qualcomm.com ([169.254.8.21]) by nasanexhc08.na.qualcomm.com ([172.30.39.7]) with mapi id 14.03.0146.002; Sat, 10 Aug 2013 07:16:46 -0700
From: "Wang, Ye-Kui" <yekuiw@qti.qualcomm.com>
To: Ross Finlayson <finlayson@live555.com>, "avt@ietf.org" <avt@ietf.org>, "payload@ietf.org" <payload@ietf.org>
Thread-Topic: [AVTCORE] [payload] Clarifying the H.265 RTP payload format specification's text on when to set the RTP "M" bit
Thread-Index: AQHOldHxrENwOy7dhUOuP7HJFLBE0pmOeOQQ
Date: Sat, 10 Aug 2013 14:16:46 +0000
Message-ID: <8BA7D4CEACFFE04BA2D902BF11719A83384D701C@nasanexd02f.na.qualcomm.com>
References: <C1F36850-2B72-4A98-97B7-8847C9C90CB0@live555.com> <3879D71E758A7E4AA99A35DD8D41D3D91D4C7AA7@xmb-rcd-x14.cisco.com> <A0D9B971-CDE0-4AF7-9A70-C280514AEF10@live555.com> <8BA7D4CEACFFE04BA2D902BF11719A83384D4C47@nasanexd02f.na.qualcomm.com> <5D781561-69CD-4E0D-9377-B4B26036E691@live555.com> <8BA7D4CEACFFE04BA2D902BF11719A83384D5FB3@nasanexd02f.na.qualcomm.com> <69F25DB2-6926-4ACA-935D-90376A2A7BFA@live555.com> <8BA7D4CEACFFE04BA2D902BF11719A83384D690F@nasanexd02f.na.qualcomm.com> <A6FDCB43-F221-4BE0-BEDA-1F1E5394DDEC@live555.com> <3879D71E758A7E4AA99A35DD8D41D3D91D4CC65C@xmb-rcd-x14.cisco.com> <F5C111A5-64A6-48AB-BBA8-8812EE49F7ED@live555.com> <8BA7D4CEACFFE04BA2D902BF11719A83384D6FD4@nasanexd02f.na.qualcomm.com>
In-Reply-To: <8BA7D4CEACFFE04BA2D902BF11719A83384D6FD4@nasanexd02f.na.qualcomm.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [199.106.115.192]
Content-Type: multipart/alternative; boundary="_000_8BA7D4CEACFFE04BA2D902BF11719A83384D701Cnasanexd02fnaqu_"
MIME-Version: 1.0
Subject: Re: [AVTCORE] [payload] Clarifying the H.265 RTP payload format specification's text on when to set the RTP "M" bit
X-BeenThere: avt@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Audio/Video Transport Core Maintenance <avt.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/avt>, <mailto:avt-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/avt>
List-Post: <mailto:avt@ietf.org>
List-Help: <mailto:avt-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/avt>, <mailto:avt-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 10 Aug 2013 14:25:43 -0000

Regardless of the following, I still think that the timestamp approach should be the way to go. A good system should have a clear mapping of each video data unit (NAL unit in the context of H.265 and H.264) to an output timestamp, be it real-time encoding or pre-encoded content. For real-time encoding, the encoder knows what data units are generated for each input raw picture and thus it clearly knows the timestamp for each data unit. A pre-encoded content should have been stored in some kind of video storage format that has timestamp associated with each data unit, e.g. in a file container according to ISO base media file format, MPEG-2 systems, or whatever other file storage format. Trying to generate timestamps from a raw coded video bitstream without timing information for each coded picture based on a guess of frame rate is really just a hack to me, as frame rate can be adaptive, particularly at the beginning of a session in low-delay conversational applications or at locations of scene change or of need of full intra refresh or random accessibility, wherein your rate control algorithm can easily require skipping the encoding of some frames.

BR, YK

From: avt-bounces@ietf.org [mailto:avt-bounces@ietf.org] On Behalf Of Wang, Ye-Kui
Sent: Saturday, August 10, 2013 6:55 AM
To: Ross Finlayson; avt@ietf.org; payload@ietf.org
Subject: Re: [AVTCORE] [payload] Clarifying the H.265 RTP payload format specification's text on when to set the RTP "M" bit

Hi Ross,

You just need one more little step to get everything right here, instead of thinking of compromising the implementation :)

That is, read subclause 7.4.2.4.4 of the HEVC spec. The most relevant paragraphs are copied below for convenience (the first paragraph itself contains the answer to your question, but the second paragraph may also provide helpful information):

The first of any of the following NAL units after the last VCL NAL unit of a coded picture specifies the start of a new access unit:
-     access unit delimiter NAL unit (when present),
-     VPS NAL unit (when present),
-     SPS NAL unit (when present),
-     PPS NAL unit (when present),
-     Prefix SEI NAL unit (when present),
-     NAL units with nal_unit_type in the range of RSV_NVCL41..RSV_NVCL44 (when present),
-     NAL units with nal_unit_type in the range of UNSPEC48..UNSPEC55 (when present),
-     first VCL NAL unit of a coded picture (always present).

The order of the coded pictures and non-VCL NAL units within an access unit shall obey the following constraints:
-     When an access unit delimiter NAL unit is present, it shall be the first NAL unit. There shall be at most one access unit delimiter NAL unit in any access unit.
-     When any prefix SEI NAL units are present, they shall not follow the last VCL NAL unit of the access unit.
-     NAL units having nal_unit_type equal to FD_NUT or SUFFIX_SEI_NUT, or in the range of RSV_NVCL45..RSV_NVCL47 or UNSPEC56..UNSPEC63 shall not precede the first VCL NAL unit of the coded picture.
-     When an end of sequence NAL unit is present, it shall be the last NAL unit in the access unit other than an end of bitstream NAL unit (when present).
-     When an end of bitstream NAL unit is present, it shall be the last NAL unit in the access unit.

NOTE - VPS NAL units, SPS NAL units, PPS NAL units, prefix SEI NAL units, or NAL units with nal_unit_type in the range of RSV_NVCL41..RSV_NVCL44 or UNSPEC48..UNSPEC55, may be present in an access unit, but cannot follow the last VCL NAL unit of the coded picture within the access unit, as this condition would specify the start of a new access unit.

BR, YK

From: avt-bounces@ietf.org<mailto:avt-bounces@ietf.org> [mailto:avt-bounces@ietf.org] On Behalf Of Ross Finlayson
Sent: Friday, August 09, 2013 9:50 PM
To: avt@ietf.org<mailto:avt@ietf.org>; payload@ietf.org<mailto:payload@ietf.org>
Subject: Re: [AVTCORE] [payload] Clarifying the H.265 RTP payload format specification's text on when to set the RTP "M" bit

If you are able to set the RTP timestamp reliably, then you must already have some sort of frame boundary identification.

Yes, we have a reliable way of determining when *VCL* NAL units cross a frame boundary: Look at the first slice header bit.  The one remaining problem (that I identified at the end of my last message) is: How to classify any *non-VCL* NAL units that appear between one VCL NAL unit and another VCL unit that has the first slice header bit.  Which of these belong to the last frame, and which belong to the next frame.

But perhaps this doesn't really matter?  Perhaps it's OK (from the point of view of receivers that check and try to optimize for the 'M' bit) if we always set the 'M' bit for the last VCL NAL unit of a frame, even if some subsequent non-VCL NAL units (appearing before the first VCL NAL unit of the next frame) also belong logically to the current frame??


But you should realize that, in doing this, you have defeated the marker bit optimization. You have just shifted the latency from the receiver to the sender

No, not necessarily.  If the encoded video comes from a file (i.e., pre-recorded), then the latency involved in requiring the sender to examine the 'next' frame will usually be negligible.  But in any case, the situation we're talking about here (senders working from a sequence of pre-encoded NAL units) is one that usually occurs only in non-interactive environments, for which latency isn't crucial.


So there is not much benefit in making the marker bit reliable in this case, and there is even the risk that it will add unnecessary latency.

That's certainly another possibility, I suppose: Recommend that if a sending implementation cannot determine whether or not a NAL unit ends an 'access unit' (frame) without having to scan subsequent NAL units, then it should not set the 'M' bit at all.  I don't like this, though (especially because it adds receiver latency without necessarily reducing sender latency (note above)).  But it's a possibility to consider...
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/