[FFmpeg-cvslog] avcodec/siren: replace magic numbers with macro value

Peter Ross git at videolan.org
Thu Sep 9 11:42:08 EEST 2021


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Sat Sep  4 20:24:39 2021 +1000| [e8aec714d322cb479da2f625f977a3d5b8b8c024] | committer: Peter Ross

avcodec/siren: replace magic numbers with macro value

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Peter Ross <pross at xvid.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e8aec714d322cb479da2f625f977a3d5b8b8c024
---

 libavcodec/siren.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index 0675fbaffd..2817c5c592 100644
--- a/libavcodec/siren.c
+++ b/libavcodec/siren.c
@@ -698,7 +698,7 @@ static int siren_decode(AVCodecContext *avctx, void *data,
     SirenContext *s = avctx->priv_data;
     GetBitContext *gb = &s->gb;
     AVFrame *frame = data;
-    int ret, number_of_valid_coefs = 20 * s->number_of_regions;
+    int ret, number_of_valid_coefs = REGION_SIZE * s->number_of_regions;
     int frame_error = 0, rate_control = 0;
     int bits_per_frame;
 
@@ -765,7 +765,7 @@ static int siren_decode(AVCodecContext *avctx, void *data,
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
 
-    for (int i = 0; i < 320; i += 2)
+    for (int i = 0; i < FRAME_SIZE; i += 2)
         s->imdct_in[i] *= -1;
 
     s->tx_fn(s->tx_ctx, s->imdct_out, s->imdct_in, sizeof(float));



More information about the ffmpeg-cvslog mailing list