[FFmpeg-devel] [PATCH 1/4] avcodec/siren: replace magic numbers with macro value

Peter Ross pross at xvid.org
Tue Sep 7 12:27:19 EEST 2021


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

diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index 5b172c5ab7..93a2d14d25 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));
-- 
2.33.0

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210907/df3a3acc/attachment.sig>


More information about the ffmpeg-devel mailing list