Recensubs HQ

Hardsubbare roba a 16bit YUV 4:4:4

« Older   Newer »
  Share  
view post Posted on 29/8/2012, 20:27     +3   +1   -1
Avatar

Bimbosp

Group:
Administrator
Posts:
9,780
Reputation:
+929
Location:
Gallarate (VA)

Status:


Allora, visto che ad alcuni potrebbe interessare, mi sono messo di buona lena e ho scritto 'sta roba. Metto il codice sotto spoiler perché è roba lunghetta.

CODICE
#HardSub Utilities for Y416 v1.2 by mirkosp
#Y416 is 16bit YUV 4:4:4, by the way. But if you care about this, you likely knew already.
#And of course I mean dithertools' stacked thing, which technically is
#a stacked 8bit thingie. Dem hacks.
#Requires dithertools. Also vsfilter and/or vsfiltermod for the ass support.
#I haven't done extensive testing, so please report any errors you find.

#First and foremost, rgb32 afx clips
#l is the video to overlay on (typically left to last)
#c is the clip to be overlayed
#s is the frame on which to start the overlay
#e is the frame on which to end the overlay
#I'm nice enough to allow the usage of -num_frames style too, tho.
#sm is the colormatrix and tv is a bool for tv range (true) or not (false).
#You should be using dither_convert_rgb_to_yuv's values for sm, but
#uf you're using avisynth's, I'm doing a somewhat rough check myself.
#This also allows me to just call this function later on for ass hardsubbing...

function rgb32ony416(clip l, clip c, int "s", int "e", string "sm", bool "tv") {
assert(c.isrgb32, "dudeplz.")
assert(l.isyv24, "dudeplz.")
assert(l.width == c.width, "check width")
assert(l.height/2 == c.height, "check height")
tv = defined(tv) ? tv : defined(sm) ? sm == "PC.601" ? false : sm == "PC.709" ? false : tv : true
sm = defined(sm) ? sm == "Rec601" ? "601" : sm == "Rec709" ? "709" : sm == "PC.601" ? "601" : sm == "PC.709" ? "709" : sm : (c.width > 1024 || c.height > 600) ? "709" : "601"
s = default(s,0)
e = default(e,0)
s=s+2
l
e = (e > 0) ? e+2 : (e == 0) ? framecount+1 : e
ps = s-1
pe = (e > 0) ? e+1 : s-e
l = l.trim(0,1)+l+l.trim(0,1) #HAX! I don't feel like doing special case checks. Maybe it executes faster this way, too.
l
sa = l.trim(0,ps).converttorgb32()+stackvertical(c.showalpha("rgb32"),c.showalpha("rgb32"))+last.trim(pe,0).converttorgb32()
oc = l.trim(0,ps)+(c.Dither_convert_rgb_to_yuv(output="yv24",matrix=sm,tv_range=tv).dither_convert_8_to_16())+last.trim(pe,0)
l.trim(0,ps)+ytouv(overlay(last.utoy(),oc.utoy(),mask=sa),overlay(last.vtoy(),oc.vtoy(),mask=sa),overlay(last,oc,mask=sa)).trim(s,e)+l.trim(pe,0)
return trim(2,framecount-3) }

#And now for the ass functions
#sm is the colormatrix. If left unspecified, it's autoguessed based on res.
#path is the ass' path, hack is for the bt601 typeset deal.
#If the video you have to overlay on is bt709 and you
#have typeset in bt601 to compensate for the old vsfilter,
#set this to true.
#vfr is the path to the timecodes.
#At the time of the writing, softsubbed 4:4:4 has to be overlayed
#in rgb tho, so it's better to avoid the hack if you're
#dealing with 4:4:4 video, thus I won't account for it by default.
#I'm not 100% sure these work correctly, please report bugs if you encounter them.

function textsubmodony416(clip cs, string path, string "vfr", string "sm", bool "hack") {
hack = default(hack,false)
c = cs.ditherpost(mode=8)
sm = defined(sm) ? sm : (c.width > 1024 || c.height > 600) ? "Rec709" : "Rec601"
bc = blankclip(c,pixel_type="RGB32",color=$FF000000)#pure alpha
crgb = hack ? c.converttorgb32(matrix="Rec601") : c.converttorgb32(matrix=sm)
mergeargb(bc.showalpha(),crgb.showred(),crgb.showgreen(),crgb.showblue())
defined(vfr) ? textsubmod(path,vfr=vfr) : textsubmod(path)
mergeargb(showalpha().invert(),showred(),showgreen(),showblue())
savealpha = last
o = converttoyv24(matrix="Rec601").converttorgb32(matrix="Rec709")
return hack ? rgb32ony416(cs,mergeargb(savealpha.showalpha(),o.showred(),o.showgreen(),o.showblue()),sm=sm) : rgb32ony416(cs,last,sm=sm)
}

