Compare commits

...

3 Commits

Author SHA1 Message Date
Steve Ayerhart 079bcfc315
fix comment format 2022-11-23 15:29:11 -05:00
Steve Ayerhart 42cabaa9e8
typo, syntax error, comments 2022-11-23 15:28:10 -05:00
Steve Ayerhart e4e7d1172f
test reorg 2022-11-23 15:26:59 -05:00
5 changed files with 11 additions and 15 deletions

1
src/flac/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
version.scm

View File

@ -19,7 +19,7 @@ include $(top_srcdir)/build-aux/am/guile.am
SOURCES = \
version.scm \
decover.scm \
decoder.scm \
format.scm \
metadata.scm \
reader.scm

View File

@ -171,7 +171,7 @@
((between? raw #b100000 #b111111) (values (+ 1 (bit-extract raw 0 5)) 'lpc))
(else (values #f #f)))))
; https://www.ietf.org/archive/id/draft-ietf-cellar-flac-07.html#name-interchannel-decorrelation
;;; https://www.ietf.org/archive/id/draft-ietf-cellar-flac-07.html#name-interchannel-decorrelation
(define (stereo-decorrelation samples channel-assignment)
(match channel-assignment
('independent samples)
@ -239,13 +239,12 @@
(residual (read-residual-partitioned-rice blocksize lpc-order)))
(restore-linear-prediction warmup residual coefs lpc-order shift)))
;; TODO: clean up the channel decorrelation this is kind of ugly
(define (read-subframes stream-info frame-header)
(let ((channels (stream-info-channels stream-info))
(channel-assignment (frame-header-channel-assignment frame-header)))
(map! (λ (channel) (read-subframe frame-header channel)) (iota channels))))
; TODO: actually verify the checksum
;;; TODO: actually verify the checksum
(define (read-frame-footer)
(flac-read-uint 16))
@ -262,7 +261,7 @@
(blocksize (decode-block-size raw-blocksize))
(sample-rate (decode-sample-rate stream-info raw-sample-rate))
(crc (flac-read-uint 8)))
(make-frame-header
(%make-frame-header
blocking-strategy
blocksize
sample-rate

View File

@ -1,10 +0,0 @@
(define-module (flac tests utils)
#:use-module (srfi srfi-64)
#:export (with-tests))
(define-syntax-rule (with-tests name body ...)
(begin
(test-begin name)
body ...
(test-end name)))
; (exit (zero? (test-runner-fail-count (test-end name))))))

View File

@ -10,6 +10,12 @@
#:use-module (srfi srfi-64))
(define-syntax-rule (with-tests name body ...)
(begin
(test-begin name)
body ...
(test-end name)))
(define-public example-1
#vu8(#x66 #x4c #x61 #x43 #x80 #x00 #x00 #x22 #x10 #x00 #x10 #x00
#x00 #x00 #x0f #x00 #x00 #x0f #x0a #xc4 #x42 #xf0 #x00 #x00