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

ramiro subversion at mplayerhq.hu
Thu Aug 21 00:14:28 CEST 2008


Author: ramiro
Date: Thu Aug 21 00:14:28 2008
New Revision: 3497

Log:
Rename MLPEncodeContext.sample_rate to mlp_sample_rate to mean it's
not a simple number but encoded for MLP.

Modified:
   mlp/mlpenc.c

Modified: mlp/mlpenc.c
==============================================================================
--- mlp/mlpenc.c	(original)
+++ mlp/mlpenc.c	Thu Aug 21 00:14:28 2008
@@ -82,7 +82,7 @@ typedef struct {
                                      *   Normal channels + noise channels. */
 
     int             sample_fmt;     ///< sample format encoded for MLP
-    int             sample_rate;    ///< sample rate encoded for MLP
+    int             mlp_sample_rate;    ///< sample rate encoded for MLP
 
     int32_t        *sample_buffer;  ///< Pointer to current access unit samples.
     int32_t        *major_frame_buffer; ///< Buffer with all data for one entire major frame interval.
@@ -153,8 +153,8 @@ static void write_major_sync(MLPEncodeCo
     put_bits(&pb,  8, SYNC_MLP         );
     put_bits(&pb,  4, ctx->sample_fmt  );
     put_bits(&pb,  4, ctx->sample_fmt  );
-    put_bits(&pb,  4, ctx->sample_rate );
-    put_bits(&pb,  4, ctx->sample_rate );
+    put_bits(&pb,  4, ctx->mlp_sample_rate );
+    put_bits(&pb,  4, ctx->mlp_sample_rate );
     put_bits(&pb, 11, 0                ); /* This value is 0 in all tested
                                            * MLP samples. */
     put_bits(&pb,  5, ctx->mlp_channels);
@@ -308,8 +308,8 @@ static av_cold int mlp_encode_init(AVCod
 
     ctx->avctx = avctx;
 
-    ctx->sample_rate = mlp_sample_rate(avctx->sample_rate);
-    if (ctx->sample_rate < 0) {
+    ctx->mlp_sample_rate = mlp_sample_rate(avctx->sample_rate);
+    if (ctx->mlp_sample_rate < 0) {
         av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d. Supported "
                             "sample rates are 44100, 88200, 176400, 48000, "
                             "96000, and 192000.\n", avctx->sample_rate);
@@ -333,7 +333,7 @@ static av_cold int mlp_encode_init(AVCod
         return -1;
     }
 
-    avctx->frame_size               = 40 << (ctx->sample_rate & 0x7);
+    avctx->frame_size               = 40 << (ctx->mlp_sample_rate & 0x7);
     avctx->coded_frame              = avcodec_alloc_frame();
     avctx->coded_frame->key_frame   = 1;
 



More information about the FFmpeg-soc mailing list