~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/vc1.h

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
/** Markers used in VC-1 AP frame data */
32
32
//@{
33
 
enum VC1Code{
 
33
enum VC1Code {
34
34
    VC1_CODE_RES0       = 0x00000100,
35
35
    VC1_CODE_ENDOFSEQ   = 0x0000010A,
36
36
    VC1_CODE_SLICE,
105
105
};
106
106
//@}
107
107
 
 
108
/** MBMODE for interlaced frame P-picture */
 
109
//@{
 
110
enum MBModesIntfr {
 
111
    MV_PMODE_INTFR_1MV,
 
112
    MV_PMODE_INTFR_2MV_FIELD,
 
113
    MV_PMODE_INTFR_2MV,
 
114
    MV_PMODE_INTFR_4MV_FIELD,
 
115
    MV_PMODE_INTFR_4MV,
 
116
    MV_PMODE_INTFR_INTRA,
 
117
};
 
118
//@}
 
119
 
108
120
/** @name MV types for B frames */
109
121
//@{
110
122
enum BMVTypes {
111
123
    BMV_TYPE_BACKWARD,
112
124
    BMV_TYPE_FORWARD,
113
 
    BMV_TYPE_INTERPOLATED
 
125
    BMV_TYPE_INTERPOLATED,
 
126
    BMV_TYPE_DIRECT
114
127
};
115
128
//@}
116
129
 
120
133
    TT_8X8,
121
134
    TT_8X4_BOTTOM,
122
135
    TT_8X4_TOP,
123
 
    TT_8X4, //Both halves
 
136
    TT_8X4,         // both halves
124
137
    TT_4X8_RIGHT,
125
138
    TT_4X8_LEFT,
126
 
    TT_4X8, //Both halves
 
139
    TT_4X8,         // both halves
127
140
    TT_4X4
128
141
};
129
142
//@}
148
161
};
149
162
//@}
150
163
 
 
164
/**
 
165
 * FCM Frame Coding Mode
 
166
 * @note some content might be marked interlaced
 
167
 * but have fcm set to 0 as well (e.g. HD-DVD)
 
168
 */
 
169
enum FrameCodingMode {
 
170
    PROGRESSIVE = 0,    ///<  in the bitstream is reported as 00b
 
171
    ILACE_FRAME,        ///<  in the bitstream is reported as 10b
 
172
    ILACE_FIELD         ///<  in the bitstream is reported as 11b
 
173
};
151
174
 
152
175
/** The VC1 Context
153
176
 * @todo Change size wherever another size is more efficient
211
234
 
212
235
    /** Frame decoding info for all profiles */
213
236
    //@{
214
 
    uint8_t mv_mode;      ///< MV coding monde
215
 
    uint8_t mv_mode2;     ///< Secondary MV coding mode (B frames)
216
 
    int k_x;              ///< Number of bits for MVs (depends on MV range)
217
 
    int k_y;              ///< Number of bits for MVs (depends on MV range)
218
 
    int range_x, range_y; ///< MV range
219
 
    uint8_t pq, altpq;    ///< Current/alternate frame quantizer scale
220
 
    uint8_t zz_8x8[4][64];///< Zigzag table for TT_8x8, permuted for IDCT
 
237
    uint8_t mv_mode;             ///< MV coding monde
 
238
    uint8_t mv_mode2;            ///< Secondary MV coding mode (B frames)
 
239
    int k_x;                     ///< Number of bits for MVs (depends on MV range)
 
240
    int k_y;                     ///< Number of bits for MVs (depends on MV range)
 
241
    int range_x, range_y;        ///< MV range
 
242
    uint8_t pq, altpq;           ///< Current/alternate frame quantizer scale
 
243
    uint8_t zz_8x8[4][64];       ///< Zigzag table for TT_8x8, permuted for IDCT
221
244
    int left_blk_sh, top_blk_sh; ///< Either 3 or 0, positions of l/t in blk[]
222
 
    const uint8_t* zz_8x4;///< Zigzag scan table for TT_8x4 coding mode
223
 
    const uint8_t* zz_4x8;///< Zigzag scan table for TT_4x8 coding mode
 
245
    const uint8_t* zz_8x4;       ///< Zigzag scan table for TT_8x4 coding mode
 
246
    const uint8_t* zz_4x8;       ///< Zigzag scan table for TT_4x8 coding mode
224
247
    /** pquant parameters */
225
248
    //@{
226
249
    uint8_t dquantfrm;
232
255
     * @see 8.1.1.10, p(1)10
233
256
     */
234
257
    //@{
235
 
    int c_ac_table_index; ///< Chroma index from ACFRM element
236
 
    int y_ac_table_index; ///< Luma index from AC2FRM element
 
