diff options
author | Stefan Gehrer <stefan.gehrer@gmx.de> | 2006-07-14 18:48:50 +0000 |
---|---|---|
committer | Stefan Gehrer <stefan.gehrer@gmx.de> | 2006-07-14 18:48:50 +0000 |
commit | 77f173bef53b670fa268e0fcfa7d5da6cc300078 (patch) | |
tree | 881e7f86fc3656e7710d3156a28d5008de36a4dd /libavcodec/cavs.c | |
parent | ab01b2b82a8077016397b483c2fac725f7ed48a8 (diff) | |
download | ffmpeg-77f173bef53b670fa268e0fcfa7d5da6cc300078.tar.gz |
set mvP2 also in PSKIP macroblock
Originally committed as revision 5748 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cavs.c')
-rw-r--r-- | libavcodec/cavs.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index 7d5047b923..9feb69fe6d 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -576,23 +576,19 @@ static void mv_pred(AVSContext *h, enum mv_loc_t nP, enum mv_loc_t nC, vector_t *mvA = &h->mv[nP-1]; vector_t *mvB = &h->mv[nP-4]; vector_t *mvC = &h->mv[nC]; - vector_t *mvP2 = NULL; + const vector_t *mvP2 = NULL; mvP->ref = ref; mvP->dist = h->dist[mvP->ref]; if(mvC->ref == NOT_AVAIL) mvC = &h->mv[nP-5]; // set to top-left (mvD) - if(mode == MV_PRED_PSKIP) { - if((mvA->ref == NOT_AVAIL) || (mvB->ref == NOT_AVAIL) || + if((mode == MV_PRED_PSKIP) && + ((mvA->ref == NOT_AVAIL) || (mvB->ref == NOT_AVAIL) || ((mvA->x | mvA->y | mvA->ref) == 0) || - ((mvB->x | mvB->y | mvB->ref) == 0) ) { - mvP->x = mvP->y = 0; - set_mvs(mvP,size); - return; - } - } + ((mvB->x | mvB->y | mvB->ref) == 0) )) { + mvP2 = &un_mv; /* if there is only one suitable candidate, take it */ - if((mvA->ref >= 0) && (mvB->ref < 0) && (mvC->ref < 0)) { + } else if((mvA->ref >= 0) && (mvB->ref < 0) && (mvC->ref < 0)) { mvP2= mvA; } else if((mvA->ref < 0) && (mvB->ref >= 0) && (mvC->ref < 0)) { mvP2= mvB; |