summaryrefslogtreecommitdiff
path: root/opusdec_filter.c (follow)
Commit message (Collapse)AuthorAge
* Switch to SPDX identifiers.Andre Noll2026-03-17
| | | | | | | | Generated with sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h followed by manually tweaking the result a bit. No license change intended.
* doxygen: Hide user_data variables.Andre Noll2025-10-08
| | | | | These just clutter the generated documentation, particularly the list of global variables.
* Include regex.h from para.h.Andre Noll2025-05-19
| | | | Every .c file includes it anyway.
* Constify buffer tree API.Andre Noll2024-05-08
| | | | | | A lot of functions of the buffer tree API don't modify the memory referenced by the pointers passed. This patch marks these pointer arguments as constant.
* Consolidate EOF error codes.Andre Noll2023-03-11
| | | | | | Currently we have ~15 error codes which indicate an EOF condition. One should suffice, so drop all codes except the generic E_EOF and use that everywhere.
* Merge topic branch t/overflow into masterAndre Noll2022-10-03
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This series implements a new memory allocation API which checks for overflows. The first part of the series just renames the main allocation functions. Later patches in the series implement allocators which take two size_t arguments (like calloc(3)) and check whether the multiplication overflows by employing the __builtin_mul_overflow() primitive supported by gcc and clang. This requires us to bump the lowest supported gcc and clang version. * refs/heads/t/overflow: build: Compile with -ftrapv. string: Introduce arr_zalloc(). string: Introduce arr_alloc(). string: Introduce arr_realloc() and check for integer overflow. string: Rename para_calloc() -> zalloc(). string: Rename para_malloc() -> alloc(). string: Overhaul para_strdup().
| * string: Introduce arr_alloc().Andre Noll2022-07-29
| | | | | | | | | | | | | | | | Change all callers of alloc() which pass a product of two integers as the allocation size to call the new function instead. This function aborts if the multiplication overflows. With arr_alloc() in place, alloc() reduces to a trivial wrapper which calls new arr_alloc() with the first argument equal to one.
| * string: Rename para_calloc() -> zalloc().Andre Noll2022-07-29
| | | | | | | | | | Reword the documentation a bit since the function has never been a wrapper for calloc(3). No code changes.
| * string: Rename para_malloc() -> alloc().Andre Noll2022-07-29
| | | | | | | | | | | | | | Just because it's shorter and matches the naming of the new allocators we are about to introduce. The bulk of this patch was created with sed -i 's/para_malloc/alloc/g' *.c *.h yy/mp.y
* | Rename ->{pre,post}_select methods to ->{pre,post}_monitor.Andre Noll2022-08-25
|/ | | | | | | The word "monitor" is neutral and continues to be correct after the switch from select(2) to poll(2). Pure rename, nothing to see here.
* Shorten copyright notice.Andre Noll2017-09-22
| | | | | | | | | | | | | | | | | | | | | The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
* Convert filters to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the *_filter.m4 gengetopt files by the filter_cmd lopsub suite, where each filter is realized as a subcommand. Due to this change, para_filter needs to be linked with -llopsub. The filter structure is now stored in the user_data pointer provided by lopsub, allowing to get rid of the global filters[] array, the FILTER_ENUM macro and the corresponding enumeration constants. The removal of the ->goo_help member of struct filter makes this structure constant. Hence ->init() of struct filter can also go away. We still can tell whether a filter is supported by checking the user_data pointer: if it is NULL, the filter is unsupported. The new filter_supported() helper in filter_common.c is provided for convenience. Parsing of the filter command line options is now performed generically, and the ->parse_config() method is renamed to ->setup(), an optional function which is supposed to perform semantic checks and the one-time setup of the filter, if any. It is accompanied by ->teardown() which replaces ->free_config(). The conversion of the individual filters is easy since most filters have a simple syntax or take no arguments at all. The resample_filter, however, needs a different way to copy the wav parameters from the lopsub parse result to the wav parms structure. A suitable macro, LLS_COPY_WAV_PARMS is added to check_wav.h for this purpose. The old COPY_WAV_PARMS needs to stay until para_write, the only other user of the macro, has been converted as well. The section heading of the manual page has changed slightly, causing t0005 to fail. Hence this test needs a slight adjustment.
* opus: Use uint16_t for preskip and gain.Andre Noll2016-03-28
| | | | | These values are obtained by reading a 16 bit value from a buffer, so uint16_t is the right type for these fields.
* Update year in copyright headers.Andre Noll2015-01-12
| | | | | | | | | | | | | | | | Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
* doc: Change email address to maan@tuebingen.mpg.deAndre Noll2014-08-18
| | | | | | | | | | | | | | The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
* sched: Directly pass context pointer to pre/post_select().Andre Noll2014-05-25
| | | | | | | | | | | | | | | The patch is large, but it's fairly straight forward: Instead of a task pointer all ->pre_select() and ->post_select() methods now receive the context pointer that was passed to the scheduler when the task was registered. This allows to kill the public task_context(). Two pre_select/post_select functions are not directly called by the scheduler: session_post_select(), generic_recv_pre_select(). These are changed to receive a proper struct rather than a void pointer. Note that generic_filter_pre_select() is not changed in this manner because some filters do not provide a pre_select wrapper but set task->pre_select to generic_filter_pre_select().
* task_register() conversion: filter tasksAndre Noll2014-05-25
|
* Merge branch 't/opusdec_busy_loop_fix'Andre Noll2014-04-08
|\ | | | | | | | | | | | | A single fix that was cooking since 2014-03-02. * t/opusdec_busy_loop_fix: opusdec: Fix busy loop.
| * opusdec: Fix busy loop.Andre Noll2014-02-23
| | | | | | | | | | | | | | This braino caused the opus decoder to request a minimal timeout most of the time. The bug was introduced 2013-09 in commit 14c16b65.
* | Change copyright year to 2014.Andre Noll2014-02-22
|/ | | | | | | | | This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
* opusdec: Latency improvements.Andre Noll2013-11-10
| | | | | | | | | | | | | | Currently the opus decoder works on the ogg page level, i.e. during each scheduler iteration it tries to extract one ogg page from the stream and decodes all opus packages therein. Since ogg pages can be quite large (20K), decoding can take a significant amount of time, especially on slow machines. If the decoding takes longer than the buffer time of the configured writer, audible buffer underruns result. This changes the opus decoder to decode only a single packet during each iteration. With this patch applied, latency improves greatly, and underruns occur on neither an old 150MHz AMD K6 nor on the raspberry pi.
* opusdec: Get rid of opusdec_pre_select().Andre Noll2013-07-13
| | | | | The generic one should do just fine and the additional 100ms timeout should not be necessary.
* opusdec: avoid __STDC_VERSION__ warning.Andre Noll2013-07-13
| | | | | | | | | | | | | opusdec_filter.c indirectly includes opus_types.h which checks whether __STDC_VERSION__ >= 199901L. However, at least some gcc versions don't define __STDC_VERSION__ which results in warning: "__STDC_VERSION__" is not defined For example, this happens on Ubuntu lucid, which ships gcc-4.4.3. This patch gets rid of the warning by defining __STDC_VERSION__ if necessary prior to including the opus_types header.
* The opus decoder.Andre Noll2013-05-26
| | | | | Implementation is similar to the speex decoder, in particular meta data handling is almost identical.
* ogg/opus: Infrastructure.Andre Noll2013-05-26
This adds tests for libopus to configure.ac and minimal (non-working) implementations of the ogg/opus decoder and audio format handler.