summaryrefslogtreecommitdiff
path: root/libavcodec/mlpenc.c
Commit message (Collapse)AuthorAge
* avcodec/mlpenc: Simplify finding best codebookAndreas Rheinhardt2020-12-31
| | | | | | | | | | | | Finding the best codebook involves comparing different paths, where each path is a sequence of several decisions (namely which codebook to use). Up until now, these sequence was encoded in a NUL-terminated string and the actual decisions were encoded as ’\0'..'\3' (which encoded 0..3). This commit modifies this to actually encode it via 0..3 by switching away from a C-string to a simple array with an explicit length field. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mlpenc: Fix memleak upon init failureAndreas Rheinhardt2020-09-15
| | | | | | | | | If an error happens during init after an allocation has succeeded, the already allocated data leaked up until now. Fix this by setting the FF_CODEC_CAP_INIT_CLEANUP flag. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mlpenc: free filter state buffers on allocation failureJames Almer2020-07-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mlpenc: propagate proper error valuesJames Almer2020-07-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mlpenc: remove delay codec capabilityJames Almer2020-07-01
| | | | | | | | | | The encoder has no delayed packets at the end of the encoding process, so signaling this capability is unnecessary. This also fixes an assertion failure introduced in 827d6fe73d, as return values higher than 0 are not expected. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mlpenc: fix small memory leakPaul B Mahol2020-02-04
|
* mlp: check huff_lsbs only when codebook is usedJai Luthra2020-02-04
| | | | | | | When no codebook is used, huff_lsbs can be more than 24 and still decode to original values once filters are applied. Signed-off-by: Jai Luthra <me@jailuthra.in>
* mlpenc: fix some -fsanitize=integer errorsJai Luthra2020-02-04
| | | | Signed-off-by: Jai Luthra <me@jailuthra.in>
* mlpenc: clean upJai Luthra2020-02-04
| | | | Signed-off-by: Jai Luthra <me@jailuthra.in>
* mlpenc: improve lpc filteringJai Luthra2020-02-04
| | | | | | | | | * fix a possible memory leak (apply_filter returned before freeing) * use apply_filters in process_major_frame * revert back to checking bounds with 24 bitdepth, as huff offset takes care of it Signed-off-by: Jai Luthra <me@jailuthra.in>
* mlpenc: prevent negative lsb_bits lshiftJai Luthra2020-02-04
| | | | | | Fixes Coverity CID 1396239. Signed-off-by: Jai Luthra <me@jailuthra.in>
* mlpenc: fix huff offset calculationJai Luthra2020-02-04
| | | | | | | huff offset wasn't always within the bounds before, which lead to corrupt encoding that didn't always trigger lossless check failures Signed-off-by: Jai Luthra <me@jailuthra.in>
* mlpenc: fix lossless check error in number_sbitsJai Luthra2020-02-04
| | | | | | we need two bits instead of one bit to represent -1 in bitstream Signed-off-by: Jai Luthra <me@jailuthra.in>
* lavc/mlpenc: remove the redundant condition checkJun Zhao2019-05-12
| | | | | | remove the redundant condition check for 'frame' Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* mlpenc: Working MLP/TrueHD encoderJai Luthra2016-09-17
* Multichannel support for TrueHD is experimental There should be downmix substreams present for 2+ channel bitstreams, but ffmpeg decoder doesn't need it. Will add support for this soon. * There might be lossless check failures on LFE channels * 32-bit sample support has been removed for now, will add it later While testing, some samples gave lossless check failures when enforcing s32. Probably this will also get solved with the LFE issues. Signed-off-by: Jai Luthra <me@jailuthra.in>