[Feature][ZXW-88]merge P50 version

Only Configure: No
Affected branch: master
Affected module: unknown
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I34667719d9e0e7e29e8e4368848601cde0a48408
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngimage-full b/ap/lib/libpng/libpng-1.6.37/tests/pngimage-full
new file mode 100755
index 0000000..1198ed0
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngimage-full
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngimage --exhaustive --list-combos --log "${srcdir}/contrib/pngsuite/"*.png
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngimage-quick b/ap/lib/libpng/libpng-1.6.37/tests/pngimage-quick
new file mode 100755
index 0000000..328dc27
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngimage-quick
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngimage --list-combos --log "${srcdir}/contrib/pngsuite/"*.png
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest b/ap/lib/libpng/libpng-1.6.37/tests/pngstest
new file mode 100755
index 0000000..9d1b776
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# Usage:
+#
+#  tests/pngstest gamma alpha
+#
+# Run ./pngstest on the PNG files in $srcdir/contrib/testpngs which have the
+# given gamma and opacity:
+#
+#  gamma: one of; linear, 1.8, sRGB, none.
+#  alpha: one of; opaque, tRNS, alpha, none.  'none' is equivalent to !alpha
+#
+# NOTE: the temporary files pngstest generates have the base name gamma-alpha to
+# avoid issues with make -j
+#
+gamma="$1"
+shift
+alpha="$1"
+shift
+args=
+LC_ALL="C" # fix glob sort order to ASCII:
+for f in "${srcdir}/contrib/testpngs/"*.png
+do
+   g=
+   case "$f" in
+      *-linear[.-]*)
+         test "$gamma" = "linear" && g="$f";;
+
+      *-sRGB[.-]*)
+         test "$gamma" = "sRGB" && g="$f";;
+
+      *-1.8[.-]*)
+         test "$gamma" = "1.8" && g="$f";;
+
+      *)
+         test "$gamma" = "none" && g="$f";;
+   esac
+
+   case "$g" in
+      "")
+         :;;
+
+      *-alpha[-.]*)
+         test "$alpha" = "alpha" && args="$args $g";;
+
+      *-tRNS[-.]*)
+         test "$alpha" = "tRNS" -o "$alpha" = "none" && args="$args $g";;
+
+      *)
+         test "$alpha" = "opaque" -o "$alpha" = "none" && args="$args $g";;
+   esac
+done
+# This only works if the arguments don't contain spaces; they don't.
+exec ./pngstest --tmpfile "${gamma}-${alpha}-" --log ${1+"$@"} $args
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest-1.8 b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-1.8
new file mode 100755
index 0000000..b2ec21b
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-1.8
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "${srcdir}/tests/pngstest" 1.8 none
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest-1.8-alpha b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-1.8-alpha
new file mode 100755
index 0000000..d00596d
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-1.8-alpha
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "${srcdir}/tests/pngstest" 1.8 alpha
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest-linear b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-linear
new file mode 100755
index 0000000..4a5b3fe
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-linear
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "${srcdir}/tests/pngstest" linear none
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest-linear-alpha b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-linear-alpha
new file mode 100755
index 0000000..4114210
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-linear-alpha
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "${srcdir}/tests/pngstest" linear alpha
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest-none b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-none
new file mode 100755
index 0000000..09ad740
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-none
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "${srcdir}/tests/pngstest" none none
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest-none-alpha b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-none-alpha
new file mode 100755
index 0000000..af6083f
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-none-alpha
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "${srcdir}/tests/pngstest" none alpha
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest-sRGB b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-sRGB
new file mode 100755
index 0000000..d846081
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-sRGB
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "${srcdir}/tests/pngstest" sRGB none
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngstest-sRGB-alpha b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-sRGB-alpha
new file mode 100755
index 0000000..f1e57d3
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngstest-sRGB-alpha
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "${srcdir}/tests/pngstest" sRGB alpha
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngtest b/ap/lib/libpng/libpng-1.6.37/tests/pngtest
new file mode 100755
index 0000000..813973b
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngtest
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngtest --strict ${srcdir}/pngtest.png
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngtest-badpngs b/ap/lib/libpng/libpng-1.6.37/tests/pngtest-badpngs
new file mode 100755
index 0000000..7777523
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngtest-badpngs
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# various crashers
+# using --relaxed because some come from fuzzers that don't maintain CRC's
+
+./pngtest --relaxed ${srcdir}/contrib/testpngs/crashers/badcrc.png
+./pngtest --relaxed ${srcdir}/contrib/testpngs/crashers/badadler.png
+./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/bad_iCCP.png
+./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/empty_ancillary_chunks.png
+./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_*_chunk.png \
+    ${srcdir}/contrib/testpngs/crashers/huge_*safe_to_copy.png
+
+exec ./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_IDAT.png
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-IDAT b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-IDAT
new file mode 100755
index 0000000..8e7281a
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-IDAT
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngunknown --strict default=discard IDAT=save "${srcdir}/pngtest.png"
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-discard b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-discard
new file mode 100755
index 0000000..c96dab3
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-discard
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngunknown --strict default=discard "${srcdir}/pngtest.png"
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-if-safe b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-if-safe
new file mode 100755
index 0000000..31a4954
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-if-safe
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngunknown --strict default=if-safe "${srcdir}/pngtest.png"
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-sAPI b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-sAPI
new file mode 100755
index 0000000..88a1f6b
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-sAPI
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngunknown --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save eXIf=save "${srcdir}/pngtest.png"
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-sTER b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-sTER
new file mode 100755
index 0000000..59c5ecd
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-sTER
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngunknown --strict sTER=if-safe "${srcdir}/pngtest.png"
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-save b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-save
new file mode 100755
index 0000000..21412c4
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-save
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngunknown --strict default=save "${srcdir}/pngtest.png"
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-vpAg b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-vpAg
new file mode 100755
index 0000000..04f07b6
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngunknown-vpAg
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngunknown --strict vpAg=if-safe "${srcdir}/pngtest.png"
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-16-to-8 b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-16-to-8
new file mode 100755
index 0000000..074945d
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-16-to-8
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-16-to-8
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-alpha-mode b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-alpha-mode
new file mode 100755
index 0000000..b16e8ab
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-alpha-mode
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-alpha-mode
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-background b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-background
new file mode 100755
index 0000000..3dbf58d
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-background
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-background
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-alpha-mode b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-alpha-mode
new file mode 100755
index 0000000..4fa10bd
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-alpha-mode
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-alpha-mode --expand16
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-background b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-background
new file mode 100755
index 0000000..ad9a917
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-background
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-background --expand16
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-transform b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-transform
new file mode 100755
index 0000000..5fd1f28
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-expand16-transform
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-transform --expand16
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-sbit b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-sbit
new file mode 100755
index 0000000..6ca08e9
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-sbit
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-sbit
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-threshold b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-threshold
new file mode 100755
index 0000000..3fe4edf
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-threshold
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-threshold
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-transform b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-transform
new file mode 100755
index 0000000..3fa62c6
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-gamma-transform
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --gamma-transform
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-interlace-standard b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-interlace-standard
new file mode 100755
index 0000000..a8cdf9e
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-interlace-standard
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --standard --progressive-read --interlace
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-size b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-size
new file mode 100755
index 0000000..868d6dc
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-size
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --size --progressive-read
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-standard b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-standard
new file mode 100755
index 0000000..bf7e5c1
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-progressive-standard
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --standard --progressive-read
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-standard b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-standard
new file mode 100755
index 0000000..a89b884
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-standard
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --standard
diff --git a/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-transform b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-transform
new file mode 100755
index 0000000..c7536ae
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/tests/pngvalid-transform
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ./pngvalid --strict --transform