Re: [codec] requirements #8 (new): Sample rates?

Gregory Maxwell <gmaxwell@juniper.net> Thu, 27 January 2011 18:27 UTC

Return-Path: <gmaxwell@juniper.net>
X-Original-To: codec@core3.amsl.com
Delivered-To: codec@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id BC5DE3A67BD for <codec@core3.amsl.com>; Thu, 27 Jan 2011 10:27:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.496
X-Spam-Level:
X-Spam-Status: No, score=-6.496 tagged_above=-999 required=5 tests=[AWL=0.103, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id inZ-mc3iAV-D for <codec@core3.amsl.com>; Thu, 27 Jan 2011 10:27:32 -0800 (PST)
Received: from exprod7og120.obsmtp.com (exprod7og120.obsmtp.com [64.18.2.18]) by core3.amsl.com (Postfix) with ESMTP id C4C283A65A5 for <codec@ietf.org>; Thu, 27 Jan 2011 10:27:32 -0800 (PST)
Received: from source ([66.129.224.36]) (using TLSv1) by exprod7ob120.postini.com ([64.18.6.12]) with SMTP ID DSNKTUG5ySUzyDb/144+Igr/zzVWal1iS9K4@postini.com; Thu, 27 Jan 2011 10:30:37 PST
Received: from EMBX01-HQ.jnpr.net ([fe80::c821:7c81:f21f:8bc7]) by P-EMHUB02-HQ.jnpr.net ([fe80::88f9:77fd:dfc:4d51%11]) with mapi; Thu, 27 Jan 2011 10:23:00 -0800
From: Gregory Maxwell <gmaxwell@juniper.net>
To: Butrus Damaskus <butrus.butrus@gmail.com>, "Pochol@webfootgames.com" <Pochol@webfootgames.com>
Date: Thu, 27 Jan 2011 10:21:06 -0800
Thread-Topic: [codec] requirements #8 (new): Sample rates?
Thread-Index: Acu+O6xOBW/LehO+QNGn+yYjaaqUQwAESTbV
Message-ID: <BCB3F026FAC4C145A4A3330806FEFDA93B963FAAAF@EMBX01-HQ.jnpr.net>
References: <1485847861.1415843.1296076736111.JavaMail.root@lu2-zimbra> <4D4091A5.40604@octasic.com> <088d003d65f78906dd3464e0fde1e22d@WebfootGames.com>, <AANLkTimvVA_K+JLAqrP7SjFYD6HkqrbnxUAXxcMGWEt3@mail.gmail.com>
In-Reply-To: <AANLkTimvVA_K+JLAqrP7SjFYD6HkqrbnxUAXxcMGWEt3@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: "codec@ietf.org" <codec@ietf.org>
Subject: Re: [codec] requirements #8 (new): Sample rates?
X-BeenThere: codec@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Codec WG <codec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/codec>, <mailto:codec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/codec>
List-Post: <mailto:codec@ietf.org>
List-Help: <mailto:codec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/codec>, <mailto:codec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Jan 2011 18:27:33 -0000

Butrus Damaskus [butrus.butrus@gmail.com] wrote:
> On Thu, Jan 27, 2011 at 4:12 AM, Pascal Pochol <Pochol@webfootgames.com> wrote:
>> in our case I don't even think that we need a per packet signal to tell the
>> decoder. Unless the Opus-custom encoder does something that varies per
>> packet we usually set the parameters up front and never change them when
>> encoding a stream. We could have a little header packet to set things up or
>> since we're in total control simply set the parameter in the initialization
>> of the decoder with a few api calls. Not sure if that would work for others
>> but in our case I think it would without adding extra information to the
>> packets.
>
>Well, but you probably need at least one bit to signal header/data packets, no?

No— the codec itself doesn't carry quite a bit of information which is important
to applications already. E.g. it doesn't carry timing.  These things are left
to upper level protocols to handle.

The same can, and should, be done for configuration negotiation. The reason for
this is that the transport can be well adapted to the environment.   If there were
a 'header packet' that the codec generated only once and sent as part of
the bitstream, if that packet were lost the all the rest of the audio would be
undecodable.   So the only real options are: send it every packet or leave it
for another mechanism to handle.

Even if you wanted to reinvent a whole two way negotiation machine inside the
codec— you couldn't really, because you can't depend on the usage being
duplex.

For modes which can be reasonably switched on the fly sending it in every
packet provides some value.  For ones which can't be— sending it in every
packet is overhead, and worse— a possible opening for a malicious
transmitter to trigger poorly tested corner-cases.

A complete selection of modes that CELT can operate in (when restrictions to
simplify implementation are not imposed) takes about 4 bytes, more if you 
want to add some length coding in order to support packing multiple codec
frames in one packet.   Thats a pretty high overhead for a 64 sample/frame 
mode which is sending 700pps, especially in the case of a lossless
transport for which the configuration would only ever have to be sent once.

So, I think that in packet signaling should generally be limited only
to signalling switches that the codec can actually do on the fly, and
I think for the opus-custom modes it's probably better to not signal in
the packets at all.  If an application needs switching for opus-custom,
it could define a new encapsulation for its transport which provides for it.