<div dir="ltr">My apologies for the confusion, I think I have the mapping layout correct in this patch.<div><br></div><div>Cheers!<br><div><br></div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 25, 2017 at 10:07 AM Jean-Marc Valin <<a href="mailto:jmvalin@jmvalin.ca" target="_blank">jmvalin@jmvalin.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 25/04/17 10:12 AM, Drew Allen wrote:<br>
> We assume that the input file is ordered first by ACN ambisonic channels<br>
> followed by a (possible) stereo track, and we want to swap the order for<br>
> the API in order to couple the stereo for coding.<br>
<br>
Well, if you look at section 5.1.1 of RFC7845:<br>
<br>
       The 'coupled stream<br>
       count' field indicates that the decoders for the first M Opus<br>
       streams are to be initialized for stereo (two-channel) output,<br>
       and the remaining (N - M) decoders are to be initialized for mono<br>
       (a single channel) only.<br>
<br>
In other words, it says that in the file itself (regardless of what you<br>
do in the API), you need to have the stereo channels first, followed by<br>
the mono channels. Where the channels go in the API itself is another<br>
question and you're free to put the non-diegetic stereo at the end for that.<br>
<br>
> The mapping code<br>
> appears to be working on files I've tested it on so far.<br>
<br>
Well, even if you get the mapping wrong, it's still going to work. It's<br>
just that your non-diegetic stream will be made from two mono streams<br>
and two of your directional channels will be coupled. That's one of the<br>
limitations of simple testing, since it's not going to catch these kinds<br>
of errors.<br>
<br>
        Jean-Marc<br>
</blockquote></div></div></div></div>