comparison h264.c @ 5815:fb293531e983 libavcodec

Simplify tests for field macroblocks patch by Jeff Downs, heydowns a borg d com
author andoma
date Sat, 13 Oct 2007 05:50:11 +0000
parents 05e66f9c15bb
children b49be74d387c
comparison
equal deleted inserted replaced
5814:14a9ceb162d2 5815:fb293531e983
1701 int extra_height= h->emu_edge_height; 1701 int extra_height= h->emu_edge_height;
1702 int emu=0; 1702 int emu=0;
1703 const int full_mx= mx>>2; 1703 const int full_mx= mx>>2;
1704 const int full_my= my>>2; 1704 const int full_my= my>>2;
1705 const int pic_width = 16*s->mb_width; 1705 const int pic_width = 16*s->mb_width;
1706 const int pic_height = 16*s->mb_height >> (MB_MBAFF || FIELD_PICTURE); 1706 const int pic_height = 16*s->mb_height >> MB_FIELD;
1707 1707
1708 if(!pic->data[0]) //FIXME this is unacceptable, some senseable error concealment must be done for missing reference frames 1708 if(!pic->data[0]) //FIXME this is unacceptable, some senseable error concealment must be done for missing reference frames
1709 return; 1709 return;
1710 1710
1711 if(mx&7) extra_width -= 3; 1711 if(mx&7) extra_width -= 3;
1725 qpix_op[luma_xy](dest_y + delta, src_y + delta, h->mb_linesize); 1725 qpix_op[luma_xy](dest_y + delta, src_y + delta, h->mb_linesize);
1726 } 1726 }
1727 1727
1728 if(ENABLE_GRAY && s->flags&CODEC_FLAG_GRAY) return; 1728 if(ENABLE_GRAY && s->flags&CODEC_FLAG_GRAY) return;
1729 1729
1730 if(MB_MBAFF || FIELD_PICTURE){ 1730 if(MB_FIELD){
1731 // chroma offset when predicting from a field of opposite parity 1731 // chroma offset when predicting from a field of opposite parity
1732 my += 2 * ((s->mb_y & 1) - (h->ref_cache[list][scan8[n]] & 1)); 1732 my += 2 * ((s->mb_y & 1) - (h->ref_cache[list][scan8[n]] & 1));
1733 emu |= (my>>3) < 0 || (my>>3) + 8 >= (pic_height>>1); 1733 emu |= (my>>3) < 0 || (my>>3) + 8 >= (pic_height>>1);
1734 } 1734 }
1735 src_cb= pic->data[1] + (mx>>3) + (my>>3)*h->mb_uvlinesize; 1735 src_cb= pic->data[1] + (mx>>3) + (my>>3)*h->mb_uvlinesize;
1760 1760
1761 dest_y += 2*x_offset + 2*y_offset*h-> mb_linesize; 1761 dest_y += 2*x_offset + 2*y_offset*h-> mb_linesize;
1762 dest_cb += x_offset + y_offset*h->mb_uvlinesize; 1762 dest_cb += x_offset + y_offset*h->mb_uvlinesize;
1763 dest_cr += x_offset + y_offset*h->mb_uvlinesize; 1763 dest_cr += x_offset + y_offset*h->mb_uvlinesize;
1764 x_offset += 8*s->mb_x; 1764 x_offset += 8*s->mb_x;
1765 y_offset += 8*(s->mb_y >> (MB_MBAFF || FIELD_PICTURE)); 1765 y_offset += 8*(s->mb_y >> MB_FIELD);
1766 1766
1767 if(list0){ 1767 if(list0){
1768 Picture *ref= &h->ref_list[0][ h->ref_cache[0][ scan8[n] ] ]; 1768 Picture *ref= &h->ref_list[0][ h->ref_cache[0][ scan8[n] ] ];
1769 mc_dir_part(h, ref, n, square, chroma_height, delta, 0, 1769 mc_dir_part(h, ref, n, square, chroma_height, delta, 0,
1770 dest_y, dest_cb, dest_cr, x_offset, y_offset, 1770 dest_y, dest_cb, dest_cr, x_offset, y_offset,
1793 1793
1794 dest_y += 2*x_offset + 2*y_offset*h-> mb_linesize; 1794 dest_y += 2*x_offset + 2*y_offset*h-> mb_linesize;
1795 dest_cb += x_offset + y_offset*h->mb_uvlinesize; 1795 dest_cb += x_offset + y_offset*h->mb_uvlinesize;
1796 dest_cr += x_offset + y_offset*h->mb_uvlinesize; 1796 dest_cr += x_offset + y_offset*h->mb_uvlinesize;
1797 x_offset += 8*s->mb_x; 1797 x_offset += 8*s->mb_x;
1798 y_offset += 8*(s->mb_y >> (MB_MBAFF || FIELD_PICTURE)); 1798 y_offset += 8*(s->mb_y >> MB_FIELD);
1799 1799
1800 if(list0 && list1){ 1800 if(list0 && list1){
1801 /* don't optimize for luma-only case, since B-frames usually 1801 /* don't optimize for luma-only case, since B-frames usually
1802 * use implicit weights => chroma too. */ 1802 * use implicit weights => chroma too. */
1803 uint8_t *tmp_cb = s->obmc_scratchpad; 1803 uint8_t *tmp_cb = s->obmc_scratchpad;