From 9d98cc1a21ec5b5350aea825a3c8e45d76726aab Mon Sep 17 00:00:00 2001 From: minjaesong Date: Mon, 3 Nov 2025 22:49:44 +0900 Subject: [PATCH] TAV decoder: rewrote to output to file, currently only does I-frames which is NOT a regression from the old code :shrug: --- terranmon.txt | 57 +- video_encoder/decoder_tav.c | 1432 ++++++++++++++++++++++------------- 2 files changed, 958 insertions(+), 531 deletions(-) diff --git a/terranmon.txt b/terranmon.txt index 2aa3e39..b4f383a 100644 --- a/terranmon.txt +++ b/terranmon.txt @@ -806,15 +806,19 @@ SSF is a simple subtitle that is intended to use text buffer to display texts. The format is designed to be compatible with SubRip and SAMI (without markups) and interoperable with TEV and TAV formats. +SSF-TC is an SSF with extra timecode so that subtitle packets can be desynchronised with video frames +on encoding. + When SSF is interleaved with MP2 audio, the payload must be inserted in-between MP2 frames. ## Packet Structure - uint8 0x30 (packet type) + uint8 0x30/0x31 (SSF/SSF-TC) uint32 Packet Size * SSF Payload (see below) ## SSF Packet Structure - uint24 index (used to specify target subtitle object) + uint24 Subtitle object ID (used to specify target subtitle object) + uint64 Timecode in nanoseconds (only present for SSF-TC format; regular SSF must not write these bytes) uint8 opcode 0x00 = , is NOP when used here 0x01 = show (arguments: UTF-8 text) @@ -836,17 +840,21 @@ KSF is a frame-synced subtitle that is intended to use Karaoke-style subtitles. The format is designed to be interoperable with TEV and TAV formats. For non-karaoke style synced lyrics, use SSF. +KSF-TC is an KSF with extra timecode so that subtitle packets can be desynchronised with video frames +on encoding. + When KSF is interleaved with MP2 audio, the payload must be inserted in-between MP2 frames. ## Packet Structure - uint8 0x31 (packet type) + uint8 0x32/0x33 (KSF/KSF-TC) * KSF Payload (see below) ### KSF Packet Structure KSF is line-based: you define an unrevealed line, then subsequent commands reveal words/syllables on appropriate timings. - uint24 index (used to specify target subtitle object) + uint24 Subtitle object ID (used to specify target subtitle object) + uint64 Timecode in nanoseconds (only present for KSF-TC format; regular KSF must not write these bytes) uint8 opcode 0x00 = , is NOP when used here @@ -898,8 +906,9 @@ transmission capability, and region-of-interest coding. uint16 Width: video width in pixels uint16 Height: video height in pixels uint8 FPS: frames per second. Use 0x00 for still images - uint32 Total Frames: number of video frames. Use 0xFFFFFFFF to denote still image (.im3 file) - - frame count of 0 is used to denote not-finalised video stream + uint32 Total Frames: number of video frames + - use 0 to denote not-finalised video stream + - use 0xFFFFFFFF to denote still image (.im3 file) uint8 Wavelet Filter Type: - 0 = 5/3 reversible (LGT 5/3, JPEG 2000 standard) - 1 = 9/7 irreversible (CDF 9/7, slight modification of JPEG 2000, default choice) @@ -932,7 +941,8 @@ transmission capability, and region-of-interest coding. - 6-7 = Reserved/invalid (would indicate no luma and no chroma) uint8 Entropy Coder - 0 = Twobit-plane significance map - - 1 = Embedded Zero Block Coding (EZBC, experimental) + - 1 = Embedded Zero Block Coding + - 2 = Raw coefficients uint8 Reserved[2]: fill with zeros uint8 Device Orientation - 0 = No rotation @@ -961,28 +971,24 @@ transmission capability, and region-of-interest coding. 0x12: GOP Unified (temporal 3D DWT with unified preprocessing) 0x1F: (prohibited)