Wim Taymans
651ae201bc
audio-resampler: increase precision
2016-03-28 13:25:52 +02:00
Wim Taymans
4cb52f1831
audio-resampler: add more optimizations
2016-03-28 13:25:52 +02:00
Wim Taymans
bdf194a09a
audio-resample: fix taps conversion
...
We do taps conversion in place so make sure we don't overwrite the
input with temporary data.
Optimize some more gint16 functions.
2016-03-28 13:25:52 +02:00
Wim Taymans
f6e0481ab5
audio-resampler: Improve taps memory layout
...
Rearrange the oversampled taps in memory to make it easier to use
SIMD instructions on them. this simplifies some sse code.
Add some more optimizations
2016-03-28 13:25:52 +02:00
Wim Taymans
e9fc039bb1
audio-resampler: add cubic interpolation
2016-03-28 13:25:52 +02:00
Wim Taymans
58dcd0587d
audio-resampler: add more functions
...
Use some macros to generate more functions
2016-03-28 13:25:51 +02:00
Wim Taymans
e02af5c534
audio-resampler: add linear interpolation method
...
Make more functions into macros.
Add linear interpolation of filter coefficients.
2016-03-28 13:25:51 +02:00
Wim Taymans
05d238def9
audio-resampler: add max-phase-error config
2016-03-28 13:25:51 +02:00
Wim Taymans
13e5b986cd
audio-resampler: improve tap calculation
...
Return the taps from make_taps, this makes it possible to not actually
have to cache the taps when we want to.
Fix overflow in phase calculation.
2016-03-28 13:25:51 +02:00
Wim Taymans
6397db74cd
audio-resampler: fix guint -> gint
2016-03-28 13:25:51 +02:00
Wim Taymans
45574ba4f4
audio-resampler: improve phase error
...
Accept a phase error of maximum 10%, which turns out to be inaudible.
2016-03-28 13:25:51 +02:00
Wim Taymans
b0b3350717
audio-resampler: improve phase calculation
...
Also calculate the GCD with the current phase so that we can accurately
represent the current phase with the new resample rates.
2016-03-28 13:25:51 +02:00
Wim Taymans
bbdb447b2b
audio-resampler: fix history after buffer resize
...
When we resize the temp buffer, move the history in its new place.
2016-03-28 13:25:51 +02:00
Wim Taymans
ed747492ef
audio-resampler: add reset function
...
Add a function to reset the audio-resampler.
Use new function in audio-converter
Use the new functions in gstaudioresample and fixup drain functions.
2016-03-28 13:25:51 +02:00
Wim Taymans
ea469ad9a8
audio-resampler: Small fixes
...
Fix the phase.
Reset the new sample buffer with 0.
Move samples around when we change the filter size.
2016-03-28 13:25:51 +02:00
Wim Taymans
a489f9ddb3
audio-resampler: Rework make_taps
...
Make it return a pointer to the generated taps. That way we can later
decide to actually cache it or not.
2016-03-28 13:25:51 +02:00
Wim Taymans
05eb109c0d
audio-resampler: handle filter length changes
...
Update the buffer with history samples when the filter length changes
because of an update of the parameters or sample rates.
2016-03-28 13:25:51 +02:00
Wim Taymans
8dfb3ffb99
audio-resampler: fix samples_avail
...
We only know the taps after we calculate them.
2016-03-28 13:25:51 +02:00
Wim Taymans
c8fc9d88a7
audio-resampler: work on dynamically changing the samplerate
...
Calculate the new phase for the new sample rate.
Fix some docs.
2016-03-28 13:25:51 +02:00
Wim Taymans
4e48867097
audio-resampler: small cleanups
2016-03-28 13:25:51 +02:00
Wim Taymans
85c77659b9
audio-resampler: add fallback to mono function
...
Remove stereo implementations. Implement fall back to mono functions
when the stereo function is missing.
2016-03-28 13:25:50 +02:00
Wim Taymans
2555317a71
audio-resampler: add float stereo SSE function
2016-03-28 13:25:50 +02:00
Wim Taymans
e74c207433
audio-resampler: Fix compilation of intrinsics
...
Only compile intrinsics when we are building for the selected
architecture.
Add sse4.1 optimized int32 resampler code.
2016-03-28 13:25:50 +02:00
Wim Taymans
98bd349b88
audioconvert: only resample on supported formats
2016-03-28 13:25:50 +02:00
Wim Taymans
d348fbb9b9
audio-converter: make some optimized functions
...
Make an optimized function that just calls the resampler when possible.
Optimize the resampler transform_size function a little.
2016-03-28 13:25:50 +02:00
Wim Taymans
23531bdc93
audio-resampler: remove mirror function
...
We don't need to mirror the input, just assume 0 samples.
Always move the processed samples to the start of the buffer.
Add some G_LIKELY
2016-03-28 13:25:50 +02:00
Wim Taymans
6f685410b1
audio-resampler: also enable sse when sse2 is available
2016-03-28 13:25:50 +02:00
Wim Taymans
71871c5048
audio-resampler: optimizations
...
Improve int16 resampling by using pmaddwd
Use intrinsics to scale and pack int16 samples
Align the coefficients so that we can use aligned loads
Add padding to taps and samples so that we don't have to use partial
loads for the remainder of the loops.
Remove copy_n, we can reuse the plain copy function with some new
parameters.
Align and pad the sample array.
2016-03-28 13:25:50 +02:00
Wim Taymans
f55a67ca7c
audio-resampler: make pluggable optimized functions
...
Add support for x86 specialized functions and select them at runtime.
2016-03-28 13:25:50 +02:00
Wim Taymans
819c4c26c7
audio-resampler: combine functions
2016-03-28 13:25:50 +02:00
Wim Taymans
de37491662
audio-converter: simplify API
...
Remove the consumed/produced output fields from the resampler and
converter. Let the caler specify the right number of input/output
samples so we can be more optimal.
Use just one function to update the converter configuration.
Simplify some things internally.
Make it possible to use writable input as temp space in audioconvert.
2016-03-28 13:25:50 +02:00
Wim Taymans
1d9a793545
audio-converter: more work on resampling
...
- Fix the resampler in the audio converter
- fix memory leaks
2016-03-28 13:13:59 +02:00
Wim Taymans
75d668e152
audio-converter: add resampler
...
Add a resampler to the processing chain when needed.
port the audio resampler to the new audioconverter library
2016-03-28 13:13:59 +02:00
Tim-Philipp Müller
f4fb623aba
audiodecoder: avoid unnecessary gst_pad_has_current_caps() checks
...
No need to do this for each input buffer, we have the input caps
stored somewhere already.
https://bugzilla.gnome.org/show_bug.cgi?id=763337
2016-03-24 14:49:12 +02:00
Vineeth TM
44b70ca3a1
base: use new gst_element_class_add_static_pad_template()
...
https://bugzilla.gnome.org/show_bug.cgi?id=763075
2016-03-24 14:25:41 +02:00
Wim Taymans
c0ef1ea553
audio-channel-mixer: improve non-interleaved flags
...
Make separate flags for non-interleaved input and output because the
channel mixer should be able to convert between the two layouts in the
future.
2016-03-04 17:17:33 +01:00
Wim Taymans
221e661f07
audio-quantize: fix feedback dither
...
Make sure we allocated enough extra space in the error buffer to
store the feedback error.
2016-02-24 14:57:31 +01:00
Wim Taymans
3e8cf31a96
audio-converter: perform dithering on the current format
...
Use the current (intermediate) format to decide how to set up dithering
instead of the input format.
2016-02-24 14:57:31 +01:00
Tim-Philipp Müller
ddfe7a2808
win32: remove outdated build cruft
...
This hasn't been touched for generations, doesn't work,
and is just causing confusion. We also don't want to
maintain these files manually.
2016-02-20 10:05:17 +00:00
Wim Taymans
5cef3f31ad
audio-converter: make a copy if we can't write in unpack
...
If we don't have writable memory, make sure to make a copy of the input
samples into a temporary (writable) buffer, even if we are dealing with
a native intermediate format that we don't need to call the unpack
function for.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=761655
2016-02-10 12:51:23 +01:00
HoonHee Lee
dfa2f49523
audio/videodecoder: Minor cleanup of last commit
...
https://bugzilla.gnome.org/show_bug.cgi?id=761218
2016-01-28 13:21:49 +01:00
HoonHee Lee
15df3c812b
audio/videodecoder: use gst_pad_peer_query_caps to make output caps
...
gst_pad_get_allowed_caps() will return NULL if the srcpad has no peer.
In that case, use gst_pad_peer_query_caps() with template caps as filter
to have negotiated output caps properly before forwarding GAP event.
https://bugzilla.gnome.org/show_bug.cgi?id=761218
2016-01-28 11:34:22 +01:00
Wim Taymans
03566e5002
audio-converter: add reset function
2016-01-26 17:19:34 +01:00
Wim Taymans
2d971df593
audio-converter: handle NULL input
...
Allow NULL as input to mean silence samples.
2016-01-26 17:19:34 +01:00
Wim Taymans
6050509b65
audio-converter: improve _update_config
...
Allow NULL config to keep the existing parameters.
Fix the docs.
2016-01-26 17:19:34 +01:00
Wim Taymans
0f757bc23c
audio-converter: audio-converter: make some optimized functions
...
Make optimized functions for generic and passthrough conversion.
2016-01-26 17:19:34 +01:00
Wim Taymans
cde091ae81
audio-quantize: add _reset function
...
Add a reset function that clears any history.
2016-01-26 16:45:44 +01:00
Wim Taymans
3674742957
audio-converter: ensure correct alignment of samples
...
Make sure that the data we allocate for our temporary buffers is
properly aligned.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=760938
2016-01-21 16:27:50 +01:00
Sebastian Dröge
761142e15a
audioencoder: Add note to the documentation about various settings being reset before set_format()
...
It's quite unexpected behaviour that various subclass settings are just
reset before set_format(). Unfortunately changing this now has the risk
of breaking existing code but we should reconsider this for 2.0.
2016-01-16 11:05:13 +01:00
Wim Taymans
1b412a523d
audio-channel-mixer: round before truncating
...
Round the result before truncating for int channel mixing.
2016-01-12 15:56:36 +01:00