summaryrefslogtreecommitdiff
path: root/libavutil/pixdesc.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-10-25 23:08:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-10-27 22:39:27 +0200
commit718044dc198710f9d6e70d94affd5f8a1a52430f (patch)
treec452760c911ea2ddc669f0cbc983253508472eda /libavutil/pixdesc.h
parenta5d98da4d6f3d0cd89d61af43e6377a9c9dd4cb2 (diff)
downloadffmpeg-718044dc198710f9d6e70d94affd5f8a1a52430f.tar.gz
avutil/pixdesc: Add av_write_image_line2(), av_read_image_line2()
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>
Diffstat (limited to 'libavutil/pixdesc.h')
-rw-r--r--libavutil/pixdesc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index 4f9c5a271f..c055810ae8 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -343,7 +343,13 @@ char *av_get_pix_fmt_string(char *buf, int buf_size,
* format writes the values corresponding to the palette
* component c in data[1] to dst, rather than the palette indexes in
* data[0]. The behavior is undefined if the format is not paletted.
+ * @param dst_element_size size of elements in dst array (2 or 4 byte)
*/
+void av_read_image_line2(void *dst, const uint8_t *data[4],
+ const int linesize[4], const AVPixFmtDescriptor *desc,
+ int x, int y, int c, int w, int read_pal_component,
+ int dst_element_size);
+
void av_read_image_line(uint16_t *dst, const uint8_t *data[4],
const int linesize[4], const AVPixFmtDescriptor *desc,
int x, int y, int c, int w, int read_pal_component);
@@ -361,7 +367,12 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4],
* @param y the vertical coordinate of the first pixel to write
* @param w the width of the line to write, that is the number of
* values to write to the image line
+ * @param src_element_size size of elements in src array (2 or 4 byte)
*/
+void av_write_image_line2(const void *src, uint8_t *data[4],
+ const int linesize[4], const AVPixFmtDescriptor *desc,
+ int x, int y, int c, int w, int src_element_size);
+
void av_write_image_line(const uint16_t *src, uint8_t *data[4],
const int linesize[4], const AVPixFmtDescriptor *desc,
int x, int y, int c, int w);