[FFmpeg-devel] [PATCH][VAAPI][2/6] Add common data structures and helpers

Gwenole Beauchesne gbeauchesne
Thu Feb 26 10:54:53 CET 2009


Hi,

This patch adds common data structures and helper functions for VA API 
support. This greatly simplify actual implementation.

struct vaapi_render_state is now reduced to the strict minimum from a 
public POV. Users are required to allocate this through 
av_alloc_vaapi_render_state() as it is actually larger to hold all 
internal data needed for decoding and that the user shouldn't care about.
- av_alloc_vaapi_render_state()
- av_free_vaapi_render_state()

The buf/buf_size args to AVHWAccel::start_frame() are particularly useful 
for optimization purposes. Whenever possible, slice data chunks are 
directly copied to mapped HW memory. Otherwise, they are accumulated to a 
temporary buffer that will be copied in end_frame().
- vaapi_slice_data_prepare() [usually called in ::start_frame()]
- vaapi_slice_data_append()  [usually called in ::decode_slice()]
- vaapi_slice_data_commit()  [usually called in ::end_frame()]

The same happens for slice control blocks. If we can predetermine the 
number of slices, we can map the whole slice params buffer from HW memory 
space. Otherwise, they are accumulated to a temporary buffer that is also 
copied in end_frame().
- vaapi_slice_params_prepare() [usually called in ::start_frame()]
- vaapi_slice_params_next()    [usually called in ::decode_slice()]
- vaapi_slice_params_commit()  [usually called in ::end_frame()]

Other helpers include:
- vaapi_common_end_frame(): common commit code to the HW accelerator
- vaapi_render_picture(): doing the actual rendering

Regards,
Gwenole.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.hwaccel.vaapi.common.patch
Type: text/x-diff
Size: 23983 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090226/bf348772/attachment.patch>



More information about the ffmpeg-devel mailing list