summaryrefslogtreecommitdiff
path: root/libavcodec/mlpenc.c
Commit message (Collapse)AuthorAge
* all: use designated initializers for AVOption.unitAnton Khirnov2024-02-14
| | | | | | | | | | | | | | | | | | | | | | | | Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-20
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-22
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mlpenc: try different filter parameters in case of out of range ↵Paul B Mahol2023-10-27
| | | | output from LPC
* avcodec/mlpenc: add support for 4.0/4.1 ch layoutPaul B Mahol2023-10-27
|
* avcodec/mlpenc: add 3.1 ch layout support for truehdPaul B Mahol2023-10-27
|
* avcodec/mlpenc: add 2.1 layout support for truehdPaul B Mahol2023-10-20
|
* avcodec/mlpenc: add proper support for output bit shiftPaul B Mahol2023-10-20
|
* avcodec/mlpenc: add support for TrueHD substreamsPaul B Mahol2023-10-20
| | | | Add 3.0 channel layout support for truehd encoder.
* avcodec/mlpenc: use ctx->num_substreams when writing headersPaul B Mahol2023-10-20
|
* avcodec/mlpenc: add helper function to derive TrueHD ch map from ch_layoutPaul B Mahol2023-10-20
|
* avcodec/mlp*: merge flags used by encoder and decoderPaul B Mahol2023-10-18
|
* avcodec/mlpenc: cleanup filteringPaul B Mahol2023-10-18
|
* avcodec/mlpenc: allow smaller shift for LPCPaul B Mahol2023-10-18
|
* avcodec/mlpenc: implement advanced stereo rematrixPaul B Mahol2023-10-18
|
* avcodec/mlpenc: remove TODO comment, sample rate is always fixedPaul B Mahol2023-10-18
|
* avcodec/mlpenc: restructure code even morePaul B Mahol2023-10-18
| | | | Implement lsb_bypass for lossless rematrix.
* avcodec/mlpenc: export lpc_coeff_precision optionPaul B Mahol2023-10-10
| | | | Change default precision from 11 to 15, improves compression.
* avcodec/mlpenc: fix regression in encoding only zeroesPaul B Mahol2023-10-10
| | | | Previously it would use more bits than neccessary.
* avcodec/mlpenc: export max_interval optionPaul B Mahol2023-10-09
|
* avcodec/mlpenc: export codebook_search option tooPaul B Mahol2023-10-09
|
* avcodec/mlpenc: change flag for shorten_by in THD casePaul B Mahol2023-10-09
|
* avcodec/mlpenc: fix stereo decorrelationPaul B Mahol2023-10-09
|
* avcodec/mlpenc: rename some variables related to thdPaul B Mahol2023-10-07
| | | | Remove warning message that is no longer needed.
* avcodec/mlpenc: restructure code and resolve several bugsPaul B Mahol2023-10-06
| | | | | | | | | | | | | Do not use put_sbits() where only unsigned is stored. Reduce size of data_check_present field. Reduce size of table of codebook_extremes[]. Avoid anonymously typedeffed structs. Use encoder private context to store parameters. Fix wrapping when calculating offsets. Restructure arrays in encoder private context so to keep arrays belonging to same subblock into separate structure. Disable matrix coefficients as they are sometimes producing wrong results.
* avcodec/mlpenc: allow changing some LPC parametersPaul B Mahol2023-10-02
|
* avcodec/mlpenc: increase compression ratio even more, fix LPC parametersPaul B Mahol2023-10-02
|
* avcodec/mlpenc: increase compression ratio when input is of lower bit depthPaul B Mahol2023-10-02
|
* avcodec/mlpenc: fix quant_step_size for 16bit sample format inputPaul B Mahol2023-10-01
|
* avcodec/mlpenc: fix writing end of stream markerPaul B Mahol2023-10-01
|
* avcodec: add AVCodecContext.frame_num as 64 bit variant to frame_numberMarton Balint2023-02-13
| | | | | | | | | | Frame counters can overflow relatively easily (INT_MAX number of frames is slightly more than 1 year for 60 fps content), so make sure we use 64 bit values for them. Also deprecate the old 32 bit frame_number attribute. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/codec_internal: Avoid deprecation warnings for channel_layoutsAndreas Rheinhardt2022-09-28
| | | | | | | | | | | | | | | | | | AVCodec.channel_layouts is deprecated and Clang (unlike GCC) warns when setting this field in a codec definition. Fortunately, Clang (unlike GCC) allows to use FF_DISABLE_DEPRECATION_WARNINGS inside a definition (of an FFCodec), so that one can create simple macros to set AVCodec.channel_layouts that also suppress deprecation warnings for Clang. (Notice that some of the codec definitions were already inside FF_DISABLE/ENABLE_DEPRECATION_WARNINGS (that were not guarded by FF_API_OLD_CHANNEL_LAYOUT); these have been removed. Also notice that setting AVCodec.channel_layouts was not guarded by FF_API_OLD_CHANNEL_LAYOUT either, so testing disabling it it without removing all the codeblocks would not have worked.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mlpenc: Remove dead channel layout checksAndreas Rheinhardt2022-09-22
| | | | | | | | ff_encode_preinit() has already checked that the channel layout is equivalent to one of the layouts in AVCodec.ch_layouts. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mlpenc: Simplify channel layout comparisonsAndreas Rheinhardt2022-09-22
| | | | | | | | | | | | | These encoders have AVCodec.ch_layouts set, so ff_encode_preinit() has already checked that the used channel layout is equivalent to one of these native layouts. Therefore one can simply compare the channel masks (with the added complication that one has to use av_channel_layout_subset() to get it, because the channel layout is not guaranteed to have AV_CHANNEL_ORDER_NATIVE). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mlpenc: Fix channel layoutsAndreas Rheinhardt2022-09-22
| | | | | | | | The encoder actually creates files with side channels, not back channels. See thd_layout in mlp_parse.h. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mlpenc: analyze only if there are samplesPaul B Mahol2022-09-21
|
* avcodec/mlpenc: improve encoding of stereo TrueHD and add mono supportPaul B Mahol2022-09-18
|
* avcodec/mlpenc: rename some variables to better alternativesPaul B Mahol2022-09-18
|
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-03
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make ff_alloc_packet() based encoders accept user buffersAndreas Rheinhardt2022-08-27
| | | | | | | | | | | | | | | | | | Up until now, these encoders received non-refcounted packets (whose data was owned by the corresponding AVCodecContext) from ff_alloc_packet(); these packets were made refcounted lateron by av_packet_make_refcounted() generically. This commit makes these encoders accept user-supplied buffers by replacing av_packet_make_refcounted() with an equivalent function that is based upon get_encode_buffer(). (I am pretty certain that one can also set the flag for mpegvideo- based encoders, but I want to double-check this later. What is certain is that it reallocates the buffer owned by the AVCodecContext which should maybe be moved to encode.c, so that proresenc_kostya.c and ttaenc.c can make use of it, too.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify frame->data pointers for encoders where possibleAndreas Rheinhardt2022-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mlpenc: fix encoding after receiving last framePaul B Mahol2022-04-13
| | | | | This happened when major header needed to be written after input EOF.
* avcodec/mlpenc: simplify calling functionPaul B Mahol2022-04-12
|
* avcodec/mlpenc: use FFMAX()Paul B Mahol2022-04-12
|
* avcodec/mlpenc: improve handling of last samplesPaul B Mahol2022-04-12
|
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-21
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-21
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>