[FFmpeg-cvslog] Merge commit 'b4a911c189962e563a09fb0efaf6fa9ab56263a4'

Clément Bœsch git at videolan.org
Fri May 19 12:18:24 EEST 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Fri May 19 11:15:16 2017 +0200| [19bb2cade5c8a9d7e666b9b668f7bb8f28e8b759] | committer: Clément Bœsch

Merge commit 'b4a911c189962e563a09fb0efaf6fa9ab56263a4'

* commit 'b4a911c189962e563a09fb0efaf6fa9ab56263a4':
  mpegvideoenc: make a table const

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19bb2cade5c8a9d7e666b9b668f7bb8f28e8b759
---

 libavcodec/x86/mpegvideoenc.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c
index 67b26178a8..52d59c5694 100644
--- a/libavcodec/x86/mpegvideoenc.c
+++ b/libavcodec/x86/mpegvideoenc.c
@@ -28,7 +28,12 @@
 #include "libavcodec/mpegvideo.h"
 
 /* not permutated inverse zigzag_direct + 1 for MMX quantizer */
-DECLARE_ALIGNED(16, static uint16_t, inv_zigzag_direct16)[64];
+DECLARE_ALIGNED(16, static const uint16_t, inv_zigzag_direct16)[64] = {
+    1,  2,  6,  7,  15, 16, 28, 29, 3,  5,  8,  14, 17, 27, 30, 43, 4,  9,  13,
+    18, 26, 31, 42, 44, 10, 12, 19, 25, 32, 41, 45, 54, 11, 20, 24, 33, 40, 46,
+    53, 55, 21, 23, 34, 39, 47, 52, 56, 61, 22, 35, 38, 48, 51, 57, 60, 62, 36,
+    37, 49, 50, 58, 59, 63, 64,
+};
 
 #if HAVE_6REGS
 
@@ -204,10 +209,6 @@ static void  denoise_dct_sse2(MpegEncContext *s, int16_t *block){
 av_cold void ff_dct_encode_init_x86(MpegEncContext *s)
 {
     const int dct_algo = s->avctx->dct_algo;
-    int i;
-
-    for (i = 0; i < 64; i++)
-        inv_zigzag_direct16[ff_zigzag_direct[i]] = i + 1;
 
     if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
 #if HAVE_MMX_INLINE


======================================================================

diff --cc libavcodec/x86/mpegvideoenc.c
index 67b26178a8,ead2ed1757..52d59c5694
--- a/libavcodec/x86/mpegvideoenc.c
+++ b/libavcodec/x86/mpegvideoenc.c
@@@ -28,10 -28,13 +28,15 @@@
  #include "libavcodec/mpegvideo.h"
  
  /* not permutated inverse zigzag_direct + 1 for MMX quantizer */
- DECLARE_ALIGNED(16, static uint16_t, inv_zigzag_direct16)[64];
+ DECLARE_ALIGNED(16, static const uint16_t, inv_zigzag_direct16)[64] = {
+     1,  2,  6,  7,  15, 16, 28, 29, 3,  5,  8,  14, 17, 27, 30, 43, 4,  9,  13,
+     18, 26, 31, 42, 44, 10, 12, 19, 25, 32, 41, 45, 54, 11, 20, 24, 33, 40, 46,
+     53, 55, 21, 23, 34, 39, 47, 52, 56, 61, 22, 35, 38, 48, 51, 57, 60, 62, 36,
+     37, 49, 50, 58, 59, 63, 64,
+ };
  
 +#if HAVE_6REGS
 +
  #if HAVE_MMX_INLINE
  #define COMPILE_TEMPLATE_MMXEXT 0
  #define COMPILE_TEMPLATE_SSE2   0
@@@ -198,16 -196,11 +203,12 @@@ static void  denoise_dct_sse2(MpegEncCo
                              "%xmm4", "%xmm5", "%xmm6", "%xmm7")
      );
  }
 +#endif /* HAVE_SSE2_INLINE */
  #endif /* HAVE_INLINE_ASM */
  
 -av_cold void ff_mpv_encode_init_x86(MpegEncContext *s)
 +av_cold void ff_dct_encode_init_x86(MpegEncContext *s)
  {
      const int dct_algo = s->avctx->dct_algo;
-     int i;
- 
-     for (i = 0; i < 64; i++)
-         inv_zigzag_direct16[ff_zigzag_direct[i]] = i + 1;
  
      if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
  #if HAVE_MMX_INLINE



More information about the ffmpeg-cvslog mailing list