FATE: Add FITS tests
authorParas Chadha <paraschadha18@gmail.com>
Tue, 29 Aug 2017 17:36:42 +0000 (23:06 +0530)
committerPaul B Mahol <onemda@gmail.com>
Wed, 30 Aug 2017 10:13:02 +0000 (12:13 +0200)
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
22 files changed:
tests/Makefile
tests/fate/avformat.mak
tests/fate/demux.mak
tests/fate/fits.mak [new file with mode: 0644]
tests/lavf-regression.sh
tests/ref/fate/fits-demux [new file with mode: 0644]
tests/ref/fate/fitsdec-bitpix-32 [new file with mode: 0644]
tests/ref/fate/fitsdec-bitpix-64 [new file with mode: 0644]
tests/ref/fate/fitsdec-blank_bitpix32 [new file with mode: 0644]
tests/ref/fate/fitsdec-ext_data_min_max [new file with mode: 0644]
tests/ref/fate/fitsdec-gbrap16 [new file with mode: 0644]
tests/ref/fate/fitsdec-gbrp [new file with mode: 0644]
tests/ref/fate/fitsdec-gbrp16 [new file with mode: 0644]
tests/ref/fate/fitsdec-gray [new file with mode: 0644]
tests/ref/fate/fitsdec-multi [new file with mode: 0644]
tests/ref/fate/fitsenc-gbrap [new file with mode: 0644]
tests/ref/fate/fitsenc-gbrap16be [new file with mode: 0644]
tests/ref/fate/fitsenc-gbrp [new file with mode: 0644]
tests/ref/fate/fitsenc-gbrp16be [new file with mode: 0644]
tests/ref/fate/fitsenc-gray [new file with mode: 0644]
tests/ref/fate/fitsenc-gray16be [new file with mode: 0644]
tests/ref/lavf/fits [new file with mode: 0644]

index 30f05be..18fe9c5 100644 (file)
@@ -131,6 +131,7 @@ include $(SRC_PATH)/tests/fate/fft.mak
 include $(SRC_PATH)/tests/fate/fifo-muxer.mak
 include $(SRC_PATH)/tests/fate/filter-audio.mak
 include $(SRC_PATH)/tests/fate/filter-video.mak
+include $(SRC_PATH)/tests/fate/fits.mak
 include $(SRC_PATH)/tests/fate/flac.mak
 include $(SRC_PATH)/tests/fate/flvenc.mak
 include $(SRC_PATH)/tests/fate/gapless.mak
index 82a531c..c4cf2bc 100644 (file)
@@ -10,6 +10,7 @@ FATE_LAVF-$(call ENCDEC,  PCM_S16BE,             CAF)                += caf
 FATE_LAVF-$(call ENCDEC,  DPX,                   IMAGE2)             += dpx
 FATE_LAVF-$(call ENCDEC2, DVVIDEO,    PCM_S16LE, AVI)                += dv_fmt
 FATE_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,       FFM)                += ffm
+FATE_LAVF-$(call ENCDEC,  FITS,                  IMAGE2)             += fits
 FATE_LAVF-$(call ENCDEC,  RAWVIDEO,              FILMSTRIP)          += flm
 FATE_LAVF-$(call ENCDEC,  FLV,                   FLV)                += flv_fmt
 FATE_LAVF-$(call ENCDEC,  GIF,                   IMAGE2)             += gif
index 8a2703f..261b004 100644 (file)
@@ -36,6 +36,10 @@ fate-d-cinema-demux: CMD = framecrc -i $(TARGET_SAMPLES)/d-cinema/THX_Science_FL
 FATE_SAMPLES_DEMUX-$(CONFIG_EA_DEMUXER) += fate-d-eavp6-demux
 fate-d-eavp6-demux: CMD = framecrc -i $(TARGET_SAMPLES)/ea-vp6/SmallRing.vp6 -map 0 -vcodec copy
 
+FATE_SAMPLES_DEMUX-$(CONFIG_FITS_DEMUXER) += fate-fits-demux
+fate-fits-demux: tests/data/fits-multi.fits
+fate-fits-demux: CMD = framecrc -i $(TARGET_PATH)/tests/data/fits-multi.fits -vcodec copy
+
 FATE_SAMPLES_DEMUX-$(CONFIG_FLV_DEMUXER) += fate-flv-demux
 fate-flv-demux: CMD = framecrc -i $(TARGET_SAMPLES)/flv/Enigma_Principles_of_Lust-part.flv -codec copy
 
