Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th August 2016, 11:25   #1  |  Link
EruPii
Registered User
 
Join Date: Jan 2014
Location: Hungary
Posts: 13
Chroma bug in anime

Hello,

I have an anime DVD source which looks like interlaced video but it's not. The problem is the same as in this archived thread: http://forum.doom9.org/showthread.php?t=163937. I tried the code Didée wrote in it but didn't help (after encoding the source the result will be crappy with only chroma frames).

I bobbed the source and saw that the chroma is swapped between frames. Can't we solve the problem somehow if we Bob it or use SeparateFields, swap the chroma of the frames and use Weave or change the frame rate back to 29.970 fps in any other way?

I attached wrong frames from the bobbed source. Also, the source can be downloaded here: https://mega.nz/#!cc53iYCb!rg_42zzJw...NnEFtQK2HpG4co

Thank you for your answer in advance.
Attached Images
    

Last edited by EruPii; 28th August 2016 at 11:50.
EruPii is offline   Reply With Quote
Old 28th August 2016, 15:59   #2  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 846
try this
Code:
orig = last
sanimebob()
chroma_rep()
getparity(orig) ? interlaced60or50 : interlaced60or50(bff=true)
__________________
My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 28th August 2016, 22:11   #3  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 610
You should've cut a sample using DGIndex or another tool instead of posting the entire 800MB episode.

The problem is that they took the hard-telecined source and encoded it in progressive mode, BTW:

Code:
Format                         : MPEG-PS
File size                      : 842 MiB
Duration                       : 23mn 25s
Overall bit rate mode          : Variable
Overall bit rate               : 5 024 Kbps

Video
ID                             : 224 (0xE0)
Format                         : MPEG Video
Format version                 : Version 2
Format profile                 : Main@Main
Format settings, BVOP          : Yes
Format settings, Matrix        : Custom
Format settings, GOP           : Variable
Duration                       : 23mn 25s
Bit rate mode                  : Variable
Bit rate                       : 4 700 Kbps
Maximum bit rate               : 9 800 Kbps
Width                          : 720 pixels
Height                         : 480 pixels
Display aspect ratio           : 4:3
Frame rate                     : 29.970 fps
Standard                       : NTSC
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Progressive
Scan order                     : Top Field First
Compression mode               : Lossy
Bits/(Pixel*Frame)             : 0.454
Time code of first frame       : 00:00:00:00
Time code source               : Group of pictures header
GOP, Open/Closed               : Open
GOP, Open/Closed of first fram : Closed
Stream size                    : 788 MiB (94%)
ChiDragon is offline   Reply With Quote
Old 29th August 2016, 17:05   #4  |  Link
FranceBB
FranceBB
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Germany
Posts: 198
@chidragon... exactly.
Interlaced source encoded as progressive, with the chroma expanded between fields. There isn't much you can do to fix it...
FranceBB is offline   Reply With Quote
Old 29th August 2016, 21:46   #5  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 846
Quote:
Originally Posted by FranceBB View Post
@chidragon... exactly.
Interlaced source encoded as progressive, with the chroma expanded between fields. There isn't much you can do to fix it...
this code can (in most frames)

Code:
MPEG2Source("hhws_ep37.d2v")
orig = last
sanimebob()
chroma_rep(10)
getparity(orig) ? interlaced60or50 : interlaced60or50(bff=true)
FrameCache(10)

# next lines from http://forum.doom9.org/showpost.php?...50&postcount=6 with some edit

luma   = AnimeIVTC(1,chroma=false,mchroma=false,o3025cfr=true)
chroma = vinverse().Srestore(omode="PP3", cache=10)

# manual sync: figure out which frame (previous,current aka p,c) of 'chroma' clip is most similar to current frame of 'luma' clip

# 46*log(|x-y|+1) uses the full [0,255]-range and scales little differences better than |x-y|*2
diffp = mt_lutxy(luma,chroma.selectevery(1,-1),"x y - abs 1 + log 46 *")
diffc = mt_lutxy(luma,chroma,                  "x y - abs 1 + log 46 *")

# average difference between compared frames
mp = mt_lutf(diffp,diffp,"avg",expr="x")
mc = mt_lutf(diffc,diffc,"avg",expr="x")

# build conditional masks based on the caculated comparisons
maskp = mt_lutxy(mp,mc,"x y < 255 0 ?")

# finally merge the luma of the tfm with the chroma of the srestore clip accordingly to the binary mask
mt_merge(luma,chroma.selectevery(1,-1),maskp,luma=true,Y=2,U=3,V=3)

tdecimate(1)
smam(filter=daa3mod())
The result http://www.solidfiles.com/v/RqQ2WmWMLq3Gk
__________________
My Avisynth Stuff

Last edited by real.finder; 31st December 2016 at 17:28.
real.finder is offline   Reply With Quote
Old 31st August 2016, 11:57   #6  |  Link
EruPii
Registered User
 
Join Date: Jan 2014
Location: Hungary
Posts: 13
Yup, I know my source sucks much a**, but it's my only source.
Thanks real.finder, I'll try your code as soon as I can.
EruPii is offline   Reply With Quote
Old 16th September 2016, 23:06   #7  |  Link
EruPii
Registered User
 
