Merge commit 'e62a43f6b1a9c0c82e1df33c0c038e32029c0aa4'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 29 Nov 2013 21:44:27 +0000 (22:44 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 29 Nov 2013 21:45:05 +0000 (22:45 +0100)
* commit 'e62a43f6b1a9c0c82e1df33c0c038e32029c0aa4':
  mpeg4videodec: move MpegEncContext.time_increment_bits to Mpeg4DecContext

Conflicts:
libavcodec/mpeg4videodec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/mpeg4video.h
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo.h

Simple merge
@@@ -372,17 -364,6 +372,17 @@@ static int mpeg4_decode_sprite_trajecto
      return 0;
  }
  
- static int decode_new_pred(MpegEncContext *s, GetBitContext *gb) {
-     int len = FFMIN(s->time_increment_bits + 3, 15);
++static int decode_new_pred(Mpeg4DecContext *ctx, GetBitContext *gb) {
++    int len = FFMIN(ctx->time_increment_bits + 3, 15);
 +
 +    get_bits(gb, len);
 +    if (get_bits1(gb))
 +        get_bits(gb, len);
 +    check_marker(gb, "after new_pred");
 +
 +    return 0;
 +}
 +
  /**
   * Decode the next video packet.
   * @return <0 if something went wrong
@@@ -470,8 -464,7 +470,8 @@@ int ff_mpeg4_decode_video_packet_header
              }
          }
      }
 -    // FIXME new-pred stuff
 +    if (s->new_pred)
-         decode_new_pred(s, &s->gb);
++        decode_new_pred(ctx, &s->gb);
  
      return 0;
  }
@@@ -2017,17 -1980,6 +2017,17 @@@ no_cplx_est
          }
      }
  
-                s->time_increment_bits,
 +    if (s->avctx->debug&FF_DEBUG_PICT_INFO) {
 +        av_log(s->avctx, AV_LOG_DEBUG, "tb %d/%d, tincrbits:%d, qp_prec:%d, ps:%d,  %s%s%s%s\n",
 +               s->avctx->time_base.num, s->avctx->time_base.den,
++               ctx->time_increment_bits,
 +               s->quant_precision,
 +               s->progressive_sequence,
 +               s->scalability ? "scalability " :"" , s->quarter_sample ? "qpel " : "",
 +               s->data_partitioning ? "partition " : "", s->rvlc ? "rvlc " : ""
 +        );
 +    }
 +
      return 0;
  }
  
@@@ -2133,10 -2083,7 +2133,10 @@@ static int decode_vop_header(Mpeg4DecCo
          }
  
          av_log(s->avctx, AV_LOG_ERROR,
-                "my guess is %d bits ;)\n", s->time_increment_bits);
-         if (s->avctx->time_base.den && 4*s->avctx->time_base.den < 1<<s->time_increment_bits) {
-             s->avctx->time_base.den = 1<<s->time_increment_bits;
+                "my guess is %d bits ;)\n", ctx->time_increment_bits);
++        if (s->avctx->time_base.den && 4*s->avctx->time_base.den < 1<<ctx->time_increment_bits) {
++            s->avctx->time_base.den = 1<<ctx->time_increment_bits;
 +        }
      }
  
      if (IS_3IV1)
              av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n");
          return FRAME_SKIPPED;
      }
-         decode_new_pred(s, gb);
 +    if (s->new_pred)
++        decode_new_pred(ctx, gb);
 +
      if (ctx->shape != BIN_ONLY_SHAPE &&
                      (s->pict_type == AV_PICTURE_TYPE_P ||
                       (s->pict_type == AV_PICTURE_TYPE_S &&
@@@ -2536,12 -2434,33 +2537,12 @@@ static av_cold int decode_init(AVCodecC
      if ((ret = ff_h263_decode_init(avctx)) < 0)
          return ret;
  
 -    if (!done) {
 -        done = 1;
 -
 -        ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
 -        ff_init_rl(&ff_rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]);
 -        ff_init_rl(&ff_rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]);
 -        INIT_VLC_RL(ff_mpeg4_rl_intra, 554);
 -        INIT_VLC_RL(ff_rvlc_rl_inter, 1072);
 -        INIT_VLC_RL(ff_rvlc_rl_intra, 1072);
 -        INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
 -                        &ff_mpeg4_DCtab_lum[0][1], 2, 1,
 -                        &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512);
 -        INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
 -                        &ff_mpeg4_DCtab_chrom[0][1], 2, 1,
 -                        &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512);
 -        INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
 -                        &ff_sprite_trajectory_tab[0][1], 4, 2,
 -                        &ff_sprite_trajectory_tab[0][0], 4, 2, 128);
 -        INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
 -                        &ff_mb_type_b_tab[0][1], 2, 1,
 -                        &ff_mb_type_b_tab[0][0], 2, 1, 16);
 -    }
 +    ff_mpeg4videodec_static_init();
  
      s->h263_pred = 1;
 -    s->low_delay = 0; /* default, might be overriden in the vol header during header parsing */
 +    s->low_delay = 0; /* default, might be overridden in the vol header during header parsing */
      s->decode_mb = mpeg4_decode_mb;
-     s->time_increment_bits = 4; /* default value for broken headers */
+     ctx->time_increment_bits = 4; /* default value for broken headers */
  
      avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
      avctx->internal->allocate_progress = 1;
@@@ -744,12 -714,11 +744,12 @@@ do {
      // Error/bug resilience
      s->next_p_frame_damaged = s1->next_p_frame_damaged;
      s->workaround_bugs      = s1->workaround_bugs;
 +    s->padding_bug_score    = s1->padding_bug_score;
  
      // MPEG4 timing info
-     memcpy(&s->time_increment_bits, &s1->time_increment_bits,
+     memcpy(&s->last_time_base, &s1->last_time_base,
             (char *) &s1->pb_field_time + sizeof(s1->pb_field_time) -
-            (char *) &s1->time_increment_bits);
+            (char *) &s1->last_time_base);
  
      // B-frame info
      s->max_b_frames = s1->max_b_frames;
Simple merge