SynDB: Difference between revisions

From XionKB
Jump to navigationJump to search
(Created page with "'''SynDB''' is a database schematic for light data rich hypermedia syndication. ==Schemas== ===Canonical schemas=== These schemas contain raw media data in a singular canonical format. These formats serve as master copies from which processed "composite" media formats can be created for various purposes and the constraints thereof. {| class="wikitable" |+ Raster images |- ! Field ! Type ! Description |- | style="background-color:rgba(192,248,192,0.5)" | <tt>id</tt>...")
 
(add some forward declaration subroutine signatures)
 
(One intermediate revision by the same user not shown)
Line 12: Line 12:
! Description
! Description
|-
|-
| style="background-color:rgba(192,248,192,0.5)" | <tt>id</tt>
| style="background-color:rgba(248,192,248,0.5)" | <tt>id</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>u64</tt>
| <tt>u64</tt>
| ID of the raster image.
| ID of the raster image.
|-
|-
| <tt>w</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>w</tt>
| <tt>u64</tt>
| <tt>u64</tt>
| Width of image minus one, in pels.<ref name="64bit">Allows for a range of 1 to 18,446,744,073,709,551,616 pels.</ref>
| Width of image minus one, in pels.<ref name="64bit">Allows for a range of 1 to 18,446,744,073,709,551,616 pels.</ref>
|-
|-
| <tt>h</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>h</tt>
| <tt>u64</tt>
| <tt>u64</tt>
| Height of image minus one, in pels.<ref name="64bit" />
| Height of image minus one, in pels.<ref name="64bit" />
|-
|-
| <tt>colspace</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>colspace</tt>
| <tt>enum : u4</tt>
| <tt>enum : u4</tt>
| Colour space in use.<ref>Can be one of <code>GRAY1</code><tt>=0</tt>, <code>GRAY2</code><tt>=1</tt>, <code>GRAY4</code><tt>=2</tt>, <code>GRAY8</code><tt>=3</tt>, <code>GRAY16</code><tt>=4</tt>, <code>GRAY32</code><tt>=5</tt>, <code>RGB332</code><tt>=6</tt>, <code>RGBA4444</code><tt>=7</tt>, <code>RGB565</code><tt>=8</tt>, <code>RGBA5551</code><tt>=9</tt>, <code>RGBA8888</code><tt>=10</tt>, <code>RGBX1010102</code><tt>=11</tt>, <code>RGBA16161616</code><tt>=12</tt>, <code>YUV420</code><tt>=13</tt>, <code>YUV422</code><tt>=14</tt>, or <code>YUV444</code><tt>=15</tt>.</ref>
| Colour space in use.<ref>Can be one of <code>GRAY1</code><tt>=0</tt>, <code>GRAY2</code><tt>=1</tt>, <code>GRAY4</code><tt>=2</tt>, <code>GRAY8</code><tt>=3</tt>, <code>GRAY16</code><tt>=4</tt>, <code>GRAY32</code><tt>=5</tt>, <code>RGB332</code><tt>=6</tt>, <code>RGBA4444</code><tt>=7</tt>, <code>RGB565</code><tt>=8</tt>, <code>RGBA5551</code><tt>=9</tt>, <code>RGBA8888</code><tt>=10</tt>, <code>RGBX1010102</code><tt>=11</tt>, <code>RGBA16161616</code><tt>=12</tt>, <code>YUV420</code><tt>=13</tt>, <code>YUV422</code><tt>=14</tt>, or <code>YUV444</code><tt>=15</tt>.</ref>
|-
|-
| <tt>data</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>data</tt>
| <tt>blob</tt>
| <tt>blob</tt>
| Data payload, using the given colour space as its ABI.
| Data payload, using the given colour space as its ABI.
Line 40: Line 40:
! Description
! Description
|-
|-
| style="background-color:rgba(192,248,192,0.5)" | <tt>id</tt>
| style="background-color:rgba(248,192,248,0.5)" | <tt>id</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>u64</tt>
| <tt>u64</tt>
| ID of the vector image.
| ID of the vector image.
|-
|-
| <tt>w</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>w</tt>
| <tt>u64</tt>
| <tt>u64</tt>
| Nominal width of image minus one, in pels.<ref name="64bit" />
| Nominal width of image minus one, in pels.<ref name="64bit" />
|-
|-
| <tt>h</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>h</tt>
| <tt>u64</tt>
| <tt>u64</tt>
| Nominal height of image minus one, in pels.<ref name="64bit" />
| Nominal height of image minus one, in pels.<ref name="64bit" />
|-
|-
| <tt>data</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>data</tt>
| <tt>blob</tt>
| <tt>blob</tt>
| Data payload, using the PackVector format as its ABI.
| Data payload, using the PackVector format as its ABI.
Line 64: Line 64:
! Description
! Description
|-
|-
| style="background-color:rgba(192,248,192,0.5)" | <tt>id</tt>
| style="background-color:rgba(248,192,248,0.5)" | <tt>id</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>u64</tt>
| <tt>u64</tt>
| ID of the motion picture.
| ID of the motion picture.
|-
|-
| <tt>w</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>w</tt>
| <tt>u32</tt>
| <tt>u32</tt>
| Width of motion picture minus one, in pels.<ref name="32bit">Allows for a range of 1 to 4,294,967,296 pels.</ref>
| Width of motion picture minus one, in pels.<ref name="32bit">Allows for a range of 1 to 4,294,967,296 pels.</ref>
|-
|-
| <tt>h</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>h</tt>
| <tt>u32</tt>
| <tt>u32</tt>
| Height of motion picture minus one, in pels.<ref name="32bit" />
| Height of motion picture minus one, in pels.<ref name="32bit" />
|-
|-
| <tt>data</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>data</tt>
| <tt>blob</tt>
| <tt>blob</tt>
| Motion picture payload, stored as HEVC Main 10 Profile lossless in AVCC container format (MPEG-4 Part 15).
| Motion picture payload, stored as HEVC Main 10 Profile lossless in AVCC container format (MPEG-4 Part 15).
Line 88: Line 88:
! Description
! Description
|-
|-
| style="background-color:rgba(192,248,192,0.5)" | <tt>id</tt>
| style="background-color:rgba(248,192,248,0.5)" | <tt>id</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>u64</tt>
| <tt>u64</tt>
| ID of the waveform.
| ID of the waveform.
|-
|-
| <tt>rate</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>rate</tt>
| <tt>u32</tt>
| <tt>u32</tt>
| Sample rate of the waveform, in hertz.
| Sample rate of the waveform, in hertz.
|-
|-
| <tt>depth</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>depth</tt>
| <tt>enum : u2</tt>
| <tt>enum : u2</tt>
| Bit depth of an audio sample.<ref>Can be one of <code>U8</code><tt>=0</tt>, <code>U16LE</code><tt>=1</tt>, <code>U24LE</code><tt>=2</tt> or <code>U32LE</code><tt>=3</tt>.</ref>
| Bit depth of an audio sample.<ref>Can be one of <code>U8</code><tt>=0</tt>, <code>U16LE</code><tt>=1</tt>, <code>U24LE</code><tt>=2</tt> or <code>U32LE</code><tt>=3</tt>.</ref>
|-
|-
| <tt>chcount</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>chcount</tt>
| <tt>u3</tt>
| <tt>u3</tt>
| Channel count minus one, thereby allowing anywhere from 1 to 8 channels.
| Channel count minus one, thereby allowing anywhere from 1 to 8 channels.
|-
|-
| <tt>ttl</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>ttl</tt>
| <tt>u64</tt>
| <tt>u64</tt>
| Total sample count.<ref>This counts inter-channel samples, ergo 1 second of 44.1kHz audio is 44,100 samples regardless of the channel count.</ref>
| Total sample count.<ref>This counts inter-channel samples, ergo 1 second of 44.1kHz audio is 44,100 samples regardless of the channel count.</ref>
|-
|-
| <tt>data</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>data</tt>
| <tt>blob</tt>
| <tt>blob</tt>
| Raw PCM waveform payload.
| Raw PCM waveform payload.
Line 120: Line 120:
! Description
! Description
|-
|-
| style="background-color:rgba(192,248,192,0.5)" | <tt>id</tt>
| style="background-color:rgba(248,192,248,0.5)" | <tt>id</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>u64</tt>
| <tt>u64</tt>
| ID of the text.
| ID of the text.
|-
|-
| <tt>encoding</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>encoding</tt>
| <tt>enum : u2</tt>
| <tt>enum : u2</tt>
| Content encoding of the text.<ref>Can be one of <code>ASCII</code><tt>=0</tt>, <code>UTF8</code><tt>=1</tt>, <code>UTF16LE</code><tt>=2</tt>, or <code>UTF32LE</code><tt>=3</tt>.</ref>
| Content encoding of the text.<ref>Can be one of <code>ASCII</code><tt>=0</tt>, <code>UTF8</code><tt>=1</tt>, <code>UTF16LE</code><tt>=2</tt>, or <code>UTF32LE</code><tt>=3</tt>.</ref>
|-
|-
| <tt>data</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>data</tt>
| <tt>blob</tt>
| <tt>blob</tt>
| Data payload of the text, without any {{expl|BOM|byte order mark}}.
| Data payload of the text, without any {{expl|BOM|byte order mark}}.
Line 143: Line 143:
! Description
! Description
|-
|-
| style="background-color:rgba(192,248,192,0.5)" | <tt>id</tt>
| style="background-color:rgba(248,192,248,0.5)" | <tt>id</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>u64</tt>
| <tt>u64</tt>
| ID of the animated image.
| ID of the animated image.
|-
|-
| <tt>loop</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>loop</tt>
| <tt>bool</tt>
| <tt>bool</tt>
| Whether the animation loops infinitely or not at all.
| Whether the animation loops infinitely or not at all.
|-
|-
| <tt>count</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>count</tt>
| <tt>u32</tt>
| <tt>u32</tt>
| Total number of frames in the animated image.
| Total number of frames in the animated image.
|-
|-
| <tt>frames</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>frames</tt>
| <tt>u64[]</tt>
| <tt>u64[]</tt>
| Ordered list of IDs to canonical raster images, constituting the animation frame list.
| Ordered list of IDs to canonical raster images, constituting the animation frame list.
|-
| style="background-color:rgba(248,248,192,0.5)" | <tt>delays</tt>
| <tt>u16[]</tt>
| Ordered list of delays for each frame, denominated in centiseconds (10ms increments).
|}
|}


