diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
index 71521aba0e9d62c27598947f6b3c0871535f2f2c..0eb62275183be8d7ae57cee76a3e70df0cac85ef 100644
--- a/tests/fate/acodec.mak
+++ b/tests/fate/acodec.mak
@@ -2,6 +2,7 @@ fate-acodec-%: CODEC = $(@:fate-acodec-%=%)
 fate-acodec-%: SRC = tests/data/asynth-44100-2.wav
 fate-acodec-%: CMD = enc_dec wav $(SRC) $(FMT) "-b 128k -c $(CODEC)" wav "-c pcm_s16le" -keep
 fate-acodec-%: CMP_UNIT = 2
+fate-acodec-%: REF = $(SRC_PATH)/tests/ref/acodec/$(@:fate-acodec-%=%)
 
 FATE_ACODEC_PCM-$(call ENCDEC, PCM_ALAW,  WAV) += alaw
 FATE_ACODEC_PCM-$(call ENCDEC, PCM_MULAW, WAV) += mulaw
diff --git a/tests/ref/fate/acodec-adpcm-adx b/tests/ref/acodec/adpcm-adx
similarity index 100%
rename from tests/ref/fate/acodec-adpcm-adx
rename to tests/ref/acodec/adpcm-adx
diff --git a/tests/ref/fate/acodec-adpcm-ima_qt b/tests/ref/acodec/adpcm-ima_qt
similarity index 100%
rename from tests/ref/fate/acodec-adpcm-ima_qt
rename to tests/ref/acodec/adpcm-ima_qt
diff --git a/tests/ref/fate/acodec-adpcm-ima_wav b/tests/ref/acodec/adpcm-ima_wav
similarity index 100%
rename from tests/ref/fate/acodec-adpcm-ima_wav
rename to tests/ref/acodec/adpcm-ima_wav
diff --git a/tests/ref/fate/acodec-adpcm-ms b/tests/ref/acodec/adpcm-ms
similarity index 100%
rename from tests/ref/fate/acodec-adpcm-ms
rename to tests/ref/acodec/adpcm-ms
diff --git a/tests/ref/fate/acodec-adpcm-swf b/tests/ref/acodec/adpcm-swf
similarity index 100%
rename from tests/ref/fate/acodec-adpcm-swf
rename to tests/ref/acodec/adpcm-swf
diff --git a/tests/ref/fate/acodec-adpcm-yamaha b/tests/ref/acodec/adpcm-yamaha
similarity index 100%
rename from tests/ref/fate/acodec-adpcm-yamaha
rename to tests/ref/acodec/adpcm-yamaha
diff --git a/tests/ref/fate/acodec-alac b/tests/ref/acodec/alac
similarity index 100%
rename from tests/ref/fate/acodec-alac
rename to tests/ref/acodec/alac
diff --git a/tests/ref/fate/acodec-flac b/tests/ref/acodec/flac
similarity index 100%
rename from tests/ref/fate/acodec-flac
rename to tests/ref/acodec/flac
diff --git a/tests/ref/fate/acodec-mp2 b/tests/ref/acodec/mp2
similarity index 100%
rename from tests/ref/fate/acodec-mp2
rename to tests/ref/acodec/mp2
diff --git a/tests/ref/fate/acodec-pcm-alaw b/tests/ref/acodec/pcm-alaw
similarity index 100%
rename from tests/ref/fate/acodec-pcm-alaw
rename to tests/ref/acodec/pcm-alaw
diff --git a/tests/ref/fate/acodec-pcm-f32be b/tests/ref/acodec/pcm-f32be
similarity index 100%
rename from tests/ref/fate/acodec-pcm-f32be
rename to tests/ref/acodec/pcm-f32be
diff --git a/tests/ref/fate/acodec-pcm-f32le b/tests/ref/acodec/pcm-f32le
similarity index 100%
rename from tests/ref/fate/acodec-pcm-f32le
rename to tests/ref/acodec/pcm-f32le
diff --git a/tests/ref/fate/acodec-pcm-f64be b/tests/ref/acodec/pcm-f64be
similarity index 100%
rename from tests/ref/fate/acodec-pcm-f64be
rename to tests/ref/acodec/pcm-f64be
diff --git a/tests/ref/fate/acodec-pcm-f64le b/tests/ref/acodec/pcm-f64le
similarity index 100%
rename from tests/ref/fate/acodec-pcm-f64le
rename to tests/ref/acodec/pcm-f64le
diff --git a/tests/ref/fate/acodec-pcm-mulaw b/tests/ref/acodec/pcm-mulaw
similarity index 100%
rename from tests/ref/fate/acodec-pcm-mulaw
rename to tests/ref/acodec/pcm-mulaw
diff --git a/tests/ref/fate/acodec-pcm-s16be b/tests/ref/acodec/pcm-s16be
similarity index 100%
rename from tests/ref/fate/acodec-pcm-s16be
rename to tests/ref/acodec/pcm-s16be
diff --git a/tests/ref/fate/acodec-pcm-s16le b/tests/ref/acodec/pcm-s16le
similarity index 100%
rename from tests/ref/fate/acodec-pcm-s16le
rename to tests/ref/acodec/pcm-s16le
diff --git a/tests/ref/fate/acodec-pcm-s24be b/tests/ref/acodec/pcm-s24be
similarity index 100%
rename from tests/ref/fate/acodec-pcm-s24be
rename to tests/ref/acodec/pcm-s24be
diff --git a/tests/ref/fate/acodec-pcm-s24le b/tests/ref/acodec/pcm-s24le
similarity index 100%
rename from tests/ref/fate/acodec-pcm-s24le
rename to tests/ref/acodec/pcm-s24le
diff --git a/tests/ref/fate/acodec-pcm-s32be b/tests/ref/acodec/pcm-s32be
similarity index 100%
rename from tests/ref/fate/acodec-pcm-s32be
rename to tests/ref/acodec/pcm-s32be
diff --git a/tests/ref/fate/acodec-pcm-s32le b/tests/ref/acodec/pcm-s32le
similarity index 100%
rename from tests/ref/fate/acodec-pcm-s32le
rename to tests/ref/acodec/pcm-s32le
diff --git a/tests/ref/fate/acodec-pcm-s8 b/tests/ref/acodec/pcm-s8
similarity index 100%
rename from tests/ref/fate/acodec-pcm-s8
rename to tests/ref/acodec/pcm-s8
diff --git a/tests/ref/fate/acodec-pcm-u8 b/tests/ref/acodec/pcm-u8
similarity index 100%
rename from tests/ref/fate/acodec-pcm-u8
rename to tests/ref/acodec/pcm-u8