1
1
mirror of https://github.com/wader/fq.git synced 2024-12-24 13:52:02 +03:00

Merge pull request #379 from ktmf01/fix-flac-raw-partition

Fix decoding of FLAC raw entropy partition
This commit is contained in:
Mattias Wadman 2022-08-18 11:04:00 +02:00 committed by GitHub
commit b6c4c27688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -2,9 +2,6 @@ package flac
// https://xiph.org/flac/format.html // https://xiph.org/flac/format.html
// https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench // https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench
// TODO:
// 16 - Part 6 of Ladybug Castle (partition order 8 with escape codes)
// 32 - Part 5 of The Four of Us Are Dying (partition order 8 with escape codes)
import ( import (
"bytes" "bytes"

View File

@ -455,7 +455,13 @@ func frameDecode(d *decode.D, in any) any {
if riceParameter == riceEscape { if riceParameter == riceEscape {
escapeSampleSize := int(d.FieldU5("escape_sample_size")) escapeSampleSize := int(d.FieldU5("escape_sample_size"))
d.FieldRawLen("samples", int64(count*escapeSampleSize)) d.RangeFn(d.Pos(), int64(count*escapeSampleSize), func(d *decode.D) {
d.FieldRawLen("samples", int64(count*escapeSampleSize))
})
for j := 0; j < count; j++ {
samples[n] = d.S(escapeSampleSize)
n++
}
} else { } else {
samplesStart := d.Pos() samplesStart := d.Pos()
for j := 0; j < count; j++ { for j := 0; j < count; j++ {