Mercurial > libavcodec.hg
comparison h264.c @ 5767:32b404ec4c19 libavcodec
Partial PAFF implementation at macroblock level.
PAFF support disabled until implementation complete.
patch by Jeff Downs, heydowns a borg d com
original thread:
Subject: [FFmpeg-devel] [PATCH] Implement PAFF in H.264
Date: 18/09/07 20:30
| author | andoma |
|---|---|
| date | Thu, 04 Oct 2007 06:33:26 +0000 |
| parents | b526d558cb20 |
| children | 09b557fcfafb |
comparison
equal
deleted
inserted
replaced
| 5766:ad8345572a2e | 5767:32b404ec4c19 |
|---|---|
| 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; | 1706 const int pic_height = 16*s->mb_height >> (MB_MBAFF || FIELD_PICTURE); |
| 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){ | 1730 if(MB_MBAFF || FIELD_PICTURE){ |
| 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); | 1765 y_offset += 8*(s->mb_y >> (MB_MBAFF || FIELD_PICTURE)); |
| 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); | 1798 y_offset += 8*(s->mb_y >> (MB_MBAFF || FIELD_PICTURE)); |
| 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; |
