summaryrefslogtreecommitdiff
path: root/libavcodec/dds.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-041-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | 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/internal: Move ff_set_dimensions() to decode.hAndreas Rheinhardt2022-08-271-2/+0
| | | | | | | | | Decoder-only, as the dimensions are set by the user when encoding. Also fixup the other headers a bit while removing unnecessary internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move ff_get_buffer() to decode.hAndreas Rheinhardt2022-08-271-0/+1
| | | | | | | | | Only used by decoders (encoders have ff_encode_alloc_frame()). Also clean up the other headers a bit while removing now redundant internal.h inclusions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-1/+0
| | | | | | | | | | | 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/dds: use the common texture dsp decode functionMarton Balint2022-04-101-87/+48
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-1/+1
| | | | | | | | | | | 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: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-051-2/+1
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-6/+6
| | | | | | | | | | | | | | | | 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-211-0/+1
| | | | | | | | | | 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>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dds: Use ff_set_dimensions()Michael Niedermayer2019-08-111-3/+4
| | | | | | | | | Fixes: signed integer overflow: 2082471995 * 36 cannot be represented in type 'int' Fixes: 16025/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DDS_fuzzer-5136663778426880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dds: Fix runtime error: left shift of 145 by 24 places cannot be ↵Michael Niedermayer2017-05-291-1/+1
| | | | | | | | | represented in type 'int' Fixes: 1891/clusterfuzz-testcase-minimized-6274417925554176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dds: Fix runtime error: left shift of 210 by 24 places cannot be ↵Michael Niedermayer2017-05-131-1/+1
| | | | | | | | | represented in type 'int' Fixes: 1510/clusterfuzz-testcase-minimized-5826231746428928 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dds: Fix runtime error: left shift of 1 by 31 places cannot be ↵Michael Niedermayer2017-05-061-1/+1
| | | | | | | | | represented in type 'int' Fixes: 1380/clusterfuzz-testcase-minimized-650122545122508 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc: fix usages of av_get_codec_tag_string()Clément Bœsch2017-03-291-8/+4
|
* dds: limit 4 bpp handling to AV_PIX_FMT_PAL8Andreas Cadhalpun2016-11-161-1/+1
| | | | | | | | | | | This fixes NULL pointer dereferencing for formats, where frame->data[1] is not allocated. The problem was introduced in commit 257fbc3af4cba08ac471dab68924182160bde6fd. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avcodec/dds: add support for 4bpp formatPaul B Mahol2016-09-211-2/+36
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Merge commit '4b2e69397b84d1c1a29ffae6e9f106f2c32b1869'Clément Bœsch2016-06-211-0/+4
|\ | | | | | | | | | | | | * commit '4b2e69397b84d1c1a29ffae6e9f106f2c32b1869': dds: Add support for monochrome images Merged-by: Clément Bœsch <clement@stupeflix.com>
| * dds: Add support for monochrome imagesVittorio Giovara2016-04-261-0/+4
| |
| * dds: Drop gray-alpha swappingVittorio Giovara2016-04-261-12/+0
| | | | | | | | The original sample was generated with invalid software.
* | Merge commit '22e49e6edead9c83696f20127988f659b952ce65'Derek Buitenhuis2016-05-081-5/+1
|\ \ | |/ | | | | | | | | | | * commit '22e49e6edead9c83696f20127988f659b952ce65': dds: Simplify postprocessing check Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * dds: Simplify postprocessing checkVittorio Giovara2016-04-061-3/+1
| |
* | Merge commit '02538636261fdec9c70f4185b23147c636f269b4'Derek Buitenhuis2016-05-081-0/+2
|\ \ | |/ | | | | | | | | | | * commit '02538636261fdec9c70f4185b23147c636f269b4': dds: Add support for alpha-only files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * dds: Add support for alpha-only filesVittorio Giovara2016-04-061-0/+2
| | | | | | | | | | | | | | Due to how pixel format conversion is done, they behave the same way as gray files. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '9a9fb710bcf4657e030467cfe2556cb0e2c01afc'Derek Buitenhuis2016-05-081-0/+4
|\ \ | |/ | | | | | | | | | | * commit '9a9fb710bcf4657e030467cfe2556cb0e2c01afc': dds: Add support for rgb555 files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * dds: Add support for rgb555 filesVittorio Giovara2016-04-061-0/+4
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * dds: disable palette flag for compressed imagesAndreas Cadhalpun2015-11-141-0/+6
| | | | | | | | | | | | | | | | Having both is not valid and can cause a NULL pointer dereference of frame->data[1] later. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * dds: add missing newline to log messagesAndreas Cadhalpun2015-11-121-2/+2
| | | | | | | | Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
| * dds: validate compressed source buffer sizeAndreas Cadhalpun2015-11-121-0/+9
| | | | | | | | | | | | | | A too small buffer will cause segfaults somewhere below decompress_texture_thread. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
| * dds: validate source buffer size before copyingAndreas Cadhalpun2015-11-121-0/+6
| | | | | | | | | | | | If it is too small av_image_copy_plane segfaults. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | lavc/dds: Fix GRAY8A decoding.Carl Eugen Hoyos2016-04-151-2/+4
| | | | | | | | Fixes ticket #4667.
* | lavc/dds: replace rint by lrintGanesh Ajjanagadde2015-12-261-1/+2
| | | | | | | | | | | | avoids float to int cast. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | dds: disable palette flag for compressed ddsAndreas Cadhalpun2015-11-141-0/+6
| | | | | | | | | | | | | | | | Having both is not valid and can cause a NULL pointer dereference of frame->data[1] later. Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | dds: add missing newline to log messagesAndreas Cadhalpun2015-11-111-2/+2
| | | | | | | | | | Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | dds: validate compressed source buffer sizeAndreas Cadhalpun2015-11-111-0/+9
| | | | | | | | | | | | | | | | A too small buffer will cause segfaults somewhere below decompress_texture_thread. Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | dds: validate source buffer size before copyingAndreas Cadhalpun2015-11-111-0/+6
| | | | | | | | | | | | | | If it is too small av_image_copy_plane segfaults. Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-271-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-1/+1
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * dds: Write the palette in the native endian formMartin Storsjö2015-07-231-5/+7
| | | | | | | | | | | | | | This fixes the palette on big endian, broken (or, differing from little endian) since 57214b2f7. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'ebe8b5d947c41449c684f17c6826fe6bc46c0360'Michael Niedermayer2015-07-231-9/+17
|\ \ | |/ | | | | | | | | | | * commit 'ebe8b5d947c41449c684f17c6826fe6bc46c0360': dds: Fix the slice size computation Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * dds: Fix the slice size computationTom Butterworth2015-07-231-9/+17
| | | | | | | | | | | | | | | | A bug was introduced in 6b2b26e7af3ede0abfb46eb5725c26d1083f50bc whereby when frame height wasn't divisible by the number of threads, pixels would be omitted from the bottom rows during decode. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * dds: Fix 32bpp bitmaps decodingMichael Niedermayer2015-07-221-5/+7
| | | | | | | | | | Found-By: ami_stuff Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * dds: Fix palette decodingVittorio Giovara2015-07-221-3/+7
| | | | | | | | | | | | Red and blue channels were decoded in the wrong order. Found-By: ami_stuff
* | Merge commit 'ea4d46e72945cba37feb7aa154eb970732f513e4'Michael Niedermayer2015-07-221-2/+2
|\ \ | |/ | | | | | | | | | | * commit 'ea4d46e72945cba37feb7aa154eb970732f513e4': dds: Fix enum declaration Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * dds: Fix enum declarationVittorio Giovara2015-07-221-2/+2
| | | | | | | | Drop the global variables with anonymous enum type.
* | Merge commit '6b2b26e7af3ede0abfb46eb5725c26d1083f50bc'Michael Niedermayer2015-07-211-9/+27
|\ \ | |/ | | | | | | | | | | * commit '6b2b26e7af3ede0abfb46eb5725c26d1083f50bc': dds: Decode using optimal slices sizes Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * dds: Decode using optimal slices sizesLuca Barbato2015-07-211-9/+27
| | | | | | | | | | | | | | Enjoy some cache locality and use less threads. About the same speedup provided to HAP. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * dds: Fix palette mode on big endianLuca Barbato2015-06-241-1/+6
| | | | | | | | | | Found-By: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/dds: Flip more R<->B casesMichael Niedermayer2015-07-201-5/+9
| | | | | | | | | | | | Fixes Ticket4665 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>