Line 167: Line 171:
! Description
! Description
|-
|-
| style="background-color:rgba(192,248,192,0.5)" | <tt>id</tt>
| style="background-color:rgba(248,192,248,0.5)" | <tt>id</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>u64</tt>
| <tt>u64</tt>
| ID of the video.
| ID of the video.
|-
|-
| <tt>video</tt>
| style="background-color:rgba(248,248,192,0.5)" | <tt>video</tt>
| <tt>u64</tt>
| <tt>u64</tt>
| ID of the canonical motion picture data source.
| ID of the canonical motion picture data source.
|-
|-
| <tt>audio</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>audio</tt>
| <tt>u64</tt>
| <tt>u64</tt>
| ID of the canonical waveform data source.
| ID of the canonical waveform data source.
|-
|-
| <tt>subs</tt>
| style="background-color:rgba(192,248,192,0.5)" | <tt>subs</tt>
| <tt>u64 &vert; nil</tt>
| <tt>u64</tt>
| ID of the canonical text data, interpreted as SRT format subtitles. Optional.
| ID of the canonical text data, interpreted as SRT format subtitles.
|}
|}
==Composition API==
{| class="wikitable"
|+ Animated images
|-
! Field
! Type
! Description
|-
| style="background-color:rgba(248,248,192,0.5)" | <tt>id</tt>
| <tt>u64</tt>
| ID of the animated image in the database table.
|-
| style="background-color:rgba(248,248,192,0.5)" | <tt>cent8crop</tt>
| <tt>bool</tt>
| Whether to do a centred crop to the nearest whole 8&times;8 width and height. This helps make more efficiently coded MP4s.
|-
| style="background-color:rgba(248,248,192,0.5)" | <tt>outfmt</tt>
| <tt>enum : u2</tt>
| Desired output format.<ref>Can be one of <code>MP4</code><tt>=0</tt>, <code>APNG</code><tt>=1</tt>, <code>MNG</code><tt>=2</tt> or <code>GIF</code><tt>=3</tt>.</ref>
|-
| style="background-color:rgba(248,248,192,0.5)" | <tt>outopts</tt>
| <tt>union : outfmt</tt>
| Options <tt>struct</tt>s unionised to provide for each of the 4 possible output formats. <tt>struct</tt>s within TBD.
|}
<pre>s32 syn_compose_ani_mp4(
  u64 id,
  bl cent8crop,
  u32 w,
  u32 h,
  enum { NEAREST, BILINEAR, BICUBIC, LANCZOS } resize_alg,
  enum { FPS24, FPS30, FPS60 } fps,
  u32 bitrate );</pre>
