[FFmpeg-devel] [PATCH 1/3] aacsbr_fixed: avoid division by zero in sbr_gain_calc

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Fri Nov 20 23:27:36 CET 2015


On 20.11.2015 21:51, Michael Niedermayer wrote:
> On Fri, Nov 20, 2015 at 08:42:09PM +0100, Andreas Cadhalpun wrote:
>> On 20.11.2015 10:51, Michael Niedermayer wrote:
>>> On Fri, Nov 20, 2015 at 12:16:09AM +0100, Andreas Cadhalpun wrote:
>>>>  aacsbr_template.c |    8 ++++++++
>>>>  1 file changed, 8 insertions(+)
>>>> 43ace0364265ef16eecd6ca2d9564cc9585847f7  0001-aacsbr-don-t-call-sbr_dequant-twice-without-intermed.patch
>>>> From 0237ebfca9571d2d3e51f5c5dc15f8f5a516510a Mon Sep 17 00:00:00 2001
>>>> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>>>> Date: Fri, 20 Nov 2015 00:04:50 +0100
>>>> Subject: [PATCH] aacsbr: don't call sbr_dequant twice without intermediate
>>>>  read_sbr_data
>>>>
>>>> Doing that doesn't make sense, because the only purpose of sbr_dequant
>>>> is to process the data from read_sbr_data.
>>>>
>>>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>>>> ---
>>>>  libavcodec/aacsbr_template.c | 8 ++++++++
>>>>  1 file changed, 8 insertions(+)
>>>>
>>>> diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c
>>>> index cf18862..564930a 100644
>>>> --- a/libavcodec/aacsbr_template.c
>>>> +++ b/libavcodec/aacsbr_template.c
>>>> @@ -1041,6 +1041,7 @@ static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
>>>>      unsigned int cnt = get_bits_count(gb);
>>>>  
>>>>      sbr->id_aac = id_aac;
>>>> +    sbr->start = 2;
>>>
>>> the new value should be documented
>>> or maybe it would be possible to use a new field with self explanatory
>>> name
>>
>> I think using a new field is a good idea for code readability.
>> Updated patch attached.
>>
>> Best regards,
>> Andreas
>>
> 
>>  aacsbr_template.c |   10 ++++++++++
>>  sbr.h             |    1 +
>>  2 files changed, 11 insertions(+)
>> fd6c7feeeb29eae46242ade296c317a5e4930c12  0001-aacsbr-don-t-call-sbr_dequant-twice-without-intermed.patch
>> From 10acbb3939e576594b43965847ea7b2231722ee4 Mon Sep 17 00:00:00 2001
>> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> Date: Fri, 20 Nov 2015 20:15:21 +0100
>> Subject: [PATCH] aacsbr: don't call sbr_dequant twice without intermediate
>>  read_sbr_data
>>
>> Doing that doesn't make sense, because the only purpose of sbr_dequant
>> is to process the data from read_sbr_data.
>>
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>>  libavcodec/aacsbr_template.c | 10 ++++++++++
>>  libavcodec/sbr.h             |  1 +
>>  2 files changed, 11 insertions(+)
> 
> LGTM

Pushed.

Best regards,
Andreas



More information about the ffmpeg-devel mailing list