Commit graph

2229 commits

Author SHA1 Message Date
Sreerenj Balachandran
8799a8044d decoder: hevc: Fix the picture addition in dpb() based on spec H265 v3 (04/2015)
This fix is based on the V3 vesion of spec which was missing in older versions.

When the current picture has PicOutputFlag equal to 1, for each picture in the
DPB that is marked as "needed for output" and follows the current picture in output order,
the associated variable PicLatencyCount is set equal to PicLatencyCount + 1 (C.5.2.3).

https://bugzilla.gnome.org/show_bug.cgi?id=754010
2015-09-04 22:02:55 +03:00
Sreerenj Balachandran
ac92e6d5bc decoder: h265: Fix indentation 2015-09-04 22:00:36 +03:00
Jan Schmidt
b0194a1dc5 multiview: initial attempt at stereo/multiview support
Add support for marking caps and buffers for multiview or
stereoscopic output.

https://bugzilla.gnome.org/show_bug.cgi?id=750835
2015-08-31 17:51:56 +02:00
Víctor Manuel Jáquez Leal
cc63452d72 decoder: hevc: remove unused functions
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=754250
2015-08-31 13:13:24 +02:00
Víctor Manuel Jáquez Leal
dbedad66df vaapidecode: remove (another) unused variable
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-31 13:13:11 +02:00
Víctor Manuel Jáquez Leal
9d8a014423 vaapidecode: remove unused variable
Thus silence the compilation warnings.
2015-08-28 17:10:40 +02:00
Víctor Manuel Jáquez Leal
b8068874d5 vaapidecode: compilation fix
gst_vaapi_decoder_state_changed() returns void. This patch fixes the
compilation where the toolchain uses restrictive flags as clang.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-28 16:07:31 +02:00
Víctor Manuel Jáquez Leal
32d1c5adff vaapidecode: renegotiate if caps are not equal
The use of gst_caps_is_always_compatible() for this optimization may lead to
false positives. It is better to stick to gst_caps_is_strictly_equal() to know
if it is required a re-negotiation.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=750835
2015-08-29 00:27:05 +03:00
Sreerenj Balachandran
6eba201f32 vaapidecode: Rework the re-negotiation code to handle multi resoultion videos
Delaying the pool re-negotiation untill we push all decoded (and queued)
frames downstream. Otherwise for the multi-resolution videos, the
GstVideoVideoMemory will be having wrong resolution and which leads
to nasty behaviours, especially when using software renderers.

sample media file: RAP_B_Bossen_1.bin
case explained:
The first SPS Nal will report resoultion of 448x256 and having crop rectangles to
get the final resoultion 416x240.
Starting from 25 th frame, the resolution will change to 416x240. But parser
elements won't report this since the effective croped resolution is same in
both cases. Here the core libgstvaapi will detect this through it's internal
parsing and do all context/pool destory/reset stuffs. Also it will notify this
change to plugins in advance. But if the plugin try to do re-negotiaion of pool
immediately, this will not sync with the resolution of already decoded and queued
frames and which will lead to failure in gst_video_frame_map() in downstream(if we use the
software renderer). So we have to delay the pool renegotiation in vaapidecode,
untill we push all decoded frames downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=753914
2015-08-29 00:18:57 +03:00
Sreerenj Balachandran
ba8fcf5435 vaapidecode: Always keep a copy of input codec state
Currently we are sharing the input GstVideoCodecState with
GstVaapiDecoder(gst-libs/gst/vaapi) by just doing ref and unref for
each caps change. This is troublesome in many cases, for eg: if
resoultion changes with in a singe stream. Because, when ever there
is a resolution change, GstVideoDecoder will first change the Codec_state->caps
fields with new resolution, but since we are using the same codecstate (ref)
in gstvaapidecode.c, the caps check for input caps change will always fail.

https://bugzilla.gnome.org/show_bug.cgi?id=753914
2015-08-28 23:43:47 +03:00
Sreerenj Balachandran
11716efdd3 decoder: hevc: Fix the scaling list scan order
The default scan order of scaling lists are up-right-diagonal
as per hevc specification. Use the newly implemented
uprightdiagonal_to_raster conversion codecparser APIs to
get the the scaling_list values in raster order, which is
what the VA intel driver requires.
2015-08-26 07:25:03 +03:00
Sreerenj Balachandran
279c49e8f2 decoder: hevc: sync with the codecparser changes
The Tile Scanning Conversion process (spec 6-3 and 6-4) is implemented
in codecparsers now. Remove the duplication from gstvaapidecoder_h265
2015-08-26 07:20:09 +03:00
Sreerenj Balachandran
3b7c0f8bb1 patches/Videoparsers: update patch to fix build with older GStreamer 1.2 stacks 2015-08-26 07:04:22 +03:00
Sreerenj Balachandran
b00511355c codecparsers: Update to gst-vaapi-branch commit 69550f1
c207c6d: codecparsers: h265: Fix tile row and column parsing
47074c5: codecparsers: h265: Add APIs for up-right-diagonal/raster scan conversion
cd28b18: codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom
1746bbe: videoparsers: Use gst_base_parse_merge_tags()
2f0932b: h264parse: Clear SPS info after processing
f57d6b0: videoparsers: enable accept-template flag
2015-08-26 06:57:36 +03:00
Víctor Manuel Jáquez Leal
1cf9381b08 debian: add yasm as build dependency
As the compilation of libvpx (for vp8 parser) is enabled by default,
yasm is required by default too.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-25 18:09:44 +02:00
Lim Siew Hoon
5dd1202fb0 debian: remove --with-gstreamer-api option
It is no longer valid in gstreamer-vaapi.

Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
[removed unused GST_API_VERSION variable]
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=753618
2015-08-25 18:09:44 +02:00
Víctor Manuel Jáquez Leal
5fd4c8dffe wayland: rename is_cancelled to sync_failed
Since commit 065a18a3, the semantics of the variable is_cancelled did not make
sense. This commit renames this variable to sync_failed.
2015-08-24 19:24:07 +02:00
Olivier Crete
a83057cdb1 wayland: Don't return GST_FLOW_ERROR on flushing
Setting the sink to flushing causes gst_vaapi_window_wayland_sync() to
return FALSE which makes gst_vaapi_window_wayland_render() return
FALSE which ends up posting an ERROR message in
gst_vaapisink_show_frame_unlocked(). Solution is to just return TRUE
in the EBUSY case.

https://bugzilla.gnome.org/show_bug.cgi?id=753598
2015-08-24 19:23:54 +02:00
Víctor Manuel Jáquez Leal
18a8b87975 Revert "Marking rank of vaapidecodebin as GST_RANK_MARGINAL for now."
This reverts commit 3ccb198b51.
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
7f34c6e17d vaapidecodebin: check for postproc instance
If the VPP's deinterlace-method is set, first we should check if the postproc
is already instanced to set it. Otherwise we just store it until the VPP is
added into the bin.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
ee5d8ee202 vaapidecodebin: ensure VPP before going to READY
There are sometimes that the VA-API display context is not shared among the
pipeline, but it is important to know it before going to READY state (when the
pipeline is already linked).

One instance of this case is this:

gst-launch-1.0 filesrc location=media ! decodebin ! vaapipostproc ! vaapisink

This patch adds a new function in gstvaapipluginutil called
gst_vaapi_create_test_display(). Its purpose is to create a disposable VA-API
display, which only will be used for verify if the VAEntrypointVideoProc is
available by the hardware. Afterwards, it should be unrefed.

If the vaapidecodebin is going to READY state, and the element still doesn't
know if VPP is available, the last resort is to create a new instance of the
VA-API display and test for it.

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
1e061c54e1 vaapidecodebin: post an error message if fails
If the construction of the bin fails, post an error message in the bus.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
0004301714 vaapidecodebin: has_vpp as a tri-state variable
has_vpp can be UNKNOWN while the context message hasn't being received.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=749554
2015-08-13 17:34:42 +02:00
Víctor Manuel Jáquez Leal
f0d6b0ac3f gstvaapivideomemory: native format with no derived image
If USE_NATIVE_FORMATS is defined we bail out before configuring the surface
info based on the derived image configuration.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-13 17:20:19 +02:00
Víctor Manuel Jáquez Leal
ceb70c3ca6 surface pool config based on video info
First added the function gst_vaapi_video_format_get_best_native(), which
returns the best native format that matches a particular chroma type:

