summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-15 14:04:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-15 14:09:35 +0200
commitae237a117acbe958bea798e32249f4c2baeca5f9 (patch)
treec45fc400e59ab03d5346a82580bfc2054b9efe0f /libavcodec/wmaprodec.c
parent4f5e5a05132be4946a655b991850bf81b7497893 (diff)
parent95cd815c3663603871a1f2da95846e8f72d4ea96 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: swscale: try to use mmap only if available configure: check for mprotect wmapro: use planar sample format wmalossless: output in planar sample format wmadec: use float planar sample format output shorten: use planar sample format lavc: update documentation for AVFrame.extended_data Conflicts: libavcodec/shorten.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 9de8c3861b..4d15e45875 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -94,7 +94,6 @@
#include "put_bits.h"
#include "wmaprodata.h"
#include "dsputil.h"
-#include "fmtconvert.h"
#include "sinewin.h"
#include "wma.h"
#include "wma_common.h"
@@ -171,7 +170,6 @@ typedef struct WMAProDecodeCtx {
AVCodecContext* avctx; ///< codec context for av_log
AVFrame frame; ///< AVFrame for decoded output
DSPContext dsp; ///< accelerated DSP functions
- FmtConvertContext fmt_conv;
uint8_t frame_data[MAX_FRAMESIZE +
FF_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data
PutBitContext pb; ///< context for filling the frame_data buffer
@@ -283,10 +281,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->avctx = avctx;
ff_dsputil_init(&s->dsp, avctx);
- ff_fmt_convert_init(&s->fmt_conv, avctx);
init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
- avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
if (avctx->extradata_size >= 18) {
s->decode_flags = AV_RL16(edata_ptr+14);
@@ -1310,8 +1307,6 @@ static int decode_frame(WMAProDecodeCtx *s, int *got_frame_ptr)
int more_frames = 0;
int len = 0;
int i, ret;
- const float *out_ptr[WMAPRO_MAX_CHANNELS];
- float *samples;
/** get frame length */
if (s->len_prefix)
@@ -1384,13 +1379,11 @@ static int decode_frame(WMAProDecodeCtx *s, int *got_frame_ptr)
s->packet_loss = 1;
return 0;
}
- samples = (float *)s->frame.data[0];
- /** interleave samples and write them to the output buffer */
+ /** copy samples to the output buffer */
for (i = 0; i < s->num_channels; i++)
- out_ptr[i] = s->channel[i].out;
- s->fmt_conv.float_interleave(samples, out_ptr, s->samples_per_frame,
- s->num_channels);
+ memcpy(s->frame.extended_data[i], s->channel[i].out,
+ s->samples_per_frame * sizeof(*s->channel[i].out));
for (i = 0; i < s->num_channels; i++) {
/** reuse second half of the IMDCT output for the next frame */
@@ -1643,4 +1636,6 @@ AVCodec ff_wmapro_decoder = {
.capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
.flush = flush,
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"),
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
+ AV_SAMPLE_FMT_NONE },
};