comparison h264.h @ 10907:2d82b73b12ef libavcodec

Split fill_caches() between filter and decoder.
author michael
date Sun, 17 Jan 2010 21:43:08 +0000
parents 1b5fba731e24
children 28840dfd4b52
comparison
equal deleted inserted replaced
10906:1b5fba731e24 10907:2d82b73b12ef
717 return h->pps.chroma_qp_table[t][qscale]; 717 return h->pps.chroma_qp_table[t][qscale];
718 } 718 }
719 719
720 static inline void pred_pskip_motion(H264Context * const h, int * const mx, int * const my); 720 static inline void pred_pskip_motion(H264Context * const h, int * const mx, int * const my);
721 721
722 static void fill_caches(H264Context *h, int mb_type, int for_deblock){ 722 static av_always_inline void fill_caches(H264Context *h, int mb_type, int for_deblock){
723 MpegEncContext * const s = &h->s; 723 MpegEncContext * const s = &h->s;
724 const int mb_xy= h->mb_xy; 724 const int mb_xy= h->mb_xy;
725 int topleft_xy, top_xy, topright_xy, left_xy[2]; 725 int topleft_xy, top_xy, topright_xy, left_xy[2];
726 int topleft_type, top_type, topright_type, left_type[2]; 726 int topleft_type, top_type, topright_type, left_type[2];
727 const uint8_t * left_block; 727 const uint8_t * left_block;
1175 #endif 1175 #endif
1176 1176
1177 h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]); 1177 h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]);
1178 } 1178 }
1179 1179
1180 static void fill_decode_caches(H264Context *h, int mb_type){
1181 fill_caches(h, mb_type, 0);
1182 }
1183
1184 static void fill_filter_caches(H264Context *h, int mb_type){
1185 fill_caches(h, mb_type, 1);
1186 }
1187
1180 /** 1188 /**
1181 * gets the predicted intra4x4 prediction mode. 1189 * gets the predicted intra4x4 prediction mode.
1182 */ 1190 */
1183 static inline int pred_intra_mode(H264Context *h, int n){ 1191 static inline int pred_intra_mode(H264Context *h, int n){
1184 const int index8= scan8[n]; 1192 const int index8= scan8[n];
1311 if( h->slice_type_nos == FF_B_TYPE ) 1319 if( h->slice_type_nos == FF_B_TYPE )
1312 { 1320 {
1313 // just for fill_caches. pred_direct_motion will set the real mb_type 1321 // just for fill_caches. pred_direct_motion will set the real mb_type
1314 mb_type|= MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP; 1322 mb_type|= MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
1315 1323
1316 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ... 1324 fill_decode_caches(h, mb_type); //FIXME check what is needed and what not ...
1317 ff_h264_pred_direct_motion(h, &mb_type); 1325 ff_h264_pred_direct_motion(h, &mb_type);
1318 mb_type|= MB_TYPE_SKIP; 1326 mb_type|= MB_TYPE_SKIP;
1319 } 1327 }
1320 else 1328 else
1321 { 1329 {
1322 int mx, my; 1330 int mx, my;
1323 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP; 1331 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP;
1324 1332
1325 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ... 1333 fill_decode_caches(h, mb_type); //FIXME check what is needed and what not ...
1326 pred_pskip_motion(h, &mx, &my); 1334 pred_pskip_motion(h, &mx, &my);
1327 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1); 1335 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1);
1328 fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4); 1336 fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4);
1329 } 1337 }
1330 1338