diff --git a/tests/fate/fits.mak b/tests/fate/fits.mak
new file mode 100644 (file)
index 0000000..bc1b771
--- /dev/null
@@ -0,0 +1,59 @@
+tests/data/fits-multi.fits: TAG = GEN
+tests/data/fits-multi.fits: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+        -i $(TARGET_SAMPLES)/gif/m4nb.gif \
+        -y $(TARGET_PATH)/$(@) 2>/dev/null
+
+#mapping of fits file formats to png filenames
+map.tests/data/lena-gray.fits    := gray8
+map.tests/data/lena-gbrp.fits    := rgb24
+map.tests/data/lena-gbrp16.fits  := rgb48
+map.tests/data/lena-gbrap16.fits := rgba64
+
+tests/data/lena%.fits: TAG = GEN
+tests/data/lena%.fits: NAME = $(map.$(@))
+tests/data/lena%.fits: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+        -i $(TARGET_SAMPLES)/png1/lena-$(map.$(@)).png \
+        -y $(TARGET_PATH)/$(@) 2>/dev/null
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-ext_data_min_max
+fate-fitsdec-ext_data_min_max: CMD = framecrc -i $(TARGET_SAMPLES)/fits/x0cj010ct_d0h.fit -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-blank_bitpix32
+fate-fitsdec-blank_bitpix32: CMD = framecrc -blank_value 65535 -i $(TARGET_SAMPLES)/fits/file008.fits -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-bitpix-32
+fate-fitsdec-bitpix-32: CMD = framecrc -i $(TARGET_SAMPLES)/fits/tst0005.fits -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-bitpix-64
+fate-fitsdec-bitpix-64: CMD = framecrc -i $(TARGET_SAMPLES)/fits/tst0006.fits -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-multi
+fate-fitsdec-multi: tests/data/fits-multi.fits
+fate-fitsdec-multi: CMD = framecrc -i $(TARGET_PATH)/tests/data/fits-multi.fits -pix_fmt gbrap
+
+fate-fitsdec%: PIXFMT = $(word 3, $(subst -, ,$(@)))
+fate-fitsdec%: SRC = $(TARGET_PATH)/tests/data/lena-$(PIXFMT).fits
+fate-fitsdec%: CMD = framecrc -i $(SRC) -pix_fmt $(PIXFMT)
+
+FATE_FITS_DEC_PIXFMT = gray gbrp gbrp16 gbrap16
+$(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%): fate-fitsdec-%: tests/data/lena-%.fits
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += $(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%)
+
+FATE_FITS += $(FATE_FITS_DEC-yes)
+fate-fitsdec: $(FATE_FITS_DEC-yes)
+
+fate-fitsenc%: PIXFMT = $(word 3, $(subst -, ,$(@)))
+fate-fitsenc%: SRC = $(TARGET_PATH)/tests/data/fits-multi.fits
+fate-fitsenc%: CMD = framecrc -i $(SRC) -c:v fits -pix_fmt $(PIXFMT)
+
+FATE_FITS_ENC_PIXFMT = gray gray16be gbrp gbrap gbrp16be gbrap16be
+$(FATE_FITS_ENC_PIXFMT:%=fate-fitsenc-%): tests/data/fits-multi.fits
+FATE_FITS_ENC-$(call ENCDEC, FITS, FITS) += $(FATE_FITS_ENC_PIXFMT:%=fate-fitsenc-%)
+
+FATE_FITS += $(FATE_FITS_ENC-yes)
+fate-fitsenc: $(FATE_FITS_ENC-yes)
+
+FATE_SAMPLES_FFMPEG += $(FATE_FITS)
+fate-fits: $(FATE_FITS)
index eda40f2..d9026de 100755 (executable)
@@ -230,6 +230,15 @@ do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -q
 #do_avconv_crc $file -i $target_path/$file
 fi
 
+if [ -n "$do_fits" ] ; then
+pix_fmts="gray gray16be gbrp gbrap gbrp16be gbrap16be"
+for pix_fmt in $pix_fmts ; do
+    file=${outfile}${pix_fmt}lavf.fits
+    do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -pix_fmt $pix_fmt
+    do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt $pix_fmt
+done
+fi
+
 # image formats
 
 if [ -n "$do_pgm" ] ; then