258
    int c_ac_table_index;    ///< Chroma index from ACFRM element
 
259
    int y_ac_table_index;    ///< Luma index from AC2FRM element
237
260
    //@}
238
 
    int ttfrm;            ///< Transform type info present at frame level
239
 
    uint8_t ttmbf;        ///< Transform type flag
 
261
    int ttfrm;               ///< Transform type info present at frame level
 
262
    uint8_t ttmbf;           ///< Transform type flag
240
263
    int *ttblk_base, *ttblk; ///< Transform type at the block level
241
 
    int codingset;        ///< index of current table set from 11.8 to use for luma block decoding
242
 
    int codingset2;       ///< index of current table set from 11.8 to use for chroma block decoding
243
 
    int pqindex;          ///< raw pqindex used in coding set selection
 
264
    int codingset;           ///< index of current table set from 11.8 to use for luma block decoding
 
265
    int codingset2;          ///< index of current table set from 11.8 to use for chroma block decoding
 
266
    int pqindex;             ///< raw pqindex used in coding set selection
244
267
    int a_avail, c_avail;
245
268
    uint8_t *mb_type_base, *mb_type[3];
246
269
 
260
283
     * -# 2 -> [-512, 511.f] x [-128, 127.f]
261
284
     * -# 3 -> [-1024, 1023.f] x [-256, 255.f]
262
285
     */
263
 
    uint8_t mvrange;
264
 
    uint8_t pquantizer;           ///< Uniform (over sequence) quantizer in use
265
 
    VLC *cbpcy_vlc;               ///< CBPCY VLC table
266
 
    int tt_index;                 ///< Index for Transform Type tables
267
 
    uint8_t* mv_type_mb_plane;    ///< bitplane for mv_type == (4MV)
268
 
    uint8_t* direct_mb_plane;     ///< bitplane for "direct" MBs
269
 
    int mv_type_is_raw;           ///< mv type mb plane is not coded
270
 
    int dmb_is_raw;               ///< direct mb plane is raw
271
 
    int skip_is_raw;              ///< skip mb plane is not coded
272
 
    uint8_t luty[256], lutuv[256]; // lookup tables used for intensity compensation
273
 
    int use_ic;                   ///< use intensity compensation in B-frames
274
 
    int rnd;                      ///< rounding control
 
286
    uint8_t mvrange;                ///< Extended MV range flag
 
287
    uint8_t pquantizer;             ///< Uniform (over sequence) quantizer in use
 
288
    VLC *cbpcy_vlc;                 ///< CBPCY VLC table
 
289
    int tt_index;                   ///< Index for Transform Type tables (to decode TTMB)
 
290
    uint8_t* mv_type_mb_plane;      ///< bitplane for mv_type == (4MV)
 
291
    uint8_t* direct_mb_plane;       ///< bitplane for "direct" MBs
 
292
    uint8_t* forward_mb_plane;      ///< bitplane for "forward" MBs
 
293
    int mv_type_is_raw;             ///< mv type mb plane is not coded
 
294
    int dmb_is_raw;                 ///< direct mb plane is raw
 
295
    int fmb_is_raw;                 ///< forward mb plane is raw
 
296
    int skip_is_raw;                ///< skip mb plane is not coded
 
297
    uint8_t luty[256], lutuv[256];  ///< lookup tables used for intensity compensation
 
298
    int use_ic;                     ///< use intensity compensation in B-frames
 
299
    int rnd;                        ///< rounding control
275
300
 
276
301
    /** Frame decoding info for S/M profiles only */
277
302
    //@{
278
 
    uint8_t rangeredfrm; ///< out_sample = CLIP((in_sample-128)*2+128)
 
303
    uint8_t rangeredfrm;            ///< out_sample = CLIP((in_sample-128)*2+128)
279
304
    uint8_t interpfrm;
280
305
    //@}
281
306
 
282
307
    /** Frame decoding info for Advanced profile */
283
308
    //@{
284
 
    uint8_t fcm; ///< 0->Progressive, 2->Frame-Interlace, 3->Field-Interlace
 
309
    enum FrameCodingMode fcm;
285
310
    uint8_t numpanscanwin;
286
311
    uint8_t tfcntr;
287
312
    uint8_t rptfrm, tff, rff;
307
332
    uint8_t range_mapuv;
308
333
    //@}
309
334
 
 
335
    /** Frame decoding info for interlaced picture */
 
336
    uint8_t dmvrange;   ///< Extended differential MV range flag
 
337
    int fourmvswitch;
 
338
    int intcomp;
 
339
    uint8_t lumscale2;  ///< for interlaced field P picture
 
340
    uint8_t lumshift2;
 
341
    uint8_t luty2[256], lutuv2[256]; // lookup tables used for intensity compensation
 
