Commit graph

1018 commits

Author SHA1 Message Date
Wim Taymans 80ca1462cd video-converter: add more scaler fastpaths 2015-02-06 13:39:04 +01:00
Wim Taymans 72076e9521 video-orc: fix loading of param
param loading ignores the x4, loading only part of the param.
2015-02-06 13:25:51 +01:00
Wim Taymans bca801492b video-converter: add border and crop to more fastpaths 2015-02-06 12:35:58 +01:00
Wim Taymans a78ae80909 video-converter: fix border for YUY2 and friends
Convert as many pixels as the max subsampling so that we convert a
complete group of pixels.
2015-02-06 12:33:18 +01:00
Ravi Kiran K N bd836e12a1 video-converter: support AYUV border
Convert the border color from ARGB to AYUV, using
colorimetry matrix when output format is YUV.

https://bugzilla.gnome.org/show_bug.cgi?id=741640
2015-02-06 11:43:49 +01:00
Wim Taymans c78bdbfecb video-converter: fix swapped border width
And also do nothing when there is no border.
2015-02-06 11:43:49 +01:00
Wim Taymans 86c96e09cc video-converter: actually draw the border in some fastpaths
Don't forget to draw the border after doing the fastpath conversion.
2015-02-06 11:43:49 +01:00
Wim Taymans 8fe9299b00 video-converter: clamp width and heigth
Clamp the width and height based on the in and out offsets.
2015-02-06 11:43:49 +01:00
Wim Taymans 7b3bff644c video-format: add unaligned fallbacks
Add fallback C implementations for when we can't call the ORC function
because of bad alignment.
2015-02-06 11:43:49 +01:00
Jan Schmidt 7d4d63be21 video: Fix simple typo in GstVideoFrameMapFlags docs 2015-02-06 04:02:48 +11:00
Wim Taymans b5aa23697c video-converter: add crop and border to some fastpaths 2015-02-05 17:49:55 +01:00
Wim Taymans 6985511fc9 video-converter: add support for borders in scale fastpath
Add support for borders and cropping in the scaler fastpaths.
2015-02-05 17:18:20 +01:00
Wim Taymans 36a50778af video-converter: disable fastpath for crop and border
Add crop and border properties to the fastpath table and only select
fastpath functions when it can handle the cropping or borders.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=744028
2015-02-05 15:03:24 +01:00
Wim Taymans 3dfbd11fc8 video-converter: add fastpath for some gray formats 2015-02-04 18:01:51 +01:00
Wim Taymans 0737316e7e video-converter: add fastpath for some more RGB formats
Add fastpath for RGB and BGR.
Add fastpath for nearest resampling for RGB15 and RGB16 formats.
2015-02-04 17:44:31 +01:00
Wim Taymans 750909abce video-converter: skip lines we don't need
Make sure to skip unused lines instead of doing a useless horizontal
resampling.
2015-02-04 16:39:48 +01:00
Luis de Bethencourt d8308d5a8f video-resampler: make sure params.envelope is initialized
In gst_video_resampler_init () if method is GST_VIDEO_RESAMPLER_METHOD_NEAREST
then params.envelope is not initialized but still used later in line 382.
Make sure this variable is initiliazed to avoid undefined behaviour.

CID #1256568
2015-02-04 11:25:54 +00:00
Sebastian Dröge aa645b11f1 video{enc,dec}oder: Don't reset latency all the time and handle max=GST_CLOCK_TIME_NONE correctly
max=NONE means that *this* element has no maximum latency. If upstream had a
maximum latency we must not override it with NONE.
2015-02-03 12:24:01 +01:00
Sebastian Dröge 4e44f37abd video-converter: Fix compiler warnings
video-converter.c:3073:48: error: implicit conversion from enumeration type 'GstFormat' to different enumeration type 'GstVideoFormat'
      [-Werror,-Wenum-conversion]
        gst_video_scaler_horizontal (h_scaler, format,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~
video-converter.c:3081:44: error: implicit conversion from enumeration type 'GstFormat' to different enumeration type 'GstVideoFormat'
      [-Werror,-Wenum-conversion]
      gst_video_scaler_vertical (v_scaler, format, lines, d, i, out_w);
      ~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~
video-converter.c:3137:24: error: implicit conversion from enumeration type 'const GstVideoFormat' to different enumeration type 'GstFormat'
      [-Werror,-Wenum-conversion]
    convert->fformat = GST_VIDEO_INFO_FORMAT (in_info);
                     ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../gst-libs/gst/video/video-info.h:125:43: note: expanded from macro 'GST_VIDEO_INFO_FORMAT'
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../gst-libs/gst/video/video-format.h:361:59: note: expanded from macro 'GST_VIDEO_FORMAT_INFO_FORMAT'
                                                  ~~~~~~~~^~~~~~
video-converter.c:3157:24: error: implicit conversion from enumeration type 'GstVideoFormat' to different enumeration type 'GstFormat'
      [-Werror,-Wenum-conversion]
    convert->fformat = GST_VIDEO_FORMAT_GRAY8;
2015-01-28 17:44:57 +01:00
Sebastian Dröge 46e141067f video: Update orc files 2015-01-28 17:43:59 +01:00
Wim Taymans f29b966c79 video-converter: add fast-path scaler for some packed YUV formats
Add fast path scaling for YUY2 and other packed YUV formats. Add a new
method to merge the scalers of the Y and UV components into one scaler.
Add faster horizontal 2tap scaler.

See https://bugzilla.gnome.org/show_bug.cgi?id=741987
2015-01-28 17:32:12 +01:00
Wim Taymans ea3dcdc0da video-converter: the default is BAYER dithering 2015-01-28 17:30:14 +01:00
Wim Taymans 620dc30d0f video-converter: don't do dither when set to NONE 2015-01-28 17:29:45 +01:00
Wim Taymans e16377c0c8 video-scaler: fix taps calculation for pstride == 1
Take pstride into consideration when calculating the scaler taps.
2015-01-28 11:39:41 +01:00
Luis de Bethencourt 783204824d orc: update orc files 2015-01-27 13:39:14 +00:00
Wim Taymans e2864494fe video-converter: add fastpath for planar scaling
Add fastpaths for scaling of planar subsampled formats.

See https://bugzilla.gnome.org/show_bug.cgi?id=741987
2015-01-27 10:52:29 +01:00
Wim Taymans ba98d06767 video-scaler: add support for monochroma formats
Add support for scaling of images with pstride == 1. This can be used
to scale individual planes later.
Rework some of the scaling code to take the pstride as a parameter.
2015-01-27 10:52:29 +01:00
Wim Taymans 4ab23677a9 video-format: fix GBR unpack 2015-01-27 10:52:29 +01:00
Edward Hervey 5e69a0f898 video: Fix leaked dither object in error cases
Coverity CID : 1256564
2015-01-23 12:46:41 +01:00
Sebastian Dröge 2bd4ea6e8e Constify some static arrays everywhere 2015-01-21 09:49:47 +01:00
Alessandro Decina 5fd4e3e0b6 videoutils: keep caps features in account when building the downstream filter
See 00c2ce6 and https://bugzilla.gnome.org/show_bug.cgi?id=741263 for reference.
2015-01-15 13:59:10 +11:00
Mark Nauwelaerts 04d447a825 videoencoder: fix comment typo 2015-01-10 13:02:59 +01:00
Luis de Bethencourt 6992da94b0 video-dither: remove check for below zero for unsigned value
CLAMP checks both if value is '< 0' and '> max'. Value will never be a negative
number since it is an unsigned integer. Removing that check and only checking if
it is bigger than max and setting it appropriately.

CID 1256559
2015-01-09 15:38:09 +00:00
Luis de Bethencourt 23880ec874 video-resampler: remove check for below zero for unsigned value
CLAMP checks both if n_taps is '< 0' and '> max_taps'. n_taps will never be a
negative number because it is an unsigned integer. Removing that check and only
making sure it isn't set bigger than max.

CID 1256558
2015-01-09 15:28:06 +00:00
Sebastian Dröge 7a35321710 video: Add support for BT2020 colorspace (UHD) 2015-01-08 10:45:46 +01:00
Wim Taymans ff8129267e video-scaler: remove useless debug 2015-01-07 15:54:58 +01:00
Wim Taymans fff41f06be video-converter: add options to control chroma resampling
Add an option to disable chroma resampling.
Improve the matrix option values so that you can choose to use the input
or output matrix or disable conversion.
2015-01-07 15:52:57 +01:00
Song Bing e9c6c833c9 videopool: update video alignment after applying
Video buffer pool will update video alignment to respect stride alignment
requirement. But haven't updated it to video alignment in configure.
Which will cause user get wrong video alignment.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741501
2014-12-22 09:25:04 -05:00
Sebastian Dröge 87d6c265a8 video{en,de}coder: Call reset() before the start() vfunc
This makes sure that the element is in the same state before start() is called
the very first time and every future call after the element was used already.

Also it ensure that we always have a clean state before start(), cleaned the
same way in every case.
2014-12-22 11:38:20 +01:00
Sebastian Dröge 098b42f36b video{en,de}coder: Reset the codec after calling the stop() vfunc
The stop() vfunc might mess with some of our fields we have just
reset, which could cause memory leaks or invalid state taken over
to later.

Also the stop() vfunc, or anything called until it from another thread,
might want to be able to use the fields that were just resetted and
become confused because of that.

In the decoder we already had a workaround for things like this happening,
this workaround is not needed anymore.
2014-12-22 11:33:14 +01:00
Thiago Santos 17a7fac1a1 video: audio: fix GI annotations for proxy caps function
Add the annotations to parameters that can be null and also for stating
the ownership of the returned caps
2014-12-17 19:15:24 -03:00
Thiago Santos 8085352fb3 videodecoder: expose getcaps virtual function
Allows subclasses to do custom caps query replies.

Also exposes the standard caps query handler so subclasses can just
extend on top of it instead of reimplementing the caps query proxying.

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Thiago Santos 4956800549 videodecoder: accept-caps should only require fields from the template
With the new caps query results the caps returned might have extra fields
that are not required by the decoder (framerate for image decoders) and it
causes a regression making, for example, jpegdec reject caps that don't
have framerates.

The accept-caps implementation will do 2 checks:

1) Do subset check with the template caps, making sure all the required
fields that are present on the template are present on the received caps.
2) Do a intersection check with the result of a caps query, making sure
that downstream can accept the fields in the received caps.

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Thiago Santos 00c2ce60c3 videoutils: proxy filter when doing a caps query downstream
Allows downstream to use the filter and possibly reduce caps complexity
to speed up negotiation

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Thiago Santos f492085552 videoutils: return empty if the element has no possible allowed caps
Instead of returning the template caps and having a failure happen
later because there are no possible caps

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Thiago Santos f24075887f videodecoder: implement caps query
Refactor the encoder's caps query proxying function to a common place
and use it in the videodecoder to proxy downstream restrictions.

The new function is private to the gstvideo lib.

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Song Bing 8baf1ec500 videopool: update buffer size after video alignment
Update the new buffer size after alignment in the pool configuration
before calling the parent set_config. This ensures that the parent knows
about the buffer size that we will allocate and makes the size check
work in the release_buffer method.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741420
2014-12-16 12:14:53 +01:00
Edward Hervey ff57f69134 video: Fix non-default usage of gst_video_sink_center_rect
Make sure we take into account non-0 x/y destination rectangles
2014-12-15 14:11:07 +01:00
Sebastian Dröge ee2418effd video: Update disted orc source files 2014-12-12 10:02:43 +01:00
Sebastian Dröge 3fc5791b3f Revert "video-converter: Fix compiler warning because of missing prototype of non-static function"
This reverts commit 406f32a946.

The problem was apparently that my video-orc.h was not updated and did not
include the prototype for that function. Only a "make clean" caused it to
be regenerated.
2014-12-12 10:01:36 +01:00