diff --git a/tests/ref/fate/fits-demux b/tests/ref/fate/fits-demux
new file mode 100644 (file)
index 0000000..85605ab
--- /dev/null
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0,          0,          0,        1,    14320, 0x0ecf72e0
+0,          1,          1,        1,    14320, 0xd94af6eb
+0,          2,          2,        1,    14320, 0x15c21892
+0,          3,          3,        1,    14320, 0xb18adc01
+0,          4,          4,        1,    14320, 0xc2be706d
diff --git a/tests/ref/fate/fitsdec-bitpix-32 b/tests/ref/fate/fitsdec-bitpix-32
new file mode 100644 (file)
index 0000000..9bce361
--- /dev/null
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 102x109
+#sar 0: 0/1
+0,          0,          0,        1,    22236, 0x34490902
diff --git a/tests/ref/fate/fitsdec-bitpix-64 b/tests/ref/fate/fitsdec-bitpix-64
new file mode 100644 (file)
index 0000000..9febdd6
--- /dev/null
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 77x173
+#sar 0: 0/1
+0,          0,          0,        1,    26642, 0x0ad2a46a
diff --git a/tests/ref/fate/fitsdec-blank_bitpix32 b/tests/ref/fate/fitsdec-blank_bitpix32
new file mode 100644 (file)
index 0000000..184fd41
--- /dev/null
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 256x256
+#sar 0: 0/1
+0,          0,          0,        1,   131072, 0x7fb22427
diff --git a/tests/ref/fate/fitsdec-ext_data_min_max b/tests/ref/fate/fitsdec-ext_data_min_max
new file mode 100644 (file)
index 0000000..9009a4e
--- /dev/null
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 512x512
+#sar 0: 0/1
+0,          0,          0,        1,   524288, 0xc327ed23
diff --git a/tests/ref/fate/fitsdec-gbrap16 b/tests/ref/fate/fitsdec-gbrap16
new file mode 100644 (file)
index 0000000..78abb5c
--- /dev/null
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 128x128
+#sar 0: 0/1
+0,          0,          0,        1,   131072, 0x487894b2
diff --git a/tests/ref/fate/fitsdec-gbrp b/tests/ref/fate/fitsdec-gbrp
new file mode 100644 (file)
index 0000000..8767b67
--- /dev/null
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 128x128
+#sar 0: 0/1
+0,          0,          0,        1,    49152, 0x565c3dee
diff --git a/tests/ref/fate/fitsdec-gbrp16 b/tests/ref/fate/fitsdec-gbrp16
new file mode 100644 (file)
index 0000000..f6368f2
--- /dev/null
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 128x128
+#sar 0: 0/1
+0,          0,          0,        1,    98304, 0x1b917bdc
diff --git a/tests/ref/fate/fitsdec-gray b/tests/ref/fate/fitsdec-gray
new file mode 100644 (file)
index 0000000..425b31f
--- /dev/null
@@ -0,0 +1,6 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 128x128
+#sar 0: 0/1
+0,          0,          0,        1,    16384, 0xd788a2d2
diff --git a/tests/ref/fate/fitsdec-multi b/tests/ref/fate/fitsdec-multi
new file mode 100644 (file)
index 0000000..f24f0ad
--- /dev/null
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 72x36
+#sar 0: 0/1
+0,          0,          0,        1,    10368, 0xb4490cc8
+0,          1,          1,        1,    10368, 0x37198e4f
+0,          2,          2,        1,    10368, 0x1e89afe7
+0,          3,          3,        1,    10368, 0x80127365
+0,          4,          4,        1,    10368, 0xfd2d07d1
diff --git a/tests/ref/fate/fitsenc-gbrap b/tests/ref/fate/fitsenc-gbrap
new file mode 100644 (file)
index 0000000..3e32fc6
--- /dev/null
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0,          0,          0,        1,    11520, 0xeb0a0cc8
+0,          1,          1,        1,    11520, 0x9d7d8e4f
+0,          2,          2,        1,    11520, 0xd9e6afe7
+0,          3,          3,        1,    11520, 0x75bd7365
+0,          4,          4,        1,    11520, 0x86f107d1
diff --git a/tests/ref/fate/fitsenc-gbrap16be b/tests/ref/fate/fitsenc-gbrap16be
new file mode 100644 (file)
index 0000000..1f74f4e
--- /dev/null
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0,          0,          0,        1,    23040, 0xfa4ff4f0
+0,          1,          1,        1,    23040, 0xf57102d4
+0,          2,          2,        1,    23040, 0x58e0294d
+0,          3,          3,        1,    23040, 0x8097502a
+0,          4,          4,        1,    23040, 0x65fd7b54
diff --git a/tests/ref/fate/fitsenc-gbrp b/tests/ref/fate/fitsenc-gbrp
new file mode 100644 (file)
index 0000000..4101a0e
--- /dev/null
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0,          0,          0,        1,     8640, 0xf6b9f643
+0,          1,          1,        1,     8640, 0x250d77d9
+0,          2,          2,        1,     8640, 0x652595e5
+0,          3,          3,        1,     8640, 0x4b8e5963
+0,          4,          4,        1,     8640, 0xd8d611ab
diff --git a/tests/ref/fate/fitsenc-gbrp16be b/tests/ref/fate/fitsenc-gbrp16be
new file mode 100644 (file)
index 0000000..d4b043f
--- /dev/null
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0,          0,          0,        1,    17280, 0x6b87eec5
+0,          1,          1,        1,    17280, 0x1bf0fc9a
+0,          2,          2,        1,    17280, 0xaf071b1e
+0,          3,          3,        1,    17280, 0xfbe941fb
+0,          4,          4,        1,    17280, 0xbbc26d01
diff --git a/tests/ref/fate/fitsenc-gray b/tests/ref/fate/fitsenc-gray
new file mode 100644 (file)
index 0000000..46eb76c
--- /dev/null
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0,          0,          0,        1,     2880, 0xd2d83752
+0,          1,          1,        1,     2880, 0x77246e79
+0,          2,          2,        1,     2880, 0xdf480c1f
+0,          3,          3,        1,     2880, 0x559247a9
+0,          4,          4,        1,     2880, 0xc3df2cc4
diff --git a/tests/ref/fate/fitsenc-gray16be b/tests/ref/fate/fitsenc-gray16be
new file mode 100644 (file)
index 0000000..ec4e0ef
--- /dev/null
@@ -0,0 +1,10 @@
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: fits
+#dimensions 0: 72x36
+#sar 0: 0/1
+0,          0,          0,        1,     5760, 0x317ba180
+0,          1,          1,        1,     5760, 0x439c9e40
+0,          2,          2,        1,     5760, 0x6136ff8f
+0,          3,          3,        1,     5760, 0x2c331324
+0,          4,          4,        1,     5760, 0x2f0816c1
diff --git a/tests/ref/lavf/fits b/tests/ref/lavf/fits
new file mode 100644 (file)
index 0000000..489542b
--- /dev/null
@@ -0,0 +1,18 @@
+ed9fd697d0d782df6201f6a2db184552 *./tests/data/lavf/graylavf.fits
+5328000 ./tests/data/lavf/graylavf.fits
+./tests/data/lavf/graylavf.fits CRC=0xbacf446c
+48e6caf6a59e32f9a8a39979c9183a7f *./tests/data/lavf/gray16belavf.fits
+10368000 ./tests/data/lavf/gray16belavf.fits
+./tests/data/lavf/gray16belavf.fits CRC=0xae2b58d4
+be2f7112fd193c9a909304c81e662769 *./tests/data/lavf/gbrplavf.fits
+15408000 ./tests/data/lavf/gbrplavf.fits
+./tests/data/lavf/gbrplavf.fits CRC=0x04ed3828
+c89a72185cfad363aa9cc42e84fed301 *./tests/data/lavf/gbraplavf.fits
+20448000 ./tests/data/lavf/gbraplavf.fits
+./tests/data/lavf/gbraplavf.fits CRC=0x032a6409
+d539b9e02f5ab8fb85717c8adb60b6cc *./tests/data/lavf/gbrp16belavf.fits
+30672000 ./tests/data/lavf/gbrp16belavf.fits
+./tests/data/lavf/gbrp16belavf.fits CRC=0x81897ff7
+3dc3622fb09a338b406d8a12a30f2545 *./tests/data/lavf/gbrap16belavf.fits
+40752000 ./tests/data/lavf/gbrap16belavf.fits
+./tests/data/lavf/gbrap16belavf.fits CRC=0x247dd7b9