Commit graph

377 commits

Author SHA1 Message Date
Gwenole Beauchesne
de7432f712 image: fix source stride in picture copy. 2012-02-15 14:08:44 +01:00
Gwenole Beauchesne
ab94048ea0 decoder: fix double buffer free with some VA drivers.
vaRenderPicture() implicitly disposes VA buffers. Some VA drivers would
push the VA buffer object into a list of free buffers to be re-used. However,
reference pictures (and data) that was kept would explicitly release the VA
buffer object later on, thus possibly destroying a valid (re-used) object.

Besides, some other VA drivers don't support correctly the vaRenderPicture()
semantics for VA buffers disposal and would leak memory if there is no explicit
vaDestroyBuffer(). The temporary workaround is to explcitily destroy VA buffers
right after vaRenderPicture(). All VA drivers need to be aligned.
2012-02-13 10:10:35 +01:00
Gwenole Beauchesne
82dbd6f5be h264: complete any current picture decoder before SPS / PPS change.
This ensures the VA context is clear when the encoded resolution
changes. i.e. make sure older picture is decoded with the older
VA context before it changes.
2012-02-08 18:08:49 +01:00
Gwenole Beauchesne
6c5054e840 h264: create VA context earlier when SPS is parsed. 2012-02-08 18:07:14 +01:00
Gwenole Beauchesne
26c105a6ca h264: don't allocate too big data structures on stack. 2012-02-08 17:57:29 +01:00
Gwenole Beauchesne
830efb3fbd glib: map deprecated API to glib >= 2.32 equivalents.
GStaticMutex and GStaticRecMutex are now replaced with GMutex and
GRecMutex, which no longer require any prior call to g_thread_init().
2012-02-07 11:07:15 +01:00
Gwenole Beauchesne
a698766a8b glib: fix includes. 2012-02-07 10:06:15 +01:00
Gwenole Beauchesne
5cc357f88a cosmetics: fix warnings (drop unused variables). 2012-02-07 10:06:15 +01:00
Gwenole Beauchesne
d75d70d395 mpeg2: fix crash when there is no free surface to decode into. 2012-02-06 15:54:42 +01:00
Zhao Halley
d46e8d9961 display: skip profiles which have no entrypoints.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-02-06 12:54:20 +01:00
Gwenole Beauchesne
fe791efc28 decoder: allocate proxy surface earlier.
This simplifies gst_vaapi_picture_output() to only update the presentation
timestamp and submit the proxy to the decoder for output.
2012-01-31 11:34:17 +01:00
Gwenole Beauchesne
399875ee86 decoder: fix memory leak of VA objects on exit.
On sequence end, if the last decoded picture is not output for rendering,
then the proxy surface is not created. In this case, the original surface
must be released explicitly to the context.
2012-01-31 11:29:06 +01:00
Gwenole Beauchesne
11d09495ea mpeg2: use GstAdapter to track input sequence.
This fixes possible memory leaks and improves performance by removing
some extra copies.
2012-01-31 11:02:04 +01:00
Gwenole Beauchesne
b54bf3175c Add glib compatibility glue for older versions. 2012-01-30 19:53:13 +01:00
Gwenole Beauchesne
0fb1147d9c Add header for system-dependent definitions. 2012-01-30 19:52:10 +01:00
Gwenole Beauchesne
a79c7f9fa6 decoder: optimize slice data buffers initialization.
VA drivers may have a faster means to transfer user buffers to GPU
buffers than using memcpy(). In particular, on Intel Gen graphics, we
can use pwrite(). This provides for faster upload of bitstream and can
help higher bitrates.

