Log in

View Full Version : Dark blocks in veryslow and placebo preset with Authors.avs


alwa
17th August 2009, 13:21
Hi,
i recently did some testing with x264 and i found something strange. For my tests i used a modified version of the Authors.avs from the Avisynth example directory:

ovText = "AviSynth Authors:"+chr(13)+
\ "----------------------------"+chr(13)+
\ "Ben Rudiak-Gould"+chr(13)+
\ "Klaus Post"+chr(13)+
\ "Richard Berg"+chr(13)+
\ "Dividee"+chr(13)+
\ "Ian Brabham"+chr(13)+
\ "David Pierre"+chr(13)+chr(13)+
\ "Documentation:"+chr(13)+
\ "----------------------------"+chr(13)+
\ "Wilbert Dijkhof"+chr(13)+
\ "Jonathan Ernst"+chr(13)+
\ "Ernst Peche"+chr(13)+
\ "Alexander Balakhnin"+chr(13)+
\ "Alex_e_Basta"+chr(13)+
\ "Arne Stäcker"+chr(13)+chr(13)+
\ "Contributions by:"+chr(13)+
\ "----------------------------"+chr(13)+
\ "Avery Lee, Milan, Naoki Shibata, "+chr(13)+
\ "Peter Pawlowski, Olli Parviainen,"+chr(13)+
\ "Nicolas Capens, DevIL team,"+chr(13)+
\ "Donald Graft, poptones, ARDA"+chr(13)+
\ "Kevin Atkinson, tritical, many more..."+chr(13)+chr(13)+
\ "Thanks to:"+chr(13)+
\ "----------------------------"+chr(13)+
\ "Everyone contributing to the project,"+chr(13)+
\ "Doom9 & team, kwag, stickboy"+chr(13)+
\ ""


Blankclip(length=128, width=32,height=32, fps=25)
converttoyuy2()
Coloryuv(showyuv=true)
bg = loop(last + reverse(), 10)

c = framecount(bg)
t_mask = messageclip(ovText, height=c).converttoyv12().coloryuv(levels="tv->pc").trim(0,1)
t_blank = blankclip(t_mask, color=$ffffff)

t_mask_bl = t_mask.blur(1.0).blur(1.0).blur(1.0)

overlay(bg, t_mask_bl, mode="subtract")
overlay(t_blank, mode="blend", mask=t_mask)

frameevaluate("ol_x_offset = 40")
frameevaluate("ol_y_offset = 256 - (current_frame)")

fadeio(15)
trim(0,499)
converttoyv12()


When i encode the script with defaults everything is fine, but encodes with the veryslow or the placebo preset some dark blocks flashing up at the edges.

http://img5.imagebanana.com/img/oyktjl65/snap.jpg.png

Can anyone recreate this behaviour? Is this a bug of x264 :confused: .

I used the x264.nl unpatched build and JEEB's build of r1210 with the same result. My processor is a C2Q 9550 not overclocked.
Commandline:
x264.exe --preset veryslow -o out.mkv Authors.avs

Thanks in advance.

Underground78
17th August 2009, 15:52
I can reproduce this behaviour.

The blocks are visible with --preset veryslow but they seems to disappear when I add --b-adapt 1 or --subme 9 or --trellis 1 ... I hope it can help a bit to find the cause.

MasterNobody
17th August 2009, 16:25
Probably, it is already known and locally fixed bug of --subme 10.

Oops. It doesn't fix this. Then it is something other.

LoRd_MuldeR
17th August 2009, 16:55
I can reproduce the problem too. Doesn't look like expected behavior. Sample here:

http://www.mediafire.com/file/y2zqzimjywq/authors.7z

Betsy25
17th August 2009, 17:28
Does it happen with a non -mb-tree version too ?

Underground78
17th August 2009, 17:32
It seems it doesn't ...

The blocks are visible with --preset veryslow but they seems to disappear when I add -b 7 or --b-adapt 1 or --subme 9 or --trellis 1 or --no-mbtree [...]

alwa
17th August 2009, 17:42
It does happen with mbtree turned off, at least in my tests. But it occurs at different positions in the video.http://img5.imagebanana.com/img/tzkwicd/snapnombtree.png

Underground78
17th August 2009, 17:46
Damm, you are right. I've corrected my post ...

Groucho2004
17th August 2009, 17:46
It does happen with mbtree turned off, at least in my tests. But it occurs at different positions in the video.http://img5.imagebanana.com/img/tzkwicd/snapnombtree.png

Confirmed.

I just tried r1195 with preset "slower" - bitrate is a bit higher but it does not have that problem at all.

Edit: Ok, tried r1195 with preset "placebo" - the blocks are even worse than with r1210. Weird.

MasterNobody
17th August 2009, 18:01
It is --subme 10 bug (but it need little bit more to fix it than I think before).

Daemon404
17th August 2009, 18:08
I also noticed this in one encode of mine, but I completely forgot about it till now.

Screenshot:

http://xs842.xs.to/xs842/09341/brocks506.png

x264 settings (I did not save my exact parameters):

x264 - core 69 r1198M a1ed468 - H.264/MPEG-4 AVC codec - Copyleft 2003-2009 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:-2:-1 analyse=0x3:0x133 me=tesa subme=10 psy=1 psy_rd=1:0.0 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 chroma_qp_offset=-4 threads=6 nr=0 decimate=0 mbaff=0 bframes=16 b_pyramid=0 b_adapt=2 b_bias=0 direct=3 wpredb=1 keyint=300 keyint_min=30 scenecut=40 rc_lookahead=250 rc=2pass mbtree=1 bitrate=900 ratetol=1.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 aq=1:0.50

It should also be noted that this occurred during a fade, and was not there upon re-encode.

Dark Shikari
17th August 2009, 18:15
Known issue; already fixed locally.

creamyhorror
17th August 2009, 18:31
Just curious, but for what revisions has this bug existed?

Dark Shikari
17th August 2009, 18:34
Just curious, but for what revisions has this bug existed?Only with QPRD, since it was committed.

Also, I apologize for all the stupid bugs lately, so a nice gift is coming in r1209.

Underground78
17th August 2009, 18:37
1219 maybe ? 1209 seems to be : "Add no-mbtree to fprofile (and fix pyramid in fprofile)" ...

moviefan
17th August 2009, 18:37
Known issue; already fixed locally.

Locally means not yet commited to the repository? Thus not included in any of the currently compiled versions?

microchip8
17th August 2009, 18:49
Locally means not yet commited to the repository? Thus not included in any of the currently compiled versions?

what else do you think locally means?

Dark Shikari
17th August 2009, 18:53
1219 maybe ? 1209 seems to be : "Add no-mbtree to fprofile (and fix pyramid in fprofile)" ...Make that 1213, I can't count.

juGGaKNot
17th August 2009, 18:55
On the devs pc and not in the git i guess.

Fr4nz
17th August 2009, 19:40
Only with QPRD, since it was committed.

Also, I apologize for all the stupid bugs lately, so a nice gift is coming in r1209.

Why apologize? You're still the best :D

juGGaKNot
17th August 2009, 19:53
Why apologize? You're still the best :D

He just finished a 10l cola and now thing will be back to normal + wp

ajp_anton
17th August 2009, 20:14
Only with QPRD, since it was committed.

Also, I apologize for all the stupid bugs lately, so a nice gift is coming in r1209.Does that mean that you have a few "nice gifts" that you hide from the public until you do something stupid and need them to calm people down? =)

Dark Shikari
17th August 2009, 20:27
Does that mean that you have a few "nice gifts" that you hide from the public until you do something stupid and need them to calm people down? =)Nah, I just spent the past 5 days cooking up a surprise ;)

juGGaKNot
17th August 2009, 20:32
wp + a gift ? you know how to charm us.

shon3i
17th August 2009, 20:43
Also, I apologize for all the stupid bugs lately, so a nice gift is coming in r1209. Slices support, weighted p prediction? :)

Underground78
17th August 2009, 20:46
If I'm not mistaken, revision 1213 is Lookahead VBV (http://git.videolan.org/gitweb.cgi?p=x264.git;a=commit;h=1b6086ceb0c346c959a68478b9c36284fbdd5872).

Edit : Link to the announcement thread : x264 development: Lookahead VBV (http://forum.doom9.org/showthread.php?p=1315808#post1315808)

creamyhorror
18th August 2009, 09:57
Nah, I just spent the past 5 days cooking up a surprise ;)
Looking forward to it. Thanks for all the hard work.

roozhou
18th August 2009, 13:12
He just finished a 10l cola and now thing will be back to normal + wp

