Merge commit '56672aeaee19216d2fd8eeb9964b1f71f0af2919'
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 20 Jul 2015 19:53:09 +0000 (21:53 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 20 Jul 2015 19:53:09 +0000 (21:53 +0200)
* commit '56672aeaee19216d2fd8eeb9964b1f71f0af2919':
  svq1enc: Do not entangle coded_frame

Conflicts:
libavcodec/svq1enc.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
1  2 
libavcodec/svq1enc.c
libavcodec/svq1enc.h

@@@ -252,8 -243,8 +251,8 @@@ static int svq1_encode_plane(SVQ1EncCon
      int block_width, block_height;
      int level;
      int threshold[6];
 -    uint8_t *src     = s->scratchbuf + stride * 16;
 +    uint8_t *src     = s->scratchbuf + stride * 32;
-     const int lambda = (f->quality * f->quality) >>
+     const int lambda = (s->quality * s->quality) >>
                         (2 * FF_LAMBDA_SHIFT);
  
      /* figure out the acceptable level thresholds in advance */
              }
  
              s->m.mb_x = x;
 -            ff_init_block_index(&s->m);
 -            ff_update_block_index(&s->m);
 +            init_block_index(&s->m);
  
-             if (f->pict_type == AV_PICTURE_TYPE_I ||
+             if (s->pict_type == AV_PICTURE_TYPE_I ||
                  (s->m.mb_type[x + y * s->m.mb_stride] &
                   CANDIDATE_MB_TYPE_INTRA)) {
                  for (i = 0; i < 6; i++)
@@@ -576,12 -570,14 +575,11 @@@ static int svq1_encode_frame(AVCodecCon
                               const AVFrame *pict, int *got_packet)
  {
      SVQ1EncContext *const s = avctx->priv_data;
-     AVFrame *const p        = avctx->coded_frame;
      int i, ret;
  
 -    if (!pkt->data &&
 -        (ret = av_new_packet(pkt, s->y_block_width * s->y_block_height *
 -                             MAX_MB_BYTES * 3 + FF_MIN_BUFFER_SIZE)) < 0) {
 -        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
 +    if ((ret = ff_alloc_packet2(avctx, pkt, s->y_block_width * s->y_block_height *
 +                             MAX_MB_BYTES*3 + FF_MIN_BUFFER_SIZE)) < 0)
          return ret;
 -    }
  
      if (avctx->pix_fmt != AV_PIX_FMT_YUV410P) {
          av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
Simple merge