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

Michael Niedermayer michael at niedermayer.cc
Sat Jan 2 18:17:24 CET 2016


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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160102/668f3904/attachment.sig>


More information about the ffmpeg-devel mailing list