function textsubony416(clip cs, string path, string "vfr", string "sm", bool "hack") {
hack = default(hack,false)
c = cs.ditherpost(mode=8)
sm = defined(sm) ? sm : (c.width > 1024 || c.height > 600) ? "Rec709" : "Rec601"
bc = blankclip(c,pixel_type="RGB32",color=$FF000000)#pure alpha
crgb = hack ? c.converttorgb32(matrix="Rec601") : c.converttorgb32(matrix=sm)
mergeargb(bc.showalpha(),crgb.showred(),crgb.showgreen(),crgb.showblue())
defined(vfr) ? textsub(path,vfr=vfr) : textsub(path)
mergeargb(showalpha().invert(),showred(),showgreen(),showblue())
savealpha = last
o = converttoyv24(matrix="Rec601").converttorgb32(matrix="Rec709")
return hack ? rgb32ony416(cs,mergeargb(savealpha.showalpha(),o.showred(),o.showgreen(),o.showblue()),sm=sm) : rgb32ony416(cs,last,sm=sm)
}


Dovrebbero essere più o meno intuitivi da usare. Segnalate gli errori, che ho testato poco per via dell':eff:. Da quel che ho visto sembrerebbe andare più o meno tutto. Mi rimetto anche al buon senso di chi utilizzerà i filtri...

Edited by mirkosp - 30/8/2012, 22:40
 
Web  Top
view post Posted on 29/8/2012, 20:59     +1   -1

Member

Group:
Utente abilitato
Posts:
968
Reputation:
+161
Location:
Trentino Alto Adige

Status:


Visto che ho ancora notevoli problemi da risolvere ad un livello molto più basso, credo che non ti sentirai offeso se, per un po', non testerò il codice che hai scritto... XD

Comunque trovo questo modo di "esporre le cose" molto utile ed efficace... (a partire da "Hardsub" :blink: )

La mia curiosità te ne è molto grata! :D
 
Top
view post Posted on 29/8/2012, 23:29     +1   -1
Avatar

Bastardo è bello

Group:
Administrator
Posts:
4,286
Reputation:
+740

Status:


Ma è una guida? Checcedevofà?
 
Web Contacts  Top
view post Posted on 29/8/2012, 23:41     +1   -1
Avatar

Bimbosp

Group:
Administrator
Posts:
9,780
Reputation:
+929
Location:
Gallarate (VA)

Status:


CITAZIONE (Vaz @ 30/8/2012, 00:29) 
Ma è una guida? Checcedevofà?

:sigh:
Se non sai cos'è, probabilmente non devi farci nulla.
Comunque è tutto codice da inserire in un avsi, sono delle funzioni per avisynth.
 
Web  Top
view post Posted on 30/8/2012, 00:35     +1   -1

Member

Group:
Utente abilitato
Posts:
615
Reputation:
+170

Status:


Interessante, potrebbe tornarmi utile per qualche logo o karaoke, grazie :)

PS: Poi appena ho un po' di tempo ti passo per MP gli screen per il crop, per ora sto encodando un BD che fortunatamente non ne richiede (E la differenza è notevole).
 
Web  Top
view post Posted on 30/8/2012, 10:54     +1   -1
Avatar

Bimbosp

Group:
Administrator
Posts:
9,780
Reputation:
+929
Location:
Gallarate (VA)

Status:


Update alla v1.1.
Corregge un errore segnalato da Ithilion.
 
Web  Top
view post Posted on 30/8/2012, 21:22     +1   +1   -1
Avatar

Bimbosp

Group:
Administrator
Posts:
9,780
Reputation:
+929
Location:
Gallarate (VA)

Status:


Bump informativo.
Mi hanno segnalato che a volte rgb32ony416 crasha a random.
Aggiungere requestlinear() dopo la chiamata di rgb32ony416 e prima del resto dovrebbe rendere lo script stabile e il tutto dovrebbe funzionare senza errori.

EDIT: Già che c'ero, update alla v1.2 per correggere un errore con e negativo in rgb32ony416.

Edited by mirkosp - 30/8/2012, 22:43
 