<pre>s32 syn_compose_ani_apng(
  u64 id,
  bl cent8crop,
  u16 w,
  u16 h,
  enum { NEAREST, BILINEAR, BICUBIC, LANCZOS } resize_alg,
  bl paletted,
  bl crushed );</pre>
<pre>s32 syn_compose_ani_gif(
  u64 id,
  bl cent8crop,
  u16 w,
  u16 h,
  enum { NEAREST, BILINEAR, BICUBIC, LANCZOS } resize_alg,
  bl deep_pal,
  bl crushed );</pre>


==References==
==References==
<references />
<references />

Latest revision as of 09:00, 29 January 2024

SynDB is a database schematic for light data rich hypermedia syndication.

Schemas

Canonical schemas

These schemas contain raw media data in a singular canonical format. These formats serve as master copies from which processed "composite" media formats can be created for various purposes and the constraints thereof.

Raster images
Field Type Description
id u64 ID of the raster image.
w u64 Width of image minus one, in pels.[1]
h u64 Height of image minus one, in pels.[1]
colspace enum : u4 Colour space in use.[2]
data blob Data payload, using the given colour space as its ABI.
Vector images
Field Type Description
id u64 ID of the vector image.
w u64 Nominal width of image minus one, in pels.[1]
h u64 Nominal height of image minus one, in pels.[1]
data blob Data payload, using the PackVector format as its ABI.
Motion pictures
Field Type Description
id u64 ID of the motion picture.
w u32 Width of motion picture minus one, in pels.[3]
h u32 Height of motion picture minus one, in pels.[3]
data blob Motion picture payload, stored as HEVC Main 10 Profile lossless in AVCC container format (MPEG-4 Part 15).
Waveform audio
Field Type Description
id u64 ID of the waveform.
rate u32 Sample rate of the waveform, in hertz.
depth enum : u2 Bit depth of an audio sample.[4]
chcount u3 Channel count minus one, thereby allowing anywhere from 1 to 8 channels.
ttl u64 Total sample count.[5]
data blob Raw PCM waveform payload.
Text
Field Type Description
id u64 ID of the text.
encoding enum : u2 Content encoding of the text.[6]
data blob Data payload of the text, without any BOM.

