static inline uint32_t show_bits(struct getbit_context *gbc, int num)
{
int idx = gbc->index;
- const uint8_t *p = gbc->buffer + (idx >> 3);
- uint32_t x = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
+ const char *p = (const char *)gbc->buffer + (idx >> 3);
+ uint32_t x = read_u32_be(p);
return (x << (idx & 7)) >> (32 - num);
}
}
/* z[0...8n - 1], w[1...2n - 1] */
-#define PASS(name)\
-static void name(struct fft_complex *z, const fftsample_t *wre, unsigned int n)\
-{\
- fftsample_t t1, t2, t3, t4, t5, t6;\
- int o1 = 2 * n;\
- int o2 = 4 * n;\
- int o3 = 6 * n;\
- const fftsample_t *wim = wre + o1;\
- n--;\
-\
- TRANSFORM_ZERO(z[0], z[o1], z[o2], z[o3]);\
- TRANSFORM(z[1], z[o1 + 1], z[o2 + 1], z[o3 + 1], wre[1], wim[-1]);\
- do {\
- z += 2;\
- wre += 2;\
- wim -= 2;\
- TRANSFORM(z[0], z[o1], z[o2], z[o3], wre[0], wim[0]);\
- TRANSFORM(z[1], z[o1 + 1], z[o2 + 1], z[o3 + 1], wre[1], wim[-1]);\
- } while (--n);\
+static void pass(struct fft_complex *z, const fftsample_t *wre, unsigned int n)
+{
+ fftsample_t t1, t2, t3, t4, t5, t6;
+ int o1 = 2 * n;
+ int o2 = 4 * n;
+ int o3 = 6 * n;
+ const fftsample_t *wim = wre + o1;
+
+ n--;
+ TRANSFORM_ZERO(z[0], z[o1], z[o2], z[o3]);
+ TRANSFORM(z[1], z[o1 + 1], z[o2 + 1], z[o3 + 1], wre[1], wim[-1]);
+ do {
+ z += 2;
+ wre += 2;
+ wim -= 2;
+ TRANSFORM(z[0], z[o1], z[o2], z[o3], wre[0], wim[0]);
+ TRANSFORM(z[1], z[o1 + 1], z[o2 + 1], z[o3 + 1], wre[1], wim[-1]);
+ } while (--n);
}
-PASS(pass)
#undef BUTTERFLIES
#define BUTTERFLIES BUTTERFLIES_BIG
sfc++;
}
PARA_INFO_LOG("%d frames, %d superframes\n", fc, sfc);
- if (num_superframes)
- *num_superframes = sfc;
+ *num_superframes = sfc;
return fc;
}
*out++ = in;
return 1;
}
- bytes = (wma_log2(in) + 4) / 5;
+ bytes = DIV_ROUND_UP(wma_log2(in), 5);
shift = (bytes - 1) * 6;
*out++ = (256 - (256 >> bytes)) | (in >> shift);
while (shift >= 6) {