diff --git a/.gitignore b/.gitignore
index 9fc0ac269cfa68787fe3baa85c11ae3f67c2e8da..3e6e18ca7238c7a8a79485004b2470b804f106e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,6 +66,7 @@
 /libavutil/ffversion.h
 /src
 /tests/audiogen
+/tests/audiomatch
 /tests/base64
 /tests/checkasm/checkasm
 /tests/data/
diff --git a/Makefile b/Makefile
index 87a986965742280bbda3949d34a87e354a96f798..d881fcc574de7e3a33fcf4c30085b897a09e7ed2 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
 OBJS-ffmpeg-$(CONFIG_LIBMFX)  += ffmpeg_qsv.o
 OBJS-ffserver                 += ffserver_config.o
 
-TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
+TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
 HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
 TOOLS       = qt-faststart trasher uncoded_frame
 TOOLS-$(CONFIG_ZLIB) += cws2fws
diff --git a/tests/Makefile b/tests/Makefile
index 6e5dfa6e1b4b0e9792b3c372f0196b01798dcf44..6fef0cd7f0b87be1ed585db6afe800971fc33582 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -200,7 +200,7 @@ $(FATE_EXTERN):
 	@echo "$@ requires external samples and SAMPLES not specified"; false
 endif
 
-FATE_UTILS = base64 tiny_psnr tiny_ssim
+FATE_UTILS = base64 tiny_psnr tiny_ssim audiomatch
 
 TOOL = ffmpeg
 
diff --git a/tests/audiomatch.c b/tests/audiomatch.c
new file mode 100644
index 0000000000000000000000000000000000000000..6d181cff1ecfdaec904e72dcdb73e843ebeea3f0
--- /dev/null
+++ b/tests/audiomatch.c
@@ -0,0 +1,110 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <inttypes.h>
+
+#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
+#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+
+static int64_t fsize(FILE *f){
+    int64_t end, pos= ftell(f);
+    fseek(f, 0, SEEK_END);
+    end = ftell(f);
+    fseek(f, pos, SEEK_SET);
+    return end;
+}
+
+int main(int argc, char **argv){
+    FILE *f[2];
+    int i, pos;
+    int siglen, datlen;
+    int bestpos;
+    double bestc=0;
+    double sigamp= 0;
+    int16_t *signal, *data;
+    int maxshift= 16384;
+
+    if (argc < 3) {
+        printf("audiomatch <testfile> <reffile>\n");
+        printf("WAV headers are skipped automatically.\n");
+        return 1;
+    }
+
+    f[0] = fopen(argv[1], "rb");
+    f[1] = fopen(argv[2], "rb");
+    if (!f[0] || !f[1]) {
+        fprintf(stderr, "Could not open input files.\n");
+        return 1;
+    }
+
+    for (i = 0; i < 2; i++) {
+        uint8_t p[100];
+        if (fread(p, 1, 12, f[i]) != 12)
+            return 1;
+        if (!memcmp(p, "RIFF", 4) &&
+            !memcmp(p + 8, "WAVE", 4)) {
+            if (fread(p, 1, 8, f[i]) != 8)
+                return 1;
+            while (memcmp(p, "data", 4)) {
+                int s = p[4] | p[5] << 8 | p[6] << 16 | p[7] << 24;
+                fseek(f[i], s, SEEK_CUR);
+                if (fread(p, 1, 8, f[i]) != 8)
+                    return 1;
+            }
+        } else {
+            fseek(f[i], -12, SEEK_CUR);
+        }
+    }
+
+    datlen = fsize(f[0]) - ftell(f[0]);
+    siglen = fsize(f[1]) - ftell(f[1]);
+    data   = malloc(datlen * sizeof(*data));
+    signal = malloc(siglen * sizeof(*signal));
+
+    fread(data  , 1, datlen, f[0]);
+    fread(signal, 1, siglen, f[1]);
+    datlen /= 2;
+    siglen /= 2;
+
+    for(i=0; i<siglen; i++){
+        signal[i] = ((uint8_t*)(signal + i))[0] + 256*((uint8_t*)(signal + i))[1];
+        sigamp += signal[i] * signal[i];
+    }
+    for(i=0; i<datlen; i++)
+        data[i] = ((uint8_t*)(data + i))[0] + 256*((uint8_t*)(data + i))[1];
+
+    for(pos = 0; pos<maxshift; pos = pos < 0 ? -pos: -pos-1){
+        int64_t c= 0;
+        int testlen = FFMIN(siglen, datlen-pos);
+        for(i=FFMAX(0, -pos); i<testlen; i++){
+            int j= pos+i;
+            c += signal[i] * data[j];
+        }
+        if(fabs(c) > sigamp * 0.94)
+            maxshift = FFMIN(maxshift, fabs(pos)+128);
+        if(fabs(c)>fabs(bestc)){
+            bestc= c;
+            bestpos = pos;
+        }
+    }
+    printf("presig: %d postsig:%d c:%7.4f\n", bestpos, datlen - siglen - bestpos, bestc / sigamp);
+}
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 5631267a1cc12035eb3847a7ed58d9faeeac98b4..68b552cd3fbbc0883f73a9859be9e6e8f84db314 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -277,6 +277,18 @@ gaplessenc(){
     probegaplessinfo "$file1"
 }
 
