00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00028 #ifndef AVCODEC_H264_H
00029 #define AVCODEC_H264_H
00030
00031 #include "libavutil/intreadwrite.h"
00032 #include "dsputil.h"
00033 #include "cabac.h"
00034 #include "mpegvideo.h"
00035 #include "h264dsp.h"
00036 #include "h264pred.h"
00037 #include "rectangle.h"
00038
00039 #define interlaced_dct interlaced_dct_is_a_bad_name
00040 #define mb_intra mb_intra_is_not_initialized_see_mb_type
00041
00042 #define LUMA_DC_BLOCK_INDEX 24
00043 #define CHROMA_DC_BLOCK_INDEX 25
00044
00045 #define CHROMA_DC_COEFF_TOKEN_VLC_BITS 8
00046 #define COEFF_TOKEN_VLC_BITS 8
00047 #define TOTAL_ZEROS_VLC_BITS 9
00048 #define CHROMA_DC_TOTAL_ZEROS_VLC_BITS 3
00049 #define RUN_VLC_BITS 3
00050 #define RUN7_VLC_BITS 6
00051
00052 #define MAX_SPS_COUNT 32
00053 #define MAX_PPS_COUNT 256
00054
00055 #define MAX_MMCO_COUNT 66
00056
00057 #define MAX_DELAYED_PIC_COUNT 16
00058
00059
00060
00061 #define ALLOW_INTERLACE
00062
00063 #define ALLOW_NOCHROMA
00064
00065 #define FMO 0
00066
00071 #define MAX_SLICES 16
00072
00073 #ifdef ALLOW_INTERLACE
00074 #define MB_MBAFF h->mb_mbaff
00075 #define MB_FIELD h->mb_field_decoding_flag
00076 #define FRAME_MBAFF h->mb_aff_frame
00077 #define FIELD_PICTURE (s->picture_structure != PICT_FRAME)
00078 #else
00079 #define MB_MBAFF 0
00080 #define MB_FIELD 0
00081 #define FRAME_MBAFF 0
00082 #define FIELD_PICTURE 0
00083 #undef IS_INTERLACED
00084 #define IS_INTERLACED(mb_type) 0
00085 #endif
00086 #define FIELD_OR_MBAFF_PICTURE (FRAME_MBAFF || FIELD_PICTURE)
00087
00088 #ifdef ALLOW_NOCHROMA
00089 #define CHROMA h->sps.chroma_format_idc
00090 #else
00091 #define CHROMA 1
00092 #endif
00093
00094 #ifndef CABAC
00095 #define CABAC h->pps.cabac
00096 #endif
00097
00098 #define EXTENDED_SAR 255
00099
00100 #define MB_TYPE_REF0 MB_TYPE_ACPRED //dirty but it fits in 16 bit
00101 #define MB_TYPE_8x8DCT 0x01000000
00102 #define IS_REF0(a) ((a) & MB_TYPE_REF0)
00103 #define IS_8x8DCT(a) ((a) & MB_TYPE_8x8DCT)
00104
00109 #define DELAYED_PIC_REF 4
00110
00111
00112
00113 enum {
00114 NAL_SLICE=1,
00115 NAL_DPA,
00116 NAL_DPB,
00117 NAL_DPC,
00118 NAL_IDR_SLICE,
00119 NAL_SEI,
00120 NAL_SPS,
00121 NAL_PPS,
00122 NAL_AUD,
00123 NAL_END_SEQUENCE,
00124 NAL_END_STREAM,
00125 NAL_FILLER_DATA,
00126 NAL_SPS_EXT,
00127 NAL_AUXILIARY_SLICE=19
00128 };
00129
00133 typedef enum {
00134 SEI_BUFFERING_PERIOD = 0,
00135 SEI_TYPE_PIC_TIMING = 1,
00136 SEI_TYPE_USER_DATA_UNREGISTERED = 5,
00137 SEI_TYPE_RECOVERY_POINT = 6
00138 } SEI_Type;
00139
00143 typedef enum {
00144 SEI_PIC_STRUCT_FRAME = 0,
00145 SEI_PIC_STRUCT_TOP_FIELD = 1,
00146 SEI_PIC_STRUCT_BOTTOM_FIELD = 2,
00147 SEI_PIC_STRUCT_TOP_BOTTOM = 3,
00148 SEI_PIC_STRUCT_BOTTOM_TOP = 4,
00149 SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5,
00150 SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6,
00151 SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
00152 SEI_PIC_STRUCT_FRAME_TRIPLING = 8
00153 } SEI_PicStructType;
00154
00158 typedef struct SPS{
00159
00160 int profile_idc;
00161 int level_idc;
00162 int chroma_format_idc;
00163 int transform_bypass;
00164 int log2_max_frame_num;
00165 int poc_type;
00166 int log2_max_poc_lsb;
00167 int delta_pic_order_always_zero_flag;
00168 int offset_for_non_ref_pic;
00169 int offset_for_top_to_bottom_field;
00170 int poc_cycle_length;
00171 int ref_frame_count;
00172 int gaps_in_frame_num_allowed_flag;
00173 int mb_width;
00174 int mb_height;
00175 int frame_mbs_only_flag;
00176 int mb_aff;
00177 int direct_8x8_inference_flag;
00178 int crop;
00179 unsigned int crop_left;
00180 unsigned int crop_right;
00181 unsigned int crop_top;
00182 unsigned int crop_bottom;
00183 int vui_parameters_present_flag;
00184 AVRational sar;
00185 int video_signal_type_present_flag;
00186 int full_range;
00187 int colour_description_present_flag;
00188 enum AVColorPrimaries color_primaries;
00189 enum AVColorTransferCharacteristic color_trc;
00190 enum AVColorSpace colorspace;
00191 int timing_info_present_flag;
00192 uint32_t num_units_in_tick;
00193 uint32_t time_scale;
00194 int fixed_frame_rate_flag;
00195 short offset_for_ref_frame[256];
00196 int bitstream_restriction_flag;
00197 int num_reorder_frames;
00198 int scaling_matrix_present;
00199 uint8_t scaling_matrix4[6][16];
00200 uint8_t scaling_matrix8[2][64];
00201 int nal_hrd_parameters_present_flag;
00202 int vcl_hrd_parameters_present_flag;
00203 int pic_struct_present_flag;
00204 int time_offset_length;
00205 int cpb_cnt;
00206 int initial_cpb_removal_delay_length;
00207 int cpb_removal_delay_length;
00208 int dpb_output_delay_length;
00209 int bit_depth_luma;
00210 int bit_depth_chroma;
00211 int residual_color_transform_flag;
00212 int constraint_set_flags;
00213 }SPS;
00214
00218 typedef struct PPS{
00219 unsigned int sps_id;
00220 int cabac;
00221 int pic_order_present;
00222 int slice_group_count;
00223 int mb_slice_group_map_type;
00224 unsigned int ref_count[2];
00225 int weighted_pred;
00226 int weighted_bipred_idc;
00227 int init_qp;
00228 int init_qs;
00229 int chroma_qp_index_offset[2];
00230 int deblocking_filter_parameters_present;
00231 int constrained_intra_pred;
00232 int redundant_pic_cnt_present;
00233 int transform_8x8_mode;
00234 uint8_t scaling_matrix4[6][16];
00235 uint8_t scaling_matrix8[2][64];
00236 uint8_t chroma_qp_table[2][64];
00237 int chroma_qp_diff;
00238 }PPS;
00239
00243 typedef enum MMCOOpcode{
00244 MMCO_END=0,
00245 MMCO_SHORT2UNUSED,
00246 MMCO_LONG2UNUSED,
00247 MMCO_SHORT2LONG,
00248 MMCO_SET_MAX_LONG,
00249 MMCO_RESET,
00250 MMCO_LONG,
00251 } MMCOOpcode;
00252
00256 typedef struct MMCO{
00257 MMCOOpcode opcode;
00258 int short_pic_num;
00259 int long_arg;
00260 } MMCO;
00261
00265 typedef struct H264Context{
00266 MpegEncContext s;
00267 H264DSPContext h264dsp;
00268 int chroma_qp[2];
00269
00270 int qp_thresh;
00271
00272 int prev_mb_skipped;
00273 int next_mb_skipped;
00274
00275
00276 int chroma_pred_mode;
00277 int intra16x16_pred_mode;
00278
00279 int topleft_mb_xy;
00280 int top_mb_xy;
00281 int topright_mb_xy;
00282 int left_mb_xy[2];
00283
00284 int topleft_type;
00285 int top_type;
00286 int topright_type;
00287 int left_type[2];
00288
00289 const uint8_t * left_block;
00290 int topleft_partition;
00291
00292 int8_t intra4x4_pred_mode_cache[5*8];
00293 int8_t (*intra4x4_pred_mode);
00294 H264PredContext hpc;
00295 unsigned int topleft_samples_available;
00296 unsigned int top_samples_available;
00297 unsigned int topright_samples_available;
00298 unsigned int left_samples_available;
00299 uint8_t (*top_borders[2])[16+2*8];
00300
00305 DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[6*8];
00306
00307
00308
00309
00310
00311
00312
00313 uint8_t (*non_zero_count)[32];
00314
00318 DECLARE_ALIGNED(16, int16_t, mv_cache)[2][5*8][2];
00319 DECLARE_ALIGNED(8, int8_t, ref_cache)[2][5*8];
00320 #define LIST_NOT_USED -1 //FIXME rename?
00321 #define PART_NOT_AVAILABLE -2
00322
00326 int mv_cache_clean[2];
00327
00331 int neighbor_transform_size;
00332
00337 int block_offset[2*(16+8)];
00338
00339 uint32_t *mb2b_xy;
00340 uint32_t *mb2br_xy;
00341 int b_stride;
00342
00343 int mb_linesize;
00344 int mb_uvlinesize;
00345
00346 int emu_edge_width;
00347 int emu_edge_height;
00348
00349 SPS sps;
00350
00354 PPS pps;
00355
00356 uint32_t dequant4_buffer[6][52][16];
00357 uint32_t dequant8_buffer[2][52][64];
00358 uint32_t (*dequant4_coeff[6])[16];
00359 uint32_t (*dequant8_coeff[2])[64];
00360
00361 int slice_num;
00362 uint16_t *slice_table;
00363 int slice_type;
00364 int slice_type_nos;
00365 int slice_type_fixed;
00366
00367
00368 int mb_aff_frame;
00369 int mb_field_decoding_flag;
00370 int mb_mbaff;
00371
00372 DECLARE_ALIGNED(8, uint16_t, sub_mb_type)[4];
00373
00374
00375 int use_weight;
00376 int use_weight_chroma;
00377 int luma_log2_weight_denom;
00378 int chroma_log2_weight_denom;
00379
00380 int luma_weight[48][2][2];
00381 int chroma_weight[48][2][2][2];
00382 int implicit_weight[48][48][2];
00383
00384 int direct_spatial_mv_pred;
00385 int col_parity;
00386 int col_fieldoff;
00387 int dist_scale_factor[16];
00388 int dist_scale_factor_field[2][32];
00389 int map_col_to_list0[2][16+32];
00390 int map_col_to_list0_field[2][2][16+32];
00391
00395 unsigned int ref_count[2];
00396 unsigned int list_count;
00397 uint8_t *list_counts;
00398 Picture ref_list[2][48];
00401 int ref2frm[MAX_SLICES][2][64];
00402
00403
00404 GetBitContext intra_gb;
00405 GetBitContext inter_gb;
00406 GetBitContext *intra_gb_ptr;
00407 GetBitContext *inter_gb_ptr;
00408
00409 DECLARE_ALIGNED(16, DCTELEM, mb)[16*24];
00410 DECLARE_ALIGNED(16, DCTELEM, mb_luma_dc)[16];
00411 DCTELEM mb_padding[256];
00412
00416 CABACContext cabac;
00417 uint8_t cabac_state[460];
00418
00419
00420 uint16_t *cbp_table;
00421 int cbp;
00422 int top_cbp;
00423 int left_cbp;
00424
00425 uint8_t *chroma_pred_mode_table;
00426 int last_qscale_diff;
00427 uint8_t (*mvd_table[2])[2];
00428 DECLARE_ALIGNED(16, uint8_t, mvd_cache)[2][5*8][2];
00429 uint8_t *direct_table;
00430 uint8_t direct_cache[5*8];
00431
00432 uint8_t zigzag_scan[16];
00433 uint8_t zigzag_scan8x8[64];
00434 uint8_t zigzag_scan8x8_cavlc[64];
00435 uint8_t field_scan[16];
00436 uint8_t field_scan8x8[64];
00437 uint8_t field_scan8x8_cavlc[64];
00438 const uint8_t *zigzag_scan_q0;
00439 const uint8_t *zigzag_scan8x8_q0;
00440 const uint8_t *zigzag_scan8x8_cavlc_q0;
00441 const uint8_t *field_scan_q0;
00442 const uint8_t *field_scan8x8_q0;
00443 const uint8_t *field_scan8x8_cavlc_q0;
00444
00445 int x264_build;
00446
00447 int mb_xy;
00448
00449 int is_complex;
00450
00451
00452 int deblocking_filter;
00453 int slice_alpha_c0_offset;
00454 int slice_beta_offset;
00455
00456
00457
00458
00459 int nal_ref_idc;
00460 int nal_unit_type;
00461 uint8_t *rbsp_buffer[2];
00462 unsigned int rbsp_buffer_size[2];
00463
00467 int is_avc;
00468 int nal_length_size;
00469 int got_first;
00470
00471 SPS *sps_buffers[MAX_SPS_COUNT];
00472 PPS *pps_buffers[MAX_PPS_COUNT];
00473
00474 int dequant_coeff_pps;
00475
00476 uint16_t *slice_table_base;
00477
00478
00479
00480 int poc_lsb;
00481 int poc_msb;
00482 int delta_poc_bottom;
00483 int delta_poc[2];
00484 int frame_num;
00485 int prev_poc_msb;
00486 int prev_poc_lsb;
00487 int frame_num_offset;
00488 int prev_frame_num_offset;
00489 int prev_frame_num;
00490
00494 int curr_pic_num;
00495
00499 int max_pic_num;
00500
00501 int redundant_pic_count;
00502
00503 Picture *short_ref[32];
00504 Picture *long_ref[32];
00505 Picture default_ref_list[2][32];
00506 Picture *delayed_pic[MAX_DELAYED_PIC_COUNT+2];
00507 int outputed_poc;
00508
00512 MMCO mmco[MAX_MMCO_COUNT];
00513 int mmco_index;
00514
00515 int long_ref_count;
00516 int short_ref_count;
00517
00518 int cabac_init_idc;
00519
00524 struct H264Context *thread_context[MAX_THREADS];
00525
00529 int current_slice;
00530
00537 int max_contexts;
00538
00543 int single_decode_warning;
00544
00545 int last_slice_type;
00551 SEI_PicStructType sei_pic_struct;
00552
00559 int prev_interlaced_frame;
00560
00566 int sei_ct_type;
00567
00571 int sei_dpb_output_delay;
00572
00576 int sei_cpb_removal_delay;
00577
00585 int sei_recovery_frame_cnt;
00586
00587 int luma_weight_flag[2];
00588 int chroma_weight_flag[2];
00589
00590
00591 int sei_buffering_period_present;
00592 int initial_cpb_removal_delay[32];
00593
00594
00595 int halfpel_flag;
00596 int thirdpel_flag;
00597 int unknown_svq3_flag;
00598 int next_slice_index;
00599 uint32_t svq3_watermark_key;
00600 }H264Context;
00601
00602
00603 extern const uint8_t ff_h264_chroma_qp[52];
00604
00608 int ff_h264_decode_sei(H264Context *h);
00609
00613 int ff_h264_decode_seq_parameter_set(H264Context *h);
00614
00618 int ff_h264_get_profile(SPS *sps);
00619
00623 int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length);
00624
00632 const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length);
00633
00637 av_cold void ff_h264_free_context(H264Context *h);
00638
00642 int ff_h264_get_slice_type(const H264Context *h);
00643
00648 int ff_h264_alloc_tables(H264Context *h);
00649
00653 int ff_h264_fill_default_ref_list(H264Context *h);
00654
00655 int ff_h264_decode_ref_pic_list_reordering(H264Context *h);
00656 void ff_h264_fill_mbaff_ref_list(H264Context *h);
00657 void ff_h264_remove_all_refs(H264Context *h);
00658
00662 int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count);
00663
00664 int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb);
00665
00666 void ff_generate_sliding_window_mmcos(H264Context *h);
00667
00668
00672 int ff_h264_check_intra4x4_pred_mode(H264Context *h);
00673
00677 int ff_h264_check_intra_pred_mode(H264Context *h, int mode);
00678
00679 void ff_h264_write_back_intra_pred_mode(H264Context *h);
00680 void ff_h264_hl_decode_mb(H264Context *h);
00681 int ff_h264_frame_start(H264Context *h);
00682 int ff_h264_decode_extradata(H264Context *h);
00683 av_cold int ff_h264_decode_init(AVCodecContext *avctx);
00684 av_cold int ff_h264_decode_end(AVCodecContext *avctx);
00685 av_cold void ff_h264_decode_init_vlc(void);
00686
00691 int ff_h264_decode_mb_cavlc(H264Context *h);
00692
00697 int ff_h264_decode_mb_cabac(H264Context *h);
00698
00699 void ff_h264_init_cabac_states(H264Context *h);
00700
00701 void ff_h264_direct_dist_scale_factor(H264Context * const h);
00702 void ff_h264_direct_ref_list_init(H264Context * const h);
00703 void ff_h264_pred_direct_motion(H264Context * const h, int *mb_type);
00704
00705 void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize);
00706 void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize);
00707
00713 void ff_h264_reset_sei(H264Context *h);
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738 static const uint8_t scan8[16 + 2*4 + 3]={
00739 4+1*8, 5+1*8, 4+2*8, 5+2*8,
00740 6+1*8, 7+1*8, 6+2*8, 7+2*8,
00741 4+3*8, 5+3*8, 4+4*8, 5+4*8,
00742 6+3*8, 7+3*8, 6+4*8, 7+4*8,
00743 1+1*8, 2+1*8,
00744 1+2*8, 2+2*8,
00745 1+4*8, 2+4*8,
00746 1+5*8, 2+5*8,
00747 4+5*8, 5+5*8, 6+5*8
00748 };
00749
00750 static av_always_inline uint32_t pack16to32(int a, int b){
00751 #if HAVE_BIGENDIAN
00752 return (b&0xFFFF) + (a<<16);
00753 #else
00754 return (a&0xFFFF) + (b<<16);
00755 #endif
00756 }
00757
00758 static av_always_inline uint16_t pack8to16(int a, int b){
00759 #if HAVE_BIGENDIAN
00760 return (b&0xFF) + (a<<8);
00761 #else
00762 return (a&0xFF) + (b<<8);
00763 #endif
00764 }
00765
00769 static inline int get_chroma_qp(H264Context *h, int t, int qscale){
00770 return h->pps.chroma_qp_table[t][qscale];
00771 }
00772
00773 static inline void pred_pskip_motion(H264Context * const h, int * const mx, int * const my);
00774
00775 static void fill_decode_neighbors(H264Context *h, int mb_type){
00776 MpegEncContext * const s = &h->s;
00777 const int mb_xy= h->mb_xy;
00778 int topleft_xy, top_xy, topright_xy, left_xy[2];
00779 static const uint8_t left_block_options[4][16]={
00780 {0,1,2,3,7,10,8,11,7+0*8, 7+1*8, 7+2*8, 7+3*8, 2+0*8, 2+3*8, 2+1*8, 2+2*8},
00781 {2,2,3,3,8,11,8,11,7+2*8, 7+2*8, 7+3*8, 7+3*8, 2+1*8, 2+2*8, 2+1*8, 2+2*8},
00782 {0,0,1,1,7,10,7,10,7+0*8, 7+0*8, 7+1*8, 7+1*8, 2+0*8, 2+3*8, 2+0*8, 2+3*8},
00783 {0,2,0,2,7,10,7,10,7+0*8, 7+2*8, 7+0*8, 7+2*8, 2+0*8, 2+3*8, 2+0*8, 2+3*8}
00784 };
00785
00786 h->topleft_partition= -1;
00787
00788 top_xy = mb_xy - (s->mb_stride << MB_FIELD);
00789
00790
00791
00792
00793 topleft_xy = top_xy - 1;
00794 topright_xy= top_xy + 1;
00795 left_xy[1] = left_xy[0] = mb_xy-1;
00796 h->left_block = left_block_options[0];
00797 if(FRAME_MBAFF){
00798 const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]);
00799 const int curr_mb_field_flag = IS_INTERLACED(mb_type);
00800 if(s->mb_y&1){
00801 if (left_mb_field_flag != curr_mb_field_flag) {
00802 left_xy[1] = left_xy[0] = mb_xy - s->mb_stride - 1;
00803 if (curr_mb_field_flag) {
00804 left_xy[1] += s->mb_stride;
00805 h->left_block = left_block_options[3];
00806 } else {
00807 topleft_xy += s->mb_stride;
00808
00809 h->topleft_partition = 0;
00810 h->left_block = left_block_options[1];
00811 }
00812 }
00813 }else{
00814 if(curr_mb_field_flag){
00815 topleft_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy - 1]>>7)&1)-1);
00816 topright_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy + 1]>>7)&1)-1);
00817 top_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy ]>>7)&1)-1);
00818 }
00819 if (left_mb_field_flag != curr_mb_field_flag) {
00820 if (curr_mb_field_flag) {
00821 left_xy[1] += s->mb_stride;
00822 h->left_block = left_block_options[3];
00823 } else {
00824 h->left_block = left_block_options[2];
00825 }
00826 }
00827 }
00828 }
00829
00830 h->topleft_mb_xy = topleft_xy;
00831 h->top_mb_xy = top_xy;
00832 h->topright_mb_xy= topright_xy;
00833 h->left_mb_xy[0] = left_xy[0];
00834 h->left_mb_xy[1] = left_xy[1];
00835
00836
00837 h->topleft_type = s->current_picture.mb_type[topleft_xy] ;
00838 h->top_type = s->current_picture.mb_type[top_xy] ;
00839 h->topright_type= s->current_picture.mb_type[topright_xy];
00840 h->left_type[0] = s->current_picture.mb_type[left_xy[0]] ;
00841 h->left_type[1] = s->current_picture.mb_type[left_xy[1]] ;
00842
00843 if(FMO){
00844 if(h->slice_table[topleft_xy ] != h->slice_num) h->topleft_type = 0;
00845 if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;
00846 if(h->slice_table[left_xy[0] ] != h->slice_num) h->left_type[0] = h->left_type[1] = 0;
00847 }else{
00848 if(h->slice_table[topleft_xy ] != h->slice_num){
00849 h->topleft_type = 0;
00850 if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;
00851 if(h->slice_table[left_xy[0] ] != h->slice_num) h->left_type[0] = h->left_type[1] = 0;
00852 }
00853 }
00854 if(h->slice_table[topright_xy] != h->slice_num) h->topright_type= 0;
00855 }
00856
00857 static void fill_decode_caches(H264Context *h, int mb_type){
00858 MpegEncContext * const s = &h->s;
00859 int topleft_xy, top_xy, topright_xy, left_xy[2];
00860 int topleft_type, top_type, topright_type, left_type[2];
00861 const uint8_t * left_block= h->left_block;
00862 int i;
00863
00864 topleft_xy = h->topleft_mb_xy ;
00865 top_xy = h->top_mb_xy ;
00866 topright_xy = h->topright_mb_xy;
00867 left_xy[0] = h->left_mb_xy[0] ;
00868 left_xy[1] = h->left_mb_xy[1] ;
00869 topleft_type = h->topleft_type ;
00870 top_type = h->top_type ;
00871 topright_type= h->topright_type ;
00872 left_type[0] = h->left_type[0] ;
00873 left_type[1] = h->left_type[1] ;
00874
00875 if(!IS_SKIP(mb_type)){
00876 if(IS_INTRA(mb_type)){
00877 int type_mask= h->pps.constrained_intra_pred ? IS_INTRA(-1) : -1;
00878 h->topleft_samples_available=
00879 h->top_samples_available=
00880 h->left_samples_available= 0xFFFF;
00881 h->topright_samples_available= 0xEEEA;
00882
00883 if(!(top_type & type_mask)){
00884 h->topleft_samples_available= 0xB3FF;
00885 h->top_samples_available= 0x33FF;
00886 h->topright_samples_available= 0x26EA;
00887 }
00888 if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[0])){
00889 if(IS_INTERLACED(mb_type)){
00890 if(!(left_type[0] & type_mask)){
00891 h->topleft_samples_available&= 0xDFFF;
00892 h->left_samples_available&= 0x5FFF;
00893 }
00894 if(!(left_type[1] & type_mask)){
00895 h->topleft_samples_available&= 0xFF5F;
00896 h->left_samples_available&= 0xFF5F;
00897 }
00898 }else{
00899 int left_typei = s->current_picture.mb_type[left_xy[0] + s->mb_stride];
00900
00901 assert(left_xy[0] == left_xy[1]);
00902 if(!((left_typei & type_mask) && (left_type[0] & type_mask))){
00903 h->topleft_samples_available&= 0xDF5F;
00904 h->left_samples_available&= 0x5F5F;
00905 }
00906 }
00907 }else{
00908 if(!(left_type[0] & type_mask)){
00909 h->topleft_samples_available&= 0xDF5F;
00910 h->left_samples_available&= 0x5F5F;
00911 }
00912 }
00913
00914 if(!(topleft_type & type_mask))
00915 h->topleft_samples_available&= 0x7FFF;
00916
00917 if(!(topright_type & type_mask))
00918 h->topright_samples_available&= 0xFBFF;
00919
00920 if(IS_INTRA4x4(mb_type)){
00921 if(IS_INTRA4x4(top_type)){
00922 AV_COPY32(h->intra4x4_pred_mode_cache+4+8*0, h->intra4x4_pred_mode + h->mb2br_xy[top_xy]);
00923 }else{
00924 h->intra4x4_pred_mode_cache[4+8*0]=
00925 h->intra4x4_pred_mode_cache[5+8*0]=
00926 h->intra4x4_pred_mode_cache[6+8*0]=
00927 h->intra4x4_pred_mode_cache[7+8*0]= 2 - 3*!(top_type & type_mask);
00928 }
00929 for(i=0; i<2; i++){
00930 if(IS_INTRA4x4(left_type[i])){
00931 int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]];
00932 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= mode[6-left_block[0+2*i]];
00933 h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= mode[6-left_block[1+2*i]];
00934 }else{
00935 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]=
00936 h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= 2 - 3*!(left_type[i] & type_mask);
00937 }
00938 }
00939 }
00940 }
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952 if(top_type){
00953 AV_COPY32(&h->non_zero_count_cache[4+8*0], &h->non_zero_count[top_xy][4+3*8]);
00954 h->non_zero_count_cache[1+8*0]= h->non_zero_count[top_xy][1+1*8];
00955 h->non_zero_count_cache[2+8*0]= h->non_zero_count[top_xy][2+1*8];
00956
00957 h->non_zero_count_cache[1+8*3]= h->non_zero_count[top_xy][1+2*8];
00958 h->non_zero_count_cache[2+8*3]= h->non_zero_count[top_xy][2+2*8];
00959 }else {
00960 h->non_zero_count_cache[1+8*0]=
00961 h->non_zero_count_cache[2+8*0]=
00962
00963 h->non_zero_count_cache[1+8*3]=
00964 h->non_zero_count_cache[2+8*3]=
00965 AV_WN32A(&h->non_zero_count_cache[4+8*0], CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040);
00966 }
00967
00968 for (i=0; i<2; i++) {
00969 if(left_type[i]){
00970 h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]];
00971 h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]];
00972 h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+4+2*i]];
00973 h->non_zero_count_cache[0+8*4 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+5+2*i]];
00974 }else{
00975 h->non_zero_count_cache[3+8*1 + 2*8*i]=
00976 h->non_zero_count_cache[3+8*2 + 2*8*i]=
00977 h->non_zero_count_cache[0+8*1 + 8*i]=
00978 h->non_zero_count_cache[0+8*4 + 8*i]= CABAC && !IS_INTRA(mb_type) ? 0 : 64;
00979 }
00980 }
00981
00982 if( CABAC ) {
00983
00984 if(top_type) {
00985 h->top_cbp = h->cbp_table[top_xy];
00986 } else {
00987 h->top_cbp = IS_INTRA(mb_type) ? 0x1CF : 0x00F;
00988 }
00989
00990 if (left_type[0]) {
00991 h->left_cbp = (h->cbp_table[left_xy[0]] & 0x1f0)
00992 | ((h->cbp_table[left_xy[0]]>>(left_block[0]&(~1)))&2)
00993 | (((h->cbp_table[left_xy[1]]>>(left_block[2]&(~1)))&2) << 2);
00994 } else {
00995 h->left_cbp = IS_INTRA(mb_type) ? 0x1CF : 0x00F;
00996 }
00997 }
00998 }
00999
01000 #if 1
01001 if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){
01002 int list;
01003 for(list=0; list<h->list_count; list++){
01004 if(!USES_LIST(mb_type, list)){
01005
01006
01007
01008
01009
01010 continue;
01011 }
01012 assert(!(IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred));
01013
01014 h->mv_cache_clean[list]= 0;
01015
01016 if(USES_LIST(top_type, list)){
01017 const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride;
01018 AV_COPY128(h->mv_cache[list][scan8[0] + 0 - 1*8], s->current_picture.motion_val[list][b_xy + 0]);
01019 h->ref_cache[list][scan8[0] + 0 - 1*8]=
01020 h->ref_cache[list][scan8[0] + 1 - 1*8]= s->current_picture.ref_index[list][4*top_xy + 2];
01021 h->ref_cache[list][scan8[0] + 2 - 1*8]=
01022 h->ref_cache[list][scan8[0] + 3 - 1*8]= s->current_picture.ref_index[list][4*top_xy + 3];
01023 }else{
01024 AV_ZERO128(h->mv_cache[list][scan8[0] + 0 - 1*8]);
01025 AV_WN32A(&h->ref_cache[list][scan8[0] + 0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101);
01026 }
01027
01028 if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){
01029 for(i=0; i<2; i++){
01030 int cache_idx = scan8[0] - 1 + i*2*8;
01031 if(USES_LIST(left_type[i], list)){
01032 const int b_xy= h->mb2b_xy[left_xy[i]] + 3;
01033 const int b8_xy= 4*left_xy[i] + 1;
01034 AV_COPY32(h->mv_cache[list][cache_idx ], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0+i*2]]);
01035 AV_COPY32(h->mv_cache[list][cache_idx+8], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[1+i*2]]);
01036 h->ref_cache[list][cache_idx ]= s->current_picture.ref_index[list][b8_xy + (left_block[0+i*2]&~1)];
01037 h->ref_cache[list][cache_idx+8]= s->current_picture.ref_index[list][b8_xy + (left_block[1+i*2]&~1)];
01038 }else{
01039 AV_ZERO32(h->mv_cache [list][cache_idx ]);
01040 AV_ZERO32(h->mv_cache [list][cache_idx+8]);
01041 h->ref_cache[list][cache_idx ]=
01042 h->ref_cache[list][cache_idx+8]= (left_type[i]) ? LIST_NOT_USED : PART_NOT_AVAILABLE;
01043 }
01044 }
01045 }else{
01046 if(USES_LIST(left_type[0], list)){
01047 const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
01048 const int b8_xy= 4*left_xy[0] + 1;
01049 AV_COPY32(h->mv_cache[list][scan8[0] - 1], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0]]);
01050 h->ref_cache[list][scan8[0] - 1]= s->current_picture.ref_index[list][b8_xy + (left_block[0]&~1)];
01051 }else{
01052 AV_ZERO32(h->mv_cache [list][scan8[0] - 1]);
01053 h->ref_cache[list][scan8[0] - 1]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
01054 }
01055 }
01056
01057 if(USES_LIST(topright_type, list)){
01058 const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;
01059 AV_COPY32(h->mv_cache[list][scan8[0] + 4 - 1*8], s->current_picture.motion_val[list][b_xy]);
01060 h->ref_cache[list][scan8[0] + 4 - 1*8]= s->current_picture.ref_index[list][4*topright_xy + 2];
01061 }else{
01062 AV_ZERO32(h->mv_cache [list][scan8[0] + 4 - 1*8]);
01063 h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
01064 }
01065 if(h->ref_cache[list][scan8[0] + 4 - 1*8] < 0){
01066 if(USES_LIST(topleft_type, list)){
01067 const int b_xy = h->mb2b_xy [topleft_xy] + 3 + h->b_stride + (h->topleft_partition & 2*h->b_stride);
01068 const int b8_xy= 4*topleft_xy + 1 + (h->topleft_partition & 2);
01069 AV_COPY32(h->mv_cache[list][scan8[0] - 1 - 1*8], s->current_picture.motion_val[list][b_xy]);
01070 h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy];
01071 }else{
01072 AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]);
01073 h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
01074 }
01075 }
01076
01077 if((mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2)) && !FRAME_MBAFF)
01078 continue;
01079
01080 if(!(mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2))) {
01081 h->ref_cache[list][scan8[4 ]] =
01082 h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE;
01083 AV_ZERO32(h->mv_cache [list][scan8[4 ]]);
01084 AV_ZERO32(h->mv_cache [list][scan8[12]]);
01085
01086 if( CABAC ) {
01087
01088 if(USES_LIST(top_type, list)){
01089 const int b_xy= h->mb2br_xy[top_xy];
01090 AV_COPY64(h->mvd_cache[list][scan8[0] + 0 - 1*8], h->mvd_table[list][b_xy + 0]);
01091 }else{
01092 AV_ZERO64(h->mvd_cache[list][scan8[0] + 0 - 1*8]);
01093 }
01094 if(USES_LIST(left_type[0], list)){
01095 const int b_xy= h->mb2br_xy[left_xy[0]] + 6;
01096 AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 0*8], h->mvd_table[list][b_xy - left_block[0]]);
01097 AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 1*8], h->mvd_table[list][b_xy - left_block[1]]);
01098 }else{
01099 AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 0*8]);
01100 AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 1*8]);
01101 }
01102 if(USES_LIST(left_type[1], list)){
01103 const int b_xy= h->mb2br_xy[left_xy[1]] + 6;
01104 AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 2*8], h->mvd_table[list][b_xy - left_block[2]]);
01105 AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 3*8], h->mvd_table[list][b_xy - left_block[3]]);
01106 }else{
01107 AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 2*8]);
01108 AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 3*8]);
01109 }
01110 AV_ZERO16(h->mvd_cache [list][scan8[4 ]]);
01111 AV_ZERO16(h->mvd_cache [list][scan8[12]]);
01112 if(h->slice_type_nos == FF_B_TYPE){
01113 fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1);
01114
01115 if(IS_DIRECT(top_type)){
01116 AV_WN32A(&h->direct_cache[scan8[0] - 1*8], 0x01010101u*(MB_TYPE_DIRECT2>>1));
01117 }else if(IS_8X8(top_type)){
01118 int b8_xy = 4*top_xy;
01119 h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy + 2];
01120 h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 3];
01121 }else{
01122 AV_WN32A(&h->direct_cache[scan8[0] - 1*8], 0x01010101*(MB_TYPE_16x16>>1));
01123 }
01124
01125 if(IS_DIRECT(left_type[0]))
01126 h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_DIRECT2>>1;
01127 else if(IS_8X8(left_type[0]))
01128 h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[4*left_xy[0] + 1 + (left_block[0]&~1)];
01129 else
01130 h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_16x16>>1;
01131
01132 if(IS_DIRECT(left_type[1]))
01133 h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_DIRECT2>>1;
01134 else if(IS_8X8(left_type[1]))
01135 h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[4*left_xy[1] + 1 + (left_block[2]&~1)];
01136 else
01137 h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_16x16>>1;
01138 }
01139 }
01140 }
01141 if(FRAME_MBAFF){
01142 #define MAP_MVS\
01143 MAP_F2F(scan8[0] - 1 - 1*8, topleft_type)\
01144 MAP_F2F(scan8[0] + 0 - 1*8, top_type)\
01145 MAP_F2F(scan8[0] + 1 - 1*8, top_type)\
01146 MAP_F2F(scan8[0] + 2 - 1*8, top_type)\
01147 MAP_F2F(scan8[0] + 3 - 1*8, top_type)\
01148 MAP_F2F(scan8[0] + 4 - 1*8, topright_type)\
01149 MAP_F2F(scan8[0] - 1 + 0*8, left_type[0])\
01150 MAP_F2F(scan8[0] - 1 + 1*8, left_type[0])\
01151 MAP_F2F(scan8[0] - 1 + 2*8, left_type[1])\
01152 MAP_F2F(scan8[0] - 1 + 3*8, left_type[1])
01153 if(MB_FIELD){
01154 #define MAP_F2F(idx, mb_type)\
01155 if(!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\
01156 h->ref_cache[list][idx] <<= 1;\
01157 h->mv_cache[list][idx][1] /= 2;\
01158 h->mvd_cache[list][idx][1] >>=1;\
01159 }
01160 MAP_MVS
01161 #undef MAP_F2F
01162 }else{
01163 #define MAP_F2F(idx, mb_type)\
01164 if(IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\
01165 h->ref_cache[list][idx] >>= 1;\
01166 h->mv_cache[list][idx][1] <<= 1;\
01167 h->mvd_cache[list][idx][1] <<= 1;\
01168 }
01169 MAP_MVS
01170 #undef MAP_F2F
01171 }
01172 }
01173 }
01174 }
01175 #endif
01176
01177 h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]);
01178 }
01179
01183 static inline int pred_intra_mode(H264Context *h, int n){
01184 const int index8= scan8[n];
01185 const int left= h->intra4x4_pred_mode_cache[index8 - 1];
01186 const int top = h->intra4x4_pred_mode_cache[index8 - 8];
01187 const int min= FFMIN(left, top);
01188
01189 tprintf(h->s.avctx, "mode:%d %d min:%d\n", left ,top, min);
01190
01191 if(min<0) return DC_PRED;
01192 else return min;
01193 }
01194
01195 static inline void write_back_non_zero_count(H264Context *h){
01196 const int mb_xy= h->mb_xy;
01197
01198 AV_COPY64(&h->non_zero_count[mb_xy][ 0], &h->non_zero_count_cache[0+8*1]);
01199 AV_COPY64(&h->non_zero_count[mb_xy][ 8], &h->non_zero_count_cache[0+8*2]);
01200 AV_COPY32(&h->non_zero_count[mb_xy][16], &h->non_zero_count_cache[0+8*5]);
01201 AV_COPY32(&h->non_zero_count[mb_xy][20], &h->non_zero_count_cache[4+8*3]);
01202 AV_COPY64(&h->non_zero_count[mb_xy][24], &h->non_zero_count_cache[0+8*4]);
01203 }
01204
01205 static inline void write_back_motion(H264Context *h, int mb_type){
01206 MpegEncContext * const s = &h->s;
01207 const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
01208 const int b8_xy= 4*h->mb_xy;
01209 int list;
01210
01211 if(!USES_LIST(mb_type, 0))
01212 fill_rectangle(&s->current_picture.ref_index[0][b8_xy], 2, 2, 2, (uint8_t)LIST_NOT_USED, 1);
01213
01214 for(list=0; list<h->list_count; list++){
01215 int y, b_stride;
01216 int16_t (*mv_dst)[2];
01217 int16_t (*mv_src)[2];
01218
01219 if(!USES_LIST(mb_type, list))
01220 continue;
01221
01222 b_stride = h->b_stride;
01223 mv_dst = &s->current_picture.motion_val[list][b_xy];
01224 mv_src = &h->mv_cache[list][scan8[0]];
01225 for(y=0; y<4; y++){
01226 AV_COPY128(mv_dst + y*b_stride, mv_src + 8*y);
01227 }
01228 if( CABAC ) {
01229 uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? 8*h->mb_xy : h->mb2br_xy[h->mb_xy]];
01230 uint8_t (*mvd_src)[2] = &h->mvd_cache[list][scan8[0]];
01231 if(IS_SKIP(mb_type))
01232 AV_ZERO128(mvd_dst);
01233 else{
01234 AV_COPY64(mvd_dst, mvd_src + 8*3);
01235 AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8*0);
01236 AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8*1);
01237 AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8*2);
01238 }
01239 }
01240
01241 {
01242 int8_t *ref_index = &s->current_picture.ref_index[list][b8_xy];
01243 ref_index[0+0*2]= h->ref_cache[list][scan8[0]];
01244 ref_index[1+0*2]= h->ref_cache[list][scan8[4]];
01245 ref_index[0+1*2]= h->ref_cache[list][scan8[8]];
01246 ref_index[1+1*2]= h->ref_cache[list][scan8[12]];
01247 }
01248 }
01249
01250 if(h->slice_type_nos == FF_B_TYPE && CABAC){
01251 if(IS_8X8(mb_type)){
01252 uint8_t *direct_table = &h->direct_table[4*h->mb_xy];
01253 direct_table[1] = h->sub_mb_type[1]>>1;
01254 direct_table[2] = h->sub_mb_type[2]>>1;
01255 direct_table[3] = h->sub_mb_type[3]>>1;
01256 }
01257 }
01258 }
01259
01260 static inline int get_dct8x8_allowed(H264Context *h){
01261 if(h->sps.direct_8x8_inference_flag)
01262 return !(AV_RN64A(h->sub_mb_type) & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8 )*0x0001000100010001ULL));
01263 else
01264 return !(AV_RN64A(h->sub_mb_type) & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8|MB_TYPE_DIRECT2)*0x0001000100010001ULL));
01265 }
01266
01270 static void av_unused decode_mb_skip(H264Context *h){
01271 MpegEncContext * const s = &h->s;
01272 const int mb_xy= h->mb_xy;
01273 int mb_type=0;
01274
01275 memset(h->non_zero_count[mb_xy], 0, 32);
01276 memset(h->non_zero_count_cache + 8, 0, 8*5);
01277
01278 if(MB_FIELD)
01279 mb_type|= MB_TYPE_INTERLACED;
01280
01281 if( h->slice_type_nos == FF_B_TYPE )
01282 {
01283
01284 mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
01285 if(h->direct_spatial_mv_pred){
01286 fill_decode_neighbors(h, mb_type);
01287 fill_decode_caches(h, mb_type);
01288 }
01289 ff_h264_pred_direct_motion(h, &mb_type);
01290 mb_type|= MB_TYPE_SKIP;
01291 }
01292 else
01293 {
01294 int mx, my;
01295 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP;
01296
01297 fill_decode_neighbors(h, mb_type);
01298 fill_decode_caches(h, mb_type);
01299 pred_pskip_motion(h, &mx, &my);
01300 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1);
01301 fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4);
01302 }
01303
01304 write_back_motion(h, mb_type);
01305 s->current_picture.mb_type[mb_xy]= mb_type;
01306 s->current_picture.qscale_table[mb_xy]= s->qscale;
01307 h->slice_table[ mb_xy ]= h->slice_num;
01308 h->prev_mb_skipped= 1;
01309 }
01310
01311 #include "h264_mvpred.h"
01312
01313 #endif