Re: [codec] Conformance with unusual sample rates

Gregory Maxwell <gmaxwell@juniper.net> Fri, 18 November 2011 15:19 UTC

Return-Path: <gmaxwell@juniper.net>
X-Original-To: codec@ietfa.amsl.com
Delivered-To: codec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8D37121F8AD9 for <codec@ietfa.amsl.com>; Fri, 18 Nov 2011 07:19:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.599
X-Spam-Level:
X-Spam-Status: No, score=-6.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
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 dnX7h61s+cIq for <codec@ietfa.amsl.com>; Fri, 18 Nov 2011 07:19:55 -0800 (PST)
Received: from exprod7og121.obsmtp.com (exprod7og121.obsmtp.com [64.18.2.20]) by ietfa.amsl.com (Postfix) with ESMTP id 41B9121F8AD8 for <codec@ietf.org>; Fri, 18 Nov 2011 07:19:55 -0800 (PST)
Received: from P-EMHUB01-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob121.postini.com ([64.18.6.12]) with SMTP ID DSNKTsZ3mX/AAo3ZOXs9TTEhTWymR0thOoA3@postini.com; Fri, 18 Nov 2011 07:19:55 PST
Received: from EMBX01-HQ.jnpr.net ([fe80::c821:7c81:f21f:8bc7]) by P-EMHUB01-HQ.jnpr.net ([fe80::fc92:eb1:759:2c72%11]) with mapi; Fri, 18 Nov 2011 07:18:12 -0800
From: Gregory Maxwell <gmaxwell@juniper.net>
To: John Ridges <jridges@masque.com>, "codec@ietf.org" <codec@ietf.org>
Date: Fri, 18 Nov 2011 07:18:11 -0800
Thread-Topic: [codec] Conformance with unusual sample rates
Thread-Index: Acyl/nPnzJ3payWGST25aUfeyNLk7gAA0JuH
Message-ID: <BCB3F026FAC4C145A4A3330806FEFDA93D19F6B509@EMBX01-HQ.jnpr.net>
References: <4EC66BAE.9000600@masque.com>
In-Reply-To: <4EC66BAE.9000600@masque.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="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [codec] Conformance with unusual sample rates
X-BeenThere: codec@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Codec WG <codec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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: Fri, 18 Nov 2011 15:19:59 -0000

John Ridges [jridges@masque.com] wrote:
> Since the codec conformance is a hot topic right now, I thought I would
> ask a (probably dumb) question. Is it possible to create a conforming
> (and thus unencumbered) Opus codec from the reference implementation
> that can use a sample rate of, say, 44100 Hz? If so, what are the rules
> that would guarantee conformance? Thanks,

The _correct way_ to use Opus with 44100 Hz is to use a resampler. 

This is, for example, how the opus-tools package uses the reference
library to support any input and output sampling rates the user desires,
transparently and painlessly. (https://git.xiph.org/?p=users/jm/opus-tools.git)

Personally, I think that it's most accurate to think of Opus as a sample-rateless
format. Any rate can go into the encoder, you get packets out at 2.5-120ms 
intervals, and any rate can come out of the decoder.  For particular rates
(8000,12000,16000,24000,48000) the conversion from opus to audio is extra
efficient so those are the ones that the reference library supports directly.
(But not other rates because platform specific optimized resampling would
do better)

The computational cost of a resampler is not significant compared to
the codec, there is no quality impact from a reasonable resampler. Any
other option and you'd suffer from loss of coding efficiency, loss of
interoperability, lost of on the fly mode agility, etc.