Postby Moddy3d » 22 Nov 2012 02:31
Hello,
I am currently in the process of writing a plug-in that processes a 8-tile auto-stereoscopic format video into the auto-stereoscopic TV ready format.
In the past I've had experience writing this pixel arrangement algorithm with other libraries like OpenCV and as a plugin for Nuke, however there seems to be a lot of details to writing image processors in VLC I am not familiar with. This is my first experience with VLC, so please be kind ^^
Abstractly, the process is as follows
INPUT: 8-tile view format Video (1920 x 1024~)
1. Extract the 8 individual views and store them as temporary pictures roughly sizes of 640 x 400
2. Scale each picture up to the current screen resolution, or even better, allow for dynamic scaling + proper pixel arrangement
3. Do the pixel arrangement process, basically by masking each individual scaled-up picture in a different manner, and then merging them. (For example, in the final result, column 1 would have pixels from view 1, column 2 from view 2, col 3 view 3... etc, to align with the Auto-stereoscopic tv)
OUTPUT: Full-screen Resolution Pixel-arranged Format Video
Now here is the current progress,
1. Implementing it in the form of a video filter.
2. In the Open() call for filter initialization, I store the size and locations of each tile into the filter object's private data, p_sys.
3. In the Filter() call for filter process, I begin by creating a group of picture_t pointers and allocating new picture_t's.
4. I proceed to copy the corresponding tiles from the original image into these new picture_t's.
Right now I'm at the stage where I need to scale these images but I don't understand how to do that.
I have a quite a bit of questions:
For video_format_t
1. What does the i_x_offset and i_y_offset really do?
2. What does the _visible_ mean? What's the difference?
3. If I am specifying a location on a picture (X,Y), from what corner of the image does it count from?
4. What's this i_align thing?
For Scaling
1. I read the scale.c source but I don't understand it, because it's quite cryptic to me and uncommented, could anybody possibly explain the operations?
For Screen Resolution
1. How do I find out what the full-screen resolution (W,H) of the target device?
2. How do I find out what the current resolution (W,H) of the video in VLC is? This way it could be even better because I can do the scaling from the tiles to the window size before the pixel processing, so the final result would work and display properly at any window size.
Thanks a lot for your time to read, and I will appreciate any sort of advice and feedback!
Regards!