Log in

View Full Version : x264 code modifications


shin_san
9th May 2006, 09:16
I need to take a BMP sequence as input of my decoder. I don t want to use a tool (such as Virtualdub).
I tried to modify the source but I don t understand how to replace a frame by a BMP, and how the frames are represented. Has somebody already found a way?
Thanks for help.

Manao
9th May 2006, 09:41
Why do it the hard way ? There's an imagereader plugin in avisynth that handles bmp. No need to code anything.

shin_san
9th May 2006, 10:43
Because I need to use a filter library in C, working on BMP...
I have already written a BMP reader. The problem is to convert these BMP to a frame encodable by x264.

shin_san
10th May 2006, 02:52
I precise a bit my question.
What is exactly a x264_picture_t? I want to treat each frame as an image (filter frame by frame) and then, Encode_frame(...,...,...) with a treated frame. Is it possible?

MeteorRain
10th May 2006, 11:28
why not rewrite the filter into avs filter?
a filter for bmp should be easy to be rewrite to work with rgb colorspace

unmei
10th May 2006, 22:36
https://trac.videolan.org/x264/browser/trunk/x264.h
line 277 onwards
i suspect there are 4 of i_stride and *plane to support up to 4 color planes, the plane pointers most likely represent raw scanlines of i_stride length and i_pts sitting on a full 8bytes might mean it represents the total data size or maybe only w*h - but what exactly those fields represent should be easy to guess from using x264_picture_alloc with a couple of different width/height/colospace parameters and look at what its result looks like.

shin_san
15th May 2006, 03:02
Thanks a lot, I finally use

PGETFRAME pFrame;
pFrame=AVIStreamGetFrameOpen(pStream, NULL);
BYTE* pDIB = (BYTE*) AVIStreamGetFrame(pFrame, i_frame);

to take each frame form the avi.

It just remains to write them after filtering...