[SCM] libav/experimental: Simplify: use a for instead of unrolling by hand

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:29:32 UTC 2013


The following commit has been merged in the experimental branch:
commit 1b0dc0120d97377cddcafa0467a424df71c876dd
Author: Vitor Sessak <vitor1001 at gmail.com>
Date:   Fri Sep 5 00:00:20 2008 +0000

    Simplify: use a for instead of unrolling by hand
    
    Originally committed as revision 15213 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index be766bc..79967f6 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -317,7 +317,7 @@ static int mace3_decode_frame(AVCodecContext *avctx,
 {
     short *samples = data;
     MACEContext *ctx = avctx->priv_data;
-    int i, j;
+    int i, j, k;
 
     for(i = 0; i < avctx->channels; i++) {
         ctx->index = ctx->lev = 0;
@@ -325,15 +325,12 @@ static int mace3_decode_frame(AVCodecContext *avctx,
         ctx->outPtr = samples + i;
 
         for (j=0; j < buf_size / 2 / avctx->channels; j++) {
-            uint8_t pkt = buf[i*2 + j*2*avctx->channels];
-            chomp3(ctx, pkt       & 7, MACEtab1, MACEtab2, avctx->channels);
-            chomp3(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, avctx->channels);
-            chomp3(ctx, pkt >> 5     , MACEtab1, MACEtab2, avctx->channels);
-
-            pkt = buf[i*2 + j*2*avctx->channels + 1];
+            for (k=0; k < 2; k++) {
+            uint8_t pkt = buf[i*2 + j*2*avctx->channels + k];
             chomp3(ctx, pkt       & 7, MACEtab1, MACEtab2, avctx->channels);
             chomp3(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, avctx->channels);
             chomp3(ctx, pkt >> 5     , MACEtab1, MACEtab2, avctx->channels);
+            }
         }
     }
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list