Merge commit 'f4d581cda3897f66c1dda7586b93f86a591dbbef'
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sun, 24 Apr 2016 10:47:15 +0000 (11:47 +0100)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sun, 24 Apr 2016 10:47:39 +0000 (11:47 +0100)
* commit 'f4d581cda3897f66c1dda7586b93f86a591dbbef':
  lavc: Deduplicate zigzag_scan table

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
1  2 
libavcodec/h264_ps.c
libavcodec/h264_slice.c
libavcodec/h264data.h
libavcodec/mathops.h
libavcodec/mathtables.c
libavcodec/svq3.c
libavcodec/tscc2.c
libavcodec/tscc2data.h
libavcodec/vp8.c
libavcodec/vp8data.h

  
  #include "libavutil/imgutils.h"
  #include "internal.h"
+ #include "mathops.h"
  #include "avcodec.h"
  #include "h264.h"
 +#include "h264data.h"
  #include "golomb.h"
  
  #define MAX_LOG2_MAX_FRAME_NUM    (12 + 4)
@@@ -833,8 -789,8 +833,8 @@@ static void init_scan_tables(H264Contex
  {
      int i;
      for (i = 0; i < 16; i++) {
 -#define TRANSPOSE(x) (x >> 2) | ((x << 2) & 0xF)
 +#define TRANSPOSE(x) ((x) >> 2) | (((x) << 2) & 0xF)
-         h->zigzag_scan[i] = TRANSPOSE(zigzag_scan[i]);
+         h->zigzag_scan[i] = TRANSPOSE(ff_zigzag_scan[i]);
          h->field_scan[i]  = TRANSPOSE(field_scan[i]);
  #undef TRANSPOSE
      }
  #undef TRANSPOSE
      }
      if (h->sps.transform_bypass) { // FIXME same ugly
-         memcpy(h->zigzag_scan_q0          , zigzag_scan             , sizeof(h->zigzag_scan_q0         ));
 -        h->zigzag_scan_q0          = ff_zigzag_scan;
 -        h->zigzag_scan8x8_q0       = ff_zigzag_direct;
 -        h->zigzag_scan8x8_cavlc_q0 = zigzag_scan8x8_cavlc;
 -        h->field_scan_q0           = field_scan;
 -        h->field_scan8x8_q0        = field_scan8x8;
 -        h->field_scan8x8_cavlc_q0  = field_scan8x8_cavlc;
++        memcpy(h->zigzag_scan_q0          , ff_zigzag_scan          , sizeof(h->zigzag_scan_q0         ));
 +        memcpy(h->zigzag_scan8x8_q0       , ff_zigzag_direct        , sizeof(h->zigzag_scan8x8_q0      ));
 +        memcpy(h->zigzag_scan8x8_cavlc_q0 , zigzag_scan8x8_cavlc    , sizeof(h->zigzag_scan8x8_cavlc_q0));
 +        memcpy(h->field_scan_q0           , field_scan              , sizeof(h->field_scan_q0          ));
 +        memcpy(h->field_scan8x8_q0        , field_scan8x8           , sizeof(h->field_scan8x8_q0       ));
 +        memcpy(h->field_scan8x8_cavlc_q0  , field_scan8x8_cavlc     , sizeof(h->field_scan8x8_cavlc_q0 ));
      } else {
 -        h->zigzag_scan_q0          = h->zigzag_scan;
 -        h->zigzag_scan8x8_q0       = h->zigzag_scan8x8;
 -        h->zigzag_scan8x8_cavlc_q0 = h->zigzag_scan8x8_cavlc;
 -        h->field_scan_q0           = h->field_scan;
 -        h->field_scan8x8_q0        = h->field_scan8x8;
 -        h->field_scan8x8_cavlc_q0  = h->field_scan8x8_cavlc;
 +        memcpy(h->zigzag_scan_q0          , h->zigzag_scan          , sizeof(h->zigzag_scan_q0         ));
 +        memcpy(h->zigzag_scan8x8_q0       , h->zigzag_scan8x8       , sizeof(h->zigzag_scan8x8_q0      ));
 +        memcpy(h->zigzag_scan8x8_cavlc_q0 , h->zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
 +        memcpy(h->field_scan_q0           , h->field_scan           , sizeof(h->field_scan_q0          ));
 +        memcpy(h->field_scan8x8_q0        , h->field_scan8x8        , sizeof(h->field_scan8x8_q0       ));
 +        memcpy(h->field_scan8x8_cavlc_q0  , h->field_scan8x8_cavlc  , sizeof(h->field_scan8x8_cavlc_q0 ));
      }
  }
  
Simple merge
@@@ -33,6 -33,8 +33,7 @@@ extern const uint32_t ff_inverse[257]
  extern const uint8_t ff_sqrt_tab[256];
  extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP];
  extern const uint8_t ff_zigzag_direct[64];
 -extern const uint8_t ff_zigzag_scan[16];
++extern const uint8_t ff_zigzag_scan[16+1];
  
  #if   ARCH_ARM
  #   include "arm/mathops.h"
@@@ -105,3 -122,10 +105,10 @@@ const uint8_t ff_zigzag_direct[64] = 
      58, 59, 52, 45, 38, 31, 39, 46,
      53, 60, 61, 54, 47, 55, 62, 63
  };
 -const uint8_t ff_zigzag_scan[16] = {
++const uint8_t ff_zigzag_scan[16+1] = {
+     0 + 0 * 4, 1 + 0 * 4, 0 + 1 * 4, 0 + 2 * 4,
+     1 + 1 * 4, 2 + 0 * 4, 3 + 0 * 4, 2 + 1 * 4,
+     1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
+     3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
+ };
  #include "h264_mvpred.h"
  #include "golomb.h"
  #include "hpeldsp.h"
+ #include "mathops.h"
  #include "rectangle.h"
  #include "tpeldsp.h"
 +#include "vdpau_internal.h"
  
  #if CONFIG_ZLIB
  #include <zlib.h>
@@@ -244,10 -240,11 +245,11 @@@ void ff_svq3_add_idct_c(uint8_t *dst, i
  static inline int svq3_decode_block(GetBitContext *gb, int16_t *block,
                                      int index, const int type)
  {
-     static const uint8_t *const scan_patterns[4] =
-     { luma_dc_zigzag_scan, zigzag_scan, svq3_scan, chroma_dc_scan };
+     static const uint8_t *const scan_patterns[4] = {
+         luma_dc_zigzag_scan, ff_zigzag_scan, svq3_scan, chroma_dc_scan
+     };
  
 -    int run, level, limit;
 +    int run, level, sign, limit;
      unsigned vlc;
      const int intra           = 3 * type >> 2;
      const uint8_t *const scan = scan_patterns[type];
Simple merge
Simple merge
Simple merge
Simple merge