Web  Top
view post Posted on 30/8/2012, 22:59     +1   -1
Avatar

Bastardo è bello

Group:
Administrator
Posts:
4,286
Reputation:
+740

Status:


CITAZIONE (mirkosp @ 30/8/2012, 00:41) 
Se non sai cos'è, probabilmente non devi farci nulla.
Comunque è tutto codice da inserire in un avsi, sono delle funzioni per avisynth.

No, era per sapere se devo spostarla nella sottosezione delle guide oppure no.
 
Web Contacts  Top
view post Posted on 30/8/2012, 23:18     +1   -1
Avatar

Bimbosp

Group:
Administrator
Posts:
9,780
Reputation:
+929
Location:
Gallarate (VA)

Status:


Mmmmh, direi di no.
Male che vada poi faccio una guida per spiegare un po' di roba riguardo all'encoding Y410 in cui sfrutterò anche questo filtro, ma di per sé non va spostato lì.
 
Web  Top
view post Posted on 14/11/2012, 16:34     +1   -1
Avatar

Bimbosp

Group:
Administrator
Posts:
9,780
Reputation:
+929
Location:
Gallarate (VA)

Status:


Bumpity bump bump.

CODICE
#HardSub Utilities for P016 v1.2 by mirkosp
#P016 is 16bit YUV 4:2:0, by the way. But if you care about this, you likely knew already.
#And of course I mean dithertools' stacked thing, which technically is
#a stacked 8bit thingie. Dem hacks.
#Requires dithertools. Also vsfilter and/or vsfiltermod for the ass support.
#I haven't done extensive testing, so please report any errors you find.

#First and foremost, rgb32 afx clips
#l is the video to overlay on (typically left to last)
#c is the clip to be overlayed
#s is the frame on which to start the overlay
#e is the frame on which to end the overlay
#I'm nice enough to allow the usage of -num_frames style too, tho.
#sm is the colormatrix and tv is a bool for tv range (true) or not (false).
#You should be using dither_convert_rgb_to_yuv's values for sm, but
#uf you're using avisynth's, I'm doing a somewhat rough check myself.
#This also allows me to just call this function later on for ass hardsubbing...

function rgb32onp016(clip l, clip c, int "s", int "e", string "sm", bool "tv") {
assert(c.isrgb32, "dudeplz.")
assert(l.isyv12, "dudeplz.")
assert(l.width == c.width, "check width")
assert(l.height/2 == c.height, "check height")
tv = defined(tv) ? tv : defined(sm) ? sm == "PC.601" ? false : sm == "PC.709" ? false : tv : true
sm = defined(sm) ? sm == "Rec601" ? "601" : sm == "Rec709" ? "709" : sm == "PC.601" ? "601" : sm == "PC.709" ? "709" : sm : (c.width > 1024 || c.height > 600) ? "709" : "601"
s = default(s,0)
e = default(e,0)
s=s+2
l
e = (e > 0) ? e+2 : (e == 0) ? framecount+1 : e
ps = s-1
pe = (e > 0) ? e+1 : s-e
l = l.trim(0,1)+l+l.trim(0,1) #HAX! I don't feel like doing special case checks. Maybe it executes faster this way, too.
l
sa = l.trim(0,ps).converttorgb32()+stackvertical(c.showalpha("rgb32"),c.showalpha("rgb32"))+last.trim(pe,0).converttorgb32()
oc = l.trim(0,ps)+(c.Dither_convert_rgb_to_yuv(output="yv12",matrix=sm,tv_range=tv).dither_convert_8_to_16())+last.trim(pe,0)
l.trim(0,ps)+ytouv(overlay(last.utoy(),oc.utoy(),mask=sa),overlay(last.vtoy(),oc.vtoy(),mask=sa),overlay(last,oc,mask=sa)).trim(s,e)+l.trim(pe,0)
return trim(2,framecount-3)
}

#And now for the ass functions
#sm is the colormatrix. If left unspecified, it's autoguessed based on res.
#path is the ass' path, hack is for the bt601 typeset deal.
#If the video you have to overlay on is bt709 and you
#have typeset in bt601 to compensate for the old vsfilter,
#set this to true.
#vfr is the path to the timecodes.
#At the time of the writing, softsubbed 4:2:0 is usually overlayed
#as bt601 due to an old vsfilter bug which is by now standard.
#This means that if you have HD video you should set this to true. Default behaviour autoguesses this.
#I'm not 100% sure these work correctly, please report bugs if you encounter them.

