Mercurial > libavcodec.hg
comparison h264.h @ 10910:7cecaa3a6b38 libavcodec
Move the qp check to skip the loop filter up.
author | michael |
---|---|
date | Mon, 18 Jan 2010 00:20:44 +0000 |
parents | f4cf3960b8c6 |
children | 3082525ea11d |
comparison
equal
deleted
inserted
replaced
10909:f4cf3960b8c6 | 10910:7cecaa3a6b38 |
---|---|
724 return h->pps.chroma_qp_table[t][qscale]; | 724 return h->pps.chroma_qp_table[t][qscale]; |
725 } | 725 } |
726 | 726 |
727 static inline void pred_pskip_motion(H264Context * const h, int * const mx, int * const my); | 727 static inline void pred_pskip_motion(H264Context * const h, int * const mx, int * const my); |
728 | 728 |
729 static av_always_inline void fill_caches(H264Context *h, int mb_type, int for_deblock){ | 729 static av_always_inline int fill_caches(H264Context *h, int mb_type, int for_deblock){ |
730 MpegEncContext * const s = &h->s; | 730 MpegEncContext * const s = &h->s; |
731 const int mb_xy= h->mb_xy; | 731 const int mb_xy= h->mb_xy; |
732 int topleft_xy, top_xy, topright_xy, left_xy[2]; | 732 int topleft_xy, top_xy, topright_xy, left_xy[2]; |
733 int topleft_type, top_type, topright_type, left_type[2]; | 733 int topleft_type, top_type, topright_type, left_type[2]; |
734 const uint8_t * left_block; | 734 const uint8_t * left_block; |
793 | 793 |
794 h->top_mb_xy = top_xy; | 794 h->top_mb_xy = top_xy; |
795 h->left_mb_xy[0] = left_xy[0]; | 795 h->left_mb_xy[0] = left_xy[0]; |
796 h->left_mb_xy[1] = left_xy[1]; | 796 h->left_mb_xy[1] = left_xy[1]; |
797 if(for_deblock){ | 797 if(for_deblock){ |
798 | |
799 //for sufficiently low qp, filtering wouldn't do anything | |
800 //this is a conservative estimate: could also check beta_offset and more accurate chroma_qp | |
801 if(!FRAME_MBAFF){ | |
802 int qp_thresh = h->qp_thresh; | |
803 int qp = s->current_picture.qscale_table[mb_xy]; | |
804 if(qp <= qp_thresh | |
805 && (s->mb_x == 0 || ((qp + s->current_picture.qscale_table[mb_xy-1] + 1)>>1) <= qp_thresh) | |
806 && (top_xy < 0 || ((qp + s->current_picture.qscale_table[top_xy ] + 1)>>1) <= qp_thresh)){ | |
807 return 1; | |
808 } | |
809 } | |
810 | |
798 *((uint64_t*)&h->non_zero_count_cache[0+8*1])= *((uint64_t*)&h->non_zero_count[mb_xy][ 0]); | 811 *((uint64_t*)&h->non_zero_count_cache[0+8*1])= *((uint64_t*)&h->non_zero_count[mb_xy][ 0]); |
799 *((uint64_t*)&h->non_zero_count_cache[0+8*2])= *((uint64_t*)&h->non_zero_count[mb_xy][ 8]); | 812 *((uint64_t*)&h->non_zero_count_cache[0+8*2])= *((uint64_t*)&h->non_zero_count[mb_xy][ 8]); |
800 *((uint32_t*)&h->non_zero_count_cache[0+8*5])= *((uint32_t*)&h->non_zero_count[mb_xy][16]); | 813 *((uint32_t*)&h->non_zero_count_cache[0+8*5])= *((uint32_t*)&h->non_zero_count[mb_xy][16]); |
801 *((uint32_t*)&h->non_zero_count_cache[4+8*3])= *((uint32_t*)&h->non_zero_count[mb_xy][20]); | 814 *((uint32_t*)&h->non_zero_count_cache[4+8*3])= *((uint32_t*)&h->non_zero_count[mb_xy][20]); |
802 *((uint64_t*)&h->non_zero_count_cache[0+8*4])= *((uint64_t*)&h->non_zero_count[mb_xy][24]); | 815 *((uint64_t*)&h->non_zero_count_cache[0+8*4])= *((uint64_t*)&h->non_zero_count[mb_xy][24]); |
1184 } | 1197 } |
1185 #endif | 1198 #endif |
1186 | 1199 |
1187 if(!for_deblock) | 1200 if(!for_deblock) |
1188 h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]); | 1201 h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]); |
1202 return 0; | |
1189 } | 1203 } |
1190 | 1204 |
1191 static void fill_decode_caches(H264Context *h, int mb_type){ | 1205 static void fill_decode_caches(H264Context *h, int mb_type){ |
1192 fill_caches(h, mb_type, 0); | 1206 fill_caches(h, mb_type, 0); |
1193 } | 1207 } |
1194 | 1208 |
1195 static void fill_filter_caches(H264Context *h, int mb_type){ | 1209 /** |
1196 fill_caches(h, mb_type, 1); | 1210 * |
1211 * @returns non zero if the loop filter can be skiped | |
1212 */ | |
1213 static int fill_filter_caches(H264Context *h, int mb_type){ | |
1214 return fill_caches(h, mb_type, 1); | |
1197 } | 1215 } |
1198 | 1216 |
1199 /** | 1217 /** |
1200 * gets the predicted intra4x4 prediction mode. | 1218 * gets the predicted intra4x4 prediction mode. |
1201 */ | 1219 */ |