cosmetics: K&R coding style, prettyprinting

Originally committed as revision 19564 to svn://svn.ffmpeg.org/ffmpeg/trunk
release/0.6
Diego Biurrun 16 years ago
parent da136c7e05
commit b25a881851
  1. 8
      libavcodec/wmaprodata.h
  2. 26
      libavcodec/wmaprodec.c

@ -40,7 +40,7 @@ static const uint16_t critical_freq[] = {
/** /**
* @name huffman tables for DPCM-coded scale factors * @name Huffman tables for DPCM-coded scale factors
* @{ * @{
*/ */
#define HUFF_SCALE_SIZE 121 #define HUFF_SCALE_SIZE 121
@ -86,7 +86,7 @@ static const uint8_t scale_huffbits[HUFF_SCALE_SIZE] = {
/** /**
* @name huffman, run and level tables for run level coded scale factors * @name Huffman, run and level tables for runlevel-coded scale factors
* @{ * @{
*/ */
#define HUFF_SCALE_RL_SIZE 120 #define HUFF_SCALE_RL_SIZE 120
@ -157,7 +157,7 @@ static const uint8_t scale_rl_level[HUFF_SCALE_RL_SIZE] = {
/** /**
* @name huffman, run and level codes for run level coded coefficients * @name Huffman, run and level codes for runlevel-coded coefficients
* @{ * @{
*/ */
#define HUFF_COEF0_SIZE 272 #define HUFF_COEF0_SIZE 272
@ -410,7 +410,7 @@ static const uint16_t coef1_level[HUFF_COEF1_SIZE] = {
/** /**
* @name huffman and vector lookup tables for vector-coded coefficients * @name Huffman and vector lookup tables for vector-coded coefficients
* @{ * @{
*/ */
#define HUFF_VEC4_SIZE 127 #define HUFF_VEC4_SIZE 127

@ -13,7 +13,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
av_freep(&s->subwoofer_cutoffs); av_freep(&s->subwoofer_cutoffs);
av_freep(&s->sf_offsets); av_freep(&s->sf_offsets);
for (i=0 ; i<WMAPRO_BLOCK_SIZES ; i++) for (i = 0 ; i < WMAPRO_BLOCK_SIZES ; i++)
ff_mdct_end(&s->mdct_ctx[i]); ff_mdct_end(&s->mdct_ctx[i]);
return 0; return 0;
@ -24,8 +24,8 @@ static av_cold int decode_end(AVCodecContext *avctx)
*@param s codec context *@param s codec context
*@param chgroup channel group for which the matrix needs to be calculated *@param chgroup channel group for which the matrix needs to be calculated
*/ */
static void decode_decorrelation_matrix(WMA3DecodeContext* s, static void decode_decorrelation_matrix(WMA3DecodeContext *s,
WMA3ChannelGroup* chgroup) WMA3ChannelGroup *chgroup)
{ {
int i; int i;
int offset = 0; int offset = 0;
@ -33,25 +33,25 @@ static void decode_decorrelation_matrix(WMA3DecodeContext* s,
memset(chgroup->decorrelation_matrix,0, memset(chgroup->decorrelation_matrix,0,
sizeof(float) *s->num_channels * s->num_channels); sizeof(float) *s->num_channels * s->num_channels);
for (i=0;i<chgroup->num_channels * (chgroup->num_channels - 1) >> 1;i++) for (i = 0; i < chgroup->num_channels * (chgroup->num_channels - 1) >> 1; i++)
rotation_offset[i] = get_bits(&s->gb,6); rotation_offset[i] = get_bits(&s->gb,6);
for (i=0;i<chgroup->num_channels;i++) for (i = 0; i < chgroup->num_channels; i++)
chgroup->decorrelation_matrix[chgroup->num_channels * i + i] = chgroup->decorrelation_matrix[chgroup->num_channels * i + i] =
get_bits1(&s->gb) ? 1.0 : -1.0; get_bits1(&s->gb) ? 1.0 : -1.0;
for (i=1;i<chgroup->num_channels;i++) { for (i = 1; i < chgroup->num_channels; i++) {
int x; int x;
for (x=0;x<i;x++) { for (x = 0; x < i; x++) {
int y; int y;
for (y=0;y < i + 1 ; y++) { for (y = 0; y < i + 1 ; y++) {
float v1 = chgroup->decorrelation_matrix[x * chgroup->num_channels + y]; float v1 = chgroup->decorrelation_matrix[x * chgroup->num_channels + y];
float v2 = chgroup->decorrelation_matrix[i * chgroup->num_channels + y]; float v2 = chgroup->decorrelation_matrix[i * chgroup->num_channels + y];
int n = rotation_offset[offset + x]; int n = rotation_offset[offset + x];
float sinv; float sinv;
float cosv; float cosv;
if (n<32) { if (n < 32) {
sinv = sin64[n]; sinv = sin64[n];
cosv = sin64[32-n]; cosv = sin64[32-n];
} else { } else {
@ -77,7 +77,7 @@ static void inverse_channel_transform(WMA3DecodeContext *s)
{ {
int i; int i;
for (i=0;i<s->num_chgroups;i++) { for (i = 0; i < s->num_chgroups; i++) {
if (s->chgroup[i].transform == 1) { if (s->chgroup[i].transform == 1) {
/** M/S stereo decoding */ /** M/S stereo decoding */
@ -119,10 +119,10 @@ static void inverse_channel_transform(WMA3DecodeContext *s)
if (*tb++ == 1) { if (*tb++ == 1) {
int y; int y;
/** multiply values with the decorrelation_matrix */ /** multiply values with the decorrelation_matrix */
for (y=sfb[0];y<FFMIN(sfb[1], s->subframe_len);y++) { for (y = sfb[0]; y < FFMIN(sfb[1], s->subframe_len); y++) {
const float* mat = s->chgroup[i].decorrelation_matrix; const float* mat = s->chgroup[i].decorrelation_matrix;
const float* data_end= data + num_channels; const float* data_end = data + num_channels;
float* data_ptr= data; float* data_ptr = data;
float** ch; float** ch;
for (ch = ch_data;ch < ch_end; ch++) for (ch = ch_data;ch < ch_end; ch++)

Loading…
Cancel
Save