summaryrefslogtreecommitdiff
path: root/libavutil/pixdesc.h
Commit message (Collapse)AuthorAgeFilesLines
* avutil/pixdesc: Add av_chroma_location_(enum_to_pos|pos_to_enum)Andreas Rheinhardt2022-09-261-0/+22
| | | | | | | They are intended as replacements for avcodec_enum_to_chroma_pos() and avcodec_chroma_pos_to_enum(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/pixdesc: favour formats where depth and subsampling exactly matchPhilip Langdale2022-09-171-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since introducing the various packed formats used by VAAPI (and p012), we've noticed that there's actually a gap in how av_find_best_pix_fmt_of_2 works. It doesn't actually assign any value to having the same bit depth as the source format, when comparing against formats with a higher bit depth. This usually doesn't matter, because av_get_padded_bits_per_pixel() will account for it. However, as many of these formats use padding internally, we find that av_get_padded_bits_per_pixel() actually returns the same value for the 10 bit, 12 bit, 16 bit flavours, etc. In these tied situations, we end up just picking the first of the two provided formats, even if the second one should be preferred because it matches the actual bit depth. This bug already existed if you tried to compare yuv420p10 against p016 and p010, for example, but it simply hadn't come up before so we never noticed. But now, we actually got a situation in the VAAPI VP9 decoder where it offers both p010 and p012 because Profile 3 could be either depth and ends up picking p012 for 10 bit content due to the ordering of the testing. In addition, in the process of testing the fix, I realised we have the same gap when it comes to chroma subsampling - we do not favour a format that has exactly the same subsampling vs one with less subsampling when all else is equal. To fix this, I'm introducing a small score penalty if the bit depth or subsampling doesn't exactly match the source format. This will break the tie in favour of the format with the exact match, but not offset any of the other scoring penalties we already have. I have added a set of tests around these formats which will fail without this fix.
* Remove obsolete version.h inclusionsAndreas Rheinhardt2021-07-221-1/+0
| | | | | | | These have mostly been added because of FF_API_*; yet when these were removed, removing the header has been forgotten. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPALAndreas Rheinhardt2021-04-271-20/+0
| | | | | | | Deprecated in d6fc031caf64eed921bbdef86d79d56bfc2633b0. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/pixdesc: Remove deprecated off-by-one fields from pix fmt descsAndreas Rheinhardt2021-04-271-11/+0
| | | | | | | Deprecated in 2268db2cd052674fde55c7d48b7a5098ce89b4ba. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/pixdesc: add missing FF_API_PSEUDOPAL checkJames Almer2020-10-021-0/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/pixdesc: Add av_write_image_line2(), av_read_image_line2()Michael Niedermayer2018-10-271-0/+11
| | | | | | | | | This is needed because of 32bit float formats (which are difficult to store in 16bits) This also fixes undefined behavior found by fate Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/pixdesc: add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8Marton Balint2018-04-301-6/+2
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPALwm42018-04-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PSEUDOPAL pixel formats are not paletted, but carried a palette with the intention of allowing code to treat unpaletted formats as paletted. The palette simply mapped the byte values to the resulting RGB values, making it some sort of LUT for RGB conversion. It was used for 1 byte formats only: RGB4_BYTE, BGR4_BYTE, RGB8, BGR8, GRAY8. The first 4 are awfully obscure, used only by some ancient bitmap formats. The last one, GRAY8, is more common, but its treatment is grossly incorrect. It considers full range GRAY8 only, so GRAY8 coming from typical Y video planes was not mapped to the correct RGB values. This cannot be fixed, because AVFrame.color_range can be freely changed at runtime, and there is nothing to ensure the pseudo palette is updated. Also, nothing actually used the PSEUDOPAL palette data, except xwdenc (trivially changed in the previous commit). All other code had to treat it as a special case, just to ignore or to propagate palette data. In conclusion, this was just a very strange old mechnaism that has no real justification to exist anymore (although it may have been nice and useful in the past). Now it's an artifact that makes the API harder to use: API users who allocate their own pixel data have to be aware that they need to allocate the palette, or FFmpeg will crash on them in _some_ situations. On top of this, there was no API to allocate the pseuo palette outside of av_frame_get_buffer(). This patch not only deprecates AV_PIX_FMT_FLAG_PSEUDOPAL, but also makes the pseudo palette optional. Nothing accesses it anymore, though if it's set, it's propagated. It's still allocated and initialized for compatibility with API users that rely on this feature. But new API users do not need to allocate it. This was an explicit goal of this patch. Most changes replace AV_PIX_FMT_FLAG_PSEUDOPAL with FF_PSEUDOPAL. I first tried #ifdefing all code, but it was a mess. The FF_PSEUDOPAL macro reduces the mess, and still allows defining FF_API_PSEUDOPAL to 0. Passes FATE with FF_API_PSEUDOPAL enabled and disabled. In addition, FATE passes with FF_API_PSEUDOPAL set to 1, but with allocation functions manually changed to not allocating a palette.
* avutil/pixdesc: remove reference to avcodec_get_chroma_sub_sampleMartin Vignali2017-11-061-5/+0
| | | | | | Don't recommend to use deprecated functions. Signed-off-by: James Almer <jamrial@gmail.com>
* pixdesc: Add API to map color property names to enum valuesVittorio Giovara2017-09-211-0/+25
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* Add single precision planar RGB pixel formatsVittorio Giovara2017-08-151-0/+6
| | | | | | Add a pixel format flag to identify this family. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavu: add AV_PIX_FMT_FLAG_BAYERClément Bœsch2017-03-201-0/+5
|
* pixdesc: Order function prototypes semanticallyTimothy Gu2016-10-051-97/+97
|
* Merge commit '6695f178a5929eab91d3da7e9023999f1774bd0e'Derek Buitenhuis2016-02-161-3/+3
|\ | | | | | | | | | | | | * commit '6695f178a5929eab91d3da7e9023999f1774bd0e': pixdesc: Use AV_CEIL_RSHIFT in documentation Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * pixdesc: Use AV_CEIL_RSHIFT in documentationVittorio Giovara2016-01-251-3/+3
| |
* | Merge commit 'd336bfcf69fee159e9dba5e5e486ddb1aba61aab'Derek Buitenhuis2016-02-031-2/+2
|\ \ | |/ | | | | | | | | | | * commit 'd336bfcf69fee159e9dba5e5e486ddb1aba61aab': pixdesc: fix and extend doxy for av_pix_fmt_get_chroma_sub_sample() Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * pixdesc: fix and extend doxy for av_pix_fmt_get_chroma_sub_sample()Anton Khirnov2016-01-231-2/+2
| | | | | | | | The parameters in the docs are currently swapped.
* | Merge commit '7b02cb29d9d60cdd5ef321043d11d02023e7dc8f'Hendrik Leppkes2015-09-121-1/+2
|\ \ | |/ | | | | | | | | | | * commit '7b02cb29d9d60cdd5ef321043d11d02023e7dc8f': pixdesc: Document the component order Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * pixdesc: Document the component orderLuca Barbato2015-09-101-0/+7
| |
* | Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'Hendrik Leppkes2015-09-081-6/+18
|\ \ | |/ | | | | | | | | | | * commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba': lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fieldsVittorio Giovara2015-09-071-6/+17
| | | | | | | | | | | | The new fields can be accessed directly and are more intelligible. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '6b3ef7f080293956b2e5212b83135c6b051212e9'Hendrik Leppkes2015-09-081-5/+5
|\ \ | |/ | | | | | | | | | | * commit '6b3ef7f080293956b2e5212b83135c6b051212e9': lavu: Remove bit packing from AVComponentDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Remove bit packing from AVComponentDescriptorVittorio Giovara2015-09-071-5/+5
| | | | | | | | | | | | | | | | | | There is no practical benefit in having this structure elements bit packed given the size of the structure and its usage. Change types from uint16_t (packed) to plain int in order to simplify modifying the structure and accessing its fields. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'b8b5d8274471129f122858bc74ad09284dae6ab7'Hendrik Leppkes2015-09-081-1/+5
|\ \ | |/ | | | | | | | | | | * commit 'b8b5d8274471129f122858bc74ad09284dae6ab7': lavu: extend size of the AVPixFmtDescriptor.flags field Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: extend size of the AVPixFmtDescriptor.flags fieldwm42015-09-071-1/+5
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '2f8cbbc962dfc0dc1dd0a90b2cd6c21266380f51'Hendrik Leppkes2015-09-051-7/+0
|\ \ | |/ | | | | | | | | | | * commit '2f8cbbc962dfc0dc1dd0a90b2cd6c21266380f51': lavu: Drop deprecated external access to AVPixFmtDescriptor table Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Drop deprecated external access to AVPixFmtDescriptor tableVittorio Giovara2015-08-281-7/+0
| | | | | | | | Deprecated in 10/2012.
* | Merge commit '183db02a51a422568084b113a7571c845ca68622'Hendrik Leppkes2015-09-051-14/+0
|\ \ | |/ | | | | | | | | | | * commit '183db02a51a422568084b113a7571c845ca68622': lavu: Drop deprecated old_pix_fmt.h and related code Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Drop deprecated old_pix_fmt.h and related codeVittorio Giovara2015-08-281-14/+0
| | | | | | | | Deprecated in 10/2012.
* | pixelutils: indent comments in pixdesc.h to be clearerPeter Cordes2015-03-041-3/+3
| | | | | | | | Signed-off-by: Peter Cordes <peter@cordes.ca>
* | pixdesc: clarify AV_PIX_FMT_FLAG_ALPHA doxygenwm42015-02-101-1/+12
| | | | | | | | | | | | Also make clear that PAL8 can have alpha. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil: move internal function out of public headerwm42015-02-101-2/+0
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/pixdesc: rewrite AV_PIX_FMT_FLAG_PSEUDOPAL documentationMichael Niedermayer2015-01-241-3/+7
| | | | | | | | | | | | It seems many people do not understand its current documentation Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '5a419b2dd1881889d436f55741fd3ff3f9f436c4'Michael Niedermayer2014-10-081-0/+26
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit '5a419b2dd1881889d436f55741fd3ff3f9f436c4': pixdesc: return color properties names Conflicts: libavutil/pixdesc.c libavutil/pixdesc.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pixdesc: return color properties namesVittorio Giovara2014-10-081-0/+25
| |
* | Merge commit 'd2962e9f89cca6ff40f0c9d5ffc9c4397b8b1b26'Michael Niedermayer2014-08-041-0/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit 'd2962e9f89cca6ff40f0c9d5ffc9c4397b8b1b26': pixdesc: Support pixelformat aliases Conflicts: doc/APIchanges libavutil/pixdesc.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pixdesc: Support pixelformat aliasesLuca Barbato2014-08-041-0/+5
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'b2e059a1ffbdaaa985c6a7dcdd684fa034725238'Michael Niedermayer2014-08-011-16/+31
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'b2e059a1ffbdaaa985c6a7dcdd684fa034725238': pixdesc: K&R formatting cosmetics Conflicts: libavutil/pixdesc.c libavutil/pixdesc.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pixdesc: K&R formatting cosmeticsLuca Barbato2014-08-011-18/+31
| | | | | | | | | | | | Also change some comments to multiline. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | fix various typosLou Logan2014-06-031-1/+1
| | | | | | | | | | Signed-off-by: Lou Logan <lou@lrcd.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Move av_find_best_pix_fmt_of_2() from avcodec to avutilMichael Niedermayer2014-04-301-1/+49
| | | | | | | | | | | | | | | | | | This avoids a dependancy of libavfilter on libavcodec See Ticket 3592 Fixes Ticket2784 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '5ce04c14dd3dd3670cbdba82275a3a72c716ec6f'Michael Niedermayer2013-10-031-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '5ce04c14dd3dd3670cbdba82275a3a72c716ec6f': Use correct Doxygen syntax Conflicts: libavcodec/atrac3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Use correct Doxygen syntaxDiego Biurrun2013-10-031-1/+1
| |
* | Fix wrong use of "an" in some comments.Thilo Borgmann2013-08-121-1/+1
| |
* | Merge commit 'bf4b0ed1d5d323050a87c9f0ad1dd40860eb3da2'Michael Niedermayer2013-07-281-1/+3
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'bf4b0ed1d5d323050a87c9f0ad1dd40860eb3da2': Add missing deprecation attributes Conflicts: libavfilter/avfilter.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Add missing deprecation attributesDiego Biurrun2013-07-271-1/+3
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-05-151-9/+42
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_* Conflicts: doc/APIchanges libavcodec/avpicture.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/imgconvert.c libavcodec/tiffenc.c libavfilter/vf_pixdesctest.c libavfilter/vf_scale.c libavutil/imgutils.c libavutil/pixdesc.c libavutil/version.h libswscale/swscale_internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_*Anton Khirnov2013-05-151-9/+42
| |
* | Merge commit '096696ef0dd391d9430376d1444c1a3cde9171fd'Michael Niedermayer2013-05-151-1/+2
|\ \ | |/ | | | | | | | | | | | | * commit '096696ef0dd391d9430376d1444c1a3cde9171fd': avfiltergraph: simplify inserting conversion filters. Clarify output of av_get_bits_per_pixel Merged-by: Michael Niedermayer <michaelni@gmx.at>