vaapi_create_buffer() helper function was also updated to allow for
un-mapped buffers and pre-initialized data for buffers.
2012-01-30 10:32:14 +01:00
Gwenole Beauchesne
5cd0242bbb h264: simplify RefPicList reconstruction. 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
d656b958a3 h264: flush DPB when the end of the sequence is reached. 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
e52ca4a2c8 h264: handle Decoded Picture Buffer (DPB). 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
425060a7a8 h264: fix pred_weight_table() reconstruction.
Only the explicit pred_weight_table(), possibly with the inferred default
values, shall be required. e.g. don't fill in the table if weighted_pred_flag
is not set for P/SP slices.
2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
8c37221fa5 h264: execute reference picture marking process (MMCO). 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
61753fd55a h264: fix presentation timestamps. 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
16ccf82363 h264: execute reference picture marking process (sliding window). 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
5a795b439c h264: handle avcC format for decoding buffers. 2012-01-29 15:27:59 +01:00
Sreerenj Balachandran
6d61965531 h264: handle codec-data.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
c071f80f40 Add initial H.264 decoder. 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
4a46b5d6c4 decoder: retain proxy surface until the GstVaapiPicture is destroyed.
Keep a valid reference to the proxy in GstVaapiPicture so that frames
marked as "used for reference" could be kept during the lifetime of the
picture. i.e. don't release them too soon as they could be re-used right
away.
2012-01-27 15:56:32 +01:00
Gwenole Beauchesne
2897618b85 decoder: properly reference count pictures.
This fixes cases where a GstVaapiPicture would be destroyed whereas
there is still a valid instance of it in either prev, current or
next picture.
2012-01-27 13:28:12 +01:00
Gwenole Beauchesne
7b19745141 decoder: simplify output of decoded frames.
Drop obsolete gst_vaapi_decoder_push_surface() that was no longer used.
Change gst_vaapi_decoder_push_surface_proxy() semantics to assume PTS
is already set correctly and reference count increased, if necessary.
2012-01-27 13:28:12 +01:00
Gwenole Beauchesne
e5d12e8853 decoder: rework the internal VA objects API.
The new API simplifies a lot reference counting and makes it more
flexible for future additions/changes. The GstVaapiCodecInfo is
also gone. Rather, new helper macros are provided to allocate
picture, slice and quantization matrix parameter buffers.
2012-01-27 13:28:11 +01:00
Gwenole Beauchesne
dbba1f6107 decoder: allow slices to be attached to pictures later. 2012-01-24 10:21:45 +01:00
Gwenole Beauchesne
74d3680381 decoder: add ref_count to GstVaapiPicture. 2012-01-24 10:15:52 +01:00
Zhao Halley
b963ccb929 profile: match video/x-h263 as H.263 Baseline profile.
HACK: qtdemux does not report profiles for H.263. So, assume plain
"video/x-h263" is H.263 Baseline profile.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-24 10:15:00 +01:00
Gwenole Beauchesne
c42ba571a8 display: report H.263 Baseline profile.
HACK: expose GST_VAAPI_PROFILE_H263_BASELINE for decoding if MPEG-4:2 Simple
profile (VAProfileMPEG4Simple) is supported.
2012-01-24 10:11:59 +01:00
Gwenole Beauchesne
29623239b9 Add template for workarounds. 2012-01-24 10:11:59 +01:00
Gwenole Beauchesne
0f511e1e0b surface: don't expose gst_vaapi_surface_get_parent_context().
gst_vaapi_surface_get_parent_context() was not meant to be exposed globally.
It's just an internal helper function. However, it's still possible to get
the parent context through the "parent-context" property.
2012-01-18 10:42:38 +01:00
Gwenole Beauchesne
92f11799d1 legal: fix year for some copyright notices. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
1594d99d55 legal: add Intel copyright on modified files. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
14cc1cf061 legal: fix copyright notices to include "Copyright" term. 2012-01-16 11:40:51 +01:00
Zhao Halley
c0d8f2fb1f mpeg4: replace GstVaapiTSB with GstAdapter (gst-plugins-base >= 0.10.24).
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:51 +01:00
Zhao Halley
6502783474 Add initial MPEG-4 decoder.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:51 +01:00
Sreerenj Balachandran
c3455e341e vc1: replace GstVaapiTSB with GstAdapter (gst-plugins-base >= 0.10.24).
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
6ae97634cf vc1: fix codec-data decoding for WMV3 format. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
7b1d784197 vc1: fix presentation timestamps. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
b5ab2e56a9 vc1: fix MV mode packing. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
a7ccbde2af vc1: handle codec-data. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
032486912f vc1: handle encapsulated bitstreams. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
5aea02a66f vc1: fix bitplanes decoding. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
e686c440c7 vc1: fix BFRACTION reconstruction. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
a6a1653d92 vc1: fix framerate calculation. 2012-01-16 11:40:51 +01:00