aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ra288.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:28:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:28:27 +0100
commit08059f6150fcf75d884670cdbdbdf8830fa199bd (patch)
tree3e3c42784e6b34b0de16fa3fad2fbd852f59137c /libavcodec/ra288.c
parent65da7007043cf4fb99b72c7f823cfc15e429b45f (diff)
parent5d5c248c3df30fa91a8dde639618c985b9a11c53 (diff)
downloadffmpeg-08059f6150fcf75d884670cdbdbdf8830fa199bd.tar.gz
Merge commit '5d5c248c3df30fa91a8dde639618c985b9a11c53'
* commit '5d5c248c3df30fa91a8dde639618c985b9a11c53': s302m: decode directly to the user-provided AVFrame ra288: decode directly to the user-provided AVFrame ra144: decode directly to the user-provided AVFrame ralf: decode directly to the user-provided AVFrame qdm2: decode directly to the user-provided AVFrame Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ra288.c')
-rw-r--r--libavcodec/ra288.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index cb6eadba7d..dac8aa6032 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -38,7 +38,6 @@
#define RA288_BLOCKS_PER_FRAME 32
typedef struct {
- AVFrame frame;
AVFloatDSPContext fdsp;
DECLARE_ALIGNED(32, float, sp_lpc)[FFALIGN(36, 16)]; ///< LPC coefficients for speech data (spec: A)
DECLARE_ALIGNED(32, float, gain_lpc)[FFALIGN(10, 16)]; ///< LPC coefficients for gain (spec: GB)
@@ -75,9 +74,6 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
avpriv_float_dsp_init(&ractx->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
- avcodec_get_frame_defaults(&ractx->frame);
- avctx->coded_frame = &ractx->frame;
-
return 0;
}
@@ -185,6 +181,7 @@ static void backward_filter(RA288Context *ractx,
static int ra288_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;
float *out;
@@ -200,12 +197,12 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
}
/* get output buffer */
- ractx->frame.nb_samples = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME;
- if ((ret = ff_get_buffer(avctx, &ractx->frame)) < 0) {
+ frame->nb_samples = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME;
+ if ((ret = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
- out = (float *)ractx->frame.data[0];
+ out = (float *)frame->data[0];
init_get_bits(&gb, buf, avctx->block_align * 8);
@@ -227,8 +224,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
}
}
- *got_frame_ptr = 1;
- *(AVFrame *)data = ractx->frame;
+ *got_frame_ptr = 1;
return avctx->block_align;
}