intrax8: Carry over the loopfilter value in ff_intrax8_decode_picture

Helps in decoupling this code from mpegvideo.
pull/235/head^2
Vittorio Giovara 9 years ago
parent 68127e1bf8
commit 577393321c
  1. 5
      libavcodec/intrax8.c
  2. 7
      libavcodec/intrax8.h
  3. 3
      libavcodec/vc1_block.c
  4. 3
      libavcodec/wmv2dec.c

@ -712,7 +712,7 @@ block_placed:
if (!chroma)
x8_update_predictions(w, w->orient, n);
if (s->loop_filter) {
if (w->loopfilter) {
uint8_t *ptr = w->dest[chroma];
int linesize = s->current_picture.f->linesize[!!chroma];
@ -776,7 +776,7 @@ av_cold void ff_intrax8_common_end(IntraX8Context *w)
}
int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant,
int quant_offset)
int quant_offset, int loopfilter)
{
MpegEncContext *const s = w->s;
int mb_xy;
@ -786,6 +786,7 @@ int ff_intrax8_decode_picture(IntraX8Context *const w, int dquant,
w->dquant = dquant;
w->quant = dquant >> 1;
w->qsum = quant_offset;
w->loopfilter = loopfilter;
w->divide_quant_dc_luma = ((1 << 16) + (w->quant >> 1)) / w->quant;
if (w->quant < 5) {

@ -42,6 +42,7 @@ typedef struct IntraX8Context {
int quant;
int dquant;
int qsum;
int loopfilter;
// calculated per frame
int quant_dc_chroma;
@ -78,14 +79,16 @@ void ff_intrax8_common_end(IntraX8Context *w);
/**
* Decode single IntraX8 frame.
* The parent codec must fill s->loopfilter and s->gb (bitstream).
* The parent codec must fill s->gb (bitstream).
* The parent codec must call ff_mpv_frame_start() before calling this function.
* The parent codec must call ff_mpv_frame_end() after calling this function.
* This function does not use ff_mpv_decode_mb().
* @param w pointer to IntraX8Context
* @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 ff_intrax8_decode_picture(IntraX8Context *w, int quant, int halfpq,
int loopfilter);
#endif /* AVCODEC_INTRAX8_H */

@ -3022,7 +3022,8 @@ 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);
ff_intrax8_decode_picture(&v->x8, 2 * v->pq + v->halfpq,
v->pq * !v->pquantizer, v->s.loop_filter);
ff_er_add_slice(&v->s.er, 0, 0,
(v->s.mb_x >> 1) - 1, (v->s.mb_y >> 1) - 1,

@ -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, 2 * s->qscale, (s->qscale - 1) | 1,
s->loop_filter);
ff_er_add_slice(&w->s.er, 0, 0,
(w->s.mb_x >> 1) - 1, (w->s.mb_y >> 1) - 1,

Loading…
Cancel
Save