4 |
* - Decoder Module - |
* - Decoder Module - |
5 |
* |
* |
6 |
* Copyright(C) 2002 MinChen <chenm001@163.com> |
* Copyright(C) 2002 MinChen <chenm001@163.com> |
7 |
* 2002-2003 Peter Ross <pross@xvid.org> |
* 2002-2004 Peter Ross <pross@xvid.org> |
8 |
* |
* |
9 |
* This program is free software ; you can redistribute it and/or modify |
* This program is free software ; you can redistribute it and/or modify |
10 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
339 |
stop_coding_timer(); |
stop_coding_timer(); |
340 |
|
|
341 |
start_timer(); |
start_timer(); |
342 |
add_acdc(pMB, i, &block[i * 64], iDcScaler, predictors, dec->bs_version); |
add_acdc(pMB, i, &block[i * 64], iDcScaler, predictors); |
343 |
stop_prediction_timer(); |
stop_prediction_timer(); |
344 |
|
|
345 |
start_timer(); |
start_timer(); |
1215 |
uint32_t x, y; |
uint32_t x, y; |
1216 |
VECTOR mv; |
VECTOR mv; |
1217 |
const VECTOR zeromv = {0,0}; |
const VECTOR zeromv = {0,0}; |
1218 |
|
const int64_t TRB = dec->time_pp - dec->time_bp, TRD = dec->time_pp; |
1219 |
int i; |
int i; |
1220 |
|
|
1221 |
start_timer(); |
start_timer(); |
1310 |
|
|
1311 |
case MODE_DIRECT_NONE_MV: |
case MODE_DIRECT_NONE_MV: |
1312 |
for (i = 0; i < 4; i++) { |
for (i = 0; i < 4; i++) { |
1313 |
mb->mvs[i].x = last_mb->mvs[i].x*dec->time_bp/dec->time_pp + mv.x; |
mb->mvs[i].x = (int32_t) ((TRB * last_mb->mvs[i].x) / TRD + mv.x); |
1314 |
mb->mvs[i].y = last_mb->mvs[i].y*dec->time_bp/dec->time_pp + mv.y; |
mb->b_mvs[i].x = (int32_t) ((mv.x == 0) |
1315 |
|
? ((TRB - TRD) * last_mb->mvs[i].x) / TRD |
1316 |
mb->b_mvs[i].x = (mv.x) |
: mb->mvs[i].x - last_mb->mvs[i].x); |
1317 |
? mb->mvs[i].x - last_mb->mvs[i].x |
mb->mvs[i].y = (int32_t) ((TRB * last_mb->mvs[i].y) / TRD + mv.y); |
1318 |
: last_mb->mvs[i].x*(dec->time_bp - dec->time_pp)/dec->time_pp; |
mb->b_mvs[i].y = (int32_t) ((mv.y == 0) |
1319 |
mb->b_mvs[i].y = (mv.y) |
? ((TRB - TRD) * last_mb->mvs[i].y) / TRD |
1320 |
? mb->mvs[i].y - last_mb->mvs[i].y |
: mb->mvs[i].y - last_mb->mvs[i].y); |
|
: last_mb->mvs[i].y*(dec->time_bp - dec->time_pp)/dec->time_pp; |
|
1321 |
} |
} |
1322 |
|
|
1323 |
decoder_bf_interpolate_mbinter(dec, dec->refn[1], dec->refn[0], |
decoder_bf_interpolate_mbinter(dec, dec->refn[1], dec->refn[0], |
1361 |
xvid_dec_frame_t * frame, xvid_dec_stats_t * stats, |
xvid_dec_frame_t * frame, xvid_dec_stats_t * stats, |
1362 |
int coding_type, int quant) |
int coding_type, int quant) |
1363 |
{ |
{ |
1364 |
|
const int brightness = XVID_VERSION_MINOR(frame->version) >= 1 ? frame->brightness : 0; |
1365 |
|
|
1366 |
if (dec->cartoon_mode) |
if (dec->cartoon_mode) |
1367 |
frame->general &= ~XVID_FILMEFFECT; |
frame->general &= ~XVID_FILMEFFECT; |
1368 |
|
|
1369 |
if (frame->general & (XVID_DEBLOCKY|XVID_DEBLOCKUV|XVID_FILMEFFECT) && mbs != NULL) /* post process */ |
if ((frame->general & (XVID_DEBLOCKY|XVID_DEBLOCKUV|XVID_FILMEFFECT) || brightness!=0) |
1370 |
|
&& mbs != NULL) /* post process */ |
1371 |
{ |
{ |
1372 |
/* note: image is stored to tmp */ |
/* note: image is stored to tmp */ |
1373 |
image_copy(&dec->tmp, img, dec->edged_width, dec->height); |
image_copy(&dec->tmp, img, dec->edged_width, dec->height); |
1374 |
image_postproc(&dec->postproc, &dec->tmp, dec->edged_width, |
image_postproc(&dec->postproc, &dec->tmp, dec->edged_width, |
1375 |
mbs, dec->mb_width, dec->mb_height, dec->mb_width, |
mbs, dec->mb_width, dec->mb_height, dec->mb_width, |
1376 |
frame->general, dec->frames, (coding_type == B_VOP)); |
frame->general, brightness, dec->frames, (coding_type == B_VOP)); |
1377 |
img = &dec->tmp; |
img = &dec->tmp; |
1378 |
} |
} |
1379 |
|
|