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. |
28th May 2009, 22:46 | #63 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
Honestly, I don't know the idx format and I don't use VobSub. Apparently, the idx file contains the indexes to each subtitle of the sub file, but I don't know if it holds a CLUT. If it's the case, I can try to implement a function to import its color palette in PgcEdit, but I need more info. I haven't been able to find a doc about the file format. Can you help me? Can you send me an example?
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV |
28th May 2009, 23:35 | #64 | Link |
Registered User
Join Date: May 2008
Posts: 1,840
|
Sure here's a sample.
I'm guessing this line is all that needs to be read: palette: 000000, cbcbcb, 000000, 000000, 000000, d6ec38, 000000, 000000, 000000, cbcbcb, 000000, 000000, 000000, cbcbcb, 000000, 000000 Thanks for looking into it. |
29th May 2009, 00:33 | #65 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
Yep, thanks. I guess the colors are expressed in RGB values. Most of the colors are black, plus 3 light greys and a yellow. Can you confirm that?
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV |
29th May 2009, 12:04 | #66 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
OK, done. You will be able to import the palette from a VobSub index file with the next version of PgcEdit.
In attachment is the example palette you gave me, converted to the PgcEdit YCrCb raw format (VTS_05_0.clb). Please confirm that it is correct. Thanks.
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV Last edited by r0lZ; 29th May 2009 at 16:48. |
29th May 2009, 16:44 | #68 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
Oops, my bad. I forgot to accept the changes after having imported the IDX and before exporting the CLB, and, of course, PgcEdit has saved the original palette of my test DVD. I've updated the ZIP two posts above with the right CLB, but given your screenshot, I can confirm that it works well.
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV |
29th May 2009, 19:11 | #70 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
Currently, I haven't much time, but I should release it soon...
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV |
30th May 2009, 15:35 | #72 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
Some little errors are due to rounding problems when converting the YCrCb format to or from RGB. The conversion algorythms used by PgcEdit are correct, and they have already been verified several times. Of course, a little difference is still possible, and inevitable by nature, but it should never be superior to 1 (or -1).
Anyway PgcEdit is right: Code:
palette: 000000, cbcbcb, 000000, 000000, 000000, d6ec38, [...] The little difference in the red and blue component of the yellow slot are due to the rounding errors when the RGB values are converted back to YCrCb, and cannot be avoided. BTW, how have you produced your ORIGINAL screenshots of the color picker? Obviously, they do not match the IDX file.
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV Last edited by r0lZ; 30th May 2009 at 15:50. |
30th May 2009, 16:16 | #73 | Link |
Registered User
Join Date: May 2008
Posts: 1,840
|
Original comes from original DVD.
I used vobsub 2.33 to create the idx. I also tried vsrip and the original DVD palette line was identical. However the custom colors line changed but does this have any effect in this situation? I'm only using DVD to DVD for testing purposes now, if that was all I ever wanted to do I'd use pgcedit color copy/paste. My goal is to be able to do BD to DVD conversions with the most original looking subtitles as possible. My only option currently is BD sup -> vobsub -> DVD sup. This result is plenty good enough for this particular DVD, it only uses grey and I have trouble telling the difference. However in a situation with colored subs I wonder if there's situations where it could look pretty ugly. Last edited by turbojet; 30th May 2009 at 16:29. |
30th May 2009, 19:40 | #74 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
And displayed by PgcEdit? Right? Then it's the proof that VS doesn't generate its IDX file with the right values, or at least that it uses another formula than PgcEdit to do the conversion. Unfortunately, they store the values in the IDX file in already-converted RGB instead of the original YCrCb, therefore I can't use my own formula to convert and display them. I just take the RGB values from the IDX files, and display them unmodified. They are converted back to YCrCb when you click OK in the PGC Editor window. Of course, since the formula used by SubRip is not the same, that operation introduces an error.
There are many different formulas to convert from YCrCb to RGB and vice-versa, and I cannot be totally sure that PgcEdit uses the right one, but as I said previously, the PgcEdit formulas have been checked by several users and they seem to be accurate. Anyway, I'm not going to change them, unless someone can prove that they are wrong, and give me the right formulas. BTW, can you send me the original palette, extracted by PgcEdit in raw .CLB format? They are the original YCrCb colors, directly extracted from the DVD, without any conversion. I would like to have a look.
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV Last edited by r0lZ; 30th May 2009 at 19:49. |
31st May 2009, 10:26 | #75 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
I've double-checked again the conversion formulas, and I use (almost) exactly the formulas recommended in Keith Jack's Video Demystified to convert between 8-bit digital RGB (full 0-255 range) and YCrCb (SDTV 601). If you are interested, here are the formulas:
Code:
Y = 0.257*R + 0.504*G + 0.098*B + 16 (rounded, and clipped to valid range 16-235) Cr = 0.439*R - 0.368*G - 0.071*B + 128 (rounded, and clipped to valid range 16-240) Cb = -0.148*R - 0.291*G + 0.439*B + 128 (rounded, and clipped to valid range 16-240) R = 1.164*(Y-16) + 1.596*(Cr-128) G = 1.164*(Y-16) - 0.813*(Cr-128) - 0.391*(Cb-128) B = 1.164*(Y-16) + 2.018*(Cb-128) (All RGB values are rounded and clipped to valid range 0-255) Code:
G = 1.164*(Y-16) - 0.813*(Cr-128) - 0.392*(Cb-128) B = 1.164*(Y-16) + 2.017*(Cb-128) Anyway, I have fixed those errors now, as Video Demystified is cited as THE reference book by many specialists, and I trust it. Additional note: Do NOT trust the converters at DVD Replica (YCrCb to RGB and RGB to YCrCb), as they are wrong (and there is a bug in the RGB to YCrCb applet preventing to specify a R value > 0).
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV Last edited by r0lZ; 31st May 2009 at 10:41. |
1st June 2009, 18:49 | #76 | Link | |
Registered User
Join Date: May 2008
Posts: 1,840
|
Quote:
Did it have any effect on the output? |
|
1st June 2009, 19:06 | #77 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
Thanks!
Perhaps some minimal effects on the rounding of the divisions, but certainly no more than a difference of 1 in each RGB component. As I said before, those rounding errors are inevitable. The new formulas are perhaps more accurate, and may avoid some rounding errors, but probably not all. Anyway, it's not a solution for the IDX problem. [EDIT] I've just imported the original palette in a DVD to verify the values. Of course, PgcEdit shows the colors like in your ORIGINAL screenshots above. (And BTW the difference in the formulas have no effects on the result.) So, IMO, VobSub should store 218, 204, 38 (DACC26) for the yellow and 204, 204, 204 (CCCCCC) for the greys in the IDX files (or store the original YCrCb values instead of already converted RGB values), but it stores the wrong values D6EC38 and CBCBCB. Black is correctly converted to 000000. The greys are close enough to the original, but the yellow is very different. That's not surprising, as the difficulty with the conversions is the color components. Unfortunately, I can't do much more. If you wish, try to contact the author of VobSub...
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV Last edited by r0lZ; 1st June 2009 at 19:49. |
1st June 2009, 19:53 | #79 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,469
|
No, my bad. I mean VobSub, of course. (I've fixed the "typo")
Unfortunately, if the development of VobSub has ceased, I suppose there is no simple solution. Try to find a program that can output the original palette in YCrCb format. If you need it, I can probably implement an import function in PgcEdit.
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV |
|
|