summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegenc_common.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-03-10 13:51:18 +0100
committerNiklas Haas <git@haasn.dev>2022-04-11 17:29:57 +0200
commite254af31549ce6b4964936b3fe2124c3a18e69f8 (patch)
tree107d7bbd4f00af7b5f5732598fca7d270640eaee /libavcodec/mjpegenc_common.h
parent4a580975d4b978894d20dd443163cc8b6a2dbf2a (diff)
downloadffmpeg-e254af31549ce6b4964936b3fe2124c3a18e69f8.tar.gz
avcodec/mjpegenc: support writing ICC profiles
This is mostly straightforward. The major complication is that, as a result of the 16-bit chunk size limitation, ICC profiles may need to be split up into multiple chunks. We also need to make sure to allocate enough extra space in the packet to fit the ICC profile, so modify both mpegvideo_enc.c and ljpegenc.c to take into account this extra overhead, failing cleanly if necessary. Also add a FATE transcode test to ensure that the ICC profile gets written (and read) correctly. Note that this ICC profile is smaller than 64 kB, so this doesn't test the APP2 chunk re-arranging code at all. Signed-off-by: Niklas Haas <git@haasn.dev>
Diffstat (limited to 'libavcodec/mjpegenc_common.h')
-rw-r--r--libavcodec/mjpegenc_common.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mjpegenc_common.h b/libavcodec/mjpegenc_common.h
index ba7c4f93fa..5b13faae23 100644
--- a/libavcodec/mjpegenc_common.h
+++ b/libavcodec/mjpegenc_common.h
@@ -29,8 +29,10 @@
struct MJpegContext;
+int ff_mjpeg_add_icc_profile_size(AVCodecContext *avctx, const AVFrame *frame,
+ size_t *max_pkt_size);
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
- struct MJpegContext *m,
+ const AVFrame *frame, struct MJpegContext *m,
ScanTable *intra_scantable, int pred,
uint16_t luma_intra_matrix[64],
uint16_t chroma_intra_matrix[64],