function textsubmodonp016(clip cs, string path, string "vfr", string "sm", bool "hack") {
c = cs.ditherpost(mode=8)
sm = defined(sm) ? sm : (c.width > 1024 || c.height > 600) ? "Rec709" : "Rec601"
hack = defined(hack) ? hack : sm == "Rec709" ? true : sm == "PC.709" ? true : false
bc = blankclip(c,pixel_type="RGB32",color=$FF000000)#pure alpha
crgb = hack ? c.converttorgb32(matrix="Rec601") : c.converttorgb32(matrix=sm)
mergeargb(bc.showalpha(),crgb.showred(),crgb.showgreen(),crgb.showblue())
defined(vfr) ? textsubmod(path,vfr=vfr) : textsubmod(path)
mergeargb(showalpha().invert(),showred(),showgreen(),showblue())
savealpha = last
o = converttoyv24(matrix="Rec601").converttorgb32(matrix="Rec709")
return hack ? rgb32onp016(cs,mergeargb(savealpha.showalpha(),o.showred(),o.showgreen(),o.showblue()),sm=sm) : rgb32onp016(cs,last,sm=sm)
}

function textsubonp016(clip cs, string path, string "vfr", string "sm", bool "hack") {
c = cs.ditherpost(mode=8)
sm = defined(sm) ? sm : (c.width > 1024 || c.height > 600) ? "Rec709" : "Rec601"
hack = defined(hack) ? hack : sm == "Rec709" ? true : sm == "PC.709" ? true : false
bc = blankclip(c,pixel_type="RGB32",color=$FF000000)#pure alpha
crgb = hack ? c.converttorgb32(matrix="Rec601") : c.converttorgb32(matrix=sm)
mergeargb(bc.showalpha(),crgb.showred(),crgb.showgreen(),crgb.showblue())
defined(vfr) ? textsub(path,vfr=vfr) : textsub(path)
mergeargb(showalpha().invert(),showred(),showgreen(),showblue())
savealpha = last
o = converttoyv24(matrix="Rec601").converttorgb32(matrix="Rec709")
return hack ? rgb32onp016(cs,mergeargb(savealpha.showalpha(),o.showred(),o.showgreen(),o.showblue()),sm=sm) : rgb32onp016(cs,last,sm=sm)
}


Tools per hardsubbare a 16bit 4:2:0. Sostanzialmente identici a quelli dell'OP, cambiano alcuni dettagli proprio.
Al solito, segnalatemi errori/problemi e vedremo il da farsi.
 
Web  Top
view post Posted on 18/11/2012, 20:48     +3   +1   -1
Avatar

Bimbosp

Group:
Administrator
Posts:
9,780
Reputation:
+929
Location:
Gallarate (VA)

Status:


Nuova versione del 4:2:0, perché c'era un errorone col mask, che m'ero scordato di aggiustare per il chroma. Oops.

CODICE
#HardSub Utilities for P016 v1.3 by mirkosp
#P016 is 16bit YUV 4:2:0, by the way. But if you care about this, you likely knew already.
#And of course I mean dithertools' stacked thing, which technically is
#a stacked 8bit thingie. Dem hacks.
#Requires dithertools. Also vsfilter and/or vsfiltermod for the ass support.
#I haven't done extensive testing, so please report any errors you find.

#First and foremost, rgb32 afx clips
#l is the video to overlay on (typically left to last)
#c is the clip to be overlayed
#s is the frame on which to start the overlay
#e is the frame on which to end the overlay
#I'm nice enough to allow the usage of -num_frames style too, tho.
#sm is the colormatrix and tv is a bool for tv range (true) or not (false).
#You should be using dither_convert_rgb_to_yuv's values for sm, but
#uf you're using avisynth's, I'm doing a somewhat rough check myself.
#This also allows me to just call this function later on for ass hardsubbing...

