[FFmpeg-cvslog] r17880 - in trunk/libavcodec: mpc.c mpc.h mpc7.c mpc8.c

kostya subversion
Sun Mar 8 17:37:57 CET 2009


Author: kostya
Date: Sun Mar  8 17:37:57 2009
New Revision: 17880

Log:
Make Musepack decoders use LFG pseudorandom generator

Modified:
   trunk/libavcodec/mpc.c
   trunk/libavcodec/mpc.h
   trunk/libavcodec/mpc7.c
   trunk/libavcodec/mpc8.c

Modified: trunk/libavcodec/mpc.c
==============================================================================
--- trunk/libavcodec/mpc.c	Sun Mar  8 17:08:18 2009	(r17879)
+++ trunk/libavcodec/mpc.c	Sun Mar  8 17:37:57 2009	(r17880)
@@ -25,7 +25,6 @@
  * divided into 32 subbands.
  */
 
-#include "libavutil/random.h"
 #include "avcodec.h"
 #include "bitstream.h"
 #include "dsputil.h"

Modified: trunk/libavcodec/mpc.h
==============================================================================
--- trunk/libavcodec/mpc.h	Sun Mar  8 17:08:18 2009	(r17879)
+++ trunk/libavcodec/mpc.h	Sun Mar  8 17:37:57 2009	(r17880)
@@ -28,7 +28,7 @@
 #ifndef AVCODEC_MPC_H
 #define AVCODEC_MPC_H
 
-#include "libavutil/random.h"
+#include "libavutil/lfg.h"
 #include "avcodec.h"
 #include "bitstream.h"
 #include "dsputil.h"
@@ -62,7 +62,7 @@ typedef struct {
     int cur_frame, frames;
     uint8_t *bits;
     int buf_size;
-    AVRandomState rnd;
+    AVLFG rnd;
     int frames_to_skip;
     /* for synthesis */
     DECLARE_ALIGNED_16(MPA_INT, synth_buf[MPA_MAX_CHANNELS][512*2]);

Modified: trunk/libavcodec/mpc7.c
==============================================================================
--- trunk/libavcodec/mpc7.c	Sun Mar  8 17:08:18 2009	(r17879)
+++ trunk/libavcodec/mpc7.c	Sun Mar  8 17:37:57 2009	(r17880)
@@ -25,7 +25,7 @@
  * divided into 32 subbands.
  */
 
-#include "libavutil/random.h"
+#include "libavutil/lfg.h"
 #include "avcodec.h"
 #include "bitstream.h"
 #include "dsputil.h"
@@ -53,7 +53,7 @@ static av_cold int mpc7_decode_init(AVCo
         return -1;
     }
     memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
-    av_random_init(&c->rnd, 0xDEADBEEF);
+    av_lfg_init(&c->rnd, 0xDEADBEEF);
     dsputil_init(&c->dsp, avctx);
     c->dsp.bswap_buf((uint32_t*)buf, (const uint32_t*)avctx->extradata, 4);
     ff_mpc_init();
@@ -118,7 +118,7 @@ static inline void idx_to_quant(MPCConte
     switch(idx){
     case -1:
         for(i = 0; i < SAMPLES_PER_BAND; i++){
-            *dst++ = (av_random(&c->rnd) & 0x3FC) - 510;
+            *dst++ = (av_lfg_get(&c->rnd) & 0x3FC) - 510;
         }
         break;
     case 1:

Modified: trunk/libavcodec/mpc8.c
==============================================================================
--- trunk/libavcodec/mpc8.c	Sun Mar  8 17:08:18 2009	(r17879)
+++ trunk/libavcodec/mpc8.c	Sun Mar  8 17:37:57 2009	(r17880)
@@ -25,7 +25,7 @@
  * divided into 32 subbands.
  */
 
-#include "libavutil/random.h"
+#include "libavutil/lfg.h"
 #include "avcodec.h"
 #include "bitstream.h"
 #include "dsputil.h"
@@ -100,7 +100,7 @@ static av_cold int mpc8_decode_init(AVCo
         return -1;
     }
     memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
-    av_random_init(&c->rnd, 0xDEADBEEF);
+    av_lfg_init(&c->rnd, 0xDEADBEEF);
     dsputil_init(&c->dsp, avctx);
 
     ff_mpc_init();
@@ -284,7 +284,7 @@ static int mpc8_decode_frame(AVCodecCont
             switch(res){
             case -1:
                 for(j = 0; j < SAMPLES_PER_BAND; j++)
-                    c->Q[ch][off + j] = (av_random(&c->rnd) & 0x3FC) - 510;
+                    c->Q[ch][off + j] = (av_lfg_get(&c->rnd) & 0x3FC) - 510;
                 break;
             case 0:
                 break;




More information about the ffmpeg-cvslog mailing list