342
    VLC* mbmode_vlc;
 
343
    VLC* imv_vlc;
 
344
    VLC* twomvbp_vlc;
 
345
    VLC* fourmvbp_vlc;
 
346
    uint8_t twomvbp;
 
347
    uint8_t fourmvbp;
 
348
    uint8_t* fieldtx_plane;
 
349
    int fieldtx_is_raw;
 
350
    int8_t zzi_8x8[64];
 
351
    uint8_t *blk_mv_type_base, *blk_mv_type;    ///< 0: frame MV, 1: field MV (interlaced frame)
 
352
    uint8_t *mv_f_base, *mv_f[2];               ///< 0: MV obtained from same field, 1: opposite field
 
353
    uint8_t *mv_f_last_base, *mv_f_last[2];
 
354
    uint8_t *mv_f_next_base, *mv_f_next[2];
 
355
    int field_mode;         ///< 1 for interlaced field pictures
 
356
    int fptype;
 
357
    int second_field;
 
358
    int refdist;            ///< distance of the current picture from reference
 
359
    int numref;             ///< number of past field pictures used as reference
 
360
                            // 0 corresponds to 1 and 1 corresponds to 2 references
 
361
    int reffield;           ///< if numref = 0 (1 reference) then reffield decides which
 
362
                            // field to use among the two fields from previous frame
 
363
    int intcompfield;       ///< which of the two fields to be intensity compensated
 
364
                            // 0: both fields, 1: bottom field, 2: top field
 
365
    int cur_field_type;     ///< 0: top, 1: bottom
 
366
    int ref_field_type[2];  ///< forward and backward reference field type (top or bottom)
 
367
    int blocks_off, mb_off;
 
368
    int qs_last;            ///< if qpel has been used in the previous (tr.) picture
 
369
    int bmvtype;
 
370
    int frfd, brfd;         ///< reference frame distance (forward or backward)
 
371
    int pic_header_flag;
 
372
 
310
373
    /** Frame decoding info for sprite modes */
311
374
    //@{
312
375
    int new_sprite;
313
376
    int two_sprites;
 
377
    AVFrame sprite_output_frame;
 
378
    int output_width, output_height, sprite_width, sprite_height;
 
379
    uint8_t* sr_rows[2][2];      ///< Sprite resizer line cache
314
380
    //@}
315
381
 
316
382
    int p_frame_skipped;
322
388
    uint32_t *cbp_base, *cbp;
323
389
    uint8_t *is_intra_base, *is_intra;
324
390
    int16_t (*luma_mv_base)[2], (*luma_mv)[2];
325
 
    uint8_t bfraction_lut_index;///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
326
 
    uint8_t broken_link;        ///< Broken link flag (BROKEN_LINK syntax element)
327
 
    uint8_t closed_entry;       ///< Closed entry point flag (CLOSED_ENTRY syntax element)
 
391
    uint8_t bfraction_lut_index; ///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
 
392
    uint8_t broken_link;         ///< Broken link flag (BROKEN_LINK syntax element)
 
393
    uint8_t closed_entry;        ///< Closed entry point flag (CLOSED_ENTRY syntax element)
328
394
 
329
 
    int parse_only;             ///< Context is used within parser
 
395
    int parse_only;              ///< Context is used within parser
330
396
 
331
397
    int warn_interlaced;
332
398
} VC1Context;
338
404
{
339
405
    uint32_t mrk = 0xFFFFFFFF;
340
406
 
341
 
    if(end-src < 4) return end;
342
 
    while(src < end){
 
407
    if (end-src < 4)
 
408
        return end;
 
409
    while (src < end) {
343
410
        mrk = (mrk << 8) | *src++;
344
 
        if(IS_MARKER(mrk))
345
 
            return src-4;
 
411
        if (IS_MARKER(mrk))
 
412
            return src - 4;
346
413
    }
347
414
    return end;
348
415
}
351
418
{
352
419
    int dsize = 0, i;
353
420
 
354
 
    if(size < 4){
355
 
        for(dsize = 0; dsize < size; dsize++) *dst++ = *src++;
 
421
    if (size < 4) {
 
422
        for (dsize = 0; dsize < size; dsize++)
 
423
            *dst++ = *src++;
356
424
        return size;
357
425
    }
358
 
    for(i = 0; i < size; i++, src++) {
359
 
        if(src[0] == 3 && i >= 2 && !src[-1] && !src[-2] && i < size-1 && src[1] < 4) {
 
426
    for (i = 0; i < size; i++, src++) {
 
427
        if (src[0] == 3 && i >= 2 && !src[-1] && !src[-2] && i < size-1 && src[1] < 4) {
360
428
            dst[dsize++] = src[1];
361
429
            src++;
362
430
            i++;