Could anybody explain to me what does "10l", "100l" mean? I have seen them many times in x264 and ffmpeg repository.

Underground78
18th August 2009, 13:23
See here (http://forum.doom9.org/showthread.php?p=1310034#post1310034) and here (http://forum.doom9.org/showthread.php?p=1218259#post1218259) ...

LoRd_MuldeR
18th August 2009, 13:23
Could anybody explain to me what does "10l", "100l" mean? I have seen them many times in x264 and ffmpeg repository.

http://forum.doom9.org/showpost.php?p=1310035&postcount=736

Jenyok
10th December 2011, 14:12
Another Authors2.avs script...
For your use...
Any your sentences and critics are welcomed !!!
.

# Authors2.avs
#

LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\GSCRIPT_11\gscript.dll")



ovText = "AviSynth Authors:"+chr(13)+
\ "----------------------------"+chr(13)+
\ "Ben Rudiak-Gould\n"+chr(13)+
\ "Klaus Post"+chr(13)+
\ "Richard Berg"+chr(13)+
\ "Dividee"+chr(13)+
\ "Ian Brabham"+chr(13)+
\ "David Pierre\n"+chr(13)+
\ "Documentation:"+chr(13)+
\ "----------------------------"+chr(13)+
\ "Wilbert Dijkhof"+chr(13)+
\ "Jonathan Ernst"+chr(13)+
\ "Ernst Peche"+chr(13)+
\ "Alexander Balakhnin"+chr(13)+
\ "Alex_e_Basta"+chr(13)+
\ "Arne Stфcker"+chr(13)+chr(13)+
\ "Contributions by:"+chr(13)+
\ "----------------------------"+chr(13)+
\ "Avery Lee, Milan, Naoki Shibata, "+chr(13)+
\ "Peter Pawlowski, Olli Parviainen,"+chr(13)+
\ "Nicolas Capens, DevIL team,"+chr(13)+
\ "Donald Graft, poptones, ARDA"+chr(13)+
\ "Kevin Atkinson, tritical, many more..."+chr(13)+chr(13)+
\ "Thanks to:"+chr(13)+
\ "----------------------------"+chr(13)+
\ "Everyone contributing to the project,"+chr(13)+
\ "Doom9 & team, kwag, stickboy,"+chr(13)+
\ "Jenyok & C°\n"
# \ "Jenyok & C°"



function MessageClip2(clip c, string text, int "x", int "y", int "dy", int "first_frame", int "last_frame", string "font", \
float "size", int "text_color", int "halo_color", int "align", int "spc", \
float "font_width", float "font_angle", bool "interlaced", int "back_color", string "pixel_type")
{
last = c
dy = Default(dy, size)
y = Default(y, int(size))
pixel_type = Default(pixel_type, "YUY2")
text_color = Default(text_color, $FFFFFF) # White color text by default...
back_color = Default(back_color, $000000) # Black color background by default...
StrLen2 = StrLen(text)
StrChr13 = String(Chr(13))
StrSlashN = "\n" # As C++ new line string
ClipLength = 2
Str1 = "" # Temporary string
Str2 = "" # Temporary string
StrSum = 0 # Number of substrings in string
i = 1 # Index i
j = 1 # Index j
k = 1 # Index k

# Count SubStrings in String...
# End of SubString are "\n" or/and Chr(13), see Code function...
#
GScript("""
while (i <= StrLen2)
{
Str1 = MidStr(text, i, 1)
Str2 = MidStr(text, i, 2)
if (Str2 == StrSlashN) {
Str1 = StrChr13
i = i + 1
} # End of if ()
if ((Str1 == StrChr13) || (i == StrLen2)) {
StrSum = StrSum + 1
} # End of if ()
i = i + 1
Str1 = ""
Str2 = ""
} # End of while ()
""") # End of GScript ()

# Calculate Height of Video Clip...
#
CHeight = int(StrSum * size)
CHeight = CHeight + int((StrSum + 1) * dy * 0.125) # 0.125 pixel's interval, see documentation to BlankClip() function ...
BlankClip(last, length=ClipLength, height=CHeight, color=back_color, pixel_type=pixel_type)

# Insert SubStrings to Video with SubTitle() function...
#
Str1 = "" # Temporary string
Str2 = "" # Temporary string
i = 1 # Index i
GScript("""
while (i <= StrLen2)
{
Str1 = MidStr(text, i, 1)
Str2 = MidStr(text, i, 2)
if (Str2 == StrSlashN) {
Str1 = StrChr13
i = i + 1
} # End of if ()
if ((Str1 == StrChr13) || (i == StrLen2)) {
if ((Str1 != StrChr13) && (i == StrLen2)) {
k = k + 1
} # End of if ()
Str1 = ""
Str1 = MidStr(text, j, k - 1)
SubTitle(last, Str1, x=x, y=y, first_frame=first_frame, last_frame=last_frame, \
font=font, size=size, text_color=text_color, halo_color=halo_color, \
align=align, spc=spc, font_width=font_width, font_angle=font_angle, \
interlaced=interlaced)
j = i + 1
k = 0
y = y + dy
} # End of if ()
i = i + 1
k = k + 1
Str1 = ""
Str2 = ""
} # End of while ()
""") # End of GScript ()
return last
}





# Constants
#
W768 = 768 # Clip size Width
H576 = 576 # Clip size Height
FPSVideo = 25.0
FPSDenominator = 1
PixelType = "YUY2"
NChannels = 2
AudioRate = 44100

LengthClip = 2048 # !!! You must "select" this value for scrolling all text in video clip from bottom to top ...

BackGround = $000000 # Background color ...
TextColor = $FFFFFF # White (Yellow) or other TEXT color for scrolling ...

# Constants
#
Speed = "" # High or Low or nothing ...
SpeedValue = 4 # Must be betwwen 1..20, maybe more than 20 ...

# Constants
#
ShiftX = 8
ShiftY = 6


Speed = UCase(Speed)
SpeedValue = (SpeedValue <= 1) ? 1 : (SpeedValue > 20) ? 20 : SpeedValue


BlankClip(length=LengthClip, width=W768, height=H576, fps=FPSVideo, fps_denominator=FPSDenominator, \
audio_rate=AudioRate, channels=NChannels, pixel_type=PixelType, color=BackGround)


# ONLY For demonstration ...
#
#ColorYUV(showyuv=true).Spline64Resize(W768, H576, src_width=Width(last), src_height=Height(last)) # W768 x H576


t_mask = MessageClip2(last, ovText, size=30, align=8, text_color=TextColor, \
back_color=BackGround, pixel_type=PixelType).ColorYUV(levels="tv->pc").Trim(0, 1) # See documentation to SubTitle() function ...

t_blank = BlankClip(t_mask, color=TextColor)
t_mask_bl = t_mask.blur(1.0).blur(1.0).blur(1.0)

Overlay(last, t_mask_bl, mode="subtract")
Overlay(last, t_blank, mode="blend", mask=t_mask)


#FrameEvaluate("ol_x_offset = 20") # No more times needed ...

(Speed == "HIGH") ? \
FrameEvaluate("ol_y_offset = H576 - ((current_frame) * SpeedValue)") : \
(Speed == "LOW") ? \
FrameEvaluate("ol_y_offset = H576 - ((current_frame) / SpeedValue)") : \
FrameEvaluate("ol_y_offset = H576 - (current_frame)")


#Spline64Resize(W768-ShiftX, H576-ShiftY, src_width=Width(last), src_height=Height(last))
#BClip=BlankClip(length=LengthClip, width=W768, height=H576, fps=FPSVideo, fps_denominator=FPSDenominator, \
# audio_rate=AudioRate, channels=NChannels, pixel_type=PixelType, color=BackGround)
#Overlay(BClip, last, 0, ShiftY / 2)



#last = t_mask # For debuging ...
#ConvertToYUY2() # For debuging ...

.
What is needed (wanted) more ?
There is needed Scrolling Text in frame window not from bottom frame edge to top frame edge,
but from bottom frame edge with (+) Shift Y to top frame edge without (-) Shift Y !!!
I didn't found directly decision of this problem...
.
See comments in Code...
.
#Spline64Resize(W768-ShiftX, H576-ShiftY, src_width=Width(last), src_height=Height(last))
#BClip=BlankClip(length=LengthClip, width=W768, height=H576, fps=FPSVideo, fps_denominator=FPSDenominator, \
# audio_rate=AudioRate, channels=NChannels, pixel_type=PixelType, color=BackGround)
#Overlay(BClip, last, 0, ShiftY / 2)