summaryrefslogtreecommitdiff
path: root/libavcodec/msmpeg4data.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-06-18 00:50:20 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-06-18 00:50:20 +0000
commit0151a6f546121a5cd932fcaeef78e8f9f6f7582c (patch)
tree2de9015e7fe31e3a9829f95cfbfedceaefed7abd /libavcodec/msmpeg4data.h
parentf5957f3fe2b8dfda13a9750acc3e3a03cd5d39c9 (diff)
wmv1 support
Originally committed as revision 697 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msmpeg4data.h')
-rw-r--r--libavcodec/msmpeg4data.h85
1 files changed, 83 insertions, 2 deletions
diff --git a/libavcodec/msmpeg4data.h b/libavcodec/msmpeg4data.h
index 66e0a3d895..9d728ef2e1 100644
--- a/libavcodec/msmpeg4data.h
+++ b/libavcodec/msmpeg4data.h
@@ -578,8 +578,8 @@ extern const UINT8 mvtab[33][2];
extern const UINT8 intra_MCBPC_code[8];
extern const UINT8 intra_MCBPC_bits[8];
-extern const UINT8 inter_MCBPC_code[8];
-extern const UINT8 inter_MCBPC_bits[8];
+extern const UINT8 inter_MCBPC_code[25];
+extern const UINT8 inter_MCBPC_bits[25];
#define NB_RL_TABLES 6
@@ -1761,6 +1761,17 @@ static const UINT8 table1_mvy[1099] = {
34, 28, 21,
};
+/* motion vector table */
+typedef struct MVTable {
+ int n;
+ const UINT16 *table_mv_code;
+ const UINT8 *table_mv_bits;
+ const UINT8 *table_mvx;
+ const UINT8 *table_mvy;
+ UINT16 *table_mv_index; /* encoding: convert mv to index in table_mv */
+ VLC vlc; /* decoding: vlc */
+} MVTable;
+
static MVTable mv_tables[2] = {
{
1099,
@@ -1786,3 +1797,73 @@ static const UINT8 v2_mb_type[8][2] = {
static const UINT8 v2_intra_cbpc[4][2] = {
{1, 1}, {0, 3}, {1, 3}, {1, 2},
};
+
+static UINT8 wmv1_y_dc_scale_table[32]={
+// 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
+ 0, 8, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21
+};
+static UINT8 wmv1_c_dc_scale_table[32]={
+// 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
+ 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22
+};
+
+static UINT8 old_ff_y_dc_scale_table[32]={
+// 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
+ 0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
+};
+static UINT8 old_ff_c_dc_scale_table[32]={
+// 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
+ 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22
+};
+
+
+#define WMV1_SCANTABLE_COUNT 4
+
+static UINT8 wmv1_scantable00[64]= {
+0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
+0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
+0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05,
+0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A,
+0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F,
+0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34,
+0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35,
+0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F,
+};
+static UINT8 wmv1_scantable01[64]= {
+0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
+0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
+0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D,
+0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A,
+0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D,
+0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25,
+0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35,
+0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F,
+};
+static UINT8 wmv1_scantable02[64]= {
+0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18,
+0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20,
+0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07,
+0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39,
+0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D,
+0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E,
+0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35,
+0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
+};
+static UINT8 wmv1_scantable03[64]= {
+0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09,
+0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29,
+0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13,
+0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C,
+0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24,
+0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E,
+0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35,
+0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
+};
+
+static UINT8 *wmv1_scantable[WMV1_SCANTABLE_COUNT+1]={
+ wmv1_scantable00,
+ wmv1_scantable01,
+ wmv1_scantable02,
+ wmv1_scantable03,
+};
+