Comments (3)
From #66 (comment):
The fq tool by @wader has been invaluable to investigate the cause of diffs between input (decoding) and output (encoding) FLAC files.
To investigate a mismatch between input FLAC files and corresponding FLAC files produced by encode, do as follows.
- switch to Git branch encode-lpc
- uncomment the
ioutil.WriteFile
lines inTestEncode
to output FLAC file (to/tmp/got.flac
) when the contents of the round-trip test case mismatch. - uncomment a test case that is currently failing (e.g.
testdata/59996.flac
) - run
go test -v -run TestEncode/testdata/59996.flac
=== RUN TestEncode/testdata/59996.flac
enc_test.go:206: "testdata/59996.flac": content mismatch;
expected 66 4C 61 ... 7C A2 21 22 3B ... 80 32 2A,
got 66 4C 61 ... 7C 62 21 12 3B ... 80 32 2A
^ ^
| |
| |
DIFF DIFF
--- FAIL: TestEncode (0.02s)
--- FAIL: TestEncode/testdata/59996.flac (0.02s)
- use fq to analyze the diff
- 4a: analyze input FILE (source of truth):
fq d -d flac testdata/59996.flac
- 4b: analyze output FILE (produced by encode):
fq d -d flac /tmp/got.flac
- 4a: analyze input FILE (source of truth):
binary diff (using vbindiff) between input and output FLAC files
fq analysis of input FILE (source of truth)
fq d -d flac testdata/59996.flac
fq analysis of output FILE (produce by mewkiz/flac
encoding)
fq d -d flac /tmp/got.flac
from flac.
From #66 (comment):
--input (orig): testdata/59996.flac
++output (encode): /tmp/got.flac
residual: (0b-0000000000000000011111100101101) -16173
residual: (0b-0000000000000000011101101010011) -15187
residual: (0b00000000000000000111101011001001) 31433
-residual: (0b-0000000000000000001110111110011) -7667
+residual: (0b-0000000000000000001110111110010) -7666
-residual: (0b00000000000000000110001000010010) 25106
+residual: (0b00000000000000000110001000010001) 25105
-residual: (0b00000000000000000010001110110100) 9140
+residual: (0b00000000000000000010001110110101) 9141
-residual: (0b-0000000000000000110000000101110) -24622
+residual: (0b-0000000000000000110000000110000) -24624
-residual: (0b00000000000000000001000011000000) 4288
+residual: (0b00000000000000000001000011000010) 4290
-residual: (0b00000000000000000110101101001001) 27465
+residual: (0b00000000000000000110101101000110) 27462
-residual: (0b-0000000000000000111100011100001) -30945
+residual: (0b-0000000000000000111100011011110) -30942
-residual: (0b00000000000000000111111110100011) 32675
+residual: (0b00000000000000000111111110100000) 32672
-residual: (0b-0000000000000000101000111001011) -20939
+residual: (0b-0000000000000000101000111001001) -20937
-residual: (0b-0000000000000000011011001011101) -13917
+residual: (0b-0000000000000000011011001011110) -13918
residual: (0b00000000000000001000100101110011) 35187
residual: (0b-0000000000000001101011111001001) -55241
There seem to be a small diff in the residual between the original input FLAC file and the encoded output FLAC file.
Still not sure why. Anyone who may have an idea? : )
from flac.
Fixed by 70d4ace.
from flac.
Related Issues (20)
- Any plans for replaygain scanning support? HOT 2
- Audio Compression HOT 7
- Convert problem in the flac2wav HOT 3
- Error when downloading package HOT 2
- Re-Implement the flac.Encode(f, stream) function HOT 5
- Sample with Rice parameter escape codes HOT 5
- Reason for using sized integer types in `StreamInfo` and `frame.Header` HOT 2
- Update seek API to use absolute rather than relative sample number HOT 2
- Flac plays slowly HOT 1
- `flac.parseStreamInfo` reports wrong type when first block is not `STREAMINFO` HOT 3
- FLAC decoder testbench HOT 7
- Last call on FLAC spec HOT 3
- IETF test cases - 3 of 64 FAIL (61 of 64 PASS) in flac.TestDecode HOT 6
- "frame.Frame.parseHeader: The flac library test cases do not yet include any audio files with block size 192." HOT 2
- flac.Parse funcs are prone to data races HOT 3
- IETF test cases - 1 of 64 FAIL (63 of 64 PASS) in frame.TestFrameHash (decoding audio samples) HOT 5
- proposal: move cmd example tools to external repository (to reduce external dependencies of flac)
- ci: replace Travis CI with Github actions for continuous build and test runs
- `frame.SampleNum()` is wrong for the last frame of the stream
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flac.