[FFmpeg-cvslog] Merge commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3'
Derek Buitenhuis
git at videolan.org
Sun Apr 24 13:47:43 CEST 2016
ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Sun Apr 24 12:34:58 2016 +0100| [52692eed615cc6dd05edae5505044401059408a0] | committer: Derek Buitenhuis
Merge commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3'
* commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3':
intrax8: Reference the current AVCodecContext
Merged-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52692eed615cc6dd05edae5505044401059408a0
---
libavcodec/intrax8.c | 4 +++-
libavcodec/intrax8.h | 5 ++++-
libavcodec/vc1dec.c | 2 +-
libavcodec/wmv2dec.c | 2 +-
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index 9d3390c..a4aaad6 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -733,13 +733,15 @@ static void x8_init_block_index(IntraX8Context *w, AVFrame *frame, int mb_y)
w->dest[2] += (mb_y & (~1)) * uvlinesize << 2;
}
-av_cold int ff_intrax8_common_init(IntraX8Context *w, IDCTDSPContext *idsp,
+av_cold int ff_intrax8_common_init(AVCodecContext *avctx,
+ IntraX8Context *w, IDCTDSPContext *idsp,
MpegEncContext *const s)
{
int ret = x8_vlc_init();
if (ret < 0)
return ret;
+ w->avctx = avctx;
w->idsp = *idsp;
w->s = s;
diff --git a/libavcodec/intrax8.h b/libavcodec/intrax8.h
index 988f0c1..af19582 100644
--- a/libavcodec/intrax8.h
+++ b/libavcodec/intrax8.h
@@ -38,6 +38,7 @@ typedef struct IntraX8Context {
ScanTable scantable[3];
WMV2DSPContext wdsp;
uint8_t idct_permutation[64];
+ AVCodecContext *avctx;
//set by the caller codec
MpegEncContext * s;
@@ -70,12 +71,14 @@ typedef struct IntraX8Context {
/**
* Initialize IntraX8 frame decoder.
* Requires valid MpegEncContext with valid s->mb_width before calling.
+ * @param avctx pointer to AVCodecContext
* @param w pointer to IntraX8Context
* @param idsp pointer to IDCTDSPContext
* @param s pointer to MpegEncContext of the parent codec
* @return 0 on success, a negative AVERROR value on error
*/
-int ff_intrax8_common_init(IntraX8Context *w, IDCTDSPContext *idsp,
+int ff_intrax8_common_init(AVCodecContext *avctx,
+ IntraX8Context *w, IDCTDSPContext *idsp,
MpegEncContext *const s);
/**
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 25251c8..786c6db 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -387,7 +387,7 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
return AVERROR(ENOMEM);
}
- ret = ff_intrax8_common_init(&v->x8, &s->idsp, s);
+ ret = ff_intrax8_common_init(s->avctx, &v->x8, &s->idsp, s);
if (ret < 0)
goto error;
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 629dc80..67a06b6 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -468,7 +468,7 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx)
ff_wmv2_common_init(w);
- return ff_intrax8_common_init(&w->x8, &w->s.idsp, &w->s);
+ return ff_intrax8_common_init(avctx, &w->x8, &w->s.idsp, &w->s);
}
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
======================================================================
diff --cc libavcodec/intrax8.h
index 988f0c1,7a0eaf7..af19582
--- a/libavcodec/intrax8.h
+++ b/libavcodec/intrax8.h
@@@ -36,11 -35,10 +36,12 @@@ typedef struct IntraX8Context
// set by ff_intrax8_common_init
uint8_t *prediction_table; // 2 * (mb_w * 2)
ScanTable scantable[3];
+ WMV2DSPContext wdsp;
+ uint8_t idct_permutation[64];
+ AVCodecContext *avctx;
- // set by the caller codec
- MpegEncContext *s;
+ //set by the caller codec
+ MpegEncContext * s;
IntraX8DSPContext dsp;
IDCTDSPContext idsp;
int quant;
diff --cc libavcodec/vc1dec.c
index 25251c8,250d72a..786c6db
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@@ -382,12 -372,14 +382,12 @@@ av_cold int ff_vc1_decode_init_alloc_ta
v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
- for (i = 0; i < 4; i++) {
- v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width);
- if (!v->sr_rows[i >> 1][i & 1])
- goto error;
- }
+ for (i = 0; i < 4; i++)
+ if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width)))
+ return AVERROR(ENOMEM);
}
- ret = ff_intrax8_common_init(&v->x8, &s->idsp, s);
+ ret = ff_intrax8_common_init(s->avctx, &v->x8, &s->idsp, s);
if (ret < 0)
goto error;
More information about the ffmpeg-cvslog
mailing list