comparison h264.h @ 10912:9bdf0bb607a3 libavcodec

Make qp check for loop filter skiping also work with MBAFF.
author michael
date Mon, 18 Jan 2010 00:34:28 +0000
parents 3082525ea11d
children 497929e9d912
comparison
equal deleted inserted replaced
10911:3082525ea11d 10912:9bdf0bb607a3
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 798
799 //for sufficiently low qp, filtering wouldn't do anything 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 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; //FIXME strictly we should store qp_thresh for each mb of a slice 801 int qp_thresh = h->qp_thresh; //FIXME strictly we should store qp_thresh for each mb of a slice
803 int qp = s->current_picture.qscale_table[mb_xy]; 802 int qp = s->current_picture.qscale_table[mb_xy];
804 if(qp <= qp_thresh 803 if(qp <= qp_thresh
805 && (s->mb_x == 0 || ((qp + s->current_picture.qscale_table[mb_xy-1] + 1)>>1) <= qp_thresh) 804 && (left_xy[0]<0 || ((qp + s->current_picture.qscale_table[left_xy[0]] + 1)>>1) <= qp_thresh)
805 && (left_xy[1]<0 || ((qp + s->current_picture.qscale_table[left_xy[1]] + 1)>>1) <= qp_thresh)
806 && (top_xy < 0 || ((qp + s->current_picture.qscale_table[top_xy ] + 1)>>1) <= qp_thresh)){ 806 && (top_xy < 0 || ((qp + s->current_picture.qscale_table[top_xy ] + 1)>>1) <= qp_thresh)){
807 return 1; 807 return 1;
808 } 808 }
809 }
810 809
811 *((uint64_t*)&h->non_zero_count_cache[0+8*1])= *((uint64_t*)&h->non_zero_count[mb_xy][ 0]); 810 *((uint64_t*)&h->non_zero_count_cache[0+8*1])= *((uint64_t*)&h->non_zero_count[mb_xy][ 0]);
812 *((uint64_t*)&h->non_zero_count_cache[0+8*2])= *((uint64_t*)&h->non_zero_count[mb_xy][ 8]); 811 *((uint64_t*)&h->non_zero_count_cache[0+8*2])= *((uint64_t*)&h->non_zero_count[mb_xy][ 8]);
813 *((uint32_t*)&h->non_zero_count_cache[0+8*5])= *((uint32_t*)&h->non_zero_count[mb_xy][16]); 812 *((uint32_t*)&h->non_zero_count_cache[0+8*5])= *((uint32_t*)&h->non_zero_count[mb_xy][16]);
814 *((uint32_t*)&h->non_zero_count_cache[4+8*3])= *((uint32_t*)&h->non_zero_count[mb_xy][20]); 813 *((uint32_t*)&h->non_zero_count_cache[4+8*3])= *((uint32_t*)&h->non_zero_count[mb_xy][20]);