Results 1 to 8 of 8

Thread: Patch for encode-flac

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default 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. #2
    Join Date
    Aug 2007
    Posts
    6,673

    Default

    Why do you never use /dev/null for outputs?

  3. #3
    Join Date
    Apr 2008
    Posts
    126

    Default

    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; 05-16-2008 at 08:41 AM.

  4. #4
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default

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

  5. #5
    Join Date
    Aug 2007
    Posts
    6,673

    Default

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

  6. #6
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default

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

  7. #7
    Join Date
    Apr 2008
    Location
    York, UK
    Posts
    134

    Default

    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

  8. #8

    Default

    Will be committed to master momentarily.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •