55 |
* 22.12.2001 lock based interpolation |
* 22.12.2001 lock based interpolation |
56 |
* 01.12.2001 inital version; (c)2001 peter ross <pross@xvid.org> |
* 01.12.2001 inital version; (c)2001 peter ross <pross@xvid.org> |
57 |
* |
* |
58 |
* $Id: decoder.c,v 1.39 2002-09-22 17:01:36 edgomez Exp $ |
* $Id: decoder.c,v 1.41 2002-09-25 23:37:08 h Exp $ |
59 |
* |
* |
60 |
*************************************************************************/ |
*************************************************************************/ |
61 |
|
|
585 |
|
|
586 |
start_timer(); |
start_timer(); |
587 |
image_setedges(&dec->refn[0], dec->edged_width, dec->edged_height, |
image_setedges(&dec->refn[0], dec->edged_width, dec->edged_height, |
588 |
dec->width, dec->height, dec->interlacing); |
dec->width, dec->height); |
589 |
stop_edges_timer(); |
stop_edges_timer(); |
590 |
|
|
591 |
bound = 0; |
bound = 0; |
1143 |
|
|
1144 |
start_timer(); |
start_timer(); |
1145 |
image_setedges(&dec->refn[0], dec->edged_width, dec->edged_height, |
image_setedges(&dec->refn[0], dec->edged_width, dec->edged_height, |
1146 |
dec->width, dec->height, dec->interlacing); |
dec->width, dec->height); |
1147 |
image_setedges(&dec->refn[1], dec->edged_width, dec->edged_height, |
image_setedges(&dec->refn[1], dec->edged_width, dec->edged_height, |
1148 |
dec->width, dec->height, dec->interlacing); |
dec->width, dec->height); |
1149 |
stop_edges_timer(); |
stop_edges_timer(); |
1150 |
|
|
1151 |
#ifdef BFRAMES_DEC_DEBUG |
#ifdef BFRAMES_DEC_DEBUG |
1337 |
decoder_pframe(dec, &bs, rounding, quant, fcode_forward, |
decoder_pframe(dec, &bs, rounding, quant, fcode_forward, |
1338 |
intra_dc_threshold); |
intra_dc_threshold); |
1339 |
#ifdef BFRAMES_DEC |
#ifdef BFRAMES_DEC |
1340 |
DEBUG1("P_VOP Time=", dec->time); |
DPRINTF(DPRINTF_DEBUG, "P_VOP Time=%d", dec->time); |
1341 |
#endif |
#endif |
1342 |
break; |
break; |
1343 |
|
|
1344 |
case I_VOP: |
case I_VOP: |
1345 |
decoder_iframe(dec, &bs, quant, intra_dc_threshold); |
decoder_iframe(dec, &bs, quant, intra_dc_threshold); |
1346 |
#ifdef BFRAMES_DEC |
#ifdef BFRAMES_DEC |
1347 |
DEBUG1("I_VOP Time=", dec->time); |
DPRINTF(DPRINTF_DEBUG, "I_VOP Time=%d", dec->time); |
1348 |
#endif |
#endif |
1349 |
break; |
break; |
1350 |
|
|
1351 |
case B_VOP: |
case B_VOP: |
1352 |
#ifdef BFRAMES_DEC |
#ifdef BFRAMES_DEC |
1353 |
if (dec->time_pp > dec->time_bp) { |
if (dec->time_pp > dec->time_bp) { |
1354 |
DEBUG1("B_VOP Time=", dec->time); |
DPRINTF(DPRINTF_DEBUG, "B_VOP Time=%d", dec->time); |
1355 |
decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward); |
decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward); |
1356 |
} else { |
} else { |
1357 |
DEBUG("broken B-frame!"); |
DPRINTF(DPRINTF_DEBUG, "Broken B_VOP"); |
1358 |
} |
} |
1359 |
#else |
#else |
1360 |
image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height); |
image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height); |
1372 |
|
|
1373 |
#ifdef BFRAMES_DEC_DEBUG |
#ifdef BFRAMES_DEC_DEBUG |
1374 |
if (frame->length != BitstreamPos(&bs) / 8){ |
if (frame->length != BitstreamPos(&bs) / 8){ |
1375 |
DEBUG2("InLen/UseLen",frame->length, BitstreamPos(&bs) / 8); |
DPRINTF(DPRINTF_DEBUG, "InLen: %d / UseLen: %d", frame->length, BitstreamPos(&bs) / 8); |
1376 |
} |
} |
1377 |
#endif |
#endif |
1378 |
frame->length = BitstreamPos(&bs) / 8; |
frame->length = BitstreamPos(&bs) / 8; |