summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteven Robertson <steven@strobe.cc>2012-07-10 22:14:57 -0700
committerStefano Sabatini <stefasab@gmail.com>2012-07-22 12:17:34 +0200
commit82ecae8a7069104698d491000b37629cd8d96fd8 (patch)
tree90de57d08d4e0c14ff9b05f40172b25255a30392 /tests
parent8c2ce16f93be0fc1362ab74846b46c9818da14be (diff)
lavfi: add alphaextract and alphamerge filters
These filters are designed for storing and transmitting video sequences with alpha using higher-efficiency codecs such as x264 which don't natively support an alpha channel. 'alphaextract' takes an input stream with an alpha channel and returns a video containing just the alpha component as a grayscale value; 'alphamerge' takes an RGB or YUV stream and adds an alpha channel recovered from a second grayscale stream. Signed-off-by: Steven Robertson <steven@strobe.cc> Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/lavfi-regression.sh15
-rw-r--r--tests/ref/lavfi/alphaextract_rgb1
-rw-r--r--tests/ref/lavfi/alphaextract_yuv1
-rw-r--r--tests/ref/lavfi/alphamerge_rgb1
-rw-r--r--tests/ref/lavfi/alphamerge_yuv1
5 files changed, 16 insertions, 3 deletions
diff --git a/tests/lavfi-regression.sh b/tests/lavfi-regression.sh
index dd5e2dac62..61040445bf 100755
--- a/tests/lavfi-regression.sh
+++ b/tests/lavfi-regression.sh
@@ -13,21 +13,25 @@ eval do_$test=y
do_video_filter() {
label=$1
- filters=$2
+ filters="$2"
shift 2
printf '%-20s' $label
run_avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
$ENC_OPTS -vf "$filters" -vcodec rawvideo $* -f nut md5:
}
-do_lavfi() {
- vfilters="slicify=random,$2"
+do_lavfi_plain() {
+ vfilters="$2"
if [ $test = $1 ] ; then
do_video_filter $test "$vfilters"
fi
}
+do_lavfi() {
+ do_lavfi_plain $1 "slicify=random,$2"
+}
+
do_lavfi_colormatrix() {
do_lavfi "${1}1" "$1=$4:$5,$1=$5:$3,$1=$3:$4,$1=$4:$3,$1=$3:$5,$1=$5:$2"
do_lavfi "${1}2" "$1=$2:$3,$1=$3:$2,$1=$2:$4,$1=$4:$2,$1=$2:$5,$1=$5:$4"
@@ -60,6 +64,11 @@ do_lavfi "vflip" "vflip"
do_lavfi "vflip_crop" "vflip,crop=iw-100:ih-100:100:100"
do_lavfi "vflip_vflip" "vflip,vflip"
+do_lavfi_plain "alphamerge_rgb" "[in]slicify=random,format=bgra,split,alphamerge[out]"
+do_lavfi_plain "alphamerge_yuv" "[in]slicify=random,format=yuv420p,split,alphamerge[out]"
+do_lavfi_plain "alphaextract_rgb" "[in]slicify=random,format=bgra,split,alphamerge,slicify=random,split[o3][o4];[o4]alphaextract[alpha];[o3][alpha]alphamerge[out]"
+do_lavfi_plain "alphaextract_yuv" "[in]slicify=random,format=yuv420p,split,alphamerge,slicify=random,split[o3][o4];[o4]alphaextract[alpha];[o3][alpha]alphamerge[out]"
+
do_lavfi_colormatrix "colormatrix" bt709 fcc bt601 smpte240m
do_lavfi_pixfmts(){
diff --git a/tests/ref/lavfi/alphaextract_rgb b/tests/ref/lavfi/alphaextract_rgb
new file mode 100644
index 0000000000..3b86986bae
--- /dev/null
+++ b/tests/ref/lavfi/alphaextract_rgb
@@ -0,0 +1 @@
+alphaextract_rgb b706818ea0d324e0d43adbaef9ab3470
diff --git a/tests/ref/lavfi/alphaextract_yuv b/tests/ref/lavfi/alphaextract_yuv
new file mode 100644
index 0000000000..7bfcf8629f
--- /dev/null
+++ b/tests/ref/lavfi/alphaextract_yuv
@@ -0,0 +1 @@
+alphaextract_yuv 430b779a379ad9c38f3b4c190f723cd4
diff --git a/tests/ref/lavfi/alphamerge_rgb b/tests/ref/lavfi/alphamerge_rgb
new file mode 100644
index 0000000000..6dc3b9a513
--- /dev/null
+++ b/tests/ref/lavfi/alphamerge_rgb
@@ -0,0 +1 @@
+alphamerge_rgb b706818ea0d324e0d43adbaef9ab3470
diff --git a/tests/ref/lavfi/alphamerge_yuv b/tests/ref/lavfi/alphamerge_yuv
new file mode 100644
index 0000000000..ecd7bf8d9b
--- /dev/null
+++ b/tests/ref/lavfi/alphamerge_yuv
@@ -0,0 +1 @@
+alphamerge_yuv 430b779a379ad9c38f3b4c190f723cd4