summaryrefslogtreecommitdiffstats
path: root/thirdparty/libwebp/enc/analysis.c
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2016-12-28 23:17:42 +0100
committerGitHub <noreply@github.com>2016-12-28 23:17:42 +0100
commit86e428eea0b9ef5c1732af3a5c29b5c365fbf6e8 (patch)
tree847c3a15508aea33384ad9a93e915c268f379ce1 /thirdparty/libwebp/enc/analysis.c
parentc798ff15510997fdbe6848687804f5e2cb17eefb (diff)
parente04c7e11ec2fabf34aaf515103bc0b6086e1aabd (diff)
downloadredot-engine-86e428eea0b9ef5c1732af3a5c29b5c365fbf6e8.tar.gz
Merge pull request #7350 from volzhs/webp-0.5.2
Update libwebp to 0.5.2
Diffstat (limited to 'thirdparty/libwebp/enc/analysis.c')
-rw-r--r--thirdparty/libwebp/enc/analysis.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/thirdparty/libwebp/enc/analysis.c b/thirdparty/libwebp/enc/analysis.c
index b55128fd48..136c331289 100644
--- a/thirdparty/libwebp/enc/analysis.c
+++ b/thirdparty/libwebp/enc/analysis.c
@@ -307,6 +307,7 @@ static int MBAnalyzeBestIntra4Mode(VP8EncIterator* const it,
static int MBAnalyzeBestUVMode(VP8EncIterator* const it) {
int best_alpha = DEFAULT_ALPHA;
+ int smallest_alpha = 0;
int best_mode = 0;
const int max_mode = MAX_UV_MODE;
int mode;
@@ -322,6 +323,10 @@ static int MBAnalyzeBestUVMode(VP8EncIterator* const it) {
alpha = GetAlpha(&histo);
if (IS_BETTER_ALPHA(alpha, best_alpha)) {
best_alpha = alpha;
+ }
+ // The best prediction mode tends to be the one with the smallest alpha.
+ if (mode == 0 || alpha < smallest_alpha) {
+ smallest_alpha = alpha;
best_mode = mode;
}
}