Giter Site home page Giter Site logo

Comments (3)

mewmew avatar mewmew commented on September 18, 2024

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.

  1. switch to Git branch encode-lpc
  2. uncomment the ioutil.WriteFile lines in TestEncode to output FLAC file (to /tmp/got.flac) when the contents of the round-trip test case mismatch.
  3. uncomment a test case that is currently failing (e.g. testdata/59996.flac)
  4. 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)
  1. 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

binary diff (using vbindiff) between input and output FLAC files

screenshot_2023-10-29_11:10:27

fq analysis of input FILE (source of truth)

fq d -d flac testdata/59996.flac

screenshot_2023-10-29_11:14:40

fq analysis of output FILE (produce by mewkiz/flac encoding)

fq d -d flac /tmp/got.flac

screenshot_2023-10-29_11:14:50

from flac.

mewmew avatar mewmew commented on September 18, 2024

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.

mewmew avatar mewmew commented on September 18, 2024

Fixed by 70d4ace.

from flac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.