Revision 7bc9090a libavcodec/mpegvideo.h

View differences:

libavcodec/mpegvideo.h
137 137
    
138 138
    int16_t (*motion_val[2])[2];
139 139
    int8_t *ref_index[2];
140
    uint16_t *mb_type_base;
141
    uint16_t *mb_type;           ///< mb_type_base + mb_width + 2
140
    uint32_t *mb_type_base;
141
    uint32_t *mb_type;           ///< mb_type_base + mb_width + 2, note: only used for decoding currently
142 142
#define MB_TYPE_INTRA4x4   0x0001
143
#define MB_TYPE_INTRA16x16 0x0002
144
#define MB_TYPE_INTRA_PCM  0x0004
143
#define MB_TYPE_INTRA16x16 0x0002 //FIXME h264 specific
144
#define MB_TYPE_INTRA_PCM  0x0004 //FIXME h264 specific
145 145
#define MB_TYPE_16x16      0x0008
146 146
#define MB_TYPE_16x8       0x0010
147 147
#define MB_TYPE_8x16       0x0020
148 148
#define MB_TYPE_8x8        0x0040
149 149
#define MB_TYPE_INTERLACED 0x0080
150 150
#define MB_TYPE_DIRECT2     0x0100 //FIXME
151
#define MB_TYPE_REF0       0x0200
152
#define MB_TYPE_GMC2        0x0400 //FIXME
151
#define MB_TYPE_ACPRED     0x0200
152
#define MB_TYPE_GMC        0x0400 //FIXME mpeg4 specific
153
#define MB_TYPE_SKIP       0x0800
153 154
#define MB_TYPE_P0L0       0x1000
154 155
#define MB_TYPE_P1L0       0x2000
155 156
#define MB_TYPE_P0L1       0x4000
156 157
#define MB_TYPE_P1L1       0x8000
158
#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
159
#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
160
#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
161
#define MB_TYPE_QUANT      0x00010000
162
//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 pat, ...)
157 163

  
158 164
#define IS_INTRA4x4(a)   ((a)&MB_TYPE_INTRA4x4)
159 165
#define IS_INTRA16x16(a) ((a)&MB_TYPE_INTRA16x16)
160
#define IS_INTRA(a)      ((a)&3)
166
#define IS_PCM(a)        ((a)&MB_TYPE_INTRA_PCM)
167
#define IS_INTRA(a)      ((a)&7)
161 168
#define IS_INTER(a)      ((a)&(MB_TYPE_16x16|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8))
169
#define IS_SKIP(a)       ((a)&MB_TYPE_SKIP)
162 170
#define IS_INTRA_PCM(a)  ((a)&MB_TYPE_INTRA_PCM)
163 171
#define IS_INTERLACED(a) ((a)&MB_TYPE_INTERLACED)
164 172
#define IS_DIRECT(a)     ((a)&MB_TYPE_DIRECT2)
173
#define IS_GMC(a)        ((a)&MB_TYPE_GMC)
165 174
#define IS_16X16(a)      ((a)&MB_TYPE_16x16)
166 175
#define IS_16X8(a)       ((a)&MB_TYPE_16x8)
167 176
#define IS_8X16(a)       ((a)&MB_TYPE_8x16)
......
170 179
#define IS_SUB_8X4(a)    ((a)&MB_TYPE_16x8)  //note reused
171 180
#define IS_SUB_4X8(a)    ((a)&MB_TYPE_8x16)  //note reused
172 181
#define IS_SUB_4X4(a)    ((a)&MB_TYPE_8x8)   //note reused
173
#define IS_REF0(a)       ((a)&MB_TYPE_REF0)
182
#define IS_ACPRED(a)     ((a)&MB_TYPE_ACPRED)
183
#define IS_QUANT(a)      ((a)&MB_TYPE_QUANT)
174 184
#define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0<<((part)+2*(list))))
175 185
#define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0|MB_TYPE_P1L0)<<(2*(list)))) ///< does this mb use listX, note doesnt work if subMBs
176 186

  
......
283 293
    int picture_in_gop_number; ///< 0-> first pic in gop, ... 
284 294
    int b_frames_since_non_b;  ///< used for encoding, relative to not yet reordered input 
285 295
    int mb_width, mb_height;   ///< number of MBs horizontally & vertically 
296
    int mb_stride;             ///< mb_width+1 used for some arrays to allow simple addressng of left & top MBs withoutt sig11