+audio_match(){
+    sample=$(target_path $1)
+    trefile=$(target_path $2)
+    extra_args=$3
+
+    decfile="${outdir}/${test}.wav"
+    cleanfiles="$cleanfiles $decfile"
+
+    ffmpeg -i "$sample" -flags +bitexact -fflags +bitexact $extra_args -y $decfile
+    tests/audiomatch $decfile $trefile
+}
+
 concat(){
     template=$1
     sample=$2
diff --git a/tests/fate/gapless.mak b/tests/fate/gapless.mak
index 8cae3acd4fa6ca221c3d5af4e46f695d6b692568..0253b9ec61ee5f577bd771efad0a37177c474cb9 100644
--- a/tests/fate/gapless.mak
+++ b/tests/fate/gapless.mak
@@ -1,6 +1,98 @@
 FATE_GAPLESS-$(CONFIG_MP3_DEMUXER) += fate-gapless-mp3
 fate-gapless-mp3: CMD = gapless $(TARGET_SAMPLES)/gapless/gapless.mp3
 
+FATE_GAPLESS-$(CONFIG_MP3_DEMUXER) += fate-audiomatch-square-mp3
+fate-audiomatch-square-mp3: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/square3.mp3 $(TARGET_SAMPLES)/audiomatch/square3.wav
+
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-square-aac
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-16000-mono-lc-adts    fate-audiomatch-afconvert-16000-mono-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-44100-mono-lc-adts    fate-audiomatch-afconvert-44100-mono-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-16000-mono-he-adts    fate-audiomatch-afconvert-16000-mono-he-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-44100-mono-he-adts    fate-audiomatch-afconvert-44100-mono-he-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-16000-stereo-he-adts  fate-audiomatch-afconvert-16000-stereo-he-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-44100-stereo-he-adts  fate-audiomatch-afconvert-44100-stereo-he-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-16000-stereo-he2-adts fate-audiomatch-afconvert-16000-stereo-he2-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-44100-stereo-he2-adts fate-audiomatch-afconvert-44100-stereo-he2-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-16000-stereo-lc-adts  fate-audiomatch-afconvert-16000-stereo-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-afconvert-44100-stereo-lc-adts  fate-audiomatch-afconvert-44100-stereo-lc-m4a
+
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-faac-16000-mono-lc-adts    fate-audiomatch-faac-16000-mono-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-faac-44100-mono-lc-adts    fate-audiomatch-faac-44100-mono-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-faac-16000-stereo-lc-adts  fate-audiomatch-faac-16000-stereo-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-faac-44100-stereo-lc-adts  fate-audiomatch-faac-44100-stereo-lc-m4a
+
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-dolby-44100-mono-lc-mp4
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-dolby-44100-mono-he-mp4
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-dolby-44100-stereo-he-mp4
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-dolby-44100-stereo-he2-mp4
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-dolby-44100-stereo-lc-mp4
+
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-16000-mono-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-44100-mono-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-16000-mono-he-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-44100-mono-he-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-16000-stereo-he-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-44100-stereo-he-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-16000-stereo-he2-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-44100-stereo-he2-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-16000-stereo-lc-m4a
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-nero-44100-stereo-lc-m4a
+
+FATE_GAPLESS-$(CONFIG_MOV_DEMUXER) += fate-audiomatch-quicktime7-44100-stereo-lc-mp4 fate-audiomatch-quicktimeX-44100-stereo-lc-m4a
+
+fate-audiomatch-square-aac: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/square3.m4a $(TARGET_SAMPLES)/audiomatch/square3.wav
+
+fate-audiomatch-afconvert-16000-mono-lc-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_lc.adts  $(TARGET_SAMPLES)/audiomatch/tones_16000_mono.wav
+fate-audiomatch-afconvert-16000-mono-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_mono.wav
+fate-audiomatch-afconvert-16000-mono-he-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_he.adts  $(TARGET_SAMPLES)/audiomatch/tones_16000_mono.wav "-ac 1 -ar 16000"
+fate-audiomatch-afconvert-16000-mono-he-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_he.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_mono.wav "-ac 1 -ar 16000"
+fate-audiomatch-afconvert-16000-stereo-lc-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_lc.adts  $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav
+fate-audiomatch-afconvert-16000-stereo-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav
+fate-audiomatch-afconvert-16000-stereo-he-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he.adts  $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav "-ar 16000"
+fate-audiomatch-afconvert-16000-stereo-he-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav "-ar 16000"
+fate-audiomatch-afconvert-16000-stereo-he2-adts:CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he2.adts $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav "-ar 16000"
+fate-audiomatch-afconvert-16000-stereo-he2-m4a: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_stereo_aac_he2.m4a  $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav "-ar 16000"
+fate-audiomatch-afconvert-44100-mono-lc-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_lc.adts  $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav
+fate-audiomatch-afconvert-44100-mono-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav
+fate-audiomatch-afconvert-44100-mono-he-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_he.adts  $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav "-ac 1"
+fate-audiomatch-afconvert-44100-mono-he-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_mono_aac_he.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav "-ac 1"
+fate-audiomatch-afconvert-44100-stereo-lc-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_lc.adts  $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-afconvert-44100-stereo-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-afconvert-44100-stereo-he-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he.adts  $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-afconvert-44100-stereo-he-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-afconvert-44100-stereo-he2-adts:CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he2.adts $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-afconvert-44100-stereo-he2-m4a: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_afconvert_44100_stereo_aac_he2.m4a  $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+
+fate-audiomatch-dolby-44100-mono-lc-mp4:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_mono_aac_lc.mp4   $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav
+fate-audiomatch-dolby-44100-mono-he-mp4:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_mono_aac_he.mp4   $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav "-ac 1"
+fate-audiomatch-dolby-44100-stereo-lc-mp4:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_stereo_aac_lc.mp4   $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-dolby-44100-stereo-he-mp4:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_stereo_aac_he.mp4   $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-dolby-44100-stereo-he2-mp4: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_stereo_aac_he2.mp4  $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+
+fate-audiomatch-faac-16000-mono-lc-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_faac_16000_mono_aac_lc.adts  $(TARGET_SAMPLES)/audiomatch/tones_16000_mono.wav
+fate-audiomatch-faac-16000-mono-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_faac_16000_mono_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_mono.wav
+fate-audiomatch-faac-16000-stereo-lc-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_faac_16000_stereo_aac_lc.adts  $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav
+fate-audiomatch-faac-16000-stereo-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_faac_16000_stereo_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav
+fate-audiomatch-faac-44100-mono-lc-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_faac_44100_mono_aac_lc.adts  $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav
+fate-audiomatch-faac-44100-mono-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_faac_44100_mono_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav
+fate-audiomatch-faac-44100-stereo-lc-adts: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_faac_44100_stereo_aac_lc.adts  $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-faac-44100-stereo-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_faac_44100_stereo_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+
+fate-audiomatch-nero-16000-mono-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_16000_mono_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_mono.wav
+fate-audiomatch-nero-16000-mono-he-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_16000_mono_aac_he.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_mono.wav
+fate-audiomatch-nero-16000-stereo-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_16000_stereo_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav
+fate-audiomatch-nero-16000-stereo-he-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_16000_stereo_aac_he.m4a   $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav
+fate-audiomatch-nero-16000-stereo-he2-m4a: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_16000_stereo_aac_he2.m4a  $(TARGET_SAMPLES)/audiomatch/tones_16000_stereo.wav
+fate-audiomatch-nero-44100-mono-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_44100_mono_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav
+fate-audiomatch-nero-44100-mono-he-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_44100_mono_aac_he.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_mono.wav
+fate-audiomatch-nero-44100-stereo-lc-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_44100_stereo_aac_lc.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-nero-44100-stereo-he-m4a:  CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_44100_stereo_aac_he.m4a   $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-nero-44100-stereo-he2-m4a: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_nero_44100_stereo_aac_he2.m4a  $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+
+fate-audiomatch-quicktime7-44100-stereo-lc-mp4: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_quicktime7_44100_stereo_aac_lc.mp4  $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+fate-audiomatch-quicktimeX-44100-stereo-lc-m4a: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/tones_quicktimeX_44100_stereo_aac_lc.m4a  $(TARGET_SAMPLES)/audiomatch/tones_44100_stereo.wav
+
+
 FATE_GAPLESS = $(FATE_GAPLESS-yes)
 
 FATE_GAPLESSINFO_PROBE-$(call DEMDEC, MOV, AAC) += fate-gaplessinfo-itunes1
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-mono-he-adts b/tests/ref/fate/audiomatch-afconvert-16000-mono-he-adts
new file mode 100644
index 0000000000000000000000000000000000000000..8441bcca5c99f6db2651118772352eebf3551644
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-mono-he-adts
@@ -0,0 +1 @@
+presig: 2593 postsig:223 c: 0.9835
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-mono-he-m4a b/tests/ref/fate/audiomatch-afconvert-16000-mono-he-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..05c5a42e001a4b48487050dff43e692fb8b8b1fc
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-mono-he-m4a
@@ -0,0 +1 @@
+presig: 481 postsig:223 c: 0.9835
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-mono-lc-adts b/tests/ref/fate/audiomatch-afconvert-16000-mono-lc-adts
new file mode 100644
index 0000000000000000000000000000000000000000..df78497c3becb64995834c6eb07c693dd483a99b
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-mono-lc-adts
@@ -0,0 +1 @@
+presig: 2112 postsig:704 c: 0.9842
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-mono-lc-m4a b/tests/ref/fate/audiomatch-afconvert-16000-mono-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..a31c584c4cdec0da61f047ba0fd3ac2cc03a3be5
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-mono-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:704 c: 0.9842
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-adts b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-adts
new file mode 100644
index 0000000000000000000000000000000000000000..d2526f84e19ddc528a33c1b6250e797d58f830e4
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-adts
@@ -0,0 +1 @@
+presig: 5186 postsig:446 c: 0.9895
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-m4a b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..192dce224af6262de2e637937c68e8dd42c059da
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-m4a
@@ -0,0 +1 @@
+presig: 962 postsig:446 c: 0.9895
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-adts b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-adts
new file mode 100644
index 0000000000000000000000000000000000000000..c49e59f4d8e50b1ba2d0ba5017d7707198886c85
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-adts
@@ -0,0 +1 @@
+presig: 5186 postsig:446 c: 0.9839
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-m4a b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..7adf91757c74738d5fa23b51bdd064341212544e
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-m4a
@@ -0,0 +1 @@
+presig: 962 postsig:446 c: 0.9839
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-stereo-lc-adts b/tests/ref/fate/audiomatch-afconvert-16000-stereo-lc-adts
new file mode 100644
index 0000000000000000000000000000000000000000..6af6b35f36a46abe2853bc49d45a879b06b52269
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-stereo-lc-adts
@@ -0,0 +1 @@
+presig: 4224 postsig:1408 c: 0.9985
diff --git a/tests/ref/fate/audiomatch-afconvert-16000-stereo-lc-m4a b/tests/ref/fate/audiomatch-afconvert-16000-stereo-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..df05a4bf4390c46f4c7eb341331fae13a852a56c
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-16000-stereo-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:1408 c: 0.9985
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-mono-he-adts b/tests/ref/fate/audiomatch-afconvert-44100-mono-he-adts
new file mode 100644
index 0000000000000000000000000000000000000000..5029b5ae643e80b43a9676b624ec2b4f49b16035
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-mono-he-adts
@@ -0,0 +1 @@
+presig: 5186 postsig:822 c: 0.9911
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-mono-he-m4a b/tests/ref/fate/audiomatch-afconvert-44100-mono-he-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..0a9ed19f5f79997a1c70185f798363e101ee8939
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-mono-he-m4a
@@ -0,0 +1 @@
+presig: 962 postsig:822 c: 0.9911
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-mono-lc-adts b/tests/ref/fate/audiomatch-afconvert-44100-mono-lc-adts
new file mode 100644
index 0000000000000000000000000000000000000000..807aa5a3e558a2c03f28b8f738d82b864365f9aa
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-mono-lc-adts
@@ -0,0 +1 @@
+presig: 2112 postsig:824 c: 0.9995
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-mono-lc-m4a b/tests/ref/fate/audiomatch-afconvert-44100-mono-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..9160b244fa3e3fe9c61a381304bcd9ce850e7bd4
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-mono-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:824 c: 0.9995
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-adts b/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-adts
new file mode 100644
index 0000000000000000000000000000000000000000..dfde35d606b776b03bd24da020735237553f1102
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-adts
@@ -0,0 +1 @@
+presig: 10372 postsig:1644 c: 0.9890
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-m4a b/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..2fa74a715eeafbcd949b705c1434429e6fdff5b3
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-m4a
@@ -0,0 +1 @@
+presig: 1924 postsig:1644 c: 0.9890
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-adts b/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-adts
new file mode 100644
index 0000000000000000000000000000000000000000..da6b749bdf31a126c57c1e0b84f51d2ffe0a5da7
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-adts
@@ -0,0 +1 @@
+presig: 10372 postsig:1644 c: 0.9909
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-m4a b/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..bb93fb010854afe267768632f4b1c58c6fdd4094
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-m4a
@@ -0,0 +1 @@
+presig: 1924 postsig:1644 c: 0.9909
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-stereo-lc-adts b/tests/ref/fate/audiomatch-afconvert-44100-stereo-lc-adts
new file mode 100644
index 0000000000000000000000000000000000000000..10964d1a6aff0b057dc35590a3b39fddaf79643a
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-stereo-lc-adts
@@ -0,0 +1 @@
+presig: 4224 postsig:1648 c: 1.0006
diff --git a/tests/ref/fate/audiomatch-afconvert-44100-stereo-lc-m4a b/tests/ref/fate/audiomatch-afconvert-44100-stereo-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..b11b9217e30f473073ceb120f00037074e0c079f
--- /dev/null
+++ b/tests/ref/fate/audiomatch-afconvert-44100-stereo-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:1648 c: 1.0006
diff --git a/tests/ref/fate/audiomatch-dolby-44100-mono-he-mp4 b/tests/ref/fate/audiomatch-dolby-44100-mono-he-mp4
new file mode 100644
index 0000000000000000000000000000000000000000..53d432e95e8767d183b628ab8cecd6a30ca29a95
--- /dev/null
+++ b/tests/ref/fate/audiomatch-dolby-44100-mono-he-mp4
@@ -0,0 +1 @@
+presig: 5569 postsig:-1609 c: 0.9702
diff --git a/tests/ref/fate/audiomatch-dolby-44100-mono-lc-mp4 b/tests/ref/fate/audiomatch-dolby-44100-mono-lc-mp4
new file mode 100644
index 0000000000000000000000000000000000000000..3345722a6e9d48c6e7e117c1c9e44e4566e5a461
--- /dev/null
+++ b/tests/ref/fate/audiomatch-dolby-44100-mono-lc-mp4
@@ -0,0 +1 @@
+presig: 2973 postsig:-37 c: 0.9998
diff --git a/tests/ref/fate/audiomatch-dolby-44100-stereo-he-mp4 b/tests/ref/fate/audiomatch-dolby-44100-stereo-he-mp4
new file mode 100644
index 0000000000000000000000000000000000000000..c015373c978edcaef042301ff50f0a53c3bc5ca2
--- /dev/null
+++ b/tests/ref/fate/audiomatch-dolby-44100-stereo-he-mp4
@@ -0,0 +1 @@
+presig: 11160 postsig:-3240 c: 0.9703
diff --git a/tests/ref/fate/audiomatch-dolby-44100-stereo-he2-mp4 b/tests/ref/fate/audiomatch-dolby-44100-stereo-he2-mp4
new file mode 100644
index 0000000000000000000000000000000000000000..5876fcbb27ee7105b4ebffd98d55b12de29ed620
--- /dev/null
+++ b/tests/ref/fate/audiomatch-dolby-44100-stereo-he2-mp4
@@ -0,0 +1 @@
+presig: 15884 postsig:228 c: 0.8390
diff --git a/tests/ref/fate/audiomatch-dolby-44100-stereo-lc-mp4 b/tests/ref/fate/audiomatch-dolby-44100-stereo-lc-mp4
new file mode 100644
index 0000000000000000000000000000000000000000..c335657cab4321cac808be1805a44da55e5b8458
--- /dev/null
+++ b/tests/ref/fate/audiomatch-dolby-44100-stereo-lc-mp4
@@ -0,0 +1 @@
+presig: 5760 postsig:-1936 c: 0.9837
diff --git a/tests/ref/fate/audiomatch-faac-16000-mono-lc-adts b/tests/ref/fate/audiomatch-faac-16000-mono-lc-adts
new file mode 100644
index 0000000000000000000000000000000000000000..00b6b8c718b4432e8df7aadd681c3b8ba76d4d0e
--- /dev/null
+++ b/tests/ref/fate/audiomatch-faac-16000-mono-lc-adts
@@ -0,0 +1 @@
+presig: 0 postsig:768 c: 1.0011
diff --git a/tests/ref/fate/audiomatch-faac-16000-mono-lc-m4a b/tests/ref/fate/audiomatch-faac-16000-mono-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..00b6b8c718b4432e8df7aadd681c3b8ba76d4d0e
--- /dev/null
+++ b/tests/ref/fate/audiomatch-faac-16000-mono-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:768 c: 1.0011
diff --git a/tests/ref/fate/audiomatch-faac-16000-stereo-lc-adts b/tests/ref/fate/audiomatch-faac-16000-stereo-lc-adts
new file mode 100644
index 0000000000000000000000000000000000000000..3efbe5a41c5395b0c99cd5717894be8fdbfbd244
--- /dev/null
+++ b/tests/ref/fate/audiomatch-faac-16000-stereo-lc-adts
@@ -0,0 +1 @@
+presig: 0 postsig:1536 c: 1.0011
diff --git a/tests/ref/fate/audiomatch-faac-16000-stereo-lc-m4a b/tests/ref/fate/audiomatch-faac-16000-stereo-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..3efbe5a41c5395b0c99cd5717894be8fdbfbd244
--- /dev/null
+++ b/tests/ref/fate/audiomatch-faac-16000-stereo-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:1536 c: 1.0011
diff --git a/tests/ref/fate/audiomatch-faac-44100-mono-lc-adts b/tests/ref/fate/audiomatch-faac-44100-mono-lc-adts
new file mode 100644
index 0000000000000000000000000000000000000000..ba690926463d29c52d57e2d88cc4d30c82598965
--- /dev/null
+++ b/tests/ref/fate/audiomatch-faac-44100-mono-lc-adts
@@ -0,0 +1 @@
+presig: 0 postsig:888 c: 0.9882
diff --git a/tests/ref/fate/audiomatch-faac-44100-mono-lc-m4a b/tests/ref/fate/audiomatch-faac-44100-mono-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..ba690926463d29c52d57e2d88cc4d30c82598965
--- /dev/null
+++ b/tests/ref/fate/audiomatch-faac-44100-mono-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:888 c: 0.9882
diff --git a/tests/ref/fate/audiomatch-faac-44100-stereo-lc-adts b/tests/ref/fate/audiomatch-faac-44100-stereo-lc-adts
new file mode 100644
index 0000000000000000000000000000000000000000..25acdba3a460308a3d7d11b76fea6d180a1f9c4a
--- /dev/null
+++ b/tests/ref/fate/audiomatch-faac-44100-stereo-lc-adts
@@ -0,0 +1 @@
+presig: 0 postsig:1776 c: 0.9882
diff --git a/tests/ref/fate/audiomatch-faac-44100-stereo-lc-m4a b/tests/ref/fate/audiomatch-faac-44100-stereo-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..25acdba3a460308a3d7d11b76fea6d180a1f9c4a
--- /dev/null
+++ b/tests/ref/fate/audiomatch-faac-44100-stereo-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:1776 c: 0.9882
diff --git a/tests/ref/fate/audiomatch-nero-16000-mono-he-m4a b/tests/ref/fate/audiomatch-nero-16000-mono-he-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..37f671634ac8fed90af0ba58bce6b4486e6c2d03
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-16000-mono-he-m4a
@@ -0,0 +1 @@
+presig: -4 postsig:196 c: 0.9736
diff --git a/tests/ref/fate/audiomatch-nero-16000-mono-lc-m4a b/tests/ref/fate/audiomatch-nero-16000-mono-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..96627b0a5484734345f787a52be9e73ac623f131
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-16000-mono-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:192 c: 0.9965
diff --git a/tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a b/tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..c21eb01f6f7c164a4df43421c4375bee04bd9f9f
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a
@@ -0,0 +1 @@
+presig: -8 postsig:392 c: 0.9777
diff --git a/tests/ref/fate/audiomatch-nero-16000-stereo-he2-m4a b/tests/ref/fate/audiomatch-nero-16000-stereo-he2-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..5df74f1126d16ecf9a82f0f78779afc68b4a6cd7
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-16000-stereo-he2-m4a
@@ -0,0 +1 @@
+presig: 2 postsig:2590 c: 0.9934
diff --git a/tests/ref/fate/audiomatch-nero-16000-stereo-lc-m4a b/tests/ref/fate/audiomatch-nero-16000-stereo-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..b67165b1b586383e1114f0512b627e41898f7c81
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-16000-stereo-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:384 c: 0.9961
diff --git a/tests/ref/fate/audiomatch-nero-44100-mono-he-m4a b/tests/ref/fate/audiomatch-nero-44100-mono-he-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..51181110927b14a06bc14df9c9d08333faef383e
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-44100-mono-he-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:1336 c: 0.9973
diff --git a/tests/ref/fate/audiomatch-nero-44100-mono-lc-m4a b/tests/ref/fate/audiomatch-nero-44100-mono-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..2928869f938335f59a6588c77b762cd9f972afc9
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-44100-mono-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:312 c: 0.9986
diff --git a/tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a b/tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..7c20e7505a697c6f8cad3697f82ede49fcd27aac
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a
@@ -0,0 +1 @@
+presig: -2 postsig:2674 c: 0.9986
diff --git a/tests/ref/fate/audiomatch-nero-44100-stereo-he2-m4a b/tests/ref/fate/audiomatch-nero-44100-stereo-he2-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..f74a12843f8f1a685d38636dd4a19ce6be51edf3
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-44100-stereo-he2-m4a
@@ -0,0 +1 @@
+presig: 2 postsig:782 c: 0.9980
diff --git a/tests/ref/fate/audiomatch-nero-44100-stereo-lc-m4a b/tests/ref/fate/audiomatch-nero-44100-stereo-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..0393668ab34770437251daafbe8c708e4c7502ee
--- /dev/null
+++ b/tests/ref/fate/audiomatch-nero-44100-stereo-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:624 c: 0.9954
diff --git a/tests/ref/fate/audiomatch-quicktime7-44100-stereo-lc-mp4 b/tests/ref/fate/audiomatch-quicktime7-44100-stereo-lc-mp4
new file mode 100644
index 0000000000000000000000000000000000000000..c9fd2972c52e8dc4156eaad653ab2d0fbb48ed92
--- /dev/null
+++ b/tests/ref/fate/audiomatch-quicktime7-44100-stereo-lc-mp4
@@ -0,0 +1 @@
+presig: 4220 postsig:-2444 c: 0.9768
diff --git a/tests/ref/fate/audiomatch-quicktimeX-44100-stereo-lc-m4a b/tests/ref/fate/audiomatch-quicktimeX-44100-stereo-lc-m4a
new file mode 100644
index 0000000000000000000000000000000000000000..18863d7e47e78c286a2375093f696a425cb79e21
--- /dev/null
+++ b/tests/ref/fate/audiomatch-quicktimeX-44100-stereo-lc-m4a
@@ -0,0 +1 @@
+presig: 0 postsig:1648 c: 0.9994
diff --git a/tests/ref/fate/audiomatch-square-aac b/tests/ref/fate/audiomatch-square-aac
new file mode 100644
index 0000000000000000000000000000000000000000..2e8b8d244a6d8e31498d48b75602b1a57700a81f
--- /dev/null
+++ b/tests/ref/fate/audiomatch-square-aac
@@ -0,0 +1 @@
+presig: 0 postsig:892 c: 0.9983
diff --git a/tests/ref/fate/audiomatch-square-mp3 b/tests/ref/fate/audiomatch-square-mp3
new file mode 100644
index 0000000000000000000000000000000000000000..b798641a1917f343eb3dc004e17bad3e6666a6f7
--- /dev/null
+++ b/tests/ref/fate/audiomatch-square-mp3
@@ -0,0 +1 @@
+presig: 0 postsig:0 c: 0.9447