summaryrefslogtreecommitdiff
path: root/libavcodec/imc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:05:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:05:00 +0100
commit5459cf411412c7a1d2da7ce6a6955c7d57490a55 (patch)
tree18117251ae2ca34fd6895998f9699ef09855427a /libavcodec/imc.c
parentd88e674a15dc23ca6bb68173dbb7c12e5d668bb5 (diff)
parenta8ea936a0a00570f61a16a588821b52f6a3115c2 (diff)
Merge commit 'a8ea936a0a00570f61a16a588821b52f6a3115c2'
* commit 'a8ea936a0a00570f61a16a588821b52f6a3115c2': libilbc: decode directly to the user-provided AVFrame dpcm: decode directly to the user-provided AVFrame imc/iac: decode directly to the user-provided AVFrame gsm: decode directly to the user-provided AVFrame Conflicts: libavcodec/dpcm.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/imc.c')
-rw-r--r--libavcodec/imc.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index c127b2559e..0f434614c6 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -81,8 +81,6 @@ typedef struct IMCChannel {
} IMCChannel;
typedef struct {
- AVFrame frame;
-
IMCChannel chctx[2];
/** MDCT tables */
@@ -253,9 +251,6 @@ static av_cold int imc_decode_init(AVCodecContext *avctx)
avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO
: AV_CH_LAYOUT_STEREO;
- avcodec_get_frame_defaults(&q->frame);
- avctx->coded_frame = &q->frame;
-
return 0;
}
@@ -937,6 +932,7 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
static int imc_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
+ AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int ret, i;
@@ -951,14 +947,14 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
- q->frame.nb_samples = COEFFS;
- if ((ret = ff_get_buffer(avctx, &q->frame)) < 0) {
+ frame->nb_samples = COEFFS;
+ if ((ret = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
for (i = 0; i < avctx->channels; i++) {
- q->out_samples = (float *)q->frame.extended_data[i];
+ q->out_samples = (float *)frame->extended_data[i];
q->dsp.bswap16_buf(buf16, (const uint16_t*)buf, IMC_BLOCK_SIZE / 2);
@@ -971,12 +967,11 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
}
if (avctx->channels == 2) {
- q->fdsp.butterflies_float((float *)q->frame.extended_data[0],
- (float *)q->frame.extended_data[1], COEFFS);
+ q->fdsp.butterflies_float((float *)frame->extended_data[0],
+ (float *)frame->extended_data[1], COEFFS);
}
- *got_frame_ptr = 1;
- *(AVFrame *)data = q->frame;
+ *got_frame_ptr = 1;
return IMC_BLOCK_SIZE * avctx->channels;
}