TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua

标题: [tcaxLib] Parsing TCAS_BUF [打印本页]

作者: milkyjing    时间: 2012-3-1 23:10:00     标题: [tcaxLib] Parsing TCAS_BUF

in tcaxPy_Main:

TCAS_BUF = []

temp = []
tcas_main(temp,...)
.....

TCAS_BUF.extend(tcas_parse(temp, width, height, fps))

return (None, TCAS_BUF)



in tcaxPy_User:

you can use TCAS_BUF.extend(), or simply write the parsed buf to file.




the tcas_parse() function receives a TCAS_BUF, with resolution and fps,  and returns a linear TCAS_BUF


作者: milkyjing    时间: 2012-4-24 22:58:44     标题: What's in TCAS_BUF

it's a python list, which has the following structure (according to the pseudo-code).
  1.                 pixDip = PyTuple_New(7);
  2.                 PyTuple_SET_ITEM(pixDip, 0, PyLong_FromLong(start));
  3.                 PyTuple_SET_ITEM(pixDip, 1, PyLong_FromLong(end));
  4.                 PyTuple_SET_ITEM(pixDip, 2, PyLong_FromUnsignedLong(layer_type_pair));
  5.                 PyTuple_SET_ITEM(pixDip, 3, PyLong_FromLong(posX));
  6.                 PyTuple_SET_ITEM(pixDip, 4, PyLong_FromLong(posY));
  7.                 PyTuple_SET_ITEM(pixDip, 5, PyLong_FromLong(color));
  8.                 PyTuple_SET_ITEM(pixDip, 6, PyLong_FromLong(alpha));
  9.                 PyList_Append(tcasList, pixDip);
  10.                 Py_CLEAR(pixDip);
复制代码
[(start, end, ltp, posX, posY, color, alpha), ...]


作者: milkyjing    时间: 2012-4-25 12:32:30     标题: the process of parsing

1. get the TCAS_BUF as input of tcas_parse, with extra parameters (resolution and fps)
2. use _tcaxlib_convert_tcas_list_to_buf function to create the TCAS_BUF to uncompressed tcas buffer.
3. use libtcas_compress_raw_chunks function to compress the uncompressed tcas buffer to compressed tcas buffer.
4. libtcas_stream_parser_init & libtcas_stream_parser_parse & libtcas_stream_parser_fin functions to parse the compressed tcas buffer and convert to vector of parsed chunks.
5. convert the parsed chunks back to TCAS_BUF


作者: milkyjing    时间: 2012-4-27 16:04:02

End of the issue, though with some details to handle.




欢迎光临 TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua (http://tcax.org/) Powered by Discuz! X2