Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 15th, 2010  |  syntax: C  |  size: 4.41 KB  |  views: 107  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: apps/codecs/lib/codeclib.h
  2. ===================================================================
  3. --- apps/codecs/lib/codeclib.h  (revision 24686)
  4. +++ apps/codecs/lib/codeclib.h  (working copy)
  5.  -68,11 +68,11 @@
  6.  extern void mdct_backward(int n, int32_t *in, int32_t *out);
  7.  /* -2- ffmpeg fft-based mdct */
  8.  extern int ff_mdct_init(MDCTContext *s, int nbits, int inverse);
  9. -extern void ff_imdct_half(MDCTContext *s, int32_t *output, const int32_t *input);
  10. -extern void ff_imdct_calc(MDCTContext *s, int32_t *output, const int32_t *input);
  11. +extern void ff_imdct_half(int nbits, int32_t *output, const int32_t *input);
  12. +extern void ff_imdct_calc(int nbits, int32_t *output, const int32_t *input);
  13.  /*ffmpeg fft (can be used without mdct)*/
  14.  extern void ff_fft_calc_c(int nbits, FFTComplex *z);
  15. -extern int ff_fft_init(void *s, int nbits, int inverse);
  16. +//extern int ff_fft_init(void *s, int nbits, int inverse);
  17.  
  18.  #if defined(CPU_ARM) && (ARM_ARCH == 4)
  19.  /* optimised unsigned integer division for ARMv4, in IRAM */
  20. Index: apps/codecs/lib/mdct.c
  21. ===================================================================
  22. --- apps/codecs/lib/mdct.c      (revision 24686)
  23. +++ apps/codecs/lib/mdct.c      (working copy)
  24.  -56,12 +56,12 @@
  25.   * NOTE - CANNOT CURRENTLY OPERATE IN PLACE (input and output must
  26.   *                                          not overlap or intersect at all)
  27.   */
  28. -void ff_imdct_half(MDCTContext *s, fixed32 *output, const fixed32 *input)
  29. +void ff_imdct_half(int nbits, fixed32 *output, const fixed32 *input)
  30.  {
  31.      int n8, n4, n2, n, j;
  32.      const fixed32 *in1, *in2;
  33.      
  34. -    n = 1 << s->nbits;
  35. +    n = 1 << nbits;
  36.  
  37.      n2 = n >> 1;
  38.      n4 = n >> 2;
  39.  -74,8 +74,8 @@
  40.      in2 = input + n2 - 1;
  41.      
  42.      /* revtab comes from the fft; revtab table is sized for N=4096 size fft = 2^12.
  43. -       The fft is size N/4 so s->nbits-2, so our shift needs to be (12-(nbits-2)) */
  44. -    const int revtab_shift = (14- s->nbits);
  45. +       The fft is size N/4 so nbits-2, so our shift needs to be (12-(nbits-2)) */
  46. +    const int revtab_shift = (14- nbits);
  47.      
  48.      /* bitreverse reorder the input and rotate;   result here is in OUTPUT ... */
  49.      /* (note that when using the current split radix, the bitreverse ordering is
  50.  -93,7 +93,7 @@
  51.          an mdct-local set of twiddles to do that part)
  52.         */
  53.      const int32_t *T = sincos_lookup0;
  54. -    const int step = 2<<(12-s->nbits);
  55. +    const int step = 2<<(12-nbits);
  56.      const uint16_t * p_revtab=revtab;
  57.      {
  58.          const uint16_t * const p_revtab_end = p_revtab + n8;
  59.  -134,10 +134,10 @@
  60.  
  61.  
  62.      /* ... and so fft runs in OUTPUT buffer */
  63. -    ff_fft_calc_c(s->nbits-2, z);
  64. +    ff_fft_calc_c(nbits-2, z);
  65.  
  66.      /* post rotation + reordering.  now keeps the result within the OUTPUT buffer */
  67. -    switch( s->nbits )
  68. +    switch( nbits )
  69.      {
  70.          default:
  71.          {
  72.  -266,9 +266,9 @@
  73.   *            <-----------output----------->
  74.   *
  75.   */
  76. -void ff_imdct_calc(MDCTContext *s, fixed32 *output, const fixed32 *input)
  77. +void ff_imdct_calc(int nbits, fixed32 *output, const fixed32 *input)
  78.  {
  79. -    const int n = (1<<s->nbits);
  80. +    const int n = (1<<nbits);
  81.      const int n2 = (n>>1);
  82.      const int n4 = (n>>2);
  83.      
  84. Index: apps/codecs/lib/mdct.h
  85. ===================================================================
  86. --- apps/codecs/lib/mdct.h      (revision 24680)
  87. +++ apps/codecs/lib/mdct.h      (working copy)
  88.  -35,8 +35,8 @@
  89.  MDCTContext;
  90.  
  91.  int ff_mdct_init(MDCTContext *s, int nbits, int inverse);
  92. -void ff_imdct_calc(MDCTContext *s, fixed32 *output, const fixed32 *input);
  93. -void ff_imdct_half(MDCTContext *s, fixed32 *output, const fixed32 *input);
  94. +void ff_imdct_calc(int nbits, fixed32 *output, const fixed32 *input);
  95. +void ff_imdct_half(int nbits, fixed32 *output, const fixed32 *input);
  96.  
  97.  #ifdef CPU_ARM
  98.  
  99. Index: apps/codecs/libwma/wmadeci.c
  100. ===================================================================
  101. --- apps/codecs/libwma/wmadeci.c        (revision 24680)
  102. +++ apps/codecs/libwma/wmadeci.c        (working copy)
  103.  -1253,7 +1253,7 @@
  104.              mdct_backward( (1 << (s->block_len_bits+1)), (int32_t*)(*(s->coefs))[ch], (int32_t*)scratch_buffer);
  105.  */
  106.              /*slower but more easily understood IMDCT from FFMPEG*/
  107. -            ff_imdct_calc(&s->mdct_ctx[bsize],
  108. +            ff_imdct_calc(s->block_len_bits+1,
  109.                            (int32_t*)scratch_buffer,
  110.                            (*(s->coefs))[ch]);
clone this paste RAW Paste Data