mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
avcodec/dvbsubdec: Split best score computation out of loop in compute_default_clut()
3% faster Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
cd2f69cdd6
commit
963247b5f3
@ -680,14 +680,17 @@ static void compute_default_clut(AVSubtitleRect *rect, int w, int h)
|
|||||||
int l_r = x+1<w ? L( 1, 0) : 1;
|
int l_r = x+1<w ? L( 1, 0) : 1;
|
||||||
int l_t = y ? L( 0,-1) : 1;
|
int l_t = y ? L( 0,-1) : 1;
|
||||||
int l_b = y+1<h ? L( 0, 1) : 1;
|
int l_b = y+1<h ? L( 0, 1) : 1;
|
||||||
int score;
|
|
||||||
if (l_m)
|
if (l_m)
|
||||||
continue;
|
continue;
|
||||||
scoretab[v] += l_l + l_r + l_t + l_b;
|
scoretab[v] += l_l + l_r + l_t + l_b;
|
||||||
score = 1024LL*scoretab[v] / counttab[v];
|
}
|
||||||
|
}
|
||||||
|
for (x = 0; x < 256; x++) {
|
||||||
|
if (scoretab[x]) {
|
||||||
|
int score = 1024LL*scoretab[x] / counttab[x];
|
||||||
if (score > bestscore) {
|
if (score > bestscore) {
|
||||||
bestscore = score;
|
bestscore = score;
|
||||||
bestv = v;
|
bestv = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user