--- libavcodec/intrax8.c | 21 +++++++++++---------- libavcodec/intrax8.h | 7 +++++-- libavcodec/vc1_block.c | 4 +++- libavcodec/wmv2dec.c | 3 ++- 4 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index d9c156c..d0e7e93 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -333,7 +333,7 @@ static int x8_setup_spatial_predictor(IntraX8Context *const w, const int chroma) int quant; w->dsp.setup_spatial_compensation(w->dest[chroma], s->sc.edge_emu_buffer, - s->current_picture.f->linesize[chroma > 0], + w->frame->linesize[chroma > 0], &range, &sum, w->edges); if (chroma) { w->orient = w->chroma_orient; @@ -664,7 +664,7 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma) dsp_x8_put_solidcolor(av_clip_uint8((dc_level * dc_quant + 4) >> 3), w->dest[chroma], - s->current_picture.f->linesize[!!chroma]); + w->frame->linesize[!!chroma]); goto block_placed; } @@ -690,15 +690,15 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma) if (w->flat_dc) { dsp_x8_put_solidcolor(w->predicted_dc, w->dest[chroma], - s->current_picture.f->linesize[!!chroma]); + w->frame->linesize[!!chroma]); } else { w->dsp.spatial_compensation[w->orient](s->sc.edge_emu_buffer, w->dest[chroma], - s->current_picture.f->linesize[!!chroma]); + w->frame->linesize[!!chroma]); } if (!zeros_only) w->idsp.idct_add(w->dest[chroma], - s->current_picture.f->linesize[!!chroma], + w->frame->linesize[!!chroma], s->block[0]); block_placed: @@ -707,7 +707,7 @@ block_placed: if (w->loopfilter) { uint8_t *ptr = w->dest[chroma]; - int linesize = s->current_picture.f->linesize[!!chroma]; + int linesize = w->frame->linesize[!!chroma]; if (!((w->edges & 2) || (zeros_only && (w->orient | 4) == 4))) w->dsp.h_loop_filter(ptr, linesize, w->quant); @@ -768,8 +768,8 @@ av_cold void ff_intrax8_common_end(IntraX8Context *w) av_freep(&w->prediction_table); } -int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant, - int quant_offset, int loopfilter) +int ff_intrax8_decode_picture(IntraX8Context *const w, Picture *pict, + int dquant, int quant_offset, int loopfilter) { MpegEncContext *const s = w->s; int mb_xy; @@ -779,6 +779,7 @@ int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant, w->dquant = dquant; w->quant = dquant >> 1; w->qsum = quant_offset; + w->frame = pict->f; w->loopfilter = loopfilter; w->divide_quant_dc_luma = ((1 << 16) + (w->quant >> 1)) / w->quant; @@ -795,7 +796,7 @@ int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant, s->resync_mb_y = 0; for (s->mb_y = 0; s->mb_y < s->mb_height * 2; s->mb_y++) { - x8_init_block_index(w, s->current_picture.f, s->mb_y); + x8_init_block_index(w, w->frame, s->mb_y); mb_xy = (s->mb_y >> 1) * s->mb_stride; for (s->mb_x = 0; s->mb_x < s->mb_width * 2; s->mb_x++) { @@ -824,7 +825,7 @@ int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant, /* emulate MB info in the relevant tables */ s->mbskip_table[mb_xy] = 0; s->mbintra_table[mb_xy] = 1; - s->current_picture.qscale_table[mb_xy] = w->quant; + pict->qscale_table[mb_xy] = w->quant; mb_xy++; } w->dest[0] += 8; diff --git a/libavcodec/intrax8.h b/libavcodec/intrax8.h index ba3a207..e82a432 100644 --- a/libavcodec/intrax8.h +++ b/libavcodec/intrax8.h @@ -23,6 +23,7 @@ #include "mpegvideo.h" #include "idctdsp.h" #include "intrax8dsp.h" +#include "mpegpicture.h" typedef struct IntraX8Context { VLC *j_ac_vlc[4]; // they point to the static j_mb_vlc @@ -43,6 +44,7 @@ typedef struct IntraX8Context { int dquant; int qsum; int loopfilter; + AVFrame *frame; // calculated per frame int quant_dc_chroma; @@ -86,11 +88,12 @@ void ff_intrax8_common_end(IntraX8Context *w); * calling this function. * This function does not use ff_mpv_decode_mb(). * @param w pointer to IntraX8Context + * @param pict the output Picture containing an AVFrame * @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1. * @param quant_offset offset away from zero * @param loopfilter enable filter after decoding a block */ -int ff_intrax8_decode_picture(IntraX8Context *w, int quant, int halfpq, - int loopfilter); +int ff_intrax8_decode_picture(IntraX8Context *w, Picture *pict, + int quant, int halfpq, int loopfilter); #endif /* AVCODEC_INTRAX8_H */ diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index 558e9e3..5a42fc0 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -3022,7 +3022,9 @@ void ff_vc1_decode_blocks(VC1Context *v) v->s.esc3_level_length = 0; if (v->x8_type) { - ff_intrax8_decode_picture(&v->x8, 2 * v->pq + v->halfpq, v->pq * !v->pquantizer, v->s.loop_filter); + ff_intrax8_decode_picture(&v->x8, &v->s.current_picture, + 2 * v->pq + v->halfpq, v->pq * !v->pquantizer, + v->s.loop_filter); } else { v->cur_blk_idx = 0; v->left_blk_idx = -1; diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index 7680761..1d498b4 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -228,7 +228,8 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s) s->picture_number++; // FIXME ? if (w->j_type) { - ff_intrax8_decode_picture(&w->x8, 2 * s->qscale, (s->qscale - 1) | 1, + ff_intrax8_decode_picture(&w->x8, &s->current_picture, + 2 * s->qscale, (s->qscale - 1) | 1, s->loop_filter); return 1; } -- 2.7.0 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel