movit-fosdem2014.pdf

Upload: anonymous-bwvvqpx

Post on 08-Aug-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/21/2019 movit-fosdem2014.pdf

    1/37

    Movit: The modern video tool

    A high-quality, high-performance, open-source* lib

    for video filters

    * G!v"#

  • 8/21/2019 movit-fosdem2014.pdf

    2/37

    $igh-performance%

    The road from the &'s to "'() and back

  • 8/21/2019 movit-fosdem2014.pdf

    3/37

    A+ .(/&/0

    inti1

    for.i 2 '1 i 3 4idth * height1 ##i0 5 out6i7 2 a6i7 * .(8'- f0 # b6i7 * f19

  • 8/21/2019 movit-fosdem2014.pdf

    4/37

    +ave one multiply

    inti1

    for.i 2 '1 i 3 4idth * height1 ##i0 5 out6i7 2 a6i7 # .b6i7 - a6i70 * f19

  • 8/21/2019 movit-fosdem2014.pdf

    5/37

    (8( fi;ed-point .typical /'s code

    intfi 2 lrintf.f * ?@0 CC (019

  • 8/21/2019 movit-fosdem2014.pdf

    6/37

    MMD .(//B0

    const intfi 2 lrintf.f * "?@01const FFm) fvec 2 FmmFset(Fpi(.fi0, finvvec 2 FmmFset(Fpi(.finv01const FFm)*avec 2 .FFm)*0a, *bvec 2 .FFm)*0b1FFm)*outvec 2 .FFm)*0out1for. 1 i 3 4idth * height1 i #2 &0 5

    FFm)aval 2 avec6i H &7, bval 2 bvec6i H &71FFm)aFlo 2 FmmFunpackloFpi&.aval, ero0, aFhi 2 FmmFunpackhiFpi&.aval, ero01

    FFm)bFlo 2 FmmFunpackloFpi&.bval, ero0, bFhi 2 FmmFunpackhiFpi&.bval, ero01FFm)outFlo 2 FmmFaddFpi(.FmmFmulloFpi(.finvvec, aFlo0, FmmFmulloFpi(.fvec, FFm)outFhi 2 FmmFaddFpi(.FmmFmulloFpi(.finvvec, aFhi0, FmmFmulloFpi(.fvec, outFlo 2 FmmFsrliFpi(.FmmFaddFpi(.outFlo, roundvec0, &01outFhi 2 FmmFsrliFpi(.FmmFaddFpi(.outFhi, roundvec0, &01outvec6i H &7 2 FmFpackus4b.outFlo, outFhi01

    9Eendiffor . 1 i 3 4idth * height1 ##i0 5

    out6i7 2 .a6i7 * fi # b6i7 * finv # >?@0 CC &19

  • 8/21/2019 movit-fosdem2014.pdf

    7/37

    Multicore .early "'''s0

    HH All the stuff from the previous e;ample, plus support for ++I", AJD", et

    pthreadFt threads6@MF?>I+71for.inti 2 '1 i 3 @MF?>I+1 ##i0 5 HH // has happened in the meantim

    pthreadFcreate.Lthreads6i7, @!!, processFslice, .void*0i019HH ait for all the cores to come back, hope that all of them 4ere idle888for.inti 2 '1 i 3 @MF?>I+1 ##i0 5

    pthreadFNoin.threads6i7, @!!019

  • 8/21/2019 movit-fosdem2014.pdf

    8/37

    Orei'r blend plugin ."''0

    const uint&Ft bf 2 .const uint&Ft0 ."

  • 8/21/2019 movit-fosdem2014.pdf

    9/37

    R

  • 8/21/2019 movit-fosdem2014.pdf

    10/37

    "'(): G@s are no longer uncomm

    Tim SAvatarS Partel, -PQ-"8'

  • 8/21/2019 movit-fosdem2014.pdf

    11/37

    "'(): G@s are no longer uncomm

    flickr8comHphotosHfootfun, -PQ-"8'

  • 8/21/2019 movit-fosdem2014.pdf

    12/37

    "'(): G@s are no longer uncomm

    Mia Aasbakken, used 4ith permission

  • 8/21/2019 movit-fosdem2014.pdf

    13/37

    "'(): G@s are no longer uncomm

    antelotteriet anto, Apeland nformasNonHatrine !unke

  • 8/21/2019 movit-fosdem2014.pdf

    14/37

    G!+! ."'')0

    vec" tc 2 glFMultiTe;oord'8;y1

    vec)first 2 te;ture".te;A, tc01vec)second 2 te;ture".te;P, tc01glFOragolor 2 first # vec).f0 * .second - first01

  • 8/21/2019 movit-fosdem2014.pdf

    15/37

    AdNusted for inclusion in Movit

    vec) [email protected]"tc0 5

    vec)first 2 @T(.tc01 vec)second 2 @T".tc01 return first # vec).>IOD.f00 * .second - first019

  • 8/21/2019 movit-fosdem2014.pdf

    16/37

    $igh-quality%?r: There is more than one 4ay to mess it u

  • 8/21/2019 movit-fosdem2014.pdf

    17/37

    Oade done in gamma space

    s>GP .incorrect0!inear light .correct0

  • 8/21/2019 movit-fosdem2014.pdf

    18/37

    >ec8 "'"' misinterpreted as s>GP .>e.emphasied1 done three times0

    flickr8comHphotosHfictu

  • 8/21/2019 movit-fosdem2014.pdf

    19/37

    rong chroma subpi;el placemen.Qbr ):(:'0

  • 8/21/2019 movit-fosdem2014.pdf

    20/37

    rong chroma subpi;el placemen.Qbr ):(:'0

  • 8/21/2019 movit-fosdem2014.pdf

    21/37

    U 4c -l *8cpp V grep total ('"< total

    U 4c -l *test*8cpp V grep total )&

  • 8/21/2019 movit-fosdem2014.pdf

    22/37

    My first Movit chain

    hoto by ikimedia ommons user etritap .-PQ-+A-=8'

  • 8/21/2019 movit-fosdem2014.pdf

    23/37

    mageOormat inoutFformat.?!?>+AIFs>GP, GAMMAFs>GP01

    Olatnput *input 2 ne4Olatnput.inoutFformat,

    O?>MATFPG>AF?+TM@!T!IFA!$A,

    G!F@+GIFPQTI, 4idth, height01chain8addFinput.input01

    chain8addFeffect.ne4Glo4Iffect.001

    chain8addFoutput.inoutFformat,

    ?@T@TFA!$AFO?>MATF?+TM@!T!I01

    chain8setFditherFbits.&01chain8finalie.01

    HH 8888

    input-CsetFpi;elFdata.buf01

    chain8renderFtoFscreen.01

  • 8/21/2019 movit-fosdem2014.pdf

    24/37

  • 8/21/2019 movit-fosdem2014.pdf

    25/37

  • 8/21/2019 movit-fosdem2014.pdf

    26/37

  • 8/21/2019 movit-fosdem2014.pdf

    27/37

  • 8/21/2019 movit-fosdem2014.pdf

    28/37

  • 8/21/2019 movit-fosdem2014.pdf

    29/37

    More Movit effects

  • 8/21/2019 movit-fosdem2014.pdf

    30/37

  • 8/21/2019 movit-fosdem2014.pdf

    31/37

  • 8/21/2019 movit-fosdem2014.pdf

    32/37

  • 8/21/2019 movit-fosdem2014.pdf

    33/37

    .ork in progress, coming soon0

  • 8/21/2019 movit-fosdem2014.pdf

    34/37

    .ork in progress, coming soon0

  • 8/21/2019 movit-fosdem2014.pdf

    35/37

    emo timeK

  • 8/21/2019 movit-fosdem2014.pdf

    36/37

    Outure 4ork

    More filters

    Petter Qbr handling $andling of interlaced content

    hatever clients need .4ithin reasonR0

  • 8/21/2019 movit-fosdem2014.pdf

    37/37

    http:HHmovit8sesse8net

    Thank youK