[FFmpeg-devel] [PATCH 02/15] libavutil: Implementation of AAC_fixed_decoder (LC-module) [2/5]
Nedeljko Babic
Nedeljko.Babic at imgtec.com
Fri Nov 14 12:41:14 CET 2014
>On Fri, Nov 07, 2014 at 04:08:06PM +0100, Nedeljko Babic wrote:
>> From: Djordje Pesut <djordje.pesut at imgtec.com>
>>
>> Make changes in softfloat.
>>
>> Functions for sqrt and sincos are added.
>>
>> Div function is improved.
>>
>> Some changes are made in order for code in softfloat to be usable in fixed aac
>> decoder code.
>> For example order of fields in structure SoftFloat is changed.
>> This doesn't create any impact on current ffmpeg code since softfloat is
>> currently not in use and this way we don't need to make much changes in
>> implementation of aac fixed point decoder that uses this code.
>>
>> Signed-off-by: Nedeljko Babic <nedeljko.babic at imgtec.com>
>> ---
>> libavutil/softfloat.h | 167 ++++++++++++++++++++----
>> libavutil/softfloat_tables.h | 294 +++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 439 insertions(+), 22 deletions(-)
>> create mode 100644 libavutil/softfloat_tables.h
>>
>> diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
>> index 8647e6a..df91a8b 100644
>> --- a/libavutil/softfloat.h
>> +++ b/libavutil/softfloat.h
>> @@ -23,18 +23,26 @@
>>
>> #include <stdint.h>
>> #include "common.h"
>> -
>> #include "avassert.h"
>> +#include "softfloat_tables.h"
>>
>> #define MIN_EXP -126
>> #define MAX_EXP 126
>> #define ONE_BITS 29
>>
>> typedef struct SoftFloat{
>> - int32_t exp;
>> int32_t mant;
>> + int32_t exp;
>> }SoftFloat;
>>
>
>> +static const SoftFloat FLOAT_0 = { 0, 0};
>> +static const SoftFloat FLOAT_05 = { 536870912, 0};
>> +static const SoftFloat FLOAT_1 = { 536870912, 1};
>> +static const SoftFloat FLOAT_EPSILON = { 703687442, -16};
>> +static const SoftFloat FLOAT_1584893192 = { 850883053, 1};
>> +static const SoftFloat FLOAT_100000 = { 819200000, 17};
>> +static const SoftFloat FLOAT_0999999 = {1073740750, 0};
>
>the mantises should be in some form of base 2 or base 16 in the
>source as this should be more readable
>
I didn't made a change here because for some of the values base 16
representation is not more readable than base 10 (for example 703687442 and
0x29F16B12).
On the other hand I see that it is more readable for most of the values
and I will make a change in the next patch.
>
>> +
>> static av_const SoftFloat av_normalize_sf(SoftFloat a){
>> if(a.mant){
>> #if 1
>> @@ -66,11 +74,12 @@ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){
>> av_assert2(a.mant < 0x40000000 && a.mant > -0x40000000);
>> return a;
>> #elif 1
>> - int t= a.mant + 0x40000000 < 0;
>> - return (SoftFloat){a.exp+t, a.mant>>t};
>> + int t= a.mant + 0x40000000;
>> + t = t < 0;
>> + return (SoftFloat){ a.mant>>t, a.exp+t};
>> #else
>> int t= (a.mant + 0x40000000U)>>31;
>
>> - return (SoftFloat){a.exp+t, a.mant>>t};
>> + return (SoftFloat){a.mant>>t, a.exp+t};
>
>fliping the order of the argumets, as its cosmetic should be in a
>seperate patch from all functional changes
>this keeps the changes easier to read now for review as well as in
>the future
Ok. It will be moved to the new patch.
Should I resend entire patch set once all the changes are made, or should I just
split this patch in the two new patches and send them in answer to this review?
More information about the ffmpeg-devel
mailing list