]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '8072345e9f86d88fbc4a15c17cb03f1e4701c9a5'
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sun, 24 Apr 2016 11:34:16 +0000 (12:34 +0100)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sun, 24 Apr 2016 11:34:16 +0000 (12:34 +0100)
* commit '8072345e9f86d88fbc4a15c17cb03f1e4701c9a5':
  intrax8: Keep a reference to the GetBitContext reader

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
1  2 
libavcodec/intrax8.c
libavcodec/intrax8.h
libavcodec/vc1_block.c
libavcodec/wmv2dec.c

index 2b37658cb7de6acf4f17eac6fceece0061da7590,f23ab811c282f08818dff2425851c7773d8396a1..9d3390cec4fd487cf70298bbcd60cdbe5c9c78d2
@@@ -133,30 -132,30 +133,27 @@@ static void x8_reset_vlc_tables(IntraX8
  
  static inline void x8_select_ac_table(IntraX8Context *const w, int mode)
  {
-     MpegEncContext *const s = w->s;
      int table_index;
  
 -    assert(mode < 4);
 +    av_assert2(mode < 4);
  
      if (w->j_ac_vlc[mode])
          return;
  
-     table_index       = get_bits(&s->gb, 3);
+     table_index       = get_bits(w->gb, 3);
      // 2 modes use same tables
      w->j_ac_vlc[mode] = &j_ac_vlc[w->quant < 13][mode >> 1][table_index];
 -
 -    assert(w->j_ac_vlc[mode]);
 +    av_assert2(w->j_ac_vlc[mode]);
  }
  
  static inline int x8_get_orient_vlc(IntraX8Context *w)
  {
-     MpegEncContext *const s = w->s;
      if (!w->j_orient_vlc) {
-         int table_index = get_bits(&s->gb, 1 + (w->quant < 13));
+         int table_index = get_bits(w->gb, 1 + (w->quant < 13));
          w->j_orient_vlc = &j_orient_vlc[w->quant < 13][table_index];
      }
 -    assert(w->j_orient_vlc);
 -    assert(w->j_orient_vlc->table);
  
-     return get_vlc2(&s->gb, w->j_orient_vlc->table, OR_VLC_BITS, OR_VLC_MTD);
+     return get_vlc2(w->gb, w->j_orient_vlc->table, OR_VLC_BITS, OR_VLC_MTD);
  }
  
  #define extra_bits(eb)  (eb)        // 3 bits
@@@ -290,17 -288,18 +286,16 @@@ static const uint8_t dc_index_offset[] 
  static int x8_get_dc_rlf(IntraX8Context *const w, const int mode,
                           int *const level, int *const final)
  {
-     MpegEncContext *const s = w->s;
      int i, e, c;
  
 -    assert(mode < 3);
 +    av_assert2(mode < 3);
      if (!w->j_dc_vlc[mode]) {
-         int table_index = get_bits(&s->gb, 3);
+         int table_index = get_bits(w->gb, 3);
          // 4 modes, same table
          w->j_dc_vlc[mode] = &j_dc_vlc[w->quant < 13][table_index];
      }
 -    assert(w->j_dc_vlc);
 -    assert(w->j_dc_vlc[mode]->table);
  
-     i = get_vlc2(&s->gb, w->j_dc_vlc[mode]->table, DC_VLC_BITS, DC_VLC_MTD);
+     i = get_vlc2(w->gb, w->j_dc_vlc[mode]->table, DC_VLC_BITS, DC_VLC_MTD);
  
      /* (i >= 17) { i -= 17; final =1; } */
      c        = i > 16;
@@@ -780,8 -775,9 +776,8 @@@ int ff_intrax8_decode_picture(IntraX8Co
  {
      MpegEncContext *const s = w->s;
      int mb_xy;
-     w->use_quant_matrix = get_bits1(&s->gb);
 -    assert(s);
  
+     w->gb     = gb;
      w->dquant = dquant;
      w->quant  = dquant >> 1;
      w->qsum   = quant_offset;
index 64a33cea2f1031fcf8623a37ffe54b22fa7fecb5,f07349f3c432613eb6d22b44e798f7b9f2f647c1..988f0c10ec70b10034aa6d5c8783556df264fe2f
@@@ -88,10 -86,9 +89,10 @@@ void ff_intrax8_common_end(IntraX8Conte
   * 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().
 + * lowres decoding is theoretically impossible.
   * @param w pointer to IntraX8Context
   * @param pict the output Picture containing an AVFrame
+  * @param gb open bitstream reader
   * @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
Simple merge
Simple merge