Commit graph

1215 commits

Author SHA1 Message Date
Sreerenj Balachandran
d7bd0a4c10 build: Add gmodule dependency for libgstvaapi_egl
https://bugzilla.gnome.org/show_bug.cgi?id=756259
2015-11-30 13:03:04 +01:00
Sreerenj Balachandran
a24918037d decoder: vp9: Fix last/golden/altref frame index setting
Always fill VADecPictureParameterBufferVP9 last/golden/altref indices
based on what ever reference frame indices encoded in frame header.
2015-11-17 19:37:07 +02:00
Sreerenj Balachandran
2855682bd3 decoder: vp9: Fix PTS calculation of cloned frames 2015-11-16 18:22:55 +02:00
Sreerenj Balachandran
9a314a2430 decoder: vp9: Avoid unnecessary show_frame flag checking while doing picture output
We always set GST_VAAPI_PICTURE_FLAG_SKIPPED for DECODE_ONLY frames and the
gstvaapidecoder base calss is reponsible for handling those frames later on.
No need for explicit verification of frame header's show_frame in order to
do picture outputing.
2015-11-16 18:22:33 +02:00
Sreerenj Balachandran
26f895f4a8 decoder: vp9: Fix ref picture update while doing repeat frame
Don't try to do frame decoding and reference picture update
while receiving a vp9 frame having show_existing_frame flag
set as TRUE.
2015-11-16 18:22:14 +02:00
Sreerenj Balachandran
247896884b decoder: vp9: Add repeat-frame display handling
If vp9 frame header come up with show_existing_frame flag set,
we should duplicate the existing decoded frame as current frame to
be displayed.
2015-11-16 18:21:56 +02:00
Sreerenj Balachandran
8ee23ffd96 decoder: vp9: Add crop rectangle support.
Set crop rectange if:
There is display_width and display_height which is different from actual width/height
 or
The changed resolution is less than the actual configured dimension of surfaces
2015-11-13 19:46:01 +02:00
Sreerenj Balachandran
a48eebefd6 decoder: vp9: Fix the context and surface pool reset for multi resolution video
Unlike other decoders, vp9 decoder doesn't need to reset the
whole context and surfaces for each resolution change. Context
reset only needed if resolution of any frame is greater than
what actullay configured. There are streams where a bigger
resolution set in ivf header or webm header but actual resolution
of all frames are less. Also it is possible to have inter-prediction
between these multi resolution frames.
2015-11-13 19:23:05 +02:00
Sreerenj Balachandran
4aa523f8b4 decoder: vp9: Fill the VADecPictureParameterBufferVP9 width/height from frame header
Always fill width/height of VADecPictureParameterBufferVP9 from frame header.
Preliminary fix for supproting multi resolution video decode.
2015-11-13 18:58:33 +02:00
Sreerenj Balachandran
9b885c65ca decoder: vp9: Set lossless flag from frame header 2015-11-13 18:41:53 +02:00
Víctor Manuel Jáquez Leal
57b69d36f2 libs: vp9: remove unused symbols
clang complains about a couple variables and one label which were not
used. This patch removes them.

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

https://bugzilla.gnome.org/show_bug.cgi?id=757958
2015-11-11 19:18:52 +01:00
Víctor Manuel Jáquez Leal
f182fcfb37 libs: remove unneeded headers
Since gstvaapidisplay_glx.h do not expose gl.h/glx.h structures, it is not
required to include them in the header. It is not also required to include
them in gstvaapidisplay_glx.c, since gstvaapiutils_glx.h includes them and
exposes their structures (e.g. GLXPixmap).

Nonetheless, glext.h neither glxext.h are required to include, they are
already included conditionally by gl.h and glx.h, respectively.

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

https://bugzilla.gnome.org/show_bug.cgi?id=757577
2015-11-09 15:12:31 +01:00
Sreerenj Balachandran
db877e015d VP9: libgstvaapi: Add VP9 decoder 2015-11-06 15:12:51 +02:00
Sreerenj Balachandran
a3d63724dd VP9: gstvaapiprofile: Add profile definitions 2015-11-06 14:57:00 +02:00
Sreerenj Balachandran
279f494bc0 VP9: Allow building vp9 codecparser internally 2015-11-06 14:25:39 +02:00
Víctor Manuel Jáquez Leal
f6ae00a6bb decoder: h264: initialize PPS's slice_group_id
When the GstVaapiParserInfoH264 is allocated, the memory is not initialized,
so it contains random data.

When gst_h264_parser_parse_pps() fails, the PPS structure keeps slice_group_id
pointer uninitialized, leading to a segmentation fault when the memory is
freed.

This patch prevents this by initializing the slice_group_id before the PPS
parsing.

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

https://bugzilla.gnome.org/show_bug.cgi?id=754845
2015-09-15 19:36:37 +02:00
Sreerenj Balachandran
3bd6185f9f decoder: hevc: Don't flush dpb for EOS/EOB nal
Explicit flushing of dpb for EOS and EOB nal decoding is wrong,
the dpb_add() itself will handle the flusing(if needed) of dpb
for end of sequence and end of bitstream.

https://bugzilla.gnome.org/show_bug.cgi?id=754010
2015-09-04 22:19:55 +03:00
Sreerenj Balachandran
e90ea99df1 decoder: hevc: Fix the dpb_add() based on C.5.2.3
Follow the spec as it is in C.5.2.3, add the decoded frame to dpb
just after the PicLatencyCnt setting of existing dpb frames.

https://bugzilla.gnome.org/show_bug.cgi?id=754010
2015-09-04 22:11:10 +03:00
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
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
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
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
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
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
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
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
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
Sreerenj Balachandran
47b78b7547 decoder: jpeg: Align with new API/ABI changes in codecparser
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-07-22 09:38:42 +03:00
Gwenole Beauchesne
52adebe779 decoder: h264: track previous reference frames.
Improve closure of gaps in frame_num by strictly following and trying
to fill them with previous reference frames. So, they are now tracked
thus avoiding insertion of dummy ("greenish") frames.
2015-07-20 15:25:46 +02:00
Gwenole Beauchesne
06147100f2 decoder: h264: fix integration of second field into the DPB.
If the new picture to be added to the DPB is not a first field, then
it shall be the second field of the previous picture that was added
before.

This removes the need for dpb_find_picture() now that we track the
immediately preceding decoded picture, in decode order.
2015-07-20 15:25:46 +02:00
Gwenole Beauchesne
d4ccae8398 decoder: h264: fix closure of "other-field" gap.
When a dummy "other-field" is inserted, it is assumed to inherit the
reference flags from the first field, and the sliding window decoded
reference picture marking process is also executed so that corrupted
frames are moved out as early as possible.

While doing so, we also try to output frames that now contain a single
valid field picture, prior to inserting any other picture into the DPB.
Note: this may be superfluous currently based on the fact that dpb_add()
combines the two most recent pairable fields, but this process would be
further simplified later on.
2015-07-20 15:25:46 +02:00
Gwenole Beauchesne
80a7ab0959 decoder: h264: track corrupted frames.
Mark the picture as "corrupted" if it is reconstructed from corrupted
references or if those references are fake, e.g. resulting from lost
frames.

This is useful for notifying the upper layer, or downstream elements,
that the decoded frame may contain artefacts.

https://bugzilla.gnome.org/show_bug.cgi?id=703921
2015-07-20 15:25:46 +02:00
Gwenole Beauchesne
939bdb08a5 decoder: add initial infrastructure for marking corrupted output.
Add initial infrastructure in core codec library and vaapidecode to mark
corrupted frames as such. A corrupted frame is such a frame that was
reconstructed from invalid references for instance.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2015-07-20 15:25:46 +02:00
Víctor Manuel Jáquez Leal
1b76561d95 vaapidecoder: no wmv profiles gstreamer 1.4/1.2
This patch fix the auto-plugging problem in gstreamer 1.2 and gstreamer 1.4

Right now there is not a primary ranked parser for vc1 and the demuxers
delivers caps without specifying the profile. This situation is not an issue
for avdec_vc1 but for vaapidecode it is, which refuses to negotiate without a
explicit profile defined in the negotiated caps.

Nonetheless, in gstreamer 1.5 it seems not to be a problem since the
negotiation admits caps subsets try outs.

This patch solves the issue ignoring the profile negotiation in the caps. For
gstreamer < 1.5 the profile string is not handled, so the auto-plugging get
done without the vc1 parser, such as happens in gstreamer 1.5.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2015-07-15 13:38:23 +02:00
Sreerenj Balachandran
86c4cdc8b6 build: Add missing CFLAGS to Makefile.am 2015-07-07 13:32:18 +03:00
Sreerenj Balachandran
9f0e054d9d gstvaapifilter: Only register STE property if it supported by corresponding VA library
Fix the regression introduced in commit eb465fb.
VAProcFilterSkinToneEnhancement is avaialbe from VA >= 0.36.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-07-03 15:07:45 +03:00
Sreerenj Balachandran
eb465fb392 gstvaapifilter: Add guard for VAProcFilterSkinToneEnhancement
VAProcFilterSkinToneEnhancement is avaialbe from VA >= 0.36.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-07-03 12:42:09 +03:00
Sreerenj Balachandran
6b88777627 encoder:h265: Fix the check for packed-header support
Use VA_ENC_PACKED_HEADER_* definition for checking.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-07-02 21:57:38 +03:00
Sreerenj Balachandran
02d8092da9 encoder:h264: Fix the check for packed-header support
Use VA_ENC_PACKED_HEADER_* definition for checking.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2015-07-02 21:37:56 +03:00