summaryrefslogtreecommitdiff
path: root/libavcodec/amrwbdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 11:45:25 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 11:45:25 +0100
commitf03cdbd0454fbdba53a123a8f95186a519fade8d (patch)
treec7386c765f42c684b931dcefb6382d4aadf43e5a /libavcodec/amrwbdec.c
parentd13f434dbb55348b3ed761e4f4c2ff9c7be4ea4b (diff)
parent5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20 (diff)
Merge commit '5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20'
* commit '5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20': binkaudio: decode directly to the user-provided AVFrame atrac3: decode directly to the user-provided AVFrame atrac1: decode directly to the user-provided AVFrame ape: decode directly to the user-provided AVFrame amrwb: decode directly to the user-provided AVFrame Conflicts: libavcodec/amrwbdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/amrwbdec.c')
-rw-r--r--libavcodec/amrwbdec.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index f06d40b960..c0481325e7 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -45,7 +45,6 @@
#include "mips/amrwbdec_mips.h"
typedef struct {
- AVFrame avframe; ///< AVFrame for decoded samples
AMRWBFrame frame; ///< AMRWB parameters decoded from bitstream
enum Mode fr_cur_mode; ///< mode index of current frame
uint8_t fr_quality; ///< frame quality index (FQI)
@@ -121,9 +120,6 @@ static av_cold int amrwb_decode_init(AVCodecContext *avctx)
for (i = 0; i < 4; i++)
ctx->prediction_error[i] = MIN_ENERGY;
- avcodec_get_frame_defaults(&ctx->avframe);
- avctx->coded_frame = &ctx->avframe;
-
ff_acelp_filter_init(&ctx->acelpf_ctx);
ff_acelp_vectors_init(&ctx->acelpv_ctx);
ff_celp_filter_init(&ctx->celpf_ctx);
@@ -1097,6 +1093,7 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AMRWBContext *ctx = avctx->priv_data;
+ AVFrame *frame = data;
AMRWBFrame *cf = &ctx->frame;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
@@ -1114,12 +1111,12 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
int sub, i, ret;
/* get output buffer */
- ctx->avframe.nb_samples = 4 * AMRWB_SFR_SIZE_16k;
- if ((ret = ff_get_buffer(avctx, &ctx->avframe)) < 0) {
+ frame->nb_samples = 4 * AMRWB_SFR_SIZE_16k;
+ if ((ret = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
- buf_out = (float *)ctx->avframe.data[0];
+ buf_out = (float *)frame->data[0];
header_size = decode_mime_header(ctx, buf);
if (ctx->fr_cur_mode > MODE_SID) {
@@ -1265,8 +1262,7 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
memcpy(ctx->isp_sub4_past, ctx->isp[3], LP_ORDER * sizeof(ctx->isp[3][0]));
memcpy(ctx->isf_past_final, ctx->isf_cur, LP_ORDER * sizeof(float));
- *got_frame_ptr = 1;
- *(AVFrame *)data = ctx->avframe;
+ *got_frame_ptr = 1;
return expected_fr_size;
}