YUV 4:2:0 -> NV12, YUV 4:2:2 -> YUY2, YUV 4:0:0 -> Y800

RGB32 chroma and encoded format map to NV12 too.

That format is used to configure, initially, the surface's pool for the
allocator.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-13 17:20:19 +02:00
Víctor Manuel Jáquez Leal
940dc1a18e gstvaapivideomemory: refactor gst_vaapi_video_allocator_new()
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-13 17:20:19 +02:00
Victor Jaquez
002ac0ba9e gstvaapiencoder: validate chroma according to the VA's RT format
Before, only YUV420 color space where supported. With this patch, the
encoder is queried to know the supported formats and admits YUV422
color space if its available.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-13 17:20:19 +02:00
Sreerenj Balachandran
53a0e78948 decoder: hevc: Add calculation of WpOffsetHalfRangeC
This is necessary for finding ChromaOffsetL0/ChromaOffsetL1
prediction weight table values with out using any hard coding.

Fixme: We don't have parser API for sps_range_extension, so
assumed zero value for high_precision_offsets_enabled_flag.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-13 05:07:52 +03:00
Sreerenj Balachandran
1f287dc71c decoder: hevc: Fix ChromaOffsetL0/ChromaOffsetL1 calculation
Based on ITU-T rec H265(4/2015): 7-56

This was a wrong equation in rec H265 (4/2013): 7-44...

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-13 04:09:44 +03:00
Sreerenj Balachandran
6669000580 decoder: hevc: Fix default value assignment of pred_weight_table 2015-08-13 04:08:03 +03:00
Sreerenj Balachandran
8939674a36 decoder: hevc: Fix the value assigning for delta_chroma_log2_weight_denom
Assign only if ChromaArrayType != 0..

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-13 03:48:43 +03:00
Sreerenj Balachandran
a57f294ed3 codecparsers: Update to gst-vaapi-branch commit 1c70432
8e98b41: codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom
839c5bc: codecparsers: h265: Fix the parsing of ref_pic_lists_modification

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-13 03:06:32 +03:00
Sreerenj Balachandran
d357e3a15f codecparsers: Update to gst-vaapi-branch commit c18b8ad
8a03e67: videoparsers: h265: Avoid skipping of EOS and EOB nals
a033083: videoparsers: h265: Fix the frame start detection code

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-11 08:09:10 +03:00
Sreerenj Balachandran
f7ce9a33d5 decoder: hevc: Add SEI parsing
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-10 05:50:50 +03:00
Sreerenj Balachandran
95b8ca0cda decoder: hevc: Workaround to recognize wrongly encoded main profile streams
HACK: This is a work-around to identify some main profile streams having wrong profile_idc.
There are some wrongly encoded main profile streams(eg: ENTP_C_LG_3.bin) which doesn't
have any of the profile_idc values mentioned in Annex-A, instead general_profile_idc
has been set as zero and having general_profile_compatibility_flag[general_profile_idc]
is TRUE. Assuming them as MAIN profile for now.

https://bugzilla.gnome.org/show_bug.cgi?id=753226

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-07 08:43:44 +03:00
Sreerenj Balachandran
869facf3bc patches/videoparsers: Fix the wrong source file path
This is something wrongly typed in commit 6d7b631
2015-08-07 08:42:46 +03:00
Sreerenj Balachandran
682fbb4146 codecparsers: Update to gst-vaapi-branch commit b8d8be4
ee7e81b: h264parse: Don't discard first AU delimiter
3690fb9: h264parse: Add more NAL types for debugging output
108d368: h265parse: Avoid checking for Non Mandatory VPS NAL
ace61048: h265parse: expose compatible profiles to downstream

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-07 08:34:55 +03:00
Víctor Manuel Jáquez Leal
de1bc55ceb gstvaapivideocontext: remove unused parameter
gst_vaapi_video_context_prepare() received an unused parameter. This patch
removes it and the structure passed by the caller.

