mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-05 06:13:43 +00:00
Simplify spatial direct ref selection with FFMIN3()
Originally committed as revision 14319 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
86255db9b9
commit
29d05ebc7a
@ -1001,11 +1001,7 @@ static inline void pred_direct_motion(H264Context * const h, int *mb_type){
|
|||||||
int refc = h->ref_cache[list][scan8[0] - 8 + 4];
|
int refc = h->ref_cache[list][scan8[0] - 8 + 4];
|
||||||
if(refc == -2)
|
if(refc == -2)
|
||||||
refc = h->ref_cache[list][scan8[0] - 8 - 1];
|
refc = h->ref_cache[list][scan8[0] - 8 - 1];
|
||||||
ref[list] = refa;
|
ref[list] = FFMIN3((unsigned)refa, (unsigned)refb, (unsigned)refc);
|
||||||
if(ref[list] < 0 || (refb < ref[list] && refb >= 0))
|
|
||||||
ref[list] = refb;
|
|
||||||
if(ref[list] < 0 || (refc < ref[list] && refc >= 0))
|
|
||||||
ref[list] = refc;
|
|
||||||
if(ref[list] < 0)
|
if(ref[list] < 0)
|
||||||
ref[list] = -1;
|
ref[list] = -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user