ffmpeg | branch: master | Derek Buitenhuis <derek.buitenh...@gmail.com> | Sun Apr 24 12:19:53 2016 +0100| [83e0b1b1d7b4120f1bdd2576e977a6bda0283ce9] | committer: Derek Buitenhuis
Merge commit '68127e1bf8037a6e0acd6401cc8c5da950e3fa0a' * commit '68127e1bf8037a6e0acd6401cc8c5da950e3fa0a': intrax8: Keep a reference to the context idctdsp Merged-by: Derek Buitenhuis <derek.buitenh...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=83e0b1b1d7b4120f1bdd2576e977a6bda0283ce9 --- configure | 1 + libavcodec/intrax8.c | 6 ++++-- libavcodec/intrax8.h | 6 +++++- libavcodec/vc1dec.c | 2 +- libavcodec/wmv2dec.c | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 97f374b..1f5788b 100755 --- a/configure +++ b/configure @@ -2261,6 +2261,7 @@ faandct_deps="faan fdctdsp" faanidct_deps="faan idctdsp" h264dsp_select="startcode" frame_thread_encoder_deps="encoders threads" +intrax8_select="idctdsp" mdct_select="fft" me_cmp_select="fdctdsp idctdsp pixblockdsp" mpeg_er_select="error_resilience" diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index 9141c5b..471009e 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -488,7 +488,7 @@ static void x8_ac_compensation(IntraX8Context *const w, const int direction, { MpegEncContext *const s = w->s; int t; -#define B(x,y) s->block[0][w->idct_permutation[(x)+(y)*8]] +#define B(x,y) s->block[0][w->idct_permutation[(x) + (y) * 8]] #define T(x) ((x) * dc_level + 0x8000) >> 16; switch (direction) { case 0: @@ -739,12 +739,14 @@ 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, MpegEncContext *const s) +av_cold int ff_intrax8_common_init(IntraX8Context *w, IDCTDSPContext *idsp, + MpegEncContext *const s) { int ret = x8_vlc_init(); if (ret < 0) return ret; + w->idsp = *idsp; w->s = s; //two rows, 2 blocks per cannon mb diff --git a/libavcodec/intrax8.h b/libavcodec/intrax8.h index fdbcdec..849e04d 100644 --- a/libavcodec/intrax8.h +++ b/libavcodec/intrax8.h @@ -21,6 +21,7 @@ #include "get_bits.h" #include "mpegvideo.h" +#include "idctdsp.h" #include "intrax8dsp.h" #include "wmv2dsp.h" @@ -40,6 +41,7 @@ typedef struct IntraX8Context { //set by the caller codec MpegEncContext * s; IntraX8DSPContext dsp; + IDCTDSPContext idsp; int quant; int dquant; int qsum; @@ -64,10 +66,12 @@ typedef struct IntraX8Context { * Initialize IntraX8 frame decoder. * Requires valid MpegEncContext with valid s->mb_width before calling. * @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, MpegEncContext *const s); +int ff_intrax8_common_init(IntraX8Context *w, IDCTDSPContext *idsp, + MpegEncContext *const s); /** * Destroy IntraX8 frame structure. diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index dae697b..25251c8 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); + ret = ff_intrax8_common_init(&v->x8, &s->idsp, s); if (ret < 0) goto error; diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index 934bf15..a365838 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -466,7 +466,7 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx) ff_wmv2_common_init(w); - return ff_intrax8_common_init(&w->x8, &w->s); + return ff_intrax8_common_init(&w->x8, &w->s.idsp, &w->s); } static av_cold int wmv2_decode_end(AVCodecContext *avctx) ====================================================================== diff --cc configure index 97f374b,99b9405..1f5788b --- a/configure +++ b/configure @@@ -2260,8 -1863,9 +2260,9 @@@ error_resilience_select="me_cmp faandct_deps="faan fdctdsp" faanidct_deps="faan idctdsp" h264dsp_select="startcode" +frame_thread_encoder_deps="encoders threads" + intrax8_select="idctdsp" mdct_select="fft" -rdft_select="fft" me_cmp_select="fdctdsp idctdsp pixblockdsp" mpeg_er_select="error_resilience" mpegaudio_select="mpegaudiodsp" diff --cc libavcodec/intrax8.c index 9141c5b,0082591..471009e --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@@ -488,7 -492,7 +488,7 @@@ static void x8_ac_compensation(IntraX8C { MpegEncContext *const s = w->s; int t; - #define B(x,y) s->block[0][w->idct_permutation[(x)+(y)*8]] -#define B(x, y) s->block[0][w->idsp.idct_permutation[(x) + (y) * 8]] ++#define B(x,y) s->block[0][w->idct_permutation[(x) + (y) * 8]] #define T(x) ((x) * dc_level + 0x8000) >> 16; switch (direction) { case 0: @@@ -745,9 -750,10 +746,10 @@@ av_cold int ff_intrax8_common_init(Intr if (ret < 0) return ret; + w->idsp = *idsp; w->s = s; - // two rows, 2 blocks per cannon mb + //two rows, 2 blocks per cannon mb w->prediction_table = av_mallocz(s->mb_width * 2 * 2); if (!w->prediction_table) return AVERROR(ENOMEM); diff --cc libavcodec/intrax8.h index fdbcdec,ef88d83..849e04d --- a/libavcodec/intrax8.h +++ b/libavcodec/intrax8.h @@@ -21,8 -21,8 +21,9 @@@ #include "get_bits.h" #include "mpegvideo.h" + #include "idctdsp.h" #include "intrax8dsp.h" +#include "wmv2dsp.h" typedef struct IntraX8Context { VLC *j_ac_vlc[4]; // they point to the static j_mb_vlc @@@ -34,12 -34,11 +35,13 @@@ // set by ff_intrax8_common_init uint8_t *prediction_table; // 2 * (mb_w * 2) ScanTable scantable[3]; + WMV2DSPContext wdsp; + uint8_t idct_permutation[64]; - // set by the caller codec - MpegEncContext *s; + //set by the caller codec + MpegEncContext * s; IntraX8DSPContext dsp; + IDCTDSPContext idsp; int quant; int dquant; int qsum; diff --cc libavcodec/vc1dec.c index dae697b,9e64a6b..25251c8 --- 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); + ret = ff_intrax8_common_init(&v->x8, &s->idsp, s); if (ret < 0) goto error; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog