4 |
* - Motion Estimation for B-VOPs - |
* - Motion Estimation for B-VOPs - |
5 |
* |
* |
6 |
* Copyright(C) 2002 Christoph Lampert <gruel@web.de> |
* Copyright(C) 2002 Christoph Lampert <gruel@web.de> |
7 |
* 2002 Michael Militzer <michael@xvid.org> |
* 2002-2010 Michael Militzer <michael@xvid.org> |
8 |
* 2002-2003 Radoslaw Czyz <xvid@syskin.cjb.net> |
* 2002-2003 Radoslaw Czyz <xvid@syskin.cjb.net> |
9 |
* |
* |
10 |
* This program is free software ; you can redistribute it and/or modify |
* This program is free software ; you can redistribute it and/or modify |
21 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
* |
* |
24 |
* $Id: estimation_bvop.c,v 1.24 2006-02-24 08:46:22 syskin Exp $ |
* $Id: estimation_bvop.c,v 1.26 2010-11-28 15:18:21 Isibaar Exp $ |
25 |
* |
* |
26 |
****************************************************************************/ |
****************************************************************************/ |
27 |
|
|
1081 |
|
|
1082 |
if (frame->vop_flags & XVID_VOP_RD_BVOP) |
if (frame->vop_flags & XVID_VOP_RD_BVOP) |
1083 |
ModeDecision_BVOP_RD(&Data_d, &Data_b, &Data_f, &Data_i, |
ModeDecision_BVOP_RD(&Data_d, &Data_b, &Data_f, &Data_i, |
1084 |
pMB, b_mb, &f_predMV, &b_predMV, frame->motion_flags, pParam, i, j, best_sad); |
pMB, b_mb, &f_predMV, &b_predMV, frame->motion_flags, frame->vop_flags, pParam, i, j, best_sad); |
1085 |
else |
else |
1086 |
ModeDecision_BVOP_SAD(&Data_d, &Data_b, &Data_f, &Data_i, pMB, b_mb, &f_predMV, &b_predMV); |
ModeDecision_BVOP_SAD(&Data_d, &Data_b, &Data_f, &Data_i, pMB, b_mb, &f_predMV, &b_predMV); |
1087 |
|
|
1123 |
int max_mbs; |
int max_mbs; |
1124 |
int current_mb = 0; |
int current_mb = 0; |
1125 |
|
|
1126 |
uint32_t i, j; |
int32_t i, j; |
1127 |
int32_t best_sad = 256*4096; |
int32_t best_sad = 256*4096; |
1128 |
uint32_t skip_sad; |
uint32_t skip_sad; |
1129 |
int fb_thresh; |
int fb_thresh; |
1272 |
|
|
1273 |
if (frame->vop_flags & XVID_VOP_RD_BVOP) |
if (frame->vop_flags & XVID_VOP_RD_BVOP) |
1274 |
ModeDecision_BVOP_RD(&Data_d, &Data_b, &Data_f, &Data_i, |
ModeDecision_BVOP_RD(&Data_d, &Data_b, &Data_f, &Data_i, |
1275 |
pMB, b_mb, &f_predMV, &b_predMV, frame->motion_flags, pParam, i, j, best_sad); |
pMB, b_mb, &f_predMV, &b_predMV, frame->motion_flags, frame->vop_flags, pParam, i, j, best_sad); |
1276 |
else |
else |
1277 |
ModeDecision_BVOP_SAD(&Data_d, &Data_b, &Data_f, &Data_i, pMB, b_mb, &f_predMV, &b_predMV); |
ModeDecision_BVOP_SAD(&Data_d, &Data_b, &Data_f, &Data_i, pMB, b_mb, &f_predMV, &b_predMV); |
1278 |
|
|
1279 |
*complete_count_self = i+1; |
*complete_count_self = i+1; |
1280 |
current_mb++; |
current_mb++; |
1281 |
|
maxMotionBVOP(&MVmaxF, &MVmaxB, pMB, Data_d.qpel); |
1282 |
} |
} |
1283 |
|
|
1284 |
complete_count_self++; |
complete_count_self++; |
1285 |
complete_count_above++; |
complete_count_above++; |
1286 |
} |
} |
1287 |
|
|
1288 |
|
h->minfcode = getMinFcode(MVmaxF); |
1289 |
|
h->minbcode = getMinFcode(MVmaxB); |
1290 |
} |
} |