--- decoder.c 2003/10/01 23:23:00 1.49.2.13 +++ decoder.c 2003/10/07 13:02:35 1.49.2.15 @@ -20,7 +20,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: decoder.c,v 1.49.2.13 2003/10/01 23:23:00 edgomez Exp $ + * $Id: decoder.c,v 1.49.2.15 2003/10/07 13:02:35 edgomez Exp $ * ****************************************************************************/ @@ -40,8 +40,7 @@ #include "bitstream/bitstream.h" #include "bitstream/mbcoding.h" -#include "quant/quant_h263.h" -#include "quant/quant_mpeg4.h" +#include "quant/quant.h" #include "dct/idct.h" #include "dct/fdct.h" #include "utils/mem_transfer.h" @@ -327,9 +326,9 @@ start_timer(); if (dec->quant_type == 0) { - dequant_intra(&data[i * 64], &block[i * 64], iQuant, iDcScaler); + dequant_h263_intra(&data[i * 64], &block[i * 64], iQuant, iDcScaler); } else { - dequant4_intra(&data[i * 64], &block[i * 64], iQuant, iDcScaler); + dequant_mpeg_intra(&data[i * 64], &block[i * 64], iQuant, iDcScaler); } stop_iquant_timer(); @@ -533,9 +532,9 @@ start_timer(); if (dec->quant_type == 0) { - dequant_inter(&data[i * 64], &block[i * 64], iQuant); + dequant_h263_inter(&data[i * 64], &block[i * 64], iQuant); } else { - dequant4_inter(&data[i * 64], &block[i * 64], iQuant); + dequant_mpeg_inter(&data[i * 64], &block[i * 64], iQuant); } stop_iquant_timer(); @@ -658,9 +657,9 @@ start_timer(); if (dec->quant_type == 0) { - dequant_inter(&data[i * 64], &block[i * 64], iQuant); + dequant_h263_inter(&data[i * 64], &block[i * 64], iQuant); } else { - dequant4_inter(&data[i * 64], &block[i * 64], iQuant); + dequant_mpeg_inter(&data[i * 64], &block[i * 64], iQuant); } stop_iquant_timer(); @@ -940,7 +939,7 @@ mb->quant = quant; if (dec->interlacing) { - if (cbp || intra) { + if ((cbp || intra) && !mcsel) { mb->field_dct = BitstreamGetBit(bs); DPRINTF(XVID_DEBUG_MB,"decp: field_dct: %i\n", mb->field_dct); } @@ -1205,9 +1204,9 @@ start_timer(); if (dec->quant_type == 0) { - dequant_inter(&data[i * 64], &block[i * 64], iQuant); + dequant_h263_inter(&data[i * 64], &block[i * 64], iQuant); } else { - dequant4_inter(&data[i * 64], &block[i * 64], iQuant); + dequant_mpeg_inter(&data[i * 64], &block[i * 64], iQuant); } stop_iquant_timer(); @@ -1445,9 +1444,9 @@ start_timer(); if (dec->quant_type == 0) { - dequant_inter(&data[i * 64], &block[i * 64], iQuant); + dequant_h263_inter(&data[i * 64], &block[i * 64], iQuant); } else { - dequant4_inter(&data[i * 64], &block[i * 64], iQuant); + dequant_mpeg_inter(&data[i * 64], &block[i * 64], iQuant); } stop_iquant_timer(); @@ -1600,6 +1599,26 @@ quant = 1; } } + + if (dec->interlacing) { + if (mb->cbp) { + mb->field_dct = BitstreamGetBit(bs); + DPRINTF(XVID_DEBUG_MB,"decp: field_dct: %i\n", mb->field_dct); + } + + if (mb->mb_type) { + mb->field_pred = BitstreamGetBit(bs); + DPRINTF(XVID_DEBUG_MB, "decp: field_pred: %i\n", mb->field_pred); + + if (mb->field_pred) { + mb->field_for_top = BitstreamGetBit(bs); + DPRINTF(XVID_DEBUG_MB,"decp: field_for_top: %i\n", mb->field_for_top); + mb->field_for_bot = BitstreamGetBit(bs); + DPRINTF(XVID_DEBUG_MB,"decp: field_for_bot: %i\n", mb->field_for_bot); + } + } + } + } else { mb->mb_type = MODE_DIRECT_NONE_MV; mb->cbp = 0;