ac3enc: do not use the broken MAC64() macro

Message ID 1300114128-27634-1-git-send-email-justin.ruggles@gmail.com
State Superseded
Headers show

Commit Message

Justin Ruggles March 14, 2011, 2:48 p.m.
This fixes fate-acodec-ac3_fixed regression test that is failing for most
x86-32 builds according to FATE.
---
 libavcodec/ac3enc_fixed.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Mans Rullgard March 14, 2011, 3:08 p.m. | #1
Justin Ruggles <justin.ruggles@gmail.com> writes:

> This fixes fate-acodec-ac3_fixed regression test that is failing for most
> x86-32 builds according to FATE.
> ---
>  libavcodec/ac3enc_fixed.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> diff --git a/libavcodec/ac3enc_fixed.h b/libavcodec/ac3enc_fixed.h
> index bad2306..06b89ba 100644
> --- a/libavcodec/ac3enc_fixed.h
> +++ b/libavcodec/ac3enc_fixed.h
> @@ -36,7 +36,7 @@ typedef int16_t SampleType;
>  typedef int32_t CoefType;
>  typedef int64_t CoefSumType;
>  
> -#define MAC_COEF(d,a,b) MAC64(d,a,b)
> +#define MAC_COEF(d,a,b) ((d) += ((int64_t)(a) * (int64_t)(b)))

This only covers up the fact that MAC64 is broken.
Justin Ruggles March 14, 2011, 3:12 p.m. | #2
On 03/14/2011 11:08 AM, Måns Rullgård wrote:

> Justin Ruggles <justin.ruggles@gmail.com> writes:
> 
>> This fixes fate-acodec-ac3_fixed regression test that is failing for most
>> x86-32 builds according to FATE.
>> ---
>>  libavcodec/ac3enc_fixed.h |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>>
>> diff --git a/libavcodec/ac3enc_fixed.h b/libavcodec/ac3enc_fixed.h
>> index bad2306..06b89ba 100644
>> --- a/libavcodec/ac3enc_fixed.h
>> +++ b/libavcodec/ac3enc_fixed.h
>> @@ -36,7 +36,7 @@ typedef int16_t SampleType;
>>  typedef int32_t CoefType;
>>  typedef int64_t CoefSumType;
>>  
>> -#define MAC_COEF(d,a,b) MAC64(d,a,b)
>> +#define MAC_COEF(d,a,b) ((d) += ((int64_t)(a) * (int64_t)(b)))
> 
> This only covers up the fact that MAC64 is broken.


I know... but I can't figure out how to fix it and I don't like having
the ac3 test broken.  I also don't know why the mp2 test isn't failing
as well since it uses MAC64.

-Justin
Mans Rullgard March 14, 2011, 3:15 p.m. | #3
Justin Ruggles <justin.ruggles@gmail.com> writes:

> On 03/14/2011 11:08 AM, Måns Rullgård wrote:
>
>> Justin Ruggles <justin.ruggles@gmail.com> writes:
>> 
>>> This fixes fate-acodec-ac3_fixed regression test that is failing for most
>>> x86-32 builds according to FATE.
>>> ---
>>>  libavcodec/ac3enc_fixed.h |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>>
>>> diff --git a/libavcodec/ac3enc_fixed.h b/libavcodec/ac3enc_fixed.h
>>> index bad2306..06b89ba 100644
>>> --- a/libavcodec/ac3enc_fixed.h
>>> +++ b/libavcodec/ac3enc_fixed.h
>>> @@ -36,7 +36,7 @@ typedef int16_t SampleType;
>>>  typedef int32_t CoefType;
>>>  typedef int64_t CoefSumType;
>>>  
>>> -#define MAC_COEF(d,a,b) MAC64(d,a,b)
>>> +#define MAC_COEF(d,a,b) ((d) += ((int64_t)(a) * (int64_t)(b)))
>> 
>> This only covers up the fact that MAC64 is broken.
>
> I know... but I can't figure out how to fix it and I don't like having
> the ac3 test broken.  I also don't know why the mp2 test isn't failing
> as well since it uses MAC64.

Let's figure it out then.  If we can't find an answer, we should remove
that macro.

Patch

diff --git a/libavcodec/ac3enc_fixed.h b/libavcodec/ac3enc_fixed.h
index bad2306..06b89ba 100644
--- a/libavcodec/ac3enc_fixed.h
+++ b/libavcodec/ac3enc_fixed.h
@@ -36,7 +36,7 @@  typedef int16_t SampleType;
 typedef int32_t CoefType;
 typedef int64_t CoefSumType;
 
-#define MAC_COEF(d,a,b) MAC64(d,a,b)
+#define MAC_COEF(d,a,b) ((d) += ((int64_t)(a) * (int64_t)(b)))
 
 
 /**