Mercurial > libavcodec.hg
comparison vc1.c @ 4238:a784639411d6 libavcodec
B-frames support for adv. profile
author | kostya |
---|---|
date | Sun, 26 Nov 2006 04:54:17 +0000 |
parents | 327e9d4572cb |
children | 30b14d0f2324 |
comparison
equal
deleted
inserted
replaced
4237:327e9d4572cb | 4238:a784639411d6 |
---|---|
1589 case 0: | 1589 case 0: |
1590 v->s.pict_type = P_TYPE; | 1590 v->s.pict_type = P_TYPE; |
1591 break; | 1591 break; |
1592 case 1: | 1592 case 1: |
1593 v->s.pict_type = B_TYPE; | 1593 v->s.pict_type = B_TYPE; |
1594 return -1; | 1594 break; |
1595 // break; | |
1596 case 2: | 1595 case 2: |
1597 v->s.pict_type = I_TYPE; | 1596 v->s.pict_type = I_TYPE; |
1598 break; | 1597 break; |
1599 case 3: | 1598 case 3: |
1600 v->s.pict_type = BI_TYPE; | 1599 v->s.pict_type = BI_TYPE; |
1619 } | 1618 } |
1620 v->rnd = get_bits1(gb); | 1619 v->rnd = get_bits1(gb); |
1621 if(v->interlace) | 1620 if(v->interlace) |
1622 v->uvsamp = get_bits1(gb); | 1621 v->uvsamp = get_bits1(gb); |
1623 if(v->finterpflag) v->interpfrm = get_bits(gb, 1); | 1622 if(v->finterpflag) v->interpfrm = get_bits(gb, 1); |
1623 if(v->s.pict_type == B_TYPE) { | |
1624 v->bfraction = get_vlc2(gb, vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); | |
1625 v->bfraction = vc1_bfraction_lut[v->bfraction]; | |
1626 if(v->bfraction == 0) { | |
1627 v->s.pict_type = BI_TYPE; /* XXX: should not happen here */ | |
1628 } | |
1629 } | |
1624 pqindex = get_bits(gb, 5); | 1630 pqindex = get_bits(gb, 5); |
1625 v->pqindex = pqindex; | 1631 v->pqindex = pqindex; |
1626 if (v->quantizer_mode == QUANT_FRAME_IMPLICIT) | 1632 if (v->quantizer_mode == QUANT_FRAME_IMPLICIT) |
1627 v->pq = pquant_table[0][pqindex]; | 1633 v->pq = pquant_table[0][pqindex]; |
1628 else | 1634 else |
1733 av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n"); | 1739 av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n"); |
1734 vop_dquant_decoding(v); | 1740 vop_dquant_decoding(v); |
1735 } | 1741 } |
1736 | 1742 |
1737 v->ttfrm = 0; //FIXME Is that so ? | 1743 v->ttfrm = 0; //FIXME Is that so ? |
1744 if (v->vstransform) | |
1745 { | |
1746 v->ttmbf = get_bits(gb, 1); | |
1747 if (v->ttmbf) | |
1748 { | |
1749 v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)]; | |
1750 } | |
1751 } else { | |
1752 v->ttmbf = 1; | |
1753 v->ttfrm = TT_8X8; | |
1754 } | |
1755 break; | |
1756 case B_TYPE: | |
1757 if(v->postprocflag) | |
1758 v->postproc = get_bits1(gb); | |
1759 if (v->extended_mv) v->mvrange = get_prefix(gb, 0, 3); | |
1760 else v->mvrange = 0; | |
1761 v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13 | |
1762 v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11 | |
1763 v->range_x = 1 << (v->k_x - 1); | |
1764 v->range_y = 1 << (v->k_y - 1); | |
1765 | |
1766 if (v->pq < 5) v->tt_index = 0; | |
1767 else if(v->pq < 13) v->tt_index = 1; | |
1768 else v->tt_index = 2; | |
1769 | |
1770 lowquant = (v->pq > 12) ? 0 : 1; | |
1771 v->mv_mode = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN; | |
1772 v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV); | |
1773 v->s.mspel = v->s.quarter_sample; | |
1774 | |
1775 status = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v); | |
1776 if (status < 0) return -1; | |
1777 av_log(v->s.avctx, AV_LOG_DEBUG, "MB Direct Type plane encoding: " | |
1778 "Imode: %i, Invert: %i\n", status>>1, status&1); | |
1779 status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v); | |
1780 if (status < 0) return -1; | |
1781 av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: " | |
1782 "Imode: %i, Invert: %i\n", status>>1, status&1); | |
1783 | |
1784 v->s.mv_table_index = get_bits(gb, 2); | |
1785 v->cbpcy_vlc = &vc1_cbpcy_p_vlc[get_bits(gb, 2)]; | |
1786 | |
1787 if (v->dquant) | |
1788 { | |
1789 av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n"); | |
1790 vop_dquant_decoding(v); | |
1791 } | |
1792 | |
1793 v->ttfrm = 0; | |
1738 if (v->vstransform) | 1794 if (v->vstransform) |
1739 { | 1795 { |
1740 v->ttmbf = get_bits(gb, 1); | 1796 v->ttmbf = get_bits(gb, 1); |
1741 if (v->ttmbf) | 1797 if (v->ttmbf) |
1742 { | 1798 { |