This was added without explanation in bf334535b, and there are
no references to why this should be done, or what it actually
fixes. The difference to actual decoded output from QuickTime
is not significantly altered by this change.

This also does not match what our encoder does, making the encoder's
attempts to improve quality actually just worsen it (at least
when tested using our decoder).

CC: [email protected]
---
 libavcodec/adpcm.c            | 13 ++-----------
 tests/ref/acodec/adpcm-ima_qt |  4 ++--
 tests/ref/fate/qt-ima4-mono   |  2 +-
 tests/ref/fate/qt-ima4-stereo |  2 +-
 4 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index c6bc4d0..378df2e 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -641,17 +641,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void 
*data,
             step_index = predictor & 0x7F;
             predictor &= ~0x7F;
 
-            if (cs->step_index == step_index) {
-                int diff = predictor - cs->predictor;
-                if (diff < 0)
-                    diff = - diff;
-                if (diff > 0x7f)
-                    goto update;
-            } else {
-            update:
-                cs->step_index = step_index;
-                cs->predictor = predictor;
-            }
+            cs->step_index = step_index;
+            cs->predictor = predictor;
 
             if (cs->step_index > 88u){
                 av_log(avctx, AV_LOG_ERROR, "ERROR: step_index[%d] = %i\n",
diff --git a/tests/ref/acodec/adpcm-ima_qt b/tests/ref/acodec/adpcm-ima_qt
index 6d018eb..13e2ab5 100644
--- a/tests/ref/acodec/adpcm-ima_qt
+++ b/tests/ref/acodec/adpcm-ima_qt
@@ -1,4 +1,4 @@
 6609b0d57259a6e905807fd8b6a1e482 *tests/data/fate/acodec-adpcm-ima_qt.aiff
 281252 tests/data/fate/acodec-adpcm-ima_qt.aiff
-c574b797e31fbbc3ae5bf3533bb5888c *tests/data/fate/acodec-adpcm-ima_qt.out.wav
-stddev:  904.39 PSNR: 37.20 MAXDIFF:34029 bytes:  1058400/  1058560
+7744c7268ad29db602617ef0a5c84a0a *tests/data/fate/acodec-adpcm-ima_qt.out.wav
+stddev:  902.10 PSNR: 37.22 MAXDIFF:34029 bytes:  1058400/  1058560
diff --git a/tests/ref/fate/qt-ima4-mono b/tests/ref/fate/qt-ima4-mono
index b8fc5f9..47dcc1a 100644
--- a/tests/ref/fate/qt-ima4-mono
+++ b/tests/ref/fate/qt-ima4-mono
@@ -1 +1 @@
-e178ed520edf2f46492ae740d88f5815
+4edc3619821d73353829e36db66f53c6
diff --git a/tests/ref/fate/qt-ima4-stereo b/tests/ref/fate/qt-ima4-stereo
index 84c9f46..f2e5f68 100644
--- a/tests/ref/fate/qt-ima4-stereo
+++ b/tests/ref/fate/qt-ima4-stereo
@@ -1 +1 @@
-d22be0e193dcbba1068a1ca6ab04cf77
+49c9aca92b64ad7ea373b40f073f1d47
-- 
1.8.5.2 (Apple Git-48)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to