[FFmpeg-devel] [PATCH 1/6] ac3enc_fixed: convert to 32-bit sample format

Lynne dev at lynne.ee
Tue Jan 12 09:37:17 EET 2021


Jan 9, 2021, 22:01 by andreas.rheinhardt at gmail.com:

> Lynne:
>
>> @@ -165,7 +164,11 @@ typedef struct AC3EncodeContext {
>>  AVCodecContext *avctx;                  ///< parent AVCodecContext
>>  PutBitContext pb;                       ///< bitstream writer context
>>  AudioDSPContext adsp;
>> +#if AC3ENC_FLOAT
>>  AVFloatDSPContext *fdsp;
>> +#else
>> +    AVFixedDSPContext *fdsp;
>> +#endif
>>  MECmpContext mecc;
>>  AC3DSPContext ac3dsp;                   ///< AC-3 optimized functions
>>  FFTContext mdct;                        ///< FFT context for MDCT calculation
>>
> [...]
>
>> @@ -118,9 +89,10 @@ static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
>>  static av_cold void ac3_fixed_mdct_end(AC3EncodeContext *s)
>>  {
>>  ff_mdct_end(&s->mdct);
>> +    av_freep(&s->fdsp);
>> +    av_freep(&s->mdct_window);
>>  }
>>
>
> ff_ac3_encode_close already unconditionally frees fdsp, so freeing it
> above is either unnecessary or ac3_float_mdct_end should also free its
> fdsp (and ff_ac3_encode_close shouldn't). Freeing mdct_window can also
> be moved to ff_ac3_encode_close (which already frees several buffers
> whose pointed-to-type depends upon the encoding mode).
> Notice that ac3enc.c uses the fixed-point mode, but the layout of
> AC3EncodeContext does not depend upon this (apart from pointed-to-types,
> of course). Actually, ff_mdct_end does the same for both fixed- and
> floating-point mode, so one could even incorporate
> ac3_fixed/float_mdct_end into ff_ac3_encode_close.
>
Done. Left ac3_fixed/float_mdct_end as-is for now.
New patch attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ac3enc_fixed-convert-to-32-bit-sample-format.patch
Type: text/x-patch
Size: 16970 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210112/65ab3a23/attachment.bin>


More information about the ffmpeg-devel mailing list