[FFmpeg-devel] [PATCH] dca: adjust decoding of the XBR extension for integer core decoding

Hendrik Leppkes h.leppkes at gmail.com
Sat Jan 2 19:10:43 CET 2016


On Sat, Jan 2, 2016 at 6:17 PM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Sat, Jan 02, 2016 at 03:05:41PM +0100, Hendrik Leppkes wrote:
>> ---
>>  libavcodec/dcadec.c | 11 ++++++-----
>>  1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
>> index 187e172..0817018 100644
>> --- a/libavcodec/dcadec.c
>> +++ b/libavcodec/dcadec.c
>> @@ -1345,11 +1345,11 @@ int ff_dca_xbr_parse_frame(DCAContext *s)
>>              for(i = 0; i < n_xbr_ch[chset]; i++) {
>>                  for(j = 0; j < active_bands[chset][i]; j++) {
>>                      const int xbr_abits = abits_high[i][j];
>> -                    const float quant_step_size = ff_dca_lossless_quant_d[xbr_abits];
>> +                    const uint32_t quant_step_size = ff_dca_lossless_quant[xbr_abits];
>>                      const int sfi = xbr_tmode && s->dca_chan[i].transition_mode[j] && subsubframe >= s->dca_chan[i].transition_mode[j];
>> -                    const float rscale = quant_step_size * scale_table_high[i][j][sfi];
>> -                    float *subband_samples = s->dca_chan[chan_base+i].subband_samples[k][j];
>> -                    int block[8];
>> +                    const uint32_t rscale = scale_table_high[i][j][sfi];
>> +                    int32_t *subband_samples = s->dca_chan[chan_base+i].subband_samples[k][j];
>> +                    int32_t block[8];
>>
>>                      if(xbr_abits <= 0)
>>                          continue;
>> @@ -1374,8 +1374,9 @@ int ff_dca_xbr_parse_frame(DCAContext *s)
>>                      }
>>
>>                      /* scale & sum into subband */
>> +                    s->dcadsp.dequantize(block, quant_step_size, rscale);
>>                      for(l = 0; l < 8; l++)
>> -                        subband_samples[l] += (float)block[l] * rscale;
>> +                        subband_samples[l] += block[l];
>>                  }
>>              }
>
> confirmed that this fixes decoding, so should be ok
>


Applied.


More information about the ffmpeg-devel mailing list