From 03143cbadc06790017cf74ffc79675a44893fca7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 10 Mar 2019 20:56:38 -0400 Subject: [PATCH] hwopus: Document second member of HwopusHeader This second member indicates the Opus encoder's entropy coder's final range. While nothing in the service actually does anything with the final range as far as I can tell, this is specified within RFC 6716 (https://tools.ietf.org/html/rfc6716, see section "6. Conformance") as a means of ensuring decoder conformance. States as follows: "In addition, a compliant decoder implementation MUST have the same final range decoder state as that of the reference decoder." So what is likely done when performing compliance testing is the data is encoded, and then the final range of the encoder is sent via this header, then during decoding, the final range would be checked against to ensure that it's valid. --- nx/include/switch/services/hwopus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx/include/switch/services/hwopus.h b/nx/include/switch/services/hwopus.h index 1869ece4..655f4751 100644 --- a/nx/include/switch/services/hwopus.h +++ b/nx/include/switch/services/hwopus.h @@ -18,8 +18,8 @@ typedef struct { /// This structure is the start of opusin for \ref hwopusDecodeInterleaved, with the actual opus packet following this. /// These fields are big-endian. typedef struct { - u32 size; ///< Size of the packet following this header. - u32 unk; ///< Unknown, can be left at zero. + u32 size; ///< Size of the packet following this header. + u32 final_range; ///< Indicates the final range of the codec encoder's entropy coder. This can be left at zero. } HwopusHeader; /// Used internally.