~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/cavsdata.h

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc, Andrew Starr-Bochicchio, Lionel Le Folgoc
  • Date: 2008-12-26 00:10:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081226001006-2040ls9680bd1blt
Tags: 1.1.7-0.2ubuntu1
[ Andrew Starr-Bochicchio ]
* Merge from debian-multimedia (LP: #298547), Ubuntu Changes:
 - For ffmpeg-related build-deps, fix versionized dependencies
   as the ubuntu versioning is different than debian-multimedia's.

[ Lionel Le Folgoc ]
* LP: #311412 is fixed since the 1.1.7~rc1-0.1 revision.
* debian/patches/03_ffmpeg.diff: updated to fix FTBFS due to libswscale API
  change (cherry-pick from Gentoo #234383).

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 *
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
20
20
 */
21
21
 
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
29
 
 
30
 
#define A_AVAIL                          1
31
 
#define B_AVAIL                          2
32
 
#define C_AVAIL                          4
33
 
#define D_AVAIL                          8
34
 
#define NOT_AVAIL                       -1
35
 
#define REF_INTRA                       -2
36
 
#define REF_DIR                         -3
37
 
 
38
 
#define ESCAPE_CODE                     59
39
 
 
40
 
#define FWD0                          0x01
41
 
#define FWD1                          0x02
42
 
#define BWD0                          0x04
43
 
#define BWD1                          0x08
44
 
#define SYM0                          0x10
45
 
#define SYM1                          0x20
46
 
#define SPLITH                        0x40
47
 
#define SPLITV                        0x80
48
 
 
49
 
#define MV_BWD_OFFS                     12
50
 
#define MV_STRIDE                        4
51
 
 
52
 
enum mb_t {
53
 
  I_8X8 = 0,
54
 
  P_SKIP,
55
 
  P_16X16,
56
 
  P_16X8,
57
 
  P_8X16,
58
 
  P_8X8,
59
 
  B_SKIP,
60
 
  B_DIRECT,
61
 
  B_FWD_16X16,
62
 
  B_BWD_16X16,
63
 
  B_SYM_16X16,
64
 
  B_8X8 = 29
65
 
};
66
 
 
67
 
enum sub_mb_t {
68
 
  B_SUB_DIRECT,
69
 
  B_SUB_FWD,
70
 
  B_SUB_BWD,
71
 
  B_SUB_SYM
72
 
};
73
 
 
74
 
enum intra_luma_t {
75
 
  INTRA_L_VERT,
76
 
  INTRA_L_HORIZ,
77
 
  INTRA_L_LP,
78
 
  INTRA_L_DOWN_LEFT,
79
 
  INTRA_L_DOWN_RIGHT,
80
 
  INTRA_L_LP_LEFT,
81
 
  INTRA_L_LP_TOP,
82
 
  INTRA_L_DC_128
83
 
};
84
 
 
85
 
enum intra_chroma_t {
86
 
  INTRA_C_LP,
87
 
  INTRA_C_HORIZ,
88
 
  INTRA_C_VERT,
89
 
  INTRA_C_PLANE,
90
 
  INTRA_C_LP_LEFT,
91
 
  INTRA_C_LP_TOP,
92
 
  INTRA_C_DC_128,
93
 
};
94
 
 
95
 
enum mv_pred_t {
96
 
  MV_PRED_MEDIAN,
97
 
  MV_PRED_LEFT,
98
 
  MV_PRED_TOP,
99
 
  MV_PRED_TOPRIGHT,
100
 
  MV_PRED_PSKIP,
101
 
  MV_PRED_BSKIP
102
 
};
103
 
 
104
 
enum block_t {
105
 
  BLK_16X16,
106
 
  BLK_16X8,
107
 
  BLK_8X16,
108
 
  BLK_8X8
109
 
};
110
 
 
111
 
enum mv_loc_t {
112
 
  MV_FWD_D3 = 0,
113
 
  MV_FWD_B2,
114
 
  MV_FWD_B3,
115
 
  MV_FWD_C2,
116
 
  MV_FWD_A1,
117
 
  MV_FWD_X0,
118
 
  MV_FWD_X1,
119
 
  MV_FWD_A3 = 8,
120
 
  MV_FWD_X2,
121
 
  MV_FWD_X3,
122
 
  MV_BWD_D3 = MV_BWD_OFFS,
123
 
  MV_BWD_B2,
124
 
  MV_BWD_B3,
125
 
  MV_BWD_C2,
126
 
  MV_BWD_A1,
127
 
  MV_BWD_X0,
128
 
  MV_BWD_X1,
129
 
  MV_BWD_A3 = MV_BWD_OFFS+8,
130
 
  MV_BWD_X2,
131
 
  MV_BWD_X3
132
 
};
133
 
 
134
 
#ifdef CONFIG_CAVS_DECODER
135
 
static const uint8_t partition_flags[30] = {
 
22
#ifndef FFMPEG_CAVSDATA_H
 
23
#define FFMPEG_CAVSDATA_H
 
24
 
 
25
#include "cavs.h"
 
26
 
 
27
const uint8_t ff_cavs_partition_flags[30] = {
136
28
  0,                                 //I_8X8
137
29
  0,                                 //P_SKIP
138
30
  0,                                 //P_16X16
165
57
                      SPLITH|SPLITV, //B_8X8 = 29
166
58
};
167
59
 
168
 
static const uint8_t scan3x3[4] = {4,5,7,8};
169
 
 
170
 
static const uint8_t mv_scan[4] = {
171
 
    MV_FWD_X0,MV_FWD_X1,
172
 
    MV_FWD_X2,MV_FWD_X3
173
 
};
174
 
 
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}
184
 
};
185
 
 
186
 
static const uint8_t chroma_qp[64] = {
 
60
const uint8_t ff_cavs_scan3x3[4] = {4,5,7,8};
 
61
 
 
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
191
67
};
192
68
 
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,
201
77
  7, 7, 7, 7, 7, 7, 7, 7
202
78
};
203
79
 
