From patchwork Fri Feb 10 18:42:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felicia Lim X-Patchwork-Id: 2486 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp641375vsb; Fri, 10 Feb 2017 10:51:35 -0800 (PST) X-Received: by 10.223.160.180 with SMTP id m49mr9200896wrm.160.1486752695267; Fri, 10 Feb 2017 10:51:35 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 186si2248314wmx.129.2017.02.10.10.51.24; Fri, 10 Feb 2017 10:51:35 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E97A7689D91; Fri, 10 Feb 2017 20:51:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f169.google.com (mail-qk0-f169.google.com [209.85.220.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 15CB9689B85 for ; Fri, 10 Feb 2017 20:51:11 +0200 (EET) Received: by mail-qk0-f169.google.com with SMTP id u25so48680240qki.2 for ; Fri, 10 Feb 2017 10:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=CbPInSCQ1XJyROV/Q5GHTSsVOW/cqnV+gXwtPzQ6g+Y=; b=vqEJhYzeRJQn/blqLem61Fsqt0yubckd0hEHnelgROcvYYV23uTbiyIrbLWSMRf5cs HfqcJNPk7sMFbp2du16npWsZWG0TA5aPnAy6FybclkpGinM/VRtUbhimRqSIOAxyZlNi 6jXrDhZkw3m3QVWWpZmSKv5fhEo2flFuKi93LlSVmb4QaGoCW7LiROkAdT1kk0pHUrp0 sTs9X+GBDz+N3vrAgZGZzOO3SrPvAhR3d6F/pyR23CnLLhhK+WfFmSwSPWpeTZH1hdEL JM4FHN+6AZzLqH5V0nAwFKWgamuesIwgRI1oXBVBuhV/UgUxFYNfvWgJ+TOa1bFe7Feb lDZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=CbPInSCQ1XJyROV/Q5GHTSsVOW/cqnV+gXwtPzQ6g+Y=; b=Ise+hBFLtRiWV71UNOf6W6gkvZwgHpSLt0RIg8KpAgO/5NpKal7Jd2C7ReZpgyFC2v WKWhqG7FdSstyLxdcJ8vC1ihI3bLtX+NtbGZDV571snYIj0vRGsKJC7BOcbFOVtyc3BA 4xxKF4XknCderZVcpd6eX11ljZK4/XOt6mf4Mm7l9Zah7P/kV79/UNTYbnVS7qO663Ej 7I3vvCEhuZrzjCAUHggf6CasOkJTUFF7S/EoZqveDesROxZQGyCV7CVrVtPGrzUkZfTx 3Ph3yG08namMJ0wzXTyRvwwQqY2Nj2Vnfwn9gbuNiFhGeeL8nE4K0RmEMp96GzGm7qmN e1VQ== X-Gm-Message-State: AMke39l9y3OpDNrNBsavy9BsIG9g/o4Z69ponM/WmFSzBbSGjjafO1x5z7rEN8xyhLrIi8RATXc3v9Yirn9X+4GF X-Received: by 10.55.161.75 with SMTP id k72mr9608652qke.193.1486752185795; Fri, 10 Feb 2017 10:43:05 -0800 (PST) MIME-Version: 1.0 From: Felicia Lim Date: Fri, 10 Feb 2017 18:42:55 +0000 Message-ID: To: ffmpeg-devel@ffmpeg.org X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH] libopus: decode ambisonics with non-diegetic sources X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi all, The attached patch allows libavcodec/opus to decode ambisonics with non-diegetic stereo stream in an ogg/opus container, as is being added in this IETF standards draft [1]. Please let me know if there are any concerns. Thanks, Felicia [1] https://tools.ietf.org/html/draft-ietf-codec-ambisonics-01#section-3.1 From 0798655323605d44d4f75e48fbfc940be0ba7423 Mon Sep 17 00:00:00 2001 From: Felicia Date: Mon, 6 Feb 2017 15:49:36 -0800 Subject: [PATCH] libopus: decode ambisonics with non-diegetic sources Channel mapping 2 additionally supports a non-diegetic stereo track appended to the end of a full-order ambisonics signal, such that the total channel count is either (n + 1) ^ 2, or (n + 1) ^ 2 + 2 where n is the ambisonics order --- libavcodec/opus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/opus.c b/libavcodec/opus.c index 1eeb92c5bd..07e70fd7a4 100644 --- a/libavcodec/opus.c +++ b/libavcodec/opus.c @@ -373,10 +373,12 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, channel_reorder = channel_reorder_vorbis; } else if (map_type == 2) { int ambisonic_order = ff_sqrt(channels) - 1; - if (channels != (ambisonic_order + 1) * (ambisonic_order + 1)) { + if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) && + channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) { av_log(avctx, AV_LOG_ERROR, "Channel mapping 2 is only specified for channel counts" - " which can be written as (n + 1)^2 for nonnegative integer n\n"); + " which can be written as (n + 1)^2 or (n + 1)^2 + 2" + " for nonnegative integer n\n"); return AVERROR_INVALIDDATA; } layout = 0; -- 2.11.0.483.g087da7b7c-goog