From a45a919c8407e2a7e82ea5f3545794fb988cf990 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Thu, 13 Nov 2025 09:45:37 +0900 Subject: [PATCH] zfm: size string for gigabytes --- assets/disk0/tvdos/bin/zfm.js | 1 + video_encoder/TAD_README.md | 8 ++++---- video_encoder/encoder_tav.c | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/disk0/tvdos/bin/zfm.js b/assets/disk0/tvdos/bin/zfm.js index 6a166f3..56d9887 100644 --- a/assets/disk0/tvdos/bin/zfm.js +++ b/assets/disk0/tvdos/bin/zfm.js @@ -72,6 +72,7 @@ let cursor = [0, 0] // absolute position! function bytesToReadable(i) { return ''+ ( + (i > 999999999) ? (((i / 10000000)|0)/100 + "G") : (i > 999999) ? (((i / 10000)|0)/100 + "M") : (i > 9999) ? (((i / 100)|0)/10 + "K") : i diff --git a/video_encoder/TAD_README.md b/video_encoder/TAD_README.md index dc71d12..81be478 100644 --- a/video_encoder/TAD_README.md +++ b/video_encoder/TAD_README.md @@ -25,7 +25,7 @@ TAD (TSVM Advanced Audio) is a modern audio codec built on discrete wavelet tran - **Pre-processing** - First-order IIR pre-emphasis filter (α=0.5) shifts quantisation noise to lower frequencies, where they are less objectionable to listeners - - Gamma compression (γ=0.5) for dynamic range compression before quantisation + - Gamma companding (γ=0.5) for dynamic range compression before quantisation - Mid/Side stereo transformation exploits stereo correlation - Lambda companding (λ=6.0) with Laplacian CDF mapping for full bit utilisation @@ -141,7 +141,7 @@ Audio is automatically resampled to 32 KHz stereo if necessary. - Shifts quantisation noise toward lower frequencies - Improves perceptual quality -3. **Gamma Compression** +3. **Gamma Companding** - Dynamic range compression with γ=0.5 - Applied independently to each sample - Reduces quantisation error for low-amplitude signals @@ -205,7 +205,7 @@ Audio is automatically resampled to 32 KHz stereo if necessary. - R = Mid - Side - Reconstruct stereo channels -7. **Gamma Expansion** +7. **Gamma Decompanding** - Inverse gamma with γ⁻¹=2.0 - Restore original dynamic range @@ -309,7 +309,7 @@ Different weights for Mid and Side channels reflect perceptual importance of fre ### Quality Characteristics - **Frequency Response**: Flat 0-16 KHz within perceptual limits -- **Dynamic Range**: Preserved through gamma compression/expansion +- **Dynamic Range**: Preserved through gamma companding - **Stereo Imaging**: Maintained through Mid/Side decorrelation - **Perceptual Quality**: Optimised for human auditory system characteristics diff --git a/video_encoder/encoder_tav.c b/video_encoder/encoder_tav.c index e11507d..bffbbb8 100644 --- a/video_encoder/encoder_tav.c +++ b/video_encoder/encoder_tav.c @@ -6706,7 +6706,7 @@ static void quantise_dwt_coefficients_perceptual_per_coeff_no_normalisation(tav_ quantised[i] = (int16_t)CLAMP((int)quantised_val, -32768, 32767); // Debug: Print LL subband coefficients (9×7 at top-left for 560×448) - static int debug_once = 1; + /*static int debug_once = 1; if (debug_once && i < 63 && width == 560 && !is_chroma) { int x = i % width; int y = i / width; @@ -6715,7 +6715,7 @@ static void quantise_dwt_coefficients_perceptual_per_coeff_no_normalisation(tav_ x, y, i, coeffs[i], weight, effective_q, quantised_val, quantised[i]); if (i == 62) debug_once = 0; } - } + }*/ } } @@ -9852,7 +9852,6 @@ int main(int argc, char *argv[]) { {"fps", required_argument, 0, 'f'}, {"quality", required_argument, 0, 'q'}, {"quantiser", required_argument, 0, 'Q'}, - {"quantiser", required_argument, 0, 'Q'}, {"wavelet", required_argument, 0, 1010}, {"channel-layout", required_argument, 0, 'c'}, {"bitrate", required_argument, 0, 'b'},