204
 
static const uint16_t dequant_mul[64] = {
 
80
const uint16_t ff_cavs_dequant_mul[64] = {
205
81
  32768,36061,38968,42495,46341,50535,55437,60424,
206
82
  32932,35734,38968,42495,46177,50535,55109,59933,
207
83
  65535,35734,38968,42577,46341,50617,55027,60097,
212
88
  32771,35734,38965,42497,46341,50535,55109,60099
213
89
};
214
90
 
215
 
DECLARE_ALIGNED_8(typedef, struct) {
216
 
    int16_t x;
217
 
    int16_t y;
218
 
    int16_t dist;
219
 
    int16_t ref;
220
 
} vector_t;
221
 
 
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};
225
94
 
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};
229
98
 
230
99
/** marks block as using intra prediction */
231
 
static const vector_t intra_mv = {0,0,1,REF_INTRA};
232
 
 
233
 
typedef struct residual_vlc_t {
234
 
  int8_t rltab[59][3];
235
 
  int8_t level_add[27];
236
 
  int8_t golomb_order;
237
 
  int inc_limit;
238
 
  int8_t max_run;
239
 
} residual_vlc_t;
 
100
const vector_t ff_cavs_intra_mv = {0,0,1,REF_INTRA};
240
101
 
241
102
#define EOB 0,0,0
242
103
 
243
 
static const residual_vlc_t intra_2dvlc[7] = {
 
104
const dec_2dvlc_t ff_cavs_intra_dec[7] = {
244
105
  {
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},
377
238
  }
378
239
};
379
240
 
380
 
static const residual_vlc_t inter_2dvlc[7] = {
 
241
const dec_2dvlc_t ff_cavs_inter_dec[7] = {
381
242
  {
382
243
    { //level / run
383
244
      {  1, 1, 1},{ -1, 1, 1},{  1, 2, 1},{ -1, 2, 1},{  1, 3, 1},{ -1, 3, 1},
514
375
  }
515
376
};
516
377
 
517
 
static const residual_vlc_t chroma_2dvlc[5] = {
 
378
const dec_2dvlc_t ff_cavs_chroma_dec[5] = {
518
379
  {
519
380
    { //level / run
520
381
      {  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
637
498
};
638
499
 
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};
 
504
 
 
505
#endif /* FFMPEG_CAVSDATA_H */