]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ra288.c
Simplify ptr[0]; ptr++; to *ptr++
[ffmpeg] / libavcodec / ra288.c
index 908292034630cf6e01bf7b45248c8306f06a53d9..9ba5209ab412619eb8c0bd952d3d028735dc8076 100644 (file)
@@ -2,42 +2,44 @@
  * RealAudio 2.0 (28.8K)
  * Copyright (c) 2003 the ffmpeg project
  *
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "avcodec.h"
 #include "ra288.h"
+
 typedef struct {
-       float   history[8];
-       float   output[40];
-       float   pr1[36];
-       float   pr2[10];
-       int     phase, phasep;
-
-       float st1a[111],st1b[37],st1[37];
-       float st2a[38],st2b[11],st2[11];
-       float sb[41];
-       float lhist[10];
+        float   history[8];
+        float   output[40];
+        float   pr1[36];
+        float   pr2[10];
+        int     phase, phasep;
+
+        float   st1a[111],st1b[37],st1[37];
+        float   st2a[38],st2b[11],st2[11];
+        float   sb[41];
+        float   lhist[10];
 } Real288_internal;
 
 static int ra288_decode_init(AVCodecContext * avctx)
 {
-       Real288_internal *glob=avctx->priv_data;
-       memset(glob,0,sizeof(Real288_internal));
-       return 0;
+        Real288_internal *glob=avctx->priv_data;
+        memset(glob,0,sizeof(Real288_internal));
+        return 0;
 }
 
 static void prodsum(float *tgt, float *src, int len, int n);
@@ -109,7 +111,7 @@ static void decode(Real288_internal *glob, unsigned int input)
   for (sum=32,x=10;x--;sum-=glob->pr2[x]*glob->lhist[x]);
   if (sum<0) sum=0; else if (sum>60) sum=60;
 
-  sumsum=exp(sum*0.1151292546497)*f;   /* pow(10.0,sum/20)*f */
+  sumsum=exp(sum*0.1151292546497)*f;    /* pow(10.0,sum/20)*f */
   for (sum=0,x=5;x--;) { buffer[x]=table[x]*sumsum; sum+=buffer[x]*buffer[x]; }
   if ((sum/=5)<1) sum=1;
 
@@ -180,7 +182,7 @@ static void co(int n, int i, int j, float *in, float *out, float *st1, float *st
     if (x==c) fp=in;
     work[x]=*(table++)*(*(st1++)=*(fp++));
   }
-  
+
   prodsum(buffer1,work+n,i,n);
   prodsum(buffer2,work+a,j,n);
 
@@ -232,8 +234,8 @@ static int ra288_decode_frame(AVCodecContext * avctx,
 
     if (buf_size < avctx->block_align)
     {
-       av_log(avctx, AV_LOG_ERROR, "ffra288: Error! Input buffer is too small [%d<%d]\n",buf_size,avctx->block_align);
-       return 0;
+        av_log(avctx, AV_LOG_ERROR, "ffra288: Error! Input buffer is too small [%d<%d]\n",buf_size,avctx->block_align);
+        return 0;
     }
 
     datao = data;