Join Date: Jan 2014
Location: Hungary
Posts: 13
It's almost good, the problem is that I get these kind of frames in part of the video. Maybe chroma_rep doesn't work fully correctly. Does somebody have some kind of solution for this? Thank you for your reply in advance.
Attached Images
  
EruPii is offline   Reply With Quote
Old 16th September 2016, 23:25   #8  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 447
Try this: Here
__________________
By law and justice!

Flea Market
GMJCZP is offline   Reply With Quote
Old 17th September 2016, 10:21   #9  |  Link
EruPii
Registered User
 
Join Date: Jan 2014
Location: Hungary
Posts: 13
I'm using that script real.finder pasted here which contains the script you linked here. My problem is with this code block:
Code:
orig = last
sanimebob()
chroma_rep(10)
getparity(orig) ? interlaced60or50 : interlaced60or50(bff=true)
FrameCache(10)
I think the function in bold characters might not work correctly, even with its default parameter values. When I commented it out, that frame was correct, but some frames directly after scene changes were wrong.

Last edited by EruPii; 17th September 2016 at 10:22. Reason: adding information
EruPii is offline   Reply With Quote
Old 18th September 2016, 01:47   #10  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 846
Quote:
Originally Posted by EruPii View Post
I'm using that script real.finder pasted here which contains the script you linked here. My problem is with this code block:
Code:
orig = last
sanimebob()
chroma_rep(10)
getparity(orig) ? interlaced60or50 : interlaced60or50(bff=true)
FrameCache(10)
I think the function in bold characters might not work correctly, even with its default parameter values. When I commented it out, that frame was correct, but some frames directly after scene changes were wrong.
yes, it will not work in 60i, it work only in pure Telecine

that why I add other code in bottom
__________________
My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 18th September 2016, 21:06   #11  |  Link
EruPii
Registered User
 
Join Date: Jan 2014
Location: Hungary
Posts: 13
Quote:
Originally Posted by real.finder View Post
yes, it will not work in 60i, it work only in pure Telecine

that why I add other code in bottom
Oh, thanks. But could you tell me where I can get "Hqdn3dY"? I googled it but I got no download links.
EruPii is offline   Reply With Quote
Old 18th September 2016, 21:14   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,161
Dont know about hqdn3dY (The Y is unknown to me), but Hqdn3d can be found here:- http://avisynth.nl/index.php/Externa...oral_Denoisers

EDIT: I dont see hqdn3d in this thread anyway (apart from your prev post [with/without the Y]).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but are any of them infinitely bigger ???

Last edited by StainlessS; 18th September 2016 at 22:00.
StainlessS is offline   Reply With Quote
Old 18th September 2016, 22:17   #13  |  Link
EruPii
Registered User
 
Join Date: Jan 2014
Location: Hungary
Posts: 13
Quote:
Originally Posted by StainlessS View Post
Dont know about hqdn3dY (The Y is unknown to me), but Hqdn3d can be found here:- http://avisynth.nl/index.php/Externa...oral_Denoisers

EDIT: I dont see hqdn3d in this thread anyway (apart from your prev post [with/without the Y]).
This line needs hqdnd3dy:
Code:
smam(filter="daa3mod()")
EruPii is offline   Reply With Quote
Old 19th September 2016, 06:22   #14  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 846
Quote:
Originally Posted by EruPii View Post
This line needs hqdnd3dy:
Code:
smam(filter="daa3mod()")
http://web.archive.org/web/201602211...ins/Hqdn3dY.7z

but it's not the last one but work here
__________________
My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 19th September 2016, 07:49   #15  |  Link
EruPii
Registered User
 
Join Date: Jan 2014
Location: Hungary
Posts: 13
Quote:
Originally Posted by real.finder View Post
http://web.archive.org/web/201602211...ins/Hqdn3dY.7z

but it's not the last one but work here
Thanks!
EruPii is offline   Reply With Quote
Old 21st September 2016, 12:24   #16  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 846
I upload the last one I have in Attachments
Attached Files
File Type: 7z Hqdn3dY.7z (125.3 KB, 270 views)
__________________
My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 22nd September 2016, 15:48   #17  |  Link
EruPii
Registered User
 
Join Date: Jan 2014
Location: Hungary
Posts: 13
Thanks. I put the line
Code:
smam(filter="daa3mod()")
into the script, but when I try to pan or encode the source Avisynth returns with an error: RequestLinear: internal error (frame not cached)! after some frames. What can I do against it?
EruPii is offline   Reply With Quote
Old 22nd September 2016, 16:30   #18  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 846
Quote:
Originally Posted by EruPii View Post
Thanks. I put the line
Code:
smam(filter="daa3mod()")
into the script, but when I try to pan or encode the source Avisynth returns with an error: RequestLinear: internal error (frame not cached)! after some frames. What can I do against it?
this should not happened since I add FrameCache(10)

anyway this is normal http://forum.doom9.org/showpost.php?...1&postcount=81
__________________
My Avisynth Stuff
real.finder is offline   Reply With Quote
Reply

Tags
anime, chroma, chroma bug, dvd

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:31.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.