Commit graph

44 commits

Author SHA1 Message Date
Wim Taymans
b2a7ac2766 video-converter: v-resample enough pixels
When we are using the fast linear resampler, use the ->inc to calculate
the first and last pixel we need so that we can do vertical resampling
on the right amount of pixels.
2015-03-02 16:33:09 +01:00
Wim Taymans
330fb44a6f video-scaler: add support for copy
When no scalers are given, simply do a copy of the requested area.
2015-02-25 16:49:20 +01:00
Wim Taymans
9e8799924b video-scaler: add scaler optimization
If we are vertically downscaling, it is better to first downscale and
then do the horizontal scaling in most cases.
2015-02-25 15:33:26 +01:00
Wim Taymans
4d8c277656 video-scaler: remove unused case 2015-02-25 15:32:57 +01:00
Wim Taymans
cdd86d025a video-scaler: add 2d scaler
Make a convenience function that combines 2 scalers to perform a 2d
scale. This removes quite a bit of overhead in method calls when doing a
typical scale and it also can reuse a piece of unused memory in the
vertical scaler.
Use the 2d scaler in video-converter and remove the other scalers and
temp memory.
2015-02-11 13:32:25 +01:00
Wim Taymans
4313970678 video-scaler: Small performance tweaks
Small performance tweaks for RGB and friends.
Add, but ifdef out, alternative nearest neighbour scaling, it is slower
than the current table based version.
Use memcpy instead of orc_memcpy because it is measurably faster.
Fix YUY2 and friends vertical scaling.
2015-02-10 16:45:38 +01:00
Sebastian Dröge
13643870bf video-scaler: Guard against (impossible) bits!=16 && bits!=8 case to fix compiler warning with clang
video-scaler.c:1331:14: error: variable 'func' is used uninitialized whenever 'if' condition is false
      [-Werror,-Wsometimes-uninitialized]
  } else if (bits == 16) {
             ^~~~~~~~~~
video-scaler.c:1348:3: note: uninitialized use occurs here
  func (scale, src_lines, dest, dest_offset, width, n_elems);
  ^~~~
video-scaler.c:1331:10: note: remove the 'if' if its condition is always true
  } else if (bits == 16) {
         ^~~~~~~~~~~~~~~~
video-scaler.c:1260:27: note: initialize the variable 'func' to silence this warning
  GstVideoScalerVFunc func;
                          ^
                           = NULL
2015-02-10 16:44:38 +01:00
Luis de Bethencourt
4fb0095898 video-converter: bits variable always set
In function gst_video_scaler_vertical() the bits variable is always
set to either 8 or 16 in every possible format. No need to initialize it.

If the format isn't valid it goes to no_func, so there is no need to
handle the case of bits not being 8 or 16.

CID #1268401
2015-02-10 15:25:04 +00:00
Wim Taymans
80ca1462cd video-converter: add more scaler fastpaths 2015-02-06 13:39:04 +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
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
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
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
ff8129267e video-scaler: remove useless debug 2015-01-07 15:54:58 +01:00
Wim Taymans
fc1d24ec45 video-scaler: add where orc functions could go
Add the disabled orc functions in #if 0 lines for when we can enable
them.
2014-12-02 15:11:12 +01:00
Wim Taymans
0e3bfbd996 video-scale: combine adds when max_taps equals combine size
When the amount of pixels/lines matches the amount we can combine,
combine the adds and multiplies and do the scale as a separate
operation.
2014-11-25 17:42:07 +01:00
Wim Taymans
74e63fa660 video-scaler: combine scaling operations
Combine add and scale of multiple lines/pixels to reduce the amount of
read and writes to temporary memory.
2014-11-25 17:27:07 +01:00
Wim Taymans
1a3e8395bb video-scaler: ensure both fields have the same number of taps 2014-11-21 15:58:34 +01:00
Wim Taymans
588fdeb834 video-scaler: fix interlaced shift 2014-11-19 12:55:02 +01:00
Wim Taymans
d6ed383c6f video: add some more debuging 2014-11-19 12:55:02 +01:00
Wim Taymans
7d0cef3bcb video-scaler: fix interlacing some more
Use the right phase.
Take the right lines from interlaced content.
2014-11-19 12:55:02 +01:00
Wim Taymans
d03bad7761 video-scaler: fix interlaced taps setup 2014-11-19 12:55:02 +01:00
Wim Taymans
cf970376df video-scaler: avoid memcpy when not needed 2014-11-05 11:55:22 +01:00
Wim Taymans
3286320297 video-scaler: fix temp line allocation
We need to allocate the templine with the amount of pixels we are going
to handle, which we only know for the vertical resampler when we are
asked to resample.
2014-11-04 17:38:11 +01:00
Wim Taymans
67a4702b19 video-scaler: fix taps in interlaced mode 2014-11-04 17:38:11 +01:00
Wim Taymans
562416bb94 video-scaler: fix phases in interlaced mode 2014-11-04 17:38:11 +01:00
Wim Taymans
bd6d2b40d1 video-scaler: add support for 16bits formats
Add scaler functions for 16 bits formats.
Rename the scaler functions so that 16bits versions don't look too
weird.
Remove old unused h_2tap functions
Fix v_ntap functions, it was using 1 tap too little.
2014-11-03 15:41:02 +01:00
Sebastian Dröge
b4ee10f616 video-scaler: Fix compiler warning
video-scaler.c:151:58: error: implicit conversion from enumeration type
      'GstVideoScalerFlags' to different enumeration type
      'GstVideoResamplerFlags' [-Werror,-Wenum-conversion]
    gst_video_resampler_init (&scale->resampler, method, flags, out_size,
    ~~~~~~~~~~~~~~~~~~~~~~~~                             ^~~~~
2014-11-03 08:12:44 +01:00
Tim-Philipp Müller
c409d134de video: fix some g-i / gtk-doc warnings 2014-11-01 14:58:13 +00:00
Wim Taymans
ceee8d5d40 video-scaler: ORCify vertical ntap function 2014-11-01 13:15:29 +01:00
Wim Taymans
45462d2ea4 video-scaler: handle 4tap interlaced 2014-11-01 13:15:29 +01:00
Wim Taymans
524d30a168 video-scaler: add ORC optimized ntap horizontal scalers 2014-10-31 16:50:49 +01:00
Wim Taymans
19cd171035 video-scaler: fix offset check 2014-10-31 11:23:21 +01:00
Tim-Philipp Müller
ef98393b0d video-scaler: fix build without orc
https://bugzilla.gnome.org/show_bug.cgi?id=739433
2014-10-30 23:53:39 +00:00
Wim Taymans
49d909dabf video-scaler: add more ORC functions
Add the old ORC functions for nearest and linear. Label them as Low
quality because they are not as accurate but ORC lacks opcodes to
express this for now.
2014-10-30 11:48:00 +01:00
Wim Taymans
ca2bd1cc6b video-scaler: rename resampler to video-resampler
Prefix the resampler with video-. It we would like to reuse the
resampler for audio later, we can copy/move it and deprecate this
one.
2014-10-30 11:48:00 +01:00
Wim Taymans
daf20d5e09 video-scaler: remove color range argument
We just need to clip to the format limits, if there is extra headroom in
the range we can use that without problems.
2014-10-29 17:38:33 +01:00
Wim Taymans
21ba193dd6 video-scaler: add ORC optimized versions
Add ORC optimized versions of 2 and 4tap vertical scaling. Provide
a high quality 12 bits and a low quality 6 bits version.
2014-10-29 16:26:19 +01:00
Wim Taymans
84176843c1 video-scaler: add precision to make_s16_taps 2014-10-29 16:26:19 +01:00
Wim Taymans
28e5ed00de resampler: make offset/phase/n_taps uint32
Make various resizer fields uint32 so that we can use them in ORC
functions later.
2014-10-29 16:26:19 +01:00
Wim Taymans
fcc7fbd460 resampler: make shift easier to use 2014-10-29 16:26:10 +01:00
Wim Taymans
32047eaac0 video-scaler: add extra options 2014-10-29 16:26:10 +01:00
Wim Taymans
199fab4b06 video-scaler: add video scaler helper object
Add a video scaler object build on top of the resampler. It has
implementation to deal with interlaced video as well as horizontal and
vertical scaling functions.
2014-10-29 16:26:10 +01:00