Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
38f64c03
Commit
38f64c03
authored
Aug 14, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg12decdata.h: Move all tables to the only place they are used
parent
ec6c1b1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
94 deletions
+57
-94
mpeg12.c
libavcodec/mpeg12.c
+24
-1
mpeg12dec.c
libavcodec/mpeg12dec.c
+33
-1
mpeg12decdata.h
libavcodec/mpeg12decdata.h
+0
-92
No files found.
libavcodec/mpeg12.c
View file @
38f64c03
...
...
@@ -33,13 +33,36 @@
#include "error_resilience.h"
#include "mpeg12.h"
#include "mpeg12data.h"
#include "mpeg12decdata.h"
#include "bytestream.h"
#include "xvmc_internal.h"
#include "thread.h"
uint8_t
ff_mpeg12_static_rl_table_store
[
2
][
2
][
2
*
MAX_RUN
+
MAX_LEVEL
+
3
];
static
const
uint8_t
table_mb_ptype
[
7
][
2
]
=
{
{
3
,
5
},
// 0x01 MB_INTRA
{
1
,
2
},
// 0x02 MB_PAT
{
1
,
3
},
// 0x08 MB_FOR
{
1
,
1
},
// 0x0A MB_FOR|MB_PAT
{
1
,
6
},
// 0x11 MB_QUANT|MB_INTRA
{
1
,
5
},
// 0x12 MB_QUANT|MB_PAT
{
2
,
5
},
// 0x1A MB_QUANT|MB_FOR|MB_PAT
};
static
const
uint8_t
table_mb_btype
[
11
][
2
]
=
{
{
3
,
5
},
// 0x01 MB_INTRA
{
2
,
3
},
// 0x04 MB_BACK
{
3
,
3
},
// 0x06 MB_BACK|MB_PAT
{
2
,
4
},
// 0x08 MB_FOR
{
3
,
4
},
// 0x0A MB_FOR|MB_PAT
{
2
,
2
},
// 0x0C MB_FOR|MB_BACK
{
3
,
2
},
// 0x0E MB_FOR|MB_BACK|MB_PAT
{
1
,
6
},
// 0x11 MB_QUANT|MB_INTRA
{
2
,
6
},
// 0x16 MB_QUANT|MB_BACK|MB_PAT
{
3
,
6
},
// 0x1A MB_QUANT|MB_FOR|MB_PAT
{
2
,
5
},
// 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT
};
#define INIT_2D_VLC_RL(rl, static_size)\
{\
static RL_VLC_ELEM rl_vlc_table[static_size];\
...
...
libavcodec/mpeg12dec.c
View file @
38f64c03
...
...
@@ -34,7 +34,6 @@
#include "error_resilience.h"
#include "mpeg12.h"
#include "mpeg12data.h"
#include "mpeg12decdata.h"
#include "bytestream.h"
#include "xvmc_internal.h"
#include "thread.h"
...
...
@@ -54,6 +53,39 @@ typedef struct Mpeg1Context {
int
extradata_decoded
;
}
Mpeg1Context
;
#define MB_TYPE_ZERO_MV 0x20000000
static
const
uint32_t
ptype2mb_type
[
7
]
=
{
MB_TYPE_INTRA
,
MB_TYPE_L0
|
MB_TYPE_CBP
|
MB_TYPE_ZERO_MV
|
MB_TYPE_16x16
,
MB_TYPE_L0
,
MB_TYPE_L0
|
MB_TYPE_CBP
,
MB_TYPE_QUANT
|
MB_TYPE_INTRA
,
MB_TYPE_QUANT
|
MB_TYPE_L0
|
MB_TYPE_CBP
|
MB_TYPE_ZERO_MV
|
MB_TYPE_16x16
,
MB_TYPE_QUANT
|
MB_TYPE_L0
|
MB_TYPE_CBP
,
};
static
const
uint32_t
btype2mb_type
[
11
]
=
{
MB_TYPE_INTRA
,
MB_TYPE_L1
,
MB_TYPE_L1
|
MB_TYPE_CBP
,
MB_TYPE_L0
,
MB_TYPE_L0
|
MB_TYPE_CBP
,
MB_TYPE_L0L1
,
MB_TYPE_L0L1
|
MB_TYPE_CBP
,
MB_TYPE_QUANT
|
MB_TYPE_INTRA
,
MB_TYPE_QUANT
|
MB_TYPE_L1
|
MB_TYPE_CBP
,
MB_TYPE_QUANT
|
MB_TYPE_L0
|
MB_TYPE_CBP
,
MB_TYPE_QUANT
|
MB_TYPE_L0L1
|
MB_TYPE_CBP
,
};
static
const
uint8_t
non_linear_qscale
[
32
]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
10
,
12
,
14
,
16
,
18
,
20
,
22
,
24
,
28
,
32
,
36
,
40
,
44
,
48
,
52
,
56
,
64
,
72
,
80
,
88
,
96
,
104
,
112
,
};
/* as H.263, but only 17 codes */
static
int
mpeg_decode_motion
(
MpegEncContext
*
s
,
int
fcode
,
int
pred
)
{
...
...
libavcodec/mpeg12decdata.h
deleted
100644 → 0
View file @
ec6c1b1d
/*
* MPEG1/2 decoder tables
* copyright (c) 2000,2001 Fabrice Bellard
* copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
* 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
*/
/**
* @file
* MPEG1/2 decoder tables.
*/
#ifndef AVCODEC_MPEG12DECDATA_H
#define AVCODEC_MPEG12DECDATA_H
#include <stdint.h>
#include "mpegvideo.h"
#define MB_TYPE_ZERO_MV 0x20000000
static
const
uint8_t
table_mb_ptype
[
7
][
2
]
=
{
{
3
,
5
},
// 0x01 MB_INTRA
{
1
,
2
},
// 0x02 MB_PAT
{
1
,
3
},
// 0x08 MB_FOR
{
1
,
1
},
// 0x0A MB_FOR|MB_PAT
{
1
,
6
},
// 0x11 MB_QUANT|MB_INTRA
{
1
,
5
},
// 0x12 MB_QUANT|MB_PAT
{
2
,
5
},
// 0x1A MB_QUANT|MB_FOR|MB_PAT
};
static
const
uint32_t
ptype2mb_type
[
7
]
=
{
MB_TYPE_INTRA
,
MB_TYPE_L0
|
MB_TYPE_CBP
|
MB_TYPE_ZERO_MV
|
MB_TYPE_16x16
,
MB_TYPE_L0
,
MB_TYPE_L0
|
MB_TYPE_CBP
,
MB_TYPE_QUANT
|
MB_TYPE_INTRA
,
MB_TYPE_QUANT
|
MB_TYPE_L0
|
MB_TYPE_CBP
|
MB_TYPE_ZERO_MV
|
MB_TYPE_16x16
,
MB_TYPE_QUANT
|
MB_TYPE_L0
|
MB_TYPE_CBP
,
};
static
const
uint8_t
table_mb_btype
[
11
][
2
]
=
{
{
3
,
5
},
// 0x01 MB_INTRA
{
2
,
3
},
// 0x04 MB_BACK
{
3
,
3
},
// 0x06 MB_BACK|MB_PAT
{
2
,
4
},
// 0x08 MB_FOR
{
3
,
4
},
// 0x0A MB_FOR|MB_PAT
{
2
,
2
},
// 0x0C MB_FOR|MB_BACK
{
3
,
2
},
// 0x0E MB_FOR|MB_BACK|MB_PAT
{
1
,
6
},
// 0x11 MB_QUANT|MB_INTRA
{
2
,
6
},
// 0x16 MB_QUANT|MB_BACK|MB_PAT
{
3
,
6
},
// 0x1A MB_QUANT|MB_FOR|MB_PAT
{
2
,
5
},
// 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT
};
static
const
uint32_t
btype2mb_type
[
11
]
=
{
MB_TYPE_INTRA
,
MB_TYPE_L1
,
MB_TYPE_L1
|
MB_TYPE_CBP
,
MB_TYPE_L0
,
MB_TYPE_L0
|
MB_TYPE_CBP
,
MB_TYPE_L0L1
,
MB_TYPE_L0L1
|
MB_TYPE_CBP
,
MB_TYPE_QUANT
|
MB_TYPE_INTRA
,
MB_TYPE_QUANT
|
MB_TYPE_L1
|
MB_TYPE_CBP
,
MB_TYPE_QUANT
|
MB_TYPE_L0
|
MB_TYPE_CBP
,
MB_TYPE_QUANT
|
MB_TYPE_L0L1
|
MB_TYPE_CBP
,
};
static
const
uint8_t
non_linear_qscale
[
32
]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
10
,
12
,
14
,
16
,
18
,
20
,
22
,
24
,
28
,
32
,
36
,
40
,
44
,
48
,
52
,
56
,
64
,
72
,
80
,
88
,
96
,
104
,
112
,
};
#endif
/* AVCODEC_MPEG12DECDATA_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment