Merge commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3'

* commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3':
  intrax8: Reference the current AVCodecContext

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
Derek Buitenhuis 2016-04-24 12:34:58 +01:00
commit 52692eed61
4 changed files with 9 additions and 4 deletions

View File

@ -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;

View File

@ -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);
/**

View File

@ -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;

View File

@ -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)