[FFmpeg-soc] [soc]: r3686 - mlp/mlpenc.c

ramiro subversion at mplayerhq.hu
Sun Aug 31 20:53:56 CEST 2008


Author: ramiro
Date: Sun Aug 31 20:53:56 2008
New Revision: 3686

Log:
Prepare input_to_sample_buffer() to wrap around the input buffer.

Modified:
   mlp/mlpenc.c

Modified: mlp/mlpenc.c
==============================================================================
--- mlp/mlpenc.c	(original)
+++ mlp/mlpenc.c	Sun Aug 31 20:53:56 2008
@@ -1211,15 +1211,20 @@ static void input_data(MLPEncodeContext 
 static void input_to_sample_buffer(MLPEncodeContext *ctx)
 {
     int32_t *sample_buffer = ctx->sample_buffer;
-    int32_t *input_buffer = ctx->inout_buffer + ctx->starting_frame_index * ctx->one_sample_buffer_size;
+    unsigned int index;
+
+    for (index = 0; index < ctx->number_of_frames; index++) {
+        unsigned int cur_index = (ctx->starting_frame_index + index) % ctx->max_restart_interval;
+    int32_t *input_buffer = ctx->inout_buffer + cur_index * ctx->one_sample_buffer_size;
     unsigned int i, channel;
 
-    for (i = 0; i < ctx->number_of_samples; i++) {
+    for (i = 0; i < ctx->frame_size[cur_index]; i++) {
         for (channel = 0; channel < ctx->avctx->channels; channel++)
             *sample_buffer++ = *input_buffer++;
         sample_buffer += 2; /* noise_channels */
         input_buffer += 2; /* noise_channels */
     }
+    }
 }
 
 /****************************************************************************



More information about the FFmpeg-soc mailing list