Michael Niedermayer
c9ad2e9aa3
imgconvert: remove avg_bits_per_pixel(), its redundant
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6ff544e473
imgconvert: fix color type for non normal pix_fmts like HW stuff and unused entries.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6adf97fe00
avcodec_get_pix_fmt_loss: remove PixFmtInfo use
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
fc04c99dea
imgconvert: print color type too
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
f6c4395374
imgconvert: remove PixFmtInfo use from avg_bits_per_pixel()
...
This fixes several inconsistencies with YUV >8bit formats caused
due to missing information in the PixFmtInfo table.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0880f26bbe
avcodec_find_best_pix_fmt_of_2: favor formats with fewer components if it does not incur a loss.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ad9333d5ef
imgconvert-test: add avg bits per pixel
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0efa240f2b
is_yuv_planar: remove use of PixFmtInfo
...
This fixes the behavior for a few yuva 16bit formats
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
be19e7e373
imgconvert: add self test code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
ae3822bca1
imgconvert: remove PixFmtInfo
...
It is pleonastic and was used in stale functions pending replacement.
12 years ago
Luca Barbato
d1d9efaae6
avcodec: split avpicture from imgconvert
...
All the non deprecated functions are in avpicture.c now.
12 years ago
Michael Niedermayer
d4e74d5d6d
Remove deprecation of avcodec_get_chroma_sub_sample.
...
Add explanations what the difference between the 2 functions are and
when either should be used.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
cc085993f4
avcodec: remove ff_is_hwaccel_pix_fmt
...
It is used only in one place and is unlikely it would be needed
elsewhere.
12 years ago
Michael Niedermayer
0e4d34e087
pix_fmt_info: add 9/10 bit YUVA formats
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
b90d7840df
lavc: const correctness for avpicture_fill()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
8cda27b753
avcodec_find_best_pix_fmt_of_2: fix handling or PIX_FMT_NONE
...
Fixes CID733775
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
50ba57e0ce
lavc: do not use av_pix_fmt_descriptors directly.
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Diego Biurrun
0ae3ba8daa
avcodec: Drop long-deprecated imgconvert.h header
12 years ago
Michael Niedermayer
9afd55922a
imgconvert: silence some const incompatible pointer warnings.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
dfb4757bbe
lavc: support building with the forks ABI for avcodec_find_best_pix_fmt2()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
2a54ae9df8
imgconvert: add avcodec_find_best_pix_fmt_of_2()
...
and deprecate avcodec_find_best_pix_fmt2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
17337f54c0
x86: Split inline and external assembly #ifdefs
12 years ago
Martin Storsjö
1d9c2dc89a
Don't include common.h from avutil.h
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
72743aef03
imgconvert: Implement avcodec_find_best_pix_fmt_of_list()
...
The old avcodec_find_best_pix_fmt() was insufficient due to 64 pix_fmt limit.
In ffmpeg this problem has been solved long ago through avcodec_find_best_pix_fmt2()
Today libav has added a incompatible modified version of avcodec_find_best_pix_fmt2()
under the same name, thus again breaking ABI/API ...
The avcodec_find_best_pix_fmt_of_list() added in this commit here makes the libav
API available to ffmpeg users too.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
31a192f387
imgconvert: favor pixel formats without resolution loss
...
Fixes Ticket1517
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Janne Grunau
f30260d32a
imgconvert: deprecate avcodec_find_best_pix_fmt()
13 years ago
Janne Grunau
ac29054fda
imgconvert: add avcodec_find_best_pix_fmt2()
...
The number of pixel formats outgrew the number of available bits in
the bitmask used in avcodec_find_best_pix_fmt().
avcodec_find_best_pix_fmt2() uses a PIX_FMT_NONE terminated list
of pixel formats instead.
13 years ago
Janne Grunau
39bb27bf79
imgconvert: avoid undefined left shift in avcodec_find_best_pix_fmt
...
CC: libav-stable@libav.org
13 years ago
Michael Niedermayer
4251a0b84c
imgconvert: add planar RGB formats to pix_fmt_info
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
6ca8ef5189
imgconvert: add yuv 9,10,12,14 bit planar YUV formats to pix_fmt_info
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Stefano Sabatini
e6674e46ec
lavu/imgutils: create misc functions for dealing with buffers
...
Move the lavc/imgconvert functions and rename them as follows:
avpicture_get_size -> av_image_get_buffer_size()
avpicture_fill -> av_image_fill_arrays()
avpicture_layout -> av_image_copy_to_buffer()
The new functions have an align parameter, which allows to define the
linesize alignment assumed in the buffer (which is set or read).
The names of the functions are consistent with the lavu/samples API
(av_samples_get_buffer_size(), av_samples_fill_arrays()).
13 years ago
Stefano Sabatini
18b4404dc3
lavc/imgconvert: fix check on av_image_check_size() return code in avpicture_get_size()
...
The documentation states that av_image_check_size() will return a
negative value in case of error, while the check is done on ret != 0.
Also return a proper error code rather than -1 in case the check fails.
13 years ago
Stefano Sabatini
0b2ecf8224
lavc/imgconvert: remove pointless switch block from avpicture_fill()
13 years ago
Carl Eugen Hoyos
143a5c55ff
Add yuva422p pix_fmt.
13 years ago
Michael Niedermayer
84cd3729ef
imgconvert: fix regression with fate-gif colorspaces.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
2ec8789eb8
avpicture_layout: use a endian independant format for the palette.
...
This should fix the failing fate PAL8 tests.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Stefano Sabatini
1a3d4b88a4
imgconvert: add macro pixdesc_has_alpha for checking if a pixel format has an alpha component
...
Reduce redundancy and simplify.
13 years ago
Anton Khirnov
38d5533228
pixdesc: mark pseudopaletted formats with a special flag.
...
This makes it possible to dintinguish them from PAL8.
Fixes an invalid write in avpicture_layout().
13 years ago
Carl Eugen Hoyos
6838df0488
Add pix_fmt_info for yuva444.
...
Reviewed-by: Paul B Mahol
13 years ago
Alex Converse
7181c4edee
cosmetics: Remove extra newlines at EOF
13 years ago
Anton Khirnov
8b9b6041d7
lavc: remove disabled FF_API_GET_ALPHA_INFO cruft.
13 years ago
Anton Khirnov
8e5746d461
lavc: remove disabled FF_API_GET_PIX_FMT_NAME cruft.
13 years ago
Michael Niedermayer
e9a6152e17
lavc: fix FF_LOSS_COLORQUANT detection for gray8a->pal8
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Carl Eugen Hoyos
dc2f652ae4
Fix pix_fmt_info for yuva420.
...
This allows correct output pix_fmt auto-selection
if the input pix_fmt is yuva420.
Fixes ticket #290 .
13 years ago
Michael Niedermayer
d9816cd5df
imgconvert: add PIX_FMT_GRAY8A to pix_fmt_info
...
Fixes selecting gray8a for PAM
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Diego Biurrun
44b0edda3f
Drop some pointless void* return value casts from av_malloc() invocations.
13 years ago
Anton Khirnov
586657c20a
lavc: deprecate img_get_alpha_info().
...
It's never been touched or used in any way since it was added in 2003
and only works for PIX_FMT_PAL8, which makes me conclude that nobody's
ever used it.
13 years ago
Matthew Einhorn
e662b263d9
Fixes avpicture_layout to not write past buffer end.
...
avpicture_get_size() returns the size of buffer required for avpicture_layout.
For pseudo-paletted formats (gray8...) this size does not include the palette.
However, avpicture_layout doesn't know this and still writes the palette. Consequently,
avpicture_layout writes passed the length of the buffer. This fixes it
by fixing avpicture_layout so that it doesn't write the palette for these formats.
Signed-off-by: Matthew Einhorn <moiein2000@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Jean First
9569a3c9f4
Add new pix_fmt RGBA64
13 years ago