]> git.sesse.net Git - ffmpeg/commitdiff
mpegvideo: Move tables to a separate file
authorVittorio Giovara <vittorio.giovara@gmail.com>
Fri, 29 May 2015 18:44:03 +0000 (19:44 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Sun, 31 May 2015 11:06:19 +0000 (13:06 +0200)
18 files changed:
libavcodec/Makefile
libavcodec/flvdec.c
libavcodec/flvenc.c
libavcodec/h261enc.c
libavcodec/intelh263dec.c
libavcodec/ituh263dec.c
libavcodec/ituh263enc.c
libavcodec/mpeg12.c
libavcodec/mpeg12dec.c
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo.h
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideodata.c [new file with mode: 0644]
libavcodec/mpegvideodata.h [new file with mode: 0644]
libavcodec/msmpeg4.c
libavcodec/rv10.c
libavcodec/rv20enc.c

index 0107460154e4031a1b75328829207d4cbc079894..96cc2580992dad14903f80cb6c30e1e046cdf80d 100644 (file)
@@ -76,7 +76,8 @@ OBJS-$(CONFIG_MPEGAUDIODSP)            += mpegaudiodsp.o                \
                                           mpegaudiodsp_fixed.o          \
                                           mpegaudiodsp_float.o
 OBJS-$(CONFIG_MPEGVIDEO)               += mpegvideo.o mpegvideodsp.o rl.o \
-                                          mpegvideo_motion.o mpegutils.o
+                                          mpegvideo_motion.o mpegutils.o \
+                                          mpegvideodata.o
 OBJS-$(CONFIG_MPEGVIDEOENC)            += mpegvideo_enc.o mpeg12data.o  \
                                           motion_est.o ratecontrol.o    \
                                           mpegvideoencdsp.o
index 0a6f26857988f63210d71fb200a6ef2f9087a1e3..71617947bbcbc5eb8b20460bb0a11c7a963f9de8 100644 (file)
@@ -23,6 +23,7 @@
 #include "flv.h"
 #include "h263.h"
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 
 void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last)
 {
index e14a1056e974a2c691d53d36361d9c1d1e36ad46..f52f66aed81865fb595d10b4fde4999565935f2b 100644 (file)
@@ -21,6 +21,7 @@
 #include "flv.h"
 #include "h263.h"
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 
 void ff_flv_encode_picture_header(MpegEncContext *s, int picture_number)
 {
index f24e590f92d299666e0c914c37141bb3a6c3eec8..ae61fc24c483f537a86c62876600f5376813df1d 100644 (file)
@@ -31,6 +31,7 @@
 #include "mpegvideo.h"
 #include "h263.h"
 #include "h261.h"
+#include "mpegvideodata.h"
 
 int ff_h261_get_picture_format(int width, int height)
 {
index e34da5c6f529aa85334654604fc3476f96f3431e..3f37489aa91d368f4e312714a254ba288935650d 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "mpegvideo.h"
 #include "h263.h"
+#include "mpegvideodata.h"
 
 /* don't understand why they choose a different header ! */
 int ff_intel_h263_decode_picture_header(MpegEncContext *s)
index 1f9ac27dd37ae0380dd40ed0bbf208788d6be25e..8f69f0f918df01331ded1a2eca58a1709194ab48 100644 (file)
@@ -41,6 +41,7 @@
 #include "unary.h"
 #include "flv.h"
 #include "mpeg4video.h"
+#include "mpegvideodata.h"
 
 // The defines below define the number of bits that are read at once for
 // reading vlc values. Changing these may improve speed and data cache needs
index 3afc238e35e9382e9c4bced4ca2e2fe1c513b9d7..952e15ce24d589cca308b939a4d72fcaf3521abe 100644 (file)
@@ -32,6 +32,7 @@
 #include "libavutil/attributes.h"
 #include "avcodec.h"
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 #include "h263.h"
 #include "mathops.h"
 #include "mpegutils.h"
index 900761d9c9d937a947b12706674f20b83097ba2a..69c6d0a09a2af26523c727f895fd96ea79cddc1b 100644 (file)
@@ -32,6 +32,7 @@
 #include "error_resilience.h"
 #include "mpeg12.h"
 #include "mpeg12data.h"
+#include "mpegvideodata.h"
 #include "bytestream.h"
 #include "thread.h"
 
index c66d6aa5083d58f82d417a8f7d072f3583d78160..d4c517d82e22da077946935b566c23380350d1dc 100644 (file)
@@ -41,6 +41,7 @@
 #include "mpeg12data.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 #include "thread.h"
 #include "version.h"
 #include "xvmc_internal.h"
index 7e36170d431a8c429a9530a37dc832c9e28fb269..eb71a8620940c083391c349299f13ec25d4509c5 100644 (file)
@@ -25,6 +25,7 @@
 #include "internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 #include "mpeg4video.h"
 #include "h263.h"
 #include "thread.h"
index 49f2e661773ab5dcb59c250a1e461a7d39bfb9b2..f380aeeb6dce18ed24243f80d4cd504f0ded4ee3 100644 (file)
@@ -39,6 +39,7 @@
 #include "mathops.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 #include "mjpegenc.h"
 #include "msmpeg4.h"
 #include "qpeldsp.h"
 #include "wmv2.h"
 #include <limits.h>
 
-static const uint8_t ff_default_chroma_qscale_table[32] = {
-//   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
-     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
-};
-
-const uint8_t ff_mpeg1_dc_scale_table[128] = {
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-};
-
-static const uint8_t mpeg2_dc_scale_table1[128] = {
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-};
-
-static const uint8_t mpeg2_dc_scale_table2[128] = {
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-};
-
-static const uint8_t mpeg2_dc_scale_table3[128] = {
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-};
-
-const uint8_t *const ff_mpeg2_dc_scale_table[4] = {
-    ff_mpeg1_dc_scale_table,
-    mpeg2_dc_scale_table1,
-    mpeg2_dc_scale_table2,
-    mpeg2_dc_scale_table3,
-};
-
-const uint8_t ff_alternate_horizontal_scan[64] = {
-     0,  1,  2,  3,  8,  9, 16, 17,
-    10, 11,  4,  5,  6,  7, 15, 14,
-    13, 12, 19, 18, 24, 25, 32, 33,
-    26, 27, 20, 21, 22, 23, 28, 29,
-    30, 31, 34, 35, 40, 41, 48, 49,
-    42, 43, 36, 37, 38, 39, 44, 45,
-    46, 47, 50, 51, 56, 57, 58, 59,
-    52, 53, 54, 55, 60, 61, 62, 63,
-};
-
-const uint8_t ff_alternate_vertical_scan[64] = {
-     0,  8, 16, 24,  1,  9,  2, 10,
-    17, 25, 32, 40, 48, 56, 57, 49,
-    41, 33, 26, 18,  3, 11,  4, 12,
-    19, 27, 34, 42, 50, 58, 35, 43,
-    51, 59, 20, 28,  5, 13,  6, 14,
-    21, 29, 36, 44, 52, 60, 37, 45,
-    53, 61, 22, 30,  7, 15, 23, 31,
-    38, 46, 54, 62, 39, 47, 55, 63,
-};
-
 static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
                                    int16_t *block, int n, int qscale)
 {
index 48c9cffc89f38afcaba8fc891e1fc982d21fbaa1..7fd4f1104ff720ab748bd71ec5d210efac901668 100644 (file)
@@ -88,10 +88,6 @@ enum OutputFormat {
 #define EXT_START_CODE          0x000001b5
 #define USER_START_CODE         0x000001b2
 
-/* encoding scans */
-extern const uint8_t ff_alternate_horizontal_scan[64];
-extern const uint8_t ff_alternate_vertical_scan[64];
-
 struct MpegEncContext;
 
 /**
@@ -821,10 +817,6 @@ int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr,
 int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index,
                                int ref_index, int size, int h, int add_rate);
 
-/* mpeg12.c */
-extern const uint8_t ff_mpeg1_dc_scale_table[128];
-extern const uint8_t * const ff_mpeg2_dc_scale_table[4];
-
 void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
 void ff_mpeg1_encode_mb(MpegEncContext *s,
                         int16_t block[8][64],
index a47781812ff38fde0192ed46b890f2665354c682..cb8a4068195270326ab3db2433f6a930565f3823 100644 (file)
@@ -40,6 +40,7 @@
 #include "idctdsp.h"
 #include "mpeg12.h"
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 #include "h261.h"
 #include "h263.h"
 #include "mjpegenc_common.h"
diff --git a/libavcodec/mpegvideodata.c b/libavcodec/mpegvideodata.c
new file mode 100644 (file)
index 0000000..f27dd90
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+const uint8_t ff_default_chroma_qscale_table[32] = {
+//   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
+     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
+    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
+};
+
+const uint8_t ff_mpeg1_dc_scale_table[128] = {
+//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
+    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+};
+
+static const uint8_t mpeg2_dc_scale_table1[128] = {
+//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+};
+
+static const uint8_t mpeg2_dc_scale_table2[128] = {
+//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+};
+
+static const uint8_t mpeg2_dc_scale_table3[128] = {
+//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+};
+
+const uint8_t *const ff_mpeg2_dc_scale_table[4] = {
+    ff_mpeg1_dc_scale_table,
+    mpeg2_dc_scale_table1,
+    mpeg2_dc_scale_table2,
+    mpeg2_dc_scale_table3,
+};
+
+const uint8_t ff_alternate_horizontal_scan[64] = {
+     0,  1,  2,  3,  8,  9, 16, 17,
+    10, 11,  4,  5,  6,  7, 15, 14,
+    13, 12, 19, 18, 24, 25, 32, 33,
+    26, 27, 20, 21, 22, 23, 28, 29,
+    30, 31, 34, 35, 40, 41, 48, 49,
+    42, 43, 36, 37, 38, 39, 44, 45,
+    46, 47, 50, 51, 56, 57, 58, 59,
+    52, 53, 54, 55, 60, 61, 62, 63,
+};
+
+const uint8_t ff_alternate_vertical_scan[64] = {
+     0,  8, 16, 24,  1,  9,  2, 10,
+    17, 25, 32, 40, 48, 56, 57, 49,
+    41, 33, 26, 18,  3, 11,  4, 12,
+    19, 27, 34, 42, 50, 58, 35, 43,
+    51, 59, 20, 28,  5, 13,  6, 14,
+    21, 29, 36, 44, 52, 60, 37, 45,
+    53, 61, 22, 30,  7, 15, 23, 31,
+    38, 46, 54, 62, 39, 47, 55, 63,
+};
diff --git a/libavcodec/mpegvideodata.h b/libavcodec/mpegvideodata.h
new file mode 100644 (file)
index 0000000..d3ace23
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MPEGVIDEODATA_H
+#define AVCODEC_MPEGVIDEODATA_H
+
+#include <stdint.h>
+
+/* encoding scans */
+extern const uint8_t ff_alternate_horizontal_scan[64];
+extern const uint8_t ff_alternate_vertical_scan[64];
+
+extern const uint8_t ff_mpeg1_dc_scale_table[128];
+extern const uint8_t * const ff_mpeg2_dc_scale_table[4];
+
+extern const uint8_t ff_default_chroma_qscale_table[32];
+
+#endif /* AVCODEC_MPEGVIDEODATA_H */
index 95b5c93ea37bea3d96b1c75118956e42d364a421..94bd86e0e369b2ac1840d312fce432c41f5cc3dc 100644 (file)
@@ -35,6 +35,7 @@
 #include "h263.h"
 #include "mpeg4video.h"
 #include "msmpeg4data.h"
+#include "mpegvideodata.h"
 #include "vc1data.h"
 
 /*
index 20230f40bd12691706c2cd2137b0fe74be9c7f7e..52be052537bb6ea9dee97a3434086a47c6b4d23e 100644 (file)
@@ -36,6 +36,7 @@
 #include "mpeg_er.h"
 #include "mpegvideo.h"
 #include "mpeg4video.h"
+#include "mpegvideodata.h"
 
 #define RV_GET_MAJOR_VER(x)  ((x) >> 28)
 #define RV_GET_MINOR_VER(x) (((x) >> 20) & 0xFF)
index 4462bde01d3b45c8b8c19cf365ba62d912a34908..dcb192f4bdac48882bcf6f1a65370a516de3212f 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 #include "h263.h"
 #include "put_bits.h"