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

ramiro subversion at mplayerhq.hu
Mon Aug 25 22:17:55 CEST 2008


Author: ramiro
Date: Mon Aug 25 22:17:55 2008
New Revision: 3619

Log:
Use compression_level to decide how far to search for the best offset.


Modified:
   mlp/mlpenc.c

Modified: mlp/mlpenc.c
==============================================================================
--- mlp/mlpenc.c	(original)
+++ mlp/mlpenc.c	Mon Aug 25 22:17:55 2008
@@ -149,6 +149,8 @@ typedef struct {
     ChannelParams  *prev_channel_params;
     DecodingParams *prev_decoding_params;
 
+    unsigned int    max_codebook_search;
+
     DSPContext      dsp;
 } MLPEncodeContext;
 
@@ -476,6 +478,13 @@ static av_cold int mlp_encode_init(AVCod
     /* TODO Let user pass major header interval as parameter. */
     ctx->major_header_interval = MAJOR_HEADER_INTERVAL;
 
+    if (avctx->compression_level == -1) {
+        ctx->max_codebook_search = 3;
+    } else {
+        /* TODO Decide how much to test with the compression_level the user wants. */
+        ctx->max_codebook_search = 3 * avctx->compression_level;
+    }
+
     /* TODO Let user pass parameters for LPC filter. */
 
     lpc_sample_buffer_size = avctx->frame_size
@@ -1501,7 +1510,7 @@ static inline void codebook_bits(MLPEnco
                 *bo = temp_bo;
 
             is_greater = 0;
-        } else if (++is_greater >= 3)
+        } else if (++is_greater >= ctx->max_codebook_search)
             break;
 
         previous_count = temp_bo.bitcount;



More information about the FFmpeg-soc mailing list