[FFmpeg-cvslog] adxenc: remove unneeded loops

Justin Ruggles git at videolan.org
Thu Jan 5 02:18:50 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Mon Dec 19 10:14:35 2011 -0500| [6c117bd8e072319dd0895efd64c4470ad0872213] | committer: Justin Ruggles

adxenc: remove unneeded loops

avctx->frame_size is 32, so that is how many samples we process per call.

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

 libavcodec/adxenc.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c
index 4f434ba..12690d2 100644
--- a/libavcodec/adxenc.c
+++ b/libavcodec/adxenc.c
@@ -128,7 +128,6 @@ static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,
     ADXContext *c          = avctx->priv_data;
     const int16_t *samples = data;
     uint8_t *dst           = frame;
-    int rest               = avctx->frame_size;
 
     if (!c->header_parsed) {
         int hdrsize = adx_encode_header(avctx, dst, buf_size);
@@ -137,20 +136,12 @@ static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,
     }
 
     if (avctx->channels == 1) {
-        while (rest >= 32) {
             adx_encode(c, dst, samples, c->prev, avctx->channels);
             dst     += 18;
-            samples += 32;
-            rest    -= 32;
-        }
     } else {
-        while (rest >= 32*2) {
             adx_encode(c, dst,      samples,     c->prev,     avctx->channels);
             adx_encode(c, dst + 18, samples + 1, c->prev + 1, avctx->channels);
             dst     += 18*2;
-            samples += 32*2;
-            rest    -= 32*2;
-        }
     }
     return dst - frame;
 }



More information about the ffmpeg-cvslog mailing list