Composite schemas

These schemas contain information particular to composite media formulations sourced from canonical "master copies" in tables following the schemas above. They are tailored to specific uses very close to the product level.

Animated images
Field Type Description
id u64 ID of the animated image.
loop bool Whether the animation loops infinitely or not at all.
count u32 Total number of frames in the animated image.
frames u64[] Ordered list of IDs to canonical raster images, constituting the animation frame list.
delays u16[] Ordered list of delays for each frame, denominated in centiseconds (10ms increments).
Web videos
Field Type Description
id u64 ID of the video.
video u64 ID of the canonical motion picture data source.
audio u64 ID of the canonical waveform data source.
subs u64 ID of the canonical text data, interpreted as SRT format subtitles.

Composition API

Animated images
Field Type Description
id u64 ID of the animated image in the database table.
cent8crop bool Whether to do a centred crop to the nearest whole 8×8 width and height. This helps make more efficiently coded MP4s.
outfmt enum : u2 Desired output format.[7]
outopts union : outfmt Options structs unionised to provide for each of the 4 possible output formats. structs within TBD.
s32 syn_compose_ani_mp4(
   u64 id,
   bl cent8crop,
   u32 w,
   u32 h,
   enum { NEAREST, BILINEAR, BICUBIC, LANCZOS } resize_alg,
   enum { FPS24, FPS30, FPS60 } fps,
   u32 bitrate );
s32 syn_compose_ani_apng(
   u64 id,
   bl cent8crop,
   u16 w,
   u16 h,
   enum { NEAREST, BILINEAR, BICUBIC, LANCZOS } resize_alg,
   bl paletted,
   bl crushed );
s32 syn_compose_ani_gif(
   u64 id,
   bl cent8crop,
   u16 w,
   u16 h,
   enum { NEAREST, BILINEAR, BICUBIC, LANCZOS } resize_alg,
   bl deep_pal,
   bl crushed );

References

  1. 1.0 1.1 1.2 1.3 Allows for a range of 1 to 18,446,744,073,709,551,616 pels.
  2. Can be one of GRAY1=0, GRAY2=1, GRAY4=2, GRAY8=3, GRAY16=4, GRAY32=5, RGB332=6, RGBA4444=7, RGB565=8, RGBA5551=9, RGBA8888=10, RGBX1010102=11, RGBA16161616=12, YUV420=13, YUV422=14, or YUV444=15.
  3. 3.0 3.1 Allows for a range of 1 to 4,294,967,296 pels.
  4. Can be one of U8=0, U16LE=1, U24LE=2 or U32LE=3.
  5. This counts inter-channel samples, ergo 1 second of 44.1kHz audio is 44,100 samples regardless of the channel count.
  6. Can be one of ASCII=0, UTF8=1, UTF16LE=2, or UTF32LE=3.
  7. Can be one of MP4=0, APNG=1, MNG=2 or GIF=3.