Announcement

Collapse
No announcement yet.

Patch for encode-flac

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Patch for encode-flac

    Removes the need for the installation to copy the trondheim wav file into the test folder. The test will now run using the copy in pts-shared.

    Code:
    diff --git a/pts/test-resources/encode-flac/install.sh b/pts/test-resources/encode-flac/install.sh
    index 285d515..997826e 100644
    --- a/pts/test-resources/encode-flac/install.sh
    +++ b/pts/test-resources/encode-flac/install.sh
    @@ -2,11 +2,6 @@
    
     cd $1
    
    -if [ ! -f pts-trondheim.wav ]
    -  then
    -     tar -xvf ../pts-shared/pts-trondheim-wav.tar.gz
    -fi
    -
     THIS_DIR=$(pwd)
     mkdir $THIS_DIR/flac_
    
    @@ -19,6 +14,6 @@ cd ..
     rm -rf flac-1.2.1/
    
     echo "#!/bin/sh
    -/usr/bin/time -f \"WAV To FLAC Encode Time: %e Seconds\" ./flac_/bin/flac -s --best pts-trondheim.wav 2>&1
    +/usr/bin/time -f \"WAV To FLAC Encode Time: %e Seconds\" ./flac_/bin/flac -s --best ../pts-shared/pts-trondheim.wav -o ./pts-trondheim.flac 2>&1
     rm -f pts-trondheim.flac" > flac
     chmod +x flac

  • #2
    Why do you never use /dev/null for outputs?

    Comment


    • #3
      I was gonna ask the same question, but I remembered not all STDIO routines are equal. I've observed weird behaviour while transcoding a file with a pipe command, where neither CPU core was fully used. Turned out it was the lefthand codec (wavpack) that was at fault. Using STDOUT might impair the benchmarks.

      Given the relatively small size of the output files, and the amount of RAM people have these days, I suggest using a tmpfs mount instead. 128 MiB would be enough for audio encoding benchmarks. Compression benchmarks are more problematic though.

      EDIT: nevermind, I/O redirection seems fine. Redirecting STDOUT to /dev/null would indeed be a good idea.
      Last edited by apaige; 16 May 2008, 07:41 AM.

      Comment


      • #4
        Do you mean encoding to /dev/null or just redirecting stdout/err to /dev/null?

        Comment


        • #5
          Look into the gzip benchmark, this one is already updated to use no temp files at all.

          Comment


          • #6
            Yep, I'm modifying encode-flac to do a similar thing now.

            Comment


            • #7
              OK, a "no temp files" encode-flac:

              Code:
              diff --git a/pts/test-resources/encode-flac/install.sh b/pts/test-resources/encode-flac/install.sh
              index 997826e..33cb9d4 100644
              --- a/pts/test-resources/encode-flac/install.sh
              +++ b/pts/test-resources/encode-flac/install.sh
              @@ -14,6 +14,5 @@ cd ..
               rm -rf flac-1.2.1/
              
               echo "#!/bin/sh
              -/usr/bin/time -f \"WAV To FLAC Encode Time: %e Seconds\" ./flac_/bin/flac -s --best ../pts-shared/pts-trondheim.wav -o ./pts-trondheim.flac 2>&1
              -rm -f pts-trondheim.flac" > flac
              +/usr/bin/time -f \"WAV To FLAC Encode Time: %e Seconds\" ./flac_/bin/flac -s --best --totally-silent ../pts-shared/pts-trondheim.wav -f -o /dev/null 2>&1" > flac
               chmod +x flac
              diff --git a/pts/test-resources/encode-flac/post.sh b/pts/test-resources/encode-flac/post.sh
              deleted file mode 100644
              index 2bb0f97..0000000
              --- a/pts/test-resources/encode-flac/post.sh
              +++ /dev/null
              @@ -1,4 +0,0 @@
              -#!/bin/sh
              -
              -cd $1
              -rm -f pts-trondheim.flac
              diff --git a/pts/test-resources/encode-flac/pre.sh b/pts/test-resources/encode-flac/pre.sh
              deleted file mode 100644
              index 2bb0f97..0000000
              --- a/pts/test-resources/encode-flac/pre.sh
              +++ /dev/null
              @@ -1,4 +0,0 @@
              -#!/bin/sh
              -
              -cd $1
              -rm -f pts-trondheim.flac

              Comment


              • #8
                Will be committed to master momentarily.
                Michael Larabel
                https://www.michaellarabel.com/

                Comment

                Working...
                X