Added testdata

This commit is contained in:
DataHoarder 2022-11-11 09:48:17 +01:00
parent 9943954038
commit 0853a5cb2b
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
3 changed files with 31 additions and 0 deletions

1
testdata/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.y4m

9
testdata/prepare.sh vendored Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
pushd "${0%/*}" || exit
# Samples taken from https://media.xiph.org/
if [[ ! -f "sintel_trailer_2k_720p24.y4m" ]]; then
wget --show-progress -O "sintel_trailer_2k_720p24.y4m" https://media.xiph.org/video/derf/y4m/sintel_trailer_2k_720p24.y4m
fi

21
testdata/testdata.go vendored Normal file
View file

@ -0,0 +1,21 @@
package testdata
import (
"os"
"path"
"runtime"
)
func init() {
_, filename, _, _ := runtime.Caller(0)
// The ".." may change depending on you folder structure
dir := path.Join(path.Dir(filename), "..")
err := os.Chdir(dir)
if err != nil {
panic(err)
}
}
const (
Y4M_Sintel_Trailer_720p24_YUV420_8bit = "testdata/sintel_trailer_2k_720p24.y4m"
)