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 uint8_t *list_counts;
00396 unsigned int ref_count[2];
00397 unsigned int list_count;
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 Picture *next_output_pic;
00508 int outputed_poc;
00509 int next_outputed_poc;
00510
00514 MMCO mmco[MAX_MMCO_COUNT];
00515 int mmco_index;
00516
00517 int long_ref_count;
00518 int short_ref_count;
00519
00520 int cabac_init_idc;
00521
00526 struct H264Context *thread_context[MAX_THREADS];
00527
00531 int current_slice;
00532
00539 int max_contexts;
00540
00545 int single_decode_warning;
00546
00547 int last_slice_type;
00553 SEI_PicStructType sei_pic_struct;
00554
00561 int prev_interlaced_frame;
00562
00568 int sei_ct_type;
00569
00573 int sei_dpb_output_delay;
00574
00578 int sei_cpb_removal_delay;
00579
00587 int sei_recovery_frame_cnt;
00588
00589 int luma_weight_flag[2];
00590 int chroma_weight_flag[2];
00591
00592
00593 int sei_buffering_period_present;
00594 int initial_cpb_removal_delay[32];
00595
00596
00597 int halfpel_flag;
00598 int thirdpel_flag;
00599 int unknown_svq3_flag;
00600 int next_slice_index;
00601 uint32_t svq3_watermark_key;
00602 }H264Context;
00603
00604
00605 extern const uint8_t ff_h264_chroma_qp[52];
00606
00610 int ff_h264_decode_sei(H264Context *h);
00611
00615 int ff_h264_decode_seq_parameter_set(H264Context *h);
00616
00620 int ff_h264_get_profile(SPS *sps);
00621
00625 int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length);
00626
00634 const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length);
00635
00639 av_cold void ff_h264_free_context(H264Context *h);
00640
00644 int ff_h264_get_slice_type(const H264Context *h);
00645
00650 int ff_h264_alloc_tables(H264Context *h);
00651
00655 int ff_h264_fill_default_ref_list(H264Context *h);
00656
00657 int ff_h264_decode_ref_pic_list_reordering(H264Context *h);
00658 void ff_h264_fill_mbaff_ref_list(H264Context *h);
00659 void ff_h264_remove_all_refs(H264Context *h);
00660
00664 int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count);
00665
00666 int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb);
00667
00668 void ff_generate_sliding_window_mmcos(H264Context *h);
00669
00670
00674 int ff_h264_check_intra4x4_pred_mode(H264Context *h);
00675
00679 int ff_h264_check_intra_pred_mode(H264Context *h, int mode);
00680
00681 void ff_h264_write_back_intra_pred_mode(H264Context *h);
00682 void ff_h264_hl_decode_mb(H264Context *h);
00683 int ff_h264_frame_start(H264Context *h);
00684 int ff_h264_decode_extradata(H264Context *h);
00685 av_cold int ff_h264_decode_init(AVCodecContext *avctx);
00686 av_cold int ff_h264_decode_end(AVCodecContext *avctx);
00687 av_cold void ff_h264_decode_init_vlc(void);
00688
00693 int ff_h264_decode_mb_cavlc(H264Context *h);
00694
00699 int ff_h264_decode_mb_cabac(H264Context *h);
00700
00701 void ff_h264_init_cabac_states(H264Context *h);
00702
00703 void ff_h264_direct_dist_scale_factor(H264Context * const h);
00704 void ff_h264_direct_ref_list_init(H264Context * const h);
00705 void ff_h264_pred_direct_motion(H264Context * const h, int *mb_type);
00706
00707 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);
00708 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);
00709
00715 void ff_h264_reset_sei(H264Context *h);
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740 static const uint8_t scan8[16 + 2*4 + 3]={
00741 4+1*8, 5+1*8, 4+2*8, 5+2*8,
00742 6+1*8, 7+1*8, 6+2*8, 7+2*8,
00743 4+3*8, 5+3*8, 4+4*8, 5+4*8,
00744 6+3*8, 7+3*8, 6+4*8, 7+4*8,
00745 1+1*8, 2+1*8,
00746 1+2*8, 2+2*8,
00747 1+4*8, 2+4*8,
00748 1+5*8, 2+5*8,
00749 4+5*8, 5+5*8, 6+5*8
00750 };
00751
00752 static av_always_inline uint32_t pack16to32(int a, int b){
00753 #if HAVE_BIGENDIAN
00754 return (b&0xFFFF) + (a<<16);
00755 #else
00756 return (a&0xFFFF) + (b<<16);
00757 #endif
00758 }
00759
00760 static av_always_inline uint16_t pack8to16(int a, int b){
00761 #if HAVE_BIGENDIAN
00762 return (b&0xFF) + (a<<8);
00763 #else
00764 return (a&0xFF) + (b<<8);
00765 #endif
00766 }
00767
00771 static inline int get_chroma_qp(H264Context *h, int t, int qscale){
00772 return h->pps.chroma_qp_table[t][qscale];
00773 }
00774
00775 static inline void pred_pskip_motion(H264Context * const h, int * const mx, int * const my);
00776
00777 static void fill_decode_neighbors(H264Context *h, int mb_type){
00778 MpegEncContext * const s = &h->s;
00779 const int mb_xy= h->mb_xy;
00780 int topleft_xy, top_xy, topright_xy, left_xy[2];
00781 static const uint8_t left_block_options[4][16]={
00782 {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},
00783 {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},
00784 {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},
00785 {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}
00786 };
00787
00788 h->topleft_partition= -1;
00789
00790 top_xy = mb_xy - (s->mb_stride << MB_FIELD);
00791
00792
00793
00794
00795 topleft_xy = top_xy - 1;
00796 topright_xy= top_xy + 1;
00797 left_xy[1] = left_xy[0] = mb_xy-1;
00798 h->left_block = left_block_options[0];
00799 if(FRAME_MBAFF){
00800 const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]);
00801 const int curr_mb_field_flag = IS_INTERLACED(mb_type);
00802 if(s->mb_y&1){
00803 if (left_mb_field_flag != curr_mb_field_flag) {
00804 left_xy[1] = left_xy[0] = mb_xy - s->mb_stride - 1;
00805 if (curr_mb_field_flag) {
00806 left_xy[1] += s->mb_stride;
00807 h->left_block = left_block_options[3];
00808 } else {
00809 topleft_xy += s->mb_stride;
00810
00811 h->topleft_partition = 0;
00812 h->left_block = left_block_options[1];
00813 }
00814 }
00815 }else{
00816 if(curr_mb_field_flag){
00817 topleft_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy - 1]>>7)&1)-1);
00818 topright_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy + 1]>>7)&1)-1);
00819 top_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy ]>>7)&1)-1);
00820 }
00821 if (left_mb_field_flag != curr_mb_field_flag) {
00822 if (curr_mb_field_flag) {
00823 left_xy[1] += s->mb_stride;
00824 h->left_block = left_block_options[3];
00825 } else {
00826 h->left_block = left_block_options[2];
00827 }
00828 }
00829 }
00830 }
00831
00832 h->topleft_mb_xy = topleft_xy;
00833 h->top_mb_xy = top_xy;
00834 h->topright_mb_xy= topright_xy;
00835 h->left_mb_xy[0] = left_xy[0];
00836 h->left_mb_xy[1] = left_xy[1];
00837
00838
00839 h->topleft_type = s->current_picture.mb_type[topleft_xy] ;
00840 h->top_type = s->current_picture.mb_type[top_xy] ;
00841 h->topright_type= s->current_picture.mb_type[topright_xy];
00842 h->left_type[0] = s->current_picture.mb_type[left_xy[0]] ;
00843 h->left_type[1] = s->current_picture.mb_type[left_xy[1]] ;
00844
00845 if(FMO){
00846 if(h->slice_table[topleft_xy ] != h->slice_num) h->topleft_type = 0;
00847 if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;
00848 if(h->slice_table[left_xy[0] ] != h->slice_num) h->left_type[0] = h->left_type[1] = 0;
00849 }else{
00850 if(h->slice_table[topleft_xy ] != h->slice_num){
00851 h->topleft_type = 0;
00852 if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;
00853 if(h->slice_table[left_xy[0] ] != h->slice_num) h->left_type[0] = h->left_type[1] = 0;
00854 }
00855 }
00856 if(h->slice_table[topright_xy] != h->slice_num) h->topright_type= 0;
00857 }
00858
00859 static void fill_decode_caches(H264Context *h, int mb_type){
00860 MpegEncContext * const s = &h->s;
00861 int topleft_xy, top_xy, topright_xy, left_xy[2];
00862 int topleft_type, top_type, topright_type, left_type[2];
00863 const uint8_t * left_block= h->left_block;
00864 int i;
00865
00866 topleft_xy = h->topleft_mb_xy ;
00867 top_xy = h->top_mb_xy ;
00868 topright_xy = h->topright_mb_xy;
00869 left_xy[0] = h->left_mb_xy[0] ;
00870 left_xy[1] = h->left_mb_xy[1] ;
00871 topleft_type = h->topleft_type ;
00872 top_type = h->top_type ;
00873 topright_type= h->topright_type ;
00874 left_type[0] = h->left_type[0] ;
00875 left_type[1] = h->left_type[1] ;
00876
00877 if(!IS_SKIP(mb_type)){
00878 if(IS_INTRA(mb_type)){
00879 int type_mask= h->pps.constrained_intra_pred ? IS_INTRA(-1) : -1;
00880 h->topleft_samples_available=
00881 h->top_samples_available=
00882 h->left_samples_available= 0xFFFF;
00883 h->topright_samples_available= 0xEEEA;
00884
00885 if(!(top_type & type_mask)){
00886 h->topleft_samples_available= 0xB3FF;
00887 h->top_samples_available= 0x33FF;
00888 h->topright_samples_available= 0x26EA;
00889 }
00890 if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[0])){
00891 if(IS_INTERLACED(mb_type)){
00892 if(!(left_type[0] & type_mask)){
00893 h->topleft_samples_available&= 0xDFFF;
00894 h->left_samples_available&= 0x5FFF;
00895 }
00896 if(!(left_type[1] & type_mask)){
00897 h->topleft_samples_available&= 0xFF5F;
00898 h->left_samples_available&= 0xFF5F;
00899 }
00900 }else{
00901 int left_typei = s->current_picture.mb_type[left_xy[0] + s->mb_stride];
00902
00903 assert(left_xy[0] == left_xy[1]);
00904 if(!((left_typei & type_mask) && (left_type[0] & type_mask))){
00905 h->topleft_samples_available&= 0xDF5F;
00906 h->left_samples_available&= 0x5F5F;
00907 }
00908 }
00909 }else{
00910 if(!(left_type[0] & type_mask)){
00911 h->topleft_samples_available&= 0xDF5F;
00912 h->left_samples_available&= 0x5F5F;
00913 }
00914 }
00915
00916 if(!(topleft_type & type_mask))
00917 h->topleft_samples_available&= 0x7FFF;
00918
00919 if(!(topright_type & type_mask))
00920 h->topright_samples_available&= 0xFBFF;
00921
00922 if(IS_INTRA4x4(mb_type)){
00923 if(IS_INTRA4x4(top_type)){
00924 AV_COPY32(h->intra4x4_pred_mode_cache+4+8*0, h->intra4x4_pred_mode + h->mb2br_xy[top_xy]);
00925 }else{
00926 h->intra4x4_pred_mode_cache[4+8*0]=
00927 h->intra4x4_pred_mode_cache[5+8*0]=
00928 h->intra4x4_pred_mode_cache[6+8*0]=
00929 h->intra4x4_pred_mode_cache[7+8*0]= 2 - 3*!(top_type & type_mask);
00930 }
00931 for(i=0; i<2; i++){
00932 if(IS_INTRA4x4(left_type[i])){
00933 int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]];
00934 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= mode[6-left_block[0+2*i]];
00935 h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= mode[6-left_block[1+2*i]];
00936 }else{
00937 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]=
00938 h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= 2 - 3*!(left_type[i] & type_mask);
00939 }
00940 }
00941 }
00942 }
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954 if(top_type){
00955 AV_COPY32(&h->non_zero_count_cache[4+8*0], &h->non_zero_count[top_xy][4+3*8]);
00956 h->non_zero_count_cache[1+8*0]= h->non_zero_count[top_xy][1+1*8];
00957 h->non_zero_count_cache[2+8*0]= h->non_zero_count[top_xy][2+1*8];
00958
00959 h->non_zero_count_cache[1+8*3]= h->non_zero_count[top_xy][1+2*8];
00960 h->non_zero_count_cache[2+8*3]= h->non_zero_count[top_xy][2+2*8];
00961 }else {
00962 h->non_zero_count_cache[1+8*0]=
00963 h->non_zero_count_cache[2+8*0]=
00964
00965 h->non_zero_count_cache[1+8*3]=
00966 h->non_zero_count_cache[2+8*3]=
00967 AV_WN32A(&h->non_zero_count_cache[4+8*0], CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040);
00968 }
00969
00970 for (i=0; i<2; i++) {
00971 if(left_type[i]){
00972 h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]];
00973 h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]];
00974 h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+4+2*i]];
00975 h->non_zero_count_cache[0+8*4 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+5+2*i]];
00976 }else{
00977 h->non_zero_count_cache[3+8*1 + 2*8*i]=
00978 h->non_zero_count_cache[3+8*2 + 2*8*i]=
00979 h->non_zero_count_cache[0+8*1 + 8*i]=
00980 h->non_zero_count_cache[0+8*4 + 8*i]= CABAC && !IS_INTRA(mb_type) ? 0 : 64;
00981 }
00982 }
00983
00984 if( CABAC ) {
00985
00986 if(top_type) {
00987 h->top_cbp = h->cbp_table[top_xy];
00988 } else {
00989 h->top_cbp = IS_INTRA(mb_type) ? 0x1CF : 0x00F;
00990 }
00991
00992 if (left_type[0]) {
00993 h->left_cbp = (h->cbp_table[left_xy[0]] & 0x1f0)
00994 | ((h->cbp_table[left_xy[0]]>>(left_block[0]&(~1)))&2)
00995 | (((h->cbp_table[left_xy[1]]>>(left_block[2]&(~1)))&2) << 2);
00996 } else {
00997 h->left_cbp = IS_INTRA(mb_type) ? 0x1CF : 0x00F;
00998 }
00999 }
01000 }
01001
01002 #if 1
01003 if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){
01004 int list;
01005 for(list=0; list<h->list_count; list++){
01006 if(!USES_LIST(mb_type, list)){
01007
01008
01009
01010
01011
01012 continue;
01013 }
01014 assert(!(IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred));
01015
01016 h->mv_cache_clean[list]= 0;
01017
01018 if(USES_LIST(top_type, list)){
01019 const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride;
01020 AV_COPY128(h->mv_cache[list][scan8[0] + 0 - 1*8], s->current_picture.motion_val[list][b_xy + 0]);
01021 h->ref_cache[list][scan8[0] + 0 - 1*8]=
01022 h->ref_cache[list][scan8[0] + 1 - 1*8]= s->current_picture.ref_index[list][4*top_xy + 2];
01023 h->ref_cache[list][scan8[0] + 2 - 1*8]=
01024 h->ref_cache[list][scan8[0] + 3 - 1*8]= s->current_picture.ref_index[list][4*top_xy + 3];
01025 }else{
01026 AV_ZERO128(h->mv_cache[list][scan8[0] + 0 - 1*8]);
01027 AV_WN32A(&h->ref_cache[list][scan8[0] + 0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101);
01028 }
01029
01030 if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){
01031 for(i=0; i<2; i++){
01032 int cache_idx = scan8[0] - 1 + i*2*8;
01033 if(USES_LIST(left_type[i], list)){
01034 const int b_xy= h->mb2b_xy[left_xy[i]] + 3;
01035 const int b8_xy= 4*left_xy[i] + 1;
01036 AV_COPY32(h->mv_cache[list][cache_idx ], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0+i*2]]);
01037 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]]);
01038 h->ref_cache[list][cache_idx ]= s->current_picture.ref_index[list][b8_xy + (left_block[0+i*2]&~1)];
01039 h->ref_cache[list][cache_idx+8]= s->current_picture.ref_index[list][b8_xy + (left_block[1+i*2]&~1)];
01040 }else{
01041 AV_ZERO32(h->mv_cache [list][cache_idx ]);
01042 AV_ZERO32(h->mv_cache [list][cache_idx+8]);
01043 h->ref_cache[list][cache_idx ]=
01044 h->ref_cache[list][cache_idx+8]= (left_type[i]) ? LIST_NOT_USED : PART_NOT_AVAILABLE;
01045 }
01046 }
01047 }else{
01048 if(USES_LIST(left_type[0], list)){
01049 const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
01050 const int b8_xy= 4*left_xy[0] + 1;
01051 AV_COPY32(h->mv_cache[list][scan8[0] - 1], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0]]);
01052 h->ref_cache[list][scan8[0] - 1]= s->current_picture.ref_index[list][b8_xy + (left_block[0]&~1)];
01053 }else{
01054 AV_ZERO32(h->mv_cache [list][scan8[0] - 1]);
01055 h->ref_cache[list][scan8[0] - 1]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
01056 }
01057 }
01058
01059 if(USES_LIST(topright_type, list)){
01060 const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;
01061 AV_COPY32(h->mv_cache[list][scan8[0] + 4 - 1*8], s->current_picture.motion_val[list][b_xy]);
01062 h->ref_cache[list][scan8[0] + 4 - 1*8]= s->current_picture.ref_index[list][4*topright_xy + 2];
01063 }else{
01064 AV_ZERO32(h->mv_cache [list][scan8[0] + 4 - 1*8]);
01065 h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
01066 }
01067 if(h->ref_cache[list][scan8[0] + 4 - 1*8] < 0){
01068 if(USES_LIST(topleft_type, list)){
01069 const int b_xy = h->mb2b_xy [topleft_xy] + 3 + h->b_stride + (h->topleft_partition & 2*h->b_stride);
01070 const int b8_xy= 4*topleft_xy + 1 + (h->topleft_partition & 2);
01071 AV_COPY32(h->mv_cache[list][scan8[0] - 1 - 1*8], s->current_picture.motion_val[list][b_xy]);
01072 h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy];
01073 }else{
01074 AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]);
01075 h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
01076 }
01077 }
01078
01079 if((mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2)) && !FRAME_MBAFF)
01080 continue;
01081
01082 if(!(mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2))) {
01083 h->ref_cache[list][scan8[4 ]] =
01084 h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE;
01085 AV_ZERO32(h->mv_cache [list][scan8[4 ]]);
01086 AV_ZERO32(h->mv_cache [list][scan8[12]]);
01087
01088 if( CABAC ) {
01089
01090 if(USES_LIST(top_type, list)){
01091 const int b_xy= h->mb2br_xy[top_xy];
01092 AV_COPY64(h->mvd_cache[list][scan8[0] + 0 - 1*8], h->mvd_table[list][b_xy + 0]);
01093 }else{
01094 AV_ZERO64(h->mvd_cache[list][scan8[0] + 0 - 1*8]);
01095 }
01096 if(USES_LIST(left_type[0], list)){
01097 const int b_xy= h->mb2br_xy[left_xy[0]] + 6;
01098 AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 0*8], h->mvd_table[list][b_xy - left_block[0]]);
01099 AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 1*8], h->mvd_table[list][b_xy - left_block[1]]);
01100 }else{
01101 AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 0*8]);
01102 AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 1*8]);
01103 }
01104 if(USES_LIST(left_type[1], list)){
01105 const int b_xy= h->mb2br_xy[left_xy[1]] + 6;
01106 AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 2*8], h->mvd_table[list][b_xy - left_block[2]]);
01107 AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 3*8], h->mvd_table[list][b_xy - left_block[3]]);
01108 }else{
01109 AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 2*8]);
01110 AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 3*8]);
01111 }
01112 AV_ZERO16(h->mvd_cache [list][scan8[4 ]]);
01113 AV_ZERO16(h->mvd_cache [list][scan8[12]]);
01114 if(h->slice_type_nos == FF_B_TYPE){
01115 fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1);
01116
01117 if(IS_DIRECT(top_type)){
01118 AV_WN32A(&h->direct_cache[scan8[0] - 1*8], 0x01010101u*(MB_TYPE_DIRECT2>>1));
01119 }else if(IS_8X8(top_type)){
01120 int b8_xy = 4*top_xy;
01121 h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy + 2];
01122 h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 3];
01123 }else{
01124 AV_WN32A(&h->direct_cache[scan8[0] - 1*8], 0x01010101*(MB_TYPE_16x16>>1));
01125 }
01126
01127 if(IS_DIRECT(left_type[0]))
01128 h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_DIRECT2>>1;
01129 else if(IS_8X8(left_type[0]))
01130 h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[4*left_xy[0] + 1 + (left_block[0]&~1)];
01131 else
01132 h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_16x16>>1;
01133
01134 if(IS_DIRECT(left_type[1]))
01135 h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_DIRECT2>>1;
01136 else if(IS_8X8(left_type[1]))
01137 h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[4*left_xy[1] + 1 + (left_block[2]&~1)];
01138 else
01139 h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_16x16>>1;
01140 }
01141 }
01142 }
01143 if(FRAME_MBAFF){
01144 #define MAP_MVS\
01145 MAP_F2F(scan8[0] - 1 - 1*8, topleft_type)\
01146 MAP_F2F(scan8[0] + 0 - 1*8, top_type)\
01147 MAP_F2F(scan8[0] + 1 - 1*8, top_type)\
01148 MAP_F2F(scan8[0] + 2 - 1*8, top_type)\
01149 MAP_F2F(scan8[0] + 3 - 1*8, top_type)\
01150 MAP_F2F(scan8[0] + 4 - 1*8, topright_type)\
01151 MAP_F2F(scan8[0] - 1 + 0*8, left_type[0])\
01152 MAP_F2F(scan8[0] - 1 + 1*8, left_type[0])\
01153 MAP_F2F(scan8[0] - 1 + 2*8, left_type[1])\
01154 MAP_F2F(scan8[0] - 1 + 3*8, left_type[1])
01155 if(MB_FIELD){
01156 #define MAP_F2F(idx, mb_type)\
01157 if(!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\
01158 h->ref_cache[list][idx] <<= 1;\
01159 h->mv_cache[list][idx][1] /= 2;\
01160 h->mvd_cache[list][idx][1] >>=1;\
01161 }
01162 MAP_MVS
01163 #undef MAP_F2F
01164 }else{
01165 #define MAP_F2F(idx, mb_type)\
01166 if(IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\
01167 h->ref_cache[list][idx] >>= 1;\
01168 h->mv_cache[list][idx][1] <<= 1;\
01169 h->mvd_cache[list][idx][1] <<= 1;\
01170 }
01171 MAP_MVS
01172 #undef MAP_F2F
01173 }
01174 }
01175 }
01176 }
01177 #endif
01178
01179 h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]);
01180 }
01181
01185 static inline int pred_intra_mode(H264Context *h, int n){
01186 const int index8= scan8[n];
01187 const int left= h->intra4x4_pred_mode_cache[index8 - 1];
01188 const int top = h->intra4x4_pred_mode_cache[index8 - 8];
01189 const int min= FFMIN(left, top);
01190
01191 tprintf(h->s.avctx, "mode:%d %d min:%d\n", left ,top, min);
01192
01193 if(min<0) return DC_PRED;
01194 else return min;
01195 }
01196
01197 static inline void write_back_non_zero_count(H264Context *h){
01198 const int mb_xy= h->mb_xy;
01199
01200 AV_COPY64(&h->non_zero_count[mb_xy][ 0], &h->non_zero_count_cache[0+8*1]);
01201 AV_COPY64(&h->non_zero_count[mb_xy][ 8], &h->non_zero_count_cache[0+8*2]);
01202 AV_COPY32(&h->non_zero_count[mb_xy][16], &h->non_zero_count_cache[0+8*5]);
01203 AV_COPY32(&h->non_zero_count[mb_xy][20], &h->non_zero_count_cache[4+8*3]);
01204 AV_COPY64(&h->non_zero_count[mb_xy][24], &h->non_zero_count_cache[0+8*4]);
01205 }
01206
01207 static inline void write_back_motion(H264Context *h, int mb_type){
01208 MpegEncContext * const s = &h->s;
01209 const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
01210 const int b8_xy= 4*h->mb_xy;
01211 int list;
01212
01213 if(!USES_LIST(mb_type, 0))
01214 fill_rectangle(&s->current_picture.ref_index[0][b8_xy], 2, 2, 2, (uint8_t)LIST_NOT_USED, 1);
01215
01216 for(list=0; list<h->list_count; list++){
01217 int y, b_stride;
01218 int16_t (*mv_dst)[2];
01219 int16_t (*mv_src)[2];
01220
01221 if(!USES_LIST(mb_type, list))
01222 continue;
01223
01224 b_stride = h->b_stride;
01225 mv_dst = &s->current_picture.motion_val[list][b_xy];
01226 mv_src = &h->mv_cache[list][scan8[0]];
01227 for(y=0; y<4; y++){
01228 AV_COPY128(mv_dst + y*b_stride, mv_src + 8*y);
01229 }
01230 if( CABAC ) {
01231 uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? 8*h->mb_xy : h->mb2br_xy[h->mb_xy]];
01232 uint8_t (*mvd_src)[2] = &h->mvd_cache[list][scan8[0]];
01233 if(IS_SKIP(mb_type))
01234 AV_ZERO128(mvd_dst);
01235 else{
01236 AV_COPY64(mvd_dst, mvd_src + 8*3);
01237 AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8*0);
01238 AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8*1);
01239 AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8*2);
01240 }
01241 }
01242
01243 {
01244 int8_t *ref_index = &s->current_picture.ref_index[list][b8_xy];
01245 ref_index[0+0*2]= h->ref_cache[list][scan8[0]];
01246 ref_index[1+0*2]= h->ref_cache[list][scan8[4]];
01247 ref_index[0+1*2]= h->ref_cache[list][scan8[8]];
01248 ref_index[1+1*2]= h->ref_cache[list][scan8[12]];
01249 }
01250 }
01251
01252 if(h->slice_type_nos == FF_B_TYPE && CABAC){
01253 if(IS_8X8(mb_type)){
01254 uint8_t *direct_table = &h->direct_table[4*h->mb_xy];
01255 direct_table[1] = h->sub_mb_type[1]>>1;
01256 direct_table[2] = h->sub_mb_type[2]>>1;
01257 direct_table[3] = h->sub_mb_type[3]>>1;
01258 }
01259 }
01260 }
01261
01262 static inline int get_dct8x8_allowed(H264Context *h){
01263 if(h->sps.direct_8x8_inference_flag)
01264 return !(AV_RN64A(h->sub_mb_type) & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8 )*0x0001000100010001ULL));
01265 else
01266 return !(AV_RN64A(h->sub_mb_type) & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8|MB_TYPE_DIRECT2)*0x0001000100010001ULL));
01267 }
01268
01272 static void av_unused decode_mb_skip(H264Context *h){
01273 MpegEncContext * const s = &h->s;
01274 const int mb_xy= h->mb_xy;
01275 int mb_type=0;
01276
01277 memset(h->non_zero_count[mb_xy], 0, 32);
01278 memset(h->non_zero_count_cache + 8, 0, 8*5);
01279
01280 if(MB_FIELD)
01281 mb_type|= MB_TYPE_INTERLACED;
01282
01283 if( h->slice_type_nos == FF_B_TYPE )
01284 {
01285
01286 mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
01287 if(h->direct_spatial_mv_pred){
01288 fill_decode_neighbors(h, mb_type);
01289 fill_decode_caches(h, mb_type);
01290 }
01291 ff_h264_pred_direct_motion(h, &mb_type);
01292 mb_type|= MB_TYPE_SKIP;
01293 }
01294 else
01295 {
01296 int mx, my;
01297 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP;
01298
01299 fill_decode_neighbors(h, mb_type);
01300 fill_decode_caches(h, mb_type);
01301 pred_pskip_motion(h, &mx, &my);
01302 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1);
01303 fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4);
01304 }
01305
01306 write_back_motion(h, mb_type);
01307 s->current_picture.mb_type[mb_xy]= mb_type;
01308 s->current_picture.qscale_table[mb_xy]= s->qscale;
01309 h->slice_table[ mb_xy ]= h->slice_num;
01310 h->prev_mb_skipped= 1;
01311 }
01312
01313 #include "h264_mvpred.h"
01314
01315 #endif