~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/ac3dsp.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
    }
172
172
}
173
173
 
 
174
static void ac3_downmix_c(float **samples, float (*matrix)[2],
 
175
                          int out_ch, int in_ch, int len)
 
176
{
 
177
    int i, j;
 
178
    float v0, v1;
 
179
    if (out_ch == 2) {
 
180
        for (i = 0; i < len; i++) {
 
181
            v0 = v1 = 0.0f;
 
182
            for (j = 0; j < in_ch; j++) {
 
183
                v0 += samples[j][i] * matrix[j][0];
 
184
                v1 += samples[j][i] * matrix[j][1];
 
185
            }
 
186
            samples[0][i] = v0;
 
187
            samples[1][i] = v1;
 
188
        }
 
189
    } else if (out_ch == 1) {
 
190
        for (i = 0; i < len; i++) {
 
191
            v0 = 0.0f;
 
192
            for (j = 0; j < in_ch; j++)
 
193
                v0 += samples[j][i] * matrix[j][0];
 
194
            samples[0][i] = v0;
 
195
        }
 
196
    }
 
197
}
 
198
 
174
199
av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
175
200
{
176
201
    c->ac3_exponent_min = ac3_exponent_min_c;
182
207
    c->update_bap_counts = ac3_update_bap_counts_c;
183
208
    c->compute_mantissa_size = ac3_compute_mantissa_size_c;
184
209
    c->extract_exponents = ac3_extract_exponents_c;
 
210
    c->downmix = ac3_downmix_c;
185
211
 
186
212
    if (ARCH_ARM)
187
213
        ff_ac3dsp_init_arm(c, bit_exact);
188
 
    if (HAVE_MMX)
 
214
    if (ARCH_X86)
189
215
        ff_ac3dsp_init_x86(c, bit_exact);
190
216
}