comparison h264.c @ 5883:c64d94561b19 libavcodec

Fix deblocking filter for field pictures by properly looking for first row in bottom fields and preventing the use of "fast" deblocking for such.
author heydowns
date Wed, 07 Nov 2007 23:35:48 +0000
parents 6c962a4004a1
children 4d8ecacecccb
comparison
equal deleted inserted replaced
5882:51fc10d9fdff 5883:c64d94561b19
6369 } 6369 }
6370 } 6370 }
6371 6371
6372 static void 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) { 6372 static void 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) {
6373 MpegEncContext * const s = &h->s; 6373 MpegEncContext * const s = &h->s;
6374 int mb_y_firstrow = s->picture_structure == PICT_BOTTOM_FIELD;
6374 int mb_xy, mb_type; 6375 int mb_xy, mb_type;
6375 int qp, qp0, qp1, qpc, qpc0, qpc1, qp_thresh; 6376 int qp, qp0, qp1, qpc, qpc0, qpc1, qp_thresh;
6376 6377
6377 mb_xy = mb_x + mb_y*s->mb_stride; 6378 mb_xy = mb_x + mb_y*s->mb_stride;
6378 6379
6379 if(mb_x==0 || mb_y==0 || !s->dsp.h264_loop_filter_strength || h->pps.chroma_qp_diff || 6380 if(mb_x==0 || mb_y==mb_y_firstrow || !s->dsp.h264_loop_filter_strength || h->pps.chroma_qp_diff ||
6380 (h->deblocking_filter == 2 && (h->slice_table[mb_xy] != h->slice_table[h->top_mb_xy] || 6381 (h->deblocking_filter == 2 && (h->slice_table[mb_xy] != h->slice_table[h->top_mb_xy] ||
6381 h->slice_table[mb_xy] != h->slice_table[mb_xy - 1]))) { 6382 h->slice_table[mb_xy] != h->slice_table[mb_xy - 1]))) {
6382 filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize); 6383 filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);
6383 return; 6384 return;
6384 } 6385 }