function rgb32onp016(clip l, clip c, int "s", int "e", string "sm", bool "tv") {
assert(c.isrgb32, "dudeplz.")
assert(l.isyv12, "dudeplz.")
assert(l.width == c.width, "check width")
assert(l.height/2 == c.height, "check height")
tv = defined(tv) ? tv : defined(sm) ? sm == "PC.601" ? false : sm == "PC.709" ? false : tv : true
sm = defined(sm) ? sm == "Rec601" ? "601" : sm == "Rec709" ? "709" : sm == "PC.601" ? "601" : sm == "PC.709" ? "709" : sm : (c.width > 1024 || c.height > 600) ? "709" : "601"
s = default(s,0)
e = default(e,0)
s=s+2
l
e = (e > 0) ? e+2 : (e == 0) ? framecount+1 : e
ps = s-1
pe = (e > 0) ? e+1 : s-e
l = l.trim(0,1)+l+l.trim(0,1) #HAX! I don't feel like doing special case checks. Maybe it executes faster this way, too.
l
sa = l.trim(0,ps).converttorgb32()+stackvertical(c.showalpha("rgb32"),c.showalpha("rgb32"))+last.trim(pe,0).converttorgb32()
oc = l.trim(0,ps)+(c.Dither_convert_rgb_to_yuv(output="yv12",matrix=sm,tv_range=tv).dither_convert_8_to_16())+last.trim(pe,0)
l.trim(0,ps)+ytouv(overlay(last.utoy(),oc.utoy(),mask=sa.reduceby2()),overlay(last.vtoy(),oc.vtoy(),mask=sa.reduceby2()),overlay(last,oc,mask=sa)).trim(s,e)+l.trim(pe,0)
return trim(2,framecount-3)
}

#And now for the ass functions
#sm is the colormatrix. If left unspecified, it's autoguessed based on res.
#path is the ass' path, hack is for the bt601 typeset deal.
#If the video you have to overlay on is bt709 and you
#have typeset in bt601 to compensate for the old vsfilter,
#set this to true.
#vfr is the path to the timecodes.
#At the time of the writing, softsubbed 4:2:0 is usually overlayed
#as bt601 due to an old vsfilter bug which is by now standard.
#This means that if you have HD video you should set this to true. Default behaviour autoguesses this.
#I'm not 100% sure these work correctly, please report bugs if you encounter them.

function textsubmodonp016(clip cs, string path, string "vfr", string "sm", bool "hack") {
c = cs.ditherpost(mode=8)
sm = defined(sm) ? sm : (c.width > 1024 || c.height > 600) ? "Rec709" : "Rec601"
hack = defined(hack) ? hack : sm == "Rec709" ? true : sm == "PC.709" ? true : false
bc = blankclip(c,pixel_type="RGB32",color=$FF000000)#pure alpha
crgb = hack ? c.converttorgb32(matrix="Rec601") : c.converttorgb32(matrix=sm)
mergeargb(bc.showalpha(),crgb.showred(),crgb.showgreen(),crgb.showblue())
defined(vfr) ? textsubmod(path,vfr=vfr) : textsubmod(path)
mergeargb(showalpha().invert(),showred(),showgreen(),showblue())
savealpha = last
o = converttoyv24(matrix="Rec601").converttorgb32(matrix="Rec709")
return hack ? rgb32onp016(cs,mergeargb(savealpha.showalpha(),o.showred(),o.showgreen(),o.showblue()),sm=sm) : rgb32onp016(cs,last,sm=sm)
}

function textsubonp016(clip cs, string path, string "vfr", string "sm", bool "hack") {
c = cs.ditherpost(mode=8)
sm = defined(sm) ? sm : (c.width > 1024 || c.height > 600) ? "Rec709" : "Rec601"
hack = defined(hack) ? hack : sm == "Rec709" ? true : sm == "PC.709" ? true : false
bc = blankclip(c,pixel_type="RGB32",color=$FF000000)#pure alpha
crgb = hack ? c.converttorgb32(matrix="Rec601") : c.converttorgb32(matrix=sm)
mergeargb(bc.showalpha(),crgb.showred(),crgb.showgreen(),crgb.showblue())
defined(vfr) ? textsub(path,vfr=vfr) : textsub(path)
mergeargb(showalpha().invert(),showred(),showgreen(),showblue())
savealpha = last
o = converttoyv24(matrix="Rec601").converttorgb32(matrix="Rec709")
return hack ? rgb32onp016(cs,mergeargb(savealpha.showalpha(),o.showred(),o.showgreen(),o.showblue()),sm=sm) : rgb32onp016(cs,last,sm=sm)
}
 
Web  Top
view post Posted on 11/12/2012, 17:15     +1   -1
Avatar

Member

Group:
Utente abilitato
Posts:
501
Reputation:
+10

Status:


Ci deve essere qualcosa di profondamente assurdo nell'animo delle persone che postano in questo assurdo...
Mi sono messo a rivedere la funzioni che hai scritto, per riorganizzarle un poco, e mi sono imbattuto in un passaggio forse migliorabile.

