X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_xbr.c;h=a381be4553e9d94db59ac68720081038df413347;hb=1b64954e42b4dc685a82d5576527a2166d818773;hp=78094e028777ae4eb7bc116740dca07ed0ef0a66;hpb=b13a1210a242d2b3177592ec8687c6f579bff156;p=ffmpeg diff --git a/libavfilter/vf_xbr.c b/libavfilter/vf_xbr.c index 78094e02877..a381be4553e 100644 --- a/libavfilter/vf_xbr.c +++ b/libavfilter/vf_xbr.c @@ -24,7 +24,7 @@ * XBR Filter is used for depixelization of image. * This is based on Hyllian's xBR shader. * - * @see http://www.libretro.com/forums/viewtopic.php?f=6&t=134 + * @see https://forums.libretro.com/t/xbr-algorithm-tutorial/123 * @see https://github.com/yoyofr/iFBA/blob/master/fba_src/src/intf/video/scalers/xbr.cpp */ @@ -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;