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

ramiro subversion at mplayerhq.hu
Sun Aug 10 16:52:53 CEST 2008


Author: ramiro
Date: Sun Aug 10 16:52:53 2008
New Revision: 3150

Log:
determine_bits() for each substr within the loop at mlp_encode_frame().

Modified:
   mlp/mlpenc.c

Modified: mlp/mlpenc.c
==============================================================================
--- mlp/mlpenc.c	(original)
+++ mlp/mlpenc.c	Sun Aug 10 16:52:53 2008
@@ -829,11 +829,8 @@ static inline void codebook_bits(MLPEnco
     }
 }
 
-static void determine_bits(MLPEncodeContext *ctx)
+static void determine_bits(MLPEncodeContext *ctx, unsigned int substr)
 {
-    unsigned int substr;
-
-    for (substr = 0; substr < ctx->num_substreams; substr++) {
         DecodingParams *dp = &ctx->decoding_params[substr];
         RestartHeader  *rh = &ctx->restart_header [substr];
         unsigned int channel;
@@ -877,7 +874,6 @@ static void determine_bits(MLPEncodeCont
             dp->huff_lsbs  [channel] = bo.lsb_bits + 8;
             dp->codebook   [channel] = best_codebook;
         }
-    }
 }
 
 static void write_block_data(MLPEncodeContext *ctx, PutBitContext *pb,
@@ -1055,8 +1051,6 @@ static int mlp_encode_frame(AVCodecConte
         apply_filter(ctx, channel);
     }
 
-    determine_bits(ctx);
-
     for (substr = 0; substr < ctx->num_substreams; substr++) {
         DecodingParams *dp = &ctx->decoding_params[substr];
         RestartHeader  *rh = &ctx->restart_header [substr];
@@ -1070,6 +1064,8 @@ static int mlp_encode_frame(AVCodecConte
             last_block = 1;
         }
 
+        determine_bits(ctx, substr);
+
         params_changed = decoding_params_diff(ctx, &decoding_params[substr],
                                               filter_params,
                                               substr, write_headers);



More information about the FFmpeg-soc mailing list