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

ramiro subversion at mplayerhq.hu
Sun Aug 17 22:27:14 CEST 2008


Author: ramiro
Date: Sun Aug 17 22:27:14 2008
New Revision: 3410

Log:
Move default param_presence_flags to its a function.

Modified:
   mlp/mlpenc.c

Modified: mlp/mlpenc.c
==============================================================================
--- mlp/mlpenc.c	(original)
+++ mlp/mlpenc.c	Sun Aug 17 22:27:14 2008
@@ -266,6 +266,21 @@ static void clear_channel_params(Channel
     }
 }
 
+static uint8_t default_param_presence_flags()
+{
+    uint8_t param_presence_flags = 0;
+
+    param_presence_flags |= PARAM_BLOCKSIZE;
+/*  param_presence_flags |= PARAM_MATRIX; */
+/*  param_presence_flags |= PARAM_OUTSHIFT; */
+    param_presence_flags |= PARAM_QUANTSTEP;
+    param_presence_flags |= PARAM_FIR;
+/*  param_presence_flags |= PARAM_IIR; */
+    param_presence_flags |= PARAM_HUFFOFFSET;
+
+    return param_presence_flags;
+}
+
 static av_cold int mlp_encode_init(AVCodecContext *avctx)
 {
     MLPEncodeContext *ctx = avctx->priv_data;
@@ -340,7 +355,6 @@ static av_cold int mlp_encode_init(AVCod
     for (substr = 0; substr < ctx->num_substreams; substr++) {
         DecodingParams *dp = &ctx->decoding_params[substr];
         RestartHeader  *rh = &ctx->restart_header [substr];
-        uint8_t param_presence_flags = 0;
         unsigned int channel;
 
         rh->min_channel        = 0;
@@ -354,15 +368,7 @@ static av_cold int mlp_encode_init(AVCod
             cp->huff_lsbs                = 24;
         }
 
-        param_presence_flags |= PARAM_BLOCKSIZE;
-/*      param_presence_flags |= PARAM_MATRIX; */
-/*      param_presence_flags |= PARAM_OUTSHIFT; */
-        param_presence_flags |= PARAM_QUANTSTEP;
-        param_presence_flags |= PARAM_FIR;
-/*      param_presence_flags |= PARAM_IIR; */
-        param_presence_flags |= PARAM_HUFFOFFSET;
-
-        dp->param_presence_flags = param_presence_flags;
+        dp->param_presence_flags = default_param_presence_flags();
     }
 
     return 0;



More information about the FFmpeg-soc mailing list