Nelle funzioni textsubmodony416/textsubony416 ecc. quando converti da YUV a RGB fai sostanzialmente così:
CODICE
output = input.Ditherpost(mode = 8).ConvertToRgb32(matrix="Matrix")
.

Forse non sarebbe meglio usare la funzione diretta sempre del pacchetto dither?
CODICE
output = input.Dither_convert_yuv_to_rgb(lsb_in = true, matrix="Matrix")
 
Top
view post Posted on 11/12/2012, 18:02     +1   -1
Avatar

Bimbosp

Group:
Administrator
Posts:
9,780
Reputation:
+929
Location:
Gallarate (VA)

Status:


Sarebbe matrix=nomevariabile senza virgolette (gli devi passare la variabile, non una stringa col nome della variabile), comunque ricordati di specificare anche mode=8. Inoltre, occhio che il nome delle matrici cambiano, perché dithertools utilizza delle matrici sue, e la matrice la utilizzo per conversioni anche a 8bit, quindi devi aggiungere qualche concatenamento di if in più e possibilmente introdurre un'altra variabile. Fai riferimento all'inizio di rgb32ony416 o rgb32onp016 per l'if (forse c'è un qualche errore residuo o forse l'ho corretto, boh).
TL;DR: Al momento m'era parso più semplice scriverla così, poi che sia possibile ottimizzare in qualche modo penso sia indubbio (soprattutto scrivendolo in un qualche linguaggio di programmazione come C e compilando delle dll al posto di fare degli script, direi).
 
Web  Top
view post Posted on 11/12/2012, 18:29     +1   -1
Avatar

Member

Group:
Utente abilitato
Posts:
501
Reputation:
+10

Status:


CITAZIONE (mirkosp @ 11/12/2012, 18:02) 
Sarebbe matrix=nomevariabile senza virgolette (gli devi passare la variabile, non una stringa col nome della variabile), comunque ricordati di specificare anche mode=8. Inoltre, occhio che il nome delle matrici cambiano, perché dithertools utilizza delle matrici sue, e la matrice la utilizzo per conversioni anche a 8bit, quindi devi aggiungere qualche concatenamento di if in più e possibilmente introdurre un'altra variabile. Fai riferimento all'inizio di rgb32ony416 o rgb32onp016 per l'if (forse c'è un qualche errore residuo o forse l'ho corretto, boh).
TL;DR: Al momento m'era parso più semplice scriverla così, poi che sia possibile ottimizzare in qualche modo penso sia indubbio (soprattutto scrivendolo in un qualche linguaggio di programmazione come C e compilando delle dll al posto di fare degli script, direi).

Si matrix="Matrix" era solo un esempio di possibile utilizzo... non ci presto molta attenzione di solito quando faccio esempi.
Giusta osservazione per mode=8. Leggendo va di default con 6 in effetti.

Beh, che codice compilato sia più veloce di questo non ci sono dubbi. Solo che va riscritto appunto...
 
Top
view post Posted on 17/12/2012, 16:20     +1   -1
Avatar

Member

Group:
Utente abilitato
Posts:
501
Reputation:
+10

Status:


Ma un po' schifo il lettore di codice comunque...
CODICE
e = l.FrameCount + 1
       pe = (e > 0) ? (e + 1) : (2 - e)        
       l = l.Trim(0, 1) + l + l.Trim(0, 1)
       l
       sa = l.Trim(0, 1).ConvertToRgb32()
               \ + StackVertical(d.ShowAlpha("RGB32"), d.ShowAlpha("RGB32"))
               \ + last.Trim(pe, 0).ConvertToRGB32()
       oc = l.trim(0, 1)
               \ + d.Dither_convert_rgb_to_yuv(output = "YV12", matrix = matrix, tv_range = tv).Dither_convert_8_to_16()
               \ + last.Trim(pe, 0)
       l.Trim(0, 1)
               \ + YtoUV(overlay(last.UtoY(), oc.UtoY(), mask = sa.ReduceBy2()),
                       \ overlay(last.vtoy(), oc.vtoy(), mask = sa.ReduceBy2()),
                       \ overlay(last, oc, mask = sa)).trim(2, e)
               \ + l.Trim(pe, 0)
       return trim(2, framecount - 3)

Perché fai una cosa del genere (più o meno nelle funzioni che hai postato) per convertire da RGB di nuovo YUV?
Non riesco a comprenderlo... :/
 
Top
23 replies since 29/8/2012, 20:27   2425 views
  Share