This a left over of "Removal of gstreamer-1.0 support" (commit 8b36e25f).

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-06 19:07:13 +02:00
Sreerenj Balachandran
696b446f09 decoder: hevc: Fix decoding of stream when it has temporal sublayers
We are calculating the dpb size based on max_dec_pic_buffering.
But if there are more than one temporal sublayers, we are supposed
to use the max_dec_pic_buffering[max_sub_layers_minus] for dpb
size calculation (Assuming HighestTid as max_sub_layers_minus).

Sample streams: TSCL_A_VIDYO_5.bin, TSCL_B_VIDYO_4.bin

https://bugzilla.gnome.org/show_bug.cgi?id=753226

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-06 04:01:24 +03:00
Víctor Manuel Jáquez Leal
66f05af288 refactor vaapi caps strings for pad templates
Refactor the main vaapi caps strings into three macros:
GST_VAAPI_MAKE_SURFACE_CAPS, GST_VAAPI_MAKE_ENC_SURFACE_CAPS and
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS.

Those are in gstvaapipluginutil.h so all the elements could use them, instead
of re-declaring them every time.

No functional changes.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-05 14:26:37 +02:00
Víctor Manuel Jáquez Leal
343739e281 gstvaapipostproc: fix code style
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-08-05 14:26:00 +02:00
Sreerenj Balachandran
cb8b2af5f0 decoder: hevc: Fix the decoding of dependent slice segment
Decoding process for reference picture list construction needs to be
invoked only for P and B slice and the value for slice_type of dependent slice
segment should be taken from the previous independent slice segment header
of the same pic.

https://bugzilla.gnome.org/show_bug.cgi?id=753226

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-08-05 05:23:20 +03:00
Victor Jaquez
9bdf43a843 plugins: reduce the noise of warnings
Those messagse should be attached to the object, also the lack of
caps is not an error, in particular in the case of JPEG encoding.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-04 19:42:48 +02:00
Víctor Manuel Jáquez Leal
1e8610fc95 gstvaapicontext: fix the JPEG encoder attribs value
When we query for the VAConfigAttribEncJPEG, we get a value which packs the
VAConfigAttribValEncJPEG structure, but we did not assign it. This patch
assigns the returned value to the attribute.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-04 19:42:48 +02:00
Victor Jaquez
351496a304 gstvaapiencoder: framerate 0/1 is valid too
Framerate 0/1 is valid, and it is particularly useful for picture
encoding, such as jpeg. This patch makes the encoder to admit that
framerate.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=744042
2015-08-04 19:41:51 +02:00
Víctor Manuel Jáquez Leal
954037cd24 vaapipostroc: GLTextureUploadMeta in sink template
Advertise GLTextureUploadMeta in sink caps template.

https://bugzilla.gnome.org/show_bug.cgi?id=752130
2015-08-04 19:37:33 +02:00
Víctor Manuel Jáquez Leal
001a5c637d remove gstvaapiuploader
Working on bug #744042 I realized that the gstvaapiuploader is practically not
used.

This patch removes the gstvaapiuploader and add the method
gst_vaapi_plugin_base_get_allowed_raw_caps () that returns the raw caps that
the system can handle, which is used by vaapisink and vaapipostproc.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=752777
2015-08-04 19:32:40 +02:00
Víctor Manuel Jáquez Leal
b601bf0df6 vaapidecode: don't lost GLTextureUpload on seek
When seeking, the decoder is reset, but the buffer pool is not
re-negotiated, but in reset_full() the code forgets if the negotiated buffer
pool has the GLTextureUpload meta.

The decoder knows that GLTextureUpload meta was negotiated in
decide_allocation(), but this method is not called when seeking.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=752929
2015-08-04 19:20:48 +02:00
Víctor Manuel Jáquez Leal
c76fe74297 plugins: don't use gst_pad_get_allowed_caps()
gst_pad_get_allowed_caps() query the pad and the peer pad. In the case
decoders, that is OK, but in the case of the postproc might lead loops,
since the gst_base_transform_query_caps() forwards the query upstream
and forth.

Instead of gst_pad_get_allowed_caps() we only query the peer with
gst_pad_peer_query_caps() using the pad's template as filter.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=752558
2015-08-04 19:05:25 +02:00
Sreerenj Balachandran
4b5fcaaf04 README: updates 2015-07-22 12:40:19 +03:00