X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_xbr.c;h=a381be4553e9d94db59ac68720081038df413347;hb=0bf3a7361d17d596a5044882098f56817db0e103;hp=2c71871d22db45ee31369d132bbee062d45768bf;hpb=185aa5e896e15ae96145609944bfc6bbb239bc64;p=ffmpeg diff --git a/libavfilter/vf_xbr.c b/libavfilter/vf_xbr.c index 2c71871d22d..a381be4553e 100644 --- a/libavfilter/vf_xbr.c +++ b/libavfilter/vf_xbr.c @@ -380,7 +380,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return ff_filter_frame(outlink, out); } -static int init(AVFilterContext *ctx) +static av_cold int init(AVFilterContext *ctx) { XBRContext *s = ctx->priv; static const xbrfunc_t xbrfuncs[] = {xbr2x, xbr3x, xbr4x}; @@ -395,7 +395,7 @@ static int init(AVFilterContext *ctx) int startg = FFMAX3(-bg, -rg, 0); int endg = FFMIN3(255-bg, 255-rg, 255); uint32_t y = (uint32_t)(( 299*rg + 1000*startg + 114*bg)/1000); - c = bg + (rg<<16) + 0x010101 * startg; + c = bg + rg * (1 << 16) + 0x010101 * startg; for (g = startg; g <= endg; g++) { s->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v; c+= 0x010101;