summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/packet: change side data related public function and struct size ↵James Almer2021-03-10
| | | | | | | | | types to size_t av_packet_add_side_data() already defines size as a size_t, so this makes it consistent across all side data functions Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mediacodec_wrapper: use MediaCodecInfo.isSoftwareOnly() when availablesfan52021-03-10
| | | | | Added in Android 10 it provides a reliable way of filtering out software decoders, unlike existing string-based checks.
* avcodec/mediacodec_wrapper: check if codec is software earliersfan52021-03-10
|
* libavcodec/amfenc_hevc: Recommend values for min and max video quantizer scale.Ovchinnikov Dmitrii2021-03-09
| | | | | | | Current settings makes bitrate larger than expected, more information: https://github.com/HandBrake/HandBrake/issues/3447#issue-820490736 Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/decode: Reindent after previous commitsAndreas Rheinhardt2021-03-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/decode: Don't needlessly copy side-data for subtitlesAndreas Rheinhardt2021-03-09
| | | | | | | | AVCodecInternal.last_pkt_props is not used when decoding subtitles; ergo it makes no sense to set it at all. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/decode: Avoid stack packets when decoding subtitlesAndreas Rheinhardt2021-03-09
| | | | | | | | | | | | | Use AVCodecInternal.buffer_pkt (previously only used in avcodec_send_packet) instead of stack packets when decoding subtitles. Also stop sharing side-data between packets and use the user-supplied packet directly for decoding when possible (no subtitle decoder ever modifies the packet it is given). Reusing AVCodecInternal.buffer_pkt is based upon an idea from James Almer. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/qsvdec: Make functions used only here static, remove headerAndreas Rheinhardt2021-03-09
| | | | | | | | | Forgotten after d78ecf10bd745cb69a71b32419e0661bfdcfb1fd. (Also mark some AVPackets as const.) Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Constify some AVPacketsAndreas Rheinhardt2021-03-09
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dcadsp: Fix integer overflow in dmix_add_c()Michael Niedermayer2021-03-08
| | | | | | | | Fixes: signed integer overflow: 1515225320 + 759416059 cannot be represented in type 'int' Fixes: 29256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DCA_fuzzer-5719088561258496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Avoid undefined negation in imdct_and_windowing_eld()Michael Niedermayer2021-03-08
| | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'INTFLOAT' (aka 'int'); cast to an unsigned type to negate this value to itself Fixes: 29057/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5642758933053440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: add forgotten flags to mpeg4_optionsPaul B Mahol2021-03-08
|
* mobiclip: fix copyright headersFlorian Nouwt2021-03-08
| | | | | | | | The Mobiclip related code was based on Mobius (https://github.com/adibsurani/Mobius), which was based on my original reverse engineering efforts (https://github.com/Gericom/MobiclipDecoder). This commit adds the appropriate copyright headers on the related files. Signed-off-by: Florian Nouwt <fnouwt2@gmail.com>
* avcodec/ylc: Reindent after previous commitAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ylc: Avoid code duplication when creating and freeing VLCsAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ylc: Use only one temporary bufferAndreas Rheinhardt2021-03-08
| | | | | | | | | The effective lifetime of the buffer used to build the VLCs and the buffer containing the bitstream is disjoint, so that one can use a common buffer for both. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ylc: Remove write-only variableAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/h261dec: Remove parse_context cruftAndreas Rheinhardt2021-03-08
| | | | | | | | The H.261 decoder doesn't use the ParseContext of its MpegEncContext since e7316976650b429345da619c3acff38004aaf6b8. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc: clarify thread_safe_callbacks doxyAnton Khirnov2021-03-08
| | | | | State explicitly when this field will be removed and how to access it in a forward compatible way.
* lscrdec: add copyright headerAnton Khirnov2021-03-08
| | | | As requested by the author.
* lavc: remove tests/optionsAnton Khirnov2021-03-08
| | | | It tests deprecated avcodec_copy_context().
* mjpegdec: handle lowres with AVID croppingAnton Khirnov2021-03-08
|
* avcodec/jpeglsenc: Allocate buffers togetherAndreas Rheinhardt2021-03-08
| | | | | | | | | Having only one allocation that is not automatically freed in particular means that one does not need to free the already allocated buffers when allocating another one fails. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Avoid allocation of JLSStateAndreas Rheinhardt2021-03-08
| | | | | | | | This state is currently allocated and freed for every packet; but it can just be moved to the stack instead. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Only use one line at a time as spare bufferAndreas Rheinhardt2021-03-08
| | | | | | | | | | | | | | | | | | | ls_encode_line() encodes one line of input from left to right and to do so it uses the values of the left, upper left, upper and upper right pixels for prediction (i.e. the values that a decoder gets when it decodes the already encoded part of the picture). So a simple algorithm would use a buffer that can hold two lines, namely the current line as well as the last line and swap the pointers to the two lines after decoding each line. Yet if one is currently encoding the pixel with index k of a line, one doesn't need any pixel with index < k - 1 of the last line at all and similarly, no pixels with index >= k have been written yet. So the overlap in the effective lifetime is pretty limited and since the last patch (which stopped reading the upper left pixel and instead reused the value of the upper pixel from the last iteration of the loop) it is inexistent. Ergo one only needs one line and doesn't need to swap the lines out. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Move check out of loopAndreas Rheinhardt2021-03-08
| | | | | | | | | | | | | | | | | | ls_encode_line() encodes a line of input, going from left to right. In order to calculate a predicted value it uses the left and upper-left value of the output picture (that is, it uses how a decoder would see the already encoded part of the picture), unless this is the very first pixel of this line in which case one uses the first pixel of the last (upper) line and the line before the last line. Therefore the loop contained a check for whether this is the beginning of a new line. This commit moves said check out of the loop by initializing these values before the loop and by updating these values at the end of the loop body; already read/calculated values are reused for this (the prediction also needs the value of the upper pixel and this can be reused for the upper left value of the next iteration of the loop). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Don't modify frame we don't ownAndreas Rheinhardt2021-03-08
| | | | | | | | | | | | | | | | | | | | | The jpegls encoder uses three buffers (as well as its state) to perform its function: A copy of the last encoded line as a decoder would decode it, the part of the current line that has been encoded (again, as a decoder would decode it) and the part of the current line that is not yet encoded. The encoder solves this by modifying the input frame as it encodes the output (it also zero-allocates a line to serve as last line for the first line where no preceding line exists); yet this is wrong as said frame is not owned by the encoder, so it must not be modified (and it is given to the encoder as const AVFrame *) without making it writable. This patch solves this bug by allocating two lines, one for the last and one for the currently encoded line of output (as a decoder would decode it). Notice that the frame is only modified if the encoder is in the non-default non-lossless mode. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Don't use put bits API for byte-aligned writesAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/codec: Update init_static_data doxygenAndreas Rheinhardt2021-03-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avcodec: Don't suggest calling deprecated avcodec_register_all()Andreas Rheinhardt2021-03-08
| | | | | | | | | | | | Despite avcodec_register and avcodec_register_all being deprecated, their documentation still said that one of them has to be called before doing anything else. Clarify this confusing situation. Furthermore, don't use avcodec_register_all in sample code for a non-deprecated function. Reviewed-by: mypopy@gmail.com <mypopy@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/codec: add doxy to AVCodec.decode()James Almer2021-03-07
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/codec: use the correct name for all AVCodec.decode() parametersJames Almer2021-03-07
| | | | | | | This field hasn't been used to return the output frame size since avcodec_decode_audio4() was introduced. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/codec: remove outdated comment about AVCodec.encode2()James Almer2021-03-07
| | | | | | | The packet passed as argument to this function hasn't contained a user-provided buffer since 93016f5d1d. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libxvid: Remove unnecessary headerAndreas Rheinhardt2021-03-06
| | | | | | Forgotten in a1c6fc773f941fd6a6ef3f12f102a7902ae69453. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/parser: Schedule av_parser_change for removalAndreas Rheinhardt2021-03-06
| | | | | | | | Originally deprecated in 748c2fca7e4d99357c234936aa71212a6282be36, publically deprecated in 9a07c1332cfe092b57b5758f22b686ca58806c60 (merged into FFmpeg in 1885ffb03d0af28e6bac2bcc8725fa15b93f6ac9). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: add TTML encoderJan Ekström2021-03-05
| | | | | | Enables encoding of other subtitle formats into TTML paragraphs. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avcodec: enable usage of err_recognition for encodersJan Ekström2021-03-05
| | | | | | | | Enables the usage of such values as AV_EF_EXPLODE in encoders, which can be useful in cases such as subtitle encoders where they have the responsibility to validate the correctness of an incoming ASS dialog line. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avcodec/decode: Check size before opening iconvAndreas Rheinhardt2021-03-05
| | | | | | | Avoids closing iconv when the size check fails. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/decode: Return early upon failureAndreas Rheinhardt2021-03-05
| | | | | | | Allows to remove one level of indentation. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/speedhq: fix decoding non 444 subsampling when width is not multiple ↵Paul B Mahol2021-03-04
| | | | of 16
* avcodec/decode: constify the source packet parameter in extract_packet_props()James Almer2021-03-03
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/utils: free last_pkt_props on avcodec_open2() failureJames Almer2021-03-03
| | | | | | Regression since b34d1de8dc Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/decode: port last_pkt_props to AVFifoBufferJames Almer2021-03-03
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/float2half: fix minor style issuePaul B Mahol2021-03-03
|
* avcodec/half2float: fix integer overflows in convertmantissa()Paul B Mahol2021-03-03
|
* avcodec/mobiclip: Avoid undefined integer overflow in MV computationMichael Niedermayer2021-03-03
| | | | | | | | Fixes: signed integer overflow: 1 + 2147483647 cannot be represented in type 'int' Fixes: 30877/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-4775601145774080 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/alsdec: Check bitstream input in read_block()Michael Niedermayer2021-03-03
| | | | | | | | Fixes: Timeout Fixes: 28110/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5036338973507584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/exr: add lut oriented half to float conversion codePaul B Mahol2021-03-02
|
* avcodec/exrenc: move float2half code to own headerPaul B Mahol2021-03-02
|
* avcodec/exr: add DWA decompression supportPaul B Mahol2021-03-02
|