286 297
    int h_edge_pos, v_edge_pos;///< horizontal / vertical position of the right/bottom edge (pixel replicateion)
287 298
    int mb_num;                ///< number of MBs of a picture 
288 299
    int linesize;              ///< line size, in bytes, may be different from width 
......
355 366
    DSPContext dsp;             ///< pointers for accelerated dsp fucntions 
356 367
    int f_code;                 ///< forward MV resolution 
357 368
    int b_code;                 ///< backward MV resolution for B Frames (mpeg4) 
358
    int16_t (*motion_val)[2];            ///< used for MV prediction (4MV per MB) 
369
    int16_t (*motion_val)[2];
370
    int16_t (*p_mv_table_base)[2];
371
    int16_t (*b_forw_mv_table_base)[2];
372
    int16_t (*b_back_mv_table_base)[2];
373
    int16_t (*b_bidir_forw_mv_table_base)[2]; 
374
    int16_t (*b_bidir_back_mv_table_base)[2]; 
375
    int16_t (*b_direct_mv_table_base)[2];
359 376
    int16_t (*p_mv_table)[2];            ///< MV table (1MV per MB) p-frame encoding 
360 377
    int16_t (*b_forw_mv_table)[2];       ///< MV table (1MV per MB) forward mode b-frame encoding 
361 378
    int16_t (*b_back_mv_table)[2];       ///< MV table (1MV per MB) backward mode b-frame encoding 
......
396 413
    int mb_x, mb_y;
397 414
    int mb_skip_run;
398 415
    int mb_intra;
399
    uint8_t *mb_type;       ///< Table for MB type 
416
    uint8_t *mb_type;       ///< Table for MB type FIXME remove and use picture->mb_type
400 417
#define MB_TYPE_INTRA    0x01
401 418
#define MB_TYPE_INTER    0x02
402 419
#define MB_TYPE_INTER4V  0x04
403 420
#define MB_TYPE_SKIPED   0x08
404
#define MB_TYPE_GMC      0x10
421
//#define MB_TYPE_GMC      0x10
405 422

  
406 423
#define MB_TYPE_DIRECT   0x10
407 424
#define MB_TYPE_FORWARD  0x20
......
410 427

  
411 428
    int block_index[6]; ///< index to current MB in block based arrays with edges
412 429
    int block_wrap[6];
430
    
431
    int *mb_index2xy;        ///< mb_index -> mb_x + mb_y*mb_stride
413 432

  
414 433
    /** matrix transmitted in the bitstream */
415 434
    uint16_t intra_matrix[64];
......
467 486
    int last_bits; ///< temp var used for calculating the above vars
468 487
    
469 488
    /* error concealment / resync */
489
    int error_count;
470 490
    uint8_t *error_status_table;       ///< table of the error status of each MB  
471 491
#define VP_START            1          ///< current MB is the first after a resync marker 
472 492
#define AC_ERROR            2
......
544 564
    uint8_t *tex_pb_buffer;          
545 565
    uint8_t *pb2_buffer;
546 566
    int mpeg_quant;
547
#define CO_LOCATED_TYPE_4MV     1
548
#define CO_LOCATED_TYPE_FIELDMV 2
549
    int8_t *co_located_type_table;     ///< 4mv & field_mv info for next b frame 
550 567
    int16_t (*field_mv_table)[2][2];   ///< used for interlaced b frame decoding 
551 568
    int8_t (*field_select_table)[2];   ///< wtf, no really another table for interlaced b frames 
552 569
    int t_frame;                       ///< time distance of first I -> B, used for interlaced b frames 
......
693 710
                                    int src_x, int src_y, int w, int h);
694 711
char ff_get_pict_type_char(int pict_type);
695 712
int ff_combine_frame( MpegEncContext *s, int next, uint8_t **buf, int *buf_size);
713
void ff_print_debug_info(MpegEncContext *s, Picture *pict);
696 714

  
697 715
void ff_er_frame_start(MpegEncContext *s);
698 716
void ff_er_frame_end(MpegEncContext *s);
......
827 845
int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s);
828 846
int ff_h263_resync(MpegEncContext *s);
829 847
int ff_h263_get_gob_height(MpegEncContext *s);
830
void ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
848
int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
831 849
inline int ff_h263_round_chroma(int x);
832 850

  
833 851

  

Also available in: Unified diff