changeset 11337:15dd07e86519 libavcodec

Perform coefficient transformations in Bink Audio DCT decoder (issue1770)
author pross
date Wed, 03 Mar 2010 09:51:56 +0000
parents ad4ac2a6373f
children 444401d150d6
files binkaudio.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/binkaudio.c	Wed Mar 03 09:38:09 2010 +0000
+++ b/binkaudio.c	Wed Mar 03 09:51:56 2010 +0000
@@ -125,7 +125,7 @@
     if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT)
         ff_rdft_init(&s->trans.rdft, frame_len_bits, IRIDFT);
     else if (CONFIG_BINKAUDIO_DCT_DECODER)
-        ff_dct_init(&s->trans.dct, frame_len_bits, 0);
+        ff_dct_init(&s->trans.dct, frame_len_bits, 1);
     else
         return -1;
 
@@ -211,8 +211,11 @@
             }
         }
 
-        if (CONFIG_BINKAUDIO_DCT_DECODER && use_dct)
+        if (CONFIG_BINKAUDIO_DCT_DECODER && use_dct) {
+            coeffs[0] /= 0.5;
             ff_dct_calc (&s->trans.dct,  coeffs);
+            s->dsp.vector_fmul_scalar(coeffs, coeffs, s->frame_len / 2, s->frame_len);
+        }
         else if (CONFIG_BINKAUDIO_RDFT_DECODER)
             ff_rdft_calc(&s->trans.rdft, coeffs);
     }