Merge commit 'ca09effb01e126b0ac74ff3de70a475423ddee82'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 6 Jan 2015 20:54:26 +0000 (21:54 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 6 Jan 2015 20:54:26 +0000 (21:54 +0100)
* commit 'ca09effb01e126b0ac74ff3de70a475423ddee82':
  ffv1: Drop unnecessary casts and const qualifiers to match function signatures

Conflicts:
libavcodec/ffv1dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/ffv1dec.c

@@@ -852,31 -824,20 +852,31 @@@ static av_cold int decode_init(AVCodecC
      return 0;
  }
  
 -static int ffv1_decode_frame(AVCodecContext *avctx, void *data,
 -                             int *got_frame, AVPacket *avpkt)
 +static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
  {
-     const uint8_t *buf  = avpkt->data;
+     uint8_t *buf        = avpkt->data;
      int buf_size        = avpkt->size;
      FFV1Context *f      = avctx->priv_data;
      RangeCoder *const c = &f->slice_context[0]->c;
      int i, ret;
      uint8_t keystate = 128;
-     const uint8_t *buf_p;
+     uint8_t *buf_p;
 -    AVFrame *const p    = data;
 +    AVFrame *p;
 +
 +    if (f->last_picture.f)
 +        ff_thread_release_buffer(avctx, &f->last_picture);
 +    FFSWAP(ThreadFrame, f->picture, f->last_picture);
  
 -    f->cur = p;
 +    f->cur = p = f->picture.f;
  
 +    if (f->version < 3 && avctx->field_order > AV_FIELD_PROGRESSIVE) {
 +        /* we have interlaced material flagged in container */
 +        p->interlaced_frame = 1;
 +        if (avctx->field_order == AV_FIELD_TT || avctx->field_order == AV_FIELD_TB)
 +            p->top_field_first = 1;
 +    }
 +
 +    f->avctx = avctx;
      ff_init_range_decoder(c, buf, buf_size);
      ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8);
  
          if (i) {
              ff_init_range_decoder(&fs->c, buf_p, v);
          } else
-             fs->c.bytestream_end = (uint8_t *)(buf_p + v);
+             fs->c.bytestream_end = buf_p + v;
  
 +        fs->avctx = avctx;
          fs->cur = p;
      }
  
                  int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0;
                  dst[j] = p->data[j] + p->linesize[j] *
                           (fs->slice_y >> sv) + (fs->slice_x >> sh);
 -                src[j] = f->last_picture->data[j] +
 -                         f->last_picture->linesize[j] *
 +                src[j] = f->last_picture.f->data[j] + f->last_picture.f->linesize[j] *
                           (fs->slice_y >> sv) + (fs->slice_x >> sh);
              }
-             av_image_copy(dst, p->linesize, (const uint8_t **)src,
+             av_image_copy(dst, p->linesize, src,
 -                          f->last_picture->linesize,
 -                          avctx->pix_fmt, fs->slice_width,
 +                          f->last_picture.f->linesize,
 +                          avctx->pix_fmt,
 +                          fs->slice_width,
                            fs->slice_height);
          }
      }