From 70e562d3dde4219c5cc27a5890373fab1cdca9a5 Mon Sep 17 00:00:00 2001 From: bdrtc Date: Fri, 9 Dec 2022 15:23:41 +0800 Subject: [PATCH 1/3] This fixes #595. Add a way of specifying frame duration to FLAC encoder config --- flac_codec_registration.src.html | 63 +++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/flac_codec_registration.src.html b/flac_codec_registration.src.html index 1a13b0f4..da184992 100644 --- a/flac_codec_registration.src.html +++ b/flac_codec_registration.src.html @@ -16,7 +16,8 @@ (2) the codec-specific {{EncodedAudioChunk}} [=EncodedAudioChunk/[[internal data]]=] bytes, (3) the {{AudioDecoderConfig.description}} bytes, and (4) the values of - {{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=]. + {{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=], and (5) the + codec-specific extensions to {{AudioEncoderConfig}}. The registration is not intended to include any information on whether a codec format is encumbered by intellectual property claims. Implementers and @@ -46,6 +47,7 @@ text: EncodedAudioChunk; url: encodedaudiochunk type: dictionary text: AudioDecoderConfig; url: dictdef-audiodecoderconfig + text: AudioEncoderConfig; url: dictdef-audioencoderconfig
@@ -54,6 +56,12 @@
     "href": "https://xiph.org/flac/format.html",
     "title": "FLAC - format",
     "publisher": "Xiph.Org Foundation"
+  },
+  
+  "FLAC-DRAFT": {
+    "href": "https://datatracker.ietf.org/doc/draft-ietf-cellar-flac",
+    "title": "Free Lossless Audio Codec",
+    "publisher": "IETF"
   }
 }
 
@@ -94,6 +102,59 @@ NOTE: Once the initialization has succeeded, any FLAC packet can be decoded at any time without error, but this might not result in the expected audio output. +AudioEncoderConfig extensions {#audioencoderconfig-extensions} +============================================================= + +
+
+partial dictionary AudioEncoderConfig {
+  FlacEncoderConfig flac;
+};
+
+
+ +
+
flac
+
+ Contains codec specific configuration options for the FLAC codec. +
+
+ + +FlacEncoderConfig {#flac-encoder-config} +-------------------------------------- + +
+
+dictionary FlacEncoderConfig {
+  [EnforceRange] unsigned long blockSize = 0;
+  [EnforceRange] unsigned long compressLevel = 5;
+};
+
+
+ +To check if an {{FlacEncoderConfig}} is valid, run these steps: +1. If {{FlacEncoderConfig/blockSize}} is not a valid block size, + which is described section 5.1 of [[FLAC-DRAFT]], return `false`. +1. If {{FlacEncoderConfig/compressLevel}} is specified and not within the range of + `0`(fastest, least compression) and `8`(slowest, most compression) inclusively, return `false`. +2. Return `true`. + +
+
blockSize
+
+ Configures the number of samples to use per frame, of output {{EncodedAudioChunk}}s. + + NOTE: Use 0 to let the encoder estimate a blocksize by default. +
+ +
compressLevel
+
+ Configures the compression level to use while encoding. +
+ +
+ Privacy Considerations {#privacy-considerations} ========================================================================== From bee24289e7457cdc9cb39674f47a6ad0bc0422af Mon Sep 17 00:00:00 2001 From: bdrtc Date: Mon, 19 Dec 2022 11:31:51 +0800 Subject: [PATCH 2/3] fix format --- flac_codec_registration.src.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flac_codec_registration.src.html b/flac_codec_registration.src.html index da184992..b20c2802 100644 --- a/flac_codec_registration.src.html +++ b/flac_codec_registration.src.html @@ -137,7 +137,7 @@ 1. If {{FlacEncoderConfig/blockSize}} is not a valid block size, which is described section 5.1 of [[FLAC-DRAFT]], return `false`. 1. If {{FlacEncoderConfig/compressLevel}} is specified and not within the range of - `0`(fastest, least compression) and `8`(slowest, most compression) inclusively, return `false`. + `0` (fastest, least compression) and `8` (slowest, most compression) inclusively, return `false`. 2. Return `true`.
From 3b7449da2e7444e33acfc3e17b74d71aef61d30e Mon Sep 17 00:00:00 2001 From: bdrtc Date: Wed, 4 Jan 2023 12:03:44 +0800 Subject: [PATCH 3/3] update FLAC to the IETF draft --- flac_codec_registration.src.html | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/flac_codec_registration.src.html b/flac_codec_registration.src.html index b20c2802..6beca3ea 100644 --- a/flac_codec_registration.src.html +++ b/flac_codec_registration.src.html @@ -53,12 +53,6 @@
 {
   "FLAC": {
-    "href": "https://xiph.org/flac/format.html",
-    "title": "FLAC - format",
-    "publisher": "Xiph.Org Foundation"
-  },
-  
-  "FLAC-DRAFT": {
     "href": "https://datatracker.ietf.org/doc/draft-ietf-cellar-flac",
     "title": "Free Lossless Audio Codec",
     "publisher": "IETF"
@@ -83,8 +77,8 @@
 {{AudioDecoderConfig.description}} is required, and has to be the following:
 
 - The bytes `0x66 0x4C 0x61 0x43` ("`fLaC`" in ASCII)
-- A `METADATA_BLOCK` of type `STEAMINFO` as described in [[FLAC]]
-- Optionaly other `METADATA_BLOCK`, that are not used by the specification
+- A `metadata block` (called the STREAMINFO block) as described in section 7 of [[FLAC]]
+- Optionaly other metadata blocks, that are not used by the specification
 
 The {{AudioDecoderConfig.sampleRate}} and {{AudioDecoderConfig.numberOfChannels}}
 members are overridden by what the decoder finds in the
@@ -135,7 +129,7 @@
 
 To check if an {{FlacEncoderConfig}} is valid, run these steps:
 1. If {{FlacEncoderConfig/blockSize}} is not a valid block size,
-	which is described section 5.1 of [[FLAC-DRAFT]], return `false`.
+	which is described section 5.1 of [[FLAC]], return `false`.
 1. If {{FlacEncoderConfig/compressLevel}} is specified and not within the range of
     `0` (fastest, least compression) and `8` (slowest, most compression) inclusively, return `false`.
 2. Return `true`.