17
17
* You should have received a copy of the GNU Lesser General Public
18
18
* License along with FFmpeg; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
#define SLICE_MIN_START_CODE 0x00000101
23
#define SLICE_MAX_START_CODE 0x000001af
24
#define EXT_START_CODE 0x000001b5
25
#define USER_START_CODE 0x000001b2
26
#define SEQ_START_CODE 0x000001b0
27
#define PIC_I_START_CODE 0x000001b3
28
#define PIC_PB_START_CODE 0x000001b6
38
#define ESCAPE_CODE 59
49
#define MV_BWD_OFFS 12
122
MV_BWD_D3 = MV_BWD_OFFS,
129
MV_BWD_A3 = MV_BWD_OFFS+8,
134
#ifdef CONFIG_CAVS_DECODER
135
static const uint8_t partition_flags[30] = {
22
#ifndef FFMPEG_CAVSDATA_H
23
#define FFMPEG_CAVSDATA_H
27
const uint8_t ff_cavs_partition_flags[30] = {
165
57
SPLITH|SPLITV, //B_8X8 = 29
168
static const uint8_t scan3x3[4] = {4,5,7,8};
170
static const uint8_t mv_scan[4] = {
175
static const uint8_t cbp_tab[64][2] = {
176
{63, 0},{15,15},{31,63},{47,31},{ 0,16},{14,32},{13,47},{11,13},
177
{ 7,14},{ 5,11},{10,12},{ 8, 5},{12,10},{61, 7},{ 4,48},{55, 3},
178
{ 1, 2},{ 2, 8},{59, 4},{ 3, 1},{62,61},{ 9,55},{ 6,59},{29,62},
179
{45,29},{51,27},{23,23},{39,19},{27,30},{46,28},{53, 9},{30, 6},
180
{43,60},{37,21},{60,44},{16,26},{21,51},{28,35},{19,18},{35,20},
181
{42,24},{26,53},{44,17},{32,37},{58,39},{24,45},{20,58},{17,43},
182
{18,42},{48,46},{22,36},{33,33},{25,34},{49,40},{40,52},{36,49},
183
{34,50},{50,56},{52,25},{54,22},{41,54},{56,57},{38,41},{57,38}
186
static const uint8_t chroma_qp[64] = {
60
const uint8_t ff_cavs_scan3x3[4] = {4,5,7,8};
62
const uint8_t ff_cavs_chroma_qp[64] = {
187
63
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,
188
64
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
189
65
32,33,34,35,36,37,38,39,40,41,42,42,43,43,44,44,
190
66
45,45,46,46,47,47,48,48,48,49,49,49,50,50,50,51
193
static const uint8_t dequant_shift[64] = {
69
const uint8_t ff_cavs_dequant_shift[64] = {
194
70
14,14,14,14,14,14,14,14,
195
71
13,13,13,13,13,13,13,13,
196
72
13,12,12,12,12,12,12,12,
212
88
32771,35734,38965,42497,46341,50535,55109,60099
215
DECLARE_ALIGNED_8(typedef, struct) {
222
91
/** marks block as unavailable, i.e. out of picture
223
92
or not yet decoded */
224
static const vector_t un_mv = {0,0,1,NOT_AVAIL};
93
const vector_t ff_cavs_un_mv = {0,0,1,NOT_AVAIL};
226
95
/** marks block as "no prediction from this direction"
227
96
e.g. forward motion vector in BWD partition */
228
static const vector_t dir_mv = {0,0,1,REF_DIR};
97
const vector_t ff_cavs_dir_mv = {0,0,1,REF_DIR};
230
99
/** marks block as using intra prediction */
231
static const vector_t intra_mv = {0,0,1,REF_INTRA};
233
typedef struct residual_vlc_t {
235
int8_t level_add[27];
100
const vector_t ff_cavs_intra_mv = {0,0,1,REF_INTRA};
241
102
#define EOB 0,0,0
243
static const residual_vlc_t intra_2dvlc[7] = {
104
const dec_2dvlc_t ff_cavs_intra_dec[7] = {
245
106
{ //level / run / table_inc
246
107
{ 1, 1, 1},{ -1, 1, 1},{ 1, 2, 1},{ -1, 2, 1},{ 1, 3, 1},{ -1, 3, 1},
636
497
5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9
639
static const int_fast8_t left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
640
static const int_fast8_t top_modifier_l[8] = {-1, 1, 5,-1,-1, 5, 7, 7};
641
static const int_fast8_t left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
642
static const int_fast8_t top_modifier_c[7] = { 4, 1,-1,-1, 4, 6, 6};
643
#endif /* CONFIG_CAVS_DECODER */
500
const int_fast8_t ff_left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
501
const int_fast8_t ff_top_modifier_l[8] = {-1, 1, 5,-1,-1, 5, 7, 7};
502
const int_fast8_t ff_left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
503
const int_fast8_t ff_top_modifier_c[7] = { 4, 1,-1,-1, 4, 6, 6};
505
#endif /* FFMPEG_CAVSDATA_H */