[FFmpeg-devel] [PATCH][VAAPI][2/6] Add common data structures and helpers
Thu Feb 26 10:54:53 CET 2009
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.
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
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 23983 